contentoh-components-library 21.5.99 → 21.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +249 -54
  3. package/dist/components/atoms/GeneralInput/styles.js +7 -3
  4. package/dist/components/atoms/InputFormatter/index.js +223 -68
  5. package/dist/components/atoms/InputFormatter/styles.js +20 -4
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +11 -1
  7. package/dist/components/molecules/TabsMenu/index.js +13 -1
  8. package/dist/components/molecules/TagAndInput/index.js +364 -24
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +6 -22
  11. package/dist/components/organisms/InputGroup/index.js +22 -18
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +150 -337
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +393 -352
  15. package/dist/components/pages/ProviderProductEdition/utils.js +1 -0
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +125 -211
  17. package/dist/components/pages/RetailerProductEdition/index.js +1743 -2239
  18. package/dist/components/pages/RetailerProductEdition/styles.js +4 -2
  19. package/dist/components/pages/RetailerProductEdition/utils.js +251 -2
  20. package/package.json +4 -2
  21. package/src/ai/utils/compare-strings.js +45 -0
  22. package/src/assets/images/Icons/arrow.png +0 -0
  23. package/src/assets/images/Icons/cancel.png +0 -0
  24. package/src/assets/images/Icons/ia-icon.png +0 -0
  25. package/src/assets/images/Icons/loading.svg +5 -0
  26. package/src/assets/images/Icons/reload.png +0 -0
  27. package/src/components/atoms/GeneralButton/styles.js +4 -0
  28. package/src/components/atoms/GeneralInput/index.js +241 -60
  29. package/src/components/atoms/GeneralInput/styles.js +81 -0
  30. package/src/components/atoms/InputFormatter/index.js +200 -51
  31. package/src/components/atoms/InputFormatter/styles.js +284 -0
  32. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +10 -0
  33. package/src/components/atoms/RetailerSelector/index.js +3 -0
  34. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  35. package/src/components/molecules/StatusAsignationInfo/index.js +9 -1
  36. package/src/components/molecules/TabsMenu/index.js +12 -0
  37. package/src/components/molecules/TagAndInput/index.js +294 -21
  38. package/src/components/molecules/TagAndInput/styles.js +59 -17
  39. package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
  40. package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
  41. package/src/components/organisms/FullProductNameHeader/index.js +4 -28
  42. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  43. package/src/components/organisms/InputGroup/index.js +12 -4
  44. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +174 -202
  45. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  46. package/src/components/pages/ProviderProductEdition/index.js +486 -417
  47. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  48. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +136 -243
  49. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +575 -0
  50. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +62 -0
  51. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +344 -0
  52. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +155 -0
  53. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +114 -0
  54. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +60 -0
  55. package/src/components/pages/RetailerProductEdition/index.js +1580 -1719
  56. package/src/components/pages/RetailerProductEdition/index_old.js +1979 -0
  57. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +101 -0
  58. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +115 -0
  59. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +174 -0
  60. package/src/components/pages/RetailerProductEdition/styles.js +67 -2
  61. package/src/components/pages/RetailerProductEdition/utils.js +240 -0
  62. package/src/contexts/AiProductEdition.jsx +347 -0
  63. package/src/global-files/statusDictionary.js +103 -0
