1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[75,13],{"0X2M":function(e,t,n){"use strict";var a=n("Q3sF"),c=n("xcSo"),o=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===o||a(o,e)&&t===o.lastIndexOf?c:t}},"2nZx":function(e,t,n){},"5tqG":function(e,t,n){e.exports=n("ctcj")},AySf:function(e,t,n){"use strict";var a=n("yQr1"),c=n.n(a),o=(n("Pwec"),n("CtXQ")),l=n("EcSs"),i=n.n(l),r=(n("+L6B"),n("2/Rp")),s=n("06Pm"),u=n.n(s),f=n("kA7L"),m=n.n(f),d=n("3SUL"),p=n.n(d),v=n("eYnF"),h=n.n(v),g=n("X5/F"),b=n.n(g),y=n("04Ix"),E=n.n(y),w=(n("DZo9"),n("8z0m")),_=n("FLGM"),x=n.n(_),N=n("ZbhI"),C=n.n(N),j=n("UtpJ"),O=n.n(j),S=n("M5Mt"),k=n.n(S),L=n("cDcd"),B=n.n(L),D=n("sYIF"),I=n("vDqi"),V=n.n(I);var A=w.a.Dragger,M=function(e){function t(e){var n;return u()(this,t),n=function(e,t,n){return t=h()(t),p()(e,function(){try{var e=!Boolean.prototype.valueOf.call(c()(Boolean,[],(function(){})))}catch(e){}return!!e}()?c()(t,n||[],h()(e).constructor):t.apply(e,n))}(this,t,[e]),E()(n,"componentDidMount",(function(){var e=n.props.defaultFileList;if(e){var t=[];x()(e).call(e,(function(e){t.push({uid:e.id,name:e.title,status:"done",url:e.url})})),n.setState({fileList:t})}n.checkInitFile()})),E()(n,"componentDidUpdate",(function(e){e&&e.fileList!==n.props.fileList&&n.checkInitFile()})),E()(n,"checkInitFile",(function(){var e=n.props.fileList;e&&e.length>0&&n.setState({fileList:Object(D.d)(e)})})),E()(n,"onAttachmentRemove",(function(e){if(!e.percent||100===e.percent)return n.deleteAttachment(e),!1})),E()(n,"deleteAttachment",(function(e){var t="/attachments/".concat(e.response?e.response.id:e.uid,".json");V.a.delete(t,{}).then((function(t){t.data&&(0===t.data.status?n.setState((function(t){var n,a,c=C()(n=t.fileList).call(n,e),o=O()(a=t.fileList).call(a);return k()(o).call(o,c,1),{fileList:o}}),(function(){n.fileIdList(n.state.fileList)})):n.props.showNotification(t.data.message))})).catch((function(e){}))})),E()(n,"handleChange",(function(e){var t=n.props.changeIsComplete;if(t&&t(!0),"uploading"===e.file.status||"done"===e.file.status||"removed"===e.file.status){var a=e.fileList;n.setState({fileList:Object(D.d)(a)}),n.fileIdList(a)}})),E()(n,"fileIdList",(function(e){var t=[];e&&e.length>0?(x()(e).call(e,(function(e){return e.response&&"done"===e.status&&t.push(e.response.id||e.response.data&&e.response.data.id)})),t&&t.length>0&&n.props.load(t)):n.props.load([])})),E()(n,"checkFile",(function(e){for(var t=[".rar",".iso",".flv",".rmvb",".mmf",".ape",".vsdx",".msi",".md"],n=!1,a=0;a<t.length;a++)if(n=new RegExp("(.+(?=["+t[a]+"]$))").test(e))return n;return!1})),E()(n,"beforeUpload",(function(e){var t=n.props.size,a=e.size/1024/1024<t;return a||n.props.showNotification("文件大小必须小于".concat(t,"MB!")),a})),n.state={fileList:void 0},n}return b()(t,e),m()(t,[{key:"render",value:function(){var e=this.props,t=e.isComplete,n=e.icon,a=e.btn,c=e.className,l=e.size,s=e.actionUrl,u=this.state.fileList,f={name:"file",fileList:!0===t?u:void 0,action:s||"".concat(Object(D.l)()),onChange:this.handleChange,onRemove:this.onAttachmentRemove,beforeUpload:this.beforeUpload,multiple:!0};return a?B.a.createElement(w.a,i()({},f,{className:c}),B.a.createElement(r.a,{type:"default"},"上传文件"),B.a.createElement("span",{className:"ml10 color-grey-9"},"(你可以上传小于",B.a.createElement("span",{className:"color-red"},l,"MB"),"的文件)")):B.a.createElement(A,i()({},f,{className:c}),n||B.a.createElement(o.a,{type:"inbox"}),B.a.createElement("p",{className:"ant-upload-text font-16 color-grey-3"},"拖动文件或点击此处上传"))}}])}(L.Component);t.a=M},B3S4:function(e,t,n){"use strict";n.r(t),n("+L6B");var a=n("2/Rp"),c=n("zLi2"),o=n.n(c),l=n("o+MX"),i=n.n(l),r=n("cDcd"),s=n.n(r),u=(n("2nZx"),n("AySf")),f=n("bIax"),m=n.n(f),d=n("p7gc"),p=(n("spEH"),n("vDqi")),v=n.n(p),h=n("bjH3"),g=n("LZ3y");t.default=function(e){var t=Object(r.useState)(void 0),n=o()(t,2),c=n[0],l=n[1],f=Object(r.useState)(void 0),p=o()(f,2),b=p[0],y=p[1],E=Object(r.useState)(!1),w=o()(E,2),_=w[0],x=w[1],N=Object(r.useState)(void 0),C=o()(N,2),j=C[0],O=C[1],S=e.match.params,k=S.owner,L=S.projectsId,B=e.isManager,D=(e.isDeveloper,e.current_user),I=e.projectDetail,V=D&&D.login&&B;function A(){var e,t=i()(e="/".concat(k,"/")).call(e,L,"/about.json");v.a.get(t).then((function(e){e&&(y(e.data.content),l(e.data.attachments))})).catch((function(e){}))}return Object(r.useEffect)((function(){var e;k&&L&&I&&(A(),document.title=i()(e="主页-".concat(I.author.name,"/")).call(e,I.name))}),[k,L,I]),s.a.createElement("div",{className:"aboutPanels"},s.a.createElement("div",{className:"aboutContent"},s.a.createElement("div",{className:"aboutTitle"},s.a.createElement("span",{className:"font-16"},"项目概览"),V&&!_&&s.a.createElement("a",{onClick:function(){x(!0)},className:"color-blue"},s.a.createElement("i",{className:"iconfont icon-a-bianji12 mr5 font-13 color-blue"}),"编辑")),_?s.a.createElement("div",{className:"padding20 boies"},s.a.createElement(d.a,{placeholder:"请输入描述信息",height:500,mdID:"order-new-description",initValue:b,onChange:function(e){y(e)},className:"mt20"}),s.a.createElement("div",{className:"pb20"},s.a.createElement(u.a,{className:"commentStyle mt20",isComplete:!0,load:function(e){O(e)},icon:s.a.createElement("img",{src:m.a,width:"58",alt:"",style:{marginBottom:15}}),size:100,showNotification:e.showNotification}),c&&c.length>0&&s.a.createElement(g.a,{attachments:c,showNotification:e.showNotification,canDelete:!0})),s.a.createElement("div",{className:"pb30"},s.a.createElement(a.a,{type:"primary",onClick:function(){var t,n=i()(t="/".concat(k,"/")).call(t,L,"/about.json");v.a.post(n,{content:b,attachment_ids:j}).then((function(t){t&&(e.showNotification("项目主页编辑成功!"),A(),x(!1))})).catch((function(e){}))}},"确定"),s.a.createElement(a.a,{className:"ml30",onClick:function(){return x(!1)}},"取消"))):s.a.createElement("div",{className:"padding20 boies"},b?s.a.createElement(h.a,{className:"break_word_comments imageLayerParent",value:b,url:e.history.location}):s.a.createElement("div",null,"暂无概览~"),c&&c.length>0&&s.a.createElement(g.a,{attachments:c,showNotification:e.showNotification}))))}},BfIq:function(e,t,n){e.exports=n("k2Gq")},LZ3y:function(e,t,n){"use strict";var a=n("yQr1"),c=n.n(a),o=(n("2qtc"),n("kLXV")),l=(n("T2oS"),n("W9HT")),i=(n("P2fV"),n("NJEC")),r=n("06Pm"),s=n.n(r),u=n("kA7L"),f=n.n(u),m=n("3SUL"),d=n.n(m),p=n("eYnF"),v=n.n(p),h=n("X5/F"),g=n.n(h),b=n("04Ix"),y=n.n(b),E=n("ZbhI"),w=n.n(E),_=n("o+MX"),x=n.n(_),N=n("FLGM"),C=n.n(N),j=n("cDcd"),O=n.n(j),S=n("vDqi"),k=n.n(S),L=n("zLi2"),B=n.n(L),D=n("6tYh"),I=n.n(D),V=function(e){var t=Object(j.useState)(null),n=B()(t,2),a=n[0],c=n[1];return Object(j.useEffect)((function(){c(e.video_url)}),[]),O.a.createElement(I.a,{url:a,controls:!0,playing:!1})};var A=function(e){function t(e){var n;return s()(this,t),n=function(e,t,n){return t=v()(t),d()(e,function(){try{var e=!Boolean.prototype.valueOf.call(c()(Boolean,[],(function(){})))}catch(e){}return!!e}()?c()(t,n||[],v()(e).constructor):t.apply(e,n))}(this,t,[e]),y()(n,"componentDidMount",(function(){n.getDetail()})),y()(n,"getDetail",(function(){n.setState({canDelete:n.props.canDelete})})),y()(n,"show_video_modal",(function(e){n.setState({video_title:e.title,move_spin:!0,video_id:e.id}),n.move_attachment(e.id,"preview")})),y()(n,"hide_video_modal",(function(){var e=n.state.video_id;n.setState({video_title:void 0}),n.move_attachment(e,"close")})),y()(n,"move_attachment",(function(e,t){k.a.post("/attachments/".concat(e,"/preview_attachment"),{status:t}).then((function(e){e?n.setState({show_video:"preview"===t,video_url:"preview"===t?"https://www.gitlink.org.cn"+e.data.url:void 0,move_spin:!1}):n.setState({move_spin:!1})})).catch((function(e){n.setState({move_spin:!1})}))})),y()(n,"is_video",(function(e){var t=["mp4","flv","mkv","3gp"];return w()(t).call(t,e.split(".").pop())>-1})),y()(n,"deleteAttachment",(function(e){var t=n.props.deleteLoad,a="/attachments/".concat(e,".json");k.a.delete(a,{}).then((function(a){var c;a.data&&(0===a.data.status?(n.setState({Deleted:x()(c=n.state.Deleted).call(c,e)}),n.props.showNotification("附件删除成功"),t&&t(e)):n.props.showNotification(a.data.message))})).catch((function(e){}))})),n.state={canDelete:!1,show_video:!1,video_url:void 0,video_title:void 0,video_id:void 0,move_spin:!1,Deleted:[]},n}return g()(t,e),f()(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.Deleted,a=t.canDelete,c=t.show_video,r=t.video_url,s=t.video_title,u=t.move_spin,f=this.props.attachments;return O.a.createElement("div",null,f?O.a.createElement("div",{className:"attachmentsList mt5"},C()(f).call(f,(function(t,c){return O.a.createElement("div",{key:c,style:{display:n.length>0&&-1!==w()(n).call(n,t.id)?"none":"block",padding:"4px"},className:"attachment-list-div"},O.a.createElement(l.a,{spinning:u},e.is_video(t.title)?O.a.createElement("a",{onClick:function(){return e.show_video_modal(t)},className:"attachment-list-a"},O.a.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),O.a.createElement("span",null,t.title),O.a.createElement("span",{className:"ml20"},t.filesize)):O.a.createElement("a",{href:"".concat(t.url),target:"_blank",className:"attachment-list-a",download:!0},O.a.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),O.a.createElement("span",null,t.title),O.a.createElement("span",{className:"ml20"},t.filesize)),a?O.a.createElement(i.a,{placement:"bottom",title:"您确定要删除附件吗",okText:"是",cancelText:"否",onConfirm:function(){return e.deleteAttachment(t.id)}},O.a.createElement("span",{className:"attachment-list-delete fr"},O.a.createElement("i",{className:"iconfont icon-lajitong mr10 color-grey-9 font-14"}))):""))}))):"",c?O.a.createElement(o.a,{title:s,visible:!0,width:690,footer:null,onCancel:this.hide_video_modal},O.a.createElement(V,{video_url:r})):"")}}])}(j.Component);t.a=A},NJEC:function(e,t,n){"use strict";var a=n("cDcd"),c=n("VCL8"),o=n("3S7+"),l=n("CtXQ"),i=n("2/Rp"),r=n("YMnH"),s=n("ZvpZ"),u=n("H84U");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(f,e);var t,n,c,l=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=g(e);if(t){var c=g(this).constructor;n=Reflect.construct(a,arguments,c)}else n=a.apply(this,arguments);return v(this,n)}}(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=l.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(h(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(h(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var c=t.props,o=c.okButtonProps,l=c.cancelButtonProps,r=c.title,s=c.cancelText,u=c.okText,f=c.okType,d=c.icon;return a.createElement("div",null,a.createElement("div",{className:"".concat(e,"-inner-content")},a.createElement("div",{className:"".concat(e,"-message")},d,a.createElement("div",{className:"".concat(e,"-message-title")},r)),a.createElement("div",{className:"".concat(e,"-buttons")},a.createElement(i.a,m({onClick:t.onCancel,size:"small"},l),s||n.cancelText),a.createElement(i.a,m({onClick:t.onConfirm,type:f,size:"small"},o),u||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,c=t.props,l=c.prefixCls,i=c.placement,u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)t.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]])}return n}(c,["prefixCls","placement"]),f=n("popover",l),d=a.createElement(r.a,{componentName:"Popconfirm",defaultLocale:s.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return a.createElement(o.a,m({},u,{prefixCls:f,placement:i,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,c=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var a=n.onVisibleChange;a&&a(e,t)}},{key:"render",value:function(){return a.createElement(u.a,null,this.renderConfirm)}}])&&d(t.prototype,n),c&&d(t,c),f}(a.Component);b.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:a.createElement(l.a,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(c.polyfill)(b),t.a=b},OG05:function(e,t,n){"use strict";var a=n("pevS"),c=n("hVCs");a({target:"Array",proto:!0,forced:c!==[].lastIndexOf},{lastIndexOf:c})},P2fV:function(e,t,n){"use strict";n("cIOH"),n("Q9mQ"),n("+L6B")},Yf6w:function(e,t,n){"use strict";var a,c=n("pevS"),o=n("E890"),l=n("RLqH").f,i=n("ZyXh"),r=n("jBKu"),s=n("nlFj"),u=n("GHVm"),f=n("jFgU"),m=n("cEKj"),d=o("".slice),p=Math.min,v=f("endsWith");c({target:"String",proto:!0,forced:!(!m&&!v&&(a=l(String.prototype,"endsWith"),a&&!a.writable)||v)},{endsWith:function(e){var t=r(u(this));s(e);var n=arguments.length>1?arguments[1]:void 0,a=t.length,c=void 0===n?a:p(i(n),a),o=r(e);return d(t,c-o.length,c)===o}})},afLt:function(e,t,n){"use strict";n("Yf6w");var a=n("wY6U");e.exports=a("String","endsWith")},bIax:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAAmCAYAAACVr4jIAAAEiklEQVRoQ9WZbWxTZRTHf+feDlAJQhUIftBAUDEaDVG/gHEzEQ3GsVtMWTBGo0QxsLUJRvHDQtmMMRoyaAeJ+O4HCWzZ2rFkghpfQmZMNGqMgiwiJH6YStjmG2Treo+5ZZtDuvXerncrz8c+/3PO/9fbe3uec4VpWqsTOmeWElK4G+VOYCHCPGBAoEeFH4DP1KS1fbP8MlmbMtkEXuPX7tRFGYNtAo8As13E2wKtmNQla6TbhT6nZEpB1zbppozNSwJzCjCcRkn09/H8p/Uy5DV+SkDDMZ0xFORVhce9GrxIL3wsBuuSNXLGSy7/QWNqhILsVwh7MTaRVuC7QICVLZvlb7c5fQe14voy8JxbQ251IhxMniFEvdhuYnwFrYrrCoEjgOHGjFeNQE0yKnvcxPkKasX1W+A2N0YK1JweEJa+H5E/88VPCnR1QmfOslmlBhXANSgZVY5pGc1GhiUoh/MZmOy+CrH2iDTky1MwaGiXhm1hh8C1OYooQj+abQD8XqdSUVmcr0hBoFZcGxDqcHBKYGVMbumoEaeTGnd5NhrarY9phndKgG/Ughg8kayVt4sG6vSnM2xOiHB1iYG+mKyVuqKBWk26AZs3Sgky60XYnYpIbfFAE7oPZX2pgQrsSEbl2UmDxmJqHF3AgnSaDoQ7Sg0U2JqKyisFgVY26WLT5lGENSi3AoESBByxdEKU98Tm3bYt8nMunxc9da2dOheDBpSNCDNKGC6XtbTCm4PC1v93SxeAVjbpMtOmHbjhEgO80K7wkyihZFS+H9kYBV3TqEsNky+Aqy5pyP/IfjeF8tZa+fH8gxkI79HZg0N8KbBsiiCdCYH/97zQnellecd2OZsFtRL6AsqEf7hF+QIERXnaEDozStc4fXJRSo35yWb/eiSc0Plp5SRwRVEr5E5Wn4rKdmerslFvNgMc8bvxV/jHMLlOrLg+Bez1HVJ4KxWRDWPrhBJaruePcjN9rh9xQDuAB/0sJHCor5fKXNO7qiatFpt9fk0hhrk6JBTXboXrfQMVvi4zKZ9okGUl9BmUHb55gFPOFXUmaX7dnycHA6zo3Cy/5oOoSmhclEg+XUH7wlmxdmk/wpUFJZg46IxdxsqDm+S4q9wxNawgzcBDrvReRMofDuhRhJu8xLnQnjMMVrXVSpcL7aikIqaz5gb5ELjLS1xerXJMrITuR6nOK/YgUDjUHpXVHkJGpVVxDQm0FRI7boxwQKyduh4j+9Qr9uoFMggqSsN481fnpZNt0oWOvnBybqPiHiZsHhan/UsP4Rxt5hebdEy+11JR2ZgrvxXX24GvfKx9uizAkpEWsAalycdi0wcq1KYisjsLWhHTwLwgHyjc4xPstIAKfNLXy31OozJ6TAs3ajBt8jlwow+w0wF6vCzDipYt4jwrLhxA39+owcsCHEC5t8iwUwsqfHRuiOrDw5AXgTofhJvVHPqNJ9VmG7CoSMBTBdojBg2Bhbzesk4yY72PO6mv3KuXGwM8IEqVKstFstDOuxTP032g2KCDwz7+UqVHhG9UaLd76XQO2bkuzr9Ki5LaLq4ltwAAAABJRU5ErkJggg=="},ctcj:function(e,t,n){"use strict";var a=n("iWGr");e.exports=a},eXKH:function(e,t,n){},ex8r:function(e,t,n){},hVCs:function(e,t,n){"use strict";var a=n("oLk2"),c=n("pCEo"),o=n("x9K+"),l=n("x08Q"),i=n("n2Hk"),r=Math.min,s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0,f=i("lastIndexOf"),m=u||!f;e.exports=m?function(e){if(u)return a(s,this,arguments)||0;var t=c(this),n=l(t);if(0===n)return-1;var i=n-1;for(arguments.length>1&&(i=r(i,o(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:s},iWGr:function(e,t,n){"use strict";var a=n("Q3sF"),c=n("afLt"),o=String.prototype;e.exports=function(e){var t=e.endsWith;return"string"==typeof e||e===o||a(o,e)&&t===o.endsWith?c:t}},k2Gq:function(e,t,n){"use strict";var a=n("0X2M");e.exports=a},"p77/":function(e,t,n){},p7gc:function(e,t,n){"use strict";var a=n("UtpJ"),c=n.n(a),o=n("O0yt"),l=n.n(o),i=n("Dcj1"),r=n.n(i),s=n("6UaR"),u=n.n(s),f=n("zLi2"),m=n.n(f),d=n("IeeE"),p=n.n(d),v=n("RKTd"),h=n.n(v),g=n("pPxq"),b=n.n(g),y=n("o+MX"),E=n.n(y),w=n("FLGM"),_=n.n(w),x=n("BfIq"),N=n.n(x),C=n("BF1V"),j=n.n(C),O=n("0lTi"),S=n.n(O),k=n("lHQ6"),L=n.n(k),B=n("ZbhI"),D=n.n(B),I=n("UF4K"),V=n.n(I),A=n("xlHU"),M=n.n(A),q=n("5tqG"),R=n.n(q),P=n("cDcd"),H=n.n(P),F=n("sYIF"),T=n("bdgK"),U=n("vDqi"),G=n.n(U);function K(e,t){var n=void 0!==l.a&&r()(e)||e["@@iterator"];if(!n){if(u()(e)||(n=function(e,t){if(e){var n;if("string"==typeof e)return X(e,t);var a=c()(n={}.toString.call(e)).call(n,8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?S()(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?X(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,f=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){f=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(f)throw i}}}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}n("pb8e"),n("ex8r"),n("p77/"),n("eXKH");var Q=window.$,z=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","image","table","|","line-break","watch","clear","emoji","fullscreen"],Z=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","inline-latex","latex","|","image","table","|","line-break","watch","clear","emoji","fullscreen"];function Y(e,t,n){window.sessionStorage.removeItem(e+t);var a="#e_tip_"+n;"content"==e?Q("#e_tips_"+n).html(" "):Q(a).html(" ")}function J(e,t,n){var a=window.sessionStorage.getItem("content"+t);if(null!==a&&a!==e.getValue()){Q("#e_tips_"+n).data("editor",e);var c='您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+t+"','"+n+'\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+t+"','"+n+"')\">不恢复</a>";Q("#e_tips_"+n).html(c)}return p()((function(){var a,c=new Date,o=c.getHours(),l=c.getMinutes(),i=c.getSeconds();if(o=o<10?"0"+o:o,l=l<10?"0"+l:l,i=i<10?"0"+i:i,""!==h()(a=e.getValue()).call(a)){!function(e,t,n){window.sessionStorage.setItem("content"+t,n)}(0,t,e.getValue());var r="#e_tips_"+n,s=" 数据已于 "+o+":"+l+":"+i+" 保存 ",u=Q(r).html();u&&" "!==u&&!1===b()(u).call(u," 数据已于 ")?Q(r).html(u.split(" (")[0]+" (".concat(s,")")):Q(r).html(s)}}),1e4)}window.md_clear_data=Y,window.md_rec_data=function(e,t,n){null!==window.sessionStorage.getItem(e+t)&&(Q("#e_tips_"+n).data("editor").setValue(window.sessionStorage.getItem(e+t)),Y(e,t,n))},t.a=function(e){var t,n,a=e.mdID,c=e.onChange,o=e.onCMBeforeChange,l=e.onCMBlur,i=e.error,r=void 0!==i&&i,s=e.className,u=void 0===s?"":s,f=e.noStorage,d=void 0!==f&&f,p=e.imageExpand,v=void 0===p||p,h=e.placeholder,g=void 0===h?"":h,b=e.width,y=void 0===b?"100%":b,w=e.height,x=void 0===w?400:w,C=e.initValue,O=void 0===C?"":C,k=(e.emoji,e.watch),B=void 0===k||k,I=(e.showNullButton,e.showResizeBar),A=void 0!==I&&I,q=e.startInit,U=void 0===q||q,X=(e.forMember,e.isCanAtme),Q=void 0!==X&&X,Y=e.isQuoteIssue,W=void 0!==Y&&Y,$=e.changeAtWhoLoginList,ee=e.owner,te=e.projectsId,ne=e.isFocus,ae=void 0===ne||ne,ce=e.showLatexButton,oe=void 0===ce||ce,le=Object(P.useRef)(),ie=Object(P.useRef)(),re=Object(P.useState)(),se=m()(re,2),ue=se[0],fe=se[1],me=Object(P.useState)(!1),de=m()(me,2),pe=de[0],ve=de[1],he=Object(P.useState)([]),ge=m()(he,2),be=ge[0],ye=ge[1],Ee=Object(P.useState)([]),we=m()(Ee,2),_e=we[0],xe=we[1],Ne=Object(P.useState)([]),Ce=m()(Ne,2),je=Ce[0],Oe=Ce[1],Se=Object(P.useRef)([]),ke=Object(P.useRef)(!1),Le="mdEditor_".concat(a),Be="mdEditors_".concat(a),De="e_tips_mdEditor_".concat(a),Ie=Object(P.useState)([]),Ve=m()(Ie,2),Ae=Ve[0],Me=Ve[1],qe=Object(P.useState)(!1),Re=m()(qe,2),Pe=Re[0],He=Re[1],Fe=Object(P.useState)([]),Te=m()(Fe,2),Ue=Te[0],Ge=Te[1],Ke=Object(P.useRef)(!1),Xe=Object(P.useRef)([]);function Qe(e){var t;G.a.get(E()(t="/v1/".concat(ee,"/")).call(t,te,"/issues"),{params:{only_name:!0,keyword:e,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1}}).then((function(t){if(t){!e&&Me(t.data.issues);var n=t.data.issues;Ge(n&&n.length>0?n:void 0)}}))}Object(P.useEffect)((function(){var e;Q&&G.a.get(E()(e="/".concat(ee,"/")).call(e,te,"/members.json")).then((function(e){0!==e.data.total_count&&(Oe(e.data.users),xe(e.data.users))})),document.addEventListener("click",(function(){ke.current=!1,ve(!1),Ke.current=!1,He(!1)})),W&&Qe()}),[]);var ze=H.a.createElement("div",{id:"quoteDiv",className:"quoteDiv"},Ue&&_()(Ue).call(Ue,(function(e,t){return H.a.createElement("li",{className:"quote ".concat(0===t&&"active"),onClick:function(){return function(e){var t,n,a,c;Ke.current=!1,He(!1);var o=ue.cm,l=o.doc.getCursor(),i=l.line,r=l.ch,s=N()(t=o.getRange({line:i,ch:0},{line:i,ch:r})).call(t,"#");o.replaceRange(E()(n=E()(a=E()(c="[#".concat(e.subject,"](/")).call(c,ee,"/")).call(a,te,"/issues/")).call(n,e.project_issues_index,") "),{line:i,ch:s},{line:i,ch:r}),o.focus();var u=new j.a(Xe.current);u.add(e.project_issues_index),Xe.current=S()(u)}(e)},onMouseOver:function(){return e=t,document.getElementsByClassName("quote active")[0]&&(document.getElementsByClassName("quote active")[0].className="quote"),void(document.getElementsByClassName("quote")[e]&&(document.getElementsByClassName("quote")[e].className="quote active"));var e}},H.a.createElement("span",{style:{minWidth:"40px"}},H.a.createElement("span",{className:"issueIndex",title:e.project_issues_index},"#",e.project_issues_index)),H.a.createElement("span",{className:"issueName task-hide"},e.subject))})));function Ze(e){var t=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,n=ue.cm.getValue();if(e.shiftKey&&"Digit2"===e.code&&(ke.current=!0,ve(!0),document.getElementById("at_who_list").style.top=L()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("at_who_list").style.left=L()(t.getPropertyValue("left").replace("px",""))+20+"px"),e.ctrlKey&&"KeyZ"===e.code&&0!==je.length){if(O){var a=[];_()(je).call(je,(function(e){var t;-1!=D()(O).call(O,e.username)&&"@"===O.charAt(D()(O).call(O,e.username)-1)&&D()(O).call(O,"@".concat(e.username))===D()(n).call(n,"@".concat(e.username))&&(a[a.length]=E()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=a.length&&_()(a).call(a,(function(e){n=n.replace(e,"")}))}-1!=D()(n).call(n,"@")&&_()(je).call(je,(function(e){if(-1!=D()(n).call(n,e.username)&&"@"===n.charAt(D()(n).call(n,e.username)-1)){var t=new j.a(Se.current);t.add(e.login),Se.current=S()(t),ye(S()(t))}}))}e.shiftKey&&"Digit3"===e.code&&W&&(Ke.current=!0,He(!0),document.getElementById("quoteDiv").style.top=L()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("quoteDiv").style.left=L()(t.getPropertyValue("left").replace("px",""))+20+"px")}Object(P.useEffect)((function(){if(Je)if(Ke.current){var e=document.getElementById("quoteDiv"),t=document.getElementsByClassName("quote");Je.addKeyMap({Up:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n>0&&(n<=t.length-4&&(e.scrollTop-=40),t[n].className="quote",t[n-1].className="quote active")},Down:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n<t.length-1&&(n>=3&&(e.scrollTop+=40),t[n].className="quote",t[n+1].className="quote active")},Enter:function(){document.getElementsByClassName("quote active")[0]&&document.getElementsByClassName("quote active")[0].click()}})}else Je.removeKeyMap()}),[Pe]),Object(P.useEffect)((function(){$&&$(be)}),[be]);var Ye=H.a.createElement("div",{className:"at_who_list",id:"at_who_list"},_e&&_()(_e).call(_e,(function(e,t){return H.a.createElement("div",{key:t,className:"at_who ".concat(0===t&&"active"),onClick:function(){!function(e){var t;ke.current=!1,ve(!1);var n=ue.cm,a=n.doc.getCursor(),c=a.line,o=a.ch,l=N()(t=n.getRange({line:c,ch:0},{line:c,ch:o})).call(t,"@"),i=void 0;_()(_e).call(_e,(function(t){t.username===e&&(i=t.login)})),n.replaceRange("[@"+e+"]"+"(/".concat(i,") "),{line:c,ch:l},{line:c,ch:o}),n.focus();var r=new j.a(Se.current);r.add(i),Se.current=S()(r),ye(S()(r))}(e.username)},onMouseOver:function(){!function(e){document.getElementsByClassName("at_who active")[0]&&(document.getElementsByClassName("at_who active")[0].className="at_who"),document.getElementsByClassName("at_who")[e]&&(document.getElementsByClassName("at_who")[e].className="at_who active")}(t)}},e.image_url&&H.a.createElement("img",{src:Object(F.i)("/".concat(e.image_url)),alt:""}),H.a.createElement("span",null,e.username))})));Object(P.useEffect)((function(){!ue&&U&&window.editormd(Le,{width:y,height:x,path:Object(F.m)("/editormd/lib/"),markdown:O,syncScrolling:"single",tex:!0,tocm:!0,emoji:!0,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,watch:B,saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:g,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:Object(F.l)(),toolbarIcons:function(){return oe?Z:z},toolbarIconsClass:{"line-break":"fa-minus",fullScreen:"iconfont icon-fangdaicon font-14"},toolbarCustomIcons:{"inline-latex":"<a title='行内公式' class='latex' ><i name='inline-latex' class='fa iconfont icon-hangneigongshi font-14'></i></a>",latex:"<a title='多行公式' class='latex' ><i name='latex' class='fa iconfont icon-duohanggongshi font-16'></i></a>","null-button":"<a class='pr' title='增加填空'><i class='border-left'><span></span></i><span name='null-button' class='fa fillTip'>点击插入填空项</span><i class='iconfont fa icon-edit font-16' name='null-button'></i></a>"},toolbarHandlers:{"line-break":function(e,t,n,a){e.replaceSelection("<br/>")},"null-button":function(e,t,n,a){""===a&&e.setCursor(n.line,n.ch+1),e.replaceSelection("▁")},fullScreen:function(e,t,n,a){t.addClass("none")},"inline-latex":function(e,t,n,a){e.replaceSelection("$"+a+"$"),e.setCursor(n.line,n.ch+2),e.focus()},latex:function(e,t,n,a){e.replaceSelection("$$\n\n"+a+"$$"),e.setCursor(n.line+1,0),e.focus()}},lang:{toolbar:{latex:"多行公式","line-break":"换行",fullScreen:"开启全屏"}},onload:function(){fe(this)}})}),[Le,ue,U]);var Je=ue&&ue.cm;return Object(P.useEffect)((function(){ke.current?Je.addKeyMap({Up:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e>0&&(e<=n.length-4&&(t.scrollTop-=40),n[e].className="at_who",n[e-1].className="at_who active")},Down:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e<n.length-1&&(e>=3&&(t.scrollTop+=40),n[e].className="at_who",n[e+1].className="at_who active")},Enter:function(){if(document.getElementsByClassName("at_who active")[0])document.getElementsByClassName("at_who active")[0].click();else{var e=ue.cm,t=e.doc.getCursor(),n=t.line,a=t.ch;e.replaceRange("\n",{line:n,ch:a},{line:n,ch:a}),ve(!1),ke.current=!1}}}):Je&&Je.removeKeyMap()}),[pe]),Object(P.useEffect)((function(){if(ke.current&&_e){var e=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,t="添加评论..."===g?80:10;document.getElementById("at_who_list").style.left=L()(e.getPropertyValue("left").replace("px",""))+t+"px"}}),[_e]),Object(P.useEffect)((function(){if(Je){var e,t=null;return l&&ue.cm.on("blur",(function(){l(ue.getValue())})),o&&ue.cm.on("beforeChange",(function(e,t){o(e,t)})),d||(t=J(ue,"MDEditor__".concat(Le),Le)),(Q||W)&&ue.cm.on("focus",(function(){document.addEventListener("keydown",Ze)})),(Q||W)&&ue.cm.on("blur",(function(){document.removeEventListener("keydown",Ze)})),ue.cm.on("change",(function(e){var t=e.getValue();if(c&&c(t),Ke.current){var n=e.doc.getCursor(),a=n.line,o=n.ch,l=Je.getRange({line:a,ch:0},{line:a,ch:o});-1===D()(l).call(l,"#")||" "===(l=l.substring(N()(l).call(l,"#")+1))?(He(!1),Ke.current=!1):Qe(l)}if(ke.current){var i,r=e.doc.getCursor(),s=r.line,u=r.ch,f=Je.getRange({line:s,ch:0},{line:s,ch:u});-1===D()(f).call(f,"@")?(ve(!1),ke.current=!1):(f=f.substring(N()(f).call(f,"@")+1))?G.a.get(E()(i="/".concat(ee,"/")).call(i,te,"/members.json"),{params:{search:f}}).then((function(e){e&&e.data&&0!==e.data.total_count?xe(e.data.users):xe(void 0)})):xe(je)}if(function(e,t,n){if(0!=n.length){var a,c=ue.cm,o=c.getValue();if(O){var l=[];_()(t).call(t,(function(t){var n,a,c,i,r,s,u,f,m=t.username;m=t.project_issues_index,-1!=D()(O).call(O,m)&&O.charAt(D()(O).call(O,m)-1)===e&&D()(O).call(O,E()(n="".concat(e)).call(n,m))===D()(o).call(o,E()(a="".concat(e)).call(a,m))&&(l[l.length]=E()(c=E()(i="[".concat(e)).call(i,m,"](/")).call(c,m,")"),l[l.length]=E()(r=E()(s=E()(u=E()(f="[".concat(e)).call(f,m,"](")).call(u,ee,"/")).call(s,te,"/issues/")).call(r,m,")"))})),0!=l.length&&_()(l).call(l,(function(e){o=o.replace(e,"")}))}var i=new V.a;_()(a=S()(n)).call(a,(function(e){_()(t).call(t,(function(t){t.project_issues_index===e&&i.set(t.project_issues_index,t.project_issues_index)}))}));var r=c.doc.getCursor(),s=r.line,u=r.ch;-1===D()(o).call(o,e)&&(Xe.current=[]);var f,m,d=c.getRange({line:s,ch:0},{line:s,ch:u}),p=c.getLine(s);p&&-1!==D()(p).call(p,e)?_()(f=S()(M()(i).call(i))).call(f,(function(t){var n,a,l,r,f=E()(n=E()(a=E()(l=E()(r="[".concat(e)).call(r,t,"](/")).call(l,ee,"/")).call(a,te,"/issues/")).call(n,i.get(t),")");if(R()(d).call(d,f)&&c.setSelection({line:s,ch:N()(d).call(d,e)-1},{line:s,ch:u}),-1===D()(o).call(o,f)){var m=new j.a(Xe.current);m.delete(i.get(t)),Xe.current=S()(m)}})):_()(m=S()(M()(i).call(i))).call(m,(function(t){var n,a,c,l,r=E()(n=E()(a=E()(c=E()(l="[".concat(e)).call(l,t,"](/")).call(c,ee,"/")).call(a,te,"/issues/")).call(n,i.get(t),")");if(-1===D()(o).call(o,r)){var s=new j.a(Xe.current);s.delete(i.get(t)),Xe.current=S()(s)}}))}}("#",Ae,Xe.current),0!=Se.current.length){var m,d=ue.cm,p=d.getValue();if(O){var v=[];_()(je).call(je,(function(e){var t;-1!=D()(O).call(O,e.username)&&"@"===O.charAt(D()(O).call(O,e.username)-1)&&D()(O).call(O,"@".concat(e.username))===D()(p).call(p,"@".concat(e.username))&&(v[v.length]=E()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=v.length&&_()(v).call(v,(function(e){p=p.replace(e,"")}))}var h=new V.a;_()(m=S()(Se.current)).call(m,(function(e){_()(je).call(je,(function(t){t.login===e&&h.set(t.username,t.login)}))}));var g=d.doc.getCursor(),b=g.line,y=g.ch;-1===D()(p).call(p,"@")&&(Se.current=[],ye([]));var w,x,C=d.getRange({line:b,ch:0},{line:b,ch:y}),k=d.getLine(b);k&&-1!==D()(k).call(k,"@")?_()(w=S()(M()(h).call(h))).call(w,(function(e){var t,n=E()(t="[@".concat(e,"](/")).call(t,h.get(e),")");if(R()(C).call(C,n)&&d.setSelection({line:b,ch:N()(C).call(C,"@")-1},{line:b,ch:y}),-1===D()(p).call(p,n)){var a=new j.a(Se.current);a.delete(h.get(e)),Se.current=S()(a),ye(S()(a))}})):_()(x=S()(M()(h).call(h))).call(x,(function(e){var t,n=E()(t="[@".concat(e,"](/")).call(t,h.get(e),")");if(-1===D()(p).call(p,n)){var a=new j.a(Se.current);a.delete(h.get(e)),Se.current=S()(a),ye(S()(a))}}))}})),e=function(){var e;return le.current&&(e=new T.default((function(e){var t,n=K(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&(ue.resize(),ue.cm.refresh(),ae&&ue.cm.focus())}}catch(e){n.e(e)}finally{n.f()}}))).observe(le.current),e}(),function(){d||clearInterval(t),e&&e.unobserve(le.current)}}}),[Je]),Object(P.useEffect)((function(){ue&&null!=O&&O!==ue.getValue()&&ue.setValue(O.toString())}),[ue,O,Le]),Object(P.useEffect)((function(){if(ie.current){var e=function(e){c=!0,o=e.pageY},t=function(){c=!1},n=function(e){if(c){var t=e.pageY-o;t<0&&(t=0),t>300&&(t=300);var n=x+t+"px";ue.resize("",n)}},a=ie.current,c=!1,o=0;return a.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){a.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[ue,ie]),H.a.createElement(P.Fragment,null,H.a.createElement("div",{ref:le,className:E()(t=E()(n="df editormd-editing ".concat(u," ")).call(n,v&&"editormd-image-click-expand"," ")).call(t,Pe||pe?"quoteBox":""," ")},H.a.createElement("div",{className:"edu-back-greyf5 radius4 editormd ".concat(r?"error":""),id:Le},Pe&&ze,pe&&Ye,H.a.createElement("textarea",{style:{display:"none"},id:Be,name:"content"}),H.a.createElement("div",{className:"CodeMirror cm-s-defualt",style:{display:"none"}}))),A?H.a.createElement("a",{ref:ie,className:"editor-resize"}):null,H.a.createElement("div",{className:"fr rememberTip"},!0===d?null:H.a.createElement("div",{id:De,className:"edu-txt-right color-grey-cd font-12"})))}},xcSo:function(e,t,n){"use strict";n("OG05");var a=n("wY6U");e.exports=a("Array","lastIndexOf")}}]); |