const e=require("../_util/props-util/initDefaultProps.js"),t=require("../_util/props-util/index.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/vue-types/index.js"),i=require("../node_modules/.pnpm/throttle-debounce@5.0.2/node_modules/throttle-debounce/esm/index.js"),a=require("./style/index.js");let o=require("vue");var s=()=>({prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:r.default.any,delay:Number,indicator:r.default.any}),c=null;function l(e,t){return!!e&&!!t&&!isNaN(Number(t))}function u(e){let t=e.indicator;c=typeof t==`function`?t:()=>(0,o.createVNode)(t,null,null)}var d=(0,o.defineComponent)({compatConfig:{MODE:3},name:`ASpin`,inheritAttrs:!1,props:e.default(s(),{size:`default`,spinning:!0,wrapperClassName:``}),setup(e,{attrs:r,slots:s}){let{prefixCls:u,size:d,direction:f}=n.default(`spin`,e),[p,m]=a.default(u),h=(0,o.shallowRef)(e.spinning&&!l(e.spinning,e.delay)),g;return(0,o.watch)([()=>e.spinning,()=>e.delay],()=>{g?.cancel(),g=i.debounce(e.delay,()=>{h.value=e.spinning}),g?.()},{immediate:!0,flush:`post`}),(0,o.onBeforeUnmount)(()=>{g?.cancel()}),()=>{let{class:n,...i}=r,{tip:a=s.tip?.()}=e,l=s.default?.(),g={[m.value]:!0,[u.value]:!0,[`${u.value}-sm`]:d.value===`small`,[`${u.value}-lg`]:d.value===`large`,[`${u.value}-spinning`]:h.value,[`${u.value}-show-text`]:!!a,[`${u.value}-rtl`]:f.value===`rtl`,[n]:!!n};function _(n){let r=`${n}-dot`,i=t.getPropsSlot(s,e,`indicator`);return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),(0,o.isVNode)(i)?(0,o.cloneVNode)(i,{class:r}):c&&(0,o.isVNode)(c())?(0,o.cloneVNode)(c(),{class:r}):(0,o.createVNode)(`span`,{class:`${r} ${n}-dot-spin`},[(0,o.createVNode)(`i`,{class:`${n}-dot-item`},null),(0,o.createVNode)(`i`,{class:`${n}-dot-item`},null),(0,o.createVNode)(`i`,{class:`${n}-dot-item`},null),(0,o.createVNode)(`i`,{class:`${n}-dot-item`},null)]))}let v=(0,o.createVNode)(`div`,{...i,class:g,"aria-live":`polite`,"aria-busy":h.value},[_(u.value),a?(0,o.createVNode)(`div`,{class:`${u.value}-text`},[a]):null]);if(l&&t.filterEmpty(l).length){let t={[`${u.value}-container`]:!0,[`${u.value}-blur`]:h.value};return p((0,o.createVNode)(`div`,{class:[`${u.value}-nested-loading`,e.wrapperClassName,m.value]},[h.value&&(0,o.createVNode)(`div`,{key:`loading`},[v]),(0,o.createVNode)(`div`,{class:t,key:`container`},[l])]))}return p(v)}}});exports.default=d,exports.setDefaultIndicator=u,exports.spinProps=s;