@perevorot/shop 2.0.151 → 2.0.152

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 +1 @@
1
- {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=30ed1a56&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\" :data-code=\"item.attributes.code\" shop-product>\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 cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.attributes.productId ? item.attributes.productId : item.id\" :item=\"item\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"is-hidden\" shop-product-category>{{ item.attributes.categoryFull }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\" shop-product-name>\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\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)\" shop-product-price></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, inject } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n let cartStorage = inject('cartStorage');\n cartStorage = cartStorage ? cartStorage : 'cart';\n\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.categoryFull ? props.item.attributes.categoryFull : props.item.attributes.category;\n const brand = props.item.attributes.brand;\n const property = props.item.attributes.property;\n const index = props.item.attributes.index;\n const itemListName = props.item.attributes.itemListName;\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/remove', {\n id: props.item.id,\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price) * q,\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: q,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (index) {\n object.ecommerce.items[0].index = index;\n }\n\n if (itemListName) {\n object.ecommerce.items[0].item_list_name = itemListName;\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/add', {\n cart: cartStorage,\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n if (difference > 0) {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price),\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: 1,\n }\n ]\n },\n event: 'add_to_cart'\n };\n\n if (brand) {\n object.ecommerce.items[0].item_brand = brand;\n }\n\n if (props.item.attributes.index) {\n object.ecommerce.items[0].index = props.item.attributes.index;\n }\n\n if (props.item.attributes.itemListName) {\n object.ecommerce.items[0].item_list_name = props.item.attributes.itemListName;\n }\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\" :data-code=\"item.attributes.code\" shop-product>\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 cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.attributes.productId ? item.attributes.productId : item.id\" :item=\"item\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"is-hidden\" shop-product-category>{{ item.attributes.categoryFull }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\" shop-product-name>\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\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)\" shop-product-price></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, inject } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n let cartStorage = inject('cartStorage');\n cartStorage = cartStorage ? cartStorage : 'cart';\n\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.categoryFull ? props.item.attributes.categoryFull : props.item.attributes.category;\n const brand = props.item.attributes.brand;\n const property = props.item.attributes.property;\n const index = props.item.attributes.index;\n const itemListName = props.item.attributes.itemListName;\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/remove', {\n id: props.item.id,\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price) * q,\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: q,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (index) {\n object.ecommerce.items[0].index = index;\n }\n\n if (itemListName) {\n object.ecommerce.items[0].item_list_name = itemListName;\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/add', {\n cart: cartStorage,\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n if (difference > 0) {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price),\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: 1,\n }\n ]\n },\n event: 'add_to_cart'\n };\n\n if (brand) {\n object.ecommerce.items[0].item_brand = brand;\n }\n\n if (props.item.attributes.index) {\n object.ecommerce.items[0].index = props.item.attributes.index;\n }\n\n if (props.item.attributes.itemListName) {\n object.ecommerce.items[0].item_list_name = props.item.attributes.itemListName;\n }\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>"],"names":["name","props","item","Object","setup","cartStorage","inject","store","useStore","loading","ref","input","options","attributes","length","optionsToggled","auth","computed","getters","value","price","code","category","categoryFull","brand","property","index","itemListName","quantity","difference","dispatch","cart","product","id","callback","object","ecommerce","currency","parseFloat","items","item_name","item_id","event","item_brand","item_list_name","indexOf","split","forEach","segment","trim","item_category","item_variant","$env","debug","console","log","window","dataLayer","push","watch","values","increase","decrease","remove","q","gotoProduct","href","addEventListener","commit","location","_createElementVNode","$props","deleted","_createElementBlock","active","bundle","_hoisted_2","_hoisted_3","_ctx","_hoisted_4","_hoisted_5","_hoisted_6","onClick","$setup","disabled","_createBlock","productId","_hoisted_10","image","src","_hoisted_15","_hoisted_16","_hoisted_17","_renderSlot","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","type","min","_hoisted_30","innerHTML","_hoisted_33","filters","priceOld","amount","percent","sum","_hoisted_37","_hoisted_38","option","key","_hoisted_39","_hoisted_41","description","_hoisted_43","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","_hoisted_49","second","_hoisted_54","_hoisted_55","_hoisted_56","third","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_65","_hoisted_66","_hoisted_67"],"mappings":"sDAiJe,CACXA,KAAM,WACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACEI,EAAcC,SAAO,eACzBD,EAAcA,GAA4B,WAEpCE,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAQD,QACRE,EAAUF,MAAIT,EAAMC,KAAKW,WAAWD,SAAWX,EAAMC,KAAKW,WAAWD,QAAQE,OAASb,EAAMC,KAAKW,WAAWD,QAAU,IACtHG,EAAiBL,OAAI,GACrBM,EAAOC,YAAS,kBAAMV,EAAMW,QAAQ,cAEtCjB,EAAMC,KAAKW,WAAWD,SAAWX,EAAMC,KAAKW,WAAWD,QAAQE,SAC/DC,EAAeI,OAAQ,OAGrBnB,EAAOC,EAAMC,KAAKF,KAClBoB,EAAQnB,EAAMC,KAAKW,WAAWO,MAC9BC,EAAOpB,E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D,WAAW8G,OAAOnC,iCAClCf,yCAMZH,2BAAAsD,GAC4BrD,QAAK1D,WAAW8G,OAAOtG,oBAA/CoD,2BAAAoD,oBAAwD/C,8CAA2BP,QAAK1D,WAAW8G,OAAOtG,0CAC1GiD,2BAAAwD,GACIxD,0BAAIY,uCAAOC,eAAYZ,QAAK1D,WAAW8G,OAAOzD,2BAAUK,QAAK1D,WAAW8G,OAAO3H,gDAIzDuE,QAAK1D,WAAW8D,QAAUJ,QAAK1D,WAAWkH,qBAA5EtD,2BAAAuD,GACIC,GAGA3D,2BAAA4D,IACIC,GAGA7D,0BAAIY,yCAAOC,eAAYZ,QAAK1D,WAAWkH,MAAM7D,UACzCI,uDAAc,+BAA+CC,QAAK1D,WAAWkH,MAAMvC,WACjCjB,QAAK1D,WAAWkH,MAAMvC,qBAApEf,kCAAMgB,IAAKlB,QAAK1D,WAAWkH,MAAMvC,kCACjCf,2CAMZH,2BAAA8D,IAC4B7D,QAAK1D,WAAWkH,MAAM1G,oBAA9CoD,2BAAA4D,qBAAuDvD,8CAA2BP,QAAK1D,WAAWkH,MAAM1G,0CACxGiD,2BAAAgE,IACIhE,0BAAIY,yCAAOC,eAAYZ,QAAK1D,WAAWkH,MAAM7D,2BAAUK,QAAK1D,WAAWkH,MAAM/H"}
1
+ {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=30ed1a56&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\" :data-code=\"item.attributes.code\" shop-product>\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 cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.attributes.productId ? item.attributes.productId : item.id\" :item=\"item\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"is-hidden\" shop-product-category>{{ item.attributes.categoryFull }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\" shop-product-name>\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\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)\" shop-product-price></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, inject } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n let cartStorage = inject('cartStorage');\n cartStorage = cartStorage ? cartStorage : 'cart';\n\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.categoryFull ? props.item.attributes.categoryFull : props.item.attributes.category;\n const brand = props.item.attributes.brand;\n const property = props.item.attributes.property;\n const index = props.item.attributes.index;\n const itemListName = props.item.attributes.itemListName;\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/remove', {\n id: props.item.id,\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price) * q,\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: q,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (index) {\n object.ecommerce.items[0].index = index;\n }\n\n if (itemListName) {\n object.ecommerce.items[0].item_list_name = itemListName;\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/add', {\n cart: cartStorage,\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n if (difference > 0) {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price),\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: 1,\n }\n ]\n },\n event: 'add_to_cart'\n };\n\n if (brand) {\n object.ecommerce.items[0].item_brand = brand;\n }\n\n if (props.item.attributes.index) {\n object.ecommerce.items[0].index = props.item.attributes.index;\n }\n\n if (props.item.attributes.itemListName) {\n object.ecommerce.items[0].item_list_name = props.item.attributes.itemListName;\n }\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\" :data-code=\"item.attributes.code\" shop-product>\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 cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.attributes.productId ? item.attributes.productId : item.id\" :item=\"item\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"is-hidden\" shop-product-category>{{ item.attributes.categoryFull }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\" shop-product-name>\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\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)\" shop-product-price></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(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 <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(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>\n <use xlink:href=\"#logo\" />\n </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 @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, inject } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n let cartStorage = inject('cartStorage');\n cartStorage = cartStorage ? cartStorage : 'cart';\n\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.categoryFull ? props.item.attributes.categoryFull : props.item.attributes.category;\n const brand = props.item.attributes.brand;\n const property = props.item.attributes.property;\n const index = props.item.attributes.index;\n const itemListName = props.item.attributes.itemListName;\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/remove', {\n id: props.item.id,\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price) * q,\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: q,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (index) {\n object.ecommerce.items[0].index = index;\n }\n\n if (itemListName) {\n object.ecommerce.items[0].item_list_name = itemListName;\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/add', {\n cart: cartStorage,\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n if (difference > 0) {\n const q = props.item.quantity;\n\n const object = {\n ecommerce: {\n currency: 'UAH',\n value: parseFloat(price),\n items: [\n {\n item_name: name,\n item_id: code,\n price: parseFloat(price),\n quantity: 1,\n }\n ]\n },\n event: 'add_to_cart'\n };\n\n if (brand) {\n object.ecommerce.items[0].item_brand = brand;\n }\n\n if (props.item.attributes.index) {\n object.ecommerce.items[0].index = props.item.attributes.index;\n }\n\n if (props.item.attributes.itemListName) {\n object.ecommerce.items[0].item_list_name = props.item.attributes.itemListName;\n }\n\n if (category) {\n if (category.indexOf('/') !== -1) {\n category.split('/').forEach((segment, index) => {\n object.ecommerce.items[0]['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n object.ecommerce.items[0].item_category = category;\n }\n }\n\n if (property) {\n object.ecommerce.items[0].item_variant = property;\n }\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>"],"names":["name","props","item","Object","setup","cartStorage","inject","store","useStore","loading","ref","input","options","attributes","length","optionsToggled","auth","computed","getters","value","price","code","category","categoryFull","brand","property","index","itemListName","quantity","difference","dispatch","cart","product","id","callback","object","ecommerce","currency","parseFloat","items","item_name","item_id","event","item_brand","item_list_name","indexOf","split","forEach","segment","trim","item_category","item_variant","$env","debug","console","log","window","dataLayer","push","watch","values","increase","decrease","remove","q","gotoProduct","href","addEventListener","commit","location","_createElementVNode","$props","deleted","_createElementBlock","active","bundle","_hoisted_2","_hoisted_3","_ctx","_hoisted_4","_hoisted_5","_hoisted_6","onClick","$setup","disabled","_createBlock","productId","_hoisted_10","image","src","_hoisted_15","_hoisted_16","_hoisted_17","_renderSlot","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","type","min","_hoisted_30","innerHTML","_hoisted_33","filters","priceOld","amount","percent","sum","_hoisted_37","_hoisted_38","option","key","_hoisted_39","_hoisted_41","description","_hoisted_43","_hoisted_44","_hoisted_47","_hoisted_48","_hoisted_49","_hoisted_50","second","_hoisted_55","_hoisted_56","_hoisted_57","third","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_66","_hoisted_67","_hoisted_68"],"mappings":"sDAiJe,CACXA,KAAM,WACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACEI,EAAcC,SAAO,eACzBD,EAAcA,GAA4B,WAEpCE,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAQD,QACRE,EAAUF,MAAIT,EAAMC,KAAKW,WAAWD,SAAWX,EAAMC,KAAKW,WAAWD,QAAQE,OAASb,EAAMC,KAAKW,WAAWD,QAAU,IACtHG,EAAiBL,OAAI,GACrBM,EAAOC,YAAS,kBAAMV,EAAMW,QAAQ,cAEtCjB,EAAMC,KAAKW,WAAWD,SAAWX,EAAMC,KAAKW,WAAWD,QAAQE,SAC/DC,EAAeI,OAAQ,OAGrBnB,EAAOC,EAAMC,KAAKF,KAClBoB,EAAQnB,EAAMC,KAAKW,WAAWO,MAC9BC,EAAOpB,EAAMC,KAAKW,WAAWQ,KAC7BC,EAAWrB,EAAMC,KAAKW,WAAWU,aAAetB,EAAMC,KAAKW,WAAWU,aAAetB,EAAMC,KAAKW,WAAWS,SAC3GE,EAAQvB,EAAMC,KAAKW,WAAWW,MAC9BC,EAAWxB,EAAMC,KAAKW,WAAWY,SACjCC,EAAQzB,EAAMC,KAAKW,WAAWa,MAC9BC,EAAe1B,EAAMC,KAAKW,WAAWc,aA2ErCC,EAAW,SAACC,GACdpB,EAAQU,OAAQ,EAEhBZ,EAAMuB,SAASzB,EAAc,OAAQ,CACjC0B,KAAM1B,EACN2B,QAAS,CACLC,G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AAYZ,QAAK1D,WAAWkH,MAAM7D,UACzCI,uDAAc,+BAA+CC,QAAK1D,WAAWkH,MAAMvC,WACjCjB,QAAK1D,WAAWkH,MAAMvC,qBAApEf,kCAAMgB,IAAKlB,QAAK1D,WAAWkH,MAAMvC,kCACjCf,2CAMZH,2BAAA8D,IAC4B7D,QAAK1D,WAAWkH,MAAM1G,oBAA9CoD,2BAAA4D,qBAAuDvD,8CAA2BP,QAAK1D,WAAWkH,MAAM1G,0CACxGiD,2BAAAgE,IACIhE,0BAAIY,yCAAOC,eAAYZ,QAAK1D,WAAWkH,MAAM7D,2BAAUK,QAAK1D,WAAWkH,MAAM/H"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("@vueform/slider")),l=e.defineComponent({name:"price",components:{Slider:r.default},props:{min:Number,max:Number,step:Number,from:Number,to:Number,bar:Array,reset:String,hrefTemplate:String},setup:function(t){var r=e.ref([t.from,t.to]),l=e.ref(!0),n=e.computed((function(){return t.hrefTemplate.replace("#-#",Math.floor(r.value[0])+"-"+Math.ceil(r.value[1]))}));return{value:r,opacity:function(e){return 1},height:function(e){return e>0?"calc(10% + "+e+"%)":"0px"},change:function(){l.value=!1},href:n,disabled:l}}}),n={class:"shop-filters-price"},o={class:"mb-2"},a={class:"title is-6 mb-0 is-clickable","shop-filter-title":""},i=["href"],c={"shop-filter-content":""},s={class:"columns is-gapless is-vcentered"},u={class:"column"},m=["innerHTML"],d=["innerHTML"],p={class:"column is-narrow"},f=["href"],h={class:"columns is-gapless is-align-items-flex-end mb-0",style:{height:"30px"}},v=["title"];l.render=function(t,r,l,N,V,b){var g=e.resolveComponent("slider");return e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,[e.createElementVNode("div",a,e.toDisplayString(t.__("shop.filter.price")),1),t.reset?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.reset,class:"is-size-7"},e.toDisplayString(t.__("shop.clearFilter")),9,i)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[e.createElementVNode("div",u,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[0])},null,8,m),e.createTextVNode(" — "),e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[1])},null,8,d)]),e.createElementVNode("div",p,[e.createElementVNode("a",{href:t.href,class:"button is-small"},"OK",8,f)])]),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bar,(function(r,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"column",style:e.normalizeStyle("width:5%;background-color:#DDD;height: "+t.height(r[0])+";opacity:"+t.opacity(l)),title:r[1]},null,12,v)})),128))]),e.createVNode(g,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=function(e){return t.value=e}),min:t.min,max:t.max,step:t.step,tooltips:!1,onUpdate:t.change},null,8,["modelValue","min","max","step","onUpdate"])])])},module.exports=l;
1
+ "use strict";var e=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("@vueform/slider")),l=e.defineComponent({name:"price",components:{Slider:r.default},props:{min:Number,max:Number,step:Number,from:Number,to:Number,bar:Array,reset:String,hrefTemplate:String},setup:function(t){var r=e.ref([t.from,t.to]),l=e.ref(!0),n=e.computed((function(){return t.hrefTemplate.replace("#-#",Math.floor(r.value[0])+"-"+Math.ceil(r.value[1]))}));return{value:r,opacity:function(e){return 1},height:function(e){return e>0?"calc(10% + "+e+"%)":"0px"},change:function(){l.value=!1},href:n,disabled:l}}}),n={class:"shop-filters-price"},o={class:"mb-2"},a={class:"title is-6 mb-0 is-clickable","shop-filter-title":""},i=["href"],c={"shop-filter-content":""},s={class:"columns is-gapless is-vcentered"},u={class:"column"},m=["innerHTML"],d=e.createTextVNode(" — "),p=["innerHTML"],f={class:"column is-narrow"},h=["href"],v={class:"columns is-gapless is-align-items-flex-end mb-0",style:{height:"30px"}},N=["title"];l.render=function(t,r,l,V,b,g){var E=e.resolveComponent("slider");return e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,[e.createElementVNode("div",a,e.toDisplayString(t.__("shop.filter.price")),1),t.reset?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.reset,class:"is-size-7"},e.toDisplayString(t.__("shop.clearFilter")),9,i)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[e.createElementVNode("div",u,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[0])},null,8,m),d,e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[1])},null,8,p)]),e.createElementVNode("div",f,[e.createElementVNode("a",{href:t.href,class:"button is-small"},"OK",8,h)])]),e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bar,(function(r,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"column",style:e.normalizeStyle("width:5%;background-color:#DDD;height: "+t.height(r[0])+";opacity:"+t.opacity(l)),title:r[1]},null,12,N)})),128))]),e.createVNode(E,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=function(e){return t.value=e}),min:t.min,max:t.max,step:t.step,tooltips:!1,onUpdate:t.change},null,8,["modelValue","min","max","step","onUpdate"])])])},module.exports=l;
2
2
  //# sourceMappingURL=Price.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Price.js","sources":["../../../../src/components/shop/filters/Price.vue","../../../../src/components/shop/filters/Price.vue?vue&type=template&id=4ec0b279&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>"],"names":["defineComponent","name","components","Slider","props","min","Number","max","step","from","to","bar","Array","reset","String","hrefTemplate","setup","value","ref","disabled","href","computed","replace","Math","floor","ceil","opacity","key","height","change","style","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_ctx","_hoisted_5","_hoisted_6","_hoisted_7","innerHTML","price","_hoisted_10","_hoisted_12","item","title","_createVNode","tooltips","onUpdate"],"mappings":"gJAsD6BA,kBAAgB,CACzCC,KAAM,QACNC,WAAY,CACRC,OAAAA,WAEJC,MAAO,CACHC,IAAKC,OACLC,IAAKD,OACLE,KAAMF,OACNG,KAAMH,OACNI,GAAIJ,OACJK,IAAKC,MACLC,MAAOC,OACPC,aAAcD,QAElBE,eAAMZ,OACIa,EAAQC,MAAI,CAACd,EAAMK,KAAML,EAAMM,KAC/BS,EAAWD,OAAI,GAEfE,EAAOC,YAAS,kBACXjB,EAAMW,aAAaO,QACtB,MACAC,KAAKC,MAAMP,EAAMA,MAAM,IAAM,IAAMM,KAAKE,KAAKR,EAAMA,MAAM,cAwB1D,CACHA,MAAAA,EACAS,QAtBY,SAACC,UACC,GAsBdC,OAXW,SAACX,UACLA,EAAQ,EAAI,cAAgBA,EAAQ,KAAO,OAWlDY,OARW,WACXV,EAASF,OAAQ,GAQjBG,KAAAA,EACAD,SAAAA,eCzGG,+BACI,iBACI,mDAA+B,wCAOzC,aACU,4CACI,mDAKA,wCAKL,kDACNW,MAAA,oHAtBZC,2BAAAC,GACIC,2BAAAC,GACID,2BAAAE,oBACOC,8BAEkCA,uBAAzCL,gCAAIX,KAAMgB,cAAa,+BACnBA,kEAGRH,2BAAAI,GACIJ,2BAAAK,GACIL,2BAAAM,GACIN,6BAAMO,UAAQJ,WAASK,MAAML,gDAAqBH,6BAC9CO,UAAQJ,WAASK,MAAML,yBAG/BH,2BAAAS,GACIT,0BAAIb,KAAMgB,aAAY,mBAAkB,cAGhDH,2BAAAU,oBAIIZ,kDAC0BK,gBAAdQ,EAAMjB,wBADlBI,4BAEKJ,IAAKA,QACA,SACLG,0GAMAe,MAAOD,4BAGhBE,4BACaV,6DAAAA,YACR/B,IAAK+B,MACL7B,IAAK6B,MACL5B,KAAM4B,OACNW,UAAU,EACVC,SAAQZ"}
1
+ {"version":3,"file":"Price.js","sources":["../../../../src/components/shop/filters/Price.vue","../../../../src/components/shop/filters/Price.vue?vue&type=template&id=4ec0b279&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>"],"names":["defineComponent","name","components","Slider","props","min","Number","max","step","from","to","bar","Array","reset","String","hrefTemplate","setup","value","ref","disabled","href","computed","replace","Math","floor","ceil","opacity","key","height","change","style","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_ctx","_hoisted_5","_hoisted_6","_hoisted_7","innerHTML","price","_hoisted_11","_hoisted_13","item","title","_createVNode","tooltips","onUpdate"],"mappings":"gJAsD6BA,kBAAgB,CACzCC,KAAM,QACNC,WAAY,CACRC,OAAAA,WAEJC,MAAO,CACHC,IAAKC,OACLC,IAAKD,OACLE,KAAMF,OACNG,KAAMH,OACNI,GAAIJ,OACJK,IAAKC,MACLC,MAAOC,OACPC,aAAcD,QAElBE,eAAMZ,OACIa,EAAQC,MAAI,CAACd,EAAMK,KAAML,EAAMM,KAC/BS,EAAWD,OAAI,GAEfE,EAAOC,YAAS,kBACXjB,EAAMW,aAAaO,QACtB,MACAC,KAAKC,MAAMP,EAAMA,MAAM,IAAM,IAAMM,KAAKE,KAAKR,EAAMA,MAAM,cAwB1D,CACHA,MAAAA,EACAS,QAtBY,SAACC,UACC,GAsBdC,OAXW,SAACX,UACLA,EAAQ,EAAI,cAAgBA,EAAQ,KAAO,OAWlDY,OARW,WACXV,EAASF,OAAQ,GAQjBG,KAAAA,EACAD,SAAAA,eCzGG,+BACI,iBACI,mDAA+B,wCAOzC,aACU,4CACI,8EAKA,wCAKL,kDACNW,MAAA,oHAtBZC,2BAAAC,GACIC,2BAAAC,GACID,2BAAAE,oBACOC,8BAEkCA,uBAAzCL,gCAAIX,KAAMgB,cAAa,+BACnBA,kEAGRH,2BAAAI,GACIJ,2BAAAK,GACIL,2BAAAM,GACIN,6BAAMO,UAAQJ,WAASK,MAAML,yBAAqBH,6BAC9CO,UAAQJ,WAASK,MAAML,yBAG/BH,2BAAAS,GACIT,0BAAIb,KAAMgB,aAAY,mBAAkB,cAGhDH,2BAAAU,oBAIIZ,kDAC0BK,gBAAdQ,EAAMjB,wBADlBI,4BAEKJ,IAAKA,QACA,SACLG,0GAMAe,MAAOD,4BAGhBE,4BACaV,6DAAAA,YACR/B,IAAK+B,MACL7B,IAAK6B,MACL5B,KAAM4B,OACNW,UAAU,EACVC,SAAQZ"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),l=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var u=s(r),m=s(a),p=s(l),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},y={class:"bundle-title"},g={class:"column name"},k={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},w={key:0,class:"code"},S={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},L={key:0,class:"quantity-price"},M=["innerHTML"],P={class:"column is-2 has-text-right"},F=["innerHTML"],O=["innerHTML"],H=["innerHTML"],q={key:0,class:"options is-toggled"},$={class:"toggler"},U={class:"wrapper"},z={class:"column"},R={class:"option-title"},A={class:"column is-2 has-text-right"},j=["innerHTML"],W={key:0,class:"bundle columns"},J={class:"column is-narrow"},I=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),G=["href"],K=["src"],Q={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],oe={key:1,class:"bundle columns"},ne={class:"column is-narrow"},re=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],le=["src"],ie={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},de={key:0,class:"code"},ue={class:"title"},me=["href"];function pe(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ve(){}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,a,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",y,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",g,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",S,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",P,[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,F)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,H)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",z,[e.createElementVNode("div",R,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[e.createTextVNode("+"),e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,j)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[I,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,K)):(e.openBlock(),e.createElementBlock("svg",Q,X))],2)],8,G)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",ne,[re,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,le)):(e.openBlock(),e.createElementBlock("svg",ie,ce))],2)],8,ae)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,me)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(m.default),e.markRaw(p.default);var fe=n.SchemaFormFactory([u.default({})]),ye={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ge=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},props:{isLogin:{type:Boolean,default:!0},isPhoneMasked:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1},isTrackAfterSuccessOnlinePurchase:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var a=e.useSlots(),l=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),u=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),w=e.ref("new"),S=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),L=e.ref(""),M=e.ref(null),P=e.ref(!1),F=e.getCurrentInstance(),O=e.computed((function(){var e=u.value.reduce((function(e,t){return e+(t.attributes.loyalty?t.attributes.loyalty.points*t.quantity:0)}),0);return{points:e,name:t.pluralize(e,__("shop.pluralize.points"))}})),H=e.ref(""),q=e.ref(!1),$=e.computed((function(){return t.numberFormat(y.value.loyalty_points-(q.value?H.value:0))})),U=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),z=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),R=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(R,(function(e){e.length>1e3&&(R.value=R.value.substring(0,1e3))}));var A=function(t,o){return e.computed({get:function(){return y.value[t]?y.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(y.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",A);var j=e.ref({last_name:A("last_name"),middle_name:A("middle_name"),name:A("name"),email:A("email"),phone:A("phone"),registration_number:A("registration_number"),company_name:A("company_name"),user_type:A("user_type","individual")});e.provide("user",j),i.dispatch("auth/me",{finally:function(){}});var W=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),J=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),I=e.computed((function(){return W.value?B.value.find((function(e){return e.id==W.value})):{}})),G=e.computed((function(){return J.value?C.value.find((function(e){return e.id==J.value})):{}})),K=e.computed((function(){return ee(B.value,W.value)})),Q=e.computed((function(){return ee(C.value,J.value)})),X=e.computed((function(){return te(B.value)})),Y=e.computed((function(){return te(C.value)})),Z=e.computed((function(){var e=[];return u.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),ee=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},te=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&W.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(W.value)),o&&J.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(J.value)),o&&n.categories&&n.categories.length&&(o=!Z.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===j.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},oe=e.computed((function(){var e=0;return u.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(w,(function(e){"login"==e&&i.commit("auth/modal","login")}));var ne={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:m.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:m.default,label:__("auth.registration.form.phone"),model:"phone",type:"phone"},registration_number:{component:m.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:m.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:m.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}};r.isPhoneMasked&&(ne.phone.mask="(###) ###-##-##");var re=Object.keys(ne).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ne[t]),e}),{});re=r.userFields.reduce((function(e,t){return e[t]=re[t],e}),{});var ae=e.ref(re);n.useSchemaForm(j);var le={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:r.isPhoneMasked?v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")):v.string().required(__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required(__("auth.validation.required"))}))},ie=Object.keys(le).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=le[t]),e}),{}),ce=v.object().shape(ie);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var se=he((function(){return function(e){var t=e();if(t&&t.then)return t.then(ve)}((function(){if("function"==typeof de.value)return pe(de.value(),(function(e){S.value&&S.value.click(),ce.isValid(j.value).then((function(t){g.value=t&&J.value&&U.value&&W.value&&(!I.value.component||I.value.component&&D.value[I.value.code]&&D.value[I.value.code].isValid)&&e}))}))}))})),de=e.ref(null);e.provide("shippingComponentValid",de);var ue=e.ref({});e.provide("shippingComponentUserData",ue);var me=e.ref(!1),fe=function(e){_.value=!0,E.value=e,document.querySelector("html").classList.add("is-checkout-thanks"),ke()},ge=he((function(){var t="function"==typeof de.value?de.value():null;return I.value&&!I.value.component&&(t=!0),ce.isValid(j.value).then((function(o){if(o)if(W.value)if(!I.value.component||D.value[I.value.code]&&D.value[I.value.code].isValid)if(t)if(J.value)if(U.value){var n,a=D.value[I.value.code]?JSON.parse(JSON.stringify(D.value[I.value.code])):{};delete a.isValid;var c=JSON.parse(JSON.stringify(ue.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var d={checkout:!0,user:{last_name:j.value.last_name,middle_name:j.value.middle_name,name:j.value.name,phone:j.value.phone,email:j.value.email,user_type:j.value.user_type,registration_number:j.value.registration_number,company_name:j.value.company_name},shipping:{id:W.value,data:a,user:c},payment:{id:J.value},comment:R.value,dontcall:z.value,promoCode:L.value,loyalty:H.value,clientId:n};s.value=!0,$http.post(window.location.href,d).then((function(t){if(t.data&&t.data.error&&t.data.message)l(t.data.message,{type:"error"});else{var o=[];u.value.forEach((function(e){var t={item_name:e.name,item_id:e.attributes.code,price:e.price,quantity:e.quantity};e.attributes.brand&&(t.item_brand=e.attributes.brand),e.attributes.property&&(t.item_variant=e.attributes.property),e.attributes.categoryFull&&(-1!==e.attributes.categoryFull.indexOf("/")?e.attributes.categoryFull.split("/").forEach((function(e,o){t["item_category"+(o?o+1:"")]=e.trim()})):t.item_category=e.attributes.categoryFull),e.attributes.index&&(t.index=e.attributes.index),e.attributes.itemListName&&(t.item_list_name=e.attributes.itemListName),o.push(t)}));var n={payment_type:G.value.name,shipping_tier:I.value.name,ecommerce:{transaction_id:t.data.order.id,affiliation:"main",value:parseFloat(h.value),shipping:0,currency:"UAH",items:o},event:"purchase"};j.value.user_type&&(n.user_type=__("auth.registration.form.user_type_"+j.value.user_type)),L.value&&(n.ecommerce.coupon=L.value),r.isTrackAfterSuccessOnlinePurchase&&(t.data.redirect||t.data.payment_widget_data&&window.Wayforpay)?localStorage.setItem("ecommerce",JSON.stringify(n)):($env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){k.value.submit()}),400)}))),t.data.payment_widget_data&&window.Wayforpay?function(e,t){var o=new Wayforpay;window.addEventListener("message",(function(e){"WfpWidgetEventClose"==e.data||"WfpWidgetEventDeclined"==e.data||e.data,"WfpWidgetEventApproved"==e.data&&(fe(t),me.value=!0,i.dispatch("cart/clear",{finally:function(){}}))})),o.run(e)}(JSON.parse(t.data.payment_widget_data),t.data.order):fe(t.data.order)}})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else w.value="new",S.value.click(),l(__("shop.order.validate_user"),{type:"error"})})),pe()})),ke=function(){i.commit("checkout/reset"),i.commit("cart/clear")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(u.value.forEach((function(t){var o={item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),quantity:t.quantity};t.attributes.brand&&(o.item_brand=t.attributes.brand),t.attributes.property&&(o.item_variant=t.attributes.property),t.attributes.categoryFull&&(-1!==t.attributes.categoryFull.indexOf("/")?t.attributes.categoryFull.split("/").forEach((function(e,t){o["item_category"+(t?t+1:"")]=e.trim()})):o.item_category=t.attributes.categoryFull),t.attributes.index&&(o.index=t.attributes.index),t.attributes.itemListName&&(o.item_list_name=t.attributes.itemListName),e.push(o)})),e.length){var t={ecommerce:{currency:"UAH",items:e,value:parseFloat(h.value)},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:w,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){w.value="new"},quantity:d,items:u,loading:s,pluralize:t.pluralize,discount:oe,total:h,shipping:W,shippingPrice:K,payment:J,fee:Q,userValidation:ce,userSchema:ae,userSubmitButton:S,checkout:ge,ifCheckoutReady:g,validate:se,shippingTypesRestricted:X,paymentMethodsRestricted:Y,toggleShippingRadio:function(e){W.value===e&&(W.value=null)},togglePaymentRadio:function(e){J.value===e&&(J.value=null)},shippingSelected:I,paymentSelected:G,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:ke,user:j,dontcall:z,comment:R,isCommentToggled:T,commentMaxLength:1e3,userCheckout:y,thanks:_,order:E,redirect:b,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){L.value&&(P.value=!0,$http.post(window.location.href,{promoCodeApply:L.value,email:j.value.email,total:h.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ye,props:{message:__("shop.order.promo.error_"+e.error,{number:F.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(L.value="")})),M.value=null)})).finally((function(){P.value=!1})))},promoCode:L,isPromoLoading:P,promoCodeApplied:M,resetPromoCode:function(){L.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+Q.value+K.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N,slots:a,isPayed:me,loyalty:O,loyaltyUse:H,loyaltyUseApplied:q,resetLoyaltyUse:function(){H.value=0,q.value=!1},applyLoyaltyUse:function(){H.value&&(q.value=!0)},readableUserLoyaltyPoints:$}}}),ke={class:"cart checkout"},_e=["action"],Ee=["name","value"],Ve={key:1,class:"items-wrapper"},Ne={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},we={class:"wrapper"},Se={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=["innerHTML"],Le=["onClick"],Me=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Pe={class:"checkout-block is-user auth-user"},Fe={class:"wrapper"},Oe={class:"items-title"},He={key:0,class:"user-tabs"},qe={class:"columns"},$e={class:"column user-form"},Ue={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={key:0,class:"column user-login user-form"},Re={key:1,class:"column"},Ae={key:0,class:"social-auth"},je={class:"socials"},We={class:"description"},Je={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ge=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ke={class:"checkout-block is-shipping"},Qe={class:"wrapper shipping-type-block"},Xe={class:"rows"},Ye={class:"item"},Ze={class:"row"},et={class:"info"},tt={class:"items-title mb-1"},ot={key:0,class:"value"},nt={class:"next-dates"},rt={class:"row"},at={class:"info"},lt=["value","onClick"],it=["src"],ct={key:1,class:"icon"},st=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],dt={key:0,class:"description"},ut={class:"value"},mt={key:0,class:"green"},pt=["innerHTML"],vt={key:0},ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},yt={class:"rows"},gt={class:"item"},kt={class:"row"},_t={class:"info"},Et={class:"items-title mb-1"},Vt={class:"info"},Nt=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],wt={class:"column is-4"},St={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Lt={class:"row"},Mt={class:"info"},Pt={class:"items-title mb-1"},Ft={class:"info"},Ot=["value","onClick"],Ht={key:0,class:"description"},qt={key:0,class:"value"},$t=["innerHTML"],Ut=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),zt={class:"inner"},Rt={class:"items-title"},At={class:"rows"},jt={class:"row products"},Wt={class:"info"},Jt=["textContent"],It={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},ao={class:"value"},lo=["innerHTML"],io={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},uo=e.createElementVNode("br",null,null,-1),mo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},yo={class:"value orange"},go=["innerHTML"],ko={key:0,class:"user-loyalty"},_o={class:"notice"},Eo={class:"user-form is-loyalty-use"},Vo={class:"control"},No=["disabled"],bo=["disabled"],Bo={class:"checkbox-wrapper nocall"},Co={key:1,class:"consent"},wo={class:"checkbox-wrapper"},So=["innerHTML"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form is-promo-code"},xo={class:"control"},Lo=["disabled"],Mo={class:"label",for:"promo-code-applied"},Po=["disabled"],Fo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Oo={class:"user-form"},Ho={key:0,class:"chars-count"},qo={key:2,class:"checkout-block thanks"},$o={class:"title"},Uo={class:"columns"},zo={key:0,class:"column is-6"},Ro={class:"subtitle"},Ao={key:1,class:"column is-6"},jo={class:"column is-6"},Wo={key:0,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Go=["innerHTML"],Ko=["innerHTML"],Qo={key:1,class:"info-wrapper"},Xo={class:"title"},Yo={class:"columns"},Zo=["innerHTML"],en=["innerHTML"],tn={key:2,class:"info-wrapper"},on={class:"title"},nn={class:"columns"},rn={class:"column is-6"},an=["innerHTML"],ln={key:3,class:"checkout-block empty"},cn={class:"title"},sn={class:"message"},dn=["href"],un=e.createElementVNode("br",null,null,-1),mn=["href"];ge.render=function(t,o,n,r,a,l){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ke,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ee)})),128))],8,_e)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ne,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",we,[e.createElementVNode("div",Se,[e.createElementVNode("div",De,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Te),e.createTextVNode(" "),e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,xe)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[Me,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Le)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",Fe,[e.createElementVNode("div",Oe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",qe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Ue,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",je,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Je,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ge)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",nt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",rt,[e.createElementVNode("div",at,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,lt),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",ct,st)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ut,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,pt))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",vt,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",yt,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Nt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",wt,[e.createElementVNode("div",St,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Pt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Ft,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Ot),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,$t)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Ut,e.createElementVNode("div",zt,[e.createElementVNode("div",Rt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",jt,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Jt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",It,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",ao,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,lo)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",io,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),uo,e.createElementVNode("span",mo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",yo,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,go)])])]),e.renderSlot(t.$slots,"loyalty",{loyalty:t.loyalty}),t.userCheckout.loyalty_points>0?(e.openBlock(),e.createElementBlock("div",ko,[e.createElementVNode("div",_o,e.toDisplayString(t.pluralize(t.readableUserLoyaltyPoints,t.__("shop.pluralize.points")))+" в наявності",1),e.createElementVNode("div",Eo,[e.createElementVNode("div",Vo,[e.withDirectives(e.createElementVNode("input",{type:"number",class:"input",placeholder:"Сума бонусів","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.loyaltyUse=e}),disabled:t.loyaltyUseApplied},null,8,No),[[e.vModelText,t.loyaltyUse]])]),t.loyaltyUseApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button is-reset",onClick:o[12]||(o[12]=function(){return t.resetLoyaltyUse&&t.resetLoyaltyUse.apply(t,arguments)})},"Відмінити")):(e.openBlock(),e.createElementBlock("button",{key:0,class:"button",onClick:o[11]||(o[11]=function(){return t.applyLoyaltyUse&&t.applyLoyaltyUse.apply(t,arguments)}),disabled:!t.loyaltyUse||t.loyaltyUse>t.userCheckout.loyalty_points},"Використати",8,bo))])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Bo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[14]||(o[14]=function(){return t.checkout&&t.checkout.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),3),e.renderSlot(t.$slots,"submit",{total:t.total}),t.isConsent?(e.openBlock(),e.createElementBlock("div",Co,[e.createElementVNode("div",wo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,So)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[16]||(o[16]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Do]),e.createElementVNode("div",To,[e.createElementVNode("div",xo,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[17]||(o[17]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,Lo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Mo,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[19]||(o[19]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[18]||(o[18]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,Po))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[20]||(o[20]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),Fo]),e.createElementVNode("div",Oo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[21]||(o[21]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Ho,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",qo,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",$o,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.isPayed?t.__("shop.order.payed"):t.__("shop.order.success")),1)]),e.createElementVNode("div",Uo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",zo,[e.createElementVNode("div",Ro,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[22]||(o[22]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("button",{class:"button is-orange",onClick:o[23]||(o[23]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",jo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Io,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Go)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,Ko)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Xo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Yo,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Zo)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,en)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",tn,[e.createElementVNode("div",on,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",nn,[e.createElementVNode("div",rn,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,an)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",cn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",sn,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dn),e.createTextVNode(", "),un,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,mn)]))])},module.exports=ge;
1
+ "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),l=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var u=s(r),m=s(a),p=s(l),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},y={class:"bundle-title"},g={class:"column name"},k={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},w={key:0,class:"code"},S={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},L={key:0,class:"quantity-price"},M=["innerHTML"],P={class:"column is-2 has-text-right"},F=["innerHTML"],O=["innerHTML"],H=["innerHTML"],q={key:0,class:"options is-toggled"},$={class:"toggler"},U={class:"wrapper"},z={class:"column"},R={class:"option-title"},A={class:"column is-2 has-text-right"},j=e.createTextVNode("+"),W=["innerHTML"],J={key:0,class:"bundle columns"},I={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],X={key:1},Y=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Z={class:"column"},ee={key:0,class:"code"},te={class:"title"},oe=["href"],ne={key:1,class:"bundle columns"},re={class:"column is-narrow"},ae=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),le=["href"],ie=["src"],ce={key:1},se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],de={class:"column"},ue={key:0,class:"code"},me={class:"title"},pe=["href"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(){}function fe(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,a,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",y,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",g,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",S,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",P,[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,F)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,H)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",z,[e.createElementVNode("div",R,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[j,e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,W)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("div",I,[G,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,Q)):(e.openBlock(),e.createElementBlock("svg",X,Y))],2)],8,K)]),e.createElementVNode("div",Z,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",te,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,oe)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",re,[ae,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,ie)):(e.openBlock(),e.createElementBlock("svg",ce,se))],2)],8,le)]),e.createElementVNode("div",de,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",me,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,pe)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(m.default),e.markRaw(p.default);var ye=n.SchemaFormFactory([u.default({})]),ge={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ke=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ye},props:{isLogin:{type:Boolean,default:!0},isPhoneMasked:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1},isTrackAfterSuccessOnlinePurchase:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var a=e.useSlots(),l=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),u=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),w=e.ref("new"),S=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),L=e.ref(""),M=e.ref(null),P=e.ref(!1),F=e.getCurrentInstance(),O=e.computed((function(){var e=u.value.reduce((function(e,t){return e+(t.attributes.loyalty?t.attributes.loyalty.points*t.quantity:0)}),0);return{points:e,name:t.pluralize(e,__("shop.pluralize.points"))}})),H=e.ref(""),q=e.ref(!1),$=e.computed((function(){return t.numberFormat(y.value.loyalty_points-(q.value?H.value:0))})),U=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),z=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),R=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(R,(function(e){e.length>1e3&&(R.value=R.value.substring(0,1e3))}));var A=function(t,o){return e.computed({get:function(){return y.value[t]?y.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(y.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",A);var j=e.ref({last_name:A("last_name"),middle_name:A("middle_name"),name:A("name"),email:A("email"),phone:A("phone"),registration_number:A("registration_number"),company_name:A("company_name"),user_type:A("user_type","individual")});e.provide("user",j),i.dispatch("auth/me",{finally:function(){}});var W=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),J=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),I=e.computed((function(){return W.value?B.value.find((function(e){return e.id==W.value})):{}})),G=e.computed((function(){return J.value?C.value.find((function(e){return e.id==J.value})):{}})),K=e.computed((function(){return ee(B.value,W.value)})),Q=e.computed((function(){return ee(C.value,J.value)})),X=e.computed((function(){return te(B.value)})),Y=e.computed((function(){return te(C.value)})),Z=e.computed((function(){var e=[];return u.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),ee=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},te=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&W.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(W.value)),o&&J.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(J.value)),o&&n.categories&&n.categories.length&&(o=!Z.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===j.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},oe=e.computed((function(){var e=0;return u.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(w,(function(e){"login"==e&&i.commit("auth/modal","login")}));var ne={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:m.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:m.default,label:__("auth.registration.form.phone"),model:"phone",type:"phone"},registration_number:{component:m.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:m.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:m.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}};r.isPhoneMasked&&(ne.phone.mask="(###) ###-##-##");var re=Object.keys(ne).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ne[t]),e}),{});re=r.userFields.reduce((function(e,t){return e[t]=re[t],e}),{});var ae=e.ref(re);n.useSchemaForm(j);var le={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:r.isPhoneMasked?v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")):v.string().required(__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required(__("auth.validation.required"))}))},ie=Object.keys(le).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=le[t]),e}),{}),ce=v.object().shape(ie);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var se=fe((function(){return function(e){var t=e();if(t&&t.then)return t.then(he)}((function(){if("function"==typeof de.value)return ve(de.value(),(function(e){S.value&&S.value.click(),ce.isValid(j.value).then((function(t){g.value=t&&J.value&&U.value&&W.value&&(!I.value.component||I.value.component&&D.value[I.value.code]&&D.value[I.value.code].isValid)&&e}))}))}))})),de=e.ref(null);e.provide("shippingComponentValid",de);var ue=e.ref({});e.provide("shippingComponentUserData",ue);var me=e.ref(!1),pe=function(e){_.value=!0,E.value=e,document.querySelector("html").classList.add("is-checkout-thanks"),ke()},ye=fe((function(){var t="function"==typeof de.value?de.value():null;return I.value&&!I.value.component&&(t=!0),ce.isValid(j.value).then((function(o){if(o)if(W.value)if(!I.value.component||D.value[I.value.code]&&D.value[I.value.code].isValid)if(t)if(J.value)if(U.value){var n,a=D.value[I.value.code]?JSON.parse(JSON.stringify(D.value[I.value.code])):{};delete a.isValid;var c=JSON.parse(JSON.stringify(ue.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var d={checkout:!0,user:{last_name:j.value.last_name,middle_name:j.value.middle_name,name:j.value.name,phone:j.value.phone,email:j.value.email,user_type:j.value.user_type,registration_number:j.value.registration_number,company_name:j.value.company_name},shipping:{id:W.value,data:a,user:c},payment:{id:J.value},comment:R.value,dontcall:z.value,promoCode:L.value,loyalty:H.value,clientId:n};s.value=!0,$http.post(window.location.href,d).then((function(t){if(t.data&&t.data.error&&t.data.message)l(t.data.message,{type:"error"});else{var o=[];u.value.forEach((function(e){var t={item_name:e.name,item_id:e.attributes.code,price:e.price,quantity:e.quantity};e.attributes.brand&&(t.item_brand=e.attributes.brand),e.attributes.property&&(t.item_variant=e.attributes.property),e.attributes.categoryFull&&(-1!==e.attributes.categoryFull.indexOf("/")?e.attributes.categoryFull.split("/").forEach((function(e,o){t["item_category"+(o?o+1:"")]=e.trim()})):t.item_category=e.attributes.categoryFull),e.attributes.index&&(t.index=e.attributes.index),e.attributes.itemListName&&(t.item_list_name=e.attributes.itemListName),o.push(t)}));var n={payment_type:G.value.name,shipping_tier:I.value.name,ecommerce:{transaction_id:t.data.order.id,affiliation:"main",value:parseFloat(h.value),shipping:0,currency:"UAH",items:o},event:"purchase"};j.value.user_type&&(n.user_type=__("auth.registration.form.user_type_"+j.value.user_type)),L.value&&(n.ecommerce.coupon=L.value),r.isTrackAfterSuccessOnlinePurchase&&(t.data.redirect||t.data.payment_widget_data&&window.Wayforpay)?localStorage.setItem("ecommerce",JSON.stringify(n)):($env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){k.value.submit()}),400)}))),t.data.payment_widget_data&&window.Wayforpay?function(e,t){var o=new Wayforpay;window.addEventListener("message",(function(e){"WfpWidgetEventClose"==e.data||"WfpWidgetEventDeclined"==e.data||e.data,"WfpWidgetEventApproved"==e.data&&(pe(t),me.value=!0,i.dispatch("cart/clear",{finally:function(){}}))})),o.run(e)}(JSON.parse(t.data.payment_widget_data),t.data.order):pe(t.data.order)}})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else w.value="new",S.value.click(),l(__("shop.order.validate_user"),{type:"error"})})),ve()})),ke=function(){i.commit("checkout/reset"),i.commit("cart/clear")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(u.value.forEach((function(t){var o={item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),quantity:t.quantity};t.attributes.brand&&(o.item_brand=t.attributes.brand),t.attributes.property&&(o.item_variant=t.attributes.property),t.attributes.categoryFull&&(-1!==t.attributes.categoryFull.indexOf("/")?t.attributes.categoryFull.split("/").forEach((function(e,t){o["item_category"+(t?t+1:"")]=e.trim()})):o.item_category=t.attributes.categoryFull),t.attributes.index&&(o.index=t.attributes.index),t.attributes.itemListName&&(o.item_list_name=t.attributes.itemListName),e.push(o)})),e.length){var t={ecommerce:{currency:"UAH",items:e,value:parseFloat(h.value)},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:w,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){w.value="new"},quantity:d,items:u,loading:s,pluralize:t.pluralize,discount:oe,total:h,shipping:W,shippingPrice:K,payment:J,fee:Q,userValidation:ce,userSchema:ae,userSubmitButton:S,checkout:ye,ifCheckoutReady:g,validate:se,shippingTypesRestricted:X,paymentMethodsRestricted:Y,toggleShippingRadio:function(e){W.value===e&&(W.value=null)},togglePaymentRadio:function(e){J.value===e&&(J.value=null)},shippingSelected:I,paymentSelected:G,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:ke,user:j,dontcall:z,comment:R,isCommentToggled:T,commentMaxLength:1e3,userCheckout:y,thanks:_,order:E,redirect:b,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){L.value&&(P.value=!0,$http.post(window.location.href,{promoCodeApply:L.value,email:j.value.email,total:h.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ge,props:{message:__("shop.order.promo.error_"+e.error,{number:F.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(L.value="")})),M.value=null)})).finally((function(){P.value=!1})))},promoCode:L,isPromoLoading:P,promoCodeApplied:M,resetPromoCode:function(){L.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+Q.value+K.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N,slots:a,isPayed:me,loyalty:O,loyaltyUse:H,loyaltyUseApplied:q,resetLoyaltyUse:function(){H.value=0,q.value=!1},applyLoyaltyUse:function(){H.value&&(q.value=!0)},readableUserLoyaltyPoints:$}}}),_e={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},be={class:"checkout-title"},Be={class:"columns"},Ce={class:"column checkout-blocks-wrapper"},we={class:"checkout-block is-cart"},Se={class:"wrapper"},De={class:"title-row"},Te={class:"items-title"},xe=["textContent"],Le=e.createTextVNode(" "),Me=["innerHTML"],Pe=["onClick"],Fe=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},He={class:"wrapper"},qe={class:"items-title"},$e={key:0,class:"user-tabs"},Ue={class:"columns"},ze={class:"column user-form"},Re={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Ae={key:0,class:"column user-login user-form"},je={key:1,class:"column"},We={key:0,class:"social-auth"},Je={class:"socials"},Ie={class:"description"},Ge={class:"buttons"},Ke=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Qe=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Xe={class:"checkout-block is-shipping"},Ye={class:"wrapper shipping-type-block"},Ze={class:"rows"},et={class:"item"},tt={class:"row"},ot={class:"info"},nt={class:"items-title mb-1"},rt={key:0,class:"value"},at={class:"next-dates"},lt={class:"row"},it={class:"info"},ct=["value","onClick"],st=["src"],dt={key:1,class:"icon"},ut=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],mt={key:0,class:"description"},pt={class:"value"},vt={key:0,class:"green"},ht=["innerHTML"],ft={key:0},yt={key:0,class:"checkout-block is-payment"},gt={class:"wrapper payment-method-block"},kt={class:"rows"},_t={class:"item"},Et={class:"row"},Vt={class:"info"},Nt={class:"items-title mb-1"},bt={class:"info"},Bt=["value","onClick"],Ct={key:0,class:"description"},wt={key:0,class:"value"},St=["innerHTML"],Dt={class:"column is-4"},Tt={class:"checkout-block summary"},xt={key:0,class:"inner payment-method-block"},Lt={class:"rows"},Mt={class:"item"},Pt={class:"row"},Ft={class:"info"},Ot={class:"items-title mb-1"},Ht={class:"info"},qt=["value","onClick"],$t={key:0,class:"description"},Ut={key:0,class:"value"},zt=["innerHTML"],Rt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),At={class:"inner"},jt={class:"items-title"},Wt={class:"rows"},Jt={class:"row products"},It={class:"info"},Gt=["textContent"],Kt={class:"value"},Qt=["innerHTML"],Xt={key:0,class:"row discount"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:1,class:"row fee"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],ao={key:2,class:"row shipping"},lo={class:"info"},io={class:"value"},co=["innerHTML"],so={key:1,class:"green"},uo={key:3,class:"row promo"},mo={class:"info"},po=e.createElementVNode("br",null,null,-1),vo={class:"green"},ho={class:"value"},fo=["innerHTML"],yo={class:"row price"},go={class:"info"},ko={class:"value orange"},_o=["innerHTML"],Eo={key:0,class:"user-loyalty"},Vo={class:"notice"},No={class:"user-form is-loyalty-use"},bo={class:"control"},Bo=["disabled"],Co=["disabled"],wo={class:"checkbox-wrapper nocall"},So={key:1,class:"consent"},Do={class:"checkbox-wrapper"},To=["innerHTML"],xo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Lo={class:"user-form is-promo-code"},Mo={class:"control"},Po=["disabled"],Fo={class:"label",for:"promo-code-applied"},Oo=["disabled"],Ho=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),qo={class:"user-form"},$o={key:0,class:"chars-count"},Uo={key:2,class:"checkout-block thanks"},zo={class:"title"},Ro={class:"columns"},Ao={key:0,class:"column is-6"},jo={class:"subtitle"},Wo={key:1,class:"column is-6"},Jo={class:"column is-6"},Io={key:0,class:"info-wrapper"},Go={class:"title"},Ko={class:"columns"},Qo=["innerHTML"],Xo=["innerHTML"],Yo={key:1,class:"info-wrapper"},Zo={class:"title"},en={class:"columns"},tn=["innerHTML"],on=["innerHTML"],nn={key:2,class:"info-wrapper"},rn={class:"title"},an={class:"columns"},ln={class:"column is-6"},cn=["innerHTML"],sn={key:3,class:"checkout-block empty"},dn={class:"title"},un={class:"message"},mn=["href"],pn=e.createTextVNode(", "),vn=e.createElementVNode("br",null,null,-1),hn=["href"];ke.render=function(t,o,n,r,a,l){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",_e,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",be,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",we,[e.createCommentVNode("items"),e.createElementVNode("div",Se,[e.createElementVNode("div",De,[e.createElementVNode("div",Te,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,xe),Le,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Me)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[Fe,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Pe)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",He,[e.createElementVNode("div",qe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Ue,[e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Re,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",je,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Je,[e.createElementVNode("div",Ie,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Ge,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ke),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Qe)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",at,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",lt,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,ct),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,st)):(e.openBlock(),e.createElementBlock("svg",dt,ut)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",mt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",pt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,ht))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ft,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[e.createElementVNode("div",Nt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",bt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Bt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ct,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",wt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,St)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Pt,[e.createElementVNode("div",Ft,[e.createElementVNode("div",Ot,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Ht,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,qt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",$t,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Ut,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,zt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Rt,e.createElementVNode("div",At,[e.createElementVNode("div",jt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Wt,[e.createElementVNode("div",Jt,[e.createElementVNode("div",It,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Gt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Qt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",no,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,ro)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("div",lo,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",io,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,co)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",so,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",mo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),po,e.createElementVNode("span",vo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,fo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",yo,[e.createElementVNode("div",go,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",ko,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,_o)])])]),e.renderSlot(t.$slots,"loyalty",{loyalty:t.loyalty}),t.userCheckout.loyalty_points>0?(e.openBlock(),e.createElementBlock("div",Eo,[e.createElementVNode("div",Vo,e.toDisplayString(t.pluralize(t.readableUserLoyaltyPoints,t.__("shop.pluralize.points")))+" в наявності",1),e.createElementVNode("div",No,[e.createElementVNode("div",bo,[e.withDirectives(e.createElementVNode("input",{type:"number",class:"input",placeholder:"Сума бонусів","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.loyaltyUse=e}),disabled:t.loyaltyUseApplied},null,8,Bo),[[e.vModelText,t.loyaltyUse]])]),t.loyaltyUseApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button is-reset",onClick:o[12]||(o[12]=function(){return t.resetLoyaltyUse&&t.resetLoyaltyUse.apply(t,arguments)})},"Відмінити")):(e.openBlock(),e.createElementBlock("button",{key:0,class:"button",onClick:o[11]||(o[11]=function(){return t.applyLoyaltyUse&&t.applyLoyaltyUse.apply(t,arguments)}),disabled:!t.loyaltyUse||t.loyaltyUse>t.userCheckout.loyalty_points},"Використати",8,Co))])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",wo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[14]||(o[14]=function(){return t.checkout&&t.checkout.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),3),e.renderSlot(t.$slots,"submit",{total:t.total}),t.isConsent?(e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("div",Do,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,To)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[16]||(o[16]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),xo]),e.createElementVNode("div",Lo,[e.createElementVNode("div",Mo,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[17]||(o[17]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,Po),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Fo,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[19]||(o[19]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[18]||(o[18]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,Oo))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[20]||(o[20]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),Ho]),e.createElementVNode("div",qo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[21]||(o[21]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",$o,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Uo,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",zo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.isPayed?t.__("shop.order.payed"):t.__("shop.order.success")),1)]),e.createElementVNode("div",Ro,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("div",jo,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[22]||(o[22]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("button",{class:"button is-orange",onClick:o[23]||(o[23]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",Jo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Io,[e.createElementVNode("div",Go,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ko,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Qo)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,Xo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Yo,[e.createElementVNode("div",Zo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",en,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,tn)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,on)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",nn,[e.createElementVNode("div",rn,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",an,[e.createElementVNode("div",ln,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,cn)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",dn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",un,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,mn),pn,vn,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,hn)]))])},module.exports=ke;
2
2
  //# sourceMappingURL=Checkout.js.map