forked from bytedance/Elkeid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
500c00.3.min.js
1 lines (1 loc) · 11.1 KB
/
500c00.3.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{575:function(e,n,t){"use strict";t(13),t(116),t(676)},576:function(e,n,t){"use strict";var r=t(11),o=t.n(r),a=t(0),c=t.n(a),l=t(296),i=t(619),u=t(24),f=t(1),s=t(8),p=t(12),m=t(44),d=t(216),v=t(239),b=t(66),y=t(48),O=t(106),C=function(){return(C=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},E={simple:!0},h=[],g=function(){return(g=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function j(e){var n=E,t=n.prefixCls,r=n.simple;return c.a.createElement(K,g({prefixCls:t,simple:r},e),e.content)}var k=function(e){if(e.isNotice){var n=e.icon;if(!n&&null!==n)switch(e.noticeType){case"info":n=c.a.createElement(v.a,null);break;case"success":n=c.a.createElement(b.a,null);break;case"warning":n=c.a.createElement(y.a,null);break;case"error":n=c.a.createElement(O.a,null)}e.title=c.a.createElement("span",null,n,e.title),e.hideCancel=!0}else e.title=c.a.createElement("span",null,null!==e.icon&&(e.icon||c.a.createElement(y.a,null)),e.title);return e};var x=function(e,n){var t=document.createElement("div");document.body.appendChild(t);var r=n||function(e){o.a.render(c.a.createElement(j,g({},e,{onCancel:i})),t)},a=g(g({},e),{visible:!1});function l(){o.a.unmountComponentAtNode(t)&&t.parentNode&&t.parentNode.removeChild(t);for(var e=0;e<h.length;e++){if(h[e]===u){h.splice(e,1);break}}}function i(n){!n&&e.onCancel&&e.onCancel(),a.visible=!1,a.afterClose=function(){e.afterClose&&e.afterClose(),l()},r(a)}function u(){a.visible=!1,a.afterClose=function(){e.afterClose&&e.afterClose(),l()},r(a)}return a.onOk=function(){var n,t=e.onOk||e.onConfirm;t&&(n=t()),n&&n.then&&(a.confirmLoading=!0,r(a),n.then((function(){i(!0)}),(function(e){console.error(e),a.confirmLoading=!1,r(a)}))),n||i(!0)},(a=k(a)).visible=!0,r(a),h.push(u),{close:u,update:function(n){a=g(g(g({},a),{title:e.title}),n),a=k(a),r(a)}}},w=t(3),N=t(238),P=t(23),S=t(2),T=t(9),R=t(215),I=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,a=t.call(e),c=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return c},M=function(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))},L=Object(a.forwardRef)((function(e,n){var t=I(Object(a.useState)([]),2),r=t[0],o=t[1];function l(e){o((function(n){return M(M([],I(n),!1),[e],!1)}))}function i(e){o((function(n){return n.filter((function(n){return e!==n}))}))}return Object(a.useImperativeHandle)(n,(function(){return{addInstance:l,removeInstance:i}})),c.a.createElement(c.a.Fragment,null,r)})),F=function(){return(F=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},B=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,a=t.call(e),c=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return c};var z=Object(a.forwardRef)((function(e,n){var t=B(Object(a.useState)(!0),2),r=t[0],o=t[1],l=B(Object(a.useState)(e),2),i=l[0],u=l[1];return Object(a.useImperativeHandle)(n,(function(){return{update:u,close:function(){o(!1)}}})),c.a.createElement(K,F({},i,{simple:!0,visible:r,onOk:function(){var e=i.onOk&&i.onOk();e&&e.then&&(u(F(F({},i),{confirmLoading:!0})),e.then((function(){o(!1)}),(function(e){console.error(e),u(F(F({},i),{confirmLoading:!1}))}))),e||o(!1)},onCancel:function(){i.onCancel&&i.onCancel(),o(!1)},unmountOnExit:!0}),i.content)})),A=function(){return(A=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var D=function(){var e=Object(a.createRef)(),n=c.a.createElement(L,{ref:e}),t=0;function r(n){var r;t+=1;var o=Object(a.createRef)();var l=c.a.createElement(z,A({key:t,ref:o},k(n),{afterClose:function(){n.afterClose&&n.afterClose(),e.current.removeInstance(l)}}));function i(){o.current.close()}return e.current.addInstance(l),h.push(i),{close:i,update:null===(r=o.current)||void 0===r?void 0:r.update}}var o={confirm:function(e){return r(A({},e))}};return["info","success","warning","error"].forEach((function(e){o[e]=function(n){return r(A(A({},n),{isNotice:!0,noticeType:e}))}})),[o,n]},H=t(10),J=t(7),U=function(){return(U=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},V=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t},X=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,a=t.call(e),c=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return c},Y=null;s.b||document.documentElement.addEventListener("click",(function(e){Y={left:e.clientX,top:e.clientY},setTimeout((function(){Y=null}),100)}),!0);var q={mask:!0,maskClosable:!0,mountOnEnter:!0,escToExit:!0,getPopupContainer:function(){return document.body},alignCenter:!0};var G=Object(a.forwardRef)((function(e,n){var t,o,v,b=Object(a.useContext)(w.a),y=Object(J.a)(e,q,null===(v=b.componentConfig)||void 0===v?void 0:v.Modal),O=y.className,C=y.style,E=y.visible,h=y.simple,g=y.title,j=y.children,k=y.cancelText,x=y.okText,I=y.okButtonProps,M=y.cancelButtonProps,L=y.getPopupContainer,F=void 0===L?function(){return document.body}:L,B=y.footer,z=y.afterClose,A=y.confirmLoading,D=y.mountOnEnter,G=y.unmountOnExit,K=y.afterOpen,Q=y.hideCancel,W=y.autoFocus,Z=y.focusLock,$=y.maskClosable,_=y.mask,ee=y.alignCenter,ne=y.getChildrenPopupContainer,te=y.wrapClassName,re=y.escToExit,oe=y.modalRender,ae=y.maskStyle,ce=y.wrapStyle,le=y.closeIcon,ie=V(y,["className","style","visible","simple","title","children","cancelText","okText","okButtonProps","cancelButtonProps","getPopupContainer","footer","afterClose","confirmLoading","mountOnEnter","unmountOnExit","afterOpen","hideCancel","autoFocus","focusLock","maskClosable","mask","alignCenter","getChildrenPopupContainer","wrapClassName","escToExit","modalRender","maskStyle","wrapStyle","closeIcon"]),ue=Object(a.useRef)(null),fe=Object(a.useRef)(null),se=Object(a.useRef)(!1),pe=X(Object(a.useState)(E),2),me=pe[0],de=pe[1],ve=X(Object(a.useState)(),2),be=ve[0],ye=ve[1],Oe=Object(a.useRef)(null),Ce=Object(a.useRef)(!1),Ee=Object(a.useRef)(!1),he=X(Object(H.a)(!1,{defaultValue:!1,value:A}),2),ge=he[0],je=he[1],ke=b.getPrefixCls("modal",y.prefixCls),xe=Object(N.a)(),we=!h,Ne="closable"in y?y.closable:we,Pe=Object(a.useCallback)((function(){return Object(r.findDOMNode)(F())}),[F]);Object(R.a)(Pe,{hidden:E&&_});var Se=function(){y.onCancel&&y.onCancel()},Te=Object(a.useRef)(!1),Re=function(e){var n,t=y.onConfirm,r=y.onOk||t;r&&(n=r(e)),n&&n.then&&(je(!0),n.then((function(){je(!1)}),(function(e){je(!1),console.error(e)})))};Object(a.useEffect)((function(){var e=function(e){re&&e&&e.key===p.g.key&&Se()};return E&&!se.current&&(se.current=!0,Object(s.d)(document,"keydown",e)),function(){se.current=!1,Object(s.c)(document,"keydown",e)}}),[E,re]),Object(a.useEffect)((function(){var e;if(E&&void 0===be&&ue.current){var n=+(null===(e=window.getComputedStyle(ue.current,null))||void 0===e?void 0:e.zIndex);isNaN(n)||ye(n+1)}}),[E,be]);var Ie=b.focusLock.modal,Me=!!Ie,Le=Object(S.e)(Ie)&&Ie.autoFocus,Fe=void 0!==Z?Z:Me,Be=void 0!==W?W:Le,ze=c.a.createElement(w.b,U({},b,{prefixCls:y.prefixCls||b.prefixCls,locale:xe,zIndex:be||1050,getPopupContainer:function(e){return"function"==typeof ne?ne(e):fe.current}}),g&&c.a.createElement("div",{className:ke+"-header"},c.a.createElement("div",{className:ke+"-title"},g)),c.a.createElement("div",{ref:fe,className:ke+"-content"},j),function(){if(null!==B){var e=c.a.createElement(m.a,U({onClick:Se},M),k||xe.Modal.cancelText),n=c.a.createElement(m.a,U({loading:ge,onClick:Re,type:"primary"},I),x||xe.Modal.okText),t=B||c.a.createElement(c.a.Fragment,null,!Q&&e,n);return Object(S.c)(B)&&(t=B(e,n)),c.a.createElement("div",{className:ke+"-footer"},t)}}(),Ne&&(void 0!==le?c.a.createElement("span",{onClick:Se,className:ke+"-close-icon"},le):c.a.createElement(P.a,{tabIndex:-1,onClick:Se,className:ke+"-close-icon"},c.a.createElement(u.a,null)))),Ae=c.a.createElement("div",{className:Object(f.a)(ke,(t={},t[ke+"-simple"]=h,t),O),style:C},Fe?c.a.createElement(i.a,{disabled:!E,autoFocus:Be},ze):ze),De=function(e){if(!Ce.current){var n="";if(Oe.current){var t=e.getBoundingClientRect(),r=Oe.current,o=r.left,a=r.top;n=o-t.left+"px "+(a-t.top)+"px"}e.style.transformOrigin=n}};return c.a.createElement(d.a,{visible:E,forceRender:!D,getContainer:F},c.a.createElement("div",{ref:n},_?c.a.createElement(l.a,{in:E,timeout:400,appear:!0,mountOnEnter:D,classNames:"fadeModal",unmountOnExit:G,onEnter:function(e){e.style.display="block"},onExited:function(e){e.style.display="none"}},c.a.createElement("div",{className:ke+"-mask",style:ae})):null,c.a.createElement("div",U({role:"dialog","aria-hidden":"true"},Object(T.a)(ie,["content","icon","showIcon","isNotice","noticeType","onCancel","onOk","onConfirm","closable","prefixCls"]),{ref:ue,className:Object(f.a)(ke+"-wrapper",(o={},o[ke+"-wrapper-no-mask"]=!_,o[ke+"-wrapper-align-center"]=ee,o),te),style:U(U({},ce||{}),{display:E||me?"block":"none",overflow:!E&&me?"hidden":""}),onMouseDown:function(e){Ee.current=e.target===e.currentTarget},onClick:function(e){Ee.current&&(Ee.current=!1,!Te.current&&$&&_&&e.target===e.currentTarget&&setTimeout((function(){Se()}),100))}}),c.a.createElement(l.a,{in:E,timeout:400,appear:!0,classNames:"zoomModal",unmountOnExit:G,mountOnEnter:D,onEnter:function(e){de(!0),Oe.current=Y,Ce.current=!!e.style.transformOrigin,De(e)},onEntered:function(e){De(e),Oe.current=null,K&&K()},onExit:function(){Te.current=!0},onExited:function(e){de(!1),De(e),z&&z(),Te.current=!1}},c.a.createElement(w.b,U({},b,{prefixCls:y.prefixCls||b.prefixCls,locale:xe,zIndex:be||1050,getPopupContainer:function(e){return"function"==typeof ne?ne(e):document.body}}),c.a.cloneElement(Object(S.c)(oe)?oe(Ae):Ae,{onMouseDown:function(){Ee.current=!1},onMouseUp:function(){Ee.current=!1}}))))))}));G.displayName="Modal",G.config=function(e){E=C(C({},E),e)},G.confirm=function(e){return x(e)},G.useModal=D,["info","success","warning","error"].forEach((function(e){G[e]=function(n){return x(U(U({},n),{isNotice:!0,noticeType:e}))}})),G.destroyAll=function(){for(;h.length;){var e=h.pop();e&&e()}};var K=G;n.a=K},676:function(e,n,t){}}]);