@yoobic/yobi 7.7.96 → 7.7.100

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 (89) hide show
  1. package/dist/cjs/{grid-renderers-dacdc474.js → grid-renderers-374ca7e9.js} +7 -3
  2. package/dist/cjs/{image-helpers-ea15b526.js → image-helpers-3385fd6f.js} +2 -2
  3. package/dist/cjs/{index-541062cd.js → index-621e23cc.js} +11 -3
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/yoo-action-sheet-controller_15.cjs.entry.js +1 -1
  6. package/dist/cjs/yoo-ag-grid_96.cjs.entry.js +2 -2
  7. package/dist/cjs/yoo-avatar_5.cjs.entry.js +1 -1
  8. package/dist/cjs/yoo-card-header.cjs.entry.js +1 -1
  9. package/dist/cjs/yoo-card-list-image_12.cjs.entry.js +2 -2
  10. package/dist/cjs/yoo-form-choice_4.cjs.entry.js +1 -1
  11. package/dist/cjs/yoo-form-creator-block-expandable.cjs.entry.js +1 -1
  12. package/dist/cjs/yoo-form-creator-block-simple_4.cjs.entry.js +2 -2
  13. package/dist/cjs/yoo-form-creator-card_2.cjs.entry.js +1 -1
  14. package/dist/cjs/yoo-form-creator-field-selector_8.cjs.entry.js +5 -4
  15. package/dist/cjs/yoo-form-creator-translate-dialog.cjs.entry.js +1 -1
  16. package/dist/cjs/yoo-form-creator.cjs.entry.js +18 -20
  17. package/dist/cjs/yoo-form-text-editor.cjs.entry.js +1 -1
  18. package/dist/cjs/yoo-gridstack.cjs.entry.js +17 -2
  19. package/dist/cjs/yoo-mission-detail.cjs.entry.js +8 -2
  20. package/dist/cjs/yoo-mission-results.cjs.entry.js +1 -1
  21. package/dist/cjs/yoo-podium.cjs.entry.js +1 -1
  22. package/dist/cjs/yoo-walkthrough.cjs.entry.js +1 -1
  23. package/dist/collection/components/app-operations/mission-detail/mission-detail.js +15 -0
  24. package/dist/collection/components/app-operations/mission-results/mission-results.js +1 -1
  25. package/dist/collection/components/form/form-text-editor/form-text-editor.js +1 -1
  26. package/dist/collection/components/form-creator/form-creator/form-creator.js +9 -11
  27. package/dist/collection/components/form-creator/form-creator-page-card-list/form-creator-page-card-list.js +1 -1
  28. package/dist/collection/components/form-creator/helpers/index.js +11 -3
  29. package/dist/collection/components/form-creator/workflow/workflow.js +4 -3
  30. package/dist/collection/components/grid/ag-grid/grid-renderers.js +7 -3
  31. package/dist/collection/components/grid/gridstack/gridstack.js +18 -3
  32. package/dist/collection/utils/helpers/image-helpers.js +2 -2
  33. package/dist/design-system/design-system.esm.js +1 -1
  34. package/dist/design-system/index.esm.js +1 -1
  35. package/dist/design-system/{p-83aa89ad.entry.js → p-0cd448c7.entry.js} +1 -1
  36. package/dist/design-system/{p-4ef0efa6.entry.js → p-0d6af448.entry.js} +1 -1
  37. package/dist/design-system/{p-c5e4eec8.entry.js → p-202031a2.entry.js} +1 -1
  38. package/dist/design-system/p-2752aa83.js +1 -0
  39. package/dist/design-system/{p-e70980f6.entry.js → p-2d017575.entry.js} +1 -1
  40. package/dist/design-system/{p-5c6ef130.js → p-349cb8cd.js} +1 -1
  41. package/dist/design-system/{p-02385015.entry.js → p-3d5d0597.entry.js} +1 -1
  42. package/dist/design-system/{p-7fcd0596.entry.js → p-405c25ba.entry.js} +1 -1
  43. package/dist/design-system/{p-59f99c7c.entry.js → p-43b3420c.entry.js} +1 -1
  44. package/dist/design-system/{p-eb421ff4.entry.js → p-44b19de9.entry.js} +1 -1
  45. package/dist/design-system/{p-af4cfea4.entry.js → p-4ae66a1f.entry.js} +1 -1
  46. package/dist/design-system/{p-d74f2bbf.entry.js → p-52465658.entry.js} +1 -1
  47. package/dist/design-system/p-55d4560c.entry.js +1 -0
  48. package/dist/design-system/p-6bc1375d.entry.js +1 -0
  49. package/dist/design-system/{p-1f8cfec7.entry.js → p-80aded97.entry.js} +1 -1
  50. package/dist/design-system/{p-332efa96.entry.js → p-9ed3a063.entry.js} +1 -1
  51. package/dist/design-system/p-a09b181a.entry.js +1 -0
  52. package/dist/design-system/p-be2ae101.entry.js +1 -0
  53. package/dist/design-system/{p-cb9c30a3.entry.js → p-c4f7294a.entry.js} +1 -1
  54. package/dist/design-system/{p-6470e707.entry.js → p-cf343c67.entry.js} +1 -1
  55. package/dist/design-system/p-f28ca7cf.js +1 -0
  56. package/dist/esm/{grid-renderers-f81f061f.js → grid-renderers-f71fdcd7.js} +7 -3
  57. package/dist/esm/{image-helpers-6b281c05.js → image-helpers-2f8f9d5d.js} +2 -2
  58. package/dist/esm/{index-70924cfc.js → index-350d88b9.js} +11 -3
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/yoo-action-sheet-controller_15.entry.js +1 -1
  61. package/dist/esm/yoo-ag-grid_96.entry.js +2 -2
  62. package/dist/esm/yoo-avatar_5.entry.js +1 -1
  63. package/dist/esm/yoo-card-header.entry.js +1 -1
  64. package/dist/esm/yoo-card-list-image_12.entry.js +2 -2
  65. package/dist/esm/yoo-form-choice_4.entry.js +1 -1
  66. package/dist/esm/yoo-form-creator-block-expandable.entry.js +1 -1
  67. package/dist/esm/yoo-form-creator-block-simple_4.entry.js +2 -2
  68. package/dist/esm/yoo-form-creator-card_2.entry.js +1 -1
  69. package/dist/esm/yoo-form-creator-field-selector_8.entry.js +5 -4
  70. package/dist/esm/yoo-form-creator-translate-dialog.entry.js +1 -1
  71. package/dist/esm/yoo-form-creator.entry.js +10 -12
  72. package/dist/esm/yoo-form-text-editor.entry.js +1 -1
  73. package/dist/esm/yoo-gridstack.entry.js +17 -2
  74. package/dist/esm/yoo-mission-detail.entry.js +8 -2
  75. package/dist/esm/yoo-mission-results.entry.js +1 -1
  76. package/dist/esm/yoo-podium.entry.js +1 -1
  77. package/dist/esm/yoo-walkthrough.entry.js +1 -1
  78. package/dist/types/components/app-operations/mission-detail/mission-detail.d.ts +1 -0
  79. package/dist/types/components/form-creator/helpers/index.d.ts +4 -1
  80. package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/form-field/form-field.interface.d.ts +1 -0
  81. package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/mission/mission.interface.d.ts +1 -1
  82. package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/workflow/workflow.interface.d.ts +1 -0
  83. package/package.json +1 -1
  84. package/dist/design-system/p-03dbb1fa.entry.js +0 -1
  85. package/dist/design-system/p-486e9464.js +0 -1
  86. package/dist/design-system/p-67582664.entry.js +0 -1
  87. package/dist/design-system/p-6871e6b7.entry.js +0 -1
  88. package/dist/design-system/p-6cfa75b3.js +0 -1
  89. package/dist/design-system/p-c047c9ba.entry.js +0 -1