@@ -77,10 +77,12 @@ var _genericModalWarning = _interopRequireDefault(require("../../../assets/image
77
77
 
78
78
  var _styles = require("./styles");
79
79
 
80
+ var _AiProductEdition = require("../../../contexts/AiProductEdition");
81
+
80
82
  var _jsxRuntime = require("react/jsx-runtime");
81
83
 
82
84
  var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
83
- var _location$state4, _location$state5, _location$state6, _state$active_retaile3, _state$active_retaile4, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile5, _state$product5, _state$active_retaile6, _state$active_retaile7, _state$active_retaile8, _state$product6, _state$product7, _state$product8, _state$datasheets_inp, _state$product9, _state$images_values12;
85
+ var _location$state4, _state$product2, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _location$state5, _location$state6, _state$active_retaile3, _state$active_retaile4, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile5, _state$product11, _state$active_retaile6, _state$active_retaile7, _state$active_retaile8, _state$product12, _state$product13, _state$product14, _state$datasheets_inp, _state$datasheets_inp2, _state$product15, _state$images_values12;
84
86
 
85
87
  var tabsSections = _ref.tabsSections,
86
88
  _ref$productSelected = _ref.productSelected,
@@ -240,11 +242,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
240
242
  (0, _react.useEffect)(function () {
241
243
  var setProductData = function setProductData() {
242
244
  try {
243
- var product = JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected;
245
+ var product = productSelected ? productSelected : JSON.parse(sessionStorage.getItem("productSelected"));
244
246
  var productNormalized = (0, _utils.normalizeProduct)(product);
245
- console.log({
246
- productNormalized: productNormalized
247
- });
248
247
  dispatch({
249
248
  type: "SET_PRODUCT",
250
249
  payload: productNormalized
@@ -289,7 +288,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
289
288
 
290
289
  var fetchData = /*#__PURE__*/function () {
291
290
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
292
- var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, _services$2$inputsByR, _services$2$values, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues;
291
+ var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, _services$2$inputsByR, _services$2$values, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues, updatedStatusByRetailer;
293
292
 
294
293
  return _regenerator.default.wrap(function _callee2$(_context2) {
295
294
  while (1) {
@@ -339,6 +338,21 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
339
338
  var orderA = (_orderMap$a$image_id = orderMap[a.image_id]) !== null && _orderMap$a$image_id !== void 0 ? _orderMap$a$image_id : Number.MAX_SAFE_INTEGER;
340
339
  var orderB = (_orderMap$b$image_id = orderMap[b.image_id]) !== null && _orderMap$b$image_id !== void 0 ? _orderMap$b$image_id : Number.MAX_SAFE_INTEGER;
341
340
  return orderA - orderB;
341
+ }); //Cuando carguemos la información de los servicios, las actualizamos en el estado del producto
342
+
343
+ updatedStatusByRetailer = servicesDataRes.reduce(function (acc, current, idx) {
344
+ var id_retailer = current.id_retailer,
345
+ service = current.service,
346
+ status = current.status;
347
+ if (!acc[id_retailer]) acc[id_retailer] = {};
348
+ acc[id_retailer][service] = status;
349
+ return acc;
350
+ }, {});
351
+ dispatch({
352
+ type: "SET_PRODUCT",
353
+ payload: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
354
+ statusByRetailer: updatedStatusByRetailer
355
+ })
342
356
  });
343
357
  dispatch({
344
358
  type: "SET_SERVICES",
@@ -365,11 +379,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
365
379
  return rId === id_retailer;
366
380
  })
367
381
  });
368
- _context2.next = 24;
382
+ _context2.next = 26;
369
383
  break;
370
384
 
371
- case 20:
372
- _context2.prev = 20;
385
+ case 22:
386
+ _context2.prev = 22;
373
387
  _context2.t0 = _context2["catch"](1);
374
388
  console.error("Error fetching data:", _context2.t0);
375
389
  dispatch({
@@ -377,20 +391,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
377
391
  payload: _context2.t0
378
392
  });
379
393
 
380
- case 24:
381
- _context2.prev = 24;
394
+ case 26:
395
+ _context2.prev = 26;
382
396
  dispatch({
383
397
  type: "SET_LOADING",
384
398
  payload: false
385
399
  });
386
- return _context2.finish(24);
400
+ return _context2.finish(26);
387
401
 
388
- case 27:
402
+ case 29:
389
403
  case "end":
390
404
  return _context2.stop();
391
405
  }
392
406
  }
393
- }, _callee2, null, [[1, 20, 24, 27]]);
407
+ }, _callee2, null, [[1, 22, 26, 29]]);
394
408
  }));
395
409
 
396
410
  return function fetchData() {
@@ -399,7 +413,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
399
413
  }();
400
414
 
401
415
  fetchData();
