contentoh-components-library 21.5.91 → 21.5.93

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 (66) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +54 -245
  3. package/dist/components/atoms/GeneralInput/styles.js +3 -7
  4. package/dist/components/atoms/InputFormatter/index.js +68 -223
  5. package/dist/components/atoms/InputFormatter/styles.js +4 -20
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -11
  7. package/dist/components/molecules/TabsMenu/index.js +12 -13
  8. package/dist/components/molecules/TagAndInput/index.js +24 -361
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +22 -6
  11. package/dist/components/organisms/InputGroup/index.js +18 -22
  12. package/dist/components/pages/ProviderProductEdition/index.js +47 -34
  13. package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
  14. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +196 -179
  15. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +260 -59
  16. package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +38 -50
  17. package/dist/components/pages/RetailerProductEdition/index.js +2234 -1715
  18. package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
  19. package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
  20. package/dist/contexts/AiProductEdition.js +157 -234
  21. package/package.json +2 -4
  22. package/src/components/atoms/GeneralButton/styles.js +0 -4
  23. package/src/components/atoms/GeneralInput/index.js +60 -237
  24. package/src/components/atoms/GeneralInput/styles.js +0 -81
  25. package/src/components/atoms/InputFormatter/index.js +51 -200
  26. package/src/components/atoms/InputFormatter/styles.js +0 -284
  27. package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
  28. package/src/components/molecules/TabsMenu/index.js +11 -12
  29. package/src/components/molecules/TagAndInput/index.js +21 -286
  30. package/src/components/molecules/TagAndInput/styles.js +17 -59
  31. package/src/components/organisms/FullProductNameHeader/index.js +28 -4
  32. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  33. package/src/components/organisms/InputGroup/index.js +4 -12
  34. package/src/components/pages/ProviderProductEdition/index.js +69 -51
  35. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  36. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +224 -201
  37. package/src/components/pages/RetailerProductEdition/index.js +1718 -1546
  38. package/src/components/pages/RetailerProductEdition/styles.js +2 -67
  39. package/src/components/pages/RetailerProductEdition/utils.js +0 -240
  40. package/dist/ai/utils/compare-strings.js +0 -45
  41. package/dist/components/organisms/ChangeStatusModal/index.js +0 -531
  42. package/dist/components/organisms/ChangeStatusModal/styles.js +0 -85
  43. package/dist/global-files/statusDictionary.js +0 -103
  44. package/src/ai/utils/compare-strings.js +0 -45
  45. package/src/assets/images/Icons/arrow.png +0 -0
  46. package/src/assets/images/Icons/cancel.png +0 -0
  47. package/src/assets/images/Icons/ia-icon.png +0 -0
  48. package/src/assets/images/Icons/loading.svg +0 -5
  49. package/src/assets/images/Icons/reload.png +0 -0
  50. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
  51. package/src/components/atoms/RetailerSelector/index.js +0 -3
  52. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  53. package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
  54. package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
  55. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
  56. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
  57. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
  58. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
  59. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
  60. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
  61. package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
  62. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
  63. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
  64. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
  65. package/src/contexts/AiProductEdition.jsx +0 -344
  66. package/src/global-files/statusDictionary.js +0 -103
@@ -7,15 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.TagAndInput = void 0;
9
9
 
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
15
-
16
- var _objectSpread6 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
17
-
18
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
19
11
 
20
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
21
13
 
@@ -37,10 +29,6 @@ var _SliderToolTip = require("../../atoms/SliderToolTip");
37
29
 
38
30
  var _Tooltip = require("../../atoms/Tooltip");
39
31
 
40
- var _AiProductEdition = require("../../../contexts/AiProductEdition");
41
-
42
- var _iaIcon = _interopRequireDefault(require("../../../assets/images/Icons/ia-icon.png"));
43
-
44
32
  var _jsxRuntime = require("react/jsx-runtime");
45
33
 
46
34
  var TagAndInput = function TagAndInput(_ref) {
@@ -62,7 +50,6 @@ var TagAndInput = function TagAndInput(_ref) {
62
50
  inputRows = _ref.inputRows,
63
51
  maxChar = _ref.maxChar,
64
52
  required = _ref.required,
65
- aiGenerated = _ref.aiGenerated,
66
53
  optionList = _ref.optionList,
67
54
  description = _ref.description,
68
55
  inputOnChange = _ref.inputOnChange,
@@ -81,274 +68,15 @@ var TagAndInput = function TagAndInput(_ref) {
81
68
  boxOnboardingList = _useState2[0],
82
69
  setBoxOnboardingList = _useState2[1];
83
70
 
84
- var _useAiProductEdition = (0, _AiProductEdition.useAiProductEdition)(),
85
- isCreators = _useAiProductEdition.isCreators,
86
- generateProductSuggestions = _useAiProductEdition.generateProductSuggestions,
87
- regenerateProductSuggestions = _useAiProductEdition.regenerateProductSuggestions,
88
- suggestions = _useAiProductEdition.suggestions,
89
- setSuggestions = _useAiProductEdition.setSuggestions,
90
- currentSuggestion = _useAiProductEdition.currentSuggestion,
91
- setCurrentSuggestionValue = _useAiProductEdition.setCurrentSuggestionValue,
92
- isAiAvailable = _useAiProductEdition.isAiAvailable,
93
- inputsGeneratedWithAi = _useAiProductEdition.inputsGeneratedWithAi,
94
- setInputsGeneratedWithAi = _useAiProductEdition.setInputsGeneratedWithAi,
95
- inputsUsingAi = _useAiProductEdition.inputsUsingAi,
96
- setInputsUsingAi = _useAiProductEdition.setInputsUsingAi;
97
-
98
- var isBenefitInput = label === null || label === void 0 ? void 0 : label.toLowerCase().includes("beneficios");
99
-
100
- var _useState3 = (0, _react.useState)(false),
101
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
102
- isAiGenerationLoading = _useState4[0],
103
- setIsAiGenerationLoading = _useState4[1];
104
-
105
- var _useState5 = (0, _react.useState)(false),
106
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
107
- isAiActive = _useState6[0],
108
- setIsAiActive = _useState6[1];
109
-
110
- var _useState7 = (0, _react.useState)(false),
111
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
112
- isAiRegenerationLoading = _useState8[0],
113
- setIsAiRegenerationLoading = _useState8[1];
114
-
115
- var _useState9 = (0, _react.useState)(false),
116
- _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
117
- isAiGenerated = _useState10[0],
118
- setIsAiGenerated = _useState10[1];
119
-
120
- var _useState11 = (0, _react.useState)(""),
121
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
122
- errorMessage = _useState12[0],
123
- setErrorMessage = _useState12[1];
124
-
125
- function handlerAiGeneration(_x) {
126
- return _handlerAiGeneration.apply(this, arguments);
127
- }
128
-
129
- function _handlerAiGeneration() {
130
- _handlerAiGeneration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
131
- var type, currentSuggestions, aiSuggestions, errorMsg;
132
- return _regenerator.default.wrap(function _callee$(_context) {
133
- while (1) {
134
- switch (_context.prev = _context.next) {
135
- case 0:
136
- type = _ref2.type;
137
-
138
- if (!(isAiGenerationLoading || !isAiAvailable)) {
139
- _context.next = 3;
140
- break;
141
- }
142
-
143
- return _context.abrupt("return");
144
-
145
- case 3:
146
- if (!isAiActive) {
147
- _context.next = 6;
148
- break;
149
- }
150
-
151
- setIsAiActive(false);
152
- return _context.abrupt("return");
153
-
154
- case 6:
155
- //Si ya tiene sugerencias generadas, se las mostramos
156
- currentSuggestions = suggestions === null || suggestions === void 0 ? void 0 : suggestions[inputId];
157
-
158
- if (!(Array.isArray(currentSuggestions) && currentSuggestions.length > 0)) {
159
- _context.next = 9;
160
- break;
161
- }
162
-
163
- return _context.abrupt("return", setIsAiActive(true));
164
-
165
- case 9:
166
- setErrorMessage("");
167
- setIsAiGenerationLoading(true);
168
- _context.next = 13;
169
- return generateProductSuggestions({
170
- inputName: label,
171
- currentValue: value,
172
- description: description,
173
- maxChar: maxChar !== null && maxChar !== void 0 ? maxChar : 99,
174
- type: type,
175
- // Informacion del producto
176
- articleId: articleId,
177
- versionId: version,
178
- descriptionId: !isBenefitInput ? inputId : null,
179
- attributeId: isBenefitInput ? inputId : null
180
- });
181
-
182
- case 13:
183
- aiSuggestions = _context.sent;
184
-
185
- if (!(!aiSuggestions && aiSuggestions.length === 0)) {
186
- _context.next = 19;
187
- break;
188
- }
189
-
190
- errorMsg = "Error: No se recibieron sugerencias de IA";
191
- console.log(errorMsg);
192
- setIsAiGenerationLoading(false);
193
- return _context.abrupt("return");
194
-
195
- case 19:
196
- if (!(aiSuggestions !== null && aiSuggestions !== void 0 && aiSuggestions.error)) {
197
- _context.next = 24;
198
- break;
199
- }
200
-
201
- console.log('Error: ', aiSuggestions.error);
202
- setErrorMessage(aiSuggestions.error);
203
- setIsAiGenerationLoading(false);
204
- return _context.abrupt("return");
205
-
206
- case 24:
207
- setSuggestions(function (prev) {
208
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, inputId, aiSuggestions));
209
- });
210
- setIsAiActive(true);
211
- setIsAiGenerationLoading(false);
212
-
213
- case 27:
214
- case "end":
215
- return _context.stop();
216
- }
217
- }
218
- }, _callee);
219
- }));
220
- return _handlerAiGeneration.apply(this, arguments);
221
- }
222
-
223
- function handlerRegenerateSuggestions(_x2) {
224
- return _handlerRegenerateSuggestions.apply(this, arguments);
225
- }
226
-
227
- function _handlerRegenerateSuggestions() {
228
- _handlerRegenerateSuggestions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
229
- var _ref3$type, type, currentSuggestions, aiSuggestions, errorMsg;
230
-
231
- return _regenerator.default.wrap(function _callee2$(_context2) {
232
- while (1) {
233
- switch (_context2.prev = _context2.next) {
234
- case 0:
235
- _ref3$type = _ref3.type, type = _ref3$type === void 0 ? "description" : _ref3$type;
236
-
237
- if (!isAiRegenerationLoading) {
238
- _context2.next = 3;
239
- break;
240
- }
241
-
242
- return _context2.abrupt("return");
243
-
244
- case 3:
245
- setErrorMessage("");
246
- setIsAiRegenerationLoading(true);
247
- currentSuggestions = suggestions === null || suggestions === void 0 ? void 0 : suggestions[inputId];
248
- _context2.next = 8;
249
- return regenerateProductSuggestions({
250
- inputName: label,
251
- currentValue: value,
252
- description: description,
253
- maxChar: maxChar !== null && maxChar !== void 0 ? maxChar : 99,
254
- type: type,
255
- //Información del producto
256
- articleId: articleId,
257
- versionId: version,
258
- descriptionId: !isBenefitInput ? inputId : null,
259
- attributeId: isBenefitInput ? inputId : null
260
- });
261
-
262
- case 8:
263
- aiSuggestions = _context2.sent;
264
-
265
- if (!(!aiSuggestions && aiSuggestions.length === 0)) {
266
- _context2.next = 15;
267
- break;
268
- }
269
-
270
- errorMsg = "Error: No se recibieron sugerencias de IA";
271
- console.log(errorMsg);
272
- setErrorMessage(errorMsg);
273
- setIsAiRegenerationLoading(false);
274
- return _context2.abrupt("return");
275
-
276
- case 15:
277
- console.log({
278
- aiSuggestionsRenew: aiSuggestions
279
- });
280
-
281
- if (!(aiSuggestions !== null && aiSuggestions !== void 0 && aiSuggestions.error)) {
282
- _context2.next = 21;
283
- break;
284
- }
285
-
286
- console.log('Error: ', aiSuggestions.error);
287
- setErrorMessage(aiSuggestions.error);
288
- setIsAiRegenerationLoading(false);
289
- return _context2.abrupt("return");
290
-
291
- case 21:
292
- setSuggestions(function (prev) {
293
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, inputId, [].concat((0, _toConsumableArray2.default)(currentSuggestions), (0, _toConsumableArray2.default)(aiSuggestions))));
294
- });
295
- setIsAiRegenerationLoading(false);
296
-
297
- case 23:
298
- case "end":
299
- return _context2.stop();
300
- }
301
- }
302
- }, _callee2);
303
- }));
304
- return _handlerRegenerateSuggestions.apply(this, arguments);
305
- }
306
-
307
- var handleChangeSuggestion = function handleChangeSuggestion(_ref4) {
308
- var _currentSuggestion$in, _inputSuggestions$pre, _inputSuggestions$nex;
309
-
310
- var _ref4$action = _ref4.action,
311
- action = _ref4$action === void 0 ? "next" : _ref4$action;
312
- var inputSuggestions = suggestions === null || suggestions === void 0 ? void 0 : suggestions[inputId];
313
- if (!inputSuggestions || !Array.isArray(inputSuggestions)) return console.log("Error: No existe la sugerencia");
314
- var currentIndex = currentSuggestion === null || currentSuggestion === void 0 ? void 0 : (_currentSuggestion$in = currentSuggestion[inputId]) === null || _currentSuggestion$in === void 0 ? void 0 : _currentSuggestion$in.index;
315
- if (!currentIndex && currentIndex != 0) return console.log("Error: No existe un indice en la sugerencia actual");
316
-
317
- switch (action) {
318
- case "prev":
319
- if (currentIndex === 0) return;
320
- var prevIndex = currentIndex - 1;
321
- setCurrentSuggestionValue({
322
- inputId: inputId,
323
- index: prevIndex,
324
- value: (_inputSuggestions$pre = inputSuggestions[prevIndex]) === null || _inputSuggestions$pre === void 0 ? void 0 : _inputSuggestions$pre.value
325
- });
326
- break;
327
-
328
- case "next":
329
- if (currentIndex === inputSuggestions.length - 1) return;
330
- var nextIndex = currentIndex + 1;
331
- setCurrentSuggestionValue({
332
- inputId: inputId,
333
- index: nextIndex,
334
- value: (_inputSuggestions$nex = inputSuggestions[nextIndex]) === null || _inputSuggestions$nex === void 0 ? void 0 : _inputSuggestions$nex.value
335
- });
336
- break;
337
-
338
- default:
339
- break;
340
- }
341
- };
342
-
343
71
  (0, _react.useEffect)(function () {
344
72
  var temp = {};
345
73
  var maxBoxId = 0;
346
74
  inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.inputs.forEach(function (attrId) {
347
75
  if (!dataInputs[attrId].box) return;
348
- Object.entries(dataInputs[attrId].box).forEach(function (_ref5) {
349
- var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
350
- boxId = _ref6[0],
351
- value = _ref6[1];
76
+ Object.entries(dataInputs[attrId].box).forEach(function (_ref2) {
77
+ var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
78
+ boxId = _ref3[0],
79
+ value = _ref3[1];
352
80
 
353
81
  if (boxId > maxBoxId) maxBoxId = boxId;
354
82
  if (!temp[boxId]) temp[boxId] = {};
@@ -370,80 +98,28 @@ var TagAndInput = function TagAndInput(_ref) {
370
98
  (0, _react.useEffect)(function () {
371
99
  onChange && onChange(boxOnboardingList);
372
100
  }, [boxOnboardingList]);
373
- (0, _react.useEffect)(function () {
374
- var currentDescriptionUpdate = Array.isArray(updatedDescriptions) ? updatedDescriptions.find(function (desc) {
375
- return (desc === null || desc === void 0 ? void 0 : desc.attributeId) === inputId;
376
- }) : null;
377
- var currentDatasheetUpdate = Array.isArray(updatedDatasheets) ? updatedDatasheets.find(function (data) {
378
- return (data === null || data === void 0 ? void 0 : data.attributeId) === inputId;
379
- }) : null;
380
- var calculatedIsAiGenerated = aiGenerated;
381
-
382
- if (currentDescriptionUpdate) {
383
- calculatedIsAiGenerated = currentDescriptionUpdate.aiSuggestionAccepted;
384
- } else if (currentDatasheetUpdate) {
385
- calculatedIsAiGenerated = currentDatasheetUpdate.aiSuggestionAccepted;
386
- }
387
-
388
- setInputsGeneratedWithAi(function (prev) {
389
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, "".concat(inputId, "-").concat(inputType, "-").concat(version), {
390
- inputType: inputType,
391
- inputId: inputId,
392
- version: version,
393
- isAiGenerated: !!calculatedIsAiGenerated,
394
- label: label
395
- }));
396
- });
397
- }, [updatedDescriptions, updatedDatasheets, aiGenerated, inputId]);
398
- (0, _react.useEffect)(function () {
399
- var _inputsGeneratedWithA;
400
-
401
- setIsAiGenerated(!!((_inputsGeneratedWithA = inputsGeneratedWithAi["".concat(inputId, "-").concat(inputType, "-").concat(version)]) !== null && _inputsGeneratedWithA !== void 0 && _inputsGeneratedWithA.isAiGenerated));
402
- }, [inputsGeneratedWithAi]);
403
- (0, _react.useEffect)(function () {
404
- setInputsUsingAi(function (prev) {
405
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, "".concat(inputId, "-").concat(inputType, "-").concat(version), {
406
- using: isAiActive
407
- }));
408
- });
409
- }, [isAiActive]);
410
101
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
411
102
  inputType: inputType,
412
103
  className: "input-container",
413
104
  children: [(label === null || label === void 0 ? void 0 : label.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
414
105
  className: "title-container",
415
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
416
- className: "titles",
417
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
418
- text: label,
419
- headerType: "input-name-header",
420
- color: color
421
- }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
422
- componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
423
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
424
- children: description
425
- })
426
- }),
427
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
428
- src: _infoIcon.default,
429
- alt: "info icon",
430
- className: 'icon_information'
431
- }),
432
- classNameTooltip: "container-tooltip"
433
- })]
434
- }), isCreators && isAiGenerated ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
435
- className: "ai-generated",
436
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
437
- src: _iaIcon.default
438
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
439
- children: "Atributo generado con IA"
440
- })]
441
- }) : null]
442
- }), errorMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
443
- className: "error-message-container",
444
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
445
- children: errorMessage
446
- })
106
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
107
+ text: label,
108
+ headerType: "input-name-header",
109
+ color: color
110
+ }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
111
+ componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
112
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
113
+ children: description
114
+ })
115
+ }),
116
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
117
+ src: _infoIcon.default,
118
+ alt: "info icon",
119
+ className: 'icon_information'
120
+ }),
121
+ classNameTooltip: "container-tooltip"
122
+ })]
447
123
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GeneralInput, {
448
124
  inputId: inputId,
449
125
  inputType: inputType,
@@ -467,20 +143,7 @@ var TagAndInput = function TagAndInput(_ref) {
467
143
  description: description,
468
144
  inputOnChange: inputOnChange,
469
145
  onKeyDown: onKeyDown,
470
- auditClass: auditClass // AI Generation
471
- ,
472
- hasAiGeneration: isCreators,
473
- isBenefitInput: isBenefitInput,
474
- isAiGenerationLoading: isAiGenerationLoading,
475
- isAiRegenerationLoading: isAiRegenerationLoading,
476
- isAiActive: isAiActive,
477
- setIsAiActive: setIsAiActive,
478
- isAiAvailable: isAiAvailable,
479
- aiGenerated: aiGenerated // aiSuggestions={aiSuggestions}
480
- ,
481
- handlerAiGeneration: handlerAiGeneration,
482
- handlerRegenerateSuggestions: handlerRegenerateSuggestions,
483
- handleChangeSuggestion: handleChangeSuggestion,
146
+ auditClass: auditClass,
484
147
  onChange: function onChange(e) {
485
148
  setBoxOnboardingList(function (prev) {
486
149
  return prev.map(function (box, i) {
@@ -488,7 +151,7 @@ var TagAndInput = function TagAndInput(_ref) {
488
151
  return box;
489
152
  }
490
153
 
491
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, box), {}, {
154
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, box), {}, {
492
155
  value: e
493
156
  });
494
157
  });
@@ -15,10 +15,10 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n font-family: ", ";\n\n .titles{\n display: flex;\n gap: .5rem;\n align-items: center;\n }\n\n .icon_information{\n width: 1.35rem;\n height: 1.35rem;\n filter: brightness(.35);\n margin-top: 10px;\n }\n\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n .ai-generated{\n\n display: flex;\n align-items: items-center;\n gap: .5rem;\n font-size: 11px;\n background-color: rgba(224, 57, 167, 0.025);\n border: 1px solid rgba(224, 57, 167, 0.1);\n padding: .25rem .5rem;\n border-radius: 5px;\n margin-left: 0.5rem;\n margin-top: 7px;\n cursor: default;\n\n > img {\n width: 0.75rem;\n height: 0.75rem;\n }\n\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n\n\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n\n .error-message-container {\n\n font-family: \"Raleway\";\n font-size: 12px;\n font-weight: 500;\n color: #E1251B;\n margin-bottom: 8px;\n margin-top: 0;\n\n }\n"])), _variables.FontFamily.Raleway, _variables.GlobalColors.white, function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n\n display: flex;\n align-items: center;\n gap: .5rem;\n\n .icon_information{\n width: 1.35rem;\n height: 1.35rem;\n filter: brightness(.35);\n }\n\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
19
19
  var color = _ref.color;
20
20
  return color ? color : _variables.GlobalColors.s5;
21
- }, function (_ref2) {
21
+ }, _variables.FontFamily.Raleway, function (_ref2) {
22
22
  var inputType = _ref2.inputType;
23
23
  return inputType !== "textarea" ? 4 : 15;
24
24
  }, function (_ref3) {
@@ -51,16 +51,32 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
51
51
  setRetailerIndex = _useState4[1];
52
52
 
53
53
  (0, _react.useEffect)(function () {
54
- var ifFromTasks = headerData.statusByRetailer ? true : false;
54
+ // necesitamos definir los retailers que se deberan de mostrar en el selecto de retailers
55
+ // Si se viene desde la vista de productos se deben usar los de categoryRetailer
56
+ // Si se vene desde la vista de tareas entonces se debe trabajar con los retailers que esten en statusByRetailer
57
+ var ifFromTasks = headerData.statusByRetailer;
55
58
  var categoryRetailer = headerData.categoryRetailer || headerData.article.categoryRetailer;
59
+ var categoryRetailerNormalized = categoryRetailer ? categoryRetailer.map(function (rel) {
60
+ return {
61
+ id_retailer: rel.id_retailer || rel.retailer_id,
62
+ retailer: rel.retailer_name || rel.retailerName || rel.retailer,
63
+ name: rel.retailer_name || rel.retailerName || rel.retailer,
64
+ id_category: rel.id_category,
65
+ category: rel.category_name || rel.categoryName || rel.category,
66
+ image: "https://content-management-images.s3.amazonaws.com/retailers/".concat(rel.id_retailer || rel.retailer_id, ".png")
67
+ };
68
+ }) : null;
69
+ var retailersIdsFromStatusByRetailer = Object.keys(headerData.statusByRetailer || {}).map(function (id) {
70
+ return parseInt(id, 10);
71
+ });
56
72
 
57
73
  if (ifFromTasks) {
58
- setRetailers(headerData.categoryRetailerInOrder);
59
- } else {
60
- console.log({
61
- categoryRetailer: categoryRetailer
74
+ var categoryRetailerInOrder = categoryRetailerNormalized.filter(function (rel) {
75
+ return retailersIdsFromStatusByRetailer.includes(rel.id_retailer);
62
76
  });
63
- setRetailers(categoryRetailer);
77
+ setRetailers(categoryRetailerInOrder);
78
+ } else {
79
+ setRetailers(categoryRetailerNormalized);
64
80
  }
65
81
  }, [servicesData]);
66
82
 
@@ -183,7 +183,7 @@ var InputGroup = function InputGroup(_ref) {
183
183
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
184
184
  className: "inputs-container",
185
185
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
186
- var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _auditInputGroup$inpu, _auditInputGroup$inpu2;
186
+ var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _auditInputGroup$inpu, _auditInputGroup$inpu2;
187
187
 
188
188
  return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
189
189
  className: ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.id) === 6700 || ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id) === 6701 ? "inputs-validation-onboarding" : "inputs-validation",
@@ -206,12 +206,11 @@ var InputGroup = function InputGroup(_ref) {
206
206
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
207
207
  articleId: articleId,
208
208
  isRequired: (_dataInputs$input18 = dataInputs[input]) === null || _dataInputs$input18 === void 0 ? void 0 : _dataInputs$input18.required,
209
- aiGenerated: (_dataInputs$input19 = dataInputs[input]) === null || _dataInputs$input19 === void 0 ? void 0 : _dataInputs$input19.ai_generated,
210
209
  updatedDatasheets: updatedDatasheets,
211
210
  setUpdatedDatasheets: setUpdatedDatasheets,
212
- maxChar: (_dataInputs$input20 = dataInputs[input]) !== null && _dataInputs$input20 !== void 0 && _dataInputs$input20.max_chars ? (_dataInputs$input21 = dataInputs[input]) === null || _dataInputs$input21 === void 0 ? void 0 : _dataInputs$input21.max_chars : 999,
213
- optionList: (_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.option_list,
214
- description: (_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.description,
211
+ maxChar: (_dataInputs$input19 = dataInputs[input]) !== null && _dataInputs$input19 !== void 0 && _dataInputs$input19.max_chars ? (_dataInputs$input20 = dataInputs[input]) === null || _dataInputs$input20 === void 0 ? void 0 : _dataInputs$input20.max_chars : 999,
212
+ optionList: (_dataInputs$input21 = dataInputs[input]) === null || _dataInputs$input21 === void 0 ? void 0 : _dataInputs$input21.option_list,
213
+ description: (_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.description,
215
214
  showTooltip: true,
216
215
  auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
217
216
  }, index + "-" + ((_dataInputs$input10 = dataInputs[input]) === null || _dataInputs$input10 === void 0 ? void 0 : _dataInputs$input10.value) + "-" + ((_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.id) + "-" + compare)]
@@ -231,7 +230,6 @@ var InputGroup = function InputGroup(_ref) {
231
230
  label: (input === null || input === void 0 ? void 0 : input.name) + (input.required ? "*" : ""),
232
231
  value: compare ? auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu === void 0 ? void 0 : _auditInputGroup$inpu.value : input === null || input === void 0 ? void 0 : input.value,
233
232
  isRequired: input.required,
234
- aiGenerated: input === null || input === void 0 ? void 0 : input.ai_generated,
235
233
  disabled: input.id === 44186 || input.id === 44187 ? false : input === null || input === void 0 ? void 0 : input.isApproved,
236
234
  maxChar: input.max_chars,
237
235
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
@@ -255,35 +253,34 @@ var InputGroup = function InputGroup(_ref) {
255
253
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
256
254
  className: "inputs-container",
257
255
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs2 = inputGroup.inputs) === null || _inputGroup$inputs2 === void 0 ? void 0 : _inputGroup$inputs2.map(function (input, index) {
258
- var _dataInputs$input24, _dataInputs$input25, _dataInputs$input26, _dataInputs$input27, _dataInputs$input28, _dataInputs$input29, _dataInputs$input30, _dataInputs$input31, _dataInputs$input32, _auditInputs$input2, _dataInputs$input33, _dataInputs$input34, _dataInputs$input35, _dataInputs$input36, _dataInputs$input37, _dataInputs$input38, _dataInputs$input39, _dataInputs$input40, _dataInputs$input41, _dataInputs$input42, _dataInputs$input43, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
256
+ var _dataInputs$input23, _dataInputs$input24, _dataInputs$input25, _dataInputs$input26, _dataInputs$input27, _dataInputs$input28, _dataInputs$input29, _auditInputs$input2, _dataInputs$input30, _dataInputs$input31, _dataInputs$input32, _dataInputs$input33, _dataInputs$input34, _dataInputs$input35, _dataInputs$input36, _dataInputs$input37, _dataInputs$input38, _dataInputs$input39, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
259
257
 
260
258
  return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
261
259
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
262
260
  //disabled={input === 40001}
263
- disabled: (_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.isApproved,
264
- inputId: (_dataInputs$input27 = dataInputs[input]) === null || _dataInputs$input27 === void 0 ? void 0 : _dataInputs$input27.id,
261
+ disabled: (_dataInputs$input25 = dataInputs[input]) === null || _dataInputs$input25 === void 0 ? void 0 : _dataInputs$input25.isApproved,
262
+ inputId: (_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.id,
265
263
  version: version,
266
- inputType: inputTypeValue((_dataInputs$input28 = dataInputs[input]) === null || _dataInputs$input28 === void 0 ? void 0 : _dataInputs$input28.type),
267
- label: ((_dataInputs$input29 = dataInputs[input]) === null || _dataInputs$input29 === void 0 ? void 0 : _dataInputs$input29.name) + ((_dataInputs$input30 = dataInputs[input]) !== null && _dataInputs$input30 !== void 0 && _dataInputs$input30.required ? "*" : ""),
268
- value: (_dataInputs$input31 = dataInputs[input]) !== null && _dataInputs$input31 !== void 0 && _dataInputs$input31.box ? Object.values((_dataInputs$input32 = dataInputs[input]) === null || _dataInputs$input32 === void 0 ? void 0 : _dataInputs$input32.box)[0] : compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input33 = dataInputs[input]) === null || _dataInputs$input33 === void 0 ? void 0 : _dataInputs$input33.value,
264
+ inputType: inputTypeValue((_dataInputs$input27 = dataInputs[input]) === null || _dataInputs$input27 === void 0 ? void 0 : _dataInputs$input27.type),
265
+ label: ((_dataInputs$input28 = dataInputs[input]) === null || _dataInputs$input28 === void 0 ? void 0 : _dataInputs$input28.name) + ((_dataInputs$input29 = dataInputs[input]) !== null && _dataInputs$input29 !== void 0 && _dataInputs$input29.required ? "*" : ""),
266
+ value: compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input30 = dataInputs[input]) === null || _dataInputs$input30 === void 0 ? void 0 : _dataInputs$input30.value,
269
267
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
270
268
  articleId: articleId,
271
- isRequired: (_dataInputs$input34 = dataInputs[input]) === null || _dataInputs$input34 === void 0 ? void 0 : _dataInputs$input34.required,
272
- aiGenerated: (_dataInputs$input35 = dataInputs[input]) === null || _dataInputs$input35 === void 0 ? void 0 : _dataInputs$input35.ai_generated,
269
+ isRequired: (_dataInputs$input31 = dataInputs[input]) === null || _dataInputs$input31 === void 0 ? void 0 : _dataInputs$input31.required,
273
270
  updatedDatasheets: updatedDatasheets,
274
271
  setUpdatedDatasheets: setUpdatedDatasheets,
275
- maxChar: (_dataInputs$input36 = dataInputs[input]) !== null && _dataInputs$input36 !== void 0 && _dataInputs$input36.max_chars ? (_dataInputs$input37 = dataInputs[input]) === null || _dataInputs$input37 === void 0 ? void 0 : _dataInputs$input37.max_chars : 999,
276
- optionList: (_dataInputs$input38 = dataInputs[input]) === null || _dataInputs$input38 === void 0 ? void 0 : _dataInputs$input38.option_list,
277
- description: (_dataInputs$input39 = dataInputs[input]) === null || _dataInputs$input39 === void 0 ? void 0 : _dataInputs$input39.description,
272
+ maxChar: (_dataInputs$input32 = dataInputs[input]) !== null && _dataInputs$input32 !== void 0 && _dataInputs$input32.max_chars ? (_dataInputs$input33 = dataInputs[input]) === null || _dataInputs$input33 === void 0 ? void 0 : _dataInputs$input33.max_chars : 999,
273
+ optionList: (_dataInputs$input34 = dataInputs[input]) === null || _dataInputs$input34 === void 0 ? void 0 : _dataInputs$input34.option_list,
274
+ description: (_dataInputs$input35 = dataInputs[input]) === null || _dataInputs$input35 === void 0 ? void 0 : _dataInputs$input35.description,
278
275
  showTooltip: true,
279
276
  inputGroup: inputGroup,
280
277
  dataInputs: dataInputs,
281
278
  onChange: setUpdatedBoxData,
282
279
  auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
283
- }, index + "-" + ((_dataInputs$input24 = dataInputs[input]) === null || _dataInputs$input24 === void 0 ? void 0 : _dataInputs$input24.value) + "-" + ((_dataInputs$input25 = dataInputs[input]) === null || _dataInputs$input25 === void 0 ? void 0 : _dataInputs$input25.id) + "-" + compare), ((_dataInputs$input40 = dataInputs[input]) === null || _dataInputs$input40 === void 0 ? void 0 : _dataInputs$input40.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
284
- inputId: (_dataInputs$input41 = dataInputs[input]) === null || _dataInputs$input41 === void 0 ? void 0 : _dataInputs$input41.id,
285
- isApproved: (_dataInputs$input42 = dataInputs[input]) === null || _dataInputs$input42 === void 0 ? void 0 : _dataInputs$input42.isApproved,
286
- comment: (_dataInputs$input43 = dataInputs[input]) === null || _dataInputs$input43 === void 0 ? void 0 : _dataInputs$input43.comment,
280
+ }, index + "-" + ((_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.value) + "-" + ((_dataInputs$input24 = dataInputs[input]) === null || _dataInputs$input24 === void 0 ? void 0 : _dataInputs$input24.id) + "-" + compare), ((_dataInputs$input36 = dataInputs[input]) === null || _dataInputs$input36 === void 0 ? void 0 : _dataInputs$input36.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
281
+ inputId: (_dataInputs$input37 = dataInputs[input]) === null || _dataInputs$input37 === void 0 ? void 0 : _dataInputs$input37.id,
282
+ isApproved: (_dataInputs$input38 = dataInputs[input]) === null || _dataInputs$input38 === void 0 ? void 0 : _dataInputs$input38.isApproved,
283
+ comment: (_dataInputs$input39 = dataInputs[input]) === null || _dataInputs$input39 === void 0 ? void 0 : _dataInputs$input39.comment,
287
284
  handleImgClick: handleImgClick,
288
285
  changeImageBtn: changeImageBtn,
289
286
  showDivState: showDivStates,
@@ -306,7 +303,6 @@ var InputGroup = function InputGroup(_ref) {
306
303
  label: (input === null || input === void 0 ? void 0 : input.name) + (input.required ? "*" : ""),
307
304
  value: compare ? auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu3 = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu3 === void 0 ? void 0 : _auditInputGroup$inpu3.value : input === null || input === void 0 ? void 0 : input.value,
308
305
  isRequired: input.required,
309
- aiGenerated: input === null || input === void 0 ? void 0 : input.ai_generated,
310
306
  maxChar: input.max_chars,
311
307
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
312
308
  updatedDescriptions: updatedDescriptions,