@@ -594,13 +594,16 @@ function catalogRenderer(params) {
594
594
  return formCatalog;
595
595
  }
596
596
  function documentRenderer(params) {
597
+ var _a, _b, _c, _d;
597
598
  let documents = [];
598
- if (params.colDef.fieldDefinition.type === inputBar_interface.FormFieldType.document) {
599
- documents = rrule.compact([].concat(params.colDef.fieldDefinition.document));
599
+ const colDef = (_a = params.column) === null || _a === void 0 ? void 0 : _a.getColDef();
600
+ if (((_c = (_b = colDef) === null || _b === void 0 ? void 0 : _b.fieldDefinition) === null || _c === void 0 ? void 0 : _c.type) === inputBar_interface.FormFieldType.document) {
601
+ documents = rrule.compact([].concat(colDef.fieldDefinition.document));
600
602
  }
601
603
  else {
602
604
  documents = rrule.compact([].concat(params.value));
603
605
  }
606
+ documents = documents.filter((d) => !!d._downloadURL);
604
607
  const wrapper = document.createElement('div');
605
608
  wrapper.classList.add('col');
606
609
  if (documents.length > 0) {
@@ -612,8 +615,9 @@ function documentRenderer(params) {
612
615
  formDocument.showActionSheet = false;
613
616
  wrapper.appendChild(formDocument);
614
617
  });
618
+ return ((_d = params) === null || _d === void 0 ? void 0 : _d.type) === 'excel' ? documents.map((d) => d._downloadURL).join(',') : wrapper;
615
619
  }
616
- return wrapper;
620
+ return '';
617
621
  }
