/* empty css */import{d as W,r as T,a as he,c as O,w as N,o as we,b as st,e as ct,f as pe,g as c,n as re,m as ue,h as rt,i as Ie,j as ut,v as ze,_ as dt,u as vt,k as ft,l as fe,p as F,t as Re,q as mt,F as xe,s as me,x as oe,y as gt,z as ht,A as wt,B as bt}from"./app-b010d774.js";import{c as K,t as V,n as Z,m as G,u as Ae,a as Be,b as be,w as Le,d as Fe,e as xt,o as yt,f as Me,g as ye,i as $e,p as Se,h as H,j as ae,k as Ue,l as Ye,q as ge,r as de,s as ie,I as J,v as ce,x as se,y as Xe,z as Ne,A as q,B as _t,L as je,C as Ze,D as St,E as He,P as We,H as kt,F as Ge,G as Ct,J as Pt,K as qe,M as It,N as Je,O as pt,Q as Oe,R as Te,S as zt}from"./request-eebca079.js";const[Ke,_e]=K("swipe"),Rt={loop:V,width:Z,height:Z,vertical:Boolean,autoplay:G(0),duration:G(500),touchable:V,lazyRender:Boolean,initialSwipe:G(0),indicatorColor:String,showIndicators:V,stopPropagation:V},Qe=Symbol(Ke);var $t=W({name:Ke,props:Rt,emits:["change","dragStart","dragEnd"],setup(e,{emit:l,slots:i}){const t=T(),s=T(),a=he({rect:null,width:0,height:0,offset:0,active:0,swiping:!1});let w=!1;const b=Ae(),{children:x,linkChildren:_}=Be(Qe),o=O(()=>x.length),f=O(()=>a[e.vertical?"height":"width"]),n=O(()=>e.vertical?b.deltaY.value:b.deltaX.value),g=O(()=>a.rect?(e.vertical?a.rect.height:a.rect.width)-f.value*o.value:0),m=O(()=>f.value?Math.ceil(Math.abs(g.value)/f.value):o.value),P=O(()=>o.value*f.value),v=O(()=>(a.active+o.value)%o.value),z=O(()=>{const d=e.vertical?"vertical":"horizontal";return b.direction.value===d}),L=O(()=>{const d={transitionDuration:"".concat(a.swiping?0:e.duration,"ms"),transform:"translate".concat(e.vertical?"Y":"X","(").concat(+a.offset.toFixed(2),"px)")};if(f.value){const p=e.vertical?"height":"width",R=e.vertical?"width":"height";d[p]="".concat(P.value,"px"),d[R]=e[R]?"".concat(e[R],"px"):""}return d}),k=d=>{const{active:p}=a;return d?e.loop?H(p+d,-1,o.value):H(p+d,0,m.value):p},E=(d,p=0)=>{let R=d*f.value;e.loop||(R=Math.min(R,-g.value));let j=p-R;return e.loop||(j=H(j,g.value,0)),j},y=({pace:d=0,offset:p=0,emitChange:R})=>{if(o.value<=1)return;const{active:j}=a,X=k(d),ve=E(X,p);if(e.loop){if(x[0]&&ve!==g.value){const Ce=ve0;x[o.value-1].setOffset(Ce?-P.value:0)}}a.active=X,a.offset=ve,R&&X!==j&&l("change",v.value)},M=()=>{a.swiping=!0,a.active<=-1?y({pace:o.value}):a.active>=o.value&&y({pace:-o.value})},Q=()=>{M(),b.reset(),ye(()=>{a.swiping=!1,y({pace:-1,emitChange:!0})})},u=()=>{M(),b.reset(),ye(()=>{a.swiping=!1,y({pace:1,emitChange:!0})})};let S;const $=()=>clearTimeout(S),I=()=>{$(),+e.autoplay>0&&o.value>1&&(S=setTimeout(()=>{u(),I()},+e.autoplay))},A=(d=+e.initialSwipe)=>{if(!t.value)return;const p=()=>{var R,j;if(!$e(t)){const X={width:t.value.offsetWidth,height:t.value.offsetHeight};a.rect=X,a.width=+((R=e.width)!=null?R:X.width),a.height=+((j=e.height)!=null?j:X.height)}o.value&&(d=Math.min(o.value-1,d),d===-1&&(d=o.value-1)),a.active=d,a.swiping=!0,a.offset=E(d),x.forEach(X=>{X.setOffset(0)}),I()};$e(t)?re().then(p):p()},U=()=>A(a.active);let ee;const te=d=>{!e.touchable||d.touches.length>1||(b.start(d),w=!1,ee=Date.now(),$(),M())},r=d=>{e.touchable&&a.swiping&&(b.move(d),z.value&&(!e.loop&&(a.active===0&&n.value>0||a.active===o.value-1&&n.value<0)||(Se(d,e.stopPropagation),y({offset:n.value}),w||(l("dragStart",{index:v.value}),w=!0))))},h=()=>{if(!e.touchable||!a.swiping)return;const d=Date.now()-ee,p=n.value/d;if((Math.abs(p)>.25||Math.abs(n.value)>f.value/2)&&z.value){const j=e.vertical?b.offsetY.value:b.offsetX.value;let X=0;e.loop?X=j>0?n.value>0?-1:1:0:X=-Math[n.value>0?"ceil":"floor"](n.value/f.value),y({pace:X,emitChange:!0})}else n.value&&y({pace:0});w=!1,a.swiping=!1,l("dragEnd",{index:v.value}),I()},C=(d,p={})=>{M(),b.reset(),ye(()=>{let R;e.loop&&d===o.value?R=a.active===0?0:d:R=d%o.value,p.immediate?ye(()=>{a.swiping=!1}):a.swiping=!1,y({pace:R-a.active,emitChange:!0})})},B=(d,p)=>{const R=p===v.value,j=R?{backgroundColor:e.indicatorColor}:void 0;return c("i",{style:j,class:_e("indicator",{active:R})},null)},Y=()=>{if(i.indicator)return i.indicator({active:v.value,total:o.value});if(e.showIndicators&&o.value>1)return c("div",{class:_e("indicators",{vertical:e.vertical})},[Array(o.value).fill("").map(B)])};return be({prev:Q,next:u,state:a,resize:U,swipeTo:C}),_({size:f,props:e,count:o,activeIndicator:v}),N(()=>e.initialSwipe,d=>A(+d)),N(o,()=>A(a.active)),N(()=>e.autoplay,I),N([Le,Fe,()=>e.width,()=>e.height],U),N(xt(),d=>{d==="visible"?I():$()}),we(A),st(()=>A(a.active)),yt(()=>A(a.active)),ct($),pe($),Me("touchmove",r,{target:s}),()=>{var d;return c("div",{ref:t,class:_e()},[c("div",{ref:s,style:L.value,class:_e("track",{vertical:e.vertical}),onTouchstartPassive:te,onTouchend:h,onTouchcancel:h},[(d=i.default)==null?void 0:d.call(i)]),Y()])}}});const Ot=ae($t),[Tt,Dt]=K("swipe-item");var Vt=W({name:Tt,setup(e,{slots:l}){let i;const t=he({offset:0,inited:!1,mounted:!1}),{parent:s,index:a}=Ue(Qe);if(!s){console.error("[Vant] must be a child component of .");return}const w=O(()=>{const _={},{vertical:o}=s.props;return s.size.value&&(_[o?"height":"width"]="".concat(s.size.value,"px")),t.offset&&(_.transform="translate".concat(o?"Y":"X","(").concat(t.offset,"px)")),_}),b=O(()=>{const{loop:_,lazyRender:o}=s.props;if(!o||i)return!0;if(!t.mounted)return!1;const f=s.activeIndicator.value,n=s.count.value-1,g=f===0&&_?n:f-1,m=f===n&&_?0:f+1;return i=a.value===f||a.value===g||a.value===m,i}),x=_=>{t.offset=_};return we(()=>{re(()=>{t.mounted=!0})}),be({setOffset:x}),()=>{var _;return c("div",{class:Dt(),style:w.value},[b.value?(_=l.default)==null?void 0:_.call(l):null])}}});const Et=ae(Vt),[et,At]=K("radio-group"),Bt={shape:String,disabled:Boolean,iconSize:Z,direction:String,modelValue:ge,checkedColor:String},tt=Symbol(et);var Lt=W({name:et,props:Bt,emits:["change","update:modelValue"],setup(e,{emit:l,slots:i}){const{linkChildren:t}=Be(tt),s=a=>l("update:modelValue",a);return N(()=>e.modelValue,a=>l("change",a)),t({props:e,updateValue:s}),Ye(()=>e.modelValue),()=>{var a;return c("div",{class:At([e.direction]),role:"radiogroup"},[(a=i.default)==null?void 0:a.call(i)])}}});const Ft=ae(Lt),at={name:ge,disabled:Boolean,iconSize:Z,modelValue:ge,checkedColor:String,labelPosition:String,labelDisabled:Boolean};var Mt=W({props:de({},at,{bem:ie(Function),role:String,shape:String,parent:Object,checked:Boolean,bindGroup:V,indeterminate:{type:Boolean,default:null}}),emits:["click","toggle"],setup(e,{emit:l,slots:i}){const t=T(),s=n=>{if(e.parent&&e.bindGroup)return e.parent.props[n]},a=O(()=>{if(e.parent&&e.bindGroup){const n=s("disabled")||e.disabled;if(e.role==="checkbox"){const g=s("modelValue").length,m=s("max"),P=m&&g>=+m;return n||P&&!e.checked}return n}return e.disabled}),w=O(()=>s("direction")),b=O(()=>{const n=e.checkedColor||s("checkedColor");if(n&&e.checked&&!a.value)return{borderColor:n,backgroundColor:n}}),x=O(()=>e.shape||s("shape")||"round"),_=n=>{const{target:g}=n,m=t.value,P=m===g||(m==null?void 0:m.contains(g));!a.value&&(P||!e.labelDisabled)&&l("toggle"),l("click",n)},o=()=>{var n,g;const{bem:m,checked:P,indeterminate:v}=e,z=e.iconSize||s("iconSize");return c("div",{ref:t,class:m("icon",[x.value,{disabled:a.value,checked:P,indeterminate:v}]),style:x.value!=="dot"?{fontSize:ce(z)}:{width:ce(z),height:ce(z),borderColor:(n=b.value)==null?void 0:n.borderColor}},[i.icon?i.icon({checked:P,disabled:a.value}):x.value!=="dot"?c(J,{name:v?"minus":"success",style:b.value},null):c("div",{class:m("icon--dot__icon"),style:{backgroundColor:(g=b.value)==null?void 0:g.backgroundColor}},null)])},f=()=>{const{checked:n}=e;if(i.default)return c("span",{class:e.bem("label",[e.labelPosition,{disabled:a.value}])},[i.default({checked:n,disabled:a.value})])};return()=>{const n=e.labelPosition==="left"?[f(),o()]:[o(),f()];return c("div",{role:e.role,class:e.bem([{disabled:a.value,"label-disabled":e.labelDisabled},w.value]),tabindex:a.value?void 0:0,"aria-checked":e.checked,onClick:_},[n])}}});const Ut=de({},at,{shape:String}),[Yt,Xt]=K("radio");var Nt=W({name:Yt,props:Ut,emits:["update:modelValue"],setup(e,{emit:l,slots:i}){const{parent:t}=Ue(tt),s=()=>(t?t.props.modelValue:e.modelValue)===e.name,a=()=>{t?t.updateValue(e.name):l("update:modelValue",e.name)};return()=>c(Mt,ue({bem:Xt,role:"radio",parent:t,checked:s(),onToggle:a},e),se(i,["default","icon"]))}});const jt=ae(Nt),[Zt,le]=K("image"),Ht={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:Z,height:Z,radius:Z,lazyLoad:Boolean,iconSize:Z,showError:V,errorIcon:q("photo-fail"),iconPrefix:String,showLoading:V,loadingIcon:q("photo"),crossorigin:String,referrerpolicy:String};var Wt=W({name:Zt,props:Ht,emits:["load","error"],setup(e,{emit:l,slots:i}){const t=T(!1),s=T(!0),a=T(),{$Lazyload:w}=rt().proxy,b=O(()=>{const v={width:ce(e.width),height:ce(e.height)};return Xe(e.radius)&&(v.overflow="hidden",v.borderRadius=ce(e.radius)),v});N(()=>e.src,()=>{t.value=!1,s.value=!0});const x=v=>{s.value&&(s.value=!1,l("load",v))},_=()=>{const v=new Event("load");Object.defineProperty(v,"target",{value:a.value,enumerable:!0}),x(v)},o=v=>{t.value=!0,s.value=!1,l("error",v)},f=(v,z,L)=>L?L():c(J,{name:v,size:e.iconSize,class:z,classPrefix:e.iconPrefix},null),n=()=>{if(s.value&&e.showLoading)return c("div",{class:le("loading")},[f(e.loadingIcon,le("loading-icon"),i.loading)]);if(t.value&&e.showError)return c("div",{class:le("error")},[f(e.errorIcon,le("error-icon"),i.error)])},g=()=>{if(t.value||!e.src)return;const v={alt:e.alt,class:le("img"),style:{objectFit:e.fit,objectPosition:e.position},crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy};return e.lazyLoad?Ie(c("img",ue({ref:a},v),null),[[ut("lazy"),e.src]]):c("img",ue({ref:a,src:e.src,onLoad:x,onError:o},v),null)},m=({el:v})=>{const z=()=>{v===a.value&&s.value&&_()};a.value?z():re(z)},P=({el:v})=>{v===a.value&&!t.value&&o()};return w&&Ne&&(w.$on("loaded",m),w.$on("error",P),pe(()=>{w.$off("loaded",m),w.$off("error",P)})),we(()=>{re(()=>{var v;(v=a.value)!=null&&v.complete&&!e.lazyLoad&&_()})}),()=>{var v;return c("div",{class:le({round:e.round,block:e.block}),style:b.value},[g(),n(),(v=i.default)==null?void 0:v.call(i)])}}});const ot=ae(Wt),De=e=>Math.sqrt((e[0].clientX-e[1].clientX)**2+(e[0].clientY-e[1].clientY)**2),Gt=e=>({x:(e[0].clientX+e[1].clientX)/2,y:(e[0].clientY+e[1].clientY)/2}),Pe=K("image-preview")[1],Ve=2.6,qt={src:String,show:Boolean,active:Number,minZoom:ie(Z),maxZoom:ie(Z),rootWidth:ie(Number),rootHeight:ie(Number),disableZoom:Boolean,doubleScale:Boolean,closeOnClickImage:Boolean,closeOnClickOverlay:Boolean,vertical:Boolean};var Jt=W({props:qt,emits:["scale","close","longPress"],setup(e,{emit:l,slots:i}){const t=he({scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,initializing:!1,imageRatio:0}),s=Ae(),a=T(),w=T(),b=T(!1),x=T(!1);let _=0;const o=O(()=>{const{scale:r,moveX:h,moveY:C,moving:B,zooming:Y,initializing:d}=t,p={transitionDuration:Y||B||d?"0s":".3s"};return(r!==1||x.value)&&(p.transform="matrix(".concat(r,", 0, 0, ").concat(r,", ").concat(h,", ").concat(C,")")),p}),f=O(()=>{if(t.imageRatio){const{rootWidth:r,rootHeight:h}=e,C=b.value?h/t.imageRatio:r;return Math.max(0,(t.scale*C-r)/2)}return 0}),n=O(()=>{if(t.imageRatio){const{rootWidth:r,rootHeight:h}=e,C=b.value?h:r*t.imageRatio;return Math.max(0,(t.scale*C-h)/2)}return 0}),g=(r,h)=>{var C;if(r=H(r,+e.minZoom,+e.maxZoom+1),r!==t.scale){const B=r/t.scale;if(t.scale=r,h){const Y=Ze((C=a.value)==null?void 0:C.$el),d={x:Y.width*.5,y:Y.height*.5},p=t.moveX-(h.x-Y.left-d.x)*(B-1),R=t.moveY-(h.y-Y.top-d.y)*(B-1);t.moveX=H(p,-f.value,f.value),t.moveY=H(R,-n.value,n.value)}else t.moveX=0,t.moveY=x.value?_:0;l("scale",{scale:r,index:e.active})}},m=()=>{g(1)},P=()=>{const r=t.scale>1?1:2;g(r,r===2||x.value?{x:s.startX.value,y:s.startY.value}:void 0)};let v,z,L,k,E,y,M,Q,u=!1;const S=r=>{const{touches:h}=r;if(v=h.length,v===2&&e.disableZoom)return;const{offsetX:C}=s;s.start(r),z=t.moveX,L=t.moveY,Q=Date.now(),u=!1,t.moving=v===1&&(t.scale!==1||x.value),t.zooming=v===2&&!C.value,t.zooming&&(k=t.scale,E=De(h))},$=r=>{const{touches:h}=r;if(s.move(r),t.moving){const{deltaX:C,deltaY:B}=s,Y=C.value+z,d=B.value+L;if((e.vertical?s.isVertical()&&Math.abs(d)>n.value:s.isHorizontal()&&Math.abs(Y)>f.value)&&!u){t.moving=!1;return}u=!0,Se(r,!0),t.moveX=H(Y,-f.value,f.value),t.moveY=H(d,-n.value,n.value)}if(t.zooming&&(Se(r,!0),h.length===2)){const C=De(h),B=k*C/E;y=Gt(h),g(B,y)}},I=r=>{var h;const C=(h=w.value)==null?void 0:h.$el;if(!C)return;const B=C.firstElementChild,Y=r.target===C,d=B==null?void 0:B.contains(r.target);!e.closeOnClickImage&&d||!e.closeOnClickOverlay&&Y||l("close")},A=r=>{if(v>1)return;const h=Date.now()-Q,C=250;s.isTap.value&&(h{I(r),M=null},C):I(r):h>St&&l("longPress"))},U=r=>{let h=!1;if((t.moving||t.zooming)&&(h=!0,t.moving&&z===t.moveX&&L===t.moveY&&(h=!1),!r.touches.length)){t.zooming&&(t.moveX=H(t.moveX,-f.value,f.value),t.moveY=H(t.moveY,-n.value,n.value),t.zooming=!1),t.moving=!1,z=0,L=0,k=1,t.scale<1&&m();const C=+e.maxZoom;t.scale>C&&g(C,y)}Se(r,h),A(r),s.reset()},ee=()=>{const{rootWidth:r,rootHeight:h}=e,C=h/r,{imageRatio:B}=t;b.value=t.imageRatio>C&&BC&&B>=Ve,x.value&&(_=(B*r-h)/2,t.moveY=_,t.initializing=!0,_t(()=>{t.initializing=!1})),m()},te=r=>{const{naturalWidth:h,naturalHeight:C}=r.target;t.imageRatio=C/h,ee()};return N(()=>e.active,m),N(()=>e.show,r=>{r||m()}),N(()=>[e.rootWidth,e.rootHeight],ee),Me("touchmove",$,{target:O(()=>{var r;return(r=w.value)==null?void 0:r.$el})}),be({resetScale:m}),()=>{const r={loading:()=>c(je,{type:"spinner"},null)};return c(Et,{ref:w,class:Pe("swipe-item"),onTouchstartPassive:S,onTouchend:U,onTouchcancel:U},{default:()=>[i.image?c("div",{class:Pe("image-wrap")},[i.image({src:e.src,onLoad:te,style:o.value})]):c(ot,{ref:a,src:e.src,fit:"contain",class:Pe("image",{vertical:b.value}),style:o.value,onLoad:te},r)]})}}});const[Kt,ne]=K("image-preview"),Qt=["show","teleport","transition","overlayStyle","closeOnPopstate"],ea={show:Boolean,loop:V,images:He(),minZoom:G(1/3),maxZoom:G(3),overlay:V,vertical:Boolean,closeable:Boolean,showIndex:V,className:ge,closeIcon:q("clear"),transition:String,beforeClose:Function,doubleScale:V,overlayClass:ge,overlayStyle:Object,swipeDuration:G(300),startPosition:G(0),showIndicators:Boolean,closeOnPopstate:V,closeOnClickImage:V,closeOnClickOverlay:V,closeIconPosition:q("top-right"),teleport:[String,Object]};var lt=W({name:Kt,props:ea,emits:["scale","close","closed","change","longPress","update:show"],setup(e,{emit:l,slots:i}){const t=T(),s=T(),a=he({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),w=()=>{if(t.value){const k=Ze(t.value.$el);a.rootWidth=k.width,a.rootHeight=k.height,t.value.resize()}},b=k=>l("scale",k),x=k=>l("update:show",k),_=()=>{Ge(e.beforeClose,{args:[a.active],done:()=>x(!1)})},o=k=>{k!==a.active&&(a.active=k,l("change",k))},f=()=>{if(e.showIndex)return c("div",{class:ne("index")},[i.index?i.index({index:a.active}):"".concat(a.active+1," / ").concat(e.images.length)])},n=()=>{if(i.cover)return c("div",{class:ne("cover")},[i.cover()])},g=()=>{a.disableZoom=!0},m=()=>{a.disableZoom=!1},P=()=>c(Ot,{ref:t,lazyRender:!0,loop:e.loop,class:ne("swipe"),vertical:e.vertical,duration:e.swipeDuration,initialSwipe:e.startPosition,showIndicators:e.showIndicators,indicatorColor:"white",onChange:o,onDragEnd:m,onDragStart:g},{default:()=>[e.images.map((k,E)=>c(Jt,{ref:y=>{E===a.active&&(s.value=y)},src:k,show:e.show,active:a.active,maxZoom:e.maxZoom,minZoom:e.minZoom,rootWidth:a.rootWidth,rootHeight:a.rootHeight,disableZoom:a.disableZoom,doubleScale:e.doubleScale,closeOnClickImage:e.closeOnClickImage,closeOnClickOverlay:e.closeOnClickOverlay,vertical:e.vertical,onScale:b,onClose:_,onLongPress:()=>l("longPress",{index:E})},{image:i.image}))]}),v=()=>{if(e.closeable)return c(J,{role:"button",name:e.closeIcon,class:[ne("close-icon",e.closeIconPosition),kt],onClick:_},null)},z=()=>l("closed"),L=(k,E)=>{var y;return(y=t.value)==null?void 0:y.swipeTo(k,E)};return be({resetScale:()=>{var k;(k=s.value)==null||k.resetScale()},swipeTo:L}),we(w),N([Le,Fe],w),N(()=>e.startPosition,k=>o(+k)),N(()=>e.show,k=>{const{images:E,startPosition:y}=e;k?(o(+y),re(()=>{w(),L(+y,{immediate:!0})})):l("close",{index:a.active,url:E[a.active]})}),()=>c(We,ue({class:[ne(),e.className],overlayClass:[ne("overlay"),e.overlayClass],onClosed:z,"onUpdate:show":x},se(e,Qt)),{default:()=>[v(),P(),f(),n()]})}});let ke;const ta={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"};function aa(){({instance:ke}=Ct({setup(){const{state:e,toggle:l}=Pt(),i=()=>{e.images=[]};return()=>c(lt,ue(e,{onClosed:i,"onUpdate:show":l}),null)}}))}const oa=(e,l=0)=>{if(Ne)return ke||aa(),e=Array.isArray(e)?{images:e,startPosition:l}:e,ke.open(de({},ta,e)),ke};ae(lt);const[la,D,na]=K("uploader");function Ee(e,l){return new Promise(i=>{if(l==="file"){i();return}const t=new FileReader;t.onload=s=>{i(s.target.result)},l==="dataUrl"?t.readAsDataURL(e):l==="text"&&t.readAsText(e)})}function nt(e,l){return qe(e).some(i=>i.file?It(l)?l(i.file):i.file.size>+l:!1)}function ia(e,l){const i=[],t=[];return e.forEach(s=>{nt(s,l)?t.push(s):i.push(s)}),{valid:i,invalid:t}}const sa=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i,ca=e=>sa.test(e);function it(e){return e.isImage?!0:e.file&&e.file.type?e.file.type.indexOf("image")===0:e.url?ca(e.url):typeof e.content=="string"?e.content.indexOf("data:image")===0:!1}var ra=W({props:{name:Z,item:ie(Object),index:Number,imageFit:String,lazyLoad:Boolean,deletable:Boolean,reupload:Boolean,previewSize:[Number,String,Array],beforeDelete:Function},emits:["delete","preview","reupload"],setup(e,{emit:l,slots:i}){const t=()=>{const{status:o,message:f}=e.item;if(o==="uploading"||o==="failed"){const n=o==="failed"?c(J,{name:"close",class:D("mask-icon")},null):c(je,{class:D("loading")},null),g=Xe(f)&&f!=="";return c("div",{class:D("mask")},[n,g&&c("div",{class:D("mask-message")},[f])])}},s=o=>{const{name:f,item:n,index:g,beforeDelete:m}=e;o.stopPropagation(),Ge(m,{args:[n,{name:f,index:g}],done:()=>l("delete")})},a=()=>l("preview"),w=()=>l("reupload"),b=()=>{if(e.deletable&&e.item.status!=="uploading"){const o=i["preview-delete"];return c("div",{role:"button",class:D("preview-delete",{shadow:!o}),tabindex:0,"aria-label":na("delete"),onClick:s},[o?o():c(J,{name:"cross",class:D("preview-delete-icon")},null)])}},x=()=>{if(i["preview-cover"]){const{index:o,item:f}=e;return c("div",{class:D("preview-cover")},[i["preview-cover"](de({index:o},f))])}},_=()=>{const{item:o,lazyLoad:f,imageFit:n,previewSize:g,reupload:m}=e;return it(o)?c(ot,{fit:n,src:o.objectUrl||o.content||o.url,class:D("preview-image"),width:Array.isArray(g)?g[0]:g,height:Array.isArray(g)?g[1]:g,lazyLoad:f,onClick:m?w:a},{default:x}):c("div",{class:D("file"),style:Je(e.previewSize)},[c(J,{class:D("file-icon"),name:"description"},null),c("div",{class:[D("file-name"),"van-ellipsis"]},[o.file?o.file.name:o.url]),x()])};return()=>c("div",{class:D("preview")},[_(),t(),b()])}});const ua={name:G(""),accept:q("image/*"),capture:String,multiple:Boolean,disabled:Boolean,readonly:Boolean,lazyLoad:Boolean,maxCount:G(1/0),imageFit:q("cover"),resultType:q("dataUrl"),uploadIcon:q("photograph"),uploadText:String,deletable:V,reupload:Boolean,afterRead:Function,showUpload:V,modelValue:He(),beforeRead:Function,beforeDelete:Function,previewSize:[Number,String,Array],previewImage:V,previewOptions:Object,previewFullImage:V,maxSize:{type:[Number,String,Function],default:1/0}};var da=W({name:la,props:ua,emits:["delete","oversize","clickUpload","closePreview","clickPreview","clickReupload","update:modelValue"],setup(e,{emit:l,slots:i}){const t=T(),s=[],a=T(-1),w=T(!1),b=(u=e.modelValue.length)=>({name:e.name,index:u}),x=()=>{t.value&&(t.value.value="")},_=u=>{if(x(),nt(u,e.maxSize))if(Array.isArray(u)){const S=ia(u,e.maxSize);if(u=S.valid,l("oversize",S.invalid,b()),!u.length)return}else{l("oversize",u,b());return}if(u=he(u),a.value>-1){const S=[...e.modelValue];S.splice(a.value,1,u),l("update:modelValue",S),a.value=-1}else l("update:modelValue",[...e.modelValue,...qe(u)]);e.afterRead&&e.afterRead(u,b())},o=u=>{const{maxCount:S,modelValue:$,resultType:I}=e;if(Array.isArray(u)){const A=+S-$.length;u.length>A&&(u=u.slice(0,A)),Promise.all(u.map(U=>Ee(U,I))).then(U=>{const ee=u.map((te,r)=>{const h={file:te,status:"",message:"",objectUrl:URL.createObjectURL(te)};return U[r]&&(h.content=U[r]),h});_(ee)})}else Ee(u,I).then(A=>{const U={file:u,status:"",message:"",objectUrl:URL.createObjectURL(u)};A&&(U.content=A),_(U)})},f=u=>{const{files:S}=u.target;if(e.disabled||!S||!S.length)return;const $=S.length===1?S[0]:[].slice.call(S);if(e.beforeRead){const I=e.beforeRead($,b());if(!I){x();return}if(pt(I)){I.then(A=>{o(A||$)}).catch(x);return}}o($)};let n;const g=()=>l("closePreview"),m=u=>{if(e.previewFullImage){const S=e.modelValue.filter(it),$=S.map(I=>(I.objectUrl&&!I.url&&I.status!=="failed"&&(I.url=I.objectUrl,s.push(I.url)),I.url)).filter(Boolean);n=oa(de({images:$,startPosition:S.indexOf(u),onClose:g},e.previewOptions))}},P=()=>{n&&n.close()},v=(u,S)=>{const $=e.modelValue.slice(0);$.splice(S,1),l("update:modelValue",$),l("delete",u,b(S))},z=u=>{w.value=!0,a.value=u,re(()=>Q())},L=()=>{w.value||(a.value=-1),w.value=!1},k=(u,S)=>{const $=["imageFit","deletable","reupload","previewSize","beforeDelete"],I=de(se(e,$),se(u,$,!0));return c(ra,ue({item:u,index:S,onClick:()=>l(e.reupload?"clickReupload":"clickPreview",u,b(S)),onDelete:()=>v(u,S),onPreview:()=>m(u),onReupload:()=>z(S)},se(e,["name","lazyLoad"]),I),se(i,["preview-cover","preview-delete"]))},E=()=>{if(e.previewImage)return e.modelValue.map(k)},y=u=>l("clickUpload",u),M=()=>{const u=e.modelValue.length<+e.maxCount,S=e.readonly?null:c("input",{ref:t,type:"file",class:D("input"),accept:e.accept,capture:e.capture,multiple:e.multiple&&a.value===-1,disabled:e.disabled,onChange:f,onClick:L},null);return i.default?Ie(c("div",{class:D("input-wrapper"),onClick:y},[i.default(),S]),[[ze,u]]):Ie(c("div",{class:D("upload",{readonly:e.readonly}),style:Je(e.previewSize),onClick:y},[c(J,{name:e.uploadIcon,class:D("upload-icon")},null),e.uploadText&&c("span",{class:D("upload-text")},[e.uploadText]),S]),[[ze,e.showUpload&&u]])},Q=()=>{t.value&&!e.disabled&&t.value.click()};return pe(()=>{s.forEach(u=>URL.revokeObjectURL(u))}),be({chooseFile:Q,reuploadFile:z,closeImagePreview:P}),Ye(()=>e.modelValue),()=>c("div",{class:D()},[c("div",{class:D("wrapper",{disabled:e.disabled})},[E(),M()])])}});const va=ae(da);const fa="/assets/upload-7e4bd949.png";const ma={class:"px-4 py-8"},ga={class:"text-2xl mb-1 font-semibold text-[#232323]"},ha=F("p",{class:"text-sm/[24px] text-[#666666] mb-[76px]"},"让数据录入更精准,更高效",-1),wa=F("div",{class:"mb-[95px] py-[34px] flex flex-col items-center"},[F("img",{class:"block w-[120px] h-[120px]",src:fa,alt:""}),F("p",{class:"w-[182px] text-center text-[#999] text-xs"}," *支持PNG、JPG、JPEG等格式 图片大小不超过7M ")],-1),ba=F("div",{class:"h-[42px] text-sm/[42px] text-center text-white font-medium bg-[#AE8877] w-full"}," 图片上传 ",-1),xa=F("div",{class:"h-[42px] text-sm/[42px] text-center text-[#AE8877] font-medium border border-[#AE8877]"}," 拍照上传 ",-1),ya={class:"w-[230px] mx-auto mb-24 relative"},_a=["src"],Sa={class:"absolute z-10 -top-3 -right-3 rounded-full bg-black w-[25px] h-[25px]"},ka={class:"px-4 pt-[42px] flex flex-col h-full"},Ca=F("h1",{class:"text-2xl mb-2 font-semibold text-[#232323]"},"制单选择",-1),Pa={key:0,class:"flex-1 overflow-y-auto"},Ia={__name:"ocr-upload",setup(e){const l=vt(),i=ft(),t=T([]),s=()=>{t.value=[]},a=()=>{Oe("文件大小不能超过7M")},w=T(null),b=g=>{Te({url:"/get_barcode",method:"post",data:g}).then(m=>{m.code===1&&(zt("识别成功"),t.value=[],w.value=null,n.value="",f.value=!1)})},x=g=>{const m=new FormData;m.append("file",t.value[0].file),g&&m.append("message",JSON.stringify(g)),i.query.type==="RFID吊牌"||!i.query.type||g?b(m):Te({url:"/get_matio_id",method:"post",data:m}).then(P=>{var v;+P.code==1&&(P.matio_list.length?(w.value=P,f.value=!0):((v=P.matio_list)==null?void 0:v.length)===0&&Oe("未识别到制单信息, 请确认吊牌类别选择是否正确"))})},_=()=>{const g={matio_id:n.value,image_origin_path:w.value.image_origin_path,upload_time:w.value.upload_timestamp,barcode_type:i.query.type||"RFID吊牌",barcode:w.value.barcode};x(g)},o=T(localStorage.getItem("user"));we(()=>{o.value||l.push("/login?redirect=/")});const f=T(!1),n=T("");return(g,m)=>{var E;const P=va,v=J,z=jt,L=Ft,k=We;return oe(),fe(xe,null,[F("div",ma,[F("h1",ga," OCR "+Re(mt(i).query.type||"RFID吊牌")+"识别 ",1),ha,t.value.length?(oe(),fe(xe,{key:1},[F("div",ya,[F("img",{class:"w-full",src:(E=t.value[0])==null?void 0:E.content,alt:""},null,8,_a),F("div",Sa,[c(v,{name:"cross",class:"!absolute top-1/2 left-[13.5px] -translate-x-1/2 -translate-y-1/2",color:"#fff",size:14,onClick:s})])]),F("div",{class:"h-[42px] text-sm/[42px] text-center text-white font-medium bg-[#AE8877] w-full",onClick:m[2]||(m[2]=y=>x(null))}," 确认上传 ")],64)):(oe(),fe(xe,{key:0},[wa,c(P,{class:"w-full mb-2.5",modelValue:t.value,"onUpdate:modelValue":m[0]||(m[0]=y=>t.value=y),"preview-image":!1,"max-size":7*1024*1024,onOversize:a},{default:me(()=>[ba]),_:1},8,["modelValue"]),c(P,{class:"w-full mb-2.5",modelValue:t.value,"onUpdate:modelValue":m[1]||(m[1]=y=>t.value=y),capture:"camera","preview-image":!1,"max-size":7*1024*1024,onOversize:a},{default:me(()=>[xa]),_:1},8,["modelValue"])],64))]),c(k,{show:f.value,"onUpdate:show":m[4]||(m[4]=y=>f.value=y),position:"bottom",overlay:!1,duration:0,style:{height:"100%",width:"100%",maxWidth:"100%"}},{default:me(()=>[F("div",ka,[Ca,w.value?(oe(),fe("div",Pa,[c(L,{modelValue:n.value,"onUpdate:modelValue":m[3]||(m[3]=y=>n.value=y),shape:"dot"},{default:me(()=>[(oe(!0),fe(xe,null,gt(w.value.matio_list,(y,M)=>(oe(),wt(z,{key:M,name:y},{default:me(()=>[bt(Re(y),1)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])])):ht("v-if",!0),F("div",{onClick:_,class:"mb-8 mt-4 h-[42px] text-sm/[42px] text-center text-white font-medium bg-[#AE8877] w-full"}," 确认选择 ")])]),_:1},8,["show"])],64)}}},$a=dt(Ia,[["__file","D:/项目代码/goelia-ocr/src/pages/ocr-upload.vue"]]);export{$a as default};