@perevorot/shop 2.0.84 → 2.0.85

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"},O=["innerHTML"],q=["innerHTML"],$=["innerHTML"],F={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"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,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,O)):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,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,$)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",F,[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 fe=n.SchemaFormFactory([m.default({})]),ge={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ke=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},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(null),_=e.ref({}),b=e.ref([]),B=e.ref([]),C=e.ref("new"),S=e.ref(null),w=e.computed((function(){return i.getters["checkout/shippingData"]})),D=e.ref(!1),T=e.ref(!1),x=e.ref(""),M=e.ref(null),L=e.ref(!1),H=e.getCurrentInstance(),O=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&&(D.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)}})};e.provide("field",F);var P=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")});e.provide("user",P),i.dispatch("auth/me",{finally:function(){}});var z=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),R=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),j=e.computed((function(){return z.value?b.value.find((function(e){return e.id==z.value})):{}})),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return K(b.value,z.value)})),J=e.computed((function(){return K(B.value,R.value)})),I=e.computed((function(){return Q(b.value)})),W=e.computed((function(){return Q(B.value)})),G=e.computed((function(){var e=[];return d.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),K=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},Q=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&&z.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(z.value)),o&&R.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(R.value)),o&&n.categories&&n.categories.length&&(o=!G.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===P.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},X=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){b.value=e.data.shipping,B.value=e.data.payment})),e.watch(C,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Y={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"}},Z=Object.keys(Y).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Y[t]),e}),{}),ee=e.ref(Z);n.useSchemaForm(P);var te={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()}))},oe=Object.keys(te).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=te[t]),e}),{}),ne=v.object().shape(oe);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var re=he((function(){return ve(le.value(),(function(e){ne.isValid(P.value).then((function(t){g.value=t&&R.value&&O.value&&z.value&&(!j.value.component||j.value.component&&w.value[j.value.code]&&w.value[j.value.code].isValid)&&e}))}))})),le=e.ref(null);e.provide("shippingComponentValid",le);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ae=he((function(){return ve(le.value(),(function(t){ne.isValid(P.value).then((function(o){if(o)if(z.value)if(!j.value.component||w.value[j.value.code]&&w.value[j.value.code].isValid)if(t)if(R.value)if(O.value){var n,r=w.value[j.value.code]?JSON.parse(JSON.stringify(w.value[j.value.code])):{};delete r.isValid;var i=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var c={checkout:!0,user:{last_name:P.value.last_name,name:P.value.name,phone:P.value.phone,email:P.value.email,user_type:P.value.user_type,registration_number:P.value.registration_number},shipping:{id:z.value,data:r,user:i},payment:{id:R.value},comment:$.value,dontcall:q.value,promoCode:x.value,clientId:n};a.value=!0,$http.post(window.location.href,c).then((function(t){if(t.data.redirect)_.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+J.value+U.value,tax:"0",shipping:U.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")+": «"+j.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+j.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else C.value="new",S.value.click(),l(__("shop.order.validate_user"),{type:"error"})}))}))}));return{auth:h,userType:C,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){C.value="new"},quantity:s,items:d,loading:a,pluralize:t.pluralize,discount:X,total:m,shipping:z,shippingPrice:U,payment:R,fee:J,userValidation:ne,userSchema:ee,userSubmitButton:S,checkout:ae,ifCheckoutReady:g,validate:re,shippingTypesRestricted:I,paymentMethodsRestricted:W,toggleShippingRadio:function(e){z.value===e&&(z.value=null)},togglePaymentRadio:function(e){R.value===e&&(R.value=null)},shippingSelected:j,paymentSelected:A,shippingComponentData:w,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(w.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:function(){i.commit("checkout/reset")},user:P,dontcall:q,comment:$,isCommentToggled:D,commentMaxLength:1e3,userCheckout:f,thanks:y,order:E,redirect:_,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:T,applyPromoCode:function(){x.value&&(L.value=!0,$http.post(window.location.href,{promoCodeApply:x.value,email:P.value.email,total:m.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ge,props:{message:__("shop.order.promo.error_"+e.error,{number:H.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(x.value="")})),M.value=null)})).finally((function(){L.value=!1})))},promoCode:x,isPromoLoading:L,promoCodeApplied:M,resetPromoCode:function(){x.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=m.value+J.value+U.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N}}}),ye={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},_e={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},Se={class:"wrapper"},we={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=e.createTextVNode(" "),Me=["innerHTML"],Le=["onClick"],He=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},qe={class:"wrapper"},$e={class:"items-title"},Fe={key:0,class:"user-tabs"},Pe={class:"columns"},ze={class:"column user-form"},Re={type:"submit",ref:"userSubmitButton",class:"is-hidden"},je={key:0,class:"column user-login user-form"},Ae={key:1,class:"column"},Ue={key:0,class:"social-auth"},Je={class:"socials"},Ie={class:"description"},We={class:"buttons"},Ge=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ke=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Qe={class:"checkout-block is-shipping"},Xe={class:"wrapper shipping-type-block"},Ye={class:"rows"},Ze={class:"item"},et={class:"row"},tt={class:"info"},ot={class:"items-title mb-1"},nt={key:0,class:"value"},rt={class:"next-dates"},lt={class:"row"},it={class:"info"},at=["value","onClick"],ct=["src"],st={key:1,class:"icon"},dt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],mt={key:0,class:"description"},ut={class:"value"},pt={key:0,class:"green"},vt=["innerHTML"],ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},gt={class:"rows"},kt={class:"item"},yt={class:"row"},Et={class:"info"},Vt={class:"items-title mb-1"},Nt={class:"info"},_t=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],St={class:"column is-4"},wt={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Mt={class:"row"},Lt={class:"info"},Ht={class:"items-title mb-1"},Ot={class:"info"},qt=["value","onClick"],$t={key:0,class:"description"},Ft={key:0,class:"value"},Pt=["innerHTML"],zt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),Rt={class:"inner"},jt={class:"items-title"},At={class:"rows"},Ut={class:"row products"},Jt={class:"info"},It=["textContent"],Wt={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},lo={class:"value"},io=["innerHTML"],ao={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},mo=e.createElementVNode("br",null,null,-1),uo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},go={class:"value orange"},ko=["innerHTML"],yo={class:"checkbox-wrapper nocall"},Eo={key:0,class:"consent"},Vo={class:"checkbox-wrapper"},No=["innerHTML"],_o=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),bo={class:"user-form is-promo-code"},Bo={class:"control"},Co=["disabled"],So={class:"label",for:"promo-code-applied"},wo=["disabled"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form"},xo={key:0,class:"chars-count"},Mo={key:2,class:"checkout-block thanks"},Lo={class:"title"},Ho={class:"columns"},Oo={key:0,class:"column is-6"},qo={class:"subtitle"},$o={key:1,class:"column is-6"},Fo={class:"column is-6"},Po={key:0,class:"info-wrapper"},zo={class:"title"},Ro={class:"columns"},jo=["innerHTML"],Ao=["innerHTML"],Uo={key:1,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Wo=["innerHTML"],Go=["innerHTML"],Ko={key:2,class:"info-wrapper"},Qo={class:"title"},Xo={class:"columns"},Yo={class:"column is-6"},Zo=["innerHTML"],en={key:3,class:"checkout-block empty"},tn={class:"title"},on={class:"message"},nn=["href"],rn=e.createTextVNode(", "),ln=e.createElementVNode("br",null,null,-1),an=["href"];ke.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",ye,[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,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",_e,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",Se,[e.createElementVNode("div",we,[e.createElementVNode("div",De,[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,Te),xe,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Me)])]),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},[He,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Le)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Pe,[e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Re,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",je,[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",Ae,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",Je,[e.createElementVNode("div",Ie,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",We,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ge),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ke)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",rt,"на "+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",lt,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,at),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,ct)):(e.openBlock(),e.createElementBlock("svg",st,dt)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",mt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ut,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",pt,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,vt))])]),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",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,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",Nt,[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,_t),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",St,[e.createElementVNode("div",wt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,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",Ot,[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,qt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",$t,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Pt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),zt,e.createElementVNode("div",Rt,[e.createElementVNode("div",jt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",Ut,[e.createElementVNode("div",Jt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,It),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Wt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",lo,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,io)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",ao,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),mo,e.createElementVNode("span",uo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",go,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,ko)])])]),e.createElementVNode("div",yo,[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",Eo,[e.createElementVNode("div",Vo,[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,No)])])])):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),_o]),e.createElementVNode("div",bo,[e.createElementVNode("div",Bo,[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,Co),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",So,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,wo))])],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),Do]),e.createElementVNode("div",To,[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",xo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Mo,[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",Lo,[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",Ho,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("div",qo,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",$o,[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",Fo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",zo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ro,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,jo)):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,Ao)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Io,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Wo)):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,Go)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Ko,[e.createElementVNode("div",Qo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Xo,[e.createElementVNode("div",Yo,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,Zo)])])])):e.createCommentVNode("v-if",!0)])])]}))])):(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",tn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",on,[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,nn),rn,ln,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,an)]))])},module.exports=ke;
1
+ "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),l=require("@perevorot/shop/dist/forms/FormText"),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"},O=["innerHTML"],q=["innerHTML"],$=["innerHTML"],F={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"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,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,O)):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,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,$)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",F,[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 fe=n.SchemaFormFactory([m.default({})]),ge={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ke=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},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(null),_=e.ref({}),b=e.ref([]),B=e.ref([]),C=e.ref("new"),S=e.ref(null),w=e.computed((function(){return i.getters["checkout/shippingData"]})),D=e.ref(!1),T=e.ref(!1),x=e.ref(""),M=e.ref(null),L=e.ref(!1),H=e.getCurrentInstance(),O=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&&(D.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch($,(function(e){e.length>1e3&&($.value=$.value.substring(0,1e3))}));var F=function(t,o){return e.computed({get:function(){return f.value[t]?f.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(f.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",F);var P=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","individual")});e.provide("user",P),i.dispatch("auth/me",{finally:function(){}});var z=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),R=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),j=e.computed((function(){return z.value?b.value.find((function(e){return e.id==z.value})):{}})),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return K(b.value,z.value)})),J=e.computed((function(){return K(B.value,R.value)})),I=e.computed((function(){return Q(b.value)})),W=e.computed((function(){return Q(B.value)})),G=e.computed((function(){var e=[];return d.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),K=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},Q=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&&z.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(z.value)),o&&R.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(R.value)),o&&n.categories&&n.categories.length&&(o=!G.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===P.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},X=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){b.value=e.data.shipping,B.value=e.data.payment})),e.watch(C,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Y={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"}},Z=Object.keys(Y).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Y[t]),e}),{}),ee=e.ref(Z);n.useSchemaForm(P);var te={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()}))},oe=Object.keys(te).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=te[t]),e}),{}),ne=v.object().shape(oe);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var re=he((function(){return ve(le.value(),(function(e){ne.isValid(P.value).then((function(t){g.value=t&&R.value&&O.value&&z.value&&(!j.value.component||j.value.component&&w.value[j.value.code]&&w.value[j.value.code].isValid)&&e}))}))})),le=e.ref(null);e.provide("shippingComponentValid",le);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ae=he((function(){return ve(le.value(),(function(t){ne.isValid(P.value).then((function(o){if(o)if(z.value)if(!j.value.component||w.value[j.value.code]&&w.value[j.value.code].isValid)if(t)if(R.value)if(O.value){var n,r=w.value[j.value.code]?JSON.parse(JSON.stringify(w.value[j.value.code])):{};delete r.isValid;var i=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var c={checkout:!0,user:{last_name:P.value.last_name,name:P.value.name,phone:P.value.phone,email:P.value.email,user_type:P.value.user_type,registration_number:P.value.registration_number},shipping:{id:z.value,data:r,user:i},payment:{id:R.value},comment:$.value,dontcall:q.value,promoCode:x.value,clientId:n};a.value=!0,$http.post(window.location.href,c).then((function(t){if(t.data.redirect)_.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+J.value+U.value,tax:"0",shipping:U.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")+": «"+j.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+j.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else C.value="new",S.value.click(),l(__("shop.order.validate_user"),{type:"error"})}))}))}));return{auth:h,userType:C,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){C.value="new"},quantity:s,items:d,loading:a,pluralize:t.pluralize,discount:X,total:m,shipping:z,shippingPrice:U,payment:R,fee:J,userValidation:ne,userSchema:ee,userSubmitButton:S,checkout:ae,ifCheckoutReady:g,validate:re,shippingTypesRestricted:I,paymentMethodsRestricted:W,toggleShippingRadio:function(e){z.value===e&&(z.value=null)},togglePaymentRadio:function(e){R.value===e&&(R.value=null)},shippingSelected:j,paymentSelected:A,shippingComponentData:w,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(w.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:function(){i.commit("checkout/reset")},user:P,dontcall:q,comment:$,isCommentToggled:D,commentMaxLength:1e3,userCheckout:f,thanks:y,order:E,redirect:_,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:T,applyPromoCode:function(){x.value&&(L.value=!0,$http.post(window.location.href,{promoCodeApply:x.value,email:P.value.email,total:m.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ge,props:{message:__("shop.order.promo.error_"+e.error,{number:H.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(x.value="")})),M.value=null)})).finally((function(){L.value=!1})))},promoCode:x,isPromoLoading:L,promoCodeApplied:M,resetPromoCode:function(){x.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=m.value+J.value+U.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N}}}),ye={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},_e={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},Se={class:"wrapper"},we={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=e.createTextVNode(" "),Me=["innerHTML"],Le=["onClick"],He=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},qe={class:"wrapper"},$e={class:"items-title"},Fe={key:0,class:"user-tabs"},Pe={class:"columns"},ze={class:"column user-form"},Re={type:"submit",ref:"userSubmitButton",class:"is-hidden"},je={key:0,class:"column user-login user-form"},Ae={key:1,class:"column"},Ue={key:0,class:"social-auth"},Je={class:"socials"},Ie={class:"description"},We={class:"buttons"},Ge=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ke=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Qe={class:"checkout-block is-shipping"},Xe={class:"wrapper shipping-type-block"},Ye={class:"rows"},Ze={class:"item"},et={class:"row"},tt={class:"info"},ot={class:"items-title mb-1"},nt={key:0,class:"value"},rt={class:"next-dates"},lt={class:"row"},it={class:"info"},at=["value","onClick"],ct=["src"],st={key:1,class:"icon"},dt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],mt={key:0,class:"description"},ut={class:"value"},pt={key:0,class:"green"},vt=["innerHTML"],ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},gt={class:"rows"},kt={class:"item"},yt={class:"row"},Et={class:"info"},Vt={class:"items-title mb-1"},Nt={class:"info"},_t=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],St={class:"column is-4"},wt={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Mt={class:"row"},Lt={class:"info"},Ht={class:"items-title mb-1"},Ot={class:"info"},qt=["value","onClick"],$t={key:0,class:"description"},Ft={key:0,class:"value"},Pt=["innerHTML"],zt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),Rt={class:"inner"},jt={class:"items-title"},At={class:"rows"},Ut={class:"row products"},Jt={class:"info"},It=["textContent"],Wt={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},lo={class:"value"},io=["innerHTML"],ao={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},mo=e.createElementVNode("br",null,null,-1),uo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},go={class:"value orange"},ko=["innerHTML"],yo={class:"checkbox-wrapper nocall"},Eo={key:0,class:"consent"},Vo={class:"checkbox-wrapper"},No=["innerHTML"],_o=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),bo={class:"user-form is-promo-code"},Bo={class:"control"},Co=["disabled"],So={class:"label",for:"promo-code-applied"},wo=["disabled"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form"},xo={key:0,class:"chars-count"},Mo={key:2,class:"checkout-block thanks"},Lo={class:"title"},Ho={class:"columns"},Oo={key:0,class:"column is-6"},qo={class:"subtitle"},$o={key:1,class:"column is-6"},Fo={class:"column is-6"},Po={key:0,class:"info-wrapper"},zo={class:"title"},Ro={class:"columns"},jo=["innerHTML"],Ao=["innerHTML"],Uo={key:1,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Wo=["innerHTML"],Go=["innerHTML"],Ko={key:2,class:"info-wrapper"},Qo={class:"title"},Xo={class:"columns"},Yo={class:"column is-6"},Zo=["innerHTML"],en={key:3,class:"checkout-block empty"},tn={class:"title"},on={class:"message"},nn=["href"],rn=e.createTextVNode(", "),ln=e.createElementVNode("br",null,null,-1),an=["href"];ke.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",ye,[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,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",_e,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",Se,[e.createElementVNode("div",we,[e.createElementVNode("div",De,[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,Te),xe,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Me)])]),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},[He,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Le)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Pe,[e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Re,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",je,[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",Ae,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",Je,[e.createElementVNode("div",Ie,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",We,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ge),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ke)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",rt,"на "+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",lt,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,at),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,ct)):(e.openBlock(),e.createElementBlock("svg",st,dt)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",mt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ut,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",pt,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,vt))])]),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",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,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",Nt,[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,_t),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",St,[e.createElementVNode("div",wt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,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",Ot,[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,qt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",$t,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Pt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),zt,e.createElementVNode("div",Rt,[e.createElementVNode("div",jt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",Ut,[e.createElementVNode("div",Jt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,It),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Wt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",lo,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,io)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",ao,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),mo,e.createElementVNode("span",uo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",go,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,ko)])])]),e.createElementVNode("div",yo,[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",Eo,[e.createElementVNode("div",Vo,[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,No)])])])):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),_o]),e.createElementVNode("div",bo,[e.createElementVNode("div",Bo,[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,Co),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",So,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,wo))])],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),Do]),e.createElementVNode("div",To,[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",xo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Mo,[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",Lo,[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",Ho,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("div",qo,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",$o,[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",Fo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",zo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ro,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,jo)):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,Ao)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Io,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Wo)):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,Go)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Ko,[e.createElementVNode("div",Qo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Xo,[e.createElementVNode("div",Yo,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,Zo)])])])):e.createCommentVNode("v-if",!0)])])]}))])):(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",tn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",on,[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,nn),rn,ln,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,an)]))])},module.exports=ke;
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=4ff427a7&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>&nbsp;<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, provide } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n },\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 const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\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 provide('field', field);\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 provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\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 = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n 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 user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.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 shippingComponent\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>&nbsp;<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, provide } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n },\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 const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name) => {\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 provide('field', field);\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 provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\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 = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n 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 user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.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 shippingComponent\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","then","Promise","resolve","f","i","arguments","reject","e","_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","shippingComponent","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","provide","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","response","userSchemaFields","component","model","label","list","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","shippingComponentValid","isShippingComponentFormsValid","isValid","isUserValid","shippingComponentUserData","checkout","valid","clientId","shippingUserData","document","cookie","split","parts","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","eventTimeout","dataLayer","querySelector","classList","add","nextTick","submit","console","error","click","facebook","$ziggy","provider","google","loginCallback","pluralize","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,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,2CAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,0BACI,kBACA,qCAKR,4BACI,uBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,4DAIrBA,qBAA0B,oBAAV,6BAI7B,0BACI,kBACA,iCCmURH,EAAOI,cAErBA,EAAOA,EAAKJ,GAASA,MAEdA,EAAMI,SACZC,QAAQC,YAEVF,EAAOJ,OAAWI,kBArBHG,+DAGfC,GAAKC,yDAIT,gBACMJ,QAAQK,OAAOC,yDD3YrBC,oDAAW,mDAAmEC,OAAKlB,WAAWmB,YAC1DD,OAAKlB,WAAWmB,sBAAhDF,2BAAAG,GACIZ,2BAAAa,oBAA6BH,gEAEjCV,2BAAAc,GACId,oDAAW,kBAAkCU,OAAKlB,WAAWmB,YACzDX,2BAAAe,GAC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X,+CAAgBW,iCAEpCV,2BAAA+W,IACmCrW,WAASuN,mBAAxCxN,2BAAAuW,IACIhX,2BAAAiX,qBAAyBvW,kCACzBV,qCAAc,oBAAqB2R,yCAAOjR,eAAawO,8BAAaxO,uDAExED,2BAAAyW,IACIlX,qCAAc,mBAAoB2R,wCAAOjR,uDAASA,kCAEtDV,2BAAAmX,IACoCzW,QAAM8I,2BAAtC/I,2BAAA2W,IACIpX,2BAAAqX,qBAAsB3W,gCACtBV,2BAAAsX,IACmC5W,QAAM8I,2BAArC/I,wCAAW,cAAuCqB,UAAQpB,QAAM8I,yDACjC9I,QAAM8I,2BAArC/I,wCAAW,cAAuCqB,UAAQpB,QAAM8I,8FAGxC9I,QAAM+I,0BAAtChJ,2BAAA8W,IACIvX,2BAAAwX,qBAAsB9W,+BACtBV,2BAAAyX,IACmC/W,QAAM+I,0BAArChJ,wCAAW,cAAsCqB,UAAQpB,QAAM+I,wDAChC/I,QAAM+I,0BAArChJ,wCAAW,cAAsCqB,UAAQpB,QAAM+I,6FAGvC/I,QAAMoH,yBAAtCrH,2BAAAiX,IACI1X,2BAAA2X,qBAAsBjX,kCACtBV,2BAAA4X,IACI5X,2BAAA6X,IACI7X,6BAAM8B,UAAQpB,QAAMoH,gBAAiB,qFAQjErH,2BAAAqX,IACI9X,2BAAA+X,qBAAsBrX,4BACtBV,2BAAAgY,wCACOtX,kCACHV,qBAAoF,KAAhFgB,KAAMN,OAAK0P,OAAOnC,IAAMvN,OAAK0P,OAAOnC,2BAAcvN,oCAAgCuX,uCAASvX,kCAEnGV,gCAAS,kBAAmBgB,KAAMN,OAAK0P,OAAOnC,IAAMvN,OAAK0P,OAAOnC,2BAAcvN"}
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=38cf9a0c&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>&nbsp;<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, provide } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n },\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 const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\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 = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n 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 user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.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 shippingComponent\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>&nbsp;<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, provide } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n },\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 const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n const userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name'\n },\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 = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const checkout = async () => {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n 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 user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data.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 shippingComponent\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","then","Promise","resolve","f","i","arguments","reject","e","_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","shippingComponent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","defaultValue","data","JSON","parse","stringify","provide","user","last_name","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","response","userSchemaFields","component","model","label","list","mask","condition","userSchemaFieldsFiltered","reduce","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","shippingComponentValid","isShippingComponentFormsValid","isValid","isUserValid","shippingComponentUserData","checkout","valid","clientId","shippingUserData","document","cookie","split","parts","url","products","brand","category","ecommerce","purchase","actionField","affiliation","revenue","tax","event","eventTimeout","dataLayer","querySelector","classList","add","nextTick","submit","console","error","click","facebook","$ziggy","provider","google","loginCallback","pluralize","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,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,2CAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,kDAA6B,oCAMjD,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,0BACI,kBACA,qCAKR,4BACI,uBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,4DAIrBA,qBAA0B,oBAAV,6BAI7B,0BACI,kBACA,iCCmURH,EAAOI,cAErBA,EAAOA,EAAKJ,GAASA,MAEdA,EAAMI,SACZC,QAAQC,YAE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MxN,OAAK2P,OAAOnC,2BAAcxN,oCAAgCwX,uCAASxX,kCAEnGV,gCAAS,kBAAmBgB,KAAMN,OAAK2P,OAAOnC,IAAMxN,OAAK2P,OAAOnC,2BAAcxN"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormRadio"),a=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=i(r),m=i(n),h=i(o),s=u(a);e.markRaw(m.default),e.markRaw(h.default);var p=t.SchemaFormFactory([l.default({})]),c=e.defineComponent({components:{SchemaForm:p},setup:function(){var r,n=e.inject("user"),o=e.inject("field"),a=e.ref(null),i=e.ref(null),u=(r=function(){return i.value.click(),d.isValid(l.value)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}),l=e.ref({type:o("other_type"),name:o("other_name"),last_name:o("other_last_name"),phone_me:o("other_phone_me"),phone_other:o("other_phone_other")}),p=e.ref({type:{component:h.default,model:"type",label:"",list:[{code:"me",value:__("auth.registration.form.user_type_me")},{code:"other",value:__("auth.registration.form.user_type_other")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"name",condition:function(e){return"other"===e.type}},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",condition:function(e){return"other"===e.type}},phone_me:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_me",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"me"===e.type}},phone_other:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_other",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"other"===e.type}}});t.useSchemaForm(l);var c=/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,d=s.object().shape({name:s.string().when("type",(function(e){if("other"==e)return s.string().trim().required(__("auth.validation.required"))})),last_name:s.string().when("type",(function(e){if("other"==e)return s.string().trim().required(__("auth.validation.required"))})),phone_me:s.string().when("type",(function(e){if("me"==e)return s.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))})),phone_other:s.string().when("type",(function(e){if("other"==e)return s.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))}))});return{schema:p,validation:d,user:l,form:a,userSubmitButton:i,isValid:u,getValue:function(){var e=JSON.parse(JSON.stringify(l.value));return"me"==e.type?(e.name=n.value.name,e.last_name=n.value.last_name,e.phone=e.phone_me,delete e.phone_other,delete e.phone_me):(e.phone=e.phone_other,delete e.phone_me,delete e.phone_other),delete e.type,e}}}}),d={class:"auth-user"},f={type:"submit",ref:"userSubmitButton",class:"is-hidden"};c.render=function(t,r,n,o,a,i){var u=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",d,[e.createVNode(u,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,preventModelCleanupOnSchemaChange:!0,ref:"form"},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",f,null,512)]})),_:1},8,["schema","validation-schema"])])},module.exports=c;
1
+ "use strict";var e=require("vue"),t=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormRadio"),a=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=i(r),m=i(n),h=i(o),s=u(a);e.markRaw(m.default),e.markRaw(h.default);var p=t.SchemaFormFactory([l.default({})]),c=e.defineComponent({components:{SchemaForm:p},setup:function(){var r,n=e.inject("user"),o=e.inject("field"),a=e.ref(null),i=e.ref(null),u=(r=function(){return i.value.click(),d.isValid(l.value)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}),l=e.ref({type:o("other_type","me"),name:o("other_name",""),last_name:o("other_last_name",""),phone_me:o("other_phone_me",""),phone_other:o("other_phone_other","")}),p=e.ref({type:{component:h.default,model:"type",label:"",list:[{code:"me",value:__("auth.registration.form.user_type_me")},{code:"other",value:__("auth.registration.form.user_type_other")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"name",condition:function(e){return"other"===e.type}},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",condition:function(e){return"other"===e.type}},phone_me:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_me",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"me"===e.type}},phone_other:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_other",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"other"===e.type}}});t.useSchemaForm(l);var c=/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,d=s.object().shape({name:s.string().when("type",(function(e){if("other"==e)return s.string().trim().required(__("auth.validation.required"))})),last_name:s.string().when("type",(function(e){if("other"==e)return s.string().trim().required(__("auth.validation.required"))})),phone_me:s.string().when("type",(function(e){if("me"==e)return s.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))})),phone_other:s.string().when("type",(function(e){if("other"==e)return s.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))}))});return{schema:p,validation:d,user:l,form:a,userSubmitButton:i,isValid:u,getValue:function(){var e=JSON.parse(JSON.stringify(l.value));return"me"==e.type?(e.name=n.value.name,e.last_name=n.value.last_name,e.phone=e.phone_me,delete e.phone_other,delete e.phone_me):(e.phone=e.phone_other,delete e.phone_me,delete e.phone_other),delete e.type,e}}}}),d={class:"auth-user"},f={type:"submit",ref:"userSubmitButton",class:"is-hidden"};c.render=function(t,r,n,o,a,i){var u=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",d,[e.createVNode(u,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,preventModelCleanupOnSchemaChange:!0,ref:"form"},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",f,null,512)]})),_:1},8,["schema","validation-schema"])])},module.exports=c;
2
2
  //# sourceMappingURL=OtherRecipient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OtherRecipient.js","sources":["../../../../../src/components/shop/order/shipping/OtherRecipient.vue","../../../../../src/components/shop/order/shipping/OtherRecipient.vue?vue&type=template&id=7059040b&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject } from 'vue';\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';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('user');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type'),\n name: field('other_name'),\n last_name: field('other_last_name'),\n phone_me: field('other_phone_me'),\n phone_other: field('other_phone_other'),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>","<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject } from 'vue';\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';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('user');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type'),\n name: field('other_name'),\n last_name: field('other_last_name'),\n phone_me: field('other_phone_me'),\n phone_other: field('other_phone_other'),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>"],"names":["markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","components","setup","f","checkoutUser","inject","field","form","ref","userSubmitButton","isValid","value","click","validation","user","i","resolve","apply","this","reject","e","type","name","last_name","phone_me","phone_other","schema","component","model","label","list","code","__","condition","mask","useSchemaForm","phoneRegExp","yup","object","shape","string","when","trim","required","matches","getValue","raw","JSON","parse","stringify","phone","_createElementBlock","_hoisted_1","_createVNode","schemaRowClasses","_ctx","preventModelCleanupOnSchemaChange","afterForm","_createElementVNode","_hoisted_2"],"mappings":"omBAiBAA,UAAQC,WACRD,UA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,EAAIG,SAASE,OAAOC,SAASX,GAAG,gCAG/CT,UAAWc,EAAIG,SAASC,KAAK,QAAQ,SAACpB,MACtB,SAARA,SACOgB,EAAIG,SAASE,OAAOC,SAASX,GAAG,gCAG/CR,SAAUa,EAAIG,SAASC,KAAK,QAAQ,SAACpB,MACrB,MAARA,SACOgB,EAAIG,SAASG,SAASX,GAAG,0BAA0BY,QAAQR,EAAaJ,GAAG,6BAG1FP,YAAaY,EAAIG,SAASC,KAAK,QAAQ,SAACpB,MACxB,SAARA,SACOgB,EAAIG,SAASG,SAASX,GAAG,0BAA0BY,QAAQR,EAAaJ,GAAG,qCAKvF,CACHN,OAAAA,EACAb,WAAAA,EACAC,KAAAA,EACAP,KAAAA,EACAE,iBAAAA,EACAC,QAAAA,EACAmC,SAhGa,eACPC,EAAMC,KAAKC,MAAMD,KAAKE,UAAUnC,EAAKH,cAE3B,MAAZmC,EAAIzB,MACJyB,EAAIxB,KAAOlB,EAAaO,MAAMW,KAC9BwB,EAAIvB,UAAYnB,EAAaO,MAAMY,UACnCuB,EAAII,MAAQJ,EAAItB,gBAETsB,EAAIrB,mBACJqB,EAAItB,WAEXsB,EAAII,MAAQJ,EAAIrB,mBAETqB,EAAItB,gBACJsB,EAAIrB,oBAGRqB,EAAIzB,KAEJyB,gBChEJ,gBAGSzB,KAAK,SAASb,IAAI,yBAAyB,wGAH/D2C,2BAAAC,GACIC,iBAAYC,iBAAiB,QAAS5B,OAAQ6B,6BAA4BA,aAAaC,mCAAmC,EAAMhD,IAAI,SACrHiD,qBACP,kBAAAC,8BAAAC"}