618
622
  function pricecheckRenderer(params) {
619
623
  const value = params.value;
@@ -6,11 +6,11 @@ const index = require('./index-e2b47ee9.js');
6
6
 
7
7
  async function getImageSize(src, onErr) {
8
8
  const img = new Image();
9
- if (src && (index.isImageUrl(src) || index.isBase64(src))) {
9
+ if (src) {
10
10
  img.src = rrule.isCloudinaryLink(src) ? new rrule.Cloudinary(src).quality('low').getUrl() : src;
11
11
  await new Promise((resolve, reject) => {
12
12
  img.onload = () => resolve(img.width);
13
- img.onerror = () => reject(onErr === null || onErr === void 0 ? void 0 : onErr());
13
+ img.onerror = () => index.isImageUrl(src) || index.isBase64(src) && reject(onErr === null || onErr === void 0 ? void 0 : onErr());
14
14
  });
15
15
  }
16
16
  return {
@@ -899,6 +899,8 @@ function setChildFields(parentConditions, itemIndex) {
899
899
  function addNewIdsToSlide(slide) {
900
900
  var _a, _b;
901
901
  const ids = [];
902
+ if (slide)
903
+ slide._id = index.getUUID();
902
904
  (_a = slide === null || slide === void 0 ? void 0 : slide.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
903
905
  const newId = index.getUUID();
904
906
  ids.push({ oldId: item.name, newId });
@@ -1148,10 +1150,16 @@ function cleanCustomFormFieldSlides(selectedFields, translations) {
1148
1150
  });
1149
1151
  return { cleanedFields: selectedFields, removedConditionIds };
1150
1152
  }
1151
- function createNewIdsForCustomFields(customFields) {
1152
- const cleanedFields = customFields.map((field) => {
1153
+ function createNewIdsForCustomFields(customFields, isCustomDataSet, fieldLocation) {
1154
+ const cleanedFields = customFields.map((field, fIndex) => {
1153
1155
  const cleanedField = cloneDeep.cloneDeep(field);
1154
- cleanedField.name = index.getUUID();
1156
+ if (isCustomDataSet) {
1157
+ cleanedField.name = formCreatorHelpers.getCustomName(cleanedField.title, fieldLocation.slideIndex, fieldLocation.itemIndex + fIndex);
1158
+ cleanedField.customName = index.getUUID();
1159
+ }
1160
+ else {
1161
+ cleanedField.name = index.getUUID();
1162
+ }
1155
1163
  return cleanedField;
1156
1164
  });
1157
1165
  cleanedFields.forEach((cleanedFeild) => {
@@ -22,7 +22,7 @@ const formHelpers = require('./form-helpers-ec3c2d29.js');
22
22
  const formInputHelpers = require('./form-input-helpers-9e98c0e6.js');
23
23
  const formTextAreaHelpers = require('./form-text-area-helpers-01944f5d.js');
24
24
  const geolocationHelpers = require('./geolocation-helpers-0f3560f5.js');
25
- const imageHelpers = require('./image-helpers-ea15b526.js');
25
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
26
26
  const incentiveHelpers = require('./incentive-helpers-99fce167.js');
27
27
  const mapHelpers = require('./map-helpers-021bd715.js');
28
28
  const observerHelpers = require('./observer-helpers-b02f15af.js');
@@ -28,7 +28,7 @@ const isString = require('./isString-ecd0cbf4.js');
28
28
  const _createAggregator = require('./_createAggregator-c627b114.js');
29
29
  const get = require('./get-91c14783.js');
30
30
  const formInputHelpers = require('./form-input-helpers-9e98c0e6.js');
31
- const gridRenderers = require('./grid-renderers-dacdc474.js');
31
+ const gridRenderers = require('./grid-renderers-374ca7e9.js');
32
32
  const localForage = require('./localForage-82b6f557.js');
33
33
  const dimensionsHelpers = require('./dimensions-helpers-54685523.js');
34
34
  require('./isUndefined-8f9cfd10.js');
@@ -7,7 +7,7 @@ const rrule = require('./rrule-f8e7fec2.js');
7
7
  const inputBar_interface = require('./input-bar.interface-b96b7107.js');
8
8
  const ResizeObserver_es = require('./ResizeObserver.es-2edf4ecd.js');
9
9
  const commonHelpers = require('./common-helpers-797be2a6.js');
10
- const gridRenderers = require('./grid-renderers-dacdc474.js');
10
+ const gridRenderers = require('./grid-renderers-374ca7e9.js');
11
11
  const identity$4 = require('./identity-8189b2e1.js');
12
12
  const isNumber$1 = require('./isNumber-4c1ace60.js');
13
13
  const formHelpers = require('./form-helpers-ec3c2d29.js');
@@ -67,7 +67,7 @@ const sortable_esm = require('./sortable.esm-71f9713d.js');
67
67
  const map$1 = require('./map-363505c4.js');
68
68
  const isBoolean = require('./isBoolean-d41e779d.js');
69
69
  const theme = require('./theme-e757b365.js');
70
- const imageHelpers = require('./image-helpers-ea15b526.js');
70
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
71
71
  const annotationsHelpers = require('./annotations-helpers-558ceb1e.js');
72
72
  const draggableDotsHelpers = require('./draggable-dots-helpers-9650a4b7.js');
73
73
  const inRange = require('./inRange-009d0389.js');
@@ -10,7 +10,7 @@ const index$1 = require('./index-e2b47ee9.js');
10
10
  const localForage = require('./localForage-82b6f557.js');
11
11
  require('./ResizeObserver.es-2edf4ecd.js');
12
12
  const commonHelpers = require('./common-helpers-797be2a6.js');
13
- const imageHelpers = require('./image-helpers-ea15b526.js');
13
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
14
14
  const observerHelpers = require('./observer-helpers-b02f15af.js');
15
15
  const colorHelpers = require('./color-helpers-9f67677e.js');
16
16
  require('./toInteger-31800ffe.js');
@@ -6,7 +6,7 @@ const index = require('./index-fd52e687.js');
6
6
  const rrule = require('./rrule-f8e7fec2.js');
7
7
  require('./input-bar.interface-b96b7107.js');
8
8
  require('./ResizeObserver.es-2edf4ecd.js');
9
- const imageHelpers = require('./image-helpers-ea15b526.js');
9
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
10
10
  require('./isUndefined-8f9cfd10.js');
11
11
  require('./isNumber-4c1ace60.js');
12
12
  require('./index-e2b47ee9.js');
@@ -15,8 +15,8 @@ const formInputHelpers = require('./form-input-helpers-9e98c0e6.js');
15
15
  const get = require('./get-91c14783.js');
16
16
  const annotationsHelpers = require('./annotations-helpers-558ceb1e.js');
17
17
  const dimensionsHelpers = require('./dimensions-helpers-54685523.js');
18
- const imageHelpers = require('./image-helpers-ea15b526.js');
19
- const gridRenderers = require('./grid-renderers-dacdc474.js');
18
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
19
+ const gridRenderers = require('./grid-renderers-374ca7e9.js');
20
20
  const debounce = require('./debounce-fda84c7b.js');
21
21
  const cloneDeep = require('./cloneDeep-e00dc6ae.js');
22
22
  const assign = require('./assign-bc4598ad.js');
@@ -14,7 +14,7 @@ const shuffle = require('./shuffle-8d86ba89.js');
14
14
  const findIndex = require('./findIndex-cb2c4f23.js');
15
15
  const isString = require('./isString-ecd0cbf4.js');
16
16
  const index$2 = require('./index-7d3c7ee7.js');
17
- const index$1 = require('./index-541062cd.js');
17
+ const index$1 = require('./index-621e23cc.js');
18
18
  const boostHelpers = require('./boost-helpers-0fe0ab90.js');
19
19
  const isNumber = require('./isNumber-4c1ace60.js');
20
20
  require('./isUndefined-8f9cfd10.js');
@@ -7,7 +7,7 @@ const inputBar_interface = require('./input-bar.interface-b96b7107.js');
7
7
  const rrule = require('./rrule-f8e7fec2.js');
8
8
  const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
9
9
  const index$2 = require('./index-77d54324.js');
10
- const index$1 = require('./index-541062cd.js');
10
+ const index$1 = require('./index-621e23cc.js');
11
11
  require('./isNumber-4c1ace60.js');
12
12
  require('./isEqual-35c41499.js');
13
13
  require('./_baseIsEqual-ea3c1968.js');
@@ -9,7 +9,7 @@ require('./ResizeObserver.es-2edf4ecd.js');
9
9
  const commonHelpers = require('./common-helpers-797be2a6.js');
10
10
  const index$1 = require('./index-f0c2575c.js');
11
11
  const sortable_esm = require('./sortable.esm-71f9713d.js');
12
- const index$2 = require('./index-541062cd.js');
12
+ const index$2 = require('./index-621e23cc.js');
13
13
  const entitiesHelpers$1 = require('./entities-helpers-e377d30b.js');
14
14
  const entitiesHelpers = require('./entities-helpers-c6ed72dc.js');
15
15
  require('./isUndefined-8f9cfd10.js');
@@ -252,7 +252,7 @@ const YooFormCreatorPageCardListComponent = class {
252
252
  if (this.workflowVisibility) {
253
253
  pageEntry.pageWorkflowState = this.workflowVisibility;
254
254
  if ((_a = this.pagePermissions) === null || _a === void 0 ? void 0 : _a.length) {
255
- const pagePermission = this.pagePermissions.find((permission) => permission.name === slide.title);
255
+ const pagePermission = this.pagePermissions.find((permission) => permission.name === slide._id || permission.name === slide.title);
256
256
  pageEntry.pageWorkflowState = index$2.getWorkflowFieldState(pagePermission, this.workflowVisibility);
257
257
  }
258
258
  }
@@ -6,7 +6,7 @@ const index = require('./index-fd52e687.js');
6
6
  const rrule = require('./rrule-f8e7fec2.js');
7
7
  require('./input-bar.interface-b96b7107.js');
8
8
  const index$2 = require('./index-f0c2575c.js');
9
- const index$1 = require('./index-541062cd.js');
9
+ const index$1 = require('./index-621e23cc.js');
10
10
  require('./index-e2b47ee9.js');
11
11
  require('./document-b4cc3315.js');
12
12
  require('./validate-f2c2f205.js');
@@ -13,7 +13,7 @@ const device_interface = require('./device.interface-44ea5b01.js');
13
13
  const cardVideo_interface = require('./card-video.interface-284b7b92.js');
14
14
  const sortable_esm = require('./sortable.esm-71f9713d.js');
15
15
  const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
16
- const index$2 = require('./index-541062cd.js');
16
+ const index$2 = require('./index-621e23cc.js');
17
17
  const isEqual = require('./isEqual-35c41499.js');
18
18
  const remove = require('./remove-41707d5a.js');
19
19
  const index$3 = require('./index-f0c2575c.js');
@@ -1242,7 +1242,7 @@ const YooWorkflowComponent = class {
1242
1242
  onPageStateChange(ev) {
1243
1243
  var _a, _b, _c, _d;
1244
1244
  if (this.internalMissionDescription.slides[ev.detail.index]) {
1245
- const pageName = this.internalMissionDescription.slides[ev.detail.index].title;
1245
+ const pageName = this.internalMissionDescription.slides[ev.detail.index]._id || this.internalMissionDescription.slides[ev.detail.index].title;
1246
1246
  const fieldPermission = { name: pageName };
1247
1247
  switch (ev.detail.newState.title) {
1248
1248
  case 'EDITABLE':
@@ -1347,8 +1347,9 @@ const YooWorkflowComponent = class {
1347
1347
  selected: this.isFieldsAccordionOpen
1348
1348
  }
1349
1349
  ], iconPairLeft: index$1.ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (ev) => (this.isFieldsAccordionOpen = ev.detail.selected) }, index.h("div", { slot: "CONTENTS" }, (_e = (_d = (_c = this.internalMissionDescription) === null || _c === void 0 ? void 0 : _c.slides[this.currentPageSelected]) === null || _d === void 0 ? void 0 : _d.items) === null || _e === void 0 ? void 0 : _e.map((item) => {
1350
- var _a, _b;
1351
- const pagePermission = (_b = (_a = this.currentWorkflowStep) === null || _a === void 0 ? void 0 : _a.pagesPermission) === null || _b === void 0 ? void 0 : _b.find((permission) => { var _a; return permission.name === ((_a = this.internalMissionDescription) === null || _a === void 0 ? void 0 : _a.slides[this.currentPageSelected].title); });
1350
+ var _a, _b, _c, _d;
1351
+ const slideName = ((_a = this.internalMissionDescription) === null || _a === void 0 ? void 0 : _a.slides[this.currentPageSelected]._id) || ((_b = this.internalMissionDescription) === null || _b === void 0 ? void 0 : _b.slides[this.currentPageSelected].title);
1352
+ const pagePermission = (_d = (_c = this.currentWorkflowStep) === null || _c === void 0 ? void 0 : _c.pagesPermission) === null || _d === void 0 ? void 0 : _d.find((permission) => permission.name === slideName);
1352
1353
  const pageState = index$2.getWorkflowFieldState(pagePermission, this.defaultFieldState);
1353
1354
  return this.renderSimpleBlock(item, pageState);
1354
1355
  }))));
@@ -7,7 +7,7 @@ const inputBar_interface = require('./input-bar.interface-b96b7107.js');
7
7
  const rrule = require('./rrule-f8e7fec2.js');
8
8
  const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
9
9
  const stringHelpers = require('./string-helpers-4852718a.js');
10
- const index$1 = require('./index-541062cd.js');
10
+ const index$1 = require('./index-621e23cc.js');
11
11
  const cloneDeep = require('./cloneDeep-e00dc6ae.js');
12
12
  const isEmpty = require('./isEmpty-1723db8b.js');
13
13
  const isString = require('./isString-ecd0cbf4.js');
@@ -6,13 +6,13 @@ const index = require('./index-fd52e687.js');
6
6
  const inputBar_interface = require('./input-bar.interface-b96b7107.js');
7
7
  const cardVideo_interface = require('./card-video.interface-284b7b92.js');
8
8
  const rrule = require('./rrule-f8e7fec2.js');
9
- const index$3 = require('./index-e2b47ee9.js');
9
+ const index$2 = require('./index-e2b47ee9.js');
10
10
  const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
11
11
  require('./ResizeObserver.es-2edf4ecd.js');
12
12
  const commonHelpers = require('./common-helpers-797be2a6.js');
13
13
  const sortable_esm = require('./sortable.esm-71f9713d.js');
14
- const index$2 = require('./index-77d54324.js');
15
- const index$1 = require('./index-541062cd.js');
14
+ const index$3 = require('./index-77d54324.js');
15
+ const index$1 = require('./index-621e23cc.js');
16
16
  const cloneDeep = require('./cloneDeep-e00dc6ae.js');
17
17
  const orderBy = require('./orderBy-18003c1b.js');
18
18
  require('./document-b4cc3315.js');
@@ -896,6 +896,7 @@ const YooFormCreatorComponent = class {
896
896
  this.selectedPageIndex = index;
897
897
  }
898
898
  async addNewPage(newPage, index) {
899
+ newPage = Object.assign({ _id: index$2.getUUID() }, newPage);
899
900
  this.currentSlides.splice(index, 0, newPage);
900
901
  this.selectedPageIndex = index;
901
902
  this.hasPageChanged = index;
@@ -1424,7 +1425,7 @@ const YooFormCreatorComponent = class {
1424
1425
  condition = index$1.getDefaultCondition(type, this.currentSlides[slideIndex].items[itemIndex]);
1425
1426
  }
1426
1427
  if (type === 'field') {
1427
- if (!index$2.NON_CONDITION_CATEGORIES.includes(this.currentSlides[slideIndex].items[itemIndex].category)) {
1428
+ if (!index$3.NON_CONDITION_CATEGORIES.includes(this.currentSlides[slideIndex].items[itemIndex].category)) {
1428
1429
  const { slides, unattachedParentConditions } = index$1.addNewParentCondition(this.currentSlides, this.unattachedParentConditions, slideIndex, itemIndex, condition);
1429
1430
  this.currentSlides = slides;
1430
1431
  this.unattachedParentConditions = unattachedParentConditions;
@@ -1707,26 +1708,23 @@ const YooFormCreatorComponent = class {
1707
1708
  }
1708
1709
  }
1709
1710
  onCustomFieldAdded(customFieldId, selectedCustomFormField, indexToAdd) {
1710
- var _a, _b, _c, _d;
1711
+ var _a, _b, _c, _d, _e, _f;
1711
1712
  if (!this.currentSlides[this.selectedPageIndex]) {
1712
1713
  return;
1713
1714
  }
1715
+ indexToAdd = rrule.isNullOrUndefined(indexToAdd) ? (_b = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length : indexToAdd;
1714
1716
  if (!selectedCustomFormField) {
1715
- selectedCustomFormField = (_a = this.customFormFields) === null || _a === void 0 ? void 0 : _a.find((customField) => customField._id === customFieldId);
1717
+ selectedCustomFormField = (_c = this.customFormFields) === null || _c === void 0 ? void 0 : _c.find((customField) => customField._id === customFieldId);
1716
1718
  }
1717
- const newFields = index$1.createNewIdsForCustomFields(selectedCustomFormField.fields);
1719
+ const newFields = index$1.createNewIdsForCustomFields(selectedCustomFormField.fields, ((_d = this.missionDescription) === null || _d === void 0 ? void 0 : _d.type) === 'dataset', { slideIndex: this.selectedPageIndex, itemIndex: indexToAdd });
1718
1720
  newFields === null || newFields === void 0 ? void 0 : newFields.forEach((field) => {
1719
- var _a;
1721
+ var _a, _b;
1720
1722
  field.slideIndex = this.selectedPageIndex;
1721
1723
  field.slideTitle = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.title;
1724
+ field.slideId = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b._id;
1722
1725
  });
1723
- if (((_c = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1724
- if (rrule.isNullOrUndefined(indexToAdd)) {
1725
- this.currentSlides[this.selectedPageIndex].items = [...(_d = this.currentSlides[this.selectedPageIndex]) === null || _d === void 0 ? void 0 : _d.items, ...newFields];
1726
- }
1727
- else {
1728
- this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
1729
- }
1726
+ if (((_f = (_e = this.currentSlides[this.selectedPageIndex]) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.length) > 0) {
1727
+ this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
1730
1728
  }
1731
1729
  else {
1732
1730
  this.currentSlides[this.selectedPageIndex].items = newFields;
@@ -1778,7 +1776,7 @@ const YooFormCreatorComponent = class {
1778
1776
  }
1779
1777
  if (((_e = this.missionDescription) === null || _e === void 0 ? void 0 : _e.type) === 'dataset') {
1780
1778
  newField.name = newField.title.split(' ').join('_').toLowerCase();
1781
- newField.customName = index$3.getUUID();
1779
+ newField.customName = index$2.getUUID();
1782
1780
  if (!formCreatorHelpers.isFieldNameUnique(newField, this.currentSlides)) {
1783
1781
  newField.name = formCreatorHelpers.getCustomName(newField.title, this.selectedPageIndex, indexToAdd);
1784
1782
  }
@@ -1905,7 +1903,7 @@ const YooFormCreatorComponent = class {
1905
1903
  { title: 'ADDCONDITION', selected: true, subTitle: 'FIELDTOOLTIP', blurContent: !rrule.isNullOrUndefined(this.newRestrictionCondition) },
1906
1904
  { title: 'ADDRESTRICTION', selected: true, subTitle: 'RESTRICTIONTOOLTIP' }
1907
1905
  ];
1908
- return (index.h("div", { class: "logic-container" }, index.h("yoo-ion-scroll", { forceOverscroll: false, onClick: (ev) => ev.stopPropagation() }, index.h("yoo-accordion", { maxTitleCharacters: 18, entries: entries, iconPairLeft: index$2.ARROW_PAIR, allowMultipleSelection: true }, inputBar_interface.CONDITION_TYPES.map((condition, conditionIndex) => (index.h("div", { slot: entries[conditionIndex].title }, index.h("div", { class: "condition-block-selection", ref: (el) => (this.newFieldContainerBlocks[conditionIndex] = el) }, condition === 'conditions' && this.renderNewConditionBlocks(condition), condition === 'restrictions' && this.renderRestrictionConditions(condition)))))))));
1906
+ return (index.h("div", { class: "logic-container" }, index.h("yoo-ion-scroll", { forceOverscroll: false, onClick: (ev) => ev.stopPropagation() }, index.h("yoo-accordion", { maxTitleCharacters: 18, entries: entries, iconPairLeft: index$3.ARROW_PAIR, allowMultipleSelection: true }, inputBar_interface.CONDITION_TYPES.map((condition, conditionIndex) => (index.h("div", { slot: entries[conditionIndex].title }, index.h("div", { class: "condition-block-selection", ref: (el) => (this.newFieldContainerBlocks[conditionIndex] = el) }, condition === 'conditions' && this.renderNewConditionBlocks(condition), condition === 'restrictions' && this.renderRestrictionConditions(condition)))))))));
1909
1907
  }
1910
1908
  renderNewConditionBlocks(condition) {
1911
1909
  return cardVideo_interface.conditionBlocksConfig.map((blockConfig) => {
@@ -1942,7 +1940,7 @@ const YooFormCreatorComponent = class {
1942
1940
  icon: 'info',
1943
1941
  category: inputBar_interface.FormFieldCategory.information
1944
1942
  };
1945
- return (index.h("yoo-accordion", { class: "sub-accordion", entries: entries, iconPairLeft: index$2.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, index.h("div", { slot: "TRANSLATE" }, index.h("yoo-form-creator-block-expandable", { mode: "new", formField: formField, options: this.options }))));
1943
+ return (index.h("yoo-accordion", { class: "sub-accordion", entries: entries, iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, index.h("div", { slot: "TRANSLATE" }, index.h("yoo-form-creator-block-expandable", { mode: "new", formField: formField, options: this.options }))));
1946
1944
  }
1947
1945
  renderTranslateContent() {
1948
1946
  var _a;
@@ -2127,7 +2125,7 @@ const YooFormCreatorComponent = class {
2127
2125
  selected: this.isPagesAccordionOpen,
2128
2126
  actionButtons
2129
2127
  }
2130
- ], iconPairLeft: index$2.ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (event) => this.onPagesAccordionSelected(event) }, index.h("div", { slot: "PAGES" }, index.h("yoo-form-creator-page-card-list", { ref: (el) => (this.pageCardList = el), scoringMode: index$1.isScoring(this.selectedLeftMenuOption) ? this.selectedScoring : null, missionSlides: this.currentSlides, selectedPageIndex: this.selectedPageIndex, onPageClicked: this.onPageClicked, onDuplicatePageClicked: this.onDuplicatePageClicked, onInsertPageAfterClicked: this.onInsertPageAfterClicked, onDeletePageClicked: this.onDeletePageClicked, onEditPageClicked: this.onEditPageClicked, onAddSiteTagRestrictionClicked: this.onAddSiteTagRestrictionClicked, onAddUserGroupRestrictionClicked: this.onAddUserGroupRestrictionClicked, itemList: this.itemList, isSortable: this.selectedLeftMenuOption === 'fields' }))));
2128
+ ], iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (event) => this.onPagesAccordionSelected(event) }, index.h("div", { slot: "PAGES" }, index.h("yoo-form-creator-page-card-list", { ref: (el) => (this.pageCardList = el), scoringMode: index$1.isScoring(this.selectedLeftMenuOption) ? this.selectedScoring : null, missionSlides: this.currentSlides, selectedPageIndex: this.selectedPageIndex, onPageClicked: this.onPageClicked, onDuplicatePageClicked: this.onDuplicatePageClicked, onInsertPageAfterClicked: this.onInsertPageAfterClicked, onDeletePageClicked: this.onDeletePageClicked, onEditPageClicked: this.onEditPageClicked, onAddSiteTagRestrictionClicked: this.onAddSiteTagRestrictionClicked, onAddUserGroupRestrictionClicked: this.onAddUserGroupRestrictionClicked, itemList: this.itemList, isSortable: this.selectedLeftMenuOption === 'fields' }))));
2131
2129
  const selectionModeEl = (index.h("yoo-toast", { class: "bg-light-to-dark global-actions form-creator", message: message, extraButtons: extraButtons, count: this.selectedFields.length || 0, showBackdrop: false }));
2132
2130
  return (index.h("div", { class: "form-content" }, this.showPagesSection && pageSectionEl, this.renderFormContentBlocksContainer(), ((_a = this.newUndefinedCondition) === null || _a === void 0 ? void 0 : _a.pageCondition) && index.h("div", { class: "page-condition-overlay", onClick: () => this.removeOverlays() }), this.selectionMode && selectionModeEl));
2133
2131
  }
@@ -2230,7 +2228,7 @@ const YooFormCreatorComponent = class {
2230
2228
  selected: true,
2231
2229
  actionButtons: index$1.isScoring(this.selectedLeftMenuOption) ? [] : [...actionButtons]
2232
2230
  }
2233
- ], iconPairLeft: index$2.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, this.currentSlides.map((slide, index$2) => (index.h("div", { slot: index$2 === this.selectedPageIndex ? 'CONTENT' : 'HIDDEN-CONTENT' }, index.h("yoo-ion-scroll", { ref: (el) => {
2231
+ ], iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, this.currentSlides.map((slide, index$2) => (index.h("div", { slot: index$2 === this.selectedPageIndex ? 'CONTENT' : 'HIDDEN-CONTENT' }, index.h("yoo-ion-scroll", { ref: (el) => {
2234
2232
  if (index$2 === this.selectedPageIndex) {
2235
2233
  this.mainContentScrollElement = el;
2236
2234
  }
@@ -7155,7 +7155,7 @@ const YooFormTextEditorComponent = class {
7155
7155
  const baseUploadURL = await rrule.getAsyncExtraData({ type: 'upload-api' });
7156
7156
  try {
7157
7157
  this.editor = new froala_editor_min(this.containerEl, {
7158
- key: 'AVB8B-21A3B1C1F3F1D1ua2BD1IMNBUMRWAd1AYMSTRBUZYA-9H3E2J2C5C6B3D2B5B1C1==',
7158
+ key: 'vYA6mB4F4H5B3H4A10dNSWXf1h1MDb1CF1PLPFf1C1EESFKVlA3C11A8D6D2C4E4G2C3H3==',
7159
7159
  theme: rrule.isDarkTheme() ? 'dark' : 'royal',
7160
7160
  toolbarSticky: false,
7161
7161
  requestHeaders: {
@@ -4801,9 +4801,11 @@ const YooGridstackComponent = class {
4801
4801
  }
4802
4802
  delete this.containerEl.gridstack;
4803
4803
  this.grid = gridstack.GridStack.init({
4804
+ auto: false,
4804
4805
  column: this.column || 12,
4805
4806
  animate: true,
4806
4807
  disableOneColumnMode: this.forceOneColumn !== true,
4808
+ oneColumnModeDomSort: false,
4807
4809
  cellHeight: this.cellHeight || 'auto',
4808
4810
  margin: this.itemMargin,
4809
4811
  acceptWidgets: '.ui-draggable',
@@ -4867,10 +4869,23 @@ const YooGridstackComponent = class {
4867
4869
  }
4868
4870
  }
4869
4871
  renderConfig() {
4870
- var _a;
4871
4872
  this.grid.removeAll(true);
4872
4873
  this.grid.batchUpdate();
4873
- (_a = this.config) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
4874
+ let finalConfig = this.config;
4875
+ if (this.column === 1 && (finalConfig === null || finalConfig === void 0 ? void 0 : finalConfig.length) > 0) {
4876
+ finalConfig = gridstack.Utils.sort(this.config, 1, this.column);
4877
+ finalConfig.forEach((v, i) => {
4878
+ if (i === 0) {
4879
+ v.y = 0;
4880
+ v.x = 0;
4881
+ }
4882
+ else {
4883
+ v.x = 0;
4884
+ v.y = finalConfig[i - 1].y + finalConfig[i - 1].h;
4885
+ }
4886
+ });
4887
+ }
4888
+ finalConfig === null || finalConfig === void 0 ? void 0 : finalConfig.forEach((item) => {
4874
4889
  const isHidden = !!this.hiddenWidgets.find((i) => i.id === item.id);
4875
4890
  const el = this.grid.addWidget(this.getItemTemplate(item, isHidden), cloneDeep.cloneDeep(item));
4876
4891
  if (isHidden) {
@@ -138,6 +138,12 @@ const YooMissionDetailComponent = class {
138
138
  return (user &&
139
139
  (user.email || user.firstName || user.lastName) && (index.h("li", { class: "menu-item", onClick: () => this.showUser.emit(user) }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { size: "medium", color: "app-color", iconOnlyColor: "light", icon: icon }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate(title)), index.h("div", { class: "menu-content menu-requestor" }, index.h("div", { class: "menu-inner-container" }, index.h("yoo-avatar", { size: "small", user: user }), index.h("span", { class: "text" }, user.firstName + ' ' + user.lastName), date && index.h("div", { class: "mission-date" }, pipe.pipes.dateFormat.transform(date, 'L'))), withExtraActions && ((_a = this.extraActions) === null || _a === void 0 ? void 0 : _a.length) > 0 && user && this.renderExtraActions(user))))));
140
140
  }
141
+ renderDuration() {
142
+ var _a;
143
+ if ((_a = this.mission) === null || _a === void 0 ? void 0 : _a.duration) {
144
+ return (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("span", { class: "menu-icon" }, index.h("yoo-tag", { size: "medium", icon: "ongoing", color: "app-color" })), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('MISSIONDURATION')), index.h("div", { class: "menu-content" }, this.mission.duration))));
145
+ }
146
+ }
141
147
  renderWorkflowHistory() {
142
148
  var _a, _b, _c, _d, _e, _f, _g;
143
149
  return (index.h("yoo-workflow-state", { steps: (_c = (_b = (_a = this.mission) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.workflow) === null || _c === void 0 ? void 0 : _c.steps, history: (_d = this.mission) === null || _d === void 0 ? void 0 : _d.workflowHistory, state: (_e = this.mission) === null || _e === void 0 ? void 0 : _e.workflowState, status: (_f = this.mission) === null || _f === void 0 ? void 0 : _f.status, owner: (_g = this.mission) === null || _g === void 0 ? void 0 : _g.owner }));
@@ -162,7 +168,7 @@ const YooMissionDetailComponent = class {
162
168
  web: !this.isMobile
163
169
  } }, index.h("yoo-ion-content", { class: "bg-light-to-dark no-scrollbar", scrollEvents: true }, index.h("div", null, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value ? this.progress.value : null }), index.h("ul", { class: "menu" }, this.mission.description &&
164
170
  this.mission.description.distanceMin &&
165
- this.renderSimpleSection(this.mission.description.distanceMin.toLocaleString(), 'GEOFENCINGDISTANCEMIN', 'pin-selected'), this.renderPriority(), description && description.text && this.renderSimpleSection(description.text, descriptionTitle, 'lesson'), this.mission.address && !isStoreManager && this.renderMissionLocation(), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), index.h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }), location && (location.contactname || location.contactphone || location.contactemail) && (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('CONTACT')), index.h("div", { class: "menu-content" }, location.contactname && index.h("div", { class: "menu-content-contact", innerHTML: location.contactname }), location.contactemail && index.h("div", { class: "menu-content-contact", innerHTML: location.contactemail }), location.contactphone && index.h("div", { class: "menu-content-contact", innerHTML: location.contactphone }))))), this.mission.comments && this.renderSimpleSection(this.mission.comments, 'NOTES', 'note'), location && location.info && this.renderSimpleSection(location.info, 'YOOBICINFO', 'info'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment'), this.renderUserSection(creator, 'REQUESTOR', 'author', this.mission._ect), this.mission.hasWorkflow && ((_d = (_c = (_b = this.mission) === null || _b === void 0 ? void 0 : _b.description) === null || _c === void 0 ? void 0 : _c.workflow) === null || _d === void 0 ? void 0 : _d.steps) && this.renderWorkflowHistory(), !((_e = this.mission) === null || _e === void 0 ? void 0 : _e.hasWorkflow) &&
171
+ this.renderSimpleSection(this.mission.description.distanceMin.toLocaleString(), 'GEOFENCINGDISTANCEMIN', 'pin-selected'), this.renderPriority(), description && description.text && this.renderSimpleSection(description.text, descriptionTitle, 'lesson'), this.mission.address && !isStoreManager && this.renderMissionLocation(), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), index.h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }), this.renderDuration(), location && (location.contactname || location.contactphone || location.contactemail) && (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('CONTACT')), index.h("div", { class: "menu-content" }, location.contactname && index.h("div", { class: "menu-content-contact", innerHTML: location.contactname }), location.contactemail && index.h("div", { class: "menu-content-contact", innerHTML: location.contactemail }), location.contactphone && index.h("div", { class: "menu-content-contact", innerHTML: location.contactphone }))))), this.mission.comments && this.renderSimpleSection(this.mission.comments, 'NOTES', 'note'), location && location.info && this.renderSimpleSection(location.info, 'YOOBICINFO', 'info'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment'), this.renderUserSection(creator, 'REQUESTOR', 'author', this.mission._ect), this.mission.hasWorkflow && ((_d = (_c = (_b = this.mission) === null || _b === void 0 ? void 0 : _b.description) === null || _c === void 0 ? void 0 : _c.workflow) === null || _d === void 0 ? void 0 : _d.steps) && this.renderWorkflowHistory(), !((_e = this.mission) === null || _e === void 0 ? void 0 : _e.hasWorkflow) &&
166
172
  owner &&
167
173
  owner._id &&
168
174
  owner._id !== rrule.getSession().userId &&
@@ -182,7 +188,7 @@ const YooMissionDetailComponent = class {
182
188
  renderTodo() {
183
189
  var _a;
184
190
  const isStoreManager = rrule.getSession().user && rrule.getSession().user.locationRef && rrule.getSession().user.locationRef === this.mission.locationRef;
185
- return (this.mission && (index.h("div", { class: 'mission-detail mission-todo ' + (this.isMobile ? '' : 'web') }, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value && this.progress.value }), index.h("ul", { class: "menu" }, this.mission.todo && this.mission.todo.field && this.mission.todo.fieldValue && this.renderMenuItem('LINKEDTO', true), this.mission.todo && this.mission.todo.priority && this.renderMenuItem('PRIORITY', false), this.renderUserSection(this.mission.creator, 'CREATEDBY', 'user', this.mission._ect, true), this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true), this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')), index.h("slot", null)))));
191
+ return (this.mission && (index.h("div", { class: 'mission-detail mission-todo ' + (this.isMobile ? '' : 'web') }, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value && this.progress.value }), index.h("ul", { class: "menu" }, this.mission.todo && this.mission.todo.field && this.mission.todo.fieldValue && this.renderMenuItem('LINKEDTO', true), this.mission.todo && this.mission.todo.priority && this.renderMenuItem('PRIORITY', false), this.renderUserSection(this.mission.creator, 'CREATEDBY', 'user', this.mission._ect, true), this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true), this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), this.renderDuration(), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')), index.h("slot", null)))));
186
192
  }
187
193
  renderBasedOnType() {
188
194
  if (this.mission && this.mission.type) {
@@ -126,7 +126,7 @@ const YooMissionResultsComponent = class {
126
126
  return this.mission ? (index.h("div", { class: Object.assign({ 'mission-results': true, pdf: this.isPdf }, commonHelpers.getAppContext(this.host)) }, this.isPdf && (index.h("div", { class: "header-photo-container" }, ((_h = (_g = this.mission) === null || _g === void 0 ? void 0 : _g.description) === null || _h === void 0 ? void 0 : _h.pdfHeaderPhoto) && index.h("yoo-img", { class: "header-photo", src: this.mission.description.pdfHeaderPhoto }), index.h("div", { class: "header-content" }, index.h("div", { class: "title" }, rrule.translateMulti((_j = this.mission) === null || _j === void 0 ? void 0 : _j.title)), index.h("div", { class: "subtitle" }, (_k = this.mission) === null || _k === void 0 ? void 0 : _k.address), index.h("div", { class: "tag-container" }, showInformation &&
127
127
  (tags === null || tags === void 0 ? void 0 : tags.map((tag) => {
128
128
  return index.h("yoo-tag", { color: tag.color, customColor: tag.customColor, innerHTML: tag.innerHTML });
129
- })))))), index.h("div", { class: "content" }, !this.isPdf && showInformation && index.h("yoo-mission-heading", { isPdf: this.isPdf, mission: this.mission }), index.h("ul", { class: { menu: true, pdf: this.isPdf } }, !this.isPdf && !isStoreManager && (this.mission.location || this.mission.address) ? this.renderMissionLocation() : null, ((_m = (_l = this.mission) === null || _l === void 0 ? void 0 : _l.aisle) === null || _m === void 0 ? void 0 : _m.title) ? this.renderMissionAisle() : null, showInformation && this.mission.ownerDisplayName ? this.renderMissionOwner() : null, !showInformation || this.mission.skipValidation ? null : this.renderMissionValidator(), showInformation && this.renderPriority(), this.mission.type === 'visit' && this.mission.visitType ? this.renderVisitType() : null, this.mission.type === 'visit' ? this.renderVisitDescription() : null, !rrule.getSession().isExternal && this.mission.workflowHistory && ((_q = (_p = (_o = this.mission) === null || _o === void 0 ? void 0 : _o.description) === null || _p === void 0 ? void 0 : _p.workflow) === null || _q === void 0 ? void 0 : _q.steps) && this.renderWorkflowHistory(), this.renderUnvalidatedReason(), showAudit && this.renderAudit()), showScore && index.h("yoo-mission-score", { isPdf: this.isPdf, charts: this.charts, networkScore: this.networkScore })))) : null;
129
+ })))))), index.h("div", { class: "content" }, !this.isPdf && showInformation && index.h("yoo-mission-heading", { isPdf: this.isPdf, mission: this.mission }), index.h("ul", { class: { menu: true, pdf: this.isPdf } }, !this.isPdf && !isStoreManager && (this.mission.location || this.mission.address) ? this.renderMissionLocation() : null, ((_m = (_l = this.mission) === null || _l === void 0 ? void 0 : _l.aisle) === null || _m === void 0 ? void 0 : _m.title) ? this.renderMissionAisle() : null, showInformation && this.mission.ownerDisplayName ? this.renderMissionOwner() : null, !showInformation || this.mission.skipValidation ? null : this.renderMissionValidator(), showInformation && this.renderPriority(), this.mission.type === 'visit' && this.mission.visitType ? this.renderVisitType() : null, this.mission.type === 'visit' ? this.renderVisitDescription() : null, !rrule.getSession().isExternal && this.mission.workflowHistory && ((_q = (_p = (_o = this.mission) === null || _o === void 0 ? void 0 : _o.description) === null || _p === void 0 ? void 0 : _p.workflow) === null || _q === void 0 ? void 0 : _q.steps) && this.renderWorkflowHistory(), showInformation && this.renderUnvalidatedReason(), showAudit && this.renderAudit()), showScore && index.h("yoo-mission-score", { isPdf: this.isPdf, charts: this.charts, networkScore: this.networkScore })))) : null;
130
130
  }
131
131
  get host() { return index.getElement(this); }
132
132
  };
@@ -7,7 +7,7 @@ const rrule = require('./rrule-f8e7fec2.js');
7
7
  require('./input-bar.interface-b96b7107.js');
8
8
  require('./ResizeObserver.es-2edf4ecd.js');
9
9
  const commonHelpers = require('./common-helpers-797be2a6.js');
10
- const imageHelpers = require('./image-helpers-ea15b526.js');
10
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
11
11
  const isNumber = require('./isNumber-4c1ace60.js');
12
12
  const get = require('./get-91c14783.js');
13
13
  require('./isUndefined-8f9cfd10.js');
@@ -6,7 +6,7 @@ const index = require('./index-fd52e687.js');
6
6
  const rrule = require('./rrule-f8e7fec2.js');
7
7
  require('./input-bar.interface-b96b7107.js');
8
8
  require('./ResizeObserver.es-2edf4ecd.js');
9
- const imageHelpers = require('./image-helpers-ea15b526.js');
9
+ const imageHelpers = require('./image-helpers-3385fd6f.js');
10
10
  require('./isUndefined-8f9cfd10.js');
11
11
  require('./isNumber-4c1ace60.js');
12
12
  require('./index-e2b47ee9.js');
@@ -142,6 +142,19 @@ export class YooMissionDetailComponent {
142
142
  date && h("div", { class: "mission-date" }, pipes.dateFormat.transform(date, 'L'))),
143
143
  withExtraActions && ((_a = this.extraActions) === null || _a === void 0 ? void 0 : _a.length) > 0 && user && this.renderExtraActions(user))))));
144
144
  }
145
+ renderDuration() {
146
+ var _a;
147
+ if ((_a = this.mission) === null || _a === void 0 ? void 0 : _a.duration) {
148
+ return (h("li", { class: "menu-item" },
149
+ h("div", { class: "menu-left" },
150
+ h("span", { class: "menu-icon" },
151
+ h("yoo-tag", { size: "medium", icon: "ongoing", color: "app-color" })),
152
+ h("div", { class: "border" })),
153
+ h("div", { class: "menu-right" },
154
+ h("div", { class: "menu-title" }, translate('MISSIONDURATION')),
155
+ h("div", { class: "menu-content" }, this.mission.duration))));
156
+ }
157
+ }
145
158
  renderWorkflowHistory() {
146
159
  var _a, _b, _c, _d, _e, _f, _g;
147
160
  return (h("yoo-workflow-state", { steps: (_c = (_b = (_a = this.mission) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.workflow) === null || _c === void 0 ? void 0 : _c.steps, history: (_d = this.mission) === null || _d === void 0 ? void 0 : _d.workflowHistory, state: (_e = this.mission) === null || _e === void 0 ? void 0 : _e.workflowState, status: (_f = this.mission) === null || _f === void 0 ? void 0 : _f.status, owner: (_g = this.mission) === null || _g === void 0 ? void 0 : _g.owner }));
@@ -178,6 +191,7 @@ export class YooMissionDetailComponent {
178
191
  this.mission.address && !isStoreManager && this.renderMissionLocation(),
179
192
  ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'),
180
193
  h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }),
194
+ this.renderDuration(),
181
195
  location && (location.contactname || location.contactphone || location.contactemail) && (h("li", { class: "menu-item" },
182
196
  h("div", { class: "menu-left" },
183
197
  h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }),
@@ -236,6 +250,7 @@ export class YooMissionDetailComponent {
236
250
  this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true),
237
251
  this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'),
238
252
  ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'),
253
+ this.renderDuration(),
239
254
  this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')),
240
255
  h("slot", null)))));
241
256
  }
@@ -214,7 +214,7 @@ export class YooMissionResultsComponent {
214
214
  this.mission.type === 'visit' && this.mission.visitType ? this.renderVisitType() : null,
215
215
  this.mission.type === 'visit' ? this.renderVisitDescription() : null,
216
216
  !getSession().isExternal && this.mission.workflowHistory && ((_q = (_p = (_o = this.mission) === null || _o === void 0 ? void 0 : _o.description) === null || _p === void 0 ? void 0 : _p.workflow) === null || _q === void 0 ? void 0 : _q.steps) && this.renderWorkflowHistory(),
217
- this.renderUnvalidatedReason(),
217
+ showInformation && this.renderUnvalidatedReason(),
218
218
  showAudit && this.renderAudit()),
219
219
  showScore && h("yoo-mission-score", { isPdf: this.isPdf, charts: this.charts, networkScore: this.networkScore })))) : null;
220
220
  }
@@ -133,7 +133,7 @@ export class YooFormTextEditorComponent {
133
133
  const baseUploadURL = await getAsyncExtraData({ type: 'upload-api' });
134
134
  try {
135
135
  this.editor = new FroalaEditor(this.containerEl, {
136
- key: 'AVB8B-21A3B1C1F3F1D1ua2BD1IMNBUMRWAd1AYMSTRBUZYA-9H3E2J2C5C6B3D2B5B1C1==',
136
+ key: 'vYA6mB4F4H5B3H4A10dNSWXf1h1MDb1CF1PLPFf1C1EESFKVlA3C11A8D6D2C4E4G2C3H3==',
137
137
  theme: isDarkTheme() ? 'dark' : 'royal',
138
138
  toolbarSticky: false,
139
139
  requestHeaders: {
@@ -782,6 +782,7 @@ export class YooFormCreatorComponent {
782
782
  this.selectedPageIndex = index;
783
783
  }
784
784
  async addNewPage(newPage, index) {
785
+ newPage = Object.assign({ _id: getUUID() }, newPage);
785
786
  this.currentSlides.splice(index, 0, newPage);
786
787
  this.selectedPageIndex = index;
787
788
  this.hasPageChanged = index;
@@ -1596,26 +1597,23 @@ export class YooFormCreatorComponent {
1596
1597
  }
1597
1598
  }
1598
1599
  onCustomFieldAdded(customFieldId, selectedCustomFormField, indexToAdd) {
1599
- var _a, _b, _c, _d;
1600
+ var _a, _b, _c, _d, _e, _f;
1600
1601
  if (!this.currentSlides[this.selectedPageIndex]) {
1601
1602
  return;
1602
1603
  }
1604
+ indexToAdd = isNullOrUndefined(indexToAdd) ? (_b = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length : indexToAdd;
1603
1605
  if (!selectedCustomFormField) {
1604
- selectedCustomFormField = (_a = this.customFormFields) === null || _a === void 0 ? void 0 : _a.find((customField) => customField._id === customFieldId);
1606
+ selectedCustomFormField = (_c = this.customFormFields) === null || _c === void 0 ? void 0 : _c.find((customField) => customField._id === customFieldId);
1605
1607
  }
1606
- const newFields = createNewIdsForCustomFields(selectedCustomFormField.fields);
1608
+ const newFields = createNewIdsForCustomFields(selectedCustomFormField.fields, ((_d = this.missionDescription) === null || _d === void 0 ? void 0 : _d.type) === 'dataset', { slideIndex: this.selectedPageIndex, itemIndex: indexToAdd });
1607
1609
  newFields === null || newFields === void 0 ? void 0 : newFields.forEach((field) => {
1608
- var _a;
1610
+ var _a, _b;
1609
1611
  field.slideIndex = this.selectedPageIndex;
1610
1612
  field.slideTitle = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.title;
1613
+ field.slideId = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b._id;
1611
1614
  });
1612
- if (((_c = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1613
- if (isNullOrUndefined(indexToAdd)) {
1614
- this.currentSlides[this.selectedPageIndex].items = [...(_d = this.currentSlides[this.selectedPageIndex]) === null || _d === void 0 ? void 0 : _d.items, ...newFields];
1615
- }
1616
- else {
1617
- this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
1618
- }
1615
+ if (((_f = (_e = this.currentSlides[this.selectedPageIndex]) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.length) > 0) {
1616
+ this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
1619
1617
  }
1620
1618
  else {
1621
1619
  this.currentSlides[this.selectedPageIndex].items = newFields;
@@ -153,7 +153,7 @@ export class YooFormCreatorPageCardListComponent {
153
153
  if (this.workflowVisibility) {
154
154
  pageEntry.pageWorkflowState = this.workflowVisibility;
155
155
  if ((_a = this.pagePermissions) === null || _a === void 0 ? void 0 : _a.length) {
156
- const pagePermission = this.pagePermissions.find((permission) => permission.name === slide.title);
156
+ const pagePermission = this.pagePermissions.find((permission) => permission.name === slide._id || permission.name === slide.title);
157
157
  pageEntry.pageWorkflowState = getWorkflowFieldState(pagePermission, this.workflowVisibility);
158
158
  }
159
159
  }