diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js index 5e9647021..2b79be31b 100644 --- a/lib/shared/message-utils.js +++ b/lib/shared/message-utils.js @@ -1,121 +1,110 @@ // @flow import type { MessageInfo, RawMessageInfo, RobotextMessageInfo, } from '../types/message-types'; import type { RelativeUserInfo } from '../types/user-types'; import invariant from 'invariant'; import { messageType } from '../types/message-types'; // Prefers localID function messageKey(messageInfo: MessageInfo | RawMessageInfo): string { if (messageInfo.type === 0 && messageInfo.localID) { return messageInfo.localID; } invariant(messageInfo.id, "localID should exist if ID does not"); return messageInfo.id; } // Prefers serverID function messageID(messageInfo: MessageInfo | RawMessageInfo): string { if (messageInfo.id) { return messageInfo.id; } invariant(messageInfo.type === 0, "only MessageType.TEXT can have localID"); invariant(messageInfo.localID, "localID should exist if ID does not"); return messageInfo.localID; } -function stringForUser(user: RelativeUserInfo): string { - if (user.isViewer) { - return "you"; - } else if (user.username) { - return user.username; - } else { - return "anonymous"; - } -} - function robotextForUser(user: RelativeUserInfo): string { if (user.isViewer) { return "you"; } else if (user.username) { return `<${encodeURI(user.username)}|u${user.id}>`; } else { return "anonymous"; } } function robotextForUsers(users: RelativeUserInfo[]): string { if (users.length === 1) { return robotextForUser(users[0]); } else if (users.length === 2) { return `${robotextForUser(users[0])} and ${robotextForUser(users[1])}`; } else if (users.length === 3) { return `${robotextForUser(users[0])}, ${robotextForUser(users[1])}, ` + `and ${robotextForUser(users[2])}`; } else { return `${robotextForUser(users[0])}, ${robotextForUser(users[1])}, ` + `and ${users.length - 2} others`; } } function robotextForMessageInfo( messageInfo: RobotextMessageInfo, ): string { invariant( messageInfo.type !== messageType.TEXT, "robotext is no substitute for human text!", ); const creator = robotextForUser(messageInfo.creator); if (messageInfo.type === messageType.CREATE_THREAD) { let text = "created this thread "; const parentThread = messageInfo.initialThreadState.parentThreadInfo; if (parentThread) { text += "as a child of " + `"<${encodeURI(parentThread.name)}|t${parentThread.id}>" `; } text += `with the name "${encodeURI(messageInfo.initialThreadState.name)}"`; const users = messageInfo.initialThreadState.otherMembers; if (users.length !== 0) { const initialUsersString = robotextForUsers(users); text += ` and added ${initialUsersString}`; } return `${creator} ${text}`; } else if (messageInfo.type === messageType.ADD_USER) { const users = messageInfo.addedMembers; invariant(users.length !== 0, "added who??"); const addedUsersString = robotextForUsers(users); return `${creator} added ${addedUsersString}`; } else if (messageInfo.type === messageType.CREATE_SUB_THREAD) { const childName = messageInfo.childThreadInfo.name; return `${creator} created a child thread named ` + `"<${encodeURI(childName)}|t${messageInfo.childThreadInfo.id}>"`; } else if (messageInfo.type === messageType.CHANGE_SETTINGS) { let value; if (messageInfo.field === "color") { value = `<#${messageInfo.value}|c${messageInfo.threadID}>`; } else { value = messageInfo.value; } return `${creator} updated the thread's ${messageInfo.field} to ` + `"${value}"`; } invariant(false, `${messageInfo.type} is not a messageType!`); } function robotextToRawString(robotext: string): string { return decodeURI(robotext.replace(/<([^<>\|]+)\|[^<>\|]+>/g, "$1")); } export { messageKey, messageID, - stringForUser, robotextForMessageInfo, robotextToRawString, }; diff --git a/lib/shared/user-utils.js b/lib/shared/user-utils.js new file mode 100644 index 000000000..5c9613dd2 --- /dev/null +++ b/lib/shared/user-utils.js @@ -0,0 +1,18 @@ +// @flow + +import type { RelativeUserInfo } from '../types/user-types'; +import type { RelativeMemberInfo } from '../types/thread-types'; + +function stringForUser(user: RelativeUserInfo | RelativeMemberInfo): string { + if (user.isViewer) { + return "you"; + } else if (user.username) { + return user.username; + } else { + return "anonymous"; + } +} + +export { + stringForUser, +}; diff --git a/native/chat/settings/thread-settings-user.react.js b/native/chat/settings/thread-settings-user.react.js index 346ed9de3..177202b03 100644 --- a/native/chat/settings/thread-settings-user.react.js +++ b/native/chat/settings/thread-settings-user.react.js @@ -1,110 +1,128 @@ // @flow import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types'; import { threadInfoPropType, threadPermissions, relativeMemberInfoPropType, } from 'lib/types/thread-types'; import React from 'react'; import { View, Text, StyleSheet, Platform } from 'react-native'; import Icon from 'react-native-vector-icons/FontAwesome'; import PropTypes from 'prop-types'; import { threadHasPermission } from 'lib/shared/thread-utils'; +import { stringForUser } from 'lib/shared/user-utils'; import EditSettingButton from './edit-setting-button.react'; import Button from '../../components/button.react'; import PopoverTooltip from '../../components/popover-tooltip.react'; type Props = {| memberInfo: RelativeMemberInfo, threadInfo: ThreadInfo, canEdit: bool, |}; class ThreadSettingsUser extends React.PureComponent { static propTypes = { memberInfo: relativeMemberInfoPropType.isRequired, threadInfo: threadInfoPropType.isRequired, canEdit: PropTypes.bool.isRequired, }; popoverConfig: $ReadOnlyArray<{ label: string, onPress: () => void }>; constructor(props: Props) { super(props); this.popoverConfig = [ { label: "Remove user", onPress: this.onPressRemoveUser }, { label: "Make admin", onPress: this.onPressMakeAdmin }, ]; } render() { + const userText = stringForUser(this.props.memberInfo); + let userInfo = null; + if (this.props.memberInfo.username) { + userInfo = ( + {userText} + ); + } else { + userInfo = ( + + {userText} + + ); + } + const canEditThread = threadHasPermission( this.props.threadInfo, threadPermissions.EDIT_THREAD, ); const canChange = !this.props.memberInfo.isViewer && canEditThread; let editButton = null; if (canChange && this.props.canEdit) { editButton = ( ); } + return ( - - {this.props.memberInfo.username} - + {userInfo} {editButton} ); } onPressRemoveUser = () => { } onPressMakeAdmin = () => { } } const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'row', paddingVertical: 8, paddingHorizontal: 12, }, username: { flex: 1, fontSize: 16, color: "#333333", }, + anonymous: { + fontStyle: 'italic', + color: "#888888", + }, editIcon: { lineHeight: 20, paddingLeft: 10, paddingTop: Platform.select({ android: 1, default: 0 }), textAlign: 'right', }, popoverLabelStyle: { textAlign: 'center', color: '#444', }, }); const icon = ( ); export default ThreadSettingsUser; diff --git a/native/chat/text-message.react.js b/native/chat/text-message.react.js index 107afcf81..7b2a4ced8 100644 --- a/native/chat/text-message.react.js +++ b/native/chat/text-message.react.js @@ -1,160 +1,161 @@ // @flow import type { ThreadInfo } from 'lib/types/thread-types'; import { threadInfoPropType } from 'lib/types/thread-types'; import type { ChatMessageInfoItemWithHeight } from './message-list.react'; import { chatMessageItemPropType } from '../selectors/chat-selectors'; import React from 'react'; import { Text, StyleSheet, View, TouchableOpacity, LayoutAnimation, } from 'react-native'; import invariant from 'invariant'; import PropTypes from 'prop-types'; import Color from 'color'; import { colorIsDark } from 'lib/shared/thread-utils'; -import { messageKey, stringForUser } from 'lib/shared/message-utils'; +import { messageKey } from 'lib/shared/message-utils'; +import { stringForUser } from 'lib/shared/user-utils'; import { messageType } from 'lib/types/message-types'; function textMessageItemHeight( item: ChatMessageInfoItemWithHeight, viewerID: ?string, ) { let height = 17 + item.textHeight; // for padding, margin, and text if (!item.messageInfo.creator.isViewer && item.startsCluster) { height += 25; // for username } if (item.endsCluster) { height += 7; // extra padding at the end of a cluster } return height; } type Props = { item: ChatMessageInfoItemWithHeight, focused: bool, onFocus: (messageKey: string) => void, threadInfo: ThreadInfo, }; class TextMessage extends React.PureComponent { static propTypes = { item: chatMessageItemPropType.isRequired, focused: PropTypes.bool.isRequired, onFocus: PropTypes.func.isRequired, threadInfo: threadInfoPropType.isRequired, }; constructor(props: Props) { super(props); invariant( props.item.messageInfo.type === messageType.TEXT, "TextMessage should only be used for messageType.TEXT", ); } componentWillReceiveProps(nextProps: Props) { invariant( nextProps.item.messageInfo.type === messageType.TEXT, "TextMessage should only be used for messageType.TEXT", ); } render() { const isViewer = this.props.item.messageInfo.creator.isViewer; let containerStyle = null, messageStyle = {}, textStyle = {}; if (isViewer) { containerStyle = { alignSelf: 'flex-end' }; messageStyle.backgroundColor = `#${this.props.threadInfo.color}`; const darkColor = colorIsDark(this.props.threadInfo.color); textStyle.color = darkColor ? 'white' : 'black'; } else { containerStyle = { alignSelf: 'flex-start' }; messageStyle.backgroundColor = "#DDDDDDBB"; textStyle.color = 'black'; } let authorName = null; if (!isViewer && this.props.item.startsCluster) { authorName = ( {stringForUser(this.props.item.messageInfo.creator)} ); } messageStyle.borderTopRightRadius = isViewer && !this.props.item.startsCluster ? 0 : 8; messageStyle.borderBottomRightRadius = isViewer && !this.props.item.endsCluster ? 0 : 8; messageStyle.borderTopLeftRadius = !isViewer && !this.props.item.startsCluster ? 0 : 8; messageStyle.borderBottomLeftRadius = !isViewer && !this.props.item.endsCluster ? 0 : 8; messageStyle.marginBottom = this.props.item.endsCluster ? 12 : 5; if (this.props.focused) { messageStyle.backgroundColor = Color(messageStyle.backgroundColor).darken(0.15).hex(); } textStyle.height = this.props.item.textHeight; invariant( this.props.item.messageInfo.type === messageType.TEXT, "TextMessage should only be used for messageType.TEXT", ); const text = this.props.item.messageInfo.text; return ( {authorName} {text} ); } onStartShouldSetResponder = () => true; onResponderGrant = () => { this.props.onFocus(messageKey(this.props.item.messageInfo)); } onResponderTerminationRequest = () => true; } const styles = StyleSheet.create({ text: { fontSize: 18, fontFamily: 'Arial', }, message: { overflow: 'hidden', paddingVertical: 6, paddingHorizontal: 12, marginHorizontal: 12, }, authorName: { color: '#777777', fontSize: 14, paddingHorizontal: 24, paddingVertical: 4, height: 25, }, }); export { TextMessage, textMessageItemHeight, }; diff --git a/web/dist/prod.build.js b/web/dist/prod.build.js index c144fd74b..fa3317e13 100644 --- a/web/dist/prod.build.js +++ b/web/dist/prod.build.js @@ -1,85 +1,85 @@ !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=448)}([function(e,t,n){var r=n(7),o=n(50),a=n(34),i=n(35),u=n(46),s=function(e,t,n){var c,l,f,p,d=e&s.F,h=e&s.G,v=e&s.S,y=e&s.P,m=e&s.B,g=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),w=b.prototype||(b.prototype={});h&&(n=t);for(c in n)l=!d&&g&&void 0!==g[c],f=(l?g:n)[c],p=m&&l?u(f,r):y&&"function"==typeof f?u(Function.call,f):f,g&&i(g,c,f,e&s.U),b[c]!=f&&a(b,c,p),y&&w[c]!=f&&(w[c]=f)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(746)()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var o=n(997),a=r(o),i=n(998),u=r(i),s=n(1e3),c=r(s),l=n(1001),f=r(l),p=n(1002),d=r(p),h=n(1003),v=r(h);t.hover=f.default,t.handleHover=f.default,t.handleActive=d.default,t.loop=v.default;var y=t.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(h)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function o(e){for(var t;t=e._renderedComponent;)e=t;return e}function a(e,t){var n=o(e);n._hostNode=t,t[y]=n}function i(e){var t=e._hostNode;t&&(delete t[y],e._hostNode=null)}function u(e,t){if(!(e._flags&v.hasCachedChildNodes)){var n=e._renderedChildren,i=t.firstChild;e:for(var u in n)if(n.hasOwnProperty(u)){var s=n[u],c=o(s)._domID;if(0!==c){for(;null!==i;i=i.nextSibling)if(r(i,c)){a(s,i);continue e}f("32",c)}}e._flags|=v.hasCachedChildNodes}}function s(e){if(e[y])return e[y];for(var t=[];!e[y];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[y]);e=t.pop())n=r,t.length&&u(r,e);return n}function c(e){var t=s(e);return null!=t&&t._hostNode===e?t:null}function l(e){if(void 0===e._hostNode&&f("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||f("34"),e=e._hostParent;for(;t.length;e=t.pop())u(e,e._hostNode);return e._hostNode}var f=n(11),p=n(94),d=n(319),h=(n(4),p.ID_ATTRIBUTE_NAME),v=d,y="__reactInternalInstance$"+Math.random().toString(36).slice(2),m={getClosestInstanceFromNode:s,getInstanceFromNode:c,getNodeFromInstance:l,precacheChildNodes:u,precacheNode:a,uncacheNode:i};e.exports=m},function(e,t,n){"use strict";var r=n(745),o=(n(346),n(748));n.d(t,"a",function(){return r.a}),n.d(t,"b",function(){return o.a})},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,u],l=0;s=new Error(t.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){var r=n(52);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(366),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t"+o+""};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?u(e)?a(e[0],e[1]):o(e):s(e)}var o=n(860),a=n(868),i=n(97),u=n(16),s=n(874);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),s=n.n(u),c=n(6),l=n.n(c),f=n(45),p=n.n(f),d=n(2),h=n.n(d),v=n(12),y=n.n(v),m=function(){function e(e,t){for(var n=0;n0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(h)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function o(e){for(var t;t=e._renderedComponent;)e=t;return e}function a(e,t){var n=o(e);n._hostNode=t,t[y]=n}function i(e){var t=e._hostNode;t&&(delete t[y],e._hostNode=null)}function u(e,t){if(!(e._flags&v.hasCachedChildNodes)){var n=e._renderedChildren,i=t.firstChild;e:for(var u in n)if(n.hasOwnProperty(u)){var s=n[u],c=o(s)._domID;if(0!==c){for(;null!==i;i=i.nextSibling)if(r(i,c)){a(s,i);continue e}f("32",c)}}e._flags|=v.hasCachedChildNodes}}function s(e){if(e[y])return e[y];for(var t=[];!e[y];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[y]);e=t.pop())n=r,t.length&&u(r,e);return n}function c(e){var t=s(e);return null!=t&&t._hostNode===e?t:null}function l(e){if(void 0===e._hostNode&&f("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||f("34"),e=e._hostParent;for(;t.length;e=t.pop())u(e,e._hostNode);return e._hostNode}var f=n(11),p=n(94),d=n(319),h=(n(4),p.ID_ATTRIBUTE_NAME),v=d,y="__reactInternalInstance$"+Math.random().toString(36).slice(2),m={getClosestInstanceFromNode:s,getInstanceFromNode:c,getNodeFromInstance:l,precacheChildNodes:u,precacheNode:a,uncacheNode:i};e.exports=m},function(e,t,n){"use strict";var r=n(745),o=(n(346),n(748));n.d(t,"a",function(){return r.a}),n.d(t,"b",function(){return o.a})},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,u],l=0;s=new Error(t.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){var r=n(52);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(366),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t"+o+""};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?u(e)?a(e[0],e[1]):o(e):s(e)}var o=n(860),a=n(868),i=n(97),u=n(16),s=n(874);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),s=n.n(u),c=n(6),l=n.n(c),f=n(45),p=n.n(f),d=n(2),h=n.n(d),v=n(12),y=n.n(v),m=function(){function e(e,t){for(var n=0;n0?r:n)(e)}},function(e,t,n){var r=n(0),o=n(50),a=n(8);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],i={};i[e]=t(n),r(r.S+r.F*a(function(){n(1)}),"Object",i)}},function(e,t,n){var r=n(46),o=n(112),a=n(25),i=n(21),u=n(206);e.exports=function(e,t){var n=1==e,s=2==e,c=3==e,l=4==e,f=6==e,p=5==e||f,d=t||u;return function(t,u,h){for(var v,y,m=a(t),g=o(m),b=r(u,h,3),w=i(g.length),_=0,x=n?d(t,w):s?d(t,0):void 0;w>_;_++)if((p||_ in g)&&(v=g[_],y=b(v,_,m),e))if(n)x[_]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return _;case 2:x.push(v)}else if(l)return!1;return f?-1:c||l?l:x}}},function(e,t,n){"use strict";function r(){T.ReactReconcileTransaction&&x||l("123")}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=p.getPooled(),this.reconcileTransaction=T.ReactReconcileTransaction.getPooled(!0)}function a(e,t,n,o,a,i){return r(),x.batchedUpdates(e,t,n,o,a,i)}function i(e,t){return e._mountOrder-t._mountOrder}function u(e){var t=e.dirtyComponentsLength;t!==g.length&&l("124",t,g.length),g.sort(i),b++;for(var n=0;nn;)o[n]=t[n++];return o},Pe=function(e,t,n){q(e,t,{get:function(){return this._d[n]}})},ke=function(e){var t,n,r,o,a,i,u=x(e),s=arguments.length,l=s>1?arguments[1]:void 0,f=void 0!==l,p=I(u);if(void 0!=p&&!E(p)){for(i=p.call(u),r=[],t=0;!(a=i.next()).done;t++)r.push(a.value);u=r}for(f&&s>2&&(l=c(l,arguments[2],2)),t=0,n=v(u.length),o=Ce(this,n);n>t;t++)o[t]=f?l(u[t],t):u[t];return o},Re=function(){for(var e=0,t=arguments.length,n=Ce(this,t);t>e;)n[e]=arguments[e++];return n},je=!!V&&a(function(){de.call(new V(1))}),De=function(){return de.apply(je?fe.call(Oe(this)):Oe(this),arguments)},Ae={copyWithin:function(e,t){return F.call(Oe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(Oe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return L.apply(Oe(this),arguments)},filter:function(e){return Ie(this,X(Oe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(Oe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Oe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){$(Oe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Oe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Oe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(Oe(this),arguments)},lastIndexOf:function(e){return ie.apply(Oe(this),arguments)},map:function(e){return _e(Oe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Oe(this),arguments)},reduceRight:function(e){return se.apply(Oe(this),arguments)},reverse:function(){for(var e,t=this,n=Oe(t).length,r=Math.floor(n/2),o=0;o1?arguments[1]:void 0)},sort:function(e){return le.call(Oe(this),e)},subarray:function(e,t){var n=Oe(this),r=n.length,o=m(e,r);return new(j(n,n[me]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,v((void 0===t?r:m(t,r))-o))}},Me=function(e,t){return Ie(this,fe.call(Oe(this),e,t))},Ne=function(e){Oe(this);var t=Se(arguments[1],1),n=this.length,r=x(e),o=v(r.length),a=0;if(o+t>n)throw W("Wrong length!");for(;a255?255:255&r),o.v[d](n*t+o.o,r,xe)},P=function(e,t){q(e,t,{get:function(){return I(this,t)},set:function(e){return T(this,t,e)},enumerable:!0})};b?(h=n(function(e,n,r,o){l(e,h,c,"_d");var a,i,u,s,f=0,d=0;if(_(n)){if(!(n instanceof Y||"ArrayBuffer"==(s=w(n))||"SharedArrayBuffer"==s))return be in n?Te(h,n):ke.call(h,n);a=n,d=Se(r,t);var m=n.byteLength;if(void 0===o){if(m%t)throw W("Wrong length!");if((i=m-d)<0)throw W("Wrong length!")}else if((i=v(o)*t)+d>m)throw W("Wrong length!");u=i/t}else u=y(n),i=u*t,a=new Y(i);for(p(e,"_d",{b:a,o:d,l:i,e:u,v:new K(a)});ft}function o(e,t){return r(e)||t.home?"home":(p()(t.threadID,"should be set if home isn't"),t.threadID)}function a(e,t){return r(e)?Object(d.d)():t}function i(e,t){return r(e)?Object(d.e)():t}n.d(t,"c",function(){return g}),n.d(t,"b",function(){return b}),n.d(t,"a",function(){return w}),n.d(t,"d",function(){return _});var u=n(32),s=n(134),c=(n.n(s),n(181)),l=n.n(c),f=n(24),p=n.n(f),d=n(43),h=n(180),v=n(429),y=n(273),m=n(86),g=Object(s.createSelector)(function(e){return e.threadInfos},function(e){return l()("currentUser.subscribed")(e)}),b=(Object(s.createSelector)(function(e){return e.navInfo},function(e){return e.home?"home":(p()(e.threadID,"either home or threadID should be set"),e.threadID)}),Object(s.createSelector)(function(e){return e.navInfo},function(e){return e.threadInfos},g,function(e,t,n){if(e.home)return n?"home":null;p()(e.threadID,"either home or threadID should be set");var r=t[e.threadID];return r&&Object(m.b)(r,u.d.VISIBLE)?e.threadID:null})),w=Object(s.createSelector)(function(e){return e.entryStore.lastUserInteractionCalendar},function(e){return e.navInfo},function(e,t){var n=e;return p()(void 0!==n&&null!==n,"calendar should have a lastUserInteraction entry"),function(){return{navID:o(n,t),startDate:a(n,t.startDate),endDate:i(n,t.endDate)}}}),_=Object(s.createSelector)(function(e){return e.threadInfos},g,b,function(e){return e.navInfo.threadID},function(e,t,n,r){var o=new v.a;r&&!e[r]&&o.addEntry(r,y.c),o.addEntry("home",y.a);for(var a in e){var i=e[a];o.addEntry(a,i.name+" "+i.description)}return o.addEntry("new",y.b),o})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=!1},function(e,t,n){var r=n(281),o=n(190);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(53),o=Math.max,a=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):a(e,t)}},function(e,t,n){var r=n(5),o=n(282),a=n(190),i=n(189)("IE_PROTO"),u=function(){},s=function(){var e,t=n(187)("iframe"),r=a.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("