datastake-daf 0.6.843 → 0.6.845

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4827,7 +4827,7 @@ const config$2 = {
4827
4827
  AddDocument: config$3
4828
4828
  };
4829
4829
 
4830
- const _excluded$F = ["width", "height", "size", "name", "fill"];
4830
+ const _excluded$E = ["width", "height", "size", "name", "fill"];
4831
4831
  const CustomIcon = _ref => {
4832
4832
  let {
4833
4833
  width = 14,
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
4836
4836
  name = "",
4837
4837
  fill = "none"
4838
4838
  } = _ref,
4839
- props = _objectWithoutProperties(_ref, _excluded$F);
4839
+ props = _objectWithoutProperties(_ref, _excluded$E);
4840
4840
  const conf = config$2[name];
4841
4841
  if (conf) {
4842
4842
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
5125
5125
  !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
5126
5126
  });
5127
5127
 
5128
- const _excluded$E = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5128
+ const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5129
5129
  dayjs__default["default"].extend(customParseFormat);
5130
5130
  dayjs__default["default"].extend(utc);
5131
5131
  dayjs__default["default"].extend(utc);
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
5501
5501
  createdAt,
5502
5502
  updatedAt
5503
5503
  } = data,
5504
- rest = _objectWithoutProperties(data, _excluded$E);
5504
+ rest = _objectWithoutProperties(data, _excluded$D);
5505
5505
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5506
5506
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5507
5507
  meta: _meta
@@ -6044,7 +6044,7 @@ SelectFilters.propTypes = {
6044
6044
  apiUrl: PropTypes__default["default"].string
6045
6045
  };
6046
6046
 
