<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import{u as Wt,a as Nt,b as jt,c as Mt,d as V,e as Yt,i as _,f as et,g as Ut}from"./@vant-CnemuMFX.js";import{u as Xt,r as w,a as it,i as yt,w as O,g as Lt,m as M,c as E,q as b,s as Q,e as st,f as Vt,b as qt,t as $t,n as I,v as Gt,x as Kt,y as At}from"./@vue-DgAJ0pKR.js";function St(){}const Zt=Object.assign,xt=typeof window&lt;"u",nt=e=&gt;e!==null&amp;&amp;typeof e=="object",N=e=&gt;e!=null,Qt=e=&gt;typeof e=="function",Ct=e=&gt;typeof e=="number"||/^\d+(\.\d+)?$/.test(e),Jt=()=&gt;xt?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function dt(e,t){const i=t.split(".");let s=e;return i.forEach(n=&gt;{var r;s=nt(s)&amp;&amp;(r=s[n])!=null?r:""}),s}const A=[Number,String],D={type:Boolean,default:!0},K=e=&gt;({type:A,default:e}),j=e=&gt;({type:String,default:e});Jt();const te=e=&gt;e.stopPropagation();function ee(e,t){(typeof e.cancelable!="boolean"||e.cancelable)&amp;&amp;e.preventDefault(),t&amp;&amp;te(e)}function ht(e){const t=Xt(e);if(!t)return!1;const i=window.getComputedStyle(t),s=i.display==="none",n=t.offsetParent===null&amp;&amp;i.position!=="fixed";return s||n}const{width:ie,height:se}=Wt();function S(e){if(N(e))return Ct(e)?"".concat(e,"px"):String(e)}const ne=/-(\w)/g,It=e=&gt;e.replace(ne,(t,i)=&gt;i.toUpperCase()),Z=(e,t,i)=&gt;Math.min(Math.max(e,t),i),{hasOwnProperty:re}=Object.prototype;function oe(e,t,i){const s=t[i];N(s)&amp;&amp;(!re.call(e,i)||!nt(s)?e[i]=s:e[i]=Bt(Object(e[i]),s))}function Bt(e,t){return Object.keys(t).forEach(i=&gt;{oe(e,t,i)}),e}var ae={name:"å§“å",tel:"ç”µè¯",save:"ä¿å­˜",clear:"æ¸…ç©º",cancel:"å–æ¶ˆ",confirm:"ç¡®è®¤",delete:"åˆ&nbsp;é™¤",loading:"åŠ&nbsp;è½½ä¸­...",noCoupon:"æš‚æ—&nbsp;ä¼˜æƒ&nbsp;åˆ¸",nameEmpty:"è¯·å¡«å†™å§“å",addContact:"æ·»åŠ&nbsp;è”ç³»äºº",telInvalid:"è¯·å¡«å†™æ­£ç¡®çš„ç”µè¯",vanCalendar:{end:"ç»“æŸ",start:"å¼€å§‹",title:"æ—¥æœŸé€‰æ‹©",weekdays:["æ—¥","ä¸€","äºŒ","ä¸‰","å››","äº”","å…­"],monthTitle:(e,t)=&gt;"".concat(e,"å¹´").concat(t,"æœˆ"),rangePrompt:e=&gt;"æœ€å¤šé€‰æ‹© ".concat(e," å¤©")},vanCascader:{select:"è¯·é€‰æ‹©"},vanPagination:{prev:"ä¸Šä¸€é¡µ",next:"ä¸‹ä¸€é¡µ"},vanPullRefresh:{pulling:"ä¸‹æ‹‰å³å¯åˆ·æ–°...",loosing:"é‡Šæ”¾å³å¯åˆ·æ–°..."},vanSubmitBar:{label:"åˆè®¡:"},vanCoupon:{unlimited:"æ—&nbsp;é—¨æ§›",discount:e=&gt;"".concat(e,"æŠ˜"),condition:e=&gt;"æ»¡".concat(e,"å…ƒå¯ç”¨")},vanCouponCell:{title:"ä¼˜æƒ&nbsp;åˆ¸",count:e=&gt;"".concat(e,"å¼&nbsp;å¯ç”¨")},vanCouponList:{exchange:"å…‘æ¢",close:"ä¸ä½¿ç”¨",enable:"å¯ç”¨",disabled:"ä¸å¯ç”¨",placeholder:"è¾“å…¥ä¼˜æƒ&nbsp;ç&nbsp;"},vanAddressEdit:{area:"åœ°åŒº",areaEmpty:"è¯·é€‰æ‹©åœ°åŒº",addressEmpty:"è¯·å¡«å†™è¯¦ç»†åœ°å€",addressDetail:"è¯¦ç»†åœ°å€",defaultAddress:"è®¾ä¸ºé»˜è®¤æ”¶è´§åœ°å€"},vanAddressList:{add:"æ–°å¢žåœ°å€"}};const ft=w("zh-CN"),vt=it({"zh-CN":ae}),le={messages(){return vt[ft.value]},use(e,t){ft.value=e,this.add({[e]:t})},add(e={}){Bt(vt,e)}};var ue=le;function ce(e){const t=It(e)+".";return(i,...s)=&gt;{const n=ue.messages(),r=dt(n,t+i)||dt(n,i);return Qt(r)?r(...s):r}}function J(e,t){return t?typeof t=="string"?" ".concat(e,"--").concat(t):Array.isArray(t)?t.reduce((i,s)=&gt;i+J(e,s),""):Object.keys(t).reduce((i,s)=&gt;i+(t[s]?J(e,s):""),""):""}function de(e){return(t,i)=&gt;(t&amp;&amp;typeof t!="string"&amp;&amp;(i=t,t=""),t=t?"".concat(e,"__").concat(t):e,"".concat(t).concat(J(t,i)))}function F(e){const t="van-".concat(e);return[t,de(t),ce(t)]}const gt=5;function Y(e){return e.install=t=&gt;{const{name:i}=e;i&amp;&amp;(t.component(i,e),t.component(It("-".concat(i)),e))},e}const he=Symbol();function fe(e){const t=yt(he,null);t&amp;&amp;O(t,i=&gt;{i&amp;&amp;e()})}function zt(e){const t=Lt();t&amp;&amp;Zt(t.proxy,e)}const[ve,pt]=F("badge"),ge={dot:Boolean,max:A,tag:j("div"),color:String,offset:Array,content:A,showZero:D,position:j("top-right")};var pe=M({name:ve,props:ge,setup(e,{slots:t}){const i=()=&gt;{if(t.content)return!0;const{content:o,showZero:h}=e;return N(o)&amp;&amp;o!==""&amp;&amp;(h||o!==0&amp;&amp;o!=="0")},s=()=&gt;{const{dot:o,max:h,content:c}=e;if(!o&amp;&amp;i())return t.content?t.content():N(h)&amp;&amp;Ct(c)&amp;&amp;+c&gt;+h?"".concat(h,"+"):c},n=o=&gt;o.startsWith("-")?o.replace("-",""):"-".concat(o),r=E(()=&gt;{const o={background:e.color};if(e.offset){const[h,c]=e.offset,{position:l}=e,[u,f]=l.split("-");t.default?(typeof c=="number"?o[u]=S(u==="top"?c:-c):o[u]=u==="top"?S(c):n(c),typeof h=="number"?o[f]=S(f==="left"?h:-h):o[f]=f==="left"?S(h):n(h)):(o.marginTop=S(c),o.marginLeft=S(h))}return o}),a=()=&gt;{if(i()||e.dot)return b("div",{class:pt([e.position,{dot:e.dot,fixed:!!t.default}]),style:r.value},[s()])};return()=&gt;{if(t.default){const{tag:o}=e;return b(o,{class:pt("wrapper")},{default:()=&gt;[t.default(),a()]})}return a()}}});const me=Y(pe),[be,Qe]=F("config-provider"),Ee=Symbol(be),[we,mt]=F("icon"),ye=e=&gt;e==null?void 0:e.includes("/"),Le={dot:Boolean,tag:j("i"),name:String,size:A,badge:A,color:String,badgeProps:Object,classPrefix:String};var $e=M({name:we,props:Le,setup(e,{slots:t}){const i=yt(Ee,null),s=E(()=&gt;e.classPrefix||(i==null?void 0:i.iconPrefix)||mt());return()=&gt;{const{tag:n,dot:r,name:a,size:o,badge:h,color:c}=e,l=ye(a);return b(me,Q({dot:r,tag:n,class:[s.value,l?"":"".concat(s.value,"-").concat(a)],style:{color:c,fontSize:S(o)},content:h},e.badgeProps),{default:()=&gt;{var u;return[(u=t.default)==null?void 0:u.call(t),l&amp;&amp;b("img",{class:mt("image"),src:a},null)]}})}}});const Ae=Y($e);function Se(e,t){return e&gt;t?"horizontal":t&gt;e?"vertical":""}function xe(){const e=w(0),t=w(0),i=w(0),s=w(0),n=w(0),r=w(0),a=w(""),o=w(!0),h=()=&gt;a.value==="vertical",c=()=&gt;a.value==="horizontal",l=()=&gt;{i.value=0,s.value=0,n.value=0,r.value=0,a.value="",o.value=!0};return{move:m=&gt;{const L=m.touches[0];i.value=(L.clientX&lt;0?0:L.clientX)-e.value,s.value=L.clientY-t.value,n.value=Math.abs(i.value),r.value=Math.abs(s.value);const x=10;(!a.value||n.value&lt;x&amp;&amp;r.value&lt;x)&amp;&amp;(a.value=Se(n.value,r.value)),o.value&amp;&amp;(n.value&gt;gt||r.value&gt;gt)&amp;&amp;(o.value=!1)},start:m=&gt;{l(),e.value=m.touches[0].clientX,t.value=m.touches[0].clientY},reset:l,startX:e,startY:t,deltaX:i,deltaY:s,offsetX:n,offsetY:r,direction:a,isVertical:h,isHorizontal:c,isTap:o}}const[Ot,q]=F("swipe"),Ce={loop:D,width:A,height:A,vertical:Boolean,autoplay:K(0),duration:K(500),touchable:D,lazyRender:Boolean,initialSwipe:K(0),indicatorColor:String,showIndicators:D,stopPropagation:D},Dt=Symbol(Ot);var Ie=M({name:Ot,props:Ce,emits:["change","dragStart","dragEnd"],setup(e,{emit:t,slots:i}){const s=w(),n=w(),r=it({rect:null,width:0,height:0,offset:0,active:0,swiping:!1});let a=!1;const o=xe(),{children:h,linkChildren:c}=Nt(Dt),l=E(()=&gt;h.length),u=E(()=&gt;r[e.vertical?"height":"width"]),f=E(()=&gt;e.vertical?o.deltaY.value:o.deltaX.value),m=E(()=&gt;r.rect?(e.vertical?r.rect.height:r.rect.width)-u.value*l.value:0),L=E(()=&gt;u.value?Math.ceil(Math.abs(m.value)/u.value):l.value),x=E(()=&gt;l.value*u.value),v=E(()=&gt;(r.active+l.value)%l.value),B=E(()=&gt;{const d=e.vertical?"vertical":"horizontal";return o.direction.value===d}),U=E(()=&gt;{const d={transitionDuration:"".concat(r.swiping?0:e.duration,"ms"),transform:"translate".concat(e.vertical?"Y":"X","(").concat(+r.offset.toFixed(2),"px)")};if(u.value){const p=e.vertical?"height":"width",g=e.vertical?"width":"height";d[p]="".concat(x.value,"px"),d[g]=e[g]?"".concat(e[g],"px"):""}return d}),Tt=d=&gt;{const{active:p}=r;return d?e.loop?Z(p+d,-1,l.value):Z(p+d,0,L.value):p},rt=(d,p=0)=&gt;{let g=d*u.value;e.loop||(g=Math.min(g,-m.value));let $=p-g;return e.loop||($=Z($,m.value,0)),$},C=({pace:d=0,offset:p=0,emitChange:g})=&gt;{if(l.value&lt;=1)return;const{active:$}=r,y=Tt(d),k=rt(y,p);if(e.loop){if(h[0]&amp;&amp;k!==m.value){const G=k&lt;m.value;h[0].setOffset(G?x.value:0)}if(h[l.value-1]&amp;&amp;k!==0){const G=k&gt;0;h[l.value-1].setOffset(G?-x.value:0)}}r.active=y,r.offset=k,g&amp;&amp;y!==$&amp;&amp;t("change",v.value)},X=()=&gt;{r.swiping=!0,r.active&lt;=-1?C({pace:l.value}):r.active&gt;=l.value&amp;&amp;C({pace:-l.value})},Pt=()=&gt;{X(),o.reset(),V(()=&gt;{r.swiping=!1,C({pace:-1,emitChange:!0})})},ot=()=&gt;{X(),o.reset(),V(()=&gt;{r.swiping=!1,C({pace:1,emitChange:!0})})};let at;const R=()=&gt;clearTimeout(at),H=()=&gt;{R(),+e.autoplay&gt;0&amp;&amp;l.value&gt;1&amp;&amp;(at=setTimeout(()=&gt;{ot(),H()},+e.autoplay))},T=(d=+e.initialSwipe)=&gt;{if(!s.value)return;const p=()=&gt;{var g,$;if(!ht(s)){const y={width:s.value.offsetWidth,height:s.value.offsetHeight};r.rect=y,r.width=+((g=e.width)!=null?g:y.width),r.height=+(($=e.height)!=null?$:y.height)}l.value&amp;&amp;(d=Math.min(l.value-1,d),d===-1&amp;&amp;(d=l.value-1)),r.active=d,r.swiping=!0,r.offset=rt(d),h.forEach(y=&gt;{y.setOffset(0)}),H()};ht(s)?I().then(p):p()},lt=()=&gt;T(r.active);let ut;const _t=d=&gt;{!e.touchable||d.touches.length&gt;1||(o.start(d),a=!1,ut=Date.now(),R(),X())},Ft=d=&gt;{e.touchable&amp;&amp;r.swiping&amp;&amp;(o.move(d),B.value&amp;&amp;(!e.loop&amp;&amp;(r.active===0&amp;&amp;f.value&gt;0||r.active===l.value-1&amp;&amp;f.value&lt;0)||(ee(d,e.stopPropagation),C({offset:f.value}),a||(t("dragStart",{index:v.value}),a=!0))))},ct=()=&gt;{if(!e.touchable||!r.swiping)return;const d=Date.now()-ut,p=f.value/d;if((Math.abs(p)&gt;.25||Math.abs(f.value)&gt;u.value/2)&amp;&amp;B.value){const $=e.vertical?o.offsetY.value:o.offsetX.value;let y=0;e.loop?y=$&gt;0?f.value&gt;0?-1:1:0:y=-Math[f.value&gt;0?"ceil":"floor"](f.value/u.value),C({pace:y,emitChange:!0})}else f.value&amp;&amp;C({pace:0});a=!1,r.swiping=!1,t("dragEnd",{index:v.value}),H()},Rt=(d,p={})=&gt;{X(),o.reset(),V(()=&gt;{let g;e.loop&amp;&amp;d===l.value?g=r.active===0?0:d:g=d%l.value,p.immediate?V(()=&gt;{r.swiping=!1}):r.swiping=!1,C({pace:g-r.active,emitChange:!0})})},Ht=(d,p)=&gt;{const g=p===v.value,$=g?{backgroundColor:e.indicatorColor}:void 0;return b("i",{style:$,class:q("indicator",{active:g})},null)},kt=()=&gt;{if(i.indicator)return i.indicator({active:v.value,total:l.value});if(e.showIndicators&amp;&amp;l.value&gt;1)return b("div",{class:q("indicators",{vertical:e.vertical})},[Array(l.value).fill("").map(Ht)])};return zt({prev:Pt,next:ot,state:r,resize:lt,swipeTo:Rt}),c({size:u,props:e,count:l,activeIndicator:v}),O(()=&gt;e.initialSwipe,d=&gt;T(+d)),O(l,()=&gt;T(r.active)),O(()=&gt;e.autoplay,H),O([ie,se,()=&gt;e.width,()=&gt;e.height],lt),O(jt(),d=&gt;{d==="visible"?H():R()}),st(T),Vt(()=&gt;T(r.active)),fe(()=&gt;T(r.active)),qt(R),$t(R),Mt("touchmove",Ft,{target:n}),()=&gt;{var d;return b("div",{ref:s,class:q()},[b("div",{ref:n,style:U.value,class:q("track",{vertical:e.vertical}),onTouchstartPassive:_t,onTouchend:ct,onTouchcancel:ct},[(d=i.default)==null?void 0:d.call(i)]),kt()])}}});const Je=Y(Ie),[Be,ze]=F("swipe-item");var Oe=M({name:Be,setup(e,{slots:t}){let i;const s=it({offset:0,inited:!1,mounted:!1}),{parent:n,index:r}=Yt(Dt);if(!n)return;const a=E(()=&gt;{const c={},{vertical:l}=n.props;return n.size.value&amp;&amp;(c[l?"height":"width"]="".concat(n.size.value,"px")),s.offset&amp;&amp;(c.transform="translate".concat(l?"Y":"X","(").concat(s.offset,"px)")),c}),o=E(()=&gt;{const{loop:c,lazyRender:l}=n.props;if(!l||i)return!0;if(!s.mounted)return!1;const u=n.activeIndicator.value,f=n.count.value-1,m=u===0&amp;&amp;c?f:u-1,L=u===f&amp;&amp;c?0:u+1;return i=r.value===u||r.value===m||r.value===L,i}),h=c=&gt;{s.offset=c};return st(()=&gt;{I(()=&gt;{s.mounted=!0})}),zt({setOffset:h}),()=&gt;{var c;return b("div",{class:ze(),style:a.value},[o.value?(c=t.default)==null?void 0:c.call(t):null])}}});const ti=Y(Oe),bt=_&amp;&amp;"IntersectionObserver"in window&amp;&amp;"IntersectionObserverEntry"in window&amp;&amp;"intersectionRatio"in window.IntersectionObserverEntry.prototype,z={event:"event",observer:"observer"};function W(e,t){if(!e.length)return;const i=e.indexOf(t);if(i&gt;-1)return e.splice(i,1)}function Et(e,t){if(e.tagName!=="IMG"||!e.getAttribute("data-srcset"))return;let i=e.getAttribute("data-srcset");const n=e.parentNode.offsetWidth*t;let r,a,o;i=i.trim().split(",");const h=i.map(u=&gt;(u=u.trim(),r=u.lastIndexOf(" "),r===-1?(a=u,o=999998):(a=u.substr(0,r),o=parseInt(u.substr(r+1,u.length-r-2),10)),[o,a]));h.sort((u,f)=&gt;{if(u[0]&lt;f[0])return 1;if(u[0]&gt;f[0])return-1;if(u[0]===f[0]){if(f[1].indexOf(".webp",f[1].length-5)!==-1)return 1;if(u[1].indexOf(".webp",u[1].length-5)!==-1)return-1}return 0});let c="",l;for(let u=0;u&lt;h.length;u++){l=h[u],c=l[1];const f=h[u+1];if(f&amp;&amp;f[0]&lt;n){c=l[1];break}else if(!f){c=l[1];break}}return c}const De=(e=1)=&gt;_&amp;&amp;window.devicePixelRatio||e;function Te(){if(!_)return!1;let e=!0;try{const t=document.createElement("canvas");t.getContext&amp;&amp;t.getContext("2d")&amp;&amp;(e=t.toDataURL("image/webp").indexOf("data:image/webp")===0)}catch(t){e=!1}return e}function Pe(e,t){let i=null,s=0;return function(...n){if(i)return;const r=Date.now()-s,a=()=&gt;{s=Date.now(),i=!1,e.apply(this,n)};r&gt;=t?a():i=setTimeout(a,t)}}function _e(e,t,i){e.addEventListener(t,i,{capture:!1,passive:!0})}function Fe(e,t,i){e.removeEventListener(t,i,!1)}const tt=(e,t,i)=&gt;{const s=new Image;if(!e||!e.src)return i(new Error("image src is required"));s.src=e.src,e.cors&amp;&amp;(s.crossOrigin=e.cors),s.onload=()=&gt;t({naturalHeight:s.naturalHeight,naturalWidth:s.naturalWidth,src:s.src}),s.onerror=n=&gt;i(n)};class Re{constructor({max:t}){this.options={max:t||100},this.caches=[]}has(t){return this.caches.indexOf(t)&gt;-1}add(t){this.has(t)||(this.caches.push(t),this.caches.length&gt;this.options.max&amp;&amp;this.free())}free(){this.caches.shift()}}const[He,P]=F("image"),ke={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:A,height:A,radius:A,lazyLoad:Boolean,iconSize:A,showError:D,errorIcon:j("photo-fail"),iconPrefix:String,showLoading:D,loadingIcon:j("photo"),crossorigin:String,referrerpolicy:String};var We=M({name:He,props:ke,emits:["load","error"],setup(e,{emit:t,slots:i}){const s=w(!1),n=w(!0),r=w(),{$Lazyload:a}=Lt().proxy,o=E(()=&gt;{const v={width:S(e.width),height:S(e.height)};return N(e.radius)&amp;&amp;(v.overflow="hidden",v.borderRadius=S(e.radius)),v});O(()=&gt;e.src,()=&gt;{s.value=!1,n.value=!0});const h=v=&gt;{n.value&amp;&amp;(n.value=!1,t("load",v))},c=()=&gt;{const v=new Event("load");Object.defineProperty(v,"target",{value:r.value,enumerable:!0}),h(v)},l=v=&gt;{s.value=!0,n.value=!1,t("error",v)},u=(v,B,U)=&gt;U?U():b(Ae,{name:v,size:e.iconSize,class:B,classPrefix:e.iconPrefix},null),f=()=&gt;{if(n.value&amp;&amp;e.showLoading)return b("div",{class:P("loading")},[u(e.loadingIcon,P("loading-icon"),i.loading)]);if(s.value&amp;&amp;e.showError)return b("div",{class:P("error")},[u(e.errorIcon,P("error-icon"),i.error)])},m=()=&gt;{if(s.value||!e.src)return;const v={alt:e.alt,class:P("img"),style:{objectFit:e.fit,objectPosition:e.position},crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy};return e.lazyLoad?Gt(b("img",Q({ref:r},v),null),[[Kt("lazy"),e.src]]):b("img",Q({ref:r,src:e.src,onLoad:h,onError:l},v),null)},L=({el:v})=&gt;{const B=()=&gt;{v===r.value&amp;&amp;n.value&amp;&amp;c()};r.value?B():I(B)},x=({el:v})=&gt;{v===r.value&amp;&amp;!s.value&amp;&amp;l()};return a&amp;&amp;xt&amp;&amp;(a.$on("loaded",L),a.$on("error",x),$t(()=&gt;{a.$off("loaded",L),a.$off("error",x)})),st(()=&gt;{I(()=&gt;{var v;(v=r.value)!=null&amp;&amp;v.complete&amp;&amp;!e.lazyLoad&amp;&amp;c()})}),()=&gt;{var v;return b("div",{class:P({round:e.round,block:e.block}),style:o.value},[m(),f(),(v=i.default)==null?void 0:v.call(i)])}}});const ei=Y(We);class Ne{constructor({el:t,src:i,error:s,loading:n,bindType:r,$parent:a,options:o,cors:h,elRenderer:c,imageCache:l}){this.el=t,this.src=i,this.error=s,this.loading=n,this.bindType=r,this.attempt=0,this.cors=h,this.naturalHeight=0,this.naturalWidth=0,this.options=o,this.$parent=a,this.elRenderer=c,this.imageCache=l,this.performanceData={loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}initState(){"dataset"in this.el?this.el.dataset.src=this.src:this.el.setAttribute("data-src",this.src),this.state={loading:!1,error:!1,loaded:!1,rendered:!1}}record(t){this.performanceData[t]=Date.now()}update({src:t,loading:i,error:s}){const n=this.src;this.src=t,this.loading=i,this.error=s,this.filter(),n!==this.src&amp;&amp;(this.attempt=0,this.initState())}checkInView(){const t=et(this.el);return t.top&lt;window.innerHeight*this.options.preLoad&amp;&amp;t.bottom&gt;this.options.preLoadTop&amp;&amp;t.left&lt;window.innerWidth*this.options.preLoad&amp;&amp;t.right&gt;0}filter(){Object.keys(this.options.filter).forEach(t=&gt;{this.options.filter[t](this,this.options)})}renderLoading(t){this.state.loading=!0,tt({src:this.loading,cors:this.cors},()=&gt;{this.render("loading",!1),this.state.loading=!1,t()},()=&gt;{t(),this.state.loading=!1})}load(t=St){if(this.attempt&gt;this.options.attempt-1&amp;&amp;this.state.error){t();return}if(!(this.state.rendered&amp;&amp;this.state.loaded)){if(this.imageCache.has(this.src))return this.state.loaded=!0,this.render("loaded",!0),this.state.rendered=!0,t();this.renderLoading(()=&gt;{var i,s;this.attempt++,(s=(i=this.options.adapter).beforeLoad)==null||s.call(i,this,this.options),this.record("loadStart"),tt({src:this.src,cors:this.cors},n=&gt;{this.naturalHeight=n.naturalHeight,this.naturalWidth=n.naturalWidth,this.state.loaded=!0,this.state.error=!1,this.record("loadEnd"),this.render("loaded",!1),this.state.rendered=!0,this.imageCache.add(this.src),t()},n=&gt;{!this.options.silent&amp;&amp;console.error(n),this.state.error=!0,this.state.loaded=!1,this.render("error",!1)})})}}render(t,i){this.elRenderer(this,t,i)}performance(){let t="loading",i=0;return this.state.loaded&amp;&amp;(t="loaded",i=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&amp;&amp;(t="error"),{src:this.src,state:t,time:i}}$destroy(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}const wt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",je=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],Me={rootMargin:"0px",threshold:0};function Ye(){return class{constructor({preLoad:t,error:i,throttleWait:s,preLoadTop:n,dispatchEvent:r,loading:a,attempt:o,silent:h=!0,scale:c,listenEvents:l,filter:u,adapter:f,observer:m,observerOptions:L}){this.mode=z.event,this.listeners=[],this.targetIndex=0,this.targets=[],this.options={silent:h,dispatchEvent:!!r,throttleWait:s||200,preLoad:t||1.3,preLoadTop:n||0,error:i||wt,loading:a||wt,attempt:o||3,scale:c||De(c),ListenEvents:l||je,supportWebp:Te(),filter:u||{},adapter:f||{},observer:!!m,observerOptions:L||Me},this.initEvent(),this.imageCache=new Re({max:200}),this.lazyLoadHandler=Pe(this.lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?z.observer:z.event)}config(t={}){Object.assign(this.options,t)}performance(){return this.listeners.map(t=&gt;t.performance())}addLazyBox(t){this.listeners.push(t),_&amp;&amp;(this.addListenerTarget(window),this.observer&amp;&amp;this.observer.observe(t.el),t.$el&amp;&amp;t.$el.parentNode&amp;&amp;this.addListenerTarget(t.$el.parentNode))}add(t,i,s){if(this.listeners.some(a=&gt;a.el===t))return this.update(t,i),I(this.lazyLoadHandler);const n=this.valueFormatter(i.value);let{src:r}=n;I(()=&gt;{r=Et(t,this.options.scale)||r,this.observer&amp;&amp;this.observer.observe(t);const a=Object.keys(i.modifiers)[0];let o;a&amp;&amp;(o=s.context.$refs[a],o=o?o.$el||o:document.getElementById(a)),o||(o=Ut(t));const h=new Ne({bindType:i.arg,$parent:o,el:t,src:r,loading:n.loading,error:n.error,cors:n.cors,elRenderer:this.elRenderer.bind(this),options:this.options,imageCache:this.imageCache});this.listeners.push(h),_&amp;&amp;(this.addListenerTarget(window),this.addListenerTarget(o)),this.lazyLoadHandler(),I(()=&gt;this.lazyLoadHandler())})}update(t,i,s){const n=this.valueFormatter(i.value);let{src:r}=n;r=Et(t,this.options.scale)||r;const a=this.listeners.find(o=&gt;o.el===t);a?a.update({src:r,error:n.error,loading:n.loading}):this.add(t,i,s),this.observer&amp;&amp;(this.observer.unobserve(t),this.observer.observe(t)),this.lazyLoadHandler(),I(()=&gt;this.lazyLoadHandler())}remove(t){if(!t)return;this.observer&amp;&amp;this.observer.unobserve(t);const i=this.listeners.find(s=&gt;s.el===t);i&amp;&amp;(this.removeListenerTarget(i.$parent),this.removeListenerTarget(window),W(this.listeners,i),i.$destroy())}removeComponent(t){t&amp;&amp;(W(this.listeners,t),this.observer&amp;&amp;this.observer.unobserve(t.el),t.$parent&amp;&amp;t.$el.parentNode&amp;&amp;this.removeListenerTarget(t.$el.parentNode),this.removeListenerTarget(window))}setMode(t){!bt&amp;&amp;t===z.observer&amp;&amp;(t=z.event),this.mode=t,t===z.event?(this.observer&amp;&amp;(this.listeners.forEach(i=&gt;{this.observer.unobserve(i.el)}),this.observer=null),this.targets.forEach(i=&gt;{this.initListen(i.el,!0)})):(this.targets.forEach(i=&gt;{this.initListen(i.el,!1)}),this.initIntersectionObserver())}addListenerTarget(t){if(!t)return;let i=this.targets.find(s=&gt;s.el===t);return i?i.childrenCount++:(i={el:t,id:++this.targetIndex,childrenCount:1,listened:!0},this.mode===z.event&amp;&amp;this.initListen(i.el,!0),this.targets.push(i)),this.targetIndex}removeListenerTarget(t){this.targets.forEach((i,s)=&gt;{i.el===t&amp;&amp;(i.childrenCount--,i.childrenCount||(this.initListen(i.el,!1),this.targets.splice(s,1),i=null))})}initListen(t,i){this.options.ListenEvents.forEach(s=&gt;(i?_e:Fe)(t,s,this.lazyLoadHandler))}initEvent(){this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=(t,i)=&gt;{this.Event.listeners[t]||(this.Event.listeners[t]=[]),this.Event.listeners[t].push(i)},this.$once=(t,i)=&gt;{const s=(...n)=&gt;{this.$off(t,s),i.apply(this,n)};this.$on(t,s)},this.$off=(t,i)=&gt;{if(!i){if(!this.Event.listeners[t])return;this.Event.listeners[t].length=0;return}W(this.Event.listeners[t],i)},this.$emit=(t,i,s)=&gt;{this.Event.listeners[t]&amp;&amp;this.Event.listeners[t].forEach(n=&gt;n(i,s))}}lazyLoadHandler(){const t=[];this.listeners.forEach(i=&gt;{(!i.el||!i.el.parentNode)&amp;&amp;t.push(i),i.checkInView()&amp;&amp;i.load()}),t.forEach(i=&gt;{W(this.listeners,i),i.$destroy()})}initIntersectionObserver(){bt&amp;&amp;(this.observer=new IntersectionObserver(this.observerHandler.bind(this),this.options.observerOptions),this.listeners.length&amp;&amp;this.listeners.forEach(t=&gt;{this.observer.observe(t.el)}))}observerHandler(t){t.forEach(i=&gt;{i.isIntersecting&amp;&amp;this.listeners.forEach(s=&gt;{if(s.el===i.target){if(s.state.loaded)return this.observer.unobserve(s.el);s.load()}})})}elRenderer(t,i,s){if(!t.el)return;const{el:n,bindType:r}=t;let a;switch(i){case"loading":a=t.loading;break;case"error":a=t.error;break;default:({src:a}=t);break}if(r?n.style[r]='url("'+a+'")':n.getAttribute("src")!==a&amp;&amp;n.setAttribute("src",a),n.setAttribute("lazy",i),this.$emit(i,t,s),this.options.adapter[i]&amp;&amp;this.options.adapter[i](t,this.options),this.options.dispatchEvent){const o=new CustomEvent(i,{detail:t});n.dispatchEvent(o)}}valueFormatter(t){let i=t,{loading:s,error:n}=this.options;return nt(t)&amp;&amp;({src:i}=t,s=t.loading||this.options.loading,n=t.error||this.options.error),{src:i,loading:s,error:n}}}}var Ue=e=&gt;({props:{tag:{type:String,default:"div"}},emits:["show"],render(){return At(this.tag,this.show&amp;&amp;this.$slots.default?this.$slots.default():null)},data(){return{el:null,state:{loaded:!1},show:!1}},mounted(){this.el=this.$el,e.addLazyBox(this),e.lazyLoadHandler()},beforeUnmount(){e.removeComponent(this)},methods:{checkInView(){const t=et(this.$el);return _&amp;&amp;t.top&lt;window.innerHeight*e.options.preLoad&amp;&amp;t.bottom&gt;0&amp;&amp;t.left&lt;window.innerWidth*e.options.preLoad&amp;&amp;t.right&gt;0},load(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)},destroy(){return this.$destroy}}});const Xe={selector:"img"};class Ve{constructor({el:t,binding:i,vnode:s,lazy:n}){this.el=null,this.vnode=s,this.binding=i,this.options={},this.lazy=n,this.queue=[],this.update({el:t,binding:i})}update({el:t,binding:i}){this.el=t,this.options=Object.assign({},Xe,i.value),this.getImgs().forEach(n=&gt;{this.lazy.add(n,Object.assign({},this.binding,{value:{src:"dataset"in n?n.dataset.src:n.getAttribute("data-src"),error:("dataset"in n?n.dataset.error:n.getAttribute("data-error"))||this.options.error,loading:("dataset"in n?n.dataset.loading:n.getAttribute("data-loading"))||this.options.loading}}),this.vnode)})}getImgs(){return Array.from(this.el.querySelectorAll(this.options.selector))}clear(){this.getImgs().forEach(i=&gt;this.lazy.remove(i)),this.vnode=null,this.binding=null,this.lazy=null}}class qe{constructor({lazy:t}){this.lazy=t,this.queue=[]}bind(t,i,s){const n=new Ve({el:t,binding:i,vnode:s,lazy:this.lazy});this.queue.push(n)}update(t,i,s){const n=this.queue.find(r=&gt;r.el===t);n&amp;&amp;n.update({el:t,binding:i,vnode:s})}unbind(t){const i=this.queue.find(s=&gt;s.el===t);i&amp;&amp;(i.clear(),W(this.queue,i))}}var Ge=e=&gt;({props:{src:[String,Object],tag:{type:String,default:"img"}},render(){var t,i;return At(this.tag,{src:this.renderSrc},(i=(t=this.$slots).default)==null?void 0:i.call(t))},data(){return{el:null,options:{src:"",error:"",loading:"",attempt:e.options.attempt},state:{loaded:!1,error:!1,attempt:0},renderSrc:""}},watch:{src(){this.init(),e.addLazyBox(this),e.lazyLoadHandler()}},created(){this.init()},mounted(){this.el=this.$el,e.addLazyBox(this),e.lazyLoadHandler()},beforeUnmount(){e.removeComponent(this)},methods:{init(){const{src:t,loading:i,error:s}=e.valueFormatter(this.src);this.state.loaded=!1,this.options.src=t,this.options.error=s,this.options.loading=i,this.renderSrc=this.options.loading},checkInView(){const t=et(this.$el);return t.top&lt;window.innerHeight*e.options.preLoad&amp;&amp;t.bottom&gt;0&amp;&amp;t.left&lt;window.innerWidth*e.options.preLoad&amp;&amp;t.right&gt;0},load(t=St){if(this.state.attempt&gt;this.options.attempt-1&amp;&amp;this.state.error){t();return}const{src:i}=this.options;tt({src:i},({src:s})=&gt;{this.renderSrc=s,this.state.loaded=!0},()=&gt;{this.state.attempt++,this.renderSrc=this.options.error,this.state.error=!0})}}});const si={install(e,t={}){const i=Ye(),s=new i(t),n=new qe({lazy:s});e.config.globalProperties.$Lazyload=s,t.lazyComponent&amp;&amp;e.component("LazyComponent",Ue(s)),t.lazyImage&amp;&amp;e.component("LazyImage",Ge(s)),e.directive("lazy",{beforeMount:s.add.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)}),e.directive("lazy-container",{beforeMount:n.bind.bind(n),updated:n.update.bind(n),unmounted:n.unbind.bind(n)})}};export{ei as I,si as L,ti as S,Je as a};
</pre></body></html>