1(window.webpackJsonp=window.webpackJsonp||[]).push([[440],{1900:function(e,t,s){"use strict";s.r(t);var a=s(0),o=s(3),i=(s(35),s(1)),l=s(8),r=s(57),d=s(10),c=s.n(d),n=s(11);const p=Object(l.d)({legal:{id:"report.categories.legal",defaultMessage:"Legal"},other:{id:"report.categories.other",defaultMessage:"Other"},spam:{id:"report.categories.spam",defaultMessage:"Spam"},violation:{id:"report.categories.violation",defaultMessage:"Content violates one or more server rules"}});class h extends i.PureComponent{constructor(){super(...arguments),Object(o.a)(this,"handleClick",(()=>{const{id:e,disabled:t,onSelect:s}=this.props;t||s(e)}))}render(){const{id:e,text:t,disabled:s,selected:o,children:i}=this.props;return Object(a.a)("div",{tabIndex:0,role:"button",className:c()("report-reason-selector__category",{selected:o,disabled:s}),onClick:this.handleClick},void 0,o&&Object(a.a)("input",{type:"hidden",name:"report[category]",value:e}),Object(a.a)("div",{className:"report-reason-selector__category__label"},void 0,Object(a.a)("span",{className:c()("poll__input",{active:o,disabled:s})}),t),o&&i&&Object(a.a)("div",{className:"report-reason-selector__category__rules"},void 0,i))}}class u extends i.PureComponent{constructor(){super(...arguments),Object(o.a)(this,"handleClick",(()=>{const{id:e,disabled:t,onToggle:s}=this.props;t||s(e)}))}render(){const{id:e,text:t,disabled:s,selected:o}=this.props;return Object(a.a)("div",{tabIndex:0,role:"button",className:c()("report-reason-selector__rule",{selected:o,disabled:s}),onClick:this.handleClick},void 0,Object(a.a)("span",{className:c()("poll__input",{checkbox:!0,active:o,disabled:s})}),o&&Object(a.a)("input",{type:"hidden",name:"report[rule_ids][]",value:e}),t)}}class b extends i.PureComponent{constructor(){super(...arguments),Object(o.a)(this,"state",{category:this.props.category,rule_ids:this.props.rule_ids||[],rules:[]}),Object(o.a)(this,"_save",(()=>{const{id:e,disabled:t}=this.props,{category:s,rule_ids:a}=this.state;t||Object(n.f)(!1).put(`/api/v1/admin/reports/${e}`,{category:s,rule_ids:"violation"===s?a:[]}).catch((e=>{console.error(e)}))})),Object(o.a)(this,"handleSelect",(e=>{this.setState({category:e},(()=>this._save()))})),Object(o.a)(this,"handleToggle",(e=>{const{rule_ids:t}=this.state;t.includes(e)?this.setState({rule_ids:t.filter((t=>t!==e))},(()=>this._save())):this.setState({rule_ids:[...t,e]},(()=>this._save()))}))}componentDidMount(){Object(n.f)(!1).get("/api/v1/instance").then((e=>{this.setState({rules:e.data.rules})})).catch((e=>{console.error(e)}))}render(){const{disabled:e,intl:t}=this.props,{rules:s,category:o,rule_ids:i}=this.state;return Object(a.a)("div",{className:"report-reason-selector"},void 0,Object(a.a)(h,{id:"other",text:t.formatMessage(p.other),selected:"other"===o,onSelect:this.handleSelect,disabled:e}),Object(a.a)(h,{id:"legal",text:t.formatMessage(p.legal),selected:"legal"===o,onSelect:this.handleSelect,disabled:e}),Object(a.a)(h,{id:"spam",text:t.formatMessage(p.spam),selected:"spam"===o,onSelect:this.handleSelect,disabled:e}),Object(a.a)(h,{id:"violation",text:t.formatMessage(p.violation),selected:"violation"===o,onSelect:this.handleSelect,disabled:e||0===s.length},void 0,s.map((t=>Object(a.a)(u,{id:t.id,text:t.text,selected:i.includes(t.id),onToggle:this.handleToggle,disabled:e},t.id)))))}}t.default=Object(r.c)(b)}}]); 2//# sourceMappingURL=440-ef992ad22527bd30b997.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.