"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require('./../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),o=require("classnames"),i=require("@material-ui/core"),r=require("../FileIcon/FileIcon.js"),c=require("../IconButton/index.js"),n=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 t=require("../../icons/customIcons/icons/CautionFilled.js");require("../../icons/customIcons/icons/MoreApp.js");var a=require("../MiddleTruncatedText/MiddleTruncatedText.js"),l=require("../Typography.js"),u=require("./utils.js"),d=require("./styles.js");function j(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var m=j(o);exports.FilesLoaderV2=function(o){var j=o.formatProgress,q=void 0===j?u.formatSizeProgress:j,x=o.className,I=o.name,g=o.current,h=o.total,p=o.errorText,_=o.onCancel,C=o.onReload,F=o.onDelete,v=d.useStyles(),R=h>=0&&g>=0,T=Math.min(100,Math.ceil(g/h*100)),k=g>=h;return e.jsxs("div",s.__assign({className:m.default(v.root,x)},{children:[e.jsx(r.FileIcon,{name:I,className:v.icon,strokeWidth:2}),e.jsxs("div",s.__assign({className:v.content},{children:[e.jsx(l.Regular14,s.__assign({className:v.name},{children:e.jsx(a.MiddleTruncatedText,{children:I},I)})),!p&&!k&&e.jsxs(e.Fragment,{children:[e.jsx(i.LinearProgress,{className:v.progressBar,variant:R?"determinate":void 0,value:T}),e.jsxs("div",s.__assign({className:v.progressTextContainer},{children:[e.jsx(l.Regular12,s.__assign({className:v.progressText},{children:q(h,g)})),R&&e.jsxs(l.Regular12,s.__assign({className:v.progressText},{children:[T,"%"]}))]}))]}),p&&e.jsxs(l.Regular14,s.__assign({className:v.error},{children:[e.jsx(t.CautionFilledCustomIcon,{size:16}),p]}))]})),_&&!p&&!k&&e.jsx(c,s.__assign({onClick:_,size:"small",tooltipProps:{title:"Cancel"}},{children:e.jsx(n.CloseIcon,{})})),F&&(p||k)&&e.jsx(c,s.__assign({onClick:F,size:"small",tooltipProps:{title:"Remove File"}},{children:e.jsx(n.DeleteFourIcon,{})})),C&&p&&e.jsx(c,s.__assign({onClick:C,size:"small",tooltipProps:{title:"Reload"}},{children:e.jsx(n.RedoIcon,{})}))]}))};