6047
- const _excluded$D = ["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"];
6047
+ const _excluded$C = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
6048
6048
  function DAFTable(_ref) {
6049
6049
  let {
6050
6050
  columns = [],
@@ -6075,7 +6075,7 @@ function DAFTable(_ref) {
6075
6075
  app,
6076
6076
  doEmptyRows
6077
6077
  } = _ref,
6078
- rest = _objectWithoutProperties(_ref, _excluded$D);
6078
+ rest = _objectWithoutProperties(_ref, _excluded$C);
6079
6079
  const source = React.useMemo(() => {
6080
6080
  if (data && Array.isArray(data)) {
6081
6081
  return data;
@@ -6900,7 +6900,7 @@ function ComponentWithFocus(_ref) {
6900
6900
  }
6901
6901
 
6902
6902
  var _templateObject$h;
6903
- const _excluded$C = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6903
+ const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6904
6904
  function StickyTable(_ref) {
6905
6905
  let {
6906
6906
  size = "small",
@@ -6911,7 +6911,7 @@ function StickyTable(_ref) {
6911
6911
  pagination = false,
6912
6912
  doEmptyRows = true
6913
6913
  } = _ref,
6914
- props = _objectWithoutProperties(_ref, _excluded$C);
6914
+ props = _objectWithoutProperties(_ref, _excluded$B);
6915
6915
  const data = React__default["default"].useMemo(() => {
6916
6916
  if (!doEmptyRows) {
6917
6917
  return dataSource;
@@ -7439,7 +7439,7 @@ const BTN_SIZE = {
7439
7439
  LG: 'large'
7440
7440
  };
7441
7441
 
7442
- const _excluded$B = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7442
+ const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7443
7443
  function DafButton(_ref) {
7444
7444
  let {
7445
7445
  content = '',
@@ -7453,7 +7453,7 @@ function DafButton(_ref) {
7453
7453
  style = {},
7454
7454
  className = ''
7455
7455
  } = _ref,
7456
- restProps = _objectWithoutProperties(_ref, _excluded$B);
7456
+ restProps = _objectWithoutProperties(_ref, _excluded$A);
7457
7457
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7458
7458
  icon: icon,
7459
7459
  type: type,
@@ -7572,12 +7572,12 @@ const Style$R = styled__default["default"].div`
7572
7572
  }
7573
7573
  `;
7574
7574
 
7575
- const _excluded$A = ["children"];
7575
+ const _excluded$z = ["children"];
7576
7576
  const BorderedButton = _ref => {
7577
7577
  let {
7578
7578
  children
7579
7579
  } = _ref,
7580
- props = _objectWithoutProperties(_ref, _excluded$A);
7580
+ props = _objectWithoutProperties(_ref, _excluded$z);
7581
7581
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7582
7582
  className: "d-btn-cont",
7583
7583
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7717,12 +7717,12 @@ Badge.propTypes = {
7717
7717
  props: PropTypes__default["default"].object
7718
7718
  };
7719
7719
 
7720
- const _excluded$z = ["icon"];
7720
+ const _excluded$y = ["icon"];
7721
7721
  function GetIcon(_ref) {
7722
7722
  let {
7723
7723
  icon
7724
7724
  } = _ref,
7725
- props = _objectWithoutProperties(_ref, _excluded$z);
7725
+ props = _objectWithoutProperties(_ref, _excluded$y);
7726
7726
  let Icon = Icons__namespace.CloseOutlined;
7727
7727
  if (Icons__namespace[icon]) {
7728
7728
  Icon = Icons__namespace[icon];
@@ -8052,7 +8052,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8052
8052
  }
8053
8053
  `;
8054
8054
 
8055
- const _excluded$y = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8055
+ const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8056
8056
  const {
8057
8057
  useToken: useToken$p
8058
8058
  } = antd.theme;
@@ -8145,7 +8145,7 @@ function Multiselect(_ref) {
8145
8145
  isSingle = false,
8146
8146
  selectionType = SELECTION_TYPES.DEFAULT
8147
8147
  } = _ref,
8148
- restProps = _objectWithoutProperties(_ref, _excluded$y);
8148
+ restProps = _objectWithoutProperties(_ref, _excluded$x);
8149
8149
  const {
8150
8150
  token
8151
8151
  } = useToken$p();
@@ -8865,7 +8865,7 @@ DAFHeader.propTypes = {
8865
8865
  filtersConfig: PropTypes__default["default"].any
8866
8866
  };
8867
8867
 
8868
- const _excluded$x = ["tabs", "onChange", "value", "className"];
8868
+ const _excluded$w = ["tabs", "onChange", "value", "className"];
8869
8869
  function TabsHeader(_ref) {
8870
8870
  let {
8871
8871
  tabs = [],
@@ -8873,7 +8873,7 @@ function TabsHeader(_ref) {
8873
8873
  value = '',
8874
8874
  className = 'mt-2'
8875
8875
  } = _ref,
8876
- rest = _objectWithoutProperties(_ref, _excluded$x);
8876
+ rest = _objectWithoutProperties(_ref, _excluded$w);
8877
8877
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8878
8878
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8879
8879
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8970,7 +8970,7 @@ DrawerHeader.propTypes = {
8970
8970
  tabsConfig: PropTypes__default["default"].any
8971
8971
  };
8972
8972
 
8973
- const _excluded$w = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8973
+ const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8974
8974
  const useFooter = _ref => {
8975
8975
  let {
8976
8976
  leftContent,
@@ -9005,7 +9005,7 @@ const useFooter = _ref => {
9005
9005
  style = {},
9006
9006
  className = ""
9007
9007
  } = button,
9008
- restProps = _objectWithoutProperties(button, _excluded$w);
9008
+ restProps = _objectWithoutProperties(button, _excluded$v);
9009
9009
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
9010
9010
  content: label,
9011
9011
  type: type,
@@ -11886,7 +11886,7 @@ Widget.propTypes = {
11886
11886
  };
11887
11887
  Widget.displayName = 'Widget';
11888
11888
 
11889
- const _excluded$v = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11889
+ const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11890
11890
  function ImageWidget(_ref) {
11891
11891
  let {
11892
11892
  loading = false,
@@ -11897,7 +11897,7 @@ function ImageWidget(_ref) {
11897
11897
  noDescriptionText,
11898
11898
  isPdf = false
11899
11899
  } = _ref,
11900
- props = _objectWithoutProperties(_ref, _excluded$v);
11900
+ props = _objectWithoutProperties(_ref, _excluded$u);
11901
11901
  const expandable = isPdf ? false : props.expandable;
11902
11902
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11903
11903
  loading: loading,
@@ -11957,7 +11957,7 @@ function ImageWidget(_ref) {
11957
11957
  ImageWidget.displayName = 'ImageWidget';
11958
11958
 
11959
11959
  var _templateObject$e;
11960
- const _excluded$u = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11960
+ const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11961
11961
  function FlowWidget(_ref) {
11962
11962
  let {
11963
11963
  title,
@@ -11969,7 +11969,7 @@ function FlowWidget(_ref) {
11969
11969
  className,
11970
11970
  direction = "horizontal"
11971
11971
  } = _ref,
11972
- rest = _objectWithoutProperties(_ref, _excluded$u);
11972
+ rest = _objectWithoutProperties(_ref, _excluded$t);
11973
11973
  const [activeTab, setActiveTab] = React.useState();
11974
11974
  React.useEffect(() => {
11975
11975
  if (defaultActiveTab) {
@@ -15700,7 +15700,7 @@ Map$3.propTypes = {
15700
15700
  link: PropTypes__default["default"].any
15701
15701
  };
15702
15702
 
15703
- const _excluded$t = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15703
+ const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15704
15704
  function InExpandableWidgetMap(_ref) {
15705
15705
  let {
15706
15706
  isExpanded,
@@ -15714,7 +15714,7 @@ function InExpandableWidgetMap(_ref) {
15714
15714
  height,
15715
15715
  widgetConfig
15716
15716
  } = _ref,
15717
- rest = _objectWithoutProperties(_ref, _excluded$t);
15717
+ rest = _objectWithoutProperties(_ref, _excluded$s);
15718
15718
  const [mapKey, setMapKey] = React.useState(0);
15719
15719
  const [isMapReady, setIsMapReady] = React.useState(false);
15720
15720
  React.useEffect(() => {
@@ -17914,14 +17914,14 @@ const MapConfig = ({
17914
17914
  });
17915
17915
  };
17916
17916
 
17917
- const _excluded$s = ["config", "title", "loading"];
17917
+ const _excluded$r = ["config", "title", "loading"];
17918
17918
  const Details = _ref => {
17919
17919
  let {
17920
17920
  config = [],
17921
17921
  title,
17922
17922
  loading = false
17923
17923
  } = _ref,
17924
- rest = _objectWithoutProperties(_ref, _excluded$s);
17924
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17925
17925
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17926
17926
  className: "with-border-header h-w-btn-header card",
17927
17927
  loading: loading,
@@ -17937,14 +17937,14 @@ const Details = _ref => {
17937
17937
  }));
17938
17938
  };
17939
17939
 
17940
- const _excluded$r = ["config", "title", "loading"];
17940
+ const _excluded$q = ["config", "title", "loading"];
17941
17941
  const KeyIndicatorsDetails = _ref => {
17942
17942
  let {
17943
17943
  config,
17944
17944
  title,
17945
17945
  loading = false
17946
17946
  } = _ref,
17947
- rest = _objectWithoutProperties(_ref, _excluded$r);
17947
+ rest = _objectWithoutProperties(_ref, _excluded$q);
17948
17948
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17949
17949
  className: "with-border-header h-w-btn-header",
17950
17950
  title: title,
@@ -17974,7 +17974,7 @@ const Style$G = styled__default["default"].div`
17974
17974
  }
17975
17975
  `;
17976
17976
 
17977
- const _excluded$q = ["children", "config", "detailsTitle", "firstColumnWidth"];
17977
+ const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
17978
17978
  const DetailsSection = _ref => {
17979
17979
  let {
17980
17980
  children,
@@ -17982,7 +17982,7 @@ const DetailsSection = _ref => {
17982
17982
  detailsTitle,
17983
17983
  firstColumnWidth = "250px"
17984
17984
  } = _ref,
17985
- rest = _objectWithoutProperties(_ref, _excluded$q);
17985
+ rest = _objectWithoutProperties(_ref, _excluded$p);
17986
17986
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17987
17987
  firstColumnWidth: firstColumnWidth,
17988
17988
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18158,14 +18158,14 @@ const getGoalConfig = () => {
18158
18158
  };
18159
18159
 
18160
18160
  var _templateObject$c;
18161
- const _excluded$p = ["title", "activeSdgGoals", "t"];
18161
+ const _excluded$o = ["title", "activeSdgGoals", "t"];
18162
18162
  function SDGWidget(_ref) {
18163
18163
  let {
18164
18164
  title = "Sustainable Development Goals",
18165
18165
  activeSdgGoals = [],
18166
18166
  t = key => key
18167
18167
  } = _ref,
18168
- props = _objectWithoutProperties(_ref, _excluded$p);
18168
+ props = _objectWithoutProperties(_ref, _excluded$o);
18169
18169
  const sdgConfig = getGoalConfig();
18170
18170
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18171
18171
  title: title,
@@ -18463,7 +18463,7 @@ function SdgList({
18463
18463
  });
18464
18464
  }
18465
18465
 
18466
- const _excluded$o = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18466
+ const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18467
18467
  const {
18468
18468
  Meta
18469
18469
  } = antd.Card;
@@ -18483,7 +18483,7 @@ function ProjectWidget(_ref) {
18483
18483
  hideSDGList = false,
18484
18484
  t = x => x
18485
18485
  } = _ref,
18486
- props = _objectWithoutProperties(_ref, _excluded$o);
18486
+ props = _objectWithoutProperties(_ref, _excluded$n);
18487
18487
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18488
18488
  const {
18489
18489
  token
@@ -18755,13 +18755,13 @@ const WidgetCard = _ref => {
18755
18755
  });
18756
18756
  };
18757
18757
 
18758
- const _excluded$n = ["title", "children"];
18758
+ const _excluded$m = ["title", "children"];
18759
18759
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18760
18760
  let {
18761
18761
  title,
18762
18762
  children
18763
18763
  } = _ref,
18764
- rest = _objectWithoutProperties(_ref, _excluded$n);
18764
+ rest = _objectWithoutProperties(_ref, _excluded$m);
18765
18765
  /**
18766
18766
  * Handles carousel slide change events
18767
18767
  * @param {number} currentSlide - The index of the current slide after change
@@ -18925,7 +18925,7 @@ const EmptyStateContainer = styled__default["default"].div`
18925
18925
  }
18926
18926
  `;
18927
18927
 
18928
- const _excluded$m = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18928
+ const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18929
18929
  function ImageCarousel(_ref) {
18930
18930
  let {
18931
18931
  title,
@@ -18940,7 +18940,7 @@ function ImageCarousel(_ref) {
18940
18940
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18941
18941
  emptyText = "No Image"
18942
18942
  } = _ref,
18943
- rest = _objectWithoutProperties(_ref, _excluded$m);
18943
+ rest = _objectWithoutProperties(_ref, _excluded$l);
18944
18944
  const [previewVisible, setPreviewVisible] = React.useState(false);
18945
18945
  const [current, setCurrent] = React.useState(0);
18946
18946
  const carouselRef = React.useRef(null);
@@ -19309,7 +19309,7 @@ const getVegetationConfig = () => {
19309
19309
  };
19310
19310
 
19311
19311
  var _templateObject$a, _templateObject2$3;
19312
- const _excluded$l = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19312
+ const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19313
19313
  function VegetationWidget(_ref) {
19314
19314
  let {
19315
19315
  title = "Vegetation Health",
@@ -19321,7 +19321,7 @@ function VegetationWidget(_ref) {
19321
19321
  growthObservations = [],
19322
19322
  t = key => key
19323
19323
  } = _ref,
19324
- props = _objectWithoutProperties(_ref, _excluded$l);
19324
+ props = _objectWithoutProperties(_ref, _excluded$k);
19325
19325
  let vegetationConfig = getVegetationConfig();
19326
19326
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19327
19327
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19437,7 +19437,7 @@ const getFaunaConfig = () => {
19437
19437
  };
19438
19438
 
19439
19439
  var _templateObject$9, _templateObject2$2;
19440
- const _excluded$k = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19440
+ const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19441
19441
  function FaunaWidget(_ref) {
19442
19442
  let {
19443
19443
  title = "Observed Fauna",
@@ -19448,7 +19448,7 @@ function FaunaWidget(_ref) {
19448
19448
  itemHeight = 100,
19449
19449
  t = key => key
19450
19450
  } = _ref,
19451
- props = _objectWithoutProperties(_ref, _excluded$k);
19451
+ props = _objectWithoutProperties(_ref, _excluded$j);
19452
19452
  let faunaConfig = getFaunaConfig();
19453
19453
 
19454
19454
  // Filter to show only specific keys if filterKeys is provided
@@ -19513,7 +19513,7 @@ const getInvasiveSpeciesConfig = () => {
19513
19513
  };
19514
19514
 
19515
19515
  var _templateObject$8, _templateObject2$1;
19516
- const _excluded$j = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19516
+ const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19517
19517
  function InvasiveSpeciesWidget(_ref) {
19518
19518
  let {
19519
19519
  title = "Invasive Species",
@@ -19525,7 +19525,7 @@ function InvasiveSpeciesWidget(_ref) {
19525
19525
  itemHeight = 100,
19526
19526
  t = key => key
19527
19527
  } = _ref,
19528
- props = _objectWithoutProperties(_ref, _excluded$j);
19528
+ props = _objectWithoutProperties(_ref, _excluded$i);
19529
19529
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19530
19530
 
19531
19531
  // Filter to show only specific keys if filterKeys is provided
@@ -24956,7 +24956,7 @@ const RepeatableModals = ({
24956
24956
  }) : null;
24957
24957
  };
24958
24958
 
24959
- const _excluded$i = ["viewGroup"],
24959
+ const _excluded$h = ["viewGroup"],
24960
24960
  _excluded2$2 = ["label", "icon", "position"];
24961
24961
  const Content$1 = _ref => {
24962
24962
  let {
@@ -25028,7 +25028,7 @@ const Content$1 = _ref => {
25028
25028
  if (groups[gKey].viewGroup === key) {
25029
25029
  // eslint-disable-next-line no-unused-vars
25030
25030
  const _groups$gKey = groups[gKey],
25031
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$i);
25031
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
25032
25032
  items[gKey] = gCfg;
25033
25033
  }
25034
25034
  return items;
@@ -25308,7 +25308,7 @@ const Content$1 = _ref => {
25308
25308
  });
25309
25309
  };
25310
25310
 
25311
- const _excluded$h = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25311
+ const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25312
25312
  function Modal(_ref) {
25313
25313
  let {
25314
25314
  t = text => text,
@@ -25324,7 +25324,7 @@ function Modal(_ref) {
25324
25324
  disabled = false,
25325
25325
  withModalFormWrapper = true
25326
25326
  } = _ref,
25327
- props = _objectWithoutProperties(_ref, _excluded$h);
25327
+ props = _objectWithoutProperties(_ref, _excluded$g);
25328
25328
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25329
25329
  width: 650,
25330
25330
  footer: null,
@@ -30816,7 +30816,6 @@ function Repeatable({
30816
30816
  });
30817
30817
  }
30818
30818
 
30819
- /* eslint-disable no-eval */
30820
30819
  const isRiskComment = inputData => {
30821
30820
  if (inputData) {
30822
30821
  if (inputData.name === 'assessment') {
@@ -30829,7 +30828,10 @@ const isRiskComment = inputData => {
30829
30828
  };
30830
30829
 
30831
30830
  // options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
30832
- function renderNestedInputs$1(options, k, ...args) {
30831
+ function renderNestedInputs$1(options, k) {
30832
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
30833
+ args[_key - 2] = arguments[_key];
30834
+ }
30833
30835
  if (options[k].repeatable) {
30834
30836
  return renderRepeatable$1(options, k, ...args);
30835
30837
  } else {
@@ -30857,10 +30859,11 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30857
30859
  children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
30858
30860
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
30859
30861
  name: formId,
30860
- children: (fields, {
30861
- add,
30862
- remove
30863
- }) => {
30862
+ children: (fields, _ref) => {
30863
+ let {
30864
+ add,
30865
+ remove
30866
+ } = _ref;
30864
30867
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
30865
30868
  if (fields.length === 0) {
30866
30869
  const formInputs = form.inputs;
@@ -30910,14 +30913,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30910
30913
  const _val = {
30911
30914
  [formId]: formData.map((d, j) => i === j ? val : d)
30912
30915
  };
30913
- onValuesChange(_val, {
30914
- ...values,
30915
- ..._val
30916
- });
30917
- setValues({
30918
- ...values,
30916
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, values), _val));
30917
+ setValues(_objectSpread2(_objectSpread2({}, values), {}, {
30919
30918
  [formId]: formData.map((d, j) => i === j ? val : d)
30920
- });
30919
+ }));
30921
30920
  };
30922
30921
  return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
30923
30922
  form: form,
@@ -30973,154 +30972,156 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
30973
30972
  highlightMandatory
30974
30973
  });
30975
30974
  };
30976
- const GroupContent = ({
30977
- form,
30978
- values = {},
30979
- i,
30980
- formId,
30981
- excludedKeys,
30982
- getData,
30983
- setValues,
30984
- MainForm,
30985
- options,
30986
- plainForms,
30987
- setAddress,
30988
- onValuesChange,
30989
- allData,
30990
- changeInputMeta,
30991
- highlightMandatory
30992
- }) => {
30975
+ const GroupContent = _ref2 => {
30976
+ var _form$meta;
30977
+ let {
30978
+ form,
30979
+ values = {},
30980
+ i,
30981
+ formId,
30982
+ excludedKeys,
30983
+ getData,
30984
+ setValues,
30985
+ MainForm,
30986
+ options,
30987
+ plainForms,
30988
+ setAddress,
30989
+ onValuesChange,
30990
+ allData,
30991
+ changeInputMeta,
30992
+ highlightMandatory
30993
+ } = _ref2;
30993
30994
  const {
30994
30995
  user,
30995
30996
  t
30996
30997
  } = useEditContext();
30997
30998
  const label = getInputLabel$1(form, values);
30998
- const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
30999
+ const notPartOfTheForm = (form === null || form === void 0 ? void 0 : form.type) === 'ajaxSubGroup' ? true : !!(form !== null && form !== void 0 && (_form$meta = form.meta) !== null && _form$meta !== void 0 && _form$meta.isSubGroup);
30999
31000
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
31000
31001
  const formValues = values[form.dataId];
31001
- const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31002
- children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
31003
- config: form.meta.groupInfo,
31004
- user: user,
31005
- t: t
31006
- }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
31007
- const isAjaxSubGroup = form?.type === "ajaxSubGroup";
31008
- const input = form.inputs[inp];
31009
- const inputId = input.dataId || inp;
31010
- const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
31011
- const value = inputValues[inputId];
31012
- const commentValue = inputValues[`${inputId}Comment`];
31013
- const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
31014
- const subtitles = form.subtitles || null;
31015
- const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
31016
- inputData.repeatIndex = undefined;
31017
- inputData.inputName = inputId;
31018
- inputData.repeatValues = inputValues;
31019
- if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31020
- inputData.groupInputs = inputData.groupInputs.map(gpI => {
31021
- gpI.data.inputName = gpI.data.name;
31022
- gpI.data.repeatIndex = undefined;
31023
- gpI.data.name = formId;
31024
- return gpI;
31025
- });
31026
- }
31027
- const isRisk = isRiskComment(inputData);
31028
- const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
31029
- const btnOnClick = () => {
31030
- if (typeof inputData.commentValue === 'string') {
31031
- onValuesChange({}, {
31032
- ...values,
31033
- [`${inputData.inputName}`]: null
31002
+ const renderInputs = () => {
31003
+ var _form$meta2;
31004
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31005
+ children: [form !== null && form !== void 0 && (_form$meta2 = form.meta) !== null && _form$meta2 !== void 0 && _form$meta2.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
31006
+ config: form.meta.groupInfo,
31007
+ user: user,
31008
+ t: t
31009
+ }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
31010
+ var _ref3, _values$meta, _values$meta2, _input$meta, _inputData$rules, _input$meta2;
31011
+ const isAjaxSubGroup = (form === null || form === void 0 ? void 0 : form.type) === "ajaxSubGroup";
31012
+ const input = form.inputs[inp];
31013
+ const inputId = input.dataId || inp;
31014
+ const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
31015
+ const value = inputValues[inputId];
31016
+ const commentValue = inputValues["".concat(inputId, "Comment")];
31017
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
31018
+ const subtitles = form.subtitles || null;
31019
+ const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? ((_ref3 = values[formId] || {}) === null || _ref3 === void 0 || (_ref3 = _ref3.meta) === null || _ref3 === void 0 || (_ref3 = _ref3.inputs) === null || _ref3 === void 0 ? void 0 : _ref3[inputId]) || {} : (((values === null || values === void 0 || (_values$meta = values.meta) === null || _values$meta === void 0 ? void 0 : _values$meta.inputs) || {})[formId] || {})[inputId] || {} : ((values === null || values === void 0 || (_values$meta2 = values.meta) === null || _values$meta2 === void 0 ? void 0 : _values$meta2.inputs) || {})[inputId] || {};
31020
+ inputData.repeatIndex = undefined;
31021
+ inputData.inputName = inputId;
31022
+ inputData.repeatValues = inputValues;
31023
+ if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31024
+ inputData.groupInputs = inputData.groupInputs.map(gpI => {
31025
+ gpI.data.inputName = gpI.data.name;
31026
+ gpI.data.repeatIndex = undefined;
31027
+ gpI.data.name = formId;
31028
+ return gpI;
31034
31029
  });
31035
31030
  }
31036
- const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31037
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31038
- if (Array.isArray(values[formId])) {
31039
- values[formId] = inputValues;
31040
- } else {
31041
- values[formId] = inputValues;
31042
- }
31043
- setValues({
31044
- ...values
31045
- });
31046
- };
31047
- const btnOnClick2 = () => {
31048
- if (typeof inputData.commentValue !== 'string') {
31031
+ const isRisk = isRiskComment(inputData);
31032
+ const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.mandatory) && inputIsEmpty(input, inputValues, inputMeta);
31033
+ const btnOnClick = () => {
31034
+ if (typeof inputData.commentValue === 'string') {
31035
+ onValuesChange({}, _objectSpread2(_objectSpread2({}, values), {}, {
31036
+ ["".concat(inputData.inputName)]: null
31037
+ }));
31038
+ }
31049
31039
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31050
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31040
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31051
31041
  if (Array.isArray(values[formId])) {
31052
31042
  values[formId] = inputValues;
31053
31043
  } else {
31054
31044
  values[formId] = inputValues;
31055
31045
  }
31056
- setValues({
31057
- ...values
31058
- });
31059
- }
31060
- };
31061
- const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
31062
- if (rule.metaIf && typeof rule.metaIf === 'string') {
31063
- const [name, cond, value] = rule.metaIf.split(' ');
31064
- const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
31065
- if (cond === 'is') {
31066
- return !!val?.[value];
31046
+ setValues(_objectSpread2({}, values));
31047
+ };
31048
+ const btnOnClick2 = () => {
31049
+ if (typeof inputData.commentValue !== 'string') {
31050
+ const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31051
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31052
+ if (Array.isArray(values[formId])) {
31053
+ values[formId] = inputValues;
31054
+ } else {
31055
+ values[formId] = inputValues;
31056
+ }
31057
+ setValues(_objectSpread2({}, values));
31067
31058
  }
31068
- }
31069
- return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31070
- });
31071
- const requiredRule = rules.find(r => r.required);
31072
- if (requiredRule && input.type === 'text') {
31073
- rules.push({
31074
- whitespace: true,
31075
- message: requiredRule.message || ''
31059
+ };
31060
+ const rules = inputData !== null && inputData !== void 0 && (_inputData$rules = inputData.rules) !== null && _inputData$rules !== void 0 && _inputData$rules.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.rules) || []).filter(rule => {
31061
+ if (rule.metaIf && typeof rule.metaIf === 'string') {
31062
+ var _values$meta3, _values$meta4;
31063
+ const [name, cond, value] = rule.metaIf.split(' ');
31064
+ const val = name.includes('./') ? values === null || values === void 0 || (_values$meta3 = values.meta) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3.inputs) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3[formId]) === null || _values$meta3 === void 0 ? void 0 : _values$meta3[name.split('./')[1]] : values === null || values === void 0 || (_values$meta4 = values.meta) === null || _values$meta4 === void 0 || (_values$meta4 = _values$meta4.inputs) === null || _values$meta4 === void 0 ? void 0 : _values$meta4[name.split('./')[1]];
31065
+ if (cond === 'is') {
31066
+ return !!(val !== null && val !== void 0 && val[value]);
31067
+ }
31068
+ }
31069
+ return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31076
31070
  });
31077
- }
31078
- return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31079
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31080
- style: {
31081
- position: 'relative'
31082
- },
31083
- children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31084
- input: input,
31085
- inputTypeComponent: inputTypeComponent$1,
31086
- inputData: inputData,
31087
- MainForm: MainForm,
31088
- options: options,
31089
- setValues: setValues,
31090
- formId: formId,
31091
- inputId: inputId,
31092
- inputOnBlur: inputOnBlur,
31093
- values: values,
31094
- getInputLabel: getInputLabel$1,
31095
- plainForms: plainForms,
31096
- setAddress: setAddress,
31097
- btnOnClick: btnOnClick,
31098
- btnOnClick2: btnOnClick2,
31099
- locationName: (allData || {}).locationName,
31100
- subGroupTitle: (allData || {}).subGroupTitle
31101
- }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31102
- values,
31103
- formId,
31104
- setValues,
31105
- MainForm,
31106
- options,
31107
- plainForms,
31108
- setAddress,
31109
- inputData,
31110
- inputId,
31111
- input,
31112
- rules,
31113
- inputMeta,
31114
- changeInputMeta,
31115
- notPartOfTheForm,
31116
- isAjaxSubGroup,
31117
- isHighlighted
31118
- })]
31119
- }, ii)
31120
- }, `${i}${ii}`) : null;
31121
- })]
31122
- });
31123
- const isNa = formValues?.valuation === 'na';
31071
+ const requiredRule = rules.find(r => r.required);
31072
+ if (requiredRule && input.type === 'text') {
31073
+ rules.push({
31074
+ whitespace: true,
31075
+ message: requiredRule.message || ''
31076
+ });
31077
+ }
31078
+ return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31079
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31080
+ style: {
31081
+ position: 'relative'
31082
+ },
31083
+ children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31084
+ input: input,
31085
+ inputTypeComponent: inputTypeComponent$1,
31086
+ inputData: inputData,
31087
+ MainForm: MainForm,
31088
+ options: options,
31089
+ setValues: setValues,
31090
+ formId: formId,
31091
+ inputId: inputId,
31092
+ inputOnBlur: inputOnBlur,
31093
+ values: values,
31094
+ getInputLabel: getInputLabel$1,
31095
+ plainForms: plainForms,
31096
+ setAddress: setAddress,
31097
+ btnOnClick: btnOnClick,
31098
+ btnOnClick2: btnOnClick2,
31099
+ locationName: (allData || {}).locationName,
31100
+ subGroupTitle: (allData || {}).subGroupTitle
31101
+ }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31102
+ values,
31103
+ formId,
31104
+ setValues,
31105
+ MainForm,
31106
+ options,
31107
+ plainForms,
31108
+ setAddress,
31109
+ inputData,
31110
+ inputId,
31111
+ input,
31112
+ rules,
31113
+ inputMeta,
31114
+ changeInputMeta,
31115
+ notPartOfTheForm,
31116
+ isAjaxSubGroup,
31117
+ isHighlighted
31118
+ })]
31119
+ }, ii)
31120
+ }, "".concat(i).concat(ii)) : null;
31121
+ })]
31122
+ });
31123
+ };
31124
+ const isNa = (formValues === null || formValues === void 0 ? void 0 : formValues.valuation) === 'na';
31124
31125
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31125
31126
  children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
31126
31127
  className: "risk-header",
@@ -31128,44 +31129,46 @@ const GroupContent = ({
31128
31129
  children: label
31129
31130
  })
31130
31131
  }) : /*#__PURE__*/jsxRuntime.jsx("h3", {
31131
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
31132
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
31132
31133
  children: label
31133
31134
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
31134
- className: `repeatable ${hasLabel ? "mb-4" : ""}`,
31135
+ className: "repeatable ".concat(hasLabel ? "mb-4" : ""),
31135
31136
  children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
31136
31137
  children: getInputProp(form.titleLabel, values)
31137
- }) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31138
+ }) : null, formValues !== null && formValues !== void 0 && formValues.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31138
31139
  t: t,
31139
31140
  isNa: isNa,
31140
31141
  isSuccess: !isNa
31141
31142
  // TODO: translate
31142
31143
  ,
31143
31144
  config: {
31144
- title: t(`No ${formValues?.stage || 'planning'} required`)
31145
+ title: t("No ".concat((formValues === null || formValues === void 0 ? void 0 : formValues.stage) || 'planning', " required"))
31145
31146
  },
31146
31147
  children: renderInputs()
31147
31148
  }) : renderInputs()]
31148
31149
  })]
31149
31150
  });
31150
31151
  };
31151
- const GroupContentFormItem = ({
31152
- values,
31153
- formId,
31154
- setValues,
31155
- MainForm,
31156
- options,
31157
- plainForms,
31158
- setAddress,
31159
- inputData,
31160
- inputId,
31161
- input,
31162
- rules,
31163
- inputMeta,
31164
- changeInputMeta,
31165
- notPartOfTheForm = true,
31166
- isAjaxSubGroup,
31167
- isHighlighted
31168
- }) => {
31152
+ const GroupContentFormItem = _ref4 => {
31153
+ var _rules$find, _inputMeta$reviews, _input$meta3, _values$formId, _input$meta4, _input$meta7, _input$meta8, _input$meta9, _values$meta10, _values$meta11, _values$parent, _input$meta10, _input$meta11, _inputData$value, _input$meta12, _input$meta13, _inputMeta$comment, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
31154
+ let {
31155
+ values,
31156
+ formId,
31157
+ setValues,
31158
+ MainForm,
31159
+ options,
31160
+ plainForms,
31161
+ setAddress,
31162
+ inputData,
31163
+ inputId,
31164
+ input,
31165
+ rules,
31166
+ inputMeta,
31167
+ changeInputMeta,
31168
+ notPartOfTheForm = true,
31169
+ isAjaxSubGroup,
31170
+ isHighlighted
31171
+ } = _ref4;
31169
31172
  const {
31170
31173
  t,
31171
31174
  user,
@@ -31179,10 +31182,10 @@ const GroupContentFormItem = ({
31179
31182
  staticWidth,
31180
31183
  fullWidth
31181
31184
  } = useEditContext();
31182
- const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
31183
- let maxRule = rules.find(rule => rule.max)?.max;
31185
+ const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
31186
+ let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
31184
31187
  const requiredRule = rules.find(r => r.required);
31185
- const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
31188
+ 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];
31186
31189
  if (!maxRule && input.type === 'textarea') {
31187
31190
  maxRule = MAX_TEXT_AREA_LENGTH;
31188
31191
  }
@@ -31201,38 +31204,35 @@ const GroupContentFormItem = ({
31201
31204
  }
31202
31205
  setIsShown(true);
31203
31206
  if (notPartOfTheForm || isAjaxSubGroup) {
31204
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31207
+ var _values$meta5;
31208
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
31205
31209
  const _defaultData = MainForm.getFieldValue(formId);
31206
31210
  if (isAjaxSubGroup) {
31211
+ var _defaultData$meta, _defaultData$meta2;
31207
31212
  changeInputMeta({
31208
31213
  key: formId,
31209
31214
  type: input.type,
31210
31215
  otherValues: {
31211
- [formId]: {
31212
- ..._defaultData,
31216
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31213
31217
  meta: {
31214
- inputs: {
31215
- ...(_defaultData?.meta?.inputs || {}),
31216
- [inputId]: {
31217
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31218
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta = _defaultData.meta) === null || _defaultData$meta === void 0 ? void 0 : _defaultData$meta.inputs) || {}), {}, {
31219
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta2 = _defaultData.meta) === null || _defaultData$meta2 === void 0 ? void 0 : _defaultData$meta2.inputs) || {})[inputId] || {}), {}, {
31218
31220
  comment: ''
31219
- }
31220
- }
31221
+ })
31222
+ })
31221
31223
  }
31222
- }
31224
+ })
31223
31225
  }
31224
31226
  });
31225
31227
  } else {
31226
31228
  changeInputMeta({
31227
31229
  key: formId,
31228
31230
  type: input.type,
31229
- value: {
31230
- ..._defaultMeta,
31231
- [inputId]: {
31232
- ...(_defaultMeta[inputId] || {}),
31231
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31232
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31233
31233
  comment: ''
31234
- }
31235
- }
31234
+ })
31235
+ })
31236
31236
  });
31237
31237
  }
31238
31238
  } else {
@@ -31249,62 +31249,58 @@ const GroupContentFormItem = ({
31249
31249
  if (!isReview) {
31250
31250
  return;
31251
31251
  }
31252
- const reviewSuccess = lastReview?.reviewSuccess;
31252
+ const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
31253
31253
  if (notPartOfTheForm || isAjaxSubGroup) {
31254
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31254
+ var _values$meta6;
31255
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
31255
31256
  const _defaultData = MainForm.getFieldValue(formId);
31256
31257
  if (isAjaxSubGroup) {
31258
+ var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
31257
31259
  changeInputMeta({
31258
31260
  key: formId,
31259
31261
  type: input.type,
31260
31262
  otherValues: {
31261
- [formId]: {
31262
- ..._defaultData,
31263
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31263
31264
  meta: {
31264
- inputs: {
31265
- ...(_defaultData?.meta?.inputs || {}),
31266
- [inputId]: {
31267
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31268
- reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31265
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta3 = _defaultData.meta) === null || _defaultData$meta3 === void 0 ? void 0 : _defaultData$meta3.inputs) || {}), {}, {
31266
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta4 = _defaultData.meta) === null || _defaultData$meta4 === void 0 ? void 0 : _defaultData$meta4.inputs) || {})[inputId] || {}), {}, {
31267
+ reviews: reviewSuccess ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta5 = _defaultData.meta) === null || _defaultData$meta5 === void 0 ? void 0 : _defaultData$meta5.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta6 = _defaultData.meta) === null || _defaultData$meta6 === void 0 ? void 0 : _defaultData$meta6.inputs) || {})[inputId] || {}).reviews || []), {
31269
31268
  reviewer: user,
31270
31269
  createdAt: new Date().toISOString(),
31271
31270
  reviewSuccess: true
31272
31271
  }]
31273
- }
31274
- }
31272
+ })
31273
+ })
31275
31274
  }
31276
- }
31275
+ })
31277
31276
  }
31278
31277
  });
31279
31278
  } else {
31280
31279
  changeInputMeta({
31281
31280
  key: formId,
31282
31281
  type: input.type,
31283
- value: {
31284
- ..._defaultMeta,
31285
- [inputId]: {
31286
- ...(_defaultMeta[inputId] || {}),
31282
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31283
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31287
31284
  reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31288
31285
  reviewer: user,
31289
31286
  createdAt: new Date().toISOString(),
31290
31287
  reviewSuccess: true
31291
31288
  }]
31292
- }
31293
- }
31289
+ })
31290
+ })
31294
31291
  });
31295
31292
  }
31296
31293
  } else {
31297
31294
  changeInputMeta({
31298
31295
  key: inputId,
31299
31296
  type: input.type,
31300
- value: {
31301
- ...inputMeta,
31297
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31302
31298
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31303
31299
  reviewer: user,
31304
31300
  createdAt: new Date().toISOString(),
31305
31301
  reviewSuccess: true
31306
31302
  }]
31307
- }
31303
+ })
31308
31304
  });
31309
31305
  }
31310
31306
  };
@@ -31312,118 +31308,111 @@ const GroupContentFormItem = ({
31312
31308
  if (!isReview) {
31313
31309
  return;
31314
31310
  }
31315
- const reviewError = lastReview?.reviewError;
31311
+ const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
31316
31312
  if (notPartOfTheForm || isAjaxSubGroup) {
31317
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31313
+ var _values$meta7;
31314
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
31318
31315
  const _defaultData = MainForm.getFieldValue(formId);
31319
31316
  if (isAjaxSubGroup) {
31317
+ var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
31320
31318
  changeInputMeta({
31321
31319
  key: formId,
31322
31320
  type: input.type,
31323
31321
  otherValues: {
31324
- [formId]: {
31325
- ..._defaultData,
31322
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31326
31323
  meta: {
31327
- inputs: {
31328
- ...(_defaultData?.meta?.inputs || {}),
31329
- [inputId]: {
31330
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31331
- reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31324
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta7 = _defaultData.meta) === null || _defaultData$meta7 === void 0 ? void 0 : _defaultData$meta7.inputs) || {}), {}, {
31325
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta8 = _defaultData.meta) === null || _defaultData$meta8 === void 0 ? void 0 : _defaultData$meta8.inputs) || {})[inputId] || {}), {}, {
31326
+ reviews: reviewError ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta9 = _defaultData.meta) === null || _defaultData$meta9 === void 0 ? void 0 : _defaultData$meta9.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta10 = _defaultData.meta) === null || _defaultData$meta10 === void 0 ? void 0 : _defaultData$meta10.inputs) || {})[inputId] || {}).reviews || []), {
31332
31327
  reviewer: user,
31333
31328
  createdAt: new Date().toISOString(),
31334
31329
  reviewError: true,
31335
31330
  comment: ''
31336
31331
  }]
31337
- }
31338
- }
31332
+ })
31333
+ })
31339
31334
  }
31340
- }
31335
+ })
31341
31336
  }
31342
31337
  });
31343
31338
  } else {
31344
31339
  changeInputMeta({
31345
31340
  key: formId,
31346
31341
  type: input.type,
31347
- value: {
31348
- ..._defaultMeta,
31349
- [inputId]: {
31350
- ...(_defaultMeta[inputId] || {}),
31342
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31343
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31351
31344
  reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31352
31345
  reviewer: user,
31353
31346
  createdAt: new Date().toISOString(),
31354
31347
  reviewError: true,
31355
31348
  comment: ''
31356
31349
  }]
31357
- }
31358
- }
31350
+ })
31351
+ })
31359
31352
  });
31360
31353
  }
31361
31354
  } else {
31362
31355
  changeInputMeta({
31363
31356
  key: inputId,
31364
31357
  type: input.type,
31365
- value: {
31366
- ...inputMeta,
31358
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31367
31359
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31368
31360
  reviewer: user,
31369
31361
  createdAt: new Date().toISOString(),
31370
31362
  reviewError: true,
31371
31363
  comment: ''
31372
31364
  }]
31373
- }
31365
+ })
31374
31366
  });
31375
31367
  }
31376
31368
  };
31377
- const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
31369
+ const requiredComment = (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.notApplicable) && (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.requiredCommentOnNotApplicable) && (values === null || values === void 0 || (_values$formId = values[formId]) === null || _values$formId === void 0 ? void 0 : _values$formId.valuation) !== 'na';
31378
31370
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31379
31371
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
31380
31372
  className: "flex input-cont",
31381
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31382
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
31383
- ...(['total100', 'group'].includes(input.type) ? {} : {
31384
- name: notPartOfTheForm ? [formId, inputId] : inputId,
31385
- fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31386
- initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31387
- }),
31388
- ...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31389
- valuePropName: "fileList",
31390
- getValueFromEvent: e => {
31391
- if (Array.isArray(e)) {
31392
- return e;
31393
- }
31394
- return e && e.fileList && e.fileList.map(f => {
31395
- if (f.response) {
31396
- return f.response;
31397
- }
31398
- return f;
31399
- });
31373
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
31374
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
31375
+ }, ['total100', 'group'].includes(input.type) ? {} : {
31376
+ name: notPartOfTheForm ? [formId, inputId] : inputId,
31377
+ fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31378
+ initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31379
+ }), ['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31380
+ valuePropName: "fileList",
31381
+ getValueFromEvent: e => {
31382
+ if (Array.isArray(e)) {
31383
+ return e;
31400
31384
  }
31401
- } : {}),
31402
- ...(inputOnBlur.includes(input.type) ? {
31403
- trigger: "onBlur"
31404
- } : {}),
31385
+ return e && e.fileList && e.fileList.map(f => {
31386
+ if (f.response) {
31387
+ return f.response;
31388
+ }
31389
+ return f;
31390
+ });
31391
+ }
31392
+ } : {}), inputOnBlur.includes(input.type) ? {
31393
+ trigger: "onBlur"
31394
+ } : {}), {}, {
31405
31395
  style: input.showOnView === false ? {
31406
31396
  display: 'none'
31407
- } : {},
31408
- ...(['switch'].includes(input.type) ? {
31409
- labelCol: {
31410
- span: 20
31411
- },
31412
- style: {
31413
- ...(input.showOnView === false ? {
31414
- display: 'none'
31415
- } : {}),
31416
- flexDirection: 'row',
31417
- justifyContent: 'space-between'
31418
- }
31419
- } : {}),
31397
+ } : {}
31398
+ }, ['switch'].includes(input.type) ? {
31399
+ labelCol: {
31400
+ span: 20
31401
+ },
31402
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
31403
+ display: 'none'
31404
+ } : {}), {}, {
31405
+ flexDirection: 'row',
31406
+ justifyContent: 'space-between'
31407
+ })
31408
+ } : {}), {}, {
31420
31409
  label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
31421
- className: input?.meta?.code && "mr-10",
31410
+ className: (input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.code) && "mr-10",
31422
31411
  children: getInputLabel$1(input, values)
31423
31412
  }) : null,
31424
31413
  rules: rules,
31425
- className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
31426
- "data-id": `${formId}.${inputId}`,
31414
+ className: formatClassname([input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1 "), noActionsInputs.includes(input.type) && 'no-actions-input']),
31415
+ "data-id": "".concat(formId, ".").concat(inputId),
31427
31416
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
31428
31417
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31429
31418
  className: formatClassname(["ml-4 input-actions"]),
@@ -31433,7 +31422,7 @@ const GroupContentFormItem = ({
31433
31422
  title: t('Add review note'),
31434
31423
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31435
31424
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31436
- className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
31425
+ className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && 'primary']),
31437
31426
  type: "link",
31438
31427
  onClick: onClickReviewError,
31439
31428
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -31449,7 +31438,7 @@ const GroupContentFormItem = ({
31449
31438
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31450
31439
  type: "link",
31451
31440
  onClick: onClickReviewSuccess,
31452
- className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
31441
+ className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && 'primary']),
31453
31442
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31454
31443
  name: "CheckSquare",
31455
31444
  width: 16,
@@ -31466,65 +31455,59 @@ const GroupContentFormItem = ({
31466
31455
  className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
31467
31456
  type: "link",
31468
31457
  onClick: () => {
31458
+ var _input$meta5, _input$meta6;
31469
31459
  const value = getDefaultInputValue(input);
31470
- const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
31460
+ const commentMeta = input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.requiredCommentOnNotApplicable ? {
31471
31461
  comment: ''
31472
31462
  } : {};
31473
- if (input?.meta?.requiredCommentOnNotApplicable) {
31463
+ if (input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.requiredCommentOnNotApplicable) {
31474
31464
  setIsShown(true);
31475
31465
  }
31476
31466
  if (notPartOfTheForm || isAjaxSubGroup) {
31467
+ var _values$meta8;
31477
31468
  const _defaultData = MainForm.getFieldValue(formId);
31478
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31469
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta8 = values.meta) === null || _values$meta8 === void 0 ? void 0 : _values$meta8.inputs) || {})[formId] || {};
31479
31470
  if (isAjaxSubGroup) {
31471
+ var _defaultData$meta11;
31480
31472
  changeInputMeta({
31481
31473
  key: formId,
31482
31474
  type: input.type,
31483
31475
  otherValues: {
31484
- [formId]: {
31485
- ..._defaultData,
31476
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31486
31477
  [inputId]: value,
31487
31478
  meta: {
31488
- inputs: {
31489
- ...(_defaultData?.meta?.inputs || {}),
31490
- [inputId]: inputMeta.notApplicable ? {
31479
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta11 = _defaultData.meta) === null || _defaultData$meta11 === void 0 ? void 0 : _defaultData$meta11.inputs) || {}), {}, {
31480
+ [inputId]: inputMeta.notApplicable ? _objectSpread2({
31491
31481
  notApplicable: false,
31492
- notAvailable: false,
31493
- ...commentMeta
31494
- } : {
31482
+ notAvailable: false
31483
+ }, commentMeta) : _objectSpread2({
31495
31484
  notApplicable: true,
31496
- notAvailable: false,
31497
- ...commentMeta
31498
- }
31499
- }
31485
+ notAvailable: false
31486
+ }, commentMeta)
31487
+ })
31500
31488
  }
31501
- }
31489
+ })
31502
31490
  }
31503
31491
  });
31504
31492
  } else {
31505
31493
  changeInputMeta({
31506
31494
  key: formId,
31507
31495
  type: input.type,
31508
- value: inputMeta.notApplicable ? {
31509
- ..._defaultMeta,
31510
- [inputId]: {
31496
+ value: inputMeta.notApplicable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31497
+ [inputId]: _objectSpread2({
31511
31498
  notApplicable: false,
31512
- notAvailable: false,
31513
- ...commentMeta
31514
- }
31515
- } : {
31516
- ..._defaultMeta,
31517
- [inputId]: {
31499
+ notAvailable: false
31500
+ }, commentMeta)
31501
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31502
+ [inputId]: _objectSpread2({
31518
31503
  notApplicable: true,
31519
- notAvailable: false,
31520
- ...commentMeta
31521
- }
31522
- },
31504
+ notAvailable: false
31505
+ }, commentMeta)
31506
+ }),
31523
31507
  otherValues: {
31524
- [formId]: {
31525
- ..._defaultData,
31508
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31526
31509
  [inputId]: value
31527
- }
31510
+ })
31528
31511
  }
31529
31512
  });
31530
31513
  }
@@ -31545,7 +31528,7 @@ const GroupContentFormItem = ({
31545
31528
  });
31546
31529
  }
31547
31530
  },
31548
- disabled: !input.meta?.notApplicable,
31531
+ disabled: !((_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.notApplicable),
31549
31532
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31550
31533
  name: "NotApplicable",
31551
31534
  width: 16,
@@ -31559,24 +31542,24 @@ const GroupContentFormItem = ({
31559
31542
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31560
31543
  className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
31561
31544
  type: "link",
31562
- disabled: !input.meta?.notAvailable,
31545
+ disabled: !((_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.notAvailable),
31563
31546
  onClick: () => {
31564
31547
  const value = getDefaultInputValue(input);
31565
31548
  if (notPartOfTheForm || isAjaxSubGroup) {
31549
+ var _values$meta9;
31566
31550
  const _defaultData = MainForm.getFieldValue(formId);
31567
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31551
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta9 = values.meta) === null || _values$meta9 === void 0 ? void 0 : _values$meta9.inputs) || {})[formId] || {};
31568
31552
  if (isAjaxSubGroup) {
31569
31553
  if (isAjaxSubGroup) {
31554
+ var _defaultData$meta12;
31570
31555
  changeInputMeta({
31571
31556
  key: formId,
31572
31557
  type: input.type,
31573
31558
  otherValues: {
31574
- [formId]: {
31575
- ..._defaultData,
31559
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31576
31560
  [inputId]: value,
31577
31561
  meta: {
31578
- inputs: {
31579
- ...(_defaultData?.meta?.inputs || {}),
31562
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta12 = _defaultData.meta) === null || _defaultData$meta12 === void 0 ? void 0 : _defaultData$meta12.inputs) || {}), {}, {
31580
31563
  [inputId]: inputMeta.notAvailable ? {
31581
31564
  notApplicable: false,
31582
31565
  notAvailable: false
@@ -31584,9 +31567,9 @@ const GroupContentFormItem = ({
31584
31567
  notApplicable: false,
31585
31568
  notAvailable: true
31586
31569
  }
31587
- }
31570
+ })
31588
31571
  }
31589
- }
31572
+ })
31590
31573
  }
31591
31574
  });
31592
31575
  }
@@ -31594,24 +31577,21 @@ const GroupContentFormItem = ({
31594
31577
  changeInputMeta({
31595
31578
  key: formId,
31596
31579
  type: input.type,
31597
- value: inputMeta.notAvailable ? {
31598
- ..._defaultMeta,
31580
+ value: inputMeta.notAvailable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31599
31581
  [inputId]: {
31600
31582
  notApplicable: false,
31601
31583
  notAvailable: false
31602
31584
  }
31603
- } : {
31604
- ..._defaultMeta,
31585
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31605
31586
  [inputId]: {
31606
31587
  notApplicable: false,
31607
31588
  notAvailable: true
31608
31589
  }
31609
- },
31590
+ }),
31610
31591
  otherValues: {
31611
- [formId]: {
31612
- ..._defaultData,
31592
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31613
31593
  [inputId]: value
31614
- }
31594
+ })
31615
31595
  }
31616
31596
  });
31617
31597
  }
@@ -31642,38 +31622,33 @@ const GroupContentFormItem = ({
31642
31622
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
31643
31623
  title: t('Add comment'),
31644
31624
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31645
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31625
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
31646
31626
  type: "link",
31647
- disabled: !input.meta?.comment,
31648
- ...(!isShown ? {
31649
- className: 'default p-0'
31650
- } : {
31651
- className: 'p-0 primary'
31652
- }),
31627
+ disabled: !((_input$meta9 = input.meta) !== null && _input$meta9 !== void 0 && _input$meta9.comment)
31628
+ }, !isShown ? {
31629
+ className: 'default p-0'
31630
+ } : {
31631
+ className: 'p-0 primary'
31632
+ }), {}, {
31653
31633
  onClick: onClickComment,
31654
31634
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31655
31635
  name: "AddComment",
31656
31636
  width: 16,
31657
31637
  height: 16
31658
31638
  })
31659
- })
31639
+ }))
31660
31640
  })
31661
31641
  })]
31662
31642
  }) : null]
31663
31643
  }) : null
31664
31644
  }),
31665
31645
  children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
31666
- data: {
31667
- ...(values[formId] || {}),
31668
- meta: {
31669
- ...(values?.meta || {}),
31670
- inputs: {
31671
- ...(values?.meta?.inputs || {}),
31672
- ...((values?.meta?.inputs || {})[formId] || {})
31673
- }
31674
- }
31675
- },
31676
- linkingData: values?.linking || values?.parent?.linking,
31646
+ data: _objectSpread2(_objectSpread2({}, values[formId] || {}), {}, {
31647
+ meta: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 ? void 0 : values.meta) || {}), {}, {
31648
+ inputs: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 || (_values$meta10 = values.meta) === null || _values$meta10 === void 0 ? void 0 : _values$meta10.inputs) || {}), ((values === null || values === void 0 || (_values$meta11 = values.meta) === null || _values$meta11 === void 0 ? void 0 : _values$meta11.inputs) || {})[formId] || {})
31649
+ })
31650
+ }),
31651
+ 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),
31677
31652
  name: input.dataId,
31678
31653
  config: input,
31679
31654
  t: t,
@@ -31685,13 +31660,12 @@ const GroupContentFormItem = ({
31685
31660
  getToken: getToken,
31686
31661
  app: app,
31687
31662
  valueOnlyString: true
31688
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
31689
- ...inputData,
31663
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31690
31664
  name: inputId,
31691
31665
  maxWidth,
31692
31666
  staticWidth,
31693
31667
  fullWidth
31694
- }, {
31668
+ }), {
31695
31669
  form: MainForm,
31696
31670
  forms: options,
31697
31671
  allForms: plainForms,
@@ -31709,10 +31683,10 @@ const GroupContentFormItem = ({
31709
31683
  staticWidth,
31710
31684
  fullWidth
31711
31685
  }) : console.log(input)
31712
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31686
+ })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31713
31687
  className: "code",
31714
31688
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31715
- children: input.meta?.code
31689
+ children: (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.code
31716
31690
  })
31717
31691
  }) : null]
31718
31692
  }), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31732,16 +31706,16 @@ const GroupContentFormItem = ({
31732
31706
  className: "max-char-span",
31733
31707
  children: t('max-char', {
31734
31708
  chars: maxRule,
31735
- filled: inputData?.value?.length || 0
31709
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
31736
31710
  })
31737
31711
  })
31738
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31712
+ }) : null, (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31739
31713
  className: "input-content",
31740
31714
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31741
31715
  className: "comment-textarea",
31742
- initialValue: inputMeta?.comment || '',
31716
+ initialValue: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31743
31717
  hidden: !isShown,
31744
- name: `${formId}-${inputId}-comment`,
31718
+ name: "".concat(formId, "-").concat(inputId, "-comment"),
31745
31719
  required: requiredComment,
31746
31720
  rules: requiredComment ? [{
31747
31721
  required: true,
@@ -31758,38 +31732,35 @@ const GroupContentFormItem = ({
31758
31732
  onConfirm: () => {
31759
31733
  setIsShown(false);
31760
31734
  if (notPartOfTheForm) {
31761
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31735
+ var _values$meta12;
31736
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
31762
31737
  const _defaultData = MainForm.getFieldValue(formId);
31763
31738
  if (isAjaxSubGroup) {
31739
+ var _defaultData$meta13, _defaultData$meta14;
31764
31740
  changeInputMeta({
31765
31741
  key: formId,
31766
31742
  type: input.type,
31767
31743
  otherValues: {
31768
- [formId]: {
31769
- ..._defaultData,
31744
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31770
31745
  meta: {
31771
- inputs: {
31772
- ...(_defaultData?.meta?.inputs || {}),
31773
- [inputId]: {
31774
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31746
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta13 = _defaultData.meta) === null || _defaultData$meta13 === void 0 ? void 0 : _defaultData$meta13.inputs) || {}), {}, {
31747
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta14 = _defaultData.meta) === null || _defaultData$meta14 === void 0 ? void 0 : _defaultData$meta14.inputs) || {})[inputId] || {}), {}, {
31775
31748
  comment: null
31776
- }
31777
- }
31749
+ })
31750
+ })
31778
31751
  }
31779
- }
31752
+ })
31780
31753
  }
31781
31754
  });
31782
31755
  } else {
31783
31756
  changeInputMeta({
31784
31757
  key: formId,
31785
31758
  type: input.type,
31786
- value: {
31787
- ..._defaultMeta,
31788
- [inputId]: {
31789
- ...(_defaultMeta[inputId] || {}),
31759
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31760
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31790
31761
  comment: null
31791
- }
31792
- }
31762
+ })
31763
+ })
31793
31764
  });
31794
31765
  }
31795
31766
  } else {
@@ -31804,7 +31775,7 @@ const GroupContentFormItem = ({
31804
31775
  },
31805
31776
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31806
31777
  type: "link",
31807
- disabled: !input.meta?.comment,
31778
+ disabled: !((_input$meta13 = input.meta) !== null && _input$meta13 !== void 0 && _input$meta13.comment),
31808
31779
  className: "p-0",
31809
31780
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
31810
31781
  width: 16,
@@ -31816,44 +31787,41 @@ const GroupContentFormItem = ({
31816
31787
  children: inputTypeComponent$1.comment(inputData, {
31817
31788
  form: MainForm,
31818
31789
  forms: options,
31819
- value: inputMeta?.comment || '',
31790
+ value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31820
31791
  maxWidth,
31821
31792
  staticWidth,
31822
31793
  fullWidth,
31823
31794
  onChange: val => {
31824
31795
  if (notPartOfTheForm) {
31825
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31796
+ var _values$meta13;
31797
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
31826
31798
  const _defaultData = MainForm.getFieldValue(formId);
31827
31799
  if (isAjaxSubGroup) {
31800
+ var _defaultData$meta15, _defaultData$meta16;
31828
31801
  changeInputMeta({
31829
31802
  key: formId,
31830
31803
  type: input.type,
31831
31804
  otherValues: {
31832
- [formId]: {
31833
- ..._defaultData,
31805
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31834
31806
  meta: {
31835
- inputs: {
31836
- ...(_defaultData?.meta?.inputs || {}),
31837
- [inputId]: {
31838
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31807
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta15 = _defaultData.meta) === null || _defaultData$meta15 === void 0 ? void 0 : _defaultData$meta15.inputs) || {}), {}, {
31808
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta16 = _defaultData.meta) === null || _defaultData$meta16 === void 0 ? void 0 : _defaultData$meta16.inputs) || {})[inputId] || {}), {}, {
31839
31809
  comment: val
31840
- }
31841
- }
31810
+ })
31811
+ })
31842
31812
  }
31843
- }
31813
+ })
31844
31814
  }
31845
31815
  });
31846
31816
  } else {
31847
31817
  changeInputMeta({
31848
31818
  key: formId,
31849
31819
  type: input.type,
31850
- value: {
31851
- ..._defaultMeta,
31852
- [inputId]: {
31853
- ...(_defaultMeta[inputId] || {}),
31820
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31821
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31854
31822
  comment: val
31855
- }
31856
- }
31823
+ })
31824
+ })
31857
31825
  });
31858
31826
  }
31859
31827
  } else {
@@ -31874,16 +31842,16 @@ const GroupContentFormItem = ({
31874
31842
  className: "max-char-span",
31875
31843
  children: t('max-char', {
31876
31844
  chars: MAX_COMMENTS_LENGTH,
31877
- filled: inputMeta?.comment?.length || 0
31845
+ filled: (inputMeta === null || inputMeta === void 0 || (_inputMeta$comment = inputMeta.comment) === null || _inputMeta$comment === void 0 ? void 0 : _inputMeta$comment.length) || 0
31878
31846
  })
31879
31847
  })]
31880
- }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31848
+ }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31881
31849
  className: "input-content",
31882
31850
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31883
31851
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31884
31852
  className: "comment-textarea",
31885
- initialValue: lastReview?.comment || '',
31886
- name: `${formId}-${inputId}-reviewErrorComment`,
31853
+ initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31854
+ name: "".concat(formId, "-").concat(inputId, "-reviewErrorComment"),
31887
31855
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
31888
31856
  className: "flex w-100",
31889
31857
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31894,78 +31862,71 @@ const GroupContentFormItem = ({
31894
31862
  children: inputTypeComponent$1.comment(inputData, {
31895
31863
  form: MainForm,
31896
31864
  forms: options,
31897
- value: lastReview?.comment || '',
31865
+ value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31898
31866
  maxWidth,
31899
31867
  staticWidth,
31900
31868
  fullWidth,
31901
31869
  onChange: val => {
31902
31870
  if (notPartOfTheForm) {
31903
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31871
+ var _values$meta14;
31872
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
31904
31873
  const _defaultData = MainForm.getFieldValue(formId);
31905
31874
  if (isAjaxSubGroup) {
31875
+ var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
31906
31876
  changeInputMeta({
31907
31877
  key: formId,
31908
31878
  type: input.type,
31909
31879
  otherValues: {
31910
- [formId]: {
31911
- ..._defaultData,
31880
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31912
31881
  meta: {
31913
- inputs: {
31914
- ...(_defaultData?.meta?.inputs || {}),
31915
- [inputId]: {
31916
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31917
- reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
31882
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta17 = _defaultData.meta) === null || _defaultData$meta17 === void 0 ? void 0 : _defaultData$meta17.inputs) || {}), {}, {
31883
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta18 = _defaultData.meta) === null || _defaultData$meta18 === void 0 ? void 0 : _defaultData$meta18.inputs) || {})[inputId] || {}), {}, {
31884
+ reviews: ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta19 = _defaultData.meta) === null || _defaultData$meta19 === void 0 ? void 0 : _defaultData$meta19.inputs) || {})[inputId] || {}).reviews || []).map(v => {
31918
31885
  if (v.createdAt === lastReview.createdAt) {
31919
- return {
31920
- ...v,
31886
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31921
31887
  comment: val
31922
- };
31888
+ });
31923
31889
  }
31924
31890
  return v;
31925
31891
  })
31926
- }
31927
- }
31892
+ })
31893
+ })
31928
31894
  }
31929
- }
31895
+ })
31930
31896
  }
31931
31897
  });
31932
31898
  } else {
31933
31899
  changeInputMeta({
31934
31900
  key: formId,
31935
31901
  type: input.type,
31936
- value: {
31937
- ..._defaultMeta,
31938
- [inputId]: {
31939
- ...(_defaultMeta[inputId] || {}),
31902
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31903
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31940
31904
  reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
31941
31905
  if (v.createdAt === lastReview.createdAt) {
31942
- return {
31943
- ...v,
31906
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31944
31907
  comment: val
31945
- };
31908
+ });
31946
31909
  }
31947
31910
  return v;
31948
31911
  })
31949
- }
31950
- }
31912
+ })
31913
+ })
31951
31914
  });
31952
31915
  }
31953
31916
  } else {
31954
31917
  changeInputMeta({
31955
31918
  key: inputId,
31956
31919
  type: input.type,
31957
- value: {
31958
- ...inputMeta,
31959
- reviews: (inputMeta?.reviews || []).map(v => {
31920
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31921
+ reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
31960
31922
  if (v.createdAt === lastReview.createdAt) {
31961
- return {
31962
- ...v,
31923
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31963
31924
  comment: val
31964
- };
31925
+ });
31965
31926
  }
31966
31927
  return v;
31967
31928
  })
31968
- }
31929
+ })
31969
31930
  });
31970
31931
  }
31971
31932
  },
@@ -31977,7 +31938,7 @@ const GroupContentFormItem = ({
31977
31938
  className: "max-char-span",
31978
31939
  children: t('max-char', {
31979
31940
  chars: MAX_COMMENTS_LENGTH,
31980
- filled: lastReview.comment?.length || 0
31941
+ filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
31981
31942
  })
31982
31943
  })]
31983
31944
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -31998,7 +31959,7 @@ const GroupContentFormItem = ({
31998
31959
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
31999
31960
  className: "flex flex-column justify-center mr-1",
32000
31961
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
32001
- children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31962
+ 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')
32002
31963
  })
32003
31964
  })]
32004
31965
  })]
@@ -35971,7 +35932,7 @@ const beforeUpload = allowedExtensions => file => {
35971
35932
  };
35972
35933
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35973
35934
 
35974
- const _excluded$g = ["placeholder"],
35935
+ const _excluded$f = ["placeholder"],
35975
35936
  _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35976
35937
  dayjs__default["default"].extend(utc);
35977
35938
  dayjs__default["default"].extend(timezone);
@@ -36575,10 +36536,18 @@ const inputTypeComponent$1 = {
36575
36536
  }
36576
36537
  return {
36577
36538
  label: o.label,
36578
- items: opts.filter(op => op.group === o.value)
36539
+ items: opts.filter(op => {
36540
+ var _op$filters;
36541
+ return op === null || op === void 0 || (_op$filters = op.filters) === null || _op$filters === void 0 || (_op$filters = _op$filters[0]) === null || _op$filters === void 0 ? void 0 : _op$filters.value.includes(o.value);
36542
+ })
36579
36543
  };
36580
36544
  });
36581
- const notGrouped = opts.filter(op => !gKeys.includes(op.group));
36545
+ const notGrouped = opts.filter(op => {
36546
+ var _op$filters2;
36547
+ const filterValue = op === null || op === void 0 || (_op$filters2 = op.filters) === null || _op$filters2 === void 0 || (_op$filters2 = _op$filters2[0]) === null || _op$filters2 === void 0 ? void 0 : _op$filters2.value;
36548
+ if (!filterValue) return true;
36549
+ return !gKeys.some(key => filterValue.includes(key));
36550
+ });
36582
36551
  if (notGrouped.length) {
36583
36552
  groupOptions.unshift(...notGrouped);
36584
36553
  }
@@ -36741,20 +36710,23 @@ const inputTypeComponent$1 = {
36741
36710
  }
36742
36711
  return {
36743
36712
  label: o.label,
36744
- items: opts.filter(op => op.group === o.value)
36713
+ items: opts.filter(op => {
36714
+ var _op$filters3;
36715
+ return op === null || op === void 0 || (_op$filters3 = op.filters) === null || _op$filters3 === void 0 || (_op$filters3 = _op$filters3[0]) === null || _op$filters3 === void 0 ? void 0 : _op$filters3.value.includes(o.value);
36716
+ })
36745
36717
  };
36746
36718
  });
36747
- const notGrouped = opts.filter(op => !gKeys.includes(op.group));
36719
+ const notGrouped = opts.filter(op => {
36720
+ var _op$filters4;
36721
+ const filterValue = op === null || op === void 0 || (_op$filters4 = op.filters) === null || _op$filters4 === void 0 || (_op$filters4 = _op$filters4[0]) === null || _op$filters4 === void 0 ? void 0 : _op$filters4.value;
36722
+ if (!filterValue) return true;
36723
+ return !gKeys.some(key => filterValue.includes(key));
36724
+ });
36748
36725
  if (notGrouped.length) {
36749
36726
  groupOptions.unshift(...notGrouped);
36750
36727
  }
36751
36728
  opts = groupOptions;
36752
36729
  }
36753
- console.log({
36754
- maxWidth,
36755
- staticWidth,
36756
- fullWidth
36757
- });
36758
36730
  return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36759
36731
  size: "medium",
36760
36732
  allowClear: true,
@@ -36937,7 +36909,7 @@ const inputTypeComponent$1 = {
36937
36909
  },
36938
36910
  commentHint
36939
36911
  } = _ref19,
36940
- props = _objectWithoutProperties(_ref19.props, _excluded$g);
36912
+ props = _objectWithoutProperties(_ref19.props, _excluded$f);
36941
36913
  let {
36942
36914
  onChange,
36943
36915
  value,
@@ -39643,7 +39615,7 @@ function AjaxSelect(props) {
39643
39615
  }, props));
39644
39616
  }
39645
39617
 
39646
- const _excluded$f = ["placeholder"];
39618
+ /* eslint-disable no-case-declarations */
39647
39619
  const propHasValue = val => {
39648
39620
  if (Array.isArray(val)) {
39649
39621
  return val.length > 0 ? true : false;
@@ -39661,14 +39633,14 @@ const checkCondition = (condition, repeatValues, formsValue) => {
39661
39633
  return isShown;
39662
39634
  };
39663
39635
  function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
39664
- var _input$meta;
39665
- if ((input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.hidden) === true) {
39666
- var _input$meta2;
39636
+ if (input?.meta?.hidden === true) {
39667
39637
  // Set default value for hidden fields
39668
- if ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.defaultValue) !== undefined && !propHasValue(formsValue[ref])) {
39638
+ if (input?.meta?.defaultValue !== undefined && !propHasValue(formsValue[ref])) {
39669
39639
  formsValue[ref] = input.meta.defaultValue;
39670
39640
  if (setValues && typeof setValues === 'function') {
39671
- setValues(_objectSpread2({}, formsValue));
39641
+ setValues({
39642
+ ...formsValue
39643
+ });
39672
39644
  }
39673
39645
  }
39674
39646
  return false;
@@ -39727,35 +39699,35 @@ function getInputHeadLines(type, i, input, values) {
39727
39699
  switch (type) {
39728
39700
  case "h2":
39729
39701
  return /*#__PURE__*/jsxRuntime.jsx("h2", {
39730
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39702
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39731
39703
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39732
39704
  children: getInputLabel(input, values)
39733
39705
  })
39734
39706
  });
39735
39707
  case "h3":
39736
39708
  return /*#__PURE__*/jsxRuntime.jsx("h3", {
39737
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39709
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39738
39710
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39739
39711
  children: getInputLabel(input, values)
39740
39712
  })
39741
39713
  });
39742
39714
  case "h4":
39743
39715
  return /*#__PURE__*/jsxRuntime.jsx("h4", {
39744
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39716
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39745
39717
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39746
39718
  children: getInputLabel(input, values)
39747
39719
  })
39748
39720
  });
39749
39721
  case "h5":
39750
39722
  return /*#__PURE__*/jsxRuntime.jsx("h5", {
39751
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39723
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39752
39724
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39753
39725
  children: getInputLabel(input, values)
39754
39726
  })
39755
39727
  });
39756
39728
  case "h6":
39757
39729
  return /*#__PURE__*/jsxRuntime.jsx("h6", {
39758
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39730
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39759
39731
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39760
39732
  children: getInputLabel(input, values)
39761
39733
  })
@@ -39764,9 +39736,7 @@ function getInputHeadLines(type, i, input, values) {
39764
39736
  return null;
39765
39737
  }
39766
39738
  }
39767
- function getInputLabel(input) {
39768
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39769
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
39739
+ function getInputLabel(input, formsValue = {}, asText = false) {
39770
39740
  if (typeof input.label === "object") {
39771
39741
  const validations = Object.keys(input.label);
39772
39742
  const key = validations.find(v => {
@@ -39824,8 +39794,7 @@ function getInputLabel(input) {
39824
39794
  }) : ReactHtmlParser__default["default"](input.label);
39825
39795
  }
39826
39796
  }
39827
- function getSelectOptions$1(option) {
39828
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39797
+ function getSelectOptions$1(option, formsValue = {}) {
39829
39798
  if (typeof option.label === "object") {
39830
39799
  const validations = Object.keys(option.label);
39831
39800
  const key = validations.find(v => {
@@ -39849,9 +39818,7 @@ function getSectionLabel(labels, values) {
39849
39818
  }
39850
39819
  return labels;
39851
39820
  }
39852
- function getSubtitles(subtitles, position) {
39853
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
39854
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
39821
+ function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
39855
39822
  let subtitle = subtitles && subtitles[position];
39856
39823
  if (subtitle && typeof subtitle === "object") {
39857
39824
  let newSubtitle = subtitle.default || "";
@@ -39895,12 +39862,14 @@ function getSubtitles(subtitles, position) {
39895
39862
  function getFormTitles(titles, key, position) {
39896
39863
  let tilte = titles && titles[key];
39897
39864
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
39898
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
39865
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
39899
39866
  children: tilte
39900
39867
  }) : null;
39901
39868
  }
39902
39869
  const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
39903
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
39870
+ formsValue = Object.assign(formsValue, {
39871
+ ...mainForm.getFieldsValue(true)
39872
+ });
39904
39873
  if (typeof repeatIndex === "number" && repeatValues) {
39905
39874
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
39906
39875
  repeatValues[inputName] = value;
@@ -39934,52 +39903,48 @@ const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValu
39934
39903
  }
39935
39904
  };
39936
39905
  const inputTypeComponent = {
39937
- text: (_ref, _ref2) => {
39938
- let {
39939
- props,
39940
- rules
39941
- } = _ref;
39942
- let {
39943
- inputMeta = {},
39944
- t
39945
- } = _ref2;
39906
+ text: ({
39907
+ props,
39908
+ rules
39909
+ }, {
39910
+ inputMeta = {},
39911
+ t
39912
+ }) => {
39946
39913
  const maxRule = rules.find(r => r.max);
39947
39914
  const maxProps = {};
39948
39915
  if (maxRule) {
39949
39916
  maxProps.maxLength = maxRule.max;
39950
39917
  }
39951
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
39952
- size: "medium"
39953
- }, maxProps), {}, {
39918
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
39919
+ size: "medium",
39920
+ ...maxProps,
39954
39921
  allowClear: true,
39955
39922
  autoComplete: "new-password",
39956
- type: "text"
39957
- }, props), {}, {
39923
+ type: "text",
39924
+ ...props,
39958
39925
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
39959
39926
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
39960
- }));
39927
+ });
39961
39928
  },
39962
- drawTerritory: (_ref3, _ref4) => {
39963
- let {
39964
- formsValue,
39965
- name,
39966
- addressData,
39967
- onValuesChange
39968
- } = _ref3;
39969
- let {
39970
- setFormValues,
39971
- form
39972
- } = _ref4;
39929
+ drawTerritory: ({
39930
+ formsValue,
39931
+ name,
39932
+ addressData,
39933
+ onValuesChange
39934
+ }, {
39935
+ setFormValues,
39936
+ form
39937
+ }) => {
39973
39938
  let search = formsValue.country;
39974
39939
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
39975
39940
  if (addressData.address.country) {
39976
39941
  search = addressData.address.country;
39977
39942
  }
39978
39943
  if (addressData.address.level1) {
39979
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
39944
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
39980
39945
  }
39981
39946
  if (addressData.address.level2) {
39982
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
39947
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
39983
39948
  }
39984
39949
  } else {
39985
39950
  const country = countriesList.countries[formsValue.country] || {};
@@ -39987,10 +39952,10 @@ const inputTypeComponent = {
39987
39952
  search = country.name;
39988
39953
  }
39989
39954
  if (formsValue.administrativeLevel1Name) {
39990
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
39955
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
39991
39956
  }
39992
39957
  if (formsValue.administrativeLevel2Name) {
39993
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
39958
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
39994
39959
  }
39995
39960
  }
39996
39961
  console.log("search", {
@@ -40010,9 +39975,10 @@ const inputTypeComponent = {
40010
39975
  const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
40011
39976
 
40012
39977
  // Create the updated values
40013
- const updatedValues = _objectSpread2(_objectSpread2({}, allFormValues), {}, {
39978
+ const updatedValues = {
39979
+ ...allFormValues,
40014
39980
  [name]: val
40015
- });
39981
+ };
40016
39982
 
40017
39983
  // Call onValuesChange with the change and all values
40018
39984
  if (typeof onValuesChange === 'function') {
@@ -40027,44 +39993,39 @@ const inputTypeComponent = {
40027
39993
  searchValue: search
40028
39994
  });
40029
39995
  },
40030
- link: (_ref5, _ref6) => {
40031
- let {
40032
- props,
40033
- rules
40034
- } = _ref5;
40035
- let {
40036
- inputMeta = {},
40037
- t
40038
- } = _ref6;
39996
+ link: ({
39997
+ props,
39998
+ rules
39999
+ }, {
40000
+ inputMeta = {},
40001
+ t
40002
+ }) => {
40039
40003
  const maxRule = rules.find(r => r.max);
40040
40004
  const maxProps = {};
40041
40005
  if (maxRule) {
40042
40006
  maxProps.maxLength = maxRule.max;
40043
40007
  }
40044
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
40045
- size: "medium"
40046
- }, maxProps), {}, {
40008
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
40009
+ size: "medium",
40010
+ ...maxProps,
40047
40011
  allowClear: true,
40048
40012
  autoComplete: "new-password",
40049
- type: "text"
40050
- }, props), {}, {
40013
+ type: "text",
40014
+ ...props,
40051
40015
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40052
40016
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40053
- }));
40017
+ });
40054
40018
  },
40055
- number: (_ref7, _ref8) => {
40056
- var _input$meta3;
40057
- let {
40058
- props,
40059
- rules,
40060
- input
40061
- } = _ref7;
40062
- let {
40063
- inputMeta = {},
40064
- t
40065
- } = _ref8;
40019
+ number: ({
40020
+ props,
40021
+ rules,
40022
+ input
40023
+ }, {
40024
+ inputMeta = {},
40025
+ t
40026
+ }) => {
40066
40027
  const maxRule = rules.find(r => r.max);
40067
- const integerRule = !(input !== null && input !== void 0 && (_input$meta3 = input.meta) !== null && _input$meta3 !== void 0 && _input$meta3.isDecimal);
40028
+ const integerRule = !input?.meta?.isDecimal;
40068
40029
  const parser = value => {
40069
40030
  if (!value) {
40070
40031
  return "";
@@ -40075,53 +40036,50 @@ const inputTypeComponent = {
40075
40036
  return value.replace(/\$\s?|(,*)/g, "");
40076
40037
  };
40077
40038
  if (maxRule) {
40078
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40039
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40079
40040
  allowClear: true,
40080
- autoComplete: "new-password"
40081
- }, props), {}, {
40041
+ autoComplete: "new-password",
40042
+ ...props,
40082
40043
  type: "number",
40083
40044
  min: 0,
40084
40045
  max: maxRule.max,
40085
40046
  parser: parser
40086
- }));
40047
+ });
40087
40048
  }
40088
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40049
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40089
40050
  allowClear: true,
40090
- autoComplete: "new-password"
40091
- }, props), {}, {
40051
+ autoComplete: "new-password",
40052
+ ...props,
40092
40053
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40093
40054
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
40094
40055
  min: 0,
40095
40056
  formatter: value => numberWithCommas$1(value),
40096
40057
  parser: parser
40097
- }));
40058
+ });
40098
40059
  },
40099
- select: (_ref9, _ref10) => {
40100
- var _input$meta4;
40101
- let {
40102
- value,
40103
- options,
40104
- optionGroup,
40105
- props,
40106
- formsValue,
40107
- optionsFilter,
40108
- filterCond,
40109
- repeatValues,
40110
- repeatIndex,
40111
- name,
40112
- inputName,
40113
- address,
40114
- addressData,
40115
- input
40116
- } = _ref9;
40117
- let {
40118
- forms,
40119
- form,
40120
- setAddress,
40121
- inputMeta = {},
40122
- t,
40123
- changeInputMeta
40124
- } = _ref10;
40060
+ select: ({
40061
+ value,
40062
+ options,
40063
+ optionGroup,
40064
+ props,
40065
+ formsValue,
40066
+ optionsFilter,
40067
+ filterCond,
40068
+ repeatValues,
40069
+ repeatIndex,
40070
+ name,
40071
+ inputName,
40072
+ address,
40073
+ addressData,
40074
+ input
40075
+ }, {
40076
+ forms,
40077
+ form,
40078
+ setAddress,
40079
+ inputMeta = {},
40080
+ t,
40081
+ changeInputMeta
40082
+ }) => {
40125
40083
  let opts;
40126
40084
  if (typeof options === "string") {
40127
40085
  const [formName, key] = options.split(".");
@@ -40177,19 +40135,18 @@ const inputTypeComponent = {
40177
40135
  }
40178
40136
  opts = groupOptions;
40179
40137
  }
40180
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40138
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40181
40139
  autoComplete: "new-password",
40182
40140
  allowClear: true,
40183
40141
  showSearch: true,
40184
- defaultValue: input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.defaultValue,
40142
+ defaultValue: input?.meta?.defaultValue,
40185
40143
  filterOption: filterSelectOptions,
40186
- optionFilterProp: "children"
40187
- }, props), {}, {
40144
+ optionFilterProp: "children",
40145
+ ...props,
40188
40146
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40189
40147
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select one option"),
40190
40148
  onChange: (val, selectedValue) => {
40191
- var _input$meta5;
40192
- if (typeof (input === null || input === void 0 || (_input$meta5 = input.meta) === null || _input$meta5 === void 0 ? void 0 : _input$meta5.onChange) === "string") {
40149
+ if (typeof input?.meta?.onChange === "string") {
40193
40150
  const [value, otherKey, otherVal] = input.meta.onChange.split(".");
40194
40151
  if (val === value) {
40195
40152
  changeInputMeta({
@@ -40203,7 +40160,9 @@ const inputTypeComponent = {
40203
40160
  }
40204
40161
  if (address && selectedValue) {
40205
40162
  dot__default["default"].str(address, selectedValue.children, addressData);
40206
- setAddress(_objectSpread2({}, addressData));
40163
+ setAddress({
40164
+ ...addressData
40165
+ });
40207
40166
  }
40208
40167
  if (props.onChange) {
40209
40168
  props.onChange(val);
@@ -40215,35 +40174,33 @@ const inputTypeComponent = {
40215
40174
  value: og.value,
40216
40175
  disabled: og.disabled,
40217
40176
  children: og.label
40218
- }, "".concat(i).concat(j)))
40177
+ }, `${i}${j}`))
40219
40178
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40220
40179
  value: option.value,
40221
40180
  disabled: option.disabled,
40222
40181
  children: option.label
40223
40182
  }, i))
40224
- }));
40183
+ });
40225
40184
  },
40226
- multiselect: (_ref11, _ref12) => {
40227
- let {
40228
- value,
40229
- options,
40230
- optionGroup,
40231
- optionsFilter,
40232
- filterCond,
40233
- props,
40234
- formsValue,
40235
- repeatValues,
40236
- repeatIndex,
40237
- inputName,
40238
- name,
40239
- tags
40240
- } = _ref11;
40241
- let {
40242
- forms,
40243
- form,
40244
- inputMeta = {},
40245
- t
40246
- } = _ref12;
40185
+ multiselect: ({
40186
+ value,
40187
+ options,
40188
+ optionGroup,
40189
+ optionsFilter,
40190
+ filterCond,
40191
+ props,
40192
+ formsValue,
40193
+ repeatValues,
40194
+ repeatIndex,
40195
+ inputName,
40196
+ name,
40197
+ tags
40198
+ }, {
40199
+ forms,
40200
+ form,
40201
+ inputMeta = {},
40202
+ t
40203
+ }) => {
40247
40204
  let opts;
40248
40205
  if (typeof options === "string") {
40249
40206
  const [formName, key] = options.split(".");
@@ -40300,16 +40257,16 @@ const inputTypeComponent = {
40300
40257
  }
40301
40258
  opts = groupOptions;
40302
40259
  }
40303
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
40260
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40304
40261
  allowClear: true,
40305
40262
  autoComplete: "new-password",
40306
40263
  mode: tags ? "tags" : "multiple",
40307
- optionFilterProp: "children"
40308
- }, tags ? {
40309
- tokenSeparators: [",", "\n", "\t"]
40310
- } : {}), {}, {
40311
- filterOption: filterSelectOptions
40312
- }, props), {}, {
40264
+ optionFilterProp: "children",
40265
+ ...(tags ? {
40266
+ tokenSeparators: [",", "\n", "\t"]
40267
+ } : {}),
40268
+ filterOption: filterSelectOptions,
40269
+ ...props,
40313
40270
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40314
40271
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select all relevant options"),
40315
40272
  children: (opts || []).map((option, i) => option.items ? /*#__PURE__*/jsxRuntime.jsx(antd.Select.OptGroup, {
@@ -40318,42 +40275,42 @@ const inputTypeComponent = {
40318
40275
  value: og.value,
40319
40276
  disabled: og.disabled,
40320
40277
  children: og.label
40321
- }, "".concat(i).concat(j)))
40278
+ }, `${i}${j}`))
40322
40279
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40323
40280
  value: option.value,
40324
40281
  disabled: option.disabled,
40325
40282
  children: option.label
40326
40283
  }, i))
40327
- }));
40284
+ });
40328
40285
  },
40329
- date: (_ref13, _ref14) => {
40330
- let {
40331
- props,
40332
- rules,
40333
- repeatValues,
40334
- formsValue,
40335
- name
40336
- } = _ref13;
40337
- let {
40338
- inputMeta,
40339
- t,
40340
- groupFormId,
40341
- form,
40342
- setFormValues
40343
- } = _ref14;
40286
+ date: ({
40287
+ props,
40288
+ rules,
40289
+ repeatValues,
40290
+ formsValue,
40291
+ name
40292
+ }, {
40293
+ inputMeta,
40294
+ t,
40295
+ groupFormId,
40296
+ form,
40297
+ setFormValues
40298
+ }) => {
40344
40299
  const lng = localStorage.getItem("datastakeLng") || "en";
40345
40300
  const maxRule = rules.find(r => r.max);
40346
40301
  const handleDateChange = date => {
40347
40302
  if (date) {
40348
40303
  const localDate = dayjs__default["default"].utc(date);
40349
40304
  if (groupFormId) {
40350
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
40305
+ const _new = {
40306
+ ...(formsValue[groupFormId] || {}),
40351
40307
  [name]: localDate
40352
- });
40308
+ };
40353
40309
  form.setFieldValue(groupFormId, _new);
40354
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
40310
+ setFormValues({
40311
+ ...formsValue,
40355
40312
  [groupFormId]: _new
40356
- }));
40313
+ });
40357
40314
  } else {
40358
40315
  form.setFieldValue(name, localDate);
40359
40316
  }
@@ -40365,10 +40322,10 @@ const inputTypeComponent = {
40365
40322
  checkForMax = checkCondition(maxRule.condition, repeatValues, formsValue);
40366
40323
  }
40367
40324
  if (checkForMax) {
40368
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40325
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40369
40326
  allowClear: true,
40370
- autoComplete: "new-password"
40371
- }, props), {}, {
40327
+ autoComplete: "new-password",
40328
+ ...props,
40372
40329
  onChange: handleDateChange,
40373
40330
  format: DATE_FORMATS,
40374
40331
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
@@ -40377,33 +40334,31 @@ const inputTypeComponent = {
40377
40334
  disabledDate: current => {
40378
40335
  return current && current >= dayjs__default["default"]().endOf("day");
40379
40336
  }
40380
- }));
40337
+ });
40381
40338
  }
40382
40339
  }
40383
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40340
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40384
40341
  allowClear: true,
40385
- autoComplete: "new-password"
40386
- }, props), {}, {
40342
+ autoComplete: "new-password",
40343
+ ...props,
40387
40344
  onChange: handleDateChange,
40388
40345
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Select date"),
40389
40346
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40390
40347
  format: DATE_FORMATS,
40391
40348
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
40392
- }));
40349
+ });
40393
40350
  },
40394
- comment: (_ref15, _ref16) => {
40395
- let {
40396
- props: {
40397
- placeholder
40398
- },
40399
- commentHint
40400
- } = _ref15,
40401
- props = _objectWithoutProperties(_ref15.props, _excluded$f);
40402
- let {
40403
- onChange,
40404
- value
40405
- } = _ref16;
40406
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40351
+ comment: ({
40352
+ props: {
40353
+ placeholder,
40354
+ ...props
40355
+ },
40356
+ commentHint
40357
+ }, {
40358
+ onChange,
40359
+ value
40360
+ }) => {
40361
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40407
40362
  allowClear: true,
40408
40363
  value: value,
40409
40364
  onChange: e => onChange(e.target.value),
@@ -40413,60 +40368,56 @@ const inputTypeComponent = {
40413
40368
  autoSize: {
40414
40369
  minRows: 5,
40415
40370
  maxRows: 5
40416
- }
40417
- }, props), {}, {
40371
+ },
40372
+ ...props,
40418
40373
  disabled: false
40419
- }));
40374
+ });
40420
40375
  },
40421
- textarea: (_ref17, _ref18) => {
40422
- let {
40423
- props,
40424
- rules
40425
- } = _ref17;
40426
- let {
40427
- inputMeta,
40428
- t
40429
- } = _ref18;
40376
+ textarea: ({
40377
+ props,
40378
+ rules
40379
+ }, {
40380
+ inputMeta,
40381
+ t
40382
+ }) => {
40430
40383
  const maxRule = rules.find(r => r.max);
40431
40384
  let maxLength = MAX_TEXT_AREA_LENGTH;
40432
40385
  if (maxRule) {
40433
40386
  maxLength = maxRule.max;
40434
40387
  }
40435
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40388
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40436
40389
  allowClear: true,
40437
40390
  autoComplete: "new-password",
40438
40391
  maxLength: maxLength,
40439
40392
  autoSize: {
40440
40393
  minRows: 5,
40441
40394
  maxRows: 5
40442
- }
40443
- }, props), {}, {
40395
+ },
40396
+ ...props,
40444
40397
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40445
40398
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40446
- }));
40399
+ });
40447
40400
  },
40448
- phoneNumber: (_ref19, _ref20) => {
40449
- let {
40450
- name,
40451
- inputName,
40452
- props,
40453
- value,
40454
- repeatIndex,
40455
- repeatValues,
40456
- formsValue
40457
- } = _ref19;
40458
- let {
40459
- setFormValues,
40460
- t
40461
- } = _ref20;
40462
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
40401
+ phoneNumber: ({
40402
+ name,
40403
+ inputName,
40404
+ props,
40405
+ value,
40406
+ repeatIndex,
40407
+ repeatValues,
40408
+ formsValue
40409
+ }, {
40410
+ setFormValues,
40411
+ t
40412
+ }) => {
40413
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
40463
40414
  t: t,
40464
40415
  doChangeErrors: false,
40465
40416
  allowClear: true,
40466
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
40417
+ country: formsValue?.country,
40467
40418
  formsValue: formsValue,
40468
- initialValue: value
40469
- }, props), {}, {
40419
+ initialValue: value,
40420
+ ...props,
40470
40421
  onChange: val => {
40471
40422
  if (repeatValues) {
40472
40423
  const inputValues = Array.isArray(formsValue[name]) ? formsValue[name] || [] : [];
@@ -40482,25 +40433,24 @@ const inputTypeComponent = {
40482
40433
  setFormValues(formsValue);
40483
40434
  }
40484
40435
  }
40485
- }));
40436
+ });
40486
40437
  },
40487
- switch: (_ref21, _ref22) => {
40488
- let {
40489
- props,
40490
- value,
40491
- restricted,
40492
- autocomplete,
40493
- formsValue,
40494
- repeatIndex,
40495
- name,
40496
- inputName,
40497
- replace
40498
- } = _ref21;
40499
- let {
40500
- form,
40501
- setFormValues
40502
- } = _ref22;
40503
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
40438
+ switch: ({
40439
+ props,
40440
+ value,
40441
+ restricted,
40442
+ autocomplete,
40443
+ formsValue,
40444
+ repeatIndex,
40445
+ name,
40446
+ inputName,
40447
+ replace
40448
+ }, {
40449
+ form,
40450
+ setFormValues
40451
+ }) => {
40452
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
40453
+ ...props,
40504
40454
  defaultChecked: value || false,
40505
40455
  checked: value || false,
40506
40456
  onChange: isChecked => {
@@ -40542,15 +40492,14 @@ const inputTypeComponent = {
40542
40492
  setFormValues(formsValue);
40543
40493
  }
40544
40494
  }
40545
- }));
40495
+ });
40546
40496
  },
40547
- total100: _ref23 => {
40548
- let {
40549
- props,
40550
- name,
40551
- options,
40552
- value
40553
- } = _ref23;
40497
+ total100: ({
40498
+ props,
40499
+ name,
40500
+ options,
40501
+ value
40502
+ }) => {
40554
40503
  value = value ? Array.isArray(value) ? value : [value] : [];
40555
40504
  function totalValue() {
40556
40505
  let total = 0;
@@ -40574,11 +40523,10 @@ const inputTypeComponent = {
40574
40523
  className: "total100",
40575
40524
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
40576
40525
  name: name,
40577
- children: (fields, _ref24) => {
40578
- let {
40579
- add,
40580
- remove
40581
- } = _ref24;
40526
+ children: (fields, {
40527
+ add,
40528
+ remove
40529
+ }) => {
40582
40530
  if (fields.length === 0) {
40583
40531
  const formData = value || [];
40584
40532
  if (formData.length) {
@@ -40597,26 +40545,26 @@ const inputTypeComponent = {
40597
40545
  const v = value[field.name];
40598
40546
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
40599
40547
  className: "total",
40600
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40601
- noStyle: true
40602
- }, field), {}, {
40548
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40549
+ noStyle: true,
40550
+ ...field,
40603
40551
  name: [field.name, "type"],
40604
40552
  fieldKey: [field.fieldKey, "type"],
40605
40553
  initialValue: v.type,
40606
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40554
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40607
40555
  allowClear: true,
40608
40556
  showSearch: true,
40609
40557
  filterOption: filterSelectOptions,
40610
- optionFilterProp: "children"
40611
- }, props), {}, {
40558
+ optionFilterProp: "children",
40559
+ ...props,
40612
40560
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40613
40561
  value: option.value,
40614
40562
  children: option.label
40615
40563
  }, i))
40616
- }))
40617
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40618
- noStyle: true
40619
- }, field), {}, {
40564
+ })
40565
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40566
+ noStyle: true,
40567
+ ...field,
40620
40568
  name: [field.name, "value"],
40621
40569
  fieldKey: [field.fieldKey, "value"],
40622
40570
  initialValue: v.value,
@@ -40624,14 +40572,14 @@ const inputTypeComponent = {
40624
40572
  allowClear: true,
40625
40573
  name: "value",
40626
40574
  formatter: value => {
40627
- return value ? "".concat(value, "%") : "";
40575
+ return value ? `${value}%` : "";
40628
40576
  },
40629
40577
  disabled: !v.type,
40630
40578
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
40631
40579
  min: 1,
40632
40580
  max: 100 - siblingTotal(v.type)
40633
40581
  })
40634
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40582
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40635
40583
  disabled: !v.value || !v.type || totalValue() >= 100,
40636
40584
  type: "primary",
40637
40585
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -40663,21 +40611,18 @@ const inputTypeComponent = {
40663
40611
  }) : null]
40664
40612
  });
40665
40613
  },
40666
- percentage: (_ref25, _ref26) => {
40667
- var _input$meta6;
40668
- let {
40669
- name,
40670
- inputName,
40671
- totalMax,
40672
- repeatIndex,
40673
- props,
40674
- formsValue,
40675
- input
40676
- } = _ref25;
40677
- let {
40678
- inputMeta,
40679
- t
40680
- } = _ref26;
40614
+ percentage: ({
40615
+ name,
40616
+ inputName,
40617
+ totalMax,
40618
+ repeatIndex,
40619
+ props,
40620
+ formsValue,
40621
+ input
40622
+ }, {
40623
+ inputMeta,
40624
+ t
40625
+ }) => {
40681
40626
  const isRepeatable = Array.isArray(formsValue[name]);
40682
40627
  let totalSiblings = 0;
40683
40628
  if (isRepeatable && totalMax) {
@@ -40685,15 +40630,15 @@ const inputTypeComponent = {
40685
40630
  totl = totl + (grp[inputName] || 0);
40686
40631
  return totl;
40687
40632
  }, 0);
40688
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta6 = input.meta) === null || _input$meta6 === void 0 ? void 0 : _input$meta6.siblings)) {
40633
+ } else if (Array.isArray(input?.meta?.siblings)) {
40689
40634
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
40690
40635
  totl = totl + (formsValue[key] || 0);
40691
40636
  return totl;
40692
40637
  }, 0);
40693
40638
  }
40694
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40695
- allowClear: true
40696
- }, props), {}, {
40639
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40640
+ allowClear: true,
40641
+ ...props,
40697
40642
  style: {
40698
40643
  width: "100%"
40699
40644
  },
@@ -40702,36 +40647,33 @@ const inputTypeComponent = {
40702
40647
  min: 0,
40703
40648
  max: 100 - totalSiblings,
40704
40649
  formatter: value => {
40705
- return value ? "".concat(value) : "";
40650
+ return value ? `${value}` : "";
40706
40651
  },
40707
40652
  parser: value => value.replace("%", ""),
40708
40653
  addonAfter: "%"
40709
- }));
40654
+ });
40710
40655
  },
40711
- year: _ref27 => {
40712
- let {
40713
- props
40714
- } = _ref27;
40656
+ year: ({
40657
+ props
40658
+ }) => {
40715
40659
  const lng = localStorage.getItem("datastakeLng") || "en";
40716
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40660
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40717
40661
  allowClear: true,
40718
40662
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
40719
- picker: "year"
40720
- }, props), {}, {
40663
+ picker: "year",
40664
+ ...props,
40721
40665
  format: "YYYY"
40722
- }));
40666
+ });
40723
40667
  },
40724
- upload: (_ref28, _ref29) => {
40725
- let {
40726
- rules,
40727
- value
40728
- } = _ref28;
40729
- let {
40730
- setLoading,
40731
- t,
40732
- getApiBaseUrl,
40733
- getAppHeader
40734
- } = _ref29;
40668
+ upload: ({
40669
+ rules,
40670
+ value
40671
+ }, {
40672
+ setLoading,
40673
+ t,
40674
+ getApiBaseUrl,
40675
+ getAppHeader
40676
+ }) => {
40735
40677
  const apiURL = getApiBaseUrl();
40736
40678
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
40737
40679
  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) : []) || [];
@@ -40744,12 +40686,13 @@ const inputTypeComponent = {
40744
40686
  }
40745
40687
  }
40746
40688
  const allowedExtensions = accept && accept !== "*" ? accept.split(",").map(ext => ext.trim().toLowerCase()) : [];
40747
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40689
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40690
+ ...maxProps,
40748
40691
  accept: accept,
40749
- action: "".concat(apiURL, "/upload"),
40692
+ action: `${apiURL}/upload`,
40750
40693
  beforeUpload: beforeUpload(allowedExtensions),
40751
40694
  onChange: val => {
40752
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
40695
+ if (val?.file && typeof setLoading === "function") {
40753
40696
  if (val.file.percent !== 100) {
40754
40697
  setLoading(true);
40755
40698
  } else {
@@ -40757,9 +40700,10 @@ const inputTypeComponent = {
40757
40700
  }
40758
40701
  }
40759
40702
  },
40760
- headers: _objectSpread2({
40761
- Authorization: "Bearer ".concat(getToken())
40762
- }, getAppHeader()),
40703
+ headers: {
40704
+ Authorization: `Bearer ${getToken()}`,
40705
+ ...getAppHeader()
40706
+ },
40763
40707
  defaultFileList: values,
40764
40708
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40765
40709
  style: {
@@ -40769,19 +40713,17 @@ const inputTypeComponent = {
40769
40713
  children: t("Upload")
40770
40714
  })]
40771
40715
  })
40772
- }));
40716
+ });
40773
40717
  },
40774
- imageUpload: (_ref30, _ref31) => {
40775
- let {
40776
- rules,
40777
- value
40778
- } = _ref30;
40779
- let {
40780
- setLoading,
40781
- getApiBaseUrl,
40782
- getAppHeader,
40783
- t
40784
- } = _ref31;
40718
+ imageUpload: ({
40719
+ rules,
40720
+ value
40721
+ }, {
40722
+ setLoading,
40723
+ getApiBaseUrl,
40724
+ getAppHeader,
40725
+ t
40726
+ }) => {
40785
40727
  const apiURL = getApiBaseUrl();
40786
40728
  const values = getImageUploadEditValue(value);
40787
40729
  const maxRule = rules.find(r => r.max);
@@ -40792,17 +40734,17 @@ const inputTypeComponent = {
40792
40734
  maxProps.multiple = true;
40793
40735
  }
40794
40736
  }
40795
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40737
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40738
+ ...maxProps,
40796
40739
  beforeUpload: beforeUpload(allowedImageExtensions),
40797
40740
  accept: "image/*",
40798
40741
  classList: !values || !values.length ? "empty" : "",
40799
40742
  listType: "picture",
40800
- action: "".concat(apiURL, "/upload"),
40743
+ action: `${apiURL}/upload`,
40801
40744
  onChange: val => {
40802
40745
  if (typeof setLoading === "function") {
40803
- if (val !== null && val !== void 0 && val.file) {
40804
- var _val$file;
40805
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
40746
+ if (val?.file) {
40747
+ if (val?.file?.status === "removed") {
40806
40748
  setLoading(false);
40807
40749
  return;
40808
40750
  }
@@ -40814,9 +40756,10 @@ const inputTypeComponent = {
40814
40756
  setLoading(false);
40815
40757
  }
40816
40758
  },
40817
- headers: _objectSpread2({
40818
- Authorization: "Bearer ".concat(getToken())
40819
- }, getAppHeader()),
40759
+ headers: {
40760
+ Authorization: `Bearer ${getToken()}`,
40761
+ ...getAppHeader()
40762
+ },
40820
40763
  defaultFileList: values,
40821
40764
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40822
40765
  style: {
@@ -40826,19 +40769,17 @@ const inputTypeComponent = {
40826
40769
  children: t("Upload")
40827
40770
  })]
40828
40771
  })
40829
- }));
40772
+ });
40830
40773
  },
40831
- videoUpload: (_ref32, _ref33) => {
40832
- let {
40833
- rules,
40834
- value
40835
- } = _ref32;
40836
- let {
40837
- setLoading = () => {},
40838
- getApiBaseUrl,
40839
- getAppHeader,
40840
- t
40841
- } = _ref33;
40774
+ videoUpload: ({
40775
+ rules,
40776
+ value
40777
+ }, {
40778
+ setLoading = () => {},
40779
+ getApiBaseUrl,
40780
+ getAppHeader,
40781
+ t
40782
+ }) => {
40842
40783
  const apiURL = getApiBaseUrl();
40843
40784
  const values = getImageUploadEditValue(value);
40844
40785
  const maxRule = rules.find(r => r.max);
@@ -40849,25 +40790,21 @@ const inputTypeComponent = {
40849
40790
  maxProps.multiple = true;
40850
40791
  }
40851
40792
  }
40852
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
40853
- itemRender: (item, fileList) => {
40854
- var _fileList$response;
40855
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40856
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40857
- 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)
40858
- }), item]
40859
- });
40860
- }
40861
- }, maxProps), {}, {
40793
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40794
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40795
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40796
+ url: fileList?.response?.url || fileList?.url
40797
+ }), item]
40798
+ }),
40799
+ ...maxProps,
40862
40800
  accept: "video/*",
40863
40801
  classList: !values || !values.length ? "empty" : "",
40864
40802
  listType: "picture",
40865
- action: "".concat(apiURL, "/upload"),
40803
+ action: `${apiURL}/upload`,
40866
40804
  onChange: val => {
40867
40805
  if (typeof setLoading === "function") {
40868
- if (val !== null && val !== void 0 && val.file) {
40869
- var _val$file2;
40870
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
40806
+ if (val?.file) {
40807
+ if (val?.file?.status === "removed") {
40871
40808
  setLoading(false);
40872
40809
  return;
40873
40810
  }
@@ -40879,9 +40816,10 @@ const inputTypeComponent = {
40879
40816
  setLoading(false);
40880
40817
  }
40881
40818
  },
40882
- headers: _objectSpread2({
40883
- Authorization: "Bearer ".concat(getToken())
40884
- }, getAppHeader()),
40819
+ headers: {
40820
+ Authorization: `Bearer ${getToken()}`,
40821
+ ...getAppHeader()
40822
+ },
40885
40823
  defaultFileList: values,
40886
40824
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40887
40825
  style: {
@@ -40891,19 +40829,17 @@ const inputTypeComponent = {
40891
40829
  children: t("Upload")
40892
40830
  })]
40893
40831
  })
40894
- }));
40832
+ });
40895
40833
  },
40896
- geolocation: (_ref34, _ref35) => {
40897
- let {
40898
- value,
40899
- name,
40900
- formsValue,
40901
- addressData,
40902
- props
40903
- } = _ref34;
40904
- let {
40905
- inputMeta
40906
- } = _ref35;
40834
+ geolocation: ({
40835
+ value,
40836
+ name,
40837
+ formsValue,
40838
+ addressData,
40839
+ props
40840
+ }, {
40841
+ inputMeta
40842
+ }) => {
40907
40843
  let search = formsValue.country;
40908
40844
  if (addressData && Object.keys(addressData).length > 0) {
40909
40845
  const country = countriesList.countries[formsValue.country] || {};
@@ -40911,10 +40847,10 @@ const inputTypeComponent = {
40911
40847
  search = addressData.country;
40912
40848
  }
40913
40849
  if (addressData.level1) {
40914
- search = "".concat(addressData.level1, ", ").concat(addressData.country || country.name);
40850
+ search = `${addressData.level1}, ${addressData.country || country.name}`;
40915
40851
  }
40916
40852
  if (addressData.level2) {
40917
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country || country.name);
40853
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country || country.name}`;
40918
40854
  }
40919
40855
  } else {
40920
40856
  const country = countriesList.countries[formsValue.country] || {};
@@ -40922,10 +40858,10 @@ const inputTypeComponent = {
40922
40858
  search = country.name;
40923
40859
  }
40924
40860
  if (formsValue.administrativeLevel1Name) {
40925
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
40861
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
40926
40862
  }
40927
40863
  if (formsValue.administrativeLevel2Name) {
40928
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
40864
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
40929
40865
  }
40930
40866
  }
40931
40867
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -40938,35 +40874,33 @@ const inputTypeComponent = {
40938
40874
  searchValue: search
40939
40875
  });
40940
40876
  },
40941
- ajaxSelect: (_ref36, _ref37) => {
40942
- let {
40943
- call,
40944
- automaticallyLink,
40945
- name,
40946
- preSelected,
40947
- inputName,
40948
- props,
40949
- formsValue,
40950
- onNewSetValue,
40951
- multiple,
40952
- updateOptions,
40953
- repeatValues,
40954
- repeatIndex,
40955
- value,
40956
- unique,
40957
- address,
40958
- addressData = {},
40959
- input
40960
- } = _ref36;
40961
- let {
40962
- form,
40963
- forms,
40964
- setAddress,
40965
- changeInputMeta,
40966
- inputMeta = {},
40967
- meta,
40968
- setFormValues
40969
- } = _ref37;
40877
+ ajaxSelect: ({
40878
+ call,
40879
+ automaticallyLink,
40880
+ name,
40881
+ preSelected,
40882
+ inputName,
40883
+ props,
40884
+ formsValue,
40885
+ onNewSetValue,
40886
+ multiple,
40887
+ updateOptions,
40888
+ repeatValues,
40889
+ repeatIndex,
40890
+ value,
40891
+ unique,
40892
+ address,
40893
+ addressData = {},
40894
+ input
40895
+ }, {
40896
+ form,
40897
+ forms,
40898
+ setAddress,
40899
+ changeInputMeta,
40900
+ inputMeta = {},
40901
+ meta,
40902
+ setFormValues
40903
+ }) => {
40970
40904
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
40971
40905
  preSelected: preSelected,
40972
40906
  input: input,
@@ -41002,41 +40936,40 @@ const inputTypeComponent = {
41002
40936
  const selectedValue = data.find(v => v.value === ev);
41003
40937
  if (address && selectedValue) {
41004
40938
  dot__default["default"].str(address, selectedValue.label, addressData);
41005
- setAddress(_objectSpread2({}, addressData));
40939
+ setAddress({
40940
+ ...addressData
40941
+ });
41006
40942
  }
41007
40943
  }
41008
40944
  },
41009
40945
  setAddress: setAddress
41010
40946
  });
41011
40947
  },
41012
- tag: _ref38 => {
41013
- let {
41014
- value,
41015
- repeatLabel
41016
- } = _ref38;
40948
+ tag: ({
40949
+ value,
40950
+ repeatLabel
40951
+ }) => {
41017
40952
  return /*#__PURE__*/jsxRuntime.jsx(TagInput$1, {
41018
40953
  allowClear: true,
41019
40954
  value: value || [],
41020
40955
  newPlaceholder: repeatLabel
41021
40956
  });
41022
40957
  },
41023
- modal: (_ref39, _ref40) => {
41024
- let {
41025
- call,
41026
- automaticallyLink,
41027
- name,
41028
- inputName,
41029
- props,
41030
- formsValue,
41031
- onNewSetValue,
41032
- repeatValues,
41033
- repeatIndex,
41034
- value,
41035
- modalTitle
41036
- } = _ref39;
41037
- let {
41038
- form
41039
- } = _ref40;
40958
+ modal: ({
40959
+ call,
40960
+ automaticallyLink,
40961
+ name,
40962
+ inputName,
40963
+ props,
40964
+ formsValue,
40965
+ onNewSetValue,
40966
+ repeatValues,
40967
+ repeatIndex,
40968
+ value,
40969
+ modalTitle
40970
+ }, {
40971
+ form
40972
+ }) => {
41040
40973
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal$2, {
41041
40974
  allowClear: true,
41042
40975
  call: call,
@@ -41054,69 +40987,63 @@ const inputTypeComponent = {
41054
40987
  buttonText: modalTitle
41055
40988
  });
41056
40989
  },
41057
- website: (_ref41, _ref42) => {
41058
- let {
41059
- name,
41060
- inputName,
41061
- props,
41062
- value,
41063
- repeatIndex,
41064
- repeatValues,
41065
- formsValue
41066
- } = _ref41;
41067
- let {
41068
- form,
41069
- inputMeta = {},
41070
- t
41071
- } = _ref42;
41072
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
40990
+ website: ({
40991
+ name,
40992
+ inputName,
40993
+ props,
40994
+ value,
40995
+ repeatIndex,
40996
+ repeatValues,
40997
+ formsValue
40998
+ }, {
40999
+ form,
41000
+ inputMeta = {},
41001
+ t
41002
+ }) => {
41003
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
41073
41004
  allowClear: true,
41074
41005
  initialValue: value,
41075
- t: t
41076
- }, props), {}, {
41006
+ t: t,
41007
+ ...props,
41077
41008
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
41078
41009
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41079
41010
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
41080
- }));
41011
+ });
41081
41012
  },
41082
- dataLink: (_ref43, _ref44) => {
41083
- var _input$meta7, _input$meta10, _formsValue$meta, _input$meta11;
41084
- let {
41085
- setValues,
41086
- name,
41087
- onValuesChange,
41088
- formsValue,
41089
- input,
41090
- changeLinking,
41091
- call,
41092
- automaticallyLink,
41093
- inputName,
41094
- props,
41095
- onNewSetValue,
41096
- multiple,
41097
- updateOptions,
41098
- repeatValues,
41099
- repeatIndex,
41100
- value,
41101
- unique,
41102
- address,
41103
- addressData = {},
41104
- getFromLinking
41105
- } = _ref43;
41106
- let {
41107
- form,
41108
- groupFormId,
41109
- setAddress,
41110
- isHighlighted,
41111
- changeInputMeta,
41112
- meta,
41113
- inputMeta,
41114
- forms
41115
- } = _ref44;
41116
- if ((input === null || input === void 0 || (_input$meta7 = input.meta) === null || _input$meta7 === void 0 || (_input$meta7 = _input$meta7.optionsView) === null || _input$meta7 === void 0 ? void 0 : _input$meta7.editInputType) === "ajaxSelect") {
41117
- var _formsValue$groupForm, _input$meta8, _input$meta9;
41118
- const currentValue = groupFormId ? (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
41119
- (input === null || input === void 0 || (_input$meta8 = input.meta) === null || _input$meta8 === void 0 || (_input$meta8 = _input$meta8.optionsView) === null || _input$meta8 === void 0 ? void 0 : _input$meta8.call) || (input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.call) || "default::list()::::";
41013
+ dataLink: ({
41014
+ setValues,
41015
+ name,
41016
+ onValuesChange,
41017
+ formsValue,
41018
+ input,
41019
+ changeLinking,
41020
+ call,
41021
+ automaticallyLink,
41022
+ inputName,
41023
+ props,
41024
+ onNewSetValue,
41025
+ multiple,
41026
+ updateOptions,
41027
+ repeatValues,
41028
+ repeatIndex,
41029
+ value,
41030
+ unique,
41031
+ address,
41032
+ addressData = {},
41033
+ getFromLinking
41034
+ }, {
41035
+ form,
41036
+ groupFormId,
41037
+ setAddress,
41038
+ isHighlighted,
41039
+ changeInputMeta,
41040
+ meta,
41041
+ inputMeta,
41042
+ forms
41043
+ }) => {
41044
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
41045
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
41046
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
41120
41047
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
41121
41048
  size: "medium",
41122
41049
  input: input,
@@ -41153,7 +41080,9 @@ const inputTypeComponent = {
41153
41080
  const selectedValue = data.find(v => v.value === ev);
41154
41081
  if (address && selectedValue) {
41155
41082
  dot__default["default"].str(address, selectedValue.label, addressData);
41156
- setAddress(_objectSpread2({}, addressData));
41083
+ setAddress({
41084
+ ...addressData
41085
+ });
41157
41086
  }
41158
41087
  }
41159
41088
  },
@@ -41163,149 +41092,188 @@ const inputTypeComponent = {
41163
41092
  isDataLink: true
41164
41093
  });
41165
41094
  }
41166
- const isSingle = (input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.maxRepeat) === 1;
41167
- 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));
41095
+ const isSingle = input?.meta?.maxRepeat === 1;
41096
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
41097
+ ...(formsValue[groupFormId] || {})[name]
41098
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
41099
+ ...v
41100
+ })) : isSingle ? formsValue[name] ? [{
41101
+ ...formsValue[name]
41102
+ }] : [] : (formsValue[name] || []).map(v => ({
41103
+ ...v
41104
+ }));
41168
41105
  const onUpdate = (val, i) => {
41169
41106
  const _val = isSingle ? {
41170
41107
  [name]: val
41171
41108
  } : {
41172
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
41109
+ [name]: formData?.map((d, j) => i === j ? val : d)
41173
41110
  };
41174
41111
  if (groupFormId) {
41175
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41176
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41177
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41112
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
41113
+ const _newData = {
41114
+ ..._defaultData,
41115
+ ..._val
41116
+ };
41117
+ onValuesChange(_newData, {
41118
+ ...formsValue,
41178
41119
  [groupFormId]: _newData
41179
- }));
41180
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41181
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41120
+ });
41121
+ form?.setFieldValue(groupFormId, _newData);
41122
+ setValues({
41123
+ ...formsValue,
41182
41124
  [groupFormId]: _newData
41183
- }));
41125
+ });
41184
41126
  return;
