import{r,h as a,H as e,g as s}from"./p-976cb30b.js";import{B as t}from"./p-ae86d0a0.js";import{b as o}from"./p-2de6aa8f.js";import{L as i}from"./p-e0973c11.js";import"./p-28b0e0a8.js";import"./p-e680e7e4.js";import"./p-73aabc9d.js";import"./p-ba041fc5.js";import"./p-da187899.js";import"./p-ab217a42.js";import"./p-7c679dda.js";const n=class{constructor(a){r(this,a),this.animated=!0,this.isTouch=o.isTouch,this.value=0,this.background="white"}componentDidRender(){this.updateProgress()}breakpointListener(r){this.updateProgress()}async configChanged(r){this.animated=r.animated}updateProgress(){if(this.lineEl){const r=this.el.clientWidth,a=Math.max(0,Math.min(100,this.value));this.lineEl.style.width=r/100*a+"px",100===a?this.lineEl.classList.add("bal-progress-bar__line--full"):this.lineEl.classList.remove("bal-progress-bar__line--full")}}render(){const r=t.block("progress-bar"),s=r.element("line");return a(e,{class:Object.assign(Object.assign({},r.class()),r.modifier(`background-${this.background}`).class())},a("div",{class:Object.assign(Object.assign({},s.class()),s.modifier("animated").class(this.animated)),ref:r=>this.lineEl=r}))}get el(){return s(this)}};(function(r,a,e,s){var t,o=arguments.length,i=o<3?a:null===s?s=Object.getOwnPropertyDescriptor(a,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,a,e,s);else for(var n=r.length-1;n>=0;n--)(t=r[n])&&(i=(o<3?t(i):o>3?t(a,e,i):t(a,e))||i);o>3&&i&&Object.defineProperty(a,e,i)})([i()],n.prototype,"breakpointListener",null),n.style=":root{--bal-progress-bar-background-white:var(--bal-color-white);--bal-progress-bar-background-grey:var(--bal-color-grey-3);--bal-progress-bar-line-background:var(--bal-color-primary);--bal-progress-bar-line-radius:var(--bal-radius-rounded)}.bal-progress-bar{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;width:100%;min-width:0;height:.25rem}.bal-progress-bar--background-white{background:var(--bal-progress-bar-background-white)}.bal-progress-bar--background-grey{background:var(--bal-progress-bar-background-grey)}.bal-progress-bar__line{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;height:.25rem;width:0;background:var(--bal-progress-bar-line-background);border-top-right-radius:var(--bal-progress-bar-line-radius);border-bottom-right-radius:var(--bal-progress-bar-line-radius)}.bal-progress-bar__line--animated{will-change:width;-webkit-transition:all var(--bal-animation-transition-duration) var(--bal-animation-transition-easing);transition:all var(--bal-animation-transition-duration) var(--bal-animation-transition-easing)}.bal-progress-bar__line--full{border-top-right-radius:0;border-bottom-right-radius:0}";export{n as bal_progress_bar}