(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{176: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}))},203:function(t,e,a){var i=a(284);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(5).default)("0e3ad600",i,!1,{})},283:function(t,e,a){"use strict";var i=a(203);a.n(i).a},284:function(t,e,a){(e=a(4)(!1)).push([t.i,".main-container--bot-copy{max-width:1000px}.container-description{text-align:center;margin-bottom:2em}\n",""]),t.exports=e},303: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),s=a(177),n=a(14),r=a(176),c=a(0);function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function m(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var p={name:"bot-copy",components:{ConfigEditor:s.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]:{};e%2?l(Object(a),!0).forEach((function(e){m(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(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(n.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"))}}},d=(a(283),a(1)),b=Object(d.a)(p,i,[],!1,null,null,null);b.options.__file="src/views/modals/BotCopy.vue";e.default=b.exports}}]);