datastake-daf 0.6.841 → 0.6.842

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.
@@ -4827,7 +4827,7 @@ const config$2 = {
4827
4827
  AddDocument: config$3
4828
4828
  };
4829
4829
 
4830
- const _excluded$E = ["width", "height", "size", "name", "fill"];
4830
+ const _excluded$D = ["width", "height", "size", "name", "fill"];
4831
4831
  const CustomIcon = _ref => {
4832
4832
  let {
4833
4833
  width = 14,
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
4836
4836
  name = "",
4837
4837
  fill = "none"
4838
4838
  } = _ref,
4839
- props = _objectWithoutProperties(_ref, _excluded$E);
4839
+ props = _objectWithoutProperties(_ref, _excluded$D);
4840
4840
  const conf = config$2[name];
4841
4841
  if (conf) {
4842
4842
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
5125
5125
  !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
5126
5126
  });
5127
5127
 
5128
- const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5128
+ const _excluded$C = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5129
5129
  dayjs__default["default"].extend(customParseFormat);
5130
5130
  dayjs__default["default"].extend(utc);
5131
5131
  dayjs__default["default"].extend(utc);
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
5501
5501
  createdAt,
5502
5502
  updatedAt
5503
5503
  } = data,
5504
- rest = _objectWithoutProperties(data, _excluded$D);
5504
+ rest = _objectWithoutProperties(data, _excluded$C);
5505
5505
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5506
5506
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5507
5507
  meta: _meta
@@ -6033,7 +6033,7 @@ SelectFilters.propTypes = {
6033
6033
  apiUrl: PropTypes__default["default"].string
6034
6034
  };
6035
6035
 
6036
- const _excluded$C = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
6036
+ const _excluded$B = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
6037
6037
  function DAFTable(_ref) {
6038
6038
  let {
6039
6039
  columns = [],
@@ -6064,7 +6064,7 @@ function DAFTable(_ref) {
6064
6064
  app,
6065
6065
  doEmptyRows
6066
6066
  } = _ref,
6067
- rest = _objectWithoutProperties(_ref, _excluded$C);
6067
+ rest = _objectWithoutProperties(_ref, _excluded$B);
6068
6068
  const source = React.useMemo(() => {
6069
6069
  if (data && Array.isArray(data)) {
6070
6070
  return data;
@@ -6889,7 +6889,7 @@ function ComponentWithFocus(_ref) {
6889
6889
  }
6890
6890
 
6891
6891
  var _templateObject$h;
6892
- const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6892
+ const _excluded$A = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6893
6893
  function StickyTable(_ref) {
6894
6894
  let {
6895
6895
  size = "small",
@@ -6900,7 +6900,7 @@ function StickyTable(_ref) {
6900
6900
  pagination = false,
6901
6901
  doEmptyRows = true
6902
6902
  } = _ref,
6903
- props = _objectWithoutProperties(_ref, _excluded$B);
6903
+ props = _objectWithoutProperties(_ref, _excluded$A);
6904
6904
  const data = React__default["default"].useMemo(() => {
6905
6905
  if (!doEmptyRows) {
6906
6906
  return dataSource;
@@ -7428,7 +7428,7 @@ const BTN_SIZE = {
7428
7428
  LG: 'large'
7429
7429
  };
7430
7430
 
7431
- const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7431
+ const _excluded$z = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7432
7432
  function DafButton(_ref) {
7433
7433
  let {
7434
7434
  content = '',
@@ -7442,7 +7442,7 @@ function DafButton(_ref) {
7442
7442
  style = {},
7443
7443
  className = ''
7444
7444
  } = _ref,
7445
- restProps = _objectWithoutProperties(_ref, _excluded$A);
7445
+ restProps = _objectWithoutProperties(_ref, _excluded$z);
7446
7446
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7447
7447
  icon: icon,
7448
7448
  type: type,
@@ -7561,12 +7561,12 @@ const Style$R = styled__default["default"].div`
7561
7561
  }
7562
7562
  `;
7563
7563
 
7564
- const _excluded$z = ["children"];
7564
+ const _excluded$y = ["children"];
7565
7565
  const BorderedButton = _ref => {
7566
7566
  let {
7567
7567
  children
7568
7568
  } = _ref,
7569
- props = _objectWithoutProperties(_ref, _excluded$z);
7569
+ props = _objectWithoutProperties(_ref, _excluded$y);
7570
7570
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7571
7571
  className: "d-btn-cont",
7572
7572
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7706,12 +7706,12 @@ Badge.propTypes = {
7706
7706
  props: PropTypes__default["default"].object
7707
7707
  };
7708
7708
 
7709
- const _excluded$y = ["icon"];
7709
+ const _excluded$x = ["icon"];
7710
7710
  function GetIcon(_ref) {
7711
7711
  let {
7712
7712
  icon
7713
7713
  } = _ref,
7714
- props = _objectWithoutProperties(_ref, _excluded$y);
7714
+ props = _objectWithoutProperties(_ref, _excluded$x);
7715
7715
  let Icon = Icons__namespace.CloseOutlined;
7716
7716
  if (Icons__namespace[icon]) {
7717
7717
  Icon = Icons__namespace[icon];
@@ -8041,7 +8041,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8041
8041
  }
8042
8042
  `;
8043
8043
 
8044
- const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8044
+ const _excluded$w = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8045
8045
  const {
8046
8046
  useToken: useToken$p
8047
8047
  } = antd.theme;
@@ -8134,7 +8134,7 @@ function Multiselect(_ref) {
8134
8134
  isSingle = false,
8135
8135
  selectionType = SELECTION_TYPES.DEFAULT
8136
8136
  } = _ref,
8137
- restProps = _objectWithoutProperties(_ref, _excluded$x);
8137
+ restProps = _objectWithoutProperties(_ref, _excluded$w);
8138
8138
  const {
8139
8139
  token
8140
8140
  } = useToken$p();
@@ -8854,7 +8854,7 @@ DAFHeader.propTypes = {
8854
8854
  filtersConfig: PropTypes__default["default"].any
8855
8855
  };
8856
8856
 
8857
- const _excluded$w = ["tabs", "onChange", "value", "className"];
8857
+ const _excluded$v = ["tabs", "onChange", "value", "className"];
8858
8858
  function TabsHeader(_ref) {
8859
8859
  let {
8860
8860
  tabs = [],
@@ -8862,7 +8862,7 @@ function TabsHeader(_ref) {
8862
8862
  value = '',
8863
8863
  className = 'mt-2'
8864
8864
  } = _ref,
8865
- rest = _objectWithoutProperties(_ref, _excluded$w);
8865
+ rest = _objectWithoutProperties(_ref, _excluded$v);
8866
8866
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8867
8867
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8868
8868
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8959,7 +8959,7 @@ DrawerHeader.propTypes = {
8959
8959
  tabsConfig: PropTypes__default["default"].any
8960
8960
  };
8961
8961
 
8962
- const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8962
+ const _excluded$u = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8963
8963
  const useFooter = _ref => {
8964
8964
  let {
8965
8965
  leftContent,
@@ -8994,7 +8994,7 @@ const useFooter = _ref => {
8994
8994
  style = {},
8995
8995
  className = ""
8996
8996
  } = button,
8997
- restProps = _objectWithoutProperties(button, _excluded$v);
8997
+ restProps = _objectWithoutProperties(button, _excluded$u);
8998
8998
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8999
8999
  content: label,
9000
9000
  type: type,
@@ -11875,7 +11875,7 @@ Widget.propTypes = {
11875
11875
  };
11876
11876
  Widget.displayName = 'Widget';
11877
11877
 
11878
- const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11878
+ const _excluded$t = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11879
11879
  function ImageWidget(_ref) {
11880
11880
  let {
11881
11881
  loading = false,
@@ -11886,7 +11886,7 @@ function ImageWidget(_ref) {
11886
11886
  noDescriptionText,
11887
11887
  isPdf = false
11888
11888
  } = _ref,
11889
- props = _objectWithoutProperties(_ref, _excluded$u);
11889
+ props = _objectWithoutProperties(_ref, _excluded$t);
11890
11890
  const expandable = isPdf ? false : props.expandable;
11891
11891
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11892
11892
  loading: loading,
@@ -11946,7 +11946,7 @@ function ImageWidget(_ref) {
11946
11946
  ImageWidget.displayName = 'ImageWidget';
11947
11947
 
11948
11948
  var _templateObject$e;
11949
- const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11949
+ const _excluded$s = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11950
11950
  function FlowWidget(_ref) {
11951
11951
  let {
11952
11952
  title,
@@ -11958,7 +11958,7 @@ function FlowWidget(_ref) {
11958
11958
  className,
11959
11959
  direction = "horizontal"
11960
11960
  } = _ref,
11961
- rest = _objectWithoutProperties(_ref, _excluded$t);
11961
+ rest = _objectWithoutProperties(_ref, _excluded$s);
11962
11962
  const [activeTab, setActiveTab] = React.useState();
11963
11963
  React.useEffect(() => {
11964
11964
  if (defaultActiveTab) {
@@ -15689,7 +15689,7 @@ Map$3.propTypes = {
15689
15689
  link: PropTypes__default["default"].any
15690
15690
  };
15691
15691
 
15692
- const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15692
+ const _excluded$r = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15693
15693
  function InExpandableWidgetMap(_ref) {
15694
15694
  let {
15695
15695
  isExpanded,
@@ -15703,7 +15703,7 @@ function InExpandableWidgetMap(_ref) {
15703
15703
  height,
15704
15704
  widgetConfig
15705
15705
  } = _ref,
15706
- rest = _objectWithoutProperties(_ref, _excluded$s);
15706
+ rest = _objectWithoutProperties(_ref, _excluded$r);
15707
15707
  const [mapKey, setMapKey] = React.useState(0);
15708
15708
  const [isMapReady, setIsMapReady] = React.useState(false);
15709
15709
  React.useEffect(() => {
@@ -17903,14 +17903,14 @@ const MapConfig = ({
17903
17903
  });
17904
17904
  };
17905
17905
 
17906
- const _excluded$r = ["config", "title", "loading"];
17906
+ const _excluded$q = ["config", "title", "loading"];
17907
17907
  const Details = _ref => {
17908
17908
  let {
17909
17909
  config = [],
17910
17910
  title,
17911
17911
  loading = false
17912
17912
  } = _ref,
17913
- rest = _objectWithoutProperties(_ref, _excluded$r);
17913
+ rest = _objectWithoutProperties(_ref, _excluded$q);
17914
17914
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17915
17915
  className: "with-border-header h-w-btn-header card",
17916
17916
  loading: loading,
@@ -17926,14 +17926,14 @@ const Details = _ref => {
17926
17926
  }));
17927
17927
  };
17928
17928
 
17929
- const _excluded$q = ["config", "title", "loading"];
17929
+ const _excluded$p = ["config", "title", "loading"];
17930
17930
  const KeyIndicatorsDetails = _ref => {
17931
17931
  let {
17932
17932
  config,
17933
17933
  title,
17934
17934
  loading = false
17935
17935
  } = _ref,
17936
- rest = _objectWithoutProperties(_ref, _excluded$q);
17936
+ rest = _objectWithoutProperties(_ref, _excluded$p);
17937
17937
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17938
17938
  className: "with-border-header h-w-btn-header",
17939
17939
  title: title,
@@ -17963,7 +17963,7 @@ const Style$G = styled__default["default"].div`
17963
17963
  }
17964
17964
  `;
17965
17965
 
17966
- const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
17966
+ const _excluded$o = ["children", "config", "detailsTitle", "firstColumnWidth"];
17967
17967
  const DetailsSection = _ref => {
17968
17968
  let {
17969
17969
  children,
@@ -17971,7 +17971,7 @@ const DetailsSection = _ref => {
17971
17971
  detailsTitle,
17972
17972
  firstColumnWidth = "250px"
17973
17973
  } = _ref,
17974
- rest = _objectWithoutProperties(_ref, _excluded$p);
17974
+ rest = _objectWithoutProperties(_ref, _excluded$o);
17975
17975
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17976
17976
  firstColumnWidth: firstColumnWidth,
17977
17977
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18147,14 +18147,14 @@ const getGoalConfig = () => {
18147
18147
  };
18148
18148
 
18149
18149
  var _templateObject$c;
18150
- const _excluded$o = ["title", "activeSdgGoals", "t"];
18150
+ const _excluded$n = ["title", "activeSdgGoals", "t"];
18151
18151
  function SDGWidget(_ref) {
18152
18152
  let {
18153
18153
  title = "Sustainable Development Goals",
18154
18154
  activeSdgGoals = [],
18155
18155
  t = key => key
18156
18156
  } = _ref,
18157
- props = _objectWithoutProperties(_ref, _excluded$o);
18157
+ props = _objectWithoutProperties(_ref, _excluded$n);
18158
18158
  const sdgConfig = getGoalConfig();
18159
18159
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18160
18160
  title: title,
@@ -18452,7 +18452,7 @@ function SdgList({
18452
18452
  });
18453
18453
  }
18454
18454
 
18455
- const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18455
+ const _excluded$m = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18456
18456
  const {
18457
18457
  Meta
18458
18458
  } = antd.Card;
@@ -18472,7 +18472,7 @@ function ProjectWidget(_ref) {
18472
18472
  hideSDGList = false,
18473
18473
  t = x => x
18474
18474
  } = _ref,
18475
- props = _objectWithoutProperties(_ref, _excluded$n);
18475
+ props = _objectWithoutProperties(_ref, _excluded$m);
18476
18476
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18477
18477
  const {
18478
18478
  token
@@ -18744,13 +18744,13 @@ const WidgetCard = _ref => {
18744
18744
  });
18745
18745
  };
18746
18746
 
18747
- const _excluded$m = ["title", "children"];
18747
+ const _excluded$l = ["title", "children"];
18748
18748
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18749
18749
  let {
18750
18750
  title,
18751
18751
  children
18752
18752
  } = _ref,
18753
- rest = _objectWithoutProperties(_ref, _excluded$m);
18753
+ rest = _objectWithoutProperties(_ref, _excluded$l);
18754
18754
  /**
18755
18755
  * Handles carousel slide change events
18756
18756
  * @param {number} currentSlide - The index of the current slide after change
@@ -18914,7 +18914,7 @@ const EmptyStateContainer = styled__default["default"].div`
18914
18914
  }
18915
18915
  `;
18916
18916
 
18917
- const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18917
+ const _excluded$k = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18918
18918
  function ImageCarousel(_ref) {
18919
18919
  let {
18920
18920
  title,
@@ -18929,7 +18929,7 @@ function ImageCarousel(_ref) {
18929
18929
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18930
18930
  emptyText = "No Image"
18931
18931
  } = _ref,
18932
- rest = _objectWithoutProperties(_ref, _excluded$l);
18932
+ rest = _objectWithoutProperties(_ref, _excluded$k);
18933
18933
  const [previewVisible, setPreviewVisible] = React.useState(false);
18934
18934
  const [current, setCurrent] = React.useState(0);
18935
18935
  const carouselRef = React.useRef(null);
@@ -19298,7 +19298,7 @@ const getVegetationConfig = () => {
19298
19298
  };
19299
19299
 
19300
19300
  var _templateObject$a, _templateObject2$3;
19301
- const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19301
+ const _excluded$j = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19302
19302
  function VegetationWidget(_ref) {
19303
19303
  let {
19304
19304
  title = "Vegetation Health",
@@ -19310,7 +19310,7 @@ function VegetationWidget(_ref) {
19310
19310
  growthObservations = [],
19311
19311
  t = key => key
19312
19312
  } = _ref,
19313
- props = _objectWithoutProperties(_ref, _excluded$k);
19313
+ props = _objectWithoutProperties(_ref, _excluded$j);
19314
19314
  let vegetationConfig = getVegetationConfig();
19315
19315
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19316
19316
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19426,7 +19426,7 @@ const getFaunaConfig = () => {
19426
19426
  };
19427
19427
 
19428
19428
  var _templateObject$9, _templateObject2$2;
19429
- const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19429
+ const _excluded$i = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19430
19430
  function FaunaWidget(_ref) {
19431
19431
  let {
19432
19432
  title = "Observed Fauna",
@@ -19437,7 +19437,7 @@ function FaunaWidget(_ref) {
19437
19437
  itemHeight = 100,
19438
19438
  t = key => key
19439
19439
  } = _ref,
19440
- props = _objectWithoutProperties(_ref, _excluded$j);
19440
+ props = _objectWithoutProperties(_ref, _excluded$i);
19441
19441
  let faunaConfig = getFaunaConfig();
19442
19442
 
19443
19443
  // Filter to show only specific keys if filterKeys is provided
@@ -19502,7 +19502,7 @@ const getInvasiveSpeciesConfig = () => {
19502
19502
  };
19503
19503
 
19504
19504
  var _templateObject$8, _templateObject2$1;
19505
- const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19505
+ const _excluded$h = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19506
19506
  function InvasiveSpeciesWidget(_ref) {
19507
19507
  let {
19508
19508
  title = "Invasive Species",
@@ -19514,7 +19514,7 @@ function InvasiveSpeciesWidget(_ref) {
19514
19514
  itemHeight = 100,
19515
19515
  t = key => key
19516
19516
  } = _ref,
19517
- props = _objectWithoutProperties(_ref, _excluded$i);
19517
+ props = _objectWithoutProperties(_ref, _excluded$h);
19518
19518
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19519
19519
 
19520
19520
  // Filter to show only specific keys if filterKeys is provided
@@ -24937,8 +24937,8 @@ const RepeatableModals = ({
24937
24937
  }) : null;
24938
24938
  };
24939
24939
 
24940
- const _excluded$h = ["viewGroup"],
24941
- _excluded2$2 = ["label", "icon", "position"];
24940
+ const _excluded$g = ["viewGroup"],
24941
+ _excluded2$1 = ["label", "icon", "position"];
24942
24942
  const Content$1 = _ref => {
24943
24943
  let {
24944
24944
  style = {},
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
25009
25009
  if (groups[gKey].viewGroup === key) {
25010
25010
  // eslint-disable-next-line no-unused-vars
25011
25011
  const _groups$gKey = groups[gKey],
25012
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
25012
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$g);
25013
25013
  items[gKey] = gCfg;
25014
25014
  }
25015
25015
  return items;
@@ -25237,7 +25237,7 @@ const Content$1 = _ref => {
25237
25237
  showIcon: true
25238
25238
  });
25239
25239
  }
25240
- let groups = _objectWithoutProperties(f, _excluded2$2);
25240
+ let groups = _objectWithoutProperties(f, _excluded2$1);
25241
25241
  groups = Object.keys(groups).reduce((items, key) => {
25242
25242
  var _groups$key2;
25243
25243
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -25289,7 +25289,7 @@ const Content$1 = _ref => {
25289
25289
  });
25290
25290
  };
25291
25291
 
25292
- const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25292
+ const _excluded$f = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25293
25293
  function Modal(_ref) {
25294
25294
  let {
25295
25295
  t = text => text,
@@ -25305,7 +25305,7 @@ function Modal(_ref) {
25305
25305
  disabled = false,
25306
25306
  withModalFormWrapper = true
25307
25307
  } = _ref,
25308
- props = _objectWithoutProperties(_ref, _excluded$g);
25308
+ props = _objectWithoutProperties(_ref, _excluded$f);
25309
25309
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25310
25310
  width: 650,
25311
25311
  footer: null,
@@ -35952,13 +35952,11 @@ const beforeUpload = allowedExtensions => file => {
35952
35952
  };
35953
35953
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35954
35954
 
35955
- const _excluded$f = ["placeholder"],
35956
- _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35955
+ /* eslint-disable no-case-declarations */
35957
35956
  dayjs__default["default"].extend(utc);
35958
35957
  dayjs__default["default"].extend(timezone);
35959
35958
  dayjs__default["default"].tz.setDefault("UTC");
35960
- const getDefaultInputValue = function () {
35961
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35959
+ const getDefaultInputValue = (input = {}) => {
35962
35960
  let value = undefined;
35963
35961
  if (input.type === "multiselect") {
35964
35962
  value = [];
@@ -35976,30 +35974,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35976
35974
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35977
35975
  return isShown;
35978
35976
  };
35979
- const renderDataLinkGroup = _ref2 => {
35980
- var _input$meta, _formsValue$meta, _input$meta2;
35981
- let {
35982
- input,
35983
- groupFormId,
35984
- name,
35985
- formsValue,
35986
- form,
35987
- onValuesChange,
35988
- setValues,
35989
- changeLinking,
35990
- isHighlighted
35991
- } = _ref2;
35992
- const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35993
- var _input$inputs$k;
35994
- return (input === null || input === void 0 || (_input$inputs$k = input.inputs[k]) === null || _input$inputs$k === void 0 ? void 0 : _input$inputs$k.type) === "dataLink";
35995
- });
35996
- const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35997
- const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35998
- all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35977
+ const renderDataLinkGroup = ({
35978
+ input,
35979
+ groupFormId,
35980
+ name,
35981
+ formsValue,
35982
+ form,
35983
+ onValuesChange,
35984
+ setValues,
35985
+ changeLinking,
35986
+ isHighlighted
35987
+ }) => {
35988
+ const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35989
+ const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35990
+ const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35991
+ all[key] = input?.inputs[key];
35999
35992
  return all;
36000
35993
  }, {});
36001
- const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
36002
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : getArray(formsValue[name] || []).map(v => _objectSpread2({}, v));
35994
+ const isSingle = input?.meta?.maxRepeat === 1;
35995
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35996
+ ...(formsValue[groupFormId] || {})[name]
35997
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35998
+ ...v
35999
+ })) : isSingle ? formsValue[name] ? [{
36000
+ ...formsValue[name]
36001
+ }] : [] : getArray(formsValue[name] || []).map(v => ({
36002
+ ...v
36003
+ }));
36003
36004
  const onUpdate = (val, i) => {
36004
36005
  const _val = isSingle ? {
36005
36006
  [name]: val
@@ -36007,20 +36008,31 @@ const renderDataLinkGroup = _ref2 => {
36007
36008
  [name]: formData.map((d, j) => i === j ? val : d)
36008
36009
  };
36009
36010
  if (groupFormId) {
36010
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36011
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36012
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36011
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36012
+ const _newData = {
36013
+ ..._defaultData,
36014
+ ..._val
36015
+ };
36016
+ onValuesChange(_newData, {
36017
+ ...formsValue,
36013
36018
  [groupFormId]: _newData
36014
- }));
36015
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36016
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36019
+ });
36020
+ form?.setFieldValue(groupFormId, _newData);
36021
+ setValues({
36022
+ ...formsValue,
36017
36023
  [groupFormId]: _newData
36018
- }));
36024
+ });
36019
36025
  return;
36020
36026
  }
36021
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36022
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36023
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36027
+ onValuesChange(_val, {
36028
+ ...formsValue,
36029
+ ..._val
36030
+ });
36031
+ form?.setFieldValue(name, _val[name]);
36032
+ setValues({
36033
+ ...formsValue,
36034
+ ..._val
36035
+ });
36024
36036
  };
36025
36037
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
36026
36038
  form: input,
@@ -36031,79 +36043,102 @@ const renderDataLinkGroup = _ref2 => {
36031
36043
  isHighlighted: isHighlighted,
36032
36044
  dataLinkInput: dataLinkInput,
36033
36045
  formsValue: formsValue,
36034
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36046
+ values: groupFormId ? {
36047
+ ...(formsValue[groupFormId] || {}),
36035
36048
  meta: {
36036
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
36049
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36037
36050
  }
36038
- }) : formsValue,
36051
+ } : formsValue,
36039
36052
  name: name,
36040
36053
  groupFormId: groupFormId,
36041
- maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
36042
- remove: _ref3 => {
36043
- let {
36044
- key
36045
- } = _ref3;
36054
+ maxRepeat: input?.meta?.maxRepeat,
36055
+ remove: ({
36056
+ key
36057
+ }) => {
36046
36058
  const _val = isSingle ? {
36047
36059
  [name]: null
36048
36060
  } : {
36049
36061
  [name]: formData.filter((v, j) => j !== key)
36050
36062
  };
36051
36063
  if (groupFormId) {
36052
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36053
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36054
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36064
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36065
+ const _newData = {
36066
+ ..._defaultData,
36067
+ ..._val
36068
+ };
36069
+ onValuesChange(_newData, {
36070
+ ...formsValue,
36055
36071
  [groupFormId]: _newData
36056
- }));
36057
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36058
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36072
+ });
36073
+ form?.setFieldValue(groupFormId, _newData);
36074
+ setValues({
36075
+ ...formsValue,
36059
36076
  [groupFormId]: _newData
36060
- }));
36077
+ });
36061
36078
  return;
36062
36079
  }
36063
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36064
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36065
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36080
+ onValuesChange(_val, {
36081
+ ...formsValue,
36082
+ ..._val
36083
+ });
36084
+ form?.setFieldValue(name, _val[name]);
36085
+ setValues({
36086
+ ...formsValue,
36087
+ ..._val
36088
+ });
36066
36089
  },
36067
36090
  add: val => {
36068
36091
  const _val = isSingle ? {
36069
36092
  [name]: val
36070
36093
  } : {
36071
- [name]: [...formData, _objectSpread2({}, val)]
36094
+ [name]: [...formData, {
36095
+ ...val
36096
+ }]
36072
36097
  };
36073
36098
  if (groupFormId) {
36074
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36075
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36076
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36077
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36099
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36100
+ const _newData = {
36101
+ ..._defaultData,
36102
+ ..._val
36103
+ };
36104
+ form?.setFieldValue(groupFormId, _newData);
36105
+ onValuesChange(_newData, {
36106
+ ...formsValue,
36078
36107
  [groupFormId]: _newData
36079
- }));
36080
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36108
+ });
36109
+ setValues({
36110
+ ...formsValue,
36081
36111
  [groupFormId]: _newData
36082
- }));
36112
+ });
36083
36113
  return;
36084
36114
  }
36085
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36086
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36087
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36115
+ form?.setFieldValue(name, _val[name]);
36116
+ onValuesChange(_val, {
36117
+ ...formsValue,
36118
+ ..._val
36119
+ });
36120
+ setValues({
36121
+ ...formsValue,
36122
+ ..._val
36123
+ });
36088
36124
  },
36089
36125
  k: name,
36090
36126
  formData: formData
36091
36127
  });
36092
36128
  };
36093
36129
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
36094
- var _input$meta3, _data$meta;
36095
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
36130
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
36096
36131
  return false;
36097
36132
  }
36098
- if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
36099
- var _input$meta4;
36100
- return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
36133
+ if (typeof input?.meta?.excludeFromEdit === "boolean") {
36134
+ return !input?.meta?.excludeFromEdit;
36101
36135
  }
36102
- const formsValue = _objectSpread2({}, data);
36103
- Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
36104
- var _data$meta2;
36105
- const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
36106
- if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
36136
+ const formsValue = {
36137
+ ...data
36138
+ };
36139
+ Object.keys(data?.meta?.inputs || {}).forEach(key => {
36140
+ const input = data?.meta?.inputs[key];
36141
+ if (input?.notApplicable || input?.notAvailable) {
36107
36142
  formsValue[key] = undefined;
36108
36143
  delete formsValue[key];
36109
36144
  }
@@ -36162,35 +36197,35 @@ function getInputHeadLines$1(type, i, input, values) {
36162
36197
  switch (type) {
36163
36198
  case "h2":
36164
36199
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36165
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36200
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36166
36201
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36167
36202
  children: getInputLabel$1(input, values)
36168
36203
  })
36169
36204
  });
36170
36205
  case "h3":
36171
36206
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36172
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36207
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36173
36208
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36174
36209
  children: getInputLabel$1(input, values)
36175
36210
  })
36176
36211
  });
36177
36212
  case "h4":
36178
36213
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36179
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36214
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36180
36215
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36181
36216
  children: getInputLabel$1(input, values)
36182
36217
  })
36183
36218
  });
36184
36219
  case "h5":
36185
36220
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36186
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36221
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36187
36222
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36188
36223
  children: getInputLabel$1(input, values)
36189
36224
  })
36190
36225
  });
36191
36226
  case "h6":
36192
36227
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36193
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36228
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36194
36229
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36195
36230
  children: getInputLabel$1(input, values)
36196
36231
  })
@@ -36199,16 +36234,15 @@ function getInputHeadLines$1(type, i, input, values) {
36199
36234
  return null;
36200
36235
  }
36201
36236
  }
36202
- function getInputProp(prop) {
36203
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36204
- let scope = arguments.length > 2 ? arguments[2] : undefined;
36237
+ function getInputProp(prop, formsValue = {}, scope) {
36205
36238
  if (prop && typeof prop === "object") {
36206
36239
  const validations = Object.keys(prop);
36207
36240
  const key = validations.find(v => {
36208
36241
  let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
36209
- const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36242
+ const value = dot__default["default"].pick(path, {
36243
+ ...formsValue,
36210
36244
  scope
36211
- }));
36245
+ });
36212
36246
  return _checkValue(wantedValue, match, value);
36213
36247
  });
36214
36248
  const label = key ? prop[key] : prop[validations[0]];
@@ -36217,33 +36251,29 @@ function getInputProp(prop) {
36217
36251
  return prop;
36218
36252
  }
36219
36253
  }
36220
- function getInputLabel$1(input) {
36221
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36222
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
36254
+ function getInputLabel$1(input, formsValue = {}, asText = false) {
36223
36255
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
36224
36256
  input: input,
36225
36257
  formsValue: formsValue,
36226
36258
  asText: asText
36227
36259
  });
36228
36260
  }
36229
- const InputLabel = _ref4 => {
36230
- var _input$meta5, _input$meta6, _input$meta7;
36231
- let {
36232
- input,
36233
- formsValue,
36234
- asText
36235
- } = _ref4;
36261
+ const InputLabel = ({
36262
+ input,
36263
+ formsValue,
36264
+ asText
36265
+ }) => {
36236
36266
  const {
36237
36267
  t,
36238
36268
  evaluationConfig,
36239
36269
  scope
36240
36270
  } = useEditContext();
36241
36271
  const label = getInputProp(input.label, formsValue, scope);
36242
- return input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36272
+ return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36243
36273
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
36244
36274
  className: "flex",
36245
36275
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
36246
- content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36276
+ content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36247
36277
  t: t,
36248
36278
  evaluationConfig: evaluationConfig
36249
36279
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36251,7 +36281,7 @@ const InputLabel = _ref4 => {
36251
36281
  children: ReactHtmlParser__default["default"](input.description)
36252
36282
  }),
36253
36283
  placement: "top",
36254
- children: !(input !== null && input !== void 0 && (_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.isEvaluation) || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36284
+ children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36255
36285
  className: "flex flex-column justify-content-center ml-1",
36256
36286
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
36257
36287
  fontSize: 13
@@ -36273,9 +36303,7 @@ function getSectionLabel$1(labels, values) {
36273
36303
  }
36274
36304
  return labels;
36275
36305
  }
36276
- function getSubtitles$1(subtitles, position) {
36277
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36278
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36306
+ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
36279
36307
  let subtitle = subtitles && subtitles[position];
36280
36308
  if (subtitle && typeof subtitle === "object") {
36281
36309
  let newSubtitle = subtitle.default || "";
@@ -36319,12 +36347,14 @@ function getSubtitles$1(subtitles, position) {
36319
36347
  function getFormTitles$1(titles, key, position) {
36320
36348
  let tilte = titles && titles[key];
36321
36349
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
36322
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36350
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
36323
36351
  children: tilte
36324
36352
  }) : null;
36325
36353
  }
36326
36354
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
36327
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36355
+ formsValue = Object.assign(formsValue, {
36356
+ ...mainForm.getFieldsValue(true)
36357
+ });
36328
36358
  if (typeof repeatIndex === "number" && repeatValues) {
36329
36359
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
36330
36360
  repeatValues[inputName] = value;
@@ -36359,16 +36389,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
36359
36389
  };
36360
36390
  const inputOnBlur = [];
36361
36391
  const inputTypeComponent$1 = {
36362
- text: (_ref5, _ref6) => {
36363
- let {
36364
- props,
36365
- rules
36366
- } = _ref5;
36367
- let {
36368
- inputMeta = {},
36369
- t,
36370
- isHighlighted
36371
- } = _ref6;
36392
+ text: ({
36393
+ props,
36394
+ rules
36395
+ }, {
36396
+ inputMeta = {},
36397
+ t,
36398
+ isHighlighted
36399
+ }) => {
36372
36400
  const maxRule = rules.find(r => r.max);
36373
36401
  const maxProps = {
36374
36402
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36376,28 +36404,26 @@ const inputTypeComponent$1 = {
36376
36404
  if (maxRule) {
36377
36405
  maxProps.maxLength = maxRule.max;
36378
36406
  }
36379
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36380
- size: "large"
36381
- }, maxProps), {}, {
36407
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36408
+ size: "large",
36409
+ ...maxProps,
36382
36410
  allowClear: true,
36383
36411
  autoComplete: "new-password",
36384
- type: "text"
36385
- }, props), {}, {
36412
+ type: "text",
36413
+ ...props,
36386
36414
  className: formatClassname([isHighlighted && "highlighted-input"]),
36387
36415
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36388
36416
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36389
- }));
36417
+ });
36390
36418
  },
36391
- link: (_ref7, _ref8) => {
36392
- let {
36393
- props,
36394
- rules
36395
- } = _ref7;
36396
- let {
36397
- inputMeta = {},
36398
- t,
36399
- isHighlighted
36400
- } = _ref8;
36419
+ link: ({
36420
+ props,
36421
+ rules
36422
+ }, {
36423
+ inputMeta = {},
36424
+ t,
36425
+ isHighlighted
36426
+ }) => {
36401
36427
  const maxRule = rules.find(r => r.max);
36402
36428
  const maxProps = {
36403
36429
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36405,32 +36431,29 @@ const inputTypeComponent$1 = {
36405
36431
  if (maxRule) {
36406
36432
  maxProps.maxLength = maxRule.max;
36407
36433
  }
36408
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36409
- size: "large"
36410
- }, maxProps), {}, {
36434
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36435
+ size: "large",
36436
+ ...maxProps,
36411
36437
  allowClear: true,
36412
36438
  autoComplete: "new-password",
36413
- type: "text"
36414
- }, props), {}, {
36439
+ type: "text",
36440
+ ...props,
36415
36441
  className: formatClassname([isHighlighted && "highlighted-input"]),
36416
36442
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36417
36443
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36418
- }));
36444
+ });
36419
36445
  },
36420
- number: (_ref9, _ref10) => {
36421
- var _input$meta8;
36422
- let {
36423
- props,
36424
- rules,
36425
- input
36426
- } = _ref9;
36427
- let {
36428
- inputMeta = {},
36429
- t,
36430
- isHighlighted
36431
- } = _ref10;
36446
+ number: ({
36447
+ props,
36448
+ rules,
36449
+ input
36450
+ }, {
36451
+ inputMeta = {},
36452
+ t,
36453
+ isHighlighted
36454
+ }) => {
36432
36455
  const maxRule = rules.find(r => r.max);
36433
- const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36456
+ const integerRule = !input?.meta?.isDecimal;
36434
36457
  const parser = value => {
36435
36458
  if (!value) {
36436
36459
  return "";
@@ -36441,63 +36464,60 @@ const inputTypeComponent$1 = {
36441
36464
  return value.replace(/\$\s?|(,*)/g, "");
36442
36465
  };
36443
36466
  if (maxRule) {
36444
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36467
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36445
36468
  size: "large",
36446
36469
  allowClear: true,
36447
- autoComplete: "new-password"
36448
- }, props), {}, {
36470
+ autoComplete: "new-password",
36471
+ ...props,
36449
36472
  type: "number",
36450
36473
  parser: parser,
36451
36474
  min: 0,
36452
36475
  max: maxRule.max,
36453
36476
  className: formatClassname([isHighlighted && "highlighted-input"])
36454
- }));
36477
+ });
36455
36478
  }
36456
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36479
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36457
36480
  size: "large",
36458
36481
  allowClear: true,
36459
36482
  className: formatClassname([isHighlighted && "highlighted-input"]),
36460
- autoComplete: "new-password"
36461
- }, props), {}, {
36483
+ autoComplete: "new-password",
36484
+ ...props,
36462
36485
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36463
36486
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36464
36487
  min: 0,
36465
36488
  formatter: value => numberWithCommas$1(value),
36466
36489
  parser: parser
36467
- }));
36490
+ });
36468
36491
  },
36469
36492
  // eslint-disable-next-line no-unused-vars
36470
- select: (_ref11, _ref12) => {
36471
- var _input$meta9, _input$meta10;
36472
- let {
36473
- value,
36474
- options,
36475
- optionGroup,
36476
- props,
36477
- formsValue,
36478
- optionsFilter,
36479
- filterCond,
36480
- repeatValues,
36481
- repeatIndex,
36482
- name,
36483
- inputName,
36484
- address,
36485
- addressData,
36486
- input,
36487
- scope
36488
- } = _ref11;
36489
- let {
36490
- forms,
36491
- form,
36492
- setAddress,
36493
- inputMeta = {},
36494
- t,
36495
- isHighlighted,
36496
- changeInputMeta,
36497
- groupFormId
36498
- } = _ref12;
36493
+ select: ({
36494
+ value,
36495
+ options,
36496
+ optionGroup,
36497
+ props,
36498
+ formsValue,
36499
+ optionsFilter,
36500
+ filterCond,
36501
+ repeatValues,
36502
+ repeatIndex,
36503
+ name,
36504
+ inputName,
36505
+ address,
36506
+ addressData,
36507
+ input,
36508
+ scope
36509
+ }, {
36510
+ forms,
36511
+ form,
36512
+ setAddress,
36513
+ inputMeta = {},
36514
+ t,
36515
+ isHighlighted,
36516
+ changeInputMeta,
36517
+ groupFormId
36518
+ }) => {
36499
36519
  let opts;
36500
- const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36520
+ const isEvaluation = input?.meta?.isEvaluation;
36501
36521
  let defaultValue = value;
36502
36522
  if (typeof options === "string") {
36503
36523
  const [formName, key] = options.split(".");
@@ -36522,7 +36542,7 @@ const inputTypeComponent$1 = {
36522
36542
  opts = [];
36523
36543
  }
36524
36544
  } else {
36525
- opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36545
+ opts = options?.filter(o => !o.onlyView);
36526
36546
  }
36527
36547
  opts = JSON.parse(JSON.stringify(opts || []));
36528
36548
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36532,7 +36552,7 @@ const inputTypeComponent$1 = {
36532
36552
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36533
36553
 
36534
36554
  // Handle default value logic
36535
- if (!propHasValue$1(value) && propHasValue$1(input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.defaultValue)) {
36555
+ if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36536
36556
  // If no current value but there's a default value, use the default
36537
36557
  value = input.meta.defaultValue;
36538
36558
  defaultValue = value;
@@ -36565,7 +36585,7 @@ const inputTypeComponent$1 = {
36565
36585
  }
36566
36586
  opts = groupOptions;
36567
36587
  }
36568
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36588
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36569
36589
  size: "large",
36570
36590
  autoComplete: "new-password",
36571
36591
  allowClear: true,
@@ -36574,32 +36594,35 @@ const inputTypeComponent$1 = {
36574
36594
  value: value // Use value instead of defaultValue for controlled behavior
36575
36595
  ,
36576
36596
  filterOption: filterSelectOptions,
36577
- optionFilterProp: "children"
36578
- }, props), {}, {
36597
+ optionFilterProp: "children",
36598
+ ...props,
36579
36599
  className: formatClassname([isHighlighted && "highlighted-select"]),
36580
36600
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36581
36601
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36582
36602
  onChange: (val, selectedValue) => {
36583
36603
  // ONLY FOR SBG EVALUATON !!
36584
36604
  if (isEvaluation && val === "na" && groupFormId) {
36585
- var _formsValue$meta2;
36586
36605
  changeInputMeta({
36587
36606
  key: groupFormId,
36588
- value: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 || (_formsValue$meta2 = formsValue.meta) === null || _formsValue$meta2 === void 0 || (_formsValue$meta2 = _formsValue$meta2.inputs) === null || _formsValue$meta2 === void 0 ? void 0 : _formsValue$meta2[groupFormId]) || {}), {}, {
36607
+ value: {
36608
+ ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36589
36609
  documentation: {
36590
36610
  notApplicable: true
36591
36611
  }
36592
- }),
36612
+ },
36593
36613
  otherValues: {
36594
- [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36614
+ [groupFormId]: {
36615
+ ...(formsValue?.[groupFormId] || {}),
36595
36616
  [name]: val
36596
- })
36617
+ }
36597
36618
  }
36598
36619
  });
36599
36620
  }
36600
36621
  if (address && selectedValue) {
36601
36622
  dot__default["default"].str(address, selectedValue.children, addressData);
36602
- setAddress(_objectSpread2({}, addressData));
36623
+ setAddress({
36624
+ ...addressData
36625
+ });
36603
36626
  }
36604
36627
  if (props.onChange) {
36605
36628
  props.onChange(val);
@@ -36630,15 +36653,15 @@ const inputTypeComponent$1 = {
36630
36653
  if (og.disabled !== undefined) {
36631
36654
  groupOtherProps.disabled = og.disabled;
36632
36655
  }
36633
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36634
- value: og.value
36635
- }, groupOtherProps), {}, {
36656
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36657
+ value: og.value,
36658
+ ...groupOtherProps,
36636
36659
  children: og.label
36637
- }), "".concat(i).concat(j));
36660
+ }, `${i}${j}`);
36638
36661
  })
36639
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36640
- value: option.value
36641
- }, otherProps), {}, {
36662
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36663
+ value: option.value,
36664
+ ...otherProps,
36642
36665
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36643
36666
  className: "flex",
36644
36667
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36646,35 +36669,33 @@ const inputTypeComponent$1 = {
36646
36669
  children: sgbEvaluationIcons[option.value]
36647
36670
  }), option.label]
36648
36671
  }) : option.label
36649
- }), option.value);
36672
+ }, option.value);
36650
36673
  })
36651
- }));
36674
+ });
36652
36675
  },
36653
- multiselect: (_ref13, _ref14) => {
36654
- let {
36655
- value,
36656
- options,
36657
- optionGroup,
36658
- optionsFilter,
36659
- filterCond,
36660
- props,
36661
- formsValue,
36662
- repeatValues,
36663
- repeatIndex,
36664
- inputName,
36665
- name,
36666
- tags,
36667
- maxWidth,
36668
- staticWidth,
36669
- fullWidth
36670
- } = _ref13;
36671
- let {
36672
- forms,
36673
- form,
36674
- inputMeta = {},
36675
- t,
36676
- isHighlighted
36677
- } = _ref14;
36676
+ multiselect: ({
36677
+ value,
36678
+ options,
36679
+ optionGroup,
36680
+ optionsFilter,
36681
+ filterCond,
36682
+ props,
36683
+ formsValue,
36684
+ repeatValues,
36685
+ repeatIndex,
36686
+ inputName,
36687
+ name,
36688
+ tags,
36689
+ maxWidth,
36690
+ staticWidth,
36691
+ fullWidth
36692
+ }, {
36693
+ forms,
36694
+ form,
36695
+ inputMeta = {},
36696
+ t,
36697
+ isHighlighted
36698
+ }) => {
36678
36699
  let opts;
36679
36700
  if (typeof options === "string") {
36680
36701
  const [formName, key] = options.split(".");
@@ -36736,17 +36757,17 @@ const inputTypeComponent$1 = {
36736
36757
  staticWidth,
36737
36758
  fullWidth
36738
36759
  });
36739
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36760
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36740
36761
  size: "medium",
36741
36762
  allowClear: true,
36742
36763
  autoComplete: "new-password",
36743
36764
  mode: tags ? "tags" : "multiple",
36744
- optionFilterProp: "children"
36745
- }, tags ? {
36746
- tokenSeparators: [","]
36747
- } : {}), {}, {
36748
- filterOption: filterSelectOptions
36749
- }, props), {}, {
36765
+ optionFilterProp: "children",
36766
+ ...(tags ? {
36767
+ tokenSeparators: [","]
36768
+ } : {}),
36769
+ filterOption: filterSelectOptions,
36770
+ ...props,
36750
36771
  className: formatClassname([isHighlighted && "highlighted-select"]),
36751
36772
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36752
36773
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
@@ -36785,52 +36806,51 @@ const inputTypeComponent$1 = {
36785
36806
  if (og.disabled !== undefined) {
36786
36807
  groupOtherProps.disabled = og.disabled;
36787
36808
  }
36788
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36789
- value: og.value
36790
- }, groupOtherProps), {}, {
36809
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36810
+ value: og.value,
36811
+ ...groupOtherProps,
36791
36812
  children: og.label
36792
- }), "".concat(i).concat(j));
36813
+ }, `${i}${j}`);
36793
36814
  })
36794
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36795
- value: option.value
36796
- }, otherProps), {}, {
36815
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36816
+ value: option.value,
36817
+ ...otherProps,
36797
36818
  children: option.label
36798
- }), i);
36819
+ }, i);
36799
36820
  })
36800
- }));
36821
+ });
36801
36822
  },
36802
- date: (_ref15, _ref16) => {
36803
- var _formsValue$groupForm, _value2;
36804
- let {
36805
- props,
36806
- rules,
36807
- repeatValues,
36808
- formsValue,
36809
- name
36810
- } = _ref15;
36811
- let {
36812
- setFormValues,
36813
- inputMeta,
36814
- form,
36815
- t,
36816
- isHighlighted,
36817
- groupFormId
36818
- } = _ref16;
36823
+ date: ({
36824
+ props,
36825
+ rules,
36826
+ repeatValues,
36827
+ formsValue,
36828
+ name
36829
+ }, {
36830
+ setFormValues,
36831
+ inputMeta,
36832
+ form,
36833
+ t,
36834
+ isHighlighted,
36835
+ groupFormId
36836
+ }) => {
36819
36837
  const lng = localStorage.getItem("datastakeLng") || "en";
36820
36838
  const maxRule = rules.find(r => r.max);
36821
- let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36839
+ let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36822
36840
  const handleDateChange = date => {
36823
36841
  if (date) {
36824
36842
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36825
36843
  const localDate = dayjs__default["default"].utc(date);
36826
36844
  if (groupFormId) {
36827
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36845
+ const _new = {
36846
+ ...(formsValue[groupFormId] || {}),
36828
36847
  [name]: localDate
36829
- });
36848
+ };
36830
36849
  form.setFieldValue(groupFormId, _new);
36831
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36850
+ setFormValues({
36851
+ ...formsValue,
36832
36852
  [groupFormId]: _new
36833
- }));
36853
+ });
36834
36854
  } else {
36835
36855
  form.setFieldValue(name, localDate);
36836
36856
  }
@@ -36839,13 +36859,15 @@ const inputTypeComponent$1 = {
36839
36859
  if (groupFormId) {
36840
36860
  if (typeof value === "string" || typeof value === "undefined") {
36841
36861
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36842
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36862
+ const _new = {
36863
+ ...(formsValue[groupFormId] || {}),
36843
36864
  [name]: value
36844
- });
36865
+ };
36845
36866
  form.setFieldValue(groupFormId, _new);
36846
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36867
+ setFormValues({
36868
+ ...formsValue,
36847
36869
  [groupFormId]: _new
36848
- }));
36870
+ });
36849
36871
  }
36850
36872
  } else {
36851
36873
  if (typeof value === "string") {
@@ -36861,13 +36883,12 @@ const inputTypeComponent$1 = {
36861
36883
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36862
36884
  }
36863
36885
  if (checkForMax) {
36864
- var _value;
36865
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36886
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36866
36887
  size: "large",
36867
36888
  allowClear: true,
36868
- autoComplete: "new-password"
36869
- }, props), {}, {
36870
- value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36889
+ autoComplete: "new-password",
36890
+ ...props,
36891
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36871
36892
  onChange: handleDateChange,
36872
36893
  className: formatClassname([isHighlighted && "highlighted-input"]),
36873
36894
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36877,54 +36898,49 @@ const inputTypeComponent$1 = {
36877
36898
  disabledDate: current => {
36878
36899
  return current && current >= dayjs__default["default"]().endOf("day");
36879
36900
  }
36880
- }));
36901
+ });
36881
36902
  }
36882
36903
  }
36883
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36904
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36884
36905
  size: "large",
36885
36906
  allowClear: true,
36886
- autoComplete: "new-password"
36887
- }, props), {}, {
36888
- value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36907
+ autoComplete: "new-password",
36908
+ ...props,
36909
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36889
36910
  onChange: handleDateChange,
36890
36911
  className: formatClassname([isHighlighted && "highlighted-input"]),
36891
36912
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36892
36913
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36893
36914
  format: DATE_FORMATS,
36894
36915
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36895
- }));
36916
+ });
36896
36917
  },
36897
- groupExpandable: (_ref17, _ref18) => {
36898
- var _formsValue$groupForm2;
36899
- let {
36900
- formsValue,
36901
- name,
36902
- input
36903
- } = _ref17;
36904
- let {
36905
- groupFormId
36906
- } = _ref18;
36907
- const data = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm2 = formsValue[groupFormId]) === null || _formsValue$groupForm2 === void 0 ? void 0 : _formsValue$groupForm2[name] : formsValue === null || formsValue === void 0 ? void 0 : formsValue[name];
36918
+ groupExpandable: ({
36919
+ formsValue,
36920
+ name,
36921
+ input
36922
+ }, {
36923
+ groupFormId
36924
+ }) => {
36925
+ const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36908
36926
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36909
36927
  input: input,
36910
36928
  formsValue: formsValue,
36911
36929
  data: data
36912
36930
  });
36913
36931
  },
36914
- comment: (_ref19, _ref20) => {
36915
- let {
36916
- props: {
36917
- placeholder
36918
- },
36919
- commentHint
36920
- } = _ref19,
36921
- props = _objectWithoutProperties(_ref19.props, _excluded$f);
36922
- let {
36923
- onChange,
36924
- value,
36925
- isHighlighted
36926
- } = _ref20;
36927
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36932
+ comment: ({
36933
+ props: {
36934
+ placeholder,
36935
+ ...props
36936
+ },
36937
+ commentHint
36938
+ }, {
36939
+ onChange,
36940
+ value,
36941
+ isHighlighted
36942
+ }) => {
36943
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36928
36944
  allowClear: true,
36929
36945
  value: value,
36930
36946
  onChange: e => onChange(e.target.value),
@@ -36935,27 +36951,26 @@ const inputTypeComponent$1 = {
36935
36951
  autoSize: {
36936
36952
  minRows: 5,
36937
36953
  maxRows: 5
36938
- }
36939
- }, props), {}, {
36954
+ },
36955
+ ...props,
36940
36956
  disabled: false
36941
- }));
36957
+ });
36942
36958
  },
36943
- tableComment: (_ref21, _ref22) => {
36944
- var _formsValue$meta3;
36945
- let {
36946
- setValues,
36947
- name,
36948
- onValuesChange,
36949
- formsValue
36950
- } = _ref21;
36951
- let {
36952
- form,
36953
- groupFormId,
36954
- isHighlighted
36955
- } = _ref22;
36956
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36959
+ tableComment: ({
36960
+ setValues,
36961
+ name,
36962
+ onValuesChange,
36963
+ formsValue
36964
+ }, {
36965
+ form,
36966
+ groupFormId,
36967
+ isHighlighted
36968
+ }) => {
36969
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36970
+ ...v,
36957
36971
  key: i
36958
- })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36972
+ })) : (formsValue[name] || []).map((v, i) => ({
36973
+ ...v,
36959
36974
  key: i
36960
36975
  }));
36961
36976
  const onUpdate = (val, i) => {
@@ -36963,89 +36978,121 @@ const inputTypeComponent$1 = {
36963
36978
  [name]: formData.map((d, j) => i === j ? val : d)
36964
36979
  };
36965
36980
  if (groupFormId) {
36966
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36967
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36968
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36981
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36982
+ const _newData = {
36983
+ ..._defaultData,
36984
+ ..._val
36985
+ };
36986
+ onValuesChange(_newData, {
36987
+ ...formsValue,
36969
36988
  [groupFormId]: _newData
36970
- }));
36971
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36972
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36989
+ });
36990
+ form?.setFieldValue(groupFormId, _newData);
36991
+ setValues({
36992
+ ...formsValue,
36973
36993
  [groupFormId]: _newData
36974
- }));
36994
+ });
36975
36995
  return;
36976
36996
  }
36977
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36978
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36979
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36997
+ onValuesChange(_val, {
36998
+ ...formsValue,
36999
+ ..._val
37000
+ });
37001
+ form?.setFieldValue(name, _val[name]);
37002
+ setValues({
37003
+ ...formsValue,
37004
+ ..._val
37005
+ });
36980
37006
  };
36981
37007
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36982
37008
  onUpdate: onUpdate,
36983
37009
  isHighlighted: isHighlighted,
36984
37010
  form: form,
36985
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
37011
+ values: groupFormId ? {
37012
+ ...(formsValue[groupFormId] || {}),
36986
37013
  meta: {
36987
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
37014
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36988
37015
  }
36989
- }) : formsValue,
37016
+ } : formsValue,
36990
37017
  name: name,
36991
- remove: _ref23 => {
36992
- let {
36993
- key
36994
- } = _ref23;
37018
+ remove: ({
37019
+ key
37020
+ }) => {
36995
37021
  const _val = {
36996
37022
  [name]: formData.filter(v => v.key !== key)
36997
37023
  };
36998
37024
  if (groupFormId) {
36999
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37000
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37001
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37025
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37026
+ const _newData = {
37027
+ ..._defaultData,
37028
+ ..._val
37029
+ };
37030
+ onValuesChange(_newData, {
37031
+ ...formsValue,
37002
37032
  [groupFormId]: _newData
37003
- }));
37004
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37005
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37033
+ });
37034
+ form?.setFieldValue(groupFormId, _newData);
37035
+ setValues({
37036
+ ...formsValue,
37006
37037
  [groupFormId]: _newData
37007
- }));
37038
+ });
37008
37039
  return;
37009
37040
  }
37010
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37011
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37012
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37041
+ onValuesChange(_val, {
37042
+ ...formsValue,
37043
+ ..._val
37044
+ });
37045
+ form?.setFieldValue(name, _val[name]);
37046
+ setValues({
37047
+ ...formsValue,
37048
+ ..._val
37049
+ });
37013
37050
  },
37014
37051
  add: val => {
37015
37052
  const _val = {
37016
- [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
37053
+ [name]: [...formData, {
37054
+ ...val,
37017
37055
  key: formData.length
37018
- })]
37056
+ }]
37019
37057
  };
37020
37058
  if (groupFormId) {
37021
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37022
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37023
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37024
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37059
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37060
+ const _newData = {
37061
+ ..._defaultData,
37062
+ ..._val
37063
+ };
37064
+ form?.setFieldValue(groupFormId, _newData);
37065
+ onValuesChange(_newData, {
37066
+ ...formsValue,
37025
37067
  [groupFormId]: _newData
37026
- }));
37027
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37068
+ });
37069
+ setValues({
37070
+ ...formsValue,
37028
37071
  [groupFormId]: _newData
37029
- }));
37072
+ });
37030
37073
  return;
37031
37074
  }
37032
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37033
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37034
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37075
+ form?.setFieldValue(name, _val[name]);
37076
+ onValuesChange(_val, {
37077
+ ...formsValue,
37078
+ ..._val
37079
+ });
37080
+ setValues({
37081
+ ...formsValue,
37082
+ ..._val
37083
+ });
37035
37084
  },
37036
37085
  k: name
37037
37086
  });
37038
37087
  },
37039
- textarea: (_ref24, _ref25) => {
37040
- let {
37041
- props,
37042
- rules
37043
- } = _ref24;
37044
- let {
37045
- inputMeta,
37046
- t,
37047
- isHighlighted
37048
- } = _ref25;
37088
+ textarea: ({
37089
+ props,
37090
+ rules
37091
+ }, {
37092
+ inputMeta,
37093
+ t,
37094
+ isHighlighted
37095
+ }) => {
37049
37096
  const maxRule = rules.find(r => r.max);
37050
37097
  let maxLength = MAX_TEXT_AREA_LENGTH;
37051
37098
  let rows = 5;
@@ -37072,7 +37119,7 @@ const inputTypeComponent$1 = {
37072
37119
  // rows = 14;
37073
37120
  // }
37074
37121
  }
37075
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
37122
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
37076
37123
  allowClear: true,
37077
37124
  autoComplete: "new-password",
37078
37125
  maxLength: maxLength,
@@ -37080,37 +37127,35 @@ const inputTypeComponent$1 = {
37080
37127
  autoSize: {
37081
37128
  minRows: rows,
37082
37129
  maxRows: rows
37083
- }
37084
- }, props), {}, {
37130
+ },
37131
+ ...props,
37085
37132
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37086
37133
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
37087
- }));
37134
+ });
37088
37135
  },
37089
- phoneNumber: (_ref26, _ref27) => {
37090
- let {
37091
- name,
37092
- inputName,
37093
- props,
37094
- value,
37095
- repeatIndex,
37096
- repeatValues,
37097
- formsValue
37098
- } = _ref26;
37099
- let {
37100
- setFormValues,
37101
- inputMeta,
37102
- t,
37103
- isHighlighted
37104
- } = _ref27;
37105
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
37136
+ phoneNumber: ({
37137
+ name,
37138
+ inputName,
37139
+ props,
37140
+ value,
37141
+ repeatIndex,
37142
+ repeatValues,
37143
+ formsValue
37144
+ }, {
37145
+ setFormValues,
37146
+ inputMeta,
37147
+ t,
37148
+ isHighlighted
37149
+ }) => {
37150
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
37106
37151
  customSelectWidthPercentage: "20%",
37107
37152
  t: t,
37108
37153
  size: "large",
37109
37154
  allowClear: true,
37110
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
37155
+ country: formsValue?.country,
37111
37156
  initialValue: value,
37112
- name: name
37113
- }, props), {}, {
37157
+ name: name,
37158
+ ...props,
37114
37159
  className: formatClassname([isHighlighted && "highlighted-input"]),
37115
37160
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37116
37161
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -37131,27 +37176,26 @@ const inputTypeComponent$1 = {
37131
37176
  }
37132
37177
  return val;
37133
37178
  }
37134
- }));
37179
+ });
37135
37180
  },
37136
- switch: (_ref28, _ref29) => {
37137
- let {
37138
- props,
37139
- value,
37140
- restricted,
37141
- autocomplete,
37142
- formsValue,
37143
- repeatValues,
37144
- repeatIndex,
37145
- name,
37146
- inputName,
37147
- replace: replaceInput,
37148
- unique
37149
- } = _ref28;
37150
- let {
37151
- form,
37152
- isHighlighted
37153
- } = _ref29;
37154
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
37181
+ switch: ({
37182
+ props,
37183
+ value,
37184
+ restricted,
37185
+ autocomplete,
37186
+ formsValue,
37187
+ repeatValues,
37188
+ repeatIndex,
37189
+ name,
37190
+ inputName,
37191
+ replace: replaceInput,
37192
+ unique
37193
+ }, {
37194
+ form,
37195
+ isHighlighted
37196
+ }) => {
37197
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
37198
+ ...props,
37155
37199
  size: "default",
37156
37200
  defaultChecked: value || false,
37157
37201
  checked: value || false,
@@ -37179,7 +37223,9 @@ const inputTypeComponent$1 = {
37179
37223
  const [formName, replaceInputName] = replaceTo.split(".");
37180
37224
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
37181
37225
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
37182
- formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
37226
+ formsValue = Object.assign(formsValue, {
37227
+ ...form.getFieldsValue(true)
37228
+ });
37183
37229
  if (oldId) {
37184
37230
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
37185
37231
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -37220,22 +37266,20 @@ const inputTypeComponent$1 = {
37220
37266
  }
37221
37267
  }
37222
37268
  }
37223
- }));
37269
+ });
37224
37270
  },
37225
- radioGroup: (_ref30, _ref31) => {
37226
- let {
37227
- props,
37228
- value,
37229
- options,
37230
- isRisk
37231
- } = _ref30;
37232
- let {
37233
- isHighlighted
37234
- } = _ref31;
37271
+ radioGroup: ({
37272
+ props,
37273
+ value,
37274
+ options,
37275
+ isRisk
37276
+ }, {
37277
+ isHighlighted
37278
+ }) => {
37235
37279
  if (isRisk) {
37236
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37237
- value: value
37238
- }, props), {}, {
37280
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37281
+ value: value,
37282
+ ...props,
37239
37283
  className: "is-risk-radio",
37240
37284
  children: (options || []).map(o => {
37241
37285
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37249,11 +37293,11 @@ const inputTypeComponent$1 = {
37249
37293
  }) : null]
37250
37294
  }, o.value);
37251
37295
  })
37252
- }));
37296
+ });
37253
37297
  }
37254
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37255
- value: value
37256
- }, props), {}, {
37298
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37299
+ value: value,
37300
+ ...props,
37257
37301
  className: formatClassname([isHighlighted && "highlighted-input"]),
37258
37302
  children: (options || []).map(o => {
37259
37303
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37267,20 +37311,18 @@ const inputTypeComponent$1 = {
37267
37311
  }) : null]
37268
37312
  }, o.value);
37269
37313
  })
37270
- }));
37314
+ });
37271
37315
  },
37272
- checkboxGroup: (_ref32, _ref33) => {
37273
- let {
37274
- props,
37275
- value,
37276
- options
37277
- } = _ref32;
37278
- let {
37279
- isHighlighted
37280
- } = _ref33;
37281
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
37282
- value: value
37283
- }, props), {}, {
37316
+ checkboxGroup: ({
37317
+ props,
37318
+ value,
37319
+ options
37320
+ }, {
37321
+ isHighlighted
37322
+ }) => {
37323
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37324
+ value: value,
37325
+ ...props,
37284
37326
  className: formatClassname([isHighlighted && "highlighted-input"]),
37285
37327
  style: {
37286
37328
  display: "grid",
@@ -37304,18 +37346,16 @@ const inputTypeComponent$1 = {
37304
37346
  }) : null]
37305
37347
  }, o.value);
37306
37348
  })
37307
- }));
37349
+ });
37308
37350
  },
37309
- total100: (_ref34, _ref35) => {
37310
- let {
37311
- props,
37312
- name,
37313
- options,
37314
- value
37315
- } = _ref34;
37316
- let {
37317
- isHighlighted
37318
- } = _ref35;
37351
+ total100: ({
37352
+ props,
37353
+ name,
37354
+ options,
37355
+ value
37356
+ }, {
37357
+ isHighlighted
37358
+ }) => {
37319
37359
  value = value ? Array.isArray(value) ? value : [value] : [];
37320
37360
  function totalValue() {
37321
37361
  let total = 0;
@@ -37339,11 +37379,10 @@ const inputTypeComponent$1 = {
37339
37379
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
37340
37380
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
37341
37381
  name: name,
37342
- children: (fields, _ref36) => {
37343
- let {
37344
- add,
37345
- remove
37346
- } = _ref36;
37382
+ children: (fields, {
37383
+ add,
37384
+ remove
37385
+ }) => {
37347
37386
  if (fields.length === 0) {
37348
37387
  const formData = value || [];
37349
37388
  if (formData.length) {
@@ -37362,27 +37401,27 @@ const inputTypeComponent$1 = {
37362
37401
  const v = value[field.name] || {};
37363
37402
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
37364
37403
  className: "total",
37365
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37366
- noStyle: true
37367
- }, field), {}, {
37404
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37405
+ noStyle: true,
37406
+ ...field,
37368
37407
  name: [field.name, "type"],
37369
37408
  fieldKey: [field.fieldKey, "type"],
37370
37409
  initialValue: v.type || null,
37371
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37410
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
37372
37411
  size: "large",
37373
37412
  allowClear: true,
37374
37413
  showSearch: true,
37375
37414
  filterOption: filterSelectOptions,
37376
- optionFilterProp: "children"
37377
- }, props), {}, {
37415
+ optionFilterProp: "children",
37416
+ ...props,
37378
37417
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
37379
37418
  value: option.value,
37380
37419
  children: option.label
37381
37420
  }, i))
37382
- }))
37383
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37384
- noStyle: true
37385
- }, field), {}, {
37421
+ })
37422
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37423
+ noStyle: true,
37424
+ ...field,
37386
37425
  name: [field.name, "value"],
37387
37426
  fieldKey: [field.fieldKey, "value"],
37388
37427
  initialValue: v.value,
@@ -37391,14 +37430,14 @@ const inputTypeComponent$1 = {
37391
37430
  allowClear: true,
37392
37431
  name: "value",
37393
37432
  formatter: value => {
37394
- return value ? "".concat(value, "%") : "";
37433
+ return value ? `${value}%` : "";
37395
37434
  },
37396
37435
  disabled: !v.type || null,
37397
37436
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
37398
37437
  min: 1,
37399
37438
  max: 100 - siblingTotal(v.type || 0)
37400
37439
  })
37401
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37440
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37402
37441
  disabled: !v.value || !v.type || totalValue() >= 100,
37403
37442
  type: "primary",
37404
37443
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -37430,22 +37469,19 @@ const inputTypeComponent$1 = {
37430
37469
  }) : null]
37431
37470
  });
37432
37471
  },
37433
- percentage: (_ref37, _ref38) => {
37434
- var _input$meta11;
37435
- let {
37436
- name,
37437
- inputName,
37438
- totalMax,
37439
- repeatIndex,
37440
- props,
37441
- formsValue,
37442
- input
37443
- } = _ref37;
37444
- let {
37445
- inputMeta,
37446
- t,
37447
- isHighlighted
37448
- } = _ref38;
37472
+ percentage: ({
37473
+ name,
37474
+ inputName,
37475
+ totalMax,
37476
+ repeatIndex,
37477
+ props,
37478
+ formsValue,
37479
+ input
37480
+ }, {
37481
+ inputMeta,
37482
+ t,
37483
+ isHighlighted
37484
+ }) => {
37449
37485
  const isRepeatable = Array.isArray(formsValue[name]);
37450
37486
  let totalSiblings = 0;
37451
37487
  if (isRepeatable && totalMax) {
@@ -37453,47 +37489,45 @@ const inputTypeComponent$1 = {
37453
37489
  totl = totl + (grp[inputName] || 0);
37454
37490
  return totl;
37455
37491
  }, 0);
37456
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37492
+ } else if (Array.isArray(input?.meta?.siblings)) {
37457
37493
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
37458
37494
  totl = totl + (formsValue[key] || 0);
37459
37495
  return totl;
37460
37496
  }, 0);
37461
37497
  }
37462
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37498
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37463
37499
  size: "large",
37464
- allowClear: true
37465
- }, props), {}, {
37500
+ allowClear: true,
37501
+ ...props,
37466
37502
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37467
37503
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37468
37504
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37469
37505
  min: 0,
37470
37506
  max: 100 - totalSiblings,
37471
37507
  formatter: value => {
37472
- return value ? "".concat(value) : "";
37508
+ return value ? `${value}` : "";
37473
37509
  },
37474
37510
  parser: value => value.replace("%", ""),
37475
37511
  addonAfter: "%"
37476
- }));
37512
+ });
37477
37513
  },
37478
- drawTerritory: (_ref39, _ref40) => {
37479
- let {
37480
- formsValue,
37481
- name,
37482
- addressData
37483
- } = _ref39;
37484
- let {
37485
- setFormValues
37486
- } = _ref40;
37514
+ drawTerritory: ({
37515
+ formsValue,
37516
+ name,
37517
+ addressData
37518
+ }, {
37519
+ setFormValues
37520
+ }) => {
37487
37521
  let search = formsValue.country;
37488
37522
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37489
37523
  if (addressData.address.country) {
37490
37524
  search = addressData.address.country;
37491
37525
  }
37492
37526
  if (addressData.address.level1) {
37493
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37527
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
37494
37528
  }
37495
37529
  if (addressData.address.level2) {
37496
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37530
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37497
37531
  }
37498
37532
  } else {
37499
37533
  const country = countriesList.countries[formsValue.country] || {};
@@ -37501,10 +37535,10 @@ const inputTypeComponent$1 = {
37501
37535
  search = country.name;
37502
37536
  }
37503
37537
  if (formsValue.administrativeLevel1Name) {
37504
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37538
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37505
37539
  }
37506
37540
  if (formsValue.administrativeLevel2Name) {
37507
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37541
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37508
37542
  }
37509
37543
  }
37510
37544
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37516,36 +37550,32 @@ const inputTypeComponent$1 = {
37516
37550
  searchValue: search
37517
37551
  });
37518
37552
  },
37519
- year: (_ref41, _ref42) => {
37520
- let {
37521
- props
37522
- } = _ref41;
37523
- let {
37524
- isHighlighted
37525
- } = _ref42;
37553
+ year: ({
37554
+ props
37555
+ }, {
37556
+ isHighlighted
37557
+ }) => {
37526
37558
  const lng = localStorage.getItem("datastakeLng") || "en";
37527
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37559
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37528
37560
  size: "large",
37529
37561
  allowClear: true,
37530
37562
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37531
- picker: "year"
37532
- }, props), {}, {
37563
+ picker: "year",
37564
+ ...props,
37533
37565
  className: formatClassname([isHighlighted && "highlighted-input"]),
37534
37566
  format: "YYYY"
37535
- }));
37567
+ });
37536
37568
  },
37537
- upload: (_ref43, _ref44) => {
37538
- let {
37539
- rules,
37540
- value
37541
- } = _ref43;
37542
- let {
37543
- setLoading = () => {},
37544
- getApiBaseUrl,
37545
- getAppHeader,
37546
- t,
37547
- isHighlighted
37548
- } = _ref44;
37569
+ upload: ({
37570
+ rules,
37571
+ value
37572
+ }, {
37573
+ setLoading = () => {},
37574
+ getApiBaseUrl,
37575
+ getAppHeader,
37576
+ t,
37577
+ isHighlighted
37578
+ }) => {
37549
37579
  const apiURL = getApiBaseUrl();
37550
37580
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37551
37581
  const values = (Array.isArray(value) ? value : value && typeof value === "object" && value.fileList && Array.isArray(value.fileList) ? value.fileList.map(f => f.response).filter(f => f) : []) || [];
@@ -37558,12 +37588,13 @@ const inputTypeComponent$1 = {
37558
37588
  maxProps.multiple = true;
37559
37589
  }
37560
37590
  }
37561
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37591
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37592
+ ...maxProps,
37562
37593
  accept: accept,
37563
- action: "".concat(apiURL, "/upload"),
37594
+ action: `${apiURL}/upload`,
37564
37595
  beforeUpload: beforeUpload(allowedExtensions),
37565
37596
  onChange: val => {
37566
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37597
+ if (val?.file && typeof setLoading === "function") {
37567
37598
  if (val.file.percent !== 100) {
37568
37599
  setLoading(true);
37569
37600
  } else {
@@ -37571,9 +37602,10 @@ const inputTypeComponent$1 = {
37571
37602
  }
37572
37603
  }
37573
37604
  },
37574
- headers: _objectSpread2({
37575
- Authorization: "Bearer ".concat(getToken())
37576
- }, getAppHeader()),
37605
+ headers: {
37606
+ Authorization: `Bearer ${getToken()}`,
37607
+ ...getAppHeader()
37608
+ },
37577
37609
  defaultFileList: values,
37578
37610
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37579
37611
  style: {
@@ -37584,20 +37616,18 @@ const inputTypeComponent$1 = {
37584
37616
  children: t("Upload")
37585
37617
  })]
37586
37618
  })
37587
- }));
37619
+ });
37588
37620
  },
37589
- imageUpload: (_ref45, _ref46) => {
37590
- let {
37591
- rules,
37592
- value
37593
- } = _ref45;
37594
- let {
37595
- setLoading = () => {},
37596
- getApiBaseUrl,
37597
- getAppHeader,
37598
- t,
37599
- isHighlighted
37600
- } = _ref46;
37621
+ imageUpload: ({
37622
+ rules,
37623
+ value
37624
+ }, {
37625
+ setLoading = () => {},
37626
+ getApiBaseUrl,
37627
+ getAppHeader,
37628
+ t,
37629
+ isHighlighted
37630
+ }) => {
37601
37631
  const apiURL = getApiBaseUrl();
37602
37632
  const values = getImageUploadEditValue(value);
37603
37633
  const maxRule = rules.find(r => r.max);
@@ -37608,18 +37638,17 @@ const inputTypeComponent$1 = {
37608
37638
  maxProps.multiple = true;
37609
37639
  }
37610
37640
  }
37611
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37612
- beforeUpload: beforeUpload(allowedImageExtensions)
37613
- }, maxProps), {}, {
37641
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37642
+ beforeUpload: beforeUpload(allowedImageExtensions),
37643
+ ...maxProps,
37614
37644
  accept: "image/*",
37615
37645
  classList: !values || !values.length ? "empty" : "",
37616
37646
  listType: "picture",
37617
- action: "".concat(apiURL, "/upload"),
37647
+ action: `${apiURL}/upload`,
37618
37648
  onChange: val => {
37619
37649
  if (typeof setLoading === "function") {
37620
- if (val !== null && val !== void 0 && val.file) {
37621
- var _val$file;
37622
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37650
+ if (val?.file) {
37651
+ if (val?.file?.status === "removed") {
37623
37652
  setLoading(false);
37624
37653
  return;
37625
37654
  }
@@ -37631,9 +37660,10 @@ const inputTypeComponent$1 = {
37631
37660
  setLoading(false);
37632
37661
  }
37633
37662
  },
37634
- headers: _objectSpread2({
37635
- Authorization: "Bearer ".concat(getToken())
37636
- }, getAppHeader()),
37663
+ headers: {
37664
+ Authorization: `Bearer ${getToken()}`,
37665
+ ...getAppHeader()
37666
+ },
37637
37667
  defaultFileList: values,
37638
37668
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37639
37669
  style: {
@@ -37644,20 +37674,18 @@ const inputTypeComponent$1 = {
37644
37674
  children: t("Upload")
37645
37675
  })]
37646
37676
  })
37647
- }));
37677
+ });
37648
37678
  },
37649
- videoUpload: (_ref47, _ref48) => {
37650
- let {
37651
- rules,
37652
- value
37653
- } = _ref47;
37654
- let {
37655
- setLoading = () => {},
37656
- getApiBaseUrl,
37657
- getAppHeader,
37658
- t,
37659
- isHighlighted
37660
- } = _ref48;
37679
+ videoUpload: ({
37680
+ rules,
37681
+ value
37682
+ }, {
37683
+ setLoading = () => {},
37684
+ getApiBaseUrl,
37685
+ getAppHeader,
37686
+ t,
37687
+ isHighlighted
37688
+ }) => {
37661
37689
  const apiURL = getApiBaseUrl();
37662
37690
  const values = getImageUploadEditValue(value);
37663
37691
  const maxRule = rules.find(r => r.max);
@@ -37668,25 +37696,21 @@ const inputTypeComponent$1 = {
37668
37696
  maxProps.multiple = true;
37669
37697
  }
37670
37698
  }
37671
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37672
- itemRender: (item, fileList) => {
37673
- var _fileList$response;
37674
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37675
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37676
- url: (fileList === null || fileList === void 0 || (_fileList$response = fileList.response) === null || _fileList$response === void 0 ? void 0 : _fileList$response.url) || (fileList === null || fileList === void 0 ? void 0 : fileList.url)
37677
- }), item]
37678
- });
37679
- }
37680
- }, maxProps), {}, {
37699
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37700
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37701
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37702
+ url: fileList?.response?.url || fileList?.url
37703
+ }), item]
37704
+ }),
37705
+ ...maxProps,
37681
37706
  accept: "video/*",
37682
37707
  classList: !values || !values.length ? "empty" : "",
37683
37708
  listType: "picture",
37684
- action: "".concat(apiURL, "/upload"),
37709
+ action: `${apiURL}/upload`,
37685
37710
  onChange: val => {
37686
37711
  if (typeof setLoading === "function") {
37687
- if (val !== null && val !== void 0 && val.file) {
37688
- var _val$file2;
37689
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37712
+ if (val?.file) {
37713
+ if (val?.file?.status === "removed") {
37690
37714
  setLoading(false);
37691
37715
  return;
37692
37716
  }
@@ -37698,9 +37722,10 @@ const inputTypeComponent$1 = {
37698
37722
  setLoading(false);
37699
37723
  }
37700
37724
  },
37701
- headers: _objectSpread2({
37702
- Authorization: "Bearer ".concat(getToken())
37703
- }, getAppHeader()),
37725
+ headers: {
37726
+ Authorization: `Bearer ${getToken()}`,
37727
+ ...getAppHeader()
37728
+ },
37704
37729
  fileList: values,
37705
37730
  defaultFileList: values,
37706
37731
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37712,30 +37737,28 @@ const inputTypeComponent$1 = {
37712
37737
  children: t("Upload")
37713
37738
  })]
37714
37739
  })
37715
- }));
37740
+ });
37716
37741
  },
37717
- geolocation: (_ref49, _ref50) => {
37718
- let {
37719
- value,
37720
- name,
37721
- props,
37722
- formsValue,
37723
- addressData
37724
- } = _ref49;
37725
- let {
37726
- inputMeta,
37727
- isHighlighted
37728
- } = _ref50;
37742
+ geolocation: ({
37743
+ value,
37744
+ name,
37745
+ props,
37746
+ formsValue,
37747
+ addressData
37748
+ }, {
37749
+ inputMeta,
37750
+ isHighlighted
37751
+ }) => {
37729
37752
  let search = formsValue.country;
37730
37753
  if (addressData && Object.keys(addressData).length > 0) {
37731
37754
  if (addressData.country) {
37732
37755
  search = addressData.country;
37733
37756
  }
37734
37757
  if (addressData.level1) {
37735
- search = "".concat(addressData.level1, ", ").concat(addressData.country);
37758
+ search = `${addressData.level1}, ${addressData.country}`;
37736
37759
  }
37737
37760
  if (addressData.level2) {
37738
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37761
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37739
37762
  }
37740
37763
  } else {
37741
37764
  const country = countriesList.countries[formsValue.country] || {};
@@ -37743,10 +37766,10 @@ const inputTypeComponent$1 = {
37743
37766
  search = country.name;
37744
37767
  }
37745
37768
  if (formsValue.administrativeLevel1Name) {
37746
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37769
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37747
37770
  }
37748
37771
  if (formsValue.administrativeLevel2Name) {
37749
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37772
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37750
37773
  }
37751
37774
  }
37752
37775
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37760,36 +37783,34 @@ const inputTypeComponent$1 = {
37760
37783
  searchValue: search
37761
37784
  });
37762
37785
  },
37763
- ajaxSelect: (_ref51, _ref52) => {
37764
- let {
37765
- call,
37766
- automaticallyLink,
37767
- name,
37768
- inputName,
37769
- props,
37770
- formsValue,
37771
- onNewSetValue,
37772
- multiple,
37773
- updateOptions,
37774
- repeatValues,
37775
- repeatIndex,
37776
- value,
37777
- unique,
37778
- address,
37779
- addressData = {},
37780
- getFromLinking,
37781
- input
37782
- } = _ref51;
37783
- let {
37784
- form,
37785
- forms,
37786
- setAddress,
37787
- changeInputMeta,
37788
- inputMeta,
37789
- meta,
37790
- isHighlighted,
37791
- groupFormId
37792
- } = _ref52;
37786
+ ajaxSelect: ({
37787
+ call,
37788
+ automaticallyLink,
37789
+ name,
37790
+ inputName,
37791
+ props,
37792
+ formsValue,
37793
+ onNewSetValue,
37794
+ multiple,
37795
+ updateOptions,
37796
+ repeatValues,
37797
+ repeatIndex,
37798
+ value,
37799
+ unique,
37800
+ address,
37801
+ addressData = {},
37802
+ getFromLinking,
37803
+ input
37804
+ }, {
37805
+ form,
37806
+ forms,
37807
+ setAddress,
37808
+ changeInputMeta,
37809
+ inputMeta,
37810
+ meta,
37811
+ isHighlighted,
37812
+ groupFormId
37813
+ }) => {
37793
37814
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37794
37815
  size: "medium",
37795
37816
  input: input,
@@ -37826,7 +37847,9 @@ const inputTypeComponent$1 = {
37826
37847
  const selectedValue = data.find(v => v.value === ev);
37827
37848
  if (address && selectedValue) {
37828
37849
  dot__default["default"].str(address, selectedValue.label, addressData);
37829
- setAddress(_objectSpread2({}, addressData));
37850
+ setAddress({
37851
+ ...addressData
37852
+ });
37830
37853
  }
37831
37854
  }
37832
37855
  },
@@ -37835,11 +37858,10 @@ const inputTypeComponent$1 = {
37835
37858
  address: true
37836
37859
  });
37837
37860
  },
37838
- tag: _ref53 => {
37839
- let {
37840
- value,
37841
- repeatLabel
37842
- } = _ref53;
37861
+ tag: ({
37862
+ value,
37863
+ repeatLabel
37864
+ }) => {
37843
37865
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37844
37866
  size: "large",
37845
37867
  allowClear: true,
@@ -37847,28 +37869,26 @@ const inputTypeComponent$1 = {
37847
37869
  newPlaceholder: repeatLabel
37848
37870
  });
37849
37871
  },
37850
- modal: (_ref54, _ref55) => {
37851
- let {
37852
- call,
37853
- automaticallyLink,
37854
- name,
37855
- inputName,
37856
- props,
37857
- formsValue,
37858
- allFormsValue,
37859
- onNewSetValue,
37860
- repeatValues,
37861
- repeatIndex,
37862
- value,
37863
- modalTitle,
37864
- totalInputs,
37865
- shownInputs,
37866
- allowDupplicates
37867
- } = _ref54;
37868
- let {
37869
- form,
37870
- add
37871
- } = _ref55;
37872
+ modal: ({
37873
+ call,
37874
+ automaticallyLink,
37875
+ name,
37876
+ inputName,
37877
+ props,
37878
+ formsValue,
37879
+ allFormsValue,
37880
+ onNewSetValue,
37881
+ repeatValues,
37882
+ repeatIndex,
37883
+ value,
37884
+ modalTitle,
37885
+ totalInputs,
37886
+ shownInputs,
37887
+ allowDupplicates
37888
+ }, {
37889
+ form,
37890
+ add
37891
+ }) => {
37872
37892
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37873
37893
  allowClear: true,
37874
37894
  call: call,
@@ -37891,44 +37911,40 @@ const inputTypeComponent$1 = {
37891
37911
  allowDupplicates: allowDupplicates
37892
37912
  });
37893
37913
  },
37894
- dataLink: (_ref56, _ref57) => {
37895
- var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37896
- let {
37897
- setValues,
37898
- name,
37899
- onValuesChange,
37900
- changeLinking,
37901
- formsValue,
37902
- input,
37903
- call,
37904
- automaticallyLink,
37905
- inputName,
37906
- props,
37907
- onNewSetValue,
37908
- multiple,
37909
- updateOptions,
37910
- repeatValues,
37911
- repeatIndex,
37912
- value,
37913
- unique,
37914
- address,
37915
- addressData = {},
37916
- getFromLinking
37917
- } = _ref56;
37918
- let {
37919
- form,
37920
- forms,
37921
- setAddress,
37922
- changeInputMeta,
37923
- inputMeta,
37924
- meta,
37925
- isHighlighted,
37926
- groupFormId
37927
- } = _ref57;
37928
- if ((input === null || input === void 0 || (_input$meta12 = input.meta) === null || _input$meta12 === void 0 || (_input$meta12 = _input$meta12.optionsView) === null || _input$meta12 === void 0 ? void 0 : _input$meta12.editInputType) === "ajaxSelect") {
37929
- var _formsValue$groupForm3, _input$meta13, _input$meta14;
37930
- const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37931
- (input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 || (_input$meta13 = _input$meta13.optionsView) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.call) || (input === null || input === void 0 || (_input$meta14 = input.meta) === null || _input$meta14 === void 0 ? void 0 : _input$meta14.call) || "default::list()::::";
37914
+ dataLink: ({
37915
+ setValues,
37916
+ name,
37917
+ onValuesChange,
37918
+ changeLinking,
37919
+ formsValue,
37920
+ input,
37921
+ call,
37922
+ automaticallyLink,
37923
+ inputName,
37924
+ props,
37925
+ onNewSetValue,
37926
+ multiple,
37927
+ updateOptions,
37928
+ repeatValues,
37929
+ repeatIndex,
37930
+ value,
37931
+ unique,
37932
+ address,
37933
+ addressData = {},
37934
+ getFromLinking
37935
+ }, {
37936
+ form,
37937
+ forms,
37938
+ setAddress,
37939
+ changeInputMeta,
37940
+ inputMeta,
37941
+ meta,
37942
+ isHighlighted,
37943
+ groupFormId
37944
+ }) => {
37945
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37946
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37947
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37932
37948
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37933
37949
  size: "medium",
37934
37950
  input: input,
@@ -37965,7 +37981,9 @@ const inputTypeComponent$1 = {
37965
37981
  const selectedValue = data.find(v => v.value === ev);
37966
37982
  if (address && selectedValue) {
37967
37983
  dot__default["default"].str(address, selectedValue.label, addressData);
37968
- setAddress(_objectSpread2({}, addressData));
37984
+ setAddress({
37985
+ ...addressData
37986
+ });
37969
37987
  }
37970
37988
  }
37971
37989
  },
@@ -37975,93 +37993,138 @@ const inputTypeComponent$1 = {
37975
37993
  isDataLink: true
37976
37994
  });
37977
37995
  }
37978
- const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37979
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : (formsValue[name] || []).map(v => _objectSpread2({}, v));
37996
+ const isSingle = input?.meta?.maxRepeat === 1;
37997
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37998
+ ...(formsValue[groupFormId] || {})[name]
37999
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
38000
+ ...v
38001
+ })) : isSingle ? formsValue[name] ? [{
38002
+ ...formsValue[name]
38003
+ }] : [] : (formsValue[name] || []).map(v => ({
38004
+ ...v
38005
+ }));
37980
38006
  const onUpdate = (editData, i) => {
37981
- const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
38007
+ const val = {
38008
+ ...formData[i],
38009
+ ...editData
38010
+ };
37982
38011
  const _val = isSingle ? {
37983
38012
  [name]: val
37984
38013
  } : {
37985
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
38014
+ [name]: formData?.map((d, j) => i === j ? val : d)
37986
38015
  };
37987
38016
  if (groupFormId) {
37988
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37989
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37990
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38017
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38018
+ const _newData = {
38019
+ ..._defaultData,
38020
+ ..._val
38021
+ };
38022
+ onValuesChange(_newData, {
38023
+ ...formsValue,
37991
38024
  [groupFormId]: _newData
37992
- }));
37993
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37994
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38025
+ });
38026
+ form?.setFieldValue(groupFormId, _newData);
38027
+ setValues({
38028
+ ...formsValue,
37995
38029
  [groupFormId]: _newData
37996
- }));
38030
+ });
37997
38031
  return;
37998
38032
  }
37999
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38000
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38001
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38033
+ onValuesChange(_val, {
38034
+ ...formsValue,
38035
+ ..._val
38036
+ });
38037
+ form?.setFieldValue(name, _val[name]);
38038
+ setValues({
38039
+ ...formsValue,
38040
+ ..._val
38041
+ });
38002
38042
  };
38003
- if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
38004
- var _formsValue$meta4, _input$meta17;
38043
+ if (input?.meta?.flat) {
38005
38044
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
38006
38045
  form: input,
38007
38046
  changeLinking: changeLinking,
38008
38047
  onUpdate: onUpdate,
38009
38048
  isHighlighted: isHighlighted,
38010
38049
  formsValue: formsValue,
38011
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38050
+ values: groupFormId ? {
38051
+ ...(formsValue[groupFormId] || {}),
38012
38052
  meta: {
38013
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
38053
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38014
38054
  }
38015
- }) : formsValue,
38055
+ } : formsValue,
38016
38056
  name: name,
38017
38057
  groupFormId: groupFormId,
38018
- maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
38019
- remove: _ref58 => {
38020
- let {
38021
- key
38022
- } = _ref58;
38058
+ maxRepeat: input?.meta?.maxRepeat,
38059
+ remove: ({
38060
+ key
38061
+ }) => {
38023
38062
  const _val = isSingle ? {
38024
38063
  [name]: null
38025
38064
  } : {
38026
38065
  [name]: formData.filter((v, i) => i !== key)
38027
38066
  };
38028
38067
  if (groupFormId) {
38029
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38030
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38031
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38068
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38069
+ const _newData = {
38070
+ ..._defaultData,
38071
+ ..._val
38072
+ };
38073
+ onValuesChange(_newData, {
38074
+ ...formsValue,
38032
38075
  [groupFormId]: _newData
38033
- }));
38034
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38035
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38076
+ });
38077
+ form?.setFieldValue(groupFormId, _newData);
38078
+ setValues({
38079
+ ...formsValue,
38036
38080
  [groupFormId]: _newData
38037
- }));
38081
+ });
38038
38082
  return;
38039
38083
  }
38040
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38041
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38042
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38084
+ onValuesChange(_val, {
38085
+ ...formsValue,
38086
+ ..._val
38087
+ });
38088
+ form?.setFieldValue(name, _val[name]);
38089
+ setValues({
38090
+ ...formsValue,
38091
+ ..._val
38092
+ });
38043
38093
  },
38044
38094
  add: val => {
38045
38095
  const _val = isSingle ? {
38046
38096
  [name]: val
38047
38097
  } : {
38048
- [name]: [...formData, _objectSpread2({}, val)]
38098
+ [name]: [...formData, {
38099
+ ...val
38100
+ }]
38049
38101
  };
38050
38102
  if (groupFormId) {
38051
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38052
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38053
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38054
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38103
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38104
+ const _newData = {
38105
+ ..._defaultData,
38106
+ ..._val
38107
+ };
38108
+ form?.setFieldValue(groupFormId, _newData);
38109
+ onValuesChange(_newData, {
38110
+ ...formsValue,
38055
38111
  [groupFormId]: _newData
38056
- }));
38057
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38112
+ });
38113
+ setValues({
38114
+ ...formsValue,
38058
38115
  [groupFormId]: _newData
38059
- }));
38116
+ });
38060
38117
  return;
38061
38118
  }
38062
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38063
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38064
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38119
+ form?.setFieldValue(name, _val[name]);
38120
+ onValuesChange(_val, {
38121
+ ...formsValue,
38122
+ ..._val
38123
+ });
38124
+ setValues({
38125
+ ...formsValue,
38126
+ ..._val
38127
+ });
38065
38128
  },
38066
38129
  k: name,
38067
38130
  formData: formData
@@ -38073,79 +38136,101 @@ const inputTypeComponent$1 = {
38073
38136
  onUpdate: onUpdate,
38074
38137
  isHighlighted: isHighlighted,
38075
38138
  formsValue: formsValue,
38076
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38139
+ values: groupFormId ? {
38140
+ ...(formsValue[groupFormId] || {}),
38077
38141
  meta: {
38078
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
38142
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38079
38143
  }
38080
- }) : formsValue,
38144
+ } : formsValue,
38081
38145
  name: name,
38082
38146
  groupFormId: groupFormId,
38083
- maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
38084
- remove: _ref59 => {
38085
- let {
38086
- key
38087
- } = _ref59;
38147
+ maxRepeat: input?.meta?.maxRepeat,
38148
+ remove: ({
38149
+ key
38150
+ }) => {
38088
38151
  const _val = isSingle ? {
38089
38152
  [name]: null
38090
38153
  } : {
38091
38154
  [name]: formData.filter((v, i) => i !== key)
38092
38155
  };
38093
38156
  if (groupFormId) {
38094
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38095
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38096
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38157
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38158
+ const _newData = {
38159
+ ..._defaultData,
38160
+ ..._val
38161
+ };
38162
+ onValuesChange(_newData, {
38163
+ ...formsValue,
38097
38164
  [groupFormId]: _newData
38098
- }));
38099
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38100
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38165
+ });
38166
+ form?.setFieldValue(groupFormId, _newData);
38167
+ setValues({
38168
+ ...formsValue,
38101
38169
  [groupFormId]: _newData
38102
- }));
38170
+ });
38103
38171
  return;
38104
38172
  }
38105
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38106
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38107
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38173
+ onValuesChange(_val, {
38174
+ ...formsValue,
38175
+ ..._val
38176
+ });
38177
+ form?.setFieldValue(name, _val[name]);
38178
+ setValues({
38179
+ ...formsValue,
38180
+ ..._val
38181
+ });
38108
38182
  },
38109
38183
  add: val => {
38110
38184
  const _val = isSingle ? {
38111
38185
  [name]: val
38112
38186
  } : {
38113
- [name]: [...formData, _objectSpread2({}, val)]
38187
+ [name]: [...formData, {
38188
+ ...val
38189
+ }]
38114
38190
  };
38115
38191
  if (groupFormId) {
38116
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38117
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38118
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38119
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38192
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38193
+ const _newData = {
38194
+ ..._defaultData,
38195
+ ..._val
38196
+ };
38197
+ form?.setFieldValue(groupFormId, _newData);
38198
+ onValuesChange(_newData, {
38199
+ ...formsValue,
38120
38200
  [groupFormId]: _newData
38121
- }));
38122
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38201
+ });
38202
+ setValues({
38203
+ ...formsValue,
38123
38204
  [groupFormId]: _newData
38124
- }));
38205
+ });
38125
38206
  return;
38126
38207
  }
38127
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38128
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38129
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38208
+ form?.setFieldValue(name, _val[name]);
38209
+ onValuesChange(_val, {
38210
+ ...formsValue,
38211
+ ..._val
38212
+ });
38213
+ setValues({
38214
+ ...formsValue,
38215
+ ..._val
38216
+ });
38130
38217
  },
38131
38218
  k: name,
38132
38219
  formData: formData
38133
38220
  });
38134
38221
  },
38135
- dataLinkGroup: (_ref60, _ref61) => {
38136
- let {
38137
- setValues,
38138
- name,
38139
- onValuesChange,
38140
- changeLinking,
38141
- formsValue,
38142
- input
38143
- } = _ref60;
38144
- let {
38145
- form,
38146
- groupFormId,
38147
- isHighlighted
38148
- } = _ref61;
38222
+ dataLinkGroup: ({
38223
+ setValues,
38224
+ name,
38225
+ onValuesChange,
38226
+ changeLinking,
38227
+ formsValue,
38228
+ input
38229
+ }, {
38230
+ form,
38231
+ groupFormId,
38232
+ isHighlighted
38233
+ }) => {
38149
38234
  return renderDataLinkGroup({
38150
38235
  input,
38151
38236
  name,
@@ -38158,41 +38243,51 @@ const inputTypeComponent$1 = {
38158
38243
  isHighlighted
38159
38244
  });
38160
38245
  },
38161
- groupCheckbox: (_ref62, _ref63) => {
38162
- let {
38163
- setValues,
38164
- name,
38165
- onValuesChange,
38166
- formsValue,
38167
- input
38168
- } = _ref62;
38169
- let {
38170
- form,
38171
- groupFormId,
38172
- isHighlighted
38173
- } = _ref63;
38246
+ groupCheckbox: ({
38247
+ setValues,
38248
+ name,
38249
+ onValuesChange,
38250
+ formsValue,
38251
+ input
38252
+ }, {
38253
+ form,
38254
+ groupFormId,
38255
+ isHighlighted
38256
+ }) => {
38174
38257
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
38175
38258
  const onUpdate = (val, key) => {
38176
38259
  const _val = {
38177
- [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
38260
+ [name]: {
38261
+ ...formData,
38178
38262
  [key]: val
38179
- })
38263
+ }
38180
38264
  };
38181
38265
  if (groupFormId) {
38182
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38183
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38184
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38266
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38267
+ const _newData = {
38268
+ ..._defaultData,
38269
+ ..._val
38270
+ };
38271
+ onValuesChange(_newData, {
38272
+ ...formsValue,
38185
38273
  [groupFormId]: _newData
38186
- }));
38187
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38188
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38274
+ });
38275
+ form?.setFieldValue(groupFormId, _newData);
38276
+ setValues({
38277
+ ...formsValue,
38189
38278
  [groupFormId]: _newData
38190
- }));
38279
+ });
38191
38280
  return;
38192
38281
  }
38193
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38194
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38195
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38282
+ onValuesChange(_val, {
38283
+ ...formsValue,
38284
+ ..._val
38285
+ });
38286
+ form?.setFieldValue(name, _val[name]);
38287
+ setValues({
38288
+ ...formsValue,
38289
+ ..._val
38290
+ });
38196
38291
  };
38197
38292
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
38198
38293
  form: input,
@@ -38201,91 +38296,96 @@ const inputTypeComponent$1 = {
38201
38296
  isHighlighted: isHighlighted
38202
38297
  });
38203
38298
  },
38204
- website: (_ref64, _ref65) => {
38205
- let {
38206
- name,
38207
- inputName,
38208
- props,
38209
- value,
38210
- repeatIndex,
38211
- repeatValues,
38212
- formsValue
38213
- } = _ref64;
38214
- let {
38215
- form,
38216
- isHighlighted,
38217
- inputMeta = {},
38218
- t
38219
- } = _ref65;
38220
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38299
+ website: ({
38300
+ name,
38301
+ inputName,
38302
+ props,
38303
+ value,
38304
+ repeatIndex,
38305
+ repeatValues,
38306
+ formsValue
38307
+ }, {
38308
+ form,
38309
+ isHighlighted,
38310
+ inputMeta = {},
38311
+ t
38312
+ }) => {
38313
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
38221
38314
  size: "large",
38222
38315
  allowClear: true,
38223
- initialValue: value
38224
- }, props), {}, {
38316
+ initialValue: value,
38317
+ ...props,
38225
38318
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
38226
38319
  className: formatClassname([isHighlighted && "highlighted-cont"]),
38227
38320
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
38228
38321
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
38229
- }));
38322
+ });
38230
38323
  },
38231
- group: (_ref66, _ref67) => {
38232
- let {
38233
- props,
38234
- groupInputs,
38235
- formsValue
38236
- } = _ref66;
38237
- let {
38238
- inputMeta,
38239
- isHighlighted
38240
- } = _ref67;
38241
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38324
+ group: ({
38325
+ props,
38326
+ groupInputs,
38327
+ formsValue
38328
+ }, {
38329
+ inputMeta,
38330
+ isHighlighted
38331
+ }) => {
38332
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38242
38333
  formsValue: formsValue,
38243
38334
  isHighlighted: isHighlighted,
38244
38335
  groupInputs: groupInputs,
38245
- inputMeta: inputMeta
38246
- }, props));
38336
+ inputMeta: inputMeta,
38337
+ ...props
38338
+ });
38247
38339
  },
38248
- groupInputs: (_ref68, _ref69) => {
38249
- let {
38250
- props,
38251
- groupInputs,
38252
- formsValue
38253
- } = _ref68;
38254
- let {
38255
- inputMeta,
38256
- isHighlighted
38257
- } = _ref69;
38258
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38340
+ groupInputs: ({
38341
+ props,
38342
+ groupInputs,
38343
+ formsValue
38344
+ }, {
38345
+ inputMeta,
38346
+ isHighlighted
38347
+ }) => {
38348
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38259
38349
  formsValue: formsValue,
38260
38350
  isHighlighted: isHighlighted,
38261
38351
  groupInputs: groupInputs,
38262
- inputMeta: inputMeta
38263
- }, props));
38352
+ inputMeta: inputMeta,
38353
+ ...props
38354
+ });
38264
38355
  },
38265
- smartHelp: (_ref70, _ref71) => {
38356
+ smartHelp: ({
38357
+ name,
38358
+ inputName,
38359
+ props,
38360
+ value,
38361
+ repeatIndex,
38362
+ repeatValues,
38363
+ formsValue
38364
+ }, {
38365
+ form,
38366
+ isHighlighted,
38367
+ inputMeta = {},
38368
+ t
38369
+ }) => {
38266
38370
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
38267
38371
  }
38268
38372
  };
38269
38373
  const filterForm = (f, d) => {
38270
38374
  return f && (f.showFormIf ? showHideForm(f, d) : true);
38271
38375
  };
38272
- const checkFormHasSubsections = function () {
38273
- let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38274
- return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38275
- };
38376
+ const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38276
38377
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
38277
- const _ref72 = f[key] || {},
38278
- {
38279
- label,
38280
- description = "",
38281
- excludeFromEdit,
38282
- showFormIf,
38283
- icon = "",
38284
- position = 0,
38285
- template,
38286
- formClass
38287
- } = _ref72,
38288
- fc = _objectWithoutProperties(_ref72, _excluded2$1);
38378
+ const {
38379
+ label,
38380
+ description = "",
38381
+ excludeFromEdit,
38382
+ showFormIf,
38383
+ icon = "",
38384
+ position = 0,
38385
+ template,
38386
+ formClass,
38387
+ ...fc
38388
+ } = f[key] || {};
38289
38389
  const fConf = {
38290
38390
  id: key,
38291
38391
  label,
@@ -38344,14 +38444,11 @@ const groupSubForms = (fConf, d) => {
38344
38444
  return f;
38345
38445
  }, {});
38346
38446
  };
38347
- const inputIsEmpty = function () {
38348
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38349
- let values = arguments.length > 1 ? arguments[1] : undefined;
38350
- let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
38351
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38447
+ const inputIsEmpty = (input = {}, values, inputMeta) => {
38448
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
38352
38449
  return false;
38353
38450
  }
38354
- if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38451
+ if (input?.type === "groupInputs") {
38355
38452
  return true;
38356
38453
  }
38357
38454
  const value = values[input.dataId];
@@ -38363,28 +38460,26 @@ const inputIsEmpty = function () {
38363
38460
  }
38364
38461
  return !value;
38365
38462
  };
38366
- const GetFormItem$1 = _ref73 => {
38367
- var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
38368
- let {
38369
- highlightMandatory,
38370
- inputData,
38371
- inputId,
38372
- input,
38373
- values,
38374
- MainForm,
38375
- options,
38376
- plainForms,
38377
- setValues,
38378
- setAddress,
38379
- i,
38380
- inputKey,
38381
- onValuesChange = () => {},
38382
- setLoading = () => {},
38383
- inputMeta = {},
38384
- changeInputMeta = () => {},
38385
- changeLinking = () => {},
38386
- namespace
38387
- } = _ref73;
38463
+ const GetFormItem$1 = ({
38464
+ highlightMandatory,
38465
+ inputData,
38466
+ inputId,
38467
+ input,
38468
+ values,
38469
+ MainForm,
38470
+ options,
38471
+ plainForms,
38472
+ setValues,
38473
+ setAddress,
38474
+ i,
38475
+ inputKey,
38476
+ onValuesChange = () => {},
38477
+ setLoading = () => {},
38478
+ inputMeta = {},
38479
+ changeInputMeta = () => {},
38480
+ changeLinking = () => {},
38481
+ namespace
38482
+ }) => {
38388
38483
  const {
38389
38484
  t,
38390
38485
  user,
@@ -38399,42 +38494,44 @@ const GetFormItem$1 = _ref73 => {
38399
38494
  staticWidth,
38400
38495
  fullWidth
38401
38496
  } = useEditContext();
38402
- const lastReview = ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || [])[((inputMeta === null || inputMeta === void 0 || (_inputMeta$reviews = inputMeta.reviews) === null || _inputMeta$reviews === void 0 ? void 0 : _inputMeta$reviews.length) || 0) - 1];
38497
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
38403
38498
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
38404
38499
  const inputLabel = getInputLabel$1(input, values);
38405
38500
  const onClickReviewSuccess = () => {
38406
38501
  if (!isReview) {
38407
38502
  return;
38408
38503
  }
38409
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38504
+ const reviewSuccess = lastReview?.reviewSuccess;
38410
38505
  changeInputMeta({
38411
38506
  key: inputId,
38412
38507
  type: input.type,
38413
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38508
+ value: {
38509
+ ...inputMeta,
38414
38510
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38415
38511
  reviewer: user,
38416
38512
  createdAt: new Date().toISOString(),
38417
38513
  reviewSuccess: true
38418
38514
  }]
38419
- })
38515
+ }
38420
38516
  });
38421
38517
  };
38422
38518
  const onClickReviewError = () => {
38423
38519
  if (!isReview) {
38424
38520
  return;
38425
38521
  }
38426
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38522
+ const reviewError = lastReview?.reviewError;
38427
38523
  changeInputMeta({
38428
38524
  key: inputId,
38429
38525
  type: input.type,
38430
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38526
+ value: {
38527
+ ...inputMeta,
38431
38528
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38432
38529
  reviewer: user,
38433
38530
  createdAt: new Date().toISOString(),
38434
38531
  reviewError: true,
38435
38532
  comment: ""
38436
38533
  }]
38437
- })
38534
+ }
38438
38535
  });
38439
38536
  };
38440
38537
  switch (input.type) {
@@ -38448,12 +38545,12 @@ const GetFormItem$1 = _ref73 => {
38448
38545
  case "header":
38449
38546
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
38450
38547
  className: "daf-title with-subtitle",
38451
- style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38548
+ style: input?.meta?.style,
38452
38549
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38453
38550
  className: "flex",
38454
38551
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
38455
38552
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
38456
- }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38553
+ }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38457
38554
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
38458
38555
  className: "tooltip-popover-cont",
38459
38556
  children: ReactHtmlParser__default["default"](input.description)
@@ -38480,7 +38577,7 @@ const GetFormItem$1 = _ref73 => {
38480
38577
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38481
38578
 
38482
38579
  // eslint-disable-next-line no-case-declarations
38483
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38580
+ let maxRule = rules.find(rule => rule.max)?.max;
38484
38581
  if (!maxRule && input.type === "textarea") {
38485
38582
  maxRule = MAX_TEXT_AREA_LENGTH;
38486
38583
  }
@@ -38493,30 +38590,27 @@ const GetFormItem$1 = _ref73 => {
38493
38590
  message: requiredRule.message || ""
38494
38591
  });
38495
38592
  }
38496
- const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta21 = input.meta) === null || _input$meta21 === void 0 ? void 0 : _input$meta21.mandatory) && inputIsEmpty(input, values, inputMeta);
38593
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38497
38594
  if (requiredRule || specialCharsRule) {
38498
38595
  if (input.type === "groupInputs") {
38499
38596
  rules = rules.map(r => {
38500
38597
  if (r.required) {
38501
- return _ref74 => {
38502
- let {
38503
- getFieldValue
38504
- } = _ref74;
38505
- return {
38506
- validator() {
38507
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38508
- return Promise.resolve();
38509
- }
38510
- const keys = Object.keys(input.inputs);
38511
- for (let i = 0; i < keys.length; i++) {
38512
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38513
- return Promise.reject(r.message);
38514
- }
38515
- }
38598
+ return ({
38599
+ getFieldValue
38600
+ }) => ({
38601
+ validator() {
38602
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38516
38603
  return Promise.resolve();
38517
38604
  }
38518
- };
38519
- };
38605
+ const keys = Object.keys(input.inputs);
38606
+ for (let i = 0; i < keys.length; i++) {
38607
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38608
+ return Promise.reject(r.message);
38609
+ }
38610
+ }
38611
+ return Promise.resolve();
38612
+ }
38613
+ });
38520
38614
  }
38521
38615
  return r;
38522
38616
  });
@@ -38554,13 +38648,12 @@ const GetFormItem$1 = _ref73 => {
38554
38648
  }
38555
38649
  }
38556
38650
  if (input && typeof input === "object") {
38557
- var _input$meta22, _input$meta23, _input$meta24, _input$meta25, _values$parent, _input$meta26, _input$meta27, _inputData$value, _input$meta28, _input$meta29, _inputData$commentVal, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
38558
38651
  // check if input is valid
38559
38652
  const hideComment = namespace === "project-readiness";
38560
38653
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38561
38654
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38562
38655
  className: "flex-row input-cont",
38563
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38656
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38564
38657
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38565
38658
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38566
38659
  className: formatClassname(["ml-4 input-actions"]),
@@ -38570,7 +38663,7 @@ const GetFormItem$1 = _ref73 => {
38570
38663
  title: t("Add review note"),
38571
38664
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38572
38665
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38573
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38666
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38574
38667
  type: "link",
38575
38668
  onClick: onClickReviewError,
38576
38669
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38586,7 +38679,7 @@ const GetFormItem$1 = _ref73 => {
38586
38679
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38587
38680
  type: "link",
38588
38681
  onClick: onClickReviewSuccess,
38589
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38682
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38590
38683
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38591
38684
  name: "CheckSquare",
38592
38685
  width: 16,
@@ -38623,7 +38716,7 @@ const GetFormItem$1 = _ref73 => {
38623
38716
  }
38624
38717
  });
38625
38718
  },
38626
- disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38719
+ disabled: !input.meta?.notApplicable,
38627
38720
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38628
38721
  name: "NotApplicable",
38629
38722
  width: 16,
@@ -38637,7 +38730,7 @@ const GetFormItem$1 = _ref73 => {
38637
38730
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38638
38731
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38639
38732
  type: "link",
38640
- disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38733
+ disabled: !input.meta?.notAvailable,
38641
38734
  onClick: () => {
38642
38735
  const value = getDefaultInputValue(input);
38643
38736
  MainForm.setFields([{
@@ -38669,14 +38762,14 @@ const GetFormItem$1 = _ref73 => {
38669
38762
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38670
38763
  title: t("Add comment"),
38671
38764
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38672
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38765
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38673
38766
  type: "link",
38674
- disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38675
- }, !isShown ? {
38676
- className: "default p-0"
38677
- } : {
38678
- className: "p-0 primary"
38679
- }), {}, {
38767
+ disabled: !input.meta?.comment,
38768
+ ...(!isShown ? {
38769
+ className: "default p-0"
38770
+ } : {
38771
+ className: "p-0 primary"
38772
+ }),
38680
38773
  onClick: () => {
38681
38774
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38682
38775
  return;
@@ -38695,7 +38788,7 @@ const GetFormItem$1 = _ref73 => {
38695
38788
  width: 16,
38696
38789
  height: 16
38697
38790
  })
38698
- }))
38791
+ })
38699
38792
  })
38700
38793
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38701
38794
  title: t("Project Readiness"),
@@ -38714,34 +38807,36 @@ const GetFormItem$1 = _ref73 => {
38714
38807
  }) : null]
38715
38808
  }) : null
38716
38809
  }),
38717
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38718
- }, inputOnBlur.includes(input.type) ? {
38719
- trigger: "onBlur"
38720
- } : {}), ["total100", "group"].includes(input.type) ? {} : {
38721
- name: inputId,
38722
- fieldKey: inputId,
38723
- initialValue: inputData.value
38724
- }), ["upload"].includes(input.type) ? {
38725
- valuePropName: "fileList",
38726
- getValueFromEvent: e => {
38727
- if (Array.isArray(e)) {
38728
- return e;
38729
- }
38730
- return e && e.fileList && e.fileList.map(f => {
38731
- if (f.response) {
38732
- return f.response;
38810
+ initialValue: inputMeta?.defaultValue,
38811
+ ...(inputOnBlur.includes(input.type) ? {
38812
+ trigger: "onBlur"
38813
+ } : {}),
38814
+ ...(["total100", "group"].includes(input.type) ? {} : {
38815
+ name: inputId,
38816
+ fieldKey: inputId,
38817
+ initialValue: inputData.value
38818
+ }),
38819
+ ...(["upload"].includes(input.type) ? {
38820
+ valuePropName: "fileList",
38821
+ getValueFromEvent: e => {
38822
+ if (Array.isArray(e)) {
38823
+ return e;
38733
38824
  }
38734
- return f;
38735
- });
38736
- }
38737
- } : {}), {}, {
38738
- className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38825
+ return e && e.fileList && e.fileList.map(f => {
38826
+ if (f.response) {
38827
+ return f.response;
38828
+ }
38829
+ return f;
38830
+ });
38831
+ }
38832
+ } : {}),
38833
+ className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38739
38834
  "data-id": inputData.name,
38740
38835
  rules: rules,
38741
38836
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38742
38837
  labelCol: 12,
38743
38838
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38744
- className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38839
+ className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38745
38840
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38746
38841
  className: "mr-1",
38747
38842
  children: getInputLabel$1(input, values)
@@ -38754,7 +38849,7 @@ const GetFormItem$1 = _ref73 => {
38754
38849
  config: input,
38755
38850
  t: t,
38756
38851
  ajaxForms: ajaxForms,
38757
- linkingData: (values === null || values === void 0 ? void 0 : values.linking) || (values === null || values === void 0 || (_values$parent = values.parent) === null || _values$parent === void 0 ? void 0 : _values$parent.linking),
38852
+ linkingData: values?.linking || values?.parent?.linking,
38758
38853
  changeAjaxForms: changeAjaxForms,
38759
38854
  getApiBaseUrl: getApiBaseUrl,
38760
38855
  getAppHeader: getAppHeader,
@@ -38762,11 +38857,12 @@ const GetFormItem$1 = _ref73 => {
38762
38857
  getToken: getToken,
38763
38858
  app: app,
38764
38859
  valueOnlyString: true
38765
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
38860
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38861
+ ...inputData,
38766
38862
  maxWidth,
38767
38863
  staticWidth,
38768
38864
  fullWidth
38769
- }), {
38865
+ }, {
38770
38866
  form: MainForm,
38771
38867
  forms: options,
38772
38868
  allForms: plainForms,
@@ -38787,10 +38883,10 @@ const GetFormItem$1 = _ref73 => {
38787
38883
  staticWidth,
38788
38884
  fullWidth
38789
38885
  }) : console.log(input)
38790
- })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38886
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38791
38887
  className: "code",
38792
38888
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38793
- children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38889
+ children: input.meta?.code
38794
38890
  })
38795
38891
  }) : null]
38796
38892
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38810,10 +38906,10 @@ const GetFormItem$1 = _ref73 => {
38810
38906
  className: "max-char-span",
38811
38907
  children: t("max-char", {
38812
38908
  chars: maxRule,
38813
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38909
+ filled: inputData?.value?.length || 0
38814
38910
  })
38815
38911
  })
38816
- }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38912
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38817
38913
  className: "input-content",
38818
38914
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38819
38915
  className: "comment-textarea",
@@ -38839,7 +38935,7 @@ const GetFormItem$1 = _ref73 => {
38839
38935
  },
38840
38936
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38841
38937
  type: "link",
38842
- disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38938
+ disabled: !input.meta?.comment,
38843
38939
  className: "p-0",
38844
38940
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38845
38941
  width: 16,
@@ -38848,11 +38944,12 @@ const GetFormItem$1 = _ref73 => {
38848
38944
  })
38849
38945
  })]
38850
38946
  }),
38851
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38947
+ children: inputTypeComponent$1.comment({
38948
+ ...inputData,
38852
38949
  maxWidth,
38853
38950
  staticWidth,
38854
38951
  fullWidth
38855
- }), {
38952
+ }, {
38856
38953
  form: MainForm,
38857
38954
  forms: options,
38858
38955
  setFormValues: setValues,
@@ -38877,16 +38974,16 @@ const GetFormItem$1 = _ref73 => {
38877
38974
  className: "max-char-span",
38878
38975
  children: t("max-char", {
38879
38976
  chars: MAX_COMMENTS_LENGTH,
38880
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38977
+ filled: inputData?.commentValue?.length || 0
38881
38978
  })
38882
38979
  })]
38883
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38980
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38884
38981
  className: "input-content",
38885
38982
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38886
38983
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38887
38984
  className: "comment-textarea",
38888
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38889
- name: "".concat(inputId, "-reviewErrorComment"),
38985
+ initialValue: lastReview?.comment || "",
38986
+ name: `${inputId}-reviewErrorComment`,
38890
38987
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38891
38988
  className: "flex w-100",
38892
38989
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38894,28 +38991,31 @@ const GetFormItem$1 = _ref73 => {
38894
38991
  children: t("Review note")
38895
38992
  })
38896
38993
  }),
38897
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38994
+ children: inputTypeComponent$1.comment({
38995
+ ...inputData,
38898
38996
  maxWidth,
38899
38997
  staticWidth,
38900
38998
  fullWidth
38901
- }), {
38999
+ }, {
38902
39000
  form: MainForm,
38903
39001
  forms: options,
38904
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
39002
+ value: lastReview?.comment || "",
38905
39003
  onChange: val => {
38906
39004
  changeInputMeta({
38907
39005
  key: inputId,
38908
39006
  type: input.type,
38909
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38910
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
39007
+ value: {
39008
+ ...inputMeta,
39009
+ reviews: (inputMeta?.reviews || []).map(v => {
38911
39010
  if (v.createdAt === lastReview.createdAt) {
38912
- return _objectSpread2(_objectSpread2({}, v), {}, {
39011
+ return {
39012
+ ...v,
38913
39013
  comment: val
38914
- });
39014
+ };
38915
39015
  }
38916
39016
  return v;
38917
39017
  })
38918
- })
39018
+ }
38919
39019
  });
38920
39020
  },
38921
39021
  t,
@@ -38929,7 +39029,7 @@ const GetFormItem$1 = _ref73 => {
38929
39029
  className: "max-char-span",
38930
39030
  children: t("max-char", {
38931
39031
  chars: MAX_COMMENTS_LENGTH,
38932
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
39032
+ filled: lastReview.comment?.length || 0
38933
39033
  })
38934
39034
  })]
38935
39035
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -38950,7 +39050,7 @@ const GetFormItem$1 = _ref73 => {
38950
39050
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38951
39051
  className: "flex flex-column justify-center mr-1",
38952
39052
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38953
- children: (lastReview === null || lastReview === void 0 || (_lastReview$reviewer = lastReview.reviewer) === null || _lastReview$reviewer === void 0 ? void 0 : _lastReview$reviewer.firstName) + " " + (lastReview === null || lastReview === void 0 || (_lastReview$reviewer2 = lastReview.reviewer) === null || _lastReview$reviewer2 === void 0 ? void 0 : _lastReview$reviewer2.lastName) + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
39053
+ children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38954
39054
  })
38955
39055
  })]
38956
39056
  })]
@@ -38961,14 +39061,13 @@ const GetFormItem$1 = _ref73 => {
38961
39061
  return null;
38962
39062
  }
38963
39063
  };
38964
- const editErrorHandler = _ref76 => {
38965
- let {
38966
- errorFields,
38967
- t = s => s
38968
- } = _ref76;
39064
+ const editErrorHandler = ({
39065
+ errorFields,
39066
+ t = s => s
39067
+ }) => {
38969
39068
  if (Array.isArray(errorFields) && errorFields.length) {
38970
39069
  const name = errorFields[0].name.join(".");
38971
- const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
39070
+ const element = document.querySelector(`[data-id="${name}"]`);
38972
39071
  if (element) {
38973
39072
  element.scrollIntoView();
38974
39073
  antd.message.error(t("errors::please-correct-invalid-inputs"));
@@ -41665,22 +41764,23 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41665
41764
  const formId = form.dataId || k;
41666
41765
  const allInputs = Object.keys(form.inputs).filter(i => {
41667
41766
  const input = form.inputs[i];
41668
- return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, `${formId}.${i}`);
41767
+ return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, "".concat(formId, ".").concat(i));
41669
41768
  });
41670
41769
  return allInputs.length ? /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
41671
41770
  children: [getFormTitles(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41672
41771
  children: [!form.repeatable ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41673
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} mb0 ${i ? 'mt-3' : ''}`,
41772
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
41674
41773
  children: getInputLabel(form, values)
41675
41774
  }) : !form.hideSectionLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41676
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} mb0 ${i ? 'mt-3' : ''}`,
41775
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
41677
41776
  children: form.sectionLabel ? getSectionLabel(form.sectionLabel, values) : form.label ? getInputLabel(form, values) : camelCaseToTitle(k)
41678
41777
  }) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
41679
41778
  name: formId,
41680
- children: (fields, {
41681
- add,
41682
- remove
41683
- }) => {
41779
+ children: (fields, _ref) => {
41780
+ let {
41781
+ add,
41782
+ remove
41783
+ } = _ref;
41684
41784
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
41685
41785
  if (fields.length === 0) {
41686
41786
  const formInputs = form.inputs;
@@ -41731,7 +41831,7 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41731
41831
  padding: '0px 5px',
41732
41832
  color: '#2E90FA'
41733
41833
  },
41734
- children: `#${field.name + 1}`
41834
+ children: "#".concat(field.name + 1)
41735
41835
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
41736
41836
  className: "remove-button-for-repeatable",
41737
41837
  children: (formData.filter(k => Object.keys(k).length > 0).length >= 1 || fields.length > 1) && (typeof form.canDelete !== 'function' || form.canDelete(Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {})) ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
@@ -41753,8 +41853,8 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41753
41853
  const inputId = input.dataId || inp;
41754
41854
  const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
41755
41855
  const value = inputValues[inputId];
41756
- const commentValue = inputValues[`${inputId}Comment`];
41757
- const inputData = getData(formId, input, value, commentValue, `${formId}[${field.name}].${inputId}`, `${formId}.${inputId}`);
41856
+ const commentValue = inputValues["".concat(inputId, "Comment")];
41857
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, "[").concat(field.name, "].").concat(inputId), "".concat(formId, ".").concat(inputId));
41758
41858
  const subtitles = form.subtitles || null;
41759
41859
  inputData.repeatIndex = field.name;
41760
41860
  inputData.inputName = inputId;
@@ -41775,64 +41875,59 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41775
41875
  message: requiredRule.message || ''
41776
41876
  });
41777
41877
  }
41778
- return showHideInput(input, values, field.name, inputValues, setValues, `${formId}[${field.name}].${inputId}`) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41878
+ return showHideInput(input, values, field.name, inputValues, setValues, "".concat(formId, "[").concat(field.name, "].").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41779
41879
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
41780
- className: form.repeatable ? `inputs` : "",
41880
+ className: form.repeatable ? "inputs" : "",
41781
41881
  children: [getSubtitles(subtitles, input.position, values, field.name, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines(input.type, i, input, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41782
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41783
- ...field,
41784
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
41785
- ...(['total100', 'group'].includes(input.type) ? {} : {
41786
- name: [field.name, inputId],
41787
- fieldKey: [field.fieldKey, inputId],
41788
- initialValue: inputData.value
41789
- }),
41790
- ...(['upload'].includes(input.type) ? {
41791
- valuePropName: "fileList",
41792
- getValueFromEvent: e => {
41793
- if (Array.isArray(e)) {
41794
- return e;
41795
- }
41796
- return e && e.fileList && e.fileList.map(f => {
41797
- if (f.response) {
41798
- return f.response;
41799
- }
41800
- return f;
41801
- });
41882
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
41883
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
41884
+ }, ['total100', 'group'].includes(input.type) ? {} : {
41885
+ name: [field.name, inputId],
41886
+ fieldKey: [field.fieldKey, inputId],
41887
+ initialValue: inputData.value
41888
+ }), ['upload'].includes(input.type) ? {
41889
+ valuePropName: "fileList",
41890
+ getValueFromEvent: e => {
41891
+ if (Array.isArray(e)) {
41892
+ return e;
41802
41893
  }
41803
- } : {}),
41894
+ return e && e.fileList && e.fileList.map(f => {
41895
+ if (f.response) {
41896
+ return f.response;
41897
+ }
41898
+ return f;
41899
+ });
41900
+ }
41901
+ } : {}), {}, {
41804
41902
  style: input.showOnView === false ? {
41805
41903
  display: 'none'
41806
- } : {},
41807
- ...(['switch'].includes(input.type) ? {
41808
- labelCol: {
41809
- span: 20
41810
- },
41811
- style: {
41812
- ...(input.showOnView === false ? {
41813
- display: 'none'
41814
- } : {}),
41815
- flexDirection: 'row',
41816
- justifyContent: 'space-between'
41817
- }
41818
- } : {}),
41904
+ } : {}
41905
+ }, ['switch'].includes(input.type) ? {
41906
+ labelCol: {
41907
+ span: 20
41908
+ },
41909
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
41910
+ display: 'none'
41911
+ } : {}), {}, {
41912
+ flexDirection: 'row',
41913
+ justifyContent: 'space-between'
41914
+ })
41915
+ } : {}), {}, {
41819
41916
  label: getInputLabel(input, values),
41820
41917
  rules: rules,
41821
- className: input.comment ? `with-comment i-${input.type}` : `i-${input.type}`,
41918
+ className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
41822
41919
  extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41823
41920
  disabled: inputData.props.disabled,
41824
41921
  type: "link",
41825
41922
  onClick: () => {
41826
41923
  const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
41827
- inputValues[`${inputData.inputName}Comment`] = !inputData.commentValue ? '' : undefined;
41924
+ inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
41828
41925
  if (Array.isArray(values[formId])) {
41829
41926
  values[formId][field.name] = inputValues;
41830
41927
  } else {
41831
41928
  values[formId] = inputValues;
41832
41929
  }
41833
- setValues({
41834
- ...values
41835
- });
41930
+ setValues(_objectSpread2({}, values));
41836
41931
  },
41837
41932
  children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
41838
41933
  }) : null,
@@ -41849,9 +41944,9 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41849
41944
  getAppHeader,
41850
41945
  getApiBaseUrl
41851
41946
  }) : console.log(input)
41852
- }), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41853
- name: [field.name, `${inputData.inputName}Comment`],
41854
- fieldKey: [field.fieldKey, `${inputData.inputName}Comment`],
41947
+ })), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41948
+ name: [field.name, "".concat(inputData.inputName, "Comment")],
41949
+ fieldKey: [field.fieldKey, "".concat(inputData.inputName, "Comment")],
41855
41950
  initialValue: inputData.commentValue,
41856
41951
  hidden: !inputData.commentValue,
41857
41952
  children: inputTypeComponent.comment(inputData, {
@@ -41865,10 +41960,10 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41865
41960
  }) : null]
41866
41961
  })]
41867
41962
  }, ii)
41868
- }, `${i}${ii}`) : null;
41963
+ }, "".concat(i).concat(ii)) : null;
41869
41964
  })
41870
41965
  })]
41871
- }, `${formId}-${field.name}`)), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
41966
+ }, "".concat(formId, "-").concat(field.name))), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
41872
41967
  type: "dashed",
41873
41968
  style: {
41874
41969
  margin: '10px 0px 30px',
@@ -41897,7 +41992,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41897
41992
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
41898
41993
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41899
41994
  children: [hasLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41900
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
41995
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
41901
41996
  children: label
41902
41997
  }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
41903
41998
  className: hasLabel ? "mb-4" : "",
@@ -41906,8 +42001,8 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41906
42001
  const inputId = input.dataId || inp;
41907
42002
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
41908
42003
  const value = inputValues[inputId];
41909
- const commentValue = inputValues[`${inputId}Comment`];
41910
- const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
42004
+ const commentValue = inputValues["".concat(inputId, "Comment")];
42005
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
41911
42006
  const subtitles = form.subtitles || null;
41912
42007
  inputData.repeatIndex = undefined;
41913
42008
  inputData.inputName = inputId;
@@ -41928,62 +42023,58 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41928
42023
  message: requiredRule.message || ''
41929
42024
  });
