datastake-daf 0.6.818 → 0.6.819

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.
@@ -4817,7 +4817,7 @@ const config$2 = {
4817
4817
  AddDocument: config$3
4818
4818
  };
4819
4819
 
4820
- const _excluded$H = ["width", "height", "size", "name", "fill"];
4820
+ const _excluded$G = ["width", "height", "size", "name", "fill"];
4821
4821
  const CustomIcon = _ref => {
4822
4822
  let {
4823
4823
  width = 14,
@@ -4826,7 +4826,7 @@ const CustomIcon = _ref => {
4826
4826
  name = "",
4827
4827
  fill = "none"
4828
4828
  } = _ref,
4829
- props = _objectWithoutProperties(_ref, _excluded$H);
4829
+ props = _objectWithoutProperties(_ref, _excluded$G);
4830
4830
  const conf = config$2[name];
4831
4831
  if (conf) {
4832
4832
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5115,7 +5115,7 @@ createCommonjsModule(function (module, exports) {
5115
5115
  !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])+"]"}}}));
5116
5116
  });
5117
5117
 
5118
- const _excluded$G = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5118
+ const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5119
5119
  dayjs__default["default"].extend(customParseFormat);
5120
5120
  dayjs__default["default"].extend(utc);
5121
5121
  dayjs__default["default"].extend(utc);
@@ -5491,7 +5491,7 @@ const filterCreateData = data => {
5491
5491
  createdAt,
5492
5492
  updatedAt
5493
5493
  } = data,
5494
- rest = _objectWithoutProperties(data, _excluded$G);
5494
+ rest = _objectWithoutProperties(data, _excluded$F);
5495
5495
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5496
5496
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5497
5497
  meta: _meta
@@ -6023,7 +6023,7 @@ SelectFilters.propTypes = {
6023
6023
  apiUrl: PropTypes__default["default"].string
6024
6024
  };
6025
6025
 