1
+ {"version":3,"file":"OtherRecipient.js","sources":["../../../../../src/components/shop/order/shipping/OtherRecipient.vue","../../../../../src/components/shop/order/shipping/OtherRecipient.vue?vue&type=template&id=0b088d62&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject } from 'vue';\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';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('user');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>","<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject } from 'vue';\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';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('user');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>"],"names":["markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","components","setup","f","checkoutUser","inject","field","form","ref","userSubmitButton","isValid","value","click","validation","user","i","resolve","apply","this","reject","e","type","name","last_name","phone_me","phone_other","schema","component","model","label","list","code","__","condition","mask","useSchemaForm","phoneRegExp","yup","object","shape","string","when","trim","required","matches","getValue","raw","JSON","parse","stringify","phone","_createElementBlock","_hoisted_1","_createVNode","schemaRowClasses","_ctx","preventModelCleanupOnSchemaChange","afterForm","_createElementVNode","_hoisted_2"],"mappings":"omBAiBAA,UAAQC,WACRD,UAAQE,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzCC,kBAAgB,CAC3BC,WAAY,CACRJ,WAAAA,GAEJK,qBAqDmBC,EApDTC,EAAeC,SAAO,QACtBC,EAAQD,SAAO,SACfE,EAAOC,MAAI,MACXC,EAAmBD,MAAI,MAEvBE,GA+CSP,oBA9CXM,EAAiBE,MAAMC,QAEVC,EAAWH,QAAQI,EAAKH,6BA8C/B,KAAQ,EAAGI,sCACNA,sBAGLC,UAAUC,MAAMC,iCAEhBC,OAAOC,MAjDXN,EAAON,MAAI,CACba,KAAMf,EAAM,aAAc,MAC1BgB,KAAMhB,EAAM,aAAc,IAC1BiB,UAAWjB,EAAM,kBAAmB,IACpCkB,SAAUlB,EAAM,iBAAkB,IAClCmB,YAAanB,EAAM,oBAAqB,MAyBtCoB,EAASlB,MAAI,CACfa,KAAM,CACFM,UAAW/B,UACXgC,MAAO,OACPC,MAAO,GACPC,KAAM,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MAAZmC,EAAIzB,MACJyB,EAAIxB,KAAOlB,EAAaO,MAAMW,KAC9BwB,EAAIvB,UAAYnB,EAAaO,MAAMY,UACnCuB,EAAII,MAAQJ,EAAItB,gBAETsB,EAAIrB,mBACJqB,EAAItB,WAEXsB,EAAII,MAAQJ,EAAIrB,mBAETqB,EAAItB,gBACJsB,EAAIrB,oBAGRqB,EAAIzB,KAEJyB,gBChEJ,gBAGSzB,KAAK,SAASb,IAAI,yBAAyB,wGAH/D2C,2BAAAC,GACIC,iBAAYC,iBAAiB,QAAS5B,OAAQ6B,6BAA4BA,aAAaC,mCAAmC,EAAMhD,IAAI,SACrHiD,qBACP,kBAAAC,8BAAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.84",
3
+ "version": "2.0.85",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"