41930
42025
  }
41931
- return showHideInput(input, values, undefined, inputValues, setValues, `${formId}.${inputId}`) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
42026
+ return showHideInput(input, values, undefined, inputValues, setValues, "".concat(formId, ".").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41932
42027
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
41933
42028
  children: [getSubtitles(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines(input.type, i, input, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41934
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41935
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
41936
- ...(['total100', 'group'].includes(input.type) ? {} : {
41937
- name: [formId, inputId],
41938
- fieldKey: [formId, inputId],
41939
- initialValue: inputData.value
41940
- }),
41941
- ...(['upload'].includes(input.type) ? {
41942
- valuePropName: "fileList",
41943
- getValueFromEvent: e => {
41944
- if (Array.isArray(e)) {
41945
- return e;
41946
- }
41947
- return e && e.fileList && e.fileList.map(f => {
41948
- if (f.response) {
41949
- return f.response;
41950
- }
41951
- return f;
41952
- });
42029
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
42030
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
42031
+ }, ['total100', 'group'].includes(input.type) ? {} : {
42032
+ name: [formId, inputId],
42033
+ fieldKey: [formId, inputId],
42034
+ initialValue: inputData.value
42035
+ }), ['upload'].includes(input.type) ? {
42036
+ valuePropName: "fileList",
42037
+ getValueFromEvent: e => {
42038
+ if (Array.isArray(e)) {
42039
+ return e;
41953
42040
  }
41954
- } : {}),
42041
+ return e && e.fileList && e.fileList.map(f => {
42042
+ if (f.response) {
42043
+ return f.response;
42044
+ }
42045
+ return f;
42046
+ });
42047
+ }
42048
+ } : {}), {}, {
41955
42049
  style: input.showOnView === false ? {
41956
42050
  display: 'none'
41957
- } : {},
41958
- ...(['switch'].includes(input.type) ? {
41959
- labelCol: {
41960
- span: 20
41961
- },
41962
- style: {
41963
- ...(input.showOnView === false ? {
41964
- display: 'none'
41965
- } : {}),
41966
- flexDirection: 'row',
41967
- justifyContent: 'space-between'
41968
- }
41969
- } : {}),
42051
+ } : {}
42052
+ }, ['switch'].includes(input.type) ? {
42053
+ labelCol: {
42054
+ span: 20
42055
+ },
42056
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
42057
+ display: 'none'
42058
+ } : {}), {}, {
42059
+ flexDirection: 'row',
42060
+ justifyContent: 'space-between'
42061
+ })
42062
+ } : {}), {}, {
41970
42063
  label: getInputLabel(input, values),
41971
42064
  rules: rules,
41972
- className: input.comment ? `with-comment i-${input.type}` : `i-${input.type}`,
42065
+ className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
41973
42066
  extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41974
42067
  disabled: inputData.props.disabled,
41975
42068
  type: "link",
41976
42069
  onClick: () => {
41977
42070
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
41978
- inputValues[`${inputData.inputName}Comment`] = !inputData.commentValue ? '' : undefined;
42071
+ inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
41979
42072
  if (Array.isArray(values[formId])) {
41980
42073
  values[formId] = inputValues;
41981
42074
  } else {
41982
42075
  values[formId] = inputValues;
41983
42076
  }
41984
- setValues({
41985
- ...values
41986
- });
42077
+ setValues(_objectSpread2({}, values));
41987
42078
  },
41988
42079
  children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
41989
42080
  }) : null,
@@ -41998,9 +42089,9 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41998
42089
  getAppHeader,
41999
42090
  getApiBaseUrl
42000
42091
  }) : console.log(input)
42001
- }), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
42002
- name: [formId, `${inputData.inputName}Comment`],
42003
- fieldKey: [formId, `${inputData.inputName}Comment`],
42092
+ })), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
42093
+ name: [formId, "".concat(inputData.inputName, "Comment")],
42094
+ fieldKey: [formId, "".concat(inputData.inputName, "Comment")],
42004
42095
  initialValue: inputData.commentValue,
42005
42096
  hidden: !inputData.commentValue,
42006
42097
  children: inputTypeComponent.comment(inputData, {
@@ -42014,7 +42105,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
42014
42105
  }) : null]
42015
42106
  })]
42016
42107
  }, ii)
42017
- }, `${i}${ii}`) : null;
42108
+ }, "".concat(i).concat(ii)) : null;
42018
42109
  })
42019
42110
  })]
42020
42111
  });