{"version":3,"sources":["webpack:///./app/javascript/brighteon/features/ui/components/sort_selector.js","webpack:///./app/javascript/brighteon/features/ui/containers/sort_selector_container.js","webpack:///./app/javascript/brighteon/features/home_timeline/index.js"],"names":["SortSelector","state","show","showDropdownSelector","setState","handleBlur","event","currentTarget","contains","relatedTarget","updateSortBy","sortBy","props","handleUpdateSortBy","handleSortClick","e","dataset","id","render","options","key","title","description","this","sortByTxt","forEach","option","className","onBlur","tabIndex","onClick","role","size","map","i","React","PureComponent","connect","getIn","dispatch","updateTimelineSortBy","expandHomeTimeline","messages","defineMessages","show_announcements","hide_announcements","HomeTimeline","hasUnread","isPartial","hasAnnouncements","isEmpty","unreadAnnouncements","count","item","get","showAnnouncements","injectIntl","handlePin","columnId","removeColumn","addColumn","handleMove","dir","moveColumn","handleHeaderClick","column","scrollTop","setRef","c","handleLoadMore","maxId","handleToggleAnnouncementsClick","stopPropagation","toggleShowAnnouncements","componentDidMount","setTimeout","fetchAnnouncements","_checkIfReloadNeeded","componentDidUpdate","prevProps","componentWillUnmount","_stopPolling","wasPartial","polling","setInterval","clearInterval","intl","shouldUpdateScroll","multiColumn","pinned","bindToDocument","ref","label","formatMessage","trackScroll","scrollKey","onLoadMore","timelineId","emptyMessage","defaultMessage","values","suggestions","Link","to"],"mappings":"0PAIMA,E,oJAOJC,MAAQ,CACNC,MAAM,G,EAGRC,qBAAuB,WAErB,EAAKC,SAAS,CAAEF,MAAO,EAAKD,MAAMC,MACnC,E,EAEDG,WAAa,SAACC,GACPA,EAAMC,cAAcC,SAASF,EAAMG,gBACtC,EAAKL,SAAS,CAAEF,MAAM,GAEzB,E,EAEDQ,aAAe,SAACC,GACd,EAAKP,SAAS,CAAEF,MAAO,EAAKD,MAAMC,OAClC,EAAKU,MAAMC,mBAAmBF,EAC/B,E,EAEDG,gBAAkB,SAACC,GACjB,EAAKL,aAAaK,EAAER,cAAcS,QAAQC,GAC3C,E,sCAEDC,OAAA,WAAU,IAAD,OACDC,EAAU,CACd,CAAE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AC/B,IAAQT,EAAahB,KAAKX,MAAlB2B,SAEJ2C,IAAelC,KAEPkC,GAAclC,EACxBzB,KAAK4D,QAAUC,aAAY,WACzB7C,EAASE,cACV,GAAE,KACMyC,IAAelC,GACxBzB,KAAK0D,eAER,E,EAEDA,aAAA,WACM1D,KAAK4D,UACPE,cAAc9D,KAAK4D,SACnB5D,KAAK4D,QAAU,KAElB,E,EAODjE,OAAA,WACE,MAA8EK,KAAKX,MAA3E0E,EAAR,EAAQA,KAAMC,EAAd,EAAcA,mBAAoB7B,EAAlC,EAAkCA,SAAU8B,EAA5C,EAA4CA,YAAavC,EAAzD,EAAyDA,iBACnDwC,IAAW/B,EAEjB,OACE,kBAAC,IAAD,CAAQgC,gBAAiBF,EAAaG,IAAKpE,KAAK4C,OAAQyB,MAAON,EAAKO,cAAcnD,EAASrB,QACzF,YAAC,EAAD,IAEA,YAAC,IAAD,CACEyE,aAAcL,EACdM,UAAS,iBAAmBrC,EAC5BsC,WAAYzE,KAAK8C,eACjB4B,WAAW,OACXC,aAAc,YAAC,IAAD,CAAkBjF,GAAG,oBAAoBkF,eAAe,+EAA+EC,OAAQ,CAAEC,YAAa,YAACC,EAAA,EAAD,CAAMC,GAAG,eAAT,EAAkB,YAAC,IAAD,CAAkBtF,GAAG,gCAAgCkF,eAAe,6BAClQZ,mBAAoBA,EACpBG,gBAAiBF,EACjBvC,iBAAkBA,IAIzB,E,GArGwBd,IAAMC,iB","file":"js/features/home_timeline-f1de476e7c8ed1c087dc.chunk.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from '../../../components/icon';\n\nclass SortSelector extends React.PureComponent {\n\n static propTypes = {\n sortBy: PropTypes.string,\n handleUpdateSortBy: PropTypes.func.isRequired,\n };\n\n state = {\n show: false,\n }\n\n showDropdownSelector = () => {\n // Show Dropdown Selector\n this.setState({ show: !this.state.show });\n }\n\n handleBlur = (event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n this.setState({ show: false });\n }\n }\n\n updateSortBy = (sortBy) => {\n this.setState({ show: !this.state.show });\n this.props.handleUpdateSortBy(sortBy);\n }\n\n handleSortClick = (e) => {\n this.updateSortBy(e.currentTarget.dataset.id);\n }\n\n render() {\n const options = [\n { key: 'newest-all', title: 'Newest All', description: 'Show newest posts first, including reposts.' },\n { key: 'newest-posts-only', title: 'Newest (posts only)', description: 'Show newest posts first. No reposts' },\n { key: 'top-posts', title: 'Top Posts', description: 'Show the highest-rated posts sorted by likes, reposts, and replies' },\n ];\n\n const sortBy = this.props.sortBy;\n let sortByTxt = '';\n options.forEach(option => {\n if (option.key === sortBy) {\n sortByTxt = option.title;\n }\n });\n\n const show = this.state.show;\n return (\n
\n Sort by\n
\n
\n {sortByTxt}\n \n
\n {\n show && (\n
\n {\n options.map((option, i) => {\n return (\n
\n
\n { option.key === sortBy &&\n \n }\n
\n
\n
{option.title}
\n
{option.description}
\n
\n
\n );\n })\n }\n
\n )\n }\n
\n
\n );\n }\n\n}\n\nexport default SortSelector;\n","import { connect } from 'react-redux';\nimport { expandHomeTimeline, updateTimelineSortBy } from '../../../../brighteon/actions/timelines';\nimport SortSelector from '../components/sort_selector';\n\nconst mapStateToProps = state => {\n return { sortBy: state.getIn(['timelines', 'home', 'sortBy']) };\n};\n\nconst mapDispatchToProps = (dispatch) => ({\n handleUpdateSortBy(sortBy) {\n dispatch(updateTimelineSortBy('home', sortBy));\n dispatch(expandHomeTimeline());\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SortSelector);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { expandHomeTimeline } from '../../actions/timelines';\nimport PropTypes from 'prop-types';\nimport StatusListContainer from '../ui/containers/status_list_container';\nimport Column from '../../components/column';\nimport { addColumn, removeColumn, moveColumn } from '../../actions/columns';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { Link } from 'react-router-dom';\nimport { fetchAnnouncements, toggleShowAnnouncements } from 'brighteon/actions/announcements';\nimport SortSelectorContainer from '../../../brighteon/features/ui/containers/sort_selector_container';\n\nconst messages = defineMessages({\n title: { id: 'column.home', defaultMessage: 'Home' },\n show_announcements: { id: 'home.show_announcements', defaultMessage: 'Show announcements' },\n hide_announcements: { id: 'home.hide_announcements', defaultMessage: 'Hide announcements' },\n});\n\nconst mapStateToProps = state => ({\n hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,\n isPartial: state.getIn(['timelines', 'home', 'isPartial']),\n hasAnnouncements: !state.getIn(['announcements', 'items']).isEmpty(),\n unreadAnnouncements: state.getIn(['announcements', 'items']).count(item => !item.get('read')),\n showAnnouncements: state.getIn(['announcements', 'show']),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass HomeTimeline extends React.PureComponent {\n\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n intl: PropTypes.object.isRequired,\n hasUnread: PropTypes.bool,\n isPartial: PropTypes.bool,\n columnId: PropTypes.string,\n multiColumn: PropTypes.bool,\n hasAnnouncements: PropTypes.bool,\n unreadAnnouncements: PropTypes.number,\n showAnnouncements: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('HOME', {}));\n }\n }\n\n handleMove = (dir) => {\n const { columnId, dispatch } = this.props;\n dispatch(moveColumn(columnId, dir));\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandHomeTimeline({ maxId }));\n }\n\n componentDidMount() {\n setTimeout(() => this.props.dispatch(fetchAnnouncements()), 700);\n this._checkIfReloadNeeded(false, this.props.isPartial);\n }\n\n componentDidUpdate(prevProps) {\n this._checkIfReloadNeeded(prevProps.isPartial, this.props.isPartial);\n }\n\n componentWillUnmount() {\n this._stopPolling();\n }\n\n _checkIfReloadNeeded(wasPartial, isPartial) {\n const { dispatch } = this.props;\n\n if (wasPartial === isPartial) {\n return;\n } else if (!wasPartial && isPartial) {\n this.polling = setInterval(() => {\n dispatch(expandHomeTimeline());\n }, 3000);\n } else if (wasPartial && !isPartial) {\n this._stopPolling();\n }\n }\n\n _stopPolling() {\n if (this.polling) {\n clearInterval(this.polling);\n this.polling = null;\n }\n }\n\n handleToggleAnnouncementsClick = (e) => {\n e.stopPropagation();\n this.props.dispatch(toggleShowAnnouncements());\n }\n\n render() {\n const { intl, shouldUpdateScroll, columnId, multiColumn, hasAnnouncements } = this.props;\n const pinned = !!columnId;\n\n return (\n \n \n\n }} />}\n shouldUpdateScroll={shouldUpdateScroll}\n bindToDocument={!multiColumn}\n hasAnnouncements={hasAnnouncements}\n />\n \n );\n }\n\n}\n"],"sourceRoot":""}