kwikid-forms 0.6.43 → 0.6.45

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.
Files changed (59) hide show
  1. package/bundles/kwikid-forms.umd.js +1020 -835
  2. package/bundles/kwikid-forms.umd.js.map +1 -1
  3. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.component.js +22 -32
  4. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.definitions.js +2 -1
  5. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.helper.js +2 -4
  6. package/esm2015/lib/builder/builder-form-editor/builder.form-editor.constants.js +5 -5
  7. package/esm2015/lib/builder/builder-form-editor/builder.form-editor.service.js +6 -5
  8. package/esm2015/lib/builder/builder-form-list/builder-forms-list.component.js +4 -6
  9. package/esm2015/lib/builder/builder.component.js +43 -53
  10. package/esm2015/lib/builder/builder.helper.js +11 -13
  11. package/esm2015/lib/renderer/config-converter/config-converter.constants.js +22 -7
  12. package/esm2015/lib/renderer/config-converter/config-converter.helper.js +9 -10
  13. package/esm2015/lib/renderer/config-converter/config-converter.js +61 -37
  14. package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +1 -1
  15. package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +1 -1
  16. package/esm2015/lib/renderer/form-view/definitions/form-view.commons.definition.js +2 -1
  17. package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +2 -1
  18. package/esm2015/lib/renderer/form-view/definitions/form-view.logs.definition.js +2 -1
  19. package/esm2015/lib/renderer/form-view/form-view.api.service.js +25 -24
  20. package/esm2015/lib/renderer/form-view/form-view.component.js +456 -292
  21. package/esm2015/lib/renderer/form-view/form-view.constants.js +17 -0
  22. package/esm2015/lib/renderer/form-view/form-view.module.js +15 -3
  23. package/esm2015/lib/renderer/form-view/form-view.service.js +6 -7
  24. package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +44 -58
  25. package/esm2015/lib/renderer/form-view/helpers/form-view.camera.helper.js +16 -20
  26. package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +36 -97
  27. package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +95 -92
  28. package/esm2015/lib/renderer/form-view/helpers/form-view.form-validations.helper.js +23 -22
  29. package/esm2015/lib/renderer/form-view/helpers/form-view.tasks.helper.js +5 -5
  30. package/esm2015/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.js +34 -0
  31. package/esm2015/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.js +30 -0
  32. package/esm2015/lib/renderer/forms-list/forms-list.component.js +31 -39
  33. package/esm2015/lib/renderer/forms-list/forms-list.definitions.js +2 -1
  34. package/esm2015/lib/renderer/renderer.actions.definitions.js +1 -1
  35. package/esm2015/lib/renderer/renderer.component.js +87 -113
  36. package/esm2015/lib/renderer/renderer.definitions.js +2 -1
  37. package/esm2015/lib/renderer/renderer.helper.js +2 -4
  38. package/fesm2015/kwikid-forms.js +1063 -922
  39. package/fesm2015/kwikid-forms.js.map +1 -1
  40. package/lib/builder/builder-form-editor/builder-form-editor.component.d.ts +4 -5
  41. package/lib/builder/builder-form-editor/builder.form-editor.service.d.ts +0 -1
  42. package/lib/builder/builder-form-list/builder-forms-list.component.d.ts +3 -5
  43. package/lib/renderer/config-converter/config-converter.constants.d.ts +21 -6
  44. package/lib/renderer/config-converter/config-converter.helper.d.ts +1 -0
  45. package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +45 -25
  46. package/lib/renderer/form-view/form-view.api.service.d.ts +0 -1
  47. package/lib/renderer/form-view/form-view.component.d.ts +13 -13
  48. package/lib/renderer/form-view/form-view.constants.d.ts +16 -0
  49. package/lib/renderer/form-view/form-view.module.d.ts +10 -8
  50. package/lib/renderer/form-view/form-view.service.d.ts +1 -2
  51. package/lib/renderer/form-view/helpers/form-view.camera.helper.d.ts +5 -7
  52. package/lib/renderer/form-view/helpers/form-view.defaults.helper.d.ts +4 -6
  53. package/lib/renderer/form-view/helpers/form-view.fields.helper.d.ts +1 -1
  54. package/lib/renderer/form-view/helpers/form-view.form-validations.helper.d.ts +1 -2
  55. package/lib/renderer/form-view/helpers/form-view.tasks.helper.d.ts +1 -1
  56. package/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.d.ts +7 -0
  57. package/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.d.ts +7 -0
  58. package/lib/renderer/forms-list/forms-list.component.d.ts +1 -2
  59. package/package.json +1 -1
@@ -518,19 +518,19 @@
518
518
  if (kwikidToolkit.checkObjectKeyExists(form, "formContent")) {
519
519
  if (kwikidToolkit.checkObjectKeyExists(form.formContent, "url")) {
520
520
  form = kwikidToolkit.setValueToObjectPath(form, "props.url", form.formContent.url);
521
- delete form["formContent"]["url"];
521
+ delete form.formContent.url;
522
522
  }
523
523
  if (kwikidToolkit.checkObjectKeyExists(form.formContent, "path")) {
524
524
  form = kwikidToolkit.setValueToObjectPath(form, "props.path", form.formContent.path);
525
- delete form["formContent"]["path"];
525
+ delete form.formContent.path;
526
526
  }
527
527
  }
528
528
  if (kwikidToolkit.isEmptyValue(form.formContent)) {
529
- delete form["formContent"];
529
+ delete form.formContent;
530
530
  }
531
531
  if (kwikidToolkit.checkObjectKeyExists(form, "title")) {
532
532
  form = kwikidToolkit.setValueToObjectPath(form, "props.title", form.title);
533
- delete form["title"];
533
+ delete form.title;
534
534
  }
535
535
  if (!kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
536
536
  form.hidden = false;
@@ -556,18 +556,16 @@
556
556
  htmlContent: form.htmlContent
557
557
  };
558
558
  }
559
- delete form["htmlContent"];
559
+ delete form.htmlContent;
560
560
  }
561
- else {
562
- if (!kwikidToolkit.checkObjectKeyExists(form, "props")) {
563
- form.props = {
564
- htmlContent: ""
565
- };
566
- }
561
+ else if (!kwikidToolkit.checkObjectKeyExists(form, "props")) {
562
+ form.props = {
563
+ htmlContent: ""
564
+ };
567
565
  }
568
566
  if (kwikidToolkit.checkObjectKeyExists(form, "title")) {
569
567
  form = kwikidToolkit.setValueToObjectPath(form, "props.title", form.title);
570
- delete form["title"];
568
+ delete form.title;
571
569
  }
572
570
  if (!kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
573
571
  form.hidden = false;
@@ -602,10 +600,9 @@
602
600
  title: new i3.FormControl("", i3.Validators.required)
603
601
  });
604
602
  }
605
- KwikIDBuilderFormsListComponent.prototype.setSelectedForm = function (selected_form) {
606
- this.selectedForm = selected_form;
603
+ KwikIDBuilderFormsListComponent.prototype.setSelectedForm = function (selectedForm) {
604
+ this.selectedForm = selectedForm;
607
605
  };
608
- KwikIDBuilderFormsListComponent.prototype.ngOnInit = function () { };
609
606
  KwikIDBuilderFormsListComponent.prototype.ngOnChanges = function (changes) {
610
607
  var verifyChange = function (key) {
611
608
  return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
@@ -626,7 +623,6 @@
626
623
  KwikIDBuilderFormsListComponent.prototype.handleOnClickAddForm = function () {
627
624
  if (this.addForm.invalid) {
628
625
  alert("Please fill all the fields");
629
- return;
630
626
  }
631
627
  else {
632
628
  if (kwikidToolkit.isEmptyValue(this.activeFormConfig)) {
@@ -669,7 +665,7 @@
669
665
  templateUrl: "./builder-forms-list.component.html",
670
666
  styleUrls: ["../shared.scss", "./builder-forms-list.component.scss"]
671
667
  }]
672
- }], ctorParameters: function () { return []; }, propDecorators: { activeFormConfig: [{
668
+ }], propDecorators: { activeFormConfig: [{
673
669
  type: i0.Input
674
670
  }], formsList: [{
675
671
  type: i0.Input
@@ -708,6 +704,7 @@
708
704
  EFieldType["RECORD"] = "record";
709
705
  EFieldType["STAR_RATING"] = "star-rating";
710
706
  EFieldType["LIVE_LOCATION"] = "live-location";
707
+ EFieldType["DATA_HOLDER"] = "data-holder";
711
708
  EFieldType["CURRENCY"] = "currency";
712
709
  })(EFieldType || (EFieldType = {}));
713
710
 
@@ -856,14 +853,31 @@
856
853
  uploadFileToServer: true
857
854
  },
858
855
  capture: {
859
- containerStyles: "",
860
856
  buttonText: "Camera",
857
+ containerStyles: "",
861
858
  icon: "tuiIconCameraLarge",
862
- showMediaFiles: true,
863
- uploadFileToServer: false,
864
859
  isCroppedImage: false,
865
860
  isMaskedImage: false,
866
- watermarkDataSources: [],
861
+ showMediaFiles: true,
862
+ uploadFileToServer: false,
863
+ features: {
864
+ ocr: {
865
+ isEnabled: false,
866
+ documentType: "",
867
+ documentSide: "",
868
+ isOcrFromServer: false
869
+ },
870
+ facematch: {
871
+ isEnabled: false,
872
+ isFacematchFromServer: false,
873
+ sources: []
874
+ },
875
+ watermark: {
876
+ isEnabled: false,
877
+ isWatermarkFromServer: false,
878
+ sources: []
879
+ }
880
+ },
867
881
  cameraConfig: {
868
882
  header: {
869
883
  title: "Camera",
@@ -878,8 +892,6 @@
878
892
  },
879
893
  others: {
880
894
  isFrontCamera: false,
881
- isWatermark: false,
882
- isWatermarkForImageUpload: false,
883
895
  flipHorizontal: false,
884
896
  mask: {
885
897
  shape: ""
@@ -958,16 +970,10 @@
958
970
  };
959
971
 
960
972
  var getFormFieldByKey = function (fields, key) {
961
- var field = fields.find(function (field) {
962
- if (field.key === key) {
963
- return field;
964
- }
965
- });
966
- return field;
973
+ return fields.find(function (field) { return field.key === key; });
967
974
  };
968
975
  var getFormFieldIndexByKey = function (fields, key) {
969
- var fieldIndex;
970
- fieldIndex = fields.findIndex(function (_) {
976
+ var fieldIndex = fields.findIndex(function (_) {
971
977
  return key === _.key;
972
978
  });
973
979
  return fieldIndex;
@@ -993,17 +999,17 @@
993
999
  fieldMessage.message === message.message);
994
1000
  });
995
1001
  };
996
- field["messages"] = [];
1002
+ field.messages = [];
997
1003
  if (kwikidToolkit.checkObjectKeyExists(field, "messages")) {
998
- if (!hasDuplicateMessage(field["messages"], message)) {
999
- field["messages"].push({
1004
+ if (!hasDuplicateMessage(field.messages, message)) {
1005
+ field.messages.push({
1000
1006
  type: message.type,
1001
1007
  message: message.message
1002
1008
  });
1003
1009
  }
1004
1010
  }
1005
1011
  else {
1006
- field["messages"] = [{ type: message.type, message: message.message }];
1012
+ field.messages = [{ type: message.type, message: message.message }];
1007
1013
  }
1008
1014
  return field;
1009
1015
  };
@@ -1030,19 +1036,19 @@
1030
1036
  };
1031
1037
  var removeFormFieldMessage = function (field, message) {
1032
1038
  if (kwikidToolkit.isNotEmptyValue(field === null || field === void 0 ? void 0 : field.messages)) {
1033
- field["messages"] = field["messages"].filter(function (fieldMessage) {
1039
+ field.messages = field.messages.filter(function (fieldMessage) {
1034
1040
  return fieldMessage.type !== message.type;
1035
1041
  });
1036
1042
  }
1037
1043
  else {
1038
- field["messages"] = [];
1044
+ field.messages = [];
1039
1045
  }
1040
1046
  return field;
1041
1047
  };
1042
1048
  var setApiTimerMessage = function (field, timer) {
1043
1049
  if (timer === void 0) { timer = {}; }
1044
1050
  if (kwikidToolkit.checkObjectKeyExists(field, "api")) {
1045
- field["api"]["timer"] = timer;
1051
+ field.api.timer = timer;
1046
1052
  }
1047
1053
  else {
1048
1054
  kwikidToolkit.setMissingKeyValue(field, "api", { timer: timer });
@@ -1102,7 +1108,7 @@
1102
1108
  fields[fieldIndex] = setErrorMessages(fields[fieldIndex], errors);
1103
1109
  }
1104
1110
  else {
1105
- fields[fieldIndex]["messages"] = [];
1111
+ fields[fieldIndex].messages = [];
1106
1112
  }
1107
1113
  fields[fieldIndex] = highlightFormFieldError(fields[fieldIndex], error);
1108
1114
  return fields;
@@ -1117,14 +1123,17 @@
1117
1123
  };
1118
1124
  var convertFormFieldTypeTimeToKwikUIFormat = function (time) {
1119
1125
  var timeParts = time.split(/[.:]/);
1120
- var hours = 0, minutes = 0, seconds = 0, milliseconds = 0;
1126
+ var hours = 0;
1127
+ var minutes = 0;
1128
+ var seconds = 0;
1129
+ var milliseconds = 0;
1121
1130
  if (timeParts.length >= 2) {
1122
- hours = parseInt(timeParts[0]);
1123
- minutes = parseInt(timeParts[1]);
1131
+ hours = parseInt(timeParts[0], 10);
1132
+ minutes = parseInt(timeParts[1], 10);
1124
1133
  if (timeParts.length >= 3) {
1125
- seconds = parseInt(timeParts[2]);
1134
+ seconds = parseInt(timeParts[2], 10);
1126
1135
  if (timeParts.length === 4) {
1127
- milliseconds = parseInt(timeParts[3]);
1136
+ milliseconds = parseInt(timeParts[3], 10);
1128
1137
  }
1129
1138
  }
1130
1139
  }
@@ -1132,22 +1141,17 @@
1132
1141
  return tuiTime;
1133
1142
  };
1134
1143
  var convertFormFieldTypeDateToStandardFormat = function (date) {
1135
- var formattedDate;
1136
- var year = date.year;
1137
- var month = date.month;
1138
- var day = date.day;
1139
- formattedDate = day.toString().padStart(2, "0") + "-" + (month + 1)
1144
+ var day = date.day, month = date.month, year = date.year;
1145
+ var formattedDate = day.toString().padStart(2, "0") + "-" + (month + 1)
1140
1146
  .toString()
1141
1147
  .padStart(2, "0") + "-" + year;
1142
1148
  return formattedDate;
1143
1149
  };
1144
1150
  var convertFormFieldTypeTimeToStandardFormat = function (time) {
1145
- var formattedDate;
1146
1151
  var hour = time.hours;
1147
- var minutes = time.minutes;
1148
- var seconds = time.seconds;
1152
+ var seconds = time.seconds, minutes = time.minutes;
1149
1153
  var milliseconds = time.ms;
1150
- formattedDate = hour.toString().padStart(2, "0") + ":" + minutes
1154
+ var formattedDate = hour.toString().padStart(2, "0") + ":" + minutes
1151
1155
  .toString()
1152
1156
  .padStart(2, "0") + (seconds > 0 ? ":" + seconds.toString().padStart(2, "0") : "") + (seconds > 0 && milliseconds > 0
1153
1157
  ? ":" + milliseconds.toString().padStart(2, "0")
@@ -1173,16 +1177,15 @@
1173
1177
  break;
1174
1178
  case EFieldType.SELECT:
1175
1179
  if (Array.isArray(field.options)) {
1176
- field.options.find(function (item) {
1177
- if (kwikidToolkit.isObject(item)) {
1178
- if (item.title == value) {
1179
- convertedValue = item.value;
1180
- }
1181
- }
1180
+ var foundItem = field.options.find(function (item) {
1181
+ return kwikidToolkit.isObject(item) && item.title === value;
1182
1182
  });
1183
+ if (foundItem) {
1184
+ convertedValue = foundItem.value;
1185
+ }
1183
1186
  }
1184
1187
  break;
1185
- case EFieldType.PHONE:
1188
+ case EFieldType.PHONE: {
1186
1189
  var phoneField = field;
1187
1190
  if (phoneField.properties.removeCountryCodeFromValue) {
1188
1191
  convertedValue = value
@@ -1190,6 +1193,7 @@
1190
1193
  .replace(phoneField.properties.countryCode, "");
1191
1194
  }
1192
1195
  break;
1196
+ }
1193
1197
  case EFieldType.CAPTURE:
1194
1198
  if (Array.isArray(value) && kwikidToolkit.isNotEmptyValue(value[0])) {
1195
1199
  convertedValue = value[0];
@@ -1217,6 +1221,40 @@
1217
1221
  }
1218
1222
  return convertedValue;
1219
1223
  };
1224
+ var convertFormFieldEmptyValueToKwikUIFormat = function (field) {
1225
+ var fieldType = field.type;
1226
+ var value;
1227
+ switch (fieldType) {
1228
+ case EFieldType.CHECKBOX:
1229
+ value = false;
1230
+ break;
1231
+ case EFieldType.NUMBER:
1232
+ value = null;
1233
+ break;
1234
+ case EFieldType.DATE:
1235
+ value = null;
1236
+ break;
1237
+ case EFieldType.FILE:
1238
+ value = [];
1239
+ break;
1240
+ case EFieldType.CAPTURE:
1241
+ value = [];
1242
+ break;
1243
+ case EFieldType.RECORD:
1244
+ value = [];
1245
+ break;
1246
+ case EFieldType.SELECT:
1247
+ value = null;
1248
+ break;
1249
+ case EFieldType.DROPDOWN_WITH_SEARCH:
1250
+ value = null;
1251
+ break;
1252
+ default:
1253
+ value = "";
1254
+ break;
1255
+ }
1256
+ return value;
1257
+ };
1220
1258
  var convertFormFieldValueToKwikUIFormat = function (field, value) {
1221
1259
  var convertedValue = value;
1222
1260
  if (kwikidToolkit.isNotEmptyValue(value)) {
@@ -1232,13 +1270,12 @@
1232
1270
  break;
1233
1271
  case EFieldType.SELECT:
1234
1272
  if (Array.isArray(field.options)) {
1235
- field.options.find(function (item) {
1236
- if (kwikidToolkit.isObject(item)) {
1237
- if (item.value == value) {
1238
- convertedValue = item.title;
1239
- }
1240
- }
1273
+ var foundItem = field.options.find(function (item) {
1274
+ return kwikidToolkit.isObject(item) && item.value === value;
1241
1275
  });
1276
+ if (foundItem) {
1277
+ convertedValue = foundItem.title;
1278
+ }
1242
1279
  }
1243
1280
  break;
1244
1281
  case EFieldType.DATE:
@@ -1251,25 +1288,37 @@
1251
1288
  convertedValue = value;
1252
1289
  break;
1253
1290
  case EFieldType.CAPTURE:
1254
- if (typeof value === "string") {
1291
+ if (Array.isArray(value)) {
1292
+ convertedValue = value.filter(function (item) {
1293
+ return (typeof item === "string" ||
1294
+ (kwikidToolkit.isObject(item) && kwikidToolkit.checkObjectKeyExists(item, "image")));
1295
+ });
1296
+ }
1297
+ else if (typeof value === "string") {
1255
1298
  convertedValue = [value];
1256
1299
  }
1257
- else if (!Array.isArray(value)) {
1258
- convertedValue = [];
1300
+ else if (kwikidToolkit.isObject(value) && kwikidToolkit.checkObjectKeyExists(value, "image")) {
1301
+ convertedValue = [value];
1259
1302
  }
1260
1303
  else {
1261
- convertedValue = value;
1304
+ convertedValue = [];
1262
1305
  }
1263
1306
  break;
1264
1307
  case EFieldType.RECORD:
1265
- if (typeof value === "string") {
1308
+ if (Array.isArray(value)) {
1309
+ convertedValue = value.filter(function (item) {
1310
+ return (typeof item === "string" ||
1311
+ (kwikidToolkit.isObject(item) && kwikidToolkit.checkObjectKeyExists(item, "video")));
1312
+ });
1313
+ }
1314
+ else if (typeof value === "string") {
1266
1315
  convertedValue = [value];
1267
1316
  }
1268
- else if (!Array.isArray(value)) {
1269
- convertedValue = [];
1317
+ else if (kwikidToolkit.isObject(value) && kwikidToolkit.checkObjectKeyExists(value, "video")) {
1318
+ convertedValue = [value];
1270
1319
  }
1271
1320
  else {
1272
- convertedValue = value;
1321
+ convertedValue = [];
1273
1322
  }
1274
1323
  break;
1275
1324
  default:
@@ -1281,40 +1330,6 @@
1281
1330
  }
1282
1331
  return convertedValue;
1283
1332
  };
1284
- var convertFormFieldEmptyValueToKwikUIFormat = function (field) {
1285
- var fieldType = field.type;
1286
- var value;
1287
- switch (fieldType) {
1288
- case EFieldType.CHECKBOX:
1289
- value = false;
1290
- break;
1291
- case EFieldType.NUMBER:
1292
- value = null;
1293
- break;
1294
- case EFieldType.DATE:
1295
- value = null;
1296
- break;
1297
- case EFieldType.FILE:
1298
- value = [];
1299
- break;
1300
- case EFieldType.CAPTURE:
1301
- value = [];
1302
- break;
1303
- case EFieldType.RECORD:
1304
- value = [];
1305
- break;
1306
- case EFieldType.SELECT:
1307
- value = null;
1308
- break;
1309
- case EFieldType.DROPDOWN_WITH_SEARCH:
1310
- value = null;
1311
- break;
1312
- default:
1313
- value = "";
1314
- break;
1315
- }
1316
- return value;
1317
- };
1318
1333
 
1319
1334
  var getFormFields = function (formConfig) {
1320
1335
  var fields = [];
@@ -1339,6 +1354,9 @@
1339
1354
  var setFieldKeyHidden = function (field) {
1340
1355
  return setMissingFieldKeyValue(field, "hidden", false);
1341
1356
  };
1357
+ var setFieldKeyDisabled = function (field) {
1358
+ return setMissingFieldKeyValue(field, "disabled", true);
1359
+ };
1342
1360
  var setFieldAsFormElement = function (field, value) {
1343
1361
  return setFieldKeyValue(field, "isFormElement", value);
1344
1362
  };
@@ -1348,11 +1366,9 @@
1348
1366
  * This is to handler old version of config.
1349
1367
  * Please don't add "min" at field level, add it insider field.properties only.
1350
1368
  */
1351
- return convertFormFieldTypeDateToKwikUIFormat(field["min"]);
1352
- }
1353
- else {
1354
- return {};
1369
+ return convertFormFieldTypeDateToKwikUIFormat(field.min);
1355
1370
  }
1371
+ return {};
1356
1372
  };
1357
1373
  var getMaxDate = function (field) {
1358
1374
  if (kwikidToolkit.checkObjectKeyExists(field, "max")) {
@@ -1360,11 +1376,9 @@
1360
1376
  * This is to handler old version of config.
1361
1377
  * Please don't add "max" at field level, add it insider field.properties only.
1362
1378
  */
1363
- return convertFormFieldTypeDateToKwikUIFormat(field["max"]);
1364
- }
1365
- else {
1366
- return {};
1379
+ return convertFormFieldTypeDateToKwikUIFormat(field.max);
1367
1380
  }
1381
+ return {};
1368
1382
  };
1369
1383
  var updateLanguage = function (object, language) {
1370
1384
  if (kwikidToolkit.isObject(object)) {
@@ -1372,7 +1386,7 @@
1372
1386
  object = object[language];
1373
1387
  }
1374
1388
  else {
1375
- object = object["en"];
1389
+ object = object.en;
1376
1390
  }
1377
1391
  }
1378
1392
  return object;
@@ -1461,7 +1475,7 @@
1461
1475
  return formConfig;
1462
1476
  };
1463
1477
  Converter.prototype.convertFormConfig = function (formConfig) {
1464
- var e_1, _f;
1478
+ var e_1, _l;
1465
1479
  var formatOnFieldType = function (field) {
1466
1480
  var updateFormFieldProperties = function (field) {
1467
1481
  if (kwikidToolkit.checkObjectKeyExists(FIELD_PROPERTIES, field.type)) {
@@ -1576,20 +1590,18 @@
1576
1590
  if (typeof x === "string" || typeof x === "number") {
1577
1591
  return { label: x, disabled: false, description: "" };
1578
1592
  }
1579
- else {
1580
- if (kwikidToolkit.checkObjectKeyExists(x, "label") &&
1581
- kwikidToolkit.checkObjectKeyExists(x, "disabled") &&
1582
- kwikidToolkit.checkObjectKeyExists(x, "description")) {
1583
- return x;
1584
- }
1585
- if (!kwikidToolkit.checkObjectKeyExists(x, "disabled")) {
1586
- x = Object.assign(Object.assign({}, x), { disabled: false });
1587
- }
1588
- if (!kwikidToolkit.checkObjectKeyExists(x, "description")) {
1589
- x = Object.assign(Object.assign({}, x), { description: false });
1590
- }
1593
+ if (kwikidToolkit.checkObjectKeyExists(x, "label") &&
1594
+ kwikidToolkit.checkObjectKeyExists(x, "disabled") &&
1595
+ kwikidToolkit.checkObjectKeyExists(x, "description")) {
1591
1596
  return x;
1592
1597
  }
1598
+ if (!kwikidToolkit.checkObjectKeyExists(x, "disabled")) {
1599
+ x = Object.assign(Object.assign({}, x), { disabled: false });
1600
+ }
1601
+ if (!kwikidToolkit.checkObjectKeyExists(x, "description")) {
1602
+ x = Object.assign(Object.assign({}, x), { description: false });
1603
+ }
1604
+ return x;
1593
1605
  });
1594
1606
  return field;
1595
1607
  };
@@ -1676,6 +1688,13 @@
1676
1688
  }
1677
1689
  return field;
1678
1690
  };
1691
+ var formatFieldTypeDataHolder = function (field) {
1692
+ field = setFieldKeyHidden(field);
1693
+ field = setFieldKeyDisabled(field);
1694
+ field = setFieldAsFormElement(field, true);
1695
+ field = updateFormFieldProperties(field);
1696
+ return field;
1697
+ };
1679
1698
  var formatFieldTypeOtp = function (field) {
1680
1699
  var _a, _b;
1681
1700
  field = setFieldKeyHidden(field);
@@ -1700,9 +1719,22 @@
1700
1719
  return field;
1701
1720
  };
1702
1721
  var formatFieldTypeCapture = function (field) {
1722
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1703
1723
  field = setFieldKeyHidden(field);
1704
1724
  field = setFieldAsFormElement(field, true);
1705
1725
  field = updateFormFieldProperties(field);
1726
+ field.properties = kwikidToolkit.getObjectDeepCopy(Object.assign(Object.assign({}, field.properties), { features: Object.assign(Object.assign({}, field.properties.features), { watermark: {
1727
+ isEnabled: (_d = (_c = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) === null || _b === void 0 ? void 0 : _b.others) === null || _c === void 0 ? void 0 : _c.isWatermark) !== null && _d !== void 0 ? _d : field.properties.features.watermark.isWatermark,
1728
+ isWatermarkFromServer: (_h = (_g = (_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.cameraConfig) === null || _f === void 0 ? void 0 : _f.others) === null || _g === void 0 ? void 0 : _g.isWatermarkFromServer) !== null && _h !== void 0 ? _h : field.properties.features.watermark.isWatermarkFromServer,
1729
+ sources: (_k = (_j = field === null || field === void 0 ? void 0 : field.properties) === null || _j === void 0 ? void 0 : _j.watermarkDataSources) !== null && _k !== void 0 ? _k : field.properties.features.watermark.sources
1730
+ } }) }));
1731
+ delete field.properties.watermarkDataSources;
1732
+ /**
1733
+ * Current commented because in kwikid-camera new config structure is not handled
1734
+ * Will uncomment once handled here and modify the structure a little bit here as well.
1735
+ */
1736
+ // delete field.properties.cameraConfig.others.isWatermark;
1737
+ // delete field.properties.cameraConfig.others.isWatermarkForImageUpload;
1706
1738
  return field;
1707
1739
  };
1708
1740
  var formatFieldTypeRecord = function (field) {
@@ -1779,11 +1811,11 @@
1779
1811
  case EFieldType.LIVE_LOCATION:
1780
1812
  field = formatFieldTypeLiveLocation(field);
1781
1813
  break;
1814
+ case EFieldType.DATA_HOLDER:
1815
+ field = formatFieldTypeDataHolder(field);
1816
+ break;
1782
1817
  case EFieldType.API:
1783
1818
  field = formatFieldTypeApi(field);
1784
- case EFieldType.LIVE_LOCATION:
1785
- field = formatFieldTypeLiveLocation(field);
1786
- break;
1787
1819
  break;
1788
1820
  case EFieldType.OTP:
1789
1821
  field = formatFieldTypeOtp(field);
@@ -1818,7 +1850,7 @@
1818
1850
  ? field.validators
1819
1851
  : {};
1820
1852
  field = setMissingFieldKeyValue(field, "validators", {});
1821
- field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field["validators"]), { min: kwikidToolkit.checkObjectKeyExists(validators, "min")
1853
+ field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field.validators), { min: kwikidToolkit.checkObjectKeyExists(validators, "min")
1822
1854
  ? kwikidToolkit.isNotEmptyValue(validators.min)
1823
1855
  ? Number(validators.min)
1824
1856
  : null
@@ -1870,6 +1902,10 @@
1870
1902
  delete field.validators.min;
1871
1903
  delete field.validators.max;
1872
1904
  break;
1905
+ case EFieldType.DATA_HOLDER:
1906
+ delete field.validators.min;
1907
+ delete field.validators.max;
1908
+ break;
1873
1909
  case EFieldType.CHECKBOX:
1874
1910
  delete field.validators.min;
1875
1911
  delete field.validators.max;
@@ -1929,18 +1965,18 @@
1929
1965
  if (kwikidToolkit.checkObjectKeyExists(field, "defaultValue")) {
1930
1966
  return field;
1931
1967
  }
1932
- else if (kwikidToolkit.checkObjectPathExists(field, "default.value.sources")) {
1968
+ if (kwikidToolkit.checkObjectPathExists(field, "default.value.sources")) {
1933
1969
  return field;
1934
1970
  }
1935
- else if (kwikidToolkit.checkObjectPathExists(field, "default.value.rules") &&
1971
+ if (kwikidToolkit.checkObjectPathExists(field, "default.value.rules") &&
1936
1972
  kwikidToolkit.checkObjectPathExists(field, "default.value.actions")) {
1937
1973
  return field;
1938
1974
  }
1939
- else if (kwikidToolkit.checkObjectPathExists(field, "default.value.value") &&
1975
+ if (kwikidToolkit.checkObjectPathExists(field, "default.value.value") &&
1940
1976
  kwikidToolkit.isNotEmptyValue(field.default.value.value)) {
1941
1977
  return field;
1942
1978
  }
1943
- else if (!kwikidToolkit.checkObjectPathExists(field, "default.value.sources")) {
1979
+ if (!kwikidToolkit.checkObjectPathExists(field, "default.value.sources")) {
1944
1980
  var defaultValue = {
1945
1981
  value: "",
1946
1982
  triggers: ["ON_INIT"],
@@ -1969,8 +2005,8 @@
1969
2005
  field = kwikidToolkit.setValueToObjectPath(field, "default.value", defaultValue);
1970
2006
  return field;
1971
2007
  }
1972
- delete field["defaultVal"];
1973
- delete field["defaultValue"];
2008
+ delete field.defaultVal;
2009
+ delete field.defaultValue;
1974
2010
  }
1975
2011
  return field;
1976
2012
  };
@@ -1998,30 +2034,30 @@
1998
2034
  };
1999
2035
  var setFormFields = function (formConfig, fields) {
2000
2036
  if (kwikidToolkit.checkObjectKeyExists(formConfig, "multiForm")) {
2001
- formConfig.multiForm["fields"] = fields;
2037
+ formConfig.multiForm.fields = fields;
2002
2038
  }
2003
2039
  else {
2004
- formConfig["fields"] = fields;
2040
+ formConfig.fields = fields;
2005
2041
  }
2006
2042
  return formConfig;
2007
2043
  };
2008
2044
  var setFormFieldGroups = function (formConfig, groups) {
2009
- formConfig["fieldGroups"] = groups;
2045
+ formConfig.fieldGroups = groups;
2010
2046
  return formConfig;
2011
2047
  };
2012
2048
  var updateFieldGroupKey = function (field) {
2013
2049
  if (kwikidToolkit.checkObjectKeyExists(field, "groupKey") &&
2014
2050
  !Array.isArray(field.groupKey)) {
2015
- field["groupKey"] = [field.groupKey];
2051
+ field.groupKey = [field.groupKey];
2016
2052
  }
2017
2053
  return field;
2018
2054
  };
2019
2055
  var updateFormFieldGroups = function (fieldGroups, field) {
2020
- var e_2, _f;
2056
+ var e_2, _l;
2021
2057
  if (kwikidToolkit.checkObjectKeyExists(field, "groupKey")) {
2022
2058
  try {
2023
- for (var _g = __values(field.groupKey), _h = _g.next(); !_h.done; _h = _g.next()) {
2024
- var groupKey = _h.value;
2059
+ for (var _m = __values(field.groupKey), _o = _m.next(); !_o.done; _o = _m.next()) {
2060
+ var groupKey = _o.value;
2025
2061
  if (kwikidToolkit.checkObjectKeyExists(fieldGroups, groupKey)) {
2026
2062
  fieldGroups[groupKey].push(field.key);
2027
2063
  }
@@ -2033,7 +2069,7 @@
2033
2069
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
2034
2070
  finally {
2035
2071
  try {
2036
- if (_h && !_h.done && (_f = _g.return)) _f.call(_g);
2072
+ if (_o && !_o.done && (_l = _m.return)) _l.call(_m);
2037
2073
  }
2038
2074
  finally { if (e_2) throw e_2.error; }
2039
2075
  }
@@ -2045,26 +2081,28 @@
2045
2081
  field.label = updateLanguage(field.label, language);
2046
2082
  }
2047
2083
  if (kwikidToolkit.checkObjectPathExists(field, "properties.placeholder")) {
2048
- field.properties["placeholder"] = updateLanguage(field.properties["placeholder"], language);
2084
+ field.properties.placeholder = updateLanguage(field.properties.placeholder, language);
2049
2085
  }
2050
2086
  if (kwikidToolkit.checkObjectPathExists(field, "properties.label")) {
2051
- field.properties["label"] = updateLanguage(field.properties["label"], language);
2087
+ field.properties.label = updateLanguage(field.properties.label, language);
2052
2088
  }
2053
2089
  var updateApiStatus = function (fieldApiStatus) {
2054
2090
  for (var status in fieldApiStatus) {
2055
- fieldApiStatus[status] = updateLanguage(fieldApiStatus[status], language);
2091
+ if (kwikidToolkit.isNotEmptyValue(status)) {
2092
+ fieldApiStatus[status] = updateLanguage(fieldApiStatus[status], language);
2093
+ }
2056
2094
  }
2057
2095
  return fieldApiStatus;
2058
2096
  };
2059
2097
  switch (field.type) {
2060
2098
  case EFieldType.HTML:
2061
- field["html"] = updateLanguage(field["html"], language);
2099
+ field.html = updateLanguage(field.html, language);
2062
2100
  break;
2063
2101
  case EFieldType.CAPTURE:
2064
- field.properties["cameraConfig"].header.title = updateLanguage(field.properties["cameraConfig"].header.title, language);
2102
+ field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
2065
2103
  break;
2066
2104
  case EFieldType.RECORD:
2067
- field.properties["cameraConfig"].header.title = updateLanguage(field.properties["cameraConfig"].header.title, language);
2105
+ field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
2068
2106
  break;
2069
2107
  case EFieldType.SELECT:
2070
2108
  field.options = field.options.map(function (option) {
@@ -2106,10 +2144,10 @@
2106
2144
  });
2107
2145
  break;
2108
2146
  case EFieldType.API_CALL:
2109
- field["api"]["status"]["labels"] = updateApiStatus(field["api"]["status"]["labels"]);
2147
+ field.api.status.labels = updateApiStatus(field.api.status.labels);
2110
2148
  break;
2111
2149
  case EFieldType.LIVE_LOCATION:
2112
- field["api"]["status"]["labels"] = updateApiStatus(field["api"]["status"]["labels"]);
2150
+ field.api.status.labels = updateApiStatus(field.api.status.labels);
2113
2151
  break;
2114
2152
  default:
2115
2153
  break;
@@ -2135,7 +2173,7 @@
2135
2173
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
2136
2174
  finally {
2137
2175
  try {
2138
- if (fields_1_1 && !fields_1_1.done && (_f = fields_1.return)) _f.call(fields_1);
2176
+ if (fields_1_1 && !fields_1_1.done && (_l = fields_1.return)) _l.call(fields_1);
2139
2177
  }
2140
2178
  finally { if (e_1) throw e_1.error; }
2141
2179
  }
@@ -2158,6 +2196,7 @@
2158
2196
  kwikidToolkit.logMethod
2159
2197
  ], Converter.prototype, "convertFormConfig", null);
2160
2198
 
2199
+ /* eslint-disable no-unused-vars */
2161
2200
  var EFormEditorType;
2162
2201
  (function (EFormEditorType) {
2163
2202
  EFormEditorType["FIELDS"] = "FIELDS";
@@ -2166,9 +2205,7 @@
2166
2205
 
2167
2206
  var removeField = function (fields, fieldKey) {
2168
2207
  fields = fields.filter(function (row) {
2169
- if (row.key !== fieldKey) {
2170
- return row;
2171
- }
2208
+ return row.key !== fieldKey;
2172
2209
  });
2173
2210
  return fields;
2174
2211
  };
@@ -2401,16 +2438,16 @@
2401
2438
  number: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.number) }),
2402
2439
  date: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "date", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.date) }),
2403
2440
  phone: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "phone", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.phone) }),
2404
- radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["radio"]), options: [] }),
2441
+ radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.radio), options: [] }),
2405
2442
  "radio-list": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio-list", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["radio-list"]), options: [] }),
2406
- select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["select"]), options: [] }),
2443
+ select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.select), options: [] }),
2407
2444
  slider: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "slider", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.slider) }),
