vant/static/js/async/9793.0830422a.js
2024-04-20 08:49:23 +00:00

2 lines
14 KiB
JavaScript

/*! For license information please see 9793.0830422a.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["9793"],{24647:function(e,o,a){"use strict";a.d(o,{RQ:function(){return i}});var i=e=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(e)},7197:function(e,o,a){"use strict";a.d(o,{Ee:function(){return l}});var i=a("63112"),r=a("46858"),l=(0,i.n)(r.Z);o.ZP=l},20897:function(e,o,a){"use strict";a.d(o,{G:function(){return r}});var i=0;function r(e){e?(!i&&document.body.classList.add("van-toast--unclickable"),i++):i&&!--i&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,o,a){"use strict";a.d(o,{H:function(){return s},o:function(){return n}});var i=a("11848"),r=a("39594"),l=a("12308"),t=a("10023");function n(){var e=(0,i.qj)({show:!1}),o=o=>{e.show=o},a=a=>{(0,l.l7)(e,a,{transitionAppear:!0}),o(!0)},r=()=>o(!1);return(0,t.F)({open:a,close:r,toggle:o}),{open:a,close:r,state:e,toggle:o}}function s(e){var o=(0,r.ri)(e),a=document.createElement("div");return document.body.appendChild(a),{instance:o.mount(a),unmount(){o.unmount(),document.body.removeChild(a)}}}},42901:function(e,o,a){"use strict";a("82116"),a("17989"),a("66786"),a("14529");var i=a("80681"),r=a("11848"),l=a("62568"),t=a("78335"),n=a("55987"),s=a("8051"),c=a("82210"),v=a("12308"),u=a("22300"),d=a("10023"),m=a("96528"),g=a("59973"),f=a("97760"),h=a("80763"),[p,y]=(0,l.do)("image-preview"),w=["show","teleport","transition","overlayStyle","closeOnPopstate"],b={show:Boolean,loop:t.J5,images:(0,t.Ce)(),minZoom:(0,t.SI)(1/3),maxZoom:(0,t.SI)(3),overlay:t.J5,vertical:Boolean,closeable:Boolean,showIndex:t.J5,className:t.Vg,closeIcon:(0,t.SQ)("clear"),transition:String,beforeClose:Function,doubleScale:t.J5,overlayClass:t.Vg,overlayStyle:Object,swipeDuration:(0,t.SI)(300),startPosition:(0,t.SI)(0),showIndicators:Boolean,closeOnPopstate:t.J5,closeOnClickImage:t.J5,closeOnClickOverlay:t.J5,closeIconPosition:(0,t.SQ)("top-right"),teleport:[String,Object]};o.Z=(0,i.aZ)({name:p,props:b,emits:["scale","close","closed","change","longPress","update:show"],setup(e,o){var{emit:a,slots:l}=o,t=(0,r.iH)(),p=(0,r.iH)(),b=(0,r.qj)({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),S=()=>{if(t.value){var e=(0,u.EL)(t.value.$el);b.rootWidth=e.width,b.rootHeight=e.height,t.value.resize()}},C=e=>a("scale",e),O=e=>a("update:show",e),Z=()=>{(0,n.I)(e.beforeClose,{args:[b.active],done:()=>O(!1)})},k=e=>{e!==b.active&&(b.active=e,a("change",e))},x=()=>{if(e.showIndex)return(0,i.Wm)("div",{class:y("index")},[l.index?l.index({index:b.active}):"".concat(b.active+1," / ").concat(e.images.length)])},P=()=>{if(l.cover)return(0,i.Wm)("div",{class:y("cover")},[l.cover()])},I=()=>{b.disableZoom=!0},W=()=>{b.disableZoom=!1},Y=()=>{var o,r;return(0,i.Wm)(g.oF,{ref:t,lazyRender:!0,loop:e.loop,class:y("swipe"),vertical:e.vertical,duration:e.swipeDuration,initialSwipe:e.startPosition,showIndicators:e.showIndicators,indicatorColor:"white",onChange:k,onDragEnd:W,onDragStart:I},"function"!=typeof(r=o=e.images.map((o,r)=>(0,i.Wm)(h.Z,{ref:e=>{r===b.active&&(p.value=e)},src:o,show:e.show,active:b.active,maxZoom:e.maxZoom,minZoom:e.minZoom,rootWidth:b.rootWidth,rootHeight:b.rootHeight,disableZoom:b.disableZoom,doubleScale:e.doubleScale,closeOnClickImage:e.closeOnClickImage,closeOnClickOverlay:e.closeOnClickOverlay,vertical:e.vertical,onScale:C,onClose:Z,onLongPress:()=>a("longPress",{index:r})},{image:l.image})))&&("[object Object]"!==Object.prototype.toString.call(r)||(0,i.lA)(r))?{default:()=>[o]}:o)},z=()=>{if(e.closeable)return(0,i.Wm)(m.JO,{role:"button",name:e.closeIcon,class:[y("close-icon",e.closeIconPosition),s.e9],onClick:Z},null)},B=()=>a("closed"),H=(e,o)=>{var a;return null===(a=t.value)||void 0===a?void 0:a.swipeTo(e,o)};return(0,d.F)({resetScale:()=>{var e;null===(e=p.value)||void 0===e||e.resetScale()},swipeTo:H}),(0,i.bv)(S),(0,i.YP)([c.bn,c.uK],S),(0,i.YP)(()=>e.startPosition,e=>k(+e)),(0,i.YP)(()=>e.show,o=>{var{images:r,startPosition:l}=e;o?(k(+l),(0,i.Y3)(()=>{S(),H(+l,{immediate:!0})})):a("close",{index:b.active,url:r[b.active]})}),()=>(0,i.Wm)(f.GI,(0,i.dG)({class:[y(),e.className],overlayClass:[y("overlay"),e.overlayClass],onClosed:B,"onUpdate:show":O},(0,v.ei)(e,w)),{default:()=>[z(),Y(),x(),P()]})}})},80763:function(e,o,a){"use strict";var i=a("80681"),r=a("11848"),l=a("62568"),t=a("78335"),n=a("20358"),s=a("82210"),c=a("8051"),v=a("10023"),u=a("29609"),d=a("22300"),m=a("7197"),g=a("95786"),f=a("32823"),h=e=>Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2)),p=e=>({x:(e[0].clientX+e[1].clientX)/2,y:(e[0].clientY+e[1].clientY)/2}),y=(0,l.do)("image-preview")[1],w={src:String,show:Boolean,active:Number,minZoom:(0,t.ir)(t.Or),maxZoom:(0,t.ir)(t.Or),rootWidth:(0,t.ir)(Number),rootHeight:(0,t.ir)(Number),disableZoom:Boolean,doubleScale:Boolean,closeOnClickImage:Boolean,closeOnClickOverlay:Boolean,vertical:Boolean};o.Z=(0,i.aZ)({props:w,emits:["scale","close","longPress"],setup(e,o){var a,l,t,w,b,S,C,O,{emit:Z,slots:k}=o,x=(0,r.qj)({scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,initializing:!1,imageRatio:0}),P=(0,u.o)(),I=(0,r.iH)(),W=(0,r.iH)(),Y=(0,r.iH)(!1),z=(0,r.iH)(!1),B=0,H=(0,i.Fl)(()=>{var{scale:e,moveX:o,moveY:a,moving:i,zooming:r,initializing:l}=x,t={transitionDuration:r||i||l?"0s":".3s"};return(1!==e||z.value)&&(t.transform="matrix(".concat(e,", 0, 0, ").concat(e,", ").concat(o,", ").concat(a,")")),t}),F=(0,i.Fl)(()=>{if(x.imageRatio){var{rootWidth:o,rootHeight:a}=e,i=Y.value?a/x.imageRatio:o;return Math.max(0,(x.scale*i-o)/2)}return 0}),X=(0,i.Fl)(()=>{if(x.imageRatio){var{rootWidth:o,rootHeight:a}=e,i=Y.value?a:o*x.imageRatio;return Math.max(0,(x.scale*i-a)/2)}return 0}),j=(o,a)=>{if((o=(0,n.uZ)(o,+e.minZoom,+e.maxZoom+1))!==x.scale){var i=o/x.scale;if(x.scale=o,a){var r,l=(0,d.EL)(null===(r=I.value)||void 0===r?void 0:r.$el),t={x:.5*l.width,y:.5*l.height},s=x.moveX-(a.x-l.left-t.x)*(i-1),c=x.moveY-(a.y-l.top-t.y)*(i-1);x.moveX=(0,n.uZ)(s,-F.value,F.value),x.moveY=(0,n.uZ)(c,-X.value,X.value)}else x.moveX=0,x.moveY=z.value?B:0;Z("scale",{scale:o,index:e.active})}},J=()=>{j(1)},L=()=>{var e=x.scale>1?1:2;j(e,2===e||z.value?{x:P.startX.value,y:P.startY.value}:void 0)},N=!1,E=o=>{var{touches:i}=o;if(2!==(a=i.length)||!e.disableZoom){var{offsetX:r}=P;P.start(o),l=x.moveX,t=x.moveY,O=Date.now(),N=!1,x.moving=1===a&&(1!==x.scale||z.value),x.zooming=2===a&&!r.value,x.zooming&&(w=x.scale,b=h(i))}},R=o=>{var a,i=null===(a=W.value)||void 0===a?void 0:a.$el,r=i.firstElementChild,l=o.target===i,t=null==r?void 0:r.contains(o.target);if(!!e.closeOnClickImage||!t)(e.closeOnClickOverlay||!l)&&Z("close")},T=o=>{if(!(a>1)){var i=Date.now()-O;P.isTap.value&&(i<250?e.doubleScale?C?(clearTimeout(C),C=null,L()):C=setTimeout(()=>{R(o),C=null},250):R(o):i>c.Cp&&Z("longPress"))}},G=o=>{var a=!1;if((x.moving||x.zooming)&&(a=!0,x.moving&&l===x.moveX&&t===x.moveY&&(a=!1),!o.touches.length)){x.zooming&&(x.moveX=(0,n.uZ)(x.moveX,-F.value,F.value),x.moveY=(0,n.uZ)(x.moveY,-X.value,X.value),x.zooming=!1),x.moving=!1,l=0,t=0,w=1,x.scale<1&&J();var i=+e.maxZoom;x.scale>i&&j(i,S)}(0,s.PF)(o,a),T(o),P.reset()},M=()=>{var{rootWidth:o,rootHeight:a}=e,i=a/o,{imageRatio:r}=x;Y.value=x.imageRatio>i&&r<2.6,z.value=x.imageRatio>i&&r>=2.6,z.value&&(B=(r*o-a)/2,x.moveY=B,x.initializing=!0,(0,d.Wn)(()=>{x.initializing=!1})),J()},Q=e=>{var{naturalWidth:o,naturalHeight:a}=e.target;x.imageRatio=a/o,M()};return(0,i.YP)(()=>e.active,J),(0,i.YP)(()=>e.show,e=>{!e&&J()}),(0,i.YP)(()=>[e.rootWidth,e.rootHeight],M),(0,d.OR)("touchmove",o=>{var{touches:a}=o;if(P.move(o),x.moving){var{deltaX:i,deltaY:r}=P,c=i.value+l,v=r.value+t;if((e.vertical?P.isVertical()&&Math.abs(v)>X.value:P.isHorizontal()&&Math.abs(c)>F.value)&&!N){x.moving=!1;return}N=!0,(0,s.PF)(o,!0),x.moveX=(0,n.uZ)(c,-F.value,F.value),x.moveY=(0,n.uZ)(v,-X.value,X.value)}if(x.zooming&&((0,s.PF)(o,!0),2===a.length)){var u=h(a);j(w*u/b,S=p(a))}},{target:(0,i.Fl)(()=>{var e;return null===(e=W.value)||void 0===e?void 0:e.$el})}),(0,v.F)({resetScale:J}),()=>{var o={loading:()=>(0,i.Wm)(g.gb,{type:"spinner"},null)};return(0,i.Wm)(f.j,{ref:W,class:y("swipe-item"),onTouchstartPassive:E,onTouchend:G,onTouchcancel:G},{default:()=>[k.image?(0,i.Wm)("div",{class:y("image-wrap")},[k.image({src:e.src,onLoad:Q,style:H.value})]):(0,i.Wm)(m.Ee,{ref:I,src:e.src,fit:"contain",class:y("image",{vertical:Y.value}),style:H.value,onLoad:Q},o)]})}}})},62475:function(e,o,a){"use strict";a.d(o,{V:function(){return c}});var i,r=a("80681"),l=a("12308"),t=a("84285"),n=a("42901"),s={loop:!0,images:[],maxZoom:3,minZoom:1/3,onScale:void 0,onClose:void 0,onChange:void 0,vertical:!1,teleport:"body",className:"",showIndex:!0,closeable:!1,closeIcon:"clear",transition:void 0,beforeClose:void 0,doubleScale:!0,overlayStyle:void 0,overlayClass:void 0,startPosition:0,swipeDuration:300,showIndicators:!1,closeOnPopstate:!0,closeOnClickOverlay:!0,closeIconPosition:"top-right"},c=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(l._f)return!i&&({instance:i}=(0,t.H)({setup(){var{state:e,toggle:o}=(0,t.o)(),a=()=>{e.images=[]};return()=>(0,r.Wm)(n.Z,(0,r.dG)(e,{onClosed:a,"onUpdate:show":o}),null)}})),e=Array.isArray(e)?{images:e,startPosition:o}:e,i.open((0,l.l7)({},s,e)),i}},46858:function(e,o,a){"use strict";a("82116"),a("17989");var i=a("80681"),r=a("11848"),l=a("62568"),t=a("78335"),n=a("20358"),s=a("12308"),c=a("96528"),[v,u]=(0,l.do)("image"),d={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:t.Or,height:t.Or,radius:t.Or,lazyLoad:Boolean,iconSize:t.Or,showError:t.J5,errorIcon:(0,t.SQ)("photo-fail"),iconPrefix:String,showLoading:t.J5,loadingIcon:(0,t.SQ)("photo"),crossorigin:String,referrerpolicy:String};o.Z=(0,i.aZ)({name:v,props:d,emits:["load","error"],setup(e,o){var{emit:a,slots:l}=o,t=(0,r.iH)(!1),v=(0,r.iH)(!0),d=(0,r.iH)(),{$Lazyload:m}=(0,i.FN)().proxy,g=(0,i.Fl)(()=>{var o={width:(0,n.Nn)(e.width),height:(0,n.Nn)(e.height)};return(0,s.Xq)(e.radius)&&(o.overflow="hidden",o.borderRadius=(0,n.Nn)(e.radius)),o});(0,i.YP)(()=>e.src,()=>{t.value=!1,v.value=!0});var f=e=>{v.value&&(v.value=!1,a("load",e))},h=()=>{var e=new Event("load");Object.defineProperty(e,"target",{value:d.value,enumerable:!0}),f(e)},p=e=>{t.value=!0,v.value=!1,a("error",e)},y=(o,a,r)=>r?r():(0,i.Wm)(c.JO,{name:o,size:e.iconSize,class:a,classPrefix:e.iconPrefix},null),w=()=>v.value&&e.showLoading?(0,i.Wm)("div",{class:u("loading")},[y(e.loadingIcon,u("loading-icon"),l.loading)]):t.value&&e.showError?(0,i.Wm)("div",{class:u("error")},[y(e.errorIcon,u("error-icon"),l.error)]):void 0,b=()=>{if(!t.value&&e.src){var o={alt:e.alt,class:u("img"),style:{objectFit:e.fit,objectPosition:e.position},crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy};return e.lazyLoad?(0,i.wy)((0,i.Wm)("img",(0,i.dG)({ref:d},o),null),[[(0,i.Q2)("lazy"),e.src]]):(0,i.Wm)("img",(0,i.dG)({ref:d,src:e.src,onLoad:f,onError:p},o),null)}},S=e=>{var{el:o}=e,a=()=>{o===d.value&&v.value&&h()};d.value?a():(0,i.Y3)(a)},C=e=>{var{el:o}=e;o===d.value&&!t.value&&p()};return m&&s._f&&(m.$on("loaded",S),m.$on("error",C),(0,i.Jd)(()=>{m.$off("loaded",S),m.$off("error",C)})),(0,i.bv)(()=>{(0,i.Y3)(()=>{var o;(null===(o=d.value)||void 0===o?void 0:o.complete)&&!e.lazyLoad&&h()})}),()=>{var o;return(0,i.Wm)("div",{class:u({round:e.round,block:e.block}),style:g.value},[b(),w(),null===(o=l.default)||void 0===o?void 0:o.call(l)])}}})},21083:function(e,o,a){"use strict";a("82116"),a("17989");var i=a("80681"),r=a("62568"),l=a("78335"),t=a("12308"),n=a("20897"),s=a("96528"),c=a("97760"),v=a("95786"),[u,d]=(0,r.do)("toast"),m=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],g={icon:String,show:Boolean,type:(0,l.SQ)("text"),overlay:Boolean,message:l.Or,iconSize:l.Or,duration:(0,l.qM)(2e3),position:(0,l.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:l.Vg,iconPrefix:String,transition:(0,l.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:l.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:l.Or};o.Z=(0,i.aZ)({name:u,props:g,emits:["update:show"],setup(e,o){var a,{emit:r,slots:l}=o,u=!1,g=()=>{var o=e.show&&e.forbidClick;u!==o&&(u=o,(0,n.G)(u))},f=e=>r("update:show",e),h=()=>{e.closeOnClick&&f(!1)},p=()=>clearTimeout(a),y=()=>{var{icon:o,type:a,iconSize:r,iconPrefix:l,loadingType:t}=e;return o||"success"===a||"fail"===a?(0,i.Wm)(s.JO,{name:o||a,size:r,class:d("icon"),classPrefix:l},null):"loading"===a?(0,i.Wm)(v.gb,{class:d("loading"),size:r,type:t},null):void 0},w=()=>{var{type:o,message:a}=e;return l.message?(0,i.Wm)("div",{class:d("text")},[l.message()]):(0,t.Xq)(a)&&""!==a?"html"===o?(0,i.Wm)("div",{key:0,class:d("text"),innerHTML:String(a)},null):(0,i.Wm)("div",{class:d("text")},[a]):void 0};return(0,i.YP)(()=>[e.show,e.forbidClick],g),(0,i.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{p(),e.show&&e.duration>0&&(a=setTimeout(()=>{f(!1)},e.duration))}),(0,i.bv)(g),(0,i.Ah)(g),()=>(0,i.Wm)(c.GI,(0,i.dG)({class:[d([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:h,onClosed:p,"onUpdate:show":f},(0,t.ei)(e,m)),{default:()=>[y(),w()]})}})},13118:function(e,o,a){"use strict";a.d(o,{CF:function(){return d},LJ:function(){return h},XA:function(){return f},di:function(){return g},yg:function(){return p}}),a("24836"),a("41712"),a("80855"),a("10502"),a("7978"),a("66746"),a("17530"),a("87604"),a("57024"),a("22175"),a("85322"),a("47897"),a("48943"),a("43356"),a("82116"),a("17989"),a("96245"),a("37232"),a("70629"),a("61557"),a("31564"),a("8649");var i=a("80681"),r=a("11848"),l=a("12308"),t=a("84285"),n=a("21083"),s=[],c=(0,l.l7)({},{icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1}),v=new Map;function u(e){return(0,l.Kn)(e)?e:{message:e}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l._f)return{};var o=function(){if(!s.length){var e=function(){var{instance:e,unmount:o}=(0,t.H)({setup(){var e=(0,r.iH)(""),{open:o,state:a,close:l,toggle:s}=(0,t.o)(),c=()=>{};return(0,i.YP)(e,e=>{a.message=e}),(0,i.FN)().render=()=>(0,i.Wm)(n.Z,(0,i.dG)(a,{onClosed:c,"onUpdate:show":s}),null),{open:o,close:l,message:e}}});return e}();s.push(e)}return s[s.length-1]}(),a=u(e);return o.open((0,l.l7)({},c,v.get(a.type||c.type),a)),o}var m=e=>o=>d((0,l.l7)({type:e},u(o))),g=m("loading"),f=m("success"),h=m("fail"),p=e=>{if(s.length){if(e)s.forEach(e=>{e.close()}),s=[];else{var o;s[0].close()}}}}}]);