const e=require("../_util/type.js"),t=require("../node_modules/.pnpm/@ant-design_colors@7.2.1/node_modules/@ant-design/colors/es/presets.js");require("../node_modules/.pnpm/@ant-design_colors@7.2.1/node_modules/@ant-design/colors/es/index.js");const n=require("./props.js"),r=require("./utils.js");let i=require("vue");var a=()=>({...n.progressProps(),strokeColor:e.anyType(),direction:e.stringType()}),o=e=>{let t=[];return Object.keys(e).forEach(n=>{let r=Number.parseFloat(n.replace(/%/g,``));isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((e,t)=>e.key-t.key),t.map(({key:e,value:t})=>`${t} ${e}%`).join(`, `)},s=(e,n)=>{let{from:r=t.presetPrimaryColors.blue,to:i=t.presetPrimaryColors.blue,direction:a=n===`rtl`?`to left`:`to right`,...s}=e;return Object.keys(s).length===0?{backgroundImage:`linear-gradient(${a}, ${r}, ${i})`}:{backgroundImage:`linear-gradient(${a}, ${o(s)})`}},c=(0,i.defineComponent)({compatConfig:{MODE:3},name:`ProgressLine`,inheritAttrs:!1,props:a(),setup(e,{slots:t,attrs:n}){let a=(0,i.computed)(()=>{let{strokeColor:t,direction:n}=e;return t&&typeof t!=`string`?s(t,n):{backgroundColor:t}}),o=(0,i.computed)(()=>e.strokeLinecap===`square`||e.strokeLinecap===`butt`?0:void 0),c=(0,i.computed)(()=>e.trailColor?{backgroundColor:e.trailColor}:void 0),l=(0,i.computed)(()=>e.size??[-1,e.strokeWidth||(e.size===`small`?6:8)]),u=(0,i.computed)(()=>r.getSize(l.value,`line`,{strokeWidth:e.strokeWidth})),d=(0,i.computed)(()=>{let{percent:t}=e;return{width:`${r.validProgress(t)}%`,height:`${u.value.height}px`,borderRadius:o.value,...a.value}}),f=(0,i.computed)(()=>r.getSuccessPercent(e)),p=(0,i.computed)(()=>{let{success:t}=e;return{width:`${r.validProgress(f.value)}%`,height:`${u.value.height}px`,borderRadius:o.value,backgroundColor:t?.strokeColor}}),m={width:u.value.width<0?`100%`:u.value.width,height:`${u.value.height}px`};return()=>(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(`div`,{...n,class:[`${e.prefixCls}-outer`,n.class],style:[n.style,m]},[(0,i.createVNode)(`div`,{class:`${e.prefixCls}-inner`,style:c.value},[(0,i.createVNode)(`div`,{class:`${e.prefixCls}-bg`,style:d.value},null),f.value===void 0?null:(0,i.createVNode)(`div`,{class:`${e.prefixCls}-success-bg`,style:p.value},null)])]),t.default?.()])}});exports.default=c,exports.handleGradient=s,exports.lineProps=a,exports.sortGradient=o;