"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require('./../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),o=require("react-dropzone"),i=require("classnames"),r=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js");var n=require("../../icons/customIcons/icons/CautionFilled.js");require("../../icons/customIcons/icons/MoreApp.js");var c=require("../Typography.js"),t=require("../Button/components/Button/index.js");require("moment-timezone"),require("@material-ui/core"),require("../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../Button/components/LiveButton/styles.js");var u=require("./styles.js"),a=require("./utils.js");function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var m=l(i);exports.FilesDropzone=function(i){var l=i.multiple,d=i.children,j=i.accept,p=i.onDrop,q=i.className,I=i.maxFiles,x=i.maxSize,h=i.errorText,g=i.disabled,_=u.useStyles(),v=a.parseAccept(j),b=v.mimetypes,f=v.extensions,F=b.length||f.length?s.__assign({"*/*":f},Object.fromEntries(b.map((function(s){return[s,[]]})))):void 0,C=a.formatDescription(f,x),y=o.useDropzone({onDrop:p,multiple:l,accept:F,maxFiles:I,maxSize:x,disabled:g}),z=y.getRootProps,D=y.getInputProps,B=y.isDragActive;return e.jsxs("div",s.__assign({className:q},{children:[e.jsxs("div",s.__assign({},z(),{className:m.default(_.root,g&&_.disabled,B&&_.active)},{children:[e.jsx("input",s.__assign({},D())),d||e.jsxs(e.Fragment,{children:[e.jsx(r.FileAdditionOne,{size:24,className:_.icon}),e.jsx(c.Regular14,{children:"Drag & Drop your file here or"}),e.jsx(t,s.__assign({variation:"tertiary",size:"small",disabled:g,className:_.uploadButton},{children:"Choose file"}))]})]})),!h&&C&&e.jsx(c.Regular14,s.__assign({className:m.default(_.description,g&&_.disabled)},{children:C})),h&&e.jsxs(c.Regular14,s.__assign({className:_.error},{children:[e.jsx(n.CautionFilledCustomIcon,{size:20}),h]}))]}))};