41185
41127
  }
41186
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41187
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41188
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41128
+ onValuesChange(_val, {
41129
+ ...formsValue,
41130
+ ..._val
41131
+ });
41132
+ form?.setFieldValue(name, _val[name]);
41133
+ setValues({
41134
+ ...formsValue,
41135
+ ..._val
41136
+ });
41189
41137
  };
41190
41138
  return /*#__PURE__*/jsxRuntime.jsx(DataLink, {
41191
41139
  form: input,
41192
41140
  formsValue: formsValue,
41193
41141
  onUpdate: onUpdate,
41194
41142
  isHighlighted: isHighlighted,
41195
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
41143
+ values: groupFormId ? {
41144
+ ...(formsValue[groupFormId] || {}),
41196
41145
  meta: {
41197
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
41146
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
41198
41147
  }
41199
- }) : formsValue,
41148
+ } : formsValue,
41200
41149
  name: name,
41201
41150
  groupFormId: groupFormId,
41202
- maxRepeat: input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.maxRepeat,
41203
- remove: _ref45 => {
41204
- let {
41205
- key
41206
- } = _ref45;
41151
+ maxRepeat: input?.meta?.maxRepeat,
41152
+ remove: ({
41153
+ key
41154
+ }) => {
41207
41155
  const _val = isSingle ? {
41208
41156
  [name]: null
41209
41157
  } : {
41210
41158
  [name]: formData.filter((v, i) => i !== key)
41211
41159
  };
41212
41160
  if (groupFormId) {
41213
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41214
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41215
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41161
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
41162
+ const _newData = {
41163
+ ..._defaultData,
41164
+ ..._val
41165
+ };
41166
+ onValuesChange(_newData, {
41167
+ ...formsValue,
41216
41168
  [groupFormId]: _newData
41217
- }));
41218
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41219
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41169
+ });
41170
+ form?.setFieldValue(groupFormId, _newData);
41171
+ setValues({
41172
+ ...formsValue,
41220
41173
  [groupFormId]: _newData
41221
- }));
41174
+ });
41222
41175
  return;
