define("bitbucket/internal/feature/changeset/diff-tree/components/file","module exports classnames prop-types react bitbucket/internal/enums bitbucket/internal/util/dom-event bitbucket/internal/widget/icons/icons".split(" "),function(l,h,c,m,d,e,n,g){Object.defineProperty(h,"__esModule",{value:!0});var p=babelHelpers.interopRequireDefault(c);c=babelHelpers.interopRequireDefault(m);var f=babelHelpers.interopRequireDefault(d),q=babelHelpers.interopRequireDefault(n),b,r=(b={},babelHelpers.defineProperty(b,
e.ChangeTypes.ADD,"file-added"),babelHelpers.defineProperty(b,e.ChangeTypes.COPY,"file-copied"),babelHelpers.defineProperty(b,e.ChangeTypes.DELETE,"file-deleted"),babelHelpers.defineProperty(b,e.ChangeTypes.MODIFY,"file-modified"),babelHelpers.defineProperty(b,e.ChangeTypes.MOVE,"file-moved"),babelHelpers.defineProperty(b,e.ChangeTypes.RENAME,"file-renamed"),b),k=function(b){return f.default.createElement(b,{className:"status-icon"})};d=function(b){function c(a){babelHelpers.classCallCheck(this,c);
var b=babelHelpers.possibleConstructorReturn(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,a));b.selectFile=function(a){if(q.default.openInSameTab(a)){a.preventDefault();a=b.props;var c=a.selectFile;a.isSelected||c(a.id)}};b.elementRef=f.default.createRef();return b}babelHelpers.inherits(c,b);babelHelpers.createClass(c,[{key:"shouldComponentUpdate",value:function(a){return this.props.isSelected!==a.isSelected}},{key:"componentDidUpdate",value:function(a){var b=this.elementRef.current;!a.isSelected&&
this.props.isSelected&&b.focus()}},{key:"getStatusIcon",value:function(){var a=this.props,b=a.hasComments,c=a.isSubmodule;return a.hasConflict?f.default.createElement(g.Warning,{className:"conflict-status-icon"}):c?k(g.Submodule):b?k(g.FileCommented):k(g.Document)}},{key:"render",value:function(){var a=this.props,b=a.name,c=a.fileUrl,d=a.isSelected;a=a.changeType;d=(0,p.default)("file",r[a],{"file-selected":d});a=this.getStatusIcon(this);return f.default.createElement("li",{className:d},f.default.createElement("a",
{href:c,onClick:this.selectFile,ref:this.elementRef},a,f.default.createElement("span",null,b)))}}]);return c}(d.Component);d.propTypes={name:c.default.node.isRequired,selectFile:c.default.func.isRequired,fileUrl:c.default.string.isRequired,isSelected:c.default.bool,id:c.default.string.isRequired};d.defaultProps={isSelected:!1};h.default=d;l.exports=h["default"]});