(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{622:function(t,e,n){"use strict";n.r(e);var o=n(0),r=n.n(o),u=n(6);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){return(i="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(t){return a(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":a(t)})(t)}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function f(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,p(e).call(this,t))}var n,o,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,t),n=e,(o=[{key:"render",value:function(){var t,e=this;return r.a.createElement("div",null,r.a.createElement("h4",null,"Token JWT"),r.a.createElement(u.a,{className:"input_item_input",struct:(t={},c(t,INPUT_TYPE,"text"),c(t,INPUT_NULL,!1),t),ref:function(t){return e.tokenInput=t}}),r.a.createElement("br",null),r.a.createElement("button",{onClick:function(){var t=e.tokenInput.getValue();null!==t&&e.updateData({tokenKey:t})},className:"button btn btn-primary"},lang("Save")))}},{key:"componentDidMount",value:function(){this.loadData()}},{key:"loadData",value:function(){var t=this;return App.loading(!0,"Loading..."),axios.request({url:"/control/control/read",method:"post"}).then((function(e){if(App.loading(!1,"Adding..."),!(e=e.data).result)return Promise.reject(e);t.tokenInput.setValue(e.data.tokenKey)})).catch((function(t){console.log(t),App.loading(!1,"Adding..."),error_handle(t)}))}},{key:"updateData",value:function(t){return App.loading(!0,"Loading..."),axios.request({url:"/control/control/update",method:"post",data:t}).then((function(t){if(App.loading(!1,"Adding..."),!(t=t.data).result)return Promise.reject(t);Swal(!0,"Success","success")})).catch((function(t){console.log(t),App.loading(!1,"Adding..."),error_handle(t)}))}}])&&l(n.prototype,o),a&&l(n,a),e}(o.Component);e.default=y}}]);