const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-8PssKxKU.js","assets/vendor-DWvj1jit.js","assets/vendor-DXOeSP1F.css","assets/index-DHwab4jL.css"])))=>i.map(i=>d[i]);
import{F as D,P as l,_ as i,R as s,a1 as n,T as f,Q as M,W as _,a0 as m,X as v,ai as Q,m as o,b8 as T,r,b as Y,e as t,a2 as I,ae as J,ab as Z,bU as tt}from"./vendor-DWvj1jit.js";import{k as et,M as W,bo as st,j as at,h as it,bL as nt,n as B,cj as lt}from"./index-8PssKxKU.js";import{_ as ot,a as ct}from"./wishlist-products-skeleton.vue_vue_type_script_setup_true_lang-BHaG6h1o.js";import"./product-skeleton-grid-D0l_b49G.js";const ut={class:"list-summary__content"},rt={key:0},_t=D({__name:"wishlist-summary",props:{list:{}},setup(p){return(d,b)=>{const k=l("VcPriceDisplay"),h=l("VcWidget");return s(),i(h,{id:"list-summary",class:"list-summary",title:d.$t("common.titles.order_summary")},{default:n(()=>[f("div",ut,[f("span",null,m(d.$t("common.labels.subtotal")),1),p.list.subTotal?(s(),M("span",rt,[v(k,{value:p.list.subTotal},null,8,["value"])])):_("",!0)])]),_:1},8,["title"])}}}),mt={class:"shared-list__items"},pt={key:0,class:"shared-list__page-limit"},vt=D({__name:"shared-list",props:{sharingKey:{}},setup(p){const d=p,b=J(()=>Z(()=>import("./index-8PssKxKU.js").then(e=>e.dA),__vite__mapDeps([0,1,2,3]))),{getModuleSettings:k}=et(W.MODULE_ID),{analytics:h}=st(),{t:N}=Q(),{listLoading:g,list:a,fetchSharedWishList:S}=nt(),{cart:A}=at(),{continue_shopping_link:P}=k({[W.CONTINUE_SHOPPING_LINK]:"continue_shopping_link"});it({title:o(()=>N("pages.account.list_details.meta.title",[a.value?.name]))});const L=o(()=>({item_list_id:"wishlist",item_list_name:`Wishlist "${a.value?.name}"`,related_id:a.value?.id,related_type:"wishlist"})),w=r(),O=r({}),y=r(6),c=r(1),V=r([]),U=o(()=>tt(A.value?.items,"sku")),K=o(()=>V.value.map(e=>lt(e,U.value[e.sku]?.quantity))),E=o(()=>Math.ceil((V.value.length??0)/y.value)),C=o(()=>K.value.slice((c.value-1)*y.value,c.value*y.value)),x=o(()=>C.value.length||y.value);function R(e){e&&h("selectItem",e,L.value)}return T(async()=>{await S(d.sharingKey),c.value=1,V.value=Y(a.value?.items)??[]}),T(()=>{const e=a.value?.items?.map(u=>u.product).filter(u=>!!u);e?.length&&h("viewItemList",e,L.value)}),(e,u)=>{const j=l("VcTypography"),G=l("VcPagination"),H=l("VcWidget"),X=l("VcLayout"),$=l("VcButton"),q=l("VcEmptyView"),z=l("VcContainer");return s(),i(z,{class:"shared-list"},{default:n(()=>[t(a)?.name?(s(),i(j,{key:0,tag:"h1",class:"shared-list__name"},{default:n(()=>[I(m(t(a).name),1)]),_:1})):_("",!0),f("div",{ref_key:"listElement",ref:w,class:"shared-list__content"},[t(g)?(s(),i(t(ot),{key:0,itemsCount:x.value},null,8,["itemsCount"])):!t(g)&&t(a)?.items?.length?(s(),i(X,{key:1,"sidebar-position":"right",sticky:""},{sidebar:n(()=>[v(t(_t),{list:t(a)},null,8,["list"])]),default:n(()=>[v(H,{size:"lg"},{default:n(()=>[f("div",mt,[v(t(ct),{items:C.value,"pending-items":O.value,editable:!1,navigatable:!1,onLinkClick:R},null,8,["items","pending-items"]),c.value>=t(B)?(s(),M("p",pt,m(e.$t("ui_kit.reach_limit.page_limit")),1)):_("",!0),E.value>1?(s(),i(G,{key:1,page:c.value,"onUpdate:page":u[0]||(u[0]=F=>c.value=F),pages:Math.min(E.value,t(B)),"scroll-target":w.value,"scroll-offset":60},null,8,["page","pages","scroll-target"])):_("",!0)])]),_:1})]),_:1})):!t(g)&&t(a)?.items?.length===0?(s(),i(q,{key:2,text:e.$t("shared.wishlists.list_details.empty_list"),icon:"outline-lists"},{button:n(()=>[t(P)?(s(),i($,{key:0,"external-link":t(P)},{default:n(()=>[I(m(e.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(s(),i($,{key:1,to:"/"},{default:n(()=>[I(m(e.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1}))]),_:1},8,["text"])):!t(g)&&!t(a)?(s(),i(t(b),{key:3})):_("",!0)],512)]),_:1})}}});export{vt as default};
//# sourceMappingURL=shared-list-Bh-4NbF3.js.map
