"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("classnames"),t=require("react"),n=require("./LoaderLinear.scss.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(r),u={small:n.small,medium:n.medium},s={primary:n.primary,fancy:n.fancy};exports.LoaderLinear=function(r){var a=r.value,m=r.testId,c=r.className,o=r.size,d=void 0===o?"medium":o,l=r.type,f=void 0===l?"primary":l,v=(a||0===a)&&Number.isFinite(a),y=v?Math.min(100,Math.max(0,a)):0,p=t.useRef(null),j=t.useRef(0);return t.useEffect((function(){var e=p.current;if(!v&&e){var r=function(){j.current+=1,j.current>=5&&(j.current=0,requestAnimationFrame((function(){e.style.animation="none",requestAnimationFrame((function(){e.style.animation=null}))})))};return e.addEventListener("animationend",r),function(){return e.removeEventListener("animationend",r)}}}),[v]),e.jsx("div",{className:i.default(n.root,u[d],s[f],c),"data-testid":m,children:e.jsx("div",{className:i.default(n.bar,v?n.determinate:n.indeterminate),style:{"--percent":"".concat(y,"%")},ref:p})})};
//# sourceMappingURL=LoaderLinear.js.map
