{"version":3,"sources":["webpack:///./src/components/Options/ModalEditOptionPrices.vue?6e64","webpack:///./src/components/Options/ModalEditOptionPrices.vue","webpack:///src/components/Options/ModalEditOptionPrices.vue","webpack:///./src/components/Options/ModalEditOptionPrices.vue?b05e","webpack:///./src/components/Options/ModalEditOptionPrices.vue?fd59","webpack:///./src/mixins/createId.js"],"names":["render","_vm","this","_c","_self","attrs","$t","isSaving","isSavingSuccess","isSavingError","onClickCancel","saveOptionPrices","showModal","on","scopedSlots","_u","key","fn","staticClass","domProps","_s","_v","_l","channelPrices","price","index","model","value","ValidFrom","callback","$$v","$set","expression","CurrencySymbol","directives","name","rawName","MaxPP","modifiers","$event","target","composing","_n","$forceUpdate","MaxTotal","PriceType","$$selectedVal","Array","prototype","filter","call","options","o","selected","map","val","_value","multiple","calculationTypes","type","Type","concat","UseManualDuration","_defineProperty","isArray","_i","$$a","$$el","$$c","checked","$$i","slice","_e","TaxPercentage","taxPercentages","taxPercentage","Deductible","Id","_q","Price","deletePrice","addPrice","proxy","staticRenderFns","Vue","use","VCalendar","components","mixins","uuidv4","props","channelId","Number","required","Boolean","default","Function","data","locationId","$route","params","mOption","newOptionPrice","dateOne","Date","dateTwo","computed","_objectSpread","mapState","channels","locationState","Channels","_this","Prices","p","ChannelId","result","TaxPercentages","t","created","cleanSource","option","push","Name","OptionId","TaxId","CurrencyId","Settings","setupPriceIndexes","methods","mapMutations","i","length","priceIndex","findIndex","splice","self","$options","filters","dateObjectIsoDateString","optionProvider","saveLocationOptionPrices","Location","LocationId","then","response","setOption","EventBus","$emit","message","catch","e","finally","component","replace","c","r","Math","random","v","toString"],"mappings":"gHAAA,W,2DCAIA,G,sEAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,uDAAuD,UAAY,QAAQ,SAAWL,EAAIM,SAAS,gBAAkBN,EAAIO,gBAAgB,cAAgBP,E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,OAAOG,EAAEC,SAAS","file":"js/chunk-16c5bc93.js?id=55187d045e1fe35b59c0","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/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalEditOptionPrices.vue?vue&type=style&index=0&id=55b1bc7b&prod&lang=scss&scoped=true\"","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.Options.ModalEditOptionPrices.Main_Title'),\"modalSize\":\"large\",\"isSaving\":_vm.isSaving,\"isSavingSuccess\":_vm.isSavingSuccess,\"isSavingError\":_vm.isSavingError,\"hideFooterButtons\":_vm.isSavingError || _vm.isSavingSuccess,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.saveOptionPrices,\"showModal\":_vm.showModal},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('table',{staticClass:\"table is-fullwidth is-striped\"},[_c('thead',[_c('tr',[_c('th',{domProps:{\"textContent\":_vm._s(\n              _vm.$t('Components.Options.ModalEditOptionPrices.Label_ValidFrom')\n            )}}),_c('th',{domProps:{\"textContent\":_vm._s(\n              _vm.$t('Components.Options.ModalEditOptionPrices.Label_MaxPP')\n            )}}),_c('th',{domProps:{\"textContent\":_vm._s(\n              _vm.$t('Components.Options.ModalEditOptionPrices.Label_MaxTotal')\n            )}}),_c('th',{domProps:{\"textContent\":_vm._s(\n              _vm.$t('Components.Options.ModalEditOptionPrices.Label_PriceType')\n            )}}),_c('th',{domProps:{\"textContent\":_vm._s(_vm.$t('Components.Options.ModalEditOptionPrices.Label_Vat'))}}),_c('th',{domProps:{\"textContent\":_vm._s(_vm.$t('Components.Options.ModalEditOptionPrices.Label_Deductible'))}}),_c('th',{domProps:{\"textContent\":_vm._s(\n              _vm.$t('Components.Options.ModalEditOptionPrices.Label_Price')\n            )}}),_c('th',[_vm._v(\" \")])])]),_c('tbody',_vm._l((_vm.channelPrices),function(price){return _c('tr',{key:price.index},[_c('td',[_c('ui-base-date-field',{attrs:{\"label\":\"\",\"dataFormat\":\"shortDateFormat\",\"openCalendarInModal\":true,\"inputCssClass\":\"is-small\",\"valign\":\"top\"},model:{value:(price.ValidFrom),callback:function ($$v) {_vm.$set(price, \"ValidFrom\", $$v)},expression:\"price.ValidFrom\"}})],1),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"field-price field has-addons\"},[_c('p',{staticClass:\"control\"},[_c('a',{staticClass:\"button is-static is-small\",domProps:{\"innerHTML\":_vm._s(price.CurrencySymbol)}})]),_c('p',{staticClass:\"control\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(price.MaxPP),expression:\"price.MaxPP\",modifiers:{\"number\":true}}],staticClass:\"input is-small\",attrs:{\"type\":\"text\"},domProps:{\"value\":(price.MaxPP)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(price, \"MaxPP\", _vm._n($event.target.value))},\"blur\":function($event){return _vm.$forceUpdate()}}})])])]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"field-price field has-addons\"},[_c('p',{staticClass:\"control\"},[_c('a',{staticClass:\"button is-static is-small\",domProps:{\"innerHTML\":_vm._s(price.CurrencySymbol)}})]),_c('p',{staticClass:\"control\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(price.MaxTotal),expression:\"price.MaxTotal\",modifiers:{\"number\":true}}],staticClass:\"input is-small\",attrs:{\"type\":\"text\"},domProps:{\"value\":(price.MaxTotal)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(price, \"MaxTotal\", _vm._n($event.target.value))},\"blur\":function($event){return _vm.$forceUpdate()}}})])])]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"select is-small\"},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(price.PriceType),expression:\"price.PriceType\"}],on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(price, \"PriceType\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.calculationTypes),function(type,index){return _c('option',{key:index,domProps:{\"value\":type.Type,\"selected\":type.Type === price.PriceType}},[_vm._v(\" \"+_vm._s(_vm.$t( `Components.Options.ModalEditOptionPrices.${type.Type}` ))+\" \")])}),0)]),(price.PriceType === 'PerDayPart' || price.PriceType === 'PerPersonPerDayPart')?_c('div',[_c('label',{staticClass:\"checkbox is-size-7\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(price.UseManualDuration),expression:\"price.UseManualDuration\"}],attrs:{\"type\":\"checkbox\"},domProps:{\"checked\":price.UseManualDuration,\"checked\":Array.isArray(price.UseManualDuration)?_vm._i(price.UseManualDuration,null)>-1:(price.UseManualDuration)},on:{\"change\":function($event){var $$a=price.UseManualDuration,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(price, \"UseManualDuration\", $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(price, \"UseManualDuration\", $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(price, \"UseManualDuration\", $$c)}}}}),_vm._v(\" \"+_vm._s(_vm.$t('Components.Options.ModalEditOptionPrices.Label_UseManualDuration'))+\" \")])]):_vm._e()]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"select is-small\"},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(price.TaxPercentage),expression:\"price.TaxPercentage\"}],on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(price, \"TaxPercentage\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.taxPercentages),function(taxPercentage){return _c('option',{key:taxPercentage,domProps:{\"value\":taxPercentage,\"selected\":taxPercentage === price.TaxPercentage}},[_vm._v(\" \"+_vm._s(taxPercentage)+\"% \")])}),0)])]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"control\"},[_c('label',{staticClass:\"radio\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(price.Deductible),expression:\"price.Deductible\"}],attrs:{\"type\":\"radio\",\"name\":'deductible' + price.Id},domProps:{\"checked\":price.Deductible,\"value\":true,\"checked\":_vm._q(price.Deductible,true)},on:{\"change\":function($event){return _vm.$set(price, \"Deductible\", true)}}}),_vm._v(\" \"+_vm._s(_vm.$t('General.Yes'))+\" \")]),_c('label',{staticClass:\"radio\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(price.Deductible),expression:\"price.Deductible\"}],attrs:{\"type\":\"radio\",\"name\":'deductible' + price.Id},domProps:{\"checked\":!price.Deductible,\"value\":false,\"checked\":_vm._q(price.Deductible,false)},on:{\"change\":function($event){return _vm.$set(price, \"Deductible\", false)}}}),_vm._v(\" \"+_vm._s(_vm.$t('General.No'))+\" \")])])]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('div',{staticClass:\"field-price field has-addons\"},[_c('p',{staticClass:\"control\"},[_c('a',{staticClass:\"button is-static is-small\",domProps:{\"innerHTML\":_vm._s(price.CurrencySymbol)}})]),_c('p',{staticClass:\"control\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(price.Price),expression:\"price.Price\",modifiers:{\"number\":true}}],staticClass:\"input is-small\",attrs:{\"type\":\"text\"},domProps:{\"value\":(price.Price)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(price, \"Price\", _vm._n($event.target.value))},\"blur\":function($event){return _vm.$forceUpdate()}}})])])]),_c('td',{attrs:{\"valign\":\"top\"}},[_c('a',{on:{\"click\":function($event){return _vm.deletePrice(price)}}},[_c('span',{staticClass:\"icon is-small has-text-danger\"},[_c('font-awesome-icon',{attrs:{\"icon\":['fas', 'trash-alt']}})],1)])])])}),0),_c('tfoot',[_c('tr',[_c('td',{attrs:{\"colspan\":\"8\"}},[_c('a',{staticClass:\"button is-primary\",on:{\"click\":_vm.addPrice}},[_vm._v(_vm._s(_vm.$t('Components.Options.ModalEditOptionPrices.Button_Add')))])])])])])]},proxy:true}])})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.Options.ModalEditOptionPrices.Main_Title')\"\n    modalSize=\"large\"\n    :isSaving=\"isSaving\"\n    :isSavingSuccess=\"isSavingSuccess\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"saveOptionPrices\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template v-slot:content>\n      <table class=\"table is-fullwidth is-striped\">\n        <thead>\n          <tr>\n            <th v-text=\"\n                $t('Components.Options.ModalEditOptionPrices.Label_ValidFrom')\n              \"></th>\n            <th v-text=\"\n                $t('Components.Options.ModalEditOptionPrices.Label_MaxPP')\n              \"></th>\n            <th v-text=\"\n                $t('Components.Options.ModalEditOptionPrices.Label_MaxTotal')\n              \"></th>\n            <th v-text=\"\n                $t('Components.Options.ModalEditOptionPrices.Label_PriceType')\n              \"></th>\n            <th v-text=\"$t('Components.Options.ModalEditOptionPrices.Label_Vat')\"></th>\n            <th v-text=\"$t('Components.Options.ModalEditOptionPrices.Label_Deductible')\"></th>\n            <th v-text=\"\n                $t('Components.Options.ModalEditOptionPrices.Label_Price')\n              \"></th>\n            <th>&nbsp;</th>\n          </tr>\n        </thead>\n        <tbody>\n          <tr\n            v-for=\"price in channelPrices\"\n            :key=\"price.index\"\n          >\n            <td>\n              <ui-base-date-field\n                label=\"\"\n                dataFormat=\"shortDateFormat\"\n                v-model=\"price.ValidFrom\"\n                :openCalendarInModal=\"true\"\n                inputCssClass=\"is-small\"\n                valign=\"top\"\n              />\n            </td>\n            <td valign=\"top\">\n              <div class=\"field-price field has-addons\">\n                <p class=\"control\">\n                  <a\n                    class=\"button is-static is-small\"\n                    v-html=\"price.CurrencySymbol\"\n                  ></a>\n                </p>\n                <p class=\"control\">\n                  <input\n                    type=\"text\"\n                    class=\"input is-small\"\n                    v-model.number=\"price.MaxPP\"\n                  />\n                </p>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <div class=\"field-price field has-addons\">\n                <p class=\"control\">\n                  <a\n                    class=\"button is-static is-small\"\n                    v-html=\"price.CurrencySymbol\"\n                  ></a>\n                </p>\n                <p class=\"control\">\n                  <input\n                    type=\"text\"\n                    class=\"input is-small\"\n                    v-model.number=\"price.MaxTotal\"\n                  />\n                </p>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <div class=\"select is-small\">\n                <select v-model=\"price.PriceType\">\n                  <option\n                    v-for=\"(type, index) in calculationTypes\"\n                    :key=\"index\"\n                    :value=\"type.Type\"\n                    :selected=\"type.Type === price.PriceType\"\n                  >\n                    {{\n                      $t(\n                        `Components.Options.ModalEditOptionPrices.${type.Type}`\n                      )\n                    }}\n                  </option>\n                </select>\n              </div>\n\n              <div v-if=\"price.PriceType === 'PerDayPart' || price.PriceType === 'PerPersonPerDayPart'\">\n                <label class=\"checkbox is-size-7\">\n                  <input\n                    type=\"checkbox\"\n                    v-model=\"price.UseManualDuration\"\n                    :checked=\"price.UseManualDuration\"\n                  />\n                  {{ $t('Components.Options.ModalEditOptionPrices.Label_UseManualDuration') }}\n\n                </label>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <div class=\"select is-small\">\n                <select v-model=\"price.TaxPercentage\">\n                  <option\n                    v-for=\"taxPercentage in taxPercentages\"\n                    :key=\"taxPercentage\"\n                    :value=\"taxPercentage\"\n                    :selected=\"taxPercentage === price.TaxPercentage\"\n                  >\n                    {{ taxPercentage }}%\n                  </option>\n                </select>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <div class=\"control\">\n                <label class=\"radio\">\n                  <input\n                    type=\"radio\"\n                    v-model=\"price.Deductible\"\n                    :checked=\"price.Deductible\"\n                    :value=\"true\"\n                    :name=\"'deductible' + price.Id\"\n                  />\n                  {{ $t('General.Yes') }}\n                </label>\n                <label class=\"radio\">\n                  <input\n                    type=\"radio\"\n                    v-model=\"price.Deductible\"\n                    :checked=\"!price.Deductible\"\n                    :value=\"false\"\n                    :name=\"'deductible' + price.Id\"\n                  />\n                  {{ $t('General.No') }}\n                </label>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <div class=\"field-price field has-addons\">\n                <p class=\"control\">\n                  <a\n                    class=\"button is-static is-small\"\n                    v-html=\"price.CurrencySymbol\"\n                  ></a>\n                </p>\n                <p class=\"control\">\n                  <input\n                    type=\"text\"\n                    class=\"input is-small\"\n                    v-model.number=\"price.Price\"\n                  />\n                </p>\n              </div>\n            </td>\n            <td valign=\"top\">\n              <a @click=\"deletePrice(price)\">\n                <span class=\"icon is-small has-text-danger\">\n                  <font-awesome-icon :icon=\"['fas', 'trash-alt']\" />\n                </span>\n              </a>\n            </td>\n          </tr>\n        </tbody>\n        <tfoot>\n          <tr>\n            <td colspan=\"8\">\n              <a\n                @click=\"addPrice\"\n                class=\"button is-primary\"\n              >{{\n                $t('Components.Options.ModalEditOptionPrices.Button_Add')\n              }}</a>\n            </td>\n          </tr>\n        </tfoot>\n      </table>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport optionProvider from '@/providers/option'\nimport uuidv4 from '@/mixins/createId'\nimport VCalendar from 'v-calendar'\nimport { cleanSource } from '../../utils/objectHelper'\nVue.use(VCalendar, {})\n\nexport default {\n  components: {},\n\n  mixins: [uuidv4],\n\n  props: {\n    channelId: {\n      type: Number,\n      required: 0,\n    },\n\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n  },\n\n  data() {\n    return {\n      calculationTypes: [],\n      isSaving: false,\n      isSavingSuccess: false,\n      isSavingError: false,\n      locationId: Number(this.$route.params.locationId),\n      mOption: null,\n      newOptionPrice: null,\n      dateOne: new Date(),\n      dateTwo: new Date(),\n    }\n  },\n\n  computed: {\n    ...mapState('locationStore', ['locationState']),\n    ...mapState('optionStore', ['option']),\n\n    channels() {\n      if (this.locationState) {\n        return this.locationState.Channels\n      } else {\n        return []\n      }\n    },\n\n    channelPrices() {\n      let channelPrices = this.mOption.Prices.filter((p) => p.ChannelId === this.channelId);\n\n      return channelPrices;\n    },\n\n    taxPercentages() {\n      let result = []\n\n      if (this.locationState) {\n        result = this.locationState.TaxPercentages.map((t) => t.TaxPercentage)\n      }\n\n      return result\n    },\n  },\n\n  created() {\n    this.mOption = cleanSource(this.option)\n\n    this.calculationTypes.push({ Id: 0, Type: 'PerItem', Name: 'Per item' })\n    this.calculationTypes.push({ Id: 1, Type: 'PerPerson', Name: 'Per person' })\n    this.calculationTypes.push({\n      Id: 2,\n      Type: 'PerDayPart',\n      Name: 'Per day part',\n    })\n    this.calculationTypes.push({\n      Id: 4,\n      Type: 'PerPersonPerDayPart',\n      Name: 'Per person per day part',\n    })\n\n    this.newOptionPrice = {\n      OptionId: this.option.Id,\n      ChannelId: this.channelId,\n      ValidFrom: new Date(),\n      MaxPP: 0,\n      MaxTotal: 0,\n      PriceType: 'PerItem',\n      TaxId: 0,\n      CurrencyId: this.locationState.Settings.CurrencyId,\n      CurrencySymbol: this.locationState.CurrencySymbol,\n      Price: 0,\n      Deductible: true,\n      UseManualDuration: false,\n      index: this.uuidv4()\n    };\n\n    this.setupPriceIndexes();\n  },\n\n  methods: {\n    ...mapMutations('optionStore', ['setOption']),\n\n    addPrice() {\n      this.mOption.Prices.push(this.newOptionPrice)\n\n      this.newOptionPrice = {\n        OptionId: this.option.Id,\n        ChannelId: this.channelId,\n        ValidFrom: new Date(),\n        MaxPP: 0,\n        MaxTotal: 0,\n        PriceType: 'PerItem',\n        TaxId: 0,\n        CurrencyId: this.locationState.Settings.CurrencyId,\n        CurrencySymbol: this.locationState.CurrencySymbol,\n        Price: 0,\n        Deductible: true,\n        UseManualDuration: false,\n        index: this.uuidv4()\n      }\n    },\n\n    setupPriceIndexes() {\n      for (let i = 0; i < this.mOption.Prices.length; i++) {\n        let price = this.mOption.Prices[i]\n        price.index = this.uuidv4();\n      }\n    },\n\n    deletePrice(price) {\n      let priceIndex = this.mOption.Prices.findIndex(p => p.index === price.index);\n\n      this.mOption.Prices.splice(priceIndex, 1);\n    },\n\n    saveOptionPrices() {\n      let self = this\n\n      if (!self.isSaving) {\n        self.isSaving = true\n\n        for (let i = 0; i < self.mOption.Prices.length; i++) {\n          self.mOption.Prices[i].ValidFrom =\n            self.$options.filters.dateObjectIsoDateString(\n              self.mOption.Prices[i].ValidFrom\n            )\n        }\n\n        optionProvider.methods\n          .saveLocationOptionPrices(\n            self.mOption.Id,\n            self.mOption.Location.LocationId,\n            self.mOption.Prices\n          )\n          .then((response) => {\n            self.isSavingSuccess = true\n\n            self.setOption(response.data);\n\n            // Send message to display toast on screen\n            EventBus.$emit('showToast', {\n              type: 'info',\n              message: 'Option updated',\n            })\n\n            self.onClickCancel()\n          })\n          .catch((e) => {\n            self.isSavingError = true\n          })\n          .finally(() => {\n            self.isSaving = false\n          })\n      }\n    },\n  },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.table {\n  tr {\n    td {\n      vertical-align: middle;\n    }\n  }\n}\n.field-price {\n  width: 100px;\n}\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!./ModalEditOptionPrices.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!./ModalEditOptionPrices.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalEditOptionPrices.vue?vue&type=template&id=55b1bc7b&scoped=true\"\nimport script from \"./ModalEditOptionPrices.vue?vue&type=script&lang=js\"\nexport * from \"./ModalEditOptionPrices.vue?vue&type=script&lang=js\"\nimport style0 from \"./ModalEditOptionPrices.vue?vue&type=style&index=0&id=55b1bc7b&prod&lang=scss&scoped=true\"\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  \"55b1bc7b\",\n  null\n  \n)\n\nexport default component.exports","export default {\n  methods: {\n    uuidv4() {\n      return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'\n        .replace(/[xy]/g, function(c) {\n          const r = Math.random() * 16 | 0,\n            v = c == 'x' ? r : (r & 0x3 | 0x8);\n          return v.toString(16);\n        })\n    },\n  }\n}"],"sourceRoot":""}