1import{_ as _e}from"./Bwpm6LqG.js";import{d as me,af as K,L as he,y as W,ag as ge,k as e,e as a,t as i,D as d,x as _,f as y,F as B,r as J,w,n as V,V as pe,a3 as Q,u as ye,a as fe,au as ve,E as b,B as ke,P as be,H as x,m as X,bq as Ce,ba as we,as as Ne,ai as Le,b as o,q as Oe,l as Me,_ as Te,C as E,R as Se,a7 as R,bn as Ae,ah as De,j as I,aj as Y,a5 as $e,a6 as Pe}from"./CYRhJ6we.js";import{f as He}from"./g0f3n1XG.js";const qe={key:0},Be={key:0,class:"sr-only"},Ve={key:1,class:"order-history"},xe={class:"order-history__header-wrapper"},Ee={key:0,class:"order-history__orders-wrapper"},Re={class:"order__data"},Ie={class:"order__headline"},Ue={class:"order__order-number"},ze={class:"order__products"},Fe={class:"order__items"},je=["onClick"],Ge={class:"order__actions"},Ke=["innerHTML"],We={key:2,class:"order-history__error"},Je={key:3,class:"order-history__more"},Qe={key:2,class:"order-history__error"},Xe={key:3},st=me({__name:"index",async setup(Ye){let m,O;const Z=([m,O]=K(()=>we()),m=await m,O(),m);function ee(){const t=ye(),f=b(10),h=b([]),C=b(!0),D=fe().currentMCS.language,{t:$}=W(),s=b(new Map),{isAuthenticated:c}=Q(),P=ve(),L=b(P.query.page?Number(P.query.page):1),z=b(0),F=X(()=>{const r=L.value*f.value;return z.value>r}),H=b(!1);function ie(){F.value&&(L.value=++L.value)}function ue(r,v,g,k){const{itemId:p,name:u,quantity:T,status:q,netPrice:l,totalDiscount:S,positionNumber:ce,reviewable:de}=r,G={id:p,name:u,reviewable:de,positionNumber:ce,qty:T,status:q||"",price:{amount:l.amount,currencySymbol:l?.currencySymbol??"â¬",stringValue:l?.stringValue||"",discount:S.stringValue,discountAmount:S.amount},url:k.value.get(p)?.url,cancellationStatusInfos:r.cancellationStatusInfos};return Array.isArray(r.images)&&r.images.length&&(G.image={url:r.images[0]?.url||"",alt:v("ih.order.itemLabel",{productName:r.name,orderDate:g}),title:v("ih.order.itemLabel",{productName:r.name,orderDate:g}),rank:0,src:r.images[0]?.url||"",sources:[]}),G}function le(r,v,g,k){const p=[];if(!r.orderList.length)return[];for(const u of r.orderList){if(!u)continue;const T=He(k,u.orderDate),q=u.orderLines.filter(Ne).filter(l=>l.images[0]?.url?.startsWith("https://")&&l.status!=="NAVI"&&l.quantity>0).sort((l,S)=>S.totalPositionNetPrice?.amount-l.totalPositionNetPrice?.amount).map(l=>ue(l,g,T,v));p.push({orderDate:T,orderLines:q,orderNumber:u.orderNumber,status:g(`ih.order.status.${u.status?.toLowerCase()}`),type:g(`ih.order.type.${u.type?.toLowerCase()}`),canBeReturned:u.status?.toLowerCase()==="delivered",isPickup:u.deliveryDetail?.deliveryMode==="PICKUP",paymentMethods:[],paymentAdvices:[]})}return p}async function j(){C.value=!0;const{data:r,error:v}=await t.$apollo.default.query({query:Ce,variables:{paging:{page:L.value,pageSize:f.value}},errorPolicy:"all"});if(v)x.error("[%s] (%s) Check apollo logs to see what went wrong. Error: %s",new Date().toLocaleString(),"loadOrders",v.message),H.value=!0;else if(r.account_loadCustomer){const g=le(r.account_loadCustomer.orders,s,$,D);for(const k of g){const p=h.value.find(u=>u.orderNumber===k.orderNumber);p?p.orderLines=k.orderLines:h.value.push(k)}z.value=r.account_loadCustomer.orders.total,H.value=!1}else x.debug("[%s] (%s) data.account_loadCustomer was empty",new Date().toLocaleString(),"loadOrders"),H.value=!1;C.value=!1}return ke(L,()=>j()),be(()=>{c.value?j():x.error("[%s] (%s) User is not logged in!",new Date().toLocaleString(),"myorders/index.vue")}),{orders:h,isLoading:C,containsMoreOrders:F,loadMore:ie}}const{orders:M,isLoading:A,containsMoreOrders:te,loadMore:se}=ee(),re=he(),{t:n}=W(),oe=X(()=>({title:`${n("ih.account.orders.title")}`,hreflang:[],metaTags:[]})),ae=([m,O]=K(()=>Le()),m=await m,O(),m);ge(oe,ae);function N(t){return $e(`${Pe.ACCOUNT_ORDERS}/${t}`)}function U(t){const f=t?.length||0,h=2;return{items:t?.slice(0,h),itemsLeft:f-h}}function ne(){}return(t,f)=>{const h=_e,C=Te,D=Se,$=De;return e(Z)?(o(),a("div",qe,[e(re).isMobileOrTablet?d("",!0):(o(),a("h2",Be,i(e(n)("ih.account.orders")),1)),e(A)?("useAuthHandler"in t?t.useAuthHandler:e(Q))().isAuthenticated?(o(),a("div",Xe,[y(Y,{overlay:""})])):(o(),a("div",Qe,i(e(n)("ih.order.error")),1)):(o(),a("div",Ve,[_("div",xe,[y(h,{headline:e(n)("ih.account.orders")},null,8,["headline"])]),e(M).length?(o(),a("ol",Ee,[(o(!0),a(B,null,J(e(M),s=>(o(),a("li",{key:s.orderNumber,class:"order"},[y(C,{to:N(s.orderNumber),"aria-label":e(n)("ih.order.details"),class:"order__details-button","data-tracking-id":N(s.orderNumber)+":order__details-button",onClick:f[0]||(f[0]=c=>("useTrackLinkInteraction"in t?t.useTrackLinkInteraction:e(Me))(c))},{default:w(()=>[y(e(Oe),{name:"arrow-right-bold"})]),_:1},8,["to","aria-label","data-tracking-id"]),_("div",Re,[_("div",Ie,i(s.isPickup?e(n)("ih.order.reservation"):s.type)+" "+i(e(n)("ih.order.from"))+" "+i(s.orderDate),1),_("div",Ue,i(e(n)("ih.order.orderNo"))+": "+i(s.orderNumber),1)]),_("div",ze,[_("div",Fe,[y($,null,{default:w(()=>[(o(!0),a(B,null,J(s.orderLines?.slice(0,2),c=>(o(),a(B,{key:c.id},[c.image?(o(),E(D,{key:0,class:"order__items-preview",image:c.image,"scaling-width":e(Ae),onClick:P=>("navigateTo"in t?t.navigateTo:e(R))(N(s.orderNumber))},null,8,["image","scaling-width","onClick"])):d("",!0)],64))),128))]),_:2},1024),U(s.orderLines).itemsLeft>0?(o(),a("div",{key:0,class:"order__items-more",onClick:c=>("navigateTo"in t?t.navigateTo:e(R))(N(s.orderNumber))},[_("span",null,"+ "+i(U(s.orderLines).itemsLeft),1),_("span",null,i(e(n)("ih.global.more")),1)],8,je)):d("",!0)])]),_("div",Ge,[y(e(V),{scheme:"secondary","css-classes":"order__status",onClick:c=>("navigateTo"in t?t.navigateTo:e(R))(N(s.orderNumber))},{default:w(()=>[I(i(s.status),1)]),_:2},1032,["onClick"]),s.canBeReturned?(o(),E(e(V),{key:0,"css-classes":"order__return-button",onClick:ne},{default:w(()=>[I(i(e(n)("ih.order.return")),1)]),_:1})):d("",!0)])]))),128))])):e(M).length?d("",!0):(o(),a("div",{key:1,class:"order-history__empty",innerHTML:e(n)("ih.order.emptyList")},null,8,Ke)),!e(M).length&&!e(A)?(o(),a("div",We,i(e(n)("ih.order.error")),1)):d("",!0),e(te)?(o(),a("div",Je,[y(e(V),{scheme:"secondary","css-classes":"order__status",onClick:e(se)},{default:w(()=>[I(i(e(n)("ih.global.more")),1)]),_:1},8,["onClick"])])):d("",!0),y(e(pe),{name:"fade"},{default:w(()=>[e(A)?(o(),E(Y,{key:0,overlay:""})):d("",!0)]),_:1})]))])):d("",!0)}}});
1export{st as default};
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.