{"version":3,"sources":["webpack:///./src/components/Settings/Yield/Playground/ModalYieldPlaygrounds.vue","webpack:///src/components/Settings/Yield/Playground/ModalYieldPlaygrounds.vue","webpack:///./src/components/Settings/Yield/Playground/ModalYieldPlaygrounds.vue?985d","webpack:///./src/components/Settings/Yield/Playground/ModalYieldPlaygrounds.vue?ffc2"],"names":["render","_vm","this","_c","_self","attrs","onClickCancel","showModal","on","scopedSlots","_u","key","fn","staticClass","_l","yieldSettingsList","ys","index","class","activeIndex","$event","setActiveYieldSettings","Settings","_v","_s","Name","length","stopPropagation","deleteTab","_e","addTab","$t","yieldSettingsUpdated","proxy","staticRenderFns","YieldPlayground","components","props","type","Boolean","default","Function","required","yieldSettings","Object","data","addCounter","originalYieldSettings","computed","_objectSpread","mapState","created","JSON","parse","stringify","yieldSettingsPlayground","beforeDestroy","setYieldSettingsPlayground","methods","mapMutations","push","splice","newActiveIndex","$set","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAa,mBAAmB,UAAY,cAAc,cAAgBJ,EAAIK,cAAc,UAAYL,EAAIM,UAAU,gBAAiB,GAAMC,GAAG,CAAC,WAAaP,EAAIK,eAAeG,YAAYR,EAAIS,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACT,EAAG,MAAM,CAACA,EAAG,MAAM,CAACU,YAAY,iBAAiB,CAACV,EAAG,KAAK,CAACF,EAAIa,GAAIb,EAAIc,mBAAmB,SAASC,EAAGC,GAAO,OAAOd,EAAG,KAAK,CAACQ,IAAIM,EAAMC,MAAM,CAAE,YAAajB,EAAIkB,cAAgBF,GAAQT,GAAG,CAAC,MAAQ,SAASY,GAAQ,OAAOnB,EAAIoB,uBAAuBJ,EAAOD,EAAGM,aAAa,CAACnB,EAAG,OAAO,CAACA,EAAG,IAAI,CAACF,EAAIsB,GAAGtB,EAA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GAAA,8DAAAe,WACAxB,SAAA8B,KAAAC,MAAAD,KAAAE,UAAA,KAAAP,0BAGA,IAAA5B,EAAA,KAAAJ,kBAAAW,OAAA,EACA,KAAAL,uBACAF,EACAiC,KAAAC,MAAAD,KAAAE,UAAA,KAAAP,0BAIAnB,UAAA,SAAAX,GACA,KAAAF,kBAAA8C,OAAA5C,EAAA,GAEA,IAAA6C,EAAA7C,EAAA,MAAAA,EAAA,EACAD,EAAA,KAAAD,kBAAA+C,GAEA,KAAAzC,uBAAAyC,EAAA9C,EAAAM,WAGAD,uBAAA,SAAAJ,EAAAD,GACA,KAAAG,YAAAF,EACA,KAAAwC,2BAAAL,KAAAC,MAAAD,KAAAE,UAAAtC,MAGAgB,qBAAA,SAAAW,GACA,IAAA3B,EAAA,KAAAD,kBAAA,KAAAI,aACAH,EAAAM,SAAAqB,EAEA,KAAAoB,KAAA,KAAAhD,kBAAA,KAAAI,YAAAH,OC9I2Y,I,YCOvYgD,EAAY,eACd,EACAhE,EACAkC,GACA,EACA,KACA,KACA,MAIa,aAAA8B,E","file":"js/chunk-2d0be0e9.js?id=a1c548cd0f18690cabca","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":'Yield playground',\"modalSize\":\"extra-large\",\"onClickCancel\":_vm.onClickCancel,\"showModal\":_vm.showModal,\"hideSaveButton\":true},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',[_c('div',{staticClass:\"tabs is-boxed\"},[_c('ul',[_vm._l((_vm.yieldSettingsList),function(ys,index){return _c('li',{key:index,class:{ 'is-active': _vm.activeIndex === index },on:{\"click\":function($event){return _vm.setActiveYieldSettings(index, ys.Settings)}}},[_c('span',[_c('a',[_vm._v(_vm._s(ys.Name)+\" \"),(_vm.yieldSettingsList.length > 1)?_c('span',{staticClass:\"icon has-text-danger\",on:{\"click\":function($event){$event.stopPropagation();return _vm.deleteTab(index)}}},[_c('font-awesome-icon',{attrs:{\"icon\":['fas', 'times']}})],1):_vm._e()])])])}),_c('li',[_c('a',{on:{\"click\":_vm.addTab}},[_c('span',{staticClass:\"icon has-text-success\"},[_c('font-awesome-icon',{attrs:{\"icon\":['fas', 'plus']}})],1),_c('span',[_vm._v(_vm._s(_vm.$t(`Components.Settings.Yield.YieldPlayground.Button_Add`)))])])])],2)]),_c('yield-playground',{attrs:{\"activeIndex\":_vm.activeIndex},on:{\"yieldSettingsUpdated\":_vm.yieldSettingsUpdated}})],1)]},proxy:true}])})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"'Yield playground'\"\n    modalSize=\"extra-large\"\n    :onClickCancel=\"onClickCancel\"\n    :showModal=\"showModal\"\n    :hideSaveButton=\"true\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template v-slot:content>\n      <div>\n        <div class=\"tabs is-boxed\">\n          <ul>\n            <li\n              v-for=\"(ys, index) in yieldSettingsList\"\n              :key=\"index\"\n              :class=\"{ 'is-active': activeIndex === index }\"\n              @click=\"setActiveYieldSettings(index, ys.Settings)\"\n            >\n              <span>\n                <a\n                  >{{ ys.Name}}\n\n                  <span\n                    @click.stop=\"deleteTab(index)\"\n                    v-if=\"yieldSettingsList.length > 1\"\n                    class=\"icon has-text-danger\"\n                  >\n                    <font-awesome-icon :icon=\"['fas', 'times']\" />\n                  </span>\n                </a>\n              </span>\n            </li>\n            <li>\n              <a @click=\"addTab\">\n                <span class=\"icon has-text-success\">\n                  <font-awesome-icon :icon=\"['fas', 'plus']\" />\n                </span>\n                <span>{{ $t(`Components.Settings.Yield.YieldPlayground.Button_Add`)}}</span>\n              </a>\n            </li>\n          </ul>\n        </div>\n\n        <yield-playground\n          @yieldSettingsUpdated=\"yieldSettingsUpdated\"\n          :activeIndex=\"activeIndex\"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport { mapMutations, mapState } from 'vuex'\n\nconst YieldPlayground = () =>\n  import('@/components/Settings/Yield/Playground/YieldPlayground')\n\nexport default {\n  components: {\n    'yield-playground': YieldPlayground\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    yieldSettings: {\n      type: Object,\n      default: null\n    }\n  },\n\n  data() {\n    return {\n      activeIndex: 0,\n      addCounter: 0,\n      originalYieldSettings: null,\n      yieldSettingsList: []\n    }\n  },\n\n  computed: {\n    ...mapState('yieldStore', ['yieldSettingsPlayground'])\n  },\n\n  created() {\n    this.originalYieldSettings = JSON.parse(\n      JSON.stringify(this.yieldSettingsPlayground)\n    )\n    this.addTab()\n    this.setActiveYieldSettings(0, this.yieldSettingsPlayground)\n  },\n\n  beforeDestroy() {\n    this.setYieldSettingsPlayground(null)\n  },\n\n  methods: {\n    ...mapMutations('yieldStore', ['setYieldSettingsPlayground']),\n\n    addTab() {\n      this.addCounter = this.addCounter + 1\n\n      this.yieldSettingsList.push({\n        Name: this.$t(`Components.Settings.Yield.YieldPlayground.Version`) + \" \" + this.addCounter,\n        Settings: JSON.parse(JSON.stringify(this.originalYieldSettings))\n      })\n\n      let activeIndex = this.yieldSettingsList.length - 1\n      this.setActiveYieldSettings(\n        activeIndex,\n        JSON.parse(JSON.stringify(this.originalYieldSettings))\n      )\n    },\n\n    deleteTab(index) {\n      this.yieldSettingsList.splice(index, 1)\n\n      let newActiveIndex = index - 1 < 0 ? 0 : index - 1\n      let ys = this.yieldSettingsList[newActiveIndex]\n\n      this.setActiveYieldSettings(newActiveIndex, ys.Settings)\n    },\n\n    setActiveYieldSettings(index, ys) {\n      this.activeIndex = index\n      this.setYieldSettingsPlayground(JSON.parse(JSON.stringify(ys)))\n    },\n\n    yieldSettingsUpdated(yieldSettings) {\n      let ys = this.yieldSettingsList[this.activeIndex]\n      ys.Settings = yieldSettings\n\n      this.$set(this.yieldSettingsList, this.activeIndex, ys)\n    }\n  }\n}\n</script>\n\n<style></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!./ModalYieldPlaygrounds.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!./ModalYieldPlaygrounds.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalYieldPlaygrounds.vue?vue&type=template&id=d7ce76e0\"\nimport script from \"./ModalYieldPlaygrounds.vue?vue&type=script&lang=js\"\nexport * from \"./ModalYieldPlaygrounds.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":""}