2408
2445
  otp: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "otp", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.otp) }),
2409
- api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["api"]) }),
2446
+ api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.api) }),
2410
2447
  "api-call": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api-call", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["api-call"]) }),
2411
2448
  "aadhaar-number": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "aadhaar-number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["aadhaar-number"]) }),
2412
2449
  "input-aadhaar": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "input-aadhaar", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["input-aadhaar"]) }),
2413
- image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["image"]) }),
2450
+ image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.image) }),
2414
2451
  "preview-image": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "preview-image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["preview-image"]) }),
2415
2452
  html: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "html", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.html), html: {
2416
2453
  before: "",
@@ -2456,7 +2493,9 @@
2456
2493
  KwikIDFormBuilderFormEditorService.prototype.createNestedFormGroup = function (object) {
2457
2494
  var formGroup = {};
2458
2495
  for (var index in object) {
2459
- formGroup[index] = new i3.FormControl(object[index]);
2496
+ if (kwikidToolkit.isNotEmptyValue(index)) {
2497
+ formGroup[index] = new i3.FormControl(object[index]);
2498
+ }
2460
2499
  }
2461
2500
  return new i3.FormGroup(formGroup);
2462
2501
  };
@@ -2524,7 +2563,7 @@
2524
2563
  ];
2525
2564
  this.activeEditorType = EFormEditorType.FIELDS;
2526
2565
  this.activeFormConfig_Fields = [];
2527
- this.activeFormConfig_NoFields = {};
2566
+ this.activeFormConfigNoFields = {};
2528
2567
  this.showConfigPreview = false;
2529
2568
  // Forms
2530
2569
  this.formGroup = new i3.FormGroup({});
@@ -2556,7 +2595,6 @@
2556
2595
  /**
2557
2596
  * Angular Lifecycle Methods
2558
2597
  */