402
- }, [state.product, state.active_retailer, token]); // Actualizador de campos del ui para que coincidan con el retailer activo
416
+ }, [(_state$product2 = state.product) === null || _state$product2 === void 0 ? void 0 : _state$product2.datasheet_status, (_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.description_status, (_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.images_status, (_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.status, (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.percentages, (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.version, state.active_retailer, token]); // Actualizador de campos del ui para que coincidan con el retailer activo
403
417
 
404
418
  (0, _react.useEffect)(function () {
405
419
  if (!state.active_retailer) return;
@@ -450,25 +464,38 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
450
464
  }, [state.services]); // Helper functions
451
465
 
452
466
  var canShowValidationButtons = function canShowValidationButtons() {
453
- var _state$product2;
467
+ var _state$product8;
454
468
 
455
- if (!((_state$product2 = state.product) !== null && _state$product2 !== void 0 && _state$product2.statusByRetailer)) return false;
456
- var currentService = (0, _utils.getConceptByTab)(state.active_tab);
457
- var currentStatus = state.product["".concat(currentService, "_status")];
458
- var originTab = origin[state.active_tab];
459
- var isRetailerUser = (user === null || user === void 0 ? void 0 : user.is_retailer) === 1;
460
- var validStatuses = ["AA", "AP", "R", "CA", "RCA"];
461
- if (!validStatuses.includes(currentStatus)) return false;
462
- var validOrigins = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"];
463
- if (!validOrigins.includes(originTab)) return false; // Retailer: solo AP
469
+ if (!((_state$product8 = state.product) !== null && _state$product8 !== void 0 && _state$product8.statusByRetailer)) return false;
470
+
471
+ try {
472
+ var currentService = (0, _utils.getConceptByTab)(state.active_tab); // const currentStatus = state.product[`${currentService}_status`];
464
473
 
465
- if (isRetailerUser) {
466
- return currentStatus === "AP";
467
- } // No retailer
474
+ var currentRetailer = state.active_retailer.id_retailer; //Información del servicio de la cadena seleccionada
468
475
 
476
+ var _state$services_data$ = state.services_data.find(function (service) {
477
+ return service.service === currentService && service.id_retailer === currentRetailer;
478
+ }),
479
+ currentStatus = _state$services_data$.status;
480
+
481
+ var originTab = origin[state.active_tab];
482
+ var isRetailerUser = (user === null || user === void 0 ? void 0 : user.is_retailer) === 1;
483
+ var validStatuses = ["AA", "AP", "R", "CA", "RCA"];
484
+ if (!validStatuses.includes(currentStatus)) return false;
485
+ var validOrigins = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"];
486
+ if (!validOrigins.includes(originTab)) return false; // Retailer: solo AP
487
+
488
+ if (isRetailerUser) {
489
+ return currentStatus === "AP";
490
+ } // No retailer
469
491
 
470
- var hasNoOrder = !state.product.id_order && !state.product.orderId;
471
- return originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
492
+
493
+ var hasNoOrder = !state.product.id_order && !state.product.orderId;
494
+ var condition = originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
495
+ return condition;
496
+ } catch (error) {
497
+ return false;
498
+ }
472
499
  };
473
500
 
474
501
  var canShowSaveButton = function canShowSaveButton(version_status) {
@@ -486,10 +513,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
486
513
 
487
514
  var getStatusByCurrentServiceAndRetailer = function getStatusByCurrentServiceAndRetailer() {
488
515
  var statusByRetailer = state.product.statusByRetailer;
489
- if (!statusByRetailer) return "-";
516
+ if (!statusByRetailer || Object.keys(statusByRetailer).length === 0) return "-";
490
517
  var currentService = (0, _utils.getConceptByTab)(state.active_tab);
491
518
  var currentRetailer = state.active_retailer.id_retailer;
492
- var currentStatus = statusByRetailer[currentRetailer][currentService] || "ERR";
519
+ var currentStatus = statusByRetailer[currentRetailer][currentService] || "N/S";
493
520
  return currentStatus;
494
521
  };
495
522
 
@@ -560,9 +587,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
560
587
  };
561
588
 
562
589
  var handleOnClickSaveImages = function handleOnClickSaveImages() {
563
- var _state$product3, _state$product3$servi;
590
+ var _state$product9, _state$product9$servi;
564
591
 
565
- if (((_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : (_state$product3$servi = _state$product3.services) === null || _state$product3$servi === void 0 ? void 0 : _state$product3$servi.images) === 1) {
592
+ if (((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : (_state$product9$servi = _state$product9.services) === null || _state$product9$servi === void 0 ? void 0 : _state$product9$servi.images) === 1) {
566
593
  updateImages();
567
594
  }
568
595
  };
@@ -783,9 +810,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
783
810
 
784
811
  var sendEvaluation = /*#__PURE__*/function () {
785
812
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) {
786
- var _state$product$id_ord, _state$product4, _state$active_retaile2;
813
+ var _state$product$id_ord, _state$product10, _state$active_retaile2;
814
+
815
+ var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedProduct, updatedServicesData;
787
816
 
788
- var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, serviceStatus, updatedProduct;
789
817
  return _regenerator.default.wrap(function _callee3$(_context3) {
790
818
  while (1) {
791
819
  switch (_context3.prev = _context3.next) {
@@ -798,7 +826,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
798
826
  articleId = state.product.id_article;
799
827
  orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
800
828
  sectionStatusKey = "".concat(concept, "_status");
801
- evalStatus = state.product[sectionStatusKey] || ((_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.version_status);
829
+ evalStatus = state.product[sectionStatusKey] || ((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.version_status);
802
830
  data = {
803
831
  articleId: articleId,
804
832
  orderId: orderId,
@@ -809,7 +837,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
809
837
  _context3.prev = 8;
810
838
 
811
839
  if (!result) {
812
- _context3.next = 21;
840
+ _context3.next = 22;
813
841
  break;
814
842
  }
815
843
 
@@ -828,11 +856,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
828
856
  serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")]; // Actualizar el producto con los nuevos estados
829
857
 
830
858
  updatedProduct = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
831
- statusByRetailer: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer), {}, (0, _defineProperty2.default)({}, retailerId, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer[retailerId]), {}, (0, _defineProperty2.default)({}, concept, serviceStatus))))
859
+ statusByRetailer: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer), {}, (0, _defineProperty2.default)({}, retailerId, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer[retailerId]), {}, (0, _defineProperty2.default)({}, concept, (_newStatuses$newStatu = newStatuses === null || newStatuses === void 0 ? void 0 : newStatuses.newStatus) !== null && _newStatuses$newStatu !== void 0 ? _newStatuses$newStatu : serviceStatus))))
832
860
  });
833
- console.log({
834
- updatedProduct: updatedProduct
861
+ updatedServicesData = (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.map(function (service) {
862
+ var _newStatuses$newStatu2;
863
+
864
+ return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, service), {}, {
865
+ status: (service === null || service === void 0 ? void 0 : service.id_retailer) === retailerId && (service === null || service === void 0 ? void 0 : service.service) === concept ? (_newStatuses$newStatu2 = newStatuses === null || newStatuses === void 0 ? void 0 : newStatuses.newStatus) !== null && _newStatuses$newStatu2 !== void 0 ? _newStatuses$newStatu2 : serviceStatus : service === null || service === void 0 ? void 0 : service.status
866
+ });
835
867
  });
868
+ dispatch({
869
+ type: "SET_SERVICES_DATA",
870
+ payload: updatedServicesData
871
+ }); // console.log({ updatedProduct });
872
+
836
873
  dispatch({
837
874
  type: "SET_PRODUCT",
838
875
  payload: updatedProduct
@@ -848,12 +885,12 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
848
885
  }
849
886
  });
850
887
 
851
- case 21:
852
- _context3.next = 27;
888
+ case 22:
889
+ _context3.next = 28;
853
890
  break;
854
891
 
855
- case 23:
856
- _context3.prev = 23;
892
+ case 24:
893
+ _context3.prev = 24;
857
894
  _context3.t0 = _context3["catch"](8);
858
895
  console.error("Error sending evaluation:", _context3.t0);
859
896
  dispatch({
@@ -866,20 +903,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
866
903
  }
867
904
  });
868
905
 
869
- case 27:
870
- _context3.prev = 27;
906
+ case 28:
907
+ _context3.prev = 28;
871
908
  dispatch({
872
909
  type: "SET_SAVING",
873
910
  payload: false
874
911
  });
875
- return _context3.finish(27);
912
+ return _context3.finish(28);
876
913
 
877
- case 30:
914
+ case 31:
878
915
  case "end":
879
916
  return _context3.stop();
880
917
  }
881
918
  }
882
- }, _callee3, null, [[8, 23, 27, 30]]);
919
+ }, _callee3, null, [[8, 24, 28, 31]]);
883
920
  }));
