{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/getting_started/index.jsx"],"names":["messages","defineMessages","home_timeline","id","defaultMessage","notifications","public_timeline","settings_subheading","community_timeline","neighborhood_timeline","explore","direct","bookmarks","preferences","follow_requests","favourites","blocks","domain_blocks","mutes","pins","lists","discover","personal","security","menu","GettingStarted","ImmutablePureComponent","componentDidMount","fetchFollowRequests","this","props","signedIn","context","identity","render","intl","myAccount","multiColumn","unreadFollowRequests","navItems","badgeDisplay","number","limit","push","_jsx","ColumnSubheading","text","formatMessage","showTrends","ColumnLink","icon","to","get","badge","href","Column","NavigationContainer","ColumnHeader","title","className","LinkFooter","TrendsContainer","Helmet","name","content","contextTypes","router","PropTypes","object","isRequired","propTypes","ImmutablePropTypes","map","bool","func","unreadNotifications","connect","state","getIn","me","ImmutableList","size","dispatch","injectIntl"],"mappings":"4QAuBA,MAAMA,EAAWC,YAAe,CAC9BC,cAAe,CAAEC,GAAG,gBAAkBC,eAAe,QACrDC,cAAe,CAAEF,GAAG,yBAA2BC,eAAe,iBAC9DE,gBAAiB,CAAEH,GAAG,iCAAmCC,eAAe,sBACxEG,oBAAqB,CAAEJ,GAAG,6BAA+BC,eAAe,YACxEI,mBAAoB,CAAEL,GAAG,oCAAsCC,eAAe,kBAC9EK,sBAAuB,CAAEN,GAAG,uCAAyCC,eAAe,yBACpFM,QAAS,CAAEP,GAAG,yBAA2BC,eAAe,WACxDO,OAAQ,CAAER,GAAG,wBAA0BC,eAAe,oBACtDQ,UAAW,CAAET,GAAG,2BAA6BC,eAAe,aAC5DS,YAAa,CAAEV,GAAG,6BAA+BC,eAAe,eAChEU,gBAAiB,CAAEX,GAAG,iCAAmCC,eAAe,mBACxEW,WAAY,CAAEZ,GAAG,4BAA8BC,eAAe,aAC9DY,OAAQ,CAAEb,GAAG,wBAA0BC,eAAe,iBACtDa,cAAe,CAAEd,GAAG,+BAAiCC,eAAe,mBACpEc,MAAO,CAAEf,GAAG,uBAAyBC,eAAe,eACpDe,KAAM,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pC,EA3FIvC,EAEGwC,aAAe,CACpBC,OAAQC,IAAUC,OAAOC,WACzBpC,SAAUkC,IAAUC,QAJlB3C,EAOG6C,UAAY,CACjBnC,KAAMgC,IAAUC,OAAOC,WACvBjC,UAAWmC,IAAmBC,IAC9BnC,YAAa8B,IAAUM,KACvB7C,oBAAqBuC,IAAUO,KAAKL,WACpC/B,qBAAsB6B,IAAU1B,OAChCkC,oBAAqBR,IAAU1B,QAkFpBmC,6BAlHSC,IAAK,CAC3BzC,UAAWyC,EAAMC,MAAM,CAAC,WAAYC,MACpCzC,qBAAsBuC,EAAMC,MAAM,CAAC,aAAc,kBAAmB,SAAUE,kBAAiBC,SAGtEC,IAAQ,CACjCtD,oBAAqBA,IAAMsD,EAAStD,kBA4GvBgD,CAA6CO,YAAW1D,G","file":"js/features/getting_started-6dabfc7f201d6376e81a.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { defineMessages, injectIntl } from 'react-intl';\n\nimport { Helmet } from 'react-helmet';\n\nimport { List as ImmutableList } from 'immutable';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { connect } from 'react-redux';\n\nimport { fetchFollowRequests } from 'mastodon/actions/accounts';\nimport Column from 'mastodon/components/column';\nimport ColumnHeader from 'mastodon/components/column_header';\nimport LinkFooter from 'mastodon/features/ui/components/link_footer';\n\nimport { me, showTrends } from '../../initial_state';\nimport NavigationContainer from '../compose/containers/navigation_container';\nimport ColumnLink from '../ui/components/column_link';\nimport ColumnSubheading from '../ui/components/column_subheading';\n\nimport TrendsContainer from './containers/trends_container';\n\nconst messages = defineMessages({\n home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' },\n notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },\n public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' },\n settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings' },\n community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },\n neighborhood_timeline: { id: 'navigation_bar.neighborhood_timeline', defaultMessage: 'Neighborhood timeline' },\n explore: { id: 'navigation_bar.explore', defaultMessage: 'Explore' },\n direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },\n bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Blocked domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned posts' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n discover: { id: 'navigation_bar.discover', defaultMessage: 'Discover' },\n personal: { id: 'navigation_bar.personal', defaultMessage: 'Personal' },\n security: { id: 'navigation_bar.security', defaultMessage: 'Security' },\n menu: { id: 'getting_started.heading', defaultMessage: 'Getting started' },\n});\n\nconst mapStateToProps = state => ({\n myAccount: state.getIn(['accounts', me]),\n unreadFollowRequests: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size,\n});\n\nconst mapDispatchToProps = dispatch => ({\n fetchFollowRequests: () => dispatch(fetchFollowRequests()),\n});\n\nconst badgeDisplay = (number, limit) => {\n if (number === 0) {\n return undefined;\n } else if (limit && number >= limit) {\n return `${limit}+`;\n } else {\n return number;\n }\n};\n\nclass GettingStarted extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object.isRequired,\n identity: PropTypes.object,\n };\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n myAccount: ImmutablePropTypes.map,\n multiColumn: PropTypes.bool,\n fetchFollowRequests: PropTypes.func.isRequired,\n unreadFollowRequests: PropTypes.number,\n unreadNotifications: PropTypes.number,\n };\n\n componentDidMount () {\n const { fetchFollowRequests } = this.props;\n const { signedIn } = this.context.identity;\n\n if (!signedIn) {\n return;\n }\n\n fetchFollowRequests();\n }\n\n render () {\n const { intl, myAccount, multiColumn, unreadFollowRequests } = this.props;\n const { signedIn } = this.context.identity;\n\n const navItems = [];\n\n navItems.push(\n <ColumnSubheading key='header-discover' text={intl.formatMessage(messages.discover)} />,\n );\n\n if (showTrends) {\n navItems.push(\n <ColumnLink key='explore' icon='hashtag' text={intl.formatMessage(messages.explore)} to='/explore' />,\n );\n }\n\n navItems.push(\n <ColumnLink key='community_timeline' icon='users' text={intl.formatMessage(messages.community_timeline)} to='/public/local' />,\n <ColumnLink key='neighborhood_timeline' icon='bullhorn' text={intl.formatMessage(messages.neighborhood_timeline)} to='/timelines/neighborhood' />,\n <ColumnLink key='public_timeline' icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/public' />,\n );\n\n if (signedIn) {\n navItems.push(\n <ColumnSubheading key='header-personal' text={intl.formatMessage(messages.personal)} />,\n <ColumnLink key='home' icon='home' text={intl.formatMessage(messages.home_timeline)} to='/home' />,\n <ColumnLink key='direct' icon='at' text={intl.formatMessage(messages.direct)} to='/conversations' />,\n <ColumnLink key='bookmark' icon='bookmark' text={intl.formatMessage(messages.bookmarks)} to='/bookmarks' />,\n <ColumnLink key='favourites' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,\n <ColumnLink key='lists' icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />,\n );\n\n if (myAccount.get('locked') || unreadFollowRequests > 0) {\n navItems.push(<ColumnLink key='follow_requests' icon='user-plus' text={intl.formatMessage(messages.follow_requests)} badge={badgeDisplay(unreadFollowRequests, 40)} to='/follow_requests' />);\n }\n\n navItems.push(\n <ColumnSubheading key='header-settings' text={intl.formatMessage(messages.settings_subheading)} />,\n <ColumnLink key='preferences' icon='gears' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />,\n );\n }\n\n return (\n <Column>\n {(signedIn && !multiColumn) ? <NavigationContainer /> : <ColumnHeader title={intl.formatMessage(messages.menu)} icon='bars' multiColumn={multiColumn} />}\n\n <div className='getting-started scrollable scrollable--flex'>\n <div className='getting-started__wrapper'>\n {navItems}\n </div>\n\n {!multiColumn && <div className='flex-spacer' />}\n\n <LinkFooter multiColumn />\n </div>\n\n {(multiColumn && showTrends) && <TrendsContainer />}\n\n <Helmet>\n <title>{intl.formatMessage(messages.menu)}</title>\n <meta name='robots' content='noindex' />\n </Helmet>\n </Column>\n );\n }\n\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(injectIntl(GettingStarted));\n"],"sourceRoot":""}