webpackJsonp([35],{302:function(e,t,n){"use strict";n.d(t,"a",function(){returnU});varo,a,i,r=n(2),s=n.n(r),c=n(1),l=n.n(c),u=n(3),d=n.n(u),p=n(4),h=n.n(p),m=n(0),f=n.n(m),g=n(303),v=n(100),y=n(14),b=n.n(y),k=n(5),_=n.n(k),w=n(304),C=n(306),x=n(311),j=n(7),O=n(313),S=n(314),M=n(316),D=n(318),N=n(319),P=n(321),T=n(327),F=n(43),z=n(12),I=n.n(z),R=n(99),E=(n.n(R),n(329)),A=n(13),q="><\u2028\u2029\t\n\v\f\r",L=Object(j.f)({placeholder:{id:"compose_form.placeholder",defaultMessage:"What is on your mind?"},spoiler_placeholder:{id:"compose_form.spoiler_placeholder",defaultMessage:"Write your warning here"},publish:{id:"compose_form.publish",defaultMessage:"Toot"},publishLoud:{id:"compose_form.publish_loud",defaultMessage:"{publish}!"}}),U=Object(j.g)((i=a=function(e){functiont(){varn,o,a;l()(this,t);for(vari=arguments.length,r=Array(i),s=0;s<i;s++)r[s]=arguments[s];returnn=o=d()(this,e.call.apply(e,[this].concat(r))),o.handleChange=function(e){o.props.onChange(e.target.value)},o.handleKeyDown=function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&o.handleSubmit()},o.handleSubmit=function(){o.props.text!==o.autosuggestTextarea.textarea.value&&o.props.onChange(o.autosuggestTextarea.textarea.value);vare=o.props,t=e.is_submitting,n=e.is_uploading,a=e.anyMedia,i=[o.props.spoiler_text,Object(E.a)(o.props.text)].join("");t||n||Object(R.length)(i)>A.c||0!==i.length&&0===i.trim().length&&!a||o.props.onSubmit()},o.onSuggestionsClearRequested=function(){o.props.onClearSuggestions()},o.onSuggestionsFetchRequested=function(e){o.props.onFetchSuggestions(e)},o.onSuggestionSelected=function(e,t,n){o.props.onSuggestionSelected(e,t,n)},o.handleChangeSpoilerText=function(e){o.props.onChangeSpoilerText(e.target.value)},o.setAutosuggestTextarea=function(e){o.autosuggestTextarea=e},o.handleEmojiPick=function(e){vart=o.props.text,n=o.autosuggestTextarea.textarea.selectionStart,a=e.custom&&n>0&&!q.includes(t[n-1]);o.props.onPickEmoji(n,e,a)},a=n,d()(o,a)}returnh()(t,e),t.prototype.componentDidUpdate=function(e){if(this.props.focusDate!==e.focusDate){vart=void0,n=void0;this.props.preselectDate!==e.preselectDate?(t=this.props.text.length,n=this.props.text.search(/\s/)+1):"number"==typeofthis.props.caretPosition?(n=this.props.caretPosition,t=this.props.caretPosition):(t=this.props.text.length,n=t),this.autosuggestTextarea.textarea.setSelectionRange(n,t),this.autosuggestTextarea.textarea.focus()}elsee.is_submitting&&!this.props.is_submitting&&this.autosuggestTextarea.textarea.focus()},t.prototype.render=function(){vare=this.props,t=e.intl,n=e.onPaste,o=e.showSearch,a=e.anyMedia,i=this.props.is_submitting,r=[this.props.spoiler_text,Object(E.a)(this.props.text)].join(""),c=i||this.props.is_uploading||Object(R.length)(r)>A.c||0!==r.length&&0===r.trim().length&&!a,l="";returnl="private"===this.props.privacy||"direct"===this.props.privacy?s()("span",{className:"compose-form__publish-private"},void0,s()("i",{className:"fa fa-lock"})," ",t.formatMessage(L.publish)):"unlisted"!==this.props.privacy?t.formatMessage(L.publishLoud,{publish:t.formatMessage(L.publish)}):t.formatMessage(L.publish),s()("div",{className:"compose-form"},void0,s()(T.a,{}),s()(O.a,{isVisible:this.props.spoiler,fullHeight:50},void0,s()("div",{className:"spoiler-input"},void0,s()("label",{},void0,s()("span",{style:{display:"none"}},void0,t.formatMessage(L.spoiler_placeholder)),s()("input",{placeholder:t.formatMessage(L.spoiler_placeholder),value:this.props.spoiler_text,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,type:"text",className:"spoiler-input__input",id:"cw-spoiler-input"})))),s()(w.a,{}),s()("div",{className:"compose-form__autosuggest-wrapper"},void0,f.a.createElement(C.a,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(L.placeholder),disabled:i,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onKeyDown:this.handleKeyDown,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSugg