import{r as t,h as e,g as s,H as i}from"./p-43e8bc5e.js";import{l as r,k as n}from"./p-4f82c566.js";import{L as a}from"./p-2f931022.js";import"./p-e680e7e4.js";import"./p-73aabc9d.js";import"./p-ba041fc5.js";const c=class{constructor(e){t(this,e),this.animate=async()=>{await this.load(),void 0!==this.currentRaf&&cancelAnimationFrame(this.currentRaf),this.shouldAnimate()&&(this.destroy(),this.currentRaf=r((async()=>{this.animationFunction&&this.animationFunction(this.el,this.getColor())})))},this.destroy=()=>{this.animationItem&&this.animationItem.destroy&&this.animationItem.destroy(),this.el.innerHTML=""},this.shouldAnimate=()=>"undefined"!=typeof window&&void 0!==this.animationFunction&&!this.deactivated,this.load=async()=>new Promise(((t,e)=>{if(this.animationFunction)return t();n((async()=>{import("./p-53e09ecb.js").then((e=>{this.animationFunction=e.animate,t()})).catch(e)}))})),this.inverted=!1,this.deactivated=!1,this.color="blue",this.small=!1}createLogger(t){this.log=t}deactivatedWatcher(t,e){t!==e&&(this.deactivated?this.destroy():this.animate())}componentDidLoad(){this.animate()}disconnectedCallback(){this.el&&!this.el.isConnected&&this.destroy()}getColor(){return this.inverted||"white"===this.color?"#ffffff":"#151f6d"}render(){return e(i,{role:"progressbar","aria-hidden":"true",style:{width:this.small?"32px":"64px"}})}get el(){return s(this)}static get watchers(){return{deactivated:["deactivatedWatcher"]}}};(function(t,e,s,i){var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,i);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(a=(n<3?r(a):n>3?r(e,s,a):r(e,s))||a);n>3&&a&&Object.defineProperty(e,s,a)})([a("bal-spinner")],c.prototype,"createLogger",null),c.style="bal-spinner,.bal-spinner{text-align:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-line-pack:center;align-content:center}bal-spinner svg,.bal-spinner svg{-webkit-transform:unset !important;transform:unset !important}";export{c as bal_spinner}