{"version":3,"sources":["webpack:///./src/components/Settings/Yield/Playground.vue","webpack:///src/components/Settings/Yield/Playground.vue","webpack:///./src/components/Settings/Yield/Playground.vue?13cc","webpack:///./src/components/Settings/Yield/Playground.vue?10a4"],"names":["render","_vm","this","_c","_self","yieldSettingsPlayground","yieldSettings","staticClass","_l","yieldSettingsList","ys","index","key","class","activeIndex","on","$event","setActiveYieldSettings","Settings","_v","_s","Name","length","stopPropagation","deleteTab","attrs","_e","addTab","$t","yieldSettingsUpdated","staticRenderFns","components","YieldPlayground","props","type","Object","default","data","addCounter","originalYieldSettings","computed","_objectSpread","mapState","created","setYieldSettingsPlayground","cleanSource","beforeDestroy","methods","mapMutations","push","splice","newActiveIndex","$set","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAQF,EAAII,yBAA2BJ,EAAIK,cAAeH,EAAG,MAAM,CAACA,EAAG,MAAM,CAACI,YAAY,iBAAiB,CAACJ,EAAG,KAAK,CAACF,EAAIO,GAAIP,EAAIQ,mBAAmB,SAASC,EAAGC,GAAO,OAAOR,EAAG,KAAK,CAACS,IAAID,EAAME,MAAM,CAAE,YAAaZ,EAAIa,cAAgBH,GAAQI,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOf,EAAIgB,uBAAuBN,EAAOD,EAAGQ,aAAa,CAACf,EAAG,OAAO,CAACA,EAAG,IAAI,CAACF,EAAIkB,GAAGlB,EAAImB,GAAGV,EAAGW,MAAM,KAAMpB,EAAIQ,kBAAkBa,OAAS,EAAGnB,EAAG,OAAO,CAACI,YAAY,uBAAuBQ,GAAG,CAAC,MAAQ,SAASC,GAAiC,OAAzBA,EAAOO,kBAAyBtB,EAAIuB,UAAUb,MAAU,CAACR,EAAG,oBAAoB,CAACsB,MAAM,CAAC,KAAO,CAAC,MAAO,aAAa,GAAGxB,EAAIyB,cAAavB,EAAG,KAAK,CAACA,EAAG,IAAI,CAACY,GAAG,CA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B,GACA,IAAAI,EAAA,KAAAD,kBAAA,KAAAK,aACAJ,EAAAQ,SAAAZ,EAEA,KAAA8C,KAAA,KAAA3C,kBAAA,KAAAK,YAAAJ,OC7HiX,I,YCO7W2C,EAAY,eACd,EACArD,EACA8B,GACA,EACA,KACA,KACA,MAIa,aAAAuB,E","file":"js/chunk-2d0a3325.js?id=bae43380e37a7a45da9a","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.yieldSettingsPlayground && _vm.yieldSettings)?_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('YieldPlayground',{attrs:{\"activeIndex\":_vm.activeIndex},on:{\"yieldSettingsUpdated\":_vm.yieldSettingsUpdated}})],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div v-if=\"yieldSettingsPlayground && yieldSettings\">\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    <YieldPlayground\n      @yieldSettingsUpdated=\"yieldSettingsUpdated\"\n      :activeIndex=\"activeIndex\"\n    />\n  </div>\n\n</template>\n\n<script>\nimport { mapMutations, mapState } from 'vuex'\nimport { cleanSource } from '@/utils/objectHelper'\n\nexport default {\n  components: {\n    YieldPlayground: () => import('@/components/Settings/Yield/Playground/YieldPlayground')\n  },\n\n  props: {\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.setYieldSettingsPlayground(this.yieldSettings);\n\n    // Create a clean copy of the data\n    this.originalYieldSettings = cleanSource(this.yieldSettings);\n\n    // Create a tab\n    this.addTab();\n\n    // Set the newly created tab as active and fill the data\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: cleanSource(this.originalYieldSettings)\n      })\n\n      let activeIndex = this.yieldSettingsList.length - 1\n      this.setActiveYieldSettings(\n        activeIndex,\n        cleanSource(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(cleanSource(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!./Playground.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!./Playground.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Playground.vue?vue&type=template&id=34aee557\"\nimport script from \"./Playground.vue?vue&type=script&lang=js\"\nexport * from \"./Playground.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":""}