const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DtNTt4xe.js","assets/vendor-d3O24IFR.js","assets/vendor-DXOeSP1F.css","assets/index-DFIbI_X0.css"])))=>i.map(i=>d[i]);
import{F as O,P as n,_ as i,R as t,a1 as l,T as V,Q as c,W as d,a0 as p,X as f,ag as ee,m as o,aM as te,r as m,bU as se,as as B,b as ae,e,a2 as I,a6 as w,a7 as D,az as ie,ad as le,bH as ne}from"./vendor-d3O24IFR.js";import{j as oe,M as N,bd as ce,cb as re,i as ue,f as _e,cc as me,n as A}from"./index-DtNTt4xe.js";import{W as de,_ as pe}from"./wishlist-product-item-skeleton-Cy0mXIUj.js";import{P as he}from"./product-skeleton-grid-C8M93VZf.js";const ge={class:"list-summary__content"},ye={key:0},ve=O({__name:"wishlist-summary",props:{list:{}},setup(h){return(g,L)=>{const b=n("VcPriceDisplay"),y=n("VcWidget");return t(),i(y,{id:"list-summary",class:"list-summary",title:g.$t("common.titles.order_summary")},{default:l(()=>[V("div",ge,[V("span",null,p(g.$t("common.labels.subtotal")),1),h.list.subTotal?(t(),c("span",ye,[f(b,{value:h.list.subTotal},null,8,["value"])])):d("",!0)])]),_:1},8,["title"])}}}),ke={key:0,class:"shared-list__skeleton-mobile"},fe={key:1,class:"shared-list__skeleton-desktop"},Ve={class:"shared-list__items"},be={key:0,class:"shared-list__page-limit"},Ee=O({__name:"shared-list",props:{sharingKey:{}},setup(h){const g=h,L=ie(()=>le(()=>import("./index-DtNTt4xe.js").then(s=>s.dm),__vite__mapDeps([0,1,2,3]))),{getModuleSettings:b}=oe(N.MODULE_ID),{analytics:y}=ce(),{t:U}=ee(),{listLoading:v,list:a,fetchSharedWishList:K}=re(),{cart:x}=ue(),{continue_shopping_link:E}=b({[N.CONTINUE_SHOPPING_LINK]:"continue_shopping_link"}),G=te(ne);_e({title:o(()=>U("pages.account.list_details.meta.title",[a.value?.name]))});const C=o(()=>({item_list_id:"wishlist",item_list_name:`Wishlist "${a.value?.name}"`,related_id:a.value?.id,related_type:"wishlist"})),H=G.smaller("lg"),W=m(),R=m({}),k=m(6),r=m(1),P=m([]),z=o(()=>se(x.value?.items,"sku")),F=o(()=>P.value.map(s=>me(s,z.value[s.sku]?.quantity))),$=o(()=>Math.ceil((P.value.length??0)/k.value)),M=o(()=>F.value.slice((r.value-1)*k.value,r.value*k.value)),S=o(()=>M.value.length||k.value);function X(s){s&&y("selectItem",s,C.value)}return B(async()=>{await K(g.sharingKey),r.value=1,P.value=ae(a.value?.items)??[]}),B(()=>{const s=a.value?.items?.map(u=>u.product).filter(u=>!!u);s?.length&&y("viewItemList",s,C.value)}),(s,u)=>{const j=n("VcTypography"),q=n("VcPagination"),Q=n("VcWidget"),Y=n("VcLayout"),T=n("VcButton"),J=n("VcEmptyView"),Z=n("VcContainer");return t(),i(Z,{class:"shared-list"},{default:l(()=>[e(a)?.name?(t(),i(j,{key:0,tag:"h1",class:"shared-list__name"},{default:l(()=>[I(p(e(a).name),1)]),_:1})):d("",!0),V("div",{ref_key:"listElement",ref:W,class:"shared-list__content"},[e(v)?(t(),c(w,{key:0},[e(H)?(t(),c("div",ke,[(t(!0),c(w,null,D(S.value,_=>(t(),i(e(he),{key:_}))),128))])):(t(),c("div",fe,[(t(!0),c(w,null,D(S.value,_=>(t(),i(e(de),{key:_,class:"shared-list__skeleton-desktop-item"}))),128))]))],64)):!e(v)&&e(a)?.items?.length?(t(),i(Y,{key:1,"sidebar-position":"right","sticky-sidebar":""},{sidebar:l(()=>[f(ve,{list:e(a)},null,8,["list"])]),default:l(()=>[f(Q,{size:"lg"},{default:l(()=>[V("div",Ve,[f(e(pe),{items:M.value,"pending-items":R.value,editable:!1,navigatable:!1,onLinkClick:X},null,8,["items","pending-items"]),r.value>=e(A)?(t(),c("p",be,p(s.$t("ui_kit.reach_limit.page_limit")),1)):d("",!0),$.value>1?(t(),i(q,{key:1,page:r.value,"onUpdate:page":u[0]||(u[0]=_=>r.value=_),pages:Math.min($.value,e(A)),"scroll-target":W.value,"scroll-offset":60},null,8,["page","pages","scroll-target"])):d("",!0)])]),_:1})]),_:1})):!e(v)&&e(a)?.items?.length===0?(t(),i(J,{key:2,text:s.$t("shared.wishlists.list_details.empty_list"),icon:"outline-lists"},{button:l(()=>[e(E)?(t(),i(T,{key:0,"external-link":e(E)},{default:l(()=>[I(p(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(t(),i(T,{key:1,to:"/"},{default:l(()=>[I(p(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1}))]),_:1},8,["text"])):!e(v)&&!e(a)?(t(),i(e(L),{key:3})):d("",!0)],512)]),_:1})}}});export{Ee as default};
//# sourceMappingURL=shared-list-DgY7i28T.js.map
