@perevorot/shop 2.0.110 → 2.0.111
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("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),l=require("@perevorot/shop/dist/forms/FormText"),a=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var m=s(r),u=s(l),p=s(a),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=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!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},g={class:"bundle-title"},y={class:"column name"},k={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},S={key:0,class:"code"},w={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},M={key:0,class:"quantity-price"},L=["innerHTML"],H={class:"column is-2 has-text-right"},q=["innerHTML"],O=["innerHTML"],P=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},j={class:"option-title"},A={class:"column is-2 has-text-right"},U=e.createTextVNode("+"),J=["innerHTML"],I={key:0,class:"bundle columns"},W={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],X={key:1},Y=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Z={class:"column"},ee={key:0,class:"code"},te={class:"title"},oe=["href"],ne={key:1,class:"bundle columns"},re={class:"column is-narrow"},le=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],ie=["src"],ce={key:1},se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],de={class:"column"},me={key:0,class:"code"},ue={class:"title"},pe=["href"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(){}function fe(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,a){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",f,[e.createElementVNode("div",g,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",y,[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,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(t.__("shop.cart.code"))+" "+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,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,L),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",H,[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,q)):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.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,P)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",j,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[U,e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,J)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",W,[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",X,Y))],2)],8,K)]),e.createElementVNode("div",Z,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",te,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,oe)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",re,[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",ce,se))],2)],8,ae)]),e.createElementVNode("div",de,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,e.toDisplayString(t.__("shop.cart.code"))+" "+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,pe)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(u.default),e.markRaw(p.default);var ge=n.SchemaFormFactory([m.default({})]),ye={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ke=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ge},props:{isLogin:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var l=e.useSlots(),a=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),m=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),g=e.computed((function(){return i.getters["checkout/user"]})),y=e.ref(!0),k=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),S=e.ref("new"),w=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),M=e.ref(""),L=e.ref(null),H=e.ref(!1),q=e.getCurrentInstance(),O=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),P=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),$=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch($,(function(e){e.length>1e3&&($.value=$.value.substring(0,1e3))}));var F=function(t,o){return e.computed({get:function(){return g.value[t]?g.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(g.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",F);var z=e.ref({last_name:F("last_name"),middle_name:F("middle_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),company_name:F("company_name"),user_type:F("user_type","individual")});e.provide("user",z),i.dispatch("auth/me",{finally:function(){}});var R=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),j=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return j.value?C.value.find((function(e){return e.id==j.value})):{}})),J=e.computed((function(){return Q(B.value,R.value)})),I=e.computed((function(){return Q(C.value,j.value)})),W=e.computed((function(){return X(B.value)})),G=e.computed((function(){return X(C.value)})),K=e.computed((function(){var e=[];return m.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),Q=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},X=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&R.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(R.value)),o&&j.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(j.value)),o&&n.categories&&n.categories.length&&(o=!K.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===z.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Y=e.computed((function(){var e=0;return m.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(S,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Z={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:u.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},registration_number:{component:u.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:u.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:u.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}},ee=Object.keys(Z).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Z[t]),e}),{});ee=r.userFields.reduce((function(e,t){return e[t]=ee[t],e}),{});var te=e.ref(ee);n.useSchemaForm(z);var oe={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required()}))},ne=Object.keys(oe).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=oe[t]),e}),{}),re=v.object().shape(ne);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var le=fe((function(){return function(e){var t=e();if(t&&t.then)return t.then(he)}((function(){if("function"==typeof ae.value)return ve(ae.value(),(function(e){w.value&&w.value.click(),re.isValid(z.value).then((function(t){y.value=t&&j.value&&O.value&&R.value&&(!A.value.component||A.value.component&&D.value[A.value.code]&&D.value[A.value.code].isValid)&&e}))}))}))})),ae=e.ref(null);e.provide("shippingComponentValid",ae);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ce=fe((function(){var e="function"==typeof ae.value?ae.value():null;return re.isValid(z.value).then((function(t){if(t)if(R.value)if(!A.value.component||D.value[A.value.code]&&D.value[A.value.code].isValid)if(e)if(j.value)if(O.value){var o,n=D.value[A.value.code]?JSON.parse(JSON.stringify(D.value[A.value.code])):{};delete n.isValid;var r=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(o=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var l={checkout:!0,user:{last_name:z.value.last_name,middle_name:z.value.middle_name,name:z.value.name,phone:z.value.phone,email:z.value.email,user_type:z.value.user_type,registration_number:z.value.registration_number,company_name:z.value.company_name},shipping:{id:R.value,data:n,user:r},payment:{id:j.value},comment:$.value,dontcall:P.value,promoCode:M.value,clientId:o};s.value=!0,$http.post(window.location.href,l).then((function(e){if(e.data&&e.data.error&&e.data.message)a(e.data.message,{type:"error"});else{var t=[];m.value.forEach((function(e){t.push({item_name:e.name,item_id:e.attributes.code,price:e.price,item_category:e.attributes.category?e.attributes.category:"",item_brand:e.attributes.brand?e.attributes.brand:"",quantity:e.quantity})}));var o={ecommerce:{transaction_id:e.data.order.id,value:parseFloat(h.value),tax:"0",shipping:"0",items:t},event:"purchase"};M.value&&(o.ecommerce.coupon=M.value),$env.debug.ecommerce&&console.log(o),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(o)),e.data.redirect&&(b.value={url:e.data.redirect.url,data:e.data.redirect.data}),_.value=!0,E.value=e.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),se()}})).catch((function(e){a(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else a(__("shop.order.validate_consent"),{type:"error"});else a(__("shop.order.validate_payment"),{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping"),{type:"error"});else S.value="new",w.value.click(),a(__("shop.order.validate_user"),{type:"error"})})),ve()})),se=function(){i.commit("checkout/reset")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(m.value.forEach((function(t){e.push({item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),item_brand:t.attributes.brand,item_category:t.attributes.category,quantity:t.quantity})})),e.length){var t={ecommerce:{currencyCode:"UAH",items:e},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:S,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){S.value="new"},quantity:d,items:m,loading:s,pluralize:t.pluralize,discount:Y,total:h,shipping:R,shippingPrice:J,payment:j,fee:I,userValidation:re,userSchema:te,userSubmitButton:w,checkout:ce,ifCheckoutReady:y,validate:le,shippingTypesRestricted:W,paymentMethodsRestricted:G,toggleShippingRadio:function(e){R.value===e&&(R.value=null)},togglePaymentRadio:function(e){j.value===e&&(j.value=null)},shippingSelected:A,paymentSelected:U,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:se,user:z,dontcall:P,comment:$,isCommentToggled:T,commentMaxLength:1e3,userCheckout:g,thanks:_,order:E,redirect:b,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){M.value&&(H.value=!0,$http.post(window.location.href,{promoCodeApply:M.value,email:z.value.email,total:h.value}).then((function(e){L.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ye,props:{message:__("shop.order.promo.error_"+e.error,{number:q.appContext.config.globalProperties.$filters.price(e.number)})}};a(t,{type:"error"}),"not_found"==e.error&&(M.value="")})),L.value=null)})).finally((function(){H.value=!1})))},promoCode:M,isPromoLoading:H,promoCodeApplied:L,resetPromoCode:function(){M.value="",L.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+I.value+J.value;return L.value&&"percent"==L.value.type?Math.round(e-e*L.value.amount/100):L.value&&"discount"==L.value.type?Math.max(0,e-L.value.amount):e},consent:V,shippingComponent:N,slots:l}}}),_e={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},be={class:"checkout-title"},Be={class:"columns"},Ce={class:"column checkout-blocks-wrapper"},Se={class:"checkout-block is-cart"},we={class:"wrapper"},De={class:"title-row"},Te={class:"items-title"},xe=["textContent"],Me=e.createTextVNode(" "),Le=["innerHTML"],He=["onClick"],qe=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},Pe={class:"wrapper"},$e={class:"items-title"},Fe={key:0,class:"user-tabs"},ze={class:"columns"},Re={class:"column user-form"},je={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Ae={key:0,class:"column user-login user-form"},Ue={key:1,class:"column"},Je={key:0,class:"social-auth"},Ie={class:"socials"},We={class:"description"},Ge={class:"buttons"},Ke=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Qe=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Xe={class:"checkout-block is-shipping"},Ye={class:"wrapper shipping-type-block"},Ze={class:"rows"},et={class:"item"},tt={class:"row"},ot={class:"info"},nt={class:"items-title mb-1"},rt={key:0,class:"value"},lt={class:"next-dates"},at={class:"row"},it={class:"info"},ct=["value","onClick"],st=["src"],dt={key:1,class:"icon"},mt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],ut={key:0,class:"description"},pt={class:"value"},vt={key:0,class:"green"},ht=["innerHTML"],ft={key:0},gt={key:0,class:"checkout-block is-payment"},yt={class:"wrapper payment-method-block"},kt={class:"rows"},_t={class:"item"},Et={class:"row"},Vt={class:"info"},Nt={class:"items-title mb-1"},bt={class:"info"},Bt=["value","onClick"],Ct={key:0,class:"description"},St={key:0,class:"value"},wt=["innerHTML"],Dt={class:"column is-4"},Tt={class:"checkout-block summary"},xt={key:0,class:"inner payment-method-block"},Mt={class:"rows"},Lt={class:"item"},Ht={class:"row"},qt={class:"info"},Ot={class:"items-title mb-1"},Pt={class:"info"},$t=["value","onClick"],Ft={key:0,class:"description"},zt={key:0,class:"value"},Rt=["innerHTML"],jt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),At={class:"inner"},Ut={class:"items-title"},Jt={class:"rows"},It={class:"row products"},Wt={class:"info"},Gt=["textContent"],Kt={class:"value"},Qt=["innerHTML"],Xt={key:0,class:"row discount"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:1,class:"row fee"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],lo={key:2,class:"row shipping"},ao={class:"info"},io={class:"value"},co=["innerHTML"],so={key:1,class:"green"},mo={key:3,class:"row promo"},uo={class:"info"},po=e.createElementVNode("br",null,null,-1),vo={class:"green"},ho={class:"value"},fo=["innerHTML"],go={class:"row price"},yo={class:"info"},ko={class:"value orange"},_o=["innerHTML"],Eo={class:"checkbox-wrapper nocall"},Vo={key:0,class:"consent"},No={class:"checkbox-wrapper"},bo=["innerHTML"],Bo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Co={class:"user-form is-promo-code"},So={class:"control"},wo=["disabled"],Do={class:"label",for:"promo-code-applied"},To=["disabled"],xo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Mo={class:"user-form"},Lo={key:0,class:"chars-count"},Ho={key:2,class:"checkout-block thanks"},qo={class:"title"},Oo={class:"columns"},Po={key:0,class:"column is-6"},$o={class:"subtitle"},Fo={key:1,class:"column is-6"},zo={class:"column is-6"},Ro={key:0,class:"info-wrapper"},jo={class:"title"},Ao={class:"columns"},Uo=["innerHTML"],Jo=["innerHTML"],Io={key:1,class:"info-wrapper"},Wo={class:"title"},Go={class:"columns"},Ko=["innerHTML"],Qo=["innerHTML"],Xo={key:2,class:"info-wrapper"},Yo={class:"title"},Zo={class:"columns"},en={class:"column is-6"},tn=["innerHTML"],on={key:3,class:"checkout-block empty"},nn={class:"title"},rn={class:"message"},ln=["href"],an=e.createTextVNode(", "),cn=e.createElementVNode("br",null,null,-1),sn=["href"];ke.render=function(t,o,n,r,l,a){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",_e,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden1",method:"post"},[e.createTextVNode(" redirect.url="+e.toDisplayString(t.redirect.url)+" ",1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"text",name:o,value:t,key:n},null,8,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",be,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Se,[e.createCommentVNode("items"),e.createElementVNode("div",we,[e.createElementVNode("div",De,[e.createElementVNode("div",Te,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,xe),Me,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Le)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[qe,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,He)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("div",$e,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ze,[e.withDirectives(e.createElementVNode("div",Re,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",je,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Ue,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",Ie,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Ge,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ke),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Qe)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",lt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",at,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,ct),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,st)):(e.openBlock(),e.createElementBlock("svg",dt,mt)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",pt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,ht))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ft,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("div",yt,[e.createElementVNode("div",kt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[e.createElementVNode("div",Nt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",bt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Bt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ct,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,wt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,[e.createElementVNode("div",qt,[e.createElementVNode("div",Ot,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Pt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,$t),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ft,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Rt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),jt,e.createElementVNode("div",At,[e.createElementVNode("div",Ut,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Jt,[e.createElementVNode("div",It,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Gt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Qt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",no,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,ro)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("div",ao,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",io,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,co)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",so,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",mo,[e.createElementVNode("div",uo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),po,e.createElementVNode("span",vo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,fo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",go,[e.createElementVNode("div",yo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",ko,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,_o)])])]),e.createElementVNode("div",Eo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[11]||(o[11]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:o[12]||(o[12]=function(){return t.validate&&t.validate.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),35),e.renderSlot(t.$slots,"submit"),t.isConsent?(e.openBlock(),e.createElementBlock("div",Vo,[e.createElementVNode("div",No,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,bo)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[14]||(o[14]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Bo]),e.createElementVNode("div",Co,[e.createElementVNode("div",So,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,wo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Do,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[17]||(o[17]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[16]||(o[16]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,To))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[18]||(o[18]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),xo]),e.createElementVNode("div",Mo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[19]||(o[19]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Lo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Ho,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",qo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.__("shop.order.success")),1)]),e.createElementVNode("div",Oo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",$o,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[20]||(o[20]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("button",{class:"button is-orange",onClick:o[21]||(o[21]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",zo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ao,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Uo)):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,Jo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Io,[e.createElementVNode("div",Wo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Go,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Ko)):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,Qo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",Yo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Zo,[e.createElementVNode("div",en,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,tn)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("div",nn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",rn,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,ln),an,cn,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,sn)]))])},module.exports=ke;
|
|
1
|
+
"use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),l=require("@perevorot/shop/dist/forms/FormText"),a=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var m=s(r),u=s(l),p=s(a),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=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!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},g={class:"bundle-title"},k={class:"column name"},y={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},S={key:0,class:"code"},w={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},M={key:0,class:"quantity-price"},L=["innerHTML"],H={class:"column is-2 has-text-right"},q=["innerHTML"],O=["innerHTML"],P=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},j={class:"option-title"},A={class:"column is-2 has-text-right"},U=e.createTextVNode("+"),J=["innerHTML"],I={key:0,class:"bundle columns"},W={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],X={key:1},Y=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Z={class:"column"},ee={key:0,class:"code"},te={class:"title"},oe=["href"],ne={key:1,class:"bundle columns"},re={class:"column is-narrow"},le=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],ie=["src"],ce={key:1},se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],de={class:"column"},me={key:0,class:"code"},ue={class:"title"},pe=["href"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(){}function fe(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,a){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",f,[e.createElementVNode("div",g,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",k,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",y,[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,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(t.__("shop.cart.code"))+" "+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,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,L),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",H,[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,q)):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.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,P)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",j,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[U,e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,J)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",W,[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",X,Y))],2)],8,K)]),e.createElementVNode("div",Z,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",te,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,oe)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",re,[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",ce,se))],2)],8,ae)]),e.createElementVNode("div",de,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,e.toDisplayString(t.__("shop.cart.code"))+" "+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,pe)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(u.default),e.markRaw(p.default);var ge=n.SchemaFormFactory([m.default({})]),ke={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ye=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ge},props:{isLogin:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var l=e.useSlots(),a=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),m=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),g=e.computed((function(){return i.getters["checkout/user"]})),k=e.ref(!0),y=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),S=e.ref("new"),w=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),M=e.ref(""),L=e.ref(null),H=e.ref(!1),q=e.getCurrentInstance(),O=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),P=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),$=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch($,(function(e){e.length>1e3&&($.value=$.value.substring(0,1e3))}));var F=function(t,o){return e.computed({get:function(){return g.value[t]?g.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(g.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",F);var z=e.ref({last_name:F("last_name"),middle_name:F("middle_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),company_name:F("company_name"),user_type:F("user_type","individual")});e.provide("user",z),i.dispatch("auth/me",{finally:function(){}});var R=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),j=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return j.value?C.value.find((function(e){return e.id==j.value})):{}})),J=e.computed((function(){return Q(B.value,R.value)})),I=e.computed((function(){return Q(C.value,j.value)})),W=e.computed((function(){return X(B.value)})),G=e.computed((function(){return X(C.value)})),K=e.computed((function(){var e=[];return m.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),Q=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},X=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&R.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(R.value)),o&&j.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(j.value)),o&&n.categories&&n.categories.length&&(o=!K.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===z.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Y=e.computed((function(){var e=0;return m.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(S,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Z={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:u.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},registration_number:{component:u.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:u.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:u.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}},ee=Object.keys(Z).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Z[t]),e}),{});ee=r.userFields.reduce((function(e,t){return e[t]=ee[t],e}),{});var te=e.ref(ee);n.useSchemaForm(z);var oe={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required()}))},ne=Object.keys(oe).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=oe[t]),e}),{}),re=v.object().shape(ne);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var le=fe((function(){return function(e){var t=e();if(t&&t.then)return t.then(he)}((function(){if("function"==typeof ae.value)return ve(ae.value(),(function(e){w.value&&w.value.click(),re.isValid(z.value).then((function(t){k.value=t&&j.value&&O.value&&R.value&&(!A.value.component||A.value.component&&D.value[A.value.code]&&D.value[A.value.code].isValid)&&e}))}))}))})),ae=e.ref(null);e.provide("shippingComponentValid",ae);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ce=fe((function(){var t="function"==typeof ae.value?ae.value():null;return re.isValid(z.value).then((function(o){if(o)if(R.value)if(!A.value.component||D.value[A.value.code]&&D.value[A.value.code].isValid)if(t)if(j.value)if(O.value){var n,r=D.value[A.value.code]?JSON.parse(JSON.stringify(D.value[A.value.code])):{};delete r.isValid;var l=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var i={checkout:!0,user:{last_name:z.value.last_name,middle_name:z.value.middle_name,name:z.value.name,phone:z.value.phone,email:z.value.email,user_type:z.value.user_type,registration_number:z.value.registration_number,company_name:z.value.company_name},shipping:{id:R.value,data:r,user:l},payment:{id:j.value},comment:$.value,dontcall:P.value,promoCode:M.value,clientId:n};s.value=!0,$http.post(window.location.href,i).then((function(t){if(t.data&&t.data.error&&t.data.message)a(t.data.message,{type:"error"});else{var o=[];m.value.forEach((function(e){o.push({item_name:e.name,item_id:e.attributes.code,price:e.price,item_category:e.attributes.category?e.attributes.category:"",item_brand:e.attributes.brand?e.attributes.brand:"",quantity:e.quantity})}));var n={ecommerce:{transaction_id:t.data.order.id,value:parseFloat(h.value),tax:"0",shipping:"0",items:o},event:"purchase"};M.value&&(n.ecommerce.coupon=M.value),$env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n)),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){y.value.submit()}),400)}))),_.value=!0,E.value=t.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),se()}})).catch((function(e){a(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else a(__("shop.order.validate_consent"),{type:"error"});else a(__("shop.order.validate_payment"),{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping"),{type:"error"});else S.value="new",w.value.click(),a(__("shop.order.validate_user"),{type:"error"})})),ve()})),se=function(){i.commit("checkout/reset")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(m.value.forEach((function(t){e.push({item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),item_brand:t.attributes.brand,item_category:t.attributes.category,quantity:t.quantity})})),e.length){var t={ecommerce:{currencyCode:"UAH",items:e},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:S,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){S.value="new"},quantity:d,items:m,loading:s,pluralize:t.pluralize,discount:Y,total:h,shipping:R,shippingPrice:J,payment:j,fee:I,userValidation:re,userSchema:te,userSubmitButton:w,checkout:ce,ifCheckoutReady:k,validate:le,shippingTypesRestricted:W,paymentMethodsRestricted:G,toggleShippingRadio:function(e){R.value===e&&(R.value=null)},togglePaymentRadio:function(e){j.value===e&&(j.value=null)},shippingSelected:A,paymentSelected:U,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:se,user:z,dontcall:P,comment:$,isCommentToggled:T,commentMaxLength:1e3,userCheckout:g,thanks:_,order:E,redirect:b,redirectForm:y,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){M.value&&(H.value=!0,$http.post(window.location.href,{promoCodeApply:M.value,email:z.value.email,total:h.value}).then((function(e){L.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ke,props:{message:__("shop.order.promo.error_"+e.error,{number:q.appContext.config.globalProperties.$filters.price(e.number)})}};a(t,{type:"error"}),"not_found"==e.error&&(M.value="")})),L.value=null)})).finally((function(){H.value=!1})))},promoCode:M,isPromoLoading:H,promoCodeApplied:L,resetPromoCode:function(){M.value="",L.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+I.value+J.value;return L.value&&"percent"==L.value.type?Math.round(e-e*L.value.amount/100):L.value&&"discount"==L.value.type?Math.max(0,e-L.value.amount):e},consent:V,shippingComponent:N,slots:l}}}),_e={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},be={class:"checkout-title"},Be={class:"columns"},Ce={class:"column checkout-blocks-wrapper"},Se={class:"checkout-block is-cart"},we={class:"wrapper"},De={class:"title-row"},Te={class:"items-title"},xe=["textContent"],Me=e.createTextVNode(" "),Le=["innerHTML"],He=["onClick"],qe=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},Pe={class:"wrapper"},$e={class:"items-title"},Fe={key:0,class:"user-tabs"},ze={class:"columns"},Re={class:"column user-form"},je={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Ae={key:0,class:"column user-login user-form"},Ue={key:1,class:"column"},Je={key:0,class:"social-auth"},Ie={class:"socials"},We={class:"description"},Ge={class:"buttons"},Ke=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Qe=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Xe={class:"checkout-block is-shipping"},Ye={class:"wrapper shipping-type-block"},Ze={class:"rows"},et={class:"item"},tt={class:"row"},ot={class:"info"},nt={class:"items-title mb-1"},rt={key:0,class:"value"},lt={class:"next-dates"},at={class:"row"},it={class:"info"},ct=["value","onClick"],st=["src"],dt={key:1,class:"icon"},mt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],ut={key:0,class:"description"},pt={class:"value"},vt={key:0,class:"green"},ht=["innerHTML"],ft={key:0},gt={key:0,class:"checkout-block is-payment"},kt={class:"wrapper payment-method-block"},yt={class:"rows"},_t={class:"item"},Et={class:"row"},Vt={class:"info"},Nt={class:"items-title mb-1"},bt={class:"info"},Bt=["value","onClick"],Ct={key:0,class:"description"},St={key:0,class:"value"},wt=["innerHTML"],Dt={class:"column is-4"},Tt={class:"checkout-block summary"},xt={key:0,class:"inner payment-method-block"},Mt={class:"rows"},Lt={class:"item"},Ht={class:"row"},qt={class:"info"},Ot={class:"items-title mb-1"},Pt={class:"info"},$t=["value","onClick"],Ft={key:0,class:"description"},zt={key:0,class:"value"},Rt=["innerHTML"],jt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),At={class:"inner"},Ut={class:"items-title"},Jt={class:"rows"},It={class:"row products"},Wt={class:"info"},Gt=["textContent"],Kt={class:"value"},Qt=["innerHTML"],Xt={key:0,class:"row discount"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:1,class:"row fee"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],lo={key:2,class:"row shipping"},ao={class:"info"},io={class:"value"},co=["innerHTML"],so={key:1,class:"green"},mo={key:3,class:"row promo"},uo={class:"info"},po=e.createElementVNode("br",null,null,-1),vo={class:"green"},ho={class:"value"},fo=["innerHTML"],go={class:"row price"},ko={class:"info"},yo={class:"value orange"},_o=["innerHTML"],Eo={class:"checkbox-wrapper nocall"},Vo={key:0,class:"consent"},No={class:"checkbox-wrapper"},bo=["innerHTML"],Bo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Co={class:"user-form is-promo-code"},So={class:"control"},wo=["disabled"],Do={class:"label",for:"promo-code-applied"},To=["disabled"],xo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Mo={class:"user-form"},Lo={key:0,class:"chars-count"},Ho={key:2,class:"checkout-block thanks"},qo={class:"title"},Oo={class:"columns"},Po={key:0,class:"column is-6"},$o={class:"subtitle"},Fo={key:1,class:"column is-6"},zo={class:"column is-6"},Ro={key:0,class:"info-wrapper"},jo={class:"title"},Ao={class:"columns"},Uo=["innerHTML"],Jo=["innerHTML"],Io={key:1,class:"info-wrapper"},Wo={class:"title"},Go={class:"columns"},Ko=["innerHTML"],Qo=["innerHTML"],Xo={key:2,class:"info-wrapper"},Yo={class:"title"},Zo={class:"columns"},en={class:"column is-6"},tn=["innerHTML"],on={key:3,class:"checkout-block empty"},nn={class:"title"},rn={class:"message"},ln=["href"],an=e.createTextVNode(", "),cn=e.createElementVNode("br",null,null,-1),sn=["href"];ye.render=function(t,o,n,r,l,a){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",_e,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",be,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Se,[e.createCommentVNode("items"),e.createElementVNode("div",we,[e.createElementVNode("div",De,[e.createElementVNode("div",Te,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,xe),Me,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Le)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[qe,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,He)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("div",$e,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ze,[e.withDirectives(e.createElementVNode("div",Re,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",je,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Ue,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",Ie,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Ge,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ke),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Qe)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",lt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",at,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,ct),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,st)):(e.openBlock(),e.createElementBlock("svg",dt,mt)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",pt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,ht))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ft,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[e.createElementVNode("div",Nt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",bt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Bt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ct,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,wt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,[e.createElementVNode("div",qt,[e.createElementVNode("div",Ot,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Pt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,$t),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ft,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Rt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),jt,e.createElementVNode("div",At,[e.createElementVNode("div",Ut,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Jt,[e.createElementVNode("div",It,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Gt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Qt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",no,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,ro)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("div",ao,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",io,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,co)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",so,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",mo,[e.createElementVNode("div",uo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),po,e.createElementVNode("span",vo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,fo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",go,[e.createElementVNode("div",ko,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",yo,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,_o)])])]),e.createElementVNode("div",Eo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[11]||(o[11]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:o[12]||(o[12]=function(){return t.validate&&t.validate.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),35),e.renderSlot(t.$slots,"submit"),t.isConsent?(e.openBlock(),e.createElementBlock("div",Vo,[e.createElementVNode("div",No,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,bo)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[14]||(o[14]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Bo]),e.createElementVNode("div",Co,[e.createElementVNode("div",So,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,wo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Do,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[17]||(o[17]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[16]||(o[16]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,To))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[18]||(o[18]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),xo]),e.createElementVNode("div",Mo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[19]||(o[19]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Lo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Ho,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",qo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.__("shop.order.success")),1)]),e.createElementVNode("div",Oo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",$o,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[20]||(o[20]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("button",{class:"button is-orange",onClick:o[21]||(o[21]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",zo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ao,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Uo)):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,Jo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Io,[e.createElementVNode("div",Wo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Go,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Ko)):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,Qo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",Yo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Zo,[e.createElementVNode("div",en,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,tn)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("div",nn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",rn,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,ln),an,cn,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,sn)]))])},module.exports=ye;
|
|
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=4d5a1fac&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=67c7f2b6&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\">{{ __('shop.cart.bundle') }}</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\">{{ __('shop.cart.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> / {{ __('shop.cart.q') }}</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=\"__('shop.cart.bundle_amount') + (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>{{ __('shop.cart.additional') }} {{ 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\">{{ __('shop.cart.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\">{{ __('shop.cart.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\">{{ __('shop.cart.bundle') }}</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\">{{ __('shop.cart.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> / {{ __('shop.cart.q') }}</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=\"__('shop.cart.bundle_amount') + (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>{{ __('shop.cart.additional') }} {{ 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\">{{ __('shop.cart.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\">{{ __('shop.cart.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-hidden1\" method=\"post\">\n redirect.url={{ redirect.url }}\n <input type=\"text\" :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\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> <span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\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>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</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\" :preventModelCleanupOnSchemaChange=\"true\">\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'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</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>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</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 <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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 class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</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 promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</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>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</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\">{{ __('shop.order.payment') }}</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 class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } 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 FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\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 props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\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 const consent = ref(false);\n const shippingComponent = 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 isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\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, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\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 provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\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 if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\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 userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_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 registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_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 registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required();\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n item_category: item.attributes.category ? item.attributes.category : '',\n item_brand: item.attributes.brand ? item.attributes.brand : '',\n quantity: item.quantity\n });\n });\n\n let object = {\n ecommerce: {\n transaction_id: response.data.order.id,\n value: parseFloat(total.value),\n tax: '0',\n shipping: '0',\n items: products\n },\n event: 'purchase',\n };\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n // nextTick(() => {\n // setTimeout(() => {\n // redirectForm.value.submit();\n // }, 400);\n // });\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\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 onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n item_brand: item.attributes.brand,\n item_category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: products\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\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 isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden1\" method=\"post\">\n redirect.url={{ redirect.url }}\n <input type=\"text\" :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\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> <span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\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>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</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\" :preventModelCleanupOnSchemaChange=\"true\">\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'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</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>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</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 <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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 class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</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 promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</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>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</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\">{{ __('shop.order.payment') }}</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 class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } 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 FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\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 props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\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 const consent = ref(false);\n const shippingComponent = 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 isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\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, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\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 provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\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 if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\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 userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_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 registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_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 registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required();\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n item_category: item.attributes.category ? item.attributes.category : '',\n item_brand: item.attributes.brand ? item.attributes.brand : '',\n quantity: item.quantity\n });\n });\n\n let object = {\n ecommerce: {\n transaction_id: response.data.order.id,\n value: parseFloat(total.value),\n tax: '0',\n shipping: '0',\n items: products\n },\n event: 'purchase',\n };\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n // nextTick(() => {\n // setTimeout(() => {\n // redirectForm.value.submit();\n // }, 400);\n // });\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\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 onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n item_brand: item.attributes.brand,\n item_category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: products\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\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 isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","direct","then","Promise","resolve","f","i","arguments","e","reject","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_32","_hoisted_33","_hoisted_34","second","_hoisted_40","_hoisted_41","_hoisted_42","third","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_52","_hoisted_53","_hoisted_54","yup","addMethod","string","min","msg","this","test","exclusive","message","__","params","isNaN","markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","HtmlMessage","template","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","isLogin","type","Boolean","isPromoCode","isConsent","isPaymentMethodOverSummary","userFields","Array","redirectOnEmpty","String","showPlaceholders","slots","useSlots","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","shippingComponent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","defaultValue","data","JSON","parse","stringify","provide","user","last_name","middle_name","email","phone","registration_number","company_name","user_type","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","response","userSchemaFields","component","model","label","list","placeholder","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","body","shippingComponentValid","isShippingComponentFormsValid","click","isValid","isUserValid","shippingComponentUserData","checkout","valid","clientId","shippingUserData","document","cookie","split","parts","error","products","item_name","item_id","item_category","category","item_brand","brand","ecommerce","transaction_id","parseFloat","tax","event","coupon","$env","debug","console","log","dataLayer","url","querySelector","classList","add","resertStore","onMounted","currencyCode","facebook","$ziggy","provider","google","loginCallback","pluralize","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","locale","applyPromoCode","promoCodeApply","number","appContext","config","globalProperties","$filters","resetPromoCode","calculateWithPromoCodeDiscount","max","action","method","_hoisted_5","_hoisted_6","_hoisted_7","_renderSlot","_hoisted_8","_createCommentVNode","_hoisted_9","_toDisplayString","_createBlock","_createVNode","onClick","open","_hoisted_19","_hoisted_21","_hoisted_22","schemaRowClasses","schema","preventModelCleanupOnSchemaChange","afterForm","_hoisted_23","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","nextDates","_hoisted_43","_hoisted_47","icon","_hoisted_50","description","price_label","_hoisted_55","shippingFooter","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_64","_hoisted_66","_hoisted_68","_hoisted_69","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_78","_hoisted_80","_hoisted_82","_hoisted_83","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_90","_hoisted_92","_hoisted_94","_hoisted_95","_hoisted_96","_hoisted_98","_hoisted_99","_hoisted_100","_hoisted_102","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_114","_hoisted_115","_hoisted_117","onMouseenter","_hoisted_118","_hoisted_119","_hoisted_121","_hoisted_122","_hoisted_123","disabled","_hoisted_125","_hoisted_127","_hoisted_128","_hoisted_129","_hoisted_130","filters","_hoisted_131","_hoisted_132","_hoisted_133","_hoisted_134","submit","_hoisted_135","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_139","_hoisted_142","_hoisted_143","_hoisted_144","_hoisted_147","_hoisted_148","_hoisted_149","_hoisted_150","_hoisted_152","_hoisted_153","_hoisted_154","_hoisted_157"],"mappings":"ksBA0F6BA,kBAAgB,CACzCC,KAAM,eACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAUC,YAAS,kBAAOL,EAAMC,KAAKK,WAAWF,SAAWJ,EAAMC,KAAKK,WAAWF,QAAQG,OAASP,EAAMC,KAAKK,WAAWF,QAAU,YAGjI,CACHI,YAHgBH,YAAS,kBAAOL,EAAMC,KAAKG,SAAWJ,EAAMC,KAAKG,QAAQG,OAASP,EAAMC,KAAKG,QAAQK,QAAO,SAACC,UAAiD,IAAtCN,EAAQO,MAAMC,QAAQF,EAAOG,OAAc,yBC/F5J,yBACI,yBAEJ,wBAEQ,sDAIaC,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,2CAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,0BACI,kBACA,qCAKR,4BACI,uBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,4DAIrBA,qBAA0B,oBAAV,6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,QAAMsJ,2BAAtCvJ,2BAAA0X,IACIpY,2BAAAqY,qBAAsB1X,gCACtBX,2BAAAsY,IACmC3X,QAAMsJ,2BAArCvJ,wCAAW,cAAuCqB,UAAQpB,QAAMsJ,yDACjCtJ,QAAMsJ,2BAArCvJ,wCAAW,cAAuCqB,UAAQpB,QAAMsJ,8FAGxCtJ,QAAMuJ,0BAAtCxJ,2BAAA6X,IACIvY,2BAAAwY,qBAAsB7X,+BACtBX,2BAAAyY,IACmC9X,QAAMuJ,0BAArCxJ,wCAAW,cAAsCqB,UAAQpB,QAAMuJ,wDAChCvJ,QAAMuJ,0BAArCxJ,wCAAW,cAAsCqB,UAAQpB,QAAMuJ,6FAGvCvJ,QAAMyH,yBAAtC1H,2BAAAgY,IACI1Y,2BAAA2Y,qBAAsBhY,kCACtBX,2BAAA4Y,IACI5Y,2BAAA6Y,IACI7Y,6BAAM+B,UAAQpB,QAAMyH,gBAAiB,sEAQhDzH,iEAAjBD,2BAAAoY,IACI9Y,2BAAA+Y,qBAAsBpY,4BACtBX,2BAAAgZ,wCACOrY,kCACHX,qBAAoF,KAAhFiB,KAAMN,OAAKwQ,OAAOnB,IAAMrP,OAAKwQ,OAAOnB,2BAAcrP,oCAAgCsY,uCAAStY,kCAEnGX,gCAAS,kBAAmBiB,KAAMN,OAAKwQ,OAAOnB,IAAMrP,OAAKwQ,OAAOnB,2BAAcrP"}
|
|
1
|
+
{"version":3,"file":"Checkout.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=4d5a1fac&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=76efb93d&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\">{{ __('shop.cart.bundle') }}</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\">{{ __('shop.cart.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> / {{ __('shop.cart.q') }}</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=\"__('shop.cart.bundle_amount') + (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>{{ __('shop.cart.additional') }} {{ 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\">{{ __('shop.cart.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\">{{ __('shop.cart.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\">{{ __('shop.cart.bundle') }}</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\">{{ __('shop.cart.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> / {{ __('shop.cart.q') }}</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=\"__('shop.cart.bundle_amount') + (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>{{ __('shop.cart.additional') }} {{ 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\">{{ __('shop.cart.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\">{{ __('shop.cart.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\" style=\"position: absolute; left: -1000px; top:-1000px;\" 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\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> <span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\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>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</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\" :preventModelCleanupOnSchemaChange=\"true\">\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'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</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>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</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 <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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 class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</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 promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</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>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</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\">{{ __('shop.order.payment') }}</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 class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } 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 FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\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 props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\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 const consent = ref(false);\n const shippingComponent = 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 isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\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, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\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 provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\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 if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\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 userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_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 registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_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 registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required();\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n item_category: item.attributes.category ? item.attributes.category : '',\n item_brand: item.attributes.brand ? item.attributes.brand : '',\n quantity: item.quantity\n });\n });\n\n let object = {\n ecommerce: {\n transaction_id: response.data.order.id,\n value: parseFloat(total.value),\n tax: '0',\n shipping: '0',\n items: products\n },\n event: 'purchase',\n };\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\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 onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n item_brand: item.attributes.brand,\n item_category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: products\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\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 isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" style=\"position: absolute; left: -1000px; top:-1000px;\" 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\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> <span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\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>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</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\" :preventModelCleanupOnSchemaChange=\"true\">\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'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</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>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</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 <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</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\" v-bind:class=\"'is-' + item.code\">\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 class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</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 promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" @mouseenter=\"validate\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</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>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</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\">{{ __('shop.order.payment') }}</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 class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } 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 FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\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 props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\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 const consent = ref(false);\n const shippingComponent = 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 isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\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, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\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 provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\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 if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\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 userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_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 registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_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 registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required();\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n item_category: item.attributes.category ? item.attributes.category : '',\n item_brand: item.attributes.brand ? item.attributes.brand : '',\n quantity: item.quantity\n });\n });\n\n let object = {\n ecommerce: {\n transaction_id: response.data.order.id,\n value: parseFloat(total.value),\n tax: '0',\n shipping: '0',\n items: products\n },\n event: 'purchase',\n };\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\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 onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n item_brand: item.attributes.brand,\n item_category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: products\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\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 isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","direct","then","Promise","resolve","f","i","arguments","e","reject","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_32","_hoisted_33","_hoisted_34","second","_hoisted_40","_hoisted_41","_hoisted_42","third","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_52","_hoisted_53","_hoisted_54","yup","addMethod","string","min","msg","this","test","exclusive","message","__","params","isNaN","markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","HtmlMessage","template","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","isLogin","type","Boolean","isPromoCode","isConsent","isPaymentMethodOverSummary","userFields","Array","redirectOnEmpty","String","showPlaceholders","slots","useSlots","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","shippingComponent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","defaultValue","data","JSON","parse","stringify","provide","user","last_name","middle_name","email","phone","registration_number","company_name","user_type","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","response","userSchemaFields","component","model","label","list","placeholder","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","body","shippingComponentValid","isShippingComponentFormsValid","click","isValid","isUserValid","shippingComponentUserData","checkout","valid","clientId","shippingUserData","document","cookie","split","parts","error","products","item_name","item_id","item_category","category","item_brand","brand","ecommerce","transaction_id","parseFloat","tax","event","coupon","$env","debug","console","log","dataLayer","url","nextTick","setTimeout","submit","querySelector","classList","add","resertStore","onMounted","currencyCode","facebook","$ziggy","provider","google","loginCallback","pluralize","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","locale","applyPromoCode","promoCodeApply","number","appContext","config","globalProperties","$filters","resetPromoCode","calculateWithPromoCodeDiscount","max","action","style","method","_hoisted_5","_hoisted_6","_hoisted_7","_renderSlot","_hoisted_8","_createCommentVNode","_hoisted_9","_toDisplayString","_createBlock","_createVNode","onClick","open","_hoisted_19","_hoisted_21","_hoisted_22","schemaRowClasses","schema","preventModelCleanupOnSchemaChange","afterForm","_hoisted_23","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","nextDates","_hoisted_43","_hoisted_47","icon","_hoisted_50","description","price_label","_hoisted_55","shippingFooter","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_64","_hoisted_66","_hoisted_68","_hoisted_69","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_78","_hoisted_80","_hoisted_82","_hoisted_83","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_90","_hoisted_92","_hoisted_94","_hoisted_95","_hoisted_96","_hoisted_98","_hoisted_99","_hoisted_100","_hoisted_102","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_114","_hoisted_115","_hoisted_117","onMouseenter","_hoisted_118","_hoisted_119","_hoisted_121","_hoisted_122","_hoisted_123","disabled","_hoisted_125","_hoisted_127","_hoisted_128","_hoisted_129","_hoisted_130","filters","_hoisted_131","_hoisted_132","_hoisted_133","_hoisted_134","_hoisted_135","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_139","_hoisted_142","_hoisted_143","_hoisted_144","_hoisted_147","_hoisted_148","_hoisted_149","_hoisted_150","_hoisted_152","_hoisted_153","_hoisted_154","_hoisted_157"],"mappings":"ksBA0F6BA,kBAAgB,CACzCC,KAAM,eACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAUC,YAAS,kBAAOL,EAAMC,KAAKK,WAAWF,SAAWJ,EAAMC,KAAKK,WAAWF,QAAQG,OAASP,EAAMC,KAAKK,WAAWF,QAAU,YAGjI,CACHI,YAHgBH,YAAS,kBAAOL,EAAMC,KAAKG,SAAWJ,EAAMC,KAAKG,QAAQG,OAASP,EAAMC,KAAKG,QAAQK,QAAO,SAACC,UAAiD,IAAtCN,EAAQO,MAAMC,QAAQF,EAAOG,OAAc,yBC/F5J,yBACI,yBAEJ,wBAEQ,sDAIaC,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,2CAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,0BACI,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