{"version":3,"sources":["webpack:///./src/pages/shop/order-detail.vue?7e14","webpack:///./src/pages/shop/order-detail.vue","webpack:///./src/domain/services/order-service.js","webpack:///src/pages/shop/order-detail.vue","webpack:///./src/pages/shop/order-detail.vue?215c","webpack:///./src/pages/shop/order-detail.vue?9937"],"names":["render","_vm","this","_c","_self","order","staticClass","_v","_s","$tr","timeFormat","createdAt","status","class","style","text","_e","paid","id","_l","orderItems","item","index","key","name","priceRub","count","isOrderItemAvailable","orderItemStatusText","staticStyle","attrs","formStore","on","providerChange","model","value","paymentMethod","callback","$$v","$set","expression","paymentMethods","idx","translateProviders","store","isShopClosedByTime","alertStatus","alertInfo","cost","cancelOrder","isPaymentAvailable","payment","confirmation","file","base_url","path","orderCancel","slot","cancel","ok","staticRenderFns","OrderService","providers","reduce","provider","settings","data","loading","computed","isAllItemsAvailable","created","methods","console","component"],"mappings":"wIAAA,W,yCCAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAQF,EAAII,MAAOF,EAAG,MAAM,CAACG,YAAY,gBAAgB,CAACH,EAAG,MAAM,CAACG,YAAY,gCAAgC,CAACH,EAAG,MAAM,CAACG,YAAY,sBAAsB,CAACH,EAAG,MAAM,CAACG,YAAY,4BAA4B,CAACL,EAAIM,GAAG,IAAIN,EAAIO,GAAGP,EAAIQ,IAAI,eAAe,MAAMN,EAAG,MAAM,CAACG,YAAY,sBAAsB,CAACL,EAAIM,GAAG,IAAIN,EAAIO,GAAGP,EAAIS,YAAYT,EAAII,MAAMM,YAAY,SAASR,EAAG,MAAM,CAACG,YAAY,8BAA8B,CAAEL,EAAII,MAAMO,OAAQT,EAAG,MAAM,CAACG,YAAY,8BAA8BO,MAAO,cAAaZ,EAAIW,OAAOX,EAAII,MAAMO,QAAQE,OAAS,CAACb,EAAIM,GAAG,IAAIN,EAAIO,GAAGP,EAAIW,OAAOX,EAAII,MAAMO,QAAQG,MAAM,OAAOd,EAAIe,KAAM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BACA,iCACA,oBAEA/B,UAEA,qBACA,CAAAG,uCAAAD,eACA,cACA,CAAAC,sCAAAD,sBADA,GAIAG,QACA,SACA,CAAAF,oCAAAD,iBAEA,CAAAC,sCAAAD,gBAGAmB,iBACA,IACA,4DACA,SACAuC,mBAIAvB,cACA,qBAEA,WACA,mCACA,2CACA,oBACA,oEACA,kBACA,iBAAAM,+CAGAG,SACA,qBAEA/B,wBACA,wBACA,SACA,+BACA,SACA,8BACA,SAGA,2DAEAC,uBACA,wBACA,kCACA,+BACA,yCACA,8BACA,wCAGA,2DAEA,qBAEA,UACA,aACA,0CACA,+BACA,4BAEA,SACA4C,uBACA,qBAAAjB,gBAGA,6BACA,mCAEA,sBACA,cAAAJ,SAAA,iCACA,gBAGA,kBACA,YAAA9C,SAAA,6BACA,cAGA,sBACA,+CACA,4CAGA,iBACA,sDCzUqW,I,wBCQjWoE,EAAY,eACd,EACAzE,EACA4D,GACA,EACA,KACA,KACA,MAIa,aAAAa,E","file":"js/orders-detail.707068a1.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/style-resources-loader/lib/index.js??ref--9-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./order-detail.vue?vue&type=style&index=0&id=3492d4f8&prod&lang=scss&\"","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.order)?_c('div',{staticClass:\"order-detail\"},[_c('div',{staticClass:\"order-detail__content s-card\"},[_c('div',{staticClass:\"order-detail__info\"},[_c('div',{staticClass:\"order-detail__date-block\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.date'))+\": \"),_c('div',{staticClass:\"order-detail__date\"},[_vm._v(\" \"+_vm._s(_vm.timeFormat(+_vm.order.createdAt))+\" \")])]),_c('div',{staticClass:\"order-detail__informer-tag\"},[(_vm.order.status)?_c('div',{staticClass:\"order-detail__tag order-tag\",class:`order-tag--${_vm.status(_vm.order.status).style}`},[_vm._v(\" \"+_vm._s(_vm.status(_vm.order.status).text)+\" \")]):_vm._e(),(_vm.order)?_c('div',{staticClass:\"order-detail__tag order-tag\",class:`order-tag--${_vm.paid(_vm.order.paid).style}`},[_vm._v(\" \"+_vm._s(_vm.paid(_vm.order.paid).text)+\" \")]):_vm._e()])]),_c('h3',{staticClass:\"order-detail__sub-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.compositionOrder'))+\" № \"+_vm._s(_vm.order.id)+\" \")]),_c('div',{staticClass:\"order-detail__orders\"},_vm._l((_vm.order.orderItems),function(item,index){return _c('div',{key:index,staticClass:\"order-detail__item order-item\"},[_c('div',{staticClass:\"order-item__table\"},[_c('div',{staticClass:\"order-item__row\"},[_c('div',{staticClass:\"order-item__head-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.orderCard.name'))+\" \")]),_c('div',{staticClass:\"order-item__content-title\"},[_vm._v(\" \"+_vm._s(item.item.name)+\" \")])]),_c('div',{staticClass:\"order-item__row\"},[_c('div',{staticClass:\"order-item__head-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.orderCard.price'))+\" \")]),_c('div',{staticClass:\"order-item__content-title\"},[_vm._v(\" \"+_vm._s(item.item.priceRub)+\" ₽ \")])]),_c('div',{staticClass:\"order-item__row\"},[_c('div',{staticClass:\"order-item__head-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.orderCard.quantity'))+\" \")]),_c('div',{staticClass:\"order-item__content-title\"},[_vm._v(\" \"+_vm._s(item.count)+\" \")])]),_c('div',{staticClass:\"order-item__row\"},[_c('div',{staticClass:\"order-item__head-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.orderCard.available'))+\" \")]),_c('div',{staticClass:\"order-item__content-title\"},[(_vm.isOrderItemAvailable(item.status))?[_vm._v(\" \"+_vm._s(_vm.orderItemStatusText(item.status))+\" \")]:[_c('span',{staticStyle:{\"color\":\"var(--s-warning-color-darker)\"}},[_vm._v(\" \"+_vm._s(_vm.orderItemStatusText(item.status))+\" \")])]],2)])])])}),0),_c('h3',{staticClass:\"order-detail__sub-title\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.paymentOrder'))+\" \")]),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-8 col-md-12\"},[_c('Form',{attrs:{\"model\":_vm.formStore,\"label-position\":\"top\"}},[_c('FormItem',{staticClass:\"order-detail__custom-item-form\",attrs:{\"label\":_vm.$tr('order.selectLabel')}},[_c('Select',{attrs:{\"disabled\":_vm.order.paid || _vm.order.status === 'canceled',\"placeholder\":_vm.$tr('order.selectPlaceholder')},on:{\"on-change\":_vm.providerChange},model:{value:(_vm.formStore.paymentMethod),callback:function ($$v) {_vm.$set(_vm.formStore, \"paymentMethod\", $$v)},expression:\"formStore.paymentMethod\"}},_vm._l((_vm.paymentMethods),function(item,idx){return _c('Option',{key:idx,attrs:{\"value\":item}},[_vm._v(\" \"+_vm._s(_vm.translateProviders(item))+\" \")])}),1)],1)],1)],1)]),(_vm.store && _vm.isShopClosedByTime)?_c('Alert',{attrs:{\"type\":_vm.alertStatus,\"banner\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.alertInfo)+\" \")]):_vm._e()],1),_c('div',{staticClass:\"order-detail__footer\"},[_c('div',{staticClass:\"order-detail__sum\"},[_vm._v(\" \"+_vm._s(_vm.$tr('order.orderPrice'))+\": \"),_c('div',{staticClass:\"order-detail__price\"},[_vm._v(_vm._s(_vm.order.cost)+\" ₽\")])]),_c('div',{staticClass:\"order-detail__footer-btn\"},[(_vm.order.status !== 'canceled' && !_vm.order.paid)?_c('Button',{attrs:{\"size\":\"large\"},on:{\"click\":_vm.cancelOrder}},[_vm._v(\" \"+_vm._s(_vm.$tr('order.btn.canceled'))+\" \")]):_vm._e(),(_vm.isPaymentAvailable && _vm.payment.confirmation)?_c('Button',{attrs:{\"to\":`${_vm.payment.confirmation}`,\"type\":\"primary\",\"size\":\"large\",\"target\":\"_blank\"}},[_vm._v(\" \"+_vm._s(_vm.$tr('order.btn.payment'))+\" \")]):(_vm.isPaymentAvailable && _vm.payment.file)?_c('Button',{attrs:{\"to\":`${_vm.payment.file.base_url}${_vm.payment.file.path}`,\"type\":\"primary\",\"size\":\"large\",\"target\":\"_blank\"}},[_vm._v(\" \"+_vm._s(_vm.$tr('order.btn.invoice'))+\" \")]):_vm._e()],1)]),_c('Modal',{staticClass:\"order-detail__modal-cancel\",attrs:{\"title\":_vm.$tr('order.modalCanceledOrder.title'),\"width\":\"480\"},model:{value:(_vm.orderCancel),callback:function ($$v) {_vm.orderCancel=$$v},expression:\"orderCancel\"}},[_c('p',[_vm._v(\" \"+_vm._s(_vm.$tr('order.modalCanceledOrder.text'))+\" \"),_c('span',{staticClass:\"order-detail__order-id\"},[_vm._v(_vm._s(_vm.$tr('order.modalCanceledOrder.order'))+\" №\"+_vm._s(_vm.order.id))]),_vm._v(\" ? \")]),_c('div',{attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('Button',{on:{\"click\":_vm.cancel}},[_vm._v(\" \"+_vm._s(_vm.$tr('order.modalCanceledOrder.btn.close'))+\" \")]),_c('Button',{attrs:{\"type\":\"error\"},on:{\"click\":_vm.ok}},[_vm._v(\" \"+_vm._s(_vm.$tr('order.modalCanceledOrder.btn.yes'))+\" \")])],1)])],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default class OrderService {\n  /**\n   * Возвращает список методов оплаты\n   * @param {array} providers\n   * @return string[]\n   */\n  static getPaymentMethods(providers) {\n    return providers.reduce(\n      (providers, provider) => [\n        ...providers,\n        ...provider.settings.paymentMethods,\n      ],\n      [],\n    )\n  }\n}\n","<template>\n  <div v-if=\"order\" class=\"order-detail\">\n    <div class=\"order-detail__content s-card\">\n      <div class=\"order-detail__info\">\n        <div class=\"order-detail__date-block\">\n          {{ $tr('order.date') }}:\n          <div class=\"order-detail__date\">\n            <!--            todo: разобраться с форматами-->\n            {{ timeFormat(+order.createdAt) }}\n          </div>\n        </div>\n        <div class=\"order-detail__informer-tag\">\n          <div\n            v-if=\"order.status\"\n            :class=\"`order-tag--${status(order.status).style}`\"\n            class=\"order-detail__tag order-tag\"\n          >\n            {{ status(order.status).text }}\n          </div>\n          <div\n            v-if=\"order\"\n            :class=\"`order-tag--${paid(order.paid).style}`\"\n            class=\"order-detail__tag order-tag\"\n          >\n            {{ paid(order.paid).text }}\n          </div>\n        </div>\n      </div>\n      <h3 class=\"order-detail__sub-title\">\n        {{ $tr('order.compositionOrder') }} № {{ order.id }}\n      </h3>\n      <div class=\"order-detail__orders\">\n        <div\n          v-for=\"(item, index) in order.orderItems\"\n          :key=\"index\"\n          class=\"order-detail__item order-item\"\n        >\n          <div class=\"order-item__table\">\n            <div class=\"order-item__row\">\n              <div class=\"order-item__head-title\">\n                {{ $tr('order.orderCard.name') }}\n              </div>\n              <div class=\"order-item__content-title\">\n                {{ item.item.name }}\n              </div>\n            </div>\n            <div class=\"order-item__row\">\n              <div class=\"order-item__head-title\">\n                {{ $tr('order.orderCard.price') }}\n              </div>\n              <div class=\"order-item__content-title\">\n                {{ item.item.priceRub }} ₽\n              </div>\n            </div>\n            <div class=\"order-item__row\">\n              <div class=\"order-item__head-title\">\n                {{ $tr('order.orderCard.quantity') }}\n              </div>\n              <div class=\"order-item__content-title\">\n                {{ item.count }}\n              </div>\n            </div>\n            <div class=\"order-item__row\">\n              <div class=\"order-item__head-title\">\n                {{ $tr('order.orderCard.available') }}\n              </div>\n              <div class=\"order-item__content-title\">\n                <template v-if=\"isOrderItemAvailable(item.status)\">\n                  {{ orderItemStatusText(item.status) }}\n                </template>\n                <template v-else>\n                  <span style=\"color: var(--s-warning-color-darker)\">\n                    {{ orderItemStatusText(item.status) }}\n                  </span>\n                </template>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n      <h3 class=\"order-detail__sub-title\">\n        {{ $tr('order.paymentOrder') }}\n      </h3>\n      <div class=\"row\">\n        <div class=\"col-lg-8 col-md-12\">\n          <Form :model=\"formStore\" label-position=\"top\">\n            <FormItem\n              :label=\"$tr('order.selectLabel')\"\n              class=\"order-detail__custom-item-form\"\n            >\n              <Select\n                v-model=\"formStore.paymentMethod\"\n                :disabled=\"order.paid || order.status === 'canceled'\"\n                :placeholder=\"$tr('order.selectPlaceholder')\"\n                @on-change=\"providerChange\"\n              >\n                <Option\n                  v-for=\"(item, idx) in paymentMethods\"\n                  :key=\"idx\"\n                  :value=\"item\"\n                >\n                  {{ translateProviders(item) }}\n                </Option>\n              </Select>\n            </FormItem>\n          </Form>\n        </div>\n      </div>\n      <Alert v-if=\"store && isShopClosedByTime\" :type=\"alertStatus\" banner>\n        {{ alertInfo }}\n      </Alert>\n    </div>\n    <div class=\"order-detail__footer\">\n      <div class=\"order-detail__sum\">\n        {{ $tr('order.orderPrice') }}:\n        <div class=\"order-detail__price\">{{ order.cost }} ₽</div>\n      </div>\n      <div class=\"order-detail__footer-btn\">\n        <Button\n          v-if=\"order.status !== 'canceled' && !order.paid\"\n          size=\"large\"\n          @click=\"cancelOrder\"\n        >\n          {{ $tr('order.btn.canceled') }}\n        </Button>\n        <Button\n          v-if=\"isPaymentAvailable && payment.confirmation\"\n          :to=\"`${payment.confirmation}`\"\n          type=\"primary\"\n          size=\"large\"\n          target=\"_blank\"\n        >\n          {{ $tr('order.btn.payment') }}\n        </Button>\n        <Button\n          v-else-if=\"isPaymentAvailable && payment.file\"\n          :to=\"`${payment.file.base_url}${payment.file.path}`\"\n          type=\"primary\"\n          size=\"large\"\n          target=\"_blank\"\n        >\n          {{ $tr('order.btn.invoice') }}\n        </Button>\n      </div>\n    </div>\n    <Modal\n      v-model=\"orderCancel\"\n      :title=\"$tr('order.modalCanceledOrder.title')\"\n      class=\"order-detail__modal-cancel\"\n      width=\"480\"\n    >\n      <p>\n        {{ $tr('order.modalCanceledOrder.text') }}\n        <span class=\"order-detail__order-id\"\n          >{{ $tr('order.modalCanceledOrder.order') }} №{{ order.id }}</span\n        >\n        ?\n      </p>\n      <div slot=\"footer\">\n        <Button @click=\"cancel\">\n          {{ $tr('order.modalCanceledOrder.btn.close') }}\n        </Button>\n        <Button type=\"error\" @click=\"ok\">\n          {{ $tr('order.modalCanceledOrder.btn.yes') }}\n        </Button>\n      </div>\n    </Modal>\n  </div>\n</template>\n\n<script>\nimport useShop from '@/domain/composables/shop/use-shop'\nimport { timeFormat } from '@/utils'\nimport {\n  TIME_STATUSES,\n  ENUM_PRODUCT_STATUS,\n  ENUM_PRODUCT_STATUS_I18N,\n} from '@/utils/constants'\nimport { mapGetters } from 'vuex'\nimport LangService from '@/domain/services/lang-service'\nimport ShopService from '@/domain/services/shop-service'\nimport OrderService from '@/domain/services/order-service'\n\nexport default {\n  data() {\n    return {\n      formStore: {\n        provider: '',\n      },\n      payment: null,\n      orderCancel: false,\n      loading: false,\n      order: null,\n      paymentMethods: [],\n      store: null,\n    }\n  },\n  computed: {\n    ...mapGetters('shop', ['shopId']),\n    alertInfo() {\n      return ShopService.getShopDateStatusMessage(this.$i18n.locale, this.store)\n    },\n    alertStatus() {\n      if (this.store.sellingTimeStatus === TIME_STATUSES.ENDED) {\n        return 'warning'\n      }\n      return 'success'\n    },\n    isShopClosedByTime() {\n      return this.store.sellingTimeStatus === TIME_STATUSES.ENDED\n    },\n    isAllItemsAvailable() {\n      if (!this.order && !this.order.orderItems) {\n        return false\n      }\n\n      return this.order.orderItems.every((item) =>\n        this.isOrderItemAvailable(item.status),\n      )\n    },\n    isPaymentAvailable() {\n      return (\n        this.payment &&\n        this.store.sellingTimeStatus === TIME_STATUSES.IN_PROGRESS &&\n        this.isAllItemsAvailable\n      )\n    },\n  },\n  created() {\n    this.getOrderData()\n  },\n  methods: {\n    timeFormat,\n    translateProviders(paymentMethod) {\n      const key = `order.providerTypes.${paymentMethod}`\n      return this.$tr(key)\n    },\n    status(status) {\n      // todo: статусы  в константы\n      if (status === 'canceled') {\n        return { text: this.$tr('order.status.canceled'), style: 'error' }\n      } else if (status === 'created') {\n        return { text: this.$tr('order.status.created'), style: 'success' }\n      }\n    },\n    paid(status) {\n      if (status) {\n        return { text: this.$tr('order.payment.paid'), style: 'success' }\n      } else {\n        return { text: this.$tr('order.payment.unpaid'), style: 'error' }\n      }\n    },\n    providerChange() {\n      try {\n        this.getPayment(this.order.id, this.formStore.paymentMethod)\n      } catch (e) {\n        console.error(e)\n      }\n    },\n\n    cancelOrder() {\n      this.orderCancel = true\n    },\n    async ok() {\n      this.order.status = 'canceled'\n      await this.orderUpdate(this.order.id, this.order)\n      this.orderCancel = false\n      this.$Message.success(this.$tr('order.alerts.canceledOrder'))\n      await this.$router.push(\n        this.localePath({ path: `/event/${this.store.eventId}/orders` }),\n      )\n    },\n    cancel() {\n      this.orderCancel = false\n    },\n    isOrderItemAvailable(status) {\n      if (status === ENUM_PRODUCT_STATUS.AVAILABLE) {\n        return true\n      } else if (status === ENUM_PRODUCT_STATUS.SELLING_IS_CLOSE) {\n        return false\n      } else if (status === ENUM_PRODUCT_STATUS.RATE_IS_BLOCKED) {\n        return false\n      }\n\n      throw new Error(`Неизвестный статус элемента заказа: ${status}`)\n    },\n    orderItemStatusText(status) {\n      if (status === ENUM_PRODUCT_STATUS.AVAILABLE) {\n        return this.$tr(ENUM_PRODUCT_STATUS_I18N.AVAILABLE)\n      } else if (status === ENUM_PRODUCT_STATUS.SELLING_IS_CLOSE) {\n        return this.$tr(ENUM_PRODUCT_STATUS_I18N.SELLING_IS_CLOSE)\n      } else if (status === ENUM_PRODUCT_STATUS.RATE_IS_BLOCKED) {\n        return this.$tr(ENUM_PRODUCT_STATUS_I18N.RATE_IS_BLOCKED)\n      }\n\n      throw new Error(`Неизвестный статус элемента заказа: ${status}`)\n    },\n    async getOrderData() {\n      // todo: если пользователь сделал заказ в эту сессию - заказ брать из vuex\n      try {\n        await Promise.all([\n          this.getOrder(this.$route.params.orderId),\n          this.getProviders(this.shopId),\n          this.getShop(this.shopId),\n        ])\n      } catch (e) {\n        console.error(e)\n        await LangService.toLocalePath({ path: '/404' })\n      }\n    },\n    async orderUpdate(orderId, data) {\n      await useShop().updateOrder(orderId, data)\n    },\n    async getPayment(id, type) {\n      const { payment } = await useShop().getPayment(id, type)\n      this.payment = payment\n    },\n\n    async getOrder(id) {\n      const { order } = await useShop().getOrder(id)\n      this.order = order\n    },\n\n    async getProviders(shopId) {\n      const providers = await useShop().getProviders(shopId)\n      this.paymentMethods = OrderService.getPaymentMethods(providers)\n    },\n\n    async getShop(shopId) {\n      this.store = await useShop().getEventStore(shopId)\n    },\n  },\n}\n</script>\n\n<style lang=\"scss\">\n@import '~@/styles/pages/order-detail.scss';\n@import '~@/styles/blocks/order-item.scss';\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./order-detail.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./order-detail.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./order-detail.vue?vue&type=template&id=3492d4f8&\"\nimport script from \"./order-detail.vue?vue&type=script&lang=js&\"\nexport * from \"./order-detail.vue?vue&type=script&lang=js&\"\nimport style0 from \"./order-detail.vue?vue&type=style&index=0&id=3492d4f8&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}