2559
- KwikIDBuilderFormEditorComponent.prototype.ngOnInit = function () { };
2560
2598
  KwikIDBuilderFormEditorComponent.prototype.ngOnChanges = function (changes) {
2561
2599
  var verifyChange = function (key) {
2562
2600
  return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
@@ -2571,8 +2609,8 @@
2571
2609
  KwikIDBuilderFormEditorComponent.prototype.initFormEditor = function (activeFormConfig) {
2572
2610
  this.toggleLoader(true);
2573
2611
  this.activeFormConfig_Fields = kwikidToolkit.getObjectDeepCopy(activeFormConfig.fields);
2574
- this.activeFormConfig_NoFields = kwikidToolkit.getObjectDeepCopy(activeFormConfig);
2575
- delete this.activeFormConfig_NoFields.fields;
2612
+ this.activeFormConfigNoFields = kwikidToolkit.getObjectDeepCopy(activeFormConfig);
2613
+ delete this.activeFormConfigNoFields.fields;
2576
2614
  this.rows = this.activeFormConfig_Fields.map(function (field) {
2577
2615
  var _a;
2578
2616
  return {
@@ -2622,21 +2660,21 @@
2622
2660
  */
2623
2661
  KwikIDBuilderFormEditorComponent.prototype.handleOnClickEditValidators = function (e) {
2624
2662
  var fieldConfig = this.formGroup.getRawValue()[e.index];
2625
- var fieldConfigValidators = fieldConfig["validators"];
2663
+ var fieldConfigValidators = fieldConfig.validators;
2626
2664
  this.activeFieldConfigValidatorsConfig = kwikidToolkit.mergeObjects(FIELD_VALIDATORS_CONFIG, fieldConfigValidators);
2627
2665
  this.showFieldConfigValidatorsConfigEditor = true;
2628
2666
  this.activeFieldConfigEditing = fieldConfig;
2629
2667
  };
2630
2668
  KwikIDBuilderFormEditorComponent.prototype.handleOnClickEditProperties = function (e) {
2631
2669
  var fieldConfig = this.formGroup.getRawValue()[e.index];
2632
- var fieldConfigProperties = fieldConfig["properties"];
2670
+ var fieldConfigProperties = fieldConfig.properties;
2633
2671
  this.activeFieldConfigPropertiesConfig = kwikidToolkit.mergeObjects(FIELD_PROPERTIES_CONFIG[e.type], fieldConfigProperties);
2634
2672
  this.showFieldConfigPropertiesConfigEditor = true;
2635
2673
  this.activeFieldConfigEditing = fieldConfig;
2636
2674
  };
2637
2675
  KwikIDBuilderFormEditorComponent.prototype.handleOnClickEditOptions = function (e) {
2638
2676
  var fieldConfig = this.formGroup.getRawValue()[e.index];
2639
- var fieldConfigOptions = fieldConfig["options"];
2677
+ var fieldConfigOptions = fieldConfig.options;
2640
2678
  this.activeFieldConfigOptionsConfig = kwikidToolkit.mergeObjects([], fieldConfigOptions);
2641
2679
  this.showFieldConfigOptionsConfigEditor = true;
2642
2680
  this.activeFieldConfigEditing = fieldConfig;
@@ -2734,8 +2772,8 @@
2734
2772
  /**
2735
2773
  * Non Fields Editor Related Methods
2736
2774
  */
2737
- KwikIDBuilderFormEditorComponent.prototype.handleOnClickSaveActiveFormConfig_NoFields = function (e) {
2738
- this.activeFormConfig_NoFields = JSON.parse(e);
2775
+ KwikIDBuilderFormEditorComponent.prototype.handleOnClickSaveActiveFormConfigNoFields = function (e) {
2776
+ this.activeFormConfigNoFields = JSON.parse(e);
2739
2777
  };
2740
2778
  /**
2741
2779
  * Other Component Methods
@@ -2772,7 +2810,7 @@
2772
2810
  try {
2773
2811
  for (var _c = __values(Object.values(kwikidToolkit.getObjectDeepCopy(this.formGroup.getRawValue()))), _d = _c.next(); !_d.done; _d = _c.next()) {
2774
2812
  var field = _d.value;
2775
- fields.push(kwikidToolkit.setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field["type"]], field, ""), "type", field["type"]));
2813
+ fields.push(kwikidToolkit.setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field.type], field, ""), "type", field.type));
2776
2814
  }
2777
2815
  }
2778
2816
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -2782,8 +2820,8 @@
2782
2820
  }
2783
2821
  finally { if (e_1) throw e_1.error; }
2784
2822
  }
2785
- var activeFormConfig_NoFields_Minified = findModifiedKeys(NOFIELD_CONFIG, kwikidToolkit.getObjectDeepCopy(this.activeFormConfig_NoFields), "");
2786
- this.activeFormConfig = kwikidToolkit.mergeObjects({}, activeFormConfig_NoFields_Minified, {
2823
+ var activeFormConfigNoFieldsMinified = findModifiedKeys(NOFIELD_CONFIG, kwikidToolkit.getObjectDeepCopy(this.activeFormConfigNoFields), "");
2824
+ this.activeFormConfig = kwikidToolkit.mergeObjects({}, activeFormConfigNoFieldsMinified, {
2787
2825
  fields: fields
2788
2826
  });
2789
2827
  };
@@ -2801,24 +2839,20 @@
2801
2839
  KwikIDBuilderFormEditorComponent.prototype.getOptions = function (index, value, key, path) {
2802
2840
  if (path.includes("properties")) {
2803
2841
  var fieldType = this.rows[index].type;
2804
- var finalPath = path + "['" + fieldType + "']." + key;
2805
- return kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath);
2806
- }
2807
- else {
2808
- var finalPath = path !== "" ? path + "." + key : key;
2809
- return kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath);
2842
+ var finalPath_1 = path + "['" + fieldType + "']." + key;
2843
+ return kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath_1);
2810
2844
  }
2845
+ var finalPath = path !== "" ? path + "." + key : key;
2846
+ return kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath);
2811
2847
  };
2812
2848
  KwikIDBuilderFormEditorComponent.prototype.isOptions = function (index, value, key, path) {
2813
2849
  if (path.includes("properties")) {
2814
2850
  var fieldType = this.rows[index].type;
2815
- var finalPath = path + "['" + fieldType + "']." + key;
2816
- return Array.isArray(kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath));
2817
- }
2818
- else {
2819
- var finalPath = path !== "" ? path + "." + key : key;
2820
- return Array.isArray(kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath));
2851
+ var finalPath_2 = path + "['" + fieldType + "']." + key;
2852
+ return Array.isArray(kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath_2));
2821
2853
  }
2854
+ var finalPath = path !== "" ? path + "." + key : key;
2855
+ return Array.isArray(kwikidToolkit.getObjectValueFromPath(OPTIONS, finalPath));
2822
2856
  };
2823
2857
  KwikIDBuilderFormEditorComponent.prototype.isBoolean = function (value) {
2824
2858
  return typeof value === "boolean";
@@ -2841,14 +2875,12 @@
2841
2875
  if (typeof item === "string") {
2842
2876
  return String(index) + "_" + item + "_" + new Date().getTime();
2843
2877
  }
2844
- else {
2845
- return String(index) + "_" + key + "_" + value + "_" + new Date().getTime();
2846
- }
2878
+ return String(index) + "_" + key + "_" + value + "_" + new Date().getTime();
2847
2879
  };
2848
2880
  return KwikIDBuilderFormEditorComponent;
2849
2881
  }());
2850
2882
  /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDBuilderFormEditorComponent, deps: [{ token: i3__namespace.KwikUILoaderService }, { token: KwikIDFormBuilderFormEditorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2851
- /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0__namespace, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n &nbsp;Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor&nbsp;Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>&plus;</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfig_NoFields(\n $event.target.innerHTML\n )\n \"\n >\n {{ activeFormConfig_NoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>&#10150;</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.checked }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3__namespace$2.JsonPipe, "keyvalue": i3__namespace$2.KeyValuePipe }, animations: [
2883
+ /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0__namespace, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n &nbsp;Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor&nbsp;Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>&plus;</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfigNoFields($event.target.innerHTML)\n \"\n >\n {{ activeFormConfigNoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>&#10150;</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.checked },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3__namespace$2.JsonPipe, "keyvalue": i3__namespace$2.KeyValuePipe }, animations: [
2852
2884
  animations.trigger("panelInOut", [
2853
2885
  animations.transition(":enter", [
2854
2886
  animations.style({ transform: "translateY(100%)" }),
@@ -2859,9 +2891,6 @@
2859
2891
  ])
2860
2892
  ])
2861
2893
  ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2862
- __decorate([
2863
- kwikidToolkit.logMethod
2864
- ], KwikIDBuilderFormEditorComponent.prototype, "ngOnInit", null);
2865
2894
  __decorate([
2866
2895
  kwikidToolkit.logMethod
2867
2896
  ], KwikIDBuilderFormEditorComponent.prototype, "ngOnChanges", null);
@@ -2903,7 +2932,7 @@
2903
2932
  ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickDeleteField", null);
2904
2933
  __decorate([
2905
2934
  kwikidToolkit.logMethod
2906
- ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickSaveActiveFormConfig_NoFields", null);
2935
+ ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickSaveActiveFormConfigNoFields", null);
2907
2936
  __decorate([
2908
2937
  kwikidToolkit.logMethod
2909
2938
  ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickPreview", null);
@@ -2948,7 +2977,7 @@
2948
2977
  type: i0.Input
2949
2978
  }], onClickSaveActiveFormConfig: [{
2950
2979
  type: i0.Output
2951
- }], ngOnInit: [], ngOnChanges: [], initFormEditor: [], handleOnClickChangeActiveEditor: [], handleOnClickSaveActiveFormConfig: [], handleOnClickAddField: [], handleOnClickEditValidators: [], handleOnClickEditProperties: [], handleOnClickEditOptions: [], handleOnInput: [], handleOnInputFieldConfigValidatorsConfig: [], handleOnInputFieldConfigPropertiesConfig: [], handleOnInputFieldConfigOptionsConfig: [], handleOnClickDeleteField: [], handleOnClickSaveActiveFormConfig_NoFields: [], handleOnClickPreview: [], toggleLoader: [], closeJSONPopup: [], copyToClipboard: [], convertToMinifiedJson: [], convertToCompleteJson: [], downloadJSON: [] } });
2980
+ }], ngOnChanges: [], initFormEditor: [], handleOnClickChangeActiveEditor: [], handleOnClickSaveActiveFormConfig: [], handleOnClickAddField: [], handleOnClickEditValidators: [], handleOnClickEditProperties: [], handleOnClickEditOptions: [], handleOnInput: [], handleOnInputFieldConfigValidatorsConfig: [], handleOnInputFieldConfigPropertiesConfig: [], handleOnInputFieldConfigOptionsConfig: [], handleOnClickDeleteField: [], handleOnClickSaveActiveFormConfigNoFields: [], handleOnClickPreview: [], toggleLoader: [], closeJSONPopup: [], copyToClipboard: [], convertToMinifiedJson: [], convertToCompleteJson: [], downloadJSON: [] } });
2952
2981
 
2953
2982
  var KwikIDFormsBuilderComponent = /** @class */ (function () {
2954
2983
  function KwikIDFormsBuilderComponent(loaderService) {
@@ -3001,27 +3030,24 @@
3001
3030
  case 0:
3002
3031
  this.toggleLoader(true);
3003
3032
  activeFormConfig = this.formsList.find(function (form) {
3004
- if (form.key === selectedFormKey) {
3005
- return form;
3006
- }
3033
+ return form.key === selectedFormKey;
3007
3034
  });
3008
- formConfig = undefined;
3009
3035
  if (!kwikidToolkit.getObjectFromLocalStorage(activeFormConfig.key)) return [3 /*break*/, 1];
3010
3036
  formConfig = kwikidToolkit.getObjectFromLocalStorage(activeFormConfig.key);
3011
3037
  return [3 /*break*/, 14];
3012
3038
  case 1:
3013
3039
  if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig, "props")) return [3 /*break*/, 7];
3014
- if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig["props"], "url")) return [3 /*break*/, 3];
3015
- return [4 /*yield*/, this.fetchFormConfig(activeFormConfig["props"].url)];
3040
+ if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig.props, "url")) return [3 /*break*/, 3];
3041
+ return [4 /*yield*/, this.fetchFormConfig(activeFormConfig.props.url)];
3016
3042
  case 2:
3017
3043
  formConfigFromUrl = _e.sent();
3018
3044
  formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
3019
3045
  return [3 /*break*/, 6];
3020
3046
  case 3:
3021
- if (!(kwikidToolkit.checkObjectKeyExists(activeFormConfig["props"], "path") &&
3047
+ if (!(kwikidToolkit.checkObjectKeyExists(activeFormConfig.props, "path") &&
3022
3048
  kwikidToolkit.checkObjectKeyExists(this.userConfig, "backend") &&
3023
3049
  kwikidToolkit.checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL"))) return [3 /*break*/, 5];
3024
- url = "" + ((_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL) + activeFormConfig["props"].path;
3050
+ url = "" + ((_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL) + activeFormConfig.props.path;
3025
3051
  return [4 /*yield*/, this.fetchFormConfig(url)];
3026
3052
  case 4:
3027
3053
  formConfigFromPath = _e.sent();
@@ -3048,7 +3074,7 @@
3048
3074
  if (!(kwikidToolkit.checkObjectKeyExists(activeFormConfig.formContent, "path") &&
3049
3075
  kwikidToolkit.checkObjectKeyExists(this.userConfig, "backend") &&
3050
3076
  kwikidToolkit.checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL"))) return [3 /*break*/, 11];
3051
- url = "" + ((_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL) + activeFormConfig["props"].path;
3077
+ url = "" + ((_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL) + activeFormConfig.props.path;
3052
3078
  return [4 /*yield*/, this.fetchFormConfig(url)];
3053
3079
  case 10:
3054
3080
  formConfigFromPath = _e.sent();
@@ -3105,7 +3131,7 @@
3105
3131
  return KwikIDFormsBuilderComponent;
3106
3132
  }());
3107
3133
  /** @nocollapse */ KwikIDFormsBuilderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsBuilderComponent, deps: [{ token: i3__namespace.KwikUILoaderService }], target: i0__namespace.ɵɵFactoryTarget.Component });
3108
- /** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0__namespace, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader\n></kwikui-loader>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:stretch;padding:1rem}.container>*:not(:last-child){margin-right:1rem}\n"], components: [{ type: KwikIDBuilderFormsListComponent, selector: "kwikid-builder-forms-list", inputs: ["activeFormConfig", "formsList"], outputs: ["onClickSetActiveForm", "getFormsList"] }, { type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: ["activeFormConfig"], outputs: ["onClickSaveActiveFormConfig"] }, { type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }] });
3134
+ /** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0__namespace, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader></kwikui-loader>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:stretch;padding:1rem}.container>*:not(:last-child){margin-right:1rem}\n"], components: [{ type: KwikIDBuilderFormsListComponent, selector: "kwikid-builder-forms-list", inputs: ["activeFormConfig", "formsList"], outputs: ["onClickSetActiveForm", "getFormsList"] }, { type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: ["activeFormConfig"], outputs: ["onClickSaveActiveFormConfig"] }, { type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }] });
3109
3135
  __decorate([
3110
3136
  kwikidToolkit.logMethod
3111
3137
  ], KwikIDFormsBuilderComponent.prototype, "fetchFormConfig", null);
@@ -3132,6 +3158,7 @@
3132
3158
  type: i0.Input
3133
3159
  }], fetchFormConfig: [], handleGetFormsList: [], handleOnClickSetActiveForm: [], handleOnClickSaveActiveFormConfig: [], toggleLoader: [] } });
3134
3160
 
3161
+ /* eslint-disable no-unused-vars */
3135
3162
  var EFormsListStatus;
3136
3163
  (function (EFormsListStatus) {
3137
3164
  EFormsListStatus["COMPLETED"] = "completed";
@@ -3215,6 +3242,7 @@
3215
3242
  EApiRequestUrlType["CALCULATED"] = "CALCULATED";
3216
3243
  })(EApiRequestUrlType || (EApiRequestUrlType = {}));
3217
3244
 
3245
+ /* eslint-disable no-unused-vars */
3218
3246
  var EMessageType;
3219
3247
  (function (EMessageType) {
3220
3248
  EMessageType["DEFAULT"] = "default";
@@ -3228,6 +3256,7 @@
3228
3256
  EFormViewGoBackMode["TABBED"] = "TABBED";
3229
3257
  })(EFormViewGoBackMode || (EFormViewGoBackMode = {}));
3230
3258
 
3259
+ /* eslint-disable no-unused-vars */
3231
3260
  var ELogEventType$1;
3232
3261
  (function (ELogEventType) {
3233
3262
  ELogEventType["FORM__ACTION_EXECUTE"] = "FORM__ACTION_EXECUTE";
@@ -3318,24 +3347,23 @@
3318
3347
  .join("");
3319
3348
  return outputString;
3320
3349
  }
3321
- else {
3322
- return undefined;
3323
- }
3350
+ return undefined;
3324
3351
  };
3325
3352
  // Function to preprocess header data
3326
3353
  KwikIDFormViewApiService.prototype.preProcessHeader = function (headerData, isVerifySignature) {
3327
3354
  if (!headerData)
3328
3355
  headerData = {};
3329
3356
  if (!headerData.headers)
3330
- headerData["headers"] = {};
3357
+ headerData.headers = {};
3331
3358
  // Generate a unique identifier if signature verification is required
3332
3359
  if (isVerifySignature) {
3333
- headerData["headers"]["xrid"] = uuid.v4();
3360
+ headerData.headers.xrid = uuid.v4();
3334
3361
  }
3335
3362
  // Retrieve session ID from local storage and add it to headers
3336
- var session_id = localStorage.getItem("session_id");
3337
- if (session_id)
3338
- headerData["headers"]["ses"] = session_id;
3363
+ var sessionId = localStorage.getItem("session_id");
3364
+ if (sessionId) {
3365
+ headerData.headers.ses = sessionId;
3366
+ }
3339
3367
  return headerData;
3340
3368
  };
3341
3369
  // Function to verify the signature
@@ -3345,16 +3373,16 @@
3345
3373
  if (!isVerifySignature) {
3346
3374
  resolve(true);
3347
3375
  }
3348
- // Check if data is invalid
3349
3376
  else if (!data) {
3377
+ // Check if data is invalid
3350
3378
  resolve(true);
3351
3379
  }
3352
- // Check if the signature is missing in headers when authentication is not skipped
3353
3380
  else if (isVerifySignature && header && !(header === null || header === void 0 ? void 0 : header.sig)) {
3381
+ // Check if the signature is missing in headers when authentication is not skipped
3354
3382
  reject(false);
3355
3383
  }
3356
- // Verify the signature when public key and header with signature are present and authentication is not skipped
3357
3384
  else if (isVerifySignature && header && (header === null || header === void 0 ? void 0 : header.sig)) {
3385
+ // Verify the signature when public key and header with signature are present and authentication is not skipped
3358
3386
  // Extract the signature and decode it
3359
3387
  var signature = header.sig.split(".")[0];
3360
3388
  var rawSignature = atob(signature);
@@ -3366,7 +3394,7 @@
3366
3394
  if (signature) {
3367
3395
  // Check if the current time is before the expiration time
3368
3396
  var dateValue = new Date().valueOf();
3369
- var dateCheck = dateValue < parseInt(exp);
3397
+ var dateCheck = dateValue < parseInt(exp, 10);
3370
3398
  // Check if the signature matches the data
3371
3399
  var res = signature === data;
3372
3400
  // Resolve the promise if the signature is valid and the date check passes
@@ -3402,7 +3430,7 @@
3402
3430
  preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
3403
3431
  }
3404
3432
  else {
3405
- preProcessedHeader["observe"] = "response";
3433
+ preProcessedHeader.observe = "response";
3406
3434
  }
3407
3435
  // Encrypt body if required
3408
3436
  if (isEncrypt) {
@@ -3414,7 +3442,7 @@
3414
3442
  return __generator(this, function (_c) {
3415
3443
  switch (_c.label) {
3416
3444
  case 0:
3417
- data = res["data"];
3445
+ data = res.data;
3418
3446
  if (!(data && isDecrypt)) return [3 /*break*/, 2];
3419
3447
  encryptedResponse = data;
3420
3448
  return [4 /*yield*/, kwikidToolkit.decryptWithAES(encryptedResponse)];
@@ -3478,7 +3506,7 @@
3478
3506
  preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
3479
3507
  }
3480
3508
  else {
3481
- preProcessedHeader["observe"] = "response";
3509
+ preProcessedHeader.observe = "response";
3482
3510
  }
3483
3511
  return new rxjs.Observable(function (subscriber) {
3484
3512
  axios__default["default"].get(url, preProcessedHeader).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
@@ -3486,7 +3514,7 @@
3486
3514
  return __generator(this, function (_c) {
3487
3515
  switch (_c.label) {
3488
3516
  case 0:
3489
- data = res["data"];
3517
+ data = res.data;
3490
3518
  if (!isDecrypt) return [3 /*break*/, 2];
3491
3519
  encryptedResponse = data;
3492
3520
  return [4 /*yield*/, kwikidToolkit.decryptWithAES(encryptedResponse)];
@@ -3541,7 +3569,7 @@
3541
3569
  KwikIDFormViewApiService.prototype.executeApiCall = function (url, method, body, headers, isEncrypt, isDecrypt, isVerifySignature) {
3542
3570
  var _this = this;
3543
3571
  return new Promise(function (resolve) {
3544
- if (method == "GET") {
3572
+ if (method === "GET") {
3545
3573
  _this.get(url, { headers: headers }, isDecrypt, isVerifySignature).subscribe(function (res) {
3546
3574
  resolve(res);
3547
3575
  }, function (err) {
@@ -3575,16 +3603,39 @@
3575
3603
  kwikidToolkit.logMethod
3576
3604
  ], KwikIDFormViewApiService.prototype, "get", null);
3577
3605
 
3606
+ var FORM_VIEW_TIMERS = {
3607
+ WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK: 10,
3608
+ WAIT_FOR_FILE_METADATA_DEEPCOPY: 300,
3609
+ WAIT_FOR_KWIKID_CAMERA_TO_LOAD: 500,
3610
+ WAIT_FOR_KWIKID_CAMERA_MEDIA_TO_BE_SET: 500,
3611
+ LOCATION_PERMISSION_ERROR_TOGGLE: 3000,
3612
+ LOCATION_PERMISSION_RESET_BUTTON_STATUS: 500,
3613
+ INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE: 3000,
3614
+ TIMER_300: 300,
3615
+ TIMER_500: 500,
3616
+ TIMER_1000: 1000,
3617
+ TIMER_3000: 3000,
3618
+ WAIT_FOR_API_MOCK_DATA: 1000,
3619
+ API_MOCK_SUCCESS_STATUS_CODE: 200,
3620
+ API_MOCK_ERROR_STATUS_CODE: 200
3621
+ };
3622
+
3578
3623
  var Defaults = /** @class */ (function () {
3579
- function Defaults(field, formFields, allFormsData, formData, previousFormData, extraData, takeAction) {
3624
+ function Defaults(field, object, takeAction) {
3580
3625
  this._field = field;
3581
- this._formFields = formFields;
3582
- this._allFormsData = allFormsData;
3583
- this._formData = formData;
3584
- this._previousFormData = previousFormData;
3585
- this._extraData = extraData;
3626
+ this._object = object;
3586
3627
  this._takeAction = takeAction;
3587
3628
  }
3629
+ Object.defineProperty(Defaults.prototype, "object", {
3630
+ get: function () {
3631
+ return this._object;
3632
+ },
3633
+ set: function (value) {
3634
+ this._object = value;
3635
+ },
3636
+ enumerable: false,
3637
+ configurable: true
3638
+ });
3588
3639
  Defaults.prototype.getFormFieldValue = function () {
3589
3640
  return __awaiter(this, void 0, void 0, function () {
3590
3641
  var defaultValue, engine, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_3, e_1_1, sources, sourceIndex, sources_1, sources_1_1, source, sources_2, value, validation, triggers, rules, actions, rulesMapping, actions_2, actions_2_1, action, conditionEvaluation, actions_4, e_2_1, e_3_1;
@@ -3602,17 +3653,8 @@
3602
3653
  case 1:
3603
3654
  if (!!kwikidToolkit.checkObjectKeyExists(this._field.default.value, "sources")) return [3 /*break*/, 10];
3604
3655
  engine = this._field.default.value;
3605
- triggers = engine.triggers;
3606
- rules = engine.rules;
3607
- actions = engine.actions;
3608
- rulesMapping = new kwikidToolkit.Rule(rules, {
3609
- FIELD_CONFIG: this._field,
3610
- FORM_FIELDS: this._formFields,
3611
- FORM_DATA: this._formData,
3612
- PREVIOUS_FORM_DATA: this._previousFormData,
3613
- ALL_FORMS_DATA: this._allFormsData,
3614
- EXTRA_DATA: this._extraData
3615
- }).mapping();
3656
+ triggers = engine.triggers, rules = engine.rules, actions = engine.actions;
3657
+ rulesMapping = new kwikidToolkit.Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3616
3658
  _d.label = 2;
3617
3659
  case 2:
3618
3660
  _d.trys.push([2, 7, 8, 9]);
@@ -3623,14 +3665,7 @@
3623
3665
  action = actions_1_1.value;
3624
3666
  conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
3625
3667
  if (!conditionEvaluation) return [3 /*break*/, 5];
3626
- actions_3 = new kwikidToolkit.Action(action, rulesMapping, {
3627
- FIELD_CONFIG: this._field,
3628
- FORM_FIELDS: this._formFields,
3629
- FORM_DATA: this._formData,
3630
- PREVIOUS_FORM_DATA: this._previousFormData,
3631
- ALL_FORMS_DATA: this._allFormsData,
3632
- EXTRA_DATA: this._extraData
3633
- }, this._takeAction);
3668
+ actions_3 = new kwikidToolkit.Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3634
3669
  return [4 /*yield*/, actions_3.execute()];
3635
3670
  case 4:
3636
3671
  _d.sent();
@@ -3666,14 +3701,7 @@
3666
3701
  case 12:
3667
3702
  if (!!sources_1_1.done) return [3 /*break*/, 22];
3668
3703
  source = sources_1_1.value;
3669
- sources_2 = new kwikidToolkit.Source({
3670
- FIELD_CONFIG: this._field,
3671
- FORM_FIELDS: this._formFields,
3672
- FORM_DATA: this._formData,
3673
- PREVIOUS_FORM_DATA: this._previousFormData,
3674
- ALL_FORMS_DATA: this._allFormsData,
3675
- EXTRA_DATA: this._extraData
3676
- });
3704
+ sources_2 = new kwikidToolkit.Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
3677
3705
  value = sources_2.getValueFromSource(source);
3678
3706
  // Set the Value of current source.
3679
3707
  this._field = kwikidToolkit.setValueToObjectPath(this._field, "default.value.sources.[" + sourceIndex + "].value", value);
@@ -3681,14 +3709,7 @@
3681
3709
  triggers = validation.triggers;
3682
3710
  rules = validation.rules;
3683
3711
  actions = validation.actions;
3684
- rulesMapping = new kwikidToolkit.Rule(rules, {
3685
- FIELD_CONFIG: this._field,
3686
- FORM_FIELDS: this._formFields,
3687
- FORM_DATA: this._formData,
3688
- PREVIOUS_FORM_DATA: this._previousFormData,
3689
- ALL_FORMS_DATA: this._allFormsData,
3690
- EXTRA_DATA: this._extraData
3691
- }).mapping();
3712
+ rulesMapping = new kwikidToolkit.Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3692
3713
  _d.label = 13;
3693
3714
  case 13:
3694
3715
  _d.trys.push([13, 18, 19, 20]);
@@ -3699,14 +3720,7 @@
3699
3720
  action = actions_2_1.value;
3700
3721
  conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
3701
3722
  if (!conditionEvaluation) return [3 /*break*/, 16];
3702
- actions_4 = new kwikidToolkit.Action(action, rulesMapping, {
3703
- FIELD_CONFIG: this._field,
3704
- FORM_FIELDS: this._formFields,
3705
- FORM_DATA: this._formData,
3706
- PREVIOUS_FORM_DATA: this._previousFormData,
3707
- ALL_FORMS_DATA: this._allFormsData,
3708
- EXTRA_DATA: this._extraData
3709
- }, this._takeAction);
3723
+ actions_4 = new kwikidToolkit.Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3710
3724
  return [4 /*yield*/, actions_4.execute()];
3711
3725
  case 15:
3712
3726
  _d.sent();
@@ -3726,7 +3740,7 @@
3726
3740
  finally { if (e_2) throw e_2.error; }
3727
3741
  return [7 /*endfinally*/];
3728
3742
  case 20:
3729
- sourceIndex++;
3743
+ sourceIndex += 1;
3730
3744
  _d.label = 21;
3731
3745
  case 21:
3732
3746
  sources_1_1 = sources_1.next();
@@ -3763,14 +3777,7 @@
3763
3777
  apiConfig = this._field.default.api;
3764
3778
  rules = apiConfig.rules;
3765
3779
  actions = apiConfig.actions;
3766
- rulesMapping = new kwikidToolkit.Rule(rules, {
3767
- FIELD_CONFIG: this._field,
3768
- FORM_FIELDS: this._formFields,
3769
- FORM_DATA: this._formData,
3770
- PREVIOUS_FORM_DATA: this._previousFormData,
3771
- ALL_FORMS_DATA: this._allFormsData,
3772
- EXTRA_DATA: this._extraData
3773
- }).mapping();
3780
+ rulesMapping = new kwikidToolkit.Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3774
3781
  _b.label = 1;
3775
3782
  case 1:
3776
3783
  _b.trys.push([1, 6, 7, 8]);
@@ -3781,14 +3788,7 @@
3781
3788
  action = actions_5_1.value;
3782
3789
  conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
3783
3790
  if (!conditionEvaluation) return [3 /*break*/, 4];
3784
- actions_6 = new kwikidToolkit.Action(action, rulesMapping, {
3785
- FIELD_CONFIG: this._field,
3786
- FORM_FIELDS: this._formFields,
3787
- FORM_DATA: this._formData,
3788
- PREVIOUS_FORM_DATA: this._previousFormData,
3789
- ALL_FORMS_DATA: this._allFormsData,
3790
- EXTRA_DATA: this._extraData
3791
- }, this._takeAction);
3791
+ actions_6 = new kwikidToolkit.Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3792
3792
  return [4 /*yield*/, actions_6.execute()];
3793
3793
  case 3:
3794
3794
  _b.sent();
@@ -3822,14 +3822,7 @@
3822
3822
  optionsConfig = this._field.default.options;
3823
3823
  rules = optionsConfig.rules;
3824
3824
  actions = optionsConfig.actions;
3825
- rulesMapping = new kwikidToolkit.Rule(rules, {
3826
- FIELD_CONFIG: this._field,
3827
- FORM_FIELDS: this._formFields,
3828
- FORM_DATA: this._formData,
3829
- PREVIOUS_FORM_DATA: this._previousFormData,
3830
- ALL_FORMS_DATA: this._allFormsData,
3831
- EXTRA_DATA: this._extraData
3832
- }).mapping();
3825
+ rulesMapping = new kwikidToolkit.Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3833
3826
  _b.label = 1;
3834
3827
  case 1:
3835
3828
  _b.trys.push([1, 6, 7, 8]);
@@ -3840,14 +3833,7 @@
3840
3833
  action = actions_7_1.value;
3841
3834
  conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
3842
3835
  if (!conditionEvaluation) return [3 /*break*/, 4];
3843
- actions_8 = new kwikidToolkit.Action(action, rulesMapping, {
3844
- FIELD_CONFIG: this._field,
3845
- FORM_FIELDS: this._formFields,
3846
- FORM_DATA: this._formData,
3847
- PREVIOUS_FORM_DATA: this._previousFormData,
3848
- ALL_FORMS_DATA: this._allFormsData,
3849
- EXTRA_DATA: this._extraData
3850
- }, this._takeAction);
3836
+ actions_8 = new kwikidToolkit.Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3851
3837
  return [4 /*yield*/, actions_8.execute()];
3852
3838
  case 3:
3853
3839
  _b.sent();
@@ -3883,6 +3869,15 @@
3883
3869
  kwikidToolkit.logMethod
3884
3870
  ], Defaults.prototype, "getFormFieldOptions", null);
3885
3871
 
3872
+ function NoWhitespacesValidator() {
3873
+ return function (control) {
3874
+ var value = control.value;
3875
+ if (!value || typeof value !== "string") {
3876
+ return null;
3877
+ }
3878
+ return kwikidToolkit.hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
3879
+ };
3880
+ }
3886
3881
  var FormValidation = /** @class */ (function () {
3887
3882
  function FormValidation() {
3888
3883
  }
@@ -3936,14 +3931,16 @@
3936
3931
  FormValidation.prototype.getFormFieldsValidationErrors = function (formGroup) {
3937
3932
  var errors = [];
3938
3933
  var _loop_1 = function (key) {
3939
- var controlErrors = formGroup.controls[key].errors;
3940
- if (controlErrors !== null && controlErrors !== undefined) {
3941
- Object.keys(controlErrors).forEach(function (keyError) {
3942
- errors.push({
3943
- name: keyError,
3944
- value: controlErrors[keyError]
3934
+ if (kwikidToolkit.isNotEmptyValue(key)) {
3935
+ var controlErrors_1 = formGroup.controls[key].errors;
3936
+ if (controlErrors_1 !== null && controlErrors_1 !== undefined) {
3937
+ Object.keys(controlErrors_1).forEach(function (keyError) {
3938
+ errors.push({
3939
+ name: keyError,
3940
+ value: controlErrors_1[keyError]
3941
+ });
3945
3942
  });
3946
- });
3943
+ }
3947
3944
  }
3948
3945
  };
3949
3946
  for (var key in formGroup.controls) {
@@ -3990,21 +3987,12 @@
3990
3987
  __decorate([
3991
3988
  kwikidToolkit.logMethod
3992
3989
  ], FormValidation.prototype, "getFormFieldsInvalidControls", null);
3993
- function NoWhitespacesValidator() {
3994
- return function (control) {
3995
- var value = control.value;
3996
- if (!value || typeof value !== "string") {
3997
- return null;
3998
- }
3999
- return kwikidToolkit.hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
4000
- };
4001
- }
4002
3990
 
4003
3991
  var KwikIDFormViewService = /** @class */ (function () {
4004
3992
  function KwikIDFormViewService() {
4005
3993
  }
4006
3994
  // 'init' stage of the form
4007
- KwikIDFormViewService.prototype.createFormGroup = function (fields, formData, previousFormData, allFormsData, extraData, takeAction) {
3995
+ KwikIDFormViewService.prototype.createFormGroup = function (fields, object, takeAction) {
4008
3996
  return __awaiter(this, void 0, void 0, function () {
4009
3997
  var formGroup, fields_1, fields_1_1, field, defaults, value, validators, e_1_1;
4010
3998
  var e_1, _a;
@@ -4021,7 +4009,7 @@
4021
4009
  if (!!fields_1_1.done) return [3 /*break*/, 10];
4022
4010
  field = fields_1_1.value;
4023
4011
  if (!field.isFormElement) return [3 /*break*/, 9];
4024
- defaults = new Defaults(field, fields, allFormsData, formData, previousFormData, extraData, takeAction);
4012
+ defaults = new Defaults(field, Object.assign(Object.assign({}, object), { FORM_FIELDS: fields }), takeAction);
4025
4013
  value = "";
4026
4014
  if (!kwikidToolkit.checkObjectKeyExists(field, "default")) return [3 /*break*/, 4];
4027
4015
  if (!kwikidToolkit.checkObjectKeyExists(field.default, "value")) return [3 /*break*/, 4];
@@ -4097,7 +4085,7 @@
4097
4085
  return __generator(this, function (_l) {
4098
4086
  switch (_l.label) {
4099
4087
  case 0:
4100
- if (!(this._request.url.hasOwnProperty("type") &&
4088
+ if (!(kwikidToolkit.checkObjectKeyExists(this._request.url, "type") &&
4101
4089
  this._request.url.type === EApiRequestUrlType.CALCULATED)) return [3 /*break*/, 2];
4102
4090
  source = new kwikidToolkit.Source(this._object);
4103
4091
  return [4 /*yield*/, source.getValueFromSource(this._request.url.props.value.source)];
@@ -4123,7 +4111,7 @@
4123
4111
  return __generator(this, function (_q) {
4124
4112
  switch (_q.label) {
4125
4113
  case 0:
4126
- if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 34];
4114
+ if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 33];
4127
4115
  if (!kwikidToolkit.checkObjectKeyExists(this._request.body, "params")) return [3 /*break*/, 23];
4128
4116
  params = this._request.body.params;
4129
4117
  paramIndex = 0;
@@ -4184,7 +4172,7 @@
4184
4172
  finally { if (e_1) throw e_1.error; }
4185
4173
  return [7 /*endfinally*/];
4186
4174
  case 12:
4187
- sourceIndex++;
4175
+ sourceIndex += 1;
4188
4176
  _q.label = 13;
4189
4177
  case 13:
4190
4178
  sources_1_1 = sources_1.next();
@@ -4201,7 +4189,7 @@
4201
4189
  finally { if (e_2) throw e_2.error; }
4202
4190
  return [7 /*endfinally*/];
4203
4191
  case 17:
4204
- paramIndex++;
4192
+ paramIndex += 1;
4205
4193
  _q.label = 18;
4206
4194
  case 18:
4207
4195
  params_1_1 = params_1.next();
@@ -4256,9 +4244,7 @@
4256
4244
  return [7 /*endfinally*/];
4257
4245
  case 31: return [2 /*return*/, this._object.API_CONFIG];
4258
4246
  case 32: return [2 /*return*/, this._object.API_CONFIG];
4259
- case 33: return [3 /*break*/, 35];
4260
- case 34: return [2 /*return*/, this._object.API_CONFIG];
4261
- case 35: return [2 /*return*/];
4247
+ case 33: return [2 /*return*/, this._object.API_CONFIG];
4262
4248
  }
4263
4249
  });
4264
4250
  });
@@ -4271,7 +4257,7 @@
4271
4257
  return __generator(this, function (_o) {
4272
4258
  switch (_o.label) {
4273
4259
  case 0:
4274
- if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 20];
4260
+ if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 19];
4275
4261
  if (!kwikidToolkit.checkObjectKeyExists(this._request.body, "validation")) return [3 /*break*/, 9];
4276
4262
  body = this._request.body;
4277
4263
  validation = body.validation;
@@ -4349,11 +4335,9 @@
4349
4335
  case 18:
4350
4336
  this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
4351
4337
  return [2 /*return*/, this._object.API_CONFIG];
4352
- case 19: return [3 /*break*/, 21];
4353
- case 20:
4338
+ case 19:
4354
4339
  this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
4355
4340
  return [2 /*return*/, this._object.API_CONFIG];
4356
- case 21: return [2 /*return*/];
4357
4341
  }
4358
4342
  });
4359
4343
  });
@@ -4366,7 +4350,7 @@
4366
4350
  return __generator(this, function (_q) {
4367
4351
  switch (_q.label) {
4368
4352
  case 0:
4369
- if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 34];
4353
+ if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 33];
4370
4354
  if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "params")) return [3 /*break*/, 23];
4371
4355
  params = this._request.headers.params;
4372
4356
  paramIndex = 0;
@@ -4427,7 +4411,7 @@
4427
4411
  finally { if (e_7) throw e_7.error; }
4428
4412
  return [7 /*endfinally*/];
4429
4413
  case 12:
4430
- sourceIndex++;
4414
+ sourceIndex += 1;
4431
4415
  _q.label = 13;
4432
4416
  case 13:
4433
4417
  sources_3_1 = sources_3.next();
@@ -4444,7 +4428,7 @@
4444
4428
  finally { if (e_8) throw e_8.error; }
4445
4429
  return [7 /*endfinally*/];
4446
4430
  case 17:
4447
- paramIndex++;
4431
+ paramIndex += 1;
4448
4432
  _q.label = 18;
4449
4433
  case 18:
4450
4434
  params_2_1 = params_2.next();
@@ -4499,9 +4483,7 @@
4499
4483
  return [7 /*endfinally*/];
4500
4484
  case 31: return [2 /*return*/, this._object.API_CONFIG];
4501
4485
  case 32: return [2 /*return*/, this._object.API_CONFIG];
4502
- case 33: return [3 /*break*/, 35];
4503
- case 34: return [2 /*return*/, this._object.API_CONFIG];
4504
- case 35: return [2 /*return*/];
4486
+ case 33: return [2 /*return*/, this._object.API_CONFIG];
4505
4487
  }
4506
4488
  });
4507
4489
  });
@@ -4515,7 +4497,7 @@
4515
4497
  switch (_o.label) {
4516
4498
  case 0:
4517
4499
  headers = this._request.headers;
4518
- if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 20];
4500
+ if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 19];
4519
4501
  if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "validation")) return [3 /*break*/, 9];
4520
4502
  validation = headers.validation;
4521
4503
  triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
@@ -4592,11 +4574,9 @@
4592
4574
  case 18:
4593
4575
  this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
4594
4576
  return [2 /*return*/, this._object.API_CONFIG];
4595
- case 19: return [3 /*break*/, 21];
4596
- case 20:
4577
+ case 19:
4597
4578
  this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
4598
4579
  return [2 /*return*/, this._object.API_CONFIG];
4599
- case 21: return [2 /*return*/];
4600
4580
  }
4601
4581
  });
4602
4582
  });
@@ -4757,61 +4737,61 @@
4757
4737
  ], Apis.prototype, "callNextApi", null);
4758
4738
 
4759
4739
  var CameraHelper = /** @class */ (function () {
4760
- function CameraHelper(field, formFields, allFormsData, formData, previousFormData, extraData) {
4761
- this.cameraData = {};
4740
+ function CameraHelper(field, object) {
4741
+ this.activeCameraData = {};
4762
4742
  this._field = field;
4763
- this._formFields = formFields;
4764
- this._allFormsData = allFormsData;
4765
- this._formData = formData;
4766
- this._previousFormData = previousFormData;
4767
- this._extraData = extraData;
4743
+ this._object = object;
4768
4744
  }
4745
+ Object.defineProperty(CameraHelper.prototype, "object", {
4746
+ get: function () {
4747
+ return this._object;
4748
+ },
4749
+ set: function (value) {
4750
+ this._object = value;
4751
+ },
4752
+ enumerable: false,
4753
+ configurable: true
4754
+ });
4769
4755
  CameraHelper.prototype.getCameraWatermarkData = function () {
4756
+ var _a, _b;
4770
4757
  return __awaiter(this, void 0, void 0, function () {
4771
4758
  var sources, sources_1, sources_1_1, source, sources_2, value, e_1_1;
4772
- var e_1, _a;
4773
- return __generator(this, function (_b) {
4774
- switch (_b.label) {
4759
+ var e_1, _c;
4760
+ return __generator(this, function (_d) {
4761
+ switch (_d.label) {
4775
4762
  case 0:
4776
- sources = this._field.properties["watermarkDataSources"];
4777
- _b.label = 1;
4763
+ sources = (_b = (_a = this._field.properties.features) === null || _a === void 0 ? void 0 : _a.watermark) === null || _b === void 0 ? void 0 : _b.sources;
4764
+ _d.label = 1;
4778
4765
  case 1:
4779
- _b.trys.push([1, 6, 7, 8]);
4766
+ _d.trys.push([1, 6, 7, 8]);
4780
4767
  sources_1 = __values(sources), sources_1_1 = sources_1.next();
4781
- _b.label = 2;
4768
+ _d.label = 2;
4782
4769
  case 2:
4783
4770
  if (!!sources_1_1.done) return [3 /*break*/, 5];
4784
4771
  source = sources_1_1.value;
4785
- sources_2 = new kwikidToolkit.Source({
4786
- FIELD_CONFIG: this._field,
4787
- FORM_FIELDS: this._formFields,
4788
- FORM_DATA: this._formData,
4789
- PREVIOUS_FORM_DATA: this._previousFormData,
4790
- ALL_FORMS_DATA: this._allFormsData,
4791
- EXTRA_DATA: this._extraData
4792
- });
4772
+ sources_2 = new kwikidToolkit.Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
4793
4773
  return [4 /*yield*/, sources_2.getValueFromSource(source)];
4794
4774
  case 3:
4795
- value = _b.sent();
4775
+ value = _d.sent();
4796
4776
  if (kwikidToolkit.checkObjectKeyExists(source, "id")) {
4797
- this.cameraData[source.id] = value;
4777
+ this.activeCameraData[source.id] = value;
4798
4778
  }
4799
- _b.label = 4;
4779
+ _d.label = 4;
4800
4780
  case 4:
4801
4781
  sources_1_1 = sources_1.next();
4802
4782
  return [3 /*break*/, 2];
4803
4783
  case 5: return [3 /*break*/, 8];
4804
4784
  case 6:
4805
- e_1_1 = _b.sent();
4785
+ e_1_1 = _d.sent();
4806
4786
  e_1 = { error: e_1_1 };
4807
4787
  return [3 /*break*/, 8];
4808
4788
  case 7:
4809
4789
  try {
4810
- if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
4790
+ if (sources_1_1 && !sources_1_1.done && (_c = sources_1.return)) _c.call(sources_1);
4811
4791
  }
4812
4792
  finally { if (e_1) throw e_1.error; }
4813
4793
  return [7 /*endfinally*/];
4814
- case 8: return [2 /*return*/, this.cameraData];
4794
+ case 8: return [2 /*return*/, this.activeCameraData];
4815
4795
  }
4816
4796
  });
4817
4797
  });
@@ -4848,20 +4828,18 @@
4848
4828
  }
4849
4829
  Tasks.prototype.execute = function () {
4850
4830
  return __awaiter(this, void 0, void 0, function () {
4851
- var triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_1_1;
4852
- var e_1, _a;
4853
- return __generator(this, function (_b) {
4854
- switch (_b.label) {
4831
+ var _a, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_1_1;
4832
+ var e_1, _b;
4833
+ return __generator(this, function (_c) {
4834
+ switch (_c.label) {
4855
4835
  case 0:
4856
- triggers = this._task.triggers;
4857
- rules = this._task.rules;
4858
- actions = this._task.actions;
4836
+ _a = this._task, triggers = _a.triggers, rules = _a.rules, actions = _a.actions;
4859
4837
  rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
4860
- _b.label = 1;
4838
+ _c.label = 1;
4861
4839
  case 1:
4862
- _b.trys.push([1, 6, 7, 8]);
4840
+ _c.trys.push([1, 6, 7, 8]);
4863
4841
  actions_1 = __values(actions), actions_1_1 = actions_1.next();
4864
- _b.label = 2;
4842
+ _c.label = 2;
4865
4843
  case 2:
4866
4844
  if (!!actions_1_1.done) return [3 /*break*/, 5];
4867
4845
  action = actions_1_1.value;
@@ -4870,19 +4848,19 @@
4870
4848
  actions_2 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
4871
4849
  return [4 /*yield*/, actions_2.execute()];
4872
4850
  case 3:
4873
- _b.sent();
4874
- _b.label = 4;
4851
+ _c.sent();
4852
+ _c.label = 4;
4875
4853
  case 4:
4876
4854
  actions_1_1 = actions_1.next();
4877
4855
  return [3 /*break*/, 2];
4878
4856
  case 5: return [3 /*break*/, 8];
4879
4857
  case 6:
4880
- e_1_1 = _b.sent();
4858
+ e_1_1 = _c.sent();
4881
4859
  e_1 = { error: e_1_1 };
4882
4860
  return [3 /*break*/, 8];
4883
4861
  case 7:
4884
4862
  try {
4885
- if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);
4863
+ if (actions_1_1 && !actions_1_1.done && (_b = actions_1.return)) _b.call(actions_1);
4886
4864
  }
4887
4865
  finally { if (e_1) throw e_1.error; }
4888
4866
  return [7 /*endfinally*/];
@@ -4915,6 +4893,69 @@
4915
4893
  }]
4916
4894
  }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }]; } });
4917
4895
 
4896
+ var FilterImageUrlOrBase64FromObjectPipe = /** @class */ (function () {
4897
+ function FilterImageUrlOrBase64FromObjectPipe() {
4898
+ }
4899
+ FilterImageUrlOrBase64FromObjectPipe.prototype.transform = function (mediaFiles) {
4900
+ if (kwikidToolkit.isEmptyValue(mediaFiles)) {
4901
+ return [];
4902
+ }
4903
+ return mediaFiles
4904
+ .map(function (item) {
4905
+ if (kwikidToolkit.isObject(item) && kwikidToolkit.checkObjectKeyExists(item, "image")) {
4906
+ return item.image;
4907
+ }
4908
+ if (kwikidToolkit.isNotEmptyValue(item)) {
4909
+ return item;
4910
+ }
4911
+ return null; // Use null to filter out unwanted items
4912
+ })
4913
+ .filter(function (item) { return kwikidToolkit.isNotEmptyValue(item); });
4914
+ };
4915
+ return FilterImageUrlOrBase64FromObjectPipe;
4916
+ }());
4917
+ /** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterImageUrlOrBase64FromObjectPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
4918
+ /** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterImageUrlOrBase64FromObjectPipe, name: "filterImageUrlOrBase64FromObject" });
4919
+ __decorate([
4920
+ kwikidToolkit.logMethod
4921
+ ], FilterImageUrlOrBase64FromObjectPipe.prototype, "transform", null);
4922
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterImageUrlOrBase64FromObjectPipe, decorators: [{
4923
+ type: i0.Pipe,
4924
+ args: [{
4925
+ name: "filterImageUrlOrBase64FromObject"
4926
+ }]
4927
+ }], propDecorators: { transform: [] } });
4928
+
4929
+ var FilterVideoUrlOrBase64FromObjectPipe = /** @class */ (function () {
4930
+ function FilterVideoUrlOrBase64FromObjectPipe() {
4931
+ }
4932
+ FilterVideoUrlOrBase64FromObjectPipe.prototype.transform = function (mediaFiles) {
4933
+ if (kwikidToolkit.isEmptyValue(mediaFiles)) {
4934
+ return [];
4935
+ }
4936
+ return mediaFiles
4937
+ .map(function (item) {
4938
+ if (kwikidToolkit.isObject(item) && kwikidToolkit.checkObjectKeyExists(item, "video")) {
4939
+ return item.video;
4940
+ }
4941
+ if (kwikidToolkit.isNotEmptyValue(item)) {
4942
+ return item;
4943
+ }
4944
+ return null; // Use null to filter out unwanted items
4945
+ })
4946
+ .filter(function (item) { return kwikidToolkit.isNotEmptyValue(item); });
4947
+ };
4948
+ return FilterVideoUrlOrBase64FromObjectPipe;
4949
+ }());
4950
+ /** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterVideoUrlOrBase64FromObjectPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
4951
+ /** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterVideoUrlOrBase64FromObjectPipe, name: "filterVideoUrlOrBase64FromObject" });
4952
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FilterVideoUrlOrBase64FromObjectPipe, decorators: [{
4953
+ type: i0.Pipe,
4954
+ args: [{
4955
+ name: "filterVideoUrlOrBase64FromObject"
4956
+ }]
4957
+ }] });
4958
+
4918
4959
  var TimerPipe = /** @class */ (function () {
4919
4960
  function TimerPipe() {
4920
4961
  }
@@ -4964,18 +5005,19 @@
4964
5005
  this.fieldGroups = {};
4965
5006
  this.formFields = [];
4966
5007
  this.previousFormData = {};
5008
+ this.cameraData = {};
4967
5009
  this.isShowCamera = false;
4968
5010
  this.isShowCameraFullscreen = false;
4969
- this.cameraFieldKey = "";
4970
- this.cameraData = undefined;
4971
- this.cameraType = undefined;
4972
- this.cameraImage = "";
4973
- this.cameraVideo = "";
4974
- this.cameraConfig = undefined;
4975
- this.cameraRecordingTime = 0;
4976
- this.cameraRecordingTimerSubcription = undefined;
4977
- this.cameraRecordingState = "NONE";
4978
- this.cameraRecordingStateSubcription = undefined;
5011
+ this.activeCameraFieldKey = "";
5012
+ this.activeCameraData = {};
5013
+ this.activeCameraType = undefined;
5014
+ this.activeCameraImage = "";
5015
+ this.activeCameraVideo = "";
5016
+ this.activeCameraConfig = undefined;
5017
+ this.activeCameraRecordingTime = 0;
5018
+ this.activeCameraRecordingTimerSubcription = undefined;
5019
+ this.activeCameraRecordingState = "NONE";
5020
+ this.activeCameraRecordingStateSubcription = undefined;
4979
5021
  this.previewProperties = {
4980
5022
  html: {
4981
5023
  before: "",
@@ -5022,14 +5064,14 @@
5022
5064
  KwikIDFormViewComponent.prototype.resetCamera = function () {
5023
5065
  this.isShowCamera = false;
5024
5066
  this.isShowCameraFullscreen = false;
5025
- this.cameraFieldKey = "";
5026
- this.cameraData = undefined;
5027
- this.cameraType = undefined;
5028
- this.cameraImage = "";
5029
- this.cameraVideo = "";
5030
- this.cameraConfig = undefined;
5031
- this.cameraRecordingTime = 0;
5032
- this.cameraRecordingState = "NONE";
5067
+ this.activeCameraFieldKey = "";
5068
+ this.activeCameraData = undefined;
5069
+ this.activeCameraType = undefined;
5070
+ this.activeCameraImage = "";
5071
+ this.activeCameraVideo = "";
5072
+ this.activeCameraConfig = undefined;
5073
+ this.activeCameraRecordingTime = 0;
5074
+ this.activeCameraRecordingState = "NONE";
5033
5075
  };
5034
5076
  KwikIDFormViewComponent.prototype.ngOnInit = function () {
5035
5077
  var _this = this;
@@ -5043,16 +5085,16 @@
5043
5085
  res = _15.sent();
5044
5086
  if (res) {
5045
5087
  this.loading = false;
5046
- this.cameraRecordingTimerSubcription = this.cameraRecordService
5088
+ this.activeCameraRecordingTimerSubcription = this.cameraRecordService
5047
5089
  .getTimerUpdate()
5048
5090
  .subscribe(function (time) {
5049
- _this.cameraRecordingTime = time;
5091
+ _this.activeCameraRecordingTime = time;
5050
5092
  _this.ref.detectChanges();
5051
5093
  });
5052
- this.cameraRecordingStateSubcription = this.cameraRecordService
5094
+ this.activeCameraRecordingStateSubcription = this.cameraRecordService
5053
5095
  .getRecordingState()
5054
5096
  .subscribe(function (state) {
5055
- _this.cameraRecordingState = state;
5097
+ _this.activeCameraRecordingState = state;
5056
5098
  _this.ref.detectChanges();
5057
5099
  });
5058
5100
  }
@@ -5080,7 +5122,7 @@
5080
5122
  if (verifyChange("formData")) {
5081
5123
  if (kwikidToolkit.checkObjectKeyExists(changes.formData.currentValue, "data") &&
5082
5124
  kwikidToolkit.checkObjectKeyExists(changes.formData.currentValue, "extendedData")) {
5083
- this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue["data"]);
5125
+ this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue.data);
5084
5126
  }
5085
5127
  else {
5086
5128
  this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
@@ -5090,7 +5132,7 @@
5090
5132
  if (kwikidToolkit.isNotEmptyValue(changes.popupFormCallback.currentValue)) {
5091
5133
  var popupFormData = kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "data") &&
5092
5134
  kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "extendedData")
5093
- ? changes.popupFormCallback.currentValue.popupFormData["data"]
5135
+ ? changes.popupFormCallback.currentValue.popupFormData.data
5094
5136
  : changes.popupFormCallback.currentValue.popupFormData;
5095
5137
  var popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
5096
5138
  this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_15 = {},
@@ -5141,14 +5183,20 @@
5141
5183
  if (response) {
5142
5184
  this.resetCamera();
5143
5185
  var image = response === null || response === void 0 ? void 0 : response.image_url;
5144
- this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]);
5145
- this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]);
5146
- this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy([image]), {
5186
+ var imageOcr = response === null || response === void 0 ? void 0 : response.image_ocr;
5187
+ var imageFacematch = response === null || response === void 0 ? void 0 : response.image_facematch;
5188
+ var imageWatermark = response === null || response === void 0 ? void 0 : response.image_watermark;
5189
+ var imageData = imageOcr || imageFacematch || imageWatermark
5190
+ ? Object.assign(Object.assign(Object.assign({ image: image }, (imageOcr && { ocr: imageOcr })), (imageFacematch && { facematch: imageFacematch })), (imageWatermark && { watermark: imageWatermark })) : image;
5191
+ this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy([imageData]);
5192
+ this.cameraData[field_1.key] = kwikidToolkit.getObjectDeepCopy(imageData);
5193
+ this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy([imageData]);
5194
+ this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy([imageData]), {
5147
5195
  emitEvent: false,
5148
5196
  onlySelf: false
5149
5197
  });
5150
5198
  this.formGroup.patchValue((_16 = {},
5151
- _16[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
5199
+ _16[field_1.key] = kwikidToolkit.getObjectDeepCopy([imageData]),
5152
5200
  _16), { emitEvent: false });
5153
5201
  this.formGroup.controls[field_1.key].updateValueAndValidity({
5154
5202
  emitEvent: false
@@ -5164,6 +5212,7 @@
5164
5212
  FIELD_CONFIG: field_1,
5165
5213
  FORM_FIELDS: this.formFields,
5166
5214
  FORM_DATA: this.formData,
5215
+ CAMERA_DATA: this.cameraData,
5167
5216
  TASK_DATA: this.taskData,
5168
5217
  PREVIOUS_FORM_DATA: this.previousFormData,
5169
5218
  ALL_FORMS_DATA: this.allFormsData,
@@ -5209,6 +5258,7 @@
5209
5258
  this.resetCamera();
5210
5259
  var video = response === null || response === void 0 ? void 0 : response.video_url;
5211
5260
  this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]);
5261
+ this.cameraData[field_1.key] = kwikidToolkit.getObjectDeepCopy(video);
5212
5262
  this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]);
5213
5263
  this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy([video]), {
5214
5264
  emitEvent: false,
@@ -5231,6 +5281,7 @@
5231
5281
  FIELD_CONFIG: field_1,
5232
5282
  FORM_FIELDS: this.formFields,
5233
5283
  FORM_DATA: this.formData,
5284
+ CAMERA_DATA: this.cameraData,
5234
5285
  TASK_DATA: this.taskData,
5235
5286
  PREVIOUS_FORM_DATA: this.previousFormData,
5236
5287
  ALL_FORMS_DATA: this.allFormsData,
@@ -5274,7 +5325,6 @@
5274
5325
  case EFieldType.LIVE_LOCATION:
5275
5326
  if (response) {
5276
5327
  this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy(response);
5277
- this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy(response);
5278
5328
  this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy(response), {
5279
5329
  emitEvent: false,
5280
5330
  onlySelf: false
@@ -5295,6 +5345,7 @@
5295
5345
  API_RESPONSE: response,
5296
5346
  FORM_FIELDS: this.formFields,
5297
5347
  FORM_DATA: this.formData,
5348
+ CAMERA_DATA: this.cameraData,
5298
5349
  TASK_DATA: this.taskData,
5299
5350
  PREVIOUS_FORM_DATA: this.previousFormData,
5300
5351
  ALL_FORMS_DATA: this.allFormsData,
@@ -5319,6 +5370,7 @@
5319
5370
  FIELD_CONFIG: field_1,
5320
5371
  FORM_FIELDS: this.formFields,
5321
5372
  FORM_DATA: this.formData,
5373
+ CAMERA_DATA: this.cameraData,
5322
5374
  TASK_DATA: this.taskData,
5323
5375
  PREVIOUS_FORM_DATA: this.previousFormData,
5324
5376
  ALL_FORMS_DATA: this.allFormsData,
@@ -5362,6 +5414,7 @@
5362
5414
  API_RESPONSE: {},
5363
5415
  FORM_FIELDS: this.formFields,
5364
5416
  FORM_DATA: this.formData,
5417
+ CAMERA_DATA: this.cameraData,
5365
5418
  TASK_DATA: this.taskData,
5366
5419
  PREVIOUS_FORM_DATA: this.previousFormData,
5367
5420
  ALL_FORMS_DATA: this.allFormsData,
@@ -5393,15 +5446,15 @@
5393
5446
  var field_2 = getFormFieldByKey(this.formFields, (_d = this.buttonClickResponse) === null || _d === void 0 ? void 0 : _d.key);
5394
5447
  if (kwikidToolkit.checkObjectKeyExists(this.buttonClickResponse, "default")) {
5395
5448
  field_2.default = kwikidToolkit.getObjectDeepCopy(this.buttonClickResponse.default);
5396
- delete this.buttonClickResponse["default"];
5449
+ delete this.buttonClickResponse.default;
5397
5450
  }
5398
5451
  if (kwikidToolkit.checkObjectKeyExists(this.buttonClickResponse, "messages")) {
5399
5452
  field_2.messages = kwikidToolkit.getObjectDeepCopy(this.buttonClickResponse.messages);
5400
- delete this.buttonClickResponse["messages"];
5453
+ delete this.buttonClickResponse.messages;
5401
5454
  }
5402
5455
  if (kwikidToolkit.checkObjectKeyExists(this.buttonClickResponse, "validation")) {
5403
5456
  field_2.validation = kwikidToolkit.getObjectDeepCopy(this.buttonClickResponse.validation);
5404
- delete this.buttonClickResponse["validation"];
5457
+ delete this.buttonClickResponse.validation;
5405
5458
  }
5406
5459
  field_2 = kwikidToolkit.getObjectDeepCopy(kwikidToolkit.mergeObjects(field_2, this.buttonClickResponse));
5407
5460
  if (kwikidToolkit.checkObjectKeyExists(field_2, "validation")) {
@@ -5411,6 +5464,7 @@
5411
5464
  FIELD_CONFIG: field_2,
5412
5465
  FORM_FIELDS: this.formFields,
5413
5466
  FORM_DATA: this.formData,
5467
+ CAMERA_DATA: this.cameraData,
5414
5468
  TASK_DATA: this.taskData,
5415
5469
  PREVIOUS_FORM_DATA: this.previousFormData,
5416
5470
  ALL_FORMS_DATA: this.allFormsData,
@@ -5448,11 +5502,11 @@
5448
5502
  }
5449
5503
  };
5450
5504
  KwikIDFormViewComponent.prototype.ngOnDestroy = function () {
5451
- if (this.cameraRecordingTimerSubcription) {
5452
- this.cameraRecordingTimerSubcription.unsubscribe();
5505
+ if (this.activeCameraRecordingTimerSubcription) {
5506
+ this.activeCameraRecordingTimerSubcription.unsubscribe();
5453
5507
  }
5454
- if (this.cameraRecordingStateSubcription) {
5455
- this.cameraRecordingStateSubcription.unsubscribe();
5508
+ if (this.activeCameraRecordingStateSubcription) {
5509
+ this.activeCameraRecordingStateSubcription.unsubscribe();
5456
5510
  }
5457
5511
  };
5458
5512
  KwikIDFormViewComponent.prototype.triggerLogs = function (eventType, logs) {
@@ -5490,6 +5544,7 @@
5490
5544
  FORM_CONFIG: this.formConfig,
5491
5545
  FORM_FIELDS: this.formFields,
5492
5546
  FORM_DATA: this.formData,
5547
+ CAMERA_DATA: this.cameraData,
5493
5548
  TASK_DATA: this.taskData,
5494
5549
  PREVIOUS_FORM_DATA: this.previousFormData,
5495
5550
  ALL_FORMS_DATA: this.allFormsData,
@@ -5512,7 +5567,7 @@
5512
5567
  clearInterval(intervalId);
5513
5568
  resolve();
5514
5569
  }
5515
- }, 10);
5570
+ }, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
5516
5571
  })];
5517
5572
  case 4:
5518
5573
  // Wait for ngOnChanges to be called before continuing to the next task
@@ -5543,7 +5598,15 @@
5543
5598
  return [2 /*return*/, false];
5544
5599
  }
5545
5600
  _17 = this;
5546
- return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.extraData, this.takeAction.bind(this))];
5601
+ return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, {
5602
+ FORM_CONFIG: this.formConfig,
5603
+ FORM_DATA: this.formData,
5604
+ CAMERA_DATA: this.cameraData,
5605
+ TASK_DATA: this.taskData,
5606
+ PREVIOUS_FORM_DATA: this.previousFormData,
5607
+ ALL_FORMS_DATA: this.allFormsData,
5608
+ EXTRA_DATA: this.extraData
5609
+ }, this.takeAction.bind(this))];
5547
5610
  case 11:
5548
5611
  _17.formGroup = _25.sent();
5549
5612
  /**
@@ -5552,10 +5615,10 @@
5552
5615
  * Below piece of code is to remove that redundent value from formData.
5553
5616
  */
5554
5617
  if (kwikidToolkit.checkObjectKeyExists(this.formData, "undefined")) {
5555
- delete this.formData["undefined"];
5618
+ delete this.formData.undefined;
5556
5619
  }
5557
5620
  _loop_1 = function (field) {
5558
- var _26, _27;
5621
+ var _26, _27, _28, _29;
5559
5622
  if (field.isFormElement) {
5560
5623
  this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_26 = {}, _26[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _26));
5561
5624
  this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_27 = {}, _27[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _27));
@@ -5564,17 +5627,19 @@
5564
5627
  }
5565
5628
  if (field.type === EFieldType.CAPTURE) {
5566
5629
  this_1.resetCamera();
5630
+ this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_28 = {}, _28[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _28));
5567
5631
  this_1.mediaFiles[field.key] = this_1.formGroup.controls[field.key].value;
5568
5632
  }
5569
5633
  if (field.type === EFieldType.RECORD) {
5570
5634
  this_1.resetCamera();
5635
+ this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_29 = {}, _29[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _29));
5571
5636
  this_1.mediaFiles[field.key] = this_1.formGroup.controls[field.key].value;
5572
5637
  }
5573
5638
  this_1.formGroup.controls[field.key].valueChanges
5574
5639
  .pipe(operators.pairwise())
5575
5640
  .subscribe(function (_15) {
5576
- var _16, _17;
5577
- var _18 = __read(_15, 2), previousValue = _18[0], currentValue = _18[1];
5641
+ var _16, _17, _18, _19;
5642
+ var _20 = __read(_15, 2), previousValue = _20[0], currentValue = _20[1];
5578
5643
  _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_16 = {}, _16[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _16));
5579
5644
  _this.formData = Object.assign(Object.assign({}, _this.formData), (_17 = {}, _17[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _17));
5580
5645
  if (field.type === EFieldType.FILE) {
@@ -5582,10 +5647,12 @@
5582
5647
  }
5583
5648
  if (field.type === EFieldType.CAPTURE) {
5584
5649
  _this.resetCamera();
5650
+ _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_18 = {}, _18[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _18));
5585
5651
  _this.mediaFiles[field.key] = currentValue;
5586
5652
  }
5587
5653
  if (field.type === EFieldType.RECORD) {
5588
5654
  _this.resetCamera();
5655
+ _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_19 = {}, _19[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _19));
5589
5656
  _this.mediaFiles[field.key] = currentValue;
5590
5657
  }
5591
5658
  });
@@ -5620,6 +5687,7 @@
5620
5687
  FIELD_CONFIG: field,
5621
5688
  FORM_FIELDS: this.formFields,
5622
5689
  FORM_DATA: this.formData,
5690
+ CAMERA_DATA: this.cameraData,
5623
5691
  TASK_DATA: this.taskData,
5624
5692
  PREVIOUS_FORM_DATA: this.previousFormData,
5625
5693
  ALL_FORMS_DATA: this.allFormsData,
@@ -5673,7 +5741,7 @@
5673
5741
  var formData = this.allFormsData[this.formConfig.key];
5674
5742
  if (kwikidToolkit.checkObjectKeyExists(formData, "data") &&
5675
5743
  kwikidToolkit.checkObjectKeyExists(formData, "extendedData")) {
5676
- this.formData = Object.assign(Object.assign({}, this.formData), formData["data"]);
5744
+ this.formData = Object.assign(Object.assign({}, this.formData), formData.data);
5677
5745
  }
5678
5746
  else {
5679
5747
  this.formData = Object.assign(Object.assign({}, this.formData), formData);
@@ -5694,6 +5762,7 @@
5694
5762
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
5695
5763
  FIELD_CONFIG: parentField,
5696
5764
  FORM_DATA: this.formData,
5765
+ CAMERA_DATA: this.cameraData,
5697
5766
  TASK_DATA: this.taskData,
5698
5767
  PREVIOUS_FORM_DATA: this.previousFormData,
5699
5768
  ALL_FORMS_DATA: this.allFormsData,
@@ -5713,6 +5782,7 @@
5713
5782
  FIELD_CONFIG: parentField,
5714
5783
  FORM_FIELDS: this.formFields,
5715
5784
  FORM_DATA: this.formData,
5785
+ CAMERA_DATA: this.cameraData,
5716
5786
  TASK_DATA: this.taskData,
5717
5787
  PREVIOUS_FORM_DATA: this.previousFormData,
5718
5788
  ALL_FORMS_DATA: this.allFormsData,
@@ -5768,6 +5838,7 @@
5768
5838
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
5769
5839
  FIELD_CONFIG: connectedField,
5770
5840
  FORM_DATA: this.formData,
5841
+ CAMERA_DATA: this.cameraData,
5771
5842
  TASK_DATA: this.taskData,
5772
5843
  PREVIOUS_FORM_DATA: this.previousFormData,
5773
5844
  ALL_FORMS_DATA: this.allFormsData,
@@ -5787,6 +5858,7 @@
5787
5858
  FORM_FIELDS: this.formFields,
5788
5859
  FIELD_CONFIG: connectedField,
5789
5860
  FORM_DATA: this.formData,
5861
+ CAMERA_DATA: this.cameraData,
5790
5862
  TASK_DATA: this.taskData,
5791
5863
  PREVIOUS_FORM_DATA: this.previousFormData,
5792
5864
  ALL_FORMS_DATA: this.allFormsData,
@@ -5821,7 +5893,7 @@
5821
5893
  return __generator(this, function (_15) {
5822
5894
  switch (_15.label) {
5823
5895
  case 0:
5824
- connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
5896
+ connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig.key);
5825
5897
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
5826
5898
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5827
5899
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
@@ -5917,7 +5989,7 @@
5917
5989
  var _15;
5918
5990
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5919
5991
  this.showApiLoader();
5920
- if (this.formGroup["controls"][e.key].enabled) {
5992
+ if (this.formGroup.controls[e.key].enabled) {
5921
5993
  this.files[e.key] = e.files;
5922
5994
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
5923
5995
  this.formGroup.patchValue((_15 = {},
@@ -5997,7 +6069,7 @@
5997
6069
  lastModified: value.lastModified,
5998
6070
  webkitRelativePath: value.webkitRelativePath
5999
6071
  });
6000
- }, 300); // 1000 ms = 1 sec
6072
+ }, FORM_VIEW_TIMERS.WAIT_FOR_FILE_METADATA_DEEPCOPY); // 1000 ms = 1 sec
6001
6073
  })];
6002
6074
  case 1:
6003
6075
  updatedFile = _18.apply(void 0, [_19.sent()]);
@@ -6044,23 +6116,60 @@
6044
6116
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
6045
6117
  KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
6046
6118
  var _15;
6119
+ var _this = this;
6047
6120
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
6048
- this.showApiLoader();
6049
- if (this.formGroup["controls"][e.key].enabled) {
6121
+ if (this.formGroup.controls[e.key].enabled) {
6122
+ this.showApiLoader();
6123
+ var field_3 = getFormFieldByKey(this.formFields, e.key);
6050
6124
  this.resetCamera();
6051
6125
  this.mediaFiles[e.key] = e.mediaFiles;
6052
6126
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
6127
+ this.cameraData[e.key] = convertFormFieldValueToStandardFormat(field_3, this.formData[e.key]);
6053
6128
  this.formGroup.patchValue((_15 = {},
6054
6129
  _15[e.key] = this.formData[e.key],
6055
6130
  _15), { emitEvent: false });
6056
6131
  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 })));
6132
+ this.getUnsavedDataState.emit(true);
6133
+ if (field_3.isFormElement &&
6134
+ kwikidToolkit.checkObjectKeyExists(field_3, "validation") &&
6135
+ field_3.validation.triggers.includes("ON_CHANGE")) {
6136
+ var ruleEngine_5 = new kwikidToolkit.RuleEngine({
6137
+ FIELD_CONFIG: field_3,
6138
+ FORM_FIELDS: this.formFields,
6139
+ FORM_DATA: this.formData,
6140
+ CAMERA_DATA: this.cameraData,
6141
+ TASK_DATA: this.taskData,
6142
+ PREVIOUS_FORM_DATA: this.previousFormData,
6143
+ ALL_FORMS_DATA: this.allFormsData,
6144
+ EXTRA_DATA: this.extraData
6145
+ }, this.takeAction.bind(this));
6146
+ (function () { return __awaiter(_this, void 0, void 0, function () {
6147
+ return __generator(this, function (_15) {
6148
+ switch (_15.label) {
6149
+ case 0: return [4 /*yield*/, ruleEngine_5.run(field_3.validation)];
6150
+ case 1:
6151
+ _15.sent();
6152
+ return [2 /*return*/];
6153
+ }
6154
+ });
6155
+ }); })();
6156
+ }
6157
+ if (field_3.isFormElement &&
6158
+ kwikidToolkit.checkObjectKeyExists(field_3, "connectedElements")) {
6159
+ this.handleConnectedElements({
6160
+ key: field_3.key,
6161
+ value: this.formGroup.controls[field_3.key].value
6162
+ }, "ON_CHANGE");
6163
+ }
6164
+ setTimeout(function () {
6165
+ _this.hideApiLoader();
6166
+ }, 500);
6057
6167
  }
6058
- this.hideApiLoader();
6059
6168
  };
6060
6169
  KwikIDFormViewComponent.prototype.handleOnClickInputCamera = function (e, field) {
6061
6170
  var _a, _b, _c, _d, _e, _f;
6062
6171
  return __awaiter(this, void 0, void 0, function () {
6063
- var fieldKey, fieldcameraConfig, _15, cameraHelper, _16, _17;
6172
+ var fieldKey, fieldCameraConfig, _15, cameraHelper, _16, _17;
6064
6173
  return __generator(this, function (_18) {
6065
6174
  switch (_18.label) {
6066
6175
  case 0:
@@ -6069,49 +6178,56 @@
6069
6178
  fullscreen: true
6070
6179
  });
6071
6180
  fieldKey = field.key;
6072
- fieldcameraConfig = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) !== null && _b !== void 0 ? _b : {};
6073
- this.cameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
6074
- this.cameraFieldKey = fieldKey;
6181
+ fieldCameraConfig = (_a = field === null || field === void 0 ? void 0 : field.properties) !== null && _a !== void 0 ? _a : {};
6182
+ this.activeCameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
6183
+ this.activeCameraFieldKey = fieldKey;
6075
6184
  this.triggerLogs(ELogEventType$1.FORM__FIELD_CAMERA_BUTTON_CLICK, {
6076
6185
  field_key: field.key,
6077
6186
  field_type: field.type,
6078
- camera_type: this.cameraType
6187
+ camera_type: this.activeCameraType
6079
6188
  });
6080
- _15 = this.cameraType;
6189
+ _15 = this.activeCameraType;
6081
6190
  switch (_15) {
6082
6191
  case "CAPTURE": return [3 /*break*/, 1];
6083
- case "RECORD": return [3 /*break*/, 5];
6192
+ case "RECORD": return [3 /*break*/, 4];
6084
6193
  }
6085
- return [3 /*break*/, 6];
6194
+ return [3 /*break*/, 5];
6086
6195
  case 1:
6087
- this.cameraConfig = kwikidToolkit.mergeObjectsDeep([
6088
- FIELD_PROPERTIES.capture.cameraConfig,
6089
- fieldcameraConfig
6196
+ this.activeCameraConfig = kwikidToolkit.mergeObjectsDeep([
6197
+ FIELD_PROPERTIES.capture,
6198
+ fieldCameraConfig
6090
6199
  ]);
6091
- if (!(((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark) ||
6092
- ((_f = (_e = this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.isWatermarkForImageUpload))) return [3 /*break*/, 3];
6093
- cameraHelper = new CameraHelper(field, this.formFields, this.allFormsData, this.formData, this.previousFormData, this.extraData);
6200
+ this.activeCameraData = {};
6201
+ if (!(((_d = (_c = (_b = this.activeCameraConfig) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c.watermark) === null || _d === void 0 ? void 0 : _d.isEnabled) &&
6202
+ !((_f = (_e = this.activeCameraConfig.features) === null || _e === void 0 ? void 0 : _e.watermark) === null || _f === void 0 ? void 0 : _f.isWatermarkFromServer))) return [3 /*break*/, 3];
6203
+ cameraHelper = new CameraHelper(field, {
6204
+ FORM_FIELDS: this.formFields,
6205
+ FIELD_CONFIG: field,
6206
+ FORM_DATA: this.formData,
6207
+ CAMERA_DATA: this.cameraData,
6208
+ TASK_DATA: this.taskData,
6209
+ PREVIOUS_FORM_DATA: this.previousFormData,
6210
+ ALL_FORMS_DATA: this.allFormsData,
6211
+ EXTRA_DATA: this.extraData
6212
+ });
6094
6213
  _16 = this;
6095
6214
  _17 = {};
6096
6215
  return [4 /*yield*/, cameraHelper.getCameraWatermarkData()];
6097
6216
  case 2:
6098
- _16.cameraData = (_17.watermark = _18.sent(),
6217
+ _16.activeCameraData = (_17.watermark = _18.sent(),
6099
6218
  _17);
6100
- return [3 /*break*/, 4];
6101
- case 3:
6102
- this.cameraData = undefined;
6103
- _18.label = 4;
6104
- case 4: return [3 /*break*/, 7];
6105
- case 5:
6106
- this.cameraConfig = kwikidToolkit.mergeObjectsDeep([
6107
- FIELD_PROPERTIES.record.cameraConfig,
6108
- fieldcameraConfig
6219
+ _18.label = 3;
6220
+ case 3: return [3 /*break*/, 6];
6221
+ case 4:
6222
+ this.activeCameraConfig = kwikidToolkit.mergeObjectsDeep([
6223
+ FIELD_PROPERTIES.record,
6224
+ fieldCameraConfig
6109
6225
  ]);
6110
- return [3 /*break*/, 7];
6111
- case 6:
6226
+ return [3 /*break*/, 6];
6227
+ case 5:
6112
6228
  this.resetCamera();
6113
- return [3 /*break*/, 7];
6114
- case 7:
6229
+ return [3 /*break*/, 6];
6230
+ case 6:
6115
6231
  /**
6116
6232
  * Config and other data is set now, so we can show the camera.
6117
6233
  */
@@ -6126,13 +6242,13 @@
6126
6242
  /** CameraType = CAPTURE */
6127
6243
  KwikIDFormViewComponent.prototype.setCameraMedia = function (media) {
6128
6244
  return __awaiter(this, void 0, void 0, function () {
6129
- var field, ruleEngine_5;
6245
+ var field, activeCameraData, updatedMedia, ruleEngine_6;
6130
6246
  var _15;
6131
6247
  var _this = this;
6132
6248
  return __generator(this, function (_16) {
6133
6249
  switch (_16.label) {
6134
6250
  case 0:
6135
- field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
6251
+ field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
6136
6252
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
6137
6253
  kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
6138
6254
  field.properties.uploadFileToServer)) return [3 /*break*/, 2];
@@ -6141,15 +6257,28 @@
6141
6257
  _16.sent();
6142
6258
  return [3 /*break*/, 3];
6143
6259
  case 2:
6260
+ activeCameraData = this.activeCameraData;
6144
6261
  this.resetCamera();
6145
- this.formData[field.key] = kwikidToolkit.getObjectDeepCopy([media]);
6146
- this.mediaFiles[field.key] = kwikidToolkit.getObjectDeepCopy([media]);
6147
- this.formGroup.controls[field.key].patchValue(kwikidToolkit.getObjectDeepCopy([media]), {
6262
+ updatedMedia = {};
6263
+ switch (field.type) {
6264
+ case EFieldType.CAPTURE:
6265
+ updatedMedia = Object.assign(Object.assign({}, (kwikidToolkit.isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { image: media });
6266
+ break;
6267
+ case EFieldType.RECORD:
6268
+ updatedMedia = Object.assign(Object.assign({}, (kwikidToolkit.isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { video: media });
6269
+ break;
6270
+ default:
6271
+ break;
6272
+ }
6273
+ this.formData[field.key] = kwikidToolkit.getObjectDeepCopy([updatedMedia]);
6274
+ this.cameraData[field.key] = kwikidToolkit.getObjectDeepCopy(updatedMedia);
6275
+ this.mediaFiles[field.key] = kwikidToolkit.getObjectDeepCopy([updatedMedia]);
6276
+ this.formGroup.controls[field.key].patchValue(kwikidToolkit.getObjectDeepCopy([updatedMedia]), {
6148
6277
  emitEvent: false,
6149
6278
  onlySelf: false
6150
6279
  });
6151
6280
  this.formGroup.patchValue((_15 = {},
6152
- _15[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
6281
+ _15[field.key] = kwikidToolkit.getObjectDeepCopy([updatedMedia]),
6153
6282
  _15), { emitEvent: false });
6154
6283
  this.formGroup.controls[field.key].updateValueAndValidity({
6155
6284
  emitEvent: false
@@ -6161,10 +6290,11 @@
6161
6290
  if (field.isFormElement &&
6162
6291
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
6163
6292
  field.validation.triggers.includes("ON_CHANGE")) {
6164
- ruleEngine_5 = new kwikidToolkit.RuleEngine({
6293
+ ruleEngine_6 = new kwikidToolkit.RuleEngine({
6165
6294
  FIELD_CONFIG: field,
6166
6295
  FORM_FIELDS: this.formFields,
6167
6296
  FORM_DATA: this.formData,
6297
+ CAMERA_DATA: this.cameraData,
6168
6298
  TASK_DATA: this.taskData,
6169
6299
  PREVIOUS_FORM_DATA: this.previousFormData,
6170
6300
  ALL_FORMS_DATA: this.allFormsData,
@@ -6173,7 +6303,7 @@
6173
6303
  (function () { return __awaiter(_this, void 0, void 0, function () {
6174
6304
  return __generator(this, function (_15) {
6175
6305
  switch (_15.label) {
6176
- case 0: return [4 /*yield*/, ruleEngine_5.run(field.validation)];
6306
+ case 0: return [4 /*yield*/, ruleEngine_6.run(field.validation)];
6177
6307
  case 1:
6178
6308
  _15.sent();
6179
6309
  return [2 /*return*/];
@@ -6199,14 +6329,14 @@
6199
6329
  });
6200
6330
  };
6201
6331
  /** Camera Common Methods */
6202
- KwikIDFormViewComponent.prototype.handleGetCameraMedia = function (e, cameraType) {
6332
+ KwikIDFormViewComponent.prototype.handleGetCameraMedia = function (e, activeCameraType) {
6203
6333
  var _this = this;
6204
- switch (cameraType) {
6334
+ switch (activeCameraType) {
6205
6335
  case "CAPTURE":
6206
6336
  this.showApiLoader();
6207
- this.cameraImage = "";
6337
+ this.activeCameraImage = "";
6208
6338
  setTimeout(function () {
6209
- var _a, _b, _c, _d, _e, _f, _g;
6339
+ var _a, _b, _c, _d, _e, _f, _g, _h;
6210
6340
  /**
6211
6341
  * Priority of Image to Set for Config Based
6212
6342
  * 1. Masked
@@ -6215,77 +6345,98 @@
6215
6345
  *
6216
6346
  * If no masked or cropped image is available then directly set Original Image
6217
6347
  */
6218
- var field = getFormFieldByKey(_this.formFields, _this.cameraFieldKey);
6348
+ var field = getFormFieldByKey(_this.formFields, _this.activeCameraFieldKey);
6219
6349
  var image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
6220
6350
  ? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
6221
6351
  : ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
6222
6352
  ? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
6223
6353
  : e === null || e === void 0 ? void 0 : e.originalImage;
6224
- var isShowImagePreview = (_g = (_f = (_e = _this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.preview) === null || _g === void 0 ? void 0 : _g.show;
6354
+ var isShowImagePreview = (_h = (_g = (_f = (_e = _this.activeCameraConfig) === null || _e === void 0 ? void 0 : _e.cameraConfig) === null || _f === void 0 ? void 0 : _f.others) === null || _g === void 0 ? void 0 : _g.preview) === null || _h === void 0 ? void 0 : _h.show;
6225
6355
  if (isShowImagePreview) {
6226
- _this.cameraImage = image;
6356
+ _this.activeCameraImage = image;
6227
6357
  }
6228
6358
  else {
6229
6359
  _this.setCameraMedia(image);
6230
6360
  }
6231
6361
  _this.hideApiLoader();
6232
- }, 500); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6362
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6233
6363
  break;
6234
6364
  case "RECORD":
6235
6365
  this.showApiLoader();
6236
- this.cameraVideo = "";
6366
+ this.activeCameraVideo = "";
6237
6367
  setTimeout(function () {
6238
6368
  var _a, _b, _c;
6239
6369
  /**
6240
6370
  * Priority of Image to Set for Config Based
6241
6371
  * 1. Original
6242
6372
  */
6243
- var field = getFormFieldByKey(_this.formFields, _this.cameraFieldKey);
6373
+ var field = getFormFieldByKey(_this.formFields, _this.activeCameraFieldKey);
6244
6374
  var video = e === null || e === void 0 ? void 0 : e.originalVideo;
6245
- var isShowVideoPreview = (_c = (_b = (_a = _this.cameraConfig) === null || _a === void 0 ? void 0 : _a.others) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.show;
6375
+ var isShowVideoPreview = (_c = (_b = (_a = _this.activeCameraConfig) === null || _a === void 0 ? void 0 : _a.others) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.show;
6246
6376
  if (isShowVideoPreview) {
6247
- _this.cameraVideo = video;
6377
+ _this.activeCameraVideo = video;
6248
6378
  }
6249
6379
  else {
6250
6380
  _this.setCameraMedia(video);
6251
6381
  }
6252
6382
  _this.hideApiLoader();
6253
- }, 500); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6383
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6254
6384
  break;
6255
6385
  default:
6256
6386
  break;
6257
6387
  }
6258
6388
  };
6259
- KwikIDFormViewComponent.prototype.handleOnClickSaveCameraMedia = function (e, cameraType) {
6389
+ KwikIDFormViewComponent.prototype.handleOnClickSaveCameraMedia = function (e, activeCameraType) {
6260
6390
  var _this = this;
6261
6391
  this.showApiLoader();
6262
- var field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
6392
+ var field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
6263
6393
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_SAVE_BUTTON_CLICK, {
6264
6394
  field_key: field.key,
6265
6395
  field_type: field.type,
6266
- camera_type: cameraType
6396
+ camera_type: activeCameraType
6267
6397
  });
6268
- switch (cameraType) {
6398
+ switch (activeCameraType) {
6269
6399
  case "CAPTURE":
6270
- this.cameraImage = "";
6400
+ this.activeCameraImage = "";
6271
6401
  setTimeout(function () {
6272
- var image = e === null || e === void 0 ? void 0 : e.originalImage;
6402
+ var _a, _b, _c, _d;
6403
+ /**
6404
+ * Priority of Image to Set for Config Based
6405
+ * 1. Masked
6406
+ * 2. Cropped
6407
+ * 3. Original
6408
+ *
6409
+ * If no masked or cropped image is available then directly set Original Image
6410
+ */
6411
+ var field = getFormFieldByKey(_this.formFields, _this.activeCameraFieldKey);
6412
+ var image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
6413
+ ? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
6414
+ : ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
6415
+ ? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
6416
+ : e === null || e === void 0 ? void 0 : e.originalImage;
6273
6417
  _this.setCameraMedia(image);
6274
6418
  _this.hideApiLoader();
6275
- }, 500);
6419
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6276
6420
  break;
6277
6421
  case "RECORD":
6278
- this.cameraVideo = "";
6422
+ this.activeCameraVideo = "";
6279
6423
  setTimeout(function () {
6424
+ /**
6425
+ * Priority of Image to Set for Config Based
6426
+ * 1. Original
6427
+ */
6428
+ var field = getFormFieldByKey(_this.formFields, _this.activeCameraFieldKey);
6280
6429
  var video = e === null || e === void 0 ? void 0 : e.originalVideo;
6281
6430
  _this.setCameraMedia(video);
6282
6431
  _this.hideApiLoader();
6283
- }, 500);
6432
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
6433
+ break;
6434
+ default:
6284
6435
  break;
6285
6436
  }
6286
6437
  };
6287
6438
  KwikIDFormViewComponent.prototype.handleOnClickCameraBack = function (e) {
6288
- var field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
6439
+ var field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
6289
6440
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_BACK_BUTTON_CLICK, {
6290
6441
  field_key: field.key,
6291
6442
  field_type: field.type
@@ -6293,7 +6444,7 @@
6293
6444
  this.resetCamera();
6294
6445
  };
6295
6446
  KwikIDFormViewComponent.prototype.handleOnClickCameraClose = function (e) {
6296
- var field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
6447
+ var field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
6297
6448
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_CLOSE_BUTTON_CLICK, {
6298
6449
  field_key: field.key,
6299
6450
  field_type: field.type
@@ -6339,10 +6490,11 @@
6339
6490
  if (field.isFormElement &&
6340
6491
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
6341
6492
  field.validation.triggers.includes("ON_CHANGE")) {
6342
- var ruleEngine_6 = new kwikidToolkit.RuleEngine({
6493
+ var ruleEngine_7 = new kwikidToolkit.RuleEngine({
6343
6494
  FIELD_CONFIG: field,
6344
6495
  FORM_FIELDS: this.formFields,
6345
6496
  FORM_DATA: this.formData,
6497
+ CAMERA_DATA: this.cameraData,
6346
6498
  TASK_DATA: this.taskData,
6347
6499
  PREVIOUS_FORM_DATA: this.previousFormData,
6348
6500
  ALL_FORMS_DATA: this.allFormsData,
@@ -6351,7 +6503,7 @@
6351
6503
  (function () { return __awaiter(_this, void 0, void 0, function () {
6352
6504
  return __generator(this, function (_15) {
6353
6505
  switch (_15.label) {
6354
- case 0: return [4 /*yield*/, ruleEngine_6.run(field.validation)];
6506
+ case 0: return [4 /*yield*/, ruleEngine_7.run(field.validation)];
6355
6507
  case 1:
6356
6508
  _15.sent();
6357
6509
  return [2 /*return*/];
@@ -6371,10 +6523,21 @@
6371
6523
  * 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.
6372
6524
  */
6373
6525
  KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
6526
+ var _a, _b, _c, _d, _e, _f;
6374
6527
  return __awaiter(this, void 0, void 0, function () {
6375
- return __generator(this, function (_15) {
6376
- switch (field.type) {
6377
- case EFieldType.FILE:
6528
+ 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;
6529
+ var e_10, _16, e_11, _17;
6530
+ return __generator(this, function (_18) {
6531
+ switch (_18.label) {
6532
+ case 0:
6533
+ _15 = field.type;
6534
+ switch (_15) {
6535
+ case EFieldType.FILE: return [3 /*break*/, 1];
6536
+ case EFieldType.CAPTURE: return [3 /*break*/, 2];
6537
+ case EFieldType.RECORD: return [3 /*break*/, 19];
6538
+ }
6539
+ return [3 /*break*/, 20];
6540
+ case 1:
6378
6541
  this.updateFiles(file, "LOADING", field.key);
6379
6542
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_FILE, {
6380
6543
  field_key: field.key,
@@ -6407,30 +6570,137 @@
6407
6570
  catch (err) {
6408
6571
  this.updateFiles(file, "ERROR", field.key);
6409
6572
  }
6410
- break;
6411
- case EFieldType.CAPTURE:
6412
- // Actual API Call
6573
+ return [3 /*break*/, 21];
6574
+ case 2:
6575
+ ocrPayload = {};
6576
+ if (kwikidToolkit.isNotEmptyValue((_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.ocr)) {
6577
+ ocrPayload = field.properties.features.ocr;
6578
+ }
6579
+ facematchPayload = {};
6580
+ if (!kwikidToolkit.isNotEmptyValue((_d = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.features) === null || _d === void 0 ? void 0 : _d.facematch)) return [3 /*break*/, 10];
6581
+ facematchPayload.isEnabled =
6582
+ field.properties.features.facematch.isEnabled;
6583
+ facematchPayload.isFacematchFromServer =
6584
+ field.properties.features.facematch.isFacematchFromServer;
6585
+ facematchPayload.images = [];
6586
+ facematchSources = field.properties.features.facematch.sources;
6587
+ _18.label = 3;
6588
+ case 3:
6589
+ _18.trys.push([3, 8, 9, 10]);
6590
+ facematchSources_1 = __values(facematchSources), facematchSources_1_1 = facematchSources_1.next();
6591
+ _18.label = 4;
6592
+ case 4:
6593
+ if (!!facematchSources_1_1.done) return [3 /*break*/, 7];
6594
+ facematchSourceConfig = facematchSources_1_1.value;
6595
+ source = new kwikidToolkit.Source({
6596
+ FIELD_CONFIG: field,
6597
+ FORM_FIELDS: this.formFields,
6598
+ FORM_DATA: this.formData,
6599
+ CAMERA_DATA: this.cameraData,
6600
+ TASK_DATA: this.taskData,
6601
+ PREVIOUS_FORM_DATA: this.previousFormData,
6602
+ ALL_FORMS_DATA: this.allFormsData,
6603
+ EXTRA_DATA: this.extraData
6604
+ });
6605
+ return [4 /*yield*/, source.getValueFromSource(facematchSourceConfig)];
6606
+ case 5:
6607
+ sourceValue = _18.sent();
6608
+ facematchSource = {
6609
+ key: facematchSourceConfig.id,
6610
+ value: sourceValue
6611
+ };
6612
+ facematchPayload.images.push(facematchSource);
6613
+ _18.label = 6;
6614
+ case 6:
6615
+ facematchSources_1_1 = facematchSources_1.next();
6616
+ return [3 /*break*/, 4];
6617
+ case 7: return [3 /*break*/, 10];
6618
+ case 8:
6619
+ e_10_1 = _18.sent();
6620
+ e_10 = { error: e_10_1 };
6621
+ return [3 /*break*/, 10];
6622
+ case 9:
6623
+ try {
6624
+ if (facematchSources_1_1 && !facematchSources_1_1.done && (_16 = facematchSources_1.return)) _16.call(facematchSources_1);
6625
+ }
6626
+ finally { if (e_10) throw e_10.error; }
6627
+ return [7 /*endfinally*/];
6628
+ case 10:
6629
+ watermarkPayload = {};
6630
+ if (!kwikidToolkit.isNotEmptyValue((_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.features) === null || _f === void 0 ? void 0 : _f.watermark)) return [3 /*break*/, 18];
6631
+ watermarkPayload.isEnabled =
6632
+ field.properties.features.watermark.isEnabled;
6633
+ watermarkPayload.isWatermarkFromServer =
6634
+ field.properties.features.watermark.isWatermarkFromServer;
6635
+ watermarkPayload.data = [];
6636
+ watermarkSources = field.properties.features.watermark.sources;
6637
+ watermarkPayload.config = field.properties.features.watermark.sources;
6638
+ _18.label = 11;
6639
+ case 11:
6640
+ _18.trys.push([11, 16, 17, 18]);
6641
+ watermarkSources_1 = __values(watermarkSources), watermarkSources_1_1 = watermarkSources_1.next();
6642
+ _18.label = 12;
6643
+ case 12:
6644
+ if (!!watermarkSources_1_1.done) return [3 /*break*/, 15];
6645
+ watermarkSourceConfig = watermarkSources_1_1.value;
6646
+ source = new kwikidToolkit.Source({
6647
+ FIELD_CONFIG: field,
6648
+ FORM_FIELDS: this.formFields,
6649
+ FORM_DATA: this.formData,
6650
+ CAMERA_DATA: this.cameraData,
6651
+ TASK_DATA: this.taskData,
6652
+ PREVIOUS_FORM_DATA: this.previousFormData,
6653
+ ALL_FORMS_DATA: this.allFormsData,
6654
+ EXTRA_DATA: this.extraData
6655
+ });
6656
+ return [4 /*yield*/, source.getValueFromSource(watermarkSourceConfig)];
6657
+ case 13:
6658
+ sourceValue = _18.sent();
6659
+ watermarkSource = {
6660
+ key: watermarkSourceConfig.id,
6661
+ value: sourceValue
6662
+ };
6663
+ watermarkPayload.data.push(watermarkSource);
6664
+ _18.label = 14;
6665
+ case 14:
6666
+ watermarkSources_1_1 = watermarkSources_1.next();
6667
+ return [3 /*break*/, 12];
6668
+ case 15: return [3 /*break*/, 18];
6669
+ case 16:
6670
+ e_11_1 = _18.sent();
6671
+ e_11 = { error: e_11_1 };
6672
+ return [3 /*break*/, 18];
6673
+ case 17:
6674
+ try {
6675
+ if (watermarkSources_1_1 && !watermarkSources_1_1.done && (_17 = watermarkSources_1.return)) _17.call(watermarkSources_1);
6676
+ }
6677
+ finally { if (e_11) throw e_11.error; }
6678
+ return [7 /*endfinally*/];
6679
+ case 18:
6680
+ imageUploadPayload = Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
6681
+ ocr: ocrPayload
6682
+ })), ((facematchPayload === null || facematchPayload === void 0 ? void 0 : facematchPayload.isEnabled) && {
6683
+ facematch: facematchPayload
6684
+ })), ((watermarkPayload === null || watermarkPayload === void 0 ? void 0 : watermarkPayload.isEnabled) && {
6685
+ watermark: watermarkPayload
6686
+ }));
6413
6687
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_IMAGE, {
6414
6688
  field_key: field.key,
6415
6689
  field_type: field.type,
6416
- request: {
6417
- image: file
6418
- }
6690
+ request: imageUploadPayload
6419
6691
  });
6420
6692
  try {
6421
6693
  this.onClickApiCall.emit({
6422
6694
  key: field.key,
6423
6695
  type: field.type,
6424
- payload: {
6425
- image: file
6426
- }
6696
+ payload: imageUploadPayload
6427
6697
  });
6428
6698
  }
6429
6699
  catch (err) {
6430
6700
  console.log("Failed to upload image to server!");
6431
6701
  }
6432
- break;
6433
- case EFieldType.RECORD:
6702
+ return [3 /*break*/, 21];
6703
+ case 19:
6434
6704
  // Actual API Call
6435
6705
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_VIDEO, {
6436
6706
  field_key: field.key,
@@ -6451,34 +6721,35 @@
6451
6721
  catch (err) {
6452
6722
  console.log("Failed to upload video to server!");
6453
6723
  }
6454
- break;
6724
+ return [3 /*break*/, 21];
6725
+ case 20: return [3 /*break*/, 21];
6726
+ case 21: return [2 /*return*/];
6455
6727
  }
6456
- return [2 /*return*/];
6457
6728
  });
6458
6729
  });
6459
6730
  };
6460
6731
  KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
6461
- var e_10, _15;
6732
+ var e_12, _15;
6462
6733
  var formData = this.formGroup.getRawValue();
6463
6734
  try {
6464
6735
  for (var _16 = __values(this.formFields), _17 = _16.next(); !_17.done; _17 = _16.next()) {
6465
- var field_3 = _17.value;
6466
- if (field_3.isFormElement) {
6467
- if (field_3.hidden) {
6468
- delete formData[field_3.key];
6736
+ var field_4 = _17.value;
6737
+ if (field_4.isFormElement) {
6738
+ if (field_4.hidden) {
6739
+ delete formData[field_4.key];
6469
6740
  }
6470
6741
  else {
6471
- formData[field_3.key] = convertFormFieldValueToStandardFormat(field_3, formData[field_3.key]);
6742
+ formData[field_4.key] = convertFormFieldValueToStandardFormat(field_4, formData[field_4.key]);
6472
6743
  }
6473
6744
  }
6474
6745
  }
6475
6746
  }
6476
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
6747
+ catch (e_12_1) { e_12 = { error: e_12_1 }; }
6477
6748
  finally {
6478
6749
  try {
6479
6750
  if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
6480
6751
  }
6481
- finally { if (e_10) throw e_10.error; }
6752
+ finally { if (e_12) throw e_12.error; }
6482
6753
  }
6483
6754
  var extendedFormData = this.formFields.reduce(function (result, field, index) {
6484
6755
  var _15;
@@ -6514,8 +6785,8 @@
6514
6785
  return field.key === _.key;
6515
6786
  });
6516
6787
  // set button status to default
6517
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
6518
- field["showLoader"] = true;
6788
+ field.api.status.value = EApiStatusType.LOADING;
6789
+ field.showLoader = true;
6519
6790
  this.formFields[fieldIndex] = field;
6520
6791
  this.showApiLoader();
6521
6792
  this.fieldShowApiLoader(field.key);
@@ -6527,7 +6798,7 @@
6527
6798
  this.togglePermissionErrorNotification(true);
6528
6799
  setTimeout(function () {
6529
6800
  _this.togglePermissionErrorNotification(false);
6530
- }, 3000);
6801
+ }, FORM_VIEW_TIMERS.LOCATION_PERMISSION_ERROR_TOGGLE);
6531
6802
  }
6532
6803
  else {
6533
6804
  this.triggerLogs(ELogEventType$1.FORM__LIVE_LOCATION_PERMISSION_SUCCESS, {
@@ -6537,16 +6808,16 @@
6537
6808
  }
6538
6809
  setTimeout(function () {
6539
6810
  // set button status to default
6540
- field["api"]["status"]["value"] = EApiStatusType.DEFAULT;
6541
- field["showLoader"] = false;
6811
+ field.api.status.value = EApiStatusType.DEFAULT;
6812
+ field.showLoader = false;
6542
6813
  _this.formFields[fieldIndex] = field;
6543
6814
  _this.hideApiLoader();
6544
6815
  _this.fieldHideApiLoader(field.key);
6545
- }, 500);
6816
+ }, FORM_VIEW_TIMERS.LOCATION_PERMISSION_RESET_BUTTON_STATUS);
6546
6817
  };
6547
6818
  KwikIDFormViewComponent.prototype.handleOnClickLiveLocation = function (e) {
6548
6819
  return __awaiter(this, void 0, void 0, function () {
6549
- var field, ruleEngine_7;
6820
+ var field, ruleEngine_8;
6550
6821
  var _15;
6551
6822
  var _this = this;
6552
6823
  return __generator(this, function (_16) {
@@ -6558,8 +6829,8 @@
6558
6829
  field_type: field.type
6559
6830
  });
6560
6831
  // set button status to loading
6561
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
6562
- field["showLoader"] = true;
6832
+ field.api.status.value = EApiStatusType.LOADING;
6833
+ field.showLoader = true;
6563
6834
  this.showApiLoader();
6564
6835
  this.formGroup.patchValue((_15 = {},
6565
6836
  _15[e.key] = e.value,
@@ -6578,20 +6849,21 @@
6578
6849
  case 1: return [4 /*yield*/, new Promise(function (resolve) {
6579
6850
  setTimeout(function () {
6580
6851
  resolve(true);
6581
- }, 300); // 1000 ms = 1 sec
6852
+ }, FORM_VIEW_TIMERS.TIMER_300); // 1000 ms = 1 sec
6582
6853
  })];
6583
6854
  case 2:
6584
6855
  _16.sent();
6585
6856
  // set button status to success
6586
- field["api"]["status"]["value"] = EApiStatusType.SUCCESS;
6587
- field["showLoader"] = false;
6857
+ field.api.status.value = EApiStatusType.SUCCESS;
6858
+ field.showLoader = false;
6588
6859
  if (field.isFormElement &&
6589
6860
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
6590
6861
  field.validation.triggers.includes("ON_CHANGE")) {
6591
- ruleEngine_7 = new kwikidToolkit.RuleEngine({
6862
+ ruleEngine_8 = new kwikidToolkit.RuleEngine({
6592
6863
  FIELD_CONFIG: field,
6593
6864
  FORM_FIELDS: this.formFields,
6594
6865
  FORM_DATA: this.formData,
6866
+ CAMERA_DATA: this.cameraData,
6595
6867
  TASK_DATA: this.taskData,
6596
6868
  PREVIOUS_FORM_DATA: this.previousFormData,
6597
6869
  ALL_FORMS_DATA: this.allFormsData,
@@ -6600,7 +6872,7 @@
6600
6872
  (function () { return __awaiter(_this, void 0, void 0, function () {
6601
6873
  return __generator(this, function (_15) {
6602
6874
  switch (_15.label) {
6603
- case 0: return [4 /*yield*/, ruleEngine_7.run(field.validation)];
6875
+ case 0: return [4 /*yield*/, ruleEngine_8.run(field.validation)];
6604
6876
  case 1:
6605
6877
  _15.sent();
6606
6878
  return [2 /*return*/];
@@ -6635,10 +6907,11 @@
6635
6907
  if (field.isFormElement &&
6636
6908
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
6637
6909
  field.validation.triggers.includes("ON_CHANGE")) {
6638
- var ruleEngine_8 = new kwikidToolkit.RuleEngine({
6910
+ var ruleEngine_9 = new kwikidToolkit.RuleEngine({
6639
6911
  FIELD_CONFIG: field,
6640
6912
  FORM_FIELDS: this.formFields,
6641
6913
  FORM_DATA: this.formData,
6914
+ CAMERA_DATA: this.cameraData,
6642
6915
  TASK_DATA: this.taskData,
6643
6916
  PREVIOUS_FORM_DATA: this.previousFormData,
6644
6917
  ALL_FORMS_DATA: this.allFormsData,
@@ -6647,7 +6920,7 @@
6647
6920
  (function () { return __awaiter(_this, void 0, void 0, function () {
6648
6921
  return __generator(this, function (_15) {
6649
6922
  switch (_15.label) {
6650
- case 0: return [4 /*yield*/, ruleEngine_8.run(field.validation)];
6923
+ case 0: return [4 /*yield*/, ruleEngine_9.run(field.validation)];
6651
6924
  case 1:
6652
6925
  _15.sent();
6653
6926
  return [2 /*return*/];
@@ -6663,95 +6936,6 @@
6663
6936
  }, "ON_CHANGE");
6664
6937
  }
6665
6938
  };
6666
- KwikIDFormViewComponent.prototype.handleOnClickResetFormFields2 = function (e, field) {
6667
- var _a;
6668
- return __awaiter(this, void 0, void 0, function () {
6669
- var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
6670
- var _this = this;
6671
- return __generator(this, function (_15) {
6672
- this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET_BUTTON_CLICK, {
6673
- field_key: field.key
6674
- });
6675
- resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
6676
- var _15, _16, f, _17, _18, action, resetField, actions, e_11_1, e_12_1;
6677
- var e_12, _19, e_11, _20;
6678
- return __generator(this, function (_21) {
6679
- switch (_21.label) {
6680
- case 0:
6681
- _21.trys.push([0, 11, 12, 13]);
6682
- _15 = __values(field.reset.fields), _16 = _15.next();
6683
- _21.label = 1;
6684
- case 1:
6685
- if (!!_16.done) return [3 /*break*/, 10];
6686
- f = _16.value;
6687
- _21.label = 2;
6688
- case 2:
6689
- _21.trys.push([2, 7, 8, 9]);
6690
- _17 = (e_11 = void 0, __values(f.actions)), _18 = _17.next();
6691
- _21.label = 3;
6692
- case 3:
6693
- if (!!_18.done) return [3 /*break*/, 6];
6694
- action = _18.value;
6695
- resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
6696
- actions = new kwikidToolkit.Action(action, {}, {
6697
- FIELD_CONFIG: resetField,
6698
- FORM_FIELDS: this.formFields,
6699
- FORM_DATA: this.formData,
6700
- TASK_DATA: this.taskData,
6701
- PREVIOUS_FORM_DATA: this.previousFormData,
6702
- ALL_FORMS_DATA: this.allFormsData,
6703
- EXTRA_DATA: this.extraData
6704
- }, this.takeAction.bind(this));
6705
- return [4 /*yield*/, actions.execute()];
6706
- case 4:
6707
- _21.sent();
6708
- _21.label = 5;
6709
- case 5:
6710
- _18 = _17.next();
6711
- return [3 /*break*/, 3];
6712
- case 6: return [3 /*break*/, 9];
6713
- case 7:
6714
- e_11_1 = _21.sent();
6715
- e_11 = { error: e_11_1 };
6716
- return [3 /*break*/, 9];
6717
- case 8:
6718
- try {
6719
- if (_18 && !_18.done && (_20 = _17.return)) _20.call(_17);
6720
- }
6721
- finally { if (e_11) throw e_11.error; }
6722
- return [7 /*endfinally*/];
6723
- case 9:
6724
- _16 = _15.next();
6725
- return [3 /*break*/, 1];
6726
- case 10: return [3 /*break*/, 13];
6727
- case 11:
6728
- e_12_1 = _21.sent();
6729
- e_12 = { error: e_12_1 };
6730
- return [3 /*break*/, 13];
6731
- case 12:
6732
- try {
6733
- if (_16 && !_16.done && (_19 = _15.return)) _19.call(_15);
6734
- }
6735
- finally { if (e_12) throw e_12.error; }
6736
- return [7 /*endfinally*/];
6737
- case 13: return [2 /*return*/];
6738
- }
6739
- });
6740
- }); };
6741
- BYPASS_RESET_CONFIRM = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.bypassResetConfirmation;
6742
- if (!BYPASS_RESET_CONFIRM) {
6743
- CONFIRM_RESET = window.confirm("This action will reset all the fields. Do you still want to continue?");
6744
- if (CONFIRM_RESET) {
6745
- resetFormFields();
6746
- }
6747
- }
6748
- else {
6749
- resetFormFields();
6750
- }
6751
- return [2 /*return*/];
6752
- });
6753
- });
6754
- };
6755
6939
  KwikIDFormViewComponent.prototype.handleOnClickResetFormFields = function (e, field) {
6756
6940
  var _a;
6757
6941
  return __awaiter(this, void 0, void 0, function () {
@@ -6789,6 +6973,7 @@
6789
6973
  FIELD_CONFIG: resetField,
6790
6974
  FORM_FIELDS: this.formFields,
6791
6975
  FORM_DATA: this.formData,
6976
+ CAMERA_DATA: this.cameraData,
6792
6977
  TASK_DATA: this.taskData,
6793
6978
  PREVIOUS_FORM_DATA: this.previousFormData,
6794
6979
  ALL_FORMS_DATA: this.allFormsData,
@@ -6857,6 +7042,7 @@
6857
7042
  FIELD_CONFIG: resetField,
6858
7043
  FORM_FIELDS: this.formFields,
6859
7044
  FORM_DATA: this.formData,
7045
+ CAMERA_DATA: this.cameraData,
6860
7046
  TASK_DATA: this.taskData,
6861
7047
  PREVIOUS_FORM_DATA: this.previousFormData,
6862
7048
  ALL_FORMS_DATA: this.allFormsData,
@@ -6937,6 +7123,7 @@
6937
7123
  API_CONFIG: api,
6938
7124
  FORM_FIELDS: this.formFields,
6939
7125
  FORM_DATA: this.formData,
7126
+ CAMERA_DATA: this.cameraData,
6940
7127
  TASK_DATA: this.taskData,
6941
7128
  PREVIOUS_FORM_DATA: this.previousFormData,
6942
7129
  ALL_FORMS_DATA: this.allFormsData,
@@ -6957,6 +7144,7 @@
6957
7144
  API_RESPONSE: api.response,
6958
7145
  FORM_FIELDS: this.formFields,
6959
7146
  FORM_DATA: this.formData,
7147
+ CAMERA_DATA: this.cameraData,
6960
7148
  TASK_DATA: this.taskData,
6961
7149
  PREVIOUS_FORM_DATA: this.previousFormData,
6962
7150
  ALL_FORMS_DATA: this.allFormsData,
@@ -6968,9 +7156,9 @@
6968
7156
  return [3 /*break*/, 4];
6969
7157
  case 3:
6970
7158
  setTimeout(function () {
6971
- field["api"]["status"]["value"] = EApiStatusType.FAILED;
6972
- field["showLoader"] = false;
6973
- }, 500);
7159
+ field.api.status.value = EApiStatusType.FAILED;
7160
+ field.showLoader = false;
7161
+ }, FORM_VIEW_TIMERS.TIMER_500);
6974
7162
  _17.label = 4;
6975
7163
  case 4: return [2 /*return*/, { field: field, api: api }];
6976
7164
  }
@@ -6987,6 +7175,7 @@
6987
7175
  API_CONFIG: api,
6988
7176
  FORM_FIELDS: this.formFields,
6989
7177
  FORM_DATA: this.formData,
7178
+ CAMERA_DATA: this.cameraData,
6990
7179
  TASK_DATA: this.taskData,
6991
7180
  PREVIOUS_FORM_DATA: this.previousFormData,
6992
7181
  ALL_FORMS_DATA: this.allFormsData,
@@ -6999,6 +7188,7 @@
6999
7188
  API_CONFIG: api,
7000
7189
  FORM_FIELDS: this.formFields,
7001
7190
  FORM_DATA: this.formData,
7191
+ CAMERA_DATA: this.cameraData,
7002
7192
  TASK_DATA: this.taskData,
7003
7193
  PREVIOUS_FORM_DATA: this.previousFormData,
7004
7194
  ALL_FORMS_DATA: this.allFormsData,
@@ -7039,16 +7229,17 @@
7039
7229
  api = _15.sent();
7040
7230
  apiCallResponse = {};
7041
7231
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 17];
7042
- if (!(api.request.url.hasOwnProperty("type") &&
7232
+ if (!(kwikidToolkit.checkObjectKeyExists(api.request.url, "type") &&
7043
7233
  api.request.url.type === EApiRequestUrlType.MOCK)) return [3 /*break*/, 7];
7044
7234
  return [4 /*yield*/, new Promise(function (resolve) {
7045
7235
  setTimeout(function () {
7046
7236
  resolve(api.request.url.props.mockedData);
7047
- }, 1000); // 1000 ms = 1 sec
7237
+ }, FORM_VIEW_TIMERS.WAIT_FOR_API_MOCK_DATA); // 1000 ms = 1 sec
7048
7238
  })];
7049
7239
  case 6:
7050
7240
  apiCallResponse = _15.sent();
7051
- apiCallResponseStatusCode = (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : 200; // Default Status Code for Mocked APIs
7241
+ apiCallResponseStatusCode =
7242
+ (_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
7052
7243
  return [3 /*break*/, 16];
7053
7244
  case 7:
7054
7245
  url = api.request.url.value;
@@ -7077,7 +7268,8 @@
7077
7268
  _13_1 = _15.sent();
7078
7269
  // Handle any errors
7079
7270
  apiCallResponse = {};
7080
- apiCallResponseStatusCode = 500; // Internal Server Error
7271
+ apiCallResponseStatusCode =
7272
+ FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
7081
7273
  return [3 /*break*/, 11];
7082
7274
  case 11: return [3 /*break*/, 16];
7083
7275
  case 12:
@@ -7102,7 +7294,8 @@
7102
7294
  _14_1 = _15.sent();
7103
7295
  // Handle any errors
7104
7296
  apiCallResponse = {};
7105
- apiCallResponseStatusCode = 500; // Internal Server Error
7297
+ apiCallResponseStatusCode =
7298
+ FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
7106
7299
  return [3 /*break*/, 16];
7107
7300
  case 16:
7108
7301
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
@@ -7138,17 +7331,17 @@
7138
7331
  fullscreen: true,
7139
7332
  loaderText: "Please wait"
7140
7333
  });
7141
- this.viewFormsButton["disabled"] = true;
7142
- this.viewFormsButton["showLoader"] = true;
7143
- this.saveFormButton["disabled"] = true;
7144
- this.saveFormButton["showLoader"] = true;
7334
+ this.viewFormsButton.disabled = true;
7335
+ this.viewFormsButton.showLoader = true;
7336
+ this.saveFormButton.disabled = true;
7337
+ this.saveFormButton.showLoader = true;
7145
7338
  };
7146
7339
  KwikIDFormViewComponent.prototype.hideApiLoader = function () {
7147
7340
  this.loaderService.hide();
7148
- this.viewFormsButton["disabled"] = false;
7149
- this.viewFormsButton["showLoader"] = false;
7150
- this.saveFormButton["disabled"] = false;
7151
- this.saveFormButton["showLoader"] = false;
7341
+ this.viewFormsButton.disabled = false;
7342
+ this.viewFormsButton.showLoader = false;
7343
+ this.saveFormButton.disabled = false;
7344
+ this.saveFormButton.showLoader = false;
7152
7345
  };
7153
7346
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
7154
7347
  return __awaiter(this, void 0, void 0, function () {
@@ -7163,8 +7356,8 @@
7163
7356
  field_type: field.type
7164
7357
  });
7165
7358
  // set button status to loading
7166
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
7167
- field["showLoader"] = true;
7359
+ field.api.status.value = EApiStatusType.LOADING;
7360
+ field.showLoader = true;
7168
7361
  this.showApiLoader();
7169
7362
  if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
7170
7363
  return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
@@ -7177,6 +7370,7 @@
7177
7370
  API_CONFIG: {},
7178
7371
  FORM_FIELDS: this.formFields,
7179
7372
  FORM_DATA: this.formData,
7373
+ CAMERA_DATA: this.cameraData,
7180
7374
  TASK_DATA: this.taskData,
7181
7375
  PREVIOUS_FORM_DATA: this.previousFormData,
7182
7376
  ALL_FORMS_DATA: this.allFormsData,
@@ -7296,6 +7490,7 @@
7296
7490
  FIELD_CONFIG: field,
7297
7491
  FORM_FIELDS: this.formFields,
7298
7492
  FORM_DATA: this.formData,
7493
+ CAMERA_DATA: this.cameraData,
7299
7494
  TASK_DATA: this.taskData,
7300
7495
  PREVIOUS_FORM_DATA: this.previousFormData,
7301
7496
  ALL_FORMS_DATA: this.allFormsData,
@@ -7308,7 +7503,7 @@
7308
7503
  this.toggleErrorNotification(true);
7309
7504
  setTimeout(function () {
7310
7505
  _this.toggleErrorNotification(false);
7311
- }, 3000);
7506
+ }, FORM_VIEW_TIMERS.INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE);
7312
7507
  return [2 /*return*/];
7313
7508
  }
7314
7509
  _25.label = 4;
@@ -7368,6 +7563,7 @@
7368
7563
  if (kwikidToolkit.isEmptyValue(formData[key])) {
7369
7564
  formData[key] = "";
7370
7565
  }
7566
+ return null;
7371
7567
  });
7372
7568
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
7373
7569
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
@@ -7384,6 +7580,7 @@
7384
7580
  FORM_CONFIG: this.formConfig,
7385
7581
  FORM_FIELDS: this.formFields,
7386
7582
  FORM_DATA: this.formData,
7583
+ CAMERA_DATA: this.cameraData,
7387
7584
  TASK_DATA: this.taskData,
7388
7585
  PREVIOUS_FORM_DATA: this.previousFormData,
7389
7586
  ALL_FORMS_DATA: this.allFormsData,
@@ -7406,7 +7603,7 @@
7406
7603
  clearInterval(intervalId);
7407
7604
  resolve();
7408
7605
  }
7409
- }, 10);
7606
+ }, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
7410
7607
  })];
7411
7608
  case 12:
7412
7609
  // Wait for ngOnChanges to be called before continuing to the next task
@@ -7483,7 +7680,7 @@
7483
7680
  var fieldIndex = this.formFields.findIndex(function (_) {
7484
7681
  return field.key === _.key;
7485
7682
  });
7486
- this.formFields[fieldIndex]["hidden"] = true;
7683
+ this.formFields[fieldIndex].hidden = true;
7487
7684
  this.formGroup.updateValueAndValidity();
7488
7685
  this.triggerLogs(ELogEventType$1.FORM__FIELD_HIDE, {
7489
7686
  field_key: fieldKey,
@@ -7511,7 +7708,7 @@
7511
7708
  var fieldIndex = this.formFields.findIndex(function (_) {
7512
7709
  return field.key === _.key;
7513
7710
  });
7514
- this.formFields[fieldIndex]["hidden"] = false;
7711
+ this.formFields[fieldIndex].hidden = false;
7515
7712
  this.formGroup.updateValueAndValidity();
7516
7713
  this.triggerLogs(ELogEventType$1.FORM__FIELD_SHOW, {
7517
7714
  field_key: fieldKey,
@@ -7540,17 +7737,16 @@
7540
7737
  return field.key === _.key;
7541
7738
  });
7542
7739
  if (field.isFormElement) {
7543
- this.formFields[fieldIndex]["disabled"] = true;
7740
+ this.formFields[fieldIndex].disabled = true;
7544
7741
  if (kwikidToolkit.isNotEmptyValue(this.formGroup.controls)) {
7545
7742
  this.formGroup.controls[field.key].disable({
7546
7743
  emitEvent: false
7547
7744
  });
7548
7745
  }
7549
7746
  this.formGroup.updateValueAndValidity();
7550
- console.log("YES DISABLING THE FIELD");
7551
7747
  }
7552
7748
  else if (field.type === EFieldType.BUTTON) {
7553
- this.formFields[fieldIndex]["disabled"] = true;
7749
+ this.formFields[fieldIndex].disabled = true;
7554
7750
  }
7555
7751
  this.triggerLogs(ELogEventType$1.FORM__FIELD_DISABLE, {
7556
7752
  field_key: fieldKey,
@@ -7579,7 +7775,7 @@
7579
7775
  return field.key === _.key;
7580
7776
  });
7581
7777
  if (field.isFormElement) {
7582
- this.formFields[fieldIndex]["disabled"] = false;
7778
+ this.formFields[fieldIndex].disabled = false;
7583
7779
  if (kwikidToolkit.isNotEmptyValue(this.formGroup.controls)) {
7584
7780
  this.formGroup.controls[field.key].enable({
7585
7781
  emitEvent: false
@@ -7588,7 +7784,7 @@
7588
7784
  this.formGroup.updateValueAndValidity();
7589
7785
  }
7590
7786
  else if (field.type === EFieldType.BUTTON) {
7591
- this.formFields[fieldIndex]["disabled"] = false;
7787
+ this.formFields[fieldIndex].disabled = false;
7592
7788
  }
7593
7789
  this.triggerLogs(ELogEventType$1.FORM__FIELD_ENABLE, {
7594
7790
  field_key: fieldKey,
@@ -7644,23 +7840,24 @@
7644
7840
  });
7645
7841
  // Reset the value of the field in the formFields array
7646
7842
  switch (field.type) {
7647
- case EFieldType.API:
7843
+ case EFieldType.API: {
7648
7844
  var fieldApiCall = field;
7649
7845
  fieldApiCall.api.status.value = EApiStatusType.DEFAULT;
7650
7846
  this.formFields[fieldIndex] = fieldApiCall;
7651
7847
  break;
7652
- case EFieldType.LIVE_LOCATION:
7848
+ }
7849
+ case EFieldType.LIVE_LOCATION: {
7653
7850
  var fieldLiveLocation = field;
7654
7851
  fieldLiveLocation.api.status.value = EApiStatusType.DEFAULT;
7655
7852
  this.formFields[fieldIndex] = fieldLiveLocation;
7656
7853
  break;
7657
- default:
7658
- console.log("BAIJU BEFORE", kwikidToolkit.getObjectDeepCopy(field), kwikidToolkit.getObjectDeepCopy(this.formFields));
7854
+ }
7855
+ default: {
7659
7856
  field.focus = false;
7660
7857
  field.invalid = false;
7661
7858
  this.formFields[fieldIndex] = field;
7662
- console.log("BAIJU AFTER", kwikidToolkit.getObjectDeepCopy(field), kwikidToolkit.getObjectDeepCopy(this.formFields));
7663
7859
  break;
7860
+ }
7664
7861
  }
7665
7862
  this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET, {
7666
7863
  field_key: fieldKey,
@@ -7690,18 +7887,21 @@
7690
7887
  });
7691
7888
  // Reset the value of the field in the formFields array
7692
7889
  switch (field.type) {
7693
- case EFieldType.API:
7890
+ case EFieldType.API: {
7694
7891
  var fieldApiCall = field;
7695
7892
  fieldApiCall.disabled = false;
7696
7893
  this.formFields[fieldIndex] = fieldApiCall;
7697
7894
  break;
7698
- case EFieldType.LIVE_LOCATION:
7895
+ }
7896
+ case EFieldType.LIVE_LOCATION: {
7699
7897
  var fieldLiveLocation = field;
7700
7898
  fieldLiveLocation.disabled = false;
7701
7899
  this.formFields[fieldIndex] = fieldLiveLocation;
7702
7900
  break;
7703
- default:
7901
+ }
7902
+ default: {
7704
7903
  break;
7904
+ }
7705
7905
  }
7706
7906
  };
7707
7907
  KwikIDFormViewComponent.prototype.fieldShowApiLoader = function (fieldKey) {
@@ -7711,18 +7911,21 @@
7711
7911
  });
7712
7912
  // Reset the value of the field in the formFields array
7713
7913
  switch (field.type) {
7714
- case EFieldType.API:
7914
+ case EFieldType.API: {
7715
7915
  var fieldApiCall = field;
7716
7916
  fieldApiCall.disabled = true;
7717
7917
  this.formFields[fieldIndex] = fieldApiCall;
7718
7918
  break;
7719
- case EFieldType.LIVE_LOCATION:
7919
+ }
7920
+ case EFieldType.LIVE_LOCATION: {
7720
7921
  var fieldLiveLocation = field;
7721
7922
  fieldLiveLocation.disabled = true;
7722
7923
  this.formFields[fieldIndex] = fieldLiveLocation;
7723
7924
  break;
7724
- default:
7925
+ }
7926
+ default: {
7725
7927
  break;
7928
+ }
7726
7929
  }
7727
7930
  };
7728
7931
  KwikIDFormViewComponent.prototype.setHtml = function (fieldKey, message) {
@@ -7809,7 +8012,7 @@
7809
8012
  };
7810
8013
  KwikIDFormViewComponent.prototype.fieldApiTimerMessageHide = function (fieldKey) {
7811
8014
  return __awaiter(this, void 0, void 0, function () {
7812
- var field, fieldIndex, ruleEngine_9;
8015
+ var field, fieldIndex, ruleEngine_10;
7813
8016
  var _this = this;
7814
8017
  return __generator(this, function (_15) {
7815
8018
  field = getFormFieldByKey(this.formFields, fieldKey);
@@ -7820,10 +8023,11 @@
7820
8023
  if (field.isFormElement &&
7821
8024
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
7822
8025
  field.validation.triggers.includes("ON_API_TIMER_STOP")) {
7823
- ruleEngine_9 = new kwikidToolkit.RuleEngine({
8026
+ ruleEngine_10 = new kwikidToolkit.RuleEngine({
7824
8027
  FIELD_CONFIG: field,
7825
8028
  FORM_FIELDS: this.formFields,
7826
8029
  FORM_DATA: this.formData,
8030
+ CAMERA_DATA: this.cameraData,
7827
8031
  TASK_DATA: this.taskData,
7828
8032
  PREVIOUS_FORM_DATA: this.previousFormData,
7829
8033
  ALL_FORMS_DATA: this.allFormsData,
@@ -7832,7 +8036,7 @@
7832
8036
  (function () { return __awaiter(_this, void 0, void 0, function () {
7833
8037
  return __generator(this, function (_15) {
7834
8038
  switch (_15.label) {
7835
- case 0: return [4 /*yield*/, ruleEngine_9.run(field.validation)];
8039
+ case 0: return [4 /*yield*/, ruleEngine_10.run(field.validation)];
7836
8040
  case 1:
7837
8041
  _15.sent();
7838
8042
  return [2 /*return*/];
@@ -8130,11 +8334,12 @@
8130
8334
  entrypointApiKey = action.props.apiKey;
8131
8335
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
8132
8336
  endpoints = field.api.endpoints;
8133
- nextApiIndex = endpoints.findIndex(function (api) { return api.apiKey == entrypointApiKey; });
8337
+ nextApiIndex = endpoints.findIndex(function (api) { return api.apiKey === entrypointApiKey; });
8134
8338
  apiConfig = endpoints[nextApiIndex];
8135
8339
  return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
8136
8340
  case 1:
8137
8341
  response = _15.sent();
8342
+ // eslint-disable-next-line prefer-destructuring
8138
8343
  field = response.field;
8139
8344
  field.api.endpoints[nextApiIndex] = response.api;
8140
8345
  return [2 /*return*/];
@@ -8149,7 +8354,7 @@
8149
8354
  return __generator(this, function (_16) {
8150
8355
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
8151
8356
  multipleApiCallResponses = {};
8152
- field.api.endpoints.map(function (api) {
8357
+ field.api.endpoints.forEach(function (api) {
8153
8358
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
8154
8359
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
8155
8360
  });
@@ -8191,7 +8396,7 @@
8191
8396
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "apiKey")) return [3 /*break*/, 2];
8192
8397
  entrypointApiKey_1 = action.props.apiKey;
8193
8398
  endpoints = multipleApiConfig.endpoints;
8194
- nextApiIndex = endpoints.findIndex(function (api) { return api.apiKey == entrypointApiKey_1; });
8399
+ nextApiIndex = endpoints.findIndex(function (api) { return api.apiKey === entrypointApiKey_1; });
8195
8400
  apiConfig = endpoints[nextApiIndex];
8196
8401
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
8197
8402
  case 1:
@@ -8206,6 +8411,7 @@
8206
8411
  API_CONFIG: multipleApiConfig,
8207
8412
  FORM_FIELDS: this.formFields,
8208
8413
  FORM_DATA: this.formData,
8414
+ CAMERA_DATA: this.cameraData,
8209
8415
  TASK_DATA: this.taskData,
8210
8416
  PREVIOUS_FORM_DATA: this.previousFormData,
8211
8417
  ALL_FORMS_DATA: this.allFormsData,
@@ -8227,7 +8433,7 @@
8227
8433
  return __generator(this, function (_16) {
8228
8434
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
8229
8435
  multipleApiCallResponses = {};
8230
- multipleApiConfig.endpoints.map(function (api) {
8436
+ multipleApiConfig.endpoints.forEach(function (api) {
8231
8437
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
8232
8438
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
8233
8439
  });
@@ -8269,7 +8475,8 @@
8269
8475
  if (kwikidToolkit.checkObjectKeyExists(action.props.url, "url")) {
8270
8476
  var timeout = 2000;
8271
8477
  if (kwikidToolkit.checkObjectKeyExists(action.props.url, "timeout") &&
8272
- typeof action.props.url.timeout == "number") {
8478
+ typeof action.props.url.timeout === "number") {
8479
+ // eslint-disable-next-line prefer-destructuring
8273
8480
  timeout = action.props.url.timeout;
8274
8481
  }
8275
8482
  this.triggerLogs(ELogEventType$1.FORM__REDIRECT_URL, {
@@ -8300,10 +8507,12 @@
8300
8507
  else {
8301
8508
  var formDataInKwikUIFormat = {};
8302
8509
  for (var fieldKey in formData) {
8303
- var field = getFormFieldByKey(this.formFields, fieldKey);
8304
- if (!kwikidToolkit.isUndefined(field) && !kwikidToolkit.isNull(field)) {
8305
- formDataInKwikUIFormat[fieldKey] =
8306
- convertFormFieldValueToKwikUIFormat(field, formData[fieldKey]);
8510
+ if (kwikidToolkit.isNotEmptyValue(fieldKey)) {
8511
+ var field = getFormFieldByKey(this.formFields, fieldKey);
8512
+ if (!kwikidToolkit.isUndefined(field) && !kwikidToolkit.isNull(field)) {
8513
+ formDataInKwikUIFormat[fieldKey] =
8514
+ convertFormFieldValueToKwikUIFormat(field, formData[fieldKey]);
8515
+ }
8307
8516
  }
8308
8517
  }
8309
8518
  this.formGroup.patchValue(formDataInKwikUIFormat, { emitEvent: false });
@@ -8487,7 +8696,7 @@
8487
8696
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
8488
8697
  var _a, _b, _c, _d, _e, _f;
8489
8698
  return __awaiter(this, void 0, void 0, function () {
8490
- var _15, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue, fieldHtmlMessage_Source, fieldHtmlMessageSourceValue;
8699
+ var _15, fieldErrorShowSource, fieldErrorShowSourceValue, fieldErrorHideSource, fieldErrorHideSourceValue, redirectToUrlSource, redirectToUrlSourceValue, previewErrorShowSource, previewErrorShowSourceValue, fieldHtmlMessageSource, fieldHtmlMessageSourceValue;
8491
8700
  return __generator(this, function (_16) {
8492
8701
  switch (_16.label) {
8493
8702
  case 0:
@@ -8562,12 +8771,12 @@
8562
8771
  return [3 /*break*/, 73];
8563
8772
  case 8:
8564
8773
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 10];
8565
- fieldErrorShow_Source = new kwikidToolkit.Source(object);
8566
- return [4 /*yield*/, fieldErrorShow_Source.getValueFromSource(action.props.message.source)];
8774
+ fieldErrorShowSource = new kwikidToolkit.Source(object);
8775
+ return [4 /*yield*/, fieldErrorShowSource.getValueFromSource(action.props.message.source)];
8567
8776
  case 9:
8568
8777
  fieldErrorShowSourceValue = _16.sent();
8569
- if (typeof fieldErrorShowSourceValue == "string" ||
8570
- typeof fieldErrorShowSourceValue == "number") {
8778
+ if (typeof fieldErrorShowSourceValue === "string" ||
8779
+ typeof fieldErrorShowSourceValue === "number") {
8571
8780
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
8572
8781
  }
8573
8782
  else {
@@ -8581,12 +8790,12 @@
8581
8790
  return [3 /*break*/, 73];
8582
8791
  case 11:
8583
8792
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 13];
8584
- fieldErrorHide_Source = new kwikidToolkit.Source(object);
8585
- return [4 /*yield*/, fieldErrorHide_Source.getValueFromSource(action.props.message.source)];
8793
+ fieldErrorHideSource = new kwikidToolkit.Source(object);
8794
+ return [4 /*yield*/, fieldErrorHideSource.getValueFromSource(action.props.message.source)];
8586
8795
  case 12:
8587
8796
  fieldErrorHideSourceValue = _16.sent();
8588
- if (typeof fieldErrorHideSourceValue == "string" ||
8589
- typeof fieldErrorHideSourceValue == "number") {
8797
+ if (typeof fieldErrorHideSourceValue === "string" ||
8798
+ typeof fieldErrorHideSourceValue === "number") {
8590
8799
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
8591
8800
  }
8592
8801
  else {
@@ -8676,8 +8885,8 @@
8676
8885
  return [3 /*break*/, 73];
8677
8886
  case 51:
8678
8887
  if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 53];
8679
- redirectToUrl_Source = new kwikidToolkit.Source(object);
8680
- return [4 /*yield*/, redirectToUrl_Source.getValueFromSource(action.props.url.source)];
8888
+ redirectToUrlSource = new kwikidToolkit.Source(object);
8889
+ return [4 /*yield*/, redirectToUrlSource.getValueFromSource(action.props.url.source)];
8681
8890
  case 52:
8682
8891
  redirectToUrlSourceValue = _16.sent();
8683
8892
  if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
@@ -8687,18 +8896,18 @@
8687
8896
  _16.label = 53;
8688
8897
  case 53:
8689
8898
  this.redirectToUrl(action);
8690
- _16.label = 54;
8899
+ return [3 /*break*/, 73];
8691
8900
  case 54:
8692
8901
  this.showPreview(action.props);
8693
8902
  return [3 /*break*/, 73];
8694
8903
  case 55:
8695
8904
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 57];
8696
- previewErrorShow_Source = new kwikidToolkit.Source(object);
8697
- return [4 /*yield*/, previewErrorShow_Source.getValueFromSource(action.props.message.source)];
8905
+ previewErrorShowSource = new kwikidToolkit.Source(object);
8906
+ return [4 /*yield*/, previewErrorShowSource.getValueFromSource(action.props.message.source)];
8698
8907
  case 56:
8699
8908
  previewErrorShowSourceValue = _16.sent();
8700
- if (typeof previewErrorShowSourceValue == "string" ||
8701
- typeof previewErrorShowSourceValue == "number") {
8909
+ if (typeof previewErrorShowSourceValue === "string" ||
8910
+ typeof previewErrorShowSourceValue === "number") {
8702
8911
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
8703
8912
  }
8704
8913
  else {
@@ -8749,12 +8958,12 @@
8749
8958
  return [3 /*break*/, 73];
8750
8959
  case 69:
8751
8960
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 71];
8752
- fieldHtmlMessage_Source = new kwikidToolkit.Source(object);
8753
- return [4 /*yield*/, fieldHtmlMessage_Source.getValueFromSource(action.props.message.source)];
8961
+ fieldHtmlMessageSource = new kwikidToolkit.Source(object);
8962
+ return [4 /*yield*/, fieldHtmlMessageSource.getValueFromSource(action.props.message.source)];
8754
8963
  case 70:
8755
8964
  fieldHtmlMessageSourceValue = _16.sent();
8756
- if (typeof fieldHtmlMessageSourceValue == "string" ||
8757
- typeof fieldHtmlMessageSourceValue == "number") {
8965
+ if (typeof fieldHtmlMessageSourceValue === "string" ||
8966
+ typeof fieldHtmlMessageSourceValue === "number") {
8758
8967
  fieldHtmlMessageSourceValue = String(fieldHtmlMessageSourceValue);
8759
8968
  }
8760
8969
  else {
@@ -8775,7 +8984,7 @@
8775
8984
  return KwikIDFormViewComponent;
8776
8985
  }());
8777
8986
  /** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: KwikIDFormViewService }, { token: KwikIDFormViewApiService }, { token: i6.TuiPushService }, { token: i5.TuiAlertService }, { token: i7.TuiPreviewDialogService }, { token: i5.TuiDialogService }, { token: i3__namespace.KwikUILoaderService }, { token: i4__namespace.KwikIDCameraRecordService }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
8778
- /** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"cameraType\"\n [data]=\"cameraData\"\n [image]=\"cameraImage\"\n [video]=\"cameraVideo\"\n [config]=\"cameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, cameraType)\"\n >\n <ng-container\n *ngIf=\"cameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"cameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n cameraConfig?.header?.isBack && cameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"cameraRecordingState == 'RECORDING'\"\n [class.paused]=\"cameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"cameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"cameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n &nbsp;{{ cameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"cameraConfig?.others?.maxRecordingTimeInSeconds\"\n >\n /\n {{\n cameraConfig?.others?.maxRecordingTimeInSeconds\n | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3__namespace.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3__namespace.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3__namespace.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4__namespace.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3__namespace.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4__namespace.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6__namespace.TuiPushDirective, selector: "tui-push" }, { type: i7__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3__namespace.KwikUISafeHtmlPipe, "kwikuiSafeUrl": i3__namespace.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
8987
+ /** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterImageUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterVideoUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"activeCameraType\"\n [data]=\"activeCameraData\"\n [image]=\"activeCameraImage\"\n [video]=\"activeCameraVideo\"\n [config]=\"activeCameraConfig?.cameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, activeCameraType)\"\n >\n <ng-container\n *ngIf=\"activeCameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"activeCameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n activeCameraConfig?.cameraConfig?.header?.isBack &&\n activeCameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"activeCameraRecordingState == 'RECORDING'\"\n [class.paused]=\"activeCameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"activeCameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"activeCameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n &nbsp;{{ activeCameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"\n activeCameraConfig?.cameraConfig?.others\n ?.maxRecordingTimeInSeconds\n \"\n >\n /\n {{\n activeCameraConfig?.cameraConfig?.others\n ?.maxRecordingTimeInSeconds | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3__namespace.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3__namespace.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3__namespace.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4__namespace.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3__namespace.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4__namespace.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6__namespace.TuiPushDirective, selector: "tui-push" }, { type: i7__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3__namespace.KwikUISafeHtmlPipe, "filterImageUrlOrBase64FromObject": FilterImageUrlOrBase64FromObjectPipe, "filterVideoUrlOrBase64FromObject": FilterVideoUrlOrBase64FromObjectPipe, "kwikuiSafeUrl": i3__namespace.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
8779
8988
  __decorate([
8780
8989
  kwikidToolkit.logMethod
8781
8990
  ], KwikIDFormViewComponent.prototype, "resetCamera", null);
@@ -8866,9 +9075,6 @@
8866
9075
  __decorate([
8867
9076
  kwikidToolkit.logMethod
8868
9077
  ], KwikIDFormViewComponent.prototype, "handleGetKeyValue", null);
8869
- __decorate([
8870
- kwikidToolkit.logMethod
8871
- ], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields2", null);
8872
9078
  __decorate([
8873
9079
  kwikidToolkit.logMethod
8874
9080
  ], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields", null);
@@ -9124,8 +9330,9 @@
9124
9330
  type: i0.Output
9125
9331
  }], onClickViewForms: [{
9126
9332
  type: i0.Output
9127
- }], 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: [], handleOnClickResetFormFields2: [], 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: [] } });
9333
+ }], 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: [] } });
9128
9334
 
9335
+ /* eslint-disable no-unused-vars */
9129
9336
  var EFormType;
9130
9337
  (function (EFormType) {
9131
9338
  EFormType["FORM"] = "FORM";
@@ -9178,8 +9385,8 @@
9178
9385
  this.isAllFormsCompleted = true;
9179
9386
  this.loading = false;
9180
9387
  }
9181
- KwikIDFormsListComponent.prototype.setSelectedForm = function (selected_form) {
9182
- this.selectedForm = selected_form;
9388
+ KwikIDFormsListComponent.prototype.setSelectedForm = function (selectedForm) {
9389
+ this.selectedForm = selectedForm;
9183
9390
  };
9184
9391
  KwikIDFormsListComponent.prototype.ngOnInit = function () {
9185
9392
  var _a, _b;
@@ -9242,14 +9449,12 @@
9242
9449
  if (kwikidToolkit.isNull(stepConfig) || kwikidToolkit.isUndefined(stepConfig)) {
9243
9450
  stepConfig = kwikidToolkit.setValueToObjectPath({}, "props", stepConfigProperties);
9244
9451
  }
9452
+ else if (kwikidToolkit.checkObjectKeyExists(stepConfig, "props")) {
9453
+ stepConfigProperties = kwikidToolkit.mergeObjects(stepConfigProperties, stepConfig.props);
9454
+ stepConfig = kwikidToolkit.setValueToObjectPath(stepConfig, "props", stepConfigProperties);
9455
+ }
9245
9456
  else {
9246
- if (kwikidToolkit.checkObjectKeyExists(stepConfig, "props")) {
9247
- stepConfigProperties = kwikidToolkit.mergeObjects(stepConfigProperties, stepConfig.props);
9248
- stepConfig = kwikidToolkit.setValueToObjectPath(stepConfig, "props", stepConfigProperties);
9249
- }
9250
- else {
9251
- stepConfig = kwikidToolkit.setValueToObjectPath(stepConfig, "props", stepConfigProperties);
9252
- }
9457
+ stepConfig = kwikidToolkit.setValueToObjectPath(stepConfig, "props", stepConfigProperties);
9253
9458
  }
9254
9459
  stepConfig.props.formListProperties.footer.submitFormButton.label =
9255
9460
  updateLanguage(stepConfig.props.formListProperties.footer.submitFormButton.label, getLanguage());
@@ -9258,43 +9463,34 @@
9258
9463
  KwikIDFormsListComponent.prototype.filterHiddenForms = function (formsList) {
9259
9464
  return formsList.filter(function (form) {
9260
9465
  if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9261
- if (!form.hidden) {
9262
- return form;
9263
- }
9466
+ return !form.hidden;
9264
9467
  }
9468
+ return false;
9265
9469
  });
9266
9470
  };
9267
9471
  KwikIDFormsListComponent.prototype.setFormTitles = function (formsList) {
9268
- return formsList.filter(function (form) {
9472
+ return formsList
9473
+ .map(function (form) {
9269
9474
  if (form.type === EFormType.HTML) {
9270
- return form;
9475
+ return form; // No modification, just return
9271
9476
  }
9272
- else {
9273
- if (kwikidToolkit.checkObjectPathExists(form, "props.title")) {
9274
- form.props.title = updateLanguage(form.props.title, getLanguage());
9275
- return form;
9276
- }
9477
+ if (kwikidToolkit.checkObjectPathExists(form, "props.title")) {
9478
+ form.props.title = updateLanguage(form.props.title, getLanguage());
9277
9479
  }
9278
- });
9480
+ return form; // Return the form regardless of modification
9481
+ })
9482
+ .filter(function (form) { return form.type === EFormType.HTML ||
9483
+ kwikidToolkit.checkObjectPathExists(form, "props.title"); });
9279
9484
  };
9280
9485
  KwikIDFormsListComponent.prototype.findFormsListLength = function (formsList) {
9281
- var _formsList = formsList.filter(function (form) {
9486
+ return formsList.filter(function (form) {
9282
9487
  if (kwikidToolkit.checkObjectKeyExists(form, "type")) {
9283
- if (form.type !== EFormType.HTML) {
9284
- if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9285
- if (!form.hidden) {
9286
- return form;
9287
- }
9288
- }
9289
- }
9290
- }
9291
- else if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9292
- if (!form.hidden) {
9293
- return form;
9294
- }
9488
+ return (form.type !== EFormType.HTML &&
9489
+ kwikidToolkit.checkObjectKeyExists(form, "hidden") &&
9490
+ !form.hidden);
9295
9491
  }
9296
- });
9297
- return _formsList.length;
9492
+ return kwikidToolkit.checkObjectKeyExists(form, "hidden") && !form.hidden;
9493
+ }).length;
9298
9494
  };
9299
9495
  KwikIDFormsListComponent.prototype.checkIsAllFormsCompleted = function (formsList) {
9300
9496
  var e_1, _g;
@@ -9364,6 +9560,9 @@
9364
9560
  __decorate([
9365
9561
  kwikidToolkit.logMethod
9366
9562
  ], KwikIDFormsListComponent.prototype, "filterHiddenForms", null);
9563
+ __decorate([
9564
+ kwikidToolkit.logMethod
9565
+ ], KwikIDFormsListComponent.prototype, "setFormTitles", null);
9367
9566
  __decorate([
9368
9567
  kwikidToolkit.logMethod
9369
9568
  ], KwikIDFormsListComponent.prototype, "findFormsListLength", null);
@@ -9383,7 +9582,7 @@
9383
9582
  templateUrl: "./forms-list.component.html",
9384
9583
  styleUrls: ["./forms-list.component.scss", "../shared.scss"]
9385
9584
  }]
9386
- }], ctorParameters: function () { return []; }, propDecorators: { showFormFields: [{
9585
+ }], propDecorators: { showFormFields: [{
9387
9586
  type: i0.Input
9388
9587
  }], userConfig: [{
9389
9588
  type: i0.Input
@@ -9407,7 +9606,7 @@
9407
9606
  type: i0.Output
9408
9607
  }], onClickSubmitForms: [{
9409
9608
  type: i0.Output
9410
- }], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
9609
+ }], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], setFormTitles: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
9411
9610
 
9412
9611
  var ERendererActionKey;
9413
9612
  (function (ERendererActionKey) {
@@ -9420,9 +9619,7 @@
9420
9619
 
9421
9620
  var getFormConfigByKey = function (forms, key) {
9422
9621
  var form = forms.find(function (form) {
9423
- if (form.key === key) {
9424
- return form;
9425
- }
9622
+ return form.key === key;
9426
9623
  });
9427
9624
  return form;
9428
9625
  };
@@ -9538,7 +9735,7 @@
9538
9735
  };
9539
9736
  KwikIDFormsRendererComponent.prototype.ngOnChanges = function (changes) {
9540
9737
  var verifyChange = function (prop) {
9541
- return changes.hasOwnProperty(prop) && !changes[prop].firstChange;
9738
+ return kwikidToolkit.checkObjectKeyExists(changes, prop) && !changes[prop].firstChange;
9542
9739
  };
9543
9740
  if (verifyChange("userConfig")) {
9544
9741
  this.userConfig = changes.userConfig.currentValue;
@@ -9641,19 +9838,19 @@
9641
9838
  if (kwikidToolkit.checkObjectKeyExists(form, "formContent")) {
9642
9839
  if (kwikidToolkit.checkObjectKeyExists(form.formContent, "url")) {
9643
9840
  form = kwikidToolkit.setValueToObjectPath(form, "props.url", form.formContent.url);
9644
- delete form["formContent"]["url"];
9841
+ delete form.formContent.url;
9645
9842
  }
9646
9843
  if (kwikidToolkit.checkObjectKeyExists(form.formContent, "path")) {
9647
9844
  form = kwikidToolkit.setValueToObjectPath(form, "props.path", form.formContent.path);
9648
- delete form["formContent"]["path"];
9845
+ delete form.formContent.path;
9649
9846
  }
9650
9847
  }
9651
9848
  if (kwikidToolkit.isEmptyValue(form.formContent)) {
9652
- delete form["formContent"];
9849
+ delete form.formContent;
9653
9850
  }
9654
9851
  if (kwikidToolkit.checkObjectKeyExists(form, "title")) {
9655
9852
  form = kwikidToolkit.setValueToObjectPath(form, "props.title", form.title);
9656
- delete form["title"];
9853
+ delete form.title;
9657
9854
  }
9658
9855
  if (!kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9659
9856
  form.hidden = false;
@@ -9679,18 +9876,16 @@
9679
9876
  htmlContent: form.htmlContent
9680
9877
  };
9681
9878
  }
9682
- delete form["htmlContent"];
9879
+ delete form.htmlContent;
9683
9880
  }
9684
- else {
9685
- if (!kwikidToolkit.checkObjectKeyExists(form, "props")) {
9686
- form.props = {
9687
- htmlContent: ""
9688
- };
9689
- }
9881
+ else if (!kwikidToolkit.checkObjectKeyExists(form, "props")) {
9882
+ form.props = {
9883
+ htmlContent: ""
9884
+ };
9690
9885
  }
9691
9886
  if (kwikidToolkit.checkObjectKeyExists(form, "title")) {
9692
9887
  form = kwikidToolkit.setValueToObjectPath(form, "props.title", form.title);
9693
- delete form["title"];
9888
+ delete form.title;
9694
9889
  }
9695
9890
  if (!kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9696
9891
  form.hidden = false;
@@ -9727,10 +9922,11 @@
9727
9922
  var form = formsList_1_1.value;
9728
9923
  if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9729
9924
  if (!form.hidden && form.type !== EFormType.HTML) {
9730
- form.sequenceNo = sequenceNo++;
9925
+ form.sequenceNo = sequenceNo;
9926
+ sequenceNo += 1;
9731
9927
  }
9732
9928
  else {
9733
- delete form["sequenceNo"];
9929
+ delete form.sequenceNo;
9734
9930
  }
9735
9931
  }
9736
9932
  }
@@ -9746,7 +9942,7 @@
9746
9942
  };
9747
9943
  KwikIDFormsRendererComponent.prototype.findCompletedFormsList = function (allFormsData) {
9748
9944
  var formsListCompleted = [];
9749
- Object.keys(allFormsData).map(function (formKey) {
9945
+ Object.keys(allFormsData).forEach(function (formKey) {
9750
9946
  formsListCompleted.push(formKey);
9751
9947
  });
9752
9948
  return formsListCompleted;
@@ -9875,47 +10071,44 @@
9875
10071
  return allFormsCompleted;
9876
10072
  };
9877
10073
  KwikIDFormsRendererComponent.prototype.findActiveFormConfig = function (formsList) {
9878
- var activeFormConfig = formsList.find(function (form) {
9879
- if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9880
- if (!form.hidden && form.type !== EFormType.HTML) {
9881
- return form.status === "editable" && !form.disabled;
9882
- }
9883
- }
10074
+ return formsList.find(function (form) {
10075
+ return (kwikidToolkit.checkObjectKeyExists(form, "hidden") &&
10076
+ !form.hidden &&
10077
+ form.type !== EFormType.HTML &&
10078
+ form.status === "editable" &&
10079
+ !form.disabled);
9884
10080
  });
9885
- return activeFormConfig;
9886
10081
  };
9887
10082
  KwikIDFormsRendererComponent.prototype.updateFormsList = function () {
9888
10083
  return __awaiter(this, void 0, void 0, function () {
9889
- var _o, _p, form, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_6_1, e_7_1, currentUserFormAllFormsData;
9890
- var e_7, _q, e_6, _r;
9891
- return __generator(this, function (_s) {
9892
- switch (_s.label) {
10084
+ var _o, _p, form, _q, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_6_1, e_7_1, currentUserFormAllFormsData;
10085
+ var e_7, _r, e_6, _s;
10086
+ return __generator(this, function (_t) {
10087
+ switch (_t.label) {
9893
10088
  case 0:
9894
10089
  this.formsList = this.convertFormListConfig(this.formsList);
9895
- _s.label = 1;
10090
+ _t.label = 1;
9896
10091
  case 1:
9897
- _s.trys.push([1, 14, 15, 16]);
10092
+ _t.trys.push([1, 14, 15, 16]);
9898
10093
  _o = __values(this.formsList), _p = _o.next();
9899
- _s.label = 2;
10094
+ _t.label = 2;
9900
10095
  case 2:
9901
10096
  if (!!_p.done) return [3 /*break*/, 13];
9902
10097
  form = _p.value;
9903
10098
  if (!(kwikidToolkit.checkObjectKeyExists(form, "default") &&
9904
10099
  kwikidToolkit.isNotEmptyValue(form.default))) return [3 /*break*/, 11];
9905
- triggers = form.default.triggers;
9906
- rules = form.default.rules;
9907
- actions = form.default.actions;
10100
+ _q = form.default, triggers = _q.triggers, rules = _q.rules, actions = _q.actions;
9908
10101
  rulesMapping = new kwikidToolkit.Rule(rules, {
9909
10102
  USER_CONFIG: this.userConfig,
9910
10103
  FORMS_LIST: this.formsList,
9911
10104
  ALL_FORMS_DATA: this.allFormsData,
9912
10105
  EXTRA_DATA: this.extraData
9913
10106
  }).mapping();
9914
- _s.label = 3;
10107
+ _t.label = 3;
9915
10108
  case 3:
9916
- _s.trys.push([3, 8, 9, 10]);
10109
+ _t.trys.push([3, 8, 9, 10]);
9917
10110
  actions_1 = (e_6 = void 0, __values(actions)), actions_1_1 = actions_1.next();
9918
- _s.label = 4;
10111
+ _t.label = 4;
9919
10112
  case 4:
9920
10113
  if (!!actions_1_1.done) return [3 /*break*/, 7];
9921
10114
  action = actions_1_1.value;
@@ -9928,19 +10121,19 @@
9928
10121
  }, this.takeAction.bind(this));
9929
10122
  return [4 /*yield*/, actions_2.execute()];
9930
10123
  case 5:
9931
- _s.sent();
9932
- _s.label = 6;
10124
+ _t.sent();
10125
+ _t.label = 6;
9933
10126
  case 6:
9934
10127
  actions_1_1 = actions_1.next();
9935
10128
  return [3 /*break*/, 4];
9936
10129
  case 7: return [3 /*break*/, 10];
9937
10130
  case 8:
9938
- e_6_1 = _s.sent();
10131
+ e_6_1 = _t.sent();
9939
10132
  e_6 = { error: e_6_1 };
9940
10133
  return [3 /*break*/, 10];
9941
10134
  case 9:
9942
10135
  try {
9943
- if (actions_1_1 && !actions_1_1.done && (_r = actions_1.return)) _r.call(actions_1);
10136
+ if (actions_1_1 && !actions_1_1.done && (_s = actions_1.return)) _s.call(actions_1);
9944
10137
  }
9945
10138
  finally { if (e_6) throw e_6.error; }
9946
10139
  return [7 /*endfinally*/];
@@ -9949,18 +10142,18 @@
9949
10142
  if (!kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
9950
10143
  form.hidden = false;
9951
10144
  }
9952
- _s.label = 12;
10145
+ _t.label = 12;
9953
10146
  case 12:
9954
10147
  _p = _o.next();
9955
10148
  return [3 /*break*/, 2];
9956
10149
  case 13: return [3 /*break*/, 16];
9957
10150
  case 14:
9958
- e_7_1 = _s.sent();
10151
+ e_7_1 = _t.sent();
9959
10152
  e_7 = { error: e_7_1 };
9960
10153
  return [3 /*break*/, 16];
9961
10154
  case 15:
9962
10155
  try {
9963
- if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
10156
+ if (_p && !_p.done && (_r = _o.return)) _r.call(_o);
9964
10157
  }
9965
10158
  finally { if (e_7) throw e_7.error; }
9966
10159
  return [7 /*endfinally*/];
@@ -10047,23 +10240,15 @@
10047
10240
  });
10048
10241
  };
10049
10242
  KwikIDFormsRendererComponent.prototype.findFormsListLength = function (formsList) {
10050
- var _formsList = formsList.filter(function (form) {
10243
+ var updatedFormsList = formsList.filter(function (form) {
10051
10244
  if (kwikidToolkit.checkObjectKeyExists(form, "type")) {
10052
- if (form.type !== EFormType.HTML) {
10053
- if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
10054
- if (!form.hidden) {
10055
- return form;
10056
- }
10057
- }
10058
- }
10059
- }
10060
- else if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
10061
- if (!form.hidden) {
10062
- return form;
10063
- }
10245
+ return (form.type !== EFormType.HTML &&
10246
+ kwikidToolkit.checkObjectKeyExists(form, "hidden") &&
10247
+ !form.hidden);
10064
10248
  }
10249
+ return kwikidToolkit.checkObjectKeyExists(form, "hidden") && !form.hidden;
10065
10250
  });
10066
- return _formsList.length;
10251
+ return updatedFormsList.length;
10067
10252
  };
10068
10253
  /**
10069
10254
  * Library Event Listeners
@@ -10083,12 +10268,9 @@
10083
10268
  this.toggleLoader(true);
10084
10269
  this.isUnsavedData = false;
10085
10270
  activeFormConfig = this.formsList.find(function (form) {
10086
- if (form.key === selectedForm) {
10087
- return form;
10088
- }
10271
+ return form.key === selectedForm;
10089
10272
  });
10090
10273
  activeFormConfig = new Converter().updateFormConfigProperties(activeFormConfig);
10091
- formConfig = undefined;
10092
10274
  if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig, "props")) return [3 /*break*/, 6];
10093
10275
  if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig.props, "url")) return [3 /*break*/, 2];
10094
10276
  return [4 /*yield*/, this.fetchFormConfig(activeFormConfig.props.url)];
@@ -10219,8 +10401,8 @@
10219
10401
  .subscribe({
10220
10402
  next: function (data) {
10221
10403
  _this.popupFormCallback = {
10222
- popupFormData: data["data"],
10223
- popupFormConfig: data["formConfig"],
10404
+ popupFormData: data.data,
10405
+ popupFormConfig: data.formConfig,
10224
10406
  activeFormConfig: _this.activeFormConfig
10225
10407
  };
10226
10408
  _this.activePopupFormData = {};
@@ -10249,8 +10431,8 @@
10249
10431
  .subscribe({
10250
10432
  next: function (data) {
10251
10433
  _this.popupFormCallback = {
10252
- popupFormData: data["data"],
10253
- popupFormConfig: data["formConfig"],
10434
+ popupFormData: data.data,
10435
+ popupFormConfig: data.formConfig,
10254
10436
  activeFormConfig: _this.activeFormConfig
10255
10437
  };
10256
10438
  _this.activePopupFormData = {};
@@ -10290,9 +10472,9 @@
10290
10472
  this.toggleLoader(true);
10291
10473
  this.getFormData.emit((_o = {},
10292
10474
  _o[this.activeFormConfig.key] = {
10293
- formConfig: e["formConfig"],
10294
- data: e["data"],
10295
- extendedData: e["extendedData"]
10475
+ formConfig: e.formConfig,
10476
+ data: e.data,
10477
+ extendedData: e.extendedData
10296
10478
  },
10297
10479
  _o));
10298
10480
  break;
@@ -10335,34 +10517,26 @@
10335
10517
  this.showFormSections = true;
10336
10518
  this.showForm = false;
10337
10519
  this.showFormFields = false;
10338
- return;
10520
+ }
10521
+ else if (this.checkIfFormsStatusCompleted(this.formsList, this.formsListCompleted)) {
10522
+ this.showFormSections = true;
10523
+ this.showForm = false;
10524
+ this.showFormFields = false;
10339
10525
  }
10340
10526
  else {
10341
- if (this.checkIfFormsStatusCompleted(this.formsList, this.formsListCompleted)) {
10342
- this.showFormSections = true;
10343
- this.showForm = false;
10344
- this.showFormFields = false;
10345
- return;
10346
- }
10347
- else {
10348
- var previousFormConfigDirect = this.formsList.find(function (form) {
10349
- if (form.sequenceNo === _this.activeFormConfig.sequenceNo - 1 &&
10350
- form.status !== EFormsListStatus.LOCKED) {
10351
- return form;
10352
- }
10353
- });
10354
- if (previousFormConfigDirect) {
10355
- this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
10356
- }
10527
+ var previousFormConfigDirect = this.formsList.find(function (form) {
10528
+ return (form.sequenceNo === _this.activeFormConfig.sequenceNo - 1 &&
10529
+ form.status !== EFormsListStatus.LOCKED);
10530
+ });
10531
+ if (previousFormConfigDirect) {
10532
+ this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
10357
10533
  }
10358
10534
  }
10359
10535
  break;
10360
- case EFormViewGoBackMode.TABBED:
10536
+ case EFormViewGoBackMode.TABBED: {
10361
10537
  var previousFormConfig = this.formsList.find(function (form) {
10362
- if (form.sequenceNo < _this.activeFormConfig.sequenceNo &&
10363
- form.status === EFormsListStatus.EDITABLE) {
10364
- return form;
10365
- }
10538
+ return (form.sequenceNo < _this.activeFormConfig.sequenceNo &&
10539
+ form.status === EFormsListStatus.EDITABLE);
10366
10540
  });
10367
10541
  if (previousFormConfig) {
10368
10542
  this.handleOnClickSetActiveForm(previousFormConfig.key, undefined);
@@ -10373,6 +10547,7 @@
10373
10547
  this.showFormFields = false;
10374
10548
  }
10375
10549
  break;
10550
+ }
10376
10551
  default:
10377
10552
  break;
10378
10553
  }
@@ -10736,7 +10911,11 @@
10736
10911
  return KwikIDFormViewModule;
10737
10912
  }());
10738
10913
  /** @nocollapse */ KwikIDFormViewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
10739
- /** @nocollapse */ KwikIDFormViewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent, StyleSanitizerPipe, TimerPipe], imports: [i3$2.CommonModule,
10914
+ /** @nocollapse */ KwikIDFormViewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent,
10915
+ StyleSanitizerPipe,
10916
+ TimerPipe,
10917
+ FilterImageUrlOrBase64FromObjectPipe,
10918
+ FilterVideoUrlOrBase64FromObjectPipe], imports: [i3$2.CommonModule,
10740
10919
  i3.FormsModule,
10741
10920
  i3.ReactiveFormsModule,
10742
10921
  i5.TuiLabelModule,
@@ -10771,7 +10950,13 @@
10771
10950
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, decorators: [{
10772
10951
  type: i0.NgModule,
10773
10952
  args: [{
10774
- declarations: [KwikIDFormViewComponent, StyleSanitizerPipe, TimerPipe],
10953
+ declarations: [
10954
+ KwikIDFormViewComponent,
10955
+ StyleSanitizerPipe,
10956
+ TimerPipe,
10957
+ FilterImageUrlOrBase64FromObjectPipe,
10958
+ FilterVideoUrlOrBase64FromObjectPipe
10959
+ ],
10775
10960
  imports: [
10776
10961
  i3$2.CommonModule,
10777
10962
  i3.FormsModule,