884
921
 
885
922
  return function sendEvaluation(_x2) {
@@ -1101,7 +1138,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1101
1138
 
1102
1139
  var handleOnEvaluateAll = /*#__PURE__*/function () {
1103
1140
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(result) {
1104
- var _state$product$id_ord2, _state$services_data, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
1141
+ var _state$product$id_ord2, _state$services_data2, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
1105
1142
 
1106
1143
  return _regenerator.default.wrap(function _callee5$(_context5) {
1107
1144
  while (1) {
@@ -1121,7 +1158,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1121
1158
  isAproved: result === "A"
1122
1159
  }; // Crear todas las evaluaciones para cada servicio y retailer
1123
1160
 
1124
- (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.forEach(function (ret) {
1161
+ (_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.forEach(function (ret) {
1125
1162
  var service = ret.service,
1126
1163
  id_retailer = ret.id_retailer;
1127
1164
  var data = {};
@@ -1251,330 +1288,334 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1251
1288
  };
1252
1289
 
1253
1290
  if (state.loading || !state.services || !state.product) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
1254
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1255
- headerTop: headerTop,
1256
- children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1257
- modalId: "version-selector",
1258
- articleId: state.product.id_article,
1259
- setVersion: handleOnChangeProductVersion,
1260
- companyName: company.company_name,
1261
- currentVersion: state.product.version,
1262
- setShowVersionSelector: setShowVersionSelector,
1263
- jwt: token
1264
- }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1265
- images: state.images_values,
1266
- setShowModal: setShowModal,
1267
- approveRejectButtons: canShowValidationButtons(),
1268
- sendToFacilitator: handleOnSendEvaluation
1269
- }), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1270
- componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1271
- src: state.modal.image,
1272
- alt: "modal icon"
1273
- }, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1274
- headerType: "retailer-name-header",
1275
- text: state.modal.title,
1276
- color: "white"
1277
- }, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1278
- headerType: "retailer-name-header",
1279
- text: state.modal.message,
1280
- color: "white"
1281
- }, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1282
- style: {
1283
- marginTop: "16px"
1284
- },
1285
- children: state.modal.buttons.map(function (button, index) {
1286
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1287
- buttonType: button.buttonType,
1288
- label: button.text,
1289
- onClick: button.action
1290
- }, index);
1291
- })
1292
- }, "4")].filter(Boolean),
1293
- onClick: function onClick() {
1294
- return dispatch({
1295
- type: "SET_MODAL",
1296
- payload: {
1297
- show: false,
1298
- title: "",
1299
- message: "",
1300
- image: null
1301
- }
1302
- });
1303
- }
1304
- }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
1305
- title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
1306
- show: showRejectModal,
1307
- customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1308
- inputType: "textarea",
1309
- inputId: "modal-message-box",
1310
- index: 0,
1311
- color: "white"
1312
- }),
1313
- buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1314
- type: "white",
1315
- label: "Cancelar",
1316
- size: 12,
1291
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiProductEdition.AiProductEditionProvider, {
1292
+ isCreatorsEdition: false,
1293
+ state: state,
1294
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1295
+ headerTop: headerTop,
1296
+ children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1297
+ modalId: "version-selector",
1298
+ articleId: state.product.id_article,
1299
+ setVersion: handleOnChangeProductVersion,
1300
+ companyName: company.company_name,
1301
+ currentVersion: state.product.version,
1302
+ setShowVersionSelector: setShowVersionSelector,
1303
+ jwt: token
1304
+ }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1305
+ images: state.images_values,
1306
+ setShowModal: setShowModal,
1307
+ approveRejectButtons: canShowValidationButtons(),
1308
+ sendToFacilitator: handleOnSendEvaluation
1309
+ }), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1310
+ componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1311
+ src: state.modal.image,
1312
+ alt: "modal icon"
1313
+ }, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1314
+ headerType: "retailer-name-header",
1315
+ text: state.modal.title,
1316
+ color: "white"
1317
+ }, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1318
+ headerType: "retailer-name-header",
1319
+ text: state.modal.message,
1320
+ color: "white"
1321
+ }, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1322
+ style: {
1323
+ marginTop: "16px"
1324
+ },
1325
+ children: state.modal.buttons.map(function (button, index) {
1326
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1327
+ buttonType: button.buttonType,
1328
+ label: button.text,
1329
+ onClick: button.action
1330
+ }, index);
1331
+ })
1332
+ }, "4")].filter(Boolean),
1317
1333
  onClick: function onClick() {
1318
- setShowRejectModal(false);
1334
+ return dispatch({
1335
+ type: "SET_MODAL",
1336
+ payload: {
1337
+ show: false,
1338
+ title: "",
1339
+ message: "",
1340
+ image: null
1341
+ }
1342
+ });
1319
1343
  }
