You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
28 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[60],{55060:function(In,rt,h){h.d(rt,{Z:function(){return wn}});var o=h(67294),it=h(1208),st=h(93967),ee=h.n(st),K=h(87462),N=h(1413),te=h(4942),A=h(97685),Ye=h(71002),de=h(91),Ee=h(27678),Ne=h(21770),Te=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"],we=o.createContext(null),Xe=0;function lt(t,e){var n=o.useState(function(){return Xe+=1,String(Xe)}),a=(0,A.Z)(n,1),r=a[0],i=o.useContext(we),f={data:e,canPreview:t};return o.useEffect(function(){if(i)return i.register(r,f)},[]),o.useEffect(function(){i&&i.register(r,f)},[t,e]),r}function ct(t){return new Promise(function(e){var n=document.createElement("img");n.onerror=function(){return e(!1)},n.onload=function(){return e(!0)},n.src=t})}function ke(t){var e=t.src,n=t.isCustomPlaceholder,a=t.fallback,r=(0,o.useState)(n?"loading":"normal"),i=(0,A.Z)(r,2),f=i[0],s=i[1],u=(0,o.useRef)(!1),v=f==="error";(0,o.useEffect)(function(){var p=!0;return ct(e).then(function(m){!m&&p&&s("error")}),function(){p=!1}},[e]),(0,o.useEffect)(function(){n&&!u.current?s("loading"):v&&s("normal")},[e]);var w=function(){s("normal")},l=function(m){u.current=!1,f==="loading"&&m!==null&&m!==void 0&&m.complete&&(m.naturalWidth||m.naturalHeight)&&(u.current=!0,w())},x=v&&a?{src:a}:{onLoad:w,src:e};return[l,x,f]}var ut=h(40974),me=h(64019),Le=h(15105),vt=h(91881),ft=h(75164),Ze={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function dt(t,e,n,a){var r=(0,o.useRef)(null),i=(0,o.useRef)([]),f=(0,o.useState)(Ze),s=(0,A.Z)(f,2),u=s[0],v=s[1],w=function(m){v(Ze),a&&!(0,vt.Z)(Ze,u)&&a({transform:Ze,action:m})},l=function(m,y){r.current===null&&(i.current=[],r.current=(0,ft.Z)(function(){v(function(S){var Z=S;return i.current.forEach(function(P){Z=(0,N.Z)((0,N.Z)({},Z),P)}),r.current=null,a==null||a({transform:Z,action:y}),Z})})),i.current.push((0,N.Z)((0,N.Z)({},u),m))},x=function(m,y,S,Z,P){var L=t.current,M=L.width,c=L.height,R=L.offsetWidth,g=L.offsetHeight,d=L.offsetLeft,I=L.offsetTop,b=m,C=u.scale*m;C>n?(C=n,b=n/u.scale):C<e&&(C=P?C:e,b=C/u.scale);var E=S!=null?S:innerWidth/2,D=Z!=null?Z:innerHeight/2,z=b-1,Y=z*M*.5,H=z*c*.5,W=z*(E-u.x-d),X=z*(D-u.y-I),G=u.x-(W-Y),F=u.y-(X-H);if(m<1&&C===1){var Q=R*C,J=g*C,oe=(0,Ee.g1)(),ie=oe.width,k=oe.height;Q<=ie&&J<=k&&(G=0,F=0)}l({x:G,y:F,scale:C},y)};return{transform:u,resetTransform:w,updateTransform:l,dispatchZoomChange:x}}var mt=h(80334);function He(t,e,n,a){var r=e+n,i=(n-a)/2;if(n>a){if(e>0)return(0,te.Z)({},t,i);if(e<0&&r<a)return(0,te.Z)({},t,-i)}else if(e<0||r>a)return(0,te.Z)({},t,e<0?i:-i);return{}}function Be(t,e,n,a){var r=(0,Ee.g1)(),i=r.width,f=r.height,s=null;return t<=i&&e<=f?s={x:0,y:0}:(t>i||e>f)&&(s=(0,N.Z)((0,N.Z)({},He("x",n,t,i)),He("y",a,e,f))),s}var ge=1,gt=1;function ht(t,e,n,a,r,i,f){var s=r.rotate,u=r.scale,v=r.x,w=r.y,l=(0,o.useState)(!1),x=(0,A.Z)(l,2),p=x[0],m=x[1],y=(0,o.useRef)({diffX:0,diffY:0,transformX:0,transformY:0}),S=function(c){!e||c.button!==0||(c.preventDefault(),c.stopPropagation(),y.current={diffX:c.pageX-v,diffY:c.pageY-w,transformX:v,transformY:w},m(!0))},Z=function(c){n&&p&&i({x:c.pageX-y.current.diffX,y:c.pageY-y.current.diffY},"move")},P=function(){if(n&&p){m(!1);var c=y.current,R=c.transformX,g=c.transformY,d=v!==R&&w!==g;if(!d)return;var I=t.current.offsetWidth*u,b=t.current.offsetHeight*u,C=t.current.getBoundingClientRect(),E=C.left,D=C.top,z=s%180!==0,Y=Be(z?b:I,z?I:b,E,D);Y&&i((0,N.Z)({},Y),"dragRebound")}},L=function(c){if(!(!n||c.deltaY==0)){var R=Math.abs(c.deltaY/100),g=Math.min(R,gt),d=ge+g*a;c.deltaY>0&&(d=ge/d),f(d,"wheel",c.clientX,c.clientY)}};return(0,o.useEffect)(function(){var M,c,R,g;if(e){R=(0,me.Z)(window,"mouseup",P,!1),g=(0,me.Z)(window,"mousemove",Z,!1);try{window.top!==window.self&&(M=(0,me.Z)(window.top,"mouseup",P,!1),c=(0,me.Z)(window.top,"mousemove",Z,!1))}catch(d){(0,mt.Kp)(!1,"[rc-image] ".concat(d))}}return function(){var d,I,b,C;(d=R)===null||d===void 0||d.remove(),(I=g)===null||I===void 0||I.remove(),(b=M)===null||b===void 0||b.remove(),(C=c)===null||C===void 0||C.remove()}},[n,p,v,w,s,e]),{isMoving:p,onMouseDown:S,onMouseMove:Z,onMouseUp:P,onWheel:L}}function Re(t,e){var n=t.x-e.x,a=t.y-e.y;return Math.hypot(n,a)}function pt(t,e,n,a){var r=Re(t,n),i=Re(e,a);if(r===0&&i===0)return[t.x,t.y];var f=r/(r+i),s=t.x+f*(e.x-t.x),u=t.y+f*(e.y-t.y);return[s,u]}function Ct(t,e,n,a,r,i,f){var s=r.rotate,u=r.scale,v=r.x,w=r.y,l=(0,o.useState)(!1),x=(0,A.Z)(l,2),p=x[0],m=x[1],y=(0,o.useRef)({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),S=function(c){y.current=(0,N.Z)((0,N.Z)({},y.current),c)},Z=function(c){if(e){c.stopPropagation(),m(!0);var R=c.touches,g=R===void 0?[]:R;g.length>1?S({point1:{x:g[0].clientX,y:g[0].clientY},point2:{x:g[1].clientX,y:g[1].clientY},eventType:"touchZoom"}):S({point1:{x:g[0].clientX-v,y:g[0].clientY-w},eventType:"move"})}},P=function(c){var R=c.touches,g=R===void 0?[]:R,d=y.current,I=d.point1,b=d.point2,C=d.eventType;if(g.length>1&&C==="touchZoom"){var E={x:g[0].clientX,y:g[0].clientY},D={x:g[1].clientX,y:g[1].clientY},z=pt(I,b,E,D),Y=(0,A.Z)(z,2),H=Y[0],W=Y[1],X=Re(E,D)/Re(I,b);f(X,"touchZoom",H,W,!0),S({point1:E,point2:D,eventType:"touchZoom"})}else C==="move"&&(i({x:g[0].clientX-I.x,y:g[0].clientY-I.y},"move"),S({eventType:"move"}))},L=function(){if(n){if(p&&m(!1),S({eventType:"none"}),a>u)return i({x:0,y:0,scale:a},"touchZoom");var c=t.current.offsetWidth*u,R=t.current.offsetHeight*u,g=t.current.getBoundingClientRect(),d=g.left,I=g.top,b=s%180!==0,C=Be(b?R:c,b?c:R,d,I);C&&i((0,N.Z)({},C),"dragRebound")}};return(0,o.useEffect)(function(){var M;return n&&e&&(M=(0,me.Z)(window,"touchmove",function(c){return c.preventDefault()},{passive:!1})),function(){var c;(c=M)===null||c===void 0||c.remove()}},[n,e]),{isTouching:p,onTouchStart:Z,onTouchMove:P,onTouchEnd:L}}var wt=h(2788),St=h(82225),xt=function(e){var n=e.visible,a=e.maskTransitionName,r=e.getContainer,i=e.prefixCls,f=e.rootClassName,s=e.icons,u=e.countRender,v=e.showSwitch,w=e.showProgress,l=e.current,x=e.transform,p=e.count,m=e.scale,y=e.minScale,S=e.maxScale,Z=e.closeIcon,P=e.onSwitchLeft,L=e.onSwitchRight,M=e.onClose,c=e.onZoomIn,R=e.onZoomOut,g=e.onRotateRight,d=e.onRotateLeft,I=e.onFlipX,b=e.onFlipY,C=e.toolbarRender,E=e.zIndex,D=(0,o.useContext)(we),z=s.rotateLeft,Y=s.rotateRight,H=s.zoomIn,W=s.zoomOut,X=s.close,G=s.left,F=s.right,Q=s.flipX,J=s.flipY,oe="".concat(i,"-operations-operation");o.useEffect(function(){var T=function(O){O.keyCode===Le.Z.ESC&&M()};return n&&window.addEventListener("keydown",T),function(){window.removeEventListener("keydown",T)}},[n]);var ie=[{icon:J,onClick:b,type:"flipY"},{icon:Q,onClick:I,type:"flipX"},{icon:z,onClick:d,type:"rotateLeft"},{icon:Y,onClick:g,type:"rotateRight"},{icon:W,onClick:R,type:"zoomOut",disabled:m<=y},{icon:H,onClick:c,type:"zoomIn",disabled:m===S}],k=ie.map(function(T){var j,O=T.icon,ne=T.onClick,B=T.type,V=T.disabled;return o.createElement("div",{className:ee()(oe,(j={},(0,te.Z)(j,"".concat(i,"-operations-operation-").concat(B),!0),(0,te.Z)(j,"".concat(i,"-operations-operation-disabled"),!!V),j)),onClick:ne,key:B},O)}),U=o.createElement("div",{className:"".concat(i,"-operations")},k);return o.createElement(St.ZP,{visible:n,motionName:a},function(T){var j=T.className,O=T.style;return o.createElement(wt.Z,{open:!0,getContainer:r!=null?r:document.body},o.createElement("div",{className:ee()("".concat(i,"-operations-wrapper"),j,f),style:(0,N.Z)((0,N.Z)({},O),{},{zIndex:E})},Z===null?null:o.createElement("button",{className:"".concat(i,"-close"),onClick:M},Z||X),v&&o.createElement(o.Fragment,null,o.createElement("div",{className:ee()("".concat(i,"-switch-left"),(0,te.Z)({},"".concat(i,"-switch-left-disabled"),l===0)),onClick:P},G),o.createElement("div",{className:ee()("".concat(i,"-switch-right"),(0,te.Z)({},"".concat(i,"-switch-right-disabled"),l===p-1)),onClick:L},F)),o.createElement("div",{className:"".concat(i,"-footer")},w&&o.createElement("div",{className:"".concat(i,"-progress")},u?u(l+1,p):"".concat(l+1," / ").concat(p)),C?C(U,(0,N.Z)({icons:{flipYIcon:k[0],flipXIcon:k[1],rotateLeftIcon:k[2],rotateRightIcon:k[3],zoomOutIcon:k[4],zoomInIcon:k[5]},actions:{onFlipY:b,onFlipX:I,onRotateLeft:d,onRotateRight:g,onZoomOut:R,onZoomIn:c},transform:x},D?{current:l,total:p}:{})):U)))})},It=xt,yt=["fallback","src","imgRef"],bt=["prefixCls","src","alt","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],Zt=function(e){var n=e.fallback,a=e.src,r=e.imgRef,i=(0,de.Z)(e,yt),f=ke({src:a,fallback:n}),s=(0,A.Z)(f,2),u=s[0],v=s[1];return o.createElement("img",(0,K.Z)({ref:function(l){r.current=l,u(l)}},i,v))},Rt=function(e){var n=e.prefixCls,a=e.src,r=e.alt,i=e.fallback,f=e.movable,s=f===void 0?!0:f,u=e.onClose,v=e.visible,w=e.icons,l=w===void 0?{}:w,x=e.rootClassName,p=e.closeIcon,m=e.getContainer,y=e.current,S=y===void 0?0:y,Z=e.count,P=Z===void 0?1:Z,L=e.countRender,M=e.scaleStep,c=M===void 0?.5:M,R=e.minScale,g=R===void 0?1:R,d=e.maxScale,I=d===void 0?50:d,b=e.transitionName,C=b===void 0?"zoom":b,E=e.maskTransitionName,D=E===void 0?"fade":E,z=e.imageRender,Y=e.imgCommonProps,H=e.toolbarRender,W=e.onTransform,X=e.onChange,G=(0,de.Z)(e,bt),F=(0,o.useRef)(),Q=(0,o.useContext)(we),J=Q&&P>1,oe=Q&&P>=1,ie=(0,o.useState)(!0),k=(0,A.Z)(ie,2),U=k[0],T=k[1],j=dt(F,g,I,W),O=j.transform,ne=j.resetTransform,B=j.updateTransform,V=j.dispatchZoomChange,le=ht(F,s,v,c,O,B,V),xe=le.isMoving,he=le.onMouseDown,Ie=le.onWheel,q=Ct(F,s,v,g,O,B,V),ae=q.isTouching,re=q.onTouchStart,ce=q.onTouchMove,se=q.onTouchEnd,ye=O.rotate,pe=O.scale,Ce=ee()((0,te.Z)({},"".concat(n,"-moving"),xe));(0,o.useEffect)(function(){U||T(!0)},[U]);var je=function(){ne("close")},Ae=function(){V(ge+c,"zoomIn")},De=function(){V(ge/(ge+c),"zoomOut")},ue=function(){B({rotate:ye+90},"rotateRight")},ve=function(){B({rotate:ye-90},"rotateLeft")},Oe=function(){B({flipX:!O.flipX},"flipX")},Pe=function(){B({flipY:!O.flipY},"flipY")},be=function($){$==null||$.preventDefault(),$==null||$.stopPropagation(),S>0&&(T(!1),ne("prev"),X==null||X(S-1,S))},ot=function($){$==null||$.preventDefault(),$==null||$.stopPropagation(),S<P-1&&(T(!1),ne("next"),X==null||X(S+1,S))},Sn=function($){!v||!J||($.keyCode===Le.Z.LEFT?be():$.keyCode===Le.Z.RIGHT&&ot())},xn=function($){v&&(pe!==1?B({x:0,y:0,scale:1},"doubleClick"):V(ge+c,"doubleClick",$.clientX,$.clientY))};(0,o.useEffect)(function(){var _=(0,me.Z)(window,"keydown",Sn,!1);return function(){_.remove()}},[v,J,S]);var at=o.createElement(Zt,(0,K.Z)({},Y,{width:e.width,height:e.height,imgRef:F,className:"".concat(n,"-img"),alt:r,style:{transform:"translate3d(".concat(O.x,"px, ").concat(O.y,"px, 0) scale3d(").concat(O.flipX?"-":"").concat(pe,", ").concat(O.flipY?"-":"").concat(pe,", 1) rotate(").concat(ye,"deg)"),transitionDuration:(!U||ae)&&"0s"},fallback:i,src:a,onWheel:Ie,onMouseDown:he,onDoubleClick:xn,onTouchStart:re,onTouchMove:ce,onTouchEnd:se,onTouchCancel:se}));return o.createElement(o.Fragment,null,o.createElement(ut.Z,(0,K.Z)({transitionName:C,maskTransitionName:D,closable:!1,keyboard:!0,prefixCls:n,onClose:u,visible:v,classNames:{wrapper:Ce},rootClassName:x,getContainer:m},G,{afterClose:je}),o.createElement("div",{className:"".concat(n,"-img-wrapper")},z?z(at,(0,N.Z)({transform:O},Q?{current:S}:{})):at)),o.createElement(It,{visible:v,transform:O,maskTransitionName:D,closeIcon:p,getContainer:m,prefixCls:n,rootClassName:x,icons:l,countRender:L,showSwitch:J,showProgress:oe,current:S,count:P,scale:pe,minScale:g,maxScale:I,toolbarRender:H,onSwitchLeft:be,onSwitchRight:ot,onZoomIn:Ae,onZoomOut:De,onRotateRight:ue,onRotateLeft:ve,onFlipX:Oe,onFlipY:Pe,onClose:u,zIndex:G.zIndex!==void 0?G.zIndex+1:void 0}))},Ve=Rt,Mt=h(74902);function Ot(t){var e=o.useState({}),n=(0,A.Z)(e,2),a=n[0],r=n[1],i=o.useCallback(function(s,u){return r(function(v){return(0,N.Z)((0,N.Z)({},v),{},(0,te.Z)({},s,u))}),function(){r(function(v){var w=(0,N.Z)({},v);return delete w[s],w})}},[]),f=o.useMemo(function(){return t?t.map(function(s){if(typeof s=="string")return{data:{src:s}};var u={};return Object.keys(s).forEach(function(v){["src"].concat((0,Mt.Z)(Te)).includes(v)&&(u[v]=s[v])}),{data:u}}):Object.keys(a).reduce(function(s,u){var v=a[u],w=v.canPreview,l=v.data;return w&&s.push({data:l,id:u}),s},[])},[t,a]);return[f,i]}var Pt=["visible","onVisibleChange","getContainer","current","movable","minScale","maxScale","countRender","closeIcon","onChange","onTransform","toolbarRender","imageRender"],Et=["src"],Nt=function(e){var n,a=e.previewPrefixCls,r=a===void 0?"rc-image-preview":a,i=e.children,f=e.icons,s=f===void 0?{}:f,u=e.items,v=e.preview,w=e.fallback,l=(0,Ye.Z)(v)==="object"?v:{},x=l.visible,p=l.onVisibleChange,m=l.getContainer,y=l.current,S=l.movable,Z=l.minScale,P=l.maxScale,L=l.countRender,M=l.closeIcon,c=l.onChange,R=l.onTransform,g=l.toolbarRender,d=l.imageRender,I=(0,de.Z)(l,Pt),b=Ot(u),C=(0,A.Z)(b,2),E=C[0],D=C[1],z=(0,Ne.Z)(0,{value:y}),Y=(0,A.Z)(z,2),H=Y[0],W=Y[1],X=(0,o.useState)(!1),G=(0,A.Z)(X,2),F=G[0],Q=G[1],J=((n=E[H])===null||n===void 0?void 0:n.data)||{},oe=J.src,ie=(0,de.Z)(J,Et),k=(0,Ne.Z)(!!x,{value:x,onChange:function(ae,re){p==null||p(ae,re,H)}}),U=(0,A.Z)(k,2),T=U[0],j=U[1],O=(0,o.useState)(null),ne=(0,A.Z)(O,2),B=ne[0],V=ne[1],le=o.useCallback(function(q,ae,re){var ce=E.findIndex(function(se){return se.id===q});j(!0),V({x:ae,y:re}),W(ce<0?0:ce),Q(!0)},[E]);o.useEffect(function(){T?F||W(0):Q(!1)},[T]);var xe=function(ae,re){W(ae),c==null||c(ae,re)},he=function(){j(!1),V(null)},Ie=o.useMemo(function(){return{register:D,onPreview:le}},[D,le]);return o.createElement(we.Provider,{value:Ie},i,o.createElement(Ve,(0,K.Z)({"aria-hidden":!T,movable:S,visible:T,prefixCls:r,closeIcon:M,onClose:he,mousePosition:B,imgCommonProps:ie,src:oe,fallback:w,icons:s,minScale:Z,maxScale:P,getContainer:m,current:H,count:E.length,countRender:L,onTransform:R,toolbarRender:g,imageRender:d,onChange:xe},I)))},Tt=Nt,Lt=["src","alt","onPreviewClose","prefixCls","previewPrefixCls","placeholder","fallback","width","height","style","preview","className","onClick","onError","wrapperClassName","wrapperStyle","rootClassName"],zt=["src","visible","onVisibleChange","getContainer","mask","maskClassName","movable","icons","scaleStep","minScale","maxScale","imageRender","toolbarRender"],ze=function(e){var n=e.src,a=e.alt,r=e.onPreviewClose,i=e.prefixCls,f=i===void 0?"rc-image":i,s=e.previewPrefixCls,u=s===void 0?"".concat(f,"-preview"):s,v=e.placeholder,w=e.fallback,l=e.width,x=e.height,p=e.style,m=e.preview,y=m===void 0?!0:m,S=e.className,Z=e.onClick,P=e.onError,L=e.wrapperClassName,M=e.wrapperStyle,c=e.rootClassName,R=(0,de.Z)(e,Lt),g=v&&v!==!0,d=(0,Ye.Z)(y)==="object"?y:{},I=d.src,b=d.visible,C=b===void 0?void 0:b,E=d.onVisibleChange,D=E===void 0?r:E,z=d.getContainer,Y=z===void 0?void 0:z,H=d.mask,W=d.maskClassName,X=d.movable,G=d.icons,F=d.scaleStep,Q=d.minScale,J=d.maxScale,oe=d.imageRender,ie=d.toolbarRender,k=(0,de.Z)(d,zt),U=I!=null?I:n,T=(0,Ne.Z)(!!C,{value:C,onChange:D}),j=(0,A.Z)(T,2),O=j[0],ne=j[1],B=ke({src:n,isCustomPlaceholder:g,fallback:w}),V=(0,A.Z)(B,3),le=V[0],xe=V[1],he=V[2],Ie=(0,o.useState)(null),q=(0,A.Z)(Ie,2),ae=q[0],re=q[1],ce=(0,o.useContext)(we),se=!!y,ye=function(){ne(!1),re(null)},pe=ee()(f,L,c,(0,te.Z)({},"".concat(f,"-error"),he==="error")),Ce=(0,o.useMemo)(function(){var ue={};return Te.forEach(function(ve){e[ve]!==void 0&&(ue[ve]=e[ve])}),ue},Te.map(function(ue){return e[ue]})),je=(0,o.useMemo)(function(){return(0,N.Z)((0,N.Z)({},Ce),{},{src:U})},[U,Ce]),Ae=lt(se,je),De=function(ve){var Oe=(0,Ee.os)(ve.target),Pe=Oe.left,be=Oe.top;ce?ce.onPreview(Ae,Pe,be):(re({x:Pe,y:be}),ne(!0)),Z==null||Z(ve)};return o.createElement(o.Fragment,null,o.createElement("div",(0,K.Z)({},R,{className:pe,onClick:se?De:Z,style:(0,N.Z)({width:l,height:x},M)}),o.createElement("img",(0,K.Z)({},Ce,{className:ee()("".concat(f,"-img"),(0,te.Z)({},"".concat(f,"-img-placeholder"),v===!0),S),style:(0,N.Z)({height:x},p),ref:le},xe,{width:l,height:x,onError:P})),he==="loading"&&o.createElement("div",{"aria-hidden":"true",className:"".concat(f,"-placeholder")},v),H&&se&&o.createElement("div",{className:ee()("".concat(f,"-mask"),W),style:{display:(p==null?void 0:p.display)==="none"?"none":void 0}},H)),!ce&&se&&o.createElement(Ve,(0,K.Z)({"aria-hidden":!O,visible:O,prefixCls:u,onClose:ye,mousePosition:ae,src:U,alt:a,fallback:w,getContainer:Y,icons:G,movable:X,scaleStep:F,minScale:Q,maxScale:J,rootClassName:c,imageRender:oe,imgCommonProps:Ce,toolbarRender:ie},k)))};ze.PreviewGroup=Tt,ze.displayName="Image";var $t=ze,We=$t,Ge=h(87263),Me=h(33603),Fe=h(53124),Ue=h(35792),Ke=h(24457),jt=h(62208),At=h(62946),Dt=h(62994),Yt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"},Xt=Yt,Se=h(93771),kt=function(e,n){return o.createElement(Se.Z,(0,K.Z)({},e,{ref:n,icon:Xt}))},Ht=o.forwardRef(kt),Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z"}},{tag:"path",attrs:{d:"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z"}}]},name:"rotate-right",theme:"outlined"},Vt=Bt,Wt=function(e,n){return o.createElement(Se.Z,(0,K.Z)({},e,{ref:n,icon:Vt}))},Gt=o.forwardRef(Wt),Ft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},Ut=Ft,Kt=function(e,n){return o.createElement(Se.Z,(0,K.Z)({},e,{ref:n,icon:Ut}))},Qe=o.forwardRef(Kt),Qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},Jt=Qt,qt=function(e,n){return o.createElement(Se.Z,(0,K.Z)({},e,{ref:n,icon:Jt}))},_t=o.forwardRef(qt),en={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},tn=en,nn=function(e,n){return o.createElement(Se.Z,(0,K.Z)({},e,{ref:n,icon:tn}))},on=o.forwardRef(nn),Je=h(54548),fe=h(10274),an=h(71194),rn=h(14747),sn=h(50438),ln=h(16932),cn=h(91945),qe=h(45503);const $e=t=>({position:t||"absolute",inset:0}),un=t=>{const{iconCls:e,motionDurationSlow:n,paddingXXS:a,marginXXS:r,prefixCls:i,colorTextLightSolid:f}=t;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:f,background:new fe.C("#000").setAlpha(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${n}`,[`.${i}-mask-info`]:Object.assign(Object.assign({},rn.vS),{padding:`0 ${(0,Je.bf)(a)}`,[e]:{marginInlineEnd:r,svg:{verticalAlign:"baseline"}}})}},vn=t=>{const{previewCls:e,modalMaskBg:n,paddingSM:a,marginXL:r,margin:i,paddingLG:f,previewOperationColorDisabled:s,previewOperationHoverColor:u,motionDurationSlow:v,iconCls:w,colorTextLightSolid:l}=t,x=new fe.C(n).setAlpha(.1),p=x.clone().setAlpha(.2);return{[`${e}-footer`]:{position:"fixed",bottom:r,left:{_skip_check_:!0,value:0},width:"100%",display:"flex",flexDirection:"column",alignItems:"center",color:t.previewOperationColor},[`${e}-progress`]:{marginBottom:i},[`${e}-close`]:{position:"fixed",top:r,right:{_skip_check_:!0,value:r},display:"flex",color:l,backgroundColor:x.toRgbString(),borderRadius:"50%",padding:a,outline:0,border:0,cursor:"pointer",transition:`all ${v}`,"&:hover":{backgroundColor:p.toRgbString()},[`& > ${w}`]:{fontSize:t.previewOperationSize}},[`${e}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${(0,Je.bf)(f)}`,backgroundColor:x.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${v}`,userSelect:"none",[`&:not(${e}-operations-operation-disabled):hover > ${w}`]:{color:u},"&-disabled":{color:s,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${w}`]:{fontSize:t.previewOperationSize}}}}},fn=t=>{const{modalMaskBg:e,iconCls:n,previewOperationColorDisabled:a,previewCls:r,zIndexPopup:i,motionDurationSlow:f}=t,s=new fe.C(e).setAlpha(.1),u=s.clone().setAlpha(.2);return{[`${r}-switch-left, ${r}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:t.calc(i).add(1).equal({unit:!1}),display:"flex",alignItems:"center",justifyContent:"center",width:t.imagePreviewSwitchSize,height:t.imagePreviewSwitchSize,marginTop:t.calc(t.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:t.previewOperationColor,background:s.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${f}`,userSelect:"none","&:hover":{background:u.toRgbString()},["&-disabled"]:{"&, &:hover":{color:a,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:t.previewOperationSize}},[`${r}-switch-left`]:{insetInlineStart:t.marginSM},[`${r}-switch-right`]:{insetInlineEnd:t.marginSM}}},dn=t=>{const{motionEaseOut:e,previewCls:n,motionDurationSlow:a,componentCls:r}=t;return[{[`${r}-preview-root`]:{[n]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${n}-body`]:Object.assign(Object.assign({},$e()),{overflow:"hidden"}),[`${n}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${a} ${e} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},$e()),{transition:`transform ${a} ${e} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${r}-preview-root`]:{[`${n}-wrap`]:{zIndex:t.zIndexPopup}}},{[`${r}-preview-operations-wrapper`]:{position:"fixed",zIndex:t.calc(t.zIndexPopup).add(1).equal({unit:!1})},"&":[vn(t),fn(t)]}]},mn=t=>{const{componentCls:e}=t;return{[e]:{position:"relative",display:"inline-block",[`${e}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${e}-img-placeholder`]:{backgroundColor:t.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${e}-mask`]:Object.assign({},un(t)),[`${e}-mask:hover`]:{opacity:1},[`${e}-placeholder`]:Object.assign({},$e())}}},gn=t=>{const{previewCls:e}=t;return{[`${e}-root`]:(0,sn._y)(t,"zoom"),["&"]:(0,ln.J$)(t,!0)}},hn=t=>({zIndexPopup:t.zIndexPopupBase+80,previewOperationColor:new fe.C(t.colorTextLightSolid).setAlpha(.65).toRgbString(),previewOperationHoverColor:new fe.C(t.colorTextLightSolid).setAlpha(.85).toRgbString(),previewOperationColorDisabled:new fe.C(t.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5});var _e=(0,cn.I$)("Image",t=>{const e=`${t.componentCls}-preview`,n=(0,qe.TS)(t,{previewCls:e,modalMaskBg:new fe.C("#000").setAlpha(.45).toRgbString(),imagePreviewSwitchSize:t.controlHeightLG});return[mn(n),dn(n),(0,an.QA)((0,qe.TS)(n,{componentCls:e})),gn(n)]},hn),pn=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(n[a[r]]=t[a[r]]);return n};const et={rotateLeft:o.createElement(Ht,null),rotateRight:o.createElement(Gt,null),zoomIn:o.createElement(_t,null),zoomOut:o.createElement(on,null),close:o.createElement(jt.Z,null),left:o.createElement(At.Z,null),right:o.createElement(Dt.Z,null),flipX:o.createElement(Qe,null),flipY:o.createElement(Qe,{rotate:90})};var Cn=t=>{var{previewPrefixCls:e,preview:n}=t,a=pn(t,["previewPrefixCls","preview"]);const{getPrefixCls:r}=o.useContext(Fe.E_),i=r("image",e),f=`${i}-preview`,s=r(),u=(0,Ue.Z)(i),[v,w,l]=_e(i,u),[x]=(0,Ge.Cn)("ImagePreview",typeof n=="object"?n.zIndex:void 0),p=o.useMemo(()=>{var m;if(n===!1)return n;const y=typeof n=="object"?n:{},S=ee()(w,l,u,(m=y.rootClassName)!==null&&m!==void 0?m:"");return Object.assign(Object.assign({},y),{transitionName:(0,Me.m)(s,"zoom",y.transitionName),maskTransitionName:(0,Me.m)(s,"fade",y.maskTransitionName),rootClassName:S,zIndex:x})},[n]);return v(o.createElement(We.PreviewGroup,Object.assign({preview:p,previewPrefixCls:f,icons:et},a)))},tt=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(n[a[r]]=t[a[r]]);return n};const nt=t=>{var e;const{prefixCls:n,preview:a,className:r,rootClassName:i,style:f}=t,s=tt(t,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:u,locale:v=Ke.Z,getPopupContainer:w,image:l}=o.useContext(Fe.E_),x=u("image",n),p=u(),m=v.Image||Ke.Z.Image,y=(0,Ue.Z)(x),[S,Z,P]=_e(x,y),L=ee()(i,Z,P,y),M=ee()(r,Z,l==null?void 0:l.className),[c]=(0,Ge.Cn)("ImagePreview",typeof a=="object"?a.zIndex:void 0),R=o.useMemo(()=>{var d;if(a===!1)return a;const I=typeof a=="object"?a:{},{getContainer:b,closeIcon:C}=I,E=tt(I,["getContainer","closeIcon"]);return Object.assign(Object.assign({mask:o.createElement("div",{className:`${x}-mask-info`},o.createElement(it.Z,null),m==null?void 0:m.preview),icons:et},E),{getContainer:b!=null?b:w,transitionName:(0,Me.m)(p,"zoom",I.transitionName),maskTransitionName:(0,Me.m)(p,"fade",I.maskTransitionName),zIndex:c,closeIcon:C!=null?C:(d=l==null?void 0:l.preview)===null||d===void 0?void 0:d.closeIcon})},[a,m,(e=l==null?void 0:l.preview)===null||e===void 0?void 0:e.closeIcon]),g=Object.assign(Object.assign({},l==null?void 0:l.style),f);return S(o.createElement(We,Object.assign({prefixCls:x,preview:R,rootClassName:L,className:M,style:g},s)))};nt.PreviewGroup=Cn;var wn=nt}}]);