import{C as e,T as t,c as n,ft as r,l as i,o as a,r as o,s,u as c,ut as l}from"./runtime-core.esm-bundler-DTXUv7Wx.js";import{o as u}from"./vue-router-Cyqru1db.js";import{t as d}from"./Icon-CtR1FGIT.js";var f=[`aria-label`],p={class:`flex items-center gap-2 sm:gap-3`},m={class:`flex items-center gap-2 sm:gap-3 shrink-0`},h=[`disabled`,`aria-current`,`onClick`],g={key:1},_={__name:`CheckoutStepper`,props:{steps:{type:Array,required:!0},activeKey:{type:String,required:!0}},setup(_){let v=_,y=u(),b=a(()=>{let e=v.steps.findIndex(e=>e.key===v.activeKey);return v.steps.map((t,n)=>{let r=n<e?`completed`:n===e?`active`:`upcoming`,i=r===`completed`||r===`upcoming`&&t.completed;return{...t,index:n,state:r,navigable:i}})});function x(e){!e.navigable||e.state===`active`||y.push(e.to)}return(a,u)=>(e(),c(`nav`,{"aria-label":a.$attrs[`aria-label`]||`Checkout progress`},[s(`ol`,p,[(e(!0),c(o,null,t(b.value,(t,a)=>(e(),c(o,{key:t.key},[s(`li`,m,[s(`button`,{type:`button`,disabled:!t.navigable&&t.state!==`active`,"aria-current":t.state===`active`?`step`:void 0,class:l([`group inline-flex items-center gap-2 sm:gap-2.5 transition-colors duration-base focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-brand rounded-sm`,t.navigable||t.state===`active`?`cursor-pointer`:`cursor-not-allowed`]),onClick:e=>x(t)},[s(`span`,{class:l([`inline-flex items-center justify-center w-7 h-7 rounded-full text-[12px] font-bold tabular-nums transition-colors duration-base`,t.state===`active`&&`bg-brand text-cream`,t.state===`completed`&&`bg-brand text-cream group-hover:bg-brand-hover`,t.state===`upcoming`&&`bg-transparent text-muted border border-line`,t.state===`upcoming`&&t.navigable&&`group-hover:border-brand group-hover:text-brand`])},[t.state===`completed`?(e(),n(d,{key:0,name:`check`,size:13,"stroke-width":2.6})):(e(),c(`span`,g,r(t.index+1),1))],2),s(`span`,{class:l([`hidden md:inline whitespace-nowrap text-[13px] tracking-label transition-colors duration-base`,t.state===`active`&&`text-brand font-semibold`,t.state===`completed`&&`text-brand font-medium`,t.state===`upcoming`&&`text-muted font-medium`,t.state===`upcoming`&&t.navigable&&`group-hover:text-brand`])},r(t.label),3)],10,h)]),a<b.value.length-1?(e(),c(`li`,{key:0,"aria-hidden":`true`,class:l([`h-px w-6 sm:w-10 md:w-12 transition-colors duration-base shrink-0`,a<b.value.findIndex(e=>e.key===_.activeKey)?`bg-brand`:`bg-line`])},null,2)):i(``,!0)],64))),128))])],8,f))}};export{_ as t};