(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{1882:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return _});a(10),a(9),a(24),a(98),a(69),a(158);var n=a(8),r=a.n(n),o=a(17),i=a.n(o),c=a(554),l=a(577),s=a(727),u=a.n(s),p=a(592),m=a(160),f=a(566);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t,a){return t&&y(e.prototype,t),a&&y(e,a),e}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var _=function(e){function t(e){var a,n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(a=!(r=h(t).call(this,e))||"object"!==d(r)&&"function"!=typeof r?v(n):r).handleAllow=a.handleAllow.bind(v(v(a))),a.handleDeny=a.handleDeny.bind(v(v(a))),a.state={},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(t,i.a.Component),b(t,null,[{key:"propTypes",get:function(){return{location:r.a.object.isRequired,params:r.a.object.isRequired}}}]),b(t,[{key:"UNSAFE_componentWillMount",value:function(){var e=this,t=new URLSearchParams(this.props.location.search).get("client_id");/^[a-z0-9]+$/.test(t)&&Object(l.n)(t,function(t){e.setState({app:t})})}},{key:"componentDidMount",value:function(){var e=document.getElementById("antiClickjack");e&&e.parentNode.removeChild(e)}},{key:"handleAllow",value:function(){var e=this,t=new URLSearchParams(this.props.location.search);Object(l.d)(t,function(e){e.redirect&&(window.location.href=e.redirect)},function(t){e.setState({error:t.message})})}},{key:"handleDeny",value:function(){var e=new URLSearchParams(this.props.location.search).get("redirect_uri");e.startsWith("https://")||e.startsWith("http://")?window.location.href=e+"?error=access_denied":m.a.replace("/error")}},{key:"render",value:function(){var e,t,a=this.state.app;return a?(e=a.icon_url?a.icon_url:u.a,this.state.error&&(t=i.a.createElement("div",{className:"prompt__error form-group"},i.a.createElement(p.a,{error:this.state.error}))),i.a.createElement("div",{className:"container-fluid"},i.a.createElement("div",{className:"prompt"},i.a.createElement("div",{className:"prompt__heading"},i.a.createElement("div",{className:"prompt__app-icon"},i.a.createElement("img",{src:e,width:"50",height:"50",alt:""})),i.a.createElement("div",{className:"text"},i.a.createElement(f.a,{id:"authorize.title",defaultMessage:"**{appName}** would like to connect to your **Mattermost** user account",values:{appName:a.name}}))),i.a.createElement("p",null,i.a.createElement(f.a,{id:"authorize.app",defaultMessage:"The app **{appName}** would like the ability to access and modify your basic information.",values:{appName:a.name}})),i.a.createElement("h2",{className:"prompt__allow"},i.a.createElement(f.a,{id:"authorize.access",defaultMessage:"Allow **{appName}** access?",values:{appName:a.name}})),i.a.createElement("div",{className:"prompt__buttons"},i.a.createElement("button",{type:"submit",className:"btn btn-link authorize-btn",onClick:this.handleDeny},i.a.createElement(c.c,{id:"authorize.deny",defaultMessage:"Deny"})),i.a.createElement("button",{type:"submit",className:"btn btn-primary authorize-btn",onClick:this.handleAllow},i.a.createElement(c.c,{id:"authorize.allow",defaultMessage:"Allow"}))),t))):null}}]),t}()}}]);
//# sourceMappingURL=27.f8a52d80c608ad22cd7a.js.map