Merge branch 'fix/attachments-cleanup' into 'develop'
[akkoma] / priv / static / packs / features / compose.js
index a30deefbf7dba1fe462b32ca8d23e9719014f981..4238d46273abca1e60b996e53f03dec764b48121 100644 (file)
@@ -1,2 +1,2 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{660:function(e,l,u){"use strict";(function(e){u.d(l,"a",function(){return r});var n=u(1),a=u(7),t=u(3),o=u.n(t),s=u(91),i=u.n(s),c=e.env.CDN_HOST||"",r=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.render=function(){var e,t=this.props.emoji;if(t.custom)e=t.imageUrl;else{var a=i.a[t.native]||i.a[t.native.replace(/\uFE0F$/,"")];if(!a)return null;e=c+"/emoji/"+a.filename+".svg"}return Object(n.a)("div",{className:"autosuggest-emoji"},void 0,Object(n.a)("img",{className:"emojione",src:e,alt:t.native||t.colons}),t.colons)},t}(o.a.PureComponent)}).call(this,u(57))},661:function(e,I,T){"use strict";(function(e){T.d(I,"a",function(){return D});var t,a,n,o,l,s,d=T(1),i=T(7),c=T(0),r=T(2),u=T(3),p=T.n(u),b=T(6),g=T(48),h=T(171),m=T.n(h),f=T(12),j=T.n(f),O=T(63),v=T.n(O),_=T(73),y=Object(b.f)({emoji:{id:"emoji_button.label",defaultMessage:"Insert emoji"},emoji_search:{id:"emoji_button.search",defaultMessage:"Search..."},emoji_not_found:{id:"emoji_button.not_found",defaultMessage:"No emojos!! (╯°□°)╯︵ ┻━┻"},custom:{id:"emoji_button.custom",defaultMessage:"Custom"},recent:{id:"emoji_button.recent",defaultMessage:"Frequently used"},search_results:{id:"emoji_button.search_results",defaultMessage:"Search results"},people:{id:"emoji_button.people",defaultMessage:"People"},nature:{id:"emoji_button.nature",defaultMessage:"Nature"},food:{id:"emoji_button.food",defaultMessage:"Food & Drink"},activity:{id:"emoji_button.activity",defaultMessage:"Activity"},travel:{id:"emoji_button.travel",defaultMessage:"Travel & Places"},objects:{id:"emoji_button.objects",defaultMessage:"Objects"},symbols:{id:"emoji_button.symbols",defaultMessage:"Symbols"},flags:{id:"emoji_button.flags",defaultMessage:"Flags"}}),k=e.env.CDN_HOST||"",C=function(){return k+"/emoji/sheet_10.png"},S=!!v.a.hasSupport&&{passive:!0},M=["recent","custom","people","nature","foods","activity","places","objects","symbols","flags"],w=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleClick",function(e){t.props.onSelect(1*e.currentTarget.getAttribute("data-index"))}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleDocumentClick",function(e){t.node&&!t.node.contains(e.target)&&t.props.onClose()}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"setRef",function(e){t.node=e}),t}Object(i.a)(e,o);var t=e.prototype;return t.componentWillReceiveProps=function(e){e.active?this.attachListeners():this.removeListeners()},t.componentWillUnmount=function(){this.removeListeners()},t.attachListeners=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,S)},t.removeListeners=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,S)},t.render=function(){var e=this.props.active;return p.a.createElement("div",{className:"emoji-picker-dropdown__modifiers__menu",style:{display:e?"block":"none"},ref:this.setRef},Object(d.a)("button",{onClick:this.handleClick,"data-index":1},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:1,backgroundImageFn:C})),Object(d.a)("button",{onClick:this.handleClick,"data-index":2},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:2,backgroundImageFn:C})),Object(d.a)("button",{onClick:this.handleClick,"data-index":3},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:3,backgroundImageFn:C})),Object(d.a)("button",{onClick:this.handleClick,"data-index":4},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:4,backgroundImageFn:C})),Object(d.a)("button",{onClick:this.handleClick,"data-index":5},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:5,backgroundImageFn:C})),Object(d.a)("button",{onClick:this.handleClick,"data-index":6},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:6,backgroundImageFn:C})))},e}(p.a.PureComponent),x=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleClick",function(){t.props.active?t.props.onClose():t.props.onOpen()}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleSelect",function(e){t.props.onChange(e),t.props.onClose()}),t}return Object(i.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.active,a=e.modifier;return Object(d.a)("div",{className:"emoji-picker-dropdown__modifiers"},void 0,Object(d.a)(s,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:a,onClick:this.handleClick,backgroundImageFn:C}),Object(d.a)(w,{active:t,onSelect:this.handleSelect,onClose:this.props.onClose}))},e}(p.a.PureComponent),N=Object(b.g)((n=a=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(r.a)(Object(c.a)(Object(c.a)(t)),"state",{modifierOpen:!1,placement:null}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleDocumentClick",function(e){t.node&&!t.node.contains(e.target)&&t.props.onClose()}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"setRef",function(e){t.node=e}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"getI18n",function(){var e=t.props.intl;return{search:e.formatMessage(y.emoji_search),notfound:e.formatMessage(y.emoji_not_found),categories:{search:e.formatMessage(y.search_results),recent:e.formatMessage(y.recent),people:e.formatMessage(y.people),nature:e.formatMessage(y.nature),foods:e.formatMessage(y.food),activity:e.formatMessage(y.activity),places:e.formatMessage(y.travel),objects:e.formatMessage(y.objects),symbols:e.formatMessage(y.symbols),flags:e.formatMessage(y.flags),custom:e.formatMessage(y.custom)}}}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleClick",function(e){e.native||(e.native=e.colons),t.props.onClose(),t.props.onPick(e)}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleModifierOpen",function(){t.setState({modifierOpen:!0})}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleModifierClose",function(){t.setState({modifierOpen:!1})}),Object(r.a)(Object(c.a)(Object(c.a)(t)),"handleModifierChange",function(e){t.props.onSkinTone(e)}),t}Object(i.a)(e,o);var t=e.prototype;return t.componentDidMount=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,S)},t.componentWillUnmount=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,S)},t.render=function(){var e=this.props,t=e.loading,a=e.style,n=e.intl,o=e.custom_emojis,s=e.skinTone,i=e.frequentlyUsedEmojis;if(t)return Object(d.a)("div",{style:{width:299}});var c=n.formatMessage(y.emoji),r=this.state.modifierOpen;return p.a.createElement("div",{className:j()("emoji-picker-dropdown__menu",{selecting:r}),style:a,ref:this.setRef},Object(d.a)(l,{perLine:8,emojiSize:22,sheetSize:32,custom:Object(_.buildCustomEmojis)(o),color:"",emoji:"",set:"twitter",title:c,i18n:this.getI18n(),onClick:this.handleClick,include:M,recent:i,skin:s,showPreview:!1,backgroundImageFn:C,autoFocus:!0,emojiTooltip:!0}),Object(d.a)(x,{active:r,modifier:s,onOpen:this.handleModifierOpen,onClose:this.handleModifierClose,onChange:this.handleModifierChange}))},e}(p.a.PureComponent),Object(r.a)(a,"defaultProps",{style:{},loading:!0,frequentlyUsedEmojis:[]}),t=n))||t,D=Object(b.g)(o=function(o){function e(){for(var n,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return n=o.call.apply(o,[this].concat(t))||this,Object(r.a)(Object(c.a)(Object(c.a)(n)),"state",{active:!1,loading:!1}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"setRef",function(e){n.dropdown=e}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"onShowDropdown",function(e){var t=e.target;n.setState({active:!0}),l||(n.setState({loading:!0}),Object(g.i)().then(function(e){l=e.Picker,s=e.Emoji,n.setState({loading:!1})}).catch(function(){n.setState({loading:!1})}));var a=t.getBoundingClientRect().top;n.setState({placement:2*a<innerHeight?"bottom":"top"})}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"onHideDropdown",function(){n.setState({active:!1})}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"onToggle",function(e){n.state.loading||e.key&&"Enter"!==e.key||(n.state.active?n.onHideDropdown():n.onShowDropdown(e))}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"handleKeyDown",function(e){"Escape"===e.key&&n.onHideDropdown()}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"setTargetRef",function(e){n.target=e}),Object(r.a)(Object(c.a)(Object(c.a)(n)),"findTarget",function(){return n.target}),n}return Object(i.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.intl,a=e.onPickEmoji,n=e.onSkinTone,o=e.skinTone,s=e.frequentlyUsedEmojis,i=t.formatMessage(y.emoji),c=this.state,r=c.active,l=c.loading,u=c.placement;return Object(d.a)("div",{className:"emoji-picker-dropdown",onKeyDown:this.handleKeyDown},void 0,p.a.createElement("div",{ref:this.setTargetRef,className:"emoji-button",title:i,"aria-label":i,"aria-expanded":r,role:"button",onClick:this.onToggle,onKeyDown:this.onToggle,tabIndex:0},Object(d.a)("img",{className:j()("emojione",{"pulse-loading":r&&l}),alt:"🙂",src:k+"/emoji/1f602.svg"})),Object(d.a)(m.a,{show:r,placement:u,target:this.findTarget},void 0,Object(d.a)(N,{custom_emojis:this.props.custom_emojis,loading:l,onClose:this.onHideDropdown,onPick:a,onSkinTone:n,skinTone:o,frequentlyUsedEmojis:s})))},e}(p.a.PureComponent))||o}).call(this,T(57))},700:function(e,t,a){"use strict";var n,o,s,i=a(20),u=a(1),c=a(7),r=a(0),d=a(2),l=a(3),p=a.n(l),b=a(292),g=function(e){function t(){return e.apply(this,arguments)||this}Object(c.a)(t,e);var a=t.prototype;return a.checkRemainingText=function(e){return e<0?Object(u.a)("span",{className:"character-counter character-counter--over"},void 0,e):Object(u.a)("span",{className:"character-counter"},void 0,e)},a.render=function(){var e=this.props.max-Object(b.length)(this.props.text);return this.checkRemainingText(e)},t}(p.a.PureComponent),h=a(181),m=a(26),f=a.n(m),j=a(5),O=a.n(j),v=a(23),_=a(156),y=a(142),k=a(66),C=a(143),S=a(6),M=a(24),w=a(295),x=Object(S.f)({cancel:{id:"reply_indicator.cancel",defaultMessage:"Cancel"}}),N=Object(S.g)((s=o=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleClick",function(){t.props.onCancel()}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleAccountClick",function(e){0!==e.button||e.ctrlKey||e.metaKey||(e.preventDefault(),t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"])))}),t}return Object(c.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.status,a=e.intl;if(!t)return null;var n={__html:t.get("contentHtml")},o={direction:Object(w.a)(t.get("search_index"))?"rtl":"ltr"};return Object(u.a)("div",{className:"reply-indicator"},void 0,Object(u.a)("div",{className:"reply-indicator__header"},void 0,Object(u.a)("div",{className:"reply-indicator__cancel"},void 0,Object(u.a)(k.a,{title:a.formatMessage(x.cancel),icon:"times",onClick:this.handleClick,inverted:!0})),Object(u.a)("a",{href:t.getIn(["account","url"]),onClick:this.handleAccountClick,className:"reply-indicator__display-name"},void 0,Object(u.a)("div",{className:"reply-indicator__display-avatar"},void 0,Object(u.a)(y.a,{account:t.get("account"),size:24})),Object(u.a)(C.a,{account:t.get("account")}))),Object(u.a)("div",{className:"reply-indicator__content",style:o,dangerouslySetInnerHTML:n}))},e}(M.a),Object(d.a)(o,"contextTypes",{router:O.a.object}),Object(d.a)(o,"propTypes",{status:f.a.map,onCancel:O.a.func.isRequired,intl:O.a.object.isRequired}),n=s))||n,D=Object(i.connect)(function(){var t=Object(_.f)();return function(e){return{status:t(e,{id:e.getIn(["compose","in_reply_to"])})}}},function(e){return{onCancel:function(){e(Object(v.E)())}}})(N),I=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.render=function(){var e=this.props.account;return Object(u.a)("div",{className:"autosuggest-account",title:e.get("acct")},void 0,Object(u.a)("div",{className:"autosuggest-account-icon"},void 0,Object(u.a)(y.a,{account:e,size:18})),Object(u.a)(C.a,{account:e}))},t}(M.a);Object(d.a)(I,"propTypes",{account:f.a.map.isRequired});var T,P,R,E=Object(i.connect)(function(){var n=Object(_.d)();return function(e,t){var a=t.id;return{account:n(e,a)}}})(I),F=a(660),q=a(526),A=a(12),K=a.n(A),L=function(n){function e(){for(var l,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return l=n.call.apply(n,[this].concat(t))||this,Object(d.a)(Object(r.a)(Object(r.a)(l)),"state",{suggestionsHidden:!1,selectedSuggestion:0,lastToken:null,tokenStart:0}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"onChange",function(e){var t,a,n,o,s,i=(t=e.target.value,a=e.target.selectionStart,o=t.slice(0,a).search(/\S+$/),s=t.slice(a).search(/\s/),!(n=s<0?t.slice(o):t.slice(o,s+a))||n.trim().length<3||-1===["@",":","#"].indexOf(n[0])?[null,null]:0<(n=n.trim().toLowerCase()).length?[o+1,n]:[null,null]),c=i[0],r=i[1];null!==r&&l.state.lastToken!==r?(l.setState({lastToken:r,selectedSuggestion:0,tokenStart:c}),l.props.onSuggestionsFetchRequested(r)):null===r&&(l.setState({lastToken:null}),l.props.onSuggestionsClearRequested()),l.props.onChange(e)}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"onKeyDown",function(e){var t=l.props,a=t.suggestions,n=t.disabled,o=l.state,s=o.selectedSuggestion,i=o.suggestionsHidden;if(n)e.preventDefault();else if(229!==e.which&&!e.isComposing){switch(e.key){case"Escape":0===a.size||i?document.querySelector(".ui").parentElement.focus():(e.preventDefault(),l.setState({suggestionsHidden:!0}));break;case"ArrowDown":0<a.size&&!i&&(e.preventDefault(),l.setState({selectedSuggestion:Math.min(s+1,a.size-1)}));break;case"ArrowUp":0<a.size&&!i&&(e.preventDefault(),l.setState({selectedSuggestion:Math.max(s-1,0)}));break;case"Enter":case"Tab":null!==l.state.lastToken&&0<a.size&&!i&&(e.preventDefault(),e.stopPropagation(),l.props.onSuggestionSelected(l.state.tokenStart,l.state.lastToken,a.get(s)))}!e.defaultPrevented&&l.props.onKeyDown&&l.props.onKeyDown(e)}}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"onBlur",function(){l.setState({suggestionsHidden:!0})}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"onSuggestionClick",function(e){var t=l.props.suggestions.get(e.currentTarget.getAttribute("data-index"));e.preventDefault(),l.props.onSuggestionSelected(l.state.tokenStart,l.state.lastToken,t),l.textarea.focus()}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"setTextarea",function(e){l.textarea=e}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"onPaste",function(e){e.clipboardData&&1===e.clipboardData.files.length&&(l.props.onPaste(e.clipboardData.files),e.preventDefault())}),Object(d.a)(Object(r.a)(Object(r.a)(l)),"renderSuggestion",function(e,t){var a,n,o=l.state.selectedSuggestion;return n="object"==typeof e?(a=Object(u.a)(F.a,{emoji:e}),e.id):"#"===e[0]?a=e:(a=Object(u.a)(E,{id:e}),e),Object(u.a)("div",{role:"button",tabIndex:"0","data-index":t,className:K()("autosuggest-textarea__suggestions__item",{selected:t===o}),onMouseDown:l.onSuggestionClick},n,a)}),l}Object(c.a)(e,n);var t=e.prototype;return t.componentWillReceiveProps=function(e){e.suggestions!==this.props.suggestions&&0<e.suggestions.size&&this.state.suggestionsHidden&&this.setState({suggestionsHidden:!1})},t.render=function(){var e=this.props,t=e.value,a=e.suggestions,n=e.disabled,o=e.placeholder,s=e.onKeyUp,i=e.autoFocus,c=this.state.suggestionsHidden,r={direction:"ltr"};return Object(w.a)(t)&&(r.direction="rtl"),Object(u.a)("div",{className:"autosuggest-textarea"},void 0,Object(u.a)("label",{},void 0,Object(u.a)("span",{style:{display:"none"}},void 0,o),Object(u.a)(q.a,{inputRef:this.setTextarea,className:"autosuggest-textarea__textarea",disabled:n,placeholder:o,autoFocus:i,value:t,onChange:this.onChange,onKeyDown:this.onKeyDown,onKeyUp:s,onBlur:this.onBlur,onPaste:this.onPaste,style:r,"aria-autocomplete":"list"})),Object(u.a)("div",{className:"autosuggest-textarea__suggestions "+(c||a.isEmpty()?"":"autosuggest-textarea__suggestions--visible")},void 0,a.map(this.renderSuggestion)))},e}(M.a);Object(d.a)(L,"propTypes",{value:O.a.string,suggestions:f.a.list,disabled:O.a.bool,placeholder:O.a.string,onSuggestionSelected:O.a.func.isRequired,onSuggestionsClearRequested:O.a.func.isRequired,onSuggestionsFetchRequested:O.a.func.isRequired,onChange:O.a.func.isRequired,onKeyUp:O.a.func,onKeyDown:O.a.func,onPaste:O.a.func.isRequired,autoFocus:O.a.bool}),Object(d.a)(L,"defaultProps",{autoFocus:!0});var z,W,U,H,B=Object(S.f)({upload:{id:"upload_button.label",defaultMessage:"Add media (JPEG, PNG, GIF, WebM, MP4, MOV)"}}),Y={height:null,lineHeight:"27px"},X=Object(i.connect)(function(){return function(e){return{acceptContentTypes:e.getIn(["media_attachments","accept_content_types"])}}})(T=Object(S.g)((R=P=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleChange",function(e){0<e.target.files.length&&t.props.onSelectFile(e.target.files)}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleClick",function(){t.fileElement.click()}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"setRef",function(e){t.fileElement=e}),t}return Object(c.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.intl,a=e.resetFileKey,n=e.disabled,o=e.acceptContentTypes;return Object(u.a)("div",{className:"compose-form__upload-button"},void 0,Object(u.a)(k.a,{icon:"camera",title:t.formatMessage(B.upload),disabled:n,onClick:this.handleClick,className:"compose-form__upload-button-icon",size:18,inverted:!0,style:Y}),Object(u.a)("label",{},void 0,Object(u.a)("span",{style:{display:"none"}},void 0,t.formatMessage(B.upload)),p.a.createElement("input",{key:a,ref:this.setRef,type:"file",multiple:!0,accept:o.toArray().join(","),onChange:this.handleChange,disabled:n,style:{display:"none"}})))},e}(M.a),Object(d.a)(P,"propTypes",{disabled:O.a.bool,onSelectFile:O.a.func.isRequired,style:O.a.object,resetFileKey:O.a.number,acceptContentTypes:f.a.listOf(O.a.string).isRequired,intl:O.a.object.isRequired}),T=R))||T)||T,G=Object(i.connect)(function(e){return{disabled:e.getIn(["compose","is_uploading"])||3<e.getIn(["compose","media_attachments"]).size||e.getIn(["compose","media_attachments"]).some(function(e){return"video"===e.get("type")}),resetFileKey:e.getIn(["compose","resetFileKey"])}},function(t){return{onSelectFile:function(e){t(Object(v.Z)(e))}}})(X),J=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleClick",function(e){e.preventDefault(),t.props.onClick()}),t}return Object(c.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.label,a=e.title,n=e.active,o=e.ariaControls;return Object(u.a)("button",{title:a,"aria-label":a,className:"text-icon-button "+(n?"active":""),"aria-expanded":n,onClick:this.handleClick,"aria-controls":o},void 0,t)},e}(p.a.PureComponent),Z=Object(S.f)({marked:{id:"compose_form.spoiler.marked",defaultMessage:"Text is hidden behind warning"},unmarked:{id:"compose_form.spoiler.unmarked",defaultMessage:"Text is not hidden"}}),V=Object(S.g)(Object(i.connect)(function(e,t){return{label:"CW",title:t.intl.formatMessage(e.getIn(["compose","spoiler"])?Z.marked:Z.unmarked),active:e.getIn(["compose","spoiler"]),ariaControls:"cw-spoiler-input"}},function(e){return{onClick:function(){e(Object(v.I)())}}})(J)),$=a(21),Q=a(171),ee=a.n(Q),te=a(141),ae=a(46),ne=a.n(ae),oe=a(63),se=a.n(oe),ie=a(33),ce=Object(S.f)({public_short:{id:"privacy.public.short",defaultMessage:"Public"},public_long:{id:"privacy.public.long",defaultMessage:"Post to public timelines"},unlisted_short:{id:"privacy.unlisted.short",defaultMessage:"Unlisted"},unlisted_long:{id:"privacy.unlisted.long",defaultMessage:"Do not show in public timelines"},private_short:{id:"privacy.private.short",defaultMessage:"Followers-only"},private_long:{id:"privacy.private.long",defaultMessage:"Post to followers only"},direct_short:{id:"privacy.direct.short",defaultMessage:"Direct"},direct_long:{id:"privacy.direct.long",defaultMessage:"Post to mentioned users only"},change_privacy:{id:"privacy.change",defaultMessage:"Adjust status privacy"}}),re=!!se.a.hasSupport&&{passive:!0},le=function(n){function e(){for(var s,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return s=n.call.apply(n,[this].concat(t))||this,Object(d.a)(Object(r.a)(Object(r.a)(s)),"state",{mounted:!1}),Object(d.a)(Object(r.a)(Object(r.a)(s)),"handleDocumentClick",function(e){s.node&&!s.node.contains(e.target)&&s.props.onClose()}),Object(d.a)(Object(r.a)(Object(r.a)(s)),"handleKeyDown",function(e){var t,a=s.props.items,n=e.currentTarget.getAttribute("data-index"),o=a.findIndex(function(e){return e.value===n});switch(e.key){case"Escape":s.props.onClose();break;case"Enter":s.handleClick(e);break;case"ArrowDown":(t=s.node.childNodes[o+1])&&(t.focus(),s.props.onChange(t.getAttribute("data-index")));break;case"ArrowUp":(t=s.node.childNodes[o-1])&&(t.focus(),s.props.onChange(t.getAttribute("data-index")));break;case"Home":(t=s.node.firstChild)&&(t.focus(),s.props.onChange(t.getAttribute("data-index")));break;case"End":(t=s.node.lastChild)&&(t.focus(),s.props.onChange(t.getAttribute("data-index")))}}),Object(d.a)(Object(r.a)(Object(r.a)(s)),"handleClick",function(e){var t=e.currentTarget.getAttribute("data-index");e.preventDefault(),s.props.onClose(),s.props.onChange(t)}),Object(d.a)(Object(r.a)(Object(r.a)(s)),"setRef",function(e){s.node=e}),Object(d.a)(Object(r.a)(Object(r.a)(s)),"setFocusRef",function(e){s.focusedItem=e}),s}Object(c.a)(e,n);var t=e.prototype;return t.componentDidMount=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,re),this.focusedItem&&this.focusedItem.focus(),this.setState({mounted:!0})},t.componentWillUnmount=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,re)},t.render=function(){var o=this,s=this.state.mounted,e=this.props,i=e.style,c=e.items,r=e.placement,l=e.value;return Object(u.a)(te.a,{defaultStyle:{opacity:0,scaleX:.85,scaleY:.75},style:{opacity:ne()(1,{damping:35,stiffness:400}),scaleX:ne()(1,{damping:35,stiffness:400}),scaleY:ne()(1,{damping:35,stiffness:400})}},void 0,function(e){var t=e.opacity,a=e.scaleX,n=e.scaleY;return p.a.createElement("div",{className:"privacy-dropdown__dropdown "+r,style:Object($.a)({},i,{opacity:t,transform:s?"scale("+a+", "+n+")":null}),role:"listbox",ref:o.setRef},c.map(function(e){return p.a.createElement("div",{role:"option",tabIndex:"0",key:e.value,"data-index":e.value,onKeyDown:o.handleKeyDown,onClick:o.handleClick,className:K()("privacy-dropdown__option",{active:e.value===l}),"aria-selected":e.value===l,ref:e.value===l?o.setFocusRef:null},Object(u.a)("div",{className:"privacy-dropdown__option__icon"},void 0,Object(u.a)(ie.a,{id:e.icon,fixedWidth:!0})),Object(u.a)("div",{className:"privacy-dropdown__option__content"},void 0,Object(u.a)("strong",{},void 0,e.text),e.meta))}))})},e}(p.a.PureComponent),ue=Object(S.g)(z=function(o){function e(){for(var n,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return n=o.call.apply(o,[this].concat(t))||this,Object(d.a)(Object(r.a)(Object(r.a)(n)),"state",{open:!1,placement:"bottom"}),Object(d.a)(Object(r.a)(Object(r.a)(n)),"handleToggle",function(e){var t=e.target;if(n.props.isUserTouching())n.state.open?n.props.onModalClose():n.props.onModalOpen({actions:n.options.map(function(e){return Object($.a)({},e,{active:e.value===n.props.value})}),onClick:n.handleModalActionClick});else{var a=t.getBoundingClientRect().top;n.setState({placement:2*a<innerHeight?"bottom":"top"}),n.setState({open:!n.state.open})}}),Object(d.a)(Object(r.a)(Object(r.a)(n)),"handleModalActionClick",function(e){e.preventDefault();var t=n.options[e.currentTarget.getAttribute("data-index")].value;n.props.onModalClose(),n.props.onChange(t)}),Object(d.a)(Object(r.a)(Object(r.a)(n)),"handleKeyDown",function(e){switch(e.key){case"Escape":n.handleClose()}}),Object(d.a)(Object(r.a)(Object(r.a)(n)),"handleClose",function(){n.setState({open:!1})}),Object(d.a)(Object(r.a)(Object(r.a)(n)),"handleChange",function(e){n.props.onChange(e)}),n}Object(c.a)(e,o);var t=e.prototype;return t.componentWillMount=function(){var e=this.props.intl.formatMessage;this.options=[{icon:"globe",value:"public",text:e(ce.public_short),meta:e(ce.public_long)},{icon:"unlock",value:"unlisted",text:e(ce.unlisted_short),meta:e(ce.unlisted_long)},{icon:"lock",value:"private",text:e(ce.private_short),meta:e(ce.private_long)},{icon:"envelope",value:"direct",text:e(ce.direct_short),meta:e(ce.direct_long)}]},t.render=function(){var e=this.props,t=e.value,a=e.intl,n=this.state,o=n.open,s=n.placement,i=this.options.find(function(e){return e.value===t});return Object(u.a)("div",{className:K()("privacy-dropdown",s,{active:o}),onKeyDown:this.handleKeyDown},void 0,Object(u.a)("div",{className:K()("privacy-dropdown__value",{active:0===this.options.indexOf(i)})},void 0,Object(u.a)(k.a,{className:"privacy-dropdown__value-icon",icon:i.icon,title:a.formatMessage(ce.change_privacy),size:18,expanded:o,active:o,inverted:!0,onClick:this.handleToggle,style:{height:null,lineHeight:"27px"}})),Object(u.a)(ee.a,{show:o,placement:s,target:this},void 0,Object(u.a)(le,{items:this.options,value:t,onClose:this.handleClose,onChange:this.handleChange,placement:s})))},e}(p.a.PureComponent))||z,de=a(50),pe=a(180),be=Object(i.connect)(function(e){return{isModalOpen:"ACTIONS"===e.get("modal").modalType,value:e.getIn(["compose","privacy"])}},function(t){return{onChange:function(e){t(Object(v.J)(e))},isUserTouching:pe.c,onModalOpen:function(e){return t(Object(de.d)("ACTIONS",e))},onModalClose:function(){return t(Object(de.c)())}}})(ue),ge=Object(S.f)({marked:{id:"compose_form.sensitive.marked",defaultMessage:"Media is marked as sensitive"},unmarked:{id:"compose_form.sensitive.unmarked",defaultMessage:"Media is not marked as sensitive"}}),he=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.render=function(){var e=this.props,o=e.visible,s=e.active,i=e.disabled,c=e.onClick,r=e.intl;return Object(u.a)(te.a,{defaultStyle:{scale:.87},style:{scale:ne()(o?1:.87,{stiffness:200,damping:3})}},void 0,function(e){var t=e.scale,a=s?"eye-slash":"eye",n=K()("compose-form__sensitive-button",{"compose-form__sensitive-button--visible":o});return Object(u.a)("div",{className:n,style:{transform:"scale("+t+")"}},void 0,Object(u.a)(k.a,{className:"compose-form__sensitive-button__icon",title:r.formatMessage(s?ge.marked:ge.unmarked),icon:a,onClick:c,size:18,active:s,disabled:i,style:{lineHeight:null,height:null},inverted:!0}))})},t}(p.a.PureComponent),me=Object(i.connect)(function(e){return{visible:0<e.getIn(["compose","media_attachments"]).size,active:e.getIn(["compose","sensitive"]),disabled:e.getIn(["compose","spoiler"])}},function(e){return{onClick:function(){e(Object(v.G)())}}})(Object(S.g)(he)),fe=a(661),je=a(86),Oe=a(60),ve=a(4),_e=a(219),ye=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","yum","disappointed","thinking_face","weary","sob","sunglasses","heart","ok_hand"],ke=Object(Oe.a)([function(e){return e.getIn(["settings","frequentlyUsedEmojis"],Object(ve.Map)())}],function(a){var t=a.keySeq().sort(function(e,t){return a.get(e)-a.get(t)}).reverse().slice(0,16).toArray();if(t.length<ye.length){var e=ye.filter(function(e){return!t.includes(e)});t=t.concat(e.slice(0,ye.length-t.length))}return t}),Ce=Object(Oe.a)([function(e){return e.get("custom_emojis")}],function(e){return e.filter(function(e){return e.get("visible_in_picker")}).sort(function(e,t){var a=e.get("shortcode").toLowerCase(),n=t.get("shortcode").toLowerCase();return a<n?-1:n<a?1:0})}),Se=Object(i.connect)(function(e){return{custom_emojis:Ce(e),skinTone:e.getIn(["settings","skinTone"]),frequentlyUsedEmojis:ke(e)}},function(t,e){var a=e.onPickEmoji;return{onSkinTone:function(e){t(Object(je.c)(["skinTone"],e))},onPickEmoji:function(e){t(Object(_e.b)(e)),a&&a(e)}}})(fe.a),Me=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.active,a=e.progress;return t?Object(u.a)("div",{className:"upload-progress"},void 0,Object(u.a)("div",{className:"upload-progress__icon"},void 0,Object(u.a)(ie.a,{id:"upload"})),Object(u.a)("div",{className:"upload-progress__message"},void 0,Object(u.a)(S.b,{id:"upload_progress.label",defaultMessage:"Uploading..."}),Object(u.a)("div",{className:"upload-progress__backdrop"},void 0,Object(u.a)(te.a,{defaultStyle:{width:0},style:{width:ne()(a)}},void 0,function(e){var t=e.width;return Object(u.a)("div",{className:"upload-progress__tracker",style:{width:t+"%"}})})))):null},t}(p.a.PureComponent),we=Object(i.connect)(function(e){return{active:e.getIn(["compose","is_uploading"]),progress:e.getIn(["compose","progress"])}})(Me),xe=Object(S.f)({description:{id:"upload_form.description",defaultMessage:"Describe for the visually impaired"}}),Ne=Object(S.g)((H=U=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(r.a)(Object(r.a)(t)),"state",{hovered:!1,focused:!1,dirtyDescription:null}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleKeyDown",function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&t.handleSubmit()}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleSubmit",function(){t.handleInputBlur(),t.props.onSubmit(t.context.router.history)}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleUndoClick",function(e){e.stopPropagation(),t.props.onUndo(t.props.media.get("id"))}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleFocalPointClick",function(e){e.stopPropagation(),t.props.onOpenFocalPoint(t.props.media.get("id"))}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleInputChange",function(e){t.setState({dirtyDescription:e.target.value})}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleMouseEnter",function(){t.setState({hovered:!0})}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleMouseLeave",function(){t.setState({hovered:!1})}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleInputFocus",function(){t.setState({focused:!0})}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleClick",function(){t.setState({focused:!0})}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleInputBlur",function(){var e=t.state.dirtyDescription;t.setState({focused:!1,dirtyDescription:null}),null!==e&&t.props.onDescriptionChange(t.props.media.get("id"),e)}),t}return Object(c.a)(e,o),e.prototype.render=function(){var a=this,e=this.props,n=e.intl,o=e.media,s=this.state.hovered||this.state.focused,i=this.state.dirtyDescription||""!==this.state.dirtyDescription&&o.get("description")||"",t=o.getIn(["meta","focus","x"]),c=o.getIn(["meta","focus","y"]),r=100*(t/2+.5),l=100*(c/-2+.5);return Object(u.a)("div",{className:"compose-form__upload",tabIndex:"0",onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleClick,role:"button"},void 0,Object(u.a)(te.a,{defaultStyle:{scale:.8},style:{scale:ne()(1,{stiffness:180,damping:12})}},void 0,function(e){var t=e.scale;return Object(u.a)("div",{className:"compose-form__upload-thumbnail",style:{transform:"scale("+t+")",backgroundImage:"url("+o.get("preview_url")+")",backgroundPosition:r+"% "+l+"%"}},void 0,Object(u.a)("div",{className:K()("compose-form__upload__actions",{active:s})},void 0,Object(u.a)("button",{className:"icon-button",onClick:a.handleUndoClick},void 0,Object(u.a)(ie.a,{id:"times"})," ",Object(u.a)(S.b,{id:"upload_form.undo",defaultMessage:"Delete"})),"image"===o.get("type")&&Object(u.a)("button",{className:"icon-button",onClick:a.handleFocalPointClick},void 0,Object(u.a)(ie.a,{id:"crosshairs"})," ",Object(u.a)(S.b,{id:"upload_form.focus",defaultMessage:"Crop"}))),Object(u.a)("div",{className:K()("compose-form__upload-description",{active:s})},void 0,Object(u.a)("label",{},void 0,Object(u.a)("span",{style:{display:"none"}},void 0,n.formatMessage(xe.description)),Object(u.a)("textarea",{placeholder:n.formatMessage(xe.description),value:i,maxLength:420,onFocus:a.handleInputFocus,onChange:a.handleInputChange,onBlur:a.handleInputBlur,onKeyDown:a.handleKeyDown}))))}))},e}(M.a),Object(d.a)(U,"contextTypes",{router:O.a.object}),Object(d.a)(U,"propTypes",{media:f.a.map.isRequired,intl:O.a.object.isRequired,onUndo:O.a.func.isRequired,onDescriptionChange:O.a.func.isRequired,onOpenFocalPoint:O.a.func.isRequired,onSubmit:O.a.func.isRequired}),W=H))||W,De=Object(i.connect)(function(e,t){var a=t.id;return{media:e.getIn(["compose","media_attachments"]).find(function(e){return e.get("id")===a})}},function(a){return{onUndo:function(e){a(Object(v.X)(e))},onDescriptionChange:function(e,t){a(Object(v.L)(e,{description:t}))},onOpenFocalPoint:function(e){a(Object(de.d)("FOCAL_POINT",{id:e}))},onSubmit:function(e){a(Object(v.W)(e))}}})(Ne),Ie=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.render=function(){var e=this.props.mediaIds;return Object(u.a)("div",{className:"compose-form__upload-wrapper"},void 0,Object(u.a)(we,{}),Object(u.a)("div",{className:"compose-form__uploads-wrapper"},void 0,e.map(function(e){return Object(u.a)(De,{id:e},e)})))},t}(M.a);Object(d.a)(Ie,"propTypes",{mediaIds:f.a.list.isRequired});var Te,Pe,Re,Ee=Object(i.connect)(function(e){return{mediaIds:e.getIn(["compose","media_attachments"]).map(function(e){return e.get("id")})}})(Ie),Fe=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.render=function(){var o=this.props.message;return Object(u.a)(te.a,{defaultStyle:{opacity:0,scaleX:.85,scaleY:.75},style:{opacity:ne()(1,{damping:35,stiffness:400}),scaleX:ne()(1,{damping:35,stiffness:400}),scaleY:ne()(1,{damping:35,stiffness:400})}},void 0,function(e){var t=e.opacity,a=e.scaleX,n=e.scaleY;return Object(u.a)("div",{className:"compose-form__warning",style:{opacity:t,transform:"scale("+a+", "+n+")"}},void 0,o)})},t}(p.a.PureComponent),qe=a(22),Ae=/(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i,Ke=Object(i.connect)(function(e){return{needsLockWarning:"private"===e.getIn(["compose","privacy"])&&!e.getIn(["accounts",qe.k,"locked"]),hashtagWarning:"public"!==e.getIn(["compose","privacy"])&&Ae.test(e.getIn(["compose","text"])),directMessageWarning:"direct"===e.getIn(["compose","privacy"])}})(function(e){var t=e.needsLockWarning,a=e.hashtagWarning,n=e.directMessageWarning;if(t)return Object(u.a)(Fe,{message:Object(u.a)(S.b,{id:"compose_form.lock_disclaimer",defaultMessage:"Your account is not {locked}. Anyone can follow you to view your follower-only posts.",values:{locked:Object(u.a)("a",{href:"/user-settings"},void 0,Object(u.a)(S.b,{id:"compose_form.lock_disclaimer.lock",defaultMessage:"locked"}))}})});if(a)return Object(u.a)(Fe,{message:Object(u.a)(S.b,{id:"compose_form.hashtag_warning",defaultMessage:"This toot won't be listed under any hashtag as it is unlisted. Only public toots can be searched by hashtag."})});if(n){var o=Object(u.a)("span",{},void 0,Object(u.a)(S.b,{id:"compose_form.direct_message_warning",defaultMessage:"This toot will only be sent to all the mentioned users."})," ",Object(u.a)("a",{href:"/terms",target:"_blank"},void 0,Object(u.a)(S.b,{id:"compose_form.direct_message_warning_learn_more",defaultMessage:"Learn more"})));return Object(u.a)(Fe,{message:o})}return null}),Le=Object(S.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}!"}}),ze=Object(S.g)((Re=Pe=function(n){function e(){for(var i,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return i=n.call.apply(n,[this].concat(t))||this,Object(d.a)(Object(r.a)(Object(r.a)(i)),"handleChange",function(e){i.props.onChange(e.target.value)}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"handleKeyDown",function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&i.handleSubmit()}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"handleSubmit",function(){i.props.text!==i.autosuggestTextarea.textarea.value&&i.props.onChange(i.autosuggestTextarea.textarea.value);var e=i.props,t=e.is_submitting,a=e.is_changing_upload,n=e.is_uploading,o=e.anyMedia,s=[i.props.spoiler_text,i.props.text].join("");t||n||a||Object(b.length)(s)>qe.j||0!==s.length&&0===s.trim().length&&!o||i.props.onSubmit(i.context.router?i.context.router.history:null)}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"onSuggestionsClearRequested",function(){i.props.onClearSuggestions()}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"onSuggestionsFetchRequested",function(e){i.props.onFetchSuggestions(e)}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"onSuggestionSelected",function(e,t,a){i.props.onSuggestionSelected(e,t,a)}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"handleChangeSpoilerText",function(e){i.props.onChangeSpoilerText(e.target.value)}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"setAutosuggestTextarea",function(e){i.autosuggestTextarea=e}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"setSpoilerText",function(e){i.spoilerText=e}),Object(d.a)(Object(r.a)(Object(r.a)(i)),"handleEmojiPick",function(e){var t=i.props.text,a=i.autosuggestTextarea.textarea.selectionStart,n=e.custom&&0<a&&!"><\85                 \u2028\u2029\t\n\v\f\r".includes(t[a-1]);i.props.onPickEmoji(a,e,n)}),i}Object(c.a)(e,n);var t=e.prototype;return t.componentDidUpdate=function(e){var t,a;this.props.focusDate!==e.focusDate?(this.props.preselectDate!==e.preselectDate?(t=this.props.text.length,a=this.props.text.search(/\s/)+1):"number"==typeof this.props.caretPosition?(a=this.props.caretPosition,t=this.props.caretPosition):a=t=this.props.text.length,this.autosuggestTextarea.textarea.setSelectionRange(a,t),this.autosuggestTextarea.textarea.focus()):e.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.render=function(){var e=this.props,t=e.intl,a=e.onPaste,n=e.showSearch,o=e.anyMedia,s=this.props.is_submitting,i=[this.props.spoiler_text,this.props.text].join(""),c=s||this.props.is_uploading||this.props.is_changing_upload||Object(b.length)(i)>qe.j||0!==i.length&&0===i.trim().length&&!o,r="";return r="private"===this.props.privacy||"direct"===this.props.privacy?Object(u.a)("span",{className:"compose-form__publish-private"},void 0,Object(u.a)(ie.a,{id:"lock"})," ",t.formatMessage(Le.publish)):"unlisted"!==this.props.privacy?t.formatMessage(Le.publishLoud,{publish:t.formatMessage(Le.publish)}):t.formatMessage(Le.publish),Object(u.a)("div",{className:"compose-form"},void 0,Object(u.a)(Ke,{}),Object(u.a)(D,{}),Object(u.a)("div",{className:"spoiler-input "+(this.props.spoiler?"spoiler-input--visible":"")},void 0,Object(u.a)("label",{},void 0,Object(u.a)("span",{style:{display:"none"}},void 0,t.formatMessage(Le.spoiler_placeholder)),p.a.createElement("input",{placeholder:t.formatMessage(Le.spoiler_placeholder),value:this.props.spoiler_text,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,tabIndex:this.props.spoiler?0:-1,type:"text",className:"spoiler-input__input",id:"cw-spoiler-input",ref:this.setSpoilerText}))),Object(u.a)("div",{className:"compose-form__autosuggest-wrapper"},void 0,p.a.createElement(L,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(Le.placeholder),disabled:s,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onKeyDown:this.handleKeyDown,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,onPaste:a,autoFocus:!n&&!Object(pe.b)(window.innerWidth)}),Object(u.a)(Se,{onPickEmoji:this.handleEmojiPick})),Object(u.a)("div",{className:"compose-form__modifiers"},void 0,Object(u.a)(Ee,{})),Object(u.a)("div",{className:"compose-form__buttons-wrapper"},void 0,Object(u.a)("div",{className:"compose-form__buttons"},void 0,Object(u.a)(G,{}),Object(u.a)(be,{}),Object(u.a)(me,{}),Object(u.a)(V,{})),Object(u.a)("div",{className:"character-counter__wrapper"},void 0,Object(u.a)(g,{max:qe.j,text:i}))),Object(u.a)("div",{className:"compose-form__publish"},void 0,Object(u.a)("div",{className:"compose-form__publish-button-wrapper"},void 0,Object(u.a)(h.a,{text:r,onClick:this.handleSubmit,disabled:c,block:!0}))))},e}(M.a),Object(d.a)(Pe,"contextTypes",{router:O.a.object}),Object(d.a)(Pe,"propTypes",{intl:O.a.object.isRequired,text:O.a.string.isRequired,suggestion_token:O.a.string,suggestions:f.a.list,spoiler:O.a.bool,privacy:O.a.string,spoiler_text:O.a.string,focusDate:O.a.instanceOf(Date),caretPosition:O.a.number,preselectDate:O.a.instanceOf(Date),is_submitting:O.a.bool,is_changing_upload:O.a.bool,is_uploading:O.a.bool,onChange:O.a.func.isRequired,onSubmit:O.a.func.isRequired,onClearSuggestions:O.a.func.isRequired,onFetchSuggestions:O.a.func.isRequired,onSuggestionSelected:O.a.func.isRequired,onChangeSpoilerText:O.a.func.isRequired,onPaste:O.a.func.isRequired,onPickEmoji:O.a.func.isRequired,showSearch:O.a.bool,anyMedia:O.a.bool}),Object(d.a)(Pe,"defaultProps",{showSearch:!1}),Te=Re))||Te;t.a=Object(i.connect)(function(e){return{text:e.getIn(["compose","text"]),suggestion_token:e.getIn(["compose","suggestion_token"]),suggestions:e.getIn(["compose","suggestions"]),spoiler:e.getIn(["compose","spoiler"]),spoiler_text:e.getIn(["compose","spoiler_text"]),privacy:e.getIn(["compose","privacy"]),focusDate:e.getIn(["compose","focusDate"]),caretPosition:e.getIn(["compose","caretPosition"]),preselectDate:e.getIn(["compose","preselectDate"]),is_submitting:e.getIn(["compose","is_submitting"]),is_changing_upload:e.getIn(["compose","is_changing_upload"]),is_uploading:e.getIn(["compose","is_uploading"]),showSearch:e.getIn(["search","submitted"])&&!e.getIn(["search","hidden"]),anyMedia:0<e.getIn(["compose","media_attachments"]).size}},function(n){return{onChange:function(e){n(Object(v.F)(e))},onSubmit:function(e){n(Object(v.W)(e))},onClearSuggestions:function(){n(Object(v.M)())},onFetchSuggestions:function(e){n(Object(v.O)(e))},onSuggestionSelected:function(e,t,a){n(Object(v.V)(e,t,a))},onChangeSpoilerText:function(e){n(Object(v.H)(e))},onPaste:function(e){n(Object(v.Z)(e))},onPickEmoji:function(e,t,a){n(Object(v.Q)(e,t,a))}}})(ze)},703:function(e,t,a){"use strict";a.r(t);var n,o,s,i,c,l=a(1),r=a(7),u=a(0),d=a(2),p=a(3),b=a.n(p),g=a(700),h=a(20),m=a(981),f=a(22),j=Object(h.connect)(function(e){return{account:e.getIn(["accounts",f.k])}})(m.a),O=a(23),v=a(391),_=a(6),y=a(216),k=a(21),C=a(171),S=a.n(C),M=a(141),w=a(46),x=a.n(w),N=a(33),D=Object(_.f)({placeholder:{id:"search.placeholder",defaultMessage:"Search"}}),I=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this.props.style,o=f.n?Object(l.a)(_.b,{id:"search_popout.tips.full_text",defaultMessage:"Simple text returns statuses you have written, favourited, boosted, or have been mentioned in, as well as matching usernames, display names, and hashtags."}):Object(l.a)(_.b,{id:"search_popout.tips.text",defaultMessage:"Simple text returns matching display names, usernames and hashtags"});return Object(l.a)("div",{style:Object(k.a)({},e,{position:"absolute",width:315})},void 0,Object(l.a)(M.a,{defaultStyle:{opacity:0,scaleX:.85,scaleY:.75},style:{opacity:x()(1,{damping:35,stiffness:400}),scaleX:x()(1,{damping:35,stiffness:400}),scaleY:x()(1,{damping:35,stiffness:400})}},void 0,function(e){var t=e.opacity,a=e.scaleX,n=e.scaleY;return Object(l.a)("div",{className:"search-popout",style:{opacity:t,transform:"scale("+a+", "+n+")"}},void 0,Object(l.a)("h4",{},void 0,Object(l.a)(_.b,{id:"search_popout.search_format",defaultMessage:"Advanced search format"})),Object(l.a)("ul",{},void 0,Object(l.a)("li",{},void 0,Object(l.a)("em",{},void 0,"#example")," ",Object(l.a)(_.b,{id:"search_popout.tips.hashtag",defaultMessage:"hashtag"})),Object(l.a)("li",{},void 0,Object(l.a)("em",{},void 0,"@username@domain")," ",Object(l.a)(_.b,{id:"search_popout.tips.user",defaultMessage:"user"})),Object(l.a)("li",{},void 0,Object(l.a)("em",{},void 0,"URL")," ",Object(l.a)(_.b,{id:"search_popout.tips.user",defaultMessage:"user"})),Object(l.a)("li",{},void 0,Object(l.a)("em",{},void 0,"URL")," ",Object(l.a)(_.b,{id:"search_popout.tips.status",defaultMessage:"status"}))),o)}))},t}(b.a.PureComponent),T=Object(_.g)(n=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(u.a)(Object(u.a)(t)),"state",{expanded:!1}),Object(d.a)(Object(u.a)(Object(u.a)(t)),"handleChange",function(e){t.props.onChange(e.target.value)}),Object(d.a)(Object(u.a)(Object(u.a)(t)),"handleClear",function(e){e.preventDefault(),(0<t.props.value.length||t.props.submitted)&&t.props.onClear()}),Object(d.a)(Object(u.a)(Object(u.a)(t)),"handleKeyDown",function(e){"Enter"===e.key?(e.preventDefault(),t.props.onSubmit()):"Escape"===e.key&&document.querySelector(".ui").parentElement.focus()}),Object(d.a)(Object(u.a)(Object(u.a)(t)),"handleFocus",function(){t.setState({expanded:!0}),t.props.onShow()}),Object(d.a)(Object(u.a)(Object(u.a)(t)),"handleBlur",function(){t.setState({expanded:!1})}),t}Object(r.a)(e,o);var t=e.prototype;return t.noop=function(){},t.render=function(){var e=this.props,t=e.intl,a=e.value,n=e.submitted,o=this.state.expanded,s=0<a.length||n;return Object(l.a)("div",{className:"search"},void 0,Object(l.a)("label",{},void 0,Object(l.a)("span",{style:{display:"none"}},void 0,t.formatMessage(D.placeholder)),Object(l.a)("input",{className:"search__input",type:"text",placeholder:t.formatMessage(D.placeholder),value:a,onChange:this.handleChange,onKeyUp:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur})),Object(l.a)("div",{role:"button",tabIndex:"0",className:"search__icon",onClick:this.handleClear},void 0,Object(l.a)(N.a,{id:"search",className:s?"":"active"}),Object(l.a)(N.a,{id:"times-circle",className:s?"active":"","aria-label":t.formatMessage(D.placeholder)})),Object(l.a)(S.a,{show:o&&!s,placement:"bottom",target:this},void 0,Object(l.a)(I,{})))},e}(b.a.PureComponent))||n,P=Object(h.connect)(function(e){return{value:e.getIn(["search","value"]),submitted:e.getIn(["search","submitted"])}},function(t){return{onChange:function(e){t(Object(y.e)(e))},onClear:function(){t(Object(y.f)())},onSubmit:function(){t(Object(y.h)())},onShow:function(){t(Object(y.g)())}}})(T),R=a(5),E=a.n(R),F=a(26),q=a.n(F),A=a(896),K=a(632),L=a(24),z=a(958),W=a(408),U=a(974),H=function(e){var t=e.hashtag;return Object(l.a)("div",{className:"trends__item"},void 0,Object(l.a)("div",{className:"trends__item__name"},void 0,Object(l.a)(W.a,{href:t.get("url"),to:"/timelines/tag/"+t.get("name")},void 0,"#",Object(l.a)("span",{},void 0,t.get("name"))),Object(l.a)(_.b,{id:"trends.count_by_accounts",defaultMessage:"{count} {rawCount, plural, one {person} other {people}} talking",values:{rawCount:t.getIn(["history",0,"accounts"]),count:Object(l.a)("strong",{},void 0,Object(U.a)(t.getIn(["history",0,"accounts"])))}})),Object(l.a)("div",{className:"trends__item__current"},void 0,Object(U.a)(t.getIn(["history",0,"uses"]))),Object(l.a)("div",{className:"trends__item__sparkline"},void 0,Object(l.a)(z.Sparklines,{width:50,height:28,data:t.get("history")&&t.get("history").reverse().map(function(e){return e.get("uses")}).toArray()},void 0,Object(l.a)(z.SparklinesCurve,{style:{fill:"none"}}))))},B=Object(_.f)({dismissSuggestion:{id:"suggestions.dismiss",defaultMessage:"Dismiss suggestion"}}),Y=Object(_.g)((i=s=function(e){function t(){return e.apply(this,arguments)||this}Object(r.a)(t,e);var a=t.prototype;return a.componentDidMount=function(){this.props.fetchSuggestions()},a.render=function(){var e,t,a,n=this.props,o=n.intl,s=n.results,i=n.suggestions,c=n.dismissSuggestion;if(s.isEmpty()&&!i.isEmpty())return Object(l.a)("div",{className:"search-results"},void 0,Object(l.a)("div",{className:"trends"},void 0,Object(l.a)("div",{className:"trends__header"},void 0,Object(l.a)(N.a,{id:"user-plus",fixedWidth:!0}),Object(l.a)(_.b,{id:"suggestions.header",defaultMessage:"You might be interested in…"})),i&&i.map(function(e){return Object(l.a)(A.a,{id:e,actionIcon:"times",actionTitle:o.formatMessage(B.dismissSuggestion),onActionClick:c},e)})));var r=0;return s.get("accounts")&&0<s.get("accounts").size&&(r+=s.get("accounts").size,e=Object(l.a)("div",{className:"search-results__section"},void 0,Object(l.a)("h5",{},void 0,Object(l.a)(N.a,{id:"users",fixedWidth:!0}),Object(l.a)(_.b,{id:"search_results.accounts",defaultMessage:"People"})),s.get("accounts").map(function(e){return Object(l.a)(A.a,{id:e},e)}))),s.get("statuses")&&0<s.get("statuses").size&&(r+=s.get("statuses").size,t=Object(l.a)("div",{className:"search-results__section"},void 0,Object(l.a)("h5",{},void 0,Object(l.a)(N.a,{id:"quote-right",fixedWidth:!0}),Object(l.a)(_.b,{id:"search_results.statuses",defaultMessage:"Toots"})),s.get("statuses").map(function(e){return Object(l.a)(K.a,{id:e},e)}))),s.get("hashtags")&&0<s.get("hashtags").size&&(r+=s.get("hashtags").size,a=Object(l.a)("div",{className:"search-results__section"},void 0,Object(l.a)("h5",{},void 0,Object(l.a)(N.a,{id:"hashtag",fixedWidth:!0}),Object(l.a)(_.b,{id:"search_results.hashtags",defaultMessage:"Hashtags"})),s.get("hashtags").map(function(e){return Object(l.a)(H,{hashtag:e},e.get("name"))}))),Object(l.a)("div",{className:"search-results"},void 0,Object(l.a)("div",{className:"search-results__header"},void 0,Object(l.a)(N.a,{id:"search",fixedWidth:!0}),Object(l.a)(_.b,{id:"search_results.total",defaultMessage:"{count, number} {count, plural, one {result} other {results}}",values:{count:r}})),e,t,a)},t}(L.a),Object(d.a)(s,"propTypes",{results:q.a.map.isRequired,suggestions:q.a.list.isRequired,fetchSuggestions:E.a.func.isRequired,dismissSuggestion:E.a.func.isRequired,intl:E.a.object.isRequired}),o=i))||o,X=a(217),G=Object(h.connect)(function(e){return{results:e.getIn(["search","results"]),suggestions:e.getIn(["suggestions","items"])}},function(t){return{fetchSuggestions:function(){return t(Object(X.f)())},dismissSuggestion:function(e){return t(Object(X.e)(e.get("id")))}}})(Y);a.d(t,"default",function(){return Z});var J=Object(_.f)({start:{id:"getting_started.heading",defaultMessage:"Getting started"},home_timeline:{id:"tabs_bar.home",defaultMessage:"Home"},notifications:{id:"tabs_bar.notifications",defaultMessage:"Notifications"},public:{id:"navigation_bar.public_timeline",defaultMessage:"Federated timeline"},community:{id:"navigation_bar.community_timeline",defaultMessage:"Local timeline"},preferences:{id:"navigation_bar.preferences",defaultMessage:"Preferences"},logout:{id:"navigation_bar.logout",defaultMessage:"Logout"},compose:{id:"navigation_bar.compose",defaultMessage:"Compose new toot"}}),Z=Object(h.connect)(function(e,t){return{columns:e.getIn(["settings","columns"]),showSearch:t.multiColumn?e.getIn(["search","submitted"])&&!e.getIn(["search","hidden"]):t.isSearchPage}})(c=Object(_.g)(c=function(o){function e(){for(var e,t=arguments.length,a=new Array(t),n=0;n<t;n++)a[n]=arguments[n];return e=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(u.a)(Object(u.a)(e)),"onFocus",function(){e.props.dispatch(Object(O.K)(!0))}),Object(d.a)(Object(u.a)(Object(u.a)(e)),"onBlur",function(){e.props.dispatch(Object(O.K)(!1))}),e}Object(r.a)(e,o);var t=e.prototype;return t.componentDidMount=function(){this.props.isSearchPage||this.props.dispatch(Object(O.S)())},t.componentWillUnmount=function(){this.props.isSearchPage||this.props.dispatch(Object(O.Y)())},t.render=function(){var e=this.props,t=e.multiColumn,a=e.showSearch,n=e.isSearchPage,o=e.intl,s="";if(t){var i=this.props.columns;s=Object(l.a)("nav",{className:"drawer__header"},void 0,Object(l.a)(v.a,{to:"/getting-started",className:"drawer__tab",title:o.formatMessage(J.start),"aria-label":o.formatMessage(J.start)},void 0,Object(l.a)(N.a,{id:"bars",fixedWidth:!0})),!i.some(function(e){return"HOME"===e.get("id")})&&Object(l.a)(v.a,{to:"/timelines/home",className:"drawer__tab",title:o.formatMessage(J.home_timeline),"aria-label":o.formatMessage(J.home_timeline)},void 0,Object(l.a)(N.a,{id:"home",fixedWidth:!0})),!i.some(function(e){return"NOTIFICATIONS"===e.get("id")})&&Object(l.a)(v.a,{to:"/notifications",className:"drawer__tab",title:o.formatMessage(J.notifications),"aria-label":o.formatMessage(J.notifications)},void 0,Object(l.a)(N.a,{id:"bell",fixedWidth:!0})),!i.some(function(e){return"COMMUNITY"===e.get("id")})&&Object(l.a)(v.a,{to:"/timelines/public/local",className:"drawer__tab",title:o.formatMessage(J.community),"aria-label":o.formatMessage(J.community)},void 0,Object(l.a)(N.a,{id:"users",fixedWidth:!0})),!i.some(function(e){return"PUBLIC"===e.get("id")})&&Object(l.a)(v.a,{to:"/timelines/public",className:"drawer__tab",title:o.formatMessage(J.public),"aria-label":o.formatMessage(J.public)},void 0,Object(l.a)(N.a,{id:"globe",fixedWidth:!0})),Object(l.a)("a",{href:"/user-settings",className:"drawer__tab",title:o.formatMessage(J.preferences),"aria-label":o.formatMessage(J.preferences)},void 0,Object(l.a)(N.a,{id:"cog",fixedWidth:!0})),Object(l.a)("a",{href:"/auth/sign_out",className:"drawer__tab","data-method":"delete",title:o.formatMessage(J.logout),"aria-label":o.formatMessage(J.logout)},void 0,Object(l.a)(N.a,{id:"sign-out",fixedWidth:!0})))}return Object(l.a)("div",{className:"drawer",role:"region","aria-label":o.formatMessage(J.compose)},void 0,s,(t||n)&&Object(l.a)(P,{}),Object(l.a)("div",{className:"drawer__pager"},void 0,!n&&Object(l.a)("div",{className:"drawer__inner",onFocus:this.onFocus},void 0,Object(l.a)(j,{onClose:this.onBlur}),Object(l.a)(g.a,{})),Object(l.a)(M.a,{defaultStyle:{x:n?0:-100},style:{x:x()(a||n?0:-100,{stiffness:210,damping:20})}},void 0,function(e){var t=e.x;return Object(l.a)("div",{className:"drawer__inner darker",style:{transform:"translateX("+t+"%)",visibility:-100===t?"hidden":"visible"}},void 0,Object(l.a)(G,{}))})))},e}(b.a.PureComponent))||c)||c}}]);
+(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{391:function(e,t,o){"use strict";(function(e){o.d(t,"a",function(){return u});var n=o(0),a=o(7),s=o(3),i=o.n(s),c=o(79),r=o.n(c),l=e.env.CDN_HOST||"",u=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.render=function(){var e,t=this.props.emoji;if(t.custom)e=t.imageUrl;else{var o=r.a[t.native]||r.a[t.native.replace(/\uFE0F$/,"")];if(!o)return null;e=l+"/emoji/"+o.filename+".svg"}return Object(n.a)("div",{className:"autosuggest-emoji"},void 0,Object(n.a)("img",{className:"emojione",src:e,alt:t.native||t.colons}),t.colons)},t}(i.a.PureComponent)}).call(this,o(46))},573:function(e,t,o){"use strict";(function(e){o.d(t,"a",function(){return N});var n,a,s,i,c,r,l=o(0),u=o(2),d=o(7),p=o(1),g=o(3),b=o.n(g),m=o(6),f=o(41),h=o(113),j=o.n(h),O=o(10),v=o.n(O),y=o(64),_=o.n(y),C=o(52),k=Object(m.f)({emoji:{id:"emoji_button.label",defaultMessage:"Insert emoji"},emoji_search:{id:"emoji_button.search",defaultMessage:"Search..."},emoji_not_found:{id:"emoji_button.not_found",defaultMessage:"No emojos!! (╯°□°)╯︵ ┻━┻"},custom:{id:"emoji_button.custom",defaultMessage:"Custom"},recent:{id:"emoji_button.recent",defaultMessage:"Frequently used"},search_results:{id:"emoji_button.search_results",defaultMessage:"Search results"},people:{id:"emoji_button.people",defaultMessage:"People"},nature:{id:"emoji_button.nature",defaultMessage:"Nature"},food:{id:"emoji_button.food",defaultMessage:"Food & Drink"},activity:{id:"emoji_button.activity",defaultMessage:"Activity"},travel:{id:"emoji_button.travel",defaultMessage:"Travel & Places"},objects:{id:"emoji_button.objects",defaultMessage:"Objects"},symbols:{id:"emoji_button.symbols",defaultMessage:"Symbols"},flags:{id:"emoji_button.flags",defaultMessage:"Flags"}}),S=e.env.CDN_HOST||"",M=function(){return S+"/emoji/sheet_10.png"},w=!!_.a.hasSupport&&{passive:!0},x=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(p.a)(Object(u.a)(t),"handleClick",function(e){t.props.onSelect(1*e.currentTarget.getAttribute("data-index"))}),Object(p.a)(Object(u.a)(t),"handleDocumentClick",function(e){t.node&&!t.node.contains(e.target)&&t.props.onClose()}),Object(p.a)(Object(u.a)(t),"setRef",function(e){t.node=e}),t}Object(d.a)(t,e);var o=t.prototype;return o.componentWillReceiveProps=function(e){e.active?this.attachListeners():this.removeListeners()},o.componentWillUnmount=function(){this.removeListeners()},o.attachListeners=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,w)},o.removeListeners=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,w)},o.render=function(){var e=this.props.active;return b.a.createElement("div",{className:"emoji-picker-dropdown__modifiers__menu",style:{display:e?"block":"none"},ref:this.setRef},Object(l.a)("button",{onClick:this.handleClick,"data-index":1},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:1,backgroundImageFn:M})),Object(l.a)("button",{onClick:this.handleClick,"data-index":2},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:2,backgroundImageFn:M})),Object(l.a)("button",{onClick:this.handleClick,"data-index":3},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:3,backgroundImageFn:M})),Object(l.a)("button",{onClick:this.handleClick,"data-index":4},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:4,backgroundImageFn:M})),Object(l.a)("button",{onClick:this.handleClick,"data-index":5},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:5,backgroundImageFn:M})),Object(l.a)("button",{onClick:this.handleClick,"data-index":6},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:6,backgroundImageFn:M})))},t}(b.a.PureComponent),T=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(p.a)(Object(u.a)(t),"handleClick",function(){t.props.active?t.props.onClose():t.props.onOpen()}),Object(p.a)(Object(u.a)(t),"handleSelect",function(e){t.props.onChange(e),t.props.onClose()}),t}return Object(d.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.active,o=e.modifier;return Object(l.a)("div",{className:"emoji-picker-dropdown__modifiers"},void 0,Object(l.a)(r,{emoji:"fist",set:"twitter",size:22,sheetSize:32,skin:o,onClick:this.handleClick,backgroundImageFn:M}),Object(l.a)(x,{active:t,onSelect:this.handleSelect,onClose:this.props.onClose}))},t}(b.a.PureComponent),D=Object(m.g)((s=a=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(p.a)(Object(u.a)(t),"state",{modifierOpen:!1,placement:null}),Object(p.a)(Object(u.a)(t),"handleDocumentClick",function(e){t.node&&!t.node.contains(e.target)&&t.props.onClose()}),Object(p.a)(Object(u.a)(t),"setRef",function(e){t.node=e}),Object(p.a)(Object(u.a)(t),"getI18n",function(){var e=t.props.intl;return{search:e.formatMessage(k.emoji_search),notfound:e.formatMessage(k.emoji_not_found),categories:{search:e.formatMessage(k.search_results),recent:e.formatMessage(k.recent),people:e.formatMessage(k.people),nature:e.formatMessage(k.nature),foods:e.formatMessage(k.food),activity:e.formatMessage(k.activity),places:e.formatMessage(k.travel),objects:e.formatMessage(k.objects),symbols:e.formatMessage(k.symbols),flags:e.formatMessage(k.flags),custom:e.formatMessage(k.custom)}}}),Object(p.a)(Object(u.a)(t),"handleClick",function(e){e.native||(e.native=e.colons),t.props.onClose(),t.props.onPick(e)}),Object(p.a)(Object(u.a)(t),"handleModifierOpen",function(){t.setState({modifierOpen:!0})}),Object(p.a)(Object(u.a)(t),"handleModifierClose",function(){t.setState({modifierOpen:!1})}),Object(p.a)(Object(u.a)(t),"handleModifierChange",function(e){t.props.onSkinTone(e)}),t}Object(d.a)(t,e);var o=t.prototype;return o.componentDidMount=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,w)},o.componentWillUnmount=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,w)},o.render=function(){var e=this.props,t=e.loading,o=e.style,n=e.intl,a=e.custom_emojis,s=e.skinTone,i=e.frequentlyUsedEmojis;if(t)return Object(l.a)("div",{style:{width:299}});var r=n.formatMessage(k.emoji),u=this.state.modifierOpen,d=["recent","people","nature","foods","activity","places","objects","symbols","flags"];return d.splice.apply(d,[1,0].concat(Array.from(Object(C.categoriesFromEmojis)(a)).sort())),b.a.createElement("div",{className:v()("emoji-picker-dropdown__menu",{selecting:u}),style:o,ref:this.setRef},Object(l.a)(c,{perLine:8,emojiSize:22,sheetSize:32,custom:Object(C.buildCustomEmojis)(a),color:"",emoji:"",set:"twitter",title:r,i18n:this.getI18n(),onClick:this.handleClick,include:d,recent:i,skin:s,showPreview:!1,backgroundImageFn:M,autoFocus:!0,emojiTooltip:!0}),Object(l.a)(T,{active:u,modifier:s,onOpen:this.handleModifierOpen,onClose:this.handleModifierClose,onChange:this.handleModifierChange}))},t}(b.a.PureComponent),Object(p.a)(a,"defaultProps",{style:{},loading:!0,frequentlyUsedEmojis:[]}),n=s))||n,N=Object(m.g)(i=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(p.a)(Object(u.a)(t),"state",{active:!1,loading:!1}),Object(p.a)(Object(u.a)(t),"setRef",function(e){t.dropdown=e}),Object(p.a)(Object(u.a)(t),"onShowDropdown",function(e){var o=e.target;t.setState({active:!0}),c||(t.setState({loading:!0}),Object(f.l)().then(function(e){c=e.Picker,r=e.Emoji,t.setState({loading:!1})}).catch(function(){t.setState({loading:!1})}));var n=o.getBoundingClientRect().top;t.setState({placement:2*n<innerHeight?"bottom":"top"})}),Object(p.a)(Object(u.a)(t),"onHideDropdown",function(){t.setState({active:!1})}),Object(p.a)(Object(u.a)(t),"onToggle",function(e){t.state.loading||e.key&&"Enter"!==e.key||(t.state.active?t.onHideDropdown():t.onShowDropdown(e))}),Object(p.a)(Object(u.a)(t),"handleKeyDown",function(e){"Escape"===e.key&&t.onHideDropdown()}),Object(p.a)(Object(u.a)(t),"setTargetRef",function(e){t.target=e}),Object(p.a)(Object(u.a)(t),"findTarget",function(){return t.target}),t}return Object(d.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.intl,o=e.onPickEmoji,n=e.onSkinTone,a=e.skinTone,s=e.frequentlyUsedEmojis,i=t.formatMessage(k.emoji),c=this.state,r=c.active,u=c.loading,d=c.placement;return Object(l.a)("div",{className:"emoji-picker-dropdown",onKeyDown:this.handleKeyDown},void 0,b.a.createElement("div",{ref:this.setTargetRef,className:"emoji-button",title:i,"aria-label":i,"aria-expanded":r,role:"button",onClick:this.onToggle,onKeyDown:this.onToggle,tabIndex:0},Object(l.a)("img",{className:v()("emojione",{"pulse-loading":r&&u}),alt:"🙂",src:S+"/emoji/1f602.svg"})),Object(l.a)(j.a,{show:r,placement:d,target:this.findTarget},void 0,Object(l.a)(D,{custom_emojis:this.props.custom_emojis,loading:u,onClose:this.onHideDropdown,onPick:o,onSkinTone:n,skinTone:a,frequentlyUsedEmojis:s})))},t}(b.a.PureComponent))||i}).call(this,o(46))},574:function(e,t,o){"use strict";var n,a,s,i=o(12),c=o(0),r=o(2),l=o(7),u=o(1),d=o(3),p=o.n(d),g=o(308),b=o(101),m=o(18),f=o.n(m),h=o(5),j=o.n(h),O=o(21),v=o(204),y=o(107),_=o(51),C=o(116),k=o(6),S=o(19),M=o(214),w=o(276),x=Object(k.f)({cancel:{id:"reply_indicator.cancel",defaultMessage:"Cancel"}}),T=Object(k.g)((s=a=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleClick",function(){t.props.onCancel()}),Object(u.a)(Object(r.a)(t),"handleAccountClick",function(e){0!==e.button||e.ctrlKey||e.metaKey||(e.preventDefault(),t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"])))}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.status,o=e.intl;if(!t)return null;var n={__html:t.get("contentHtml")},a={direction:Object(M.a)(t.get("search_index"))?"rtl":"ltr"};return Object(c.a)("div",{className:"reply-indicator"},void 0,Object(c.a)("div",{className:"reply-indicator__header"},void 0,Object(c.a)("div",{className:"reply-indicator__cancel"},void 0,Object(c.a)(_.a,{title:o.formatMessage(x.cancel),icon:"times",onClick:this.handleClick,inverted:!0})),Object(c.a)("a",{href:t.getIn(["account","url"]),onClick:this.handleAccountClick,className:"reply-indicator__display-name"},void 0,Object(c.a)("div",{className:"reply-indicator__display-avatar"},void 0,Object(c.a)(y.a,{account:t.get("account"),size:24})),Object(c.a)(C.a,{account:t.get("account")}))),Object(c.a)("div",{className:"reply-indicator__content",style:a,dangerouslySetInnerHTML:n}),t.get("media_attachments").size>0&&Object(c.a)(w.a,{compact:!0,media:t.get("media_attachments")}))},t}(S.a),Object(u.a)(a,"contextTypes",{router:j.a.object}),Object(u.a)(a,"propTypes",{status:f.a.map,onCancel:j.a.func.isRequired,intl:j.a.object.isRequired}),n=s))||n,D=Object(i.connect)(function(){var e=Object(v.f)();return function(t){return{status:e(t,{id:t.getIn(["compose","in_reply_to"])})}}},function(e){return{onCancel:function(){e(Object(O.M)())}}})(T),N=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props.account;return Object(c.a)("div",{className:"autosuggest-account",title:e.get("acct")},void 0,Object(c.a)("div",{className:"autosuggest-account-icon"},void 0,Object(c.a)(y.a,{account:e,size:18})),Object(c.a)(C.a,{account:e}))},t}(S.a);Object(u.a)(N,"propTypes",{account:f.a.map.isRequired});var I=Object(i.connect)(function(){var e=Object(v.d)();return function(t,o){var n=o.id;return{account:e(t,n)}}})(N),R=o(391),P=o(408),F=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props.tag,t=e.history&&Object(P.a)(e.history.reduce(function(e,t){return e+1*t.uses},0));return Object(c.a)("div",{className:"autosuggest-hashtag"},void 0,Object(c.a)("div",{className:"autosuggest-hashtag__name"},void 0,"#",Object(c.a)("strong",{},void 0,e.name)),void 0!==e.history&&Object(c.a)("div",{className:"autosuggest-hashtag__uses"},void 0,Object(c.a)(k.b,{id:"autosuggest_hashtag.per_week",defaultMessage:"{count} per week",values:{count:t}})))},t}(p.a.PureComponent),E=o(145),q=o(10),A=o.n(q),K=function(e,t){var o,n=e.slice(0,t).search(/\S+$/),a=e.slice(t).search(/\s/);return!(o=a<0?e.slice(n):e.slice(n,a+t))||o.trim().length<3||-1===["@",":","#"].indexOf(o[0])?[null,null]:(o=o.trim().toLowerCase()).length>0?[n+1,o]:[null,null]},L=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"state",{suggestionsHidden:!0,focused:!1,selectedSuggestion:0,lastToken:null,tokenStart:0}),Object(u.a)(Object(r.a)(t),"onChange",function(e){var o=K(e.target.value,e.target.selectionStart),n=o[0],a=o[1];null!==a&&t.state.lastToken!==a?(t.setState({lastToken:a,selectedSuggestion:0,tokenStart:n}),t.props.onSuggestionsFetchRequested(a)):null===a&&(t.setState({lastToken:null}),t.props.onSuggestionsClearRequested()),t.props.onChange(e)}),Object(u.a)(Object(r.a)(t),"onKeyDown",function(e){var o=t.props,n=o.suggestions,a=o.disabled,s=t.state,i=s.selectedSuggestion,c=s.suggestionsHidden;if(a)e.preventDefault();else if(229!==e.which&&!e.isComposing){switch(e.key){case"Escape":0===n.size||c?document.querySelector(".ui").parentElement.focus():(e.preventDefault(),t.setState({suggestionsHidden:!0}));break;case"ArrowDown":n.size>0&&!c&&(e.preventDefault(),t.setState({selectedSuggestion:Math.min(i+1,n.size-1)}));break;case"ArrowUp":n.size>0&&!c&&(e.preventDefault(),t.setState({selectedSuggestion:Math.max(i-1,0)}));break;case"Enter":case"Tab":null!==t.state.lastToken&&n.size>0&&!c&&(e.preventDefault(),e.stopPropagation(),t.props.onSuggestionSelected(t.state.tokenStart,t.state.lastToken,n.get(i)))}!e.defaultPrevented&&t.props.onKeyDown&&t.props.onKeyDown(e)}}),Object(u.a)(Object(r.a)(t),"onBlur",function(){t.setState({suggestionsHidden:!0,focused:!1})}),Object(u.a)(Object(r.a)(t),"onFocus",function(e){t.setState({focused:!0}),t.props.onFocus&&t.props.onFocus(e)}),Object(u.a)(Object(r.a)(t),"onSuggestionClick",function(e){var o=t.props.suggestions.get(e.currentTarget.getAttribute("data-index"));e.preventDefault(),t.props.onSuggestionSelected(t.state.tokenStart,t.state.lastToken,o),t.textarea.focus()}),Object(u.a)(Object(r.a)(t),"setTextarea",function(e){t.textarea=e}),Object(u.a)(Object(r.a)(t),"onPaste",function(e){e.clipboardData&&1===e.clipboardData.files.length&&(t.props.onPaste(e.clipboardData.files),e.preventDefault())}),Object(u.a)(Object(r.a)(t),"renderSuggestion",function(e,o){var n,a,s=t.state.selectedSuggestion;return"emoji"===e.type?(n=Object(c.a)(R.a,{emoji:e}),a=e.id):"hashtag"===e.type?(n=Object(c.a)(F,{tag:e}),a=e.name):"account"===e.type&&(n=Object(c.a)(I,{id:e.id}),a=e.id),Object(c.a)("div",{role:"button",tabIndex:"0","data-index":o,className:A()("autosuggest-textarea__suggestions__item",{selected:o===s}),onMouseDown:t.onSuggestionClick},a,n)}),t}Object(l.a)(t,e);var o=t.prototype;return o.componentWillReceiveProps=function(e){e.suggestions!==this.props.suggestions&&e.suggestions.size>0&&this.state.suggestionsHidden&&this.state.focused&&this.setState({suggestionsHidden:!1})},o.render=function(){var e=this.props,t=e.value,o=e.suggestions,n=e.disabled,a=e.placeholder,s=e.onKeyUp,i=e.autoFocus,r=e.children,l=this.state.suggestionsHidden,u={direction:"ltr"};return Object(M.a)(t)&&(u.direction="rtl"),[Object(c.a)("div",{className:"compose-form__autosuggest-wrapper"},"autosuggest-wrapper",Object(c.a)("div",{className:"autosuggest-textarea"},void 0,Object(c.a)("label",{},void 0,Object(c.a)("span",{style:{display:"none"}},void 0,a),Object(c.a)(E.a,{inputRef:this.setTextarea,className:"autosuggest-textarea__textarea",disabled:n,placeholder:a,autoFocus:i,value:t,onChange:this.onChange,onKeyDown:this.onKeyDown,onKeyUp:s,onFocus:this.onFocus,onBlur:this.onBlur,onPaste:this.onPaste,style:u,"aria-autocomplete":"list"}))),r),Object(c.a)("div",{className:"autosuggest-textarea__suggestions-wrapper"},"suggestions-wrapper",Object(c.a)("div",{className:"autosuggest-textarea__suggestions "+(l||o.isEmpty()?"":"autosuggest-textarea__suggestions--visible")},void 0,o.map(this.renderSuggestion)))]},t}(S.a);Object(u.a)(L,"propTypes",{value:j.a.string,suggestions:f.a.list,disabled:j.a.bool,placeholder:j.a.string,onSuggestionSelected:j.a.func.isRequired,onSuggestionsClearRequested:j.a.func.isRequired,onSuggestionsFetchRequested:j.a.func.isRequired,onChange:j.a.func.isRequired,onKeyUp:j.a.func,onKeyDown:j.a.func,onPaste:j.a.func.isRequired,autoFocus:j.a.bool}),Object(u.a)(L,"defaultProps",{autoFocus:!0});var U,z=o(4),W=function(e,t,o){var n,a=e.slice(0,t).search(/\S+$/),s=e.slice(t).search(/\s/);return!(n=s<0?e.slice(a):e.slice(a,s+t))||n.trim().length<3||-1===o.indexOf(n[0])?[null,null]:(n=n.trim().toLowerCase()).length>0?[a+1,n]:[null,null]},H=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"state",{suggestionsHidden:!0,focused:!1,selectedSuggestion:0,lastToken:null,tokenStart:0}),Object(u.a)(Object(r.a)(t),"onChange",function(e){var o=W(e.target.value,e.target.selectionStart,t.props.searchTokens),n=o[0],a=o[1];null!==a&&t.state.lastToken!==a?(t.setState({lastToken:a,selectedSuggestion:0,tokenStart:n}),t.props.onSuggestionsFetchRequested(a)):null===a&&(t.setState({lastToken:null}),t.props.onSuggestionsClearRequested()),t.props.onChange(e)}),Object(u.a)(Object(r.a)(t),"onKeyDown",function(e){var o=t.props,n=o.suggestions,a=o.disabled,s=t.state,i=s.selectedSuggestion,c=s.suggestionsHidden;if(a)e.preventDefault();else if(229!==e.which&&!e.isComposing){switch(e.key){case"Escape":0===n.size||c?document.querySelector(".ui").parentElement.focus():(e.preventDefault(),t.setState({suggestionsHidden:!0}));break;case"ArrowDown":n.size>0&&!c&&(e.preventDefault(),t.setState({selectedSuggestion:Math.min(i+1,n.size-1)}));break;case"ArrowUp":n.size>0&&!c&&(e.preventDefault(),t.setState({selectedSuggestion:Math.max(i-1,0)}));break;case"Enter":case"Tab":null!==t.state.lastToken&&n.size>0&&!c&&(e.preventDefault(),e.stopPropagation(),t.props.onSuggestionSelected(t.state.tokenStart,t.state.lastToken,n.get(i)))}!e.defaultPrevented&&t.props.onKeyDown&&t.props.onKeyDown(e)}}),Object(u.a)(Object(r.a)(t),"onBlur",function(){t.setState({suggestionsHidden:!0,focused:!1})}),Object(u.a)(Object(r.a)(t),"onFocus",function(){t.setState({focused:!0})}),Object(u.a)(Object(r.a)(t),"onSuggestionClick",function(e){var o=t.props.suggestions.get(e.currentTarget.getAttribute("data-index"));e.preventDefault(),t.props.onSuggestionSelected(t.state.tokenStart,t.state.lastToken,o),t.input.focus()}),Object(u.a)(Object(r.a)(t),"setInput",function(e){t.input=e}),Object(u.a)(Object(r.a)(t),"renderSuggestion",function(e,o){var n,a,s=t.state.selectedSuggestion;return"emoji"===e.type?(n=Object(c.a)(R.a,{emoji:e}),a=e.id):"hashtag"===e.type?(n=Object(c.a)(F,{tag:e}),a=e.name):"account"===e.type&&(n=Object(c.a)(I,{id:e.id}),a=e.id),Object(c.a)("div",{role:"button",tabIndex:"0","data-index":o,className:A()("autosuggest-textarea__suggestions__item",{selected:o===s}),onMouseDown:t.onSuggestionClick},a,n)}),t}Object(l.a)(t,e);var o=t.prototype;return o.componentWillReceiveProps=function(e){e.suggestions!==this.props.suggestions&&e.suggestions.size>0&&this.state.suggestionsHidden&&this.state.focused&&this.setState({suggestionsHidden:!1})},o.render=function(){var e=this.props,t=e.value,o=e.suggestions,n=e.disabled,a=e.placeholder,s=e.onKeyUp,i=e.autoFocus,r=e.className,l=e.id,u=e.maxLength,d=this.state.suggestionsHidden,g={direction:"ltr"};return Object(M.a)(t)&&(g.direction="rtl"),Object(c.a)("div",{className:"autosuggest-input"},void 0,Object(c.a)("label",{},void 0,Object(c.a)("span",{style:{display:"none"}},void 0,a),p.a.createElement("input",{type:"text",ref:this.setInput,disabled:n,placeholder:a,autoFocus:i,value:t,onChange:this.onChange,onKeyDown:this.onKeyDown,onKeyUp:s,onFocus:this.onFocus,onBlur:this.onBlur,style:g,"aria-autocomplete":"list",id:l,className:r,maxLength:u})),Object(c.a)("div",{className:"autosuggest-textarea__suggestions "+(d||o.isEmpty()?"":"autosuggest-textarea__suggestions--visible")},void 0,o.map(this.renderSuggestion)))},t}(S.a);Object(u.a)(H,"propTypes",{value:j.a.string,suggestions:f.a.list,disabled:j.a.bool,placeholder:j.a.string,onSuggestionSelected:j.a.func.isRequired,onSuggestionsClearRequested:j.a.func.isRequired,onSuggestionsFetchRequested:j.a.func.isRequired,onChange:j.a.func.isRequired,onKeyUp:j.a.func,onKeyDown:j.a.func,autoFocus:j.a.bool,className:j.a.string,id:j.a.string,searchTokens:j.a.arrayOf(j.a.string),maxLength:j.a.number}),Object(u.a)(H,"defaultProps",{autoFocus:!0,searchTokens:Object(z.List)(["@",":","#"])});var B,G,Y,X,V,J,Z,$,Q=Object(k.f)({add_poll:{id:"poll_button.add_poll",defaultMessage:"Add a poll"},remove_poll:{id:"poll_button.remove_poll",defaultMessage:"Remove poll"}}),ee={height:null,lineHeight:"27px"},te=Object(k.g)(U=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleClick",function(){t.props.onClick()}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.intl,o=e.active,n=e.unavailable,a=e.disabled;return n?null:Object(c.a)("div",{className:"compose-form__poll-button"},void 0,Object(c.a)(_.a,{icon:"tasks",title:t.formatMessage(o?Q.remove_poll:Q.add_poll),disabled:a,onClick:this.handleClick,className:"compose-form__poll-button-icon "+(o?"active":""),size:18,inverted:!0,style:ee}))},t}(p.a.PureComponent))||U,oe=Object(i.connect)(function(e){return{unavailable:e.getIn(["compose","is_uploading"])||e.getIn(["compose","media_attachments"]).size>0,active:null!==e.getIn(["compose","poll"])}},function(e){return{onClick:function(){e(function(t,o){o().getIn(["compose","poll"])?e(Object(O.eb)()):e(Object(O.K)())})}}})(te),ne=Object(k.f)({upload:{id:"upload_button.label",defaultMessage:"Add media ({formats})"}}),ae={height:null,lineHeight:"27px"},se=Object(i.connect)(function(){return function(e){return{acceptContentTypes:e.getIn(["media_attachments","accept_content_types"])}}})(B=Object(k.g)((Y=G=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleChange",function(e){e.target.files.length>0&&t.props.onSelectFile(e.target.files)}),Object(u.a)(Object(r.a)(t),"handleClick",function(){t.fileElement.click()}),Object(u.a)(Object(r.a)(t),"setRef",function(e){t.fileElement=e}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.intl,o=e.resetFileKey,n=e.unavailable,a=e.disabled;e.acceptContentTypes;return n?null:Object(c.a)("div",{className:"compose-form__upload-button"},void 0,Object(c.a)(_.a,{icon:"paperclip",title:t.formatMessage(ne.upload,{formats:"JPEG, PNG, GIF, WebM, MP4, MOV, OGG, WAV, MP3, FLAC"}),disabled:a,onClick:this.handleClick,className:"compose-form__upload-button-icon",size:18,inverted:!0,style:ae}),Object(c.a)("label",{},void 0,Object(c.a)("span",{style:{display:"none"}},void 0,t.formatMessage(ne.upload,{formats:"JPEG, PNG, GIF, WebM, MP4, MOV, OGG, WAV, MP3, FLAC"})),p.a.createElement("input",{key:o,ref:this.setRef,type:"file",multiple:!0,onChange:this.handleChange,disabled:a,style:{display:"none"}})))},t}(S.a),Object(u.a)(G,"propTypes",{disabled:j.a.bool,unavailable:j.a.bool,onSelectFile:j.a.func.isRequired,style:j.a.object,resetFileKey:j.a.number,acceptContentTypes:f.a.listOf(j.a.string).isRequired,intl:j.a.object.isRequired}),B=Y))||B)||B,ie=Object(i.connect)(function(e){return{disabled:e.getIn(["compose","is_uploading"])||e.getIn(["compose","media_attachments"]).size>3||e.getIn(["compose","media_attachments"]).some(function(e){return["video","audio"].includes(e.get("type"))}),unavailable:null!==e.getIn(["compose","poll"]),resetFileKey:e.getIn(["compose","resetFileKey"])}},function(e){return{onSelectFile:function(t){e(Object(O.mb)(t))}}})(se),ce={height:null,lineHeight:"27px",width:"23.14285722px"},re=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleClick",function(e){e.preventDefault(),t.props.onClick()}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.label,o=e.title,n=e.active,a=e.ariaControls;return Object(c.a)("button",{title:o,"aria-label":o,className:"text-icon-button "+(n?"active":""),"aria-expanded":n,onClick:this.handleClick,"aria-controls":a,style:ce},void 0,t)},t}(p.a.PureComponent),le=Object(k.f)({marked:{id:"compose_form.spoiler.marked",defaultMessage:"Text is hidden behind warning"},unmarked:{id:"compose_form.spoiler.unmarked",defaultMessage:"Text is not hidden"}}),ue=Object(k.g)(Object(i.connect)(function(e,t){return{label:"CW",title:t.intl.formatMessage(e.getIn(["compose","spoiler"])?le.marked:le.unmarked),active:e.getIn(["compose","spoiler"]),ariaControls:"cw-spoiler-input"}},function(e){return{onClick:function(){e(Object(O.Q)())}}})(re)),de=o(13),pe=o(113),ge=o.n(pe),be=o(88),me=o(34),fe=o.n(me),he=o(64),je=o.n(he),Oe=o(27),ve=Object(k.f)({public_short:{id:"privacy.public.short",defaultMessage:"Public"},public_long:{id:"privacy.public.long",defaultMessage:"Post to public timelines"},unlisted_short:{id:"privacy.unlisted.short",defaultMessage:"Unlisted"},unlisted_long:{id:"privacy.unlisted.long",defaultMessage:"Do not show in public timelines"},private_short:{id:"privacy.private.short",defaultMessage:"Followers-only"},private_long:{id:"privacy.private.long",defaultMessage:"Post to followers only"},direct_short:{id:"privacy.direct.short",defaultMessage:"Direct"},direct_long:{id:"privacy.direct.long",defaultMessage:"Post to mentioned users only"},change_privacy:{id:"privacy.change",defaultMessage:"Adjust status privacy"}}),ye=!!je.a.hasSupport&&{passive:!0},_e=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"state",{mounted:!1}),Object(u.a)(Object(r.a)(t),"handleDocumentClick",function(e){t.node&&!t.node.contains(e.target)&&t.props.onClose()}),Object(u.a)(Object(r.a)(t),"handleKeyDown",function(e){var o,n=t.props.items,a=e.currentTarget.getAttribute("data-index"),s=n.findIndex(function(e){return e.value===a});switch(e.key){case"Escape":t.props.onClose();break;case"Enter":t.handleClick(e);break;case"ArrowDown":(o=t.node.childNodes[s+1])&&(o.focus(),t.props.onChange(o.getAttribute("data-index")));break;case"ArrowUp":(o=t.node.childNodes[s-1])&&(o.focus(),t.props.onChange(o.getAttribute("data-index")));break;case"Tab":(o=e.shiftKey?t.node.childNodes[s-1]||t.node.lastChild:t.node.childNodes[s+1]||t.node.firstChild)&&(o.focus(),t.props.onChange(o.getAttribute("data-index")),e.preventDefault(),e.stopPropagation());break;case"Home":(o=t.node.firstChild)&&(o.focus(),t.props.onChange(o.getAttribute("data-index")));break;case"End":(o=t.node.lastChild)&&(o.focus(),t.props.onChange(o.getAttribute("data-index")))}}),Object(u.a)(Object(r.a)(t),"handleClick",function(e){var o=e.currentTarget.getAttribute("data-index");e.preventDefault(),t.props.onClose(),t.props.onChange(o)}),Object(u.a)(Object(r.a)(t),"setRef",function(e){t.node=e}),Object(u.a)(Object(r.a)(t),"setFocusRef",function(e){t.focusedItem=e}),t}Object(l.a)(t,e);var o=t.prototype;return o.componentDidMount=function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,ye),this.focusedItem&&this.focusedItem.focus(),this.setState({mounted:!0})},o.componentWillUnmount=function(){document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,ye)},o.render=function(){var e=this,t=this.state.mounted,o=this.props,n=o.style,a=o.items,s=o.placement,i=o.value;return Object(c.a)(be.a,{defaultStyle:{opacity:0,scaleX:.85,scaleY:.75},style:{opacity:fe()(1,{damping:35,stiffness:400}),scaleX:fe()(1,{damping:35,stiffness:400}),scaleY:fe()(1,{damping:35,stiffness:400})}},void 0,function(o){var r=o.opacity,l=o.scaleX,u=o.scaleY;return p.a.createElement("div",{className:"privacy-dropdown__dropdown "+s,style:Object(de.default)({},n,{opacity:r,transform:t?"scale("+l+", "+u+")":null,zIndex:2}),role:"listbox",ref:e.setRef},a.map(function(t){return p.a.createElement("div",{role:"option",tabIndex:"0",key:t.value,"data-index":t.value,onKeyDown:e.handleKeyDown,onClick:e.handleClick,className:A()("privacy-dropdown__option",{active:t.value===i}),"aria-selected":t.value===i,ref:t.value===i?e.setFocusRef:null},Object(c.a)("div",{className:"privacy-dropdown__option__icon"},void 0,Object(c.a)(Oe.a,{id:t.icon,fixedWidth:!0})),Object(c.a)("div",{className:"privacy-dropdown__option__content"},void 0,Object(c.a)("strong",{},void 0,t.text),t.meta))}))})},t}(p.a.PureComponent),Ce=Object(k.g)(X=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"state",{open:!1,placement:"bottom"}),Object(u.a)(Object(r.a)(t),"handleToggle",function(e){var o=e.target;if(t.props.isUserTouching())t.state.open?t.props.onModalClose():t.props.onModalOpen({actions:t.options.map(function(e){return Object(de.default)({},e,{active:e.value===t.props.value})}),onClick:t.handleModalActionClick});else{var n=o.getBoundingClientRect().top;t.state.open&&t.activeElement&&t.activeElement.focus(),t.setState({placement:2*n<innerHeight?"bottom":"top"}),t.setState({open:!t.state.open})}}),Object(u.a)(Object(r.a)(t),"handleModalActionClick",function(e){e.preventDefault();var o=t.options[e.currentTarget.getAttribute("data-index")].value;t.props.onModalClose(),t.props.onChange(o)}),Object(u.a)(Object(r.a)(t),"handleKeyDown",function(e){switch(e.key){case"Escape":t.handleClose()}}),Object(u.a)(Object(r.a)(t),"handleMouseDown",function(){t.state.open||(t.activeElement=document.activeElement)}),Object(u.a)(Object(r.a)(t),"handleButtonKeyDown",function(e){switch(e.key){case" ":case"Enter":t.handleMouseDown()}}),Object(u.a)(Object(r.a)(t),"handleClose",function(){t.state.open&&t.activeElement&&t.activeElement.focus(),t.setState({open:!1})}),Object(u.a)(Object(r.a)(t),"handleChange",function(e){t.props.onChange(e)}),t}Object(l.a)(t,e);var o=t.prototype;return o.componentWillMount=function(){var e=this.props.intl.formatMessage;this.options=[{icon:"globe",value:"public",text:e(ve.public_short),meta:e(ve.public_long)},{icon:"unlock",value:"unlisted",text:e(ve.unlisted_short),meta:e(ve.unlisted_long)},{icon:"lock",value:"private",text:e(ve.private_short),meta:e(ve.private_long)},{icon:"envelope",value:"direct",text:e(ve.direct_short),meta:e(ve.direct_long)}]},o.render=function(){var e=this.props,t=e.value,o=e.intl,n=this.state,a=n.open,s=n.placement,i=this.options.find(function(e){return e.value===t});return Object(c.a)("div",{className:A()("privacy-dropdown",s,{active:a}),onKeyDown:this.handleKeyDown},void 0,Object(c.a)("div",{className:A()("privacy-dropdown__value",{active:this.options.indexOf(i)===("bottom"===s?0:this.options.length-1)})},void 0,Object(c.a)(_.a,{className:"privacy-dropdown__value-icon",icon:i.icon,title:o.formatMessage(ve.change_privacy),size:18,expanded:a,active:a,inverted:!0,onClick:this.handleToggle,onMouseDown:this.handleMouseDown,onKeyDown:this.handleButtonKeyDown,style:{height:null,lineHeight:"27px"}})),Object(c.a)(ge.a,{show:a,placement:s,target:this},void 0,Object(c.a)(_e,{items:this.options,value:t,onClose:this.handleClose,onChange:this.handleChange,placement:s})))},t}(p.a.PureComponent))||X,ke=o(47),Se=o(114),Me=Object(i.connect)(function(e){return{isModalOpen:"ACTIONS"===e.get("modal").modalType,value:e.getIn(["compose","privacy"])}},function(e){return{onChange:function(t){e(Object(O.R)(t))},isUserTouching:Se.c,onModalOpen:function(t){return e(Object(ke.d)("ACTIONS",t))},onModalClose:function(){return e(Object(ke.c)())}}})(Ce),we=o(573),xe=o(72),Te=o(53),De=o(225),Ne=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","yum","disappointed","thinking_face","weary","sob","sunglasses","heart","ok_hand"],Ie=Object(Te.a)([function(e){return e.getIn(["settings","frequentlyUsedEmojis"],Object(z.Map)())}],function(e){var t=e.keySeq().sort(function(t,o){return e.get(t)-e.get(o)}).reverse().slice(0,16).toArray();if(t.length<Ne.length){var o=Ne.filter(function(e){return!t.includes(e)});t=t.concat(o.slice(0,Ne.length-t.length))}return t}),Re=Object(Te.a)([function(e){return e.get("custom_emojis")}],function(e){return e.filter(function(e){return e.get("visible_in_picker")}).sort(function(e,t){var o=e.get("shortcode").toLowerCase(),n=t.get("shortcode").toLowerCase();return o<n?-1:o>n?1:0})}),Pe=Object(i.connect)(function(e){return{custom_emojis:Re(e),skinTone:e.getIn(["settings","skinTone"]),frequentlyUsedEmojis:Ie(e)}},function(e,t){var o=t.onPickEmoji;return{onSkinTone:function(t){e(Object(xe.c)(["skinTone"],t))},onPickEmoji:function(t){e(Object(De.b)(t)),o&&o(t)}}})(we.a),Fe=o(22),Ee=o(31),qe=Object(k.f)({option_placeholder:{id:"compose_form.poll.option_placeholder",defaultMessage:"Choice {number}"},add_option:{id:"compose_form.poll.add_option",defaultMessage:"Add a choice"},remove_option:{id:"compose_form.poll.remove_option",defaultMessage:"Remove this choice"},poll_duration:{id:"compose_form.poll.duration",defaultMessage:"Poll duration"},minutes:{id:"intervals.full.minutes",defaultMessage:"{number, plural, one {# minute} other {# minutes}}"},hours:{id:"intervals.full.hours",defaultMessage:"{number, plural, one {# hour} other {# hours}}"},days:{id:"intervals.full.days",defaultMessage:"{number, plural, one {# day} other {# days}}"}}),Ae=Object(k.g)(V=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleOptionTitleChange",function(e){t.props.onChange(t.props.index,e.target.value)}),Object(u.a)(Object(r.a)(t),"handleOptionRemove",function(){t.props.onRemove(t.props.index)}),Object(u.a)(Object(r.a)(t),"handleToggleMultiple",function(e){t.props.onToggleMultiple(),e.preventDefault(),e.stopPropagation()}),Object(u.a)(Object(r.a)(t),"onSuggestionsClearRequested",function(){t.props.onClearSuggestions()}),Object(u.a)(Object(r.a)(t),"onSuggestionsFetchRequested",function(e){t.props.onFetchSuggestions(e)}),Object(u.a)(Object(r.a)(t),"onSuggestionSelected",function(e,o,n){t.props.onSuggestionSelected(e,o,n,["poll","options",t.props.index])}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.isPollMultiple,o=e.title,n=e.index,a=e.intl;return Object(c.a)("li",{},void 0,Object(c.a)("label",{className:"poll__text editable"},void 0,Object(c.a)("span",{className:A()("poll__input",{checkbox:t}),onClick:this.handleToggleMultiple,role:"button",tabIndex:"0"}),Object(c.a)(H,{placeholder:a.formatMessage(qe.option_placeholder,{number:n+1}),maxLength:25,value:o,onChange:this.handleOptionTitleChange,suggestions:this.props.suggestions,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,searchTokens:[":"]})),Object(c.a)("div",{className:"poll__cancel"},void 0,Object(c.a)(_.a,{disabled:n<=1,title:a.formatMessage(qe.remove_option),icon:"times",onClick:this.handleOptionRemove})))},t}(p.a.PureComponent))||V,Ke=Object(k.g)(($=Z=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleAddOption",function(){t.props.onAddOption("")}),Object(u.a)(Object(r.a)(t),"handleSelectDuration",function(e){t.props.onChangeSettings(e.target.value,t.props.isMultiple)}),Object(u.a)(Object(r.a)(t),"handleToggleMultiple",function(){t.props.onChangeSettings(t.props.expiresIn,!t.props.isMultiple)}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.options,n=t.expiresIn,a=t.isMultiple,s=t.onChangeOption,i=t.onRemoveOption,r=t.intl,l=Object(Ee.default)(t,["options","expiresIn","isMultiple","onChangeOption","onRemoveOption","intl"]);return o?Object(c.a)("div",{className:"compose-form__poll-wrapper"},void 0,Object(c.a)("ul",{},void 0,o.map(function(t,o){return p.a.createElement(Ae,Object(Fe.a)({title:t,key:o,index:o,onChange:s,onRemove:i,isPollMultiple:a,onToggleMultiple:e.handleToggleMultiple},l))})),Object(c.a)("div",{className:"poll__footer"},void 0,o.size<4&&Object(c.a)("button",{className:"button button-secondary",onClick:this.handleAddOption},void 0,Object(c.a)(Oe.a,{id:"plus"})," ",p.a.createElement(k.b,qe.add_option)),Object(c.a)("select",{value:n,onChange:this.handleSelectDuration},void 0,Object(c.a)("option",{value:300},void 0,r.formatMessage(qe.minutes,{number:5})),Object(c.a)("option",{value:1800},void 0,r.formatMessage(qe.minutes,{number:30})),Object(c.a)("option",{value:3600},void 0,r.formatMessage(qe.hours,{number:1})),Object(c.a)("option",{value:21600},void 0,r.formatMessage(qe.hours,{number:6})),Object(c.a)("option",{value:86400},void 0,r.formatMessage(qe.days,{number:1})),Object(c.a)("option",{value:259200},void 0,r.formatMessage(qe.days,{number:3})),Object(c.a)("option",{value:604800},void 0,r.formatMessage(qe.days,{number:7}))))):null},t}(S.a),Object(u.a)(Z,"propTypes",{options:f.a.list,expiresIn:j.a.number,isMultiple:j.a.bool,onChangeOption:j.a.func.isRequired,onAddOption:j.a.func.isRequired,onRemoveOption:j.a.func.isRequired,onChangeSettings:j.a.func.isRequired,suggestions:f.a.list,onClearSuggestions:j.a.func.isRequired,onFetchSuggestions:j.a.func.isRequired,onSuggestionSelected:j.a.func.isRequired,intl:j.a.object.isRequired}),J=$))||J,Le=Object(i.connect)(function(e){return{suggestions:e.getIn(["compose","suggestions"]),options:e.getIn(["compose","poll","options"]),expiresIn:e.getIn(["compose","poll","expires_in"]),isMultiple:e.getIn(["compose","poll","multiple"])}},function(e){return{onAddOption:function(t){e(Object(O.L)(t))},onRemoveOption:function(t){e(Object(O.fb)(t))},onChangeOption:function(t,o){e(Object(O.T)(t,o))},onChangeSettings:function(t,o){e(Object(O.U)(t,o))},onClearSuggestions:function(){e(Object(O.W)())},onFetchSuggestions:function(t){e(Object(O.Z)(t))},onSuggestionSelected:function(t,o,n,a){e(Object(O.ib)(t,o,n,a))}}})(Ke),Ue=o(307),ze=Object(i.connect)(function(e){return{active:e.getIn(["compose","is_uploading"]),progress:e.getIn(["compose","progress"])}})(Ue.a),We=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleUndoClick",function(e){e.stopPropagation(),t.props.onUndo(t.props.media.get("id"))}),Object(u.a)(Object(r.a)(t),"handleFocalPointClick",function(e){e.stopPropagation(),t.props.onOpenFocalPoint(t.props.media.get("id"))}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this,t=this.props.media,o=t.getIn(["meta","focus","x"]),n=t.getIn(["meta","focus","y"]),a=100*(o/2+.5),s=100*(n/-2+.5);return Object(c.a)("div",{className:"compose-form__upload",tabIndex:"0",role:"button"},void 0,Object(c.a)(be.a,{defaultStyle:{scale:.8},style:{scale:fe()(1,{stiffness:180,damping:12})}},void 0,function(o){var n=o.scale;return Object(c.a)("div",{className:"compose-form__upload-thumbnail",style:{transform:"scale("+n+")",backgroundImage:"url("+t.get("preview_url")+")",backgroundPosition:a+"% "+s+"%"}},void 0,Object(c.a)("div",{className:A()("compose-form__upload__actions",{active:!0})},void 0,Object(c.a)("button",{className:"icon-button",onClick:e.handleUndoClick},void 0,Object(c.a)(Oe.a,{id:"times"})," ",Object(c.a)(k.b,{id:"upload_form.undo",defaultMessage:"Delete"})),Object(c.a)("button",{className:"icon-button",onClick:e.handleFocalPointClick},void 0,Object(c.a)(Oe.a,{id:"pencil"})," ",Object(c.a)(k.b,{id:"upload_form.edit",defaultMessage:"Edit"}))))}))},t}(S.a);Object(u.a)(We,"contextTypes",{router:j.a.object}),Object(u.a)(We,"propTypes",{media:f.a.map.isRequired,onUndo:j.a.func.isRequired,onOpenFocalPoint:j.a.func.isRequired});var He=Object(i.connect)(function(e,t){var o=t.id;return{media:e.getIn(["compose","media_attachments"]).find(function(e){return e.get("id")===o})}},function(e){return{onUndo:function(t){e(Object(O.kb)(t))},onOpenFocalPoint:function(t){e(Object(ke.d)("FOCAL_POINT",{id:t}))},onSubmit:function(t){e(Object(O.jb)(t))}}})(We),Be=Object(k.f)({marked:{id:"compose_form.sensitive.marked",defaultMessage:"Media is marked as sensitive"},unmarked:{id:"compose_form.sensitive.unmarked",defaultMessage:"Media is not marked as sensitive"}}),Ge=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.active,o=e.disabled,n=e.onClick,a=e.intl;return Object(c.a)("div",{className:"compose-form__sensitive-button"},void 0,Object(c.a)("label",{className:A()("icon-button",{active:t}),title:a.formatMessage(t?Be.marked:Be.unmarked)},void 0,Object(c.a)("input",{name:"mark-sensitive",type:"checkbox",checked:t,onChange:n,disabled:o}),Object(c.a)("span",{className:A()("checkbox",{active:t})}),Object(c.a)(k.b,{id:"compose_form.sensitive.hide",defaultMessage:"Mark media as sensitive"})))},t}(p.a.PureComponent),Ye=Object(i.connect)(function(e){return{active:e.getIn(["compose","sensitive"]),disabled:e.getIn(["compose","spoiler"])}},function(e){return{onClick:function(){e(Object(O.O)())}}})(Object(k.g)(Ge)),Xe=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props.mediaIds;return Object(c.a)("div",{className:"compose-form__upload-wrapper"},void 0,Object(c.a)(ze,{icon:"upload",message:Object(c.a)(k.b,{id:"upload_progress.label",defaultMessage:"Uploading…"})}),Object(c.a)("div",{className:"compose-form__uploads-wrapper"},void 0,e.map(function(e){return Object(c.a)(He,{id:e},e)})),!e.isEmpty()&&Object(c.a)(Ye,{}))},t}(S.a);Object(u.a)(Xe,"propTypes",{mediaIds:f.a.list.isRequired});var Ve,Je,Ze,$e=Object(i.connect)(function(e){return{mediaIds:e.getIn(["compose","media_attachments"]).map(function(e){return e.get("id")})}})(Xe),Qe=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props.message;return Object(c.a)(be.a,{defaultStyle:{opacity:0,scaleX:.85,scaleY:.75},style:{opacity:fe()(1,{damping:35,stiffness:400}),scaleX:fe()(1,{damping:35,stiffness:400}),scaleY:fe()(1,{damping:35,stiffness:400})}},void 0,function(t){var o=t.opacity,n=t.scaleX,a=t.scaleY;return Object(c.a)("div",{className:"compose-form__warning",style:{opacity:o,transform:"scale("+n+", "+a+")"}},void 0,e)})},t}(p.a.PureComponent),et=o(20),tt=/(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i,ot=Object(i.connect)(function(e){return{needsLockWarning:"private"===e.getIn(["compose","privacy"])&&!e.getIn(["accounts",et.m,"locked"]),hashtagWarning:"public"!==e.getIn(["compose","privacy"])&&tt.test(e.getIn(["compose","text"])),directMessageWarning:"direct"===e.getIn(["compose","privacy"])}})(function(e){var t=e.needsLockWarning,o=e.hashtagWarning,n=e.directMessageWarning;if(t)return Object(c.a)(Qe,{message:Object(c.a)(k.b,{id:"compose_form.lock_disclaimer",defaultMessage:"Your account is not {locked}. Anyone can follow you to view your follower-only posts.",values:{locked:Object(c.a)("a",{href:"/user-settings"},void 0,Object(c.a)(k.b,{id:"compose_form.lock_disclaimer.lock",defaultMessage:"locked"}))}})});if(o)return Object(c.a)(Qe,{message:Object(c.a)(k.b,{id:"compose_form.hashtag_warning",defaultMessage:"This toot won't be listed under any hashtag as it is unlisted. Only public toots can be searched by hashtag."})});if(n){var a=Object(c.a)("span",{},void 0,Object(c.a)(k.b,{id:"compose_form.direct_message_warning",defaultMessage:"This toot will only be sent to all the mentioned users."})," ",Object(c.a)("a",{href:"/terms",target:"_blank"},void 0,Object(c.a)(k.b,{id:"compose_form.direct_message_warning_learn_more",defaultMessage:"Learn more"})));return Object(c.a)(Qe,{message:a})}return null}),nt=o(76),at="><\85                 \u2028\u2029\t\n\v\f\r",st=Object(k.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}!"}}),it=Object(k.g)((Ze=Je=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(u.a)(Object(r.a)(t),"handleChange",function(e){t.props.onChange(e.target.value)}),Object(u.a)(Object(r.a)(t),"handleKeyDown",function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&t.handleSubmit()}),Object(u.a)(Object(r.a)(t),"handleSubmit",function(){t.props.text!==t.autosuggestTextarea.textarea.value&&t.props.onChange(t.autosuggestTextarea.textarea.value);var e=t.props,o=e.isSubmitting,n=e.isChangingUpload,a=e.isUploading,s=e.anyMedia,i=[t.props.spoilerText,t.props.text].join("");o||a||n||Object(nt.length)(i)>et.l||0!==i.length&&0===i.trim().length&&!s||t.props.onSubmit(t.context.router?t.context.router.history:null)}),Object(u.a)(Object(r.a)(t),"onSuggestionsClearRequested",function(){t.props.onClearSuggestions()}),Object(u.a)(Object(r.a)(t),"onSuggestionsFetchRequested",function(e){t.props.onFetchSuggestions(e)}),Object(u.a)(Object(r.a)(t),"onSuggestionSelected",function(e,o,n){t.props.onSuggestionSelected(e,o,n,["text"])}),Object(u.a)(Object(r.a)(t),"onSpoilerSuggestionSelected",function(e,o,n){t.props.onSuggestionSelected(e,o,n,["spoiler_text"])}),Object(u.a)(Object(r.a)(t),"handleChangeSpoilerText",function(e){t.props.onChangeSpoilerText(e.target.value)}),Object(u.a)(Object(r.a)(t),"handleFocus",function(){if(t.composeForm&&!t.props.singleColumn){var e=t.composeForm.getBoundingClientRect(),o=e.left,n=e.right;(o<0||n>(window.innerWidth||document.documentElement.clientWidth))&&t.composeForm.scrollIntoView()}}),Object(u.a)(Object(r.a)(t),"setAutosuggestTextarea",function(e){t.autosuggestTextarea=e}),Object(u.a)(Object(r.a)(t),"setSpoilerText",function(e){t.spoilerText=e}),Object(u.a)(Object(r.a)(t),"setRef",function(e){t.composeForm=e}),Object(u.a)(Object(r.a)(t),"handleEmojiPick",function(e){var o=t.props.text,n=t.autosuggestTextarea.textarea.selectionStart,a=e.custom&&n>0&&!at.includes(o[n-1]);t.props.onPickEmoji(n,e,a)}),t}Object(l.a)(t,e);var o=t.prototype;return o.componentDidUpdate=function(e){var t,o;this.props.focusDate!==e.focusDate?(this.props.preselectDate!==e.preselectDate?(t=this.props.text.length,o=this.props.text.search(/\s/)+1):"number"==typeof this.props.caretPosition?(o=this.props.caretPosition,t=this.props.caretPosition):o=t=this.props.text.length,this.autosuggestTextarea.textarea.setSelectionRange(o,t),this.autosuggestTextarea.textarea.focus()):e.isSubmitting&&!this.props.isSubmitting?this.autosuggestTextarea.textarea.focus():this.props.spoiler!==e.spoiler&&(this.props.spoiler?this.spoilerText.input.focus():this.autosuggestTextarea.textarea.focus())},o.render=function(){var e=this.props,t=e.intl,o=e.onPaste,n=e.showSearch,a=e.anyMedia,s=this.props.isSubmitting,i=[this.props.spoilerText,this.props.text].join(""),r=s||this.props.isUploading||this.props.isChangingUpload||Object(nt.length)(i)>et.l||0!==i.length&&0===i.trim().length&&!a,l="";return l="private"===this.props.privacy||"direct"===this.props.privacy?Object(c.a)("span",{className:"compose-form__publish-private"},void 0,Object(c.a)(Oe.a,{id:"lock"})," ",t.formatMessage(st.publish)):"unlisted"!==this.props.privacy?t.formatMessage(st.publishLoud,{publish:t.formatMessage(st.publish)}):t.formatMessage(st.publish),Object(c.a)("div",{className:"compose-form"},void 0,Object(c.a)(ot,{}),Object(c.a)(D,{}),p.a.createElement("div",{className:"spoiler-input "+(this.props.spoiler?"spoiler-input--visible":""),ref:this.setRef},p.a.createElement(H,{placeholder:t.formatMessage(st.spoiler_placeholder),value:this.props.spoilerText,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,disabled:!this.props.spoiler,ref:this.setSpoilerText,suggestions:this.props.suggestions,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSpoilerSuggestionSelected,searchTokens:[":"],id:"cw-spoiler-input",className:"spoiler-input__input"})),p.a.createElement(L,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(st.placeholder),disabled:s,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,onPaste:o,autoFocus:!n&&!Object(Se.b)(window.innerWidth)},Object(c.a)(Pe,{onPickEmoji:this.handleEmojiPick}),Object(c.a)("div",{className:"compose-form__modifiers"},void 0,Object(c.a)($e,{}),Object(c.a)(Le,{}))),Object(c.a)("div",{className:"compose-form__buttons-wrapper"},void 0,Object(c.a)("div",{className:"compose-form__buttons"},void 0,Object(c.a)(ie,{}),Object(c.a)(oe,{}),Object(c.a)(Me,{}),Object(c.a)(ue,{})),Object(c.a)("div",{className:"character-counter__wrapper"},void 0,Object(c.a)(g.a,{max:et.l,text:i}))),Object(c.a)("div",{className:"compose-form__publish"},void 0,Object(c.a)("div",{className:"compose-form__publish-button-wrapper"},void 0,Object(c.a)(b.a,{text:l,onClick:this.handleSubmit,disabled:r,block:!0}))))},t}(S.a),Object(u.a)(Je,"contextTypes",{router:j.a.object}),Object(u.a)(Je,"propTypes",{intl:j.a.object.isRequired,text:j.a.string.isRequired,suggestions:f.a.list,spoiler:j.a.bool,privacy:j.a.string,spoilerText:j.a.string,focusDate:j.a.instanceOf(Date),caretPosition:j.a.number,preselectDate:j.a.instanceOf(Date),isSubmitting:j.a.bool,isChangingUpload:j.a.bool,isUploading:j.a.bool,onChange:j.a.func.isRequired,onSubmit:j.a.func.isRequired,onClearSuggestions:j.a.func.isRequired,onFetchSuggestions:j.a.func.isRequired,onSuggestionSelected:j.a.func.isRequired,onChangeSpoilerText:j.a.func.isRequired,onPaste:j.a.func.isRequired,onPickEmoji:j.a.func.isRequired,showSearch:j.a.bool,anyMedia:j.a.bool,singleColumn:j.a.bool}),Object(u.a)(Je,"defaultProps",{showSearch:!1}),Ve=Ze))||Ve;t.a=Object(i.connect)(function(e){return{text:e.getIn(["compose","text"]),suggestions:e.getIn(["compose","suggestions"]),spoiler:e.getIn(["compose","spoiler"]),spoilerText:e.getIn(["compose","spoiler_text"]),privacy:e.getIn(["compose","privacy"]),focusDate:e.getIn(["compose","focusDate"]),caretPosition:e.getIn(["compose","caretPosition"]),preselectDate:e.getIn(["compose","preselectDate"]),isSubmitting:e.getIn(["compose","is_submitting"]),isChangingUpload:e.getIn(["compose","is_changing_upload"]),isUploading:e.getIn(["compose","is_uploading"]),showSearch:e.getIn(["search","submitted"])&&!e.getIn(["search","hidden"]),anyMedia:e.getIn(["compose","media_attachments"]).size>0}},function(e){return{onChange:function(t){e(Object(O.N)(t))},onSubmit:function(t){e(Object(O.jb)(t))},onClearSuggestions:function(){e(Object(O.W)())},onFetchSuggestions:function(t){e(Object(O.Z)(t))},onSuggestionSelected:function(t,o,n,a){e(Object(O.ib)(t,o,n,a))},onChangeSpoilerText:function(t){e(Object(O.P)(t))},onPaste:function(t){e(Object(O.mb)(t))},onPickEmoji:function(t,o,n){e(Object(O.bb)(t,o,n))}}})(it)},693:function(e,t,o){"use strict";var n=o(12),a=o(6),s=o(688),i=o(638),c=o(47),r=o(20),l=Object(a.f)({logoutMessage:{id:"confirmations.logout.message",defaultMessage:"Are you sure you want to log out?"},logoutConfirm:{id:"confirmations.logout.confirm",defaultMessage:"Log out"}});t.a=Object(a.g)(Object(n.connect)(function(e){return{account:e.getIn(["accounts",r.m])}},function(e,t){var o=t.intl;return{onLogout:function(){e(Object(c.d)("CONFIRM",{message:o.formatMessage(l.logoutMessage),confirm:o.formatMessage(l.logoutConfirm),onConfirm:function(){return Object(i.a)()}}))}}})(s.a))},719:function(e,t,o){"use strict";o.r(t),o.d(t,"default",function(){return M});var n,a=o(0),s=o(2),i=o(7),c=o(1),r=o(3),l=o.n(r),u=o(574),d=o(693),p=o(12),g=o(21),b=o(310),m=o(6),f=o(687),h=o(88),j=o(34),O=o.n(j),v=o(1097),y=o(47),_=o(20),C=o(27),k=o(638),S=Object(m.f)({start:{id:"getting_started.heading",defaultMessage:"Getting started"},home_timeline:{id:"tabs_bar.home",defaultMessage:"Home"},notifications:{id:"tabs_bar.notifications",defaultMessage:"Notifications"},public:{id:"navigation_bar.public_timeline",defaultMessage:"Federated timeline"},community:{id:"navigation_bar.community_timeline",defaultMessage:"Local timeline"},preferences:{id:"navigation_bar.preferences",defaultMessage:"Preferences"},logout:{id:"navigation_bar.logout",defaultMessage:"Logout"},compose:{id:"navigation_bar.compose",defaultMessage:"Compose new toot"},logoutMessage:{id:"confirmations.logout.message",defaultMessage:"Are you sure you want to log out?"},logoutConfirm:{id:"confirmations.logout.confirm",defaultMessage:"Log out"}}),M=Object(p.connect)(function(e,t){return{columns:e.getIn(["settings","columns"]),showSearch:t.multiColumn?e.getIn(["search","submitted"])&&!e.getIn(["search","hidden"]):t.isSearchPage}})(n=Object(m.g)(n=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return t=e.call.apply(e,[this].concat(n))||this,Object(c.a)(Object(s.a)(t),"handleLogoutClick",function(e){var o=t.props,n=o.dispatch,a=o.intl;return e.preventDefault(),e.stopPropagation(),n(Object(y.d)("CONFIRM",{message:a.formatMessage(S.logoutMessage),confirm:a.formatMessage(S.logoutConfirm),onConfirm:function(){return Object(k.a)()}})),!1}),Object(c.a)(Object(s.a)(t),"onFocus",function(){t.props.dispatch(Object(g.S)(!0))}),Object(c.a)(Object(s.a)(t),"onBlur",function(){t.props.dispatch(Object(g.S)(!1))}),t}Object(i.a)(t,e);var o=t.prototype;return o.componentDidMount=function(){this.props.isSearchPage||this.props.dispatch(Object(g.db)())},o.componentWillUnmount=function(){this.props.isSearchPage||this.props.dispatch(Object(g.lb)())},o.render=function(){var e=this.props,t=e.multiColumn,o=e.showSearch,n=e.isSearchPage,s=e.intl,i="";if(t){var c=this.props.columns;i=Object(a.a)("nav",{className:"drawer__header"},void 0,Object(a.a)(b.a,{to:"/getting-started",className:"drawer__tab",title:s.formatMessage(S.start),"aria-label":s.formatMessage(S.start)},void 0,Object(a.a)(C.a,{id:"bars",fixedWidth:!0})),!c.some(function(e){return"HOME"===e.get("id")})&&Object(a.a)(b.a,{to:"/timelines/home",className:"drawer__tab",title:s.formatMessage(S.home_timeline),"aria-label":s.formatMessage(S.home_timeline)},void 0,Object(a.a)(C.a,{id:"home",fixedWidth:!0})),!c.some(function(e){return"NOTIFICATIONS"===e.get("id")})&&Object(a.a)(b.a,{to:"/notifications",className:"drawer__tab",title:s.formatMessage(S.notifications),"aria-label":s.formatMessage(S.notifications)},void 0,Object(a.a)(C.a,{id:"bell",fixedWidth:!0})),!c.some(function(e){return"COMMUNITY"===e.get("id")})&&Object(a.a)(b.a,{to:"/timelines/public/local",className:"drawer__tab",title:s.formatMessage(S.community),"aria-label":s.formatMessage(S.community)},void 0,Object(a.a)(C.a,{id:"users",fixedWidth:!0})),!c.some(function(e){return"PUBLIC"===e.get("id")})&&Object(a.a)(b.a,{to:"/timelines/public",className:"drawer__tab",title:s.formatMessage(S.public),"aria-label":s.formatMessage(S.public)},void 0,Object(a.a)(C.a,{id:"globe",fixedWidth:!0})),Object(a.a)("a",{href:"/user-settings",className:"drawer__tab",title:s.formatMessage(S.preferences),"aria-label":s.formatMessage(S.preferences)},void 0,Object(a.a)(C.a,{id:"cog",fixedWidth:!0})),Object(a.a)("a",{href:"/auth/sign_out",className:"drawer__tab",title:s.formatMessage(S.logout),"aria-label":s.formatMessage(S.logout),onClick:this.handleLogoutClick},void 0,Object(a.a)(C.a,{id:"sign-out",fixedWidth:!0})))}return Object(a.a)("div",{className:"drawer",role:"region","aria-label":s.formatMessage(S.compose)},void 0,i,(t||n)&&Object(a.a)(f.a,{}),Object(a.a)("div",{className:"drawer__pager"},void 0,!n&&Object(a.a)("div",{className:"drawer__inner",onFocus:this.onFocus},void 0,Object(a.a)(d.a,{onClose:this.onBlur}),Object(a.a)(u.a,{}),Object(a.a)("div",{className:"drawer__inner__mastodon"},void 0,Object(a.a)("img",{alt:"",draggable:"false",src:_.k||elephantUIPlane}))),Object(a.a)(h.a,{defaultStyle:{x:n?0:-100},style:{x:O()(o||n?0:-100,{stiffness:210,damping:20})}},void 0,function(e){var t=e.x;return Object(a.a)("div",{className:"drawer__inner darker",style:{transform:"translateX("+t+"%)",visibility:-100===t?"hidden":"visible"}},void 0,Object(a.a)(v.a,{}))})))},t}(l.a.PureComponent))||n)||n}}]);
 //# sourceMappingURL=compose.js.map
\ No newline at end of file