{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/ui/components/mute_modal.js"],"names":["MuteModal","connect","state","isSubmitting","getIn","account","notifications","dispatch","onConfirm","muteAccount","get","onClose","closeModal","onToggleNotifications","toggleHideNotifications","injectIntl","_this","props","c","button","componentDidMount","this","focus","render","_this$props","Object","_babel_runtime_helpers_esm_jsx__WEBPACK_IMPORTED_MODULE_0__","className","react_intl__WEBPACK_IMPORTED_MODULE_6__","id","defaultMessage","values","name","htmlFor","react_toggle__WEBPACK_IMPORTED_MODULE_7___default","a","checked","onChange","toggleNotifications","_components_button__WEBPACK_IMPORTED_MODULE_8__","onClick","handleCancel","react__WEBPACK_IMPORTED_MODULE_4___default","createElement","handleClick","ref","setRef","React","PureComponent"],"mappings":"8PAqCMA,EAFUC,kBAxBQ,SAAAC,GACtB,MAAO,CACLC,aAAcD,EAAME,MAAM,CAAC,UAAW,MAAO,iBAC7CC,QAASH,EAAME,MAAM,CAAC,QAAS,MAAO,YACtCE,cAAeJ,EAAME,MAAM,CAAC,QAAS,MAAO,oBAIrB,SAAAG,GACzB,MAAO,CACLC,UADK,SACKH,EAASC,GACjBC,EAASE,YAAYJ,EAAQK,IAAI,MAAOJ,KAG1CK,QALK,WAMHJ,EAASK,gBAGXC,sBATK,WAUHN,EAASO,qBAMdC,0MAiBe,WACZC,EAAKC,MAAMN,UACXK,EAAKC,MAAMT,UAAUQ,EAAKC,MAAMZ,QAASW,EAAKC,MAAMX,2DAGvC,WACbU,EAAKC,MAAMN,gDAGJ,SAACO,GACRF,EAAKG,OAASD,qDAGM,WACpBF,EAAKC,MAAMJ,wEAlBbO,kBAAA,WACEC,KAAKF,OAAOG,WAoBdC,OAAA,WAAU,IAAAC,EAC2BH,KAAKJ,MAAhCZ,EADAmB,EACAnB,QAASC,EADTkB,EACSlB,cAEjB,OACEmB,OAAAC,EAAA,EAAAD,CAAA,OAAKE,UAAU,qCAAf,EACEF,OAAAC,EAAA,EAAAD,CAAA,OAAKE,UAAU,8BAAf,EACEF,OAAAC,EAAA,EAAAD,CAAA,cACEA,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,CACEC,GAAG,6BACHC,eAAe,wCACfC,OAAQ,CAAEC,KAAMP,OAAAC,EAAA,EAAAD,CAAA,uBAAUpB,EAAQK,IAAI,aAG1Ce,OAAAC,EAAA,EAAAD,CAAA,gBACEA,OAAAC,EAAA,EAAAD,CAAA,SAAOQ,QAAQ,gDAAf,EACER,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,CAAkBC,GAAG,gCAAgCC,eAAe,uCACnE,IACDL,OAAAC,EAAA,EAAAD,CAACS,EAAAC,EAAD,CAAQN,GAAG,0CAA0CO,QAAS9B,EAAe+B,SAAUhB,KAAKiB,yBAKlGb,OAAAC,EAAA,EAAAD,CAAA,OAAKE,UAAU,+BAAf,EACEF,OAAAC,EAAA,EAAAD,CAACc,EAAA,EAAD,CAAQC,QAASnB,KAAKoB,aAAcd,UAAU,kCAA9C,EACEF,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,CAAkBC,GAAG,4BAA4BC,eAAe,YAElEY,EAAAP,EAAAQ,cAACJ,EAAA,EAAD,CAAQC,QAASnB,KAAKuB,YAAaC,IAAKxB,KAAKyB,QAC3CrB,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,CAAkBC,GAAG,6BAA6BC,eAAe,gBA5DrDiB,IAAMC","file":"modals/mute_modal.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport Toggle from 'react-toggle';\nimport Button from '../../../components/button';\nimport { closeModal } from '../../../actions/modal';\nimport { muteAccount } from '../../../actions/accounts';\nimport { toggleHideNotifications } from '../../../actions/mutes';\n\n\nconst mapStateToProps = state => {\n  return {\n    isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']),\n    account: state.getIn(['mutes', 'new', 'account']),\n    notifications: state.getIn(['mutes', 'new', 'notifications']),\n  };\n};\n\nconst mapDispatchToProps = dispatch => {\n  return {\n    onConfirm(account, notifications) {\n      dispatch(muteAccount(account.get('id'), notifications));\n    },\n\n    onClose() {\n      dispatch(closeModal());\n    },\n\n    onToggleNotifications() {\n      dispatch(toggleHideNotifications());\n    },\n  };\n};\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass MuteModal extends React.PureComponent {\n\n  static propTypes = {\n    isSubmitting: PropTypes.bool.isRequired,\n    account: PropTypes.object.isRequired,\n    notifications: PropTypes.bool.isRequired,\n    onClose: PropTypes.func.isRequired,\n    onConfirm: PropTypes.func.isRequired,\n    onToggleNotifications: PropTypes.func.isRequired,\n    intl: PropTypes.object.isRequired,\n  };\n\n  componentDidMount() {\n    this.button.focus();\n  }\n\n  handleClick = () => {\n    this.props.onClose();\n    this.props.onConfirm(this.props.account, this.props.notifications);\n  }\n\n  handleCancel = () => {\n    this.props.onClose();\n  }\n\n  setRef = (c) => {\n    this.button = c;\n  }\n\n  toggleNotifications = () => {\n    this.props.onToggleNotifications();\n  }\n\n  render () {\n    const { account, notifications } = this.props;\n\n    return (\n      <div className='modal-root__modal mute-modal'>\n        <div className='mute-modal__container'>\n          <p>\n            <FormattedMessage\n              id='confirmations.mute.message'\n              defaultMessage='Are you sure you want to mute {name}?'\n              values={{ name: <strong>@{account.get('acct')}</strong> }}\n            />\n          </p>\n          <div>\n            <label htmlFor='mute-modal__hide-notifications-checkbox'>\n              <FormattedMessage id='mute_modal.hide_notifications' defaultMessage='Hide notifications from this user?' />\n              {' '}\n              <Toggle id='mute-modal__hide-notifications-checkbox' checked={notifications} onChange={this.toggleNotifications} />\n            </label>\n          </div>\n        </div>\n\n        <div className='mute-modal__action-bar'>\n          <Button onClick={this.handleCancel} className='mute-modal__cancel-button'>\n            <FormattedMessage id='confirmation_modal.cancel' defaultMessage='Cancel' />\n          </Button>\n          <Button onClick={this.handleClick} ref={this.setRef}>\n            <FormattedMessage id='confirmations.mute.confirm' defaultMessage='Mute' />\n          </Button>\n        </div>\n      </div>\n    );\n  }\n\n}\n"],"sourceRoot":""}