PageSourceSearch

https://auchan.hu/_nuxt/3pqezxyr.js

js auchan.hu collected 2026-09-24 11:24:43 UTC 28,251 bytes, 9 lines download raw bytes

1/*! @copyright
2Copyright LogiNet Systems Informatikai és Fejlesztő Korlátolt Felelősségű Társaság (since 2008)
3Hungary, 1221 Budapest, Vihar utca 5. D. ép. 4. em. 15.
4Tax number: 14461862-2-43 (HU14461862)
5Registration number: 01-09-904847
6[email protected]
7https://www.loginet.hu/ */
8import{_ as j,a7 as z,a_ as Y,a2 as _,P as G,b5 as Q,g as b,ar as $,aZ as J,cB as x,cC as tt,b2 as et,r as c,o as l,c as d,b as p,D as L,H as n,a as h,Z as H,aj as K,ak as st,t as ot,E as k,eL as U,eM as O,eN as W,ab as I,eO as M,bj as D,eP as y,m as B,cF as it,cG as at,d3 as nt,k as X,I as S,a0 as N,a1 as q,B as E,ah as A,w as T,v as F,ds as rt,eQ as R,eR as lt,as as pt}from"./lu45j4xl.js";import{L as dt}from"./mzdl7acn.js";import"./nx2xaosv.js";import{a as ut,A as ht}from"./d9vwlwb3.js";import{A as ct}from"./nt2cs0cq.js";import{A as mt}from"./hcy0cfim.js";import"./c3az9eao.js";const gt="Dci2Vxci",ft="EadhGzbW",wt="_3Tl4Zmc5",St="snggPcOg",vt="BwecM9wG",Lt={awProductCardPlaceholder:gt,addNewShoppingListmodal:ft,addNewShoppingListInputWrapper:wt,addNewShoppingListtooltip:St,addNewShoppingListInput:vt},yt={name:"AwAddNewShoppingListForm",components:{AwFormButtonVersion2:ut,AwForm:Y,AwFormRowVersion2:ct,LvIcon:z},props:{displayType:{type:String,required:!0,validator:t=>["modal","tooltip"].includes(t)}},emits:["close-add-new-shopping-list-form"],setup:()=>({v$:et()}),validations(){return{newShoppingListName:{model:{required:J,maxLength:tt(50),minLength:x(2)}}}},data(){return{newShoppingListName:{version2:!0,model:"",type:"text",name:"newShoppingListName",label:"",labelAttrs:{for:"newShoppingListName"},widgetAttrs:{id:"newShoppingListName"},tokens:{maxLength:"aw.common.favourite.validation.max_length",minLength:"aw.common.favourite.validation.min_length"}}}},methods:{showCallback(){$(()=>{this.v$.$reset(),$(()=>{this.v$.$reset(),this.$refs.nameFormRow.$el.querySelector("[data-input-block]").focus()})})},closeAddNewShoppingListForm(){this.$emit("close-add-new-shopping-list-form"),this.newShoppingListName.model="",this.v$.$reset()},async addNewBasketList(){const t=G();try{t.startLoading({id:"add-to-saved-basket-modal"}),await this.$api.post("/me/shopping_lists",{name:this.newShoppingListName.model}),this.apiError=!1,await this.initShoppingListNames(),this.v$.$reset(),this.newShoppingListName.model="",this.$emit("close-add-new-shopping-list-form")}catch(e){this.apiError=Q(b(),e)}finally{t.endLoading({id:"add-to-saved-basket-modal"}),$(()=>{$(()=>{this.$refs.addNewShoppingListButton.$el.focus()})})}},async initShoppingListNames(){await _().fetchShoppingListNames()}}};function It(t,e,o,u,s,i){const a=c("lv-icon"),r=c("aw-form-row-version2"),g=c("aw-form-button-version2"),v=c("aw-form");return l(),d("div",{class:n(t.$style[`addNewShoppingList${o.displayType}`])},[p(v,{modelValue:t.v$,"onUpdate:modelValue":e[4]||(e[4]=f=>t.v$=f),class:n(t.$style.addNewShoppingListInputWrapper),onOnSubmit:i.addNewBasketList},{default:L(()=>[p(r,{ref:"nameFormRow",modelValue:s.newShoppingListName,"onUpdate:modelValue":e[2]||(e[2]=f=>s.newShoppingListName=f),class:n(t.$style.addNewShoppingListInput)},{postfix:L(()=>[h("button",{class:"buttonReset",onClick:e[0]||(e[0]=(...f)=>i.closeAddNewShoppingListForm&&i.closeAddNewShoppingListForm(...f)),onFocus:e[1]||(e[1]=f=>t.v$.$reset())},[p(a,{name:"delete-16",size:16,style:{"vertical-align":"unset"}})],32)]),_:1},8,["modelValue","class"]),p(g,{modelValue:t.v$,"onUpdate:modelValue":e[3]||(e[3]=f=>t.v$=f),styling:"small-primary-dark-just-icon","loading-id":"add-to-saved-basket-modal"},{default:L(()=>[p(a,{name:"check-circle-version2-16",size:16,style:{"vertical-align":"unset"}})]),_:1},8,["modelValue"])]),_:1},8,["modelValue","class","onOnSubmit"])],2)}const Nt={$style:Lt},Z=j(yt,[["render",It],["__cssModules",Nt]]),bt="I6Usi4Pg",_t="IK0CNyRq",kt="_3H4AUL5C",Mt="Z0Db18fT",At="_8IgffCkY",Tt="ZVGj975p",Ft="hN6cGsRT",Ct="jXrQbt9p",$t="GjzIraht",Dt="B1IciNvl",Bt="rlizzzC0",Pt="_0AMi508w",qt="ogDDHU9W",Et="_9euhX6ky",Vt="JgClY9m-",Rt="aDCet8X0",Ut="LXIJCzqu",Ot="-f-WTZNE",Wt={awProductCardPlaceholder:bt,product:_t,productImage:kt,productImageWrapper:Mt,productName:At,shoppingListItem:Tt,addNewShoppingListButton:Ft,addSh
8oppingListButton:Ct,addShoppingListButtonWrapper:$t,removeFromListTitle:Dt,removeFromList:Bt,removeFromListItem:Pt,removeFromListItemIcon:qt,emptyList:Et,productsImageContainer:Vt,productsImageContainerWrapper:Rt,productsImageItem:Ut,productsImageItemPlaceholder:Ot},jt={name:"AwAddToSavedBasketModalVersion2",components:{AwAddNewShoppingListForm:Z,LvImage:ot,AwSeparator:st,LvIcon:z,LvButton:K,AwCheckboxVersion2:H,AwModal:ht,AwCheckoutCartItemImage:mt},props:{modalType:{type:String,required:!0},selectedValue:{type:String,required:!0},count:{type:Number,required:!0},analyticsFavouriteGroupType:{type:Object,required:!0,validator:t=>t&&typeof t=="object"&&("checkoutType"in t||"variantId"in t)},shoppingListData:{type:Array,default:()=>[]},productName:{type:String,required:!0},productImage:{type:Array,required:!0},showRemovedFromList:{type:Boolean,required:!0},productId:{type:Number,required:!0},productData:{type:Object,required:!0},variantId:{type:Number,required:!0},isMultiple:{type:Boolean,default:!1},products:{type:Array,required:!1,default:()=>[]}},emits:["modal-close"],data(){return{LV_IMG_TYPE_VARIANT:nt,localShoppingListData:[],showAddNewShoppingListForm:!1,abstract77:at,abstract77Webp:it}},computed:{...B(k,{modal:t=>t.activeGenericModal}),...B(_,{shoppingLists:t=>t.shoppingListNames}),defaultShoppingListId(){return this.mappedShoppingLists.find(t=>t.default)?.id},mappedShoppingLists(){return this.shoppingLists?.map(t=>({id:t.id,name:t.listType===y.FAVOURITE?this.$awt("aw.profile.saved_baskets.default_list.title"):t.name,default:t.listType===y.FAVOURITE,isOkauchan:t.listType===y.OKAUCHAN,isSelected:this.localShoppingListData.some(e=>String(e)===String(t.id))}))??[]},sortedShoppingLists(){return[...this.mappedShoppingLists??[]].sort(({default:t,isSelected:e,name:o,isOkauchan:u},{default:s,isSelected:i,name:a,isOkauchan:r})=>s-t||r-u||i-e||o.localeCompare(a))},selectedShoppingLists(){return this.mappedShoppingLists.filter(t=>t.isSelected)},opened(){return this.modal.type===this.modalType},productIds(){return this.isMultiple?this.products.map(t=>t.variant.productId):[this.productId]},productsImages(){const t=this.products.slice(0,3);return this.products.length>3&&t.push({isPlaceholder:!0,placeholderText:`+${this.products.length-3}`}),t},modalTitle(){return this.isMultiple?this.$awt("aw.common.favourite.mobile_modal.multiple_title"):this.showRemovedFromList?this.$awt("aw.common.favourite.mobile_modal.remove_title"):this.$awt("aw.common.favourite.mobile_modal.title")}},watch:{opened(){this.localShoppingListData=this.isMultiple?this.calculateMultipleProductsShoppingListData():[...this.shoppingListData]},shoppingListData:{handler(t){this.localShoppingListData=t},deep:!0}},methods:{calculateMultipleProductsShoppingListData(){return this.products.map(t=>t.variant.shoppingListsContain).reduce((t,e)=>[...e])},showAddNewShoppingListFormCallback(){this.showAddNewShoppingListForm=!0,this.$refs.addNewShoppingListForm.showCallback()},async removeFromList(t){const e=D();let o=!1,u=[];this.isMultiple?u=this.products.map(s=>({objectId:s.variant.id+"",quantity:0})):u=[{objectId:this.variantId+"",quantity:{quantity:0}}],await this.$api.$put(`/me/shopping_lists/${t}/product_variants`,{items:u}).catch(s=>{s?.response?.status===400?(s.response.data.errors=[{...s.response.data,message:"",hideErrorMsg:!0}],I({nuxtApp:b(),error:s,closable:!1,forceModal:!0})):I({nuxtApp:b(),error:s}),o=!0,this.$logger.error(s)}),o||(this.localShoppingListData=this.localShoppingListData.filter(s=>s!==t),await e.fetchUnCachedPartsReqAndUpdateStore({productIds:this.productIds}))},async saveChanges(){const t=G();t.startLoading({id:"save-add-to-saved-basket-modal"});const e=this,o=[],u=_(),s=this.localShoppingListData.filter(r=>!this.shoppingListData.includes(r)),i=this.shoppingListData.filter(r=>!this.localShoppingListData.includes(r));let a=[];if(this.isMultiple?a=this.products.map(r=>({productId:r.variant.productId+"",variantId:r.variant.id+"",quantity:{quantity:r.quantity.quantity,type:r.quantity.type}})):a=[{productId:this.productId+"",variantId:this.variantId+"",quantity:{quantity:this.count,type:{[O]:"piece",[U]:"weight"}[W[this.selectedValue]]}}],s.length){const r=a.map(g=>({variantId:parseInt(g.variantId),listIds:s,quantity:g.quantity}));await this.$api.post("/me/shopping_lists/product_variants",{items:r})}for(const r of a){const g=i.length?this.$api.put(`products/${r.productId}/variants/${r.variantId}/shopping_lists`,{items:i,quantity:{quantity:0}}):null;await Promise.all([g]).catch(v=>{v?.response?.status===400?(v.response.data.errors=[{...v.response.data,message:"",hideErrorMsg:!0}],I({nuxtApp:e,error:v,closable:!1,forceModal:!0})):I({nuxtApp:e,error:v}),o.push(!0),e.$logger.error(v)})}for(const r of s){u.addShoppingListToSessionData(r);try{"variantId"in e.analyticsFavouriteGroupType&&(this.isMultiple?this.products.forEac
8h(g=>{e.$awAnalytics[M]({productData:g,variantProperty:"variant"})}):e.$awAnalytics[M]({productData:this.productData,variantProperty:"selectedVariant"}))}catch(g){e.$logger.error(g)}}for(const r of i)u.removeShoppingListFromSessionData(r);o.length===0&&await D().fetchUnCachedPartsReqAndUpdateStore({productIds:this.productIds}),this.closeModal(),t.endLoading({id:"save-add-to-saved-basket-modal"})},handleCheckboxChange(t,e){e?this.localShoppingListData.push(t.id):this.localShoppingListData=this.localShoppingListData.filter(o=>o!==t.id)},closeModal(){const t=k();this.$refs.addNewShoppingListForm&&(this.$refs.addNewShoppingListForm.newShoppingListName.model=""),this.showAddNewShoppingListForm=!1,t.hideFavModal({modalType:this.modalType}),this.$emit("modal-close")}}},zt={key:0,class:n(["ulReset"])},Gt=["aria-label","onClick"],Ht=["src"];function Kt(t,e,o,u,s,i){const a=c("aw-separator"),r=c("lv-image"),g=c("aw-checkout-cart-item-image"),v=c("lv-icon"),f=c("lv-button"),V=c("aw-checkbox-version2"),w=c("aw-add-new-shopping-list-form"),C=c("aw-modal");return l(),X(C,{opened:i.opened,size:"sm","modal-title":i.modalTitle,"modal-title-attrs":{},onCloseModal:i.closeModal},{content:L(()=>[p(a,{"margin-bottom":"md","margin-top":"none"}),o.isMultiple?(l(),d("div",{key:1,class:n(t.$style.productsImageContainerWrapper)},[h("ul",{class:n([t.$style.productsImageContainer,"ulReset","awScrollbar"])},[(l(!0),d(N,null,q(i.productsImages,m=>(l(),d("li",{key:m.uuid},[m.isPlaceholder?(l(),d("div",{key:0,class:n(t.$style.productsImageItemPlaceholder)},S(m.placeholderText),3)):(l(),d("div",{key:1,class:n(t.$style.productsImageItem)},[p(g,{item:m},null,8,["item"])],2))]))),128))],2)],2)):(l(),d("div",{key:0,class:n(t.$style.product)},[h("div",{class:n(t.$style.productImageWrapper)},[p(r,{type:s.LV_IMG_TYPE_VARIANT,sources:o.productImage,sizing:"contain",class:n(t.$style.productImage),alt:o.productName},null,8,["type","sources","class","alt"])],2),h("h3",{class:n(t.$style.productName)},S(o.productName),3)],2)),o.showRemovedFromList?(l(),d("div",{key:2,class:n(t.$style.removeFromListTitle)},S(t.$awt("aw.common.favourite.mobile_modal.remove_from_list_title")),3)):E("",!0),o.showRemovedFromList?(l(),d(N,{key:3},[i.selectedShoppingLists.length?(l(),d("ul",zt,[(l(!0),d(N,null,q(i.selectedShoppingLists,m=>(l(),d("li",{key:m.id,class:n(t.$style.removeFromListItem)},[h("span",null,S(m.name),1),h("button",{type:"button",class:"buttonReset","aria-label":t.$awt("aw.common.favourite.remove_label",{product_name:o.productName,list_name:m.name}),onClick:P=>i.removeFromList(m.id)},[p(v,{name:"trash-version2-16",size:16,class:n(t.$style.removeFromListItemIcon)},null,8,["class"])],8,Gt)],2))),128))])):(l(),d("div",{key:1,class:n(t.$style.emptyList)},[h("img",{alt:"",src:t.$addWebpPostfixIfSupported({url:s.abstract77,webpUrl:s.abstract77Webp}),loading:"lazy"},null,8,Ht)],2)),p(a,{"margin-bottom":"md","margin-top":"md"}),h("div",{class:n(t.$style.addShoppingListButtonWrapper)},[p(f,{styling:"primary-dark",shrink:"",class:n(t.$style.addShoppingListButton),onClick:i.closeModal},{default:L(()=>[A(S(t.$awt("aw.common.favourite.mobile_modal.close")),1)]),_:1},8,["class","onClick"])],2)],64)):(l(),d(N,{key:4},[(l(!0),d(N,null,q(i.sortedShoppingLists,m=>(l(),d("div",{key:m.id,class:n(t.$style.shoppingListItem)},[p(V,{modelValue:m.isSelected,"onUpdate:modelValue":[P=>m.isSelected=P,P=>i.handleCheckboxChange(m,P)],"has-label":""},{label:L(()=>[A(S(m.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])],2))),128)),T(p(w,{ref:"addNewShoppingListForm","display-type":"tooltip",onCloseAddNewShoppingListForm:e[0]||(e[0]=m=>s.showAddNewShoppingListForm=!1)},null,512),[[F,s.showAddNewShoppingListForm]]),T(p(f,{ref:"addNewShoppingListButton",stretch:"",styling:"small-secondary-dark",class:n(t.$style.addNewShoppingListButton),onClick:i.showAddNewShoppingListFormCallback,onFocus:e[1]||(e[1]=m=>t.$refs.addNewShoppingListForm.v$.$reset())},{default:L(()=>[A(S(t.$awt("aw.common.favourite.create_new_list")),1)]),_:1},8,["class","onClick"]),[[F,!s.showAddNewShoppingListForm]]),p(a,{"margin-bottom":"md","margin-top":"md"}),h("div",{class:n(t.$style.addShoppingListButtonWrapper)},[p(f,{styling:"primary-dark",shrink:"",class:n(t.$style.addShoppingListButton),disabled:s.showAddNewShoppingListForm,"loading-id":"save-add-to-saved-basket-modal",onClick:i.saveChanges},{default:L(()=>[A(S(t.$awt("aw.global.ok")),1)]),_:1},8,["class","disabled","onClick"])],2)],64))]),_:1},8,["opened","modal-title","onCloseModal"])}const Xt={$style:Wt},Zt=j(jt,[["render",Kt],["__cssModules",Xt]]),Yt="yXf0hpIf",Qt="-vH7nR1e",Jt="KOxNsIFP",xt="ZonfLAWs",te="iX59kpE4",ee="IV9wnHMO",se="FXQYIaI1",oe="cML3APCU",ie="mc1N3Os0",ae="Dtz6I-58",ne="dIMKC9je",re="p-jzy10T",le="Dfa6rbiK",pe="uaH2oQB2",de="YFLkJ-P7",ue={awProductCardPlaceholder:Yt,icon:Qt,filled:Jt,favButton:xt,favButtonMultiple:te,favButtonMultipleText:ee,favButtonMultipleIconSmall:se,favButtonMultipleIconBig:oe,wrapper:ie,favouriteElement:ae,lastShoppingListName:ne,removedElement:re,addToAnotherList:le,showMoreShoppingListsContainer:pe,addNewShoppingListButton:de},he={name:"AwFavouriteVersion2",components:{AwAddNewShoppingListForm:Z,AwAddToSavedBasketModalVersion2:Zt,LvButton:K,AwCheckboxVersion2:H,LvTooltip:dt,LvIcon:z},mixins:[rt],props:{variantId:{type:Number,required:!1,default:0},productId:{type:Number,required:!1,default:0},isDisabled:{type:Boolean,default:!1},shoppingListData:{type:Array,default:()=>[]},selectedValue:{type:String,default:"db"},count:{type:Number,default:1},productName:{type:String,required:!1,default:""},productData:{type:Object,required:!1,default:()=>({})},productImage:{type:Array,required:!1,default:()=>[]},isMultiple:{type:Boolean,default:!1},products:{type:Array,required:!1,default:()=>[]},defaultList:{type:String,default:y.FAVOURITE,validator:t=>Object.values(y).includes(t)},needLoginMessageInToastNotification:{type:Boolean,default:!1}},data(){return{modalTypeFav:lt+pt(),localShoppingListData:[],showTooltip:!1,showRemovedFromList:!1,lastShoppingListName:"",removedShoppingListName:"",showMoreShoppingLists:!1,showAddNewShoppingListForm:!1,analyticsFavouriteGroupType:{variantId:this.variantId},toasterKey:null,loading:!1,timer:null}},computed:{...B(G,{screenRange:t=>t.mediaQueries}),...B(_,{isEcomUser:t=>t.isEcomUser,shoppingLists:t=>t.shoppingListNames??[],shoppingListSessionData:t=>t.shoppingListSessionData??[]}),...B(k,{confirmModal:t=>t.modals.confirmModal}),isFilled(){return this.localShoppingListData.length},defaultShoppingListId(){return this.mappedShoppingLists.find(t=>t.default)?.id},existOkAuchanList(){return!!this.shoppingLists.find(t=>t.listType===y.OKAUCHAN)},mappedShoppingLists(){return this.shoppingLists?.map(t=>({id:t.id,name:t.listType===y.FAVOURITE?this.$awt("aw.profile.saved_baskets.default_list.title"):t.name,default:this.defaultList===y.OKAUCHAN&&this.existOkAuchanList?t.listType===y.OKAUCHAN:t.listType===y.FAVOURITE,isOkauchan:t.listType===y.OKAUCHAN,isSelected:this.localShoppingListData.some(e=>String(e)===String(t.id))}
8))??[]},sortedShoppingLists(){return[...this.mappedShoppingLists??[]].sort(({default:t,isSelected:e,name:o,isOkauchan:u},{default:s,isSelected:i,name:a,isOkauchan:r})=>s-t||r-u||i-e||o.localeCompare(a))},firstSelectedShoppingList(){return this.sortedShoppingLists.find(({isSelected:t})=>t)},productIds(){return this.isMultiple?this.products.map(t=>t.variant.productId):[this.productId]}},watch:{"confirmModal.confirmOk.type"(t){t==="addToSavedBasket"&&this.openLoginModal()},shoppingListData:{handler(t){this.localShoppingListData=t},deep:!0}},mounted(){this.localShoppingListData=this.isMultiple?this.calculateMultipleProductsShoppingListData():[...this.shoppingListData]},methods:{calculateMultipleProductsShoppingListData(){const t=this.products.map(o=>o.variant.shoppingListsContain),e=new Set(t[0]);for(let o=1;o<t.length;o++){const u=new Set(t[o]);e.forEach(s=>{u.has(s)||e.delete(s)})}return Array.from(e)},showAddNewShoppingListFormCallback(){this.showAddNewShoppingListForm=!0,this.$refs.addNewShoppingListForm.showCallback()},toasterModifyCallback(){const t=k(),e=R();t.showFavModal({modalType:this.modalTypeFav}),$(()=>{e.remove(this.toasterKey)})},async addProductToShoppingList(t,e=!0){const o=D();let u=!1,s=[];this.isMultiple?s=this.products.map(i=>({objectId:i.variant.id+"",quantity:{quantity:i.quantity.quantity,type:i.quantity.type}})):s=[{objectId:this.variantId+"",quantity:{quantity:this.count,type:{[O]:"piece",[U]:"weight"}[W[this.selectedValue]]}}],await this.$api.$post(`/me/shopping_lists/${t}/product_variants`,{items:s}).catch(i=>{i?.response?.status===400?(i.response.data.errors=[{...i.response.data,message:"",hideErrorMsg:!0}],I({nuxtApp:b(),error:i,closable:!1,forceModal:!0})):I({nuxtApp:b(),error:i}),u=!0,this.$logger.error(i)});try{"variantId"in this.analyticsFavouriteGroupType&&(this.isMultiple?this.products.forEach(i=>{this.$awAnalytics[M]({productData:i,variantProperty:"variant"})}):this.$awAnalytics[M]({productData:this.productData,variantProperty:"selectedVariant"}))}catch(i){this.$logger.error(i)}u||(this.localShoppingListData.push(t),e&&await o.fetchUnCachedPartsReqAndUpdateStore({productIds:this.productIds}))},async removeProductFromShoppingList(t){const e=D();let o=!1;const u=this.isMultiple?this.products.map(s=>({objectId:s.variant.id+"",quantity:{quantity:0}})):[{objectId:this.variantId+"",quantity:{quantity:0}}];await this.$api.$put(`/me/shopping_lists/${t}/product_variants`,{items:u}).catch(s=>{s?.response?.status===400?(s.response.data.errors=[{...s.response.data,message:"",hideErrorMsg:!0}],I({nuxtApp:b(),error:s,closable:!1,forceModal:!0})):I({nuxtApp:b(),error:s}),o=!0,this.$logger.error(s)}),o||(this.localShoppingListData=this.localShoppingListData.filter(s=>s!==t),await e.fetchUnCachedPartsReqAndUpdateStore({productIds:this.productIds}))},findShoppingListById(t){return this.mappedShoppingLists.find(e=>e.id===String(t))},async handleCheckboxChange(t,e){const o=_();e?(this.lastShoppingListName=t.name,await this.addProductToShoppingList(t.id),o.addShoppingListToSessionData(t.id)):(await this.removeProductFromShoppingList(t.id),o.removeShoppingListFromSessionData(t.id),this.lastShoppingListName=this.firstSelectedShoppingList?.name??"-",this.lastShoppingListName==="-"&&this.localShoppingListData.length===0&&(this.showRemovedFromList=!0,this.removedShoppingListName=t.name))},async addProductToMultipleShoppingLists(t,e=!0){const o=this.productId,u=this.variantId;let s=!1;const i=D();try{if(!this.isMultiple)await this.$api.post(`products/${o}/variants/${u}/shopping_lists`,{items:t,quantity:{quantity:this.count,type:{[O]:"piece",[U]:"weight"}[W[this.selectedValue]]}});else{const a=this.products.map(r=>({variantId:r.variant.id,listIds:t,quantity:{quantity:r.quantity.quantity,type:r.quantity.type}}));await this.$api.post("/me/shopping_lists/product_variants",{items:a})}}catch(a){a?.response?.status===400?(a.response.data.errors=[{...a.response.data,message:"",hideErrorMsg:!0}],I({nuxtApp:b(),error:a,closable:!1,forceModal:!0})):I({nuxtApp:b(),error:a}),s=!0,this.$logger.error(a)}try{"variantId"in this.analyticsFavouriteGroupType&&(this.isMultiple?this.products.forEac
8h(a=>{this.$awAnalytics[M]({productData:a,variantProperty:"variant"})}):this.$awAnalytics[M]({productData:this.productData,variantProperty:"selectedVariant"}))}catch(a){this.$logger.error(a)}s||(t.forEach(a=>{this.localShoppingListData.push(a)}),e&&await i.fetchUnCachedPartsReqAndUpdateStore({productIds:this.productIds}))},async initDesktopPopover(){if(clearTimeout(this.timer),this.localShoppingListData.length===0)this.shoppingListSessionData.length>0?await this.addProductToMultipleShoppingLists(this.shoppingListSessionData):(await this.addProductToShoppingList(this.defaultShoppingListId),_().addShoppingListToSessionData(this.defaultShoppingListId)),this.showTooltip=!0,this.showMoreShoppingLists=this.shoppingListSessionData.length>1,this.showRemovedFromList=!1,this.lastShoppingListName=this.firstSelectedShoppingList?.name;else if(this.localShoppingListData.length===1&&!this.isMultiple){const t=this.findShoppingListById(this.localShoppingListData[0]);await this.removeProductFromShoppingList(this.localShoppingListData[0]),this.showTooltip=!0,this.showRemovedFromList=!0,this.removedShoppingListName=t?.name||"-",this.timer=setTimeout(()=>{this.showTooltip=!1,this.showRemovedFromList=!1,clearTimeout(this.timer)},10*1e3)}else this.localShoppingListData.length>0&&this.isMultiple?(this.showTooltip=!this.showTooltip,this.showTooltip&&(this.showMoreShoppingLists=!0)):(this.showRemovedFromList=!1,this.showTooltip=!0,this.showMoreShoppingLists=!0,this.lastShoppingListName=this.firstSelectedShoppingList?.name)},async initMobilePopover(){const t=R();if(this.localShoppingListData.length===0)this.shoppingListSessionData.length>0?await this.addProductToMultipleShoppingLists(this.shoppingListSessionData):(await this.addProductToShoppingList(this.defaultShoppingListId),_().addShoppingListToSessionData(this.defaultShoppingListId)),this.lastShoppingListName=this.firstSelectedShoppingList?.name,this.toasterKey=t.push({title:this.$awt("aw.common.favourite.toaster.title"),text:this.$awt("aw.common.favourite.toaster.text",{list_name:this.lastShoppingListName}),manualClose:!0,screenReaderOnly:!1,showModifyButton:!0,modifyButtonCallback:this.toasterModifyCallback});else if(this.localShoppingListData.length===1&&!this.isMultiple){const e=this.findShoppingListById(this.localShoppingListData[0]);await this.removeProductFromShoppingList(this.localShoppingListData[0]),this.removedShoppingListName=e?.name||"-";const o=t.push({title:this.$awt("aw.common.favourite.remove_toaster.title"),text:this.$awt("aw.common.favourite.remove_toaster.text",{list_name:this.removedShoppingListName}),manualClose:!0,screenReaderOnly:!1,showModifyButton:!1,modifyButtonCallback:()=>({})});setTimeout(()=>{t.remove(o)},10*1e3)}else k().showFavModal({modalType:this.modalTypeFav}),this.showRemovedFromList=!this.isMultiple},async initShoppingListNames(){await _().fetchShoppingListNames()},async addToSavedBasket(){if(!this.isDisabled&&!this.loading){this.loading=!0;const t=k();this.isEcomUser?(await this.initShoppingListNames(),this.screenRange["tablet-min"]?await this.initDesktopPopover():await this.initMobilePopover()):this.needLoginMessageInToastNotification?R().push({manualClose:!1,title:this.$awt("aw.common.favourite.login_modal.text")}):t.showConfirmModal({closable:!0,data:{confirmTitle:this.$awt("aw.common.favourite.login_modal.title"),confirmText:this.$awt("aw.common.favourite.login_modal.text"),confirmOkButton:this.$awt("aw.common.favourite.login_modal.login"),confirmOkButtonAttrs:{},confirmCancelButton:this.$awt("aw.global.cancel"),confirmOkButtonStyle:"primary-dark",confirmCancelButtonStyle:"secondary-dark",showRegistrationFooter:!0,registrationFooterCallback:()=>{this.openLoginModal()},confirmOkActionType:"addToSavedBasket"}}),this.loading=!1}}}},ce=["innerHTML"],me={"data-popover-item-wrapper":""},ge=["aria-disabled","title","aria-label"],fe=["textContent"];function we(t,e,o,u,s,i){const a=c("lv-icon"),r=c("aw-checkbox-version2"),g=c("aw-add-new-shopping-list-form"),v=c("lv-button"),f=c("lv-tooltip"),V=c("aw-add-to-saved-basket-modal-version2");return l(),d("div",{class:n(t.$style.favouriteElement)},[p(f,{"show-tooltip":s.showTooltip,"onUpdate:showTooltip":e[3]||(e[3]=w=>s.showTooltip=w),options:{placement:"bottom-end"},trigger:"click","is-button-automatic":!1,styling:"secondary-version2","reference-with-overwrite":t.screenRange["desktop-medium-min"]?24:16},{tooltip:L(()=>[h("div",{class:n(t.$style.wrapper)},[s.showRemovedFromList?(l(),d(N,{key:0},[h("div",{class:n(t.$style.removedElement)},S(t.$awt("aw.common.favourite.removed_from")),3),h("div",{class:n(t.$style.removedElement)},S(s.removedShoppingListName),3)],64)):(l(),d(N,{key:1},[h("div",{class:n(t.$style.lastShoppingListName),innerHTML:t.$awt("aw.common.favourite.saved_to",{list_name:s.lastShoppingListName})},null,10,ce),T(h("button",{type:"button",class:n(["buttonReset",t.$style.addToAnotherList]),onClick:e[0]||(e[0]=w=>s.showMoreShoppingLists=!s.showMoreShoppingLists)},[h("span",null,S(t.$awt("aw.common.favourite.add_to_another_list")),1),p(a,{name:"arrow-down-16",size:16})],2),[[F,!s.showMoreShoppingLists]]),T(h("div",{class:n(t.$style.showMoreShoppingListsContainer)},[h("div",me,[(l(!0),d(N,null,q(i.sortedShoppingLists,w=>(l(),d("div",{key:w.id,"data-popover-item":""},[p(r,{modelValue:w.isSelected,"onUpdate:modelValue":[C=>w.isSelected=C,C=>i.handleCheckboxChange(w,C)],"has-label":""},{label:L(()=>[A(S(w.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),128))])],2),[[F,s.showMoreShoppingLists]]),s.showMoreShoppingLists?(l(),d(N,{key:0},[T(p(g,{ref:"addNewShoppingListForm","display-type":"tooltip",onCloseAddNewShoppingListForm:e[1]||(e[1]=w=>s.showAddNewShoppingListForm=!1)},null,512),[[F,s.showAddNewShoppingListForm]]),T(p(v,{ref:"addNewShoppingListButton",styling:"small-secondary-dark",class:n(t.$style.addNewShoppingListButton),onClick:i.showAddNewShoppingListFormCallback},{default:L(()=>[A(S(t.$awt("aw.common.favourite.create_new_list")),1)]),_:1},8,["class","onClick"]),[[F,!s.showAddNewShoppingListForm]])],64)):E("",!0)],64))],2)]),reference:L(()=>[h("button",{"data-lv-tootip-reference":"",type:"button",class:n(["buttonReset",t.$style.favButton,{[t.$style.favButtonMultiple]:o.isMultiple}]),"aria-disabled":o.isDisabled,title:t.$awt("aw.common.favourite.add_to_favourite"),"aria-label":o.isMultiple?`${t.$awt("aw.basket_tab.split_favourite")}`:`${o.productName} ${t.$awt("aw.common.favourite.label")}`,onClick:e[2]||(e[2]=(...w)=>i.addToSavedBasket&&i.addToSavedBasket(...w))},[o.productData&&!o.isMultiple?(l(),X(a,{key:0,name:"heart-version2-24",fill:"",size:24,class:n([t.$style.icon,{[t.$style.filled]:i.isFilled}])},null,8,["class"])):E("",!0),o.isMultiple?(l(),d(N,{key:1},[h("span",{class:n(t.$style.favButtonMultipleText),textContent:S(t.$awt("aw.basket_tab.split_favourite"))},null,10,fe),p(a,{name:"transactions-16",fill:"",size:16,class:n(t.$style.favButtonMultipleIconSmall)},null,8,["class"]),p(a,{name:"transactions-16",fill:"",size:24,class:n(t.$style.favButtonMultipleIconBig)},null,8,["class"])],64)):E("",!0)],10,ge)]),_:1},8,["show-tooltip","reference-with-overwrite"]),p(V,{"modal-type":s.modalTypeFav,"selected-value":o.selectedValue,count:o.count,"analytics-favourite-group-type":s.analyticsFavouriteGroupType,"product-name":o.productName,"product-image":o.productImage,"show-removed-from-list":s.showRemovedFromList,"shopping-list-data":s.localShoppingListData,"product-id":o.productId,"variant-id":o.variantId,"product-data":o.productData,"is-multiple":o.isMultiple,products:o.products,onModalClose:e[4]||(e[4]=w=>s.showRemovedFromList=!1)},null,8,["modal-type","selected-value","count","analytics-favourite-group-type","product-name","product-image","show-removed-from-list","shopping-list-data","product-id","variant-id","product-data","is-multiple","products"])],2)}const Se={$style:ue},ke=j(he,[["render",we],["__cssModules",Se]]);export{ke as default};
9//# sourceMappingURL=3pqezxyr.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.