@perevorot/shop 2.0.151 → 2.0.153

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/dist/components/account/OrderItem.js +1 -1
  2. package/dist/components/account/OrderItem.js.map +1 -1
  3. package/dist/components/account/User.js +1 -1
  4. package/dist/components/account/User.js.map +1 -1
  5. package/dist/components/auth/Forget.js +1 -1
  6. package/dist/components/auth/Forget.js.map +1 -1
  7. package/dist/components/auth/Login.js +1 -1
  8. package/dist/components/auth/Login.js.map +1 -1
  9. package/dist/components/auth/Registration.js +1 -1
  10. package/dist/components/auth/Registration.js.map +1 -1
  11. package/dist/components/auth/Reset.js +1 -1
  12. package/dist/components/auth/Reset.js.map +1 -1
  13. package/dist/components/shop/Catalog.js +1 -1
  14. package/dist/components/shop/Catalog.js.map +1 -1
  15. package/dist/components/shop/PromoProducts.js +1 -1
  16. package/dist/components/shop/PromoProducts.js.map +1 -1
  17. package/dist/components/shop/Search.js +1 -1
  18. package/dist/components/shop/Search.js.map +1 -1
  19. package/dist/components/shop/cart/Cart.js +1 -1
  20. package/dist/components/shop/cart/Cart.js.map +1 -1
  21. package/dist/components/shop/cart/CartItem.js +1 -1
  22. package/dist/components/shop/cart/CartItem.js.map +1 -1
  23. package/dist/components/shop/filters/Price.js +1 -1
  24. package/dist/components/shop/filters/Price.js.map +1 -1
  25. package/dist/components/shop/order/Checkout.js +1 -1
  26. package/dist/components/shop/order/Checkout.js.map +1 -1
  27. package/dist/components/shop/order/CheckoutItem.js +1 -1
  28. package/dist/components/shop/order/CheckoutItem.js.map +1 -1
  29. package/dist/components/shop/order/OneClick.js +1 -1
  30. package/dist/components/shop/order/OneClick.js.map +1 -1
  31. package/dist/components/shop/reviews/Question.js +1 -1
  32. package/dist/components/shop/reviews/Question.js.map +1 -1
  33. package/dist/components/shop/reviews/Review.js +1 -1
  34. package/dist/components/shop/reviews/Review.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var i=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!==i.value.indexOf(e.id)})):[]}))}}}),i={key:0,class:"column is-12"},n={class:"bundle-title"},l={class:"column name"},r={class:"column is-narrow"},a=["href"],o=["src"],s={key:1},c=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],m={class:"column"},d={class:"columns is-gapless mb-0"},u={class:"column"},p={key:0,class:"code"},b={class:"title"},k=["href"],E={class:"column is-2 has-text-centered is-relative"},v={class:"quantity"},N={key:0,class:"quantity-price"},V=["innerHTML"],h={class:"column is-2 has-text-right"},g=["innerHTML"],f=["innerHTML"],y=["innerHTML"],B={key:0,class:"options is-toggled"},C={class:"toggler"},D={class:"wrapper"},S={class:"column"},_={class:"option-title"},q={class:"column is-2 has-text-right"},x=["innerHTML"],T={key:0,class:"bundle columns"},L={class:"column is-narrow"},H=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),M=["href"],O=["src"],z={key:1},$=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],w={class:"column"},I={key:0,class:"code"},j={class:"title"},F=["href"],A={key:1,class:"bundle columns"},G={class:"column is-narrow"},J=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],P=["src"],Q={key:1},R=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],U={class:"column"},W={key:0,class:"code"},X={class:"title"},Y=["href"];t.render=function(t,Z,ee,te,ie,ne){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",i,[e.createElementVNode("div",n,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",l,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",r,[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,o)):(e.openBlock(),e.createElementBlock("svg",s,c))],2)],8,a)]),e.createElementVNode("div",m,[e.createElementVNode("div",d,[e.createElementVNode("div",u,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",p,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",b,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,k)])]),e.createElementVNode("div",E,[e.createElementVNode("div",v,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,V),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,g)):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,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,y)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",C,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(i,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",S,[e.createElementVNode("div",_,e.toDisplayString(i.name),1)]),e.createElementVNode("div",q,[e.createTextVNode("+"),e.createElementVNode("span",{innerHTML:t.$filters.price(i.price)},null,8,x)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",L,[H,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,O)):(e.openBlock(),e.createElementBlock("svg",z,$))],2)],8,M)]),e.createElementVNode("div",w,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",I,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",j,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,F)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",G,[J,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,P)):(e.openBlock(),e.createElementBlock("svg",Q,R))],2)],8,K)]),e.createElementVNode("div",U,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",X,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,Y)])])])):e.createCommentVNode("v-if",!0)])],2)},module.exports=t;
1
+ "use strict";var e=require("vue"),t=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var i=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!==i.value.indexOf(e.id)})):[]}))}}}),i={key:0,class:"column is-12"},n={class:"bundle-title"},l={class:"column name"},r={class:"column is-narrow"},a=["href"],o=["src"],s={key:1},c=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],m={class:"column"},d={class:"columns is-gapless mb-0"},u={class:"column"},p={key:0,class:"code"},b={class:"title"},k=["href"],E={class:"column is-2 has-text-centered is-relative"},v={class:"quantity"},N={key:0,class:"quantity-price"},V=["innerHTML"],h={class:"column is-2 has-text-right"},g=["innerHTML"],f=["innerHTML"],y=["innerHTML"],B={key:0,class:"options is-toggled"},C={class:"toggler"},D={class:"wrapper"},S={class:"column"},_={class:"option-title"},q={class:"column is-2 has-text-right"},x=e.createTextVNode("+"),T=["innerHTML"],L={key:0,class:"bundle columns"},H={class:"column is-narrow"},M=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),O=["href"],z=["src"],$={key:1},w=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],I={class:"column"},j={key:0,class:"code"},F={class:"title"},A=["href"],G={key:1,class:"bundle columns"},J={class:"column is-narrow"},K=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),P=["href"],Q=["src"],R={key:1},U=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],W={class:"column"},X={key:0,class:"code"},Y={class:"title"},Z=["href"];t.render=function(t,ee,te,ie,ne,le){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",i,[e.createElementVNode("div",n,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",l,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",r,[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,o)):(e.openBlock(),e.createElementBlock("svg",s,c))],2)],8,a)]),e.createElementVNode("div",m,[e.createElementVNode("div",d,[e.createElementVNode("div",u,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",p,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",b,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,k)])]),e.createElementVNode("div",E,[e.createElementVNode("div",v,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,V),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,g)):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,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,y)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",C,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(i,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",S,[e.createElementVNode("div",_,e.toDisplayString(i.name),1)]),e.createElementVNode("div",q,[x,e.createElementVNode("span",{innerHTML:t.$filters.price(i.price)},null,8,T)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",H,[M,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,z)):(e.openBlock(),e.createElementBlock("svg",$,w))],2)],8,O)]),e.createElementVNode("div",I,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",j,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",F,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,A)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",J,[K,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,Q)):(e.openBlock(),e.createElementBlock("svg",R,U))],2)],8,P)]),e.createElementVNode("div",W,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",X,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Y,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,Z)])])])):e.createCommentVNode("v-if",!0)])],2)},module.exports=t;
2
2
  //# sourceMappingURL=CheckoutItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutItem.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=4d5a1fac&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>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_31","_hoisted_32","_hoisted_33","second","_hoisted_39","_hoisted_40","_hoisted_41","third","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_51","_hoisted_52","_hoisted_53"],"mappings":"oCA0F6BA,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,6DAMpB,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,yBACI,iBACA,mCAKR,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,yBACI,iBACA,4EA9E3BC,oDAAW,mDAAmEC,OAAKV,WAAWW,YAC1DD,OAAKV,WAAWW,sBAAhDF,2BAAAG,GACIJ,2BAAAK,oBAA6BH,gEAEjCF,2BAAAM,GACIN,oDAAW,kBAAkCE,OAAKV,WAAWW,YACzDH,2BAAAO,GACIP,0BAAIQ,KA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mD,QAA7CsB,UAAQpB,WAASqB,MAAM3B,EAAO2B,0EAM/DrB,OAAKV,WAAWW,sBAAlDF,2BAAAoC,GACIrC,2BAAAsC,GACIC,EACAvC,0BAAIQ,KAAMN,OAAKV,WAAWgD,OAAOhC,OAC7BR,uDAAc,+BAA+CE,OAAKV,WAAWgD,OAAO/B,WACjCP,OAAKV,WAAWgD,OAAO/B,qBAAtER,kCAAMS,IAAKR,OAAKV,WAAWgD,OAAO/B,iCAClCR,6CAIZD,2BAAAyC,GAC4BvC,OAAKV,WAAWgD,OAAO1B,oBAA/Cb,2BAAAyC,oBAAwDxC,8CAA2BA,OAAKV,WAAWgD,OAAO1B,0CAC1Gd,2BAAA2C,GACI3C,0BAAIQ,KAAMN,OAAKV,WAAWgD,OAAOhC,wBAASN,OAAKV,WAAWgD,OAAOvD,kDAI3CiB,OAAKV,WAAWW,QAAUD,OAAKV,WAAWoD,qBAA5E3C,2BAAA4C,GACI7C,2BAAA8C,GACIC,EACA/C,0BAAIQ,KAAMN,OAAKV,WAAWoD,MAAMpC,OAC5BR,uDAAc,+BAA+CE,OAAKV,WAAWoD,MAAMnC,WACjCP,OAAKV,WAAWoD,MAAMnC,qBAApER,kCAAMS,IAAKR,OAAKV,WAAWoD,MAAMnC,iCACjCR,6CAIZD,2BAAAgD,GAC4B9C,OAAKV,WAAWoD,MAAM9B,oBAA9Cb,2BAAAgD,oBAAuD/C,8CAA2BA,OAAKV,WAAWoD,MAAM9B,0CACxGd,2BAAAkD,GACIlD,0BAAIQ,KAAMN,OAAKV,WAAWoD,MAAMpC,wBAASN,OAAKV,WAAWoD,MAAM3D"}
