@gx-design-vue/image 0.2.0-beta.21 → 0.2.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(h,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue-types"),require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue-types","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@vueuse/core"],_):(h=typeof globalThis<"u"?globalThis:h||self,_(h.GImage={},h.vueTypes,h.vue,h.iconsVue,h.proUtils,h.proHooks,h.proProvider,h.core))})(this,function(h,_,i,k,w,de,O,he){"use strict";const $=_.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});$.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const D={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},Z={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:$.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},disablePreview:$.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:$.string,imageStyle:$.style,width:$.number,height:$.number,zIndex:D.zIndex,infinite:D.infinite,getContainer:D.getContainer,initialIndex:{...D.initialIndex,default:()=>{}}},Te={urlList:{type:Array,default:()=>[]},teleported:Z.previewTeleported,zIndex:D.zIndex,initialIndex:D.initialIndex,infinite:D.infinite,getContainer:Z.getContainer,onHideOnClickModal:Z.hideOnClickModal,icons:{type:Object,default:()=>({})}};function g(e,t){Pe(e)&&(e="100%");var n=je(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function te(e){return Math.min(1,Math.max(0,e))}function Pe(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function je(e){return typeof e=="string"&&e.indexOf("%")!==-1}function ke(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ne(e){return e<=1?"".concat(Number(e)*100,"%"):e}function H(e){return e.length===1?"0"+e:String(e)}function Ve(e,t,n){return{r:g(e,255)*255,g:g(t,255)*255,b:g(n,255)*255}}function Oe(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=0,c=(a+r)/2;if(a===r)s=0,o=0;else{var u=a-r;switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:c}}function ge(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Be(e,t,n){var a,r,o;if(e=g(e,360),t=g(t,100),n=g(n,100),t===0)r=n,o=n,a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;a=ge(c,s,e+1/3),r=ge(c,s,e),o=ge(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function ze(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=a,c=a-r,u=a===0?0:c/a;if(a===r)o=0;else{switch(a){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return{h:o,s:u,v:s}}function Ye(e,t,n){e=g(e,360)*6,t=g(t,100),n=g(n,100);var a=Math.floor(e),r=e-a,o=n*(1-t),s=n*(1-r*t),c=n*(1-(1-r)*t),u=a%6,M=[n,s,o,o,c,n][u],b=[c,n,n,s,o,o][u],F=[o,o,c,n,n,s][u];return{r:M*255,g:b*255,b:F*255}}function Le(e,t,n,a){var r=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(n).toString(16))];return a&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function Ge(e,t,n,a,r){var o=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(n).toString(16)),H(We(a))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function We(e){return Math.round(parseFloat(e)*255).toString(16)}function Ee(e){return S(e)/255}function S(e){return parseInt(e,16)}function qe(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var me={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _e(e){var t={r:0,g:0,b:0},n=1,a=null,r=null,o=null,s=!1,c=!1;return typeof e=="string"&&(e=Qe(e)),typeof e=="object"&&(z(e.r)&&z(e.g)&&z(e.b)?(t=Ve(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(a=ne(e.s),r=ne(e.v),t=Ye(e.h,a,r),s=!0,c="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(a=ne(e.s),o=ne(e.l),t=Be(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=ke(n),{ok:s,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Ze="[-\\+]?\\d+%?",Xe="[-\\+]?\\d*\\.\\d+%?",R="(?:".concat(Xe,")|(?:").concat(Ze,")"),ve="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),pe="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),T={CSS_UNIT:new RegExp(R),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+pe),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+pe),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+pe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Qe(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(me[e])e=me[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=T.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=T.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=T.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=T.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=T.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=T.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=T.hex8.exec(e),n?{r:S(n[1]),g:S(n[2]),b:S(n[3]),a:Ee(n[4]),format:t?"name":"hex8"}:(n=T.hex6.exec(e),n?{r:S(n[1]),g:S(n[2]),b:S(n[3]),format:t?"name":"hex"}:(n=T.hex4.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),a:Ee(n[4]+n[4]),format:t?"name":"hex8"}:(n=T.hex3.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function z(e){return!!T.CSS_UNIT.exec(String(e))}var X=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var a;if(t instanceof e)return t;typeof t=="number"&&(t=qe(t)),this.originalInput=t;var r=_e(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(a=n.format)!==null&&a!==void 0?a:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,a,r,o=t.r/255,s=t.g/255,c=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=ke(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=ze(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=ze(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Oe(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Oe(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Le(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Ge(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),a=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(a,")"):"rgba(".concat(t,", ").concat(n,", ").concat(a,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(g(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(g(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Le(this.r,this.g,this.b,!1),n=0,a=Object.entries(me);n<a.length;n++){var r=a[n],o=r[0],s=r[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var a=!1,r=this.a<1&&this.a>=0,o=!n&&r&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=te(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=te(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=te(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=te(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var a=this.toRgb(),r=new e(t).toRgb(),o=n/100,s={r:(r.r-a.r)*o+a.r,g:(r.g-a.g)*o+a.g,b:(r.b-a.b)*o+a.b,a:(r.a-a.a)*o+a.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var a=this.toHsl(),r=360/n,o=[this];for(a.h=(a.h-(r*t>>1)+720)%360;--t;)a.h=(a.h+r)%360,o.push(new e(a));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),a=n.h,r=n.s,o=n.v,s=[],c=1/t;t--;)s.push(new e({h:a,s:r,v:o})),o=(o+c)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),a=new e(t).toRgb(),r=n.a+a.a*(1-n.a);return new e({r:(n.r*n.a+a.r*a.a*(1-n.a))/r,g:(n.g*n.a+a.g*a.a*(1-n.a))/r,b:(n.b*n.a+a.b*a.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),a=n.h,r=[this],o=360/t,s=1;s<t;s++)r.push(new e({h:(a+s*o)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const Ke=new O.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Je=new O.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Ue=new O.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),et=new O.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Re=e=>({position:e||"absolute",inset:0});function be(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const tt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),nt=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new X(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...tt(e),display:"flex",flexDirection:"row-reverse",alignItems:"center",color:e.previewOperationColor,listStyle:"none",background:s.toRgbString(),pointerEvents:"auto","&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${o}`,userSelect:"none","&:hover":{background:c.toRgbString()},"&-disabled":{color:r,pointerEvents:"none"},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-icon":{fontSize:e.previewOperationSize}}}},at=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new X(t).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:a+1,display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:o.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${r}`,pointerEvents:"auto",userSelect:"none","&:hover":{background:s.toRgbString()},"&-disabled":{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${e.iconCls}`]:{cursor:"not-allowed"}}},[`> ${e.iconCls}`]:{fontSize:e.previewOperationSize}},[`${e.componentCls}-switch-left`]:{insetInlineStart:e.marginSM},[`${e.componentCls}-switch-right`]:{insetInlineEnd:e.marginSM}}},rt=e=>({[e.componentCls]:{"&-root":{...be("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-wrapper":{...be("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-mask":{...be("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},"&-block":{height:"100%",textAlign:"center",pointerEvents:"none"},"&-body":{...Re(),overflow:"hidden"},"&-canvas":{...Re(),display:"flex",justifyContent:"center",alignItems:"center","&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}},"&-img":{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto"},"&-fade-appear, &-fade-enter":{animationName:Ke,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-fade-leave":{animationName:Je,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-zoom-appear, &-zoom-enter":{animationName:Ue,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},"&-zoom-enter-active":{animationPlayState:"running"},"&-zoom-leave":{animationName:et,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[nt(e),at(e)]});function it(e){return O.useStyle("ImageView",t=>{const n=O.mergeToken(t,{zIndexPopup:t.zIndexPopupBase+80,previewOperationColorDisabled:new X(t.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new X("#000").setAlpha(.45).toRgbString(),previewOperationColor:new X(t.colorTextLightSolid).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5,imagePreviewSwitchSize:t.controlHeightLG,iconCls:"anticon"});return[rt(n)]},e)}const j={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},ae=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},ye=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},Q={CONTAIN:{name:"contain",icon:i.createVNode(k.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode(k.OneToOneOutlined,null,null)}},$e=function(){return!w.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function we(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const De=i.defineComponent({props:Te,emits:["close","switch"],setup:(e,{emit:t,expose:n})=>{var fe,ue,P,ee,Fe;let a=null,r=null,o=null;const s=w.getPrefixCls({suffixCls:"image-viewer"}),{wrapSSR:c,hashId:u}=it(s),M=i.shallowRef(!1),[b,F]=de.useState(!1),[L,I]=de.useState(!1),E=i.ref(!0),m=i.ref(e.initialIndex),B=i.ref(null),Y=i.ref(null),K=i.ref(Q.CONTAIN),p=i.reactive({transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}),re=i.computed(()=>e.urlList.length>1),J=i.computed(()=>m.value===0),ie=i.computed(()=>m.value===e.urlList.length-1),oe=i.computed(()=>e.urlList[m.value]),se=i.computed(()=>{const{scale:l,deg:N,offsetX:d,offsetY:x,enableTransition:y}=p.transform,C={transform:`scale(${l}) rotate(${N}deg)`,transition:y?"transform .3s":"",marginLeft:`${d}px`,marginTop:`${x}px`};return K.value.name===Q.CONTAIN.name&&(C.maxWidth=C.maxHeight="100%"),C}),le=()=>{ye(document,"keydown",a),ye(document,$e,r),a=null,r=null},xe=()=>{le(),t("close"),p.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Me=l=>{M.value?M.value=!1:B.value===(l==null?void 0:l.target)&&(I(!1),m.value=e.initialIndex)},ce=()=>{p.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},G=()=>{if(J.value&&!e.infinite)return;const l=e.urlList.length;m.value=(m.value-1+l)%l},f=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;m.value=(m.value+1)%l},A=()=>{if(E.value)return;const l=Object.keys(Q),N=Object.values(Q),d=K.value.name,y=(N.findIndex(C=>C.name===d)+1)%l.length;K.value=Q[l[y]],ce()},v=(l,N={})=>{if(E.value)return;const{zoomRate:d,rotateDeg:x,enableTransition:y}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...N};switch(l){case"zoomOut":p.transform.scale>.2&&(p.transform.scale=Number.parseFloat((p.transform.scale-d).toFixed(3)));break;case"zoomIn":p.transform.scale=Number.parseFloat((p.transform.scale+d).toFixed(3));break;case"clocelise":p.transform.deg+=x;break;case"anticlocelise":p.transform.deg-=x;break}p.transform.enableTransition=y},W=()=>{a=we(l=>{switch(l.code){case j.esc:I(!1);break;case j.space:A();break;case j.left:G();break;case j.up:v("zoomIn");break;case j.right:f();break;case j.down:v("zoomOut");break}}),r=we(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?v("zoomIn",{zoomRate:.015,enableTransition:!1}):v("zoomOut",{zoomRate:.015,enableTransition:!1})}),ae(document,"keydown",a),ae(document,$e,r)},q=()=>{E.value=!1},Ie=l=>{E.value=!1,l.target.alt="加载失败"},U=i.shallowRef(),Ae=l=>{if(E.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(U.value),M.value=!0;const{offsetX:N,offsetY:d}=p.transform,x=l.pageX,y=l.pageY;o=we(C=>{p.transform={...p.transform,offsetX:N+C.pageX-x,offsetY:d+C.pageY-y}}),ae(document,"mousemove",o),ae(document,"mouseup",()=>{ye(document,"mousemove",o),b.value&&L.value&&(U.value=setTimeout(()=>{M.value=!1}))})},Ne=[{icon:((fe=e.icons)==null?void 0:fe.close)||i.createVNode(k.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),I(!1)},type:"close"},{icon:((ue=e.icons)==null?void 0:ue.zoomIn)||i.createVNode(k.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),v("zoomIn")},type:"zoomIn"},{icon:((P=e.icons)==null?void 0:P.zoomOut)||i.createVNode(k.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),v("zoomOut")},type:"zoomOut"},{icon:((ee=e.icons)==null?void 0:ee.rotateRight)||i.createVNode(k.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),v("anticlocelise")},type:"rotateRight"},{icon:((Fe=e.icons)==null?void 0:Fe.rotateLeft)||i.createVNode(k.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),v("clocelise")},type:"rotateLeft"}];return i.watch(oe,()=>{i.nextTick(()=>{Y.value.complete||(E.value=!0)})}),i.watch(m,l=>{ce(),t("switch",l)}),i.watch(b,l=>{l&&(L.value=l)}),i.watch([()=>b.value,()=>B.value],([l,N])=>{var d,x;l&&N&&(W(),(x=(d=B.value)==null?void 0:d.focus)==null||x.call(d))}),n({setOpen:F}),()=>{const l=O.getTransitionProps(`${s}-fade`),N=O.getTransitionProps(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[b.value&&i.createVNode("div",{class:`${s}-root ${u.value}`},[i.createVNode(i.Transition,l,{default:()=>[i.withDirectives(i.createVNode("div",{class:`${s}-mask ${u.value}`},null),[[i.vShow,b.value&&L.value]])]}),i.createVNode("div",{ref:B,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:d=>e.onHideOnClickModal&&Me(d)},[i.createVNode(i.Transition,i.mergeProps(N,{onAfterLeave:()=>xe()}),{default:()=>{var d,x;return[i.withDirectives(i.createVNode("div",{class:`${s}-block ${u.value}`},[i.createVNode("div",{class:`${s}-content ${u.value}`},[i.createVNode("div",{class:`${s}-body ${u.value}`},[i.createVNode("div",{class:`${s}-operations-wrapper ${u.value}`,onClick:y=>y.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[Ne.map(({icon:y,onClick:C,type:Ce})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:C,key:Ce},[i.cloneVNode(y,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((y,C)=>i.createVNode("img",{ref:Y,class:`${s}-img ${u.value}`,style:{...se.value,display:C===m.value?"block":"none"},key:y,src:y,onLoad:()=>q(),onError:Ce=>Ie(Ce),onMousedown:Ae},null))]),re.value&&i.createVNode("div",{class:[`${s}-switch-left`,m.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:()=>G()},[((d=e.icons)==null?void 0:d.left)||i.createVNode(k.LeftOutlined,null,null)]),re.value&&i.createVNode("div",{class:[`${s}-switch-right`,m.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:()=>f()},[((x=e.icons)==null?void 0:x.right)||i.createVNode(k.RightOutlined,null,null)])])])]),[[i.vShow,b.value&&L.value]])]}})])])]}))}}}),Se={width:"100%",height:"100%"},ot=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden","&-inner":{...Se,verticalAlign:"top",opacity:1},"&-placeholder":{...Se,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},"&-error":{...Se,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},"&-preview":{cursor:"pointer"}}}),st=e=>e&&e.nodeType===Node.ELEMENT_NODE;let He="";const V=i.defineComponent({props:Z,name:"GImage",emits:["error","click","load"],slots:Object,setup(e,{slots:t,emit:n,attrs:a}){const r=w.getPrefixCls({suffixCls:"image"}),{wrapSSR:o,hashId:s}=O.useProStyle("Image",[ot],r),c=i.ref(),u=i.ref(""),M=i.ref(!1),b=i.ref(!0),F=i.ref(!1),L=i.ref(null),I=i.ref();let E,m;const B=i.computed(()=>!w.isServer&&e.fit?{"object-fit":e.fit}:{}),Y=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),K=i.computed(()=>{const{src:f,previewSrcList:A,initialIndex:v}=e;if(v||v===0)return A.length>=v?v:0;let W=0;const q=A.indexOf(f);return q>=0&&(W=q),W}),p=f=>{u.value=e.src,b.value=!1,M.value=!1,n("load",f)},re=f=>{b.value=!1,M.value=!0,n("error",f)},J=()=>{if(w.isServer)return;b.value=!0,M.value=!1;const f=new Image;f.onload=A=>p(A),f.onerror=re,Object.keys(a||{}).forEach(A=>{if(A.toLowerCase()==="onload")return;const v=(a||{})[A];f.setAttribute(A,v)}),f.src=e.src},ie=he.useThrottleFn(se,200),oe=()=>{w.isServer||!I.value||!ie||(E(),I.value=void 0)};function se(){w.isInContainer(L.value,I.value)&&(J(),oe())}const le=async()=>{if(w.isServer)return;await i.nextTick();const{scrollContainer:f}=e;st(f)?I.value=f:w.isString(f)&&f!==""?I.value=document.querySelector(f)??void 0:L.value&&(I.value=w.getScrollContainer(L.value)),I.value&&(E=he.useEventListener(I,"scroll",ie),setTimeout(()=>se(),200))},xe=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Me=()=>{!Y.value||e.disablePreview||(m=he.useEventListener("wheel",xe,{passive:!1}),He=document.body.style.overflow,document.body.style.overflow="hidden",F.value=!0)},ce=()=>{m==null||m(),document.body.style.overflow=He,F.value=!1};i.watch(()=>e.src,()=>{e.lazy?(b.value=!0,M.value=!1,oe(),le()):J()});const G=f=>w.isNumber(f)?f+"px":f;return de.onMountedOrActivated(()=>{e.lazy?le():J()}),()=>{const{crossorigin:f,decoding:A,alt:v,sizes:W,srcset:q,usemap:Ie,class:U,style:Ae={}}=a,Ne={crossorigin:f,decoding:A,alt:v,sizes:W,srcset:q,usemap:Ie,style:{...B.value,height:e.height?G(e.height):void 0}},fe=w.getSlotVNode(t,e,"fallback"),ue=w.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var P,ee;Y.value&&F.value?(P=c.value)==null||P.setOpen(!0):(ee=c.value)==null||ee.setOpen(!1)}),o(i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${U}`]:!!U},ref:P=>L.value=P,style:{width:e.width?G(e.width):void 0,height:e.height?G(e.height):void 0,display:e.lazy?"block":void 0,...Ae},onClick:()=>{n("click")}},[b.value?ue||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null):M.value?fe||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(Ne,{class:{[`${s.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${r}-inner`]:!0,[`${r}-preview`]:Y.value},alt:e.alt,src:u.value,onClick:()=>Me()}),null),i.createVNode(De,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:K.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>ce()},null)]))}}});V.isGImage=!0,V.install=e=>(e.component(V.name,V),e),h.GImage=V,h.ImageViewer=De,h.default=V,h.imagePorps=Z,h.imageViewProps=Te,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(h,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@ctrl/tinycolor"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@ctrl/tinycolor","@vueuse/core"],a):(h=typeof globalThis<"u"?globalThis:h||self,a(h.GImage={},h.vue,h.iconsVue,h.proUtils,h.proHooks,h.proProvider,h.tinycolor,h.core))})(this,function(h,a,x,m,$e,A,J,Me){"use strict";const k={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},current:{type:Number,default:0},getContainer:{type:String}},Pe={preview:{type:Object,default:()=>({current:0,infinite:!0,onHideOnClickModal:!0})},showPreview:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:Boolean,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},imageClassName:String,imageStyle:Object,width:Number,height:Number,zIndex:k.zIndex,getContainer:k.getContainer},V={previewUrls:{type:Array,default:()=>[]},disabled:Boolean,zIndex:k.zIndex,current:k.current,infinite:k.infinite,getContainer:Pe.getContainer,onHideOnClickModal:Boolean,countRender:[Function,Array,Object],icons:{type:Object,default:()=>({})}};function wn(e,t){process.env.NODE_ENV!=="production"&&!e&&console!==void 0&&console.error(`Warning: ${t}`)}const yn=new A.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),bn=new A.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Sn=new A.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),Tn=new A.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),ct=e=>({position:e||"absolute",inset:0});function xe(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const In=e=>{const{previewCls:t,modalMaskBg:n,paddingSM:r,marginXL:o,margin:i,paddingLG:l,previewOperationColorDisabled:s,previewOperationHoverColor:g,motionDurationSlow:d,iconCls:S,colorTextLightSolid:O}=e,y=new J.TinyColor(n).setAlpha(.1),p=y.clone().setAlpha(.2);return{[`${t}-footer`]:{position:"fixed",bottom:o,left:{_skip_check_:!0,value:"50%"},display:"flex",flexDirection:"column",alignItems:"center",color:e.previewOperationColor,transform:"translateX(-50%)"},[`${t}-progress`]:{marginBottom:i},[`${t}-close`]:{position:"fixed",top:o,right:{_skip_check_:!0,value:o},display:"flex",color:O,backgroundColor:y.toRgbString(),borderRadius:"50%",padding:r,outline:0,border:0,cursor:"pointer",transition:`all ${d}`,"&:hover":{backgroundColor:p.toRgbString()},[`& > ${S}`]:{fontSize:e.previewOperationSize}},[`${t}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${A.unit(l)}`,backgroundColor:y.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:r,padding:r,cursor:"pointer",transition:`all ${d}`,userSelect:"none",[`&:not(${t}-operations-operation-disabled):hover > ${S}`]:{color:g},"&-disabled":{color:s,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${S}`]:{fontSize:e.previewOperationSize}}}}},Cn=e=>{const{modalMaskBg:t,iconCls:n,previewOperationColorDisabled:r,previewCls:o,zIndexPopup:i,motionDurationSlow:l}=e,s=new J.TinyColor(t).setAlpha(.1),g=s.clone().setAlpha(.2);return{[`${o}-switch-left, ${o}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:e.calc(i).add(1).equal(),display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:e.previewOperationColor,background:s.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${l}`,userSelect:"none","&:hover":{background:g.toRgbString()},"&-disabled":{"&, &:hover":{color:r,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:e.previewOperationSize}},[`${o}-switch-left`]:{insetInlineStart:e.marginSM},[`${o}-switch-right`]:{insetInlineEnd:e.marginSM}}},On=e=>({[e.componentCls]:{height:"100%",textAlign:"center",pointerEvents:"none","&-root":{...xe("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-wrap":{...xe("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-mask":{...xe("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},"&-body":{...ct(),overflow:"hidden"},"&-img":{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto","&-wrapper":{...ct(),display:"flex",justifyContent:"center",alignItems:"center",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}}},"&-fade-appear, &-fade-enter":{animationName:yn,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-fade-leave":{animationName:bn,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-zoom-appear, &-zoom-enter":{animationName:Sn,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},"&-zoom-enter-active":{animationPlayState:"running"},"&-zoom-leave":{animationName:Tn,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[In(e),Cn(e)]});function En(e){return A.useStyle("ImageViewer",t=>{const n=A.mergeToken(t,{zIndexPopup:t.zIndexPopupBase+80,previewOperationColorDisabled:new J.TinyColor(t.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationHoverColor:new J.TinyColor(t.colorTextLightSolid).setAlpha(.85).toRgbString(),modalMaskBg:new J.TinyColor("#000").setAlpha(.45).toRgbString(),previewOperationColor:new J.TinyColor(t.colorTextLightSolid).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5,imagePreviewSwitchSize:t.controlHeightLG,iconCls:"anticon",previewCls:t.componentCls});return[On(n)]},e)}function Nn(e){const t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.scrollX||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.scrollY||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function _n(){const e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function st(e,t,n,r){const o=t+n,i=(n-r)/2;if(n>r){if(t>0)return{[e]:i};if(t<0&&o<r)return{[e]:-i}}else if(t<0||o>r)return{[e]:t<0?i:-i};return{}}function An(e,t,n,r){const{width:o,height:i}=_n();let l=null;return e<=o&&t<=i?l={x:0,y:0}:(e>o||t>i)&&(l={...st("x",n,e,o),...st("y",r,t,i)}),l}let ut=!1;try{const e=Object.defineProperty({},"passive",{get(){ut=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch{}function ee(e,t,n,r){if(e&&e.addEventListener){let o=r;o===void 0&&ut&&(t==="touchstart"||t==="touchmove"||t==="wheel")&&(o={passive:!1}),e.addEventListener(t,n,o)}return{remove:()=>{e&&e.removeEventListener&&e.removeEventListener(t,n)}}}const u={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){const{keyCode:n}=t;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=u.F1&&n<=u.F12)return!1;switch(n){case u.ALT:case u.CAPS_LOCK:case u.CONTEXT_MENU:case u.CTRL:case u.DOWN:case u.END:case u.ESC:case u.HOME:case u.INSERT:case u.LEFT:case u.MAC_FF_META:case u.META:case u.NUMLOCK:case u.NUM_CENTER:case u.PAGE_DOWN:case u.PAGE_UP:case u.PAUSE:case u.PRINT_SCREEN:case u.RIGHT:case u.SHIFT:case u.UP:case u.WIN_KEY:case u.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=u.ZERO&&t<=u.NINE||t>=u.NUM_ZERO&&t<=u.NUM_MULTIPLY||t>=u.A&&t<=u.Z||window.navigator.userAgent.includes("WebKit")&&t===0)return!0;switch(t){case u.SPACE:case u.QUESTION_MARK:case u.NUM_PLUS:case u.NUM_MINUS:case u.NUM_PERIOD:case u.NUM_DIVISION:case u.SEMICOLON:case u.DASH:case u.EQUALS:case u.COMMA:case u.PERIOD:case u.SLASH:case u.APOSTROPHE:case u.SINGLE_QUOTE:case u.OPEN_SQUARE_BRACKET:case u.BACKSLASH:case u.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};let ft=e=>setTimeout(e,16),dt=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(ft=e=>window.requestAnimationFrame(e),dt=e=>window.cancelAnimationFrame(e));let gt=0;const Le=new Map;function ht(e){Le.delete(e)}function je(e,t=1){gt+=1;const n=gt;function r(o){if(o===0)ht(n),e();else{const i=ft(()=>{r(o-1)});Le.set(n,i)}}return r(t),n}je.cancel=e=>{const t=Le.get(e);return ht(t),dt(t)};function $n(e){const t=a.ref(null),n=a.reactive({...e}),r=a.ref([]),o=i=>{t.value===null&&(r.value=[],t.value=je(()=>{let l;r.value.forEach(s=>{l={...l,...s}}),Object.assign(n,l),t.value=null})),r.value.push(i)};return a.onMounted(()=>{t.value&&je.cancel(t.value)}),[n,o]}const Mn=a.defineComponent({name:"Operations",inheritAttrs:!1,props:{open:Boolean,count:{type:Number,default:0},current:{type:Number,default:0},showSwitch:Boolean,showProgress:Boolean,prefixCls:String,hashId:String,zIndex:V.zIndex,icons:V.icons,infinite:V.infinite,getContainer:V.getContainer,countRender:V.countRender,tools:Array,onClose:Function,onActive:Function},setup(e){const t=(n,r)=>{var o;n.preventDefault(),n.stopPropagation(),(o=e.onActive)==null||o.call(e,r)};return()=>{const{prefixCls:n,hashId:r,tools:o}=e,i=A.getTransitionProps(`${e.prefixCls}-fade`),l=`${n}-operations-operation`,s=`${n}-operations-icon`;return a.createVNode(a.Teleport,{to:e.getContainer||"body"},{default:()=>[a.createVNode(a.Transition,i,{default:()=>{var g,d,S,O;return[a.withDirectives(a.createVNode("div",{class:m.classNames(`${n}-operations-wrapper`,r),style:{zIndex:e.zIndex}},[((g=e.icons)==null?void 0:g.close)===null?null:a.createVNode("button",{class:`${n}-close ${r}`,onClick:e.onClose},[((d=e.icons)==null?void 0:d.close)||a.createVNode(x.CloseOutlined,null,null)]),e.showSwitch&&a.createVNode(a.Fragment,null,[a.createVNode("div",{class:m.classNames(`${n}-switch-left ${r}`,{[`${n}-switch-left-disabled`]:e.infinite?!1:e.current===0}),onClick:y=>t(y,-1)},[((S=e.icons)==null?void 0:S.left)||a.createVNode(x.LeftOutlined,null,null)]),a.createVNode("div",{className:m.classNames(`${n}-switch-right ${r}`,{[`${n}-switch-right-disabled`]:e.infinite?!1:e.current===e.count-1}),onClick:y=>t(y,1)},[((O=e.icons)==null?void 0:O.right)||a.createVNode(x.RightOutlined,null,null)])]),a.createVNode("div",{class:`${n}-footer ${r}`},[e.showProgress&&a.createVNode("div",{class:`${n}-progress`},[e.countRender?e.countRender(e.current+1,e.count):`${e.current+1} / ${e.count}`]),a.createVNode("div",{class:`${e.prefixCls}-operations`},[o==null?void 0:o.map(({icon:y,onClick:p,type:_,disabled:I})=>a.createVNode("div",{class:m.classNames(l,{[`${e.prefixCls}-operations-operation-disabled`]:I&&(I==null?void 0:I.value)}),onClick:p,key:_},[a.cloneVNode(y,{class:s})]))])])]),[[a.vShow,e.open]])]}})]})}}});var pt=typeof global=="object"&&global&&global.Object===Object&&global,Pn=typeof self=="object"&&self&&self.Object===Object&&self,$=pt||Pn||Function("return this")(),M=$.Symbol,mt=Object.prototype,xn=mt.hasOwnProperty,Ln=mt.toString,se=M?M.toStringTag:void 0;function jn(e){var t=xn.call(e,se),n=e[se];try{e[se]=void 0;var r=!0}catch{}var o=Ln.call(e);return r&&(t?e[se]=n:delete e[se]),o}var Rn=Object.prototype,Dn=Rn.toString;function zn(e){return Dn.call(e)}var Fn="[object Null]",Un="[object Undefined]",vt=M?M.toStringTag:void 0;function H(e){return e==null?e===void 0?Un:Fn:vt&&vt in Object(e)?jn(e):zn(e)}function G(e){return e!=null&&typeof e=="object"}var Bn="[object Symbol]";function Re(e){return typeof e=="symbol"||G(e)&&H(e)==Bn}function wt(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var D=Array.isArray,Vn=1/0,yt=M?M.prototype:void 0,bt=yt?yt.toString:void 0;function St(e){if(typeof e=="string")return e;if(D(e))return wt(e,St)+"";if(Re(e))return bt?bt.call(e):"";var t=e+"";return t=="0"&&1/e==-Vn?"-0":t}function K(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Hn(e){return e}var Gn="[object AsyncFunction]",Kn="[object Function]",Yn="[object GeneratorFunction]",Wn="[object Proxy]";function Tt(e){if(!K(e))return!1;var t=H(e);return t==Kn||t==Yn||t==Gn||t==Wn}var De=$["__core-js_shared__"],It=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Xn(e){return!!It&&It in e}var Zn=Function.prototype,Qn=Zn.toString;function Y(e){if(e!=null){try{return Qn.call(e)}catch{}try{return e+""}catch{}}return""}var qn=/[\\^$.*+?()[\]{}|]/g,Jn=/^\[object .+?Constructor\]$/,kn=Function.prototype,er=Object.prototype,tr=kn.toString,nr=er.hasOwnProperty,rr=RegExp("^"+tr.call(nr).replace(qn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function or(e){if(!K(e)||Xn(e))return!1;var t=Tt(e)?rr:Jn;return t.test(Y(e))}function ar(e,t){return e==null?void 0:e[t]}function W(e,t){var n=ar(e,t);return or(n)?n:void 0}var ze=W($,"WeakMap"),Ct=Object.create,ir=function(){function e(){}return function(t){if(!K(t))return{};if(Ct)return Ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function lr(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cr(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var sr=800,ur=16,fr=Date.now;function dr(e){var t=0,n=0;return function(){var r=fr(),o=ur-(r-n);if(n=r,o>0){if(++t>=sr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function gr(e){return function(){return e}}var we=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch{}}(),hr=we?function(e,t){return we(e,"toString",{configurable:!0,enumerable:!1,value:gr(t),writable:!0})}:Hn,pr=dr(hr);function mr(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var vr=9007199254740991,wr=/^(?:0|[1-9]\d*)$/;function Fe(e,t){var n=typeof e;return t=t??vr,!!t&&(n=="number"||n!="symbol"&&wr.test(e))&&e>-1&&e%1==0&&e<t}function Ot(e,t,n){t=="__proto__"&&we?we(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Et(e,t){return e===t||e!==e&&t!==t}var yr=Object.prototype,br=yr.hasOwnProperty;function Ue(e,t,n){var r=e[t];(!(br.call(e,t)&&Et(r,n))||n===void 0&&!(t in e))&&Ot(e,t,n)}function ue(e,t,n,r){var o=!n;n||(n={});for(var i=-1,l=t.length;++i<l;){var s=t[i],g=void 0;g===void 0&&(g=e[s]),o?Ot(n,s,g):Ue(n,s,g)}return n}var Nt=Math.max;function Sr(e,t,n){return t=Nt(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Nt(r.length-t,0),l=Array(i);++o<i;)l[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(l),lr(e,this,s)}}var Tr=9007199254740991;function Be(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tr}function _t(e){return e!=null&&Be(e.length)&&!Tt(e)}var Ir=Object.prototype;function Ve(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ir;return e===n}function Cr(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Or="[object Arguments]";function At(e){return G(e)&&H(e)==Or}var $t=Object.prototype,Er=$t.hasOwnProperty,Nr=$t.propertyIsEnumerable,He=At(function(){return arguments}())?At:function(e){return G(e)&&Er.call(e,"callee")&&!Nr.call(e,"callee")};function _r(){return!1}var Mt=typeof h=="object"&&h&&!h.nodeType&&h,Pt=Mt&&typeof module=="object"&&module&&!module.nodeType&&module,Ar=Pt&&Pt.exports===Mt,xt=Ar?$.Buffer:void 0,$r=xt?xt.isBuffer:void 0,Lt=$r||_r,Mr="[object Arguments]",Pr="[object Array]",xr="[object Boolean]",Lr="[object Date]",jr="[object Error]",Rr="[object Function]",Dr="[object Map]",zr="[object Number]",Fr="[object Object]",Ur="[object RegExp]",Br="[object Set]",Vr="[object String]",Hr="[object WeakMap]",Gr="[object ArrayBuffer]",Kr="[object DataView]",Yr="[object Float32Array]",Wr="[object Float64Array]",Xr="[object Int8Array]",Zr="[object Int16Array]",Qr="[object Int32Array]",qr="[object Uint8Array]",Jr="[object Uint8ClampedArray]",kr="[object Uint16Array]",eo="[object Uint32Array]",w={};w[Yr]=w[Wr]=w[Xr]=w[Zr]=w[Qr]=w[qr]=w[Jr]=w[kr]=w[eo]=!0,w[Mr]=w[Pr]=w[Gr]=w[xr]=w[Kr]=w[Lr]=w[jr]=w[Rr]=w[Dr]=w[zr]=w[Fr]=w[Ur]=w[Br]=w[Vr]=w[Hr]=!1;function to(e){return G(e)&&Be(e.length)&&!!w[H(e)]}function Ge(e){return function(t){return e(t)}}var jt=typeof h=="object"&&h&&!h.nodeType&&h,fe=jt&&typeof module=="object"&&module&&!module.nodeType&&module,no=fe&&fe.exports===jt,Ke=no&&pt.process,te=function(){try{var e=fe&&fe.require&&fe.require("util").types;return e||Ke&&Ke.binding&&Ke.binding("util")}catch{}}(),Rt=te&&te.isTypedArray,ro=Rt?Ge(Rt):to,oo=Object.prototype,ao=oo.hasOwnProperty;function Dt(e,t){var n=D(e),r=!n&&He(e),o=!n&&!r&&Lt(e),i=!n&&!r&&!o&&ro(e),l=n||r||o||i,s=l?Cr(e.length,String):[],g=s.length;for(var d in e)(t||ao.call(e,d))&&!(l&&(d=="length"||o&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Fe(d,g)))&&s.push(d);return s}function zt(e,t){return function(n){return e(t(n))}}var io=zt(Object.keys,Object),lo=Object.prototype,co=lo.hasOwnProperty;function so(e){if(!Ve(e))return io(e);var t=[];for(var n in Object(e))co.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ye(e){return _t(e)?Dt(e):so(e)}function uo(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var fo=Object.prototype,go=fo.hasOwnProperty;function ho(e){if(!K(e))return uo(e);var t=Ve(e),n=[];for(var r in e)r=="constructor"&&(t||!go.call(e,r))||n.push(r);return n}function We(e){return _t(e)?Dt(e,!0):ho(e)}var po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mo=/^\w*$/;function vo(e,t){if(D(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Re(e)?!0:mo.test(e)||!po.test(e)||t!=null&&e in Object(t)}var de=W(Object,"create");function wo(){this.__data__=de?de(null):{},this.size=0}function yo(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var bo="__lodash_hash_undefined__",So=Object.prototype,To=So.hasOwnProperty;function Io(e){var t=this.__data__;if(de){var n=t[e];return n===bo?void 0:n}return To.call(t,e)?t[e]:void 0}var Co=Object.prototype,Oo=Co.hasOwnProperty;function Eo(e){var t=this.__data__;return de?t[e]!==void 0:Oo.call(t,e)}var No="__lodash_hash_undefined__";function _o(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=de&&t===void 0?No:t,this}function X(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}X.prototype.clear=wo,X.prototype.delete=yo,X.prototype.get=Io,X.prototype.has=Eo,X.prototype.set=_o;function Ao(){this.__data__=[],this.size=0}function ye(e,t){for(var n=e.length;n--;)if(Et(e[n][0],t))return n;return-1}var $o=Array.prototype,Mo=$o.splice;function Po(e){var t=this.__data__,n=ye(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Mo.call(t,n,1),--this.size,!0}function xo(e){var t=this.__data__,n=ye(t,e);return n<0?void 0:t[n][1]}function Lo(e){return ye(this.__data__,e)>-1}function jo(e,t){var n=this.__data__,r=ye(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function L(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}L.prototype.clear=Ao,L.prototype.delete=Po,L.prototype.get=xo,L.prototype.has=Lo,L.prototype.set=jo;var ge=W($,"Map");function Ro(){this.size=0,this.__data__={hash:new X,map:new(ge||L),string:new X}}function Do(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function be(e,t){var n=e.__data__;return Do(t)?n[typeof t=="string"?"string":"hash"]:n.map}function zo(e){var t=be(this,e).delete(e);return this.size-=t?1:0,t}function Fo(e){return be(this,e).get(e)}function Uo(e){return be(this,e).has(e)}function Bo(e,t){var n=be(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function z(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}z.prototype.clear=Ro,z.prototype.delete=zo,z.prototype.get=Fo,z.prototype.has=Uo,z.prototype.set=Bo;var Vo="Expected a function";function Xe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Vo);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var l=e.apply(this,r);return n.cache=i.set(o,l)||i,l};return n.cache=new(Xe.Cache||z),n}Xe.Cache=z;var Ho=500;function Go(e){var t=Xe(e,function(r){return n.size===Ho&&n.clear(),r}),n=t.cache;return t}var Ko=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yo=/\\(\\)?/g,Wo=Go(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ko,function(n,r,o,i){t.push(o?i.replace(Yo,"$1"):r||n)}),t});function Xo(e){return e==null?"":St(e)}function ne(e,t){return D(e)?e:vo(e,t)?[e]:Wo(Xo(e))}var Zo=1/0;function Se(e){if(typeof e=="string"||Re(e))return e;var t=e+"";return t=="0"&&1/e==-Zo?"-0":t}function Ft(e,t){t=ne(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Se(t[n++])];return n&&n==r?e:void 0}function Ze(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Ut=M?M.isConcatSpreadable:void 0;function Qo(e){return D(e)||He(e)||!!(Ut&&e&&e[Ut])}function qo(e,t,n,r,o){var i=-1,l=e.length;for(n||(n=Qo),o||(o=[]);++i<l;){var s=e[i];n(s)?Ze(o,s):o[o.length]=s}return o}function Jo(e){var t=e==null?0:e.length;return t?qo(e):[]}function Bt(e){return pr(Sr(e,void 0,Jo),e+"")}var Qe=zt(Object.getPrototypeOf,Object),ko="[object Object]",ea=Function.prototype,ta=Object.prototype,Vt=ea.toString,na=ta.hasOwnProperty,ra=Vt.call(Object);function oa(e){if(!G(e)||H(e)!=ko)return!1;var t=Qe(e);if(t===null)return!0;var n=na.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Vt.call(n)==ra}function aa(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function ia(){this.__data__=new L,this.size=0}function la(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ca(e){return this.__data__.get(e)}function sa(e){return this.__data__.has(e)}var ua=200;function fa(e,t){var n=this.__data__;if(n instanceof L){var r=n.__data__;if(!ge||r.length<ua-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new z(r)}return n.set(e,t),this.size=n.size,this}function re(e){var t=this.__data__=new L(e);this.size=t.size}re.prototype.clear=ia,re.prototype.delete=la,re.prototype.get=ca,re.prototype.has=sa,re.prototype.set=fa;function da(e,t){return e&&ue(t,Ye(t),e)}function ga(e,t){return e&&ue(t,We(t),e)}var Ht=typeof h=="object"&&h&&!h.nodeType&&h,Gt=Ht&&typeof module=="object"&&module&&!module.nodeType&&module,ha=Gt&&Gt.exports===Ht,Kt=ha?$.Buffer:void 0,Yt=Kt?Kt.allocUnsafe:void 0;function pa(e,t){if(t)return e.slice();var n=e.length,r=Yt?Yt(n):new e.constructor(n);return e.copy(r),r}function ma(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var l=e[n];t(l,n,e)&&(i[o++]=l)}return i}function Wt(){return[]}var va=Object.prototype,wa=va.propertyIsEnumerable,Xt=Object.getOwnPropertySymbols,qe=Xt?function(e){return e==null?[]:(e=Object(e),ma(Xt(e),function(t){return wa.call(e,t)}))}:Wt;function ya(e,t){return ue(e,qe(e),t)}var ba=Object.getOwnPropertySymbols,Zt=ba?function(e){for(var t=[];e;)Ze(t,qe(e)),e=Qe(e);return t}:Wt;function Sa(e,t){return ue(e,Zt(e),t)}function Qt(e,t,n){var r=t(e);return D(e)?r:Ze(r,n(e))}function Ta(e){return Qt(e,Ye,qe)}function qt(e){return Qt(e,We,Zt)}var Je=W($,"DataView"),ke=W($,"Promise"),et=W($,"Set"),Jt="[object Map]",Ia="[object Object]",kt="[object Promise]",en="[object Set]",tn="[object WeakMap]",nn="[object DataView]",Ca=Y(Je),Oa=Y(ge),Ea=Y(ke),Na=Y(et),_a=Y(ze),j=H;(Je&&j(new Je(new ArrayBuffer(1)))!=nn||ge&&j(new ge)!=Jt||ke&&j(ke.resolve())!=kt||et&&j(new et)!=en||ze&&j(new ze)!=tn)&&(j=function(e){var t=H(e),n=t==Ia?e.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case Ca:return nn;case Oa:return Jt;case Ea:return kt;case Na:return en;case _a:return tn}return t});var Aa=Object.prototype,$a=Aa.hasOwnProperty;function Ma(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$a.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var rn=$.Uint8Array;function tt(e){var t=new e.constructor(e.byteLength);return new rn(t).set(new rn(e)),t}function Pa(e,t){var n=t?tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var xa=/\w*$/;function La(e){var t=new e.constructor(e.source,xa.exec(e));return t.lastIndex=e.lastIndex,t}var on=M?M.prototype:void 0,an=on?on.valueOf:void 0;function ja(e){return an?Object(an.call(e)):{}}function Ra(e,t){var n=t?tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Da="[object Boolean]",za="[object Date]",Fa="[object Map]",Ua="[object Number]",Ba="[object RegExp]",Va="[object Set]",Ha="[object String]",Ga="[object Symbol]",Ka="[object ArrayBuffer]",Ya="[object DataView]",Wa="[object Float32Array]",Xa="[object Float64Array]",Za="[object Int8Array]",Qa="[object Int16Array]",qa="[object Int32Array]",Ja="[object Uint8Array]",ka="[object Uint8ClampedArray]",ei="[object Uint16Array]",ti="[object Uint32Array]";function ni(e,t,n){var r=e.constructor;switch(t){case Ka:return tt(e);case Da:case za:return new r(+e);case Ya:return Pa(e,n);case Wa:case Xa:case Za:case Qa:case qa:case Ja:case ka:case ei:case ti:return Ra(e,n);case Fa:return new r;case Ua:case Ha:return new r(e);case Ba:return La(e);case Va:return new r;case Ga:return ja(e)}}function ri(e){return typeof e.constructor=="function"&&!Ve(e)?ir(Qe(e)):{}}var oi="[object Map]";function ai(e){return G(e)&&j(e)==oi}var ln=te&&te.isMap,ii=ln?Ge(ln):ai,li="[object Set]";function ci(e){return G(e)&&j(e)==li}var cn=te&&te.isSet,si=cn?Ge(cn):ci,ui=1,fi=2,di=4,sn="[object Arguments]",gi="[object Array]",hi="[object Boolean]",pi="[object Date]",mi="[object Error]",un="[object Function]",vi="[object GeneratorFunction]",wi="[object Map]",yi="[object Number]",fn="[object Object]",bi="[object RegExp]",Si="[object Set]",Ti="[object String]",Ii="[object Symbol]",Ci="[object WeakMap]",Oi="[object ArrayBuffer]",Ei="[object DataView]",Ni="[object Float32Array]",_i="[object Float64Array]",Ai="[object Int8Array]",$i="[object Int16Array]",Mi="[object Int32Array]",Pi="[object Uint8Array]",xi="[object Uint8ClampedArray]",Li="[object Uint16Array]",ji="[object Uint32Array]",v={};v[sn]=v[gi]=v[Oi]=v[Ei]=v[hi]=v[pi]=v[Ni]=v[_i]=v[Ai]=v[$i]=v[Mi]=v[wi]=v[yi]=v[fn]=v[bi]=v[Si]=v[Ti]=v[Ii]=v[Pi]=v[xi]=v[Li]=v[ji]=!0,v[mi]=v[un]=v[Ci]=!1;function Te(e,t,n,r,o,i){var l,s=t&ui,g=t&fi,d=t&di;if(n&&(l=o?n(e,r,o,i):n(e)),l!==void 0)return l;if(!K(e))return e;var S=D(e);if(S){if(l=Ma(e),!s)return cr(e,l)}else{var O=j(e),y=O==un||O==vi;if(Lt(e))return pa(e,s);if(O==fn||O==sn||y&&!o){if(l=g||y?{}:ri(e),!s)return g?Sa(e,ga(l,e)):ya(e,da(l,e))}else{if(!v[O])return o?e:{};l=ni(e,O,s)}}i||(i=new re);var p=i.get(e);if(p)return p;i.set(e,l),si(e)?e.forEach(function(C){l.add(Te(C,t,n,C,e,i))}):ii(e)&&e.forEach(function(C,b){l.set(b,Te(C,t,n,b,e,i))});var _=d?g?qt:Ta:g?We:Ye,I=S?void 0:_(e);return mr(I||e,function(C,b){I&&(b=C,C=e[b]),Ue(l,b,Te(C,t,n,b,e,i))}),l}function Ri(e,t){return e!=null&&t in Object(e)}function Di(e,t,n){t=ne(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var l=Se(t[r]);if(!(i=e!=null&&n(e,l)))break;e=e[l]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&Be(o)&&Fe(l,o)&&(D(e)||He(e)))}function zi(e,t){return e!=null&&Di(e,t,Ri)}function Fi(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ui(e,t){return t.length<2?e:Ft(e,aa(t,0,-1))}function Bi(e,t){return t=ne(t,e),e=Ui(e,t),e==null||delete e[Se(Fi(t))]}function Vi(e){return oa(e)?void 0:e}var Hi=1,Gi=2,Ki=4,Yi=Bt(function(e,t){var n={};if(e==null)return n;var r=!1;t=wt(t,function(i){return i=ne(i,e),r||(r=i.length>1),i}),ue(e,qt(e),n),r&&(n=Te(n,Hi|Gi|Ki,Vi));for(var o=t.length;o--;)Bi(n,t[o]);return n});function Wi(e,t,n,r){if(!K(e))return e;t=ne(t,e);for(var o=-1,i=t.length,l=i-1,s=e;s!=null&&++o<i;){var g=Se(t[o]),d=n;if(g==="__proto__"||g==="constructor"||g==="prototype")return e;if(o!=l){var S=s[g];d=void 0,d===void 0&&(d=K(S)?S:Fe(t[o+1])?[]:{})}Ue(s,g,d),s=s[g]}return e}function Xi(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var l=t[r],s=Ft(e,l);n(s,l)&&Wi(i,ne(l,e),s)}return i}function Zi(e,t){return Xi(e,t,function(n,r){return zi(e,r)})}var Qi=Bt(function(e,t){return e==null?{}:Zi(e,t)});const Z={x:0,y:0},oe={rotateLeft:a.createVNode(x.RotateLeftOutlined,null,null),rotateRight:a.createVNode(x.RotateRightOutlined,null,null),zoomIn:a.createVNode(x.ZoomInOutlined,null,null),zoomOut:a.createVNode(x.ZoomOutOutlined,null,null),flipX:a.createVNode(x.SwapOutlined,null,null),flipY:a.createVNode(x.SwapOutlined,{rotate:90},null)},dn=["close","left","right","rotateRight","rotateRight","zoomOut","flipX","flipY","rotateLeft"],gn=a.defineComponent({name:"GImageViewer",props:V,inheritAttrs:!1,emits:["close","switch","afterClose"],emit:Object,setup:(e,{emit:t,expose:n,slots:r})=>{const o=m.getPrefixCls({suffixCls:"image-view"}),{wrapSSR:i,hashId:l}=En(o),[s,g]=$e.useState(!1),[d,S]=$e.useState(!1),O=a.ref(null),y=a.ref(e.current),p=a.shallowRef(1),_=a.shallowRef(0),I=a.shallowRef(!1),C=a.reactive({x:1,y:1}),[b,F]=$n(Z),he=a.shallowRef({wheelDirection:0}),Q=a.shallowRef(),P=a.reactive({originX:0,originY:0,deltaX:0,deltaY:0}),q=a.reactive(new Map),ie=a.computed(()=>new Map(Array.from(q).map(([c,{url:T}])=>[c,T]))),Ie=a.computed(()=>ie.value.get(y.value)),le=a.computed(()=>ie.value.size),pe=a.computed(()=>Array.from(ie.value.keys())),U=a.computed(()=>pe.value.indexOf(y.value)),Ce=a.computed(()=>le.value>1),me=a.computed(()=>le.value>=1);a.watch(s,c=>{c&&(d.value=!0)});const f=c=>{y.value=c};a.watch(()=>e.current,c=>{m.isNumber(c)&&f(c)});function E(c,T){q.set(c,{url:T,loading:!0,canPreview:!1})}const R=()=>{S(!1),y.value=e.current},rt=()=>{p.value=1,_.value=0,C.x=1,C.y=1,F(Z),t("close")},ot=c=>{I.value||O.value===(c==null?void 0:c.target)&&R()},at=()=>{const c=q.get(y.value);c&&(c.loading=!1,c.canPreview=!0)},Oe=c=>{const T=q.get(y.value);T&&(T.loading=!1,T.canPreview=!1),c.target.alt="加载失败"},Ee=()=>{if(U.value>0||e.infinite){const c=U.value-1<0?e.previewUrls.length-1:U.value-1;f(pe.value[c])}},Ne=()=>{if(U.value<le.value-1||e.infinite){const c=U.value+1>e.previewUrls.length-1?0:U.value+1;f(pe.value[c])}},ce=c=>{c?p.value+=.5:p.value++,F(Z)},ve=c=>{p.value>1&&(c?p.value-=.5:p.value--),F(Z)},it=()=>{_.value+=90},tl=()=>{_.value-=90},nl=()=>{C.x=-C.x},rl=()=>{C.y=-C.y},pn=[{icon:m.getSlotVNode(r,e.icons,"zoomIn")||oe.zoomIn,onClick:()=>ce(),type:"zoomIn"},{icon:m.getSlotVNode(r,e.icons,"zoomOut")||oe.zoomOut,onClick:()=>ve(),type:"zoomOut",disabled:a.computed(()=>p.value===1)},{icon:m.getSlotVNode(r,e.icons,"rotateRight")||oe.rotateRight,onClick:it,type:"rotateRight"},{icon:m.getSlotVNode(r,e.icons,"rotateLeft")||oe.rotateLeft,onClick:tl,type:"rotateLeft"},{icon:m.getSlotVNode(r,e.icons,"flipX")||oe.flipX,onClick:nl,type:"flipX"},{icon:m.getSlotVNode(r,e.icons,"flipY")||oe.flipY,onClick:rl,type:"flipY"}],mn=()=>{if(s.value&&I.value&&Q.value){const c=Q.value.offsetWidth*p.value,T=Q.value.offsetHeight*p.value,{left:B,top:N}=Nn(Q.value),_e=_.value%180!==0;I.value=!1;const Ae=An(_e?T:c,_e?c:T,B,N);Ae&&F({...Ae})}},ol=c=>{c.button===0&&(c.preventDefault(),c.stopPropagation(),P.deltaX=c.pageX-b.x,P.deltaY=c.pageY-b.y,P.originX=b.x,P.originY=b.y,I.value=!0)},vn=c=>{s.value&&I.value&&F({x:c.pageX-P.deltaX,y:c.pageY-P.deltaY})},al=c=>{if(!s.value)return;c.preventDefault();const T=c.deltaY;he.value={wheelDirection:T}},il=c=>{!s.value||!Ce.value||(c.keyCode===u.LEFT?Ee():c.keyCode===u.RIGHT&&Ne())},ll=()=>{s.value&&(p.value!==1&&(p.value=1),(b.x!==Z.x||b.y!==Z.y)&&F(Z))};let lt=()=>{};return a.onMounted(()=>{a.watch(()=>e.previewUrls,c=>{m.isArray(c)&&c.forEach((T,B)=>{E(B,T)})},{flush:"post",immediate:!0}),a.watch([()=>s.value,I],()=>{lt();let c,T;const B=ee(window,"mouseup",mn,!1),N=ee(window,"mousemove",vn,!1),_e=ee(window,"wheel",al,{passive:!1}),Ae=ee(window,"keydown",il,!1);try{window.top!==window.self&&(c=ee(window.top,"mouseup",mn,!1),T=ee(window.top,"mousemove",vn,!1))}catch(cl){wn(!1,`[vc-image] ${cl}`)}lt=()=>{B.remove(),N.remove(),_e.remove(),Ae.remove(),c&&c.remove(),T&&T.remove()}},{flush:"post",immediate:!0}),a.watch([he],()=>{const{wheelDirection:c}=he.value;c>0?ve(!0):c<0&&ce(!0)})}),a.onUnmounted(()=>{lt()}),n({setOpen:g}),()=>{const c=A.getTransitionProps(`${o}-fade`),T=A.getTransitionProps(`${o}-zoom`),B={};for(const N in e.icons)B[N]=m.getSlotVNode(r,e.icons,N);return i(a.createVNode(a.Fragment,null,[a.createVNode(a.Teleport,{to:e.getContainer||"body"},{default:()=>[s.value&&a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${o}-root ${l.value}`},[a.createVNode(a.Transition,c,{default:()=>[a.withDirectives(a.createVNode("div",{class:`${o}-mask ${l.value}`},null),[[a.vShow,s.value&&d.value]])]}),a.createVNode("div",{ref:O,tabindex:-1,class:[`${o}-wrap`,`${l.value}`],onClick:N=>e.onHideOnClickModal&&ot(N)},[a.createVNode(a.Transition,a.mergeProps(T,{onAfterLeave:()=>rt()}),{default:()=>[a.withDirectives(a.createVNode("div",{role:"dialog",class:`${o} ${l.value}`},[a.createVNode("div",{class:`${o}-content ${l.value}`},[a.createVNode("div",{class:`${o}-body ${l.value}`},[a.createVNode("div",{class:`${o}-img-wrapper ${l.value}`,style:{transform:`translate3d(${b.x}px, ${b.y}px, 0)`}},[a.createVNode("img",{onMousedown:ol,onDblclick:ll,ref:Q,class:`${o}-img ${l.value}`,src:Ie.value,onLoad:()=>at(),onError:N=>Oe(N),style:{transform:`scale3d(${C.x*p.value}, ${C.y*p.value}, 1) rotate(${_.value}deg)`}},null)])])])]),[[a.vShow,s.value&&d.value]])]})])])])]}),s.value&&d.value&&a.createVNode(Mn,{open:s.value&&d.value,hashId:l.value,count:e.previewUrls.length,current:y.value,zIndex:e.zIndex+1,getContainer:e.getContainer,prefixCls:o,icons:Yi(B,pn.map(({type:N})=>N)),tools:pn,infinite:e.infinite,countRender:m.getSlot(r,e,"countRenders"),showSwitch:Ce.value,showProgress:me.value,onClose:R,onActive:N=>N>0?Ne():Ee()},null)]))}}}),nt={width:"100%",height:"100%"},qi=()=>({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",opacity:0}),Ji=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden","&-inner":{...nt,verticalAlign:"top",opacity:1,[`&${e.componentCls}-inner-preview`]:{userSelect:"none"}},"&-placeholder":{...nt,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},"&-error":{...nt,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},"&-preview":qi()}}),ki=e=>e&&e.nodeType===Node.ELEMENT_NODE;let hn="";const el=[...dn,"fallback","placeholder"],ae=a.defineComponent({props:Pe,name:"GImage",emits:["error","click","load"],slots:Object,setup(e,{slots:t,emit:n,attrs:r}){const o=m.getPrefixCls({suffixCls:"image"}),{wrapSSR:i,hashId:l}=A.useProStyle("Image",[Ji],o),s=a.ref(),g=a.ref(""),d=a.ref(!1),S=a.ref(!0),O=a.ref(!1),y=a.ref(null),p=a.ref();let _,I;const C=a.computed(()=>!m.isServer&&e.fit?{"object-fit":e.fit}:{}),b=a.computed(()=>{const{previewUrls:f}=e.preview;return m.isArray(f)&&f.length>0||e.showPreview}),F=a.computed(()=>{const{previewUrls:f=[],current:E=0}=e.preview;if(m.isNumber(E))return f.length>=E?E:0;const R=f.indexOf(e.src);return R>=0?R:0}),he=f=>{g.value=e.src,S.value=!1,d.value=!1,n("load",f)},Q=f=>{S.value=!1,d.value=!0,n("error",f)},P=()=>{if(m.isServer)return;S.value=!0,d.value=!1;const f=new Image;f.onload=E=>he(E),f.onerror=Q,Object.keys(r||{}).forEach(E=>{if(E.toLowerCase()==="onload")return;const R=(r||{})[E];f.setAttribute(E,R)}),f.src=e.src},q=Me.useThrottleFn(Ie,200),ie=()=>{m.isServer||!p.value||!q||(_(),p.value=void 0)};function Ie(){m.isInContainer(y.value,p.value)&&(P(),ie())}const le=async()=>{if(m.isServer)return;await a.nextTick();const{scrollContainer:f}=e;ki(f)?p.value=f:m.isString(f)&&f!==""?p.value=document.querySelector(f)??void 0:y.value&&(p.value=m.getScrollContainer(y.value)),p.value&&(_=Me.useEventListener(p,"scroll",q),setTimeout(()=>Ie(),200))},pe=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},U=()=>{b.value&&(I=Me.useEventListener("wheel",pe,{passive:!1}),hn=document.body.style.overflow,document.body.style.overflow="hidden",O.value=!0)},Ce=()=>{I==null||I(),document.body.style.overflow=hn,O.value=!1};a.watch(()=>e.src,()=>{e.lazy?(S.value=!0,d.value=!1,ie(),le()):P()}),a.watchEffect(()=>{var f,E;b.value&&O.value?(f=s.value)==null||f.setOpen(!0):(E=s.value)==null||E.setOpen(!1)});const me=f=>m.isNumber(f)?f+"px":f;return $e.onMountedOrActivated(()=>{e.lazy?le():P()}),()=>{var ve;const{crossorigin:f,decoding:E,alt:R,sizes:rt,srcset:ot,usemap:at,class:Oe,style:Ee={}}=r,Ne={crossorigin:f,decoding:E,alt:R,sizes:rt,srcset:ot,usemap:at,style:{...C.value,height:e.height?me(e.height):void 0}},ce=m.getSlotsProps(el,t,e,{render:!0});return i(a.createVNode("div",{class:{[`${l.value}`]:!0,[`${o}`]:!0,[`${Oe}`]:!!Oe},ref:it=>y.value=it,style:{width:e.width?me(e.width):void 0,height:e.height?me(e.height):void 0,display:e.lazy?"block":void 0,...Ee},onClick:()=>{n("click")}},[S.value?ce.placeholder||a.createVNode("div",{class:`${o}-placeholder ${l.value}`},null):d.value?ce.fallback||a.createVNode("div",{class:`${o}-error ${l.value}`},[a.createTextVNode("加载失败")]):g.value&&a.createVNode("img",a.mergeProps(Ne,{class:{[`${l.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${o}-inner`]:!0,[`${o}-inner-preview`]:b.value},alt:e.alt,src:g.value}),null),b.value&&a.createVNode("div",{class:`${o}-preview ${l.value}`,onClick:()=>U()},null),b.value&&a.createVNode(gn,a.mergeProps({ref:s},e.preview,Qi(ce,dn),{previewUrls:((ve=e.preview)==null?void 0:ve.previewUrls)||[e.src],current:F.value,onClose:()=>Ce()}),null)]))}}});ae.isGImage=!0,ae.install=e=>(e.component(ae.name,ae),e),h.GImage=ae,h.ImagePreview=gn,h.baseProps=k,h.default=ae,h.imagePorps=Pe,h.imagePreviewProps=V,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
+ import imagePreviewProps, { type PreviewPropsIcons } from './ImagePreview/props';
1
2
  export * from './props';
2
3
  export type { GImageProps } from './Image';
3
- export { default as ImageViewer } from './components/ImageViewer';
4
+ export type { ImagePreviewProps } from './ImagePreview';
5
+ export type { PreviewPropsIcons };
6
+ export { imagePreviewProps };
7
+ export { default as ImagePreview } from './ImagePreview';
4
8
  export { default } from './Image';
5
9
  export { default as GImage } from './Image';
package/dist/props.d.ts CHANGED
@@ -1,20 +1,39 @@
1
- import type { PropType, VNode } from 'vue';
1
+ import type { CSSProperties, PropType } from 'vue';
2
2
  import type { CustomRender, WithFalse } from '@gx-design-vue/pro-utils';
3
- type PreviewPropsIons = {
4
- rotateLeft?: VNode;
5
- rotateRight?: VNode;
6
- zoomIn?: VNode;
7
- zoomOut?: VNode;
8
- close?: VNode;
9
- left?: VNode;
10
- right?: VNode;
11
- };
12
- export declare const imagePorps: {
13
- previewTeleported: {
3
+ import type { ImagePreviewProps } from './ImagePreview/props';
4
+ export declare const baseProps: {
5
+ infinite: {
14
6
  type: PropType<boolean>;
15
7
  default: boolean;
16
8
  };
17
- hideOnClickModal: {
9
+ zIndex: {
10
+ type: PropType<number>;
11
+ default: number;
12
+ };
13
+ current: {
14
+ type: PropType<number>;
15
+ default: number;
16
+ };
17
+ getContainer: {
18
+ type: PropType<string>;
19
+ };
20
+ };
21
+ export declare const imagePorps: {
22
+ preview: {
23
+ type: PropType<ImagePreviewProps>;
24
+ default: () => Partial<{
25
+ previewUrls: string[];
26
+ disabled: boolean;
27
+ zIndex: number;
28
+ current: number;
29
+ infinite: boolean;
30
+ getContainer: string;
31
+ onHideOnClickModal: boolean;
32
+ countRender: WithFalse<(current: number, total: number) => CustomRender>;
33
+ icons: import("./ImagePreview/props").PreviewPropsIcons;
34
+ }>;
35
+ };
36
+ showPreview: {
18
37
  type: PropType<boolean>;
19
38
  default: boolean;
20
39
  };
@@ -30,9 +49,7 @@ export declare const imagePorps: {
30
49
  type: PropType<"fill" | "contain" | "cover" | "none" | "scale-down">;
31
50
  default: string;
32
51
  };
33
- lazy: import("vue-types").VueTypeValidableDef<boolean> & {
34
- default: boolean;
35
- };
52
+ lazy: PropType<boolean>;
36
53
  scrollContainer: {
37
54
  type: PropType<string | HTMLElement | undefined>;
38
55
  };
@@ -53,70 +70,15 @@ export declare const imagePorps: {
53
70
  onClick: {
54
71
  type: PropType<(info: any) => void>;
55
72
  };
56
- disablePreview: import("vue-types").VueTypeValidableDef<boolean> & {
57
- default: boolean;
58
- };
59
- previewSrcList: {
60
- type: PropType<string[]>;
61
- default: () => string[];
62
- };
63
- imageClassName: import("vue-types").VueTypeValidableDef<string> & {
64
- default: string;
65
- };
66
- imageStyle: import("vue-types").VueTypeValidableDef<import("vue").CSSProperties>;
67
- width: import("vue-types").VueTypeValidableDef<number> & {
68
- default: number;
69
- };
70
- height: import("vue-types").VueTypeValidableDef<number> & {
71
- default: number;
72
- };
73
- zIndex: {
74
- type: PropType<number>;
75
- default: number;
76
- };
77
- infinite: {
78
- type: PropType<boolean>;
79
- default: boolean;
80
- };
81
- getContainer: {
82
- type: PropType<string>;
83
- };
84
- initialIndex: {
85
- default: () => undefined;
86
- type: PropType<number>;
87
- };
88
- };
89
- export declare const imageViewProps: {
90
- urlList: {
91
- type: PropType<string[]>;
92
- default: () => never[];
93
- };
94
- teleported: {
95
- type: PropType<boolean>;
96
- default: boolean;
97
- };
73
+ imageClassName: PropType<string>;
74
+ imageStyle: PropType<CSSProperties>;
75
+ width: PropType<number>;
76
+ height: PropType<number>;
98
77
  zIndex: {
99
78
  type: PropType<number>;
100
79
  default: number;
101
80
  };
102
- initialIndex: {
103
- type: PropType<number>;
104
- default: number;
105
- };
106
- infinite: {
107
- type: PropType<boolean>;
108
- default: boolean;
109
- };
110
81
  getContainer: {
111
82
  type: PropType<string>;
112
83
  };
113
- onHideOnClickModal: {
114
- type: PropType<boolean>;
115
- default: boolean;
116
- };
117
- icons: {
118
- type: PropType<PreviewPropsIons>;
119
- default: () => PreviewPropsIons;
120
- };
121
84
  };
122
- export {};
package/dist/style.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { CSSObject } from 'ant-design-vue';
1
2
  import type { GenerateStyle } from 'ant-design-vue/es/theme/internal';
2
3
  import type { ProAliasToken } from '@gx-design-vue/pro-provider';
4
+ export declare const genImageMaskStyle: () => CSSObject;
3
5
  export declare const genImageStyle: GenerateStyle<ProAliasToken>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/image",
3
- "version": "0.2.0-beta.21",
3
+ "version": "0.2.0-beta.23",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",
@@ -24,10 +24,11 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
+ "lodash-es": "^4.17.21",
27
28
  "@vueuse/core": "^9.10.0",
28
- "@gx-design-vue/pro-utils": "^0.2.0-beta.42",
29
- "@gx-design-vue/pro-hooks": "^0.2.0-beta.31",
30
- "@gx-design-vue/pro-provider": "^0.1.0-beta.85"
29
+ "@gx-design-vue/pro-utils": "^0.2.0-beta.47",
30
+ "@gx-design-vue/pro-hooks": "^0.2.0-beta.32",
31
+ "@gx-design-vue/pro-provider": "^0.1.0-beta.94"
31
32
  },
32
33
  "devDependencies": {
33
34
  "typescript": "^5.3.3"
@@ -1,123 +0,0 @@
1
- export declare const on: (element: HTMLElement | Document | Window | null, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
2
- export declare const off: (element: HTMLElement | Document | Window | null, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
3
- export type AnyFunction<T> = (...args: any[]) => T;
4
- export type ImageViewerAction = 'zoomIn' | 'zoomOut' | 'clocelise' | 'anticlocelise';
5
- export declare const isFirefox: () => boolean;
6
- export declare function rafThrottle<T extends AnyFunction<any>>(fn: T): AnyFunction<void>;
7
- declare const GImageViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
- urlList: {
9
- type: import("vue").PropType<string[]>;
10
- default: () => never[];
11
- };
12
- teleported: {
13
- type: import("vue").PropType<boolean>;
14
- default: boolean;
15
- };
16
- zIndex: {
17
- type: import("vue").PropType<number>;
18
- default: number;
19
- };
20
- initialIndex: {
21
- type: import("vue").PropType<number>;
22
- default: number;
23
- };
24
- infinite: {
25
- type: import("vue").PropType<boolean>;
26
- default: boolean;
27
- };
28
- getContainer: {
29
- type: import("vue").PropType<string>;
30
- };
31
- onHideOnClickModal: {
32
- type: import("vue").PropType<boolean>;
33
- default: boolean;
34
- };
35
- icons: {
36
- type: import("vue").PropType<{
37
- rotateLeft?: import("vue").VNode;
38
- rotateRight?: import("vue").VNode;
39
- zoomIn?: import("vue").VNode;
40
- zoomOut?: import("vue").VNode;
41
- close?: import("vue").VNode;
42
- left?: import("vue").VNode;
43
- right?: import("vue").VNode;
44
- }>;
45
- default: () => {
46
- rotateLeft?: import("vue").VNode;
47
- rotateRight?: import("vue").VNode;
48
- zoomIn?: import("vue").VNode;
49
- zoomOut?: import("vue").VNode;
50
- close?: import("vue").VNode;
51
- left?: import("vue").VNode;
52
- right?: import("vue").VNode;
53
- };
54
- };
55
- }>, () => import("ant-design-vue/es/_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "switch")[], "close" | "switch", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
- urlList: {
57
- type: import("vue").PropType<string[]>;
58
- default: () => never[];
59
- };
60
- teleported: {
61
- type: import("vue").PropType<boolean>;
62
- default: boolean;
63
- };
64
- zIndex: {
65
- type: import("vue").PropType<number>;
66
- default: number;
67
- };
68
- initialIndex: {
69
- type: import("vue").PropType<number>;
70
- default: number;
71
- };
72
- infinite: {
73
- type: import("vue").PropType<boolean>;
74
- default: boolean;
75
- };
76
- getContainer: {
77
- type: import("vue").PropType<string>;
78
- };
79
- onHideOnClickModal: {
80
- type: import("vue").PropType<boolean>;
81
- default: boolean;
82
- };
83
- icons: {
84
- type: import("vue").PropType<{
85
- rotateLeft?: import("vue").VNode;
86
- rotateRight?: import("vue").VNode;
87
- zoomIn?: import("vue").VNode;
88
- zoomOut?: import("vue").VNode;
89
- close?: import("vue").VNode;
90
- left?: import("vue").VNode;
91
- right?: import("vue").VNode;
92
- }>;
93
- default: () => {
94
- rotateLeft?: import("vue").VNode;
95
- rotateRight?: import("vue").VNode;
96
- zoomIn?: import("vue").VNode;
97
- zoomOut?: import("vue").VNode;
98
- close?: import("vue").VNode;
99
- left?: import("vue").VNode;
100
- right?: import("vue").VNode;
101
- };
102
- };
103
- }>> & Readonly<{
104
- onSwitch?: ((...args: any[]) => any) | undefined;
105
- onClose?: ((...args: any[]) => any) | undefined;
106
- }>, {
107
- zIndex: number;
108
- infinite: boolean;
109
- urlList: string[];
110
- teleported: boolean;
111
- initialIndex: number;
112
- onHideOnClickModal: boolean;
113
- icons: {
114
- rotateLeft?: import("vue").VNode;
115
- rotateRight?: import("vue").VNode;
116
- zoomIn?: import("vue").VNode;
117
- zoomOut?: import("vue").VNode;
118
- close?: import("vue").VNode;
119
- left?: import("vue").VNode;
120
- right?: import("vue").VNode;
121
- };
122
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
123
- export default GImageViewer;