@perevorot/shop 2.0.82 → 2.0.83
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"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=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(i),v=d(a),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"},E=["href"],V=["src"],N={key:1},_=[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"],$=["innerHTML"],F=["innerHTML"],O={key:0,class:"options is-toggled"},P={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),ie=["href"],ae=["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"];h.render=function(t,o,n,r,l,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",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,V)):(e.openBlock(),e.createElementBlock("svg",N,_))],2)],8,E)]),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,$)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,F)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",P,[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,ae)):(e.openBlock(),e.createElementBlock("svg",ce,se))],2)],8,ie)]),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 ve=n.SchemaFormFactory([m.default({})]),he={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 fe=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ve},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"]}},name:"order-checkout",setup:function(r){var l=c.useToast(),i=o.useStore(),a=e.ref(!1),s=e.computed((function(){return i.getters["cart/quantity"]})),d=e.computed((function(){return i.getters["cart/items"]})),m=e.computed((function(){return i.getters["cart/total"]})),h=e.computed((function(){return i.getters["auth/is"]})),f=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),y=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref({}),_=e.ref([]),b=e.ref([]),B=e.ref("new"),C=e.ref(null),S=e.computed((function(){return i.getters["checkout/shippingData"]})),w=e.ref(!1),D=e.ref(!1),T=e.ref(""),x=e.ref(null),M=e.ref(!1),L=e.getCurrentInstance(),H=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),q=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&&(w.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){return e.computed({get:function(){return f.value[t]},set:function(e){var o=JSON.parse(JSON.stringify(f.value));o[t]=e,i.commit("checkout/user",o)}})},O=e.ref({last_name:F("last_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),user_type:F("user_type")});i.dispatch("auth/me",{finally:function(){}});var P=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),z=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),R=e.computed((function(){return P.value?_.value.find((function(e){return e.id==P.value})):{}})),j=e.computed((function(){return z.value?b.value.find((function(e){return e.id==z.value})):{}})),A=e.computed((function(){return G(_.value,P.value)})),U=e.computed((function(){return G(b.value,z.value)})),J=e.computed((function(){return K(_.value)})),I=e.computed((function(){return K(b.value)})),W=e.computed((function(){var e=[];return d.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),G=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(m.value*n.amount/100))}return o},K=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=m.value>=n.price_min&&m.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=m.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=m.value<=n.price_max,e.restrictedForce=!o),o&&P.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(P.value)),o&&z.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(z.value)),o&&n.categories&&n.categories.length&&(o=!W.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===O.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Q=e.computed((function(){var e=0;return d.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){_.value=e.data.shipping,b.value=e.data.payment})),e.watch(B,(function(e){"login"==e&&i.commit("auth/modal","login")}));var X={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"},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_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}},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}},Y=Object.keys(X).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=X[t]),e}),{}),Z=e.ref(Y);n.useSchemaForm(O);var ee={last_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()}))},te=Object.keys(ee).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ee[t]),e}),{}),oe=v.object().shape(te);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));return{auth:h,userType:B,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){B.value="new"},quantity:s,items:d,loading:a,pluralize:t.pluralize,discount:Q,total:m,shipping:P,shippingPrice:A,payment:z,fee:U,userValidation:oe,userSchema:Z,userSubmitButton:C,checkout:function(){oe.isValid(O.value).then((function(e){if(e)if(P.value)if(!R.value.component||S.value[R.value.code]&&S.value[R.value.code].isValid)if(z.value)if(H.value){var t,o=S.value[R.value.code]?JSON.parse(JSON.stringify(S.value[R.value.code])):{};if(delete o.isValid,document.cookie)document.cookie.split(";").forEach((function(e){var o=e.split("=");"_ga"===o[0].trim()&&(t=o[1].split(".")[2]+"."+o[1].split(".")[3])}));var n={checkout:!0,user:{last_name:O.value.last_name,name:O.value.name,phone:O.value.phone,email:O.value.email,user_type:O.value.user_type,registration_number:O.value.registration_number},shipping:{id:P.value,data:o},payment:{id:z.value},comment:$.value,dontcall:q.value,promoCode:T.value,clientId:t};a.value=!0,$http.post(window.location.href,n).then((function(e){if(e.data.redirect)N.value={url:e.data.redirect.url,data:e.data.redirect.data};else{var t=[];d.value.forEach((function(e){t.push({name:e.name,id:e.attributes.code,price:e.attributes.price,brand:e.attributes.brand,category:e.attributes.category,quantity:e.quantity})}));var o={ecommerce:{purchase:{actionField:{id:e.data.order.id,affiliation:"mrfix.ua",revenue:m.value+U.value+A.value,tax:"0",shipping:A.value},products:[t]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Purchase","gtm-ee-event-non-interaction":"False",eventTimeout:2e3};window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(o))}y.value=!0,E.value=e.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),nextTick((function(){k.value.submit()}))})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){a.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+R.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else B.value="new",C.value.click(),l(__("shop.order.validate_user"),{type:"error"})}))},ifCheckoutReady:g,validate:function(){oe.isValid(O.value).then((function(e){g.value=e&&z.value&&H.value&&P.value&&(!R.value.component||R.value.component&&S.value[R.value.code]&&S.value[R.value.code].isValid)}))},shippingTypesRestricted:J,paymentMethodsRestricted:I,toggleShippingRadio:function(e){P.value===e&&(P.value=null)},togglePaymentRadio:function(e){z.value===e&&(z.value=null)},shippingSelected:R,paymentSelected:j,shippingComponentData:S,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(S.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:function(){i.commit("checkout/reset")},user:O,dontcall:q,comment:$,isCommentToggled:w,commentMaxLength:1e3,userCheckout:f,thanks:y,order:E,redirect:N,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:D,applyPromoCode:function(){T.value&&(M.value=!0,$http.post(window.location.href,{promoCodeApply:T.value,email:O.value.email,total:m.value}).then((function(e){x.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:he,props:{message:__("shop.order.promo.error_"+e.error,{number:L.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(T.value="")})),x.value=null)})).finally((function(){M.value=!1})))},promoCode:T,isPromoLoading:M,promoCodeApplied:x,resetPromoCode:function(){T.value="",x.value=null},calculateWithPromoCodeDiscount:function(){var e=m.value+U.value+A.value;return x.value&&"percent"==x.value.type?Math.round(e-e*x.value.amount/100):x.value&&"discount"==x.value.type?Math.max(0,e-x.value.amount):e},consent:V}}}),ge={class:"cart checkout"},ke=["action"],ye=["name","value"],Ee={key:1,class:"items-wrapper"},Ve={class:"checkout-title"},Ne={class:"columns"},_e={class:"column checkout-blocks-wrapper"},be={class:"checkout-block is-cart"},Be={class:"wrapper"},Ce={class:"title-row"},Se={class:"items-title"},we=["textContent"],De=e.createTextVNode(" "),Te=["innerHTML"],xe=["onClick"],Me=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Le={class:"checkout-block is-user auth-user"},He={class:"wrapper"},qe={class:"items-title"},$e={key:0,class:"user-tabs"},Fe={class:"columns"},Oe={class:"column user-form"},Pe={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={key:0,class:"column user-login user-form"},Re={key:1,class:"column"},je={key:0,class:"social-auth"},Ae={class:"socials"},Ue={class:"description"},Je={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],We=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ge={class:"checkout-block is-shipping"},Ke={class:"wrapper shipping-type-block"},Qe={class:"rows"},Xe={class:"item"},Ye={class:"row"},Ze={class:"info"},et={class:"items-title mb-1"},tt={key:0,class:"value"},ot={class:"next-dates"},nt={class:"row"},rt={class:"info"},lt=["value","onClick"],it=["src"],at={key:1,class:"icon"},ct=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],st={key:0,class:"description"},dt={class:"value"},mt={key:0,class:"green"},ut=["innerHTML"],pt={key:0,class:"checkout-block is-payment"},vt={class:"wrapper payment-method-block"},ht={class:"rows"},ft={class:"item"},gt={class:"row"},kt={class:"info"},yt={class:"items-title mb-1"},Et={class:"info"},Vt=["value","onClick"],Nt={key:0,class:"description"},_t={key:0,class:"value"},bt=["innerHTML"],Bt={class:"column is-4"},Ct={class:"checkout-block summary"},St={key:0,class:"inner payment-method-block"},wt={class:"rows"},Dt={class:"item"},Tt={class:"row"},xt={class:"info"},Mt={class:"items-title mb-1"},Lt={class:"info"},Ht=["value","onClick"],qt={key:0,class:"description"},$t={key:0,class:"value"},Ft=["innerHTML"],Ot=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),Pt={class:"inner"},zt={class:"items-title"},Rt={class:"rows"},jt={class:"row products"},At={class:"info"},Ut=["textContent"],Jt={class:"value"},It=["innerHTML"],Wt={key:0,class:"row discount"},Gt={class:"info"},Kt={class:"value"},Qt=["innerHTML"],Xt={key:1,class:"row fee"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:2,class:"row shipping"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],lo={key:1,class:"green"},io={key:3,class:"row promo"},ao={class:"info"},co=e.createElementVNode("br",null,null,-1),so={class:"green"},mo={class:"value"},uo=["innerHTML"],po={class:"row price"},vo={class:"info"},ho={class:"value orange"},fo=["innerHTML"],go={class:"checkbox-wrapper nocall"},ko={key:0,class:"consent"},yo={class:"checkbox-wrapper"},Eo=["innerHTML"],Vo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),No={class:"user-form is-promo-code"},_o={class:"control"},bo=["disabled"],Bo={class:"label",for:"promo-code-applied"},Co=["disabled"],So=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),wo={class:"user-form"},Do={key:0,class:"chars-count"},To={key:2,class:"checkout-block thanks"},xo={class:"title"},Mo={class:"columns"},Lo={key:0,class:"column is-6"},Ho={class:"subtitle"},qo={key:1,class:"column is-6"},$o={class:"column is-6"},Fo={key:0,class:"info-wrapper"},Oo={class:"title"},Po={class:"columns"},zo=["innerHTML"],Ro=["innerHTML"],jo={key:1,class:"info-wrapper"},Ao={class:"title"},Uo={class:"columns"},Jo=["innerHTML"],Io=["innerHTML"],Wo={key:2,class:"info-wrapper"},Go={class:"title"},Ko={class:"columns"},Qo={class:"column is-6"},Xo=["innerHTML"],Yo={key:3,class:"checkout-block empty"},Zo={class:"title"},en={class:"message"},tn=["href"],on=e.createTextVNode(", "),nn=e.createElementVNode("br",null,null,-1),rn=["href"];fe.render=function(t,o,n,r,l,i){var a=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ge,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post",target:"_blank"},[(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,ye)})),128))],8,ke)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",Ve,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Ne,[e.createElementVNode("div",_e,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",be,[e.createCommentVNode("items"),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.createElementVNode("div",Se,[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,we),De,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Te)])]),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(a,{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},[Me,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,xe)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Le,[e.createElementVNode("div",He,[e.createElementVNode("div",qe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",$e,[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",Fe,[e.withDirectives(e.createElementVNode("div",Oe,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Pe,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",ze,[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",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Ae,[e.createElementVNode("div",Ue,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Je,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},We)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",ot,"на "+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",nt,[e.createElementVNode("div",rt,[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,lt),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",at,ct)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",st,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",dt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",mt,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,ut))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])),[[e.vShow,n.component&&n.id==t.shipping]])],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",pt,[e.createElementVNode("div",vt,[e.createElementVNode("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,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",Et,[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,Vt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Nt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,bt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Bt,[e.createElementVNode("div",Ct,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",wt,[e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Mt,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",Lt,[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,Ht),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",qt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ft)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Ot,e.createElementVNode("div",Pt,[e.createElementVNode("div",zt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Rt,[e.createElementVNode("div",jt,[e.createElementVNode("div",At,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Ut),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Jt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,It)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Wt,[e.createElementVNode("div",Gt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Qt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",no,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,ro)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",lo,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",ao,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),co,e.createElementVNode("span",so,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",mo,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,uo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",po,[e.createElementVNode("div",vo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,fo)])])]),e.createElementVNode("div",go,[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",ko,[e.createElementVNode("div",yo,[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,Eo)])])])):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),Vo]),e.createElementVNode("div",No,[e.createElementVNode("div",_o,[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,bo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Bo,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,Co))])],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),So]),e.createElementVNode("div",wo,[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",Do,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",To,[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",xo,[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",Mo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Lo,[e.createElementVNode("div",Ho,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",qo,[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",$o,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("div",Oo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Po,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,zo)):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,Ro)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",jo,[e.createElementVNode("div",Ao,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Uo,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Jo)):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,Io)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Go,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Ko,[e.createElementVNode("div",Qo,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,Xo)])])])):e.createCommentVNode("v-if",!0)])])]}))])):(e.openBlock(),e.createElementBlock("div",Yo,[e.createElementVNode("div",Zo,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",en,[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,tn),on,nn,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,rn)]))])},module.exports=fe;
|
|
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"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=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(i),v=d(a),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"},E=["href"],V=["src"],N={key:1},_=[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"],$=["innerHTML"],F=["innerHTML"],O={key:0,class:"options is-toggled"},P={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),ie=["href"],ae=["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"];h.render=function(t,o,n,r,l,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",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,V)):(e.openBlock(),e.createElementBlock("svg",N,_))],2)],8,E)]),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,$)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,F)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",P,[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,ae)):(e.openBlock(),e.createElementBlock("svg",ce,se))],2)],8,ie)]),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 ve=n.SchemaFormFactory([m.default({})]),he={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 fe=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ve},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"]}},name:"order-checkout",setup:function(r){var l=c.useToast(),i=o.useStore(),a=e.ref(!1),s=e.computed((function(){return i.getters["cart/quantity"]})),d=e.computed((function(){return i.getters["cart/items"]})),m=e.computed((function(){return i.getters["cart/total"]})),h=e.computed((function(){return i.getters["auth/is"]})),f=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),y=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref({}),_=e.ref([]),b=e.ref([]),B=e.ref("new"),C=e.ref(null),S=e.computed((function(){return i.getters["checkout/shippingData"]})),w=e.ref(!1),D=e.ref(!1),T=e.ref(""),x=e.ref(null),M=e.ref(!1),L=e.getCurrentInstance(),H=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),q=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&&(w.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){return e.computed({get:function(){return f.value[t]},set:function(e){var o=JSON.parse(JSON.stringify(f.value));o[t]=e,i.commit("checkout/user",o)}})},O=e.ref({last_name:F("last_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),user_type:F("user_type")});i.dispatch("auth/me",{finally:function(){}});var P=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),z=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),R=e.computed((function(){return P.value?_.value.find((function(e){return e.id==P.value})):{}})),j=e.computed((function(){return z.value?b.value.find((function(e){return e.id==z.value})):{}})),A=e.computed((function(){return G(_.value,P.value)})),U=e.computed((function(){return G(b.value,z.value)})),J=e.computed((function(){return K(_.value)})),I=e.computed((function(){return K(b.value)})),W=e.computed((function(){var e=[];return d.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),G=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(m.value*n.amount/100))}return o},K=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=m.value>=n.price_min&&m.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=m.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=m.value<=n.price_max,e.restrictedForce=!o),o&&P.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(P.value)),o&&z.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(z.value)),o&&n.categories&&n.categories.length&&(o=!W.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===O.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Q=e.computed((function(){var e=0;return d.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){_.value=e.data.shipping,b.value=e.data.payment})),e.watch(B,(function(e){"login"==e&&i.commit("auth/modal","login")}));var X={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"},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_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}},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}},Y=Object.keys(X).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=X[t]),e}),{}),Z=e.ref(Y);n.useSchemaForm(O);var ee={last_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()}))},te=Object.keys(ee).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ee[t]),e}),{}),oe=v.object().shape(te);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));return{auth:h,userType:B,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){B.value="new"},quantity:s,items:d,loading:a,pluralize:t.pluralize,discount:Q,total:m,shipping:P,shippingPrice:A,payment:z,fee:U,userValidation:oe,userSchema:Z,userSubmitButton:C,checkout:function(){oe.isValid(O.value).then((function(t){if(t)if(P.value)if(!R.value.component||S.value[R.value.code]&&S.value[R.value.code].isValid)if(z.value)if(H.value){var o,n=S.value[R.value.code]?JSON.parse(JSON.stringify(S.value[R.value.code])):{};if(delete n.isValid,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 r={checkout:!0,user:{last_name:O.value.last_name,name:O.value.name,phone:O.value.phone,email:O.value.email,user_type:O.value.user_type,registration_number:O.value.registration_number},shipping:{id:P.value,data:n},payment:{id:z.value},comment:$.value,dontcall:q.value,promoCode:T.value,clientId:o};a.value=!0,$http.post(window.location.href,r).then((function(t){if(t.data.redirect)N.value={url:t.data.redirect.url,data:t.data.redirect.data};else{var o=[];d.value.forEach((function(e){o.push({name:e.name,id:e.attributes.code,price:e.attributes.price,brand:e.attributes.brand,category:e.attributes.category,quantity:e.quantity})}));var n={ecommerce:{purchase:{actionField:{id:t.data.order.id,affiliation:"mrfix.ua",revenue:m.value+U.value+A.value,tax:"0",shipping:A.value},products:[o]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Purchase","gtm-ee-event-non-interaction":"False",eventTimeout:2e3};window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))}y.value=!0,E.value=t.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),e.nextTick((function(){k.value.submit()}))})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){a.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+R.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else B.value="new",C.value.click(),l(__("shop.order.validate_user"),{type:"error"})}))},ifCheckoutReady:g,validate:function(){oe.isValid(O.value).then((function(e){g.value=e&&z.value&&H.value&&P.value&&(!R.value.component||R.value.component&&S.value[R.value.code]&&S.value[R.value.code].isValid)}))},shippingTypesRestricted:J,paymentMethodsRestricted:I,toggleShippingRadio:function(e){P.value===e&&(P.value=null)},togglePaymentRadio:function(e){z.value===e&&(z.value=null)},shippingSelected:R,paymentSelected:j,shippingComponentData:S,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(S.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:function(){i.commit("checkout/reset")},user:O,dontcall:q,comment:$,isCommentToggled:w,commentMaxLength:1e3,userCheckout:f,thanks:y,order:E,redirect:N,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:D,applyPromoCode:function(){T.value&&(M.value=!0,$http.post(window.location.href,{promoCodeApply:T.value,email:O.value.email,total:m.value}).then((function(e){x.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:he,props:{message:__("shop.order.promo.error_"+e.error,{number:L.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(T.value="")})),x.value=null)})).finally((function(){M.value=!1})))},promoCode:T,isPromoLoading:M,promoCodeApplied:x,resetPromoCode:function(){T.value="",x.value=null},calculateWithPromoCodeDiscount:function(){var e=m.value+U.value+A.value;return x.value&&"percent"==x.value.type?Math.round(e-e*x.value.amount/100):x.value&&"discount"==x.value.type?Math.max(0,e-x.value.amount):e},consent:V}}}),ge={class:"cart checkout"},ke=["action"],ye=["name","value"],Ee={key:1,class:"items-wrapper"},Ve={class:"checkout-title"},Ne={class:"columns"},_e={class:"column checkout-blocks-wrapper"},be={class:"checkout-block is-cart"},Be={class:"wrapper"},Ce={class:"title-row"},Se={class:"items-title"},we=["textContent"],De=e.createTextVNode(" "),Te=["innerHTML"],xe=["onClick"],Me=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Le={class:"checkout-block is-user auth-user"},He={class:"wrapper"},qe={class:"items-title"},$e={key:0,class:"user-tabs"},Fe={class:"columns"},Oe={class:"column user-form"},Pe={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={key:0,class:"column user-login user-form"},Re={key:1,class:"column"},je={key:0,class:"social-auth"},Ae={class:"socials"},Ue={class:"description"},Je={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],We=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ge={class:"checkout-block is-shipping"},Ke={class:"wrapper shipping-type-block"},Qe={class:"rows"},Xe={class:"item"},Ye={class:"row"},Ze={class:"info"},et={class:"items-title mb-1"},tt={key:0,class:"value"},ot={class:"next-dates"},nt={class:"row"},rt={class:"info"},lt=["value","onClick"],it=["src"],at={key:1,class:"icon"},ct=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],st={key:0,class:"description"},dt={class:"value"},mt={key:0,class:"green"},ut=["innerHTML"],pt={key:0,class:"checkout-block is-payment"},vt={class:"wrapper payment-method-block"},ht={class:"rows"},ft={class:"item"},gt={class:"row"},kt={class:"info"},yt={class:"items-title mb-1"},Et={class:"info"},Vt=["value","onClick"],Nt={key:0,class:"description"},_t={key:0,class:"value"},bt=["innerHTML"],Bt={class:"column is-4"},Ct={class:"checkout-block summary"},St={key:0,class:"inner payment-method-block"},wt={class:"rows"},Dt={class:"item"},Tt={class:"row"},xt={class:"info"},Mt={class:"items-title mb-1"},Lt={class:"info"},Ht=["value","onClick"],qt={key:0,class:"description"},$t={key:0,class:"value"},Ft=["innerHTML"],Ot=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),Pt={class:"inner"},zt={class:"items-title"},Rt={class:"rows"},jt={class:"row products"},At={class:"info"},Ut=["textContent"],Jt={class:"value"},It=["innerHTML"],Wt={key:0,class:"row discount"},Gt={class:"info"},Kt={class:"value"},Qt=["innerHTML"],Xt={key:1,class:"row fee"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:2,class:"row shipping"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],lo={key:1,class:"green"},io={key:3,class:"row promo"},ao={class:"info"},co=e.createElementVNode("br",null,null,-1),so={class:"green"},mo={class:"value"},uo=["innerHTML"],po={class:"row price"},vo={class:"info"},ho={class:"value orange"},fo=["innerHTML"],go={class:"checkbox-wrapper nocall"},ko={key:0,class:"consent"},yo={class:"checkbox-wrapper"},Eo=["innerHTML"],Vo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),No={class:"user-form is-promo-code"},_o={class:"control"},bo=["disabled"],Bo={class:"label",for:"promo-code-applied"},Co=["disabled"],So=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),wo={class:"user-form"},Do={key:0,class:"chars-count"},To={key:2,class:"checkout-block thanks"},xo={class:"title"},Mo={class:"columns"},Lo={key:0,class:"column is-6"},Ho={class:"subtitle"},qo={key:1,class:"column is-6"},$o={class:"column is-6"},Fo={key:0,class:"info-wrapper"},Oo={class:"title"},Po={class:"columns"},zo=["innerHTML"],Ro=["innerHTML"],jo={key:1,class:"info-wrapper"},Ao={class:"title"},Uo={class:"columns"},Jo=["innerHTML"],Io=["innerHTML"],Wo={key:2,class:"info-wrapper"},Go={class:"title"},Ko={class:"columns"},Qo={class:"column is-6"},Xo=["innerHTML"],Yo={key:3,class:"checkout-block empty"},Zo={class:"title"},en={class:"message"},tn=["href"],on=e.createTextVNode(", "),nn=e.createElementVNode("br",null,null,-1),rn=["href"];fe.render=function(t,o,n,r,l,i){var a=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ge,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,ye)})),128))],8,ke)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",Ve,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Ne,[e.createElementVNode("div",_e,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",be,[e.createCommentVNode("items"),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.createElementVNode("div",Se,[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,we),De,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Te)])]),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(a,{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},[Me,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,xe)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Le,[e.createElementVNode("div",He,[e.createElementVNode("div",qe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",$e,[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",Fe,[e.withDirectives(e.createElementVNode("div",Oe,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Pe,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",ze,[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",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Ae,[e.createElementVNode("div",Ue,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Je,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},We)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",ot,"на "+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",nt,[e.createElementVNode("div",rt,[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,lt),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",at,ct)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",st,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",dt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",mt,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,ut))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])),[[e.vShow,n.component&&n.id==t.shipping]])],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",pt,[e.createElementVNode("div",vt,[e.createElementVNode("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,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",Et,[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,Vt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Nt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,bt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Bt,[e.createElementVNode("div",Ct,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",wt,[e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Mt,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",Lt,[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,Ht),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",qt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ft)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Ot,e.createElementVNode("div",Pt,[e.createElementVNode("div",zt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Rt,[e.createElementVNode("div",jt,[e.createElementVNode("div",At,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Ut),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Jt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,It)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Wt,[e.createElementVNode("div",Gt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Qt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",no,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,ro)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",lo,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",ao,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),co,e.createElementVNode("span",so,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",mo,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,uo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",po,[e.createElementVNode("div",vo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,fo)])])]),e.createElementVNode("div",go,[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",ko,[e.createElementVNode("div",yo,[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,Eo)])])])):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),Vo]),e.createElementVNode("div",No,[e.createElementVNode("div",_o,[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,bo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Bo,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,Co))])],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),So]),e.createElementVNode("div",wo,[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",Do,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",To,[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",xo,[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",Mo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Lo,[e.createElementVNode("div",Ho,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",qo,[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",$o,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("div",Oo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Po,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,zo)):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,Ro)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",jo,[e.createElementVNode("div",Ao,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Uo,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Jo)):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,Io)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Go,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Ko,[e.createElementVNode("div",Qo,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,Xo)])])])):e.createCommentVNode("v-if",!0)])])]}))])):(e.openBlock(),e.createElementBlock("div",Yo,[e.createElementVNode("div",Zo,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",en,[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,tn),on,nn,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,rn)]))])},module.exports=fe;
|
|
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=28280fa8&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-hidden\" method=\"post\" target=\"_blank\">\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 <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\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 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 } 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\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 },\n name: 'order-checkout',\n setup(props) {\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\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) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type'),\n });\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 },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n },\n };\n\n const 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 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 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 };\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 = () => {\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));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('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 (!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 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 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 },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n 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.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False',\n eventTimeout: 2000,\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n //debug\n //resertStore();\n //eof debug\n\n nextTick(() => {\n redirectForm.value.submit();\n });\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 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 };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\" target=\"_blank\">\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 <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\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 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 } 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\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 },\n name: 'order-checkout',\n setup(props) {\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\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) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type'),\n });\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 },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n },\n };\n\n const 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 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 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 };\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 = () => {\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));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('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 (!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 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 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 },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n 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.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False',\n eventTimeout: 2000,\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n //debug\n //resertStore();\n //eof debug\n\n nextTick(() => {\n redirectForm.value.submit();\n });\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 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 };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_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","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","data","JSON","parse","stringify","user","last_name","email","phone","registration_number","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","then","response","userSchemaFields","component","model","label","list","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","facebook","$ziggy","provider","google","loginCallback","pluralize","checkout","isValid","valid","clientId","document","cookie","split","parts","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","eventTimeout","dataLayer","querySelector","classList","add","nextTick","submit","e","console","error","click","validate","isUserValid","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","resertStore","commentMaxLength","home","$env","locale","applyPromoCode","promoCodeApply","number","appContext","config","globalProperties","$filters","resetPromoCode","calculateWithPromoCodeDiscount","max","action","method","target","_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","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_67","_hoisted_68","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_81","_hoisted_82","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_91","_hoisted_93","_hoisted_94","_hoisted_95","_hoisted_97","_hoisted_98","_hoisted_99","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_105","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_112","_hoisted_113","_hoisted_114","_hoisted_116","onMouseenter","_hoisted_117","_hoisted_118","_hoisted_120","_hoisted_121","_hoisted_122","placeholder","disabled","_hoisted_124","_hoisted_126","_hoisted_127","_hoisted_128","_hoisted_129","filters","_hoisted_130","_hoisted_131","_hoisted_132","_hoisted_133","_hoisted_134","_hoisted_135","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_141","_hoisted_142","_hoisted_143","_hoisted_146","_hoisted_147","_hoisted_148","_hoisted_149","_hoisted_151","_hoisted_152","_hoisted_153","_hoisted_156"],"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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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=1ba1fcdf&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-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('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 <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\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 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 } 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\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 },\n name: 'order-checkout',\n setup(props) {\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\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) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type'),\n });\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 },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n },\n };\n\n const 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 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 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 };\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 = () => {\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));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('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 (!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 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 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 },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n 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.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False',\n eventTimeout: 2000,\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n //debug\n //resertStore();\n //eof debug\n\n nextTick(() => {\n redirectForm.value.submit();\n });\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 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 };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" class=\"is-hidden\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('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 <component :is=\"item.component\" v-show=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\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 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 } 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\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 },\n name: 'order-checkout',\n setup(props) {\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\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) => {\n return computed({\n get() {\n return userCheckout.value[name];\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type'),\n });\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 },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email'\n },\n };\n\n const 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 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 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 };\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 = () => {\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));\n });\n };\n\n const checkout = () => {\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('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 (!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 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 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 },\n shipping: {\n id: shipping.value,\n data: data\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n 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.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n } else {\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n purchase: {\n actionField: {\n id: response.data.order.id,\n affiliation: 'mrfix.ua',\n revenue: total.value + fee.value + shippingPrice.value,\n tax: '0',\n shipping: shippingPrice.value\n },\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Purchase',\n 'gtm-ee-event-non-interaction': 'False',\n eventTimeout: 2000,\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n order.value = response.data.order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n //debug\n //resertStore();\n //eof debug\n\n nextTick(() => {\n redirectForm.value.submit();\n });\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 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 };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_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","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","data","JSON","parse","stringify","user","last_name","email","phone","registration_number","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","then","response","userSchemaFields","component","model","label","list","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","facebook","$ziggy","provider","google","loginCallback","pluralize","checkout","isValid","valid","clientId","document","cookie","split","parts","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","eventTimeout","dataLayer","querySelector","classList","add","nextTick","submit","e","console","error","click","validate","isUserValid","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","resertStore","commentMaxLength","home","$env","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","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_67","_hoisted_68","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_81","_hoisted_82","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_91","_hoisted_93","_hoisted_94","_hoisted_95","_hoisted_97","_hoisted_98","_hoisted_99","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_105","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_112","_hoisted_113","_hoisted_114","_hoisted_116","onMouseenter","_hoisted_117","_hoisted_118","_hoisted_120","_hoisted_121","_hoisted_122","placeholder","disabled","_hoisted_124","_hoisted_126","_hoisted_127","_hoisted_128","_hoisted_129","filters","_hoisted_130","_hoisted_131","_hoisted_132","_hoisted_133","_hoisted_134","_hoisted_135","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_141","_hoisted_142","_hoisted_143","_hoisted_146","_hoisted_147","_hoisted_148","_hoisted_149","_hoisted_151","_hoisted_152","_hoisted_153","_hoisted_156"],"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,q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AAkW,wCACOhW,iCACHF,iCAAM,sBAAIE,QAAMH,+CAAgBG,iCAEpCF,2BAAAmW,IACmCjW,WAASsN,mBAAxCvN,2BAAAmW,IACIpW,2BAAAqW,qBAAyBnW,kCACzBF,qCAAc,oBAAqB+Q,yCAAO7Q,eAAauO,8BAAavO,uDAExED,2BAAAqW,IACItW,qCAAc,mBAAoB+Q,wCAAO7Q,uDAASA,kCAEtDF,2BAAAuW,IACoCrW,QAAM4I,2BAAtC7I,2BAAAuW,IACIxW,2BAAAyW,qBAAsBvW,gCACtBF,2BAAA0W,IACmCxW,QAAM4I,2BAArC7I,wCAAW,cAAuCqB,UAAQpB,QAAM4I,yDACjC5I,QAAM4I,2BAArC7I,wCAAW,cAAuCqB,UAAQpB,QAAM4I,8FAGxC5I,QAAM6I,0BAAtC9I,2BAAA0W,IACI3W,2BAAA4W,qBAAsB1W,+BACtBF,2BAAA6W,IACmC3W,QAAM6I,0BAArC9I,wCAAW,cAAsCqB,UAAQpB,QAAM6I,wDAChC7I,QAAM6I,0BAArC9I,wCAAW,cAAsCqB,UAAQpB,QAAM6I,6FAGvC7I,QAAMmH,yBAAtCpH,2BAAA6W,IACI9W,2BAAA+W,qBAAsB7W,kCACtBF,2BAAAgX,IACIhX,2BAAAiX,IACIjX,6BAAMsB,UAAQpB,QAAMmH,gBAAiB,qFAQjEpH,2BAAAiX,IACIlX,2BAAAmX,qBAAsBjX,4BACtBF,2BAAAoX,wCACOlX,kCACHF,qBAAoF,KAAhFQ,KAAMN,OAAKsP,OAAOhC,IAAMtN,OAAKsP,OAAOhC,2BAActN,oCAAgCmX,uCAASnX,kCAEnGF,gCAAS,kBAAmBQ,KAAMN,OAAKsP,OAAOhC,IAAMtN,OAAKsP,OAAOhC,2BAActN"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),s=require("@perevorot/shop/dist/forms/FormSelect"),l=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),
|
|
1
|
+
"use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),s=require("@perevorot/shop/dist/forms/FormSelect"),l=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),w=d(s),S=d(l),q=d(c),x=d(f);function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(r){return function(r){if(Array.isArray(r))return A(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return A(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(r,e):void 0}}function A(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var _={pluralize:function(r,e){return r+" "+e[r%100>4&&r%100<20?2:[2,0,1,1,1,2][Math.min(r%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:w.default,FormSwitch:S.default,FormText:q.default,FormTextarea:x.default},o={},n={},i={};if(e.form)for(var a=function(){var e=j(s[u],2),a=e[0],l=e[1];if("_"!=a.charAt(0)){var c;switch(l.component){case"FormCheckbox":case"FormSwitch":c=!1;break;case"FormCheckboxes":c=[];break;default:c=""}o[a]=c}var f=t[l.component];r.markRaw(f);var d={component:f,label:l.label,validations:{}};if(l.validation){var m=p;l.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}("required"==t&&(d.validations.required=!0),"phone"==t&&d.validations.required)&&(t="matches",e=[l.pattern?new RegExp(l.pattern):/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]);"array"!=t&&e.push(__("auth.validation."+t));try{var n;m=(n=m)[t].apply(n,O(e))}catch(r){}})),i[a]=m}l.condition&&(d.condition=function(r){return r[l.condition[0]]===l.condition[1]},i[a]=p.string().when(l.condition[0],{is:l.condition[1],then:i[a]})),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){l[r]&&(d[r]=l[r])})),n[a]=d},u=0,s=Object.entries(e.form);u<s.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"}};module.exports=_;
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\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\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n markRaw(component);\n\n let s = {\n component: component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n v = v[method](...attributes);\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.string().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n};","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","push","error","condition","when","is","then","f","Object","entries","object","shape","nl2p","str","replace"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC9BhD,MAAe,CACXI,UCLW,SAAmBC,EAAOC,UAG9BD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKf,IAAIa,EAAQ,GAAI,MDGhGG,UDgCW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,eAAgBA,UAChBC,aAAcA,UACdC,UAAWA,UACXC,WAAYA,UACZC,YAAaA,UACbC,WAAYA,UACZC,WAAYA,UACZC,SAAUA,UACVC,aAAcA,WAGdC,EAAQ,GACRC,EAAS,GACTC,EAAa,MAEbd,EAAKe,0CACOC,OAAOC,UACQ,KAAnBD,EAAME,OAAO,GAAW,KACpB3B,SAEI0B,EAAQE,eACP,mBACA,aACD5B,GAAQ,YAGP,iBACDA,EAAQ,iBAGRA,EAAQ,GAGhBqB,EAAMI,GAASzB,MAGb4B,EAAYlB,EAAWgB,EAAQE,WAErCC,UAAQD,OAEJE,EAAI,CACJF,UAAWA,EACXG,MAAOL,EAAQK,MACfC,YAAa,OAGbN,EAAQH,WAAY,KAChBU,EAAI5C,EAEYqC,EAAQH,WAEhBW,SAAQ,SAACC,OACbC,EAAa,GACbC,EAASF,KAETE,EAAOC,MAAM,KAAKrC,OAAS,EAAG,KAC1BsC,EAAqBJ,EAAKG,MAAM,KACpCD,EAASE,EAAmBC,QAE5BJ,EAAaK,KAAKC,MAAMH,
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\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\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n markRaw(component);\n\n let s = {\n component: component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = element.pattern ? new RegExp(element.pattern) : /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n v = v[method](...attributes);\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.string().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n};","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","pattern","RegExp","push","error","condition","when","is","then","f","Object","entries","object","shape","nl2p","str","replace"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC9BhD,MAAe,CACXI,UCLW,SAAmBC,EAAOC,UAG9BD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKf,IAAIa,EAAQ,GAAI,MDGhGG,UDgCW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,eAAgBA,UAChBC,aAAcA,UACdC,UAAWA,UACXC,WAAYA,UACZC,YAAaA,UACbC,WAAYA,UACZC,WAAYA,UACZC,SAAUA,UACVC,aAAcA,WAGdC,EAAQ,GACRC,EAAS,GACTC,EAAa,MAEbd,EAAKe,0CACOC,OAAOC,UACQ,KAAnBD,EAAME,OAAO,GAAW,KACpB3B,SAEI0B,EAAQE,eACP,mBACA,aACD5B,GAAQ,YAGP,iBACDA,EAAQ,iBAGRA,EAAQ,GAGhBqB,EAAMI,GAASzB,MAGb4B,EAAYlB,EAAWgB,EAAQE,WAErCC,UAAQD,OAEJE,EAAI,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