@perevorot/shop 2.0.28 → 2.0.29
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"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(l),r=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),r=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(){}}),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),N=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new c.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})),V=e.ref(null),f=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return V.value&&(p&&p.destroy(),e.length&&(p=new c.default(V.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:f.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)}));return{loading:r,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",!0)},close:u,clear:function(){r.value=!0,o.dispatch("cart/clear",{finally:function(){r.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",!1)})),window.location.href=e},cross:N,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:V,bundlesSliderPrev:g,bundlesSliderNext:f,checkout:function(){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={event:"checkout",ecommerce:{checkout:{products:[e]}},eventCallback:function(){window.location.href=$ziggy("shop.checkout")}};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout")}}}}),a={class:"cart"},s={class:"dropdown is-right is-hoverable"},i={class:"dropdown-trigger"},d=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),u=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),m={class:"dropdown-menu",role:"menu"},p={key:0,class:"dropdown-content"},v={class:"dropdown-item"},E={class:"columns"},k={class:"column"},N=["innerHTML"],V=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),f={class:"dropdown-item has-text-centered"},g={class:"dropdown-item has-text-centered"},h={key:1,class:"dropdown-content"},w=e.createElementVNode("div",{class:"dropdown-item"},"Ваша корзина пуста",-1),B={class:"modal-content"},y=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],b={class:"box"},C={class:"cart-title"},x=e.createTextVNode(" Корзина "),T=["textContent"],L={key:0,class:"items-wrapper"},M={class:"items"},S={class:"columns is-gapless is-vcentered main-actions"},H={class:"column"},q={class:"column has-text-right"},$={class:"totals"},z={class:"title"},P=e.createTextVNode(" Итого: "),D=["innerHTML"],_={class:"column is-narrow"},F={key:0,class:"cross"},O=e.createElementVNode("div",{class:"title"},"С товарами из вашей корзины часто покупают",-1),A={class:"swiper",ref:"crossSlider"},G={class:"swiper-wrapper"},j={class:"columns is-gapless"},I={class:"column is-narrow"},J=["onClick"],K=["src"],Q={key:1},R=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],U={class:"column"},W=["data-code"],X={class:"name"},Y=["onClick"],Z={class:"columns is-gapless is-vcentered"},ee={class:"column is-narrow"},te={class:"prices"},ne=["innerHTML"],le=["innerHTML"],oe={class:"column"},ce=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),re={class:"swiper-nav prev",ref:"crossSliderPrev"},ae=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],se={class:"swiper-nav next",ref:"crossSliderNext"},ie=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],de={key:1,class:"bundles"},ue=e.createElementVNode("div",{class:"title"},"Вместе дешевле",-1),me={class:"swiper",ref:"bundlesSlider"},pe={class:"swiper-wrapper"},ve={class:"column is-narrow"},Ee=["onClick"],ke=["src"],Ne={key:1},Ve=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],fe={class:"column"},ge={class:"product"},he={class:"name"},we=["onClick"],Be={class:"columns is-gapless is-vcentered"},ye={class:"prices"},be=["innerHTML"],Ce=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),xe={class:"column is-narrow"},Te=["onClick"],Le=["src"],Me={key:1},Se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],He={class:"column"},qe={class:"product"},$e={class:"name"},ze=["onClick"],Pe={class:"columns is-gapless is-vcentered"},De={class:"prices"},_e=["innerHTML"],Fe={key:0,class:"column is-narrow"},Oe=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Ae={key:1,class:"column is-narrow"},Ge=["onClick"],je=["src"],Ie={key:1},Je=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Ke={key:2,class:"column"},Qe={class:"product"},Re={class:"name"},Ue=["onClick"],We={class:"columns is-gapless is-vcentered"},Xe={class:"prices"},Ye=["innerHTML"],Ze={class:"columns is-vcentered"},et={class:"column"},tt=["innerHTML"],nt=["innerHTML"],lt={class:"column"},ot={class:"is-flex is-align-items-center"},ct=["innerHTML"],rt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},at=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],st={class:"swiper-nav next",ref:"bundlesSliderNext"},it=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],dt={key:1,class:"empty"},ut=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),mt={class:"message"},pt=e.createTextVNode(" Посмотрите предложения на "),vt=e.createTextVNode(", "),Et=e.createElementVNode("br",null,null,-1),kt=e.createTextVNode("воспользуйтесь каталогом или поиском "),Nt={class:"viewed-wrapper"};r.render=function(t,n,l,o,c,r){var Vt=e.resolveComponent("cart-item"),ft=e.resolveComponent("cart-add"),gt=e.resolveComponent("bundle-add"),ht=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",s,[e.createElementVNode("div",i,[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,[d,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),u])]}))]),e.createElementVNode("div",m,[t.items.length?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,N)])]),V,e.createElementVNode("div",f,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link"},e.toDisplayString(t.__("shop.cart.checkout")),1)]),e.createElementVNode("div",g,[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.openBlock(),e.createElementBlock("div",h,[e.renderSlot(t.$slots,"empty",{},(function(){return[w]}))]))])]),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",B,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},y),e.createElementVNode("div",b,[e.createElementVNode("div",C,[x,t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,T)):e.createCommentVNode("v-if",!0)]),t.items.length?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(Vt,{key:t.id,item:t},null,8,["item"])})),128))]),e.createElementVNode("div",S,[e.createElementVNode("div",H,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки")]),e.createElementVNode("div",q,[e.createElementVNode("div",$,[e.createElementVNode("div",z,[P,e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,D)])])]),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},"Оформить заказ")])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",F,[O,e.createElementVNode("div",A,[e.createElementVNode("div",G,[(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",j,[e.createElementVNode("div",I,[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,K)):(e.openBlock(),e.createElementBlock("svg",Q,R))],2)],8,J)]),e.createElementVNode("div",U,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",X,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,Y)]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,ne)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,le)])]),e.createElementVNode("div",oe,[e.createVNode(ft,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ce]})),_:2},1032,["id"])])])],8,W)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",re,ae,512)),(e.openBlock(),e.createElementBlock("svg",se,ie,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",de,[ue,e.createElementVNode("div",me,[e.createElementVNode("div",pe,[(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",ve,[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,ke)):(e.openBlock(),e.createElementBlock("svg",Ne,Ve))],2)],8,Ee)]),e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,we)]),e.createElementVNode("div",Be,[e.createElementVNode("div",ye,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,be)])])])]),Ce,e.createElementVNode("div",xe,[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,Le)):(e.openBlock(),e.createElementBlock("svg",Me,Se))],2)],8,Te)]),e.createElementVNode("div",He,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,ze)]),e.createElementVNode("div",Pe,[e.createElementVNode("div",De,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,_e)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",Fe,Oe)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Ae,[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,je)):(e.openBlock(),e.createElementBlock("svg",Ie,Je))],2)],8,Ge)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Re,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Ue)]),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ye)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,tt),e.createElementVNode("span",{class:"bundle-amount",innerHTML:"Выгода "+n.bundle.amount},null,8,nt)]),e.createElementVNode("div",lt,[e.createElementVNode("div",ot,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,ct),e.createVNode(gt,{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",rt,at,512)),(e.openBlock(),e.createElementBlock("svg",st,it,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",dt,[ut,e.createElementVNode("div",mt,[pt,e.createElementVNode("a",{onClick:n[7]||(n[7]=function(e){return t.goto(t.$env.locale.url+"/")})},"главной странице"),vt,Et,kt]),e.createElementVNode("button",{class:"button continue",onClick:n[8]||(n[8]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки"),e.createElementVNode("div",Nt,[e.createVNode(ht,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)])},module.exports=r;
|
|
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 c=o(l),r=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),r=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(){}}),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),N=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new c.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})),V=e.ref(null),f=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return V.value&&(p&&p.destroy(),e.length&&(p=new c.default(V.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:f.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)}));return{loading:r,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",!0)},close:u,clear:function(){r.value=!0,o.dispatch("cart/clear",{finally:function(){r.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",!1)})),window.location.href=e},cross:N,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:V,bundlesSliderPrev:g,bundlesSliderNext:f,checkout:function(){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")}};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout")}}}}),a={class:"cart"},s={class:"dropdown is-right is-hoverable"},i={class:"dropdown-trigger"},d=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),u=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),m={class:"dropdown-menu",role:"menu"},p={key:0,class:"dropdown-content"},v={class:"dropdown-item"},E={class:"columns"},k={class:"column"},N=["innerHTML"],V=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),f={class:"dropdown-item has-text-centered"},g={class:"dropdown-item has-text-centered"},h={key:1,class:"dropdown-content"},w=e.createElementVNode("div",{class:"dropdown-item"},"Ваша корзина пуста",-1),y={class:"modal-content"},B=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],b={class:"box"},C={class:"cart-title"},x=e.createTextVNode(" Корзина "),T=["textContent"],L={key:0,class:"items-wrapper"},M={class:"items"},S={class:"columns is-gapless is-vcentered main-actions"},H={class:"column"},q={class:"column has-text-right"},$={class:"totals"},z={class:"title"},P=e.createTextVNode(" Итого: "),D=["innerHTML"],_={class:"column is-narrow"},F={key:0,class:"cross"},O=e.createElementVNode("div",{class:"title"},"С товарами из вашей корзины часто покупают",-1),A={class:"swiper",ref:"crossSlider"},G={class:"swiper-wrapper"},j={class:"columns is-gapless"},I={class:"column is-narrow"},J=["onClick"],K=["src"],Q={key:1},R=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],U={class:"column"},W=["data-code"],X={class:"name"},Y=["onClick"],Z={class:"columns is-gapless is-vcentered"},ee={class:"column is-narrow"},te={class:"prices"},ne=["innerHTML"],le=["innerHTML"],oe={class:"column"},ce=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),re={class:"swiper-nav prev",ref:"crossSliderPrev"},ae=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],se={class:"swiper-nav next",ref:"crossSliderNext"},ie=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],de={key:1,class:"bundles"},ue=e.createElementVNode("div",{class:"title"},"Вместе дешевле",-1),me={class:"swiper",ref:"bundlesSlider"},pe={class:"swiper-wrapper"},ve={class:"column is-narrow"},Ee=["onClick"],ke=["src"],Ne={key:1},Ve=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],fe={class:"column"},ge={class:"product"},he={class:"name"},we=["onClick"],ye={class:"columns is-gapless is-vcentered"},Be={class:"prices"},be=["innerHTML"],Ce=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),xe={class:"column is-narrow"},Te=["onClick"],Le=["src"],Me={key:1},Se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],He={class:"column"},qe={class:"product"},$e={class:"name"},ze=["onClick"],Pe={class:"columns is-gapless is-vcentered"},De={class:"prices"},_e=["innerHTML"],Fe={key:0,class:"column is-narrow"},Oe=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Ae={key:1,class:"column is-narrow"},Ge=["onClick"],je=["src"],Ie={key:1},Je=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Ke={key:2,class:"column"},Qe={class:"product"},Re={class:"name"},Ue=["onClick"],We={class:"columns is-gapless is-vcentered"},Xe={class:"prices"},Ye=["innerHTML"],Ze={class:"columns is-vcentered"},et={class:"column"},tt=["innerHTML"],nt=["innerHTML"],lt={class:"column"},ot={class:"is-flex is-align-items-center"},ct=["innerHTML"],rt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},at=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],st={class:"swiper-nav next",ref:"bundlesSliderNext"},it=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],dt={key:1,class:"empty"},ut=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),mt={class:"message"},pt=e.createTextVNode(" Посмотрите предложения на "),vt=e.createTextVNode(", "),Et=e.createElementVNode("br",null,null,-1),kt=e.createTextVNode("воспользуйтесь каталогом или поиском "),Nt={class:"viewed-wrapper"};r.render=function(t,n,l,o,c,r){var Vt=e.resolveComponent("cart-item"),ft=e.resolveComponent("cart-add"),gt=e.resolveComponent("bundle-add"),ht=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",s,[e.createElementVNode("div",i,[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,[d,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),u])]}))]),e.createElementVNode("div",m,[t.items.length?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,N)])]),V,e.createElementVNode("div",f,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link"},e.toDisplayString(t.__("shop.cart.checkout")),1)]),e.createElementVNode("div",g,[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.openBlock(),e.createElementBlock("div",h,[e.renderSlot(t.$slots,"empty",{},(function(){return[w]}))]))])]),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)})},B),e.createElementVNode("div",b,[e.createElementVNode("div",C,[x,t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,T)):e.createCommentVNode("v-if",!0)]),t.items.length?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(Vt,{key:t.id,item:t},null,8,["item"])})),128))]),e.createElementVNode("div",S,[e.createElementVNode("div",H,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки")]),e.createElementVNode("div",q,[e.createElementVNode("div",$,[e.createElementVNode("div",z,[P,e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,D)])])]),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},"Оформить заказ")])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",F,[O,e.createElementVNode("div",A,[e.createElementVNode("div",G,[(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",j,[e.createElementVNode("div",I,[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,K)):(e.openBlock(),e.createElementBlock("svg",Q,R))],2)],8,J)]),e.createElementVNode("div",U,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",X,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,Y)]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,ne)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,le)])]),e.createElementVNode("div",oe,[e.createVNode(ft,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ce]})),_:2},1032,["id"])])])],8,W)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",re,ae,512)),(e.openBlock(),e.createElementBlock("svg",se,ie,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",de,[ue,e.createElementVNode("div",me,[e.createElementVNode("div",pe,[(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",ve,[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,ke)):(e.openBlock(),e.createElementBlock("svg",Ne,Ve))],2)],8,Ee)]),e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,we)]),e.createElementVNode("div",ye,[e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,be)])])])]),Ce,e.createElementVNode("div",xe,[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,Le)):(e.openBlock(),e.createElementBlock("svg",Me,Se))],2)],8,Te)]),e.createElementVNode("div",He,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,ze)]),e.createElementVNode("div",Pe,[e.createElementVNode("div",De,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,_e)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",Fe,Oe)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Ae,[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,je)):(e.openBlock(),e.createElementBlock("svg",Ie,Je))],2)],8,Ge)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Re,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Ue)]),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ye)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,tt),e.createElementVNode("span",{class:"bundle-amount",innerHTML:"Выгода "+n.bundle.amount},null,8,nt)]),e.createElementVNode("div",lt,[e.createElementVNode("div",ot,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,ct),e.createVNode(gt,{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",rt,at,512)),(e.openBlock(),e.createElementBlock("svg",st,it,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",dt,[ut,e.createElementVNode("div",mt,[pt,e.createElementVNode("a",{onClick:n[7]||(n[7]=function(e){return t.goto(t.$env.locale.url+"/")})},"главной странице"),vt,Et,kt]),e.createElementVNode("button",{class:"button continue",onClick:n[8]||(n[8]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки"),e.createElementVNode("div",Nt,[e.createVNode(ht,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)])},module.exports=r;
|
|
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=4fa80e58&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\">\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\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">Открыть корзину</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">Ваша корзина пуста</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 Корзина\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\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\"></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\">Продолжить покупки</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n Итого:\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\">Оформить заказ</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">С товарами из вашей корзины часто покупают</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\">Вместе дешевле</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=\"'Выгода ' + 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\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a @click=\"goto($env.locale.url + '/')\">главной странице</a>,\n <br />воспользуйтесь каталогом или поиском\n </div>\n <button class=\"button continue\" @click=\"close\">Продолжить покупки</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', true);\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\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.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 const checkout = () => {\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 'event': 'checkout',\n 'ecommerce': {\n 'checkout': {\n 'products': [products]\n }\n },\n 'eventCallback': function () {\n window.location.href = $ziggy('shop.checkout');\n }\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\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 };\n }\n});\n</script>","<template>\n <div class=\"cart\">\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\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">Открыть корзину</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">Ваша корзина пуста</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 Корзина\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\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\"></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\">Продолжить покупки</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n Итого:\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\">Оформить заказ</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">С товарами из вашей корзины часто покупают</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\">Вместе дешевле</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=\"'Выгода ' + 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\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a @click=\"goto($env.locale.url + '/')\">главной странице</a>,\n <br />воспользуйтесь каталогом или поиском\n </div>\n <button class=\"button continue\" @click=\"close\">Продолжить покупки</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', true);\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\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.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 const checkout = () => {\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 'event': 'checkout',\n 'ecommerce': {\n 'checkout': {\n 'products': [products]\n }\n },\n 'eventCallback': function () {\n window.location.href = $ziggy('shop.checkout');\n }\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\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 };\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","window","addEventListener","e","value","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","open","clear","pluralize","href","location","checkout","products","forEach","item","push","attributes","code","price","brand","category","object","$ziggy","dataLayer","ecommerce","_createElementVNode","role","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_renderSlot","_ctx","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","innerHTML","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_20","_hoisted_21","_toDisplayString","_hoisted_24","_hoisted_25","_createBlock","id","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","image","src","_hoisted_45","_hoisted_47","_hoisted_49","_hoisted_50","_hoisted_51","priceOld","_hoisted_54","_createVNode","_hoisted_55","_hoisted_56","_hoisted_59","_hoisted_62","_hoisted_63","_hoisted_64","_hoisted_65","third","_hoisted_66","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_80","second","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_91","_hoisted_93","_hoisted_96","_hoisted_102","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","_hoisted_109","_hoisted_110","bundle","amount","_hoisted_113","_hoisted_114","_hoisted_116","_hoisted_119","_hoisted_122","_hoisted_123","_hoisted_124","locale","url","_hoisted_127","_hoisted_129","slider"],"mappings":"uMA+P6BA,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,cAAc,IAa/BX,EAAMY,SAAS,WAAY,SACd,eAIbC,OAAOC,iBAAiB,SAAS,SAACC,GAC1BR,EAAMS,OAAmB,WAAVD,EAAEE,KACjBP,WAYJQ,EAwCAC,EAvCEC,EAAcjB,MAAI,MAClBkB,EAAkBlB,MAAI,MACtBmB,EAAkBnB,MAAI,MAEtBoB,EAAQlB,YAAS,eACbkB,EAAQvB,EAAMM,QAAQ,qBAExBc,EAAYJ,QACRE,GACAA,EAAYM,UAGZD,EAAME,SACNP,EAAc,IAAIQ,UAAON,EAAYJ,MAAO,CACxCW,cAAe,EACfC,eAAgB,EAChBC,YAAa,KACJ,CACDF,cAAe,EACfC,eAAgB,IAGxBE,aAAc,EACdC,gBAAgB,EAChBC,QAAS,CAACC,cACVC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQhB,EAAgBL,MACxBsB,OAAQhB,EAAgBN,WAMjCO,KAILgB,EAAgBpC,MAAI,MACpBqC,EAAoBrC,MAAI,MACxBsC,EAAoBtC,MAAI,MAExBuC,EAAUrC,YAAS,eACfq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":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=b1439c16&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\">\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\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">Открыть корзину</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">Ваша корзина пуста</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 Корзина\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\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\"></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\">Продолжить покупки</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n Итого:\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\">Оформить заказ</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">С товарами из вашей корзины часто покупают</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\">Вместе дешевле</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=\"'Выгода ' + 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\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a @click=\"goto($env.locale.url + '/')\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <button class=\"button continue\" @click=\"close\">Продолжить покупки</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', true);\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 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.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 const checkout = () => {\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 };\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\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 };\n }\n});\n</script>","<template>\n <div class=\"cart\">\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\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">Открыть корзину</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">Ваша корзина пуста</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 Корзина\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\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\"></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\">Продолжить покупки</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n Итого:\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\">Оформить заказ</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">С товарами из вашей корзины часто покупают</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\">Вместе дешевле</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=\"'Выгода ' + 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\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a @click=\"goto($env.locale.url + '/')\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <button class=\"button continue\" @click=\"close\">Продолжить покупки</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', true);\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 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.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 const checkout = () => {\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 };\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\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 };\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","window","addEventListener","e","value","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","open","clear","pluralize","href","location","checkout","products","forEach","item","push","id","attributes","code","price","brand","category","object","ecommerce","event","eventCallback","$ziggy","dataLayer","_createElementVNode","role","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_renderSlot","_ctx","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","innerHTML","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_20","_hoisted_21","_toDisplayString","_hoisted_24","_hoisted_25","_createBlock","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","image","src","_hoisted_45","_hoisted_47","_hoisted_49","_hoisted_50","_hoisted_51","priceOld","_hoisted_54","_createVNode","_hoisted_55","_hoisted_56","_hoisted_59","_hoisted_62","_hoisted_63","_hoisted_64","_hoisted_65","third","_hoisted_66","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_80","second","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_91","_hoisted_93","_hoisted_96","_hoisted_102","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","_hoisted_109","_hoisted_110","bundle","amount","_hoisted_113","_hoisted_114","_hoisted_116","_hoisted_119","_hoisted_122","_hoisted_123","_hoisted_124","locale","url","_hoisted_127","_hoisted_129","slider"],"mappings":"uMA8P6BA,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,cAAc,IAa/BX,EAAMY,SAAS,WAAY,SACd,eAGbC,OAAOC,iBAAiB,SAAS,SAACC,GAC1BR,EAAMS,OAAmB,WAAVD,EAAEE,KACjBP,WAYJQ,EAwCAC,EAvCEC,EAAcjB,MAAI,MAClBkB,EAAkBlB,MAAI,MACtBmB,EAAkBnB,MAAI,MAEtBoB,EAAQlB,YAAS,eACbkB,EAAQvB,EAAMM,QAAQ,qBAExBc,EAAYJ,QACRE,GACAA,EAAYM,UAGZD,EAAME,SACNP,EAAc,IAAIQ,UAAON,EAAYJ,MAAO,CACxCW,cAAe,EACfC,eAAgB,EAChBC,YAAa,KACJ,CACDF,cAAe,EACfC,eAAgB,IAGxBE,aAAc,EACdC,gBAAgB,EAChBC,QAAS,CAACC,cACVC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQhB,EAAgBL,MACxBsB,OAAQhB,EAAgBN,WAMjCO,KAILgB,EAAgBpC,MAAI,MACpBqC,EAAoBrC,MAAI,MACxBsC,EAAoBtC,MAAI,MAExBuC,EAAUrC,YAAS,eACfqC,EAAU1C,EAAMM,QAAQ,uBAE1BiC,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AAO,sBAC/CP,2BAAA8F,IACI5C,kBAAS6C,QAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),n=require("vuex"),o=require("formvuelate"),l=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),i=require("yup"),r=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=c(l),u=c(a),d=s(i),p=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var n=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==n.value.indexOf(e.id)})):[]}))}}}),v={key:0,class:"column is-12"},f=[e.createElementVNode("div",{class:"bundle-title"},"Вместе дешевле",-1)],h={class:"column name"},k={class:"column is-narrow"},g=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],y={class:"column"},b={class:"columns is-gapless mb-0"},B={class:"column"},C={key:0,class:"code"},w={class:"title"},T=["href"],x={class:"column is-2 has-text-centered is-relative"},_={class:"quantity"},S={key:0,class:"quantity-price"},M=["innerHTML"],L=e.createTextVNode(" / шт"),D={class:"column is-2 has-text-right"},H=["innerHTML"],q=["innerHTML"],O=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},P={class:"option-title"},j={class:"column is-2 has-text-right"},J=e.createTextVNode("+"),U=["innerHTML"],I={key:0,class:"bundle columns"},A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],W={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],ne={key:1,class:"bundle columns"},oe={class:"column is-narrow"},le=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],ie=["src"],re={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},me={key:0,class:"code"},ue={class:"title"},de=["href"];p.render=function(t,n,o,l,a,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",v,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",h,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,g)]),e.createElementVNode("div",y,[e.createElementVNode("div",b,[e.createElementVNode("div",B,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",C,"Код продукта: "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",w,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,T)])]),e.createElementVNode("div",x,[e.createElementVNode("div",_,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),L])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,H)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:"Выгода "+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,O)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,"Дополнительные услуги, "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(n,o){return e.openBlock(),e.createElementBlock("div",{key:o,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",P,e.toDisplayString(n.name),1)]),e.createElementVNode("div",j,[J,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",A,[G,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,Q)):(e.openBlock(),e.createElementBlock("svg",W,X))],2)],8,K)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,"Код продукта: "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",oe,[le,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,ie)):(e.openBlock(),e.createElementBlock("svg",re,ce))],2)],8,ae)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,"Код продукта: "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,de)])])])):e.createCommentVNode("v-if",!0)])],2)},e.markRaw(u.default);var pe=o.SchemaFormFactory([m.default({})]);window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ve=e.defineComponent({components:{CheckoutItem:p,SchemaForm:pe},name:"order-checkout",setup:function(){var l=r.useToast(),a=n.useStore(),i=e.ref(!1),c=e.computed((function(){return a.getters["cart/quantity"]})),s=e.computed((function(){return a.getters["cart/items"]})),m=e.computed((function(){return a.getters["cart/total"]})),p=e.computed((function(){return a.getters["auth/is"]})),v=e.computed((function(){return a.getters["checkout/user"]})),f=e.ref(!0),h=e.ref(null),k=e.ref(!1),g=e.ref(null),E=e.ref({}),V=e.ref([]),N=e.ref([]),y=e.ref("new"),b=e.ref(null),B=e.computed((function(){return a.getters["checkout/shippingData"]})),C=e.ref(!1),w=e.computed({get:function(){return a.getters["checkout/dontcall"]},set:function(e){a.commit("checkout/dontcall",e)}}),T=e.computed({get:function(){var e=a.getters["checkout/comment"];return e&&(C.value=!0),e},set:function(e){a.commit("checkout/comment",e)}});e.watch(T,(function(e){e.length>1e3&&(T.value=T.value.substring(0,1e3))}));var x=function(t){return e.computed({get:function(){return v.value[t]},set:function(e){var n=JSON.parse(JSON.stringify(v.value));n[t]=e,a.commit("checkout/user",n)}})},_=e.ref({last_name:x("last_name"),name:x("name"),email:x("email"),phone:x("phone")});a.dispatch("auth/me",{finally:function(){}});var S=e.computed({get:function(){return a.getters["checkout/shipping"]},set:function(e){a.commit("checkout/shipping",e)}}),M=e.computed({get:function(){return a.getters["checkout/payment"]},set:function(e){a.commit("checkout/payment",e)}}),L=e.computed((function(){return S.value?V.value.find((function(e){return e.id==S.value})):{}})),D=e.computed((function(){return M.value?N.value.find((function(e){return e.id==M.value})):{}})),H=e.computed((function(){return z(V.value,S.value)})),q=e.computed((function(){return z(N.value,M.value)})),O=e.computed((function(){return R(V.value)})),$=e.computed((function(){return R(N.value)})),F=e.computed((function(){var e=[];return s.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),z=function(e,t){var n=0;if(t){var o=e.find((function(e){return e.id==t}));o&&(n="sum"==o.type?o.amount:Math.round(m.value*o.amount/100))}return n},R=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var n=!0,o=e.restrictions;o.price_min&&o.price_max?(n=m.value>=o.price_min&&m.value<=o.price_max,e.restrictedForce=!n):o.price_min?(n=m.value>=o.price_min,e.restrictedForce=!n):o.price_max&&(n=m.value<=o.price_max,e.restrictedForce=!n),n&&S.value&&o.shipping_type&&o.shipping_type.length&&(n=-1!==o.shipping_type.indexOf(S.value)),n&&M.value&&o.payment_method&&o.payment_method.length&&(n=-1!==o.payment_method.indexOf(M.value)),n&&o.categories&&o.categories.length&&(n=!F.value.filter((function(e){return!o.categories.includes(e)})).length,e.restrictedForce=!n),e.restricted=!n}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},P=e.computed((function(){var e=0;return s.value.forEach((function(t){var n=0;t.attributes.priceOld&&(n=t.attributes.priceOld-t.attributes.price),e+=n*t.quantity})),e}));$http.post(window.location.href).then((function(e){V.value=e.data.shipping,N.value=e.data.payment})),e.watch(y,(function(e){"login"==e&&a.commit("auth/modal","login")}));var j=e.ref({last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name"},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name"},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}});o.useSchemaForm(_);var J=d.object().shape({last_name:d.string().trim().required(__("auth.validation.required")),name:d.string().trim().required(__("auth.validation.required")),phone:d.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:d.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required"))});window.addEventListener("beforeunload",(function(){a.commit("auth/modal",null)}));var U=function(){a.commit("checkout/reset")};return{auth:p,userType:y,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){y.value="new"},quantity:c,items:s,loading:i,pluralize:t.pluralize,discount:P,total:m,shipping:S,shippingPrice:H,payment:M,fee:q,userValidation:J,userSchema:j,userSubmitButton:b,checkout:function(){J.isValid(_.value).then((function(e){if(e)if(S.value)if(B.value[L.value.code]&&B.value[L.value.code].isValid)if(M.value){var t=JSON.parse(JSON.stringify(B.value[L.value.code]));delete t.isValid;var n={checkout:!0,user:{last_name:_.value.last_name,name:_.value.name,phone:_.value.phone,email:_.value.email},shipping:{id:S.value,data:t},payment:{id:M.value},comment:T.value,dontcall:w.value};i.value=!0,$http.post(window.location.href,n).then((function(e){if(e.data.redirect)E.value={url:e.data.redirect.url,data:e.data.redirect.data};else{var t=[];s.value.forEach((function(e){t.push({name:e.name,id:e.attributes.code,price:e.attributes.price,brand:e.attributes.brand,category:e.attributes.category,quantity:e.quantity})}));var n={ecommerce:{purchase:{actionField:{id:e.data.order.id,affiliation:"mrfix.ua",revenue:m.value+q.value+H.value,tax:"0",shipping:H.value},products:[t]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Checkout","gtm-ee-event-non-interaction":"False"};window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))}k.value=!0,g.value=e.data.order,U()})).catch((function(e){l("Ошибка сохранения заказа",{type:"error"}),console.error(e)})).finally((function(){i.value=!1}))}else l("Выберите вид оплаты",{type:"error"});else l("Заполните все поля для доставки: «"+L.value.name+"»",{type:"error"});else l("Выберите способ доставки",{type:"error"});else y.value="new",b.value.click(),l("Заполните данные получателя заказа",{type:"error"})}))},ifCheckoutReady:f,validate:function(){J.isValid(_.value).then((function(e){f.value=e&&M.value&&S.value&&(!L.value.component||L.value.component&&B.value[L.value.code]&&B.value[L.value.code].isValid)}))},shippingTypesRestricted:O,paymentMethodsRestricted:$,toggleShippingRadio:function(e){S.value===e&&(S.value=null)},togglePaymentRadio:function(e){M.value===e&&(M.value=null)},shippingSelected:L,paymentSelected:D,shippingComponentData:B,shippingStoreData:function(e,t,n){var o=JSON.parse(JSON.stringify(B.value));t.isValid=n,o[e]=t,a.commit("checkout/shippingData",o)},resertStore:U,user:_,dontcall:w,comment:T,isCommentToggled:C,commentMaxLength:1e3,userCheckout:v,thanks:k,order:g,redirect:E,redirectForm:h,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"}}}}),fe={class:"cart checkout"},he=["action"],ke=["name","value"],ge={key:1,class:"items-wrapper"},Ee=e.createElementVNode("div",{class:"checkout-title"},"Оформление заказа",-1),Ve={class:"columns"},Ne={class:"column"},ye={class:"checkout-block items"},be={class:"title-row"},Be={class:"items-title"},Ce=e.createTextVNode(" Ваш заказ "),we=["textContent"],Te=["innerHTML"],xe=["onClick"],_e=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),e.createElementVNode("span",null,"Редактировать заказ",-1)],Se={class:"checkout-block"},Me={class:"wrapper"},Le=e.createElementVNode("div",{class:"items-title"},"Контактные даные получателя заказа",-1),De={key:0,class:"user-tabs"},He=e.createTextVNode(" Я новый клиент "),qe=e.createTextVNode(" Я постоянный клиент "),Oe={class:"columns"},$e={class:"column user-form"},Fe={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={class:"column user-login user-form"},Re={class:"column"},Pe={key:0,class:"social-auth"},je={class:"socials"},Je=e.createElementVNode("div",{class:"description"},"Или авторизируйтесь через социальные сети:",-1),Ue={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ae=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ge={class:"wrapper"},Ke={class:"rows"},Qe={class:"item"},We={class:"row"},Xe=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Доставка")],-1),Ye={class:"row"},Ze={class:"info"},et=["value","onClick"],tt=["src"],nt={key:1,class:"icon"},ot=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],lt={key:0,class:"description"},at={class:"value"},it={key:0,class:"green"},rt=["innerHTML"],ct={class:"wrapper"},st={class:"rows"},mt={class:"item"},ut={class:"row"},dt=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Оплата")],-1),pt={class:"row no-icon"},vt={class:"info"},ft=["value","onClick"],ht={key:0,class:"description"},kt={key:0,class:"value"},gt=["innerHTML"],Et={class:"column is-4"},Vt={class:"checkout-block summary"},Nt=e.createElementVNode("div",{class:"items-title"},"Итого",-1),yt={class:"rows"},bt={class:"row"},Bt={class:"info"},Ct=["textContent"],wt=e.createTextVNode(" на сумму"),Tt={class:"value"},xt=["innerHTML"],_t={key:0,class:"row"},St=e.createElementVNode("div",{class:"info"},"Скидка",-1),Mt={class:"value"},Lt=["innerHTML"],Dt={key:1,class:"row"},Ht=e.createElementVNode("div",{class:"info"},"Сервисный сбор",-1),qt={class:"value"},Ot=["innerHTML"],$t={key:2,class:"row"},Ft=e.createElementVNode("div",{class:"info"},"Стоимость доставки",-1),zt={class:"value"},Rt=["innerHTML"],Pt={key:1,class:"green"},jt={class:"row"},Jt=e.createElementVNode("div",{class:"info"},"К оплате",-1),Ut={class:"value orange"},It=["innerHTML"],At={class:"checkbox-wrapper"},Gt=e.createTextVNode(" Мне можно не перезванивать для оформления заказа "),Kt=[e.createElementVNode("span",null,"Добавить комментарий к заказу",-1),e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1)],Qt={class:"user-form"},Wt={key:0,class:"chars-count"},Xt={key:2,class:"checkout-block thanks"},Yt={class:"title"},Zt=e.createTextVNode(" Заказ "),en=e.createTextVNode(" успешно создан! "),tn={class:"columns"},nn={key:0,class:"column is-6"},on=e.createElementVNode("div",{class:"subtitle"},"Перейдите к оплате для завершения покупки",-1),ln={key:1,class:"column is-6"},an={class:"column is-6"},rn={key:0,class:"info-wrapper"},cn=e.createElementVNode("div",{class:"title"},"Доставка",-1),sn={class:"columns"},mn=["innerHTML"],un=["innerHTML"],dn={key:1,class:"info-wrapper"},pn=e.createElementVNode("div",{class:"title"},"Оплата",-1),vn={class:"columns"},fn=["innerHTML"],hn=["innerHTML"],kn={key:3,class:"checkout-block empty"},gn=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),En={class:"message"},Vn=e.createTextVNode(" Посмотрите предложения на "),Nn=["href"],yn=e.createTextVNode(", "),bn=e.createElementVNode("br",null,null,-1),Bn=e.createTextVNode("воспользуйтесь каталогом или поиском "),Cn=["href"];ve.render=function(t,n,o,l,a,i){var r=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),m=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",fe,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,n,o){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:n,value:t,key:o},null,8,ke)})),128))],8,he)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",ge,[Ee,e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,[e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.createElementVNode("div",Be,[Ce,e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,we),e.createElementVNode("span",{innerHTML:"на сумму "+t.$filters.price(t.total)},null,8,Te)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(r,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(t){return[e.createElementVNode("button",{class:"button",onClick:t.open},_e,8,xe)]})),_:1})]),e.createElementVNode("button",{onClick:n[0]||(n[0]=function(){return t.resertStore&&t.resertStore.apply(t,arguments)}),style:{position:"fixed",bottom:"1px",right:"1px","z-index":"1000"}},"reset"),e.createElementVNode("div",Se,[e.createElementVNode("div",Me,[Le,t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[1]||(n[1]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),He]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[2]||(n[2]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),qe])])),e.createElementVNode("div",Oe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Fe,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(m,{"login-callback":t.loginCallback},null,8,["login-callback"])],512),[[e.vShow,"login"==t.userType]]),e.createElementVNode("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",je,[Je,e.createElementVNode("div",Ue,[e.createElementVNode("a",{class:"button",onClick:n[3]||(n[3]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:n[4]||(n[4]=function(){return t.google&&t.google.apply(t,arguments)})},Ae)])])]))])])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",We,[Xe,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":o.restricted}]),key:o.id},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[6]||(n[6]=function(e){return t.shipping=e}),value:o.id,onClick:function(e){return t.toggleShippingRadio(o.id)}},null,8,et),[[e.vModelRadio,t.shipping]]),o.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:o.icon},null,8,tt)):(e.openBlock(),e.createElementBlock("svg",nt,ot)),e.createElementVNode("span",null,e.toDisplayString(o.name),1)]),o.description?(e.openBlock(),e.createElementBlock("div",lt,e.toDisplayString(o.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",at,[!o.amount&&o.price_label?(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(o.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==o.type?o.amount+"%":t.$filters.price(o.amount)},null,8,rt))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:o},null,8,["commit","data","item"])),[[e.vShow,o.component&&o.id==t.shipping]])],2)})),128))])]),e.createElementVNode("div",ct,[e.createElementVNode("div",st,[e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[dt,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":o.restricted}]),key:o.id},[e.createElementVNode("div",pt,[e.createElementVNode("div",vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[8]||(n[8]=function(e){return t.payment=e}),value:o.id,onClick:function(e){return t.togglePaymentRadio(o.id)}},null,8,ft),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(o.name),1)]),o.description?(e.openBlock(),e.createElementBlock("div",ht,e.toDisplayString(o.description),1)):e.createCommentVNode("v-if",!0)]),o.amount?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("span",{innerHTML:"percent"==o.type?o.amount+"%":t.$filters.price(o.amount)},null,8,gt)])):e.createCommentVNode("v-if",!0)])],2)})),128))])])])]),e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[Nt,e.createElementVNode("div",yt,[e.createElementVNode("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Ct),wt]),e.createElementVNode("div",Tt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,xt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",_t,[St,e.createElementVNode("div",Mt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Lt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Dt,[Ht,e.createElementVNode("div",qt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,Ot)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",$t,[Ft,e.createElementVNode("div",zt,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,Rt)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",Pt,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",jt,[Jt,e.createElementVNode("div",Ut,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total+t.fee+t.shippingPrice)},null,8,It)])])]),e.createElementVNode("div",At,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":n[9]||(n[9]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),Gt])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:n[10]||(n[10]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:n[11]||(n[11]=function(){return t.validate&&t.validate.apply(t,arguments)})},"Подтвердить заказ",34),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:n[12]||(n[12]=function(e){return t.isCommentToggled=!t.isCommentToggled})},Kt),e.createElementVNode("div",Qt,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":n[13]||(n[13]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Wt,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,[Zt,e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),en]),e.createElementVNode("div",tn,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",nn,[on,e.createElementVNode("button",{class:"button is-payment",onClick:n[14]||(n[14]=function(e){return t.redirectForm.submit()})},"Перейти к оплате")])):(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("button",{class:"button is-orange",onClick:n[15]||(n[15]=function(){return t.home&&t.home.apply(t,arguments)})},"Продолжить покупки")])),e.createElementVNode("div",an,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",rn,[cn,e.createElementVNode("div",sn,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,mn)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,un)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",dn,[pn,e.createElementVNode("div",vn,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,fn)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,hn)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])])])):(e.openBlock(),e.createElementBlock("div",kn,[gn,e.createElementVNode("div",En,[Vn,e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},"главной странице",8,Nn),yn,bn,Bn]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},"Продолжить покупки",8,Cn)]))])},module.exports=ve;
|
|
1
|
+
"use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),n=require("vuex"),o=require("formvuelate"),l=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),i=require("yup"),r=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=c(l),u=c(a),d=s(i),p=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var n=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==n.value.indexOf(e.id)})):[]}))}}}),v={key:0,class:"column is-12"},f=[e.createElementVNode("div",{class:"bundle-title"},"Вместе дешевле",-1)],h={class:"column name"},k={class:"column is-narrow"},g=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],y={class:"column"},b={class:"columns is-gapless mb-0"},B={class:"column"},C={key:0,class:"code"},w={class:"title"},T=["href"],x={class:"column is-2 has-text-centered is-relative"},_={class:"quantity"},S={key:0,class:"quantity-price"},M=["innerHTML"],L=e.createTextVNode(" / шт"),D={class:"column is-2 has-text-right"},H=["innerHTML"],q=["innerHTML"],O=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},P={class:"option-title"},j={class:"column is-2 has-text-right"},J=e.createTextVNode("+"),U=["innerHTML"],I={key:0,class:"bundle columns"},A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],W={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],ne={key:1,class:"bundle columns"},oe={class:"column is-narrow"},le=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],ie=["src"],re={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},me={key:0,class:"code"},ue={class:"title"},de=["href"];p.render=function(t,n,o,l,a,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",v,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",h,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,g)]),e.createElementVNode("div",y,[e.createElementVNode("div",b,[e.createElementVNode("div",B,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",C,"Код продукта: "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",w,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,T)])]),e.createElementVNode("div",x,[e.createElementVNode("div",_,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),L])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,H)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:"Выгода "+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,O)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,"Дополнительные услуги, "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(n,o){return e.openBlock(),e.createElementBlock("div",{key:o,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",P,e.toDisplayString(n.name),1)]),e.createElementVNode("div",j,[J,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",A,[G,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,Q)):(e.openBlock(),e.createElementBlock("svg",W,X))],2)],8,K)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,"Код продукта: "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",oe,[le,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,ie)):(e.openBlock(),e.createElementBlock("svg",re,ce))],2)],8,ae)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,"Код продукта: "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,de)])])])):e.createCommentVNode("v-if",!0)])],2)},e.markRaw(u.default);var pe=o.SchemaFormFactory([m.default({})]);window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ve=e.defineComponent({components:{CheckoutItem:p,SchemaForm:pe},name:"order-checkout",setup:function(){var l=r.useToast(),a=n.useStore(),i=e.ref(!1),c=e.computed((function(){return a.getters["cart/quantity"]})),s=e.computed((function(){return a.getters["cart/items"]})),m=e.computed((function(){return a.getters["cart/total"]})),p=e.computed((function(){return a.getters["auth/is"]})),v=e.computed((function(){return a.getters["checkout/user"]})),f=e.ref(!0),h=e.ref(null),k=e.ref(!1),g=e.ref(null),E=e.ref({}),V=e.ref([]),N=e.ref([]),y=e.ref("new"),b=e.ref(null),B=e.computed((function(){return a.getters["checkout/shippingData"]})),C=e.ref(!1),w=e.computed({get:function(){return a.getters["checkout/dontcall"]},set:function(e){a.commit("checkout/dontcall",e)}}),T=e.computed({get:function(){var e=a.getters["checkout/comment"];return e&&(C.value=!0),e},set:function(e){a.commit("checkout/comment",e)}});e.watch(T,(function(e){e.length>1e3&&(T.value=T.value.substring(0,1e3))}));var x=function(t){return e.computed({get:function(){return v.value[t]},set:function(e){var n=JSON.parse(JSON.stringify(v.value));n[t]=e,a.commit("checkout/user",n)}})},_=e.ref({last_name:x("last_name"),name:x("name"),email:x("email"),phone:x("phone")});a.dispatch("auth/me",{finally:function(){}});var S=e.computed({get:function(){return a.getters["checkout/shipping"]},set:function(e){a.commit("checkout/shipping",e)}}),M=e.computed({get:function(){return a.getters["checkout/payment"]},set:function(e){a.commit("checkout/payment",e)}}),L=e.computed((function(){return S.value?V.value.find((function(e){return e.id==S.value})):{}})),D=e.computed((function(){return M.value?N.value.find((function(e){return e.id==M.value})):{}})),H=e.computed((function(){return z(V.value,S.value)})),q=e.computed((function(){return z(N.value,M.value)})),O=e.computed((function(){return R(V.value)})),$=e.computed((function(){return R(N.value)})),F=e.computed((function(){var e=[];return s.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),z=function(e,t){var n=0;if(t){var o=e.find((function(e){return e.id==t}));o&&(n="sum"==o.type?o.amount:Math.round(m.value*o.amount/100))}return n},R=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var n=!0,o=e.restrictions;o.price_min&&o.price_max?(n=m.value>=o.price_min&&m.value<=o.price_max,e.restrictedForce=!n):o.price_min?(n=m.value>=o.price_min,e.restrictedForce=!n):o.price_max&&(n=m.value<=o.price_max,e.restrictedForce=!n),n&&S.value&&o.shipping_type&&o.shipping_type.length&&(n=-1!==o.shipping_type.indexOf(S.value)),n&&M.value&&o.payment_method&&o.payment_method.length&&(n=-1!==o.payment_method.indexOf(M.value)),n&&o.categories&&o.categories.length&&(n=!F.value.filter((function(e){return!o.categories.includes(e)})).length,e.restrictedForce=!n),e.restricted=!n}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},P=e.computed((function(){var e=0;return s.value.forEach((function(t){var n=0;t.attributes.priceOld&&(n=t.attributes.priceOld-t.attributes.price),e+=n*t.quantity})),e}));$http.post(window.location.href).then((function(e){V.value=e.data.shipping,N.value=e.data.payment})),e.watch(y,(function(e){"login"==e&&a.commit("auth/modal","login")}));var j=e.ref({last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name"},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name"},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}});o.useSchemaForm(_);var J=d.object().shape({last_name:d.string().trim().required(__("auth.validation.required")),name:d.string().trim().required(__("auth.validation.required")),phone:d.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:d.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required"))});window.addEventListener("beforeunload",(function(){a.commit("auth/modal",null)}));var U=function(){a.commit("checkout/reset")};return{auth:p,userType:y,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){y.value="new"},quantity:c,items:s,loading:i,pluralize:t.pluralize,discount:P,total:m,shipping:S,shippingPrice:H,payment:M,fee:q,userValidation:J,userSchema:j,userSubmitButton:b,checkout:function(){J.isValid(_.value).then((function(e){if(e)if(S.value)if(B.value[L.value.code]&&B.value[L.value.code].isValid)if(M.value){var t=JSON.parse(JSON.stringify(B.value[L.value.code]));delete t.isValid;var n={checkout:!0,user:{last_name:_.value.last_name,name:_.value.name,phone:_.value.phone,email:_.value.email},shipping:{id:S.value,data:t},payment:{id:M.value},comment:T.value,dontcall:w.value};i.value=!0,$http.post(window.location.href,n).then((function(e){if(e.data.redirect)E.value={url:e.data.redirect.url,data:e.data.redirect.data};else{var t=[];s.value.forEach((function(e){t.push({name:e.name,id:e.attributes.code,price:e.attributes.price,brand:e.attributes.brand,category:e.attributes.category,quantity:e.quantity})}));var n={ecommerce:{purchase:{actionField:{id:e.data.order.id,affiliation:"mrfix.ua",revenue:m.value+q.value+H.value,tax:"0",shipping:H.value},products:[t]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Purchase","gtm-ee-event-non-interaction":"False"};window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))}k.value=!0,g.value=e.data.order,U()})).catch((function(e){l("Ошибка сохранения заказа",{type:"error"}),console.error(e)})).finally((function(){i.value=!1}))}else l("Выберите вид оплаты",{type:"error"});else l("Заполните все поля для доставки: «"+L.value.name+"»",{type:"error"});else l("Выберите способ доставки",{type:"error"});else y.value="new",b.value.click(),l("Заполните данные получателя заказа",{type:"error"})}))},ifCheckoutReady:f,validate:function(){J.isValid(_.value).then((function(e){f.value=e&&M.value&&S.value&&(!L.value.component||L.value.component&&B.value[L.value.code]&&B.value[L.value.code].isValid)}))},shippingTypesRestricted:O,paymentMethodsRestricted:$,toggleShippingRadio:function(e){S.value===e&&(S.value=null)},togglePaymentRadio:function(e){M.value===e&&(M.value=null)},shippingSelected:L,paymentSelected:D,shippingComponentData:B,shippingStoreData:function(e,t,n){var o=JSON.parse(JSON.stringify(B.value));t.isValid=n,o[e]=t,a.commit("checkout/shippingData",o)},resertStore:U,user:_,dontcall:w,comment:T,isCommentToggled:C,commentMaxLength:1e3,userCheckout:v,thanks:k,order:g,redirect:E,redirectForm:h,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"}}}}),fe={class:"cart checkout"},he=["action"],ke=["name","value"],ge={key:1,class:"items-wrapper"},Ee=e.createElementVNode("div",{class:"checkout-title"},"Оформление заказа",-1),Ve={class:"columns"},Ne={class:"column"},ye={class:"checkout-block items"},be={class:"title-row"},Be={class:"items-title"},Ce=e.createTextVNode(" Ваш заказ "),we=["textContent"],Te=["innerHTML"],xe=["onClick"],_e=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),e.createElementVNode("span",null,"Редактировать заказ",-1)],Se={class:"checkout-block"},Me={class:"wrapper"},Le=e.createElementVNode("div",{class:"items-title"},"Контактные даные получателя заказа",-1),De={key:0,class:"user-tabs"},He=e.createTextVNode(" Я новый клиент "),qe=e.createTextVNode(" Я постоянный клиент "),Oe={class:"columns"},$e={class:"column user-form"},Fe={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={class:"column user-login user-form"},Re={class:"column"},Pe={key:0,class:"social-auth"},je={class:"socials"},Je=e.createElementVNode("div",{class:"description"},"Или авторизируйтесь через социальные сети:",-1),Ue={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ae=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ge={class:"wrapper"},Ke={class:"rows"},Qe={class:"item"},We={class:"row"},Xe=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Доставка")],-1),Ye={class:"row"},Ze={class:"info"},et=["value","onClick"],tt=["src"],nt={key:1,class:"icon"},ot=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],lt={key:0,class:"description"},at={class:"value"},it={key:0,class:"green"},rt=["innerHTML"],ct={class:"wrapper"},st={class:"rows"},mt={class:"item"},ut={class:"row"},dt=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Оплата")],-1),pt={class:"row no-icon"},vt={class:"info"},ft=["value","onClick"],ht={key:0,class:"description"},kt={key:0,class:"value"},gt=["innerHTML"],Et={class:"column is-4"},Vt={class:"checkout-block summary"},Nt=e.createElementVNode("div",{class:"items-title"},"Итого",-1),yt={class:"rows"},bt={class:"row"},Bt={class:"info"},Ct=["textContent"],wt=e.createTextVNode(" на сумму"),Tt={class:"value"},xt=["innerHTML"],_t={key:0,class:"row"},St=e.createElementVNode("div",{class:"info"},"Скидка",-1),Mt={class:"value"},Lt=["innerHTML"],Dt={key:1,class:"row"},Ht=e.createElementVNode("div",{class:"info"},"Сервисный сбор",-1),qt={class:"value"},Ot=["innerHTML"],$t={key:2,class:"row"},Ft=e.createElementVNode("div",{class:"info"},"Стоимость доставки",-1),zt={class:"value"},Rt=["innerHTML"],Pt={key:1,class:"green"},jt={class:"row"},Jt=e.createElementVNode("div",{class:"info"},"К оплате",-1),Ut={class:"value orange"},It=["innerHTML"],At={class:"checkbox-wrapper"},Gt=e.createTextVNode(" Мне можно не перезванивать для оформления заказа "),Kt=[e.createElementVNode("span",null,"Добавить комментарий к заказу",-1),e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1)],Qt={class:"user-form"},Wt={key:0,class:"chars-count"},Xt={key:2,class:"checkout-block thanks"},Yt={class:"title"},Zt=e.createTextVNode(" Заказ "),en=e.createTextVNode(" успешно создан! "),tn={class:"columns"},nn={key:0,class:"column is-6"},on=e.createElementVNode("div",{class:"subtitle"},"Перейдите к оплате для завершения покупки",-1),ln={key:1,class:"column is-6"},an={class:"column is-6"},rn={key:0,class:"info-wrapper"},cn=e.createElementVNode("div",{class:"title"},"Доставка",-1),sn={class:"columns"},mn=["innerHTML"],un=["innerHTML"],dn={key:1,class:"info-wrapper"},pn=e.createElementVNode("div",{class:"title"},"Оплата",-1),vn={class:"columns"},fn=["innerHTML"],hn=["innerHTML"],kn={key:3,class:"checkout-block empty"},gn=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),En={class:"message"},Vn=e.createTextVNode(" Посмотрите предложения на "),Nn=["href"],yn=e.createTextVNode(", "),bn=e.createElementVNode("br",null,null,-1),Bn=e.createTextVNode("воспользуйтесь каталогом или поиском "),Cn=["href"];ve.render=function(t,n,o,l,a,i){var r=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),m=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",fe,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,n,o){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:n,value:t,key:o},null,8,ke)})),128))],8,he)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",ge,[Ee,e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,[e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.createElementVNode("div",Be,[Ce,e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,we),e.createElementVNode("span",{innerHTML:"на сумму "+t.$filters.price(t.total)},null,8,Te)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(r,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(t){return[e.createElementVNode("button",{class:"button",onClick:t.open},_e,8,xe)]})),_:1})]),e.createElementVNode("button",{onClick:n[0]||(n[0]=function(){return t.resertStore&&t.resertStore.apply(t,arguments)}),style:{position:"fixed",bottom:"1px",right:"1px","z-index":"1000"}},"reset"),e.createElementVNode("div",Se,[e.createElementVNode("div",Me,[Le,t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[1]||(n[1]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),He]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[2]||(n[2]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),qe])])),e.createElementVNode("div",Oe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Fe,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(m,{"login-callback":t.loginCallback},null,8,["login-callback"])],512),[[e.vShow,"login"==t.userType]]),e.createElementVNode("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",je,[Je,e.createElementVNode("div",Ue,[e.createElementVNode("a",{class:"button",onClick:n[3]||(n[3]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:n[4]||(n[4]=function(){return t.google&&t.google.apply(t,arguments)})},Ae)])])]))])])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",We,[Xe,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":o.restricted}]),key:o.id},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[6]||(n[6]=function(e){return t.shipping=e}),value:o.id,onClick:function(e){return t.toggleShippingRadio(o.id)}},null,8,et),[[e.vModelRadio,t.shipping]]),o.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:o.icon},null,8,tt)):(e.openBlock(),e.createElementBlock("svg",nt,ot)),e.createElementVNode("span",null,e.toDisplayString(o.name),1)]),o.description?(e.openBlock(),e.createElementBlock("div",lt,e.toDisplayString(o.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",at,[!o.amount&&o.price_label?(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(o.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==o.type?o.amount+"%":t.$filters.price(o.amount)},null,8,rt))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:o},null,8,["commit","data","item"])),[[e.vShow,o.component&&o.id==t.shipping]])],2)})),128))])]),e.createElementVNode("div",ct,[e.createElementVNode("div",st,[e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[dt,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":o.restricted}]),key:o.id},[e.createElementVNode("div",pt,[e.createElementVNode("div",vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[8]||(n[8]=function(e){return t.payment=e}),value:o.id,onClick:function(e){return t.togglePaymentRadio(o.id)}},null,8,ft),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(o.name),1)]),o.description?(e.openBlock(),e.createElementBlock("div",ht,e.toDisplayString(o.description),1)):e.createCommentVNode("v-if",!0)]),o.amount?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("span",{innerHTML:"percent"==o.type?o.amount+"%":t.$filters.price(o.amount)},null,8,gt)])):e.createCommentVNode("v-if",!0)])],2)})),128))])])])]),e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[Nt,e.createElementVNode("div",yt,[e.createElementVNode("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Ct),wt]),e.createElementVNode("div",Tt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,xt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",_t,[St,e.createElementVNode("div",Mt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Lt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Dt,[Ht,e.createElementVNode("div",qt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,Ot)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",$t,[Ft,e.createElementVNode("div",zt,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,Rt)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",Pt,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",jt,[Jt,e.createElementVNode("div",Ut,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total+t.fee+t.shippingPrice)},null,8,It)])])]),e.createElementVNode("div",At,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":n[9]||(n[9]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),Gt])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:n[10]||(n[10]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:n[11]||(n[11]=function(){return t.validate&&t.validate.apply(t,arguments)})},"Подтвердить заказ",34),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:n[12]||(n[12]=function(e){return t.isCommentToggled=!t.isCommentToggled})},Kt),e.createElementVNode("div",Qt,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":n[13]||(n[13]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Wt,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,[Zt,e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),en]),e.createElementVNode("div",tn,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",nn,[on,e.createElementVNode("button",{class:"button is-payment",onClick:n[14]||(n[14]=function(e){return t.redirectForm.submit()})},"Перейти к оплате")])):(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("button",{class:"button is-orange",onClick:n[15]||(n[15]=function(){return t.home&&t.home.apply(t,arguments)})},"Продолжить покупки")])),e.createElementVNode("div",an,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",rn,[cn,e.createElementVNode("div",sn,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,mn)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,un)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",dn,[pn,e.createElementVNode("div",vn,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,fn)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,hn)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])])])):(e.openBlock(),e.createElementBlock("div",kn,[gn,e.createElementVNode("div",En,[Vn,e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},"главной странице",8,Nn),yn,bn,Bn]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},"Продолжить покупки",8,Cn)]))])},module.exports=ve;
|
|
2
2
|
//# sourceMappingURL=Checkout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=497060f6&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=f8a79d38&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">Вместе дешевле</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">Код продукта: {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / шт</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"'Выгода ' + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>Дополнительные услуги, {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">Код продукта: {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">Код продукта: {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const itemOptions = computed(() => props.item.options && props.item.options.length ? props.item.options.filter(option => options.value.indexOf(option.id) !==-1) : []);\n\n return {\n itemOptions,\n };\n }\n});\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">Вместе дешевле</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">Код продукта: {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / шт</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"'Выгода ' + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>Дополнительные услуги, {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">Код продукта: {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">Код продукта: {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const itemOptions = computed(() => props.item.options && props.item.options.length ? props.item.options.filter(option => options.value.indexOf(option.id) !==-1) : []);\n\n return {\n itemOptions,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">Оформление заказа</div>\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"checkout-block items\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n Ваш заказ\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n <span v-html=\"'на сумму ' + $filters.price(total)\"></span>\n </div>\n </div>\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>Редактировать заказ</span>\n </button>\n </template>\n </cart-trigger>\n </div>\n <button @click=\"resertStore\" style=\"position: fixed; bottom: 1px; right: 1px; z-index: 1000\">reset</button>\n <div class=\"checkout-block\">\n <div class=\"wrapper\">\n <div class=\"items-title\">Контактные даные получателя заказа</div>\n <div class=\"user-tabs\" v-if=\"!auth\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" /> Я новый клиент </label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" /> Я постоянный клиент </label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">Или авторизируйтесь через социальные сети:</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Доставка</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Оплата</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"items-title\">Итого</div>\n <div class=\"rows\">\n <div class=\"row\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> на сумму</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"discount\">\n <div class=\"info\">Скидка</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"fee > 0\">\n <div class=\"info\">Сервисный сбор</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"shipping\">\n <div class=\"info\">Стоимость доставки</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"info\">К оплате</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(total + fee + shippingPrice)\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" /> Мне можно не перезванивать для оформления заказа </label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">Подтвердить заказ</button>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>Добавить комментарий к заказу</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <div class=\"title\">\n Заказ\n <span>№{{ order.id }}</span> успешно создан!\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">Перейдите к оплате для завершения покупки</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">Перейти к оплате</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">Продолжить покупки</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">Доставка</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">Оплата</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"checkout-block empty\">\n <div class=\"title\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">Продолжить покупки</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n name: 'order-checkout',\n setup() {\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone')\n });\n\n store.dispatch('auth/me', {\n finally: () => {}\n });\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchema = ref({\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name'\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n mask: '(###) ###-##-##',\n type: 'phone'\n //placeholder: '(050) 123-45-67'\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n }\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const userValidation = yup.object().shape({\n last_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'))\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = () => {\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast('Заполните данные получателя заказа', {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast('Выберите способ доставки', {\n type: 'error'\n });\n } else if (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid) {\n toast('Заполните все поля для доставки: «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast('Выберите вид оплаты', {\n type: 'error'\n });\n } else {\n let data = JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code]));\n delete data.isValid;\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email\n },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\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 purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\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 };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n resertStore();\n\n // nextTick(() => {\n // redirectForm.value.submit();\n // });\n })\n .catch((e) => {\n toast('Ошибка сохранения заказа', {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">Оформление заказа</div>\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"checkout-block items\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n Ваш заказ\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n <span v-html=\"'на сумму ' + $filters.price(total)\"></span>\n </div>\n </div>\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>Редактировать заказ</span>\n </button>\n </template>\n </cart-trigger>\n </div>\n <button @click=\"resertStore\" style=\"position: fixed; bottom: 1px; right: 1px; z-index: 1000\">reset</button>\n <div class=\"checkout-block\">\n <div class=\"wrapper\">\n <div class=\"items-title\">Контактные даные получателя заказа</div>\n <div class=\"user-tabs\" v-if=\"!auth\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" /> Я новый клиент </label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" /> Я постоянный клиент </label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">Или авторизируйтесь через социальные сети:</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Доставка</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Оплата</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"items-title\">Итого</div>\n <div class=\"rows\">\n <div class=\"row\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> на сумму</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"discount\">\n <div class=\"info\">Скидка</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"fee > 0\">\n <div class=\"info\">Сервисный сбор</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"shipping\">\n <div class=\"info\">Стоимость доставки</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"info\">К оплате</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(total + fee + shippingPrice)\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" /> Мне можно не перезванивать для оформления заказа </label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">Подтвердить заказ</button>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>Добавить комментарий к заказу</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <div class=\"title\">\n Заказ\n <span>№{{ order.id }}</span> успешно создан!\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">Перейдите к оплате для завершения покупки</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">Перейти к оплате</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">Продолжить покупки</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">Доставка</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">Оплата</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"checkout-block empty\">\n <div class=\"title\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">Продолжить покупки</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n name: 'order-checkout',\n setup() {\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone')\n });\n\n store.dispatch('auth/me', {\n finally: () => {}\n });\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchema = ref({\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name'\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n mask: '(###) ###-##-##',\n type: 'phone'\n //placeholder: '(050) 123-45-67'\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n }\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const userValidation = yup.object().shape({\n last_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'))\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = () => {\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast('Заполните данные получателя заказа', {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast('Выберите способ доставки', {\n type: 'error'\n });\n } else if (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid) {\n toast('Заполните все поля для доставки: «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast('Выберите вид оплаты', {\n type: 'error'\n });\n } else {\n let data = JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code]));\n delete data.isValid;\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email\n },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\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 purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\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 };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n resertStore();\n\n // nextTick(() => {\n // redirectForm.value.submit();\n // });\n })\n .catch((e) => {\n toast('Ошибка сохранения заказа', {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_4","_hoisted_5","href","image","src","_hoisted_11","_hoisted_12","_hoisted_13","code","_hoisted_14","_hoisted_15","_hoisted_17","_hoisted_18","quantity","parseInt","_hoisted_19","innerHTML","price","_hoisted_22","priceOld","amount","percent","sum","_hoisted_26","_hoisted_27","_hoisted_28","index","key","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_34","_hoisted_35","_hoisted_36","second","_hoisted_42","_hoisted_43","_hoisted_44","third","_hoisted_46","_hoisted_47","_hoisted_48","_hoisted_54","_hoisted_55","_hoisted_56","markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","dontcall","get","set","commit","comment","watch","substring","field","data","JSON","parse","stringify","user","last_name","email","phone","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","type","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","then","response","userSchema","component","label","__","model","mask","useSchemaForm","userValidation","yup","object","shape","string","trim","required","matches","addEventListener","resertStore","facebook","$ziggy","provider","google","loginCallback","pluralize","checkout","isValid","valid","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","dataLayer","e","console","error","click","validate","isUserValid","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","$env","locale","action","method","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_toDisplayString","_createBlock","_createVNode","onClick","open","style","_hoisted_20","_hoisted_21","_hoisted_24","_hoisted_25","schemaRowClasses","schema","afterForm","_hoisted_32","_hoisted_39","_hoisted_40","_hoisted_41","_hoisted_45","icon","_hoisted_49","description","_hoisted_52","_hoisted_53","price_label","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_66","_hoisted_68","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_76","_hoisted_78","_hoisted_79","_hoisted_80","_hoisted_82","_hoisted_83","_hoisted_84","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_91","_hoisted_92","_hoisted_93","_hoisted_95","onMouseenter","_hoisted_100","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_106","_hoisted_107","_hoisted_108","submit","_hoisted_109","_hoisted_110","_hoisted_111","_hoisted_112","_hoisted_113","_hoisted_116","_hoisted_117","_hoisted_118","_hoisted_121","_hoisted_122","_hoisted_123","_hoisted_127"],"mappings":"yoBA0F6BA,kBAAgB,CACzCC,KAAM,eACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAUC,YAAS,kBAAML,EAAMC,KAAKK,WAAWF,SAAWJ,EAAMC,KAAKK,WAAWF,QAAQG,OAASP,EAAMC,KAAKK,WAAWF,QAAU,YAGhI,CACHI,YAHgBH,YAAS,kBAAML,EAAMC,KAAKG,SAAWJ,EAAMC,KAAKG,QAAQG,OAASP,EAAMC,KAAKG,QAAQK,QAAO,SAAAC,UAA+C,IAArCN,EAAQO,MAAMC,QAAQF,EAAOG,OAAa,yBC/FxJ,mBACPC,kCAAW,gBAAe,+BAEnB,wBAEQ,sDAIaA,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,wEAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,yBACI,kBACA,q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6CAA0E,wBACvIF,oDAAW,6BAA6CE,wBACpDF,kCAAW,UAAWgN,yCAAO9M,oBAAoBA,0BAMjDF,2BAAAmQ,qBACInQ,uCAAgB,kEAAoBE,wCAAAA,aACLA,UAAQT,sBAAvCQ,2BAAAmQ,qBAAkDlQ,mBAAmBA,UAAQT,2DAOvDS,UAAUA,uBAAxDD,2BAAAoQ,IACIrQ,2BAAAsQ,OAEItQ,iCAAM,sBAAIE,QAAMH,YAEpBC,2BAAAuQ,IACmCrQ,WAAS0K,mBAAxC3K,2BAAAuQ,IACIC,GACAzQ,qCAAc,oBAAqBgN,yCAAO9M,eAAawQ,YAAU,sCAErEzQ,2BAAA0Q,IACI3Q,qCAAc,mBAAoBgN,wCAAO9M,qCAAM,yBAEnDF,2BAAA4Q,IACoC1Q,QAAM0G,2BAAtC3G,2BAAA4Q,IACIC,GACA9Q,2BAAA+Q,IACmC7Q,QAAM0G,2BAArC3G,wCAAW,cAAuCoB,UAAQnB,QAAM0G,yDACjC1G,QAAM0G,2BAArC3G,wCAAW,cAAuCoB,UAAQnB,QAAM0G,8FAGxC1G,QAAM2G,0BAAtC5G,2BAAA+Q,IACIC,GACAjR,2BAAAkR,IACmChR,QAAM2G,0BAArC5G,wCAAW,cAAsCoB,UAAQnB,QAAM2G,wDAChC3G,QAAM2G,0BAArC5G,wCAAW,cAAsCoB,UAAQnB,QAAM2G,mHAMnF5G,2BAAAkR,IACIC,GACApR,2BAAAqR,OAEIrR,qBAAuE,KAAnEO,KAAML,OAAKmM,OAAOzB,IAAM1K,OAAKmM,OAAOzB,SAAW,4BAAsB0G,QAE7EtR,gCAAS,kBAAmBO,KAAML,OAAKmM,OAAOzB,IAAM1K,OAAKmM,OAAOzB,SAAW"}
|
|
1
|
+
{"version":3,"file":"Checkout.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=497060f6&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=0831bc5f&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">Вместе дешевле</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">Код продукта: {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / шт</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"'Выгода ' + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>Дополнительные услуги, {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">Код продукта: {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">Код продукта: {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const itemOptions = computed(() => props.item.options && props.item.options.length ? props.item.options.filter(option => options.value.indexOf(option.id) !==-1) : []);\n\n return {\n itemOptions,\n };\n }\n});\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">Вместе дешевле</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">Код продукта: {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / шт</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"'Выгода ' + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>Дополнительные услуги, {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">Код продукта: {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">Код продукта: {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const itemOptions = computed(() => props.item.options && props.item.options.length ? props.item.options.filter(option => options.value.indexOf(option.id) !==-1) : []);\n\n return {\n itemOptions,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">Оформление заказа</div>\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"checkout-block items\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n Ваш заказ\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n <span v-html=\"'на сумму ' + $filters.price(total)\"></span>\n </div>\n </div>\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>Редактировать заказ</span>\n </button>\n </template>\n </cart-trigger>\n </div>\n <button @click=\"resertStore\" style=\"position: fixed; bottom: 1px; right: 1px; z-index: 1000\">reset</button>\n <div class=\"checkout-block\">\n <div class=\"wrapper\">\n <div class=\"items-title\">Контактные даные получателя заказа</div>\n <div class=\"user-tabs\" v-if=\"!auth\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" /> Я новый клиент </label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" /> Я постоянный клиент </label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">Или авторизируйтесь через социальные сети:</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Доставка</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Оплата</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"items-title\">Итого</div>\n <div class=\"rows\">\n <div class=\"row\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> на сумму</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"discount\">\n <div class=\"info\">Скидка</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"fee > 0\">\n <div class=\"info\">Сервисный сбор</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"shipping\">\n <div class=\"info\">Стоимость доставки</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"info\">К оплате</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(total + fee + shippingPrice)\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" /> Мне можно не перезванивать для оформления заказа </label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">Подтвердить заказ</button>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>Добавить комментарий к заказу</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <div class=\"title\">\n Заказ\n <span>№{{ order.id }}</span> успешно создан!\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">Перейдите к оплате для завершения покупки</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">Перейти к оплате</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">Продолжить покупки</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">Доставка</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">Оплата</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"checkout-block empty\">\n <div class=\"title\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">Продолжить покупки</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n name: 'order-checkout',\n setup() {\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone')\n });\n\n store.dispatch('auth/me', {\n finally: () => {}\n });\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchema = ref({\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name'\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n mask: '(###) ###-##-##',\n type: 'phone'\n //placeholder: '(050) 123-45-67'\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n }\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const userValidation = yup.object().shape({\n last_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'))\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = () => {\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast('Заполните данные получателя заказа', {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast('Выберите способ доставки', {\n type: 'error'\n });\n } else if (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid) {\n toast('Заполните все поля для доставки: «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast('Выберите вид оплаты', {\n type: 'error'\n });\n } else {\n let data = JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code]));\n delete data.isValid;\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email\n },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\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 purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False'\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n resertStore();\n\n // nextTick(() => {\n // redirectForm.value.submit();\n // });\n })\n .catch((e) => {\n toast('Ошибка сохранения заказа', {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">Оформление заказа</div>\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"checkout-block items\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n Ваш заказ\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n <span v-html=\"'на сумму ' + $filters.price(total)\"></span>\n </div>\n </div>\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>Редактировать заказ</span>\n </button>\n </template>\n </cart-trigger>\n </div>\n <button @click=\"resertStore\" style=\"position: fixed; bottom: 1px; right: 1px; z-index: 1000\">reset</button>\n <div class=\"checkout-block\">\n <div class=\"wrapper\">\n <div class=\"items-title\">Контактные даные получателя заказа</div>\n <div class=\"user-tabs\" v-if=\"!auth\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" /> Я новый клиент </label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" /> Я постоянный клиент </label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">Или авторизируйтесь через социальные сети:</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Доставка</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <div class=\"wrapper\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">Оплата</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">Очистить</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"items-title\">Итого</div>\n <div class=\"rows\">\n <div class=\"row\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> на сумму</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"discount\">\n <div class=\"info\">Скидка</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"fee > 0\">\n <div class=\"info\">Сервисный сбор</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row\" v-if=\"shipping\">\n <div class=\"info\">Стоимость доставки</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"info\">К оплате</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(total + fee + shippingPrice)\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" /> Мне можно не перезванивать для оформления заказа </label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">Подтвердить заказ</button>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>Добавить комментарий к заказу</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <div class=\"title\">\n Заказ\n <span>№{{ order.id }}</span> успешно создан!\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">Перейдите к оплате для завершения покупки</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">Перейти к оплате</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">Продолжить покупки</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">Доставка</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">Оплата</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"checkout-block empty\">\n <div class=\"title\">В корзине пока что нет товаров</div>\n <div class=\"message\">\n Посмотрите предложения на\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">главной странице</a>, <br />воспользуйтесь каталогом или поиском\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">Продолжить покупки</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n name: 'order-checkout',\n setup() {\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone')\n });\n\n store.dispatch('auth/me', {\n finally: () => {}\n });\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchema = ref({\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name'\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n mask: '(###) ###-##-##',\n type: 'phone'\n //placeholder: '(050) 123-45-67'\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n }\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const userValidation = yup.object().shape({\n last_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'))\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = () => {\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast('Заполните данные получателя заказа', {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast('Выберите способ доставки', {\n type: 'error'\n });\n } else if (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid) {\n toast('Заполните все поля для доставки: «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast('Выберите вид оплаты', {\n type: 'error'\n });\n } else {\n let data = JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code]));\n delete data.isValid;\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email\n },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\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 purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False'\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n resertStore();\n\n // nextTick(() => {\n // redirectForm.value.submit();\n // });\n })\n .catch((e) => {\n toast('Ошибка сохранения заказа', {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_4","_hoisted_5","href","image","src","_hoisted_11","_hoisted_12","_hoisted_13","code","_hoisted_14","_hoisted_15","_hoisted_17","_hoisted_18","quantity","parseInt","_hoisted_19","innerHTML","price","_hoisted_22","priceOld","amount","percent","sum","_hoisted_26","_hoisted_27","_hoisted_28","index","key","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_34","_hoisted_35","_hoisted_36","second","_hoisted_42","_hoisted_43","_hoisted_44","third","_hoisted_46","_hoisted_47","_hoisted_48","_hoisted_54","_hoisted_55","_hoisted_56","markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","dontcall","get","set","commit","comment","watch","substring","field","data","JSON","parse","stringify","user","last_name","email","phone","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","type","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","then","response","userSchema","component","label","__","model","mask","useSchemaForm","userValidation","yup","object","shape","string","trim","required","matches","addEventListener","resertStore","facebook","$ziggy","provider","google","loginCallback","pluralize","checkout","isValid","valid","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","dataLayer","e","console","error","click","validate","isUserValid","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","$env","locale","action","method","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_toDisplayString","_createBlock","_createVNode","onClick","open","style","_hoisted_20","_hoisted_21","_hoisted_24","_hoisted_25","schemaRowClasses","schema","afterForm","_hoisted_32","_hoisted_39","_hoisted_40","_hoisted_41","_hoisted_45","icon","_hoisted_49","description","_hoisted_52","_hoisted_53","price_label","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_66","_hoisted_68","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_76","_hoisted_78","_hoisted_79","_hoisted_80","_hoisted_82","_hoisted_83","_hoisted_84","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_91","_hoisted_92","_hoisted_93","_hoisted_95","onMouseenter","_hoisted_100","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_106","_hoisted_107","_hoisted_108","submit","_hoisted_109","_hoisted_110","_hoisted_111","_hoisted_112","_hoisted_113","_hoisted_116","_hoisted_117","_hoisted_118","_hoisted_121","_hoisted_122","_hoisted_123","_hoisted_127"],"mappings":"yoBA0F6BA,kBAAgB,CACzCC,KAAM,eACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAUC,YAAS,kBAAML,EAAMC,KAAKK,WAAWF,SAAWJ,EAAMC,KAAKK,WAAWF,QAAQG,OAASP,EAAMC,KAAKK,WAAWF,QAAU,YAGhI,CACHI,YAHgBH,YAAS,kBAAML,EAAMC,KAAKG,SAAWJ,EAAMC,KAAKG,QAAQG,OAASP,EAAMC,KAAKG,QAAQK,QAAO,SAAAC,UAA+C,IAArCN,EAAQO,MAAMC,QAAQF,EAAOG,OAAa,yBC/FxJ,mBACPC,kCAAW,gBAAe,+BAEnB,wBAEQ,sDAIaA,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,wEAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,yBACI,kBACA,qCAKR,4BACI,uBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,4DAIrBA,qBAA0B,oBAAV,6BAI7B,0BACI,kBACA,yEA9E3BC,oDAAW,mDAAmEC,OAAKV,WAAWW,YAC1DD,OAAKV,WAAWW,sBAAhDF,2BAAAG,sCAGAJ,2BAAAK,GACIL,oDAAW,kBAAkCE,OAAKV,WAAWW,YACzDH,2BAAAM,GACIN,0BAAIO,KAAML,OAAKV,WAAWe,OACtBP,uDAAc,+BAA+CE,OAAKV,WAAWgB,WACjCN,OAAKV,WAAWgB,qBAAxDP,kCAAMQ,IAAKP,O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