contentoh-components-library 21.2.105 → 21.3.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 (248) hide show
  1. package/.env.development +5 -2
  2. package/.env.production +25 -25
  3. package/dist/assets/fonts/{roboto → Roboto}/LICENSE.txt +0 -0
  4. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Black.ttf +0 -0
  5. package/dist/assets/fonts/{roboto → Roboto}/Roboto-BlackItalic.ttf +0 -0
  6. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Bold.ttf +0 -0
  7. package/dist/assets/fonts/{roboto → Roboto}/Roboto-BoldItalic.ttf +0 -0
  8. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Italic.ttf +0 -0
  9. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Light.ttf +0 -0
  10. package/dist/assets/fonts/{roboto → Roboto}/Roboto-LightItalic.ttf +0 -0
  11. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Medium.ttf +0 -0
  12. package/dist/assets/fonts/{roboto → Roboto}/Roboto-MediumItalic.ttf +0 -0
  13. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Regular.ttf +0 -0
  14. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Thin.ttf +0 -0
  15. package/dist/assets/fonts/{roboto → Roboto}/Roboto-ThinItalic.ttf +0 -0
  16. package/dist/assets/images/chatPopup/Spinner.gif +0 -0
  17. package/dist/assets/images/chatPopup/close.svg +3 -0
  18. package/dist/assets/images/chatPopup/defaultImage.png +0 -0
  19. package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
  20. package/dist/assets/images/chatPopup/doc.svg +1 -0
  21. package/dist/assets/images/chatPopup/document.svg +1 -0
  22. package/dist/assets/images/chatPopup/iconChat.svg +19 -0
  23. package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
  24. package/dist/assets/images/chatPopup/pdf.svg +75 -0
  25. package/dist/assets/images/chatPopup/remove.svg +4 -0
  26. package/dist/assets/images/chatPopup/send.svg +3 -0
  27. package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
  28. package/dist/assets/images/chatPopup/upload_file.svg +3 -0
  29. package/dist/assets/images/chatPopup/xls.svg +53 -0
  30. package/dist/assets/images/customSelect/starIcon.svg +14 -0
  31. package/dist/assets/images/defaultImages/Spinner.gif +0 -0
  32. package/dist/assets/images/defaultImages/notFound.svg +124 -0
  33. package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +72 -0
  34. package/dist/components/atoms/ButtonFileChooser/index.js +118 -0
  35. package/dist/components/atoms/ButtonFileChooser/styles.js +20 -0
  36. package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +66 -0
  37. package/dist/components/atoms/ButtonV2/index.js +110 -0
  38. package/dist/components/atoms/ButtonV2/styles.js +53 -0
  39. package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
  40. package/dist/components/atoms/ChatPopUp/index.js +841 -0
  41. package/dist/components/atoms/ChatPopUp/styles.js +27 -0
  42. package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
  43. package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +50 -0
  44. package/dist/components/atoms/CustomIcon/index.js +40 -0
  45. package/dist/components/atoms/CustomIcon/styles.js +33 -0
  46. package/dist/components/atoms/GeneralButton/index.js +2 -6
  47. package/dist/components/atoms/IconFile/IconFile.stories.js +48 -0
  48. package/dist/components/atoms/IconFile/index.js +249 -0
  49. package/dist/components/atoms/IconFile/styles.js +23 -0
  50. package/dist/components/atoms/Image/Image.stories.js +73 -0
  51. package/dist/components/atoms/Image/index.js +76 -0
  52. package/dist/components/atoms/Image/styles.js +43 -0
  53. package/dist/components/atoms/ImageLink/ImageLink.stories.js +63 -0
  54. package/dist/components/atoms/ImageLink/index.js +77 -0
  55. package/dist/components/atoms/ImageLink/styles.js +40 -0
  56. package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +70 -0
  57. package/dist/components/atoms/ImagePreview/index.js +222 -0
  58. package/dist/components/atoms/ImagePreview/styles.js +44 -0
  59. package/dist/components/atoms/InputText/InputText.stories.js +60 -0
  60. package/dist/components/atoms/InputText/index.js +66 -0
  61. package/dist/components/atoms/InputText/styles.js +32 -0
  62. package/dist/components/atoms/NotFound/NotFound.stories.js +36 -0
  63. package/dist/components/atoms/NotFound/index.js +75 -0
  64. package/dist/components/atoms/NotFound/styles.js +20 -0
  65. package/dist/components/atoms/Select/VersionSelect.js +1 -2
  66. package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +45 -0
  67. package/dist/components/atoms/SelectItemV2/index.js +57 -0
  68. package/dist/components/atoms/SelectItemV2/styles.js +30 -0
  69. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  70. package/dist/components/atoms/StatusTag/index.js +58 -0
  71. package/dist/components/atoms/StatusTag/styles.js +20 -0
  72. package/dist/components/atoms/Tooltip/Tooltip.stories.js +66 -0
  73. package/dist/components/atoms/Tooltip/index.js +72 -0
  74. package/dist/components/atoms/Tooltip/styles.js +20 -0
  75. package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +66 -0
  76. package/dist/components/molecules/ButtonDownloadFile/index.js +179 -0
  77. package/dist/components/molecules/ButtonDownloadFile/styles.js +23 -0
  78. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  79. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  80. package/dist/components/molecules/Dropdown/Dropdown.stories.js +98 -0
  81. package/dist/components/molecules/Dropdown/index.js +150 -0
  82. package/dist/components/molecules/Dropdown/styles.js +26 -0
  83. package/dist/components/molecules/HeaderTop/index.js +10 -5
  84. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  85. package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +82 -0
  86. package/dist/components/molecules/ImageTooltip/index.js +85 -0
  87. package/dist/components/molecules/ImageTooltip/styles.js +33 -0
  88. package/dist/components/molecules/SelectV2/SelectV2.stories.js +119 -0
  89. package/dist/components/molecules/SelectV2/index.js +298 -0
  90. package/dist/components/molecules/SelectV2/styles.js +42 -0
  91. package/dist/components/organisms/Chat/Chat.stories.js +215 -0
  92. package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +83 -0
  93. package/dist/components/organisms/Chat/ChatLists/index.js +160 -0
  94. package/dist/components/organisms/Chat/ChatLists/styles.js +29 -0
  95. package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +176 -0
  96. package/dist/components/organisms/Chat/ContainerItems/index.js +569 -0
  97. package/dist/components/organisms/Chat/ContainerItems/styles.js +20 -0
  98. package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +142 -0
  99. package/dist/components/organisms/Chat/ContentChat/index.js +1422 -0
  100. package/dist/components/organisms/Chat/ContentChat/styles.js +20 -0
  101. package/dist/components/organisms/Chat/Footer/Footer.stories.js +43 -0
  102. package/dist/components/organisms/Chat/Footer/index.js +984 -0
  103. package/dist/components/organisms/Chat/Footer/styles.js +32 -0
  104. package/dist/components/organisms/Chat/Header/Header.stories.js +96 -0
  105. package/dist/components/organisms/Chat/Header/index.js +84 -0
  106. package/dist/components/organisms/Chat/Header/styles.js +20 -0
  107. package/dist/components/organisms/Chat/index.js +327 -0
  108. package/dist/components/organisms/Chat/styles.js +29 -0
  109. package/dist/components/organisms/CreateVersion/RenderChilds.js +11 -11
  110. package/dist/components/organisms/CreateVersion/index.js +89 -30
  111. package/dist/components/organisms/Modal/Modal.stories.js +66 -0
  112. package/dist/components/organisms/Modal/index.js +95 -0
  113. package/dist/components/organisms/Modal/styles.js +20 -0
  114. package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
  115. package/dist/components/organisms/OrderDetail/index.js +11 -20
  116. package/dist/components/organisms/OrderDetail/styles.js +1 -1
  117. package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
  118. package/dist/components/organisms/OrderDetail/utils/Table/utils.js +15 -45
  119. package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +28 -0
  120. package/dist/components/organisms/RangeCalendar/index.js +140 -0
  121. package/dist/components/organisms/RangeCalendar/styles.js +27 -0
  122. package/dist/components/organisms/VersionSelector/index.js +2 -28
  123. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +147 -69
  124. package/dist/components/pages/ProviderProductEdition/index.js +22 -2
  125. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  126. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  127. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  128. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +67 -77
  129. package/dist/components/pages/RetailerProductEdition/index.js +24 -5
  130. package/dist/global-files/fonts.css +15 -3
  131. package/dist/global-files/handle_http.js +383 -0
  132. package/dist/global-files/utils.js +472 -0
  133. package/dist/global-files/variables.js +2 -0
  134. package/dist/index.js +267 -46
  135. package/package.json +12 -1
  136. package/src/assets/fonts/{roboto → Roboto}/LICENSE.txt +0 -0
  137. package/src/assets/fonts/{roboto → Roboto}/Roboto-Black.ttf +0 -0
  138. package/src/assets/fonts/{roboto → Roboto}/Roboto-BlackItalic.ttf +0 -0
  139. package/src/assets/fonts/{roboto → Roboto}/Roboto-Bold.ttf +0 -0
  140. package/src/assets/fonts/{roboto → Roboto}/Roboto-BoldItalic.ttf +0 -0
  141. package/src/assets/fonts/{roboto → Roboto}/Roboto-Italic.ttf +0 -0
  142. package/src/assets/fonts/{roboto → Roboto}/Roboto-Light.ttf +0 -0
  143. package/src/assets/fonts/{roboto → Roboto}/Roboto-LightItalic.ttf +0 -0
  144. package/src/assets/fonts/{roboto → Roboto}/Roboto-Medium.ttf +0 -0
  145. package/src/assets/fonts/{roboto → Roboto}/Roboto-MediumItalic.ttf +0 -0
  146. package/src/assets/fonts/{roboto → Roboto}/Roboto-Regular.ttf +0 -0
  147. package/src/assets/fonts/{roboto → Roboto}/Roboto-Thin.ttf +0 -0
  148. package/src/assets/fonts/{roboto → Roboto}/Roboto-ThinItalic.ttf +0 -0
  149. package/src/assets/images/customSelect/starIcon.svg +14 -0
  150. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  151. package/src/assets/images/defaultImages/notFound.svg +124 -0
  152. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  153. package/src/components/atoms/ButtonFileChooser/index.js +69 -0
  154. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  155. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  156. package/src/components/atoms/ButtonV2/index.js +85 -0
  157. package/src/components/atoms/ButtonV2/styles.js +217 -0
  158. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  159. package/src/components/atoms/CustomIcon/index.js +41 -0
  160. package/src/components/atoms/CustomIcon/styles.js +85 -0
  161. package/src/components/atoms/GeneralButton/index.js +1 -4
  162. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  163. package/src/components/atoms/IconFile/index.js +119 -0
  164. package/src/components/atoms/IconFile/styles.js +67 -0
  165. package/src/components/atoms/Image/Image.stories.js +51 -0
  166. package/src/components/atoms/Image/index.js +55 -0
  167. package/src/components/atoms/Image/styles.js +34 -0
  168. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  169. package/src/components/atoms/ImageLink/index.js +57 -0
  170. package/src/components/atoms/ImageLink/styles.js +30 -0
  171. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  172. package/src/components/atoms/ImagePreview/index.js +191 -0
  173. package/src/components/atoms/ImagePreview/styles.js +77 -0
  174. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  175. package/src/components/atoms/InputText/index.js +61 -0
  176. package/src/components/atoms/InputText/styles.js +89 -0
  177. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  178. package/src/components/atoms/NotFound/index.js +52 -0
  179. package/src/components/atoms/NotFound/styles.js +55 -0
  180. package/src/components/atoms/Select/VersionSelect.js +2 -4
  181. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  182. package/src/components/atoms/SelectItemV2/index.js +61 -0
  183. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  184. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  185. package/src/components/atoms/Tooltip/index.js +59 -0
  186. package/src/components/atoms/Tooltip/styles.js +42 -0
  187. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  188. package/src/components/molecules/ButtonDownloadFile/index.js +111 -0
  189. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  190. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  191. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  192. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  193. package/src/components/molecules/Dropdown/index.js +150 -0
  194. package/src/components/molecules/Dropdown/styles.js +75 -0
  195. package/src/components/molecules/HeaderTop/index.js +11 -6
  196. package/src/components/molecules/HeaderTop/styles.js +4 -0
  197. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  198. package/src/components/molecules/ImageTooltip/index.js +63 -0
  199. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  200. package/src/components/molecules/SelectV2/SelectV2.stories.js +114 -0
  201. package/src/components/molecules/SelectV2/index.js +335 -0
  202. package/src/components/molecules/SelectV2/styles.js +105 -0
  203. package/src/components/organisms/Chat/Chat.stories.js +199 -0
  204. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  205. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  206. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  207. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  208. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  209. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  210. package/src/components/organisms/Chat/ContainerItems/index.js +549 -0
  211. package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
  212. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  213. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  214. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  215. package/src/components/organisms/Chat/ContentChat/index.js +900 -0
  216. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  217. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  218. package/src/components/organisms/Chat/Footer/index.js +669 -0
  219. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  220. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  221. package/src/components/organisms/Chat/Header/index.js +94 -0
  222. package/src/components/organisms/Chat/Header/styles.js +49 -0
  223. package/src/components/organisms/Chat/index.js +294 -0
  224. package/src/components/organisms/Chat/styles.js +42 -0
  225. package/src/components/organisms/CreateVersion/RenderChilds.js +34 -28
  226. package/src/components/organisms/CreateVersion/index.js +36 -16
  227. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  228. package/src/components/organisms/Modal/index.js +97 -0
  229. package/src/components/organisms/Modal/styles.js +103 -0
  230. package/src/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
  231. package/src/components/organisms/OrderDetail/index.js +12 -19
  232. package/src/components/organisms/OrderDetail/styles.js +0 -1
  233. package/src/components/organisms/OrderDetail/utils/Table/styles.js +0 -26
  234. package/src/components/organisms/OrderDetail/utils/Table/utils.js +15 -30
  235. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +11 -0
  236. package/src/components/organisms/RangeCalendar/index.js +117 -0
  237. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  238. package/src/components/organisms/VersionSelector/index.js +3 -18
  239. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +166 -75
  240. package/src/components/pages/ProviderProductEdition/index.js +21 -2
  241. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +67 -79
  242. package/src/components/pages/RetailerProductEdition/index.js +14 -2
  243. package/src/global-files/customHooks.js +2 -2
  244. package/src/global-files/fonts.css +15 -3
  245. package/src/global-files/handle_http.js +231 -0
  246. package/src/global-files/utils.js +300 -0
  247. package/src/global-files/variables.js +2 -0
  248. package/src/index.js +17 -0
@@ -0,0 +1,984 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Footer = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
14
+ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createForOfIteratorHelper"));
15
+
16
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
17
+
18
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
19
+
20
+ var _styles = require("./styles");
21
+
22
+ var _react = require("react");
23
+
24
+ var _awsSdk = _interopRequireDefault(require("aws-sdk"));
25
+
26
+ var _uuid = require("uuid");
27
+
28
+ var _Image = require("../../../atoms/Image");
29
+
30
+ var _ImageTooltip = require("../../../molecules/ImageTooltip");
31
+
32
+ var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
33
+
34
+ var _CustomIcon = require("../../../atoms/CustomIcon");
35
+
36
+ var _ButtonV = require("../../../atoms/ButtonV2");
37
+
38
+ var _IconFile = require("../../../atoms/IconFile");
39
+
40
+ var _Modal = require("../../Modal");
41
+
42
+ var _Tooltip = require("../../../atoms/Tooltip");
43
+
44
+ var _material = require("@mui/material");
45
+
46
+ var _ButtonFileChooser = require("../../../atoms/ButtonFileChooser");
47
+
48
+ var _react2 = require("swiper/react");
49
+
50
+ require("swiper/swiper.min.css");
51
+
52
+ var _swiper = require("swiper");
53
+
54
+ var _utils = require("../../../../global-files/utils");
55
+
56
+ var _InputText = require("../../../atoms/InputText");
57
+
58
+ var _jsxRuntime = require("react/jsx-runtime");
59
+
60
+ // carrousel
61
+ //import "swiper/modules/free-mode/free-mode.min.css";
62
+ var S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
63
+ var REGION = "us-east-1";
64
+
65
+ _awsSdk.default.config.update({
66
+ accessKeyId: process.env.REACT_APP_KEY_UPLOAD_TO_S3,
67
+ secretAccessKey: process.env.REACT_APP_ACCESS_KEY_UPLOAD_TO_S3
68
+ });
69
+
70
+ var myBucket = new _awsSdk.default.S3({
71
+ params: {
72
+ Bucket: S3_BUCKET
73
+ },
74
+ region: REGION
75
+ });
76
+
77
+ var Footer = function Footer(props) {
78
+ var chatType = props.chatType,
79
+ dataChat = props.dataChat,
80
+ statusChat = props.statusChat,
81
+ messageDisabled = props.messageDisabled,
82
+ createItemsChat = props.createItemsChat,
83
+ errorUpdate = props.errorUpdate;
84
+
85
+ var _useState = (0, _react.useState)(""),
86
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
87
+ valueInputMessage = _useState2[0],
88
+ setValueInputMessage = _useState2[1];
89
+
90
+ var _useState3 = (0, _react.useState)([]),
91
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
92
+ filesPreview = _useState4[0],
93
+ setFilesPreview = _useState4[1];
94
+
95
+ var _useState5 = (0, _react.useState)([]),
96
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
97
+ filesJsxPreview = _useState6[0],
98
+ setFilesJsxPreview = _useState6[1];
99
+
100
+ var _useState7 = (0, _react.useState)(false),
101
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
102
+ btnSendFilesLoading = _useState8[0],
103
+ setBtnSendFilesLoading = _useState8[1];
104
+
105
+ var _useState9 = (0, _react.useState)(false),
106
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
107
+ btnSendMessageLoading = _useState10[0],
108
+ setBtnSendMessageLoading = _useState10[1];
109
+
110
+ var _useState11 = (0, _react.useState)(false),
111
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
112
+ btnChooserFileDisabled = _useState12[0],
113
+ setBtnChooserFileDisabled = _useState12[1];
114
+
115
+ var _useState13 = (0, _react.useState)(false),
116
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
117
+ inputMessageDisabled = _useState14[0],
118
+ setInputMessageDisabled = _useState14[1];
119
+
120
+ var _useState15 = (0, _react.useState)(false),
121
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
122
+ openPreview = _useState16[0],
123
+ setOpenPreview = _useState16[1];
124
+
125
+ var _useState17 = (0, _react.useState)(false),
126
+ _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
127
+ toggleFocusInputMessage = _useState18[0],
128
+ setToggleFocusInputMessage = _useState18[1];
129
+
130
+ var _useState19 = (0, _react.useState)({
131
+ show: false,
132
+ fileName: ""
133
+ }),
134
+ _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
135
+ tooltipFileName = _useState20[0],
136
+ setTooltipFileName = _useState20[1];
137
+
138
+ var _useState21 = (0, _react.useState)({
139
+ show: false,
140
+ title: "",
141
+ message: "",
142
+ errorInputMessage: false
143
+ }),
144
+ _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
145
+ modalAlert = _useState22[0],
146
+ setModalAlert = _useState22[1];
147
+
148
+ var containerRef = (0, _react.useRef)();
149
+ var refInputTextMessage = (0, _react.useRef)();
150
+ (0, _react.useEffect)(function () {
151
+ //console.log("filesPreview: ", filesPreview.slice());
152
+ setTooltipFileName({
153
+ show: false,
154
+ fileName: ""
155
+ });
156
+ renderFilesPreview();
157
+ }, [filesPreview]);
158
+ (0, _react.useEffect)(function () {
159
+ if (filesJsxPreview.length) setOpenPreview(true);else setOpenPreview(false);
160
+ }, [filesJsxPreview]);
161
+ (0, _react.useEffect)(function () {
162
+ refInputTextMessage.current && refInputTextMessage.current.focus();
163
+ }, [toggleFocusInputMessage]);
164
+
165
+ var sendFilesPreview = /*#__PURE__*/function () {
166
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
167
+ var files, customFiles, fileUploadRequests, _iterator, _step, file, errorMessage, fullBase64, dataBuffer, fileKey, today, paramsCreate, responseAWS, items, index, _file, valueItem, imgSize, responseError, failedFiles, errorDetailFiles;
168
+
169
+ return _regenerator.default.wrap(function _callee$(_context) {
170
+ while (1) {
171
+ switch (_context.prev = _context.next) {
172
+ case 0:
173
+ if (!createItemsChat) {
174
+ _context.next = 89;
175
+ break;
176
+ }
177
+
178
+ files = filesPreview.slice();
179
+
180
+ if (files.length) {
181
+ _context.next = 5;
182
+ break;
183
+ }
184
+
185
+ setModalAlert({
186
+ show: true,
187
+ title: "No hay ningun archivo o imagen seleccionado para enviar",
188
+ message: "Por favor, cargue los archivos o imagenes que quiera enviar al chat",
189
+ errorInputMessage: false
190
+ });
191
+ return _context.abrupt("return");
192
+
193
+ case 5:
194
+ disableSecondaryContainer(true); // subir archivos a AWS
195
+
196
+ customFiles = [];
197
+ _context.prev = 7;
198
+ //console.log("files:", files);
199
+ fileUploadRequests = []; //console.log(dataChat);
200
+
201
+ _iterator = (0, _createForOfIteratorHelper2.default)(files);
202
+ _context.prev = 10;
203
+
204
+ _iterator.s();
205
+
206
+ case 12:
207
+ if ((_step = _iterator.n()).done) {
208
+ _context.next = 39;
209
+ break;
210
+ }
211
+
212
+ file = _step.value;
213
+ errorMessage = void 0; // obtener base64
214
+
215
+ _context.next = 17;
216
+ return (0, _utils.getBase64)(file);
217
+
218
+ case 17:
219
+ fullBase64 = _context.sent;
220
+
221
+ if (!fullBase64) {
222
+ errorMessage = "No se pudo decodificar el archivo o imagen";
223
+ } // obtener buffer
224
+
225
+
226
+ dataBuffer = void 0;
227
+ if (!errorMessage) dataBuffer = (0, _utils.getDataBuffer)((0, _utils.getDataBase64)(fullBase64));
228
+
229
+ if (!dataBuffer) {
230
+ errorMessage = "No se pudo decodificar el archivo o imagen";
231
+ } // obtener la key
232
+
233
+
234
+ fileKey = "chat/";
235
+ _context.t0 = chatType;
236
+ _context.next = _context.t0 === "merchant_product" ? 26 : _context.t0 === "order_product" ? 28 : _context.t0 === "ticket" ? 30 : 32;
237
+ break;
238
+
239
+ case 26:
240
+ if ((0, _utils.isValidNaturalNumber)(dataChat === null || dataChat === void 0 ? void 0 : dataChat.id) && (0, _utils.isValidNaturalNumber)(dataChat === null || dataChat === void 0 ? void 0 : dataChat.version)) {
241
+ fileKey += "merchantArticle/".concat(dataChat.id, "-").concat(dataChat.version, "/");
242
+ } else {
243
+ errorMessage = "El ID o la version del producto no es valido";
244
+ }
245
+
246
+ return _context.abrupt("break", 33);
247
+
248
+ case 28:
249
+ if ((0, _utils.isValidNaturalNumber)(dataChat === null || dataChat === void 0 ? void 0 : dataChat.id) && (0, _utils.isValidNaturalNumber)(dataChat === null || dataChat === void 0 ? void 0 : dataChat.version)) {
250
+ fileKey += "orderArticle/".concat(dataChat.id, "-").concat(dataChat.version, "/");
251
+ } else {
252
+ errorMessage = "El ID o la version del producto no es valido";
253
+ }
254
+
255
+ return _context.abrupt("break", 33);
256
+
257
+ case 30:
258
+ if ((0, _utils.isValidNaturalNumber)(dataChat === null || dataChat === void 0 ? void 0 : dataChat.id)) {
259
+ fileKey += "ticket/".concat(dataChat.id, "/");
260
+ } else {
261
+ errorMessage = "El ID del ticket no es valido";
262
+ }
263
+
264
+ return _context.abrupt("break", 33);
265
+
266
+ case 32:
267
+ errorMessage = "El tipo de chat no se especifico de manera correcta";
268
+
269
+ case 33:
270
+ if (!errorMessage) {
271
+ today = new Date();
272
+ fileKey += "".concat((0, _uuid.v4)(), "-").concat(today.getTime(), ".").concat((0, _utils.getFileExtension)(file.name));
273
+ } else {
274
+ fileKey = undefined;
275
+ } //console.log("fileKey: ", fileKey);
276
+ // enviar file a AWS
277
+
278
+
279
+ customFiles.push({
280
+ itemType: file.type.split("/")[0] == "image" ? "img" : "file",
281
+ key: fileKey,
282
+ errorOwn: errorMessage
283
+ });
284
+ paramsCreate = {
285
+ ACL: "public-read",
286
+ Body: dataBuffer,
287
+ Bucket: S3_BUCKET,
288
+ Key: fileKey
289
+ };
290
+ fileUploadRequests.push(myBucket.putObject(paramsCreate).promise());
291
+
292
+ case 37:
293
+ _context.next = 12;
294
+ break;
295
+
296
+ case 39:
297
+ _context.next = 44;
298
+ break;
299
+
300
+ case 41:
301
+ _context.prev = 41;
302
+ _context.t1 = _context["catch"](10);
303
+
304
+ _iterator.e(_context.t1);
305
+
306
+ case 44:
307
+ _context.prev = 44;
308
+
309
+ _iterator.f();
310
+
311
+ return _context.finish(44);
312
+
313
+ case 47:
314
+ _context.next = 49;
315
+ return Promise.allSettled(fileUploadRequests);
316
+
317
+ case 49:
318
+ responseAWS = _context.sent;
319
+ console.log("responseAWS:", responseAWS);
320
+ responseAWS.forEach(function (responseFile, index) {
321
+ if (responseFile.status === "rejected") {
322
+ customFiles[index].errorAWS = responseFile.reason.message;
323
+ customFiles[index].uploaded = false;
324
+ } else {
325
+ customFiles[index].uploaded = true;
326
+ }
327
+ }); //console.log("customFiles:", customFiles);
328
+
329
+ _context.next = 59;
330
+ break;
331
+
332
+ case 54:
333
+ _context.prev = 54;
334
+ _context.t2 = _context["catch"](7);
335
+ disableSecondaryContainer(false);
336
+ setModalAlert({
337
+ show: true,
338
+ title: "hubo un problema al subir los archivos al chat",
339
+ message: "".concat(_context.t2.message, "\n Reporta esto a TI"),
340
+ errorInputMessage: false
341
+ });
342
+ return _context.abrupt("return");
343
+
344
+ case 59:
345
+ // obtener las keys de los files subidos
346
+ items = [];
347
+ index = 0;
348
+
349
+ case 61:
350
+ if (!(index < customFiles.length)) {
351
+ _context.next = 75;
352
+ break;
353
+ }
354
+
355
+ _file = customFiles[index];
356
+
357
+ if (!_file.uploaded) {
358
+ _context.next = 72;
359
+ break;
360
+ }
361
+
362
+ valueItem = {
363
+ key: _file.key,
364
+ name: files[index].name
365
+ }; // caso imagen -> obtener width y height
366
+
367
+ if (!(_file.itemType === "img")) {
368
+ _context.next = 70;
369
+ break;
370
+ }
371
+
372
+ _context.next = 68;
373
+ return (0, _utils.getImageSize)(files[index]);
374
+
375
+ case 68:
376
+ imgSize = _context.sent;
377
+
378
+ if (imgSize) {
379
+ valueItem.width = imgSize.width;
380
+ valueItem.height = imgSize.height;
381
+ }
382
+
383
+ case 70:
384
+ console.log("valueItemFile:", valueItem);
385
+ items.push({
386
+ type: _file.itemType,
387
+ value: JSON.stringify(valueItem)
388
+ });
389
+
390
+ case 72:
391
+ index++;
392
+ _context.next = 61;
393
+ break;
394
+
395
+ case 75:
396
+ if (!items.length) {
397
+ _context.next = 83;
398
+ break;
399
+ }
400
+
401
+ _context.next = 78;
402
+ return createItemsChat(items);
403
+
404
+ case 78:
405
+ responseError = _context.sent;
406
+
407
+ if (!responseError) {
408
+ _context.next = 83;
409
+ break;
410
+ }
411
+
412
+ setModalAlert({
413
+ show: true,
414
+ title: responseError.message,
415
+ message: responseError.errorDetail,
416
+ errorInputMessage: false
417
+ });
418
+ disableSecondaryContainer(false);
419
+ return _context.abrupt("return");
420
+
421
+ case 83:
422
+ // obtener los errores de los files no subidos a AWS
423
+ failedFiles = [];
424
+ errorDetailFiles = "";
425
+ customFiles.forEach(function (file, index) {
426
+ if (!file.uploaded) {
427
+ if (failedFiles.length === 0) {
428
+ errorDetailFiles = "".concat(files[index].name, ":\n Error: ").concat(file.errorOwn ? file.errorOwn : file.errorAWS);
429
+ } else {
430
+ errorDetailFiles += "\n\n".concat(files[index].name, ":\n Error: ").concat(file.errorOwn ? file.errorOwn : file.errorAWS);
431
+ }
432
+
433
+ failedFiles.push(files[index]);
434
+ }
435
+ });
436
+
437
+ if (failedFiles.length) {
438
+ setModalAlert({
439
+ show: true,
440
+ title: "".concat(failedFiles.length, "/").concat(files.length, " archivos no fueron enviados al chat"),
441
+ message: errorDetailFiles,
442
+ errorInputMessage: false
443
+ });
444
+ } // actualizar filesPreview
445
+
446
+
447
+ disableSecondaryContainer(false);
448
+ setFilesPreview(failedFiles);
449
+
450
+ case 89:
451
+ case "end":
452
+ return _context.stop();
453
+ }
454
+ }
455
+ }, _callee, null, [[7, 54], [10, 41, 44, 47]]);
456
+ }));
457
+
458
+ return function sendFilesPreview() {
459
+ return _ref.apply(this, arguments);
460
+ };
461
+ }();
462
+
463
+ var sendMessage = /*#__PURE__*/function () {
464
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
465
+ var responseError;
466
+ return _regenerator.default.wrap(function _callee2$(_context2) {
467
+ while (1) {
468
+ switch (_context2.prev = _context2.next) {
469
+ case 0:
470
+ if (!createItemsChat) {
471
+ _context2.next = 15;
472
+ break;
473
+ }
474
+
475
+ if (!(0, _utils.isStringEmpty)(valueInputMessage)) {
476
+ _context2.next = 5;
477
+ break;
478
+ }
479
+
480
+ setValueInputMessage("");
481
+ setModalAlert({
482
+ show: true,
483
+ title: "mensaje vacío",
484
+ message: "Por favor, especifica el mensaje que quieres enviar al chat",
485
+ errorInputMessage: true
486
+ });
487
+ return _context2.abrupt("return");
488
+
489
+ case 5:
490
+ setBtnSendMessageLoading(true);
491
+ setBtnChooserFileDisabled(true);
492
+ setInputMessageDisabled(true);
493
+ _context2.next = 10;
494
+ return createItemsChat([{
495
+ type: "message",
496
+ value: valueInputMessage.trim()
497
+ }]);
498
+
499
+ case 10:
500
+ responseError = _context2.sent;
501
+ setInputMessageDisabled(false);
502
+ setBtnSendMessageLoading(false);
503
+ setBtnChooserFileDisabled(false);
504
+
505
+ if (responseError) {
506
+ setModalAlert({
507
+ show: true,
508
+ title: responseError.message,
509
+ message: responseError.errorDetail,
510
+ errorInputMessage: true
511
+ });
512
+ } else {
513
+ setValueInputMessage("");
514
+ setToggleFocusInputMessage(function (prev) {
515
+ return !prev;
516
+ });
517
+ }
518
+
519
+ case 15:
520
+ case "end":
521
+ return _context2.stop();
522
+ }
523
+ }
524
+ }, _callee2);
525
+ }));
526
+
527
+ return function sendMessage() {
528
+ return _ref2.apply(this, arguments);
529
+ };
530
+ }();
531
+
532
+ var disableSecondaryContainer = function disableSecondaryContainer() {
533
+ var disabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
534
+ setBtnSendFilesLoading(disabled);
535
+ setBtnChooserFileDisabled(disabled);
536
+ setOpenPreview(!disabled);
537
+ };
538
+
539
+ var deleteFile = /*#__PURE__*/function () {
540
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(index) {
541
+ var newFiles;
542
+ return _regenerator.default.wrap(function _callee3$(_context3) {
543
+ while (1) {
544
+ switch (_context3.prev = _context3.next) {
545
+ case 0:
546
+ newFiles = filesPreview.slice();
547
+ newFiles.splice(index, 1);
548
+ setFilesPreview(newFiles);
549
+
550
+ case 3:
551
+ case "end":
552
+ return _context3.stop();
553
+ }
554
+ }
555
+ }, _callee3);
556
+ }));
557
+
558
+ return function deleteFile(_x) {
559
+ return _ref3.apply(this, arguments);
560
+ };
561
+ }();
562
+
563
+ var renderFilesPreview = /*#__PURE__*/function () {
564
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
565
+ var jsxFiles, _loop, index;
566
+
567
+ return _regenerator.default.wrap(function _callee5$(_context6) {
568
+ while (1) {
569
+ switch (_context6.prev = _context6.next) {
570
+ case 0:
571
+ jsxFiles = [];
572
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop(index) {
573
+ var _file$type;
574
+
575
+ var file, fileType, base64;
576
+ return _regenerator.default.wrap(function _loop$(_context5) {
577
+ while (1) {
578
+ switch (_context5.prev = _context5.next) {
579
+ case 0:
580
+ file = filesPreview[index];
581
+ fileType = (_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.split("/")[0];
582
+ _context5.next = 4;
583
+ return (0, _utils.getBase64)(file);
584
+
585
+ case 4:
586
+ base64 = _context5.sent;
587
+ jsxFiles.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.SwiperSlide, {
588
+ className: "item-carrousel",
589
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ContainerItemCarrousel, {
590
+ children: [fileType === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.Image, {
591
+ width: "100%",
592
+ className: "container-img",
593
+ sizeLoading: 40,
594
+ colorLoading: undefined,
595
+ src: base64,
596
+ componentDefault: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomIcon.CustomIcon, {
597
+ className: "icon-img",
598
+ size: 60,
599
+ icon: _freeSolidSvgIcons.faImage,
600
+ type: "pink",
601
+ transparent: true
602
+ })
603
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconFile.IconFile, {
604
+ transparent: true,
605
+ size: 60,
606
+ ext: (0, _utils.getFileExtension)(file.name)
607
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
608
+ className: "container-delete",
609
+ onMouseEnter: function onMouseEnter() {
610
+ setTooltipFileName({
611
+ show: true,
612
+ fileName: file.name
613
+ });
614
+ },
615
+ onMouseLeave: function onMouseLeave() {
616
+ setTooltipFileName({
617
+ show: false,
618
+ fileName: ""
619
+ });
620
+ },
621
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
622
+ className: "btn-delete",
623
+ type: "white",
624
+ label: "Eliminar",
625
+ size: 8,
626
+ borderType: "oval",
627
+ icon: _freeSolidSvgIcons.faTrash,
628
+ isLoading: undefined,
629
+ onClick: /*#__PURE__*/function () {
630
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(event) {
631
+ return _regenerator.default.wrap(function _callee4$(_context4) {
632
+ while (1) {
633
+ switch (_context4.prev = _context4.next) {
634
+ case 0:
635
+ deleteFile(index);
636
+
637
+ case 1:
638
+ case "end":
639
+ return _context4.stop();
640
+ }
641
+ }
642
+ }, _callee4);
643
+ }));
644
+
645
+ return function (_x2) {
646
+ return _ref5.apply(this, arguments);
647
+ };
648
+ }()
649
+ })
650
+ })]
651
+ })
652
+ }, "item-" + index));
653
+
654
+ case 6:
655
+ case "end":
656
+ return _context5.stop();
657
+ }
658
+ }
659
+ }, _loop);
660
+ });
661
+ index = 0;
662
+
663
+ case 3:
664
+ if (!(index < filesPreview.length)) {
665
+ _context6.next = 8;
666
+ break;
667
+ }
668
+
669
+ return _context6.delegateYield(_loop(index), "t0", 5);
670
+
671
+ case 5:
672
+ index++;
673
+ _context6.next = 3;
674
+ break;
675
+
676
+ case 8:
677
+ setFilesJsxPreview(jsxFiles);
678
+
679
+ case 9:
680
+ case "end":
681
+ return _context6.stop();
682
+ }
683
+ }
684
+ }, _callee5);
685
+ }));
686
+
687
+ return function renderFilesPreview() {
688
+ return _ref4.apply(this, arguments);
689
+ };
690
+ }();
691
+
692
+ var onChangeFiles = /*#__PURE__*/function () {
693
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(selectedFiles) {
694
+ var newFiles;
695
+ return _regenerator.default.wrap(function _callee6$(_context7) {
696
+ while (1) {
697
+ switch (_context7.prev = _context7.next) {
698
+ case 0:
699
+ //console.log("selected files: ", selectedFiles);
700
+ newFiles = filesPreview.slice();
701
+ newFiles = newFiles.concat(selectedFiles);
702
+ setFilesPreview(newFiles);
703
+
704
+ case 3:
705
+ case "end":
706
+ return _context7.stop();
707
+ }
708
+ }
709
+ }, _callee6);
710
+ }));
711
+
712
+ return function onChangeFiles(_x3) {
713
+ return _ref6.apply(this, arguments);
714
+ };
715
+ }();
716
+
717
+ var getErrorUpdate = function getErrorUpdate() {
718
+ if (errorUpdate !== null && errorUpdate !== void 0 && errorUpdate.startDate) {
719
+ var errorDetail = "Ultima actualización hace ";
720
+
721
+ if (errorUpdate !== null && errorUpdate !== void 0 && errorUpdate.lastDate) {
722
+ var msDif = errorUpdate.lastDate.getTime() - errorUpdate.startDate.getTime();
723
+ var minutes = Math.floor(msDif / 60000);
724
+ var hours = Math.floor(minutes / 60);
725
+
726
+ if (hours === 0) {
727
+ if (minutes === 0) errorDetail += "menos de 1 minuto";else if (minutes === 1) errorDetail += "1 minuto";else errorDetail += minutes + " minutos";
728
+ } else {
729
+ if (hours === 1) errorDetail += "1 hora con ";else errorDetail += hours + " horas con ";
730
+ if (minutes === 0) errorDetail += "menos de 1 minuto";else if (minutes === 1) errorDetail += "1 minuto";else errorDetail += minutes + " minutos";
731
+ }
732
+ } else {
733
+ errorDetail += "menos de 1 minuto";
734
+ } // retornar el icono
735
+
736
+
737
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
738
+ componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
739
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
740
+ className: "label-title",
741
+ children: "Chat desactualizado"
742
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
743
+ className: "label-detail",
744
+ children: errorDetail
745
+ })]
746
+ }),
747
+ className: "container-ErrorUpdate",
748
+ classNameTooltip: "tooltipErrorUpdate",
749
+ position: "topCenter",
750
+ addArrow: false,
751
+ transitionType: "zoom",
752
+ followCursor: false,
753
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomIcon.CustomIcon, {
754
+ className: "icon-errorUpdate",
755
+ size: 15,
756
+ icon: _freeSolidSvgIcons.faExclamationTriangle,
757
+ type: "pink",
758
+ transparent: true
759
+ })
760
+ });
761
+ } else {
762
+ return null;
763
+ }
764
+ };
765
+
766
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
767
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
768
+ ref: containerRef,
769
+ children: statusChat === "closed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
770
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
771
+ className: "container-chatDisabled",
772
+ children: [getErrorUpdate(), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
773
+ className: "label-chatDisabled",
774
+ children: messageDisabled
775
+ })]
776
+ })
777
+ }) : filesJsxPreview.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
778
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ContainerMain, {
779
+ children: [getErrorUpdate(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputText.InputText, {
780
+ className: "input-itemMessage",
781
+ type: "gray",
782
+ transparent: true,
783
+ size: 13,
784
+ placeHolder: "Escribe aqu\xED...",
785
+ multiline: true,
786
+ maxRows: 5,
787
+ minRows: 1,
788
+ disabled: inputMessageDisabled,
789
+ text: valueInputMessage,
790
+ onChangeText: function onChangeText(newValue) {
791
+ return setValueInputMessage(newValue);
792
+ },
793
+ onEnter: /*#__PURE__*/function () {
794
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(event) {
795
+ return _regenerator.default.wrap(function _callee7$(_context8) {
796
+ while (1) {
797
+ switch (_context8.prev = _context8.next) {
798
+ case 0:
799
+ _context8.next = 2;
800
+ return sendMessage();
801
+
802
+ case 2:
803
+ return _context8.abrupt("return", _context8.sent);
804
+
805
+ case 3:
806
+ case "end":
807
+ return _context8.stop();
808
+ }
809
+ }
810
+ }, _callee7);
811
+ }));
812
+
813
+ return function (_x4) {
814
+ return _ref7.apply(this, arguments);
815
+ };
816
+ }(),
817
+ refInputText: refInputTextMessage
818
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonFileChooser.ButtonFileChooser, {
819
+ className: "btn-chooserFiles",
820
+ type: "gray",
821
+ transparent: true,
822
+ size: 18,
823
+ disabled: btnChooserFileDisabled,
824
+ showIcon: true,
825
+ multipleFiles: true,
826
+ onChangeFiles: onChangeFiles
827
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
828
+ className: "btn-sendMessage",
829
+ type: "pink",
830
+ size: 10,
831
+ borderType: "circle",
832
+ icon: _freeSolidSvgIcons.faArrowUp,
833
+ isLoading: btnSendMessageLoading,
834
+ onClick: /*#__PURE__*/function () {
835
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
836
+ return _regenerator.default.wrap(function _callee8$(_context9) {
837
+ while (1) {
838
+ switch (_context9.prev = _context9.next) {
839
+ case 0:
840
+ _context9.next = 2;
841
+ return sendMessage();
842
+
843
+ case 2:
844
+ case "end":
845
+ return _context9.stop();
846
+ }
847
+ }
848
+ }, _callee8);
849
+ }));
850
+
851
+ return function (_x5) {
852
+ return _ref8.apply(this, arguments);
853
+ };
854
+ }()
855
+ })]
856
+ })
857
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
858
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
859
+ open: openPreview,
860
+ placement: "top-start",
861
+ arrow: false,
862
+ componentsProps: {
863
+ popper: {
864
+ className: "tooltip-previewFiles",
865
+ disablePortal: true
866
+ },
867
+ transition: {
868
+ timeout: 300
869
+ }
870
+ },
871
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
872
+ open: tooltipFileName.show,
873
+ placement: "top",
874
+ arrow: false,
875
+ followCursor: true,
876
+ TransitionComponent: _material.Fade,
877
+ componentsProps: {
878
+ popper: {
879
+ className: "tooltip-previewFileName",
880
+ disablePortal: true
881
+ },
882
+ transition: {
883
+ timeout: 300
884
+ }
885
+ },
886
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
887
+ children: tooltipFileName.fileName
888
+ }),
889
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
890
+ className: "container-carrouselFiles",
891
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Swiper, {
892
+ spaceBetween: 5,
893
+ slidesPerView: "auto",
894
+ freeMode: true,
895
+ mousewheel: true,
896
+ keyboard: true,
897
+ modules: [_swiper.Mousewheel, _swiper.Keyboard, _swiper.FreeMode],
898
+ className: "carrousel-files",
899
+ children: filesJsxPreview
900
+ })
901
+ })
902
+ }),
903
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ContainerSecondary, {
904
+ children: [getErrorUpdate(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Slide, {
905
+ direction: "left",
906
+ in: true,
907
+ timeout: 500,
908
+ container: containerRef.current,
909
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
910
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonFileChooser.ButtonFileChooser, {
911
+ className: "btn-chooserFiles",
912
+ type: "gray",
913
+ size: 17,
914
+ borderType: "circle",
915
+ showIcon: true,
916
+ disabled: btnChooserFileDisabled,
917
+ multipleFiles: true,
918
+ onChangeFiles: onChangeFiles
919
+ })
920
+ })
921
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Slide, {
922
+ direction: "up",
923
+ in: true,
924
+ timeout: 500,
925
+ container: containerRef.current,
926
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
927
+ className: "slide-btnSendFiles",
928
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
929
+ className: "btn-sendFiles",
930
+ type: "pink",
931
+ label: "Enviar archivos",
932
+ size: 12,
933
+ borderType: "oval",
934
+ loading: btnSendFilesLoading,
935
+ isLoading: btnSendFilesLoading,
936
+ onClick: /*#__PURE__*/function () {
937
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(event) {
938
+ return _regenerator.default.wrap(function _callee9$(_context10) {
939
+ while (1) {
940
+ switch (_context10.prev = _context10.next) {
941
+ case 0:
942
+ _context10.next = 2;
943
+ return sendFilesPreview();
944
+
945
+ case 2:
946
+ case "end":
947
+ return _context10.stop();
948
+ }
949
+ }
950
+ }, _callee9);
951
+ }));
952
+
953
+ return function (_x6) {
954
+ return _ref9.apply(this, arguments);
955
+ };
956
+ }()
957
+ })
958
+ })
959
+ })]
960
+ })
961
+ })
962
+ })
963
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
964
+ className: "container-modalAlert",
965
+ show: modalAlert.show,
966
+ title: modalAlert.title,
967
+ message: modalAlert.message,
968
+ icon: "info",
969
+ onClickBtnDefault: function onClickBtnDefault(event) {
970
+ setModalAlert(function (prev) {
971
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), {}, {
972
+ show: false,
973
+ errorInputMessage: false
974
+ });
975
+ });
976
+ setToggleFocusInputMessage(function (prev) {
977
+ return !prev;
978
+ });
979
+ }
980
+ })]
981
+ });
982
+ };
983
+
984
+ exports.Footer = Footer;