import{defineProperty as a,toConsumableArray as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e,Fragment as s,jsxs as n}from"react/jsx-runtime";import{SIZES as i}from"../../../constants/sizes.js";import{forwardRef as o,useMemo as t}from"react";import l from"classnames";import c from"../PercentageLabel/PercentageLabel.js";import{ProgressBarStyle as m,baseClassName as u}from"./LinearProgressBarConstants.js";import{calculatePercentage as v}from"./LinearProgressBarHelpers.js";import d from"./Bar/Bar.js";import"./LinearProgressBar.scss.js";var b=o((function(o,b){var p=o.min,f=void 0===p?0:p,g=o.max,j=void 0===g?100:g,_=o.value,y=void 0===_?0:_,L=o.valueSecondary,P=void 0===L?0:L,N=o.animated,S=void 0===N||N,h=o.barStyle,x=void 0===h?m.PRIMARY:h,B=o.className,C=o.size,O=void 0===C?i.SMALL:C,z=o.indicateProgress,A=void 0!==z&&z,w=o.multi,E=void 0!==w&&w,H=o.multiValues,M=void 0===H?[]:H,R=o.ariaLabel,I=void 0===R?"":R,V=t((function(){var r="".concat(u,"--wrapper");return l(r,a({},"".concat(r,"__").concat(O),O),B)}),[O,B]),Y=t((function(){if(E){var a=M&&M.length&&M[0].value;return null==a?0:v(a,f,j)}return null==y?0:v(y,f,j)}),[y,f,j,E,M]),k=t((function(){return E?e(s,{children:r(M).reverse().map((function(a,r){var s=a.color;return e(d,{barStyle:m.NONE,value:a.value,animated:S,baseClass:u,color:s,min:f,max:j},"".concat(u,"_").concat(s,"_").concat(r))}))}):null}),[f,j,S,M,E]),q=A?e(c,{forElement:"linear-progress-bar",className:"".concat(u,"__label"),value:Y}):null,D=E?null:n(s,{children:[e(d,{barLabelName:I,barStyle:x,id:"linear-progress-bar",value:P,animated:S,baseClass:"".concat(u,"__secondary"),min:f,max:j}),e(d,{barStyle:x,value:y,animated:S,baseClass:u,min:f,max:j})]});return n("div",Object.assign({className:"main-wrapper"},{children:[e("div",Object.assign({className:V,ref:b},{children:n("div",Object.assign({className:"".concat(u,"__container")},{children:[D,k]}))})),q]}))}));Object.assign(b,{styles:m,barStyles:m,sizes:i});var p=b;export{p as default};
