{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/reblogs/index.js"],"names":["messages","defineMessages","refresh","Reblogs","connect","state","props","accountIds","getIn","params","statusId","injectIntl","ImmutablePureComponent","handleRefresh","this","dispatch","fetchReblogs","componentWillMount","componentWillReceiveProps","nextProps","render","intl","multiColumn","emptyMessage","id","defaultMessage","bindToDocument","showBackButton","extraButton","type","className","title","formatMessage","aria-label","onClick","scrollKey","map","withNote","name","content","propTypes","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool"],"mappings":"4RAeA,MAAMA,EAAWC,YAAe,CAC9BC,QAAQ,CAAD,yCAKN,IAIGC,EAFUC,mBAJQ,CAACC,EAAOC,KAAK,CACnCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,eAAgBF,EAAMG,OAAOC,cAG9B,GACvCC,cAAU,EADI,cAEOC,IAAwB,cAAD,yBAsB3CC,cAAgB,KACdC,KAAKR,MAAMS,SAASC,YAAaF,KAAKR,MAAMG,OAAOC,YAbrDO,qBACOH,KAAKR,MAAMC,YACdO,KAAKR,MAAMS,SAASC,YAAaF,KAAKR,MAAMG,OAAOC,WAIvDQ,0BAA0BC,GACpBA,EAAUV,OAAOC,WAAaI,KAAKR,MAAMG,OAAOC,UAAYS,EAAUV,OAAOC,UAC/EI,KAAKR,MAAMS,SAASC,YAAaG,EAAUV,OAAOC,WAQtDU,SACE,MAAM,KAAEC,EAAI,WAAEd,EAAU,YAAEe,GAAgBR,KAAKR,MAE/C,IAAKC,EACH,OACE,YAAC,IAAM,UACL,YAAC,IAAgB,KAKvB,MAAMgB,EAAe,YAAC,IAAgB,CAACC,GAAG,uBAAuBC,eAAe,iFAEhF,OACE,YAAC,IAAM,CAACC,gBAAiBJ,QAAY,EACnC,YAAC,IAAY,CACXK,gBAAc,EACdL,YAAaA,EACbM,YACE,sBAAQC,KAAK,SAASC,UAAU,wBAAwBC,MAAOV,EAAKW,cAAchC,EAASE,SAAU+B,aAAYZ,EAAKW,cAAchC,EAASE,SAAUgC,QAASpB,KAAKD,oBAAc,EAAC,YAAC,IAAI,CAACW,GAAG,eAIjM,YAAC,IAAc,CACbW,UAAU,UACVZ,aAAcA,EACdG,gBAAiBJ,QAAY,EAE5Bf,EAAW6B,KAAIZ,GACd,YAAC,IAAgB,CAAUA,GAAIA,EAAIa,UAAU,GAAtBb,MAI3B,YAAC,IAAM,UACL,oBAAMc,KAAK,SAASC,QAAQ,iBA1D7BC,UAAY,CACjB/B,OAAQgC,IAAUC,OAAOC,WACzB5B,SAAU0B,IAAUG,KAAKD,WACzBpC,WAAYsC,IAAmBC,KAC/BxB,YAAamB,IAAUM,KACvB1B,KAAMoB,IAAUC,OAAOC,YARhB,EASR","file":"js/features/reblogs-0720ec400b4b9f1f1e9c.chunk.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport { fetchReblogs } from '../../actions/interactions';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport AccountContainer from '../../containers/account_container';\nimport Column from '../ui/components/column';\nimport ScrollableList from '../../components/scrollable_list';\nimport Icon from 'mastodon/components/icon';\nimport ColumnHeader from '../../components/column_header';\nimport { Helmet } from 'react-helmet';\n\nconst messages = defineMessages({\n  refresh: { id: 'refresh', defaultMessage: 'Refresh' },\n});\n\nconst mapStateToProps = (state, props) => ({\n  accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId]),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass Reblogs extends ImmutablePureComponent {\n\n  static propTypes = {\n    params: PropTypes.object.isRequired,\n    dispatch: PropTypes.func.isRequired,\n    accountIds: ImmutablePropTypes.list,\n    multiColumn: PropTypes.bool,\n    intl: PropTypes.object.isRequired,\n  };\n\n  componentWillMount () {\n    if (!this.props.accountIds) {\n      this.props.dispatch(fetchReblogs(this.props.params.statusId));\n    }\n  }\n\n  componentWillReceiveProps(nextProps) {\n    if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {\n      this.props.dispatch(fetchReblogs(nextProps.params.statusId));\n    }\n  }\n\n  handleRefresh = () => {\n    this.props.dispatch(fetchReblogs(this.props.params.statusId));\n  }\n\n  render () {\n    const { intl, accountIds, multiColumn } = this.props;\n\n    if (!accountIds) {\n      return (\n        <Column>\n          <LoadingIndicator />\n        </Column>\n      );\n    }\n\n    const emptyMessage = <FormattedMessage id='status.reblogs.empty' defaultMessage='No one has boosted this post yet. When someone does, they will show up here.' />;\n\n    return (\n      <Column bindToDocument={!multiColumn}>\n        <ColumnHeader\n          showBackButton\n          multiColumn={multiColumn}\n          extraButton={(\n            <button type='button' className='column-header__button' title={intl.formatMessage(messages.refresh)} aria-label={intl.formatMessage(messages.refresh)} onClick={this.handleRefresh}><Icon id='refresh' /></button>\n          )}\n        />\n\n        <ScrollableList\n          scrollKey='reblogs'\n          emptyMessage={emptyMessage}\n          bindToDocument={!multiColumn}\n        >\n          {accountIds.map(id =>\n            <AccountContainer key={id} id={id} withNote={false} />,\n          )}\n        </ScrollableList>\n\n        <Helmet>\n          <meta name='robots' content='noindex' />\n        </Helmet>\n      </Column>\n    );\n  }\n\n}\n"],"sourceRoot":""}