{"version":3,"sources":["webpack:///./src/components/Spaces/ModalDeleteSpaceOption.vue","webpack:///src/components/Spaces/ModalDeleteSpaceOption.vue","webpack:///./src/components/Spaces/ModalDeleteSpaceOption.vue?55e0","webpack:///./src/components/Spaces/ModalDeleteSpaceOption.vue?05c0"],"names":["render","_vm","this","_c","_self","attrs","$t","isDeleting","isDeletingSuccess","isDeletingError","agreed","name","option","OptionName","onClickCancel","deleteSpaceOption","showModal","on","scopedSlots","_u","key","fn","staticClass","domProps","_s","model","value","callback","$$v","expression","proxy","staticRenderFns","BaseCheckbox","components","props","type","Boolean","default","Function","required","data","mSpace","computed","_objectSpread","mapState","created","self","JSON","parse","stringify","space","methods","mapMutations","optionIndex","IncludedOptions","findIndex","o","OptionId","splice","spaceProvider","updateSpace","then","response","status","setSpace","setTimeout","$emit","catch","e","finally","isSDeleting","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,+DAA+D,sBAAwB,YAAY,mBAAqBL,EAAIK,GAAG,uBAAuB,SAAWL,EAAIM,WAAW,gBAAkBN,EAAIO,kBAAkB,cAAgBP,EAAIQ,gBAAgB,kBAAoBR,EAAIQ,iBAAmBR,EAAIO,kBAAkB,mBAAqBP,EAAIS,QAAUT,EAAIM,WAAW,qBAAuBN,EAAIK,GAC3f,yEACA,CACEK,KAAMV,EAAIW,OAAOC,aAEnB,mBAAqBZ,EAAIK,GACzB,uEACA,CACEK,KAAMV,EAAIW,OAAOC,aAEnB,cAAgBZ,EAAIa,cAAc,YAAcb,EAAIc,kBAAkB,UAAYd,EAAIe,WAAWC,GAAG,CAAC,WAAahB,EAAIa,eAAeI,YAAYjB,EAAIkB,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAAClB,EAAG,MAAM,CAACmB,YAAY,gDAAgDC,SAAS,CAAC,U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,GACAtB,EAAArC,iBAAA,KAEA4D,SAAA,WACAvB,EAAAwB,aAAA,SC5I8W,I,YCO1WC,EAAY,eACd,EACAvE,EACA+B,GACA,EACA,KACA,KACA,MAIa,aAAAwC,E","file":"js/chunk-2d0b25b0.js?id=b7cdcde087d4d656e876","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.Settings.Space.ModalDeleteSpaceOption.Main_Title'),\"confirmButtonCssClass\":\"is-danger\",\"buttonLabelConfirm\":_vm.$t('Form.Control.Delete'),\"isSaving\":_vm.isDeleting,\"isSavingSuccess\":_vm.isDeletingSuccess,\"isSavingError\":_vm.isDeletingError,\"hideFooterButtons\":_vm.isDeletingError || _vm.isDeletingSuccess,\"disableSaveButton\":!_vm.agreed || _vm.isDeleting,\"savingSuccessMessage\":_vm.$t(\n      'Components.Settings.Space.ModalDeleteSpaceOption.Message_SavingSuccess',\n      {\n        name: _vm.option.OptionName,\n      }\n    ),\"savingErrorMessage\":_vm.$t(\n      'Components.Settings.Space.ModalDeleteSpaceOption.Message_SavingError',\n      {\n        name: _vm.option.OptionName,\n      }\n    ),\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.deleteSpaceOption,\"showModal\":_vm.showModal},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',{staticClass:\"has-margin-bottom is-size-5 has-text-centered\",domProps:{\"innerHTML\":_vm._s(\n        _vm.$t(\n          'Components.Settings.Space.ModalDeleteSpaceOption.Label_AreYouSure',\n          { name: _vm.option.OptionName }\n        )\n      )}}),_c('div',{staticClass:\"has-text-centered\"},[_c('BaseCheckbox',{staticClass:\"has-text-left\",attrs:{\"label\":_vm.$t('Components.Settings.Accounts.ModalDeleteAccount.Text_YesSure')},model:{value:(_vm.agreed),callback:function ($$v) {_vm.agreed=$$v},expression:\"agreed\"}})],1)]},proxy:true}])})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"\n      $t('Components.Settings.Space.ModalDeleteSpaceOption.Main_Title')\n    \"\n    confirmButtonCssClass=\"is-danger\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :isSaving=\"isDeleting\"\n    :isSavingSuccess=\"isDeletingSuccess\"\n    :isSavingError=\"isDeletingError\"\n    :hideFooterButtons=\"isDeletingError || isDeletingSuccess\"\n    :disableSaveButton=\"!agreed || isDeleting\"\n    :savingSuccessMessage=\"\n      $t(\n        'Components.Settings.Space.ModalDeleteSpaceOption.Message_SavingSuccess',\n        {\n          name: option.OptionName,\n        }\n      )\n    \"\n    :savingErrorMessage=\"\n      $t(\n        'Components.Settings.Space.ModalDeleteSpaceOption.Message_SavingError',\n        {\n          name: option.OptionName,\n        }\n      )\n    \"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"deleteSpaceOption\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template v-slot:content>\n      <div\n        class=\"has-margin-bottom is-size-5 has-text-centered\"\n        v-html=\"\n          $t(\n            'Components.Settings.Space.ModalDeleteSpaceOption.Label_AreYouSure',\n            { name: option.OptionName }\n          )\n        \"\n      ></div>\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"agreed\"\n          class=\"has-text-left\"\n          :label=\"\n            $t('Components.Settings.Accounts.ModalDeleteAccount.Text_YesSure')\n          \"\n        />\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 spaceProvider from '@/providers/space'\n\nconst BaseCheckbox = () =>\n  import(\n    /* webpackChunkName: \"settings-accounts\" */ '@/components/UI/Form/BaseCheckbox'\n  )\n\nexport default {\n  components: {\n    BaseCheckbox,\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    option: null,\n  },\n\n  data() {\n    return {\n      agreed: false,\n      isDeleting: false,\n      isDeletingSuccess: false,\n      isDeletingError: false,\n      mSpace: null,\n    }\n  },\n\n  computed: {\n    ...mapState('spaceStore', ['space']),\n  },\n\n  created() {\n    let self = this\n    self.mSpace = JSON.parse(JSON.stringify(self.space))\n  },\n\n  methods: {\n    ...mapMutations('spaceStore', ['setSpace']),\n\n    deleteSpaceOption() {\n      let self = this\n      self.isDeleting = true\n      self.isDeletingSuccess = false\n      self.isDeletingError = false\n\n      let optionIndex = self.mSpace.IncludedOptions.findIndex(\n        (o) => o.OptionId === self.option.OptionId\n      )\n      if (optionIndex > -1) {\n        self.mSpace.IncludedOptions.splice(optionIndex, 1)\n      }\n\n      spaceProvider.methods\n        .updateSpace(self.mSpace)\n        .then((response) => {\n          if (response.status === 200) {\n            self.isDeletingSuccess = true\n\n            self.mSpace = response.data\n            self.setSpace(self.mSpace)\n\n            setTimeout(() => {\n              self.$emit('spaceEdited', self.mSpace)\n              self.onClickCancel()\n            }, 1500)\n          }\n        })\n        .catch((e) => {\n          self.isDeletingError = true\n        })\n        .finally(() => {\n          self.isSDeleting = false\n        })\n    },\n  },\n}\n</script>\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!./ModalDeleteSpaceOption.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!./ModalDeleteSpaceOption.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalDeleteSpaceOption.vue?vue&type=template&id=7839075c\"\nimport script from \"./ModalDeleteSpaceOption.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteSpaceOption.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\nexport default component.exports"],"sourceRoot":""}