(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{R1i3:function(e,n,t){"use strict";t.r(n),t.d(n,"EditNotificationChannelPage",(function(){return P}));var r=t("q1tI"),o=t.n(r),i=t("t8hP"),a=t("kDLi"),c=t("ZGyg"),l=t("hBny"),u=t("0Tfw"),f=t("4vLh"),s=t("lzJ5"),p=t("X+V3"),h=t("gKHt"),b=t("qOGI");function y(e){return(y="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 d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){v(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function v(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function m(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function g(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,n){return!n||"object"!==y(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,n){return(w=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var P=function(e){function n(){var e,t;m(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(t=j(this,(e=C(n)).call.apply(e,[this].concat(o)))).onSubmit=function(e){var n=t.props.notificationChannel;t.props.updateNotificationChannel(O({},Object(h.c)(O({},n,{},e,{settings:O({},n.settings,{},e.settings)})),{id:n.id}))},t.onTestChannel=function(e){var n=t.props.notificationChannel;t.props.testNotificationChannel(Object(h.d)(O({},n,{},e,{settings:O({},n.settings,{},e.settings)})))},t}var t,r,l;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&w(e,n)}(n,e),t=n,(r=[{key:"componentDidMount",value:function(){var e=this.props.channelId;this.props.loadNotificationChannel(e)}},{key:"render",value:function(){var e=this,n=this.props,t=n.navModel,r=n.notificationChannel,l=n.notificationChannelTypes;return o.a.createElement(c.a,{navModel:t},o.a.createElement(c.a.Contents,null,o.a.createElement("h2",{className:"page-sub-heading"},"Edit notification channel"),r&&r.id>0?o.a.createElement(a.Form,{maxWidth:600,onSubmit:this.onSubmit,defaultValues:O({},r,{type:l.find((function(e){return e.value===r.type}))})},(function(n){var t=n.control,a=n.errors,c=n.getValues,f=n.register,s=n.watch,p=l.find((function(e){return e.value===c().type.value}));return o.a.createElement(u.a,{selectableChannels:Object(h.b)(l,!0),selectedChannel:p,imageRendererAvailable:i.config.rendererAvailable,onTestChannel:e.onTestChannel,register:f,watch:s,errors:a,getValues:c,control:t,resetSecureField:e.props.resetSecureField,secureFields:r.secureFields})})):o.a.createElement("div",null,"Loading notification channel",o.a.createElement(a.Spinner,null))))}}])&&g(t.prototype,r),l&&g(t,l),n}(r.PureComponent),E={loadNotificationChannel:f.h,testNotificationChannel:f.l,updateNotificationChannel:f.q,resetSecureField:b.g};n.default=Object(l.a)((function(e){var n=Object(p.c)(e.location);return{navModel:Object(s.a)(e.navIndex,"channels"),channelId:n,notificationChannel:e.notificationChannel.notificationChannel,notificationChannelTypes:e.notificationChannel.notificationChannelTypes}}),E,(function(e){return e.notificationChannel}))(P)},hBny:function(e,n,t){"use strict";t.d(n,"a",(function(){return u}));var r=t("/MKj"),o=t("zVNn"),i=t("q1tI"),a=t.n(i),c=t("2mql"),l=t.n(c),u=function(e,n,t){return function(c){var u=Object(r.connect)(e,n)(c),f=function(e){var n=Object(r.useDispatch)();return Object(i.useEffect)((function(){return function(){n(Object(o.a)({stateSelector:t}))}}),[]),a.a.createElement(u,e)};return f.displayName="ConnectWithCleanUp(".concat(u.displayName,")"),l()(f,c),f}}}}]);
//# sourceMappingURL=EditNotificationChannel.3b87c7ad03e52dfc5e30.js.map