import{v as I,o as x,U as V,a as B,m as D,A as T,c as $}from"./index-w-dkzpPh.js";import{aF as A,B as z,a7 as E,a6 as F,H as U,aI as M,g as j,p as q,D as G,t as c,aC as H,j as J,aa as K,m as L,c as Q,n as _,a as y,b as g}from"./index-DPl16C00.js";function X(t){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const r=A(),o=z();if(E){const s=new ResizeObserver(e=>{t==null||t(e,s),e.length&&(u==="content"?o.value=e[0].contentRect:o.value=e[0].target.getBoundingClientRect())});F(()=>{s.disconnect()}),U(()=>r.el,(e,a)=>{a&&(s.unobserve(a),o.value=void 0),e&&s.observe(e)},{flush:"post"})}return{resizeRef:r,contentRect:M(o)}}const Y=q({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},...$(),...T(),...D({tag:"div"}),...L()},"VProgressCircular"),ee=j()({name:"VProgressCircular",props:Y(),setup(t,u){let{slots:r}=u;const o=20,s=2*Math.PI*o,e=z(),{themeClasses:a}=G(t),{sizeClasses:n,sizeStyles:l}=I(t),{textColorClasses:i,textColorStyles:f}=x(()=>t.color),{textColorClasses:v,textColorStyles:d}=x(()=>t.bgColor),{intersectionRef:m,isIntersecting:N}=V(),{resizeRef:O,contentRect:w}=X(),h=c(()=>H(parseFloat(t.modelValue),0,100)),R=c(()=>Number(t.width)),S=c(()=>l.value?Number(t.size):w.value?w.value.width:Math.max(R.value,32)),p=c(()=>o/(1-R.value/S.value)*2),P=c(()=>R.value/S.value*p.value),W=c(()=>J((100-h.value)/100*s));return K(()=>{m.value=e.value,O.value=e.value}),B(()=>Q(t.tag,{ref:e,class:y(["v-progress-circular",{"v-progress-circular--indeterminate":!!t.indeterminate,"v-progress-circular--visible":N.value,"v-progress-circular--disable-shrink":t.indeterminate==="disable-shrink"},a.value,n.value,i.value,t.class]),style:_([l.value,f.value,t.style]),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":t.indeterminate?void 0:h.value},{default:()=>[g("svg",{style:{transform:`rotate(calc(-90deg + ${Number(t.rotate)}deg))`},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${p.value} ${p.value}`},[g("circle",{class:y(["v-progress-circular__underlay",v.value]),style:_(d.value),fill:"transparent",cx:"50%",cy:"50%",r:o,"stroke-width":P.value,"stroke-dasharray":s,"stroke-dashoffset":0},null),g("circle",{class:"v-progress-circular__overlay",fill:"transparent",cx:"50%",cy:"50%",r:o,"stroke-width":P.value,"stroke-dasharray":s,"stroke-dashoffset":W.value},null)]),r.default&&g("div",{class:"v-progress-circular__content"},[r.default({value:h.value})])]})),{}}}),C=Symbol("Forwarded refs");function b(t,u){let r=t;for(;r;){const o=Reflect.getOwnPropertyDescriptor(r,u);if(o)return o;r=Object.getPrototypeOf(r)}}function te(t){for(var u=arguments.length,r=new Array(u>1?u-1:0),o=1;o<u;o++)r[o-1]=arguments[o];return t[C]=r,new Proxy(t,{get(s,e){if(Reflect.has(s,e))return Reflect.get(s,e);if(!(typeof e=="symbol"||e.startsWith("$")||e.startsWith("__"))){for(const a of r)if(a.value&&Reflect.has(a.value,e)){const n=Reflect.get(a.value,e);return typeof n=="function"?n.bind(a.value):n}}},has(s,e){if(Reflect.has(s,e))return!0;if(typeof e=="symbol"||e.startsWith("$")||e.startsWith("__"))return!1;for(const a of r)if(a.value&&Reflect.has(a.value,e))return!0;return!1},set(s,e,a){if(Reflect.has(s,e))return Reflect.set(s,e,a);if(typeof e=="symbol"||e.startsWith("$")||e.startsWith("__"))return!1;for(const n of r)if(n.value&&Reflect.has(n.value,e))return Reflect.set(n.value,e,a);return!1},getOwnPropertyDescriptor(s,e){var n;const a=Reflect.getOwnPropertyDescriptor(s,e);if(a)return a;if(!(typeof e=="symbol"||e.startsWith("$")||e.startsWith("__"))){for(const l of r){if(!l.value)continue;const i=b(l.value,e)??("_"in l.value?b((n=l.value._)==null?void 0:n.setupState,e):void 0);if(i)return i}for(const l of r){const i=l.value&&l.value[C];if(!i)continue;const f=i.slice();for(;f.length;){const v=f.shift(),d=b(v.value,e);if(d)return d;const m=v.value&&v.value[C];m&&f.push(...m)}}}}})}export{ee as V,te as f,X as u};