1
+ {"version":3,"file":"CheckoutItem.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=4d5a1fac&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>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_32","_hoisted_33","_hoisted_34","second","_hoisted_40","_hoisted_41","_hoisted_42","third","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_52","_hoisted_53","_hoisted_54"],"mappings":"oCA0F6BA,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,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b,2BAAAgD,oBAAuD/C,8CAA2BA,OAAKV,WAAWoD,MAAM9B,0CACxGd,2BAAAkD,GACIlD,0BAAIQ,KAAMN,OAAKV,WAAWoD,MAAMpC,wBAASN,OAAKV,WAAWoD,MAAM3D"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),a=require("vuex"),t=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormTextarea"),l=require("yup"),i=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var a=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),a.default=e,Object.freeze(a)}var u=c(r),m=c(n),d=c(o),p=s(l);function f(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,n,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!a||o.length!==a);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw n}}return o}(e,a)||function(e,a){if(!e)return;if("string"==typeof e)return h(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,a)}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,r=new Array(a);t<a;t++)r[t]=e[t];return r}var v=i.useToast();e.markRaw(m.default),e.markRaw(d.default);var y={components:{SchemaForm:t.SchemaFormFactory([u.default({})])},name:"order-one-click",props:{id:Number,className:String,callback:Function,closeAction:Function,model:Array,nameSpace:{type:String,default:"oneclick"},showPlaceholders:{type:Boolean,default:!1}},setup:function(r){var n=e.ref(!1),o=e.ref(0),l=e.ref({}),i=a.useStore(),c=e.ref(!1),s=e.computed((function(){return i.getters["auth/me"]})),u=e.ref(!1),h=function(e,a){c.value=!1,a&&r.closeAction&&r.closeAction()},y={};-1!==r.model.indexOf("name")&&(y.name={component:m.default,label:__("shop.order."+r.nameSpace+".name"),store:r.nameSpace,model:"name",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".name"):" "}),-1!==r.model.indexOf("phone")&&(y.phone={component:m.default,label:__("shop.order."+r.nameSpace+".phone"),type:"phone",placeholder:"(050) 123-45-67",mask:"(###) ###-##-##",store:r.nameSpace,model:"phone"}),-1!==r.model.indexOf("email")&&(y.email={component:m.default,label:__("shop.order."+r.nameSpace+".email"),store:r.nameSpace,model:"email",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".email"):" "}),-1!==r.model.indexOf("comment")&&(y.comment={component:d.default,label:__("shop.order."+r.nameSpace+".comment"),store:r.nameSpace,model:"comment",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".comment"):" "});var b=e.ref(y),S={};-1!==r.model.indexOf("name")&&(S.name=p.string().trim().required(__("auth.validation.required"))),-1!==r.model.indexOf("phone")&&(S.phone=p.string().trim().required(__("auth.validation.required")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone"))),-1!==r.model.indexOf("email")&&(S.email=p.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")));var _=p.object().shape(S),g=e.ref({});e.onMounted((function(){g.value={name:(s.value.last_name?s.value.last_name:"")+(s.value.name?" "+s.value.name:""),email:s.value.email?s.value.email:"",phone:s.value.phone_formatted?s.value.phone_formatted:"",comment:"",id:r.id?r.id:null,namespace:r.nameSpace}})),t.useSchemaForm(g);return{open:function(){u.value=!1,c.value=!0},close:h,modal:c,loading:n,key:o,errors:l,schema:b,validation:_,model:g,onSubmit:function(){n.value=!0;var e=document.querySelector(".shop-product .product-info .cart-change-quantity input");e&&(g.value.quantity=e.value),$http.post($ziggy("api.order.oneclick"),g.value).then((function(e){r.callback?(h(),r.callback(e)):(u.value=!0,o.value++)})).finally((function(){n.value=!1})).catch((function(e){if(e.response.data&&e.response.data.error&&e.response.data.message&&v(e.response.data.message,{type:"error"}),e.response.data&&e.response.data.errors){for(var a=0,t=Object.entries(e.response.data.errors);a<t.length;a++){var r=f(t[a],2),n=r[0],i=r[1];i[0]&&(l.value[n]=i[0])}o.value++}}))},thanks:u}}},b={class:"shop-order-one-click"},S={class:"modal-content"},_=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],g={class:"box"},k={class:"title"},N={class:"field"},E=["innerHTML"],q={class:"mt-3"};y.render=function(a,t,r,n,o,l){var i=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:e.normalizeClass(r.className?r.className:"button is-link is-small"),onClick:t[0]||(t[0]=function(){return n.open&&n.open.apply(n,arguments)})},[e.createElementVNode("span",null,e.toDisplayString(a.__("shop.order."+r.nameSpace+".add")),1)],2),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":n.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:t[1]||(t[1]=function(){return n.close&&n.close.apply(n,arguments)})}),e.createElementVNode("div",S,[e.createElementVNode("button",{class:"modal-close is-large",onClick:t[2]||(t[2]=function(){return n.close&&n.close.apply(n,arguments)})},_),e.createElementVNode("div",g,[e.createElementVNode("div",k,e.toDisplayString(a.__("shop.order."+r.nameSpace+".title")),1),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",N,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(a.__("shop.order."+r.nameSpace+".submit")),3)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,!n.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:a.__("shop.order."+r.nameSpace+".thanks")},null,8,E),e.createElementVNode("div",q,[e.createElementVNode("button",{class:"button",onClick:t[3]||(t[3]=function(e){return n.close(e,!0)})},e.toDisplayString(a.__("shop.order."+r.nameSpace+".continue")),1)])],512),[[e.vShow,n.thanks]])])])],2)])},module.exports=y;
1
+ "use strict";var e=require("vue"),a=require("vuex"),t=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormTextarea"),l=require("yup"),i=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var a=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),a.default=e,Object.freeze(a)}var u=c(r),m=c(n),d=c(o),p=s(l);function f(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,n,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!a||o.length!==a);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw n}}return o}(e,a)||function(e,a){if(!e)return;if("string"==typeof e)return h(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,a)}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,r=new Array(a);t<a;t++)r[t]=e[t];return r}var v=i.useToast();e.markRaw(m.default),e.markRaw(d.default);var y={components:{SchemaForm:t.SchemaFormFactory([u.default({})])},name:"order-one-click",props:{id:Number,className:String,callback:Function,closeAction:Function,model:Array,nameSpace:{type:String,default:"oneclick"},showPlaceholders:{type:Boolean,default:!1}},setup:function(r){var n=e.ref(!1),o=e.ref(0),l=e.ref({}),i=a.useStore(),c=e.ref(!1),s=e.computed((function(){return i.getters["auth/me"]})),u=e.ref(!1),h=function(e,a){c.value=!1,a&&r.closeAction&&r.closeAction()},y={};-1!==r.model.indexOf("name")&&(y.name={component:m.default,label:__("shop.order."+r.nameSpace+".name"),store:r.nameSpace,model:"name",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".name"):" "}),-1!==r.model.indexOf("phone")&&(y.phone={component:m.default,label:__("shop.order."+r.nameSpace+".phone"),type:"phone",placeholder:"(050) 123-45-67",mask:"(###) ###-##-##",store:r.nameSpace,model:"phone"}),-1!==r.model.indexOf("email")&&(y.email={component:m.default,label:__("shop.order."+r.nameSpace+".email"),store:r.nameSpace,model:"email",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".email"):" "}),-1!==r.model.indexOf("comment")&&(y.comment={component:d.default,label:__("shop.order."+r.nameSpace+".comment"),store:r.nameSpace,model:"comment",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".comment"):" "});var b=e.ref(y),S={};-1!==r.model.indexOf("name")&&(S.name=p.string().trim().required(__("auth.validation.required"))),-1!==r.model.indexOf("phone")&&(S.phone=p.string().trim().required(__("auth.validation.required")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone"))),-1!==r.model.indexOf("email")&&(S.email=p.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")));var _=p.object().shape(S),g=e.ref({});e.onMounted((function(){g.value={name:(s.value.last_name?s.value.last_name:"")+(s.value.name?" "+s.value.name:""),email:s.value.email?s.value.email:"",phone:s.value.phone_formatted?s.value.phone_formatted:"",comment:"",id:r.id?r.id:null,namespace:r.nameSpace}})),t.useSchemaForm(g);return{open:function(){u.value=!1,c.value=!0},close:h,modal:c,loading:n,key:o,errors:l,schema:b,validation:_,model:g,onSubmit:function(){n.value=!0;var e=document.querySelector(".shop-product .product-info .cart-change-quantity input");e&&(g.value.quantity=e.value),$http.post($ziggy("api.order.oneclick"),g.value).then((function(e){r.callback?(h(),r.callback(e)):(u.value=!0,o.value++)})).finally((function(){n.value=!1})).catch((function(e){if(e.response.data&&e.response.data.error&&e.response.data.message&&v(e.response.data.message,{type:"error"}),e.response.data&&e.response.data.errors){for(var a=0,t=Object.entries(e.response.data.errors);a<t.length;a++){var r=f(t[a],2),n=r[0],i=r[1];i[0]&&(l.value[n]=i[0])}o.value++}}))},thanks:u}}},b={class:"shop-order-one-click"},S={class:"modal-content"},_=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],g={class:"box"},k={class:"title"},N={class:"field"},E=["innerHTML"],V={class:"mt-3"};y.render=function(a,t,r,n,o,l){var i=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:e.normalizeClass(r.className?r.className:"button is-link is-small"),onClick:t[0]||(t[0]=function(){return n.open&&n.open.apply(n,arguments)})},[e.createElementVNode("span",null,e.toDisplayString(a.__("shop.order."+r.nameSpace+".add")),1)],2),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":n.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:t[1]||(t[1]=function(){return n.close&&n.close.apply(n,arguments)})}),e.createElementVNode("div",S,[e.createElementVNode("button",{class:"modal-close is-large",onClick:t[2]||(t[2]=function(){return n.close&&n.close.apply(n,arguments)})},_),e.createElementVNode("div",g,[e.createElementVNode("div",k,e.toDisplayString(a.__("shop.order."+r.nameSpace+".title")),1),e.withDirectives(e.createElementVNode("div",null,[e.createVNode(i,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",N,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(a.__("shop.order."+r.nameSpace+".submit")),3)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],512),[[e.vShow,!n.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:a.__("shop.order."+r.nameSpace+".thanks")},null,8,E),e.createElementVNode("div",V,[e.createElementVNode("button",{class:"button",onClick:t[3]||(t[3]=function(e){return n.close(e,!0)})},e.toDisplayString(a.__("shop.order."+r.nameSpace+".continue")),1)])],512),[[e.vShow,n.thanks]])])])],2)])},module.exports=y;
2
2
  //# sourceMappingURL=OneClick.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OneClick.js","sources":["../../../../src/components/shop/order/OneClick.vue","../../../../src/components/shop/order/OneClick.vue?vue&type=template&id=fe7f9726&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\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 FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>","<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\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 FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>"],"names":["toast","useToast","markRaw","FormText","FormTextarea","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","name","props","id","Number","className","String","callback","Function","closeAction","model","Array","nameSpace","type","showPlaceholders","Boolean","setup","loading","ref","key","errors","store","useStore","modal","user","computed","getters","thanks","close","e","fromButton","value","schemaObject","indexOf","component","label","__","placeholder","phone","mask","email","comment","schema","validationObject","yup","string","trim","required","matches","validation","object","shape","onMounted","last_name","phone_formatted","namespace","useSchemaForm","open","onSubmit","quantityInput","document","querySelector","quantity","$http","post","$ziggy","then","response","error","data","message","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","$props","onClick","$setup","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_createBlock","schemaRowClasses","afterForm","_hoisted_7","innerHTML","_hoisted_9","$event"],"mappings":"ymDAsDA,IAAMA,EAAQC,aAEdC,UAAQC,WACRD,UAAQE,WAER,MAEe,CACXC,WAAY,CACRC,WAJWC,oBAAkB,CAACC,UAAkB,OAMpDC,KAAM,kBACNC,MAAO,CACHC,GAAIC,OACJC,UAAWC,OACXC,SAAUC,SACVC,YAAaD,SACbE,MAAOC,MACPC,UAAW,CACPC,KAAMP,eACG,YAEbQ,iBAAkB,CACdD,KAAME,iBACG,IAGjBC,eAAMd,OACIe,EAAUC,OAAI,GACdC,EAAMD,MAAI,GACVE,EAASF,MAAI,IACbG,EAAQC,aACRC,EAAQL,OAAI,GACZM,EAAOC,YAAS,kBAAMJ,EAAMK,QAAQ,cACpCC,EAAST,OAAI,GAObU,EAAQ,SAACC,EAAGC,GACdP,EAAMQ,OAAQ,EAEVD,GAAc5B,EAAMO,aACpBP,EAAMO,eAIVuB,EAAe,IAEkB,IAAjC9B,EAAMQ,MAAM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IvCvD,EAAIY,aAgBhBJ,OAAAA,cC3OG,iCAOQ,oBAEHgD,kCAAW,eACPA,yCAAgB,0BAGb,gBACI,kBAMY,kCAYR,mGAhC/BC,2BAAAC,GACIF,sDAAsBG,YAAYA,uCAAwCC,sCAAOC,sCAC7EL,mDAASM,mBAAmBH,4BAGhCH,oDAAW,qBAAqCK,aAC5CL,kCAAW,mBAAoBI,sCAAOC,wCACtCL,2BAAAO,GACIP,qCAAc,uBAAwBI,sCAAOC,0CAK7CL,2BAAAQ,GACIR,2BAAAS,oBACOH,mBAAmBH,2CAE1BH,gDACIU,iBAAYC,iBAAiB,QAAS5C,OAAQsC,6BAA4BA,8BAA6BA,SAAS7D,IAAK6D,MAAMtB,SAAQsB,aACpHO,qBACP,kBAAAZ,2BAAAa,GACIb,uDAAc,4CAAiB9D,KAAK,4BAG7BoE,mBAAmBH,sHAP5BE,6BAadL,iCACIA,4BAAKc,UAAQR,mBAAmBH,kCAChCH,2BAAAe,GACIf,qCAAc,SAAUI,uCAAOC,QAAMW,2BAC9BV,mBAAmBH,+CAJrBE"}
1
+ {"version":3,"file":"OneClick.js","sources":["../../../../src/components/shop/order/OneClick.vue","../../../../src/components/shop/order/OneClick.vue?vue&type=template&id=fe7f9726&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\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 FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>","<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\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 FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>"],"names":["toast","useToast","markRaw","FormText","FormTextarea","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","name","props","id","Number","className","String","callback","Function","closeAction","model","Array","nameSpace","type","showPlaceholders","Boolean","setup","loading","ref","key","errors","store","useStore","modal","user","computed","getters","thanks","close","e","fromButton","value","schemaObject","indexOf","component","label","__","placeholder","phone","mask","email","comment","schema","validationObject","yup","string","trim","required","matches","validation","object","shape","onMounted","last_name","phone_formatted","namespace","useSchemaForm","open","onSubmit","quantityInput","document","querySelector","quantity","$http","post","$ziggy","then","response","error","data","message","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","$props","onClick","$setup","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_createVNode","schemaRowClasses","afterForm","_hoisted_7","innerHTML","_hoisted_9","$event"],"mappings":"ymDAsDA,IAAMA,EAAQC,aAEdC,UAAQC,WACRD,UAAQE,WAER,MAEe,CACXC,WAAY,CACRC,WAJWC,oBAAkB,CAACC,UAAkB,OAMpDC,KAAM,kBACNC,MAAO,CACHC,GAAIC,OACJC,UAAWC,OACXC,SAAUC,SACVC,YAAaD,SACbE,MAAOC,MACPC,UAAW,CACPC,KAAMP,eACG,YAEbQ,iBAAkB,CACdD,KAAME,iBACG,IAGjBC,eAAMd,OACIe,EAAUC,OAAI,GACdC,EAAMD,MAAI,GACVE,EAASF,MAAI,IACbG,EAAQC,aACRC,EAAQL,OAAI,GACZM,EAAOC,YAAS,kBAAMJ,EAAMK,QAAQ,cACpCC,EAAST,OAAI,GAObU,EAAQ,SAACC,EAAGC,GACdP,EAAMQ,OAAQ,EAEVD,GAAc5B,EAAMO,aACpBP,EAAMO,eAIVuB,EAAe,IAEkB,IAAjC9B,EAAMQ,MAAMuB,QAAQ,UACpBD,EAAa/B,KAAO,CAChB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G,iCAOQ,oBAEHgD,kCAAW,eACPA,yCAAgB,0BAGb,gBACI,kBAMY,kCAYR,mGAhC/BC,2BAAAC,GACIF,sDAAsBG,YAAYA,uCAAwCC,sCAAOC,sCAC7EL,mDAASM,mBAAmBH,4BAGhCH,oDAAW,qBAAqCK,aAC5CL,kCAAW,mBAAoBI,sCAAOC,wCACtCL,2BAAAO,GACIP,qCAAc,uBAAwBI,sCAAOC,0CAK7CL,2BAAAQ,GACIR,2BAAAS,oBACOH,mBAAmBH,2CAE1BH,iCACIU,iBAAYC,iBAAiB,QAAS5C,OAAQsC,6BAA4BA,8BAA6BA,SAAS7D,IAAK6D,MAAMtB,SAAQsB,aACpHO,qBACP,kBAAAZ,2BAAAa,GACIb,uDAAc,4CAAiB9D,KAAK,4BAG7BoE,mBAAmBH,qHAP5BE,6BAadL,iCACIA,4BAAKc,UAAQR,mBAAmBH,kCAChCH,2BAAAe,GACIf,qCAAc,SAAUI,uCAAOC,QAAMW,2BAC9BV,mBAAmBH,+CAJrBE"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),o=require("@perevorot/shop/dist/forms/FormTextarea"),a=require("@perevorot/shop/dist/forms/FormText"),i=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=l(r),u=l(o),d=l(a),m=s(i);function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.markRaw(u.default),e.markRaw(d.default);var h=n.SchemaFormFactory([c.default({})]),y=e.defineComponent({name:"review",components:{SchemaForm:h},props:{id:Number},setup:function(r){var o,a=e.ref(!1),i=t.useStore(),l=e.ref(0),s=e.ref({}),c=e.ref(!1),p=e.computed((function(){return i.getters["auth/me"]})),h=e.ref(!1),y=e.ref({review:{component:u.default,label:__("shop.question.review"),model:"review"},name:{component:d.default,label:__("shop.question.name"),model:"name"}}),b=m.object().shape({review:m.string().required(__("auth.validation.required")),name:m.string().required(__("auth.validation.required"))}),E=e.ref({review:"",question:!0,name:p.value.name,id:r.id});n.useSchemaForm(E);var g=function(){c.value&&(c.value=!1,h.value=!1,document.documentElement.classList.remove("is-modal-open"))};return window.addEventListener("keyup",(function(e){c.value&&"Escape"===e.key&&g()})),document.addEventListener("DOMContentLoaded",(function(){c.value&&document.documentElement.classList.add("is-modal-open");var e=document.getElementById("questions-show-more");e&&e.addEventListener("click",(function(){document.getElementById("questions-list").querySelectorAll(".review.is-hidden").forEach((function(t){t.classList.remove("is-hidden"),e.remove()}))}))}),!1),v(o={loading:a,modal:c,schema:y,validation:b,add:function(){c.value=!0,document.documentElement.classList.add("is-modal-open")},cancel:g},"schema",y),v(o,"onSubmit",(function(){a.value=!0,$http.post($ziggy("api.review"),E.value).then((function(){h.value=!0,E.value={review:"",question:!0,name:p.value.name,id:r.id}})).catch((function(e){if(s.value={},e.response.data&&e.response.data.errors){for(var t=0,n=Object.entries(e.response.data.errors);t<n.length;t++){var r=f(n[t],2),o=r[0],a=r[1];a[0]&&(s.value[o]=a[0])}l.value++}})).finally((function(){a.value=!1}))})),v(o,"errors",s),v(o,"key",l),v(o,"model",E),v(o,"thanks",h),o}}),b={class:"shop-reviews"},E={class:"modal-content"},g=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],w={class:"box"},k={class:"title"},q={class:"shop-reviews-form"},_={class:"field"},S={class:"columns is-vcentered"},N={class:"column"},V={class:"column has-text-right"},C={class:"shop-reviews-thanks"},j=["innerHTML"],O={class:"mt-3"};y.render=function(t,n,r,o,a,i){var l=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:"button review-add",onClick:n[0]||(n[0]=function(){return t.add&&t.add.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.add")),1),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[1]||(n[1]=function(){return t.cancel&&t.cancel.apply(t,arguments)})}),e.createElementVNode("div",E,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[2]||(n[2]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},g),e.createElementVNode("div",w,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.question.title")),1),e.withDirectives(e.createElementVNode("div",q,[(e.openBlock(),e.createBlock(l,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,"initial-errors":t.errors,key:t.key,onSubmit:t.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",_,[e.createElementVNode("div",S,[e.createElementVNode("div",N,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":t.loading}]),type:"submit"},e.toDisplayString(t.__("shop.question.save")),3)]),e.createElementVNode("div",V,[e.createElementVNode("button",{class:"button",onClick:n[3]||(n[3]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.cancel")),1)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,!t.thanks]]),e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("div",{class:"message",innerHTML:t.__("shop.question.thanks")},null,8,j),e.createElementVNode("div",O,[e.createElementVNode("button",{class:"button",onClick:n[4]||(n[4]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.continue")),1)])],512),[[e.vShow,t.thanks]])])])],2)])},module.exports=y;
1
+ "use strict";var e=require("vue"),t=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),o=require("@perevorot/shop/dist/forms/FormTextarea"),a=require("@perevorot/shop/dist/forms/FormText"),i=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=l(r),u=l(o),d=l(a),m=s(i);function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.markRaw(u.default),e.markRaw(d.default);var h=n.SchemaFormFactory([c.default({})]),y=e.defineComponent({name:"review",components:{SchemaForm:h},props:{id:Number},setup:function(r){var o,a=e.ref(!1),i=t.useStore(),l=e.ref(0),s=e.ref({}),c=e.ref(!1),p=e.computed((function(){return i.getters["auth/me"]})),h=e.ref(!1),y=e.ref({review:{component:u.default,label:__("shop.question.review"),model:"review"},name:{component:d.default,label:__("shop.question.name"),model:"name"}}),b=m.object().shape({review:m.string().required(__("auth.validation.required")),name:m.string().required(__("auth.validation.required"))}),E=e.ref({review:"",question:!0,name:p.value.name,id:r.id});n.useSchemaForm(E);var g=function(){c.value&&(c.value=!1,h.value=!1,document.documentElement.classList.remove("is-modal-open"))};return window.addEventListener("keyup",(function(e){c.value&&"Escape"===e.key&&g()})),document.addEventListener("DOMContentLoaded",(function(){c.value&&document.documentElement.classList.add("is-modal-open");var e=document.getElementById("questions-show-more");e&&e.addEventListener("click",(function(){document.getElementById("questions-list").querySelectorAll(".review.is-hidden").forEach((function(t){t.classList.remove("is-hidden"),e.remove()}))}))}),!1),v(o={loading:a,modal:c,schema:y,validation:b,add:function(){c.value=!0,document.documentElement.classList.add("is-modal-open")},cancel:g},"schema",y),v(o,"onSubmit",(function(){a.value=!0,$http.post($ziggy("api.review"),E.value).then((function(){h.value=!0,E.value={review:"",question:!0,name:p.value.name,id:r.id}})).catch((function(e){if(s.value={},e.response.data&&e.response.data.errors){for(var t=0,n=Object.entries(e.response.data.errors);t<n.length;t++){var r=f(n[t],2),o=r[0],a=r[1];a[0]&&(s.value[o]=a[0])}l.value++}})).finally((function(){a.value=!1}))})),v(o,"errors",s),v(o,"key",l),v(o,"model",E),v(o,"thanks",h),o}}),b={class:"shop-reviews"},E={class:"modal-content"},g=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],w={class:"box"},k={class:"title"},q={class:"shop-reviews-form"},_={class:"field"},N={class:"columns is-vcentered"},S={class:"column"},V={class:"column has-text-right"},C={class:"shop-reviews-thanks"},j=["innerHTML"],O={class:"mt-3"};y.render=function(t,n,r,o,a,i){var l=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:"button review-add",onClick:n[0]||(n[0]=function(){return t.add&&t.add.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.add")),1),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[1]||(n[1]=function(){return t.cancel&&t.cancel.apply(t,arguments)})}),e.createElementVNode("div",E,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[2]||(n[2]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},g),e.createElementVNode("div",w,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.question.title")),1),e.withDirectives(e.createElementVNode("div",q,[e.createVNode(l,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,"initial-errors":t.errors,key:t.key,onSubmit:t.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",_,[e.createElementVNode("div",N,[e.createElementVNode("div",S,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":t.loading}]),type:"submit"},e.toDisplayString(t.__("shop.question.save")),3)]),e.createElementVNode("div",V,[e.createElementVNode("button",{class:"button",onClick:n[3]||(n[3]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.cancel")),1)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],512),[[e.vShow,!t.thanks]]),e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("div",{class:"message",innerHTML:t.__("shop.question.thanks")},null,8,j),e.createElementVNode("div",O,[e.createElementVNode("button",{class:"button",onClick:n[4]||(n[4]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.question.continue")),1)])],512),[[e.vShow,t.thanks]])])])],2)])},module.exports=y;
2
2
  //# sourceMappingURL=Question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Question.js","sources":["../../../../src/components/shop/reviews/Question.vue","../../../../src/components/shop/reviews/Question.vue?vue&type=template&id=22162317&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-reviews\">\n <button class=\"button review-add\" @click=\"add\">{{ __(\"shop.question.add\") }}</button>\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"cancel\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"cancel\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">{{ __(\"shop.question.title\") }}</div>\n <div class=\"shop-reviews-form\" v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading,\n }\">{{ __(\"shop.question.save\") }}</button>\n </div>\n <div class=\"column has-text-right\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.cancel\") }}</button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div class=\"shop-reviews-thanks\" v-show=\"thanks\">\n <div class=\"message\" v-html=\"__('shop.question.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.continue\") }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { SchemaFormFactory, useSchemaForm } from \"formvuelate\";\nimport VeeValidatePlugin from \"@formvuelate/plugin-vee-validate\";\nimport FormTextarea from \"@perevorot/shop/dist/forms/FormTextarea\";\nimport FormText from \"@perevorot/shop/dist/forms/FormText\";\nimport * as yup from \"yup\";\n\nmarkRaw(FormTextarea);\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"review\",\n components: {\n SchemaForm,\n },\n props: {\n id: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = ref(false);\n const user = computed(() => store.getters[\"auth/me\"]);\n const thanks = ref(false);\n\n const schema = ref({\n review: {\n component: FormTextarea,\n label: __(\"shop.question.review\"),\n model: \"review\",\n },\n name: {\n component: FormText,\n label: __(\"shop.question.name\"),\n model: \"name\",\n },\n });\n\n const validation = yup.object().shape({\n review: yup.string().required(__(\"auth.validation.required\")),\n name: yup.string().required(__(\"auth.validation.required\")),\n });\n\n const model = ref({\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n });\n\n useSchemaForm(model);\n\n const add = () => {\n modal.value = true;\n\n document.documentElement.classList.add('is-modal-open');\n };\n\n const cancel = () => {\n if (modal.value) {\n modal.value = false;\n thanks.value = false;\n\n document.documentElement.classList.remove('is-modal-open');\n }\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n $http\n .post($ziggy(\"api.review\"), model.value)\n .then(() => {\n thanks.value = true;\n\n model.value = {\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n };\n })\n .catch((error) => {\n errors.value = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(\n error.response.data.errors\n )) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n });\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n cancel();\n }\n });\n\n document.addEventListener(\"DOMContentLoaded\", () => {\n if (modal.value) {\n document.documentElement.classList.add('is-modal-open');\n }\n\n const showMore = document.getElementById('questions-show-more');\n\n if (showMore) {\n showMore.addEventListener('click', () => {\n document.getElementById('questions-list').querySelectorAll('.review.is-hidden').forEach(review => {\n review.classList.remove('is-hidden');\n showMore.remove();\n });\n });\n }\n }, false);\n\n return {\n loading,\n modal,\n schema,\n validation,\n add,\n cancel,\n schema,\n onSubmit,\n errors,\n key,\n model,\n thanks,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-reviews\">\n <button class=\"button review-add\" @click=\"add\">{{ __(\"shop.question.add\") }}</button>\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"cancel\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"cancel\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">{{ __(\"shop.question.title\") }}</div>\n <div class=\"shop-reviews-form\" v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading,\n }\">{{ __(\"shop.question.save\") }}</button>\n </div>\n <div class=\"column has-text-right\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.cancel\") }}</button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div class=\"shop-reviews-thanks\" v-show=\"thanks\">\n <div class=\"message\" v-html=\"__('shop.question.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.continue\") }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { SchemaFormFactory, useSchemaForm } from \"formvuelate\";\nimport VeeValidatePlugin from \"@formvuelate/plugin-vee-validate\";\nimport FormTextarea from \"@perevorot/shop/dist/forms/FormTextarea\";\nimport FormText from \"@perevorot/shop/dist/forms/FormText\";\nimport * as yup from \"yup\";\n\nmarkRaw(FormTextarea);\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"review\",\n components: {\n SchemaForm,\n },\n props: {\n id: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = ref(false);\n const user = computed(() => store.getters[\"auth/me\"]);\n const thanks = ref(false);\n\n const schema = ref({\n review: {\n component: FormTextarea,\n label: __(\"shop.question.review\"),\n model: \"review\",\n },\n name: {\n component: FormText,\n label: __(\"shop.question.name\"),\n model: \"name\",\n },\n });\n\n const validation = yup.object().shape({\n review: yup.string().required(__(\"auth.validation.required\")),\n name: yup.string().required(__(\"auth.validation.required\")),\n });\n\n const model = ref({\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n });\n\n useSchemaForm(model);\n\n const add = () => {\n modal.value = true;\n\n document.documentElement.classList.add('is-modal-open');\n };\n\n const cancel = () => {\n if (modal.value) {\n modal.value = false;\n thanks.value = false;\n\n document.documentElement.classList.remove('is-modal-open');\n }\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n $http\n .post($ziggy(\"api.review\"), model.value)\n .then(() => {\n thanks.value = true;\n\n model.value = {\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n };\n })\n .catch((error) => {\n errors.value = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(\n error.response.data.errors\n )) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n });\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n cancel();\n }\n });\n\n document.addEventListener(\"DOMContentLoaded\", () => {\n if (modal.value) {\n document.documentElement.classList.add('is-modal-open');\n }\n\n const showMore = document.getElementById('questions-show-more');\n\n if (showMore) {\n showMore.addEventListener('click', () => {\n document.getElementById('questions-list').querySelectorAll('.review.is-hidden').forEach(review => {\n review.classList.remove('is-hidden');\n showMore.remove();\n });\n });\n }\n }, false);\n\n return {\n loading,\n modal,\n schema,\n validation,\n add,\n cancel,\n schema,\n onSubmit,\n errors,\n key,\n model,\n thanks,\n };\n },\n});\n</script>"],"names":["markRaw","FormTextarea","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","name","components","props","id","Number","setup","loading","ref","store","useStore","key","errors","modal","user","computed","getters","thanks","schema","review","component","label","__","model","validation","yup","object","shape","string","required","question","value","useSchemaForm","cancel","document","documentElement","classList","remove","window","addEventListener","e","add","showMore","getElementById","querySelectorAll","forEach","$http","post","$ziggy","then","error","response","data","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","onClick","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_hoisted_7","_createBlock","schemaRowClasses","onSubmit","afterForm","_hoisted_8","_hoisted_9","_hoisted_10","type","_hoisted_11","_hoisted_12","innerHTML","_hoisted_14"],"mappings":"isDAmDAA,UAAQC,WACRD,UAAQE,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAE3BC,kBAAgB,CACzCC,KAAM,SACNC,WAAY,CACRL,WAAAA,GAEJM,MAAO,CACHC,GAAIC,QAERC,eAAMH,SACII,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,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ACRW,UAAU,EACV7B,KAAMa,EAAKiB,MAAM9B,KACjBG,GAAID,EAAMC,cAGX,SAAC8C,MACJtC,EAAOmB,MAAQ,GAEXmB,EAAMC,SAASC,MAAQF,EAAMC,SAASC,KAAKxC,OAAQ,eACnByC,OAAOC,QACnCJ,EAAMC,SAASC,KAAKxC,uBACrB,iBAFS2C,OAAOC,OAGXA,EAAS,KACT5C,EAAOmB,MAAMwB,GAASC,EAAS,IAIvC7C,EAAIoB,qBAGH,WACLxB,EAAQwB,OAAQ,qBAoCxBnB,aACAD,eACAY,gBACAN,iBCxLG,yBAIQ,oBAEHwC,kCAAW,eACPA,yCAAgB,0BAGb,gBACI,kBACA,8BAGY,kBACI,iCACI,mBAKA,kCAQpB,gDAEI,mGAhC/BC,2BAAAC,GACIF,qCAAc,oBAAqBG,sCAAOC,qDAAQA,8BAClDJ,oDAAW,qBAAqCI,aAC5CJ,kCAAW,mBAAoBG,sCAAOC,0CACtCJ,2BAAAK,GACIL,qCAAc,uBAAwBG,sCAAOC,4CAK7CJ,2BAAAM,GACIN,2BAAAO,oBAAsBH,iDACtBJ,2BAAAQ,kBACIC,iBAAYC,iBAAiB,QAASjD,OAAQ2C,6BAA4BA,8BAA6BA,SAASlD,IAAKkD,MAAMO,SAAQP,aACpHQ,qBACP,kBAAAZ,2BAAAa,GACIb,2BAAAc,GACId,2BAAAe,GACIf,uDAAc,4CAAiBgB,KAAK,4BAE9BZ,iCAEVJ,2BAAAiB,GACIjB,qCAAc,SAAUG,sCAAOC,2DAAWA,gIAX1BA,6BAkBxCJ,2BAAAkB,GACIlB,kCAAW,UAAUmB,UAAQf,wCAC7BJ,2BAAAoB,GACIpB,qCAAc,SAAUG,sCAAOC,2DAAWA,qDAHTA"}
1
+ {"version":3,"file":"Question.js","sources":["../../../../src/components/shop/reviews/Question.vue","../../../../src/components/shop/reviews/Question.vue?vue&type=template&id=22162317&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-reviews\">\n <button class=\"button review-add\" @click=\"add\">{{ __(\"shop.question.add\") }}</button>\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"cancel\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"cancel\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">{{ __(\"shop.question.title\") }}</div>\n <div class=\"shop-reviews-form\" v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading,\n }\">{{ __(\"shop.question.save\") }}</button>\n </div>\n <div class=\"column has-text-right\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.cancel\") }}</button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div class=\"shop-reviews-thanks\" v-show=\"thanks\">\n <div class=\"message\" v-html=\"__('shop.question.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.continue\") }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { SchemaFormFactory, useSchemaForm } from \"formvuelate\";\nimport VeeValidatePlugin from \"@formvuelate/plugin-vee-validate\";\nimport FormTextarea from \"@perevorot/shop/dist/forms/FormTextarea\";\nimport FormText from \"@perevorot/shop/dist/forms/FormText\";\nimport * as yup from \"yup\";\n\nmarkRaw(FormTextarea);\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"review\",\n components: {\n SchemaForm,\n },\n props: {\n id: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = ref(false);\n const user = computed(() => store.getters[\"auth/me\"]);\n const thanks = ref(false);\n\n const schema = ref({\n review: {\n component: FormTextarea,\n label: __(\"shop.question.review\"),\n model: \"review\",\n },\n name: {\n component: FormText,\n label: __(\"shop.question.name\"),\n model: \"name\",\n },\n });\n\n const validation = yup.object().shape({\n review: yup.string().required(__(\"auth.validation.required\")),\n name: yup.string().required(__(\"auth.validation.required\")),\n });\n\n const model = ref({\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n });\n\n useSchemaForm(model);\n\n const add = () => {\n modal.value = true;\n\n document.documentElement.classList.add('is-modal-open');\n };\n\n const cancel = () => {\n if (modal.value) {\n modal.value = false;\n thanks.value = false;\n\n document.documentElement.classList.remove('is-modal-open');\n }\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n $http\n .post($ziggy(\"api.review\"), model.value)\n .then(() => {\n thanks.value = true;\n\n model.value = {\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n };\n })\n .catch((error) => {\n errors.value = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(\n error.response.data.errors\n )) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n });\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n cancel();\n }\n });\n\n document.addEventListener(\"DOMContentLoaded\", () => {\n if (modal.value) {\n document.documentElement.classList.add('is-modal-open');\n }\n\n const showMore = document.getElementById('questions-show-more');\n\n if (showMore) {\n showMore.addEventListener('click', () => {\n document.getElementById('questions-list').querySelectorAll('.review.is-hidden').forEach(review => {\n review.classList.remove('is-hidden');\n showMore.remove();\n });\n });\n }\n }, false);\n\n return {\n loading,\n modal,\n schema,\n validation,\n add,\n cancel,\n schema,\n onSubmit,\n errors,\n key,\n model,\n thanks,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-reviews\">\n <button class=\"button review-add\" @click=\"add\">{{ __(\"shop.question.add\") }}</button>\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"cancel\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"cancel\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">{{ __(\"shop.question.title\") }}</div>\n <div class=\"shop-reviews-form\" v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading,\n }\">{{ __(\"shop.question.save\") }}</button>\n </div>\n <div class=\"column has-text-right\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.cancel\") }}</button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div class=\"shop-reviews-thanks\" v-show=\"thanks\">\n <div class=\"message\" v-html=\"__('shop.question.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"cancel\">{{ __(\"shop.question.continue\") }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { SchemaFormFactory, useSchemaForm } from \"formvuelate\";\nimport VeeValidatePlugin from \"@formvuelate/plugin-vee-validate\";\nimport FormTextarea from \"@perevorot/shop/dist/forms/FormTextarea\";\nimport FormText from \"@perevorot/shop/dist/forms/FormText\";\nimport * as yup from \"yup\";\n\nmarkRaw(FormTextarea);\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"review\",\n components: {\n SchemaForm,\n },\n props: {\n id: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = ref(false);\n const user = computed(() => store.getters[\"auth/me\"]);\n const thanks = ref(false);\n\n const schema = ref({\n review: {\n component: FormTextarea,\n label: __(\"shop.question.review\"),\n model: \"review\",\n },\n name: {\n component: FormText,\n label: __(\"shop.question.name\"),\n model: \"name\",\n },\n });\n\n const validation = yup.object().shape({\n review: yup.string().required(__(\"auth.validation.required\")),\n name: yup.string().required(__(\"auth.validation.required\")),\n });\n\n const model = ref({\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n });\n\n useSchemaForm(model);\n\n const add = () => {\n modal.value = true;\n\n document.documentElement.classList.add('is-modal-open');\n };\n\n const cancel = () => {\n if (modal.value) {\n modal.value = false;\n thanks.value = false;\n\n document.documentElement.classList.remove('is-modal-open');\n }\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n $http\n .post($ziggy(\"api.review\"), model.value)\n .then(() => {\n thanks.value = true;\n\n model.value = {\n review: \"\",\n question: true,\n name: user.value.name,\n id: props.id,\n };\n })\n .catch((error) => {\n errors.value = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(\n error.response.data.errors\n )) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n });\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n cancel();\n }\n });\n\n document.addEventListener(\"DOMContentLoaded\", () => {\n if (modal.value) {\n document.documentElement.classList.add('is-modal-open');\n }\n\n const showMore = document.getElementById('questions-show-more');\n\n if (showMore) {\n showMore.addEventListener('click', () => {\n document.getElementById('questions-list').querySelectorAll('.review.is-hidden').forEach(review => {\n review.classList.remove('is-hidden');\n showMore.remove();\n });\n });\n }\n }, false);\n\n return {\n loading,\n modal,\n schema,\n validation,\n add,\n cancel,\n schema,\n onSubmit,\n errors,\n key,\n model,\n thanks,\n };\n },\n});\n</script>"],"names":["markRaw","FormTextarea","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","name","components","props","id","Number","setup","loading","ref","store","useStore","key","errors","modal","user","computed","getters","thanks","schema","review","component","label","__","model","validation","yup","object","shape","string","required","question","value","useSchemaForm","cancel","document","documentElement","classList","remove","window","addEventListener","e","add","showMore","getElementById","querySelectorAll","forEach","$http","post","$ziggy","then","error","response","data","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","onClick","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_hoisted_7","_createVNode","schemaRowClasses","onSubmit","afterForm","_hoisted_8","_hoisted_9","_hoisted_10","type","_hoisted_11","_hoisted_12","innerHTML","_hoisted_14"],"mappings":"isDAmDAA,UAAQC,WACRD,UAAQE,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAE3BC,kBAAgB,CACzCC,KAAM,SACNC,WAAY,CACRL,WAAAA,GAEJM,MAAO,CACHC,GAAIC,QAERC,eAAMH,SACII,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAASJ,MAAI,IACbK,EAAQL,OAAI,GACZM,EAAOC,YAAS,kBAAMN,EAAMO,QAAQ,cACpCC,EAAST,OAAI,GAEbU,EAASV,MAAI,CACfW,OAAQ,CACJC,UAAWzB,UACX0B,MAAOC,GAAG,wBACVC,MAAO,UAEXtB,KAAM,CACFmB,UAAWxB,UACXyB,MAAOC,GAAG,sBACVC,MAAO,UAITC,EAAaC,EAAIC,SAASC,MAAM,CAClCR,OAAQM,EAAIG,SAASC,SAASP,GAAG,6BACjCrB,KAAMwB,EAAIG,SAASC,SAASP,GAAG,+BAG7BC,EAAQf,MAAI,CACdW,OAAQ,GACRW,UAAU,EACV7B,KAAMa,EAAKiB,MAAM9B,KACjBG,GAAID,EAAMC,KAGd4B,gBAAcT,OAQRU,EAAS,WAC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AAc,oBAAqBG,sCAAOC,qDAAQA,8BAClDJ,oDAAW,qBAAqCI,aAC5CJ,kCAAW,mBAAoBG,sCAAOC,0CACtCJ,2BAAAK,GACIL,qCAAc,uBAAwBG,sCAAOC,4CAK7CJ,2BAAAM,GACIN,2BAAAO,oBAAsBH,iDACtBJ,2BAAAQ,GACIC,iBAAYC,iBAAiB,QAASjD,OAAQ2C,6BAA4BA,8BAA6BA,SAASlD,IAAKkD,MAAMO,SAAQP,aACpHQ,qBACP,kBAAAZ,2BAAAa,GACIb,2BAAAc,GACId,2BAAAe,GACIf,uDAAc,4CAAiBgB,KAAK,4BAE9BZ,iCAEVJ,2BAAAiB,GACIjB,qCAAc,SAAUG,sCAAOC,2DAAWA,+HAX1BA,6BAkBxCJ,2BAAAkB,GACIlB,kCAAW,UAAUmB,UAAQf,wCAC7BJ,2BAAAoB,GACIpB,qCAAc,SAAUG,sCAAOC,2DAAWA,qDAHTA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),r=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormTextarea"),o=require("@perevorot/shop/dist/forms/FormText"),i=require("@perevorot/shop/dist/forms/FormRating"),l=require("yup");function c(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 s=c(n),d=c(a),m=c(o),v=c(i),f=u(l);function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}e.markRaw(v.default),e.markRaw(d.default),e.markRaw(m.default);var w=r.SchemaFormFactory([s.default({})]),b=e.defineComponent({name:"review",components:{SchemaForm:w},props:{id:Number},setup:function(n){var a,o=e.ref(!1),i=t.useStore(),l=e.ref(0),c=e.ref({}),u=e.computed((function(){return i.getters["review/modal"]})),s=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["auth/me"]})),w=e.ref(!1),b=e.ref({rating:{component:v.default,model:"rating"},review:{component:d.default,label:__("shop.review.review"),model:"review"},name:{component:m.default,label:__("shop.review.name"),model:"name"}}),g=f.object().shape({review:f.string().required(__("auth.validation.required")),rating:f.number().min(1,__("auth.validation.required")).required(__("auth.validation.required")),name:f.string().required(__("auth.validation.required"))}),E=e.ref({review:"",rating:0,name:y.value.name,id:n.id});r.useSchemaForm(E);var k=function(){i.commit("review/modal",!1),w.value=!1};return window.addEventListener("keyup",(function(e){u.value&&"Escape"===e.key&&k()})),document.addEventListener("DOMContentLoaded",(function(){u.value&&document.documentElement.classList.add("is-modal-open");var e=document.getElementById("reviews-show-more");e&&e.addEventListener("click",(function(){document.getElementById("reviews-list").querySelectorAll(".review.is-hidden").forEach((function(t){t.classList.remove("is-hidden"),e.remove()}))}))}),!1),p(a={loading:o,modal:u,schema:b,validation:g,add:function(){s.value?i.commit("review/modal",!0):i.commit("auth/modal","login")},cancel:k},"schema",b),p(a,"onSubmit",(function(){o.value=!0,$http.post($ziggy("api.review"),E.value).then((function(){w.value=!0,E.value={review:"",rating:0,name:y.value.name,id:n.id}})).catch((function(e){if(c.value={},e.response.data&&e.response.data.errors){for(var t=0,r=Object.entries(e.response.data.errors);t<r.length;t++){var n=h(r[t],2),a=n[0],o=n[1];o[0]&&(c.value[a]=o[0])}l.value++}})).finally((function(){o.value=!1}))})),p(a,"errors",c),p(a,"key",l),p(a,"model",E),p(a,"thanks",w),a}}),g={class:"shop-reviews"},E={class:"modal-content"},k=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],_={class:"box"},S={class:"title"},N={class:"shop-reviews-form"},V={class:"field"},q={class:"columns is-vcentered"},C={class:"column"},j={class:"column has-text-right"},O={class:"shop-reviews-thanks"},x=["innerHTML"],D={class:"mt-3"};b.render=function(t,r,n,a,o,i){var l=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("button",{class:"button review-add",onClick:r[0]||(r[0]=function(){return t.add&&t.add.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.add")),1),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:r[1]||(r[1]=function(){return t.cancel&&t.cancel.apply(t,arguments)})}),e.createElementVNode("div",E,[e.createElementVNode("button",{class:"modal-close is-large",onClick:r[2]||(r[2]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},k),e.createElementVNode("div",_,[e.createElementVNode("div",S,e.toDisplayString(t.__("shop.review.title")),1),e.withDirectives(e.createElementVNode("div",N,[(e.openBlock(),e.createBlock(l,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,"initial-errors":t.errors,key:t.key,onSubmit:t.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",V,[e.createElementVNode("div",q,[e.createElementVNode("div",C,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":t.loading}]),type:"submit"},e.toDisplayString(t.__("shop.review.save")),3)]),e.createElementVNode("div",j,[e.createElementVNode("button",{class:"button",onClick:r[3]||(r[3]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.cancel")),1)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,!t.thanks]]),e.withDirectives(e.createElementVNode("div",O,[e.createElementVNode("div",{class:"message",innerHTML:t.__("shop.review.thanks")},null,8,x),e.createElementVNode("div",D,[e.createElementVNode("button",{class:"button",onClick:r[4]||(r[4]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.continue")),1)])],512),[[e.vShow,t.thanks]])])])],2)])},module.exports=b;
1
+ "use strict";var e=require("vue"),t=require("vuex"),r=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormTextarea"),o=require("@perevorot/shop/dist/forms/FormText"),i=require("@perevorot/shop/dist/forms/FormRating"),l=require("yup");function c(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 s=c(n),d=c(a),m=c(o),v=c(i),f=u(l);function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}e.markRaw(v.default),e.markRaw(d.default),e.markRaw(m.default);var w=r.SchemaFormFactory([s.default({})]),b=e.defineComponent({name:"review",components:{SchemaForm:w},props:{id:Number},setup:function(n){var a,o=e.ref(!1),i=t.useStore(),l=e.ref(0),c=e.ref({}),u=e.computed((function(){return i.getters["review/modal"]})),s=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["auth/me"]})),w=e.ref(!1),b=e.ref({rating:{component:v.default,model:"rating"},review:{component:d.default,label:__("shop.review.review"),model:"review"},name:{component:m.default,label:__("shop.review.name"),model:"name"}}),g=f.object().shape({review:f.string().required(__("auth.validation.required")),rating:f.number().min(1,__("auth.validation.required")).required(__("auth.validation.required")),name:f.string().required(__("auth.validation.required"))}),E=e.ref({review:"",rating:0,name:y.value.name,id:n.id});r.useSchemaForm(E);var _=function(){i.commit("review/modal",!1),w.value=!1};return window.addEventListener("keyup",(function(e){u.value&&"Escape"===e.key&&_()})),document.addEventListener("DOMContentLoaded",(function(){u.value&&document.documentElement.classList.add("is-modal-open");var e=document.getElementById("reviews-show-more");e&&e.addEventListener("click",(function(){document.getElementById("reviews-list").querySelectorAll(".review.is-hidden").forEach((function(t){t.classList.remove("is-hidden"),e.remove()}))}))}),!1),p(a={loading:o,modal:u,schema:b,validation:g,add:function(){s.value?i.commit("review/modal",!0):i.commit("auth/modal","login")},cancel:_},"schema",b),p(a,"onSubmit",(function(){o.value=!0,$http.post($ziggy("api.review"),E.value).then((function(){w.value=!0,E.value={review:"",rating:0,name:y.value.name,id:n.id}})).catch((function(e){if(c.value={},e.response.data&&e.response.data.errors){for(var t=0,r=Object.entries(e.response.data.errors);t<r.length;t++){var n=h(r[t],2),a=n[0],o=n[1];o[0]&&(c.value[a]=o[0])}l.value++}})).finally((function(){o.value=!1}))})),p(a,"errors",c),p(a,"key",l),p(a,"model",E),p(a,"thanks",w),a}}),g={class:"shop-reviews"},E={class:"modal-content"},_=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],k={class:"box"},N={class:"title"},S={class:"shop-reviews-form"},V={class:"field"},q={class:"columns is-vcentered"},C={class:"column"},j={class:"column has-text-right"},O={class:"shop-reviews-thanks"},x=["innerHTML"],D={class:"mt-3"};b.render=function(t,r,n,a,o,i){var l=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("button",{class:"button review-add",onClick:r[0]||(r[0]=function(){return t.add&&t.add.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.add")),1),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:r[1]||(r[1]=function(){return t.cancel&&t.cancel.apply(t,arguments)})}),e.createElementVNode("div",E,[e.createElementVNode("button",{class:"modal-close is-large",onClick:r[2]||(r[2]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},_),e.createElementVNode("div",k,[e.createElementVNode("div",N,e.toDisplayString(t.__("shop.review.title")),1),e.withDirectives(e.createElementVNode("div",S,[e.createVNode(l,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,"initial-errors":t.errors,key:t.key,onSubmit:t.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",V,[e.createElementVNode("div",q,[e.createElementVNode("div",C,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":t.loading}]),type:"submit"},e.toDisplayString(t.__("shop.review.save")),3)]),e.createElementVNode("div",j,[e.createElementVNode("button",{class:"button",onClick:r[3]||(r[3]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.cancel")),1)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],512),[[e.vShow,!t.thanks]]),e.withDirectives(e.createElementVNode("div",O,[e.createElementVNode("div",{class:"message",innerHTML:t.__("shop.review.thanks")},null,8,x),e.createElementVNode("div",D,[e.createElementVNode("button",{class:"button",onClick:r[4]||(r[4]=function(){return t.cancel&&t.cancel.apply(t,arguments)})},e.toDisplayString(t.__("shop.review.continue")),1)])],512),[[e.vShow,t.thanks]])])])],2)])},module.exports=b;
2
2
  //# sourceMappingURL=Review.js.map