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M,EAAc7L,UAC9BD,EAAAA,EAAAA,MAACE,EAAAA,EAAQ,CACR4F,QAAM,EACN3F,IAAK,QACLgC,WA9KgC,gBA8KElC,SAAA,EAElCf,EAAAA,EAAAA,KAACV,EAAiB,CACjBG,IAAKoL,EACLlL,SAAUqJ,EACVtJ,SAAUoL,KAEX9K,EAAAA,EAAAA,KAACgB,EAAAA,EAAQ,CACR4F,QAAM,EACN3F,IAAK,OAAOF,SAEXA,KAGFf,EAAAA,EAAAA,KAAC0G,EAAuB,IAEvB0D,EAEAO,EAAWxI,OAAS,IACpBnC,EAAAA,EAAAA,KAACgB,EAAAA,EAAQ,CACR4F,QAAM,EACN3F,IAAK,OAAOF,SAEX4J,EAAW5E,KAAKoF,IAChBnL,EAAAA,EAAAA,KAACwJ,EAAyB,CAEzBC,cAAeA,KAAM+D,OA7GRjK,EA6GoB4H,EAAM5H,YA5G9CqH,GAAexK,GACPA,EAAM2D,QAAQP,GAASA,EAAKD,SAAWA,MAF3BA,KA6GkC,EAAAxC,SAE9CoK,EAAMnF,SAHFmF,EAAM5H,YASd+G,EAASnI,OAAS,IAClBnC,EAAAA,EAAAA,KAACgB,EAAAA,EAAQ,CAAC4F,QAAM,EAAA7F,SACduJ,EAASvE,KAAI,CAAAI,EAAmCsH,KAAQ,IAA1C,OAAElK,EAAM,KAAEC,EAAI,KAAE5D,EAAI,SAAEyD,GAAU8C,EAC9C,OACCnG,EAAAA,EAAAA,KAACmD,EAAgB,CAChBC,cAAuB,IAARqK,GAAanD,EAASmD,EAAM,GAAGpK,SAC9CA,SAAUA,EACVC,IAAKA,EAELC,OAAQA,EACRC,KAAMA,EACN5D,KAAMA,EACN6D,YAAaA,EACb/D,SAAUA,EACVgE,QAAS4I,EACT3I,oBAAqBqH,EAAuBoB,SAPvC7I,EAQJ,YAOQ,C","sources":["webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderInput.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/styles/inputFile.module.scss","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/styles/index.module.scss","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderItemProgress.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderTextInput.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderItemLoaded.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderItem.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/api.ts","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/styles/description.module.scss","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderDescription.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderDndZone.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderDnd.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderButton.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/styles/uploadButtons.module.scss","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderMessageDanger.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/FileUploaderProvider.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/components/FileUploader/utils.ts"],"sourcesContent":["import React, { ChangeEvent, forwardRef } from 'react';\r\nimport classes from './styles/inputFile.module.scss';\r\nimport { useFileUploaderConfig } from './FileUploaderProvider';\r\n\r\ntype FileUploaderInputProps = {\r\n\tdisabled?: boolean;\r\n\tonChange: (files: FileList) => void;\r\n};\r\n\r\nexport const FILE_UPLOADER_INPUT_DATA_TEST_ID = 'file-uploader-input';\r\n\r\nconst FileUploaderInput = forwardRef(({ disabled, onChange }, ref) => {\r\n\tconst { name, maxFiles, accept } = useFileUploaderConfig();\r\n\r\n\tconst handleInputChange = (e: ChangeEvent) => {\r\n\t\tconst { files } = e.target;\r\n\r\n\t\tif (files) {\r\n\t\t\tonChange(files);\r\n\r\n\t\t\te.target.value = '';\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t 1}\r\n\t\t\taccept={accept.join(', ')}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\nexport { FileUploaderInput };\r\n","// extracted by mini-css-extract-plugin\nexport default {\"inputFile\":\"inputFile_b1Z3dGm\"};","// extracted by mini-css-extract-plugin\nexport default {\"inputFile\":\"inputFile_XSjoM5v\",\"uploadButtons\":\"uploadButtons_Z5_7iL7\",\"uploadButtons__btn\":\"uploadButtons__btn_JweCJwE\",\"notStyledWrapper\":\"notStyledWrapper_oQOs6y8\",\"documentDropZone\":\"documentDropZone_iaRZyKW\",\"documentDropZone_full\":\"documentDropZone_full_SSyjKfb\",\"documentDropZone_local\":\"documentDropZone_local_VDEFVLN\",\"documentDropZone__inner\":\"documentDropZone__inner_vpd_Dzh\",\"documentDropZone__action\":\"documentDropZone__action_NTwy13F\",\"documentDropZone__description\":\"documentDropZone__description_n9RyXeK\",\"dndDescription\":\"dndDescription_RH1kTwt\",\"description\":\"description_sqCeykP\",\"fileIsUploading\":\"fileIsUploading_DCo4Qs9\",\"fileIsUploading__name\":\"fileIsUploading__name_qDd_HNy\",\"item_loaded\":\"item_loaded_o6GBACU\",\"item_loaded_name\":\"item_loaded_name_oPGqHho\",\"fileUploaded\":\"fileUploaded_A2_A7oC\",\"fileUploaded__info\":\"fileUploaded__info_U2YzN6O\",\"fileUploaded__deleteBtn\":\"fileUploaded__deleteBtn_RLoP1He\",\"progress\":\"progress_z8c1a_K\",\"progressNumber\":\"progressNumber_pFgOEgR\",\"progressLine\":\"progressLine_KqEt0xA\",\"progressLineFilled\":\"progressLineFilled_Pl2cEhK\",\"spinner\":\"spinner_ORhNsBa\",\"spinner__circle\":\"spinner__circle__hkz3bn\",\"spinner__ball\":\"spinner__ball_PQXinUx\",\"orbit\":\"orbit_x1pljJn\",\"spinner__innerBall\":\"spinner__innerBall__usTz3T\"};","import React, { FC } from 'react';\r\nimport classes from './styles/index.module.scss';\r\nimport { FlexGrid, FlexGridColumn } from '../FlexGrid';\r\nimport { IconButton } from '../IconButton';\r\nimport { CloseTiny } from '../Icons/CloseTiny';\r\n\r\ntype FileUploaderBoxProgressProps = {\r\n\tname: string;\r\n\tprogress: number;\r\n\tonCancel: () => void;\r\n};\r\n\r\nexport const FILE_UPLOADER_ITEM_PROGRESS_TEST_ID = 'file-uploader-item-progress';\r\n\r\nconst FileUploaderItemProgress: FC> = ({\r\n\tname,\r\n\tprogress,\r\n\tonCancel,\r\n}) => {\r\n\tconst percentage = `${progress}%`;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t
{name}
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
{percentage}
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderItemProgress };\r\n","import React, { FC } from 'react';\r\nimport { TextBoxWithPreview } from '../Textbox';\r\nimport { ControlGroup } from '../ControlGroup';\r\nimport { useFileUploaderConfig } from './FileUploaderProvider';\r\nimport { codes } from '../../data/translations';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\n\r\ntype FileUploaderTextInputProps = {\r\n\tvalue: string;\r\n\tonChange: (name: string) => void;\r\n};\r\n\r\nconst FileUploaderTextInput: FC> = ({ value, onChange }) => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst { maxFileNameLength = 128, disabled, readOnlyFileName } = useFileUploaderConfig();\r\n\tconst isInvalidName = (value.length === 0 || value.length > maxFileNameLength) && !readOnlyFileName;\r\n\r\n\tconst getValidationMessage = () => {\r\n\t\tif (value.length === 0) {\r\n\t\t\treturn translate(codes.required);\r\n\t\t}\r\n\r\n\t\tif (value.length > maxFileNameLength) {\r\n\t\t\treturn translate(codes.common.maximumLengthExceeded);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderTextInput };\r\n","import React, { FC } from 'react';\r\nimport classes from './styles/index.module.scss';\r\nimport { FlexGrid, FlexGridColumn } from '../FlexGrid';\r\nimport { IconButton } from '../IconButton';\r\nimport { FileUploaderTextInput } from './FileUploaderTextInput';\r\nimport { RecycleBin } from '../Icons/RecycleBin';\r\n\r\ntype FileUploaderBoxLoadedProps = {\r\n\tname: string;\r\n\tdisabled?: boolean;\r\n\tonNameChange: (name: string) => void;\r\n\tonRemove: () => void;\r\n};\r\n\r\nexport const FILE_UPLOADER_ITEM_LOADED_TEST_ID = 'file-uploader-item-loaded';\r\nexport const FILE_UPLOADER_ITEM_REMOVE_BUTTON_TEST_ID = 'file-uploader-item-remove-button';\r\n\r\nconst FileUploaderItemLoaded: FC> = ({\r\n\tdisabled,\r\n\tname,\r\n\tonRemove,\r\n\tonNameChange,\r\n}) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderItemLoaded };\r\n","import React, { FC, useCallback, useEffect, useState } from 'react';\r\nimport { FileUploaderItemProgress } from './FileUploaderItemProgress';\r\nimport { FileUploaderItemLoaded } from './FileUploaderItemLoaded';\r\nimport { upload } from './api';\r\nimport { FileUploaderItemData, OnFileItemErrorHandler } from './types';\r\nimport { isUndefined } from '../../predicates/type';\r\nimport { abortRequestByCancelId } from '../../modules/app';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport { codes } from '../../data/translations';\r\n\r\ntype FileUploaderBoxProps = FileUploaderItemData & {\r\n\turl: string;\r\n\tdisabled?: boolean;\r\n\tenableRequest: boolean;\r\n\tsetFilesMap: React.Dispatch>;\r\n\tonError: OnFileItemErrorHandler;\r\n\tonFileUploadSuccess?: (data: unknown) => void;\r\n};\r\n\r\nconst FileUploaderItem: FC> = ({\r\n\tdisabled,\r\n\tenableRequest,\r\n\tisLoaded,\r\n\turl,\r\n\tfileId,\r\n\tfile,\r\n\tname,\r\n\tsetFilesMap,\r\n\tonError,\r\n\tonFileUploadSuccess,\r\n}) => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst [progress, setProgress] = useState(0);\r\n\r\n\tconst removeFileById = (fileId: string) => {\r\n\t\tsetFilesMap((files) => {\r\n\t\t\treturn files.filter((file) => file.fileId !== fileId);\r\n\t\t});\r\n\t};\r\n\r\n\tconst handleChangeName = (name: string) => {\r\n\t\tsetFilesMap((files) => {\r\n\t\t\treturn files.map((file) => {\r\n\t\t\t\tif (file.fileId === fileId) {\r\n\t\t\t\t\tfile.name = name;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn file;\r\n\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\tconst handleRemove = useCallback(() => {\r\n\t\tremoveFileById(fileId);\r\n\t\t// eslint-disable-next-line\r\n\t}, [fileId]);\r\n\r\n\tconst handleCancel = () => {\r\n\t\tabortRequestByCancelId(fileId);\r\n\t\tremoveFileById(fileId);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (enableRequest && !isLoaded) {\r\n\t\t\tupload<{ errorMessage?: string }>(\r\n\t\t\t\turl,\r\n\t\t\t\tfile,\r\n\t\t\t\t{\r\n\t\t\t\t\tfileId,\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tonUploadProgress: (progressEvent) => {\r\n\t\t\t\t\t\tconst { total, loaded } = progressEvent;\r\n\r\n\t\t\t\t\t\tif (isUndefined(total)) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst progressPercent = Math.floor((loaded / total) * 100);\r\n\r\n\t\t\t\t\t\tsetProgress(progressPercent);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tisCancellable: true,\r\n\t\t\t\t\tcancelId: fileId,\r\n\t\t\t\t},\r\n\t\t\t)\r\n\t\t\t\t.then(({ data }) => {\r\n\t\t\t\t\tonFileUploadSuccess && onFileUploadSuccess(data);\r\n\r\n\t\t\t\t\tconst errorMessage = data.errorMessage;\r\n\r\n\t\t\t\t\tsetFilesMap((files) => {\r\n\t\t\t\t\t\treturn files.map((file) => {\r\n\t\t\t\t\t\t\tif (file.fileId !== fileId) {\r\n\t\t\t\t\t\t\t\treturn file;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (isUndefined(errorMessage)) {\r\n\t\t\t\t\t\t\t\tfile.isLoaded = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tonError({ fileId, message: errorMessage });\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\thandleRemove();\r\n\t\t\t\t\t\t\t\t}, 100);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn file;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t})\r\n\t\t\t\t.catch(({ message, response, code }) => {\r\n\t\t\t\t\thandleRemove();\r\n\t\t\t\t\tconst errorCodeCanceled = 'ERR_CANCELED';\r\n\r\n\t\t\t\t\tconst errorMessage =\r\n\t\t\t\t\t\tcode === errorCodeCanceled\r\n\t\t\t\t\t\t\t? translate(codes.documentUploader.uploadingCanceled)\r\n\t\t\t\t\t\t\t: response?.data.message || message;\r\n\r\n\t\t\t\t\tif (errorMessage) {\r\n\t\t\t\t\t\tonError({ fileId, message: errorMessage });\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}, [\r\n\t\tenableRequest,\r\n\t\tfile,\r\n\t\tfileId,\r\n\t\thandleRemove,\r\n\t\tisLoaded,\r\n\t\tname,\r\n\t\tonError,\r\n\t\tonFileUploadSuccess,\r\n\t\tsetFilesMap,\r\n\t\ttranslate,\r\n\t\turl,\r\n\t]);\r\n\r\n\tuseEffect(() => {\r\n\t\treturn () => {\r\n\t\t\tif (!isLoaded) {\r\n\t\t\t\tabortRequestByCancelId(fileId);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [fileId, isLoaded]);\r\n\r\n\tif (isLoaded) {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderItem };\r\n","import { getDefaultHeaders } from '../../modules/app/network/utils';\r\nimport { POST } from '@packages/dataFetch';\r\nimport { POSTConfig } from '@packages/dataFetch';\r\n\r\nexport function upload(url: string, file: File, data = {}, config: POSTConfig = {}) {\r\n\tconst formData = new FormData();\r\n\r\n\tObject.keys(data).forEach((key) => {\r\n\t\tformData.append(key, data[key]);\r\n\t});\r\n\r\n\tformData.append('file', file, file.name);\r\n\r\n\treturn POST(url, {\r\n\t\t...config,\r\n\t\tdata: formData,\r\n\t\theaders: {\r\n\t\t\t...getDefaultHeaders(),\r\n\t\t\t'Content-Type': 'multipart/form-data;',\r\n\t\t},\r\n\t});\r\n}\r\n","// extracted by mini-css-extract-plugin\nexport default {\"description\":\"description_Si2fbXw\"};","import React, { FC } from 'react';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport { codes } from '../../data/translations';\r\nimport classes from './styles/description.module.scss';\r\nimport { FlexGrid } from '../FlexGrid';\r\nimport { useFileUploaderConfig } from './FileUploaderProvider';\r\n\r\nconst FileUploaderDescription: FC = () => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst { maxFiles, accept, maxSize } = useFileUploaderConfig();\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{maxFiles === 1 &&
- {translate(codes.documentUploader.oneFileLimit)}
}\r\n\t\t\t{maxFiles > 1 &&
- {translate(codes.documentUploader.nFilesLimit, [maxFiles])}
}\r\n\t\t\t
\r\n\t\t\t\t- {translate(codes.documentUploader.supportedExtensions)}:{' '}\r\n\t\t\t\t{accept.join(', ') || translate(codes.documentUploader.unknown)}\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t- {translate(codes.documentUploader.maxFileSize)}: {maxSize} Mb\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderDescription };\r\n","import React, { FC } from 'react';\r\nimport { codes } from '../../data/translations';\r\nimport classes from './styles/index.module.scss';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport { FlexGrid } from '../FlexGrid';\r\nimport { Upload } from '../Icons/Upload';\r\nimport { useFileUploaderConfig } from './FileUploaderProvider';\r\nimport cn from 'classnames';\r\n\r\ntype FileUploaderDndZoneProps = {\r\n\tonDrop: React.DragEventHandler;\r\n\tonLeave: () => void;\r\n};\r\n\r\nexport const FILE_UPLOADER_DND_ZONE_TEST_ID = 'file-uploader-dnd-zone';\r\n\r\nconst FileUploaderDndZone: FC> = ({ onDrop, onLeave }) => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst { localDropZone } = useFileUploaderConfig();\r\n\r\n\tconst dndZoneClasses = cn(classes.documentDropZone, {\r\n\t\t[classes.documentDropZone_local]: localDropZone,\r\n\t\t[classes.documentDropZone_full]: !localDropZone,\r\n\t});\r\n\r\n\tconst handleDragOver = (e) => {\r\n\t\te.preventDefault();\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t
{translate(codes.common.uploadFile)}
\r\n\t\t\t\t
{translate(codes.common.dragAndDropFile1)}
\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderDndZone };\r\n","import React, { DragEventHandler, FC, useEffect, useState } from 'react';\r\nimport { FileUploaderDndZone } from './FileUploaderDndZone';\r\nimport { codes } from '../../data/translations';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport classes from './styles/index.module.scss';\r\n\r\ntype FileUploaderDndProps = {\r\n\tonDrop: (files: FileList) => void;\r\n};\r\n\r\nconst FileUploaderDnd: FC> = ({ onDrop }) => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst [showDndZone, setShowDndZone] = useState(false);\r\n\r\n\tconst handleDrop: DragEventHandler = (e) => {\r\n\t\te.preventDefault();\r\n\r\n\t\tonDrop(e.dataTransfer.files);\r\n\r\n\t\tsetShowDndZone(false);\r\n\t};\r\n\r\n\tconst handleLeave = () => {\r\n\t\tsetShowDndZone(false);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tconst handleDragEnter = () => {\r\n\t\t\tsetShowDndZone(true);\r\n\t\t};\r\n\r\n\t\tdocument.body.addEventListener('dragenter', handleDragEnter);\r\n\r\n\t\treturn () => {\r\n\t\t\tdocument.body.removeEventListener('dragenter', handleDragEnter);\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
{translate(codes.common.dragAndDropFile2)}
\r\n\t\t\t{showDndZone && (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderDnd };\r\n","import React, { FC } from 'react';\r\nimport { codes } from '../../data/translations';\r\nimport Button from '../Button';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport classes from './styles/uploadButtons.module.scss';\r\nimport { useFileUploader } from './FileUploaderProvider';\r\nimport { FileUploaderDnd } from './FileUploaderDnd';\r\nimport { FolderOpen } from '../Icons/FolderOpen';\r\n\r\nexport const FILE_UPLOADER_BUTTON_TEST_ID = 'file-uploader-button';\r\n\r\nconst FileUploaderButton: FC = () => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst { openUploader, disabled, setFileUploaderFiles } = useFileUploader();\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t}\r\n\t\t\t\tsize='small'\r\n\t\t\t\tclassName={classes.uploadButtons__btn}\r\n\t\t\t\tdataTestId={FILE_UPLOADER_BUTTON_TEST_ID}\r\n\t\t\t>\r\n\t\t\t\t{translate(codes.documentUploader.browse)}\r\n\t\t\t\r\n\r\n\t\t\t{!disabled && }\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderButton };\r\n","// extracted by mini-css-extract-plugin\nexport default {\"uploadButtons\":\"uploadButtons_RRoIB0v\",\"uploadButtons__btn\":\"uploadButtons__btn_d0c87Kj\",\"notStyledWrapper\":\"notStyledWrapper_bN_Y7HB\"};","import React, { FC } from 'react';\r\nimport Message from '../Message';\r\n\r\ntype FileUploaderMessageDangerProps = {\r\n\tonCancelClick: () => void;\r\n};\r\n\r\nconst FileUploaderMessageDanger: FC> = ({\r\n\tchildren,\r\n\tonCancelClick,\r\n}) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderMessageDanger };\r\n","import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { FileUploaderInput } from './FileUploaderInput';\r\nimport { createProvider } from '../../utils/createProvider';\r\nimport { FlexGrid } from '../FlexGrid';\r\nimport { FileUploaderItem } from './FileUploaderItem';\r\nimport {\r\n\tFileUploaderBaseProps,\r\n\tFileUploaderConfigProps,\r\n\tFileUploaderError,\r\n\tFileUploaderItemData,\r\n\tFileUploaderProps,\r\n\tOnFileItemErrorHandler,\r\n} from './types';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { FileUploaderDescription } from './FileUploaderDescription';\r\nimport { useTranslationAPI } from '../../modules/translations';\r\nimport { codes } from '../../data/translations';\r\nimport { useComponentDidUpdate } from '../../hooks/useComponentDidUpdate';\r\nimport { FileUploaderButton } from './FileUploaderButton';\r\nimport { FileUploaderMessageDanger } from './FileUploaderMessageDanger';\r\nimport { getExtension, removeExtension, stringifyFilesMap } from './utils';\r\nimport { usePrevious } from '../../hooks/usePrevious';\r\nimport isEqual from 'lodash/isEqual';\r\n\r\ntype FileUploaderProviderProps = {\r\n\tdisabled?: boolean;\r\n\tlocalDropZone?: boolean;\r\n\topenUploader: () => void;\r\n\tsetFileUploaderFiles: (files: FileList) => void;\r\n};\r\n\r\nconst [Provider, useFileUploader] = createProvider({\r\n\tcontextName: 'FileUploader',\r\n});\r\n\r\nconst [ProviderConfig, useFileUploaderConfig] = createProvider({\r\n\tcontextName: 'FileUploaderConfig',\r\n});\r\n\r\nexport const FILE_UPLOADER_TEST_ID = 'file-uploader';\r\n\r\nconst FileUploaderProvider: FC> = ({\r\n\tname,\r\n\turl,\r\n\tmaxFiles = 1,\r\n\tmaxSize = 10,\r\n\taccept = [],\r\n\tonChange,\r\n\tchildren = ,\r\n\tdisabled,\r\n\tlocalDropZone,\r\n\treadOnlyFileName,\r\n\terrors,\r\n\tmaxFileNameLength = 128,\r\n\tvalues,\r\n\tonFileUploadSuccess,\r\n}) => {\r\n\tconst { translate } = useTranslationAPI();\r\n\tconst [filesMap, setFilesMap] = useState([]);\r\n\tconst jsonFilesMapRef = useRef([]);\r\n\tconst prevValues = usePrevious(values);\r\n\tconst [fileErrors, setFileErrors] = useState([]);\r\n\tconst fileInput = useRef(null);\r\n\tconst disableUploadFile = filesMap.length >= maxFiles || disabled;\r\n\tconst maxSizeInBytes = maxSize * 1024 * 1024;\r\n\tconst onFileUploadSuccessRef = useRef(onFileUploadSuccess);\r\n\r\n\tconst setFileUploaderFiles = useCallback(\r\n\t\t(files: FileList) => {\r\n\t\t\tconst newFileList: FileUploaderItemData[] = [];\r\n\t\t\tconst errors: FileUploaderError[] = [];\r\n\r\n\t\t\tif (maxFiles - filesMap.length - files.length < 0) {\r\n\t\t\t\terrors.push({\r\n\t\t\t\t\tfileId: 'maxNumberOfFilesExceeded',\r\n\t\t\t\t\tmessage: translate(codes.documentUploader.error.maxNumberOfFilesExceeded, [maxFiles]),\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tfor (let i = 0; i < files.length; i++) {\r\n\t\t\t\t\tconst file = files.item(i);\r\n\t\t\t\t\tconst fileId = uuidv4();\r\n\r\n\t\t\t\t\tif (file) {\r\n\t\t\t\t\t\tif (!accept.some((extension) => file.name.toLowerCase().includes(extension.toLowerCase()))) {\r\n\t\t\t\t\t\t\terrors.push({\r\n\t\t\t\t\t\t\t\tfileId,\r\n\t\t\t\t\t\t\t\tmessage: `${file.name} - ${translate(\r\n\t\t\t\t\t\t\t\t\tcodes.documentUploader.supportedExtensions,\r\n\t\t\t\t\t\t\t\t)}: ${accept.join(', ')}`,\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (file.size > maxSizeInBytes) {\r\n\t\t\t\t\t\t\terrors.push({\r\n\t\t\t\t\t\t\t\tfileId,\r\n\t\t\t\t\t\t\t\tmessage: `${file.name} - ${translate(codes.documentUploader.error.size, [maxSize])}`,\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (file.size === 0) {\r\n\t\t\t\t\t\t\terrors.push({\r\n\t\t\t\t\t\t\t\tfileId,\r\n\t\t\t\t\t\t\t\tmessage: `${file.name} - ${translate(codes.common.emptyFileWarning)}`,\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tnewFileList.push({\r\n\t\t\t\t\t\t\tfile,\r\n\t\t\t\t\t\t\tfileId,\r\n\t\t\t\t\t\t\tisLoaded: false,\r\n\t\t\t\t\t\t\tname: removeExtension(file.name),\r\n\t\t\t\t\t\t\textension: getExtension(file.name),\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsetFileErrors(errors);\r\n\r\n\t\t\tsetFilesMap((prevLoadedFiles) => prevLoadedFiles.concat(newFileList));\r\n\t\t},\r\n\t\t[accept, maxFiles, maxSize, maxSizeInBytes, translate, filesMap.length],\r\n\t);\r\n\r\n\tconst removeError = (fileId: string) => {\r\n\t\tsetFileErrors((files) => {\r\n\t\t\treturn files.filter((file) => file.fileId !== fileId);\r\n\t\t});\r\n\t};\r\n\r\n\tconst openUploader = useCallback(() => {\r\n\t\tif (fileInput.current) {\r\n\t\t\tfileInput.current.click();\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst handleFileItemError = useCallback((file) => {\r\n\t\tconst fileError: FileUploaderError = {\r\n\t\t\tfileId: file.fileId,\r\n\t\t\tmessage: file.message,\r\n\t\t};\r\n\r\n\t\tsetFileErrors((prevErrors) => {\r\n\t\t\treturn prevErrors.filter((prevError) => prevError.fileId !== file.fileId).concat(fileError);\r\n\t\t});\r\n\r\n\t\tsetFilesMap((prevFiles) => {\r\n\t\t\treturn prevFiles.filter((prevFile) => prevFile.fileId !== file.fileId);\r\n\t\t});\r\n\t}, []);\r\n\r\n\tconst providerValue = useMemo(\r\n\t\t() => ({\r\n\t\t\topenUploader,\r\n\t\t\tsetFileUploaderFiles,\r\n\t\t\tdisabled: disableUploadFile,\r\n\t\t}),\r\n\t\t[disableUploadFile, openUploader, setFileUploaderFiles],\r\n\t);\r\n\r\n\tconst providerConfigProps = {\r\n\t\tname,\r\n\t\turl,\r\n\t\tmaxFiles,\r\n\t\tmaxSize,\r\n\t\taccept,\r\n\t\tdisabled,\r\n\t\tlocalDropZone,\r\n\t\treadOnlyFileName,\r\n\t\tmaxFileNameLength,\r\n\t};\r\n\r\n\tuseComponentDidUpdate(() => {\r\n\t\tconst jsonFilesMap = stringifyFilesMap(filesMap.filter((file) => file.isLoaded));\r\n\r\n\t\tif (!isEqual(jsonFilesMap, jsonFilesMapRef.current)) {\r\n\t\t\tjsonFilesMapRef.current = jsonFilesMap;\r\n\t\t\tonChange && onChange(filesMap);\r\n\t\t}\r\n\t}, [onChange, filesMap]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isEqual(values, prevValues)) {\r\n\t\t\tif (jsonFilesMapRef.current.length === 0 && values) {\r\n\t\t\t\t// @ts-ignore\r\n\t\t\t\tsetFilesMap(values.map((item) => ({ fileId: item.guid, name: item.name, isLoaded: true })));\r\n\t\t\t} else {\r\n\t\t\t\tsetFilesMap((prevFilesMap) => {\r\n\t\t\t\t\treturn prevFilesMap.filter(({ fileId }) => {\r\n\t\t\t\t\t\tif (!values) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn values.some((val) => val.guid === fileId);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [values]);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{errors}\r\n\r\n\t\t\t\t\t{fileErrors.length > 0 && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{fileErrors.map((error) => (\r\n\t\t\t\t\t\t\t\t removeError(error.fileId)}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{error.message}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{filesMap.length > 0 && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{filesMap.map(({ fileId, file, name, isLoaded }, idx) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { FileUploaderProvider, useFileUploader, useFileUploaderConfig };\r\n","import { FileUploaderItemData } from './types';\r\n\r\nexport function getExtension(filename: string) {\r\n\treturn filename.split('.').pop();\r\n}\r\n\r\nexport function stringifyFilesMap(files: FileUploaderItemData[]) {\r\n\treturn files.map(({ name, fileId, extension }) => {\r\n\t\tconst obj = {\r\n\t\t\tfileId,\r\n\t\t\tname,\r\n\t\t\textension,\r\n\t\t};\r\n\r\n\t\treturn JSON.stringify(obj);\r\n\t});\r\n}\r\n\r\nexport function removeExtension(fileName: string) {\r\n\treturn fileName.replace(/\\.[^/.]+$/, '');\r\n}\r\n"],"names":["FileUploaderInput","forwardRef","_ref","ref","disabled","onChange","name","maxFiles","accept","useFileUploaderConfig","_jsx","className","type","e","files","target","value","tabIndex","multiple","join","FileUploaderItemProgress","progress","onCancel","percentage","_jsxs","children","FlexGrid","gap","center","FlexGridColumn","grow","style","width","noShrink","IconButton","onClick","link","rounded","CloseTiny","FileUploaderTextInput","translate","useTranslationAPI","maxFileNameLength","readOnlyFileName","isInvalidName","length","ControlGroup","valid","validationMessage","codes","required","common","maximumLengthExceeded","TextBoxWithPreview","previewMode","invalid","FileUploaderItemLoaded","onRemove","onNameChange","dataTestId","RecycleBin","FileUploaderItem","enableRequest","isLoaded","url","fileId","file","setFilesMap","onError","onFileUploadSuccess","setProgress","useState","removeFileById","filter","handleRemove","useCallback","useEffect","data","arguments","undefined","config","formData","FormData","Object","keys","forEach","key","append","POST","headers","getDefaultHeaders","upload","onUploadProgress","progressEvent","total","loaded","isUndefined","progressPercent","Math","floor","isCancellable","cancelId","then","_ref2","errorMessage","map","message","setTimeout","catch","_ref3","response","code","documentUploader","uploadingCanceled","abortRequestByCancelId","handleCancel","FileUploaderDescription","maxSize","column","oneFileLimit","nFilesLimit","supportedExtensions","unknown","maxFileSize","FileUploaderDndZone","onDrop","onLeave","localDropZone","dndZoneClasses","cn","classes","onDragLeave","onMouseLeave","onDragOver","preventDefault","Upload","fill","height","uploadFile","dragAndDropFile1","FileUploaderDnd","showDndZone","setShowDndZone","handleDragEnter","document","body","addEventListener","removeEventListener","_Fragment","dragAndDropFile2","handleLeave","dataTransfer","FileUploaderButton","openUploader","setFileUploaderFiles","useFileUploader","Button","primary","startIcon","FolderOpen","size","browse","FileUploaderMessageDanger","onCancelClick","Message","status","hasStatusIcon","onClose","hasCloseButton","Provider","createProvider","contextName","ProviderConfig","FileUploaderProvider","errors","values","filesMap","jsonFilesMapRef","useRef","prevValues","usePrevious","fileErrors","setFileErrors","fileInput","disableUploadFile","maxSizeInBytes","onFileUploadSuccessRef","newFileList","push","error","maxNumberOfFilesExceeded","i","item","uuidv4","some","extension","toLowerCase","includes","emptyFileWarning","fileName","replace","filename","split","pop","prevLoadedFiles","concat","current","click","handleFileItemError","fileError","prevErrors","prevError","prevFiles","prevFile","providerValue","useMemo","providerConfigProps","useComponentDidUpdate","jsonFilesMap","obj","JSON","stringify","isEqual","guid","prevFilesMap","val","removeError","idx"],"sourceRoot":""}