import{_ as e}from"./vendor-flow-IzlrcDx6.js";import{rn as t}from"./index-HkVQGc9M.js";var n=e(),r={planned:{label:`Planned`,dot:`bg-[var(--color-text-muted)]`,text:`text-[var(--color-text-secondary)]`,bg:`bg-[var(--color-info-bg)]`},dispatched:{label:`On the road`,dot:`bg-[var(--color-warning)]`,text:`text-[var(--color-warning)]`,bg:`bg-[var(--color-warning-bg)]`},completed:{label:`Completed`,dot:`bg-[var(--color-success)]`,text:`text-[var(--color-success)]`,bg:`bg-[var(--color-success-bg)]`},cancelled:{label:`Cancelled`,dot:`bg-[var(--color-error)]`,text:`text-[var(--color-error)]`,bg:`bg-[var(--color-error-bg)]`}},i={planned:r.planned,dispatched:{...r.dispatched,label:`In transit`},delivered:{...r.completed,label:`Delivered`},cancelled:r.cancelled},a={pending:{label:`To dispatch`,dot:`bg-[var(--color-accent)]`,text:`text-[var(--color-accent-ink)]`,bg:`bg-[var(--color-accent-soft)]`},partial:{label:`Partly shipped`,dot:`bg-[var(--color-warning)]`,text:`text-[var(--color-warning)]`,bg:`bg-[var(--color-warning-bg)]`},dispatched:{...r.dispatched,label:`Dispatched`},delivered:r.completed};function o({tone:e,className:r}){return(0,n.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5 text-[11px] font-semibold`,e.bg,e.text,r),children:[(0,n.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,e.dot)}),e.label]})}var s=({status:e})=>(0,n.jsx)(o,{tone:r[e]}),c=({status:e})=>(0,n.jsx)(o,{tone:i[e]}),l=({state:e})=>(0,n.jsx)(o,{tone:a[e]});function u({ordered:e,allocated:r,shipped:i,className:a}){let o=Number(e)||1,s=Math.min(100,Number(i)/o*100),c=Math.min(100-s,Math.max(0,(Number(r)-Number(i))/o*100));return(0,n.jsx)(`div`,{className:t(`h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-border)]`,a),role:`presentation`,children:(0,n.jsxs)(`div`,{className:`flex h-full`,children:[(0,n.jsx)(`div`,{className:`h-full bg-[var(--color-success)]`,style:{width:`${s}%`}}),(0,n.jsx)(`div`,{className:`h-full bg-[var(--color-warning)] opacity-50`,style:{width:`${c}%`}})]})})}export{u as i,l as n,s as r,c as t};