6026
- const _excluded$F = ["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"];
6026
+ const _excluded$E = ["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"];
6027
6027
  function DAFTable(_ref) {
6028
6028
  let {
6029
6029
  columns = [],
@@ -6054,7 +6054,7 @@ function DAFTable(_ref) {
6054
6054
  app,
6055
6055
  doEmptyRows
6056
6056
  } = _ref,
6057
- rest = _objectWithoutProperties(_ref, _excluded$F);
6057
+ rest = _objectWithoutProperties(_ref, _excluded$E);
6058
6058
  const source = React.useMemo(() => {
6059
6059
  if (data && Array.isArray(data)) {
6060
6060
  return data;
@@ -6879,7 +6879,7 @@ function ComponentWithFocus(_ref) {
6879
6879
  }
6880
6880
 
6881
6881
  var _templateObject$h;
6882
- const _excluded$E = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6882
+ const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6883
6883
  function StickyTable(_ref) {
6884
6884
  let {
6885
6885
  size = "small",
@@ -6890,7 +6890,7 @@ function StickyTable(_ref) {
6890
6890
  pagination = false,
6891
6891
  doEmptyRows = true
6892
6892
  } = _ref,
6893
- props = _objectWithoutProperties(_ref, _excluded$E);
6893
+ props = _objectWithoutProperties(_ref, _excluded$D);
6894
6894
  const data = React__default["default"].useMemo(() => {
6895
6895
  if (!doEmptyRows) {
6896
6896
  return dataSource;
@@ -7418,7 +7418,7 @@ const BTN_SIZE = {
7418
7418
  LG: 'large'
7419
7419
  };
7420
7420
 
7421
- const _excluded$D = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7421
+ const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7422
7422
  function DafButton(_ref) {
7423
7423
  let {
7424
7424
  content = '',
@@ -7432,7 +7432,7 @@ function DafButton(_ref) {
7432
7432
  style = {},
7433
7433
  className = ''
7434
7434
  } = _ref,
7435
- restProps = _objectWithoutProperties(_ref, _excluded$D);
7435
+ restProps = _objectWithoutProperties(_ref, _excluded$C);
7436
7436
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7437
7437
  icon: icon,
7438
7438
  type: type,
@@ -7551,12 +7551,12 @@ const Style$R = styled__default["default"].div`
7551
7551
  }
7552
7552
  `;
7553
7553
 
7554
- const _excluded$C = ["children"];
7554
+ const _excluded$B = ["children"];
7555
7555
  const BorderedButton = _ref => {
7556
7556
  let {
7557
7557
  children
7558
7558
  } = _ref,
7559
- props = _objectWithoutProperties(_ref, _excluded$C);
7559
+ props = _objectWithoutProperties(_ref, _excluded$B);
7560
7560
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7561
7561
  className: "d-btn-cont",
7562
7562
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7696,12 +7696,12 @@ Badge.propTypes = {
7696
7696
  props: PropTypes__default["default"].object
7697
7697
  };
7698
7698
 
7699
- const _excluded$B = ["icon"];
7699
+ const _excluded$A = ["icon"];
7700
7700
  function GetIcon(_ref) {
7701
7701
  let {
7702
7702
  icon
7703
7703
  } = _ref,
7704
- props = _objectWithoutProperties(_ref, _excluded$B);
7704
+ props = _objectWithoutProperties(_ref, _excluded$A);
7705
7705
  let Icon = Icons__namespace.CloseOutlined;
7706
7706
  if (Icons__namespace[icon]) {
7707
7707
  Icon = Icons__namespace[icon];
@@ -8031,7 +8031,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8031
8031
  }
8032
8032
  `;
8033
8033
 
8034
- const _excluded$A = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8034
+ const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8035
8035
  const {
8036
8036
  useToken: useToken$n
8037
8037
  } = antd.theme;
@@ -8124,7 +8124,7 @@ function Multiselect(_ref) {
8124
8124
  isSingle = false,
8125
8125
  selectionType = SELECTION_TYPES.DEFAULT
8126
8126
  } = _ref,
8127
- restProps = _objectWithoutProperties(_ref, _excluded$A);
8127
+ restProps = _objectWithoutProperties(_ref, _excluded$z);
8128
8128
  const {
8129
8129
  token
8130
8130
  } = useToken$n();
@@ -8844,7 +8844,7 @@ DAFHeader.propTypes = {
8844
8844
  filtersConfig: PropTypes__default["default"].any
8845
8845
  };
8846
8846
 
8847
- const _excluded$z = ["tabs", "onChange", "value", "className"];
8847
+ const _excluded$y = ["tabs", "onChange", "value", "className"];
8848
8848
  function TabsHeader(_ref) {
8849
8849
  let {
8850
8850
  tabs = [],
@@ -8852,7 +8852,7 @@ function TabsHeader(_ref) {
8852
8852
  value = '',
8853
8853
  className = 'mt-2'
8854
8854
  } = _ref,
8855
- rest = _objectWithoutProperties(_ref, _excluded$z);
8855
+ rest = _objectWithoutProperties(_ref, _excluded$y);
8856
8856
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8857
8857
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8858
8858
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8949,7 +8949,7 @@ DrawerHeader.propTypes = {
8949
8949
  tabsConfig: PropTypes__default["default"].any
8950
8950
  };
8951
8951
 
8952
- const _excluded$y = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8952
+ const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8953
8953
  const useFooter = _ref => {
8954
8954
  let {
8955
8955
  leftContent,
@@ -8984,7 +8984,7 @@ const useFooter = _ref => {
8984
8984
  style = {},
8985
8985
  className = ""
8986
8986
  } = button,
8987
- restProps = _objectWithoutProperties(button, _excluded$y);
8987
+ restProps = _objectWithoutProperties(button, _excluded$x);
8988
8988
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8989
8989
  content: label,
8990
8990
  type: type,
@@ -11865,7 +11865,7 @@ Widget.propTypes = {
11865
11865
  };
11866
11866
  Widget.displayName = 'Widget';
11867
11867
 
11868
- const _excluded$x = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11868
+ const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11869
11869
  function ImageWidget(_ref) {
11870
11870
  let {
11871
11871
  loading = false,
@@ -11876,7 +11876,7 @@ function ImageWidget(_ref) {
11876
11876
  noDescriptionText,
11877
11877
  isPdf = false
11878
11878
  } = _ref,
11879
- props = _objectWithoutProperties(_ref, _excluded$x);
11879
+ props = _objectWithoutProperties(_ref, _excluded$w);
11880
11880
  const expandable = isPdf ? false : props.expandable;
11881
11881
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11882
11882
  loading: loading,
@@ -11936,7 +11936,7 @@ function ImageWidget(_ref) {
11936
11936
  ImageWidget.displayName = 'ImageWidget';
11937
11937
 
11938
11938
  var _templateObject$e;
11939
- const _excluded$w = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11939
+ const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11940
11940
  function FlowWidget(_ref) {
11941
11941
  let {
11942
11942
  title,
@@ -11948,7 +11948,7 @@ function FlowWidget(_ref) {
11948
11948
  className,
11949
11949
  direction = "horizontal"
11950
11950
  } = _ref,
11951
- rest = _objectWithoutProperties(_ref, _excluded$w);
11951
+ rest = _objectWithoutProperties(_ref, _excluded$v);
11952
11952
  const [activeTab, setActiveTab] = React.useState();
11953
11953
  React.useEffect(() => {
11954
11954
  if (defaultActiveTab) {
@@ -15679,7 +15679,7 @@ Map$3.propTypes = {
15679
15679
  link: PropTypes__default["default"].any
15680
15680
  };
15681
15681
 
15682
- const _excluded$v = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15682
+ const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15683
15683
  function InExpandableWidgetMap(_ref) {
15684
15684
  let {
15685
15685
  isExpanded,
@@ -15693,7 +15693,7 @@ function InExpandableWidgetMap(_ref) {
15693
15693
  height,
15694
15694
  widgetConfig
15695
15695
  } = _ref,
15696
- rest = _objectWithoutProperties(_ref, _excluded$v);
15696
+ rest = _objectWithoutProperties(_ref, _excluded$u);
15697
15697
  const [mapKey, setMapKey] = React.useState(0);
15698
15698
  const [isMapReady, setIsMapReady] = React.useState(false);
15699
15699
  React.useEffect(() => {
@@ -17893,14 +17893,14 @@ const MapConfig = ({
17893
17893
  });
17894
17894
  };
17895
17895
 
17896
- const _excluded$u = ["config", "title", "loading"];
17896
+ const _excluded$t = ["config", "title", "loading"];
17897
17897
  const Details = _ref => {
17898
17898
  let {
17899
17899
  config = [],
17900
17900
  title,
17901
17901
  loading = false
17902
17902
  } = _ref,
17903
- rest = _objectWithoutProperties(_ref, _excluded$u);
17903
+ rest = _objectWithoutProperties(_ref, _excluded$t);
17904
17904
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17905
17905
  className: "with-border-header h-w-btn-header card",
17906
17906
  loading: loading,
@@ -17916,14 +17916,14 @@ const Details = _ref => {
17916
17916
  }));
17917
17917
  };
17918
17918
 
17919
- const _excluded$t = ["config", "title", "loading"];
17919
+ const _excluded$s = ["config", "title", "loading"];
17920
17920
  const KeyIndicatorsDetails = _ref => {
17921
17921
  let {
17922
17922
  config,
17923
17923
  title,
17924
17924
  loading = false
17925
17925
  } = _ref,
17926
- rest = _objectWithoutProperties(_ref, _excluded$t);
17926
+ rest = _objectWithoutProperties(_ref, _excluded$s);
17927
17927
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17928
17928
  className: "with-border-header h-w-btn-header",
17929
17929
  title: title,
@@ -17953,7 +17953,7 @@ const Style$G = styled__default["default"].div`
17953
17953
  }
17954
17954
  `;
17955
17955
 
17956
- const _excluded$s = ["children", "config", "detailsTitle", "firstColumnWidth"];
17956
+ const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
17957
17957
  const DetailsSection = _ref => {
17958
17958
  let {
17959
17959
  children,
@@ -17961,7 +17961,7 @@ const DetailsSection = _ref => {
17961
17961
  detailsTitle,
17962
17962
  firstColumnWidth = "250px"
17963
17963
  } = _ref,
17964
- rest = _objectWithoutProperties(_ref, _excluded$s);
17964
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17965
17965
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17966
17966
  firstColumnWidth: firstColumnWidth,
17967
17967
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18137,14 +18137,14 @@ const getGoalConfig = () => {
18137
18137
  };
18138
18138
 
18139
18139
  var _templateObject$c;
18140
- const _excluded$r = ["title", "activeSdgGoals", "t"];
18140
+ const _excluded$q = ["title", "activeSdgGoals", "t"];
18141
18141
  function SDGWidget(_ref) {
18142
18142
  let {
18143
18143
  title = "Sustainable Development Goals",
18144
18144
  activeSdgGoals = [],
18145
18145
  t = key => key
18146
18146
  } = _ref,
18147
- props = _objectWithoutProperties(_ref, _excluded$r);
18147
+ props = _objectWithoutProperties(_ref, _excluded$q);
18148
18148
  const sdgConfig = getGoalConfig();
18149
18149
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18150
18150
  title: title,
@@ -18442,7 +18442,7 @@ function SdgList({
18442
18442
  });
18443
18443
  }
18444
18444
 
18445
- const _excluded$q = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18445
+ const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18446
18446
  const {
18447
18447
  Meta
18448
18448
  } = antd.Card;
@@ -18462,7 +18462,7 @@ function ProjectWidget(_ref) {
18462
18462
  hideSDGList = false,
18463
18463
  t = x => x
18464
18464
  } = _ref,
18465
- props = _objectWithoutProperties(_ref, _excluded$q);
18465
+ props = _objectWithoutProperties(_ref, _excluded$p);
18466
18466
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18467
18467
  const {
18468
18468
  token
@@ -18734,13 +18734,13 @@ const WidgetCard = _ref => {
18734
18734
  });
18735
18735
  };
18736
18736
 
18737
- const _excluded$p = ["title", "children"];
18737
+ const _excluded$o = ["title", "children"];
18738
18738
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18739
18739
  let {
18740
18740
  title,
18741
18741
  children
18742
18742
  } = _ref,
18743
- rest = _objectWithoutProperties(_ref, _excluded$p);
18743
+ rest = _objectWithoutProperties(_ref, _excluded$o);
18744
18744
  /**
18745
18745
  * Handles carousel slide change events
18746
18746
  * @param {number} currentSlide - The index of the current slide after change
@@ -18904,7 +18904,7 @@ const EmptyStateContainer = styled__default["default"].div`
18904
18904
  }
18905
18905
  `;
18906
18906
 
18907
- const _excluded$o = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18907
+ const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18908
18908
  function ImageCarousel(_ref) {
18909
18909
  let {
18910
18910
  title,
@@ -18919,7 +18919,7 @@ function ImageCarousel(_ref) {
18919
18919
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18920
18920
  emptyText = "No Image"
18921
18921
  } = _ref,
18922
- rest = _objectWithoutProperties(_ref, _excluded$o);
18922
+ rest = _objectWithoutProperties(_ref, _excluded$n);
18923
18923
  const [previewVisible, setPreviewVisible] = React.useState(false);
18924
18924
  const [current, setCurrent] = React.useState(0);
18925
18925
  const carouselRef = React.useRef(null);
@@ -19288,7 +19288,7 @@ const getVegetationConfig = () => {
19288
19288
  };
19289
19289
 
19290
19290
  var _templateObject$a, _templateObject2$3;
19291
- const _excluded$n = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19291
+ const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19292
19292
  function VegetationWidget(_ref) {
19293
19293
  let {
19294
19294
  title = "Vegetation Health",
@@ -19300,7 +19300,7 @@ function VegetationWidget(_ref) {
19300
19300
  growthObservations = [],
19301
19301
  t = key => key
19302
19302
  } = _ref,
19303
- props = _objectWithoutProperties(_ref, _excluded$n);
19303
+ props = _objectWithoutProperties(_ref, _excluded$m);
19304
19304
  let vegetationConfig = getVegetationConfig();
19305
19305
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19306
19306
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19416,7 +19416,7 @@ const getFaunaConfig = () => {
19416
19416
  };
19417
19417
 
19418
19418
  var _templateObject$9, _templateObject2$2;
19419
- const _excluded$m = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19419
+ const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19420
19420
  function FaunaWidget(_ref) {
19421
19421
  let {
19422
19422
  title = "Observed Fauna",
@@ -19427,7 +19427,7 @@ function FaunaWidget(_ref) {
19427
19427
  itemHeight = 100,
19428
19428
  t = key => key
19429
19429
  } = _ref,
19430
- props = _objectWithoutProperties(_ref, _excluded$m);
19430
+ props = _objectWithoutProperties(_ref, _excluded$l);
19431
19431
  let faunaConfig = getFaunaConfig();
19432
19432
 
19433
19433
  // Filter to show only specific keys if filterKeys is provided
@@ -19492,7 +19492,7 @@ const getInvasiveSpeciesConfig = () => {
19492
19492
  };
19493
19493
 
19494
19494
  var _templateObject$8, _templateObject2$1;
19495
- const _excluded$l = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19495
+ const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19496
19496
  function InvasiveSpeciesWidget(_ref) {
19497
19497
  let {
19498
19498
  title = "Invasive Species",
@@ -19504,7 +19504,7 @@ function InvasiveSpeciesWidget(_ref) {
19504
19504
  itemHeight = 100,
19505
19505
  t = key => key
19506
19506
  } = _ref,
19507
- props = _objectWithoutProperties(_ref, _excluded$l);
19507
+ props = _objectWithoutProperties(_ref, _excluded$k);
19508
19508
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19509
19509
 
19510
19510
  // Filter to show only specific keys if filterKeys is provided
@@ -24927,8 +24927,8 @@ const RepeatableModals = ({
24927
24927
  }) : null;
24928
24928
  };
24929
24929
 
24930
- const _excluded$k = ["viewGroup"],
24931
- _excluded2$2 = ["label", "icon", "position"];
24930
+ const _excluded$j = ["viewGroup"],
24931
+ _excluded2$1 = ["label", "icon", "position"];
24932
24932
  const Content$1 = _ref => {
24933
24933
  let {
24934
24934
  style = {},
@@ -24999,7 +24999,7 @@ const Content$1 = _ref => {
24999
24999
  if (groups[gKey].viewGroup === key) {
25000
25000
  // eslint-disable-next-line no-unused-vars
25001
25001
  const _groups$gKey = groups[gKey],
25002
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
25002
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
25003
25003
  items[gKey] = gCfg;
25004
25004
  }
25005
25005
  return items;
@@ -25227,7 +25227,7 @@ const Content$1 = _ref => {
25227
25227
  showIcon: true
25228
25228
  });
25229
25229
  }
25230
- let groups = _objectWithoutProperties(f, _excluded2$2);
25230
+ let groups = _objectWithoutProperties(f, _excluded2$1);
25231
25231
  groups = Object.keys(groups).reduce((items, key) => {
25232
25232
  var _groups$key2;
25233
25233
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -25279,7 +25279,7 @@ const Content$1 = _ref => {
25279
25279
  });
25280
25280
  };
25281
25281
 
25282
- const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25282
+ const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25283
25283
  function Modal(_ref) {
25284
25284
  let {
25285
25285
  t = text => text,
@@ -25295,7 +25295,7 @@ function Modal(_ref) {
25295
25295
  disabled = false,
25296
25296
  withModalFormWrapper = true
25297
25297
  } = _ref,
25298
- props = _objectWithoutProperties(_ref, _excluded$j);
25298
+ props = _objectWithoutProperties(_ref, _excluded$i);
25299
25299
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25300
25300
  width: 650,
25301
25301
  footer: null,
@@ -25869,6 +25869,7 @@ const getSourcesType = subject => {
25869
25869
  locations: "location",
25870
25870
  location: "location",
25871
25871
  "production-sites": "location",
25872
+ scl: "location",
25872
25873
  stakeholders: "stakeholder",
25873
25874
  stakeholder: "stakeholder",
25874
25875
  workers: "stakeholder",
@@ -25927,9 +25928,6 @@ const Records = _ref => {
25927
25928
  source: selectedSource
25928
25929
  }
25929
25930
  });
25930
- console.log({
25931
- data
25932
- });
25933
25931
  setVersions(data);
25934
25932
  } catch (error) {
25935
25933
  console.error('Error fetching versions:', error);
@@ -35944,13 +35942,11 @@ const beforeUpload = allowedExtensions => file => {
35944
35942
  };
35945
35943
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35946
35944
 
35947
- const _excluded$i = ["placeholder"],
35948
- _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35945
+ /* eslint-disable no-case-declarations */
35949
35946
  dayjs__default["default"].extend(utc);
35950
35947
  dayjs__default["default"].extend(timezone);
35951
35948
  dayjs__default["default"].tz.setDefault("UTC");
35952
- const getDefaultInputValue = function () {
35953
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35949
+ const getDefaultInputValue = (input = {}) => {
35954
35950
  let value = undefined;
35955
35951
  if (input.type === "multiselect") {
35956
35952
  value = [];
@@ -35968,30 +35964,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35968
35964
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35969
35965
  return isShown;
35970
35966
  };
35971
- const renderDataLinkGroup = _ref2 => {
35972
- var _input$meta, _formsValue$meta, _input$meta2;
35973
- let {
35974
- input,
35975
- groupFormId,
35976
- name,
35977
- formsValue,
35978
- form,
35979
- onValuesChange,
35980
- setValues,
35981
- changeLinking,
35982
- isHighlighted
35983
- } = _ref2;
35984
- const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35985
- var _input$inputs$k;
35986
- 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";
35987
- });
35988
- const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35989
- const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35990
- all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35967
+ const renderDataLinkGroup = ({
35968
+ input,
35969
+ groupFormId,
35970
+ name,
35971
+ formsValue,
35972
+ form,
35973
+ onValuesChange,
35974
+ setValues,
35975
+ changeLinking,
35976
+ isHighlighted
35977
+ }) => {
35978
+ const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35979
+ const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35980
+ const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35981
+ all[key] = input?.inputs[key];
35991
35982
  return all;
35992
35983
  }, {});
35993
- const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
35994
- 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));
35984
+ const isSingle = input?.meta?.maxRepeat === 1;
35985
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35986
+ ...(formsValue[groupFormId] || {})[name]
35987
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35988
+ ...v
35989
+ })) : isSingle ? formsValue[name] ? [{
35990
+ ...formsValue[name]
35991
+ }] : [] : getArray(formsValue[name] || []).map(v => ({
35992
+ ...v
35993
+ }));
35995
35994
  const onUpdate = (val, i) => {
35996
35995
  const _val = isSingle ? {
35997
35996
  [name]: val
@@ -35999,20 +35998,31 @@ const renderDataLinkGroup = _ref2 => {
35999
35998
  [name]: formData.map((d, j) => i === j ? val : d)
36000
35999
  };
36001
36000
  if (groupFormId) {
36002
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36003
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36004
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36001
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36002
+ const _newData = {
36003
+ ..._defaultData,
36004
+ ..._val
36005
+ };
36006
+ onValuesChange(_newData, {
36007
+ ...formsValue,
36005
36008
  [groupFormId]: _newData
36006
- }));
36007
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36008
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36009
+ });
36010
+ form?.setFieldValue(groupFormId, _newData);
36011
+ setValues({
36012
+ ...formsValue,
36009
36013
  [groupFormId]: _newData
36010
- }));
36014
+ });
36011
36015
  return;
36012
36016
  }
36013
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36014
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36015
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36017
+ onValuesChange(_val, {
36018
+ ...formsValue,
36019
+ ..._val
36020
+ });
36021
+ form?.setFieldValue(name, _val[name]);
36022
+ setValues({
36023
+ ...formsValue,
36024
+ ..._val
36025
+ });
36016
36026
  };
36017
36027
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
36018
36028
  form: input,
@@ -36023,79 +36033,102 @@ const renderDataLinkGroup = _ref2 => {
36023
36033
  isHighlighted: isHighlighted,
36024
36034
  dataLinkInput: dataLinkInput,
36025
36035
  formsValue: formsValue,
36026
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36036
+ values: groupFormId ? {
36037
+ ...(formsValue[groupFormId] || {}),
36027
36038
  meta: {
36028
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
36039
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36029
36040
  }
36030
- }) : formsValue,
36041
+ } : formsValue,
36031
36042
  name: name,
36032
36043
  groupFormId: groupFormId,
36033
- maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
36034
- remove: _ref3 => {
36035
- let {
36036
- key
36037
- } = _ref3;
36044
+ maxRepeat: input?.meta?.maxRepeat,
36045
+ remove: ({
36046
+ key
36047
+ }) => {
36038
36048
  const _val = isSingle ? {
36039
36049
  [name]: null
36040
36050
  } : {
36041
36051
  [name]: formData.filter((v, j) => j !== key)
36042
36052
  };
36043
36053
  if (groupFormId) {
36044
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36045
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36046
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36054
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36055
+ const _newData = {
36056
+ ..._defaultData,
36057
+ ..._val
36058
+ };
36059
+ onValuesChange(_newData, {
36060
+ ...formsValue,
36047
36061
  [groupFormId]: _newData
36048
- }));
36049
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36050
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36062
+ });
36063
+ form?.setFieldValue(groupFormId, _newData);
36064
+ setValues({
36065
+ ...formsValue,
36051
36066
  [groupFormId]: _newData
36052
- }));
36067
+ });
36053
36068
  return;
36054
36069
  }
36055
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36056
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36057
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36070
+ onValuesChange(_val, {
36071
+ ...formsValue,
36072
+ ..._val
36073
+ });
36074
+ form?.setFieldValue(name, _val[name]);
36075
+ setValues({
36076
+ ...formsValue,
36077
+ ..._val
36078
+ });
36058
36079
  },
36059
36080
  add: val => {
36060
36081
  const _val = isSingle ? {
36061
36082
  [name]: val
36062
36083
  } : {
36063
- [name]: [...formData, _objectSpread2({}, val)]
36084
+ [name]: [...formData, {
36085
+ ...val
36086
+ }]
36064
36087
  };
36065
36088
  if (groupFormId) {
36066
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36067
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36068
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36069
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36089
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36090
+ const _newData = {
36091
+ ..._defaultData,
36092
+ ..._val
36093
+ };
36094
+ form?.setFieldValue(groupFormId, _newData);
36095
+ onValuesChange(_newData, {
36096
+ ...formsValue,
36070
36097
  [groupFormId]: _newData
36071
- }));
36072
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36098
+ });
36099
+ setValues({
36100
+ ...formsValue,
36073
36101
  [groupFormId]: _newData
36074
- }));
36102
+ });
36075
36103
  return;
36076
36104
  }
36077
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36078
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36079
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36105
+ form?.setFieldValue(name, _val[name]);
36106
+ onValuesChange(_val, {
36107
+ ...formsValue,
36108
+ ..._val
36109
+ });
36110
+ setValues({
36111
+ ...formsValue,
36112
+ ..._val
36113
+ });
36080
36114
  },
36081
36115
  k: name,
36082
36116
  formData: formData
36083
36117
  });
36084
36118
  };
36085
36119
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
36086
- var _input$meta3, _data$meta;
36087
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
36120
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
36088
36121
  return false;
36089
36122
  }
36090
- if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
36091
- var _input$meta4;
36092
- return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
36123
+ if (typeof input?.meta?.excludeFromEdit === "boolean") {
36124
+ return !input?.meta?.excludeFromEdit;
36093
36125
  }
36094
- const formsValue = _objectSpread2({}, data);
36095
- Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
36096
- var _data$meta2;
36097
- const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
36098
- if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
36126
+ const formsValue = {
36127
+ ...data
36128
+ };
36129
+ Object.keys(data?.meta?.inputs || {}).forEach(key => {
36130
+ const input = data?.meta?.inputs[key];
36131
+ if (input?.notApplicable || input?.notAvailable) {
36099
36132
  formsValue[key] = undefined;
36100
36133
  delete formsValue[key];
36101
36134
  }
@@ -36154,35 +36187,35 @@ function getInputHeadLines$1(type, i, input, values) {
36154
36187
  switch (type) {
36155
36188
  case "h2":
36156
36189
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36157
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36190
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36158
36191
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36159
36192
  children: getInputLabel$1(input, values)
36160
36193
  })
36161
36194
  });
36162
36195
  case "h3":
36163
36196
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36164
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36197
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36165
36198
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36166
36199
  children: getInputLabel$1(input, values)
36167
36200
  })
36168
36201
  });
36169
36202
  case "h4":
36170
36203
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36171
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36204
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36172
36205
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36173
36206
  children: getInputLabel$1(input, values)
36174
36207
  })
36175
36208
  });
36176
36209
  case "h5":
36177
36210
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36178
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36211
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36179
36212
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36180
36213
  children: getInputLabel$1(input, values)
36181
36214
  })
36182
36215
  });
36183
36216
  case "h6":
36184
36217
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36185
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
36218
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
36186
36219
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
36187
36220
  children: getInputLabel$1(input, values)
36188
36221
  })
@@ -36191,16 +36224,15 @@ function getInputHeadLines$1(type, i, input, values) {
36191
36224
  return null;
36192
36225
  }
36193
36226
  }
36194
- function getInputProp(prop) {
36195
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36196
- let scope = arguments.length > 2 ? arguments[2] : undefined;
36227
+ function getInputProp(prop, formsValue = {}, scope) {
36197
36228
  if (prop && typeof prop === "object") {
36198
36229
  const validations = Object.keys(prop);
36199
36230
  const key = validations.find(v => {
36200
36231
  let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
36201
- const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36232
+ const value = dot__default["default"].pick(path, {
36233
+ ...formsValue,
36202
36234
  scope
36203
- }));
36235
+ });
36204
36236
  return _checkValue(wantedValue, match, value);
36205
36237
  });
36206
36238
  const label = key ? prop[key] : prop[validations[0]];
@@ -36209,33 +36241,29 @@ function getInputProp(prop) {
36209
36241
  return prop;
36210
36242
  }
36211
36243
  }
36212
- function getInputLabel$1(input) {
36213
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36214
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
36244
+ function getInputLabel$1(input, formsValue = {}, asText = false) {
36215
36245
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
36216
36246
  input: input,
36217
36247
  formsValue: formsValue,
36218
36248
  asText: asText
36219
36249
  });
36220
36250
  }
36221
- const InputLabel = _ref4 => {
36222
- var _input$meta5, _input$meta6, _input$meta7;
36223
- let {
36224
- input,
36225
- formsValue,
36226
- asText
36227
- } = _ref4;
36251
+ const InputLabel = ({
36252
+ input,
36253
+ formsValue,
36254
+ asText
36255
+ }) => {
36228
36256
  const {
36229
36257
  t,
36230
36258
  evaluationConfig,
36231
36259
  scope
36232
36260
  } = useEditContext();
36233
36261
  const label = getInputProp(input.label, formsValue, scope);
36234
- 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, {
36262
+ return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36235
36263
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
36236
36264
  className: "flex",
36237
36265
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
36238
- content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36266
+ content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36239
36267
  t: t,
36240
36268
  evaluationConfig: evaluationConfig
36241
36269
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36243,7 +36271,7 @@ const InputLabel = _ref4 => {
36243
36271
  children: ReactHtmlParser__default["default"](input.description)
36244
36272
  }),
36245
36273
  placement: "top",
36246
- 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", {
36274
+ children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36247
36275
  className: "flex flex-column justify-content-center ml-1",
36248
36276
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
36249
36277
  fontSize: 13
@@ -36265,9 +36293,7 @@ function getSectionLabel$1(labels, values) {
36265
36293
  }
36266
36294
  return labels;
36267
36295
  }
36268
- function getSubtitles$1(subtitles, position) {
36269
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36270
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36296
+ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
36271
36297
  let subtitle = subtitles && subtitles[position];
36272
36298
  if (subtitle && typeof subtitle === "object") {
36273
36299
  let newSubtitle = subtitle.default || "";
@@ -36311,12 +36337,14 @@ function getSubtitles$1(subtitles, position) {
36311
36337
  function getFormTitles$1(titles, key, position) {
36312
36338
  let tilte = titles && titles[key];
36313
36339
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
36314
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36340
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
36315
36341
  children: tilte
36316
36342
  }) : null;
36317
36343
  }
36318
36344
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
36319
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36345
+ formsValue = Object.assign(formsValue, {
36346
+ ...mainForm.getFieldsValue(true)
36347
+ });
36320
36348
  if (typeof repeatIndex === "number" && repeatValues) {
36321
36349
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
36322
36350
  repeatValues[inputName] = value;
@@ -36351,16 +36379,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
36351
36379
  };
36352
36380
  const inputOnBlur = [];
36353
36381
  const inputTypeComponent$1 = {
36354
- text: (_ref5, _ref6) => {
36355
- let {
36356
- props,
36357
- rules
36358
- } = _ref5;
36359
- let {
36360
- inputMeta = {},
36361
- t,
36362
- isHighlighted
36363
- } = _ref6;
36382
+ text: ({
36383
+ props,
36384
+ rules
36385
+ }, {
36386
+ inputMeta = {},
36387
+ t,
36388
+ isHighlighted
36389
+ }) => {
36364
36390
  const maxRule = rules.find(r => r.max);
36365
36391
  const maxProps = {
36366
36392
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36368,28 +36394,26 @@ const inputTypeComponent$1 = {
36368
36394
  if (maxRule) {
36369
36395
  maxProps.maxLength = maxRule.max;
36370
36396
  }
36371
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36372
- size: "large"
36373
- }, maxProps), {}, {
36397
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36398
+ size: "large",
36399
+ ...maxProps,
36374
36400
  allowClear: true,
36375
36401
  autoComplete: "new-password",
36376
- type: "text"
36377
- }, props), {}, {
36402
+ type: "text",
36403
+ ...props,
36378
36404
  className: formatClassname([isHighlighted && "highlighted-input"]),
36379
36405
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36380
36406
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36381
- }));
36407
+ });
36382
36408
  },
36383
- link: (_ref7, _ref8) => {
36384
- let {
36385
- props,
36386
- rules
36387
- } = _ref7;
36388
- let {
36389
- inputMeta = {},
36390
- t,
36391
- isHighlighted
36392
- } = _ref8;
36409
+ link: ({
36410
+ props,
36411
+ rules
36412
+ }, {
36413
+ inputMeta = {},
36414
+ t,
36415
+ isHighlighted
36416
+ }) => {
36393
36417
  const maxRule = rules.find(r => r.max);
36394
36418
  const maxProps = {
36395
36419
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -36397,32 +36421,29 @@ const inputTypeComponent$1 = {
36397
36421
  if (maxRule) {
36398
36422
  maxProps.maxLength = maxRule.max;
36399
36423
  }
36400
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
36401
- size: "large"
36402
- }, maxProps), {}, {
36424
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36425
+ size: "large",
36426
+ ...maxProps,
36403
36427
  allowClear: true,
36404
36428
  autoComplete: "new-password",
36405
- type: "text"
36406
- }, props), {}, {
36429
+ type: "text",
36430
+ ...props,
36407
36431
  className: formatClassname([isHighlighted && "highlighted-input"]),
36408
36432
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36409
36433
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36410
- }));
36434
+ });
36411
36435
  },
36412
- number: (_ref9, _ref10) => {
36413
- var _input$meta8;
36414
- let {
36415
- props,
36416
- rules,
36417
- input
36418
- } = _ref9;
36419
- let {
36420
- inputMeta = {},
36421
- t,
36422
- isHighlighted
36423
- } = _ref10;
36436
+ number: ({
36437
+ props,
36438
+ rules,
36439
+ input
36440
+ }, {
36441
+ inputMeta = {},
36442
+ t,
36443
+ isHighlighted
36444
+ }) => {
36424
36445
  const maxRule = rules.find(r => r.max);
36425
- const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36446
+ const integerRule = !input?.meta?.isDecimal;
36426
36447
  const parser = value => {
36427
36448
  if (!value) {
36428
36449
  return "";
@@ -36433,63 +36454,60 @@ const inputTypeComponent$1 = {
36433
36454
  return value.replace(/\$\s?|(,*)/g, "");
36434
36455
  };
36435
36456
  if (maxRule) {
36436
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36457
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36437
36458
  size: "large",
36438
36459
  allowClear: true,
36439
- autoComplete: "new-password"
36440
- }, props), {}, {
36460
+ autoComplete: "new-password",
36461
+ ...props,
36441
36462
  type: "number",
36442
36463
  parser: parser,
36443
36464
  min: 0,
36444
36465
  max: maxRule.max,
36445
36466
  className: formatClassname([isHighlighted && "highlighted-input"])
36446
- }));
36467
+ });
36447
36468
  }
36448
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36469
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36449
36470
  size: "large",
36450
36471
  allowClear: true,
36451
36472
  className: formatClassname([isHighlighted && "highlighted-input"]),
36452
- autoComplete: "new-password"
36453
- }, props), {}, {
36473
+ autoComplete: "new-password",
36474
+ ...props,
36454
36475
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36455
36476
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36456
36477
  min: 0,
36457
36478
  formatter: value => numberWithCommas$1(value),
36458
36479
  parser: parser
36459
- }));
36480
+ });
36460
36481
  },
36461
36482
  // eslint-disable-next-line no-unused-vars
36462
- select: (_ref11, _ref12) => {
36463
- var _input$meta9, _input$meta10;
36464
- let {
36465
- value,
36466
- options,
36467
- optionGroup,
36468
- props,
36469
- formsValue,
36470
- optionsFilter,
36471
- filterCond,
36472
- repeatValues,
36473
- repeatIndex,
36474
- name,
36475
- inputName,
36476
- address,
36477
- addressData,
36478
- input,
36479
- scope
36480
- } = _ref11;
36481
- let {
36482
- forms,
36483
- form,
36484
- setAddress,
36485
- inputMeta = {},
36486
- t,
36487
- isHighlighted,
36488
- changeInputMeta,
36489
- groupFormId
36490
- } = _ref12;
36483
+ select: ({
36484
+ value,
36485
+ options,
36486
+ optionGroup,
36487
+ props,
36488
+ formsValue,
36489
+ optionsFilter,
36490
+ filterCond,
36491
+ repeatValues,
36492
+ repeatIndex,
36493
+ name,
36494
+ inputName,
36495
+ address,
36496
+ addressData,
36497
+ input,
36498
+ scope
36499
+ }, {
36500
+ forms,
36501
+ form,
36502
+ setAddress,
36503
+ inputMeta = {},
36504
+ t,
36505
+ isHighlighted,
36506
+ changeInputMeta,
36507
+ groupFormId
36508
+ }) => {
36491
36509
  let opts;
36492
- const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36510
+ const isEvaluation = input?.meta?.isEvaluation;
36493
36511
  let defaultValue = value;
36494
36512
  if (typeof options === "string") {
36495
36513
  const [formName, key] = options.split(".");
@@ -36514,7 +36532,7 @@ const inputTypeComponent$1 = {
36514
36532
  opts = [];
36515
36533
  }
36516
36534
  } else {
36517
- opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36535
+ opts = options?.filter(o => !o.onlyView);
36518
36536
  }
36519
36537
  opts = JSON.parse(JSON.stringify(opts || []));
36520
36538
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36524,7 +36542,7 @@ const inputTypeComponent$1 = {
36524
36542
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36525
36543
 
36526
36544
  // Handle default value logic
36527
- 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)) {
36545
+ if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36528
36546
  // If no current value but there's a default value, use the default
36529
36547
  value = input.meta.defaultValue;
36530
36548
  defaultValue = value;
@@ -36557,7 +36575,7 @@ const inputTypeComponent$1 = {
36557
36575
  }
36558
36576
  opts = groupOptions;
36559
36577
  }
36560
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36578
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36561
36579
  size: "large",
36562
36580
  autoComplete: "new-password",
36563
36581
  allowClear: true,
@@ -36566,32 +36584,35 @@ const inputTypeComponent$1 = {
36566
36584
  value: value // Use value instead of defaultValue for controlled behavior
36567
36585
  ,
36568
36586
  filterOption: filterSelectOptions,
36569
- optionFilterProp: "children"
36570
- }, props), {}, {
36587
+ optionFilterProp: "children",
36588
+ ...props,
36571
36589
  className: formatClassname([isHighlighted && "highlighted-select"]),
36572
36590
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36573
36591
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36574
36592
  onChange: (val, selectedValue) => {
36575
36593
  // ONLY FOR SBG EVALUATON !!
36576
36594
  if (isEvaluation && val === "na" && groupFormId) {
36577
- var _formsValue$meta2;
36578
36595
  changeInputMeta({
36579
36596
  key: groupFormId,
36580
- 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]) || {}), {}, {
36597
+ value: {
36598
+ ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36581
36599
  documentation: {
36582
36600
  notApplicable: true
36583
36601
  }
36584
- }),
36602
+ },
36585
36603
  otherValues: {
36586
- [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36604
+ [groupFormId]: {
36605
+ ...(formsValue?.[groupFormId] || {}),
36587
36606
  [name]: val
36588
- })
36607
+ }
36589
36608
  }
36590
36609
  });
36591
36610
  }
36592
36611
  if (address && selectedValue) {
36593
36612
  dot__default["default"].str(address, selectedValue.children, addressData);
36594
- setAddress(_objectSpread2({}, addressData));
36613
+ setAddress({
36614
+ ...addressData
36615
+ });
36595
36616
  }
36596
36617
  if (props.onChange) {
36597
36618
  props.onChange(val);
@@ -36622,15 +36643,15 @@ const inputTypeComponent$1 = {
36622
36643
  if (og.disabled !== undefined) {
36623
36644
  groupOtherProps.disabled = og.disabled;
36624
36645
  }
36625
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36626
- value: og.value
36627
- }, groupOtherProps), {}, {
36646
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36647
+ value: og.value,
36648
+ ...groupOtherProps,
36628
36649
  children: og.label
36629
- }), "".concat(i).concat(j));
36650
+ }, `${i}${j}`);
36630
36651
  })
36631
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36632
- value: option.value
36633
- }, otherProps), {}, {
36652
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36653
+ value: option.value,
36654
+ ...otherProps,
36634
36655
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36635
36656
  className: "flex",
36636
36657
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36638,35 +36659,33 @@ const inputTypeComponent$1 = {
36638
36659
  children: sgbEvaluationIcons[option.value]
36639
36660
  }), option.label]
36640
36661
  }) : option.label
36641
- }), option.value);
36662
+ }, option.value);
36642
36663
  })
36643
- }));
36664
+ });
36644
36665
  },
36645
- multiselect: (_ref13, _ref14) => {
36646
- let {
36647
- value,
36648
- options,
36649
- optionGroup,
36650
- optionsFilter,
36651
- filterCond,
36652
- props,
36653
- formsValue,
36654
- repeatValues,
36655
- repeatIndex,
36656
- inputName,
36657
- name,
36658
- tags,
36659
- maxWidth,
36660
- staticWidth,
36661
- fullWidth
36662
- } = _ref13;
36663
- let {
36664
- forms,
36665
- form,
36666
- inputMeta = {},
36667
- t,
36668
- isHighlighted
36669
- } = _ref14;
36666
+ multiselect: ({
36667
+ value,
36668
+ options,
36669
+ optionGroup,
36670
+ optionsFilter,
36671
+ filterCond,
36672
+ props,
36673
+ formsValue,
36674
+ repeatValues,
36675
+ repeatIndex,
36676
+ inputName,
36677
+ name,
36678
+ tags,
36679
+ maxWidth,
36680
+ staticWidth,
36681
+ fullWidth
36682
+ }, {
36683
+ forms,
36684
+ form,
36685
+ inputMeta = {},
36686
+ t,
36687
+ isHighlighted
36688
+ }) => {
36670
36689
  let opts;
36671
36690
  if (typeof options === "string") {
36672
36691
  const [formName, key] = options.split(".");
@@ -36728,17 +36747,17 @@ const inputTypeComponent$1 = {
36728
36747
  staticWidth,
36729
36748
  fullWidth
36730
36749
  });
36731
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36750
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36732
36751
  size: "medium",
36733
36752
  allowClear: true,
36734
36753
  autoComplete: "new-password",
36735
36754
  mode: tags ? "tags" : "multiple",
36736
- optionFilterProp: "children"
36737
- }, tags ? {
36738
- tokenSeparators: [","]
36739
- } : {}), {}, {
36740
- filterOption: filterSelectOptions
36741
- }, props), {}, {
36755
+ optionFilterProp: "children",
36756
+ ...(tags ? {
36757
+ tokenSeparators: [","]
36758
+ } : {}),
36759
+ filterOption: filterSelectOptions,
36760
+ ...props,
36742
36761
  className: formatClassname([isHighlighted && "highlighted-select"]),
36743
36762
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36744
36763
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
@@ -36777,52 +36796,51 @@ const inputTypeComponent$1 = {
36777
36796
  if (og.disabled !== undefined) {
36778
36797
  groupOtherProps.disabled = og.disabled;
36779
36798
  }
36780
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36781
- value: og.value
36782
- }, groupOtherProps), {}, {
36799
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36800
+ value: og.value,
36801
+ ...groupOtherProps,
36783
36802
  children: og.label
36784
- }), "".concat(i).concat(j));
36803
+ }, `${i}${j}`);
36785
36804
  })
36786
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36787
- value: option.value
36788
- }, otherProps), {}, {
36805
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36806
+ value: option.value,
36807
+ ...otherProps,
36789
36808
  children: option.label
36790
- }), i);
36809
+ }, i);
36791
36810
  })
36792
- }));
36811
+ });
36793
36812
  },
36794
- date: (_ref15, _ref16) => {
36795
- var _formsValue$groupForm, _value2;
36796
- let {
36797
- props,
36798
- rules,
36799
- repeatValues,
36800
- formsValue,
36801
- name
36802
- } = _ref15;
36803
- let {
36804
- setFormValues,
36805
- inputMeta,
36806
- form,
36807
- t,
36808
- isHighlighted,
36809
- groupFormId
36810
- } = _ref16;
36813
+ date: ({
36814
+ props,
36815
+ rules,
36816
+ repeatValues,
36817
+ formsValue,
36818
+ name
36819
+ }, {
36820
+ setFormValues,
36821
+ inputMeta,
36822
+ form,
36823
+ t,
36824
+ isHighlighted,
36825
+ groupFormId
36826
+ }) => {
36811
36827
  const lng = localStorage.getItem("datastakeLng") || "en";
36812
36828
  const maxRule = rules.find(r => r.max);
36813
- let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36829
+ let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36814
36830
  const handleDateChange = date => {
36815
36831
  if (date) {
36816
36832
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36817
36833
  const localDate = dayjs__default["default"].utc(date);
36818
36834
  if (groupFormId) {
36819
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36835
+ const _new = {
36836
+ ...(formsValue[groupFormId] || {}),
36820
36837
  [name]: localDate
36821
- });
36838
+ };
36822
36839
  form.setFieldValue(groupFormId, _new);
36823
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36840
+ setFormValues({
36841
+ ...formsValue,
36824
36842
  [groupFormId]: _new
36825
- }));
36843
+ });
36826
36844
  } else {
36827
36845
  form.setFieldValue(name, localDate);
36828
36846
  }
@@ -36831,13 +36849,15 @@ const inputTypeComponent$1 = {
36831
36849
  if (groupFormId) {
36832
36850
  if (typeof value === "string" || typeof value === "undefined") {
36833
36851
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36834
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36852
+ const _new = {
36853
+ ...(formsValue[groupFormId] || {}),
36835
36854
  [name]: value
36836
- });
36855
+ };
36837
36856
  form.setFieldValue(groupFormId, _new);
36838
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36857
+ setFormValues({
36858
+ ...formsValue,
36839
36859
  [groupFormId]: _new
36840
- }));
36860
+ });
36841
36861
  }
36842
36862
  } else {
36843
36863
  if (typeof value === "string") {
@@ -36853,13 +36873,12 @@ const inputTypeComponent$1 = {
36853
36873
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36854
36874
  }
36855
36875
  if (checkForMax) {
36856
- var _value;
36857
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36876
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36858
36877
  size: "large",
36859
36878
  allowClear: true,
36860
- autoComplete: "new-password"
36861
- }, props), {}, {
36862
- value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36879
+ autoComplete: "new-password",
36880
+ ...props,
36881
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36863
36882
  onChange: handleDateChange,
36864
36883
  className: formatClassname([isHighlighted && "highlighted-input"]),
36865
36884
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36869,54 +36888,49 @@ const inputTypeComponent$1 = {
36869
36888
  disabledDate: current => {
36870
36889
  return current && current >= dayjs__default["default"]().endOf("day");
36871
36890
  }
36872
- }));
36891
+ });
36873
36892
  }
36874
36893
  }
36875
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36894
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36876
36895
  size: "large",
36877
36896
  allowClear: true,
36878
- autoComplete: "new-password"
36879
- }, props), {}, {
36880
- value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36897
+ autoComplete: "new-password",
36898
+ ...props,
36899
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36881
36900
  onChange: handleDateChange,
36882
36901
  className: formatClassname([isHighlighted && "highlighted-input"]),
36883
36902
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36884
36903
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36885
36904
  format: DATE_FORMATS,
36886
36905
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36887
- }));
36906
+ });
36888
36907
  },
36889
- groupExpandable: (_ref17, _ref18) => {
36890
- var _formsValue$groupForm2;
36891
- let {
36892
- formsValue,
36893
- name,
36894
- input
36895
- } = _ref17;
36896
- let {
36897
- groupFormId
36898
- } = _ref18;
36899
- 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];
36908
+ groupExpandable: ({
36909
+ formsValue,
36910
+ name,
36911
+ input
36912
+ }, {
36913
+ groupFormId
36914
+ }) => {
36915
+ const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36900
36916
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36901
36917
  input: input,
36902
36918
  formsValue: formsValue,
36903
36919
  data: data
36904
36920
  });
36905
36921
  },
36906
- comment: (_ref19, _ref20) => {
36907
- let {
36908
- props: {
36909
- placeholder
36910
- },
36911
- commentHint
36912
- } = _ref19,
36913
- props = _objectWithoutProperties(_ref19.props, _excluded$i);
36914
- let {
36915
- onChange,
36916
- value,
36917
- isHighlighted
36918
- } = _ref20;
36919
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36922
+ comment: ({
36923
+ props: {
36924
+ placeholder,
36925
+ ...props
36926
+ },
36927
+ commentHint
36928
+ }, {
36929
+ onChange,
36930
+ value,
36931
+ isHighlighted
36932
+ }) => {
36933
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36920
36934
  allowClear: true,
36921
36935
  value: value,
36922
36936
  onChange: e => onChange(e.target.value),
@@ -36927,27 +36941,26 @@ const inputTypeComponent$1 = {
36927
36941
  autoSize: {
36928
36942
  minRows: 5,
36929
36943
  maxRows: 5
36930
- }
36931
- }, props), {}, {
36944
+ },
36945
+ ...props,
36932
36946
  disabled: false
36933
- }));
36947
+ });
36934
36948
  },
36935
- tableComment: (_ref21, _ref22) => {
36936
- var _formsValue$meta3;
36937
- let {
36938
- setValues,
36939
- name,
36940
- onValuesChange,
36941
- formsValue
36942
- } = _ref21;
36943
- let {
36944
- form,
36945
- groupFormId,
36946
- isHighlighted
36947
- } = _ref22;
36948
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36949
+ tableComment: ({
36950
+ setValues,
36951
+ name,
36952
+ onValuesChange,
36953
+ formsValue
36954
+ }, {
36955
+ form,
36956
+ groupFormId,
36957
+ isHighlighted
36958
+ }) => {
36959
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36960
+ ...v,
36949
36961
  key: i
36950
- })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36962
+ })) : (formsValue[name] || []).map((v, i) => ({
36963
+ ...v,
36951
36964
  key: i
36952
36965
  }));
36953
36966
  const onUpdate = (val, i) => {
@@ -36955,89 +36968,121 @@ const inputTypeComponent$1 = {
36955
36968
  [name]: formData.map((d, j) => i === j ? val : d)
36956
36969
  };
36957
36970
  if (groupFormId) {
36958
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36959
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36960
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36971
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36972
+ const _newData = {
36973
+ ..._defaultData,
36974
+ ..._val
36975
+ };
36976
+ onValuesChange(_newData, {
36977
+ ...formsValue,
36961
36978
  [groupFormId]: _newData
36962
- }));
36963
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36964
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36979
+ });
36980
+ form?.setFieldValue(groupFormId, _newData);
36981
+ setValues({
36982
+ ...formsValue,
36965
36983
  [groupFormId]: _newData
36966
- }));
36984
+ });
36967
36985
  return;
36968
36986
  }
36969
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36970
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36971
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36987
+ onValuesChange(_val, {
36988
+ ...formsValue,
36989
+ ..._val
36990
+ });
36991
+ form?.setFieldValue(name, _val[name]);
36992
+ setValues({
36993
+ ...formsValue,
36994
+ ..._val
36995
+ });
36972
36996
  };
36973
36997
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36974
36998
  onUpdate: onUpdate,
36975
36999
  isHighlighted: isHighlighted,
36976
37000
  form: form,
36977
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
37001
+ values: groupFormId ? {
37002
+ ...(formsValue[groupFormId] || {}),
36978
37003
  meta: {
36979
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
37004
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36980
37005
  }
36981
- }) : formsValue,
37006
+ } : formsValue,
36982
37007
  name: name,
36983
- remove: _ref23 => {
36984
- let {
36985
- key
36986
- } = _ref23;
37008
+ remove: ({
37009
+ key
37010
+ }) => {
36987
37011
  const _val = {
36988
37012
  [name]: formData.filter(v => v.key !== key)
36989
37013
  };
36990
37014
  if (groupFormId) {
36991
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36992
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36993
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37015
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37016
+ const _newData = {
37017
+ ..._defaultData,
37018
+ ..._val
37019
+ };
37020
+ onValuesChange(_newData, {
37021
+ ...formsValue,
36994
37022
  [groupFormId]: _newData
36995
- }));
36996
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36997
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37023
+ });
37024
+ form?.setFieldValue(groupFormId, _newData);
37025
+ setValues({
37026
+ ...formsValue,
36998
37027
  [groupFormId]: _newData
36999
- }));
37028
+ });
37000
37029
  return;
37001
37030
  }
37002
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37003
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37004
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37031
+ onValuesChange(_val, {
37032
+ ...formsValue,
37033
+ ..._val
37034
+ });
37035
+ form?.setFieldValue(name, _val[name]);
37036
+ setValues({
37037
+ ...formsValue,
37038
+ ..._val
37039
+ });
37005
37040
  },
37006
37041
  add: val => {
37007
37042
  const _val = {
37008
- [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
37043
+ [name]: [...formData, {
37044
+ ...val,
37009
37045
  key: formData.length
37010
- })]
37046
+ }]
37011
37047
  };
37012
37048
  if (groupFormId) {
37013
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37014
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37015
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37016
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37049
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37050
+ const _newData = {
37051
+ ..._defaultData,
37052
+ ..._val
37053
+ };
37054
+ form?.setFieldValue(groupFormId, _newData);
37055
+ onValuesChange(_newData, {
37056
+ ...formsValue,
37017
37057
  [groupFormId]: _newData
37018
- }));
37019
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37058
+ });
37059
+ setValues({
37060
+ ...formsValue,
37020
37061
  [groupFormId]: _newData
37021
- }));
37062
+ });
37022
37063
  return;
37023
37064
  }
37024
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37025
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37026
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37065
+ form?.setFieldValue(name, _val[name]);
37066
+ onValuesChange(_val, {
37067
+ ...formsValue,
37068
+ ..._val
37069
+ });
37070
+ setValues({
37071
+ ...formsValue,
37072
+ ..._val
37073
+ });
37027
37074
  },
37028
37075
  k: name
37029
37076
  });
37030
37077
  },
37031
- textarea: (_ref24, _ref25) => {
37032
- let {
37033
- props,
37034
- rules
37035
- } = _ref24;
37036
- let {
37037
- inputMeta,
37038
- t,
37039
- isHighlighted
37040
- } = _ref25;
37078
+ textarea: ({
37079
+ props,
37080
+ rules
37081
+ }, {
37082
+ inputMeta,
37083
+ t,
37084
+ isHighlighted
37085
+ }) => {
37041
37086
  const maxRule = rules.find(r => r.max);
37042
37087
  let maxLength = MAX_TEXT_AREA_LENGTH;
37043
37088
  let rows = 5;
@@ -37064,7 +37109,7 @@ const inputTypeComponent$1 = {
37064
37109
  // rows = 14;
37065
37110
  // }
37066
37111
  }
37067
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
37112
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
37068
37113
  allowClear: true,
37069
37114
  autoComplete: "new-password",
37070
37115
  maxLength: maxLength,
@@ -37072,37 +37117,35 @@ const inputTypeComponent$1 = {
37072
37117
  autoSize: {
37073
37118
  minRows: rows,
37074
37119
  maxRows: rows
37075
- }
37076
- }, props), {}, {
37120
+ },
37121
+ ...props,
37077
37122
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37078
37123
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
37079
- }));
37124
+ });
37080
37125
  },
37081
- phoneNumber: (_ref26, _ref27) => {
37082
- let {
37083
- name,
37084
- inputName,
37085
- props,
37086
- value,
37087
- repeatIndex,
37088
- repeatValues,
37089
- formsValue
37090
- } = _ref26;
37091
- let {
37092
- setFormValues,
37093
- inputMeta,
37094
- t,
37095
- isHighlighted
37096
- } = _ref27;
37097
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
37126
+ phoneNumber: ({
37127
+ name,
37128
+ inputName,
37129
+ props,
37130
+ value,
37131
+ repeatIndex,
37132
+ repeatValues,
37133
+ formsValue
37134
+ }, {
37135
+ setFormValues,
37136
+ inputMeta,
37137
+ t,
37138
+ isHighlighted
37139
+ }) => {
37140
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
37098
37141
  customSelectWidthPercentage: "20%",
37099
37142
  t: t,
37100
37143
  size: "large",
37101
37144
  allowClear: true,
37102
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
37145
+ country: formsValue?.country,
37103
37146
  initialValue: value,
37104
- name: name
37105
- }, props), {}, {
37147
+ name: name,
37148
+ ...props,
37106
37149
  className: formatClassname([isHighlighted && "highlighted-input"]),
37107
37150
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37108
37151
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -37123,27 +37166,26 @@ const inputTypeComponent$1 = {
37123
37166
  }
37124
37167
  return val;
37125
37168
  }
37126
- }));
37169
+ });
37127
37170
  },
37128
- switch: (_ref28, _ref29) => {
37129
- let {
37130
- props,
37131
- value,
37132
- restricted,
37133
- autocomplete,
37134
- formsValue,
37135
- repeatValues,
37136
- repeatIndex,
37137
- name,
37138
- inputName,
37139
- replace: replaceInput,
37140
- unique
37141
- } = _ref28;
37142
- let {
37143
- form,
37144
- isHighlighted
37145
- } = _ref29;
37146
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
37171
+ switch: ({
37172
+ props,
37173
+ value,
37174
+ restricted,
37175
+ autocomplete,
37176
+ formsValue,
37177
+ repeatValues,
37178
+ repeatIndex,
37179
+ name,
37180
+ inputName,
37181
+ replace: replaceInput,
37182
+ unique
37183
+ }, {
37184
+ form,
37185
+ isHighlighted
37186
+ }) => {
37187
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
37188
+ ...props,
37147
37189
  size: "default",
37148
37190
  defaultChecked: value || false,
37149
37191
  checked: value || false,
@@ -37171,7 +37213,9 @@ const inputTypeComponent$1 = {
37171
37213
  const [formName, replaceInputName] = replaceTo.split(".");
37172
37214
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
37173
37215
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
37174
- formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
37216
+ formsValue = Object.assign(formsValue, {
37217
+ ...form.getFieldsValue(true)
37218
+ });
37175
37219
  if (oldId) {
37176
37220
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
37177
37221
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -37212,22 +37256,20 @@ const inputTypeComponent$1 = {
37212
37256
  }
37213
37257
  }
37214
37258
  }
37215
- }));
37259
+ });
37216
37260
  },
37217
- radioGroup: (_ref30, _ref31) => {
37218
- let {
37219
- props,
37220
- value,
37221
- options,
37222
- isRisk
37223
- } = _ref30;
37224
- let {
37225
- isHighlighted
37226
- } = _ref31;
37261
+ radioGroup: ({
37262
+ props,
37263
+ value,
37264
+ options,
37265
+ isRisk
37266
+ }, {
37267
+ isHighlighted
37268
+ }) => {
37227
37269
  if (isRisk) {
37228
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37229
- value: value
37230
- }, props), {}, {
37270
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37271
+ value: value,
37272
+ ...props,
37231
37273
  className: "is-risk-radio",
37232
37274
  children: (options || []).map(o => {
37233
37275
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37241,11 +37283,11 @@ const inputTypeComponent$1 = {
37241
37283
  }) : null]
37242
37284
  }, o.value);
37243
37285
  })
37244
- }));
37286
+ });
37245
37287
  }
37246
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
37247
- value: value
37248
- }, props), {}, {
37288
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37289
+ value: value,
37290
+ ...props,
37249
37291
  className: formatClassname([isHighlighted && "highlighted-input"]),
37250
37292
  children: (options || []).map(o => {
37251
37293
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -37259,20 +37301,18 @@ const inputTypeComponent$1 = {
37259
37301
  }) : null]
37260
37302
  }, o.value);
37261
37303
  })
37262
- }));
37304
+ });
37263
37305
  },
37264
- checkboxGroup: (_ref32, _ref33) => {
37265
- let {
37266
- props,
37267
- value,
37268
- options
37269
- } = _ref32;
37270
- let {
37271
- isHighlighted
37272
- } = _ref33;
37273
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
37274
- value: value
37275
- }, props), {}, {
37306
+ checkboxGroup: ({
37307
+ props,
37308
+ value,
37309
+ options
37310
+ }, {
37311
+ isHighlighted
37312
+ }) => {
37313
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37314
+ value: value,
37315
+ ...props,
37276
37316
  className: formatClassname([isHighlighted && "highlighted-input"]),
37277
37317
  style: {
37278
37318
  display: "grid",
@@ -37296,18 +37336,16 @@ const inputTypeComponent$1 = {
37296
37336
  }) : null]
37297
37337
  }, o.value);
37298
37338
  })
37299
- }));
37339
+ });
37300
37340
  },
37301
- total100: (_ref34, _ref35) => {
37302
- let {
37303
- props,
37304
- name,
37305
- options,
37306
- value
37307
- } = _ref34;
37308
- let {
37309
- isHighlighted
37310
- } = _ref35;
37341
+ total100: ({
37342
+ props,
37343
+ name,
37344
+ options,
37345
+ value
37346
+ }, {
37347
+ isHighlighted
37348
+ }) => {
37311
37349
  value = value ? Array.isArray(value) ? value : [value] : [];
37312
37350
  function totalValue() {
37313
37351
  let total = 0;
@@ -37331,11 +37369,10 @@ const inputTypeComponent$1 = {
37331
37369
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
37332
37370
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
37333
37371
  name: name,
37334
- children: (fields, _ref36) => {
37335
- let {
37336
- add,
37337
- remove
37338
- } = _ref36;
37372
+ children: (fields, {
37373
+ add,
37374
+ remove
37375
+ }) => {
37339
37376
  if (fields.length === 0) {
37340
37377
  const formData = value || [];
37341
37378
  if (formData.length) {
@@ -37354,27 +37391,27 @@ const inputTypeComponent$1 = {
37354
37391
  const v = value[field.name] || {};
37355
37392
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
37356
37393
  className: "total",
37357
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37358
- noStyle: true
37359
- }, field), {}, {
37394
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37395
+ noStyle: true,
37396
+ ...field,
37360
37397
  name: [field.name, "type"],
37361
37398
  fieldKey: [field.fieldKey, "type"],
37362
37399
  initialValue: v.type || null,
37363
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37400
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
37364
37401
  size: "large",
37365
37402
  allowClear: true,
37366
37403
  showSearch: true,
37367
37404
  filterOption: filterSelectOptions,
37368
- optionFilterProp: "children"
37369
- }, props), {}, {
37405
+ optionFilterProp: "children",
37406
+ ...props,
37370
37407
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
37371
37408
  value: option.value,
37372
37409
  children: option.label
37373
37410
  }, i))
37374
- }))
37375
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
37376
- noStyle: true
37377
- }, field), {}, {
37411
+ })
37412
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37413
+ noStyle: true,
37414
+ ...field,
37378
37415
  name: [field.name, "value"],
37379
37416
  fieldKey: [field.fieldKey, "value"],
37380
37417
  initialValue: v.value,
@@ -37383,14 +37420,14 @@ const inputTypeComponent$1 = {
37383
37420
  allowClear: true,
37384
37421
  name: "value",
37385
37422
  formatter: value => {
37386
- return value ? "".concat(value, "%") : "";
37423
+ return value ? `${value}%` : "";
37387
37424
  },
37388
37425
  disabled: !v.type || null,
37389
37426
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
37390
37427
  min: 1,
37391
37428
  max: 100 - siblingTotal(v.type || 0)
37392
37429
  })
37393
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37430
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37394
37431
  disabled: !v.value || !v.type || totalValue() >= 100,
37395
37432
  type: "primary",
37396
37433
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -37422,22 +37459,19 @@ const inputTypeComponent$1 = {
37422
37459
  }) : null]
37423
37460
  });
37424
37461
  },
37425
- percentage: (_ref37, _ref38) => {
37426
- var _input$meta11;
37427
- let {
37428
- name,
37429
- inputName,
37430
- totalMax,
37431
- repeatIndex,
37432
- props,
37433
- formsValue,
37434
- input
37435
- } = _ref37;
37436
- let {
37437
- inputMeta,
37438
- t,
37439
- isHighlighted
37440
- } = _ref38;
37462
+ percentage: ({
37463
+ name,
37464
+ inputName,
37465
+ totalMax,
37466
+ repeatIndex,
37467
+ props,
37468
+ formsValue,
37469
+ input
37470
+ }, {
37471
+ inputMeta,
37472
+ t,
37473
+ isHighlighted
37474
+ }) => {
37441
37475
  const isRepeatable = Array.isArray(formsValue[name]);
37442
37476
  let totalSiblings = 0;
37443
37477
  if (isRepeatable && totalMax) {
@@ -37445,47 +37479,45 @@ const inputTypeComponent$1 = {
37445
37479
  totl = totl + (grp[inputName] || 0);
37446
37480
  return totl;
37447
37481
  }, 0);
37448
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37482
+ } else if (Array.isArray(input?.meta?.siblings)) {
37449
37483
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
37450
37484
  totl = totl + (formsValue[key] || 0);
37451
37485
  return totl;
37452
37486
  }, 0);
37453
37487
  }
37454
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37488
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37455
37489
  size: "large",
37456
- allowClear: true
37457
- }, props), {}, {
37490
+ allowClear: true,
37491
+ ...props,
37458
37492
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37459
37493
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37460
37494
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37461
37495
  min: 0,
37462
37496
  max: 100 - totalSiblings,
37463
37497
  formatter: value => {
37464
- return value ? "".concat(value) : "";
37498
+ return value ? `${value}` : "";
37465
37499
  },
37466
37500
  parser: value => value.replace("%", ""),
37467
37501
  addonAfter: "%"
37468
- }));
37502
+ });
37469
37503
  },
37470
- drawTerritory: (_ref39, _ref40) => {
37471
- let {
37472
- formsValue,
37473
- name,
37474
- addressData
37475
- } = _ref39;
37476
- let {
37477
- setFormValues
37478
- } = _ref40;
37504
+ drawTerritory: ({
37505
+ formsValue,
37506
+ name,
37507
+ addressData
37508
+ }, {
37509
+ setFormValues
37510
+ }) => {
37479
37511
  let search = formsValue.country;
37480
37512
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37481
37513
  if (addressData.address.country) {
37482
37514
  search = addressData.address.country;
37483
37515
  }
37484
37516
  if (addressData.address.level1) {
37485
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37517
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
37486
37518
  }
37487
37519
  if (addressData.address.level2) {
37488
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37520
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37489
37521
  }
37490
37522
  } else {
37491
37523
  const country = countriesList.countries[formsValue.country] || {};
@@ -37493,10 +37525,10 @@ const inputTypeComponent$1 = {
37493
37525
  search = country.name;
37494
37526
  }
37495
37527
  if (formsValue.administrativeLevel1Name) {
37496
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37528
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37497
37529
  }
37498
37530
  if (formsValue.administrativeLevel2Name) {
37499
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37531
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37500
37532
  }
37501
37533
  }
37502
37534
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37508,36 +37540,32 @@ const inputTypeComponent$1 = {
37508
37540
  searchValue: search
37509
37541
  });
37510
37542
  },
37511
- year: (_ref41, _ref42) => {
37512
- let {
37513
- props
37514
- } = _ref41;
37515
- let {
37516
- isHighlighted
37517
- } = _ref42;
37543
+ year: ({
37544
+ props
37545
+ }, {
37546
+ isHighlighted
37547
+ }) => {
37518
37548
  const lng = localStorage.getItem("datastakeLng") || "en";
37519
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37549
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37520
37550
  size: "large",
37521
37551
  allowClear: true,
37522
37552
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37523
- picker: "year"
37524
- }, props), {}, {
37553
+ picker: "year",
37554
+ ...props,
37525
37555
  className: formatClassname([isHighlighted && "highlighted-input"]),
37526
37556
  format: "YYYY"
37527
- }));
37557
+ });
37528
37558
  },
37529
- upload: (_ref43, _ref44) => {
37530
- let {
37531
- rules,
37532
- value
37533
- } = _ref43;
37534
- let {
37535
- setLoading = () => {},
37536
- getApiBaseUrl,
37537
- getAppHeader,
37538
- t,
37539
- isHighlighted
37540
- } = _ref44;
37559
+ upload: ({
37560
+ rules,
37561
+ value
37562
+ }, {
37563
+ setLoading = () => {},
37564
+ getApiBaseUrl,
37565
+ getAppHeader,
37566
+ t,
37567
+ isHighlighted
37568
+ }) => {
37541
37569
  const apiURL = getApiBaseUrl();
37542
37570
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37543
37571
  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) : []) || [];
@@ -37550,12 +37578,13 @@ const inputTypeComponent$1 = {
37550
37578
  maxProps.multiple = true;
37551
37579
  }
37552
37580
  }
37553
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37581
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37582
+ ...maxProps,
37554
37583
  accept: accept,
37555
- action: "".concat(apiURL, "/upload"),
37584
+ action: `${apiURL}/upload`,
37556
37585
  beforeUpload: beforeUpload(allowedExtensions),
37557
37586
  onChange: val => {
37558
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37587
+ if (val?.file && typeof setLoading === "function") {
37559
37588
  if (val.file.percent !== 100) {
37560
37589
  setLoading(true);
37561
37590
  } else {
@@ -37563,9 +37592,10 @@ const inputTypeComponent$1 = {
37563
37592
  }
37564
37593
  }
37565
37594
  },
37566
- headers: _objectSpread2({
37567
- Authorization: "Bearer ".concat(getToken())
37568
- }, getAppHeader()),
37595
+ headers: {
37596
+ Authorization: `Bearer ${getToken()}`,
37597
+ ...getAppHeader()
37598
+ },
37569
37599
  defaultFileList: values,
37570
37600
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37571
37601
  style: {
@@ -37576,20 +37606,18 @@ const inputTypeComponent$1 = {
37576
37606
  children: t("Upload")
37577
37607
  })]
37578
37608
  })
37579
- }));
37609
+ });
37580
37610
  },
37581
- imageUpload: (_ref45, _ref46) => {
37582
- let {
37583
- rules,
37584
- value
37585
- } = _ref45;
37586
- let {
37587
- setLoading = () => {},
37588
- getApiBaseUrl,
37589
- getAppHeader,
37590
- t,
37591
- isHighlighted
37592
- } = _ref46;
37611
+ imageUpload: ({
37612
+ rules,
37613
+ value
37614
+ }, {
37615
+ setLoading = () => {},
37616
+ getApiBaseUrl,
37617
+ getAppHeader,
37618
+ t,
37619
+ isHighlighted
37620
+ }) => {
37593
37621
  const apiURL = getApiBaseUrl();
37594
37622
  const values = getImageUploadEditValue(value);
37595
37623
  const maxRule = rules.find(r => r.max);
@@ -37600,18 +37628,17 @@ const inputTypeComponent$1 = {
37600
37628
  maxProps.multiple = true;
37601
37629
  }
37602
37630
  }
37603
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37604
- beforeUpload: beforeUpload(allowedImageExtensions)
37605
- }, maxProps), {}, {
37631
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37632
+ beforeUpload: beforeUpload(allowedImageExtensions),
37633
+ ...maxProps,
37606
37634
  accept: "image/*",
37607
37635
  classList: !values || !values.length ? "empty" : "",
37608
37636
  listType: "picture",
37609
- action: "".concat(apiURL, "/upload"),
37637
+ action: `${apiURL}/upload`,
37610
37638
  onChange: val => {
37611
37639
  if (typeof setLoading === "function") {
37612
- if (val !== null && val !== void 0 && val.file) {
37613
- var _val$file;
37614
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37640
+ if (val?.file) {
37641
+ if (val?.file?.status === "removed") {
37615
37642
  setLoading(false);
37616
37643
  return;
37617
37644
  }
@@ -37623,9 +37650,10 @@ const inputTypeComponent$1 = {
37623
37650
  setLoading(false);
37624
37651
  }
37625
37652
  },
37626
- headers: _objectSpread2({
37627
- Authorization: "Bearer ".concat(getToken())
37628
- }, getAppHeader()),
37653
+ headers: {
37654
+ Authorization: `Bearer ${getToken()}`,
37655
+ ...getAppHeader()
37656
+ },
37629
37657
  defaultFileList: values,
37630
37658
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37631
37659
  style: {
@@ -37636,20 +37664,18 @@ const inputTypeComponent$1 = {
37636
37664
  children: t("Upload")
37637
37665
  })]
37638
37666
  })
37639
- }));
37667
+ });
37640
37668
  },
37641
- videoUpload: (_ref47, _ref48) => {
37642
- let {
37643
- rules,
37644
- value
37645
- } = _ref47;
37646
- let {
37647
- setLoading = () => {},
37648
- getApiBaseUrl,
37649
- getAppHeader,
37650
- t,
37651
- isHighlighted
37652
- } = _ref48;
37669
+ videoUpload: ({
37670
+ rules,
37671
+ value
37672
+ }, {
37673
+ setLoading = () => {},
37674
+ getApiBaseUrl,
37675
+ getAppHeader,
37676
+ t,
37677
+ isHighlighted
37678
+ }) => {
37653
37679
  const apiURL = getApiBaseUrl();
37654
37680
  const values = getImageUploadEditValue(value);
37655
37681
  const maxRule = rules.find(r => r.max);
@@ -37660,25 +37686,21 @@ const inputTypeComponent$1 = {
37660
37686
  maxProps.multiple = true;
37661
37687
  }
37662
37688
  }
37663
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37664
- itemRender: (item, fileList) => {
37665
- var _fileList$response;
37666
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37667
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37668
- 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)
37669
- }), item]
37670
- });
37671
- }
37672
- }, maxProps), {}, {
37689
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37690
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37691
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37692
+ url: fileList?.response?.url || fileList?.url
37693
+ }), item]
37694
+ }),
37695
+ ...maxProps,
37673
37696
  accept: "video/*",
37674
37697
  classList: !values || !values.length ? "empty" : "",
37675
37698
  listType: "picture",
37676
- action: "".concat(apiURL, "/upload"),
37699
+ action: `${apiURL}/upload`,
37677
37700
  onChange: val => {
37678
37701
  if (typeof setLoading === "function") {
37679
- if (val !== null && val !== void 0 && val.file) {
37680
- var _val$file2;
37681
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37702
+ if (val?.file) {
37703
+ if (val?.file?.status === "removed") {
37682
37704
  setLoading(false);
37683
37705
  return;
37684
37706
  }
@@ -37690,9 +37712,10 @@ const inputTypeComponent$1 = {
37690
37712
  setLoading(false);
37691
37713
  }
37692
37714
  },
37693
- headers: _objectSpread2({
37694
- Authorization: "Bearer ".concat(getToken())
37695
- }, getAppHeader()),
37715
+ headers: {
37716
+ Authorization: `Bearer ${getToken()}`,
37717
+ ...getAppHeader()
37718
+ },
37696
37719
  fileList: values,
37697
37720
  defaultFileList: values,
37698
37721
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37704,30 +37727,28 @@ const inputTypeComponent$1 = {
37704
37727
  children: t("Upload")
37705
37728
  })]
37706
37729
  })
37707
- }));
37730
+ });
37708
37731
  },
37709
- geolocation: (_ref49, _ref50) => {
37710
- let {
37711
- value,
37712
- name,
37713
- props,
37714
- formsValue,
37715
- addressData
37716
- } = _ref49;
37717
- let {
37718
- inputMeta,
37719
- isHighlighted
37720
- } = _ref50;
37732
+ geolocation: ({
37733
+ value,
37734
+ name,
37735
+ props,
37736
+ formsValue,
37737
+ addressData
37738
+ }, {
37739
+ inputMeta,
37740
+ isHighlighted
37741
+ }) => {
37721
37742
  let search = formsValue.country;
37722
37743
  if (addressData && Object.keys(addressData).length > 0) {
37723
37744
  if (addressData.country) {
37724
37745
  search = addressData.country;
37725
37746
  }
37726
37747
  if (addressData.level1) {
37727
- search = "".concat(addressData.level1, ", ").concat(addressData.country);
37748
+ search = `${addressData.level1}, ${addressData.country}`;
37728
37749
  }
37729
37750
  if (addressData.level2) {
37730
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37751
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37731
37752
  }
37732
37753
  } else {
37733
37754
  const country = countriesList.countries[formsValue.country] || {};
@@ -37735,10 +37756,10 @@ const inputTypeComponent$1 = {
37735
37756
  search = country.name;
37736
37757
  }
37737
37758
  if (formsValue.administrativeLevel1Name) {
37738
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37759
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37739
37760
  }
37740
37761
  if (formsValue.administrativeLevel2Name) {
37741
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37762
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37742
37763
  }
37743
37764
  }
37744
37765
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37752,36 +37773,34 @@ const inputTypeComponent$1 = {
37752
37773
  searchValue: search
37753
37774
  });
37754
37775
  },
37755
- ajaxSelect: (_ref51, _ref52) => {
37756
- let {
37757
- call,
37758
- automaticallyLink,
37759
- name,
37760
- inputName,
37761
- props,
37762
- formsValue,
37763
- onNewSetValue,
37764
- multiple,
37765
- updateOptions,
37766
- repeatValues,
37767
- repeatIndex,
37768
- value,
37769
- unique,
37770
- address,
37771
- addressData = {},
37772
- getFromLinking,
37773
- input
37774
- } = _ref51;
37775
- let {
37776
- form,
37777
- forms,
37778
- setAddress,
37779
- changeInputMeta,
37780
- inputMeta,
37781
- meta,
37782
- isHighlighted,
37783
- groupFormId
37784
- } = _ref52;
37776
+ ajaxSelect: ({
37777
+ call,
37778
+ automaticallyLink,
37779
+ name,
37780
+ inputName,
37781
+ props,
37782
+ formsValue,
37783
+ onNewSetValue,
37784
+ multiple,
37785
+ updateOptions,
37786
+ repeatValues,
37787
+ repeatIndex,
37788
+ value,
37789
+ unique,
37790
+ address,
37791
+ addressData = {},
37792
+ getFromLinking,
37793
+ input
37794
+ }, {
37795
+ form,
37796
+ forms,
37797
+ setAddress,
37798
+ changeInputMeta,
37799
+ inputMeta,
37800
+ meta,
37801
+ isHighlighted,
37802
+ groupFormId
37803
+ }) => {
37785
37804
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37786
37805
  size: "medium",
37787
37806
  input: input,
@@ -37818,7 +37837,9 @@ const inputTypeComponent$1 = {
37818
37837
  const selectedValue = data.find(v => v.value === ev);
37819
37838
  if (address && selectedValue) {
37820
37839
  dot__default["default"].str(address, selectedValue.label, addressData);
37821
- setAddress(_objectSpread2({}, addressData));
37840
+ setAddress({
37841
+ ...addressData
37842
+ });
37822
37843
  }
37823
37844
  }
37824
37845
  },
@@ -37827,11 +37848,10 @@ const inputTypeComponent$1 = {
37827
37848
  address: true
37828
37849
  });
37829
37850
  },
37830
- tag: _ref53 => {
37831
- let {
37832
- value,
37833
- repeatLabel
37834
- } = _ref53;
37851
+ tag: ({
37852
+ value,
37853
+ repeatLabel
37854
+ }) => {
37835
37855
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37836
37856
  size: "large",
37837
37857
  allowClear: true,
@@ -37839,28 +37859,26 @@ const inputTypeComponent$1 = {
37839
37859
  newPlaceholder: repeatLabel
37840
37860
  });
37841
37861
  },
37842
- modal: (_ref54, _ref55) => {
37843
- let {
37844
- call,
37845
- automaticallyLink,
37846
- name,
37847
- inputName,
37848
- props,
37849
- formsValue,
37850
- allFormsValue,
37851
- onNewSetValue,
37852
- repeatValues,
37853
- repeatIndex,
37854
- value,
37855
- modalTitle,
37856
- totalInputs,
37857
- shownInputs,
37858
- allowDupplicates
37859
- } = _ref54;
37860
- let {
37861
- form,
37862
- add
37863
- } = _ref55;
37862
+ modal: ({
37863
+ call,
37864
+ automaticallyLink,
37865
+ name,
37866
+ inputName,
37867
+ props,
37868
+ formsValue,
37869
+ allFormsValue,
37870
+ onNewSetValue,
37871
+ repeatValues,
37872
+ repeatIndex,
37873
+ value,
37874
+ modalTitle,
37875
+ totalInputs,
37876
+ shownInputs,
37877
+ allowDupplicates
37878
+ }, {
37879
+ form,
37880
+ add
37881
+ }) => {
37864
37882
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37865
37883
  allowClear: true,
37866
37884
  call: call,
@@ -37883,44 +37901,40 @@ const inputTypeComponent$1 = {
37883
37901
  allowDupplicates: allowDupplicates
37884
37902
  });
37885
37903
  },
37886
- dataLink: (_ref56, _ref57) => {
37887
- var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37888
- let {
37889
- setValues,
37890
- name,
37891
- onValuesChange,
37892
- changeLinking,
37893
- formsValue,
37894
- input,
37895
- call,
37896
- automaticallyLink,
37897
- inputName,
37898
- props,
37899
- onNewSetValue,
37900
- multiple,
37901
- updateOptions,
37902
- repeatValues,
37903
- repeatIndex,
37904
- value,
37905
- unique,
37906
- address,
37907
- addressData = {},
37908
- getFromLinking
37909
- } = _ref56;
37910
- let {
37911
- form,
37912
- forms,
37913
- setAddress,
37914
- changeInputMeta,
37915
- inputMeta,
37916
- meta,
37917
- isHighlighted,
37918
- groupFormId
37919
- } = _ref57;
37920
- 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") {
37921
- var _formsValue$groupForm3, _input$meta13, _input$meta14;
37922
- const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37923
- (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()::::";
37904
+ dataLink: ({
37905
+ setValues,
37906
+ name,
37907
+ onValuesChange,
37908
+ changeLinking,
37909
+ formsValue,
37910
+ input,
37911
+ call,
37912
+ automaticallyLink,
37913
+ inputName,
37914
+ props,
37915
+ onNewSetValue,
37916
+ multiple,
37917
+ updateOptions,
37918
+ repeatValues,
37919
+ repeatIndex,
37920
+ value,
37921
+ unique,
37922
+ address,
37923
+ addressData = {},
37924
+ getFromLinking
37925
+ }, {
37926
+ form,
37927
+ forms,
37928
+ setAddress,
37929
+ changeInputMeta,
37930
+ inputMeta,
37931
+ meta,
37932
+ isHighlighted,
37933
+ groupFormId
37934
+ }) => {
37935
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37936
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37937
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37924
37938
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37925
37939
  size: "medium",
37926
37940
  input: input,
@@ -37957,7 +37971,9 @@ const inputTypeComponent$1 = {
37957
37971
  const selectedValue = data.find(v => v.value === ev);
37958
37972
  if (address && selectedValue) {
37959
37973
  dot__default["default"].str(address, selectedValue.label, addressData);
37960
- setAddress(_objectSpread2({}, addressData));
37974
+ setAddress({
37975
+ ...addressData
37976
+ });
37961
37977
  }
37962
37978
  }
37963
37979
  },
@@ -37967,93 +37983,138 @@ const inputTypeComponent$1 = {
37967
37983
  isDataLink: true
37968
37984
  });
37969
37985
  }
37970
- const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37971
- 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));
37986
+ const isSingle = input?.meta?.maxRepeat === 1;
37987
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37988
+ ...(formsValue[groupFormId] || {})[name]
37989
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
37990
+ ...v
37991
+ })) : isSingle ? formsValue[name] ? [{
37992
+ ...formsValue[name]
37993
+ }] : [] : (formsValue[name] || []).map(v => ({
37994
+ ...v
37995
+ }));
37972
37996
  const onUpdate = (editData, i) => {
37973
- const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
37997
+ const val = {
37998
+ ...formData[i],
37999
+ ...editData
38000
+ };
37974
38001
  const _val = isSingle ? {
37975
38002
  [name]: val
37976
38003
  } : {
37977
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
38004
+ [name]: formData?.map((d, j) => i === j ? val : d)
37978
38005
  };
37979
38006
  if (groupFormId) {
37980
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37981
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37982
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38007
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38008
+ const _newData = {
38009
+ ..._defaultData,
38010
+ ..._val
38011
+ };
38012
+ onValuesChange(_newData, {
38013
+ ...formsValue,
37983
38014
  [groupFormId]: _newData
37984
- }));
37985
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37986
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38015
+ });
38016
+ form?.setFieldValue(groupFormId, _newData);
38017
+ setValues({
38018
+ ...formsValue,
37987
38019
  [groupFormId]: _newData
37988
- }));
38020
+ });
37989
38021
  return;
37990
38022
  }
37991
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37992
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37993
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38023
+ onValuesChange(_val, {
38024
+ ...formsValue,
38025
+ ..._val
38026
+ });
38027
+ form?.setFieldValue(name, _val[name]);
38028
+ setValues({
38029
+ ...formsValue,
38030
+ ..._val
38031
+ });
37994
38032
  };
37995
- if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
37996
- var _formsValue$meta4, _input$meta17;
38033
+ if (input?.meta?.flat) {
37997
38034
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
37998
38035
  form: input,
37999
38036
  changeLinking: changeLinking,
38000
38037
  onUpdate: onUpdate,
38001
38038
  isHighlighted: isHighlighted,
38002
38039
  formsValue: formsValue,
38003
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38040
+ values: groupFormId ? {
38041
+ ...(formsValue[groupFormId] || {}),
38004
38042
  meta: {
38005
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
38043
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38006
38044
  }
38007
- }) : formsValue,
38045
+ } : formsValue,
38008
38046
  name: name,
38009
38047
  groupFormId: groupFormId,
38010
- maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
38011
- remove: _ref58 => {
38012
- let {
38013
- key
38014
- } = _ref58;
38048
+ maxRepeat: input?.meta?.maxRepeat,
38049
+ remove: ({
38050
+ key
38051
+ }) => {
38015
38052
  const _val = isSingle ? {
38016
38053
  [name]: null
38017
38054
  } : {
38018
38055
  [name]: formData.filter((v, i) => i !== key)
38019
38056
  };
38020
38057
  if (groupFormId) {
38021
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38022
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38023
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38058
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38059
+ const _newData = {
38060
+ ..._defaultData,
38061
+ ..._val
38062
+ };
38063
+ onValuesChange(_newData, {
38064
+ ...formsValue,
38024
38065
  [groupFormId]: _newData
38025
- }));
38026
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38027
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38066
+ });
38067
+ form?.setFieldValue(groupFormId, _newData);
38068
+ setValues({
38069
+ ...formsValue,
38028
38070
  [groupFormId]: _newData
38029
- }));
38071
+ });
38030
38072
  return;
38031
38073
  }
38032
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38033
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38034
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38074
+ onValuesChange(_val, {
38075
+ ...formsValue,
38076
+ ..._val
38077
+ });
38078
+ form?.setFieldValue(name, _val[name]);
38079
+ setValues({
38080
+ ...formsValue,
38081
+ ..._val
38082
+ });
38035
38083
  },
38036
38084
  add: val => {
38037
38085
  const _val = isSingle ? {
38038
38086
  [name]: val
38039
38087
  } : {
38040
- [name]: [...formData, _objectSpread2({}, val)]
38088
+ [name]: [...formData, {
38089
+ ...val
38090
+ }]
38041
38091
  };
38042
38092
  if (groupFormId) {
38043
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38044
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38045
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38046
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38093
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38094
+ const _newData = {
38095
+ ..._defaultData,
38096
+ ..._val
38097
+ };
38098
+ form?.setFieldValue(groupFormId, _newData);
38099
+ onValuesChange(_newData, {
38100
+ ...formsValue,
38047
38101
  [groupFormId]: _newData
38048
- }));
38049
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38102
+ });
38103
+ setValues({
38104
+ ...formsValue,
38050
38105
  [groupFormId]: _newData
38051
- }));
38106
+ });
38052
38107
  return;
38053
38108
  }
38054
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38055
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38056
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38109
+ form?.setFieldValue(name, _val[name]);
38110
+ onValuesChange(_val, {
38111
+ ...formsValue,
38112
+ ..._val
38113
+ });
38114
+ setValues({
38115
+ ...formsValue,
38116
+ ..._val
38117
+ });
38057
38118
  },
38058
38119
  k: name,
38059
38120
  formData: formData
@@ -38065,79 +38126,101 @@ const inputTypeComponent$1 = {
38065
38126
  onUpdate: onUpdate,
38066
38127
  isHighlighted: isHighlighted,
38067
38128
  formsValue: formsValue,
38068
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
38129
+ values: groupFormId ? {
38130
+ ...(formsValue[groupFormId] || {}),
38069
38131
  meta: {
38070
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
38132
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
38071
38133
  }
38072
- }) : formsValue,
38134
+ } : formsValue,
38073
38135
  name: name,
38074
38136
  groupFormId: groupFormId,
38075
- maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
38076
- remove: _ref59 => {
38077
- let {
38078
- key
38079
- } = _ref59;
38137
+ maxRepeat: input?.meta?.maxRepeat,
38138
+ remove: ({
38139
+ key
38140
+ }) => {
38080
38141
  const _val = isSingle ? {
38081
38142
  [name]: null
38082
38143
  } : {
38083
38144
  [name]: formData.filter((v, i) => i !== key)
38084
38145
  };
38085
38146
  if (groupFormId) {
38086
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38087
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38088
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38147
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38148
+ const _newData = {
38149
+ ..._defaultData,
38150
+ ..._val
38151
+ };
38152
+ onValuesChange(_newData, {
38153
+ ...formsValue,
38089
38154
  [groupFormId]: _newData
38090
- }));
38091
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38092
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38155
+ });
38156
+ form?.setFieldValue(groupFormId, _newData);
38157
+ setValues({
38158
+ ...formsValue,
38093
38159
  [groupFormId]: _newData
38094
- }));
38160
+ });
38095
38161
  return;
38096
38162
  }
38097
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38098
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38099
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38163
+ onValuesChange(_val, {
38164
+ ...formsValue,
38165
+ ..._val
38166
+ });
38167
+ form?.setFieldValue(name, _val[name]);
38168
+ setValues({
38169
+ ...formsValue,
38170
+ ..._val
38171
+ });
38100
38172
  },
38101
38173
  add: val => {
38102
38174
  const _val = isSingle ? {
38103
38175
  [name]: val
38104
38176
  } : {
38105
- [name]: [...formData, _objectSpread2({}, val)]
38177
+ [name]: [...formData, {
38178
+ ...val
38179
+ }]
38106
38180
  };
38107
38181
  if (groupFormId) {
38108
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38109
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38110
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38111
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38182
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38183
+ const _newData = {
38184
+ ..._defaultData,
38185
+ ..._val
38186
+ };
38187
+ form?.setFieldValue(groupFormId, _newData);
38188
+ onValuesChange(_newData, {
38189
+ ...formsValue,
38112
38190
  [groupFormId]: _newData
38113
- }));
38114
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38191
+ });
38192
+ setValues({
38193
+ ...formsValue,
38115
38194
  [groupFormId]: _newData
38116
- }));
38195
+ });
38117
38196
  return;
38118
38197
  }
38119
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38120
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38121
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38198
+ form?.setFieldValue(name, _val[name]);
38199
+ onValuesChange(_val, {
38200
+ ...formsValue,
38201
+ ..._val
38202
+ });
38203
+ setValues({
38204
+ ...formsValue,
38205
+ ..._val
38206
+ });
38122
38207
  },
38123
38208
  k: name,
38124
38209
  formData: formData
38125
38210
  });
38126
38211
  },
38127
- dataLinkGroup: (_ref60, _ref61) => {
38128
- let {
38129
- setValues,
38130
- name,
38131
- onValuesChange,
38132
- changeLinking,
38133
- formsValue,
38134
- input
38135
- } = _ref60;
38136
- let {
38137
- form,
38138
- groupFormId,
38139
- isHighlighted
38140
- } = _ref61;
38212
+ dataLinkGroup: ({
38213
+ setValues,
38214
+ name,
38215
+ onValuesChange,
38216
+ changeLinking,
38217
+ formsValue,
38218
+ input
38219
+ }, {
38220
+ form,
38221
+ groupFormId,
38222
+ isHighlighted
38223
+ }) => {
38141
38224
  return renderDataLinkGroup({
38142
38225
  input,
38143
38226
  name,
@@ -38150,41 +38233,51 @@ const inputTypeComponent$1 = {
38150
38233
  isHighlighted
38151
38234
  });
38152
38235
  },
38153
- groupCheckbox: (_ref62, _ref63) => {
38154
- let {
38155
- setValues,
38156
- name,
38157
- onValuesChange,
38158
- formsValue,
38159
- input
38160
- } = _ref62;
38161
- let {
38162
- form,
38163
- groupFormId,
38164
- isHighlighted
38165
- } = _ref63;
38236
+ groupCheckbox: ({
38237
+ setValues,
38238
+ name,
38239
+ onValuesChange,
38240
+ formsValue,
38241
+ input
38242
+ }, {
38243
+ form,
38244
+ groupFormId,
38245
+ isHighlighted
38246
+ }) => {
38166
38247
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
38167
38248
  const onUpdate = (val, key) => {
38168
38249
  const _val = {
38169
- [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
38250
+ [name]: {
38251
+ ...formData,
38170
38252
  [key]: val
38171
- })
38253
+ }
38172
38254
  };
38173
38255
  if (groupFormId) {
38174
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
38175
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
38176
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38256
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38257
+ const _newData = {
38258
+ ..._defaultData,
38259
+ ..._val
38260
+ };
38261
+ onValuesChange(_newData, {
38262
+ ...formsValue,
38177
38263
  [groupFormId]: _newData
38178
- }));
38179
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
38180
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38264
+ });
38265
+ form?.setFieldValue(groupFormId, _newData);
38266
+ setValues({
38267
+ ...formsValue,
38181
38268
  [groupFormId]: _newData
38182
- }));
38269
+ });
38183
38270
  return;
38184
38271
  }
38185
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
38186
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
38187
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38272
+ onValuesChange(_val, {
38273
+ ...formsValue,
38274
+ ..._val
38275
+ });
38276
+ form?.setFieldValue(name, _val[name]);
38277
+ setValues({
38278
+ ...formsValue,
38279
+ ..._val
38280
+ });
38188
38281
  };
38189
38282
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
38190
38283
  form: input,
@@ -38193,91 +38286,96 @@ const inputTypeComponent$1 = {
38193
38286
  isHighlighted: isHighlighted
38194
38287
  });
38195
38288
  },
38196
- website: (_ref64, _ref65) => {
38197
- let {
38198
- name,
38199
- inputName,
38200
- props,
38201
- value,
38202
- repeatIndex,
38203
- repeatValues,
38204
- formsValue
38205
- } = _ref64;
38206
- let {
38207
- form,
38208
- isHighlighted,
38209
- inputMeta = {},
38210
- t
38211
- } = _ref65;
38212
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38289
+ website: ({
38290
+ name,
38291
+ inputName,
38292
+ props,
38293
+ value,
38294
+ repeatIndex,
38295
+ repeatValues,
38296
+ formsValue
38297
+ }, {
38298
+ form,
38299
+ isHighlighted,
38300
+ inputMeta = {},
38301
+ t
38302
+ }) => {
38303
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
38213
38304
  size: "large",
38214
38305
  allowClear: true,
38215
- initialValue: value
38216
- }, props), {}, {
38306
+ initialValue: value,
38307
+ ...props,
38217
38308
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
38218
38309
  className: formatClassname([isHighlighted && "highlighted-cont"]),
38219
38310
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
38220
38311
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
38221
- }));
38312
+ });
38222
38313
  },
38223
- group: (_ref66, _ref67) => {
38224
- let {
38225
- props,
38226
- groupInputs,
38227
- formsValue
38228
- } = _ref66;
38229
- let {
38230
- inputMeta,
38231
- isHighlighted
38232
- } = _ref67;
38233
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38314
+ group: ({
38315
+ props,
38316
+ groupInputs,
38317
+ formsValue
38318
+ }, {
38319
+ inputMeta,
38320
+ isHighlighted
38321
+ }) => {
38322
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38234
38323
  formsValue: formsValue,
38235
38324
  isHighlighted: isHighlighted,
38236
38325
  groupInputs: groupInputs,
38237
- inputMeta: inputMeta
38238
- }, props));
38326
+ inputMeta: inputMeta,
38327
+ ...props
38328
+ });
38239
38329
  },
38240
- groupInputs: (_ref68, _ref69) => {
38241
- let {
38242
- props,
38243
- groupInputs,
38244
- formsValue
38245
- } = _ref68;
38246
- let {
38247
- inputMeta,
38248
- isHighlighted
38249
- } = _ref69;
38250
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38330
+ groupInputs: ({
38331
+ props,
38332
+ groupInputs,
38333
+ formsValue
38334
+ }, {
38335
+ inputMeta,
38336
+ isHighlighted
38337
+ }) => {
38338
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
38251
38339
  formsValue: formsValue,
38252
38340
  isHighlighted: isHighlighted,
38253
38341
  groupInputs: groupInputs,
38254
- inputMeta: inputMeta
38255
- }, props));
38342
+ inputMeta: inputMeta,
38343
+ ...props
38344
+ });
38256
38345
  },
38257
- smartHelp: (_ref70, _ref71) => {
38346
+ smartHelp: ({
38347
+ name,
38348
+ inputName,
38349
+ props,
38350
+ value,
38351
+ repeatIndex,
38352
+ repeatValues,
38353
+ formsValue
38354
+ }, {
38355
+ form,
38356
+ isHighlighted,
38357
+ inputMeta = {},
38358
+ t
38359
+ }) => {
38258
38360
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
38259
38361
  }
38260
38362
  };
38261
38363
  const filterForm = (f, d) => {
38262
38364
  return f && (f.showFormIf ? showHideForm(f, d) : true);
38263
38365
  };
38264
- const checkFormHasSubsections = function () {
38265
- let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38266
- return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38267
- };
38366
+ const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
38268
38367
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
38269
- const _ref72 = f[key] || {},
38270
- {
38271
- label,
38272
- description = "",
38273
- excludeFromEdit,
38274
- showFormIf,
38275
- icon = "",
38276
- position = 0,
38277
- template,
38278
- formClass
38279
- } = _ref72,
38280
- fc = _objectWithoutProperties(_ref72, _excluded2$1);
38368
+ const {
38369
+ label,
38370
+ description = "",
38371
+ excludeFromEdit,
38372
+ showFormIf,
38373
+ icon = "",
38374
+ position = 0,
38375
+ template,
38376
+ formClass,
38377
+ ...fc
38378
+ } = f[key] || {};
38281
38379
  const fConf = {
38282
38380
  id: key,
38283
38381
  label,
@@ -38336,14 +38434,11 @@ const groupSubForms = (fConf, d) => {
38336
38434
  return f;
38337
38435
  }, {});
38338
38436
  };
38339
- const inputIsEmpty = function () {
38340
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38341
- let values = arguments.length > 1 ? arguments[1] : undefined;
38342
- let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
38343
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38437
+ const inputIsEmpty = (input = {}, values, inputMeta) => {
38438
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
38344
38439
  return false;
38345
38440
  }
38346
- if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38441
+ if (input?.type === "groupInputs") {
38347
38442
  return true;
38348
38443
  }
38349
38444
  const value = values[input.dataId];
@@ -38355,28 +38450,26 @@ const inputIsEmpty = function () {
38355
38450
  }
38356
38451
  return !value;
38357
38452
  };
38358
- const GetFormItem$1 = _ref73 => {
38359
- var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
38360
- let {
38361
- highlightMandatory,
38362
- inputData,
38363
- inputId,
38364
- input,
38365
- values,
38366
- MainForm,
38367
- options,
38368
- plainForms,
38369
- setValues,
38370
- setAddress,
38371
- i,
38372
- inputKey,
38373
- onValuesChange = () => {},
38374
- setLoading = () => {},
38375
- inputMeta = {},
38376
- changeInputMeta = () => {},
38377
- changeLinking = () => {},
38378
- namespace
38379
- } = _ref73;
38453
+ const GetFormItem$1 = ({
38454
+ highlightMandatory,
38455
+ inputData,
38456
+ inputId,
38457
+ input,
38458
+ values,
38459
+ MainForm,
38460
+ options,
38461
+ plainForms,
38462
+ setValues,
38463
+ setAddress,
38464
+ i,
38465
+ inputKey,
38466
+ onValuesChange = () => {},
38467
+ setLoading = () => {},
38468
+ inputMeta = {},
38469
+ changeInputMeta = () => {},
38470
+ changeLinking = () => {},
38471
+ namespace
38472
+ }) => {
38380
38473
  const {
38381
38474
  t,
38382
38475
  user,
@@ -38391,42 +38484,44 @@ const GetFormItem$1 = _ref73 => {
38391
38484
  staticWidth,
38392
38485
  fullWidth
38393
38486
  } = useEditContext();
38394
- 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];
38487
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
38395
38488
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
38396
38489
  const inputLabel = getInputLabel$1(input, values);
38397
38490
  const onClickReviewSuccess = () => {
38398
38491
  if (!isReview) {
38399
38492
  return;
38400
38493
  }
38401
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38494
+ const reviewSuccess = lastReview?.reviewSuccess;
38402
38495
  changeInputMeta({
38403
38496
  key: inputId,
38404
38497
  type: input.type,
38405
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38498
+ value: {
38499
+ ...inputMeta,
38406
38500
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38407
38501
  reviewer: user,
38408
38502
  createdAt: new Date().toISOString(),
38409
38503
  reviewSuccess: true
38410
38504
  }]
38411
- })
38505
+ }
38412
38506
  });
38413
38507
  };
38414
38508
  const onClickReviewError = () => {
38415
38509
  if (!isReview) {
38416
38510
  return;
38417
38511
  }
38418
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38512
+ const reviewError = lastReview?.reviewError;
38419
38513
  changeInputMeta({
38420
38514
  key: inputId,
38421
38515
  type: input.type,
38422
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38516
+ value: {
38517
+ ...inputMeta,
38423
38518
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
38424
38519
  reviewer: user,
38425
38520
  createdAt: new Date().toISOString(),
38426
38521
  reviewError: true,
38427
38522
  comment: ""
38428
38523
  }]
38429
- })
38524
+ }
38430
38525
  });
38431
38526
  };
38432
38527
  switch (input.type) {
@@ -38440,12 +38535,12 @@ const GetFormItem$1 = _ref73 => {
38440
38535
  case "header":
38441
38536
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
38442
38537
  className: "daf-title with-subtitle",
38443
- style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38538
+ style: input?.meta?.style,
38444
38539
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38445
38540
  className: "flex",
38446
38541
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
38447
38542
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
38448
- }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38543
+ }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38449
38544
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
38450
38545
  className: "tooltip-popover-cont",
38451
38546
  children: ReactHtmlParser__default["default"](input.description)
@@ -38472,7 +38567,7 @@ const GetFormItem$1 = _ref73 => {
38472
38567
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38473
38568
 
38474
38569
  // eslint-disable-next-line no-case-declarations
38475
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38570
+ let maxRule = rules.find(rule => rule.max)?.max;
38476
38571
  if (!maxRule && input.type === "textarea") {
38477
38572
  maxRule = MAX_TEXT_AREA_LENGTH;
38478
38573
  }
@@ -38485,30 +38580,27 @@ const GetFormItem$1 = _ref73 => {
38485
38580
  message: requiredRule.message || ""
38486
38581
  });
38487
38582
  }
38488
- 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);
38583
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38489
38584
  if (requiredRule || specialCharsRule) {
38490
38585
  if (input.type === "groupInputs") {
38491
38586
  rules = rules.map(r => {
38492
38587
  if (r.required) {
38493
- return _ref74 => {
38494
- let {
38495
- getFieldValue
38496
- } = _ref74;
38497
- return {
38498
- validator() {
38499
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38500
- return Promise.resolve();
38501
- }
38502
- const keys = Object.keys(input.inputs);
38503
- for (let i = 0; i < keys.length; i++) {
38504
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38505
- return Promise.reject(r.message);
38506
- }
38507
- }
38588
+ return ({
38589
+ getFieldValue
38590
+ }) => ({
38591
+ validator() {
38592
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38508
38593
  return Promise.resolve();
38509
38594
  }
38510
- };
38511
- };
38595
+ const keys = Object.keys(input.inputs);
38596
+ for (let i = 0; i < keys.length; i++) {
38597
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38598
+ return Promise.reject(r.message);
38599
+ }
38600
+ }
38601
+ return Promise.resolve();
38602
+ }
38603
+ });
38512
38604
  }
38513
38605
  return r;
38514
38606
  });
@@ -38546,13 +38638,12 @@ const GetFormItem$1 = _ref73 => {
38546
38638
  }
38547
38639
  }
38548
38640
  if (input && typeof input === "object") {
38549
- 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;
38550
38641
  // check if input is valid
38551
38642
  const hideComment = namespace === "project-readiness";
38552
38643
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38553
38644
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38554
38645
  className: "flex-row input-cont",
38555
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38646
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38556
38647
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38557
38648
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38558
38649
  className: formatClassname(["ml-4 input-actions"]),
@@ -38562,7 +38653,7 @@ const GetFormItem$1 = _ref73 => {
38562
38653
  title: t("Add review note"),
38563
38654
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38564
38655
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38565
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38656
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38566
38657
  type: "link",
38567
38658
  onClick: onClickReviewError,
38568
38659
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38578,7 +38669,7 @@ const GetFormItem$1 = _ref73 => {
38578
38669
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38579
38670
  type: "link",
38580
38671
  onClick: onClickReviewSuccess,
38581
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38672
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38582
38673
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38583
38674
  name: "CheckSquare",
38584
38675
  width: 16,
@@ -38615,7 +38706,7 @@ const GetFormItem$1 = _ref73 => {
38615
38706
  }
38616
38707
  });
38617
38708
  },
38618
- disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38709
+ disabled: !input.meta?.notApplicable,
38619
38710
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38620
38711
  name: "NotApplicable",
38621
38712
  width: 16,
@@ -38629,7 +38720,7 @@ const GetFormItem$1 = _ref73 => {
38629
38720
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38630
38721
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38631
38722
  type: "link",
38632
- disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38723
+ disabled: !input.meta?.notAvailable,
38633
38724
  onClick: () => {
38634
38725
  const value = getDefaultInputValue(input);
38635
38726
  MainForm.setFields([{
@@ -38661,14 +38752,14 @@ const GetFormItem$1 = _ref73 => {
38661
38752
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38662
38753
  title: t("Add comment"),
38663
38754
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38664
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38755
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38665
38756
  type: "link",
38666
- disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38667
- }, !isShown ? {
38668
- className: "default p-0"
38669
- } : {
38670
- className: "p-0 primary"
38671
- }), {}, {
38757
+ disabled: !input.meta?.comment,
38758
+ ...(!isShown ? {
38759
+ className: "default p-0"
38760
+ } : {
38761
+ className: "p-0 primary"
38762
+ }),
38672
38763
  onClick: () => {
38673
38764
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38674
38765
  return;
@@ -38687,7 +38778,7 @@ const GetFormItem$1 = _ref73 => {
38687
38778
  width: 16,
38688
38779
  height: 16
38689
38780
  })
38690
- }))
38781
+ })
38691
38782
  })
38692
38783
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38693
38784
  title: t("Project Readiness"),
@@ -38706,34 +38797,36 @@ const GetFormItem$1 = _ref73 => {
38706
38797
  }) : null]
38707
38798
  }) : null
38708
38799
  }),
38709
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38710
- }, inputOnBlur.includes(input.type) ? {
38711
- trigger: "onBlur"
38712
- } : {}), ["total100", "group"].includes(input.type) ? {} : {
38713
- name: inputId,
38714
- fieldKey: inputId,
38715
- initialValue: inputData.value
38716
- }), ["upload"].includes(input.type) ? {
38717
- valuePropName: "fileList",
38718
- getValueFromEvent: e => {
38719
- if (Array.isArray(e)) {
38720
- return e;
38721
- }
38722
- return e && e.fileList && e.fileList.map(f => {
38723
- if (f.response) {
38724
- return f.response;
38800
+ initialValue: inputMeta?.defaultValue,
38801
+ ...(inputOnBlur.includes(input.type) ? {
38802
+ trigger: "onBlur"
38803
+ } : {}),
38804
+ ...(["total100", "group"].includes(input.type) ? {} : {
38805
+ name: inputId,
38806
+ fieldKey: inputId,
38807
+ initialValue: inputData.value
38808
+ }),
38809
+ ...(["upload"].includes(input.type) ? {
38810
+ valuePropName: "fileList",
38811
+ getValueFromEvent: e => {
38812
+ if (Array.isArray(e)) {
38813
+ return e;
38725
38814
  }
38726
- return f;
38727
- });
38728
- }
38729
- } : {}), {}, {
38730
- className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38815
+ return e && e.fileList && e.fileList.map(f => {
38816
+ if (f.response) {
38817
+ return f.response;
38818
+ }
38819
+ return f;
38820
+ });
38821
+ }
38822
+ } : {}),
38823
+ className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38731
38824
  "data-id": inputData.name,
38732
38825
  rules: rules,
38733
38826
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38734
38827
  labelCol: 12,
38735
38828
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38736
- className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38829
+ className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38737
38830
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38738
38831
  className: "mr-1",
38739
38832
  children: getInputLabel$1(input, values)
@@ -38746,7 +38839,7 @@ const GetFormItem$1 = _ref73 => {
38746
38839
  config: input,
38747
38840
  t: t,
38748
38841
  ajaxForms: ajaxForms,
38749
- 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),
38842
+ linkingData: values?.linking || values?.parent?.linking,
38750
38843
  changeAjaxForms: changeAjaxForms,
38751
38844
  getApiBaseUrl: getApiBaseUrl,
38752
38845
  getAppHeader: getAppHeader,
@@ -38754,11 +38847,12 @@ const GetFormItem$1 = _ref73 => {
38754
38847
  getToken: getToken,
38755
38848
  app: app,
38756
38849
  valueOnlyString: true
38757
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
38850
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38851
+ ...inputData,
38758
38852
  maxWidth,
38759
38853
  staticWidth,
38760
38854
  fullWidth
38761
- }), {
38855
+ }, {
38762
38856
  form: MainForm,
38763
38857
  forms: options,
38764
38858
  allForms: plainForms,
@@ -38779,10 +38873,10 @@ const GetFormItem$1 = _ref73 => {
38779
38873
  staticWidth,
38780
38874
  fullWidth
38781
38875
  }) : console.log(input)
38782
- })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38876
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38783
38877
  className: "code",
38784
38878
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38785
- children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38879
+ children: input.meta?.code
38786
38880
  })
38787
38881
  }) : null]
38788
38882
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38802,10 +38896,10 @@ const GetFormItem$1 = _ref73 => {
38802
38896
  className: "max-char-span",
38803
38897
  children: t("max-char", {
38804
38898
  chars: maxRule,
38805
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38899
+ filled: inputData?.value?.length || 0
38806
38900
  })
38807
38901
  })
38808
- }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38902
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38809
38903
  className: "input-content",
38810
38904
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38811
38905
  className: "comment-textarea",
@@ -38831,7 +38925,7 @@ const GetFormItem$1 = _ref73 => {
38831
38925
  },
38832
38926
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38833
38927
  type: "link",
38834
- disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38928
+ disabled: !input.meta?.comment,
38835
38929
  className: "p-0",
38836
38930
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38837
38931
  width: 16,
@@ -38840,11 +38934,12 @@ const GetFormItem$1 = _ref73 => {
38840
38934
  })
38841
38935
  })]
38842
38936
  }),
38843
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38937
+ children: inputTypeComponent$1.comment({
38938
+ ...inputData,
38844
38939
  maxWidth,
38845
38940
  staticWidth,
38846
38941
  fullWidth
38847
- }), {
38942
+ }, {
38848
38943
  form: MainForm,
38849
38944
  forms: options,
38850
38945
  setFormValues: setValues,
@@ -38869,16 +38964,16 @@ const GetFormItem$1 = _ref73 => {
38869
38964
  className: "max-char-span",
38870
38965
  children: t("max-char", {
38871
38966
  chars: MAX_COMMENTS_LENGTH,
38872
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38967
+ filled: inputData?.commentValue?.length || 0
38873
38968
  })
38874
38969
  })]
38875
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38970
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38876
38971
  className: "input-content",
38877
38972
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38878
38973
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38879
38974
  className: "comment-textarea",
38880
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38881
- name: "".concat(inputId, "-reviewErrorComment"),
38975
+ initialValue: lastReview?.comment || "",
38976
+ name: `${inputId}-reviewErrorComment`,
38882
38977
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38883
38978
  className: "flex w-100",
38884
38979
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38886,28 +38981,31 @@ const GetFormItem$1 = _ref73 => {
38886
38981
  children: t("Review note")
38887
38982
  })
38888
38983
  }),
38889
- children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
38984
+ children: inputTypeComponent$1.comment({
38985
+ ...inputData,
38890
38986
  maxWidth,
38891
38987
  staticWidth,
38892
38988
  fullWidth
38893
- }), {
38989
+ }, {
38894
38990
  form: MainForm,
38895
38991
  forms: options,
38896
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38992
+ value: lastReview?.comment || "",
38897
38993
  onChange: val => {
38898
38994
  changeInputMeta({
38899
38995
  key: inputId,
38900
38996
  type: input.type,
38901
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38902
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
38997
+ value: {
38998
+ ...inputMeta,
38999
+ reviews: (inputMeta?.reviews || []).map(v => {
38903
39000
  if (v.createdAt === lastReview.createdAt) {
38904
- return _objectSpread2(_objectSpread2({}, v), {}, {
39001
+ return {
39002
+ ...v,
38905
39003
  comment: val
38906
- });
39004
+ };
38907
39005
  }
38908
39006
  return v;
38909
39007
  })
38910
- })
39008
+ }
38911
39009
  });
38912
39010
  },
38913
39011
  t,
@@ -38921,7 +39019,7 @@ const GetFormItem$1 = _ref73 => {
38921
39019
  className: "max-char-span",
38922
39020
  children: t("max-char", {
38923
39021
  chars: MAX_COMMENTS_LENGTH,
38924
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
39022
+ filled: lastReview.comment?.length || 0
38925
39023
  })
38926
39024
  })]
38927
39025
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -38942,7 +39040,7 @@ const GetFormItem$1 = _ref73 => {
38942
39040
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38943
39041
  className: "flex flex-column justify-center mr-1",
38944
39042
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38945
- 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")
39043
+ children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38946
39044
  })
38947
39045
  })]
38948
39046
  })]
@@ -38953,14 +39051,13 @@ const GetFormItem$1 = _ref73 => {
38953
39051
  return null;
38954
39052
  }
38955
39053
  };
38956
- const editErrorHandler = _ref76 => {
38957
- let {
38958
- errorFields,
38959
- t = s => s
38960
- } = _ref76;
39054
+ const editErrorHandler = ({
39055
+ errorFields,
39056
+ t = s => s
39057
+ }) => {
38961
39058
  if (Array.isArray(errorFields) && errorFields.length) {
38962
39059
  const name = errorFields[0].name.join(".");
38963
- const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
39060
+ const element = document.querySelector(`[data-id="${name}"]`);
38964
39061
  if (element) {
38965
39062
  element.scrollIntoView();
38966
39063
  antd.message.error(t("errors::please-correct-invalid-inputs"));