1import z from"./CInsX9Lb.js";import{A as M}from"./YgK08q3j.js";import{d as D,r as f,u as O,f as c,o as a,g as E,c as n,l as t,F as $,q as w,t as e,m as _,j as A,k as V,L as j,M as I,h as N,Q as P,R,J as F}from"./CBlc-w2c.js";import{u as T}from"./D47GR64Z.js";import{u as q}from"./Rwf6RNZQ.js";import"./DlLrAxWE.js";import"./DlAUqK2U.js";const x={key:1},G={class:"table--spacing table--thead-highlight table--tbody-zebra table--grid table--responsive table--justified"},J=["data-label"],Q=["data-label"],Y=["data-label"],H=["data-label"],K=["data-label"],U={class:"my-account__toolbar formkit-buttons"},W=["disabled"],X={key:2},Z=D({__name:"Orders",props:{pageSize:{},showLoadMore:{type:Boolean},scope:{}},setup(v){const d=v,l=f([]),u=f(1),p=f(!1),{fetchOrders:m,loading:b,orders:S,pageInfo:h}=T(),{t:i}=O({useScope:"global"}),r={number:i("Order")+" #",order_date:i("Order date"),order_total:i("Order amount"),status:i("Status"),action:i("Action")},k=async()=>{await m({currentPage:u.value,pageSize:d.pageSize,sort:{sort_direction:"DESC",sort_field:"CREATED_AT"},scope:d.scope}),l.value=[...l.value,...S.value],p.value=h.value?h.value.current_page>=h.value.total_pages:!1},L=async()=>{u.value=u.value+1,await k()};return k(),(o,ot)=>{const B=z,C=F("i18n-n"),y=M;return c(b)?(a(),E(B,{key:0,class:"icon icon--loader"})):c(l).length?(a(),n("div",x,[t("table",G,[t("thead",null,[t("tr",null,[(a(),n($,null,w(r,(s,g)=>t("th",{key:g},[t("span",null,e(s),1)])),64))])]),t("tbody",null,[(a(!0),n($,null,w(c(l),(s,g)=>(a(),n("tr",{key:g},[t("td",{"data-label":`${r.number}`},[t("span",null,e(s.number),1)],8,J),t("td",{"data-label":`${r.order_date}`},[t("span",null,e(o.$d(new Date(s.order_date),"long")),1)],8,Q),t("td",{"data-label":`${r.order_total}`},[_(C,{tag:"span",value:s.total.grand_total.value,format:"currency"},null,8,["value"])],8,Y),t("td",{"data-label":`${r.status}`},[t("span",null,e(s.status),1)],8,H),t("td",{"data-label":`${r.action}`},[_(y,{to:"/account/orders/"+s.number+"/"},{default:A(()=>[t("span",null,e(o.$t("View order")),1)]),_:2},1032,["to"])],8,K)]))),128))])]),t("div",U,[V(o.$slots,"actions",P(R({loading:c(b)})),()=>[c(p)?N("",!0):j((a(),n("button",{key:0,class:"button button--cta",disabled:c(b),onClick:L},[t("span",null,e(o.$t("Show more")),1)],8,W)),[[I,o.showLoadMore]]),_(y,{class:"button button--link button--back",to:"/account/"},{default:A(()=>[t("span",null,e(o.$t("Back")),1)]),_:1})])])])):(a(),n("p",X,e(o.$t("You have placed no orders.")),1))}}}),tt=Object.assign(Z,{__name:"AccountOrders"}),et={class:"my-account__orders"},at=["textContent"],it={__name:"index",setup(v){const{t:d}=O({useScope:"global"}),{setBreadcrumbs:l}=q();return l({label:d("Orders"),parents:[{label:d("Account"),url:"account"}]}),(u,p)=>{const m=tt;return a(),n("div",et,[t("h1",{class:"my-account__title heading heading--1",textContent:e(u.$t("My orders"))},null,8,at),_(m,{"page-size":100,"show-load-more":!1,scope:"GLOBAL"})])}}};export{it as default}; 2//# sourceMappingURL=CkS8hdtA.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.