(this.webpackJsonp=this.webpackJsonp||[]).push([[118],{"+hnl":function(e,t,n){},MKzF:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("+hnl")},cNeJ:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n("kaz8")),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(r=(u=i.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("MKzF");var a=n("q1tI"),u=c(a),i=c(n("vDqi"));function c(e){return e&&e.__esModule?e:{default:e}}n("j4F2"),t.default=function(e){var t=e.current_user,n=(0,a.useState)(),c=o(n,2),l=c[0],s=c[1],f=(0,a.useState)(),p=o(f,2),d=p[0],y=p[1],b=(0,a.useState)(),h=o(b,2),v=h[0],m=h[1];function g(e,n,r){var o=d,a=v;e?o[r]=n.target.checked:a[r]=n.target.checked,i.default.post("/users/"+t.login+"/template_message_settings/update_setting.json",{setting:{notification_body:o,email_body:a}}).then((function(e){e&&0===e.status&&O()}))}function O(){i.default.get("/users/"+t.login+"/template_message_settings.json").then((function(e){e&&200===e.status&&(m(e.data.email_body),y(e.data.notification_body))}))}return(0,a.useEffect)((function(){i.default.get("/template_message_settings.json").then((function(e){e&&200===e.status&&s(e.data.setting_types)})),O()}),[]),u.default.createElement("div",{className:"notice01"},u.default.createElement("div",{className:"sshHead"},u.default.createElement("span",{className:"text-shadow07"},"通知管理")),u.default.createElement("div",null,u.default.createElement("span",{className:"notice-manager-tip"},"您可以通过通知管理来选择接受通知的方式"),l&&d&&v&&l.map((function(e,t){return e.type_name&&u.default.createElement("div",{key:t},u.default.createElement("div",{className:"manager-cont-top"},e.type_name),e.settings.map((function(t,n){var o=e.type.substring(e.type.indexOf("::")+2)+"::"+t.key;return u.default.createElement("div",{className:"manager-cont",key:n},u.default.createElement("div",{className:"manager-cont-title"},t.name),u.default.createElement(r.default,{disabled:t.notification_disabled,defaultChecked:d[o],onChange:function(e){g(!0,e,o)}},"站内信"),u.default.createElement(r.default,{disabled:t.email_disabled,defaultChecked:v[o],onChange:function(e){g(!1,e,o)}},"邮件"))})))}))))}},kaz8:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("17x9"),a=n("VCL8"),u=n("TSYQ"),i=n.n(u),c=n("x1Ya"),l=n("Gytx"),s=n.n(l),f=n("H84U"),p=n("6CfX");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 y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(h=t.getOptions().map((function(e){return r.createElement(_,{prefixCls:d,key:e.value.toString(),disabled:"disabled"in e?e.disabled:a.disabled,value:e.value,checked:-1!==u.value.indexOf(e.value),onChange:e.onChange,className:"".concat(y,"-item")},e.label)})));var v=i()(y,l);return r.createElement("div",E({className:v,style:s},b),h)},t.state={value:e.value||e.defaultValue||[],registeredValues:[]},t}return t=u,o=[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value||[]}:null}}],(n=[{key:"getChildContext",value:function(){return{checkboxGroup:{toggleOption:this.toggleOption,value:this.state.value,disabled:this.props.disabled,name:this.props.name,registerValue:this.registerValue,cancelValue:this.cancelValue}}}},{key:"shouldComponentUpdate",value:function(e,t){return!s()(this.props,e)||!s()(this.state,t)}},{key:"getOptions",value:function(){return this.props.options.map((function(e){return"string"==typeof e?{label:e,value:e}:e}))}},{key:"render",value:function(){return r.createElement(f.a,null,this.renderGroup)}}])&&N(t.prototype,n),o&&N(t,o),u}(r.Component);D.defaultProps={options:[]},D.propTypes={defaultValue:o.array,value:o.array,options:o.array.isRequired,onChange:o.func},D.childContextTypes={checkboxGroup:o.any},Object(a.polyfill)(D);var U=D;_.Group=U;t.default=_}}]);