1/*! build: Vue Shop Vite 2 copyright: https://vuejs-core.cn/shop-vite 3 time: 2026-09-17 13:58:13 4 */ 5var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,n=(t,o,l)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[o]=l;import{d as r,r as s,c as v,w as i,A as d,a as m,o as c,b as p,a5 as f,Q as h,S as g,a6 as b,u as B,a4 as y,n as w,k as E}from"./vsv-element-plus-W0Ac1QVi.js";import{_ as x}from"./index-C8olrNEm.js";import"./vsv-icon-Dy8UeJYU.js";import"./vsv-nprogress-DAAW6cp4.js";const Z={key:0,class:"img-zoomer-point"},$=r((O=((e,t)=>{for(var o in t||(t={}))a.call(t,o)&&n(e,o,t[o]);if(l)for(var o of l(t))u.call(t,o)&&n(e,o,t[o]);return e})({},{name:"VabMagnifier"}),j={__name:"index",props:{url:{default:""},highUrl:{default:""},width:{default:168},height:{default:-1},type:{default:"square"},zoomerStyle:{default:()=>({})},outZoomerStyle:{default:()=>({})},scale:{default:2},enterEvent:{default:null},moveEvent:{default:null},leaveEvent:{default:null},selector:{type:Boolean,default:!0},outZoomer:{type:Boolean,default:!1},pointer:{type:Boolean,default:!1},baseline:{type:Boolean,default:!1},disabledReactive:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},maskColor:{default:""}},emits:["mousemove","mouseleave","mouseenter","created"],setup(e,{expose:t,emit:o}){const l=e,a=o,u=s(),n=s({top:0,left:0,absoluteLeft:0,absoluteTop:0}),r=s({top:0,left:0}),x=s({leftBound:0,topBound:0,rightBound:0,bottomBound:0}),$=s({leftBound:0,topBound:0,rightBound:0,bottomBound:0}),O=s(!0),j=s(!0),k=s(!1),M=s(0),S=s(0),L=s({}),T=s(null),P=s([]),z=v(()=>l.height>0?l.height:l.width),_=v(()=>l.width/2),I=v(()=>z.value/2),R=v(()=>{const e=_.value;return l.outZoomer?e*l.scale:e}),N=v(()=>{const e=I.value;return l.outZoomer?e*l.scale:e}),A=v(()=>{const{top:e,left:t}=n.value;return{top:`${e}px`,left:`${t}px`}}),C=v(()=>{const{width:e}=l;return{width:`${e}px`,height:`${z.value}px`}}),J=v(()=>{const{scale:e,width:t}=l;return{width:t*e+"px",height:z.value*e+"px"}}),U=v(()=>({top:`${S.value}px`})),Y=v(()=>({backgroundImage:`url(${l.highUrl||l.url})`})),q=v(()=>{const{scale:e}=l,{height:t,width:o}=L.value;return{backgroundSize:`${o*e}px ${t*e}px`}}),D=v(()=>{const{left:e,top:t}=r.value;return{backgroundPosition:`${e}px ${t}px`}}),H=e=>{const t=e.getBoundingClientRect(),o=navigator.userAgent.includes("MSIE")&&"HTML"===e.tagName?-e.scrollTop:t.top;return{left:t.left,top:o,right:t.right,bottom:t.bottom,width:t.right-t.left,height:t.bottom-o}},Q=()=>{k.value=!1,V(l.url).then(X)},V=e=>new Promise((t,o)=>{const l=document.createElement("img");l.addEventListener("load",t),l.addEventListener("error",o),l.src=e}),X=()=>{E(()=>{const e=u.value;k.value||(k.value=!0,e&&(e.src=l.url,setTimeout(()=>{L.value=H(e),G(),a("created",e,L.value)},500)))})},F=e=>JSON.stringify(L.value)!==JSON.stringify(e),G=()=>{te(),ae()},K=e=>{k.value&&(O.value=!1),a("mouseenter",e)},W=e=>{if(!O.value){if(k.value&&e){P.value.forEach(e=>e.call(null));const{pageX:t,pageY:o,clientY:a}=e,u=o-a,{scale:s,outZoomer:v}=l,{absoluteLeft:i,absoluteTop:d}=n.value,{leftBound:m,topBound:c,rightBound:p,bottomBound:f}=x.value,{leftBound:h,topBound:g,rightBound:b,bottomBound:B}=$.value;let y=M.value;const w=t-i,E=o-d,Z=w>m?Math.min(w,p):m,O=E>c?Math.min(E,f):c,k=w*s>h?Math.min(w*s,b):h,T=E*s>g?Math.min(E*s,B):g;n.value.left=Z-_.value,n.value.top=O-I.value,r.value.left=-k+R.value,r.value.top=-T+N.value,v&&(y||(y=M.value=u+L.value.top),j.value&&(j.value=!1),S.value=u>y?u-y:0)}a("mousemove",e)}},ee=e=>{O.value=!0,l.outZoomer&&(j.value=!0),a("mouseleave",e)},te=()=>{const{left:e,top:t}=L.value,{documentElement:o,body:l}=document,a=o.scrollTop||l.scrollTop,u=o.scrollLeft||l.scrollLeft;n.value.absoluteLeft=e+u,n.value.absoluteTop=t+a,oe(),le()},oe=()=>{const e=_.value,t=I.value,{width:o,height:l}=L.value;x.value.leftBound=e,x.value.topBound=t,x.value.rightBound=o-e,x.value.bottomBound=l-t},le=()=>{const e=R.value,t=N.value,{width:o,height:a}=L.value,{scale:u}=l;$.value.leftBound=e,$.value.topBound=t,$.value.rightBound=o*u-e,$.value.bottomBound=a*u-t},ae=()=>{M.value=0};return i(()=>l.scale,()=>{le(),!l.outZoomer&&k.value}),i(()=>l.enterEvent,e=>{e&&K(e)}),i(()=>l.moveEvent,e=>{e&&W(e)}),i(()=>l.leaveEvent,e=>{e&&ee(e)}),i(()=>l.url,Q),i(()=>l.width,oe),i(()=>l.height,oe),d(()=>{var e,t;l.url&&Q(),P.value=[],T.value=u.value,u.value&&(e=u.value,t=e=>{L.value=e,G()},l.disabledReactive||P.value.push(()=>{const o=H(e);F(o)&&t&&t(o)}))}),t({reset:()=>{te()}}),(t,o)=>(c(),m("div",{class:"vab-magnifier",onMouseenter:o[1]||(o[1]=t=>!e.disabled&&!e.enterEvent&&K(t)),onMouseleave:o[2]||(o[2]=t=>!e.disabled&&!e.leaveEvent&&ee(t)),onMousemove:o[3]||(o[3]=t=>!e.disabled&&!e.moveEvent&&W(t))},[p("img",{ref_key:"imgRef",ref:u,class:"origin-img",onLoad:o[0]||(o[0]=e=>X())},null,544),e.selector?f((c(),m("div",{key:0,class:w(["img-zoomer",{circle:"circle"===e.type}]),style:y([e.zoomerStyle,B(C),B(A),!e.outZoomer&&B(Y),!e.outZoomer&&B(q),!e.outZoomer&&B(D)])},[g(t.$slots,"zoomer",{},void 0,!0)],6)),[[b,!B(O)&&B(k)]]):h("",!0),e.outZoomer?f((c(),m("div",{key:1,class:w(["img-out-show",{"base-line":e.baseline}]),style:y([e.outZoomerStyle,B(J),B(U),B(Y),B(q),B(D)])},[e.pointer?(c(),m("div",Z)):h("",!0),g(t.$slots,"outZoomer",{},void 0,!0)],6)),[[b,!B(j)]]):h("",!0),g(t.$slots,"default",{},void 0,!0)],32))}},t(O,o(j))));var O,j;
5const k=x($,[["__scopeId","data-v-d15aae09"]]);export{k as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.