1320
- }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1321
- type: "pink",
1322
- label: "Aceptar",
1323
- size: 12,
1324
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1325
- var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
1326
- return _regenerator.default.wrap(function _callee6$(_context6) {
1327
- while (1) {
1328
- switch (_context6.prev = _context6.next) {
1329
- case 0:
1330
- elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
1331
-
1332
- if (!(!elements || elements.length === 0)) {
1333
- _context6.next = 4;
1334
- break;
1335
- }
1344
+ }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
1345
+ title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
1346
+ show: showRejectModal,
1347
+ customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1348
+ inputType: "textarea",
1349
+ inputId: "modal-message-box",
1350
+ index: 0,
1351
+ color: "white"
1352
+ }),
1353
+ buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1354
+ type: "white",
1355
+ label: "Cancelar",
1356
+ size: 12,
1357
+ onClick: function onClick() {
1358
+ setShowRejectModal(false);
1359
+ }
1360
+ }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1361
+ type: "pink",
1362
+ label: "Aceptar",
1363
+ size: 12,
1364
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1365
+ var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
1366
+ return _regenerator.default.wrap(function _callee6$(_context6) {
1367
+ while (1) {
1368
+ switch (_context6.prev = _context6.next) {
1369
+ case 0:
1370
+ elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
1336
1371
 
1337
- console.error("Elemento no encontrado");
1338
- return _context6.abrupt("return");
1372
+ if (!(!elements || elements.length === 0)) {
1373
+ _context6.next = 4;
1374
+ break;
1375
+ }
1339
1376
 
1340
- case 4:
1341
- isMessageEmpty = Array.from(elements).every(function (el) {
1342
- var body = el.innerHTML;
1343
- return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
1344
- });
1377
+ console.error("Elemento no encontrado");
1378
+ return _context6.abrupt("return");
1345
1379
 
1346
- if (!isMessageEmpty) {
1347
- _context6.next = 10;
1348
- break;
1349
- }
1380
+ case 4:
1381
+ isMessageEmpty = Array.from(elements).every(function (el) {
1382
+ var body = el.innerHTML;
1383
+ return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
1384
+ });
1350
1385
 
1351
- container = document.querySelector(".container-customComponent");
1352
- existingAlert = container.querySelector(".alert-error");
1386
+ if (!isMessageEmpty) {
1387
+ _context6.next = 10;
1388
+ break;
1389
+ }
1353
1390
 
1354
- if (!existingAlert) {
1355
- alert = document.createElement("div");
1356
- alert.className = "alert-error";
1357
- alert.style.cssText = "\n color: #d32f2f;\n background-color: #ffebee;\n border: 1px solid #ef5350;\n border-radius: 4px;\n padding: 12px 16px;\n margin-top: 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n font-family: 'Roboto', sans-serif;\n text-align: center;\n ";
1358
- alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
1359
- container.appendChild(alert);
1360
- }
1391
+ container = document.querySelector(".container-customComponent");
1392
+ existingAlert = container.querySelector(".alert-error");
1361
1393
 
1362
- return _context6.abrupt("return");
1394
+ if (!existingAlert) {
1395
+ alert = document.createElement("div");
1396
+ alert.className = "alert-error";
1397
+ alert.style.cssText = "\n color: #d32f2f;\n background-color: #ffebee;\n border: 1px solid #ef5350;\n border-radius: 4px;\n padding: 12px 16px;\n margin-top: 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n font-family: 'Roboto', sans-serif;\n text-align: center;\n ";
1398
+ alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
1399
+ container.appendChild(alert);
1400
+ }
1363
1401
 
1364
- case 10:
1365
- fullMessage = Array.from(elements).map(function (element) {
1366
- return element.innerHTML;
1367
- }).join("").replace(/<br\s*\/?>/gi, "\n");
1368
- _context6.next = 13;
1369
- return createComment(fullMessage);
1402
+ return _context6.abrupt("return");
1370
1403
 
1371
- case 13:
1372
- rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
1373
- setShowRejectModal(false);
1404
+ case 10:
1405
+ fullMessage = Array.from(elements).map(function (element) {
1406
+ return element.innerHTML;
1407
+ }).join("").replace(/<br\s*\/?>/gi, "\n");
1408
+ _context6.next = 13;
1409
+ return createComment(fullMessage, token);
1374
1410
 
1375
- case 15:
1376
- case "end":
1377
- return _context6.stop();
1378
- }
1379
- }
1380
- }, _callee6);
1381
- }))
1382
- }, "btn-Aceptar")]
1383
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1384
- setHeaderTop: setHeaderTop,
1385
- withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
1386
- chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
1387
- productSelected: state.product,
1388
- token: token,
1389
- activeRetailer: {
1390
- id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
1391
- name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
1392
- }
1393
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1394
- className: "data-container",
1395
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1396
- className: "image-data-panel",
1397
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
1398
- activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
1399
- imagesArray: state.images_values || [],
1400
- setActiveImage: handleOnChangeCurrentImage,
1401
- setShowModal: handleOnShowModalGalery
1402
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
1403
- lists: state.images_values || [],
1404
- activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
1405
- assignationsImages: assig,
1406
- retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
1407
- imagesStatus: ((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.images_status) || "-",
1408
- isRetailer: isRetailer,
1409
- setShowVersionSelector: setShowVersionSelector,
1410
- version: state.product.version,
1411
- setImages: handleOnChangeCurrentImage,
1412
- onClickSave: handleOnClickSaveImages,
1413
- setAssignation: handleOnChangeAssignations // No se usa?
1411
+ case 13:
1412
+ rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
1413
+ setShowRejectModal(false);
1414
1414
 
1415
- })]
1416
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1417
- className: "product-information",
1418
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1419
- className: "product-information",
1420
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
1421
- headerData: state.product,
1422
- percent: state.active_percentage.percentagesGeneral.required,
1423
- activeRetailer: {
1424
- id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
1425
- name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
1426
- image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
1427
- },
1428
- showValidationButtons: canShowValidationButtons(),
1429
- showApproveRejectAll: canShowValidationButtons(),
1430
- servicesData: state.services_data ? state.services_data : null,
1431
- approveAll: handleOnApproveAll,
1432
- rejectAll: handleOnRejectAll,
1433
- approve: function approve() {
1434
- return handleOnSendEvaluation("A");
1435
- },
1436
- reject: handleOnReject,
1437
- setActiveRetailer: handleOnChangeActiveRetailer
1438
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1439
- tabsSections: tabsSections,
1440
- status: getStatusByCurrentServiceAndRetailer(),
1441
- activeTab: state.active_tab,
1442
- user: user,
1415
+ case 15:
1416
+ case "end":
1417
+ return _context6.stop();
1418
+ }
1419
+ }
1420
+ }, _callee6);
1421
+ }))
1422
+ }, "btn-Aceptar")]
1423
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1424
+ setHeaderTop: setHeaderTop,
1425
+ withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
1426
+ chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
1427
+ productSelected: state.product,
1428
+ token: token,
1429
+ activeRetailer: {
1430
+ id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
1431
+ name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
1432
+ }
1433
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1434
+ className: "data-container",
1435
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1436
+ className: "image-data-panel",
1437
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
1438
+ activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
1439
+ imagesArray: state.images_values || [],
1440
+ setActiveImage: handleOnChangeCurrentImage,
1441
+ setShowModal: handleOnShowModalGalery
1442
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
1443
+ lists: state.images_values || [],
1444
+ activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
1445
+ assignationsImages: assig,
1446
+ retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
1447
+ imagesStatus: ((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.images_status) || "-",
1443
1448
  isRetailer: isRetailer,
1444
- assig: assig,
1449
+ setShowVersionSelector: setShowVersionSelector,
1445
1450
  version: state.product.version,
1446
- updatedDescriptions: state.updated_descriptions_inputs,
1447
- updatedDatasheets: state.updated_datasheets_inputs,
1448
- updatedImages: state.updated_images_values,
1449
- images: state.services.images // actions
1450
- ,
1451
- downloadImages: handleOnDownloadImages,
1452
- askToDeleteImages: handleOnAskToDeleteImages,
1453
- showSaveButton: canShowSaveButton(state.product.version_status),
1454
- onClickSave: handleOnClickSave // setters
1455
- ,
1456
- setActiveTab: handleOnChangeActiveTab,
1457
- setImageLayout: handleOnSetImageLayout,
1458
- setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1459
- setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1460
- setAssignation: handleOnSetAssignation // No se usa?
1461
- ,
1462
- setImages: handleOnSetImages // No se usa?
1463
- // setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
1464
- ,
1465
- setShowVersionSelector: setShowVersionSelector
1466
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1467
- className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
1468
- children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1469
- children: [state.active_tab === "Descripción" && (((_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1470
- activeSection: state.active_tab,
1471
- inputGroup: state.descriptions_inputs[0],
1472
- updatedDescriptions: state.updated_descriptions_inputs,
1473
- articleId: (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.id_article,
1474
- version: state.product.version,
1475
- isShowbox: false,
1476
- dinamicHeight: true,
1477
- setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1478
- updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1479
-
1480
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1481
- text: "No cuentas con este servicio",
1482
- headerType: "input-name-header"
1483
- })), state.active_tab === "Ficha técnica" && (((_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
1484
- children: (_state$datasheets_inp = state.datasheets_inputs[0].data) === null || _state$datasheets_inp === void 0 ? void 0 : _state$datasheets_inp.map(function (dataGroup, index) {
1485
- var _state$datasheets_inp2;
1486
-
1487
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1488
- index: index,
1489
- articleId: state.product.id_article,
1490
- version: state.version,
1491
- activeSection: state.active_tab,
1492
- inputGroup: dataGroup,
1493
- dataInputs: (_state$datasheets_inp2 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp2 !== void 0 ? _state$datasheets_inp2 : [],
1494
- activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
1495
- groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
1496
- updatedDatasheets: state.updated_datasheets_inputs,
1497
- setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1498
- isShowbox: true,
1499
- setUpdatedBoxData: function setUpdatedBoxData(e) {
1500
- setBoxData(e);
1501
- },
1502
- updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1503
-
1504
- }, index + "-" + state.active_retailer.retailer);
1505
- })
1506
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1507
- text: "No cuentas con este servicio",
1508
- headerType: "input-name-header"
1509
- })), state.active_tab === "Imágenes" && (((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1510
- children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1511
- checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
1512
- ,
1513
- setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
1514
- ,
1515
- setSelectedImages: handleOnSetSelectedImages
1516
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
1517
- className: "container",
1518
- style: {
1519
- position: "relative"
1520
- },
1521
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
1522
- className: "dropzone ".concat(isDragActive ? "drag-active" : "")
1523
- })), {}, {
1524
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1525
- className: "drag-overlay",
1526
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1527
- children: "Suelta las im\xE1genes aqu\xED"
1528
- })
1529
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
1530
- children: thumbs()
1531
- })]
1532
- })), ((_state$images_values12 = state.images_values) === null || _state$images_values12 === void 0 ? void 0 : _state$images_values12.values.length) === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1451
+ setImages: handleOnChangeCurrentImage,
1452
+ onClickSave: handleOnClickSaveImages,
1453
+ setAssignation: handleOnChangeAssignations // No se usa?
1454
+
1455
+ })]
1456
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1457
+ className: "product-information",
1458
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1459
+ className: "product-information",
1460
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
1461
+ headerData: state.product,
1462
+ percent: state.active_percentage.percentagesGeneral.required,
1463
+ activeRetailer: {
1464
+ id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
1465
+ name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
1466
+ image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
1467
+ },
1468
+ showValidationButtons: canShowValidationButtons(),
1469
+ showApproveRejectAll: canShowValidationButtons(),
1470
+ servicesData: state.services_data ? state.services_data : null,
1471
+ approveAll: handleOnApproveAll,
1472
+ rejectAll: handleOnRejectAll,
1473
+ approve: function approve() {
1474
+ return handleOnSendEvaluation("A");
1475
+ },
1476
+ reject: handleOnReject,
1477
+ setActiveRetailer: handleOnChangeActiveRetailer
1478
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1479
+ tabsSections: tabsSections,
1480
+ status: getStatusByCurrentServiceAndRetailer(),
1481
+ activeTab: state.active_tab,
1482
+ user: user,
1483
+ isRetailer: isRetailer,
1484
+ assig: assig,
1485
+ version: state.product.version,
1486
+ updatedDescriptions: state.updated_descriptions_inputs,
1487
+ updatedDatasheets: state.updated_datasheets_inputs,
1488
+ updatedImages: state.updated_images_values,
1489
+ images: state.services.images // actions
1490
+ ,
1491
+ downloadImages: handleOnDownloadImages,
1492
+ askToDeleteImages: handleOnAskToDeleteImages,
1493
+ showSaveButton: canShowSaveButton(state.product.version_status),
1494
+ onClickSave: handleOnClickSave // setters
1495
+ ,
1496
+ setActiveTab: handleOnChangeActiveTab,
1497
+ setImageLayout: handleOnSetImageLayout,
1498
+ setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1499
+ setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1500
+ setAssignation: handleOnSetAssignation // No se usa?
1501
+ ,
1502
+ setImages: handleOnSetImages // No se usa?
1503
+ // setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
1504
+ ,
1505
+ setShowVersionSelector: setShowVersionSelector
1506
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1507
+ className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
1508
+ children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1509
+ children: [state.active_tab === "Descripción" && (((_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1510
+ activeSection: state.active_tab,
1511
+ inputGroup: state.descriptions_inputs[0],
1512
+ updatedDescriptions: state.updated_descriptions_inputs,
1513
+ articleId: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.id_article,
1514
+ version: state.product.version,
1515
+ isShowbox: false,
1516
+ dinamicHeight: true,
1517
+ setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1518
+ updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1519
+
1520
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1521
+ text: "No cuentas con este servicio",
1522
+ headerType: "input-name-header"
1523
+ })), state.active_tab === "Ficha técnica" && (((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
1524
+ children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
1525
+ var _state$datasheets_inp3;
1526
+
1527
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1528
+ index: index,
1529
+ articleId: state.product.id_article,
1530
+ version: state.version,
1531
+ activeSection: state.active_tab,
1532
+ inputGroup: dataGroup,
1533
+ dataInputs: (_state$datasheets_inp3 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp3 !== void 0 ? _state$datasheets_inp3 : [],
1534
+ activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
1535
+ groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
1536
+ updatedDatasheets: state.updated_datasheets_inputs,
1537
+ setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1538
+ isShowbox: true,
1539
+ setUpdatedBoxData: function setUpdatedBoxData(e) {
1540
+ setBoxData(e);
1541
+ },
1542
+ updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1543
+
1544
+ }, index + "-" + state.active_retailer.retailer);
1545
+ })
1546
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1547
+ text: "No cuentas con este servicio",
1548
+ headerType: "input-name-header"
1549
+ })), state.active_tab === "Imágenes" && (((_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1550
+ children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1551
+ checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
1552
+ ,
1553
+ setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
1554
+ ,
1555
+ setSelectedImages: handleOnSetSelectedImages
1556
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
1557
+ className: "container",
1533
1558
  style: {
1534
- position: "absolute",
1535
- top: "50%",
1536
- left: "50%",
1537
- transform: "translate(-50%, -50%)",
1538
- textAlign: "center",
1539
- padding: "40px",
1540
- width: "80%",
1541
- maxWidth: "500px",
1542
- fontFamily: "Arial, sans-serif"
1559
+ position: "relative"
1543
1560
  },
1544
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1545
- style: {
1546
- fontSize: "18px",
1547
- color: "#666",
1548
- marginBottom: "16px"
1549
- },
1550
- children: "Este producto no tiene im\xE1genes"
1551
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
1561
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
1562
+ className: "dropzone ".concat(isDragActive ? "drag-active" : "")
1563
+ })), {}, {
1564
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1565
+ className: "drag-overlay",
1566
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1567
+ children: "Suelta las im\xE1genes aqu\xED"
1568
+ })
1569
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
1570
+ children: thumbs()
1571
+ })]
1572
+ })), ((_state$images_values12 = state.images_values) === null || _state$images_values12 === void 0 ? void 0 : _state$images_values12.values.length) === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1552
1573
  style: {
1553
- fontSize: "14px",
1554
- color: "#999",
1555
- marginBottom: "20px"
1574
+ position: "absolute",
1575
+ top: "50%",
1576
+ left: "50%",
1577
+ transform: "translate(-50%, -50%)",
1578
+ textAlign: "center",
1579
+ padding: "40px",
1580
+ width: "80%",
1581
+ maxWidth: "500px",
1582
+ fontFamily: "Arial, sans-serif"
1556
1583
  },
1557
- children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1558
- onClick: open,
1584
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1585
+ style: {
1586
+ fontSize: "18px",
1587
+ color: "#666",
1588
+ marginBottom: "16px"
1589
+ },
1590
+ children: "Este producto no tiene im\xE1genes"
1591
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
1559
1592
  style: {
1560
- color: "#007bff",
1561
- cursor: "pointer",
1562
- textDecoration: "underline"
1593
+ fontSize: "14px",
1594
+ color: "#999",
1595
+ marginBottom: "20px"
1563
1596
  },
1564
- children: "haz clic para abrir el explorador de archivos"
1597
+ children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1598
+ onClick: open,
1599
+ style: {
1600
+ color: "#007bff",
1601
+ cursor: "pointer",
1602
+ textDecoration: "underline"
1603
+ },
1604
+ children: "haz clic para abrir el explorador de archivos"
1605
+ })]
1565
1606
  })]
1566
1607
  })]
1567
1608
  })]
1568
- })]
1569
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1570
- text: "No cuentas con este servicio",
1571
- headerType: "input-name-header"
1572
- }))]
1573
- })
1574
- })]
1575
- })
1609
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1610
+ text: "No cuentas con este servicio",
1611
+ headerType: "input-name-header"
1612
+ }))]
1613
+ })
1614
+ })]
1615
+ })
1616
+ })]
1576
1617
  })]
1577
- })]
1618
+ })
1578
1619
  });
1579
1620
  };
1580
1621