webpackJsonp([35],{293:function(e,t,n){"use strict";n.d(t,"a",function(){returnL});varo,i,a,r=n(2),s=n.n(r),c=n(1),u=n.n(c),l=n(3),d=n.n(l),p=n(4),f=n.n(p),h=n(0),m=n.n(h),g=n(294),v=n(100),y=n(14),b=n.n(y),_=n(5),k=n.n(_),C=n(295),j=n(297),w=n(302),x=n(7),O=n(304),S=n(306),M=n(308),D=n(309),T=n(311),N=n(317),F=n(43),P=n(12),I=n.n(P),R=n(99),E=(n.n(R),n(13)),A="><\u2028\u2029\t\n\v\f\r",z=Object(x.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}!"}}),L=Object(x.g)((a=i=function(e){functiont(){varn,o,i;u()(this,t);for(vara=arguments.length,r=Array(a),s=0;s<a;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,i=e.anyMedia,a=[o.props.spoiler_text,o.props.text].join("");t||n||Object(R.length)(a)>E.h||0!==a.length&&0===a.trim().length&&!i||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.setSpoilerText=function(e){o.spoilerText=e},o.handleEmojiPick=function(e){vart=o.props.text,n=o.autosuggestTextarea.textarea.selectionStart,i=e.custom&&n>0&&!A.includes(t[n-1]);o.props.onPickEmoji(n,e,i)},i=n,d()(o,i)}returnf()(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():this.props.spoiler!==e.spoiler&&(this.props.spoiler?this.spoilerText.focus():this.autosuggestTextarea.textarea.focus())},t.prototype.render=function(){vare=this.props,t=e.intl,n=e.onPaste,o=e.showSearch,i=e.anyMedia,a=this.props.is_submitting,r=[this.props.spoiler_text,this.props.text].join(""),c=a||this.props.is_uploading||Object(R.length)(r)>E.h||0!==r.length&&0===r.trim().length&&!i,u="";returnu="private"===this.props.privacy||"direct"===this.props.privacy?s()("span",{className:"compose-form__publish-private"},void0,s()("i",{className:"fa fa-lock"})," ",t.formatMessage(z.publish)):"unlisted"!==this.props.privacy?t.formatMessage(z.publishLoud,{publish:t.formatMessage(z.publish)}):t.formatMessage(z.publish),s()("div",{className:"compose-form"},void0,s()(N.a,{}),s()(C.a,{}),s()("div",{className:"spoiler-input "+(this.props.spoiler?"spoiler-input--visible":"")},void0,s()("label",{},void0,s()("span",{style:{display:"none"}},void0,t.formatMessage(z.spoiler_placeholder)),m.a.createElement("input",{placeholder:t.formatMessage(z.spoiler_placeholder),value:this.props.spoiler_text,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,type:"text",className:"spoiler-input__input",id:"cw-spoiler-input",ref:this.setSpoilerText}))),s()("div",{className:"compose-form__autosuggest-wrapper"},void0,m.a.createElement(j.a,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(z.placeholder),disabled:a,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onKeyDown