text: webpackJsonp([9],{"/IiG":function(e,t,a){"use strict";var s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ui container"},[e._m(0,!1,!1),e._v(" "),a("div",{staticClass:"ui segment"},[e.currentDelegate?a("div",{staticClass:"ui warning message"},[e._v("\n      You are already voting for "),a("b",[e._v(e._s(e.currentDelegate.username))]),e._v(" as delegate\n    ")]):e._e(),e._v(" "),a("form",{staticClass:"ui form"},[e.delegates.length>0?a("div",{staticClass:"field"},[a("label",[e._v("Forging delegates")]),e._v(" "),a("div",{staticClass:"ui input"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedDelegate,expression:"selectedDelegate"}],on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedDelegate=t.target.multiple?a:a[0]}}},e._l(e.delegates,function(t){return a("option",{key:t.username,domProps:{value:t.username}},[e._v("\n              "+e._s(t.username)+" (Approval : "+e._s(t.approval)+") - Productivity : ("+e._s(t.productivity)+")\n            ")])}))]),e._v(" "),a("div",{staticClass:"field"},[a("label",[e._v("Delegate name")]),e._v(" "),a("div",{staticClass:"ui input"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.delegateName,expression:"delegateName"}],staticClass:"input",attrs:{type:"text",placeholder:"Enter delegate name"},domProps:{value:e.delegateName},on:{input:function(t){t.target.composing||(e.delegateName=t.target.value)}}})])])]):e._e(),e._v(" "),a("div",{staticClass:"field"},[a("label",[e._v("Passphrase")]),e._v(" "),a("div",{staticClass:"ui action input"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.passphrase,expression:"passphrase"}],staticClass:"input",attrs:{type:"password",placeholder:"Enter passphrase"},domProps:{value:e.passphrase},on:{input:function(t){t.target.composing||(e.passphrase=t.target.value)}}}),e._v(" "),a("button",{staticClass:"ui basic button",on:{click:function(t){t.preventDefault(),e.openCodeScanner()}}},[a("i",{staticClass:"fa fa-qrcode"})])])]),e._v(" "),a("button",{staticClass:"ui button green",on:{click:function(t){t.preventDefault(),e.vote()}}},[a("i",{staticClass:"fa fa-thumbs-up"}),e._v("\n        Vote\n      ")]),e._v(" "),a("button",{staticClass:"ui button basic",on:{click:function(t){t.preventDefault(),e.closeVoteForm()}}},[a("i",{staticClass:"fa fa-remove"}),e._v("\n        Close\n      ")])])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui header left aligned"},[t("i",{staticClass:"fa fa-thumbs-up"}),this._v(" "),t("div",{staticClass:"content"},[this._v("\n      Vote\n    ")])])}]};t.a=s},FZkX:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}(a("Yt4M")),n=a("wgAu");t.default={name:"delegateVote",data:function(){return{selectedDelegate:null,delegateName:"",passphrase:"",delegates:[]}},watch:{selectedDelegate:function(e){this.delegateName=e},qrScanner:function(e){"SignTransaction"===e.action&&(this.passphrase=e.payload),this.$store.dispatch("clearCodeScanned")}},computed:{wallet:function(){return this.$store.getters.wallet},qrScanner:function(){return this.$store.getters.qrScanner},currentDelegate:function(){return this.wallet.delegate}},methods:{vote:function(){var e=this;return""===this.delegateName?(0,n.errorNotification)("Delegate not selected"):""===this.passphrase?(0,n.errorNotification)("Passphrase is not valid"):void s.getDelegateByUsername(this.delegateName).then(function(t){if(!t)return(0,n.errorNotification)("Delegate not found");e.createVoteTransaction(t.publicKey)})},createVoteTransaction:function(e){var t=s.createVoteTransaction({passphrase:this.passphrase,delegates:["+"+e],secondPassphrase:null});console.log(t),this.$modal.show("confirmSendModal",{transaction:t})},openCodeScanner:function(e){this.$modal.show("scanCodeModal",{action:"SignTransaction"})},closeVoteForm:function(){this.$store.dispatch("toggleVoteForm",!1)}},mounted:function(){var e=this;s.getDelegates({limit:51,orderBy:"rate:asc"}).then(function(t){e.delegates=t})}}},VovI:function(e,t,a){(e.exports=a("FZ+f")(!0)).push([e.i,"","",{version:3,sources:[],names:[],mappings:"",file:"DelegateVote.vue",sourceRoot:""}])},WtHv:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("FZkX"),n=a.n(s),i=a("/IiG"),o=function(e){a("xpPn")},r=a("VU/8")(n.a,i.a,!1,o,"data-v-f5d64cf0",null);t.default=r.exports},xpPn:function(e,t,a){var s=a("VovI");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);a("rjj0")("35355c7a",s,!0)}});