import{o as g,c as v,a as c,d as h,n as p,_ as b,z as y}from"./index.js";function $(e,t,i,a,o,r){return g(),v("div",{class:p(["circle",{circle_mobile:i.isMobile}])},[c("div",{class:"circle-bar",style:h(r.thinBorderStyles)},null,4),c("div",{class:"percentage-bar",style:h(r.percentageBarStyle)},[c("div",{class:"percentage-bar-first-half",style:h({transform:`rotate(${r.firstHalfRotationDegree})`,borderWidth:r.circleWidth})},null,4),c("div",{class:"percentage-bar-second-half",style:h({transform:`rotate(${r.secondHalfRotationDegree})`,borderWidth:r.circleWidth})},null,4)],4)],2)}const d={DEFAULT:0,THIN:1},u={props:{value:{default:25},size:{default:15},width:{default:1.2},transitionDuration:{default:500},type:{default:d.DEFAULT},isMobile:{default:!1}},data(){return{BAR_TYPE:d,currentValue:this.value}},computed:{circleSize(){return`${this.size}vh`},circleWidth(){return`${this.width}vh`},thinBorderStyles(){const e={width:[1,.5]},t=this.width*e.width[this.type],i=t/2,a=this.size-t;return{borderWidth:`${t}vh`,top:`-${i}vh`,right:`-${i}vh`,bottom:`-${i}vh`,left:`-${i}vh`,...this.type===d.THIN&&{width:`${a}vh`,height:`${a}vh`}}},firstHalfRotationDegree(){return`${this.currentValue*3.6}deg`},secondHalfRotationDegree(){const e=this.currentValue*3.6;return`${Math.min(e,180)}deg`},percentageBarStyle(){const e=this.width/2;return{width:this.circleSize,height:this.circleSize,top:`-${e}vh`,right:`-${e}vh`,bottom:`-${e}vh`,left:`-${e}vh`,...this.currentValue>50&&{clipPath:"inset(0 0 0 0)"}}}},methods:{onValueChange(e,t){this.animationFrame&&cancelAnimationFrame(this.animationFrame);const i=null,a=e>t,o=Math.abs(e-t),r=(s,n)=>{n||(n=s);const l=Math.min(Math.round((s-n)/(this.transitionDuration/100))/100,1);a?this.currentValue=t+o*l:this.currentValue=t+-1*l*o,!(l>=1)&&(this.animationFrame=requestAnimationFrame(_=>r(_,n)))};this.animationFrame=requestAnimationFrame(s=>r(s,i))}},watch:{value(e,t){e!==t&&this.onValueChange(e,t)}}},f=()=>{y(e=>({"9c7b4ec4":e.circleSize,f27e6e6e:e.circleWidth}))},m=u.setup;u.setup=m?(e,t)=>(f(),m(e,t)):f;const S=b(u,[["render",$],["__scopeId","data-v-af49423b"]]);export{S as R};
