{"version":3,"sources":["webpack:///src/components/Reservations/ModalAddComment.vue","webpack:///./src/components/Reservations/ModalAddComment.vue","webpack:///./src/components/Reservations/ModalAddComment.vue?c6e8","webpack:///./src/components/Reservations/ModalAddComment.vue?1f57","webpack:///./src/components/Reservations/ModalAddComment.vue?3f30"],"names":["components","props","showModal","type","Boolean","default","onClickCancel","Function","required","data","isSaving","isSavingError","newComment","computed","_objectSpread","mapState","noText","result","Text","created","setNewComment","methods","mapMutations","saveNewComment","_this","self","ReservationId","reservation","Id","Comment","$options","filters","stripHtml","reservationProvider","addReservationComment","Key","then","response","status","setReservation","EventBus","$emit","message","$t","catch","error","finally","comment","ItemId","render","_vm","_c","_self","attrs","modalTitle","hideFooterButtons","onClickSave","disableSaveButton","on","closeModal","scopedSlots","_u","key","fn","directives","name","rawName","value","expression","staticClass","domProps","input","$event","target","composing","$set","_e","proxy","slot","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;AACA;AAEe;EACfA,UAAA;EAEAC,KAAA;IACAC,SAAA;MACAC,IAAA,EAAAC,OAAA;MACAC,OAAA;IACA;IAEAC,aAAA;MACAH,IAAA,EAAAI,QAAA;MACAC,QAAA;IACA;EACA;EAEAC,IAAA,WAAAA,KAAA;IACA;MACAC,QAAA;MACAC,aAAA;MACAC,UAAA;IACA;EACA;EAEAC,QAAA,EAAAC,iIAAA,CAAAA,iIAAA,KACAC,6DAAA;IAEAC,MAAA,WAAAA,OAAA;MACA,IAAAC,MAAA;MAEA,SAAAL,UAAA,CAAAM,IAAA;QACAD,MAAA;MACA;MACA,OAAAA,MAAA;IACA;EAAA,EACA;EAEAE,OAAA,WAAAA,QAAA;IACA,KAAAP,UAAA,QAAAQ,aAAA;EACA;EAEAC,OAAA,EAAAP,iIAAA,CAAAA,iIAAA,KACAQ,iEAAA;IAEAC,cAAA,WAAAA,eAAA;MAAA,IAAAC,KAAA;MACA,IAAAC,IAAA;MACA,KAAAA,IAAA,CAAAf,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;;;;;;;;;ACvD3B;AAAA;AAAA;AAAA;AAA6F;AAC3B;AACL;;;AAG7D;AAC6F;AAC7F,gBAAgB,mHAAU;AAC1B,EAAE,4FAAM;AACR,EAAE,iGAAM;AACR,EAAE,0GAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAAuS,CAAgB,iVAAG,EAAC,C;;;;;;;;;;;;;ACA3T;AAAA;AAAA;AAAA;AAAA","file":"js/387.js?id=23b9a11d8ac89bcd08d0","sourcesContent":["<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.Reservation.ModalAddComment.Main_Title')\"\n    :isSaving=\"isSaving\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"saveNewComment\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n    :disableSaveButton=\"noText\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div v-if=\"newComment.ItemId\">\n        <textarea\n          v-model=\"newComment.Text\"\n          class=\"textarea\"\n        ></textarea>\n      </div>\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 reservationProvider from '@/providers/reservation'\n\nexport default {\n  components: {},\n\n  props: {\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      isSaving: false,\n      isSavingError: false,\n      newComment: {},\n    }\n  },\n\n  computed: {\n    ...mapState('reservationStore', ['reservation']),\n\n    noText() {\n      let result = true\n\n      if (this.newComment.Text !== '') {\n        result = false\n      }\n      return result\n    },\n  },\n\n  created() {\n    this.newComment = this.setNewComment()\n  },\n\n  methods: {\n    ...mapMutations('reservationStore', ['setReservation']),\n\n    saveNewComment() {\n      let self = this\n      if (!self.isSaving) {\n        self.isSaving = true\n      }\n\n      let data = {\n        ReservationId: this.reservation.Id,\n        Comment: this.$options.filters.stripHtml(this.newComment.Text)\n      }\n\n      reservationProvider.methods\n        .addReservationComment(this.reservation.Key, data)\n        .then((response) => {\n          if (response.status === 200) {\n            this.setReservation(response.data);\n\n            EventBus.$emit('showToast', {\n              type: 'info',\n              message: this.$t(\n                'Components.Reservation.ModalAddComment.Toast_CommentAdded'\n              ),\n            })\n\n            self.onClickCancel();\n          }\n        })\n        .catch((error) => {\n          //console.log(error.response)\n          self.isSavingError = true\n        })\n        .finally(() => {\n          self.isSaving = false\n        })\n    },\n\n    setNewComment() {\n      let comment = {\n        ItemId: this.reservation.Id,\n        Text: '',\n      }\n      return comment\n    },\n  },\n}\n</script>\n","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _c(\n    \"ui-component-modal\",\n    {\n      attrs: {\n        modalTitle: _vm.$t(\"Components.Reservation.ModalAddComment.Main_Title\"),\n        isSaving: _vm.isSaving,\n        isSavingError: _vm.isSavingError,\n        hideFooterButtons: _vm.isSavingError,\n        onClickCancel: _vm.onClickCancel,\n        onClickSave: _vm.saveNewComment,\n        showModal: _vm.showModal,\n        disableSaveButton: _vm.noText,\n      },\n      on: { closeModal: _vm.onClickCancel },\n      scopedSlots: _vm._u([\n        {\n          key: \"content\",\n          fn: function () {\n            return [\n              _vm.newComment.ItemId\n                ? _c(\"div\", [\n                    _c(\"textarea\", {\n                      directives: [\n                        {\n                          name: \"model\",\n                          rawName: \"v-model\",\n                          value: _vm.newComment.Text,\n                          expression: \"newComment.Text\",\n                        },\n                      ],\n                      staticClass: \"textarea\",\n                      domProps: { value: _vm.newComment.Text },\n                      on: {\n                        input: function ($event) {\n                          if ($event.target.composing) return\n                          _vm.$set(_vm.newComment, \"Text\", $event.target.value)\n                        },\n                      },\n                    }),\n                  ])\n                : _vm._e(),\n            ]\n          },\n          proxy: true,\n        },\n      ]),\n    },\n    [_c(\"template\", { slot: \"modalTitle\" })],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./ModalAddComment.vue?vue&type=template&id=9fade09a\"\nimport script from \"./ModalAddComment.vue?vue&type=script&lang=js\"\nexport * from \"./ModalAddComment.vue?vue&type=script&lang=js\"\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\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/github/workspace/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('9fade09a')) {\n      api.createRecord('9fade09a', component.options)\n    } else {\n      api.reload('9fade09a', component.options)\n    }\n    module.hot.accept(\"./ModalAddComment.vue?vue&type=template&id=9fade09a\", function () {\n      api.rerender('9fade09a', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Reservations/ModalAddComment.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../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!./ModalAddComment.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../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!./ModalAddComment.vue?vue&type=script&lang=js\"","export * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"d2a26fb4-vue-loader-template\\\"}!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalAddComment.vue?vue&type=template&id=9fade09a\""],"sourceRoot":""}