spc-pleroma/priv/static/packs/flavours/glitch/async/status.js

2 lines
24 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{656:function(e,t,a){"use strict";a.d(t,"a",function(){return I});var h=a(1),s=a(7),o=a(0),i=a(2),n=a(3),O=a.n(n),c=a(5),r=a.n(c),l=a(26),d=a.n(l),f=a(102),g=a(103),j=a(111),m=a(457),v=a(395),k=a(391),M=a(6),y=a(446),u=a(24),C=a(138),_=a(448),p=a(532),b=a(12),x=a.n(b),I=function(n){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=n.call.apply(n,[this].concat(t))||this,Object(i.a)(Object(o.a)(Object(o.a)(a)),"state",{height:null}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"handleAccountClick",function(e){0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&a.context.router&&(e.preventDefault(),a.context.router.history.push("/accounts/"+a.props.status.getIn(["account","id"]))),e.stopPropagation()}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"parseClick",function(e,t){0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&a.context.router&&(e.preventDefault(),a.context.router.history.push(t)),e.stopPropagation()}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"handleOpenVideo",function(e,t){a.props.onOpenVideo(e,t)}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"setRef",function(e){a.node=e,a._measureHeight()}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"handleChildUpdate",function(){a._measureHeight()}),Object(i.a)(Object(o.a)(Object(o.a)(a)),"handleModalLink",function(e){var t;e.preventDefault(),t="A"!==e.target.nodeName?e.target.parentNode.href:e.target.href,window.open(t,"mastodon-intent","width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes")}),a}Object(s.a)(e,n);var t=e.prototype;return t._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(p.a)(function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})}),this.props.onHeightChange&&e&&this.props.onHeightChange())},t.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},t.render=function(){var e=this.props.status&&this.props.status.get("reblog")?this.props.status.get("reblog"):this.props.status,t=this.props,a=t.expanded,s=t.onToggleHidden,n=t.settings,o={boxSizing:"border-box"},i=this.props.compact;if(!e)return null;var c="",r=null,l="",d="",u="retweet",p="";if(this.props.measureHeight&&(o.height=this.state.height+"px"),0<e.get("media_attachments").size)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))c=Object(h.a)(v.a,{media:e.get("media_attachments")});else if("video"===e.getIn(["media_attachments",0,"type"])){var b=e.getIn(["media_attachments",0]);c=Object(h.a)(C.default,{preview:b.get("preview_url"),src:b.get("url"),alt:b.get("description"),inline:!0,sensitive:e.get("sensitive"),letterbox:n.getIn(["media","letterbox"]),fullwidth:n.getIn(["media","fullwidth"]),preventPlayback:!a,onOpenVideo:this.handleOpenVideo,autoplay:!0}),r="video-camera"}else c=Object(h.a)(m.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),letterbox:n.getIn(["media","letterbox"]),fullwidth:n.getIn(["media","fullwidth"]),hidden:!a,onOpenMedia:this.props.onOpenMedia}),r="picture-o";else c=Object(h.a)(y.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)});return e.get("application")&&(l=Object(h.a)("span",{},void 0," · ",Object(h.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?u="envelope":"private"===e.get("visibility")&&(u="lock"),d="private"===e.get("visibility")?Object(h.a)("i",{className:"fa fa-"+u}):this.context.router?Object(h.a)(k.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(h.a)("i",{className:"fa fa-"+u}),Object(h.a)("span",{className:"detailed-status__reblogs"},void 0,Object(h.a)(M.c,{value:e.get("reblogs_count")}))):Object(h.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(h.a)("i",{className:"fa fa-"+u}),Object(h.a)("span",{className:"detailed-status__reblogs"},void 0,Object(h.a)(M.c,{value:e.get("reblogs_count")}))),p=this.context.router?Object(h.a)(k.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(h.a)("i",{className:"fa fa-star"}),Object(h.a)("span",{className:"detailed-status__favorites"},void 0,Object(h.a)(M.c,{value:e.get("favourites_count")}))):Object(h.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(h.a)("i",{className:"fa fa-star"}),Object(h.a)("span",{className:"detailed-status__favorites"},void 0,Object(h.a)(M.c,{value:e.get("favourites_count")}))),Object(h.a)("div",{style:o},void 0,O.a.createElement("div",{ref:this.setRef,className:x()("detailed-status",{compact:i}),"data-status-by":e.getIn(["account","acct"])},Object(h.a)("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,Object(h.a)("div",{className:"detailed-status__display-avatar"},void 0,Object(h.a)(f.a,{account:e.get("account"),size:48})),Object(h.a)(g.a,{account:e.get("account"),localDomain:this.props.domain})),Object(h.a)(j.a,{status:e,media:c,mediaIcon:r,expanded:a,collapsed:!1,onExpandedToggle:s,parseClick:this.parseClick,onUpdate:this.handleChildUpdate}),Object(h.a)("div",{className:"detailed-status__meta"},void 0,Object(h.a)("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener"},void 0,Object(h.a)(M.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),l," · ",d," · ",p," · ",Object(h.a)(_.a,{visibility:e.get("visibility")}))))},e}(u.a);Object(i.a)(I,"contextTypes",{router:r.a.object}),Object(i.a)(I,"propTypes",{status:d.a.map.isRequired,settings:d.a.map.isRequired,onOpenMedia:r.a.func.isRequired,onOpenVideo:r.a.func.isRequired,onToggleHidden:r.a.func,expanded:r.a.bool,measureHeight:r.a.bool,onHeightChange:r.a.func,domain:r.a.string.isRequired,compact:r.a.bool})},728:function(e,t,a){"use strict";a.r(t);var s,n,o,i,c,r,l,b=a(1),d=a(7),u=a(0),p=a(2),h=a(4),O=a.n(h),f=a(3),g=a.n(f),j=a(20),m=a(5),v=a.n(m),k=a(12),M=a.n(k),y=a(26),C=a.n(y),_=a(51),x=a(907),I=a(656),w=a(47),R=a(522),D=a(6),N=a(29),E=a(140),H=Object(D.f)({delete:{id:"status.delete",defaultMessage:"Delete"},redraft:{id:"status.redraft",defaultMessage:"Delete & re-draft"},direct:{id:"status.direct",defaultMessage:"Direct message @{name}"},mention:{id:"status.mention",defaultMessage:"Mention @{name}"},reply:{id:"status.reply",defaultMessage:"Reply"},reblog:{id:"status.reblog",defaultMessage:"Boost"},reblog_private:{id:"status.reblog_private",defaultMessage:"Boost to original audience"},cannot_reblog:{id:"status.cannot_reblog",defaultMessage:"This post cannot be boosted"},favourite:{id:"status.favourite",defaultMessage:"Favourite"},bookmark:{id:"status.bookmark",defaultMessage:"Bookmark"},mute:{id:"status.mute",defaultMessage:"Mute @{name}"},muteConversation:{id:"status.mute_conversation",defaultMessage:"Mute conversation"},unmuteConversation:{id:"status.unmute_conversation",defaultMessage:"Unmute conversation"},block:{id:"status.block",defaultMessage:"Block @{name}"},report:{id:"status.report",defaultMessage:"Report @{name}"},share:{id:"status.share",defaultMessage:"Share"},pin:{id:"status.pin",defaultMessage:"Pin on profile"},unpin:{id:"status.unpin",defaultMessage:"Unpin from profile"},embed:{id:"status.embed",defaultMessage:"Embed"},admin_account:{id:"status.admin_account",defaultMessage:"Open moderation interface for @{name}"},admin_status:{id:"status.admin_status",defaultMessage:"Open this status in the moderation interface"},copy:{id:"status.copy",defaultMessage:"Copy link to status"}}),A=Object(D.g)((o=n=function(n){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=n.call.apply(n,[this].concat(t))||this,Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleReplyClick",function(){a.props.onReply(a.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleReblogClick",function(e){a.props.onReblog(a.props.status,e)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleFavouriteClick",function(e){a.props.onFavourite(a.props.status,e)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleBookmarkClick",function(e){a.props.onBookmark(a.props.status,e)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleDeleteClick",function(){a.props.onDelete(a.props.status,a.context.router.history)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleRedraftClick",function(){a.props.onDelete(a.props.status,a.context.router.history,!0)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleDirectClick",function(){a.props.onDirect(a.props.status.get("account"),a.context.router.history)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleMentionClick",function(){a.props.onMention(a.props.status.get("account"),a.context.router.history)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleMuteClick",function(){a.props.onMute(a.props.status.get("account"))}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleConversationMuteClick",function(){a.props.onMuteConversation(a.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleBlockClick",function(){a.props.onBlock(a.props.status.get("account"))}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleReport",function(){a.props.onReport(a.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handlePinClick",function(){a.props.onPin(a.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleShare",function(){navigator.share({text:a.props.status.get("search_index"),url:a.props.status.get("url")})}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleEmbed",function(){a.props.onEmbed(a.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(a)),"handleCopy",function(){var e=a.props.status.get("url"),t=document.createElement("textarea");t.textContent=e,t.style.position="fixed",document.body.appendChild(t);try{t.select(),document.execCommand("copy")}catch(e){}finally{document.body.removeChild(t)}}),a}return Object(d.a)(e,n),e.prototype.render=function(){var e=this.props,t=e.status,a=e.intl,s=["public","unlisted"].includes(t.get("visibility")),n=t.get("muted"),o=[];s&&(o.push({text:a.formatMessage(H.copy),action:this.handleCopy}),o.push({text:a.formatMessage(H.embed),action:this.handleEmbed}),o.push(null)),N.k===t.getIn(["account","id"])?(s&&o.push({text:a.formatMessage(t.get("pinned")?H.unpin:H.pin),action:this.handlePinClick}),o.push(null),o.push({text:a.formatMessage(n?H.unmuteConversation:H.muteConversation),action:this.handleConversationMuteClick}),o.push(null),o.push({text:a.formatMessage(H.delete),action:this.handleDeleteClick})):(o.push({text:a.formatMessage(H.mention,{name:t.getIn(["account","username"])}),action:this.handleMentionClick}),o.push({text:a.formatMessage(H.direct,{name:t.getIn(["account","username"])}),action:this.handleDirectClick}),o.push(null),o.push({text:a.formatMessage(H.mute,{name:t.getIn(["account","username"])}),action:this.handleMuteClick}),o.push({text:a.formatMessage(H.block,{name:t.getIn(["account","username"])}),action:this.handleBlockClick}),o.push({text:a.formatMessage(H.report,{name:t.getIn(["account","username"])}),action:this.handleReport}),N.h&&(E.a||E.e)&&(o.push(null),void 0!==E.a&&o.push({text:a.formatMessage(H.admin_account,{name:t.getIn(["account","username"])}),href:Object(E.a)(t.getIn(["account","id"]))}),void 0!==E.e&&o.push({text:a.formatMessage(H.admin_status),href:Object(E.e)(t.getIn(["account","id"]),t.get("id"))})));var i="share"in navigator&&"public"===t.get("visibility")&&Object(b.a)("div",{className:"detailed-status__button"},void 0,Object(b.a)(w.a,{title:a.formatMessage(H.share),icon:"share-alt",onClick:this.handleShare})),c="direct"===t.get("visibility")||"private"===t.get("visibility")&&N.k!==t.getIn(["account","id"]),r="private"===t.get("visibility")?H.reblog_private:H.reblog;return Object(b.a)("div",{className:"detailed-status__action-bar"},void 0,Object(b.a)("div",{className:"detailed-status__button"},void 0,Object(b.a)(w.a,{title:a.formatMessage(H.reply),icon:null===t.get("in_reply_to_id",null)?"reply":"reply-all",onClick:this.handleReplyClick})),Object(b.a)("div",{className:"detailed-status__button"},void 0,Object(b.a)(w.a,{disabled:c,active:t.get("reblogged"),title:c?a.formatMessage(H.cannot_reblog):a.formatMessage(r),icon:"retweet",onClick:this.handleReblogClick})),Object(b.a)("div",{className:"detailed-status__button"},void 0,Object(b.a)(w.a,{className:"star-icon",animate:!0,active:t.get("favourited"),title:a.formatMessage(H.favourite),icon:"star",onClick:this.handleFavouriteClick})),i,Object(b.a)("div",{className:"detailed-status__button"},void 0,Object(b.a)(w.a,{className:"bookmark-icon",active:t.get("bookmarked"),title:a.formatMessage(H.bookmark),icon:"bookmark",onClick:this.handleBookmarkClick})),Object(b.a)("div",{className:"detailed-status__action-bar-dropdown"},void 0,Object(b.a)(R.a,{size:18,icon:"ellipsis-h",items:o,direction:"left",ariaLabel:"More"})))},e}(g.a.PureComponent),Object(p.a)(n,"contextTypes",{router:v.a.object}),s=o))||s,B=a(641),F=a(25),S=a(19),T=a(293),U=a(14),z=a(68),q=a(93),P=a(170),V=a(300),K=a(897),L=a(428),Y=a(633),J=a(45),W=a(24),G=a(179),Q=a(172),X=a(524),Z=a(628);a.d(t,"default",function(){return ee});var $=Object(D.f)({deleteConfirm:{id:"confirmations.delete.confirm",defaultMessage:"Delete"},deleteMessage:{id:"confirmations.delete.message",defaultMessage:"Are you sure you want to delete this status?"},redraftConfirm:{id:"confirmations.redraft.confirm",defaultMessage:"Delete & redraft"},redraftMessage:{id:"confirmations.redraft.message",defaultMessage:"Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it."},blockConfirm:{id:"confirmations.block.confirm",defaultMessage:"Block"},revealAll:{id:"status.show_more_all",defaultMessage:"Show more for all"},hideAll:{id:"status.show_less_all",defaultMessage:"Show less for all"},detailedStatus:{id:"status.detailed_status",defaultMessage:"Detailed conversation view"},replyConfirm:{id:"confirmations.reply.confirm",defaultMessage:"Reply"},replyMessage:{id:"confirmations.reply.message",defaultMessage:"Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?"}}),ee=(i=Object(j.connect)(function(){var s=Object(P.f)();return function(n,e){var o=s(n,{id:e.params.statusId}),t=O.a.List(),a=O.a.List();return o&&(t=t.withMutations(function(e){for(var t=o.get("in_reply_to_id");t;)e.unshift(t),t=n.getIn(["contexts","inReplyTos",t])}),a=a.withMutations(function(e){for(var t=[o.get("id")];0<t.length;){var a=t.shift(),s=n.getIn(["contexts","replies",a]);o.get("id")!==a&&e.push(a),s&&s.reverse().forEach(function(e){t.unshift(e)})}})),{status:o,ancestorsIds:t,descendantsIds:a,settings:n.get("local_settings"),askReplyConfirmation:n.getIn(["local_settings","confirm_before_clearing_draft"])&&0!==n.getIn(["compose","text"]).trim().length,domain:n.getIn(["meta","domain"])}}}),Object(D.g)(c=i((l=r=function(s){function e(){for(var i,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return i=s.call.apply(s,[this].concat(t))||this,Object(p.a)(Object(u.a)(Object(u.a)(i)),"state",{fullscreen:!1,isExpanded:void 0,threadExpanded:void 0,statusId:void 0}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleExpandedToggle",function(){i.props.status.get("spoiler_text")&&i.setExpansion(!i.state.isExpanded)}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleModalFavourite",function(e){i.props.dispatch(Object(F.r)(e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleFavouriteClick",function(e,t){e.get("favourited")?i.props.dispatch(Object(F.x)(e)):t&&t.shiftKey||!N.g?i.handleModalFavourite(e):i.props.dispatch(Object(J.d)("FAVOURITE",{status:e,onFavourite:i.handleModalFavourite}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handlePin",function(e){e.get("pinned")?i.props.dispatch(Object(F.y)(e)):i.props.dispatch(Object(F.u)(e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleReplyClick",function(e){var t=i.props,a=t.askReplyConfirmation,s=t.dispatch,n=t.intl;s(a?Object(J.d)("CONFIRM",{message:n.formatMessage($.replyMessage),confirm:n.formatMessage($.replyConfirm),onDoNotAsk:function(){return s(Object(T.b)(["confirm_before_clearing_draft"],!1))},onConfirm:function(){return s(Object(S.Y)(e,i.context.router.history))}}):Object(S.Y)(e,i.context.router.history))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleModalReblog",function(e){i.props.dispatch(Object(F.v)(e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleReblogClick",function(e,t){e.get("reblogged")?i.props.dispatch(Object(F.z)(e)):t&&t.shiftKey||!N.b?i.handleModalReblog(e):i.props.dispatch(Object(J.d)("BOOST",{status:e,onReblog:i.handleModalReblog}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleBookmarkClick",function(e){e.get("bookmarked")?i.props.dispatch(Object(F.w)(e)):i.props.dispatch(Object(F.q)(e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleDeleteClick",function(e,t,a){void 0===a&&(a=!1);var s=i.props,n=s.dispatch,o=s.intl;N.d?n(Object(J.d)("CONFIRM",{message:o.formatMessage(a?$.redraftMessage:$.deleteMessage),confirm:o.formatMessage(a?$.redraftConfirm:$.deleteConfirm),onConfirm:function(){return n(Object(_.f)(e.get("id"),t,a))}})):n(Object(_.f)(e.get("id"),t,a))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleDirectClick",function(e,t){i.props.dispatch(Object(S.R)(e,t))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleMentionClick",function(e,t){i.props.dispatch(Object(S.W)(e,t))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleOpenMedia",function(e,t){i.props.dispatch(Object(J.d)("MEDIA",{media:e,index:t}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleOpenVideo",function(e,t){i.props.dispatch(Object(J.d)("VIDEO",{media:e,time:t}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleMuteClick",function(e){i.props.dispatch(Object(z.g)(e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleConversationMuteClick",function(e){e.get("muted")?i.props.dispatch(Object(_.i)(e.get("id"))):i.props.dispatch(Object(_.h)(e.get("id")))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleToggleAll",function(){var e=i.state.isExpanded;i.setState({isExpanded:!e,threadExpanded:!e})}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleBlockClick",function(e){var t=i.props,a=t.dispatch,s=t.intl;a(Object(J.d)("CONFIRM",{message:Object(b.a)(D.b,{id:"confirmations.block.message",defaultMessage:"Are you sure you want to block {name}?",values:{name:Object(b.a)("strong",{},void 0,"@",e.get("acct"))}}),confirm:s.formatMessage($.blockConfirm),onConfirm:function(){return a(Object(U.A)(e.get("id")))}}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleReport",function(e){i.props.dispatch(Object(q.k)(e.get("account"),e))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleEmbed",function(e){i.props.dispatch(Object(J.d)("EMBED",{url:e.get("url")}))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyMoveUp",function(){i.handleMoveUp(i.props.status.get("id"))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyMoveDown",function(){i.handleMoveDown(i.props.status.get("id"))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyReply",function(e){e.preventDefault(),i.handleReplyClick(i.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyFavourite",function(){i.handleFavouriteClick(i.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyBoost",function(){i.handleReblogClick(i.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyMention",function(e){e.preventDefault(),i.handleMentionClick(i.props.status)}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleHotkeyOpenProfile",function(){i.context.router.history.push("/accounts/"+i.props.status.getIn(["account","id"]))}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleMoveUp",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,n=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size-1);else{var o=s.indexOf(e);-1===o?(o=n.indexOf(e),i._selectChild(s.size+o)):i._selectChild(o-1)}}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"handleMoveDown",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,n=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size+1);else{var o=s.indexOf(e);-1===o?(o=n.indexOf(e),i._selectChild(s.size+o+2)):i._selectChild(o+1)}}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"setExpansion",function(e){i.setState({isExpanded:e})}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"setRef",function(e){i.node=e}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"onFullScreenChange",function(){i.setState({fullscreen:Object(Q.d)()})}),Object(p.a)(Object(u.a)(Object(u.a)(i)),"shouldUpdateScroll",function(e,t){var a=t.location;return!(((e||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)}),i}Object(d.a)(e,s);var t=e.prototype;return t.componentDidMount=function(){Object(Q.a)(this.onFullScreenChange),this.props.dispatch(Object(_.g)(this.props.params.statusId));var e=this.props,t=e.status,a=e.ancestorsIds;if(t&&a&&0<a.size){var s=this.node.querySelectorAll(".focusable")[a.size-1];window.requestAnimationFrame(function(){s.scrollIntoView(!0)})}},e.getDerivedStateFromProps=function(e,t){return t.statusId!==e.params.statusId&&e.params.statusId?(e.dispatch(Object(_.g)(e.params.statusId)),{threadExpanded:void 0,isExpanded:Object(X.a)(e.settings,e.status),statusId:e.params.statusId}):null},t._selectChild=function(e){var t=this.node.querySelectorAll(".focusable")[e];t&&t.focus()},t.renderChildren=function(e){var t=this;return e.map(function(e){return Object(b.a)(Y.a,{id:e,expanded:t.state.threadExpanded,onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown,contextType:"thread"},e)})},t.componentDidUpdate=function(e){if(this.props.params.statusId&&(this.props.params.statusId!==e.params.statusId||e.ancestorsIds.size<this.props.ancestorsIds.size)){var t=this.props,a=t.status,s=t.ancestorsIds;if(a&&s&&0<s.size){var n=this.node.querySelectorAll(".focusable")[s.size-1];window.requestAnimationFrame(function(){n.scrollIntoView(!0)})}}},t.componentWillUnmount=function(){Object(Q.b)(this.onFullScreenChange)},t.render=function(){this.setExpansion;var e,t,a=this.props,s=a.status,n=a.settings,o=a.ancestorsIds,i=a.descendantsIds,c=a.intl,r=a.domain,l=this.state,d=l.fullscreen,u=l.isExpanded;if(null===s)return Object(b.a)(B.a,{},void 0,Object(b.a)(K.a,{}),Object(b.a)(x.a,{}));o&&0<o.size&&(e=Object(b.a)("div",{},void 0,this.renderChildren(o))),i&&0<i.size&&(t=Object(b.a)("div",{},void 0,this.renderChildren(i)));var p={moveUp:this.handleHotkeyMoveUp,moveDown:this.handleHotkeyMoveDown,reply:this.handleHotkeyReply,favourite:this.handleHotkeyFavourite,boost:this.handleHotkeyBoost,mention:this.handleHotkeyMention,openProfile:this.handleHotkeyOpenProfile,toggleSpoiler:this.handleExpandedToggle};return Object(b.a)(B.a,{label:c.formatMessage($.detailedStatus)},void 0,Object(b.a)(L.a,{showBackButton:!0,extraButton:Object(b.a)("button",{className:"column-header__button",title:c.formatMessage(u?$.hideAll:$.revealAll),"aria-label":c.formatMessage(u?$.hideAll:$.revealAll),onClick:this.handleToggleAll,"aria-pressed":u?"true":"false"},void 0,Object(b.a)("i",{className:"fa fa-"+(u?"eye":"eye-slash")}))}),Object(b.a)(V.a,{scrollKey:"thread",shouldUpdateScroll:this.shouldUpdateScroll},void 0,g.a.createElement("div",{className:M()("scrollable","detailed-status__wrapper",{fullscreen:d}),ref:this.setRef},e,Object(b.a)(G.HotKeys,{handlers:p},void 0,Object(b.a)("div",{className:"focusable",tabIndex:"0","aria-label":Object(Z.b)(c,s,!1,!s.get("hidden"))},void 0,Object(b.a)(I.a,{status:s,settings:n,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,expanded:u,onToggleHidden:this.handleExpandedToggle,domain:r}),Object(b.a)(A,{status:s,onReply:this.handleReplyClick,onFavourite:this.handleFavouriteClick,onReblog:this.handleReblogClick,onBookmark:this.handleBookmarkClick,onDelete:this.handleDeleteClick,onDirect:this.handleDirectClick,onMention:this.handleMentionClick,onMute:this.handleMuteClick,onMuteConversation:this.handleConversationMuteClick,onBlock:this.handleBlockClick,onReport:this.handleReport,onPin:this.handlePin,onEmbed:this.handleEmbed}))),t)))},e}(W.a),Object(p.a)(r,"contextTypes",{router:v.a.object}),Object(p.a)(r,"propTypes",{params:v.a.object.isRequired,dispatch:v.a.func.isRequired,status:C.a.map,settings:C.a.map.isRequired,ancestorsIds:C.a.list,descendantsIds:C.a.list,intl:v.a.object.isRequired,askReplyConfirmation:v.a.bool,domain:v.a.string.isRequired}),c=l))||c)||c)}}]);
//# sourceMappingURL=status.js.map