contentoh-components-library 21.5.97 → 21.5.99

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 +54 -249
  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 +1 -13
  8. package/dist/components/molecules/TagAndInput/index.js +24 -364
  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/ProviderProductEdition.stories.js +337 -150
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +376 -412
  15. package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +211 -125
  17. package/dist/components/pages/RetailerProductEdition/index.js +2236 -1738
  18. package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
  19. package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
  20. package/package.json +2 -4
  21. package/src/components/atoms/GeneralButton/styles.js +0 -4
  22. package/src/components/atoms/GeneralInput/index.js +60 -241
  23. package/src/components/atoms/GeneralInput/styles.js +0 -81
  24. package/src/components/atoms/InputFormatter/index.js +51 -200
  25. package/src/components/atoms/InputFormatter/styles.js +0 -284
  26. package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
  27. package/src/components/molecules/TabsMenu/index.js +0 -12
  28. package/src/components/molecules/TagAndInput/index.js +21 -294
  29. package/src/components/molecules/TagAndInput/styles.js +17 -59
  30. package/src/components/organisms/FullProductNameHeader/index.js +28 -4
  31. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  32. package/src/components/organisms/InputGroup/index.js +4 -12
  33. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -174
  34. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  35. package/src/components/pages/ProviderProductEdition/index.js +420 -494
  36. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  37. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +243 -136
  38. package/src/components/pages/RetailerProductEdition/index.js +1717 -1563
  39. package/src/components/pages/RetailerProductEdition/styles.js +2 -67
  40. package/src/components/pages/RetailerProductEdition/utils.js +0 -240
  41. package/src/ai/utils/compare-strings.js +0 -45
  42. package/src/assets/images/Icons/arrow.png +0 -0
  43. package/src/assets/images/Icons/cancel.png +0 -0
  44. package/src/assets/images/Icons/ia-icon.png +0 -0
  45. package/src/assets/images/Icons/loading.svg +0 -5
  46. package/src/assets/images/Icons/reload.png +0 -0
  47. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
  48. package/src/components/atoms/RetailerSelector/index.js +0 -3
  49. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  50. package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
  51. package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
  52. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
  53. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
  54. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
  55. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
  56. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
  57. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
  58. package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
  59. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
  60. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
  61. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
  62. package/src/contexts/AiProductEdition.jsx +0 -347
  63. 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,83 +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
- if (!isCreators) return;
375
- var currentDescriptionUpdate = Array.isArray(updatedDescriptions) ? updatedDescriptions.find(function (desc) {
376
- return (desc === null || desc === void 0 ? void 0 : desc.attributeId) === inputId;
377
- }) : null;
378
- var currentDatasheetUpdate = Array.isArray(updatedDatasheets) ? updatedDatasheets.find(function (data) {
379
- return (data === null || data === void 0 ? void 0 : data.attributeId) === inputId;
380
- }) : null;
381
- var calculatedIsAiGenerated = aiGenerated;
382
-
383
- if (currentDescriptionUpdate) {
384
- calculatedIsAiGenerated = currentDescriptionUpdate.aiSuggestionAccepted;
385
- } else if (currentDatasheetUpdate) {
386
- calculatedIsAiGenerated = currentDatasheetUpdate.aiSuggestionAccepted;
387
- }
388
-
389
- setInputsGeneratedWithAi(function (prev) {
390
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, "".concat(inputId, "-").concat(inputType, "-").concat(version), {
391
- inputType: inputType,
392
- inputId: inputId,
393
- version: version,
394
- isAiGenerated: !!calculatedIsAiGenerated,
395
- label: label
396
- }));
397
- });
398
- }, [updatedDescriptions, updatedDatasheets, aiGenerated, inputId]);
399
- (0, _react.useEffect)(function () {
400
- var _inputsGeneratedWithA;
401
-
402
- if (!isCreators) return;
403
- setIsAiGenerated(!!((_inputsGeneratedWithA = inputsGeneratedWithAi["".concat(inputId, "-").concat(inputType, "-").concat(version)]) !== null && _inputsGeneratedWithA !== void 0 && _inputsGeneratedWithA.isAiGenerated));
404
- }, [inputsGeneratedWithAi]);
405
- (0, _react.useEffect)(function () {
406
- if (!isCreators) return;
407
- setInputsUsingAi(function (prev) {
408
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, "".concat(inputId, "-").concat(inputType, "-").concat(version), {
409
- using: isAiActive
410
- }));
411
- });
412
- }, [isAiActive]);
413
101
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
414
102
  inputType: inputType,
415
103
  className: "input-container",
416
104
  children: [(label === null || label === void 0 ? void 0 : label.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
417
105
  className: "title-container",
418
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
419
- className: "titles",
420
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
421
- text: label,
422
- headerType: "input-name-header",
423
- color: color
424
- }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
425
- componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
426
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
427
- children: description
428
- })
429
- }),
430
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
431
- src: _infoIcon.default,
432
- alt: "info icon",
433
- className: 'icon_information'
434
- }),
435
- classNameTooltip: "container-tooltip"
436
- })]
437
- }), isCreators && isAiGenerated ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
438
- className: "ai-generated",
439
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
440
- src: _iaIcon.default
441
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
442
- children: "Atributo generado con IA"
443
- })]
444
- }) : null]
445
- }), errorMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
446
- className: "error-message-container",
447
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
448
- children: errorMessage
449
- })
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
+ })]
450
123
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GeneralInput, {
451
124
  inputId: inputId,
452
125
  inputType: inputType,
@@ -470,20 +143,7 @@ var TagAndInput = function TagAndInput(_ref) {
470
143
  description: description,
471
144
  inputOnChange: inputOnChange,
472
145
  onKeyDown: onKeyDown,
473
- auditClass: auditClass // AI Generation
474
- ,
475
- hasAiGeneration: isCreators,
476
- isBenefitInput: isBenefitInput,
477
- isAiGenerationLoading: isAiGenerationLoading,
478
- isAiRegenerationLoading: isAiRegenerationLoading,
479
- isAiActive: isAiActive,
480
- setIsAiActive: setIsAiActive,
481
- isAiAvailable: isAiAvailable,
482
- aiGenerated: aiGenerated // aiSuggestions={aiSuggestions}
483
- ,
484
- handlerAiGeneration: handlerAiGeneration,
485
- handlerRegenerateSuggestions: handlerRegenerateSuggestions,
486
- handleChangeSuggestion: handleChangeSuggestion,
146
+ auditClass: auditClass,
487
147
  onChange: function onChange(e) {
488
148
  setBoxOnboardingList(function (prev) {
489
149
  return prev.map(function (box, i) {
@@ -491,7 +151,7 @@ var TagAndInput = function TagAndInput(_ref) {
491
151
  return box;
492
152
  }
493
153
 
494
- return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, box), {}, {
154
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, box), {}, {
495
155
  value: e
496
156
  });
497
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,