"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[903],{15746:function(Ye,Ie,m){var o=m(21584);Ie.Z=o.Z},15241:function(Ye,Ie,m){m.d(Ie,{Z:function(){return dn}});var o=m(67294),ft=m(99611),vt=m(93967),q=m.n(vt),he=m(87462),R=m(1413),ie=m(4942),D=m(97685),ke=m(71002),we=m(45987),We=/margin|padding|width|height|max|min|offset/,Te={left:!0,top:!0},Fe={cssFloat:1,styleFloat:1,float:1};function He(t){return t.nodeType===1?t.ownerDocument.defaultView.getComputedStyle(t,null):{}}function dt(t,e,n){if(e=e.toLowerCase(),n==="auto"){if(e==="height")return t.offsetHeight;if(e==="width")return t.offsetWidth}return e in Te||(Te[e]=We.test(e)),Te[e]?parseFloat(n)||0:n}function Cn(t,e){var n=arguments.length,r=He(t);return e=Fe[e]?"cssFloat"in t.style?"cssFloat":"styleFloat":e,n===1?r:dt(t,e,r[e]||t.style[e])}function mt(t,e,n){var r=arguments.length;if(e=Fe[e]?"cssFloat"in t.style?"cssFloat":"styleFloat":e,r===3)return typeof n=="number"&&We.test(e)&&(n="".concat(n,"px")),t.style[e]=n,n;for(var a in e)e.hasOwnProperty(a)&&mt(t,a,e[a]);return He(t)}function pn(t){return t===document.body?document.documentElement.clientWidth:t.offsetWidth}function wn(t){return t===document.body?window.innerHeight||document.documentElement.clientHeight:t.offsetHeight}function Sn(){var t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:t,height:e}}function Be(){var t=document.documentElement.clientWidth,e=window.innerHeight||document.documentElement.clientHeight;return{width:t,height:e}}function xn(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function gt(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var Oe=m(21770),ht=m(40974),Se=m(64019),Le=m(15105),Ct=m(2788),pt=m(29372),ye=o.createContext(null),wt=function(e){var n=e.visible,r=e.maskTransitionName,a=e.getContainer,i=e.prefixCls,f=e.rootClassName,s=e.icons,u=e.countRender,d=e.showSwitch,h=e.showProgress,l=e.current,x=e.transform,g=e.count,p=e.scale,I=e.minScale,P=e.maxScale,S=e.closeIcon,T=e.onActive,M=e.onClose,E=e.onZoomIn,c=e.onZoomOut,y=e.onRotateRight,C=e.onRotateLeft,v=e.onFlipX,b=e.onFlipY,Z=e.onReset,w=e.toolbarRender,N=e.zIndex,X=e.image,O=(0,o.useContext)(ye),k=s.rotateLeft,B=s.rotateRight,G=s.zoomIn,V=s.zoomOut,_=s.close,H=s.left,U=s.right,ee=s.flipX,K=s.flipY,se="".concat(i,"-operations-operation");o.useEffect(function(){var A=function(z){z.keyCode===Le.Z.ESC&&M()};return n&&window.addEventListener("keydown",A),function(){window.removeEventListener("keydown",A)}},[n]);var te=function($,z){$.preventDefault(),$.stopPropagation(),T(z)},j=o.useCallback(function(A){var $=A.type,z=A.disabled,F=A.onClick,Y=A.icon;return o.createElement("div",{key:$,className:q()(se,"".concat(i,"-operations-operation-").concat($),(0,ie.Z)({},"".concat(i,"-operations-operation-disabled"),!!z)),onClick:F},Y)},[se,i]),le=d?j({icon:H,onClick:function($){return te($,-1)},type:"prev",disabled:l===0}):void 0,ne=d?j({icon:U,onClick:function($){return te($,1)},type:"next",disabled:l===g-1}):void 0,Q=j({icon:K,onClick:b,type:"flipY"}),L=j({icon:ee,onClick:v,type:"flipX"}),re=j({icon:k,onClick:C,type:"rotateLeft"}),W=j({icon:B,onClick:y,type:"rotateRight"}),J=j({icon:V,onClick:c,type:"zoomOut",disabled:p<=I}),ae=j({icon:G,onClick:E,type:"zoomIn",disabled:p===P}),ce=o.createElement("div",{className:"".concat(i,"-operations")},Q,L,re,W,J,ae);return o.createElement(pt.ZP,{visible:n,motionName:r},function(A){var $=A.className,z=A.style;return o.createElement(Ct.Z,{open:!0,getContainer:a!=null?a:document.body},o.createElement("div",{className:q()("".concat(i,"-operations-wrapper"),$,f),style:(0,R.Z)((0,R.Z)({},z),{},{zIndex:N})},S===null?null:o.createElement("button",{className:"".concat(i,"-close"),onClick:M},S||_),d&&o.createElement(o.Fragment,null,o.createElement("div",{className:q()("".concat(i,"-switch-left"),(0,ie.Z)({},"".concat(i,"-switch-left-disabled"),l===0)),onClick:function(Y){return te(Y,-1)}},H),o.createElement("div",{className:q()("".concat(i,"-switch-right"),(0,ie.Z)({},"".concat(i,"-switch-right-disabled"),l===g-1)),onClick:function(Y){return te(Y,1)}},U)),o.createElement("div",{className:"".concat(i,"-footer")},h&&o.createElement("div",{className:"".concat(i,"-progress")},u?u(l+1,g):"".concat(l+1," / ").concat(g)),w?w(ce,(0,R.Z)((0,R.Z)({icons:{prevIcon:le,nextIcon:ne,flipYIcon:Q,flipXIcon:L,rotateLeftIcon:re,rotateRightIcon:W,zoomOutIcon:J,zoomInIcon:ae},actions:{onActive:T,onFlipY:b,onFlipX:v,onRotateLeft:C,onRotateRight:y,onZoomOut:c,onZoomIn:E,onReset:Z,onClose:M},transform:x},O?{current:l,total:g}:{}),{},{image:X})):ce)))})},St=wt,xt=m(91881),It=m(75164),be={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function yt(t,e,n,r){var a=(0,o.useRef)(null),i=(0,o.useRef)([]),f=(0,o.useState)(be),s=(0,D.Z)(f,2),u=s[0],d=s[1],h=function(p){d(be),(0,xt.Z)(be,u)||r==null||r({transform:be,action:p})},l=function(p,I){a.current===null&&(i.current=[],a.current=(0,It.Z)(function(){d(function(P){var S=P;return i.current.forEach(function(T){S=(0,R.Z)((0,R.Z)({},S),T)}),a.current=null,r==null||r({transform:S,action:I}),S})})),i.current.push((0,R.Z)((0,R.Z)({},u),p))},x=function(p,I,P,S,T){var M=t.current,E=M.width,c=M.height,y=M.offsetWidth,C=M.offsetHeight,v=M.offsetLeft,b=M.offsetTop,Z=p,w=u.scale*p;w>n?(w=n,Z=n/u.scale):w<e&&(w=T?w:e,Z=w/u.scale);var N=P!=null?P:innerWidth/2,X=S!=null?S:innerHeight/2,O=Z-1,k=O*E*.5,B=O*c*.5,G=O*(N-u.x-v),V=O*(X-u.y-b),_=u.x-(G-k),H=u.y-(V-B);if(p<1&&w===1){var U=y*w,ee=C*w,K=Be(),se=K.width,te=K.height;U<=se&&ee<=te&&(_=0,H=0)}l({x:_,y:H,scale:w},I)};return{transform:u,resetTransform:h,updateTransform:l,dispatchZoomChange:x}}var bt=m(80334);function Ge(t,e,n,r){var a=e+n,i=(n-r)/2;if(n>r){if(e>0)return(0,ie.Z)({},t,i);if(e<0&&a<r)return(0,ie.Z)({},t,-i)}else if(e<0||a>r)return(0,ie.Z)({},t,e<0?i:-i);return{}}function Ve(t,e,n,r){var a=Be(),i=a.width,f=a.height,s=null;return t<=i&&e<=f?s={x:0,y:0}:(t>i||e>f)&&(s=(0,R.Z)((0,R.Z)({},Ge("x",n,t,i)),Ge("y",r,e,f))),s}var xe=1,Zt=1;function Pt(t,e,n,r,a,i,f){var s=a.rotate,u=a.scale,d=a.x,h=a.y,l=(0,o.useState)(!1),x=(0,D.Z)(l,2),g=x[0],p=x[1],I=(0,o.useRef)({diffX:0,diffY:0,transformX:0,transformY:0}),P=function(c){!e||c.button!==0||(c.preventDefault(),c.stopPropagation(),I.current={diffX:c.pageX-d,diffY:c.pageY-h,transformX:d,transformY:h},p(!0))},S=function(c){n&&g&&i({x:c.pageX-I.current.diffX,y:c.pageY-I.current.diffY},"move")},T=function(){if(n&&g){p(!1);var c=I.current,y=c.transformX,C=c.transformY,v=d!==y&&h!==C;if(!v)return;var b=t.current.offsetWidth*u,Z=t.current.offsetHeight*u,w=t.current.getBoundingClientRect(),N=w.left,X=w.top,O=s%180!==0,k=Ve(O?Z:b,O?b:Z,N,X);k&&i((0,R.Z)({},k),"dragRebound")}},M=function(c){if(!(!n||c.deltaY==0)){var y=Math.abs(c.deltaY/100),C=Math.min(y,Zt),v=xe+C*r;c.deltaY>0&&(v=xe/v),f(v,"wheel",c.clientX,c.clientY)}};return(0,o.useEffect)(function(){var E,c,y,C;if(e){y=(0,Se.Z)(window,"mouseup",T,!1),C=(0,Se.Z)(window,"mousemove",S,!1);try{window.top!==window.self&&(E=(0,Se.Z)(window.top,"mouseup",T,!1),c=(0,Se.Z)(window.top,"mousemove",S,!1))}catch(v){(0,bt.Kp)(!1,"[rc-image] ".concat(v))}}return function(){var v,b,Z,w;(v=y)===null||v===void 0||v.remove(),(b=C)===null||b===void 0||b.remove(),(Z=E)===null||Z===void 0||Z.remove(),(w=c)===null||w===void 0||w.remove()}},[n,g,d,h,s,e]),{isMoving:g,onMouseDown:P,onMouseMove:S,onMouseUp:T,onWheel:M}}function Mt(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 Ue(t){var e=t.src,n=t.isCustomPlaceholder,r=t.fallback,a=(0,o.useState)(n?"loading":"normal"),i=(0,D.Z)(a,2),f=i[0],s=i[1],u=(0,o.useRef)(!1),d=f==="error";(0,o.useEffect)(function(){var g=!0;return Mt(e).then(function(p){!p&&g&&s("error")}),function(){g=!1}},[e]),(0,o.useEffect)(function(){n&&!u.current?s("loading"):d&&s("normal")},[e]);var h=function(){s("normal")},l=function(p){u.current=!1,f==="loading"&&p!==null&&p!==void 0&&p.complete&&(p.naturalWidth||p.naturalHeight)&&(u.current=!0,h())},x=d&&r?{src:r}:{onLoad:h,src:e};return[l,x,f]}function Ze(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.hypot(n,r)}function Et(t,e,n,r){var a=Ze(t,n),i=Ze(e,r);if(a===0&&i===0)return[t.x,t.y];var f=a/(a+i),s=t.x+f*(e.x-t.x),u=t.y+f*(e.y-t.y);return[s,u]}function Rt(t,e,n,r,a,i,f){var s=a.rotate,u=a.scale,d=a.x,h=a.y,l=(0,o.useState)(!1),x=(0,D.Z)(l,2),g=x[0],p=x[1],I=(0,o.useRef)({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),P=function(c){I.current=(0,R.Z)((0,R.Z)({},I.current),c)},S=function(c){if(e){c.stopPropagation(),p(!0);var y=c.touches,C=y===void 0?[]:y;C.length>1?P({point1:{x:C[0].clientX,y:C[0].clientY},point2:{x:C[1].clientX,y:C[1].clientY},eventType:"touchZoom"}):P({point1:{x:C[0].clientX-d,y:C[0].clientY-h},eventType:"move"})}},T=function(c){var y=c.touches,C=y===void 0?[]:y,v=I.current,b=v.point1,Z=v.point2,w=v.eventType;if(C.length>1&&w==="touchZoom"){var N={x:C[0].clientX,y:C[0].clientY},X={x:C[1].clientX,y:C[1].clientY},O=Et(b,Z,N,X),k=(0,D.Z)(O,2),B=k[0],G=k[1],V=Ze(N,X)/Ze(b,Z);f(V,"touchZoom",B,G,!0),P({point1:N,point2:X,eventType:"touchZoom"})}else w==="move"&&(i({x:C[0].clientX-b.x,y:C[0].clientY-b.y},"move"),P({eventType:"move"}))},M=function(){if(n){if(g&&p(!1),P({eventType:"none"}),r>u)return i({x:0,y:0,scale:r},"touchZoom");var c=t.current.offsetWidth*u,y=t.current.offsetHeight*u,C=t.current.getBoundingClientRect(),v=C.left,b=C.top,Z=s%180!==0,w=Ve(Z?y:c,Z?c:y,v,b);w&&i((0,R.Z)({},w),"dragRebound")}};return(0,o.useEffect)(function(){var E;return n&&e&&(E=(0,Se.Z)(window,"touchmove",function(c){return c.preventDefault()},{passive:!1})),function(){var c;(c=E)===null||c===void 0||c.remove()}},[n,e]),{isTouching:g,onTouchStart:S,onTouchMove:T,onTouchEnd:M}}var Nt=["fallback","src","imgRef"],Tt=["prefixCls","src","alt","imageInfo","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],Ot=function(e){var n=e.fallback,r=e.src,a=e.imgRef,i=(0,we.Z)(e,Nt),f=Ue({src:r,fallback:n}),s=(0,D.Z)(f,2),u=s[0],d=s[1];return o.createElement("img",(0,he.Z)({ref:function(l){a.current=l,u(l)}},i,d))},Lt=function(e){var n=e.prefixCls,r=e.src,a=e.alt,i=e.imageInfo,f=e.fallback,s=e.movable,u=s===void 0?!0:s,d=e.onClose,h=e.visible,l=e.icons,x=l===void 0?{}:l,g=e.rootClassName,p=e.closeIcon,I=e.getContainer,P=e.current,S=P===void 0?0:P,T=e.count,M=T===void 0?1:T,E=e.countRender,c=e.scaleStep,y=c===void 0?.5:c,C=e.minScale,v=C===void 0?1:C,b=e.maxScale,Z=b===void 0?50:b,w=e.transitionName,N=w===void 0?"zoom":w,X=e.maskTransitionName,O=X===void 0?"fade":X,k=e.imageRender,B=e.imgCommonProps,G=e.toolbarRender,V=e.onTransform,_=e.onChange,H=(0,we.Z)(e,Tt),U=(0,o.useRef)(),ee=(0,o.useContext)(ye),K=ee&&M>1,se=ee&&M>=1,te=(0,o.useState)(!0),j=(0,D.Z)(te,2),le=j[0],ne=j[1],Q=yt(U,v,Z,V),L=Q.transform,re=Q.resetTransform,W=Q.updateTransform,J=Q.dispatchZoomChange,ae=Pt(U,u,h,y,L,W,J),ce=ae.isMoving,A=ae.onMouseDown,$=ae.onWheel,z=Rt(U,u,h,v,L,W,J),F=z.isTouching,Y=z.onTouchStart,ve=z.onTouchMove,pe=z.onTouchEnd,ue=L.rotate,fe=L.scale,ze=q()((0,ie.Z)({},"".concat(n,"-moving"),ce));(0,o.useEffect)(function(){le||ne(!0)},[le]);var je=function(){re("close")},De=function(){J(xe+y,"zoomIn")},de=function(){J(xe/(xe+y),"zoomOut")},me=function(){W({rotate:ue+90},"rotateRight")},Me=function(){W({rotate:ue-90},"rotateLeft")},Ee=function(){W({flipX:!L.flipX},"flipX")},Re=function(){W({flipY:!L.flipY},"flipY")},mn=function(){re("reset")},Xe=function(ge){var Ne=S+ge;!Number.isInteger(Ne)||Ne<0||Ne>M-1||(ne(!1),re(ge<0?"prev":"next"),_==null||_(Ne,S))},gn=function(ge){!h||!K||(ge.keyCode===Le.Z.LEFT?Xe(-1):ge.keyCode===Le.Z.RIGHT&&Xe(1))},hn=function(ge){h&&(fe!==1?W({x:0,y:0,scale:1},"doubleClick"):J(xe+y,"doubleClick",ge.clientX,ge.clientY))};(0,o.useEffect)(function(){var oe=(0,Se.Z)(window,"keydown",gn,!1);return function(){oe.remove()}},[h,K,S]);var ct=o.createElement(Ot,(0,he.Z)({},B,{width:e.width,height:e.height,imgRef:U,className:"".concat(n,"-img"),alt:a,style:{transform:"translate3d(".concat(L.x,"px, ").concat(L.y,"px, 0) scale3d(").concat(L.flipX?"-":"").concat(fe,", ").concat(L.flipY?"-":"").concat(fe,", 1) rotate(").concat(ue,"deg)"),transitionDuration:(!le||F)&&"0s"},fallback:f,src:r,onWheel:$,onMouseDown:A,onDoubleClick:hn,onTouchStart:Y,onTouchMove:ve,onTouchEnd:pe,onTouchCancel:pe})),ut=(0,R.Z)({url:r,alt:a},i);return o.createElement(o.Fragment,null,o.createElement(ht.Z,(0,he.Z)({transitionName:N,maskTransitionName:O,closable:!1,keyboard:!0,prefixCls:n,onClose:d,visible:h,classNames:{wrapper:ze},rootClassName:g,getContainer:I},H,{afterClose:je}),o.createElement("div",{className:"".concat(n,"-img-wrapper")},k?k(ct,(0,R.Z)({transform:L,image:ut},ee?{current:S}:{})):ct)),o.createElement(St,{visible:h,transform:L,maskTransitionName:O,closeIcon:p,getContainer:I,prefixCls:n,rootClassName:g,icons:x,countRender:E,showSwitch:K,showProgress:se,current:S,count:M,scale:fe,minScale:v,maxScale:Z,toolbarRender:G,onActive:Xe,onZoomIn:De,onZoomOut:de,onRotateRight:me,onRotateLeft:Me,onFlipX:Ee,onFlipY:Re,onClose:d,onReset:mn,zIndex:H.zIndex!==void 0?H.zIndex+1:void 0,image:ut}))},Ke=Lt,At=m(74902),Ae=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"];function $t(t){var e=o.useState({}),n=(0,D.Z)(e,2),r=n[0],a=n[1],i=o.useCallback(function(s,u){return a(function(d){return(0,R.Z)((0,R.Z)({},d),{},(0,ie.Z)({},s,u))}),function(){a(function(d){var h=(0,R.Z)({},d);return delete h[s],h})}},[]),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(d){["src"].concat((0,At.Z)(Ae)).includes(d)&&(u[d]=s[d])}),{data:u}}):Object.keys(r).reduce(function(s,u){var d=r[u],h=d.canPreview,l=d.data;return h&&s.push({data:l,id:u}),s},[])},[t,r]);return[f,i,!!t]}var zt=["visible","onVisibleChange","getContainer","current","movable","minScale","maxScale","countRender","closeIcon","onChange","onTransform","toolbarRender","imageRender"],jt=["src"],Dt=function(e){var n,r=e.previewPrefixCls,a=r===void 0?"rc-image-preview":r,i=e.children,f=e.icons,s=f===void 0?{}:f,u=e.items,d=e.preview,h=e.fallback,l=(0,ke.Z)(d)==="object"?d:{},x=l.visible,g=l.onVisibleChange,p=l.getContainer,I=l.current,P=l.movable,S=l.minScale,T=l.maxScale,M=l.countRender,E=l.closeIcon,c=l.onChange,y=l.onTransform,C=l.toolbarRender,v=l.imageRender,b=(0,we.Z)(l,zt),Z=$t(u),w=(0,D.Z)(Z,3),N=w[0],X=w[1],O=w[2],k=(0,Oe.Z)(0,{value:I}),B=(0,D.Z)(k,2),G=B[0],V=B[1],_=(0,o.useState)(!1),H=(0,D.Z)(_,2),U=H[0],ee=H[1],K=((n=N[G])===null||n===void 0?void 0:n.data)||{},se=K.src,te=(0,we.Z)(K,jt),j=(0,Oe.Z)(!!x,{value:x,onChange:function(F,Y){g==null||g(F,Y,G)}}),le=(0,D.Z)(j,2),ne=le[0],Q=le[1],L=(0,o.useState)(null),re=(0,D.Z)(L,2),W=re[0],J=re[1],ae=o.useCallback(function(z,F,Y,ve){var pe=O?N.findIndex(function(ue){return ue.data.src===F}):N.findIndex(function(ue){return ue.id===z});V(pe<0?0:pe),Q(!0),J({x:Y,y:ve}),ee(!0)},[N,O]);o.useEffect(function(){ne?U||V(0):ee(!1)},[ne]);var ce=function(F,Y){V(F),c==null||c(F,Y)},A=function(){Q(!1),J(null)},$=o.useMemo(function(){return{register:X,onPreview:ae}},[X,ae]);return o.createElement(ye.Provider,{value:$},i,o.createElement(Ke,(0,he.Z)({"aria-hidden":!ne,movable:P,visible:ne,prefixCls:a,closeIcon:E,onClose:A,mousePosition:W,imgCommonProps:te,src:se,fallback:h,icons:s,minScale:S,maxScale:T,getContainer:p,current:G,count:N.length,countRender:M,onTransform:y,toolbarRender:C,imageRender:v,onChange:ce},b)))},Xt=Dt,Qe=0;function Yt(t,e){var n=o.useState(function(){return Qe+=1,String(Qe)}),r=(0,D.Z)(n,1),a=r[0],i=o.useContext(ye),f={data:e,canPreview:t};return o.useEffect(function(){if(i)return i.register(a,f)},[]),o.useEffect(function(){i&&i.register(a,f)},[t,e]),a}var kt=["src","alt","onPreviewClose","prefixCls","previewPrefixCls","placeholder","fallback","width","height","style","preview","className","onClick","onError","wrapperClassName","wrapperStyle","rootClassName"],Wt=["src","visible","onVisibleChange","getContainer","mask","maskClassName","movable","icons","scaleStep","minScale","maxScale","imageRender","toolbarRender"],Je=function(e){var n=e.src,r=e.alt,a=e.onPreviewClose,i=e.prefixCls,f=i===void 0?"rc-image":i,s=e.previewPrefixCls,u=s===void 0?"".concat(f,"-preview"):s,d=e.placeholder,h=e.fallback,l=e.width,x=e.height,g=e.style,p=e.preview,I=p===void 0?!0:p,P=e.className,S=e.onClick,T=e.onError,M=e.wrapperClassName,E=e.wrapperStyle,c=e.rootClassName,y=(0,we.Z)(e,kt),C=d&&d!==!0,v=(0,ke.Z)(I)==="object"?I:{},b=v.src,Z=v.visible,w=Z===void 0?void 0:Z,N=v.onVisibleChange,X=N===void 0?a:N,O=v.getContainer,k=O===void 0?void 0:O,B=v.mask,G=v.maskClassName,V=v.movable,_=v.icons,H=v.scaleStep,U=v.minScale,ee=v.maxScale,K=v.imageRender,se=v.toolbarRender,te=(0,we.Z)(v,Wt),j=b!=null?b:n,le=(0,Oe.Z)(!!w,{value:w,onChange:X}),ne=(0,D.Z)(le,2),Q=ne[0],L=ne[1],re=Ue({src:n,isCustomPlaceholder:C,fallback:h}),W=(0,D.Z)(re,3),J=W[0],ae=W[1],ce=W[2],A=(0,o.useState)(null),$=(0,D.Z)(A,2),z=$[0],F=$[1],Y=(0,o.useContext)(ye),ve=!!I,pe=function(){L(!1),F(null)},ue=q()(f,M,c,(0,ie.Z)({},"".concat(f,"-error"),ce==="error")),fe=(0,o.useMemo)(function(){var de={};return Ae.forEach(function(me){e[me]!==void 0&&(de[me]=e[me])}),de},Ae.map(function(de){return e[de]})),ze=(0,o.useMemo)(function(){return(0,R.Z)((0,R.Z)({},fe),{},{src:j})},[j,fe]),je=Yt(ve,ze),De=function(me){var Me=gt(me.target),Ee=Me.left,Re=Me.top;Y?Y.onPreview(je,j,Ee,Re):(F({x:Ee,y:Re}),L(!0)),S==null||S(me)};return o.createElement(o.Fragment,null,o.createElement("div",(0,he.Z)({},y,{className:ue,onClick:ve?De:S,style:(0,R.Z)({width:l,height:x},E)}),o.createElement("img",(0,he.Z)({},fe,{className:q()("".concat(f,"-img"),(0,ie.Z)({},"".concat(f,"-img-placeholder"),d===!0),P),style:(0,R.Z)({height:x},g),ref:J},ae,{width:l,height:x,onError:T})),ce==="loading"&&o.createElement("div",{"aria-hidden":"true",className:"".concat(f,"-placeholder")},d),B&&ve&&o.createElement("div",{className:q()("".concat(f,"-mask"),G),style:{display:(g==null?void 0:g.display)==="none"?"none":void 0}},B)),!Y&&ve&&o.createElement(Ke,(0,he.Z)({"aria-hidden":!Q,visible:Q,prefixCls:u,onClose:pe,mousePosition:z,src:j,alt:r,imageInfo:{width:l,height:x},fallback:h,getContainer:k,icons:_,movable:V,scaleStep:H,minScale:U,maxScale:ee,rootClassName:c,imageRender:K,imgCommonProps:fe,toolbarRender:se},te)))};Je.PreviewGroup=Xt;var Ft=Je,qe=Ft,_e=m(87263),Pe=m(33603),et=m(53124),tt=m(35792),Ht=m(10110),Bt=m(97937),Gt=m(6171),Vt=m(90814),Ut=m(43749),Kt=m(56424),nt=m(94668),Qt=m(35598),Jt=m(15668),ot=m(11568),Ce=m(15063),qt=m(71194),_t=m(14747),en=m(50438),tn=m(16932),nn=m(83559),rt=m(83262);const $e=t=>({position:t||"absolute",inset:0}),on=t=>{const{iconCls:e,motionDurationSlow:n,paddingXXS:r,marginXXS:a,prefixCls:i,colorTextLightSolid:f}=t;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:f,background:new Ce.t("#000").setA(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${n}`,[`.${i}-mask-info`]:Object.assign(Object.assign({},_t.vS),{padding:`0 ${(0,ot.bf)(r)}`,[e]:{marginInlineEnd:a,svg:{verticalAlign:"baseline"}}})}},rn=t=>{const{previewCls:e,modalMaskBg:n,paddingSM:r,marginXL:a,margin:i,paddingLG:f,previewOperationColorDisabled:s,previewOperationHoverColor:u,motionDurationSlow:d,iconCls:h,colorTextLightSolid:l}=t,x=new Ce.t(n).setA(.1),g=x.clone().setA(.2);return{[`${e}-footer`]:{position:"fixed",bottom:a,left:{_skip_check_:!0,value:"50%"},display:"flex",flexDirection:"column",alignItems:"center",color:t.previewOperationColor,transform:"translateX(-50%)"},[`${e}-progress`]:{marginBottom:i},[`${e}-close`]:{position:"fixed",top:a,right:{_skip_check_:!0,value:a},display:"flex",color:l,backgroundColor:x.toRgbString(),borderRadius:"50%",padding:r,outline:0,border:0,cursor:"pointer",transition:`all ${d}`,"&:hover":{backgroundColor:g.toRgbString()},[`& > ${h}`]:{fontSize:t.previewOperationSize}},[`${e}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${(0,ot.bf)(f)}`,backgroundColor:x.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:r,padding:r,cursor:"pointer",transition:`all ${d}`,userSelect:"none",[`&:not(${e}-operations-operation-disabled):hover > ${h}`]:{color:u},"&-disabled":{color:s,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${h}`]:{fontSize:t.previewOperationSize}}}}},an=t=>{const{modalMaskBg:e,iconCls:n,previewOperationColorDisabled:r,previewCls:a,zIndexPopup:i,motionDurationSlow:f}=t,s=new Ce.t(e).setA(.1),u=s.clone().setA(.2);return{[`${a}-switch-left, ${a}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:t.calc(i).add(1).equal(),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:r,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:t.previewOperationSize}},[`${a}-switch-left`]:{insetInlineStart:t.marginSM},[`${a}-switch-right`]:{insetInlineEnd:t.marginSM}}},sn=t=>{const{motionEaseOut:e,previewCls:n,motionDurationSlow:r,componentCls:a}=t;return[{[`${a}-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 ${r} ${e} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},$e()),{transition:`transform ${r} ${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"}}}}},{[`${a}-preview-root`]:{[`${n}-wrap`]:{zIndex:t.zIndexPopup}}},{[`${a}-preview-operations-wrapper`]:{position:"fixed",zIndex:t.calc(t.zIndexPopup).add(1).equal()},"&":[rn(t),an(t)]}]},ln=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({},on(t)),[`${e}-mask:hover`]:{opacity:1},[`${e}-placeholder`]:Object.assign({},$e())}}},cn=t=>{const{previewCls:e}=t;return{[`${e}-root`]:(0,en._y)(t,"zoom"),"&":(0,tn.J$)(t,!0)}},un=t=>({zIndexPopup:t.zIndexPopupBase+80,previewOperationColor:new Ce.t(t.colorTextLightSolid).setA(.65).toRgbString(),previewOperationHoverColor:new Ce.t(t.colorTextLightSolid).setA(.85).toRgbString(),previewOperationColorDisabled:new Ce.t(t.colorTextLightSolid).setA(.25).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5});var at=(0,nn.I$)("Image",t=>{const e=`${t.componentCls}-preview`,n=(0,rt.IX)(t,{previewCls:e,modalMaskBg:new Ce.t("#000").setA(.45).toRgbString(),imagePreviewSwitchSize:t.controlHeightLG});return[ln(n),sn(n),(0,qt.QA)((0,rt.IX)(n,{componentCls:e})),cn(n)]},un),fn=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n};const it={rotateLeft:o.createElement(Ut.Z,null),rotateRight:o.createElement(Kt.Z,null),zoomIn:o.createElement(Qt.Z,null),zoomOut:o.createElement(Jt.Z,null),close:o.createElement(Bt.Z,null),left:o.createElement(Gt.Z,null),right:o.createElement(Vt.Z,null),flipX:o.createElement(nt.Z,null),flipY:o.createElement(nt.Z,{rotate:90})};var vn=t=>{var{previewPrefixCls:e,preview:n}=t,r=fn(t,["previewPrefixCls","preview"]);const{getPrefixCls:a}=o.useContext(et.E_),i=a("image",e),f=`${i}-preview`,s=a(),u=(0,tt.Z)(i),[d,h,l]=at(i,u),[x]=(0,_e.Cn)("ImagePreview",typeof n=="object"?n.zIndex:void 0),g=o.useMemo(()=>{var p;if(n===!1)return n;const I=typeof n=="object"?n:{},P=q()(h,l,u,(p=I.rootClassName)!==null&&p!==void 0?p:"");return Object.assign(Object.assign({},I),{transitionName:(0,Pe.m)(s,"zoom",I.transitionName),maskTransitionName:(0,Pe.m)(s,"fade",I.maskTransitionName),rootClassName:P,zIndex:x})},[n]);return d(o.createElement(qe.PreviewGroup,Object.assign({preview:g,previewPrefixCls:f,icons:it},r)))},st=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n};const lt=t=>{const{prefixCls:e,preview:n,className:r,rootClassName:a,style:i}=t,f=st(t,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:s,getPopupContainer:u,className:d,style:h,preview:l}=(0,et.dj)("image"),[x]=(0,Ht.Z)("Image"),g=s("image",e),p=s(),I=(0,tt.Z)(g),[P,S,T]=at(g,I),M=q()(a,S,T,I),E=q()(r,S,d),[c]=(0,_e.Cn)("ImagePreview",typeof n=="object"?n.zIndex:void 0),y=o.useMemo(()=>{if(n===!1)return n;const v=typeof n=="object"?n:{},{getContainer:b,closeIcon:Z,rootClassName:w}=v,N=st(v,["getContainer","closeIcon","rootClassName"]);return Object.assign(Object.assign({mask:o.createElement("div",{className:`${g}-mask-info`},o.createElement(ft.Z,null),x==null?void 0:x.preview),icons:it},N),{rootClassName:q()(M,w),getContainer:b!=null?b:u,transitionName:(0,Pe.m)(p,"zoom",v.transitionName),maskTransitionName:(0,Pe.m)(p,"fade",v.maskTransitionName),zIndex:c,closeIcon:Z!=null?Z:l==null?void 0:l.closeIcon})},[n,x,l==null?void 0:l.closeIcon]),C=Object.assign(Object.assign({},h),i);return P(o.createElement(qe,Object.assign({prefixCls:g,preview:y,rootClassName:M,className:E,style:C},f)))};lt.PreviewGroup=vn;var dn=lt},71230:function(Ye,Ie,m){var o=m(17621);Ie.Z=o.Z}}]); |