@perevorot/shop 2.0.92 → 2.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),r=require("@perevorot/shop/dist/api"),o=require("simplebar"),n=require("secure-ls");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(o),c=l(n);var i=e.defineComponent({name:"search",props:{q:{type:String,default:""},placeholder:{type:String,default:""},placeholderMobile:{type:String,default:""},parameter:{type:String,default:"/q{separator}"},isHistory:{type:Boolean,default:!0},isToggleDropdownOnClose:{type:Boolean,default:!0},htmlClass:{type:String,default:""}},setup:function(o){var n=new c.default({isCompression:!1}),l=o.q;if(l){var i=document.createElement("textarea");i.innerHTML=l,l=i.value}var s=e.ref(!1),d=e.ref(l),u=e.ref([]),p=e.ref([]),m=e.ref(0),h=e.ref(-1),v=e.ref(!1),f=e.ref(),y=e.ref(""),g=e.ref(),k=e.ref(n.get("search")),w=e.ref([]),E=t.useStore(),B=e.computed((function(){return E.getters["auth/me"]})),V=[],N=function(){clearTimeout(void 0),h.value=-1,d.value.trim()?(s.value=!0,d.value.trim()&&r.shop.search(d.value).then((function(e){e.data&&(C(),u.value=e.data.products,m.value=e.data.total,y.value=e.data.separator,p.value=e.data.byCategory,new a.default(g.value))})).finally((function(){s.value=!1}))):(u.value=[],s.value=!1)},C=function(){if(d.value.length>1){var e=n.get("search")?n.get("search"):[];-1!==e.indexOf(d.value)&&(e=e.filter((function(e){return e!==d.value}))),e.length>4&&(e=e.slice(0,4)),e.unshift(d.value),n.set("search",e),k.value=e}};e.onBeforeUpdate((function(){V=[]})),e.watch((function(){return d.value}),(function(){v.value=!0,h.value=-1,N()}));var S=e.computed((function(){return d.value?$env.locale.url+"/search"+_.value:$env.locale.url+"/search"})),_=e.computed((function(){return o.parameter.replace("{separator}",y.value)+d.value.toLowerCase()})),D=function(e){e.target.closest(".cart")||(o.isToggleDropdownOnClose&&(v.value=!1,document.querySelector("html").classList.remove(o.htmlClass)),h.value=-1)};window.addEventListener("click",D);var L,b=e.computed((function(){return d.value.length>3?w.value.filter((function(e){return-1!==e.search.indexOf(d.value)})):[]})),q=(L=function(){var e,t,r,n=document.getElementById("menu");return n&&n.querySelectorAll("[data-search]").forEach((function(e){var t=e.textContent.trim(),r=e.dataset.search;w.value.push({name:(r?r+" / ":"")+t,search:t.toLowerCase(),href:e.closest("a").href})})),o.q&&N(),r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(L.apply(this,e))}catch(e){return Promise.reject(e)}});document.addEventListener("DOMContentLoaded",q,!1);var x=e.ref(o.placeholder);if(o.placeholderMobile){var H=function(){var e=window.matchMedia("(max-width: 768px)").matches;x.value=e?o.placeholderMobile:o.placeholder};window.addEventListener("resize",H),H()}return{isLoading:s,term:d,results:u,next:function(){h.value<u.value.length-1&&h.value++},prev:function(){h.value>=0&&h.value--},current:h,add:function(e){h.value>=0&&(e.preventDefault(),V[h.value].add())},cartRefs:function(e){e&&V.push(e)},isDropdown:v,preventCaret:function(e){(38==e.which||40==e.which||32==e.which&&h.value>=0)&&e.preventDefault()},esc:function(e){f.value.blur(),D(e)},input:f,dropdown:function(){v.value=!0,h.value=-1,document.querySelector("html").classList.add(o.props.htmlClass)},total:m,searchUrl:S,searchHrefWithParameter:_,open:function(){h.value>=0?window.location.href=u.value[h.value].href:window.location.href=S.value},categories:b,byCategory:p,dropdownContent:g,history:k,clearSearchHistory:function(e){n.remove("search"),k.value=[],f.value.focus()},setSearchHistory:function(e){e.value=e},user:B,clear:function(){d.value="",f.value.focus()},placeholderMobilized:x}}}),s={class:"dropdown-trigger"},d=["placeholder"],u={class:"icon is-small is-right"},p=[e.createElementVNode("i",{class:"fas fa-search"},null,-1)],m={key:1,class:"dropdown-menu"},h={class:"dropdown-content"},v={class:"history-list"},f={class:"dropdown-item history-list-title"},y=["onClick"],g={class:"dropdown-item history-list-clear"},k={class:"dropdown-menu"},w={class:"dropdown-content",style:{"max-height":"600px",overflow:"auto"},ref:"dropdownContent"},E={key:0,class:"results-list"},B=["href"],V={key:0,class:"dropdown-divider"},N={key:1,class:"results-list-category"},C={class:"dropdown-item categories-list-title"},S=["href"],_={key:2,class:"results-list-total"},D={class:"dropdown-item mb-3 mt-2"},L=e.createElementVNode("br",null,null,-1),b=["href"],q={key:3,class:"products-list"},x={class:"dropdown-item products-list-title"},H={class:"columns"},M={class:"column"},T={class:"title"},P=["href"],K=["innerHTML"],$={key:0,class:"price_old"},z=["innerHTML"],O={class:"code"},F={key:1,class:"quantity"},R={key:2,class:"no-quantity"},U={key:0,class:"column is-narrow"},W={key:1,class:"column is-eol"},j={key:0,class:"dropdown-content"},A={class:"dropdown-item"},I=["innerHTML"];i.render=function(t,r,o,n,l,a){var c=e.resolveComponent("cart-add");return e.openBlock(),e.createElementBlock("div",{class:"shop-search",onClick:r[10]||(r[10]=function(e){return e.stopPropagation()})},[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isDropdown,"is-dropdown-visible":t.isDropdown&&(t.history.length&&!t.term||t.results.length||t.categories.length||t.term&&!t.isLoading&&!t.results.length&&!t.categories.length)}])},[t.htmlClass?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"overlay search-overlay",onClick:r[0]||(r[0]=function(e){return t.esc(e)})})),e.createElementVNode("div",s,[e.createElementVNode("div",{class:e.normalizeClass(["control has-icons-right",{"is-loading":t.isLoading}])},[e.withDirectives(e.createElementVNode("input",{class:"input",type:"text","onUpdate:modelValue":r[1]||(r[1]=function(e){return t.term=e}),ref:"input",placeholder:t.placeholderMobilized,onKeyup:[r[2]||(r[2]=e.withKeys((function(){return t.next&&t.next.apply(t,arguments)}),["arrow-down"])),r[3]||(r[3]=e.withKeys((function(){return t.prev&&t.prev.apply(t,arguments)}),["arrow-up"])),r[4]||(r[4]=e.withKeys((function(e){return t.add(e)}),["space"])),r[5]||(r[5]=e.withKeys((function(){return t.open&&t.open.apply(t,arguments)}),["enter"])),r[6]||(r[6]=e.withKeys((function(e){return t.esc(e)}),["esc"]))],onClick:r[7]||(r[7]=function(){return t.dropdown&&t.dropdown.apply(t,arguments)}),onKeydown:r[8]||(r[8]=function(e){return t.preventCaret(e)})},null,40,d),[[e.vModelText,t.term]]),e.renderSlot(t.$slots,"clear",{clear:t.clear,term:t.term}),e.renderSlot(t.$slots,"icon",{isLoading:t.isLoading},(function(){return[e.withDirectives(e.createElementVNode("span",u,p,512),[[e.vShow,!t.isLoading]])]}))],2)]),t.isHistory&&t.isDropdown&&t.history.length&&!t.term?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",h,[e.createElementVNode("div",v,[e.createElementVNode("div",f,[e.createElementVNode("p",null,e.toDisplayString(t.__("shop.search.history")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.history,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("a",{onClick:function(e){return t.term=r}},e.toDisplayString(r),9,y)])})),128)),e.createElementVNode("div",g,[e.createElementVNode("a",{onClick:r[9]||(r[9]=function(e){return t.clearSearchHistory(e)})},e.toDisplayString(t.__("shop.search.history_clear")),1)])])])])):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("div",w,[e.renderSlot(t.$slots,"results-header"),t.categories.length?(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(t,r){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:r},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:t.href},e.toDisplayString(t.name),9,B)])])})),128)),t.byCategory.length?(e.openBlock(),e.createElementBlock("hr",V)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.byCategory.length?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",C,e.toDisplayString(t.__("shop.search.categories")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.byCategory,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.renderSlot(t.$slots,"item-category",{item:r,searchHrefWithParameter:t.searchHrefWithParameter},(function(){return[e.createElementVNode("div",null,[e.createElementVNode("a",{href:r.href+t.searchHrefWithParameter},e.toDisplayString(r.name),9,S)]),e.createElementVNode("div",null,e.toDisplayString(t.__("shop.search.category_found",{count:r.count})),1)]}))])})),128))])):e.createCommentVNode("v-if",!0),t.total?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("p",D,[e.createTextVNode(e.toDisplayString(t.__("shop.search.total_found",{total:t.total}))+" ",1),L,e.createElementVNode("a",{href:t.searchUrl},e.toDisplayString(t.__("shop.search.open_results")),9,b)])])):e.createCommentVNode("v-if",!0),t.results.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",x,e.toDisplayString(t.__("shop.search.products")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.results,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-item",{"is-active":t.current==o}]),key:r.id},[e.renderSlot(t.$slots,"item",{user:t.user,item:r,cartRefs:t.cartRefs},(function(){return[e.createElementVNode("div",H,[e.createElementVNode("div",M,[e.createElementVNode("div",T,[e.createElementVNode("a",{href:r.href},e.toDisplayString(r.name),9,P)]),e.createElementVNode("div",{class:"price",innerHTML:r.price},null,8,K),r.price_old?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("span",{innerHTML:r.price_old},null,8,z)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",O,e.toDisplayString(r.code),1),r.quantity?(e.openBlock(),e.createElementBlock("div",F,e.toDisplayString(t.__("shop.search.in_stock")),1)):(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(t.__("shop.search.out_stock")),1))]),r.is_eol?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.__("shop.search.eol")),1)):(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(c,{id:r.id,"is-change-quantity":!1,"is-already-in-cart":!1,ref_for:!0,ref:t.cartRefs},null,8,["id"])]))])]}))],2)})),128))])):e.createCommentVNode("v-if",!0)],512),[[e.vShow,t.results.length||t.categories.length]]),t.isLoading||t.results.length||t.categories.length?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",A,[e.createElementVNode("div",{class:"no-results",innerHTML:t.__("shop.search.no_results")},null,8,I)])]))],512),[[e.vShow,t.results.length||t.term]])],2)])},module.exports=i;
1
+ "use strict";var e=require("vue"),t=require("vuex"),r=require("@perevorot/shop/dist/api"),o=require("simplebar"),n=require("secure-ls");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(o),c=l(n);var s=e.defineComponent({name:"search",props:{q:{type:String,default:""},placeholder:{type:String,default:""},placeholderMobile:{type:String,default:""},parameter:{type:String,default:"/q{separator}"},isHistory:{type:Boolean,default:!0},isToggleDropdownOnClose:{type:Boolean,default:!0},htmlClass:{type:String,default:""}},setup:function(o){var n=new c.default({isCompression:!1}),l=o.q;if(l){var s=document.createElement("textarea");s.innerHTML=l,l=s.value}var i=e.ref(!1),d=e.ref(l),u=e.ref([]),p=e.ref([]),m=e.ref(0),h=e.ref(-1),v=e.ref(!1),f=e.ref(),y=e.ref(""),g=e.ref(),k=e.ref(n.get("search")),w=e.ref([]),E=t.useStore(),B=e.computed((function(){return E.getters["auth/me"]})),V=[],N=function(){clearTimeout(void 0),h.value=-1,d.value.trim()?(i.value=!0,d.value.trim()&&r.shop.search(d.value).then((function(e){e.data&&(C(),u.value=e.data.products,m.value=e.data.total,y.value=e.data.separator,p.value=e.data.byCategory,new a.default(g.value))})).finally((function(){i.value=!1}))):(u.value=[],i.value=!1)},C=function(){if(d.value.length>1){var e=n.get("search")?n.get("search"):[];-1!==e.indexOf(d.value)&&(e=e.filter((function(e){return e!==d.value}))),e.length>4&&(e=e.slice(0,4)),e.unshift(d.value),n.set("search",e),k.value=e}};e.onBeforeUpdate((function(){V=[]})),e.watch((function(){return d.value}),(function(){v.value=!0,h.value=-1,N()}));var S=e.computed((function(){return d.value?$env.locale.url+"/search"+_.value:$env.locale.url+"/search"})),_=e.computed((function(){return o.parameter.replace("{separator}",y.value)+d.value.toLowerCase()})),D=function(e){e.target.closest(".cart")||(o.isToggleDropdownOnClose&&(v.value=!1,o.htmlClass&&document.querySelector("html").classList.remove(o.htmlClass)),h.value=-1)};window.addEventListener("click",D);var L,b=e.computed((function(){return d.value.length>3?w.value.filter((function(e){return-1!==e.search.indexOf(d.value)})):[]})),q=(L=function(){var e,t,r,n=document.getElementById("menu");return n&&n.querySelectorAll("[data-search]").forEach((function(e){var t=e.textContent.trim(),r=e.dataset.search;w.value.push({name:(r?r+" / ":"")+t,search:t.toLowerCase(),href:e.closest("a").href})})),o.q&&N(),r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(L.apply(this,e))}catch(e){return Promise.reject(e)}});document.addEventListener("DOMContentLoaded",q,!1);var x=e.ref(o.placeholder);if(o.placeholderMobile){var H=function(){var e=window.matchMedia("(max-width: 768px)").matches;x.value=e?o.placeholderMobile:o.placeholder};window.addEventListener("resize",H),H()}return{isLoading:i,term:d,results:u,next:function(){h.value<u.value.length-1&&h.value++},prev:function(){h.value>=0&&h.value--},current:h,add:function(e){h.value>=0&&(e.preventDefault(),V[h.value].add())},cartRefs:function(e){e&&V.push(e)},isDropdown:v,preventCaret:function(e){(38==e.which||40==e.which||32==e.which&&h.value>=0)&&e.preventDefault()},esc:function(e){f.value.blur(),D(e)},input:f,dropdown:function(){v.value=!0,h.value=-1,o.htmlClass&&document.querySelector("html").classList.add(o.htmlClass)},total:m,searchUrl:S,searchHrefWithParameter:_,open:function(){h.value>=0?window.location.href=u.value[h.value].href:window.location.href=S.value},categories:b,byCategory:p,dropdownContent:g,history:k,clearSearchHistory:function(e){n.remove("search"),k.value=[],f.value.focus()},setSearchHistory:function(e){e.value=e},user:B,clear:function(){d.value="",f.value.focus()},placeholderMobilized:x}}}),i={class:"dropdown-trigger"},d=["placeholder"],u={class:"icon is-small is-right"},p=[e.createElementVNode("i",{class:"fas fa-search"},null,-1)],m={key:1,class:"dropdown-menu"},h={class:"dropdown-content"},v={class:"history-list"},f={class:"dropdown-item history-list-title"},y=["onClick"],g={class:"dropdown-item history-list-clear"},k={class:"dropdown-menu"},w={class:"dropdown-content",style:{"max-height":"600px",overflow:"auto"},ref:"dropdownContent"},E={key:0,class:"results-list"},B=["href"],V={key:0,class:"dropdown-divider"},N={key:1,class:"results-list-category"},C={class:"dropdown-item categories-list-title"},S=["href"],_={key:2,class:"results-list-total"},D={class:"dropdown-item mb-3 mt-2"},L=e.createElementVNode("br",null,null,-1),b=["href"],q={key:3,class:"products-list"},x={class:"dropdown-item products-list-title"},H={class:"columns"},M={class:"column"},T={class:"title"},P=["href"],K=["innerHTML"],$={key:0,class:"price_old"},z=["innerHTML"],O={class:"code"},F={key:1,class:"quantity"},R={key:2,class:"no-quantity"},U={key:0,class:"column is-narrow"},W={key:1,class:"column is-eol"},j={key:0,class:"dropdown-content"},A={class:"dropdown-item"},I=["innerHTML"];s.render=function(t,r,o,n,l,a){var c=e.resolveComponent("cart-add");return e.openBlock(),e.createElementBlock("div",{class:"shop-search",onClick:r[10]||(r[10]=function(e){return e.stopPropagation()})},[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isDropdown,"is-dropdown-visible":t.isDropdown&&(t.history.length&&!t.term||t.results.length||t.categories.length||t.term&&!t.isLoading&&!t.results.length&&!t.categories.length)}])},[t.htmlClass?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"overlay search-overlay",onClick:r[0]||(r[0]=function(e){return t.esc(e)})})),e.createElementVNode("div",i,[e.createElementVNode("div",{class:e.normalizeClass(["control has-icons-right",{"is-loading":t.isLoading}])},[e.withDirectives(e.createElementVNode("input",{class:"input",type:"text","onUpdate:modelValue":r[1]||(r[1]=function(e){return t.term=e}),ref:"input",placeholder:t.placeholderMobilized,onKeyup:[r[2]||(r[2]=e.withKeys((function(){return t.next&&t.next.apply(t,arguments)}),["arrow-down"])),r[3]||(r[3]=e.withKeys((function(){return t.prev&&t.prev.apply(t,arguments)}),["arrow-up"])),r[4]||(r[4]=e.withKeys((function(e){return t.add(e)}),["space"])),r[5]||(r[5]=e.withKeys((function(){return t.open&&t.open.apply(t,arguments)}),["enter"])),r[6]||(r[6]=e.withKeys((function(e){return t.esc(e)}),["esc"]))],onClick:r[7]||(r[7]=function(){return t.dropdown&&t.dropdown.apply(t,arguments)}),onKeydown:r[8]||(r[8]=function(e){return t.preventCaret(e)})},null,40,d),[[e.vModelText,t.term]]),e.renderSlot(t.$slots,"clear",{clear:t.clear,term:t.term}),e.renderSlot(t.$slots,"icon",{isLoading:t.isLoading},(function(){return[e.withDirectives(e.createElementVNode("span",u,p,512),[[e.vShow,!t.isLoading]])]}))],2)]),t.isHistory&&t.isDropdown&&t.history.length&&!t.term?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",h,[e.createElementVNode("div",v,[e.createElementVNode("div",f,[e.createElementVNode("p",null,e.toDisplayString(t.__("shop.search.history")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.history,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("a",{onClick:function(e){return t.term=r}},e.toDisplayString(r),9,y)])})),128)),e.createElementVNode("div",g,[e.createElementVNode("a",{onClick:r[9]||(r[9]=function(e){return t.clearSearchHistory(e)})},e.toDisplayString(t.__("shop.search.history_clear")),1)])])])])):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("div",w,[e.renderSlot(t.$slots,"results-header"),t.categories.length?(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(t,r){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:r},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:t.href},e.toDisplayString(t.name),9,B)])])})),128)),t.byCategory.length?(e.openBlock(),e.createElementBlock("hr",V)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.byCategory.length?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",C,e.toDisplayString(t.__("shop.search.categories")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.byCategory,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.renderSlot(t.$slots,"item-category",{item:r,searchHrefWithParameter:t.searchHrefWithParameter},(function(){return[e.createElementVNode("div",null,[e.createElementVNode("a",{href:r.href+t.searchHrefWithParameter},e.toDisplayString(r.name),9,S)]),e.createElementVNode("div",null,e.toDisplayString(t.__("shop.search.category_found",{count:r.count})),1)]}))])})),128))])):e.createCommentVNode("v-if",!0),t.total?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("p",D,[e.createTextVNode(e.toDisplayString(t.__("shop.search.total_found",{total:t.total}))+" ",1),L,e.createElementVNode("a",{href:t.searchUrl},e.toDisplayString(t.__("shop.search.open_results")),9,b)])])):e.createCommentVNode("v-if",!0),t.results.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",x,e.toDisplayString(t.__("shop.search.products")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.results,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-item",{"is-active":t.current==o}]),key:r.id},[e.renderSlot(t.$slots,"item",{user:t.user,item:r,cartRefs:t.cartRefs},(function(){return[e.createElementVNode("div",H,[e.createElementVNode("div",M,[e.createElementVNode("div",T,[e.createElementVNode("a",{href:r.href},e.toDisplayString(r.name),9,P)]),e.createElementVNode("div",{class:"price",innerHTML:r.price},null,8,K),r.price_old?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("span",{innerHTML:r.price_old},null,8,z)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",O,e.toDisplayString(r.code),1),r.quantity?(e.openBlock(),e.createElementBlock("div",F,e.toDisplayString(t.__("shop.search.in_stock")),1)):(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(t.__("shop.search.out_stock")),1))]),r.is_eol?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.__("shop.search.eol")),1)):(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(c,{id:r.id,"is-change-quantity":!1,"is-already-in-cart":!1,ref_for:!0,ref:t.cartRefs},null,8,["id"])]))])]}))],2)})),128))])):e.createCommentVNode("v-if",!0)],512),[[e.vShow,t.results.length||t.categories.length]]),t.isLoading||t.results.length||t.categories.length?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",A,[e.createElementVNode("div",{class:"no-results",innerHTML:t.__("shop.search.no_results")},null,8,I)])]))],512),[[e.vShow,t.results.length||t.term]])],2)])},module.exports=s;
2
2
  //# sourceMappingURL=Search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.js","sources":["../../../src/components/shop/Search.vue","../../../src/components/shop/Search.vue?vue&type=template&id=34c0656f&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\" v-if=\"!htmlClass\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholderMobilized\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"clear\" :clear=\"clear\" :term=\"term\"></slot>\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isHistory && isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <slot name=\"results-header\"></slot>\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <slot name=\"item-category\" :item=\"item\" :searchHrefWithParameter=\"searchHrefWithParameter\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{ __('shop.search.category_found', { count: item.count }) }}\n </div>\n </slot>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\"></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\" v-html=\"__('shop.search.no_results')\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n placeholderMobile: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n },\n isHistory: {\n type: Boolean,\n default: true\n },\n isToggleDropdownOnClose: {\n type: Boolean,\n default: true\n },\n htmlClass: {\n type: String,\n default: ''\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n if (props.isToggleDropdownOnClose) {\n isDropdown.value = false;\n document.querySelector('html').classList.remove(props.htmlClass);\n }\n\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n document.querySelector('html').classList.add(props.props.htmlClass);\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n const clear = () => {\n term.value = '';\n input.value.focus();\n };\n\n const placeholderMobilized = ref(props.placeholder);\n\n if (props.placeholderMobile) {\n const switchPlaceholder = () => {\n const isMobile = window.matchMedia('(max-width: 768px)').matches;\n\n placeholderMobilized.value = isMobile ? props.placeholderMobile : props.placeholder;\n };\n\n window.addEventListener('resize', switchPlaceholder);\n\n switchPlaceholder();\n }\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user,\n clear,\n placeholderMobilized,\n };\n }\n});\n</script>","<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\" v-if=\"!htmlClass\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholderMobilized\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"clear\" :clear=\"clear\" :term=\"term\"></slot>\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isHistory && isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <slot name=\"results-header\"></slot>\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <slot name=\"item-category\" :item=\"item\" :searchHrefWithParameter=\"searchHrefWithParameter\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{ __('shop.search.category_found', { count: item.count }) }}\n </div>\n </slot>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\"></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\" v-html=\"__('shop.search.no_results')\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n placeholderMobile: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n },\n isHistory: {\n type: Boolean,\n default: true\n },\n isToggleDropdownOnClose: {\n type: Boolean,\n default: true\n },\n htmlClass: {\n type: String,\n default: ''\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n if (props.isToggleDropdownOnClose) {\n isDropdown.value = false;\n document.querySelector('html').classList.remove(props.htmlClass);\n }\n\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n document.querySelector('html').classList.add(props.props.htmlClass);\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n const clear = () => {\n term.value = '';\n input.value.focus();\n };\n\n const placeholderMobilized = ref(props.placeholder);\n\n if (props.placeholderMobile) {\n const switchPlaceholder = () => {\n const isMobile = window.matchMedia('(max-width: 768px)').matches;\n\n placeholderMobilized.value = isMobile ? props.placeholderMobile : props.placeholder;\n };\n\n window.addEventListener('resize', switchPlaceholder);\n\n switchPlaceholder();\n }\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user,\n clear,\n placeholderMobilized,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","q","type","String","placeholder","placeholderMobile","parameter","isHistory","Boolean","isToggleDropdownOnClose","htmlClass","setup","ls","SecureLS","isCompression","encoder","document","createElement","innerHTML","value","isLoading","ref","term","results","byCategory","total","current","isDropdown","input","separator","dropdownContent","history","get","menu","store","useStore","user","computed","getters","refs","search","clearTimeout","timeout","trim","api","then","response","data","saveSearch","products","SimpleBar","length","indexOf","filter","item","slice","unshift","set","onBeforeUpdate","watch","searchUrl","$env","locale","url","searchHrefWithParameter","replace","toLowerCase","close","event","target","closest","querySelector","classList","remove","window","addEventListener","f","categories","load","direct","menuElement","getElementById","querySelectorAll","forEach","element","textContent","dataset","push","href","arguments","i","resolve","apply","this","placeholderMobilized","switchPlaceholder","isMobile","matchMedia","matches","next","prev","add","preventDefault","cartRefs","el","preventCaret","which","esc","blur","dropdown","open","location","clearSearchHistory","focus","setSearchHistory","clear","_createElementVNode","style","_createElementBlock","onClick","$event","stopPropagation","_ctx","_hoisted_1","onKeyup","onKeydown","_renderSlot","_hoisted_3","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","index","key","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","_hoisted_18","count","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_24","_hoisted_25","id","_hoisted_26","_hoisted_27","_hoisted_28","price","price_old","_hoisted_31","_hoisted_33","code","quantity","_hoisted_34","_hoisted_35","is_eol","_hoisted_37","_hoisted_36","_createVNode","_hoisted_38","_hoisted_39"],"mappings":"kOA0HA,MAA6BA,kBAAgB,CACzCC,KAAM,SACNC,MAAO,CACHC,EAAG,CACCC,KAAMC,eACG,IAEbC,YAAa,CACTF,KAAMC,eACG,IAEbE,kBAAmB,CACfH,KAAMC,eACG,IAEbG,UAAW,CACPJ,KAAMC,eACG,iBAEbI,UAAW,CACPL,KAAMM,iBACG,GAEbC,wBAAyB,CACrBP,KAAMM,iBACG,GAEbE,UAAW,CACPR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vE,QAAWuE,aAAWvE,sDAAjFmE,2BAAA6C,GACI/C,2BAAAgD,GACIhD,kCAAW,aAAalG,UAAQwG,+DA3ETA,UAAQvE,QAAUuE"}
1
+ {"version":3,"file":"Search.js","sources":["../../../src/components/shop/Search.vue","../../../src/components/shop/Search.vue?vue&type=template&id=81ea6246&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\" v-if=\"!htmlClass\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholderMobilized\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"clear\" :clear=\"clear\" :term=\"term\"></slot>\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isHistory && isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <slot name=\"results-header\"></slot>\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <slot name=\"item-category\" :item=\"item\" :searchHrefWithParameter=\"searchHrefWithParameter\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{ __('shop.search.category_found', { count: item.count }) }}\n </div>\n </slot>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\"></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\" v-html=\"__('shop.search.no_results')\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n placeholderMobile: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n },\n isHistory: {\n type: Boolean,\n default: true\n },\n isToggleDropdownOnClose: {\n type: Boolean,\n default: true\n },\n htmlClass: {\n type: String,\n default: ''\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n if (props.isToggleDropdownOnClose) {\n isDropdown.value = false;\n if (props.htmlClass) {\n document.querySelector('html').classList.remove(props.htmlClass);\n }\n }\n\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n\n if (props.htmlClass) {\n document.querySelector('html').classList.add(props.htmlClass);\n }\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n const clear = () => {\n term.value = '';\n input.value.focus();\n };\n\n const placeholderMobilized = ref(props.placeholder);\n\n if (props.placeholderMobile) {\n const switchPlaceholder = () => {\n const isMobile = window.matchMedia('(max-width: 768px)').matches;\n\n placeholderMobilized.value = isMobile ? props.placeholderMobile : props.placeholder;\n };\n\n window.addEventListener('resize', switchPlaceholder);\n\n switchPlaceholder();\n }\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user,\n clear,\n placeholderMobilized,\n };\n }\n});\n</script>","<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\" v-if=\"!htmlClass\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholderMobilized\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"clear\" :clear=\"clear\" :term=\"term\"></slot>\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isHistory && isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <slot name=\"results-header\"></slot>\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <slot name=\"item-category\" :item=\"item\" :searchHrefWithParameter=\"searchHrefWithParameter\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{ __('shop.search.category_found', { count: item.count }) }}\n </div>\n </slot>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\"></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\" v-html=\"__('shop.search.no_results')\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n placeholderMobile: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n },\n isHistory: {\n type: Boolean,\n default: true\n },\n isToggleDropdownOnClose: {\n type: Boolean,\n default: true\n },\n htmlClass: {\n type: String,\n default: ''\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n if (props.isToggleDropdownOnClose) {\n isDropdown.value = false;\n if (props.htmlClass) {\n document.querySelector('html').classList.remove(props.htmlClass);\n }\n }\n\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n\n if (props.htmlClass) {\n document.querySelector('html').classList.add(props.htmlClass);\n }\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n const clear = () => {\n term.value = '';\n input.value.focus();\n };\n\n const placeholderMobilized = ref(props.placeholder);\n\n if (props.placeholderMobile) {\n const switchPlaceholder = () => {\n const isMobile = window.matchMedia('(max-width: 768px)').matches;\n\n placeholderMobilized.value = isMobile ? props.placeholderMobile : props.placeholder;\n };\n\n window.addEventListener('resize', switchPlaceholder);\n\n switchPlaceholder();\n }\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user,\n clear,\n placeholderMobilized,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","q","type","String","placeholder","placeholderMobile","parameter","isHistory","Boolean","isToggleDropdownOnClose","htmlClass","setup","ls","SecureLS","isCompression","encoder","document","createElement","innerHTML","value","isLoading","ref","term","results","byCategory","total","current","isDropdown","input","separator","dropdownContent","history","get","menu","store","useStore","user","computed","getters","refs","search","clearTimeout","timeout","trim","api","then","response","data","saveSearch","products","SimpleBar","length","indexOf","filter","item","slice","unshift","set","onBeforeUpdate","watch","searchUrl","$env","locale","url","searchHrefWithParameter","replace","toLowerCase","close","event","target","closest","querySelector","classList","remove","window","addEventListener","f","categories","load","direct","menuElement","getElementById","querySelectorAll","forEach","element","textContent","dataset","push","href","arguments","i","resolve","apply","this","placeholderMobilized","switchPlaceholder","isMobile","matchMedia","matches","next","prev","add","preventDefault","cartRefs","el","preventCaret","which","esc","blur","dropdown","open","location","clearSearchHistory","focus","setSearchHistory","clear","_createElementVNode","style","_createElementBlock","onClick","$event","stopPropagation","_ctx","_hoisted_1","onKeyup","onKeydown","_renderSlot","_hoisted_3","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","index","key","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","_hoisted_18","count","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_24","_hoisted_25","id","_hoisted_26","_hoisted_27","_hoisted_28","price","price_old","_hoisted_31","_hoisted_33","code","quantity","_hoisted_34","_hoisted_35","is_eol","_hoisted_37","_hoisted_36","_createVNode","_hoisted_38","_hoisted_39"],"mappings":"kOA0HA,MAA6BA,kBAAgB,CACzCC,KAAM,SACNC,MAAO,CACHC,EAAG,CACCC,KAAMC,eACG,IAEbC,YAAa,CACTF,KAAMC,eACG,IAEbE,kBAAmB,CACfH,KAAMC,eACG,IAEbG,UAAW,CACPJ,KAAMC,eACG,iBAEbI,UAAW,CACPL,KAAMM,iBACG,GAEbC,wBAAyB,CACrBP,KAAMM,iBACG,GAEbE,UAAW,CACPR,KAAMC,eACG,KAGjBQ,eAAMX,OACIY,EAAK,IAAIC,UAAS,CACpBC,eAAe,IAGfb,EAAID,EAAMC,KAEVA,EAAG,KACCc,EAAUC,SAASC,cAAc,YACrCF,EAAQG,UAAYjB,EACpBA,EAAIc,EAAQI,UAGVC,EAAYC,OAAI,GAChBC,EAAOD,MAAIpB,GACXsB,EAAUF,MAAI,IACdG,EAAaH,MAAI,IACjBI,EAAQJ,MAAI,GACZK,EAAUL,OAAK,GACfM,EAAaN,OAAI,GACjBO,EAAQP,QACRQ,EAAYR,MAAI,IAChBS,EAAkBT,QAClBU,EAAUV,MAAIT,EAAGoB,IAAI,WACrBC,EAAOZ,MAAI,IACXa,EAAQC,aACRC,EAAOC,YAAS,kBAAMH,EAAMI,QAAQ,cAEtCC,EAAO,GAGLC,EAAS,WACXC,kBAHAC,GAKAhB,EAAQP,OAAS,EAEZG,EAAKH,MAAMwB,QAIZvB,EAAUD,OAAQ,EAGdG,EAAKH,MAAMwB,QACXC,OAAIJ,OAAOlB,E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,WAAWU,KAAtDC,IAAK/E,EAAK6F,KACzErB,8BAAmB1F,KAAMsF,OAAOpE,KAAMA,EAAOiD,SAAWmB,aAAxD,kBACIN,2BAAAgC,GACIhC,2BAAAiC,GACIjC,2BAAAkC,GACIlC,0BAAI5B,KAAMlC,EAAKkC,wBACRlC,EAAKvD,aAGhBqH,kCAAW,QAAQlG,UAAQoC,EAAKiG,iBACHjG,EAAKkG,yBAAlClC,2BAAAmC,GACIrC,6BAAMlG,UAAQoC,EAAKkG,wDAEvBpC,2BAAAsC,oBAAqBpG,EAAKqG,SACErG,EAAKsG,wBAAjCtC,2BAAAuC,oBACOnC,iDAEPJ,4BAAAwC,oBACOpC,qCAG0BpE,EAAKyG,sBAG1CzC,2BAAA0C,oBACOtC,4CAJPJ,2BAAA2C,GACIC,iBAAWf,GAAI7F,EAAK6F,yBAAyB,wBAA4B,aAAQ9H,IAAKqG,oGA9DxEA,UAAQvE,QAAUuE,aAAWvE,UAwE9BuE,aAAcA,UAAQvE,QAAWuE,aAAWvE,sDAAjFmE,2BAAA6C,GACI/C,2BAAAgD,GACIhD,kCAAW,aAAalG,UAAQwG,+DA3ETA,UAAQvE,QAAUuE"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(l),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),c=e.ref(!1),a=e.computed((function(){return o.getters["cart/items"]})),s=e.computed((function(){return o.getters["cart/modal"]})),i=e.computed((function(){return o.getters["cart/total"]})),d=e.computed((function(){return o.getters["cart/quantity"]})),u=function(){o.commit("cart/modal",!1)};o.dispatch("cart/get",{finally:function(){}}),document.body.addEventListener("click",(function(e){s.value&&!e.target.closest(".cart")&&u()})),window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&u()}));var m,p,v=e.ref(null),E=e.ref(null),k=e.ref(null),f=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new r.default(v.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[l.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:E.value,prevEl:k.value}}))),e})),N=e.ref(null),V=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return N.value&&(p&&p.destroy(),e.length&&(p=new r.default(N.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:V.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)}));var y=e.ref(!1);return{loading:c,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",!s.value)},close:u,clear:function(){c.value=!0,o.dispatch("cart/clear",{finally:function(){c.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",!1)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",!1)})),window.location.href=e},cross:f,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:N,bundlesSliderPrev:g,bundlesSliderNext:V,checkout:function(){try{y.value=!0;var e=[];a.value.forEach((function(t){e.push({name:t.name,id:t.attributes.code,price:t.attributes.price,brand:t.attributes.brand,category:t.attributes.category,quantity:t.quantity})}));var t={ecommerce:{checkout:{products:[e]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Checkout","gtm-ee-event-non-interaction":"False",eventCallback:function(){window.location.href=$ziggy("shop.checkout")},eventTimeout:2e3};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout"),setTimeout((function(){window.location.href=$ziggy("shop.checkout")}),2e3)}catch(e){console.error(e),window.location.href=$ziggy("shop.checkout")}},isLoading:y}}}),a={class:"dropdown is-right is-hoverable"},s={class:"dropdown-trigger"},i=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),d=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),u={class:"dropdown-menu",role:"menu"},m={key:0,class:"dropdown-content"},p={class:"dropdown-item"},v={class:"columns"},E={class:"column"},k=["innerHTML"],f=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),N={class:"dropdown-item has-text-centered"},V={class:"dropdown-item has-text-centered"},g={key:1,class:"dropdown-content"},h={class:"dropdown-item"},y={class:"modal-content"},w=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],B={class:"box"},b={class:"cart-title"},C=["textContent"],_={key:0,class:"items-wrapper"},x={class:"items"},S={class:"columns is-gapless is-vcentered main-actions"},L={class:"column"},T={class:"column has-text-right"},M={class:"totals"},D={class:"title"},$=["innerHTML"],H={class:"column is-narrow"},q={key:0,class:"cross"},z={class:"title"},P={class:"swiper",ref:"crossSlider"},F={class:"swiper-wrapper"},O={class:"columns is-gapless"},A={class:"column is-narrow"},G=["onClick"],j=["src"],R={key:1},I=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],J={class:"column"},K=["data-code"],Q={class:"name"},U=["onClick"],W={class:"columns is-gapless is-vcentered"},X={class:"column is-narrow"},Y={class:"prices"},Z=["innerHTML"],ee=["innerHTML"],te={class:"column"},ne=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),le={class:"swiper-nav prev",ref:"crossSliderPrev"},oe=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],re={class:"swiper-nav next",ref:"crossSliderNext"},ce=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ae={key:1,class:"bundles"},se={class:"title"},ie={class:"swiper",ref:"bundlesSlider"},de={class:"swiper-wrapper"},ue={class:"column is-narrow"},me=["onClick"],pe=["src"],ve={key:1},Ee=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],ke={class:"column"},fe={class:"product"},Ne={class:"name"},Ve=["onClick"],ge={class:"columns is-gapless is-vcentered"},he={class:"prices"},ye=["innerHTML"],we=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Be={class:"column is-narrow"},be=["onClick"],Ce=["src"],_e={key:1},xe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Se={class:"column"},Le={class:"product"},Te={class:"name"},Me=["onClick"],De={class:"columns is-gapless is-vcentered"},$e={class:"prices"},He=["innerHTML"],qe={key:0,class:"column is-narrow"},ze=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Pe={key:1,class:"column is-narrow"},Fe=["onClick"],Oe=["src"],Ae={key:1},Ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],je={key:2,class:"column"},Re={class:"product"},Ie={class:"name"},Je=["onClick"],Ke={class:"columns is-gapless is-vcentered"},Qe={class:"prices"},Ue=["innerHTML"],We={class:"columns is-vcentered"},Xe={class:"column"},Ye=["innerHTML"],Ze=["innerHTML"],et={class:"column"},tt={class:"is-flex is-align-items-center"},nt=["innerHTML"],lt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},ot=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],rt={class:"swiper-nav next",ref:"bundlesSliderNext"},ct=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],at={key:1,class:"empty"},st={class:"title"},it={class:"message"},dt=["href"],ut=e.createTextVNode(", "),mt=e.createElementVNode("br",null,null,-1),pt={class:"viewed-wrapper"};c.render=function(t,n,l,o,r,c){var vt=e.resolveComponent("cart-item"),Et=e.resolveComponent("cart-add"),kt=e.resolveComponent("bundle-add"),ft=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cart",{"is-open":t.modal}])},[e.createElementVNode("div",a,[e.createElementVNode("div",s,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[i,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),d])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,k)])]),f,e.createElementVNode("div",N,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",V,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:n[2]||(n[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",g,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[3]||(n[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},w),e.createElementVNode("div",B,[e.createElementVNode("div",b,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,C)):e.createCommentVNode("v-if",!0)]),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(n){return e.openBlock(),e.createBlock(vt,{key:n.id,item:n},e.createSlots({_:2},[e.renderList(t.$slots,(function(n,l){return{name:l,fn:e.withCtx((function(n){return[e.renderSlot(t.$slots,l,e.normalizeProps(e.guardReactiveProps(n||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",S,[e.createElementVNode("div",L,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,$)])])]),e.createElementVNode("div",H,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",z,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",P,[e.createElementVNode("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",O,[e.createElementVNode("div",A,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,j)):(e.openBlock(),e.createElementBlock("svg",R,I))],2)],8,G)]),e.createElementVNode("div",J,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",Q,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,U)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,Z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,ee)])]),e.createElementVNode("div",te,[e.createVNode(Et,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ne]})),_:2},1032,["id"])])])],8,K)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",le,oe,512)),(e.openBlock(),e.createElementBlock("svg",re,ce,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":n.third}])},[e.createElementVNode("div",ue,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,pe)):(e.openBlock(),e.createElementBlock("svg",ve,Ee))],2)],8,me)]),e.createElementVNode("div",ke,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ne,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,Ve)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,ye)])])])]),we,e.createElementVNode("div",Be,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.second.image}])},[n.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.second.image},null,8,Ce)):(e.openBlock(),e.createElementBlock("svg",_e,xe))],2)],8,be)]),e.createElementVNode("div",Se,[e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,Me)]),e.createElementVNode("div",De,[e.createElementVNode("div",$e,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,He)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",qe,ze)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.third.image}])},[n.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.third.image},null,8,Oe)):(e.openBlock(),e.createElementBlock("svg",Ae,Ge))],2)],8,Fe)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ue)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,Ye),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+n.bundle.amount},null,8,Ze)]),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,nt),e.createVNode(kt,{id:n.id,second:n.second.id,third:n.third?n.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",lt,ot,512)),(e.openBlock(),e.createElementBlock("svg",rt,ct,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",st,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",it,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dt),ut,mt,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:n[7]||(n[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",pt,[e.createVNode(ft,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)],2)},module.exports=c;
1
+ "use strict";var e=require("vue"),t=require("vuex"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(l),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),c=e.ref(!1),a=e.computed((function(){return o.getters["cart/items"]})),s=e.computed((function(){return o.getters["cart/modal"]})),i=e.computed((function(){return o.getters["cart/total"]})),d=e.computed((function(){return o.getters["cart/quantity"]})),u=function(){o.commit("cart/modal",null)};o.dispatch("cart/get",{finally:function(){}}),document.body.addEventListener("click",(function(e){s.value&&!e.target.closest(".cart")&&u()})),window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&u()}));var m,p,v=e.ref(null),E=e.ref(null),k=e.ref(null),f=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new r.default(v.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[l.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:E.value,prevEl:k.value}}))),e})),N=e.ref(null),V=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return N.value&&(p&&p.destroy(),e.length&&(p=new r.default(N.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:V.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)}));var y=e.ref(!1);return{loading:c,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",s.value?null:"cart")},close:u,clear:function(){c.value=!0,o.dispatch("cart/clear",{finally:function(){c.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)})),window.location.href=e},cross:f,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:N,bundlesSliderPrev:g,bundlesSliderNext:V,checkout:function(){try{y.value=!0;var e=[];a.value.forEach((function(t){e.push({name:t.name,id:t.attributes.code,price:t.attributes.price,brand:t.attributes.brand,category:t.attributes.category,quantity:t.quantity})}));var t={ecommerce:{checkout:{products:[e]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Checkout","gtm-ee-event-non-interaction":"False",eventCallback:function(){window.location.href=$ziggy("shop.checkout")},eventTimeout:2e3};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout"),setTimeout((function(){window.location.href=$ziggy("shop.checkout")}),2e3)}catch(e){console.error(e),window.location.href=$ziggy("shop.checkout")}},isLoading:y}}}),a={class:"dropdown is-right is-hoverable"},s={class:"dropdown-trigger"},i=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),d=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),u={class:"dropdown-menu",role:"menu"},m={key:0,class:"dropdown-content"},p={class:"dropdown-item"},v={class:"columns"},E={class:"column"},k=["innerHTML"],f=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),N={class:"dropdown-item has-text-centered"},V={class:"dropdown-item has-text-centered"},g={key:1,class:"dropdown-content"},h={class:"dropdown-item"},y={class:"modal-content"},w=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],B={class:"box"},b={class:"cart-title"},C=["textContent"],_={key:0,class:"items-wrapper"},x={class:"items"},S={class:"columns is-gapless is-vcentered main-actions"},L={class:"column"},T={class:"column has-text-right"},M={class:"totals"},D={class:"title"},$=["innerHTML"],H={class:"column is-narrow"},q={key:0,class:"cross"},z={class:"title"},P={class:"swiper",ref:"crossSlider"},F={class:"swiper-wrapper"},O={class:"columns is-gapless"},A={class:"column is-narrow"},G=["onClick"],j=["src"],R={key:1},I=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],J={class:"column"},K=["data-code"],Q={class:"name"},U=["onClick"],W={class:"columns is-gapless is-vcentered"},X={class:"column is-narrow"},Y={class:"prices"},Z=["innerHTML"],ee=["innerHTML"],te={class:"column"},ne=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),le={class:"swiper-nav prev",ref:"crossSliderPrev"},oe=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],re={class:"swiper-nav next",ref:"crossSliderNext"},ce=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ae={key:1,class:"bundles"},se={class:"title"},ie={class:"swiper",ref:"bundlesSlider"},de={class:"swiper-wrapper"},ue={class:"column is-narrow"},me=["onClick"],pe=["src"],ve={key:1},Ee=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],ke={class:"column"},fe={class:"product"},Ne={class:"name"},Ve=["onClick"],ge={class:"columns is-gapless is-vcentered"},he={class:"prices"},ye=["innerHTML"],we=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Be={class:"column is-narrow"},be=["onClick"],Ce=["src"],_e={key:1},xe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Se={class:"column"},Le={class:"product"},Te={class:"name"},Me=["onClick"],De={class:"columns is-gapless is-vcentered"},$e={class:"prices"},He=["innerHTML"],qe={key:0,class:"column is-narrow"},ze=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Pe={key:1,class:"column is-narrow"},Fe=["onClick"],Oe=["src"],Ae={key:1},Ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],je={key:2,class:"column"},Re={class:"product"},Ie={class:"name"},Je=["onClick"],Ke={class:"columns is-gapless is-vcentered"},Qe={class:"prices"},Ue=["innerHTML"],We={class:"columns is-vcentered"},Xe={class:"column"},Ye=["innerHTML"],Ze=["innerHTML"],et={class:"column"},tt={class:"is-flex is-align-items-center"},nt=["innerHTML"],lt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},ot=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],rt={class:"swiper-nav next",ref:"bundlesSliderNext"},ct=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],at={key:1,class:"empty"},st={class:"title"},it={class:"message"},dt=["href"],ut=e.createTextVNode(", "),mt=e.createElementVNode("br",null,null,-1),pt={class:"viewed-wrapper"};c.render=function(t,n,l,o,r,c){var vt=e.resolveComponent("cart-item"),Et=e.resolveComponent("cart-add"),kt=e.resolveComponent("bundle-add"),ft=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cart",{"is-open":t.modal}])},[e.createElementVNode("div",a,[e.createElementVNode("div",s,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[i,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),d])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,k)])]),f,e.createElementVNode("div",N,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",V,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:n[2]||(n[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",g,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[3]||(n[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},w),e.createElementVNode("div",B,[e.createElementVNode("div",b,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,C)):e.createCommentVNode("v-if",!0)]),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(n){return e.openBlock(),e.createBlock(vt,{key:n.id,item:n},e.createSlots({_:2},[e.renderList(t.$slots,(function(n,l){return{name:l,fn:e.withCtx((function(n){return[e.renderSlot(t.$slots,l,e.normalizeProps(e.guardReactiveProps(n||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",S,[e.createElementVNode("div",L,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,$)])])]),e.createElementVNode("div",H,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",z,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",P,[e.createElementVNode("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",O,[e.createElementVNode("div",A,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,j)):(e.openBlock(),e.createElementBlock("svg",R,I))],2)],8,G)]),e.createElementVNode("div",J,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",Q,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,U)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,Z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,ee)])]),e.createElementVNode("div",te,[e.createVNode(Et,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ne]})),_:2},1032,["id"])])])],8,K)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",le,oe,512)),(e.openBlock(),e.createElementBlock("svg",re,ce,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":n.third}])},[e.createElementVNode("div",ue,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,pe)):(e.openBlock(),e.createElementBlock("svg",ve,Ee))],2)],8,me)]),e.createElementVNode("div",ke,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ne,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,Ve)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,ye)])])])]),we,e.createElementVNode("div",Be,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.second.image}])},[n.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.second.image},null,8,Ce)):(e.openBlock(),e.createElementBlock("svg",_e,xe))],2)],8,be)]),e.createElementVNode("div",Se,[e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,Me)]),e.createElementVNode("div",De,[e.createElementVNode("div",$e,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,He)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",qe,ze)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.third.image}])},[n.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.third.image},null,8,Oe)):(e.openBlock(),e.createElementBlock("svg",Ae,Ge))],2)],8,Fe)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ue)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,Ye),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+n.bundle.amount},null,8,Ze)]),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,nt),e.createVNode(kt,{id:n.id,second:n.second.id,third:n.third?n.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",lt,ot,512)),(e.openBlock(),e.createElementBlock("svg",rt,ct,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",st,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",it,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dt),ut,mt,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:n[7]||(n[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",pt,[e.createVNode(ft,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)],2)},module.exports=c;
2
2
  //# sourceMappingURL=Cart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=222e3752&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","setup","store","useStore","loading","ref","items","computed","getters","modal","total","quantity","close","commit","dispatch","document","body","addEventListener","event","value","target","closest","window","e","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","products","forEach","item","push","id","attributes","code","price","brand","category","object","ecommerce","eventCallback","$ziggy","eventTimeout","dataLayer","setTimeout","error","console","_createElementVNode","role","_createElementBlock","_ctx","_hoisted_1","_hoisted_2","_renderSlot","onClick","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","innerHTML","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_19","_hoisted_20","_toDisplayString","_hoisted_22","_hoisted_23","_createBlock","_","slotProps","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","image","src","_hoisted_42","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","priceOld","_hoisted_51","_createVNode","_hoisted_52","_hoisted_53","_hoisted_56","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","third","_hoisted_63","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","second","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_93","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","bundle","amount","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_116","_hoisted_119","_hoisted_120","_hoisted_121","locale","url","_hoisted_124","_hoisted_125","slider"],"mappings":"uM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F,IACItF,mCAAY,QAAQe,UAAQZ,WAASf,MAAML,EAAKoG,OAAO/F,mBACvD+D,kBAAalE,GAAIF,EAAKE,GAAKmF,OAAQrF,EAAKqF,OAAOnF,GAAW0E,MAAO5E,EAAK4E,MAAQ5E,EAAK4E,MAAM1E,iFAOjHiB,2BAAAqF,2BAGArF,2BAAAsF,iEAKRtF,2BAAAuF,IACIzF,2BAAA0F,qBAAsBvF,4BACtBH,2BAAA2F,wCACOxF,kCACHH,qBAAoF,KAAhFtB,KAAMyB,OAAKyF,OAAOC,IAAM1F,OAAKyF,OAAOC,2BAAc1F,oCAAgC2F,uCAAS3F,kCAEnGH,qCAAc,kBAAmBO,sCAAOJ,yDAAUA,+BAClDH,2BAAA+F,IACI5C,kBAAS6C,QAAQ"}
1
+ {"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=7759facf&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","setup","store","useStore","loading","ref","items","computed","getters","modal","total","quantity","close","commit","dispatch","document","body","addEventListener","event","value","target","closest","window","e","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","products","forEach","item","push","id","attributes","code","price","brand","category","object","ecommerce","eventCallback","$ziggy","eventTimeout","dataLayer","setTimeout","error","console","_createElementVNode","role","_createElementBlock","_ctx","_hoisted_1","_hoisted_2","_renderSlot","onClick","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","innerHTML","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_19","_hoisted_20","_toDisplayString","_hoisted_22","_hoisted_23","_createBlock","_","slotProps","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","image","src","_hoisted_42","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","priceOld","_hoisted_51","_createVNode","_hoisted_52","_hoisted_53","_hoisted_56","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","third","_hoisted_63","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","second","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_93","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","bundle","amount","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_116","_hoisted_119","_hoisted_120","_hoisted_121","locale","url","_hoisted_124","_hoisted_125","slider"],"mappings":"uMAmQ6BA,kBAAgB,CACzCC,KAAM,OACNC,MAAO,CACHC,QAAS,CACLC,KAAMC,iBACG,IAGjBC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GAEdC,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBACrCC,EAAQF,YAAS,kBAAML,EAAMM,QAAQ,iBACrCE,EAAQH,YAAS,kBAAML,EAAMM,QAAQ,iBACrCG,EAAWJ,YAAS,kBAAML,EAAMM,QAAQ,oBAMxCI,EAAQ,WACVV,EAAMW,OAAO,aAAc,OAa/BX,EAAMY,SAAS,WAAY,SACd,eAGbC,SAASC,KAAKC,iBAAiB,SAA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uCAAS3F,kCAEnGH,qCAAc,kBAAmBO,sCAAOJ,yDAAUA,+BAClDH,2BAAA+F,IACI5C,kBAAS6C,QAAQ"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),n=e.defineComponent({name:"cart-trigger",setup:function(){var n=t.useStore();return{quantity:e.computed((function(){return n.getters["cart/quantity"]})),open:function(){n.commit("cart/modal",!0)},close:function(){n.commit("cart/modal",!1)}}}}),o={class:"cart"},r={class:"dropdown is-right is-hoverable"},a={class:"dropdown-trigger"},c=e.createElementVNode("svg",{width:"22",height:"19"},[e.createElementVNode("use",{"xlink:href":"#cart"})],-1),i=["textContent"];n.render=function(t,n,l,u,s,d){return e.openBlock(),e.createElementBlock("div",o,[e.createElementVNode("div",r,[e.createElementVNode("div",a,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open,close:t.close},(function(){return[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-products":t.quantity}]),onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[c,e.createElementVNode("span",{textContent:e.toDisplayString(t.quantity)},null,8,i)],2)]}))])])])},module.exports=n;
1
+ "use strict";var e=require("vue"),t=require("vuex"),n=e.defineComponent({name:"cart-trigger",setup:function(){var n=t.useStore();return{quantity:e.computed((function(){return n.getters["cart/quantity"]})),open:function(){n.commit("cart/modal","cart")},close:function(){n.commit("cart/modal",null)}}}}),o={class:"cart"},r={class:"dropdown is-right is-hoverable"},a={class:"dropdown-trigger"},c=e.createElementVNode("svg",{width:"22",height:"19"},[e.createElementVNode("use",{"xlink:href":"#cart"})],-1),i=["textContent"];n.render=function(t,n,l,u,s,d){return e.openBlock(),e.createElementBlock("div",o,[e.createElementVNode("div",r,[e.createElementVNode("div",a,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open,close:t.close},(function(){return[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-products":t.quantity}]),onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[c,e.createElementVNode("span",{textContent:e.toDisplayString(t.quantity)},null,8,i)],2)]}))])])])},module.exports=n;
2
2
  //# sourceMappingURL=CartTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CartTrigger.js","sources":["../../../../src/components/shop/cart/CartTrigger.vue","../../../../src/components/shop/cart/CartTrigger.vue?vue&type=template&id=6815b67f&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\" :close=\"close\">\n <button class=\"button\" @click=\"open\" v-bind:class=\"{ 'is-products': quantity }\">\n <svg width=\"22\" height=\"19\">\n <use xlink:href=\"#cart\" />\n </svg>\n <span v-text=\"quantity\"></span>\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n name: 'cart-trigger',\n setup() {\n const store = useStore();\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', true);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n return {\n quantity,\n open,\n close,\n };\n }\n});\n</script>\n","<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\" :close=\"close\">\n <button class=\"button\" @click=\"open\" v-bind:class=\"{ 'is-products': quantity }\">\n <svg width=\"22\" height=\"19\">\n <use xlink:href=\"#cart\" />\n </svg>\n <span v-text=\"quantity\"></span>\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n name: 'cart-trigger',\n setup() {\n const store = useStore();\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', true);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n return {\n quantity,\n open,\n close,\n };\n }\n});\n</script>\n"],"names":["defineComponent","name","setup","store","useStore","quantity","computed","getters","open","commit","close","_createElementVNode","width","height","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_renderSlot","total","_ctx","onClick","_hoisted_4","_toDisplayString"],"mappings":"sDAoBeA,kBAAgB,CAC3BC,KAAM,eACNC,qBACUC,EAAQC,mBAWP,CACHC,SAXaC,YAAS,kBAAMH,EAAMI,QAAQ,oBAY1CC,KAVS,WACTL,EAAMM,OAAO,cAAc,IAU3BC,MAPU,WACVP,EAAMM,OAAO,cAAc,iBC9BxB,iBACI,2CACI,sBAGCE,4BAAKC,MAAM,KAAKC,OAAO,OACnBF,yCAAgB,qFANxCG,2BAAAC,GACIJ,2BAAAK,GACIL,2BAAAM,GACIC,iCAAOC,MAAOC,WAAWZ,KAAMY,OAAOV,MAAOU,UAA7C,kBACIT,uDAAc,wBAAsDS,cAA5CC,sCAAOD,sCAC3BE,EAGAX,yCAAMY,kBAAQH"}
1
+ {"version":3,"file":"CartTrigger.js","sources":["../../../../src/components/shop/cart/CartTrigger.vue","../../../../src/components/shop/cart/CartTrigger.vue?vue&type=template&id=66c18fe1&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\" :close=\"close\">\n <button class=\"button\" @click=\"open\" v-bind:class=\"{ 'is-products': quantity }\">\n <svg width=\"22\" height=\"19\">\n <use xlink:href=\"#cart\" />\n </svg>\n <span v-text=\"quantity\"></span>\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n name: 'cart-trigger',\n setup() {\n const store = useStore();\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n return {\n quantity,\n open,\n close,\n };\n }\n});\n</script>\n","<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\" :close=\"close\">\n <button class=\"button\" @click=\"open\" v-bind:class=\"{ 'is-products': quantity }\">\n <svg width=\"22\" height=\"19\">\n <use xlink:href=\"#cart\" />\n </svg>\n <span v-text=\"quantity\"></span>\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n name: 'cart-trigger',\n setup() {\n const store = useStore();\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n return {\n quantity,\n open,\n close,\n };\n }\n});\n</script>\n"],"names":["defineComponent","name","setup","store","useStore","quantity","computed","getters","open","commit","close","_createElementVNode","width","height","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_renderSlot","total","_ctx","onClick","_hoisted_4","_toDisplayString"],"mappings":"sDAoBeA,kBAAgB,CAC3BC,KAAM,eACNC,qBACUC,EAAQC,mBAWP,CACHC,SAXaC,YAAS,kBAAMH,EAAMI,QAAQ,oBAY1CC,KAVS,WACTL,EAAMM,OAAO,aAAc,SAU3BC,MAPU,WACVP,EAAMM,OAAO,aAAc,oBC9BxB,iBACI,2CACI,sBAGCE,4BAAKC,MAAM,KAAKC,OAAO,OACnBF,yCAAgB,qFANxCG,2BAAAC,GACIJ,2BAAAK,GACIL,2BAAAM,GACIC,iCAAOC,MAAOC,WAAWZ,KAAMY,OAAOV,MAAOU,UAA7C,kBACIT,uDAAc,wBAAsDS,cAA5CC,sCAAOD,sCAC3BE,EAGAX,yCAAMY,kBAAQH"}
package/dist/store.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("@perevorot/shop/dist/api"),a={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(a,n){var e=a.commit;t.cart.items().then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(a,n){var e=a.commit,c=a.state;t.cart.add(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length?e("items",t.data.items):e("quantity",n.product),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},options:function(a,n){var e=a.commit,c=a.state;t.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(a,n){var e=a.commit;t.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(a,n){var e=a.commit;t.cart.remove(n.id).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(a,n){var e=a.commit;t.cart.clear(n.id).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function n(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var e=require("vue-toastification").useToast(),c={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal},is:function(t){return Object.keys(t.user).length>0}},o={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},i={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(a,n){var e=a.commit;t.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},l={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(a,n){var e=a.commit;t.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(a,n){var e=a.commit;t.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(a,n){a.commit,a.state,t.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(a,n){var e=a.commit;a.state,t.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},s={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},u={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},r={modules:{cart:a,auth:{namespaced:!0,state:{user:{},modal:!1,account:[]},getters:c,actions:{me:function(a,n){var c=a.commit;t.auth.me().then((function(t){c("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),e(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&c("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(a,n){var e=a.commit,c=a.dispatch;t.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),e("modal",null),document.documentElement.classList.remove("is-modal-open"),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(a,n){var e=a.commit;t.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(a,e){n(a),t.auth.reset(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a,!1,t.data)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},resetSms:function(a,e){n(a),t.auth.resetSms(e.credentials).then((function(t){e&&"function"==typeof e.callback&&e.callback(t.data,!1)})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.error&&e.callback(t.response.data,!0)})).finally(e.finally)},passwordUpdate:function(a,e){n(a),t.auth.passwordUpdate(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},register:function(a,n){a.commit,t.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(a,n){a.commit,t.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:o},wishlist:i,compare:l,review:s,order:u,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=r;
1
+ "use strict";var t=require("@perevorot/shop/dist/api"),a={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(a,n){var e=a.commit;t.cart.items().then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(a,n){var e=a.commit,c=a.state;t.cart.add(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length?e("items",t.data.items):e("quantity",n.product),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},options:function(a,n){var e=a.commit,c=a.state;t.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(a,n){var e=a.commit;t.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(a,n){var e=a.commit;t.cart.remove(n.id).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(a,n){var e=a.commit;t.cart.clear(n.id).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function n(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var e=require("vue-toastification").useToast(),c={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal},is:function(t){return Object.keys(t.user).length>0}},o={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},i={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(a,n){var e=a.commit;t.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},l={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(a,n){var e=a.commit;t.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(a,n){var e=a.commit;t.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(a,n){a.commit,a.state,t.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(a,n){var e=a.commit;a.state,t.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},s={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},u={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},r={modules:{cart:a,auth:{namespaced:!0,state:{user:{},modal:!1,account:[]},getters:c,actions:{me:function(a,n){var c=a.commit;t.auth.me().then((function(t){c("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),e(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&c("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(a,n){var e=a.commit,c=a.dispatch;t.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),e("modal",null),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(a,n){var e=a.commit;t.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(a,e){n(a),t.auth.reset(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a,!1,t.data)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},resetSms:function(a,e){n(a),t.auth.resetSms(e.credentials).then((function(t){e&&"function"==typeof e.callback&&e.callback(t.data,!1)})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.error&&e.callback(t.response.data,!0)})).finally(e.finally)},passwordUpdate:function(a,e){n(a),t.auth.passwordUpdate(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},register:function(a,n){a.commit,t.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(a,n){a.commit,t.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:o},wishlist:i,compare:l,review:s,order:u,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=r;
2
2
  //# sourceMappingURL=store.js.map
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sources":["../src/store/modules/cart.js","../src/store/modules/auth.js","../src/store/modules/wishlist.js","../src/store/modules/compare.js","../src/store/modules/review.js","../src/store/modules/order.js","../src/store/index.js","../src/store/modules/checkout.js"],"sourcesContent":["import {\n cart as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n cross: [],\n bundles: [],\n modal: false\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n\n cross: (state) => {\n return state.cross;\n },\n\n bundles: (state) => {\n return state.bundles;\n },\n\n productQuantity: (state, getters) => (id) => {\n const product = getters.items.find(product => product.id === id);\n\n return product ? product.quantity : 0;\n },\n\n quantity: (state, getters) => {\n let count = 0;\n\n getters.items.forEach((item) => {\n count += parseInt(item.quantity);\n });\n\n return count;\n },\n\n total: (state, getters) => {\n let total = 0;\n\n getters.items.forEach((item) => {\n let price = (item.attributes.price ? item.attributes.price : item.price);\n\n if (item.attributes.options && item.attributes.options.length && item.options && item.options.length) {\n let optionsPrice = 0;\n\n item.options.forEach(option => {\n if (item.attributes.options.indexOf(option.id) !== -1) {\n optionsPrice += parseInt(option.price);\n }\n });\n\n price += optionsPrice;\n }\n\n total +=\n price *\n (item.attributes.active === false ? 0 : item.quantity);\n });\n\n return total;\n },\n\n modal: (state) => {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n\n return state.modal;\n }\n}\n\nconst actions = {\n get({\n commit\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n add({\n commit,\n state\n }, data) {\n api.add(data.product).then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n } else {\n commit('quantity', data.product);\n }\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n options({\n commit,\n state\n }, data) {\n api.options(data.product).then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n quantity({\n commit\n }, data) {\n api.quantity(data.product).then(() => {\n commit('quantity', data.product);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n remove({\n commit\n }, data) {\n api.remove(data.id).then((response) => {\n commit('remove', data.id);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n clear({\n commit\n }, data) {\n api.clear(data.id).then(() => {\n commit('clear');\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n }\n}\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n\n items(state, items) {\n state.items = items;\n },\n\n cross(state, cross) {\n state.cross = cross;\n },\n\n bundles(state, bundles) {\n state.bundles = bundles;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n\n quantity(state, item) {\n const product = state.items.find(product => product.id === item.id);\n\n product.quantity = item.exact ? item.exact : (product.quantity + item.quantity);\n },\n\n clear(state) {\n state.items = [];\n state.cross = [];\n state.bundles = [];\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import { auth as api } from '@perevorot/shop/dist/api';\n// import {\n// useGlobalToast as useToast\n// } from \"@/global/toast\";\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n user: {},\n modal: false,\n account: [],\n};\n\nconst getters = {\n me: (state) => {\n return state.user;\n },\n account: (state) => {\n return state.account;\n },\n modal: (state) => {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n\n return state.modal;\n },\n is: (state) => {\n return Object.keys(state.user).length > 0;\n },\n};\n\nconst actions = {\n me({ commit }, data) {\n api.me()\n .then((response) => {\n commit('me', response.data);\n\n if (response.data.flash && response.data.flash.message) {\n console.error(response.data.flash.message);\n\n toast(response.data.flash.message, {\n type: response.data.flash.type ? response.data.flash.type : 'default',\n });\n }\n\n if (response.data.flash && response.data.flash.modal) {\n commit('modal', response.data.flash.modal);\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data && data.finally ? data.finally : () => {});\n },\n login({ commit, dispatch }, data) {\n api.login(data.credentials)\n .then((response) => {\n if (response.data.csrf_token) {\n $http.defaults.headers.common['X-CSRF-TOKEN'] = response.data.csrf_token;\n\n delete response.data.csrf_token;\n }\n\n commit('me', response.data);\n commit('modal', null);\n\n document.documentElement.classList.remove('is-modal-open');\n\n dispatch(\n 'cart/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n dispatch(\n 'wishlist/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n logout({ commit }, data) {\n api.logout().then(() => {\n commit('me', {\n user: {},\n account: [],\n });\n\n commit('wishlist/items', [], {\n root: true,\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n\n if (window.location.href.indexOf('/account') !== -1) {\n window.location.href = $env.locale.url + '/';\n }\n });\n },\n reset({}, data) {\n api.reset(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message, false, response.data);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n resetSms({}, data) {\n api.resetSms(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response.data, false);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.error) {\n data.callback(error.response.data, true);\n }\n }\n })\n .finally(data.finally);\n },\n passwordUpdate({}, data) {\n api.passwordUpdate(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n register({ commit }, data) {\n api['register' + data.type](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n update({ commit }, data) {\n api['update'](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n me(state, me) {\n state.user = Array.isArray(me.user) && !me.user.length ? {} : me.user;\n state.account = me.account;\n },\n modal(state, action) {\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import {\n wishlist as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n item: (state, getters) => (id) => {\n return getters.items.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n // badge: (state) => {\n // return state.items.length;\n // },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data && response.data.items) {\n commit('items', response.data.items);\n }\n\n if (response.data && response.data.last) {\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n items(state, items) {\n state.items = items;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n last(state, last) {\n state.last = last;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import { compare as api } from '@perevorot/shop/dist/api';\n\nconst state = {\n products: [],\n categories: [],\n list: [],\n last: '',\n modal: null,\n};\n\nconst getters = {\n products: (state) => {\n return state.products;\n },\n categories: (state) => {\n return state.categories;\n },\n product: (state, getters) => (id) => {\n return getters.products.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n last: (state) => {\n return state.last;\n },\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items()\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n category({ commit }, data) {\n api.category(data.slug)\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n list({ commit }, data) {\n api.list()\n .then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n toggle({ commit, state }, data) {\n api.toggle(data.id)\n .then((response) => {\n if (response.data) {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n delete({ commit, state }, data) {\n api.delete(data.id)\n .then((response) => {\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n modal({ commit, state }, data) {\n api.modal(data.id)\n .then((response) => {\n commit('modal', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n products(state, products) {\n state.products = products;\n },\n\n categories(state, categories) {\n state.categories = categories;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n remove(state, id) {\n state.products = state.products.filter((item) => item.id !== id);\n },\n\n last(state, last) {\n state.last = last;\n },\n\n modal(state, modal) {\n state.modal = modal;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","const state = {\n modal: false\n}\n\nconst getters = {\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n modal(state, action) {\n document.documentElement.classList[action ? 'add' : 'remove']('is-modal-open');\n\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","const state = {\n steps: {},\n current: 1,\n modal: false,\n}\n\nconst getters = {\n steps: (state) => {\n return state.steps;\n },\n current: (state) => {\n return state.current;\n },\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n step(state, data) {\n if (Number.isInteger(data)) {\n state.current = data;\n } else {\n if (data.data) {\n state.steps[data.step] = data.data;\n }\n }\n },\n stepInit(state, data) {\n if (!state.steps[data.step]) {\n state.steps[data.step] = data.data;\n }\n },\n reset(state) {\n state.steps = {};\n state.current = 1;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","import cart from './modules/cart';\nimport auth from './modules/auth';\nimport wishlist from './modules/wishlist';\nimport compare from './modules/compare';\nimport review from './modules/review';\nimport order from './modules/order';\nimport checkout from './modules/checkout';\n\nexport default {\n modules: {\n cart,\n auth,\n wishlist,\n compare,\n review,\n order,\n checkout,\n },\n strict: false,\n};","const state = {\n user: {},\n payment: null,\n shipping: null,\n shippingData: {},\n dontcall: false,\n comment: '',\n};\n\nconst getters = {\n user: (state, getters, rootState, rootGetters) => {\n return Object.keys(state.user).length ? state.user : JSON.parse(JSON.stringify(rootGetters['auth/me']));\n },\n shipping: (state) => {\n return state.shipping;\n },\n shippingData: (state) => {\n return state.shippingData;\n },\n payment: (state) => {\n return state.payment;\n },\n dontcall: (state) => {\n return state.dontcall;\n },\n comment: (state) => {\n return state.comment;\n },\n};\n\nconst mutations = {\n user(state, data) {\n state.user = data;\n },\n shipping(state, data) {\n state.shipping = data;\n },\n shippingData(state, data) {\n state.shippingData = data;\n },\n payment(state, data) {\n state.payment = data;\n },\n dontcall(state, data) {\n state.dontcall = data;\n },\n comment(state, data) {\n state.comment = data;\n },\n reset(state) {\n state.user = {};\n state.payment = null;\n state.shipping = null;\n state.shippingData = {};\n state.dontcall = false;\n state.comment = '';\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n"],"names":["namespaced","state","items","cross","bundles","modal","getters","productQuantity","id","product","find","quantity","count","forEach","item","parseInt","total","price","attributes","options","length","optionsPrice","option","indexOf","active","document","documentElement","classList","actions","get","data","commit","api","then","response","callback","add","remove","clear","mutations","action","filter","exact","toast","me","user","account","is","Object","keys","Array","isArray","list","last","toggle","products","categories","category","slug","steps","current","step","Number","isInteger","stepInit","reset","modules","cart","auth","flash","message","console","error","type","login","dispatch","credentials","csrf_token","$http","defaults","headers","common","root","window","localStorage","logout","location","href","$env","locale","url","errors","email","resetSms","passwordUpdate","register","update","wishlist","compare","review","order","checkout","payment","shipping","shippingData","dontcall","comment","rootState","rootGetters","JSON","parse","stringify","strict"],"mappings":"yDA6Ne,CACXA,YAAY,EACZC,MA3NU,CACVC,MAAO,GACPC,MAAO,GACPC,QAAS,GACTC,OAAO,GAwNPC,QArNY,CACZJ,MAAO,SAACD,UACGA,EAAMC,OAGjBC,MAAO,SAACF,UACGA,EAAME,OAGjBC,QAAS,SAACH,UACCA,EAAMG,SAGjBG,gBAAiB,SAACN,EAAOK,UAAY,SAACE,OAC5BC,EAAUH,EAAQJ,MAAMQ,MAAK,SAAAD,UAAWA,EAAQD,KAAOA,YAEtDC,EAAUA,EAAQE,SAAW,IAGxCA,SAAU,SAACV,EAAOK,OACVM,EAAQ,SAEZN,EAAQJ,MAAMW,SAAQ,SAACC,GACnBF,GAASG,SAASD,EAAKH,aAGpBC,GAGXI,MAAO,SAACf,EAAOK,OACPU,EAAQ,SAEZV,EAAQJ,MAAMW,SAAQ,SAACC,OACfG,EAASH,EAAKI,WAAWD,MAAQH,EAAKI,WAAWD,MAAQH,EAAKG,SAE9DH,EAAKI,WAAWC,SAAWL,EAAKI,WAAWC,QAAQC,QAAUN,EAAKK,SAAWL,EAAKK,QAAQC,OAAQ,KAC9FC,EAAe,EAEnBP,EAAKK,QAAQN,SAAQ,SAAAS,IACmC,IAAhDR,EAAKI,WAAWC,QAAQI,QAAQD,EAAOd,MACvCa,GAAgBN,SAASO,EAAOL,WAIxCA,GAASI,EAGbL,GACIC,IAC4B,IAA3BH,EAAKI,WAAWM,OAAmB,EAAIV,EAAKH,aAG9CK,GAGXX,MAAO,SAACJ,UACJwB,SAASC,gBAAgBC,UAAU1B,EAAMI,MAAQ,MAAQ,UAAU,iBAE5DJ,EAAMI,QA4JjBuB,QAxJY,CACZC,eAEGC,OADCC,IAAAA,OAEAC,OAAI9B,QAAQ+B,MAAK,SAACC,GACdH,EAAO,QAASG,EAASJ,KAAK5B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4C,KAAOf,GAEjByE,kBAAStG,EAAO6B,GACZ7B,EAAMsG,SAAWzE,GAErB0E,sBAAavG,EAAO6B,GAChB7B,EAAMuG,aAAe1E,GAEzBwE,iBAAQrG,EAAO6B,GACX7B,EAAMqG,QAAUxE,GAEpB2E,kBAASxG,EAAO6B,GACZ7B,EAAMwG,SAAW3E,GAErB4E,iBAAQzG,EAAO6B,GACX7B,EAAMyG,QAAU5E,GAEpBmC,eAAMhE,GACFA,EAAM4C,KAAO,GACb5C,EAAMqG,QAAU,KAChBrG,EAAMsG,SAAW,KACjBtG,EAAMuG,aAAe,GACrBvG,EAAMwG,UAAW,EACjBxG,EAAMyG,QAAU,ODrCpBM,QAAQ"}
1
+ {"version":3,"file":"store.js","sources":["../src/store/modules/cart.js","../src/store/modules/auth.js","../src/store/modules/wishlist.js","../src/store/modules/compare.js","../src/store/modules/review.js","../src/store/modules/order.js","../src/store/index.js","../src/store/modules/checkout.js"],"sourcesContent":["import { cart as api } from '@perevorot/shop/dist/api';\n\nconst state = {\n items: [],\n cross: [],\n bundles: [],\n modal: false,\n};\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n\n cross: (state) => {\n return state.cross;\n },\n\n bundles: (state) => {\n return state.bundles;\n },\n\n productQuantity: (state, getters) => (id) => {\n const product = getters.items.find((product) => product.id === id);\n\n return product ? product.quantity : 0;\n },\n\n quantity: (state, getters) => {\n let count = 0;\n\n getters.items.forEach((item) => {\n count += parseInt(item.quantity);\n });\n\n return count;\n },\n\n total: (state, getters) => {\n let total = 0;\n\n getters.items.forEach((item) => {\n let price = item.attributes.price ? item.attributes.price : item.price;\n\n if (item.attributes.options && item.attributes.options.length && item.options && item.options.length) {\n let optionsPrice = 0;\n\n item.options.forEach((option) => {\n if (item.attributes.options.indexOf(option.id) !== -1) {\n optionsPrice += parseInt(option.price);\n }\n });\n\n price += optionsPrice;\n }\n\n total += price * (item.attributes.active === false ? 0 : item.quantity);\n });\n\n return total;\n },\n\n modal: (state) => {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n }\n\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items()\n .then((response) => {\n commit('items', response.data.items);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n add({ commit, state }, data) {\n api.add(data.product)\n .then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n } else {\n commit('quantity', data.product);\n }\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n options({ commit, state }, data) {\n api.options(data.product)\n .then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n quantity({ commit }, data) {\n api.quantity(data.product)\n .then(() => {\n commit('quantity', data.product);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n remove({ commit }, data) {\n api.remove(data.id)\n .then((response) => {\n commit('remove', data.id);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n clear({ commit }, data) {\n api.clear(data.id)\n .then(() => {\n commit('clear');\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n\n items(state, items) {\n state.items = items;\n },\n\n cross(state, cross) {\n state.cross = cross;\n },\n\n bundles(state, bundles) {\n state.bundles = bundles;\n },\n\n remove(state, id) {\n state.items = state.items.filter((item) => item.id !== id);\n },\n\n quantity(state, item) {\n const product = state.items.find((product) => product.id === item.id);\n\n product.quantity = item.exact ? item.exact : product.quantity + item.quantity;\n },\n\n clear(state) {\n state.items = [];\n state.cross = [];\n state.bundles = [];\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import { auth as api } from '@perevorot/shop/dist/api';\n// import {\n// useGlobalToast as useToast\n// } from \"@/global/toast\";\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n user: {},\n modal: false,\n account: [],\n};\n\nconst getters = {\n me: (state) => {\n return state.user;\n },\n account: (state) => {\n return state.account;\n },\n modal: (state) => {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n }\n\n return state.modal;\n },\n is: (state) => {\n return Object.keys(state.user).length > 0;\n },\n};\n\nconst actions = {\n me({ commit }, data) {\n api.me()\n .then((response) => {\n commit('me', response.data);\n\n if (response.data.flash && response.data.flash.message) {\n console.error(response.data.flash.message);\n\n toast(response.data.flash.message, {\n type: response.data.flash.type ? response.data.flash.type : 'default',\n });\n }\n\n if (response.data.flash && response.data.flash.modal) {\n commit('modal', response.data.flash.modal);\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data && data.finally ? data.finally : () => {});\n },\n login({ commit, dispatch }, data) {\n api.login(data.credentials)\n .then((response) => {\n if (response.data.csrf_token) {\n $http.defaults.headers.common['X-CSRF-TOKEN'] = response.data.csrf_token;\n\n delete response.data.csrf_token;\n }\n\n commit('me', response.data);\n commit('modal', null);\n\n //document.documentElement.classList.remove('is-modal-open');\n\n dispatch(\n 'cart/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n dispatch(\n 'wishlist/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n logout({ commit }, data) {\n api.logout().then(() => {\n commit('me', {\n user: {},\n account: [],\n });\n\n commit('wishlist/items', [], {\n root: true,\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n\n if (window.location.href.indexOf('/account') !== -1) {\n window.location.href = $env.locale.url + '/';\n }\n });\n },\n reset({}, data) {\n api.reset(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message, false, response.data);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n resetSms({}, data) {\n api.resetSms(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response.data, false);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.error) {\n data.callback(error.response.data, true);\n }\n }\n })\n .finally(data.finally);\n },\n passwordUpdate({}, data) {\n api.passwordUpdate(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n register({ commit }, data) {\n api['register' + data.type](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n update({ commit }, data) {\n api['update'](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n me(state, me) {\n state.user = Array.isArray(me.user) && !me.user.length ? {} : me.user;\n state.account = me.account;\n },\n modal(state, action) {\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import {\n wishlist as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n item: (state, getters) => (id) => {\n return getters.items.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n // badge: (state) => {\n // return state.items.length;\n // },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data && response.data.items) {\n commit('items', response.data.items);\n }\n\n if (response.data && response.data.last) {\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n items(state, items) {\n state.items = items;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n last(state, last) {\n state.last = last;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import { compare as api } from '@perevorot/shop/dist/api';\n\nconst state = {\n products: [],\n categories: [],\n list: [],\n last: '',\n modal: null,\n};\n\nconst getters = {\n products: (state) => {\n return state.products;\n },\n categories: (state) => {\n return state.categories;\n },\n product: (state, getters) => (id) => {\n return getters.products.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n last: (state) => {\n return state.last;\n },\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items()\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n category({ commit }, data) {\n api.category(data.slug)\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n list({ commit }, data) {\n api.list()\n .then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n toggle({ commit, state }, data) {\n api.toggle(data.id)\n .then((response) => {\n if (response.data) {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n delete({ commit, state }, data) {\n api.delete(data.id)\n .then((response) => {\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n modal({ commit, state }, data) {\n api.modal(data.id)\n .then((response) => {\n commit('modal', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n products(state, products) {\n state.products = products;\n },\n\n categories(state, categories) {\n state.categories = categories;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n remove(state, id) {\n state.products = state.products.filter((item) => item.id !== id);\n },\n\n last(state, last) {\n state.last = last;\n },\n\n modal(state, modal) {\n state.modal = modal;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","const state = {\n modal: false\n}\n\nconst getters = {\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n modal(state, action) {\n document.documentElement.classList[action ? 'add' : 'remove']('is-modal-open');\n\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","const state = {\n steps: {},\n current: 1,\n modal: false,\n}\n\nconst getters = {\n steps: (state) => {\n return state.steps;\n },\n current: (state) => {\n return state.current;\n },\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n step(state, data) {\n if (Number.isInteger(data)) {\n state.current = data;\n } else {\n if (data.data) {\n state.steps[data.step] = data.data;\n }\n }\n },\n stepInit(state, data) {\n if (!state.steps[data.step]) {\n state.steps[data.step] = data.data;\n }\n },\n reset(state) {\n state.steps = {};\n state.current = 1;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","import cart from './modules/cart';\nimport auth from './modules/auth';\nimport wishlist from './modules/wishlist';\nimport compare from './modules/compare';\nimport review from './modules/review';\nimport order from './modules/order';\nimport checkout from './modules/checkout';\n\nexport default {\n modules: {\n cart,\n auth,\n wishlist,\n compare,\n review,\n order,\n checkout,\n },\n strict: false,\n};","const state = {\n user: {},\n payment: null,\n shipping: null,\n shippingData: {},\n dontcall: false,\n comment: '',\n};\n\nconst getters = {\n user: (state, getters, rootState, rootGetters) => {\n return Object.keys(state.user).length ? state.user : JSON.parse(JSON.stringify(rootGetters['auth/me']));\n },\n shipping: (state) => {\n return state.shipping;\n },\n shippingData: (state) => {\n return state.shippingData;\n },\n payment: (state) => {\n return state.payment;\n },\n dontcall: (state) => {\n return state.dontcall;\n },\n comment: (state) => {\n return state.comment;\n },\n};\n\nconst mutations = {\n user(state, data) {\n state.user = data;\n },\n shipping(state, data) {\n state.shipping = data;\n },\n shippingData(state, data) {\n state.shippingData = data;\n },\n payment(state, data) {\n state.payment = data;\n },\n dontcall(state, data) {\n state.dontcall = data;\n },\n comment(state, data) {\n state.comment = data;\n },\n reset(state) {\n state.user = {};\n state.payment = null;\n state.shipping = null;\n state.shippingData = {};\n state.dontcall = false;\n state.comment = '';\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n"],"names":["namespaced","state","items","cross","bundles","modal","getters","productQuantity","id","product","find","quantity","count","forEach","item","parseInt","total","price","attributes","options","length","optionsPrice","option","indexOf","active","document","documentElement","classList","actions","get","data","commit","api","then","response","callback","add","remove","clear","mutations","action","filter","exact","toast","me","user","account","is","Object","keys","Array","isArray","list","last","toggle","products","categories","category","slug","steps","current","step","Number","isInteger","stepInit","reset","modules","cart","auth","flash","message","console","error","type","login","dispatch","credentials","csrf_token","$http","defaults","headers","common","root","window","localStorage","logout","location","href","$env","locale","url","errors","email","resetSms","passwordUpdate","register","update","wishlist","compare","review","order","checkout","payment","shipping","shippingData","dontcall","comment","rootState","rootGetters","JSON","parse","stringify","strict"],"mappings":"yDA0Ne,CACXA,YAAY,EACZC,MA1NU,CACVC,MAAO,GACPC,MAAO,GACPC,QAAS,GACTC,OAAO,GAuNPC,QApNY,CACZJ,MAAO,SAACD,UACGA,EAAMC,OAGjBC,MAAO,SAACF,UACGA,EAAME,OAGjBC,QAAS,SAACH,UACCA,EAAMG,SAGjBG,gBAAiB,SAACN,EAAOK,UAAY,SAACE,OAC5BC,EAAUH,EAAQJ,MAAMQ,MAAK,SAACD,UAAYA,EAAQD,KAAOA,YAExDC,EAAUA,EAAQE,SAAW,IAGxCA,SAAU,SAACV,EAAOK,OACVM,EAAQ,SAEZN,EAAQJ,MAAMW,SAAQ,SAACC,GACnBF,GAASG,SAASD,EAAKH,aAGpBC,GAGXI,MAAO,SAACf,EAAOK,OACPU,EAAQ,SAEZV,EAAQJ,MAAMW,SAAQ,SAACC,OACfG,EAAQH,EAAKI,WAAWD,MAAQH,EAAKI,WAAWD,MAAQH,EAAKG,SAE7DH,EAAKI,WAAWC,SAAWL,EAAKI,WAAWC,QAAQC,QAAUN,EAAKK,SAAWL,EAAKK,QAAQC,OAAQ,KAC9FC,EAAe,EAEnBP,EAAKK,QAAQN,SAAQ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QAAS,IAwDTpG,QArDY,CACZuC,KAAM,SAAC5C,EAAOK,EAASqG,EAAWC,UACvB5D,OAAOC,KAAKhD,EAAM4C,MAAMzB,OAASnB,EAAM4C,KAAOgE,KAAKC,MAAMD,KAAKE,UAAUH,EAAY,cAE/FL,SAAU,SAACtG,UACAA,EAAMsG,UAEjBC,aAAc,SAACvG,UACJA,EAAMuG,cAEjBF,QAAS,SAACrG,UACCA,EAAMqG,SAEjBG,SAAU,SAACxG,UACAA,EAAMwG,UAEjBC,QAAS,SAACzG,UACCA,EAAMyG,UAqCjBnE,UAjCc,CACdM,cAAK5C,EAAO6B,GACR7B,EAAM4C,KAAOf,GAEjByE,kBAAStG,EAAO6B,GACZ7B,EAAMsG,SAAWzE,GAErB0E,sBAAavG,EAAO6B,GAChB7B,EAAMuG,aAAe1E,GAEzBwE,iBAAQrG,EAAO6B,GACX7B,EAAMqG,QAAUxE,GAEpB2E,kBAASxG,EAAO6B,GACZ7B,EAAMwG,SAAW3E,GAErB4E,iBAAQzG,EAAO6B,GACX7B,EAAMyG,QAAU5E,GAEpBmC,eAAMhE,GACFA,EAAM4C,KAAO,GACb5C,EAAMqG,QAAU,KAChBrG,EAAMsG,SAAW,KACjBtG,EAAMuG,aAAe,GACrBvG,EAAMwG,UAAW,EACjBxG,EAAMyG,QAAU,ODrCpBM,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.92",
3
+ "version": "2.0.94",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"