41223
41176
  }
41224
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41225
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41226
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41177
+ onValuesChange(_val, {
41178
+ ...formsValue,
41179
+ ..._val
41180
+ });
41181
+ form?.setFieldValue(name, _val[name]);
41182
+ setValues({
41183
+ ...formsValue,
41184
+ ..._val
41185
+ });
41227
41186
  },
41228
41187
  add: val => {
41229
41188
  const _val = isSingle ? {
41230
41189
  [name]: val
41231
41190
  } : {
41232
- [name]: [...formData, _objectSpread2({}, val)]
41191
+ [name]: [...formData, {
41192
+ ...val
41193
+ }]
41233
41194
  };
41234
41195
  if (groupFormId) {
41235
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41236
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41237
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41238
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41196
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
41197
+ const _newData = {
41198
+ ..._defaultData,
41199
+ ..._val
41200
+ };
41201
+ form?.setFieldValue(groupFormId, _newData);
41202
+ onValuesChange(_newData, {
41203
+ ...formsValue,
41239
41204
  [groupFormId]: _newData
41240
- }));
41241
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41205
+ });
41206
+ setValues({
41207
+ ...formsValue,
41242
41208
  [groupFormId]: _newData
41243
- }));
41209
+ });
41244
41210
  return;
41245
41211
  }
41246
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41247
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41248
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41212
+ form?.setFieldValue(name, _val[name]);
41213
+ onValuesChange(_val, {
41214
+ ...formsValue,
41215
+ ..._val
41216
+ });
41217
+ setValues({
41218
+ ...formsValue,
41219
+ ..._val
41220
+ });
41249
41221
  },
41250
41222
  k: name,
41251
41223
  formData: formData
41252
41224
  });
41253
41225
  },
41254
- internallink: (_ref46, _ref47) => {
41255
- let {
41256
- name,
41257
- inputName,
41258
- props,
41259
- value,
41260
- repeatIndex,
41261
- repeatValues,
41262
- formsValue
41263
- } = _ref46;
41264
- let {
41265
- form,
41266
- inputMeta = {},
41267
- t
41268
- } = _ref47;
41269
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
41226
+ internallink: ({
41227
+ name,
41228
+ inputName,
41229
+ props,
41230
+ value,
41231
+ repeatIndex,
41232
+ repeatValues,
41233
+ formsValue
41234
+ }, {
41235
+ form,
41236
+ inputMeta = {},
41237
+ t
41238
+ }) => {
41239
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
41270
41240
  allowClear: true,
41271
41241
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41272
41242
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com",
41273
- initialValue: value
41274
- }, props), {}, {
41243
+ initialValue: value,
41244
+ ...props,
41275
41245
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form)
41276
- }));
41246
+ });
41277
41247
  },
41278
- group: _ref48 => {
41279
- let {
41280
- props,
41281
- groupInputs
41282
- } = _ref48;
41283
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41284
- groupInputs: groupInputs
41285
- }, props));
41248
+ group: ({
41249
+ props,
41250
+ groupInputs
41251
+ }) => {
41252
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41253
+ groupInputs: groupInputs,
41254
+ ...props
41255
+ });
41286
41256
  },
41287
- groupInputs: (_ref49, _ref50) => {
41288
- let {
41289
- props,
41290
- groupInputs
41291
- } = _ref49;
41292
- let {
41293
- inputMeta
41294
- } = _ref50;
41295
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41257
+ groupInputs: ({
41258
+ props,
41259
+ groupInputs
41260
+ }, {
41261
+ inputMeta
41262
+ }) => {
41263
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41296
41264
  groupInputs: groupInputs,
41297
- inputMeta: inputMeta
41298
- }, props));
41265
+ inputMeta: inputMeta,
41266
+ ...props
41267
+ });
41299
41268
  },
41300
- radioGroup: _ref51 => {
41301
- let {
41302
- props,
41303
- value,
41304
- options
41305
- } = _ref51;
41306
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
41307
- value: value
41308
- }, props), {}, {
41269
+ radioGroup: ({
41270
+ props,
41271
+ value,
41272
+ options
41273
+ }) => {
41274
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
41275
+ value: value,
41276
+ ...props,
41309
41277
  children: (options || []).map(o => {
41310
41278
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
41311
41279
  value: o.value,
@@ -41318,17 +41286,16 @@ const inputTypeComponent = {
41318
41286
  }) : null]
41319
41287
  }, o.value);
41320
41288
  })
41321
- }));
41289
+ });
41322
41290
  },
41323
- checkboxGroup: _ref52 => {
41324
- let {
41325
- props,
41326
- value,
41327
- options
41328
- } = _ref52;
41329
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
41330
- value: value
41331
- }, props), {}, {
41291
+ checkboxGroup: ({
41292
+ props,
41293
+ value,
41294
+ options
41295
+ }) => {
41296
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
41297
+ value: value,
41298
+ ...props,
41332
41299
  children: (options || []).map(o => {
41333
41300
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Checkbox, {
41334
41301
  value: o.value,
@@ -41341,30 +41308,28 @@ const inputTypeComponent = {
41341
41308
  }) : null]
41342
41309
  }, o.value);
41343
41310
  })
41344
- }));
41311
+ });
41345
41312
  }
41346
41313
  };
41347
- const GetFormItem = _ref53 => {
41348
- var _find, _input$meta12, _input$meta13, _input$meta14, _input$meta15, _input$meta16, _input$meta17, _input$meta18, _inputData$value, _input$meta19, _input$meta20, _inputData$commentVal;
41349
- let {
41350
- code,
41351
- inputData,
41352
- inputId,
41353
- input,
41354
- setLoading,
41355
- values,
41356
- MainForm,
41357
- options,
41358
- plainForms,
41359
- setValues,
41360
- alertError,
41361
- setAddress,
41362
- inputMeta = {},
41363
- inputKey,
41364
- changeInputMeta = () => {},
41365
- i,
41366
- isCreate = false
41367
- } = _ref53;
41314
+ const GetFormItem = ({
41315
+ code,
41316
+ inputData,
41317
+ inputId,
41318
+ input,
41319
+ setLoading,
41320
+ values,
41321
+ MainForm,
41322
+ options,
41323
+ plainForms,
41324
+ setValues,
41325
+ alertError,
41326
+ setAddress,
41327
+ inputMeta = {},
41328
+ inputKey,
41329
+ changeInputMeta = () => {},
41330
+ i,
41331
+ isCreate = false
41332
+ }) => {
41368
41333
  const {
41369
41334
  t,
41370
41335
  getAppHeader,
@@ -41380,7 +41345,7 @@ const GetFormItem = _ref53 => {
41380
41345
  case "h6":
41381
41346
  return getInputHeadLines(input.type, i, input, values);
41382
41347
  default:
41383
- const rules = inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
41348
+ const rules = inputMeta?.notApplicable || inputMeta?.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
41384
41349
  const requiredRule = rules.find(r => r.required);
41385
41350
  if (requiredRule && input.type === "text") {
41386
41351
  rules.push({
@@ -41389,45 +41354,47 @@ const GetFormItem = _ref53 => {
41389
41354
  });
41390
41355
  }
41391
41356
  const noLabel = ["message"].includes(input.type);
41392
- let maxRule = (_find = ((inputData === null || inputData === void 0 ? void 0 : inputData.rules) || []).find(rule => rule.max)) === null || _find === void 0 ? void 0 : _find.max;
41357
+ let maxRule = (inputData?.rules || []).find(rule => rule.max)?.max;
41393
41358
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41394
41359
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41395
41360
  className: "flex input-cont",
41396
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
41397
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
41398
- }, ["total100", "group"].includes(input.type) ? {} : {
41399
- name: inputId,
41400
- fieldKey: inputId,
41401
- initialValue: inputData.value
41402
- }), ["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41403
- valuePropName: "fileList",
41404
- getValueFromEvent: e => {
41405
- if (Array.isArray(e)) {
41406
- return e;
41407
- }
41408
- return e && e.fileList && e.fileList.map(f => {
41409
- if (f.response) {
41410
- return f.response;
41361
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41362
+ initialValue: inputMeta?.defaultValue,
41363
+ ...(["total100", "group"].includes(input.type) ? {} : {
41364
+ name: inputId,
41365
+ fieldKey: inputId,
41366
+ initialValue: inputData.value
41367
+ }),
41368
+ ...(["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41369
+ valuePropName: "fileList",
41370
+ getValueFromEvent: e => {
41371
+ if (Array.isArray(e)) {
41372
+ return e;
41411
41373
  }
41412
- return f;
41413
- });
41414
- }
41415
- } : {}), {}, {
41374
+ return e && e.fileList && e.fileList.map(f => {
41375
+ if (f.response) {
41376
+ return f.response;
41377
+ }
41378
+ return f;
41379
+ });
41380
+ }
41381
+ } : {}),
41416
41382
  style: input.showOnView === false ? {
41417
41383
  display: "none"
41418
- } : {}
41419
- }, ["switch"].includes(input.type) ? {
41420
- labelCol: {
41421
- span: 20
41422
- },
41423
- style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
41424
- display: "none"
41425
- } : {}), {}, {
41426
- flexDirection: "row",
41427
- justifyContent: "space-between"
41428
- })
41429
- } : {}), {}, {
41430
- className: input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1"),
41384
+ } : {},
41385
+ ...(["switch"].includes(input.type) ? {
41386
+ labelCol: {
41387
+ span: 20
41388
+ },
41389
+ style: {
41390
+ ...(input.showOnView === false ? {
41391
+ display: "none"
41392
+ } : {}),
41393
+ flexDirection: "row",
41394
+ justifyContent: "space-between"
41395
+ }
41396
+ } : {}),
41397
+ className: input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1`,
41431
41398
  "data-id": inputData.name,
41432
41399
  rules: rules,
41433
41400
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
@@ -41438,8 +41405,8 @@ const GetFormItem = _ref53 => {
41438
41405
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41439
41406
  className: "mr-1",
41440
41407
  children: getInputLabel(input, values)
41441
- }), !!(input !== null && input !== void 0 && (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.tooltip) && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41442
- title: input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.tooltip,
41408
+ }), !!input?.meta?.tooltip && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41409
+ title: input?.meta?.tooltip,
41443
41410
  trigger: "hover",
41444
41411
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41445
41412
  className: "flex flex-column justify-content-center",
@@ -41457,7 +41424,7 @@ const GetFormItem = _ref53 => {
41457
41424
  title: t("Not applicable"),
41458
41425
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41459
41426
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41460
- disabled: !(input !== null && input !== void 0 && (_input$meta14 = input.meta) !== null && _input$meta14 !== void 0 && _input$meta14.notApplicable),
41427
+ disabled: !input?.meta?.notApplicable,
41461
41428
  className: formatClassname(["default p-0", inputMeta.notApplicable && "primary"]),
41462
41429
  type: "link",
41463
41430
  onClick: () => {
@@ -41492,7 +41459,7 @@ const GetFormItem = _ref53 => {
41492
41459
  title: t("No available information"),
41493
41460
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41494
41461
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41495
- disabled: !(input !== null && input !== void 0 && (_input$meta15 = input.meta) !== null && _input$meta15 !== void 0 && _input$meta15.notAvailable),
41462
+ disabled: !input?.meta?.notAvailable,
41496
41463
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
41497
41464
  type: "link",
41498
41465
  onClick: () => {
@@ -41526,14 +41493,14 @@ const GetFormItem = _ref53 => {
41526
41493
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41527
41494
  title: t("Add comment"),
41528
41495
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41529
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
41496
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41530
41497
  type: "link",
41531
- disabled: !(input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.comment)
41532
- }, !isShown ? {
41533
- className: "default p-0"
41534
- } : {
41535
- className: "p-0 primary"
41536
- }), {}, {
41498
+ disabled: !input?.meta?.comment,
41499
+ ...(!isShown ? {
41500
+ className: "default p-0"
41501
+ } : {
41502
+ className: "p-0 primary"
41503
+ }),
41537
41504
  onClick: () => {
41538
41505
  setIsShown(true);
41539
41506
  changeInputMeta({
@@ -41549,18 +41516,18 @@ const GetFormItem = _ref53 => {
41549
41516
  width: 16,
41550
41517
  height: 16
41551
41518
  })
41552
- }))
41519
+ })
41553
41520
  })
41554
41521
  })]
41555
- }), (_input$meta17 = input.meta) !== null && _input$meta17 !== void 0 && _input$meta17.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41522
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41556
41523
  className: "code",
41557
41524
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41558
- children: (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.code
41525
+ children: input.meta?.code
41559
41526
  })
41560
41527
  }) : code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41561
41528
  className: "code",
41562
41529
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41563
- children: "".concat(code, ".").concat(i + 1)
41530
+ children: `${code}.${i + 1}`
41564
41531
  })
41565
41532
  }) : null]
41566
41533
  })
@@ -41580,7 +41547,7 @@ const GetFormItem = _ref53 => {
41580
41547
  getAppHeader,
41581
41548
  getApiBaseUrl
41582
41549
  }) : console.log(input)
41583
- }))
41550
+ })
41584
41551
  }), alertError ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
41585
41552
  message: alertError.message,
41586
41553
  type: "error",
@@ -41609,10 +41576,10 @@ const GetFormItem = _ref53 => {
41609
41576
  className: "max-char-span",
41610
41577
  children: t("max-char", {
41611
41578
  chars: maxRule,
41612
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
41579
+ filled: inputData?.value?.length || 0
41613
41580
  })
41614
41581
  })
41615
- }) : null, (_input$meta19 = input.meta) !== null && _input$meta19 !== void 0 && _input$meta19.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41582
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41616
41583
  className: "input-content dynamic-form-comment",
41617
41584
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41618
41585
  className: "comment-textarea",
@@ -41638,7 +41605,7 @@ const GetFormItem = _ref53 => {
41638
41605
  },
41639
41606
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41640
41607
  type: "link",
41641
- disabled: !((_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.comment),
41608
+ disabled: !input.meta?.comment,
41642
41609
  className: "p-0",
41643
41610
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
41644
41611
  width: 16,
@@ -41669,7 +41636,7 @@ const GetFormItem = _ref53 => {
41669
41636
  className: "max-char-span",
41670
41637
  children: t("max-char", {
41671
41638
  chars: MAX_COMMENTS_LENGTH,
41672
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
41639
+ filled: inputData?.commentValue?.length || 0
41673
41640
  })
41674
41641
  })]
41675
41642
  }) : null]
@@ -54937,7 +54904,8 @@ function AccountTable(_ref) {
54937
54904
  module,
54938
54905
  defaultPageSize = 20,
54939
54906
  actionButton,
54940
- inviteAccount
54907
+ inviteAccount,
54908
+ refetchTrigger
54941
54909
  } = _ref;
54942
54910
  const accountTypes = config === null || config === void 0 ? void 0 : config.accountTypes;
54943
54911
  const [showFilters, setShowFilters] = React.useState(false);
@@ -54965,7 +54933,8 @@ function AccountTable(_ref) {
54965
54933
  filtersConfig: filtersConfig$c,
54966
54934
  getRedirectLink,
54967
54935
  getData,
54968
- fetchPendingOnMount: true
54936
+ fetchPendingOnMount: true,
54937
+ refetchTrigger
54969
54938
  });
54970
54939
  const selectOptions = React.useMemo(() => {
54971
54940
  var _config$options;
@@ -58219,23 +58188,27 @@ function NewAccount({
58219
58188
  updateAccount,
58220
58189
  inviteAccount,
58221
58190
  isPending = false,
58222
- accountToEdit
58191
+ accountToEdit,
58192
+ countries
58223
58193
  }) {
58224
58194
  const [MainForm] = antd.Form.useForm();
58225
58195
  const [loading, setLoading] = React.useState(false);
58226
58196
  const [accountUsed, setAccountUsed] = React.useState(false);
58227
58197
  const isEdit = React.useMemo(() => accountToEdit && typeof accountToEdit === "object", [accountToEdit]);
58198
+ const selectedCountry = React.useMemo(() => findOptions(accountToEdit?.otherData?.country, countries), [accountToEdit?.otherData?.country, countries]);
58199
+ console.log(selectedCountry, "selectedCountry");
58228
58200
  React.useEffect(() => {
58229
58201
  if (accountToEdit && typeof accountToEdit === "object") {
58230
58202
  MainForm.setFieldsValue({
58231
58203
  name: accountToEdit.name,
58232
58204
  email: accountToEdit.email,
58233
- type: accountToEdit?.otherData?.interface
58205
+ type: accountToEdit?.otherData?.interface,
58206
+ country: selectedCountry
58234
58207
  });
58235
58208
  } else {
58236
58209
  MainForm.resetFields();
58237
58210
  }
58238
- }, [accountToEdit, MainForm]);
58211
+ }, [accountToEdit, MainForm, selectedCountry]);
58239
58212
  const onSubmit = async () => {
58240
58213
  try {
58241
58214
  const val = await MainForm.validateFields();
@@ -58247,6 +58220,7 @@ function NewAccount({
58247
58220
  data: val,
58248
58221
  isPending: accountToEdit.status === 'pending' || isPending
58249
58222
  });
58223
+ antd.message.success(t("Account successfully updated"));
58250
58224
  } else {
58251
58225
  if (!inviteAccount) {
58252
58226
  throw new Error("inviteAccount function is required for creating new accounts");
@@ -58286,7 +58260,7 @@ function NewAccount({
58286
58260
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
58287
58261
  placeholder: t("Type")
58288
58262
  })
58289
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58263
+ }), !isEdit && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58290
58264
  name: "email",
58291
58265
  label: t("Email"),
58292
58266
  rules: [{
@@ -58296,6 +58270,16 @@ function NewAccount({
58296
58270
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
58297
58271
  placeholder: t("Type")
58298
58272
  })
58273
+ }), isEdit && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58274
+ name: "country",
58275
+ label: t("Country"),
58276
+ rules: [{
58277
+ required: true
58278
+ }],
58279
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
58280
+ placeholder: t("Select"),
58281
+ options: countries
58282
+ })
58299
58283
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58300
58284
  name: "type",
58301
58285
  label: t("Type"),
@@ -58419,6 +58403,7 @@ function AdminAccountsScreen({
58419
58403
  };
58420
58404
  const [addAccountVisible, setAddAccountVisible] = React.useState(!!query.get("create"));
58421
58405
  const [accountToEdit, setAccountToEdit] = React.useState(null);
58406
+ const [refetchTrigger, setRefetchTrigger] = React.useState(0);
58422
58407
  const actionButtons = React.useMemo(() => [{
58423
58408
  type: "primary",
58424
58409
  onClick: () => setAddAccountVisible(true),
@@ -58459,6 +58444,7 @@ function AdminAccountsScreen({
58459
58444
  headerTitle: "accounts",
58460
58445
  actionButton: actionButtons,
58461
58446
  getData: handleGetData,
58447
+ refetchTrigger: refetchTrigger,
58462
58448
  config: {
58463
58449
  accountTypes,
58464
58450
  addAccountVisible,
@@ -58480,8 +58466,10 @@ function AdminAccountsScreen({
58480
58466
  setAccountToEdit(null);
58481
58467
  },
58482
58468
  accountTypes: accountTypes,
58483
- countriesOptions: options?.countries,
58484
- fetchData: () => {},
58469
+ countries: options?.countries,
58470
+ fetchData: () => {
58471
+ setRefetchTrigger(prev => prev + 1);
58472
+ },
58485
58473
  inviteAccount: data => AdminService.inviteAccount(data),
58486
58474
  updateAccount: ({
58487
58475
  data,