"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/progress-dialog"],{2001:(e,s,t)=>{t.r(s),t.d(s,{default:()=>d});var r=t(242),n=t(241),o=t(243),a=t.n(o),i=t(90);const l="error",u="running";class c extends n.Component{renderErrors(e,s){if(!Array.isArray(s)||0===s.length)return null;const t=e===l?"danger":"warning";return(0,n.jsx)(r.Alert,{intent:t,"data-type":"errors",children:s.map((e=>(0,n.jsx)("div",{children:e},e)))})}renderStatusText({status:e,progress:s,progressStatus:t}){const o={done:"statusDone",[l]:"statusError",not_started:"statusNotStarted",canceled:"statusCanceled"};return e===u&&t?t:e===u&&-1!==s?(0,n.jsx)(r.Translate,{content:"percentCompleted",params:{percent:s}}):o[e]?(0,n.jsx)(r.Translate,{content:o[e]}):null}render(){const{title:e,steps:s,isOpen:t,onComplete:o,onHide:a,...l}=this.props;return(0,n.jsx)(r.ProgressDialog,{title:(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e}}),actions:a?(0,n.jsx)(r.Button,{"aria-label":i.Locale.getSection("components.tasks.common").lmsg("minimize"),ghost:!0,size:"lg",icon:"minimize",onClick:a}):null,cancelTitle:(0,n.jsx)(r.Translate,{content:"close","data-type":"close-button"}),isOpen:t,onFinish:o,onClose:a,"data-type":"progress-dialog",...l,children:s.map((({title:e,icon:s,status:t,progress:o,progressStatus:a,errors:i=[],output:l=[]})=>{const u=Number(o);return(0,n.jsxs)(r.ProgressStep,{title:e,icon:{src:s},status:t,statusText:this.renderStatusText({status:t,progress:u,progressStatus:a}),progress:u,children:[this.renderErrors(t,i),l.length>0&&(0,n.jsx)(r.ConsoleOutput,{children:l})]},e)}))})}}c.propTypes={title:a().node.isRequired,steps:a().array.isRequired,isOpen:a().bool.isRequired,errors:a().array.isRequired,onComplete:a().func.isRequired,onHide:a().func.isRequired};const d=c},2e3:(e,s,t)=>{t.r(s),t.d(s,{default:()=>a});var r=t(242),n=t(241),o=t(2001);const a=({locale:e,container:s,...t})=>{(0,n.render)((0,n.jsx)(r.LocaleProvider,{messages:e,children:(0,n.jsx)(o.default,{...t})}),s)}}}]);
//# sourceMappingURL=progress-dialog.js.map?d96f14f638c2de45af7d