import{bd as S,be as v,bf as h,bg as $,aX as B,bh as U,g as z,ab as F,bi as M,az as A,L as D,x as w,bj as j,bk as q,a7 as g,v as G,aq as J,ac as n,aE as L,af as W,a as X,a6 as k,J as y,C as H,e as c}from"./index-CTxlYqj4.js";import{d as K,u as Q,m as Y,a as Z}from"./tag-Dx3OexMp.js";function N(e){return S(()=>{const s=v(e),a=[],t={};if(s.background)if(h(s.background)){if(t.backgroundColor=s.background,!s.text&&$(s.background)){const r=B(s.background);if(r.a==null||r.a===1){const o=U(r);t.color=o,t.caretColor=o}}}else a.push(`bg-${s.background}`);return s.text&&(h(s.text)?(t.color=s.text,t.caretColor=s.text):a.push(`text-${s.text}`)),{colorClasses:a,colorStyles:t}})}function x(e){const{colorClasses:s,colorStyles:a}=N(()=>({text:v(e)}));return{textColorClasses:s,textColorStyles:a}}function ne(e){const{colorClasses:s,colorStyles:a}=N(()=>({background:v(e)}));return{backgroundColorClasses:s,backgroundColorStyles:a}}function ee(e,s){const a=z(),t=F(!1);if(M){const r=new IntersectionObserver(o=>{t.value=!!o.find(l=>l.isIntersecting)},s);A(()=>{r.disconnect()}),D(a,(o,l)=>{l&&(r.unobserve(l),t.value=!1),o&&r.observe(o)},{flush:"post"})}return{intersectionRef:a,isIntersecting:t}}const se=["x-small","small","default","large","x-large"],ae=w({size:{type:[String,Number],default:"default"}},"size");function te(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j();return S(()=>{const a=e.size;let t,r;return q(se,a)?t=`${s}--size-${a}`:a&&(r={width:g(a),height:g(a)}),{sizeClasses:t,sizeStyles:r}})}const re=w({bgColor:String,color:String,indeterminate:[Boolean,String],modelValue:{type:[Number,String],default:0},rotate:{type:[Number,String],default:0},width:{type:[Number,String],default:4},...Z(),...ae(),...Y({tag:"div"}),...H()},"VProgressCircular"),ce=G()({name:"VProgressCircular",props:re(),setup(e,s){let{slots:a}=s;const t=20,r=2*Math.PI*t,o=z(),{themeClasses:l}=J(e),{sizeClasses:p,sizeStyles:f}=te(e),{textColorClasses:P,textColorStyles:R}=x(()=>e.color),{textColorClasses:I,textColorStyles:T}=x(()=>e.bgColor),{intersectionRef:_,isIntersecting:V}=ee(),{resizeRef:E,contentRect:C}=K(),u=n(()=>L(parseFloat(e.modelValue),0,100)),i=n(()=>Number(e.width)),m=n(()=>f.value?Number(e.size):C.value?C.value.width:Math.max(i.value,32)),d=n(()=>t/(1-i.value/m.value)*2),b=n(()=>i.value/m.value*d.value),O=n(()=>g((100-u.value)/100*r));return W(()=>{_.value=o.value,E.value=o.value}),Q(()=>X(e.tag,{ref:o,class:y(["v-progress-circular",{"v-progress-circular--indeterminate":!!e.indeterminate,"v-progress-circular--visible":V.value,"v-progress-circular--disable-shrink":e.indeterminate==="disable-shrink"},l.value,p.value,P.value,e.class]),style:k([f.value,R.value,e.style]),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":e.indeterminate?void 0:u.value},{default:()=>[c("svg",{style:{transform:`rotate(calc(-90deg + ${Number(e.rotate)}deg))`},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${d.value} ${d.value}`},[c("circle",{class:y(["v-progress-circular__underlay",I.value]),style:k(T.value),fill:"transparent",cx:"50%",cy:"50%",r:t,"stroke-width":b.value,"stroke-dasharray":r,"stroke-dashoffset":0},null),c("circle",{class:"v-progress-circular__overlay",fill:"transparent",cx:"50%",cy:"50%",r:t,"stroke-width":b.value,"stroke-dasharray":r,"stroke-dashoffset":O.value},null)]),a.default&&c("div",{class:"v-progress-circular__content"},[a.default({value:u.value})])]})),{}}});export{ce as V,x as a,N as b,te as c,ee as d,ae as m,ne as u};
