(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{186:function(t,e,a){"use strict";function i(t,e){for(const a of t)if(a.name===e)return!0;return!1}a.d(e,"a",function(){return i})},215:function(t,e,a){var i=a(306);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(5).default)("11b9574c",i,!1,{})},305:function(t,e,a){"use strict";var i=a(215);a.n(i).a},306:function(t,e,a){(t.exports=a(4)(!1)).push([t.i,".main-container--bot-copy {\n  max-width: 1000px;\n}\n.container-description {\n  text-align: center;\n  margin-bottom: 2em;\n}\n",""])},345:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.bot?a("main",{staticClass:"main-container main-container--bot-copy"},[a("h2",{staticClass:"title"},[t._v("\n\t\t"+t._s(t.$t("bot-new"))+"\n\t")]),t._v(" "),a("div",{staticClass:"container"},[a("p",{staticClass:"container-description"},[t._v("\n\t\t\t"+t._s(t.$t("bot-new-copy",{name:t.bot.name}))+"\n\t\t")]),t._v(" "),t.displayCategories?a("config-editor",{attrs:{fields:t.fields,model:t.model,categories:t.categories}}):a("config-editor",{attrs:{fields:t.fields,model:t.model}}),t._v(" "),a("div",{staticClass:"form-item"},[a("div",{staticClass:"form-item__buttons"},[a("button",{staticClass:"button button--confirm",on:{click:t.onCreate}},[t.creating?a("font-awesome-icon",{attrs:{icon:"spinner",spin:""}}):a("span",[t._v(t._s(t.$t("create")))])],1),t._v(" "),a("router-link",{staticClass:"button button--cancel pull-right",attrs:{tag:"button",to:{name:"bot-config",params:{bot:t.bot.name}}}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("cancel"))+"\n\t\t\t\t")])],1)])],1)]):t._e()};i._withStripped=!0;var o=a(3),n=a(188),s=a(14),r=a(186),c=a(0);function l(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var m={name:"bot-copy",components:{ConfigEditor:n.a},data(){return{creating:!1,categories:[{name:this.$t("basic"),fields:["Name","SteamLogin","SteamPassword"]}],fields:[{defaultValue:"",param:"Name",paramName:"Name",type:"string",description:this.$t("name-description")},{defaultValue:"",param:"SteamLogin",paramName:"SteamLogin",type:"string",description:Object(c.a)("cache:parameter-descriptions:".concat(this.$i18n.locale)).descriptions.SteamLogin},{defaultValue:"",param:"SteamPassword",paramName:"SteamPassword",type:"string",description:Object(c.a)("cache:parameter-descriptions:".concat(this.$i18n.locale)).descriptions.SteamPassword}],model:{}}},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{},i=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(a).filter(function(t){return Object.getOwnPropertyDescriptor(a,t).enumerable}))),i.forEach(function(e){l(t,e,a[e])})}return t}({},Object(o.c)({displayCategories:"settings/displayCategories",bots:"bots/bots"}),{bot(){return this.$store.getters["bots/bot"](this.$route.params.bot)}}),created(){this.bot||this.$router.replace({name:"bots"}),this.model=this.bot.config},methods:{async onCreate(){if(!this.creating)if(this.model.Name)if("ASF"!==this.model.Name)if(Object(r.a)(this.bots,this.model.Name))this.$error(this.$t("bot-create-name-exist",{name:this.model.Name}));else{this.creating=!0;try{await this.$http.post("bot/".concat(this.model.Name),{botConfig:this.model}),await Object(s.a)(1e3),await this.$store.dispatch("bots/updateBot",{name:this.model.Name}),this.$parent.close()}catch(t){this.$error(t.message)}finally{this.creating=!1}}else this.$error(this.$t("bot-create-name-asf"));else this.$error(this.$t("bot-create-name"))}}},p=(a(305),a(1)),d=Object(p.a)(m,i,[],!1,null,null,null);d.options.__file="src/views/modals/BotCopy.vue";e.default=d.exports}}]);