import{i as pt,j as ft,k as ie,r as l,l as Re,p as ae,bn as xr,bo as mt,bp as Er,bq as Ir,br as Ut,bs as zt,bt as Or,bu as Wt,bv as Pr,bw as Dr,bx as Fr,by as jr,_ as Rr,bz as Tr,h as Ee,a as nt,d as Ht,f as Oe,b as Xt,bA as at,a3 as qt,m as Vt,aN as ot,aV as kr,X as Nr,av as Te,aw as ke,M as Lr,bB as Ie,bC as pe,O as _e,aG as Gt,aH as Kt,aF as Yt,g as oe,aI as le,aE as Jt,R as it,N as Ar,aU as Qt,t as Zt,bD as Mr,bE as yt,P as Br,au as Ue,aM as _r,V as Ur,bF as zr,U as wt,aO as $t,a0 as st,aq as Wr,aK as Hr,bG as Xr,aX as qr,az as Ct,bH as Vr,bI as er,b6 as tr,bJ as Gr,Y as rr,I as lt,aa as Kr,A as Yr,x as Jr,w as Qr,q as D,s as ee,b2 as Zr,b3 as en,L as tn,F as rn,bK as nn,$ as an,b7 as Ne,ah as on,bL as sn}from"./index-c51caa49.js";import{T as ln,n as cn,c as St,S as xt,F as un,o as dn}from"./PrivateIndicator-3ba4829d.js";import{u as pn,c as fn,R as Se}from"./useTags-e7bab752.js";import{E as mn,F as ne,I as xe,R as hn,C as gn}from"./MultiLineMarkdown-cd643b01.js";import{C as vn,T as bn}from"./index-d69c6bc3.js";import{b as yn,i as wn}from"./isString-acff3167.js";import{b as nr}from"./_baseIteratee-fd661219.js";const Le=(e,t,r,n,a)=>({background:e,border:`${ie(n.lineWidth)} ${n.lineType} ${t}`,[`${a}-icon`]:{color:r}}),$n=e=>{const{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:a,fontSize:i,fontSizeLG:s,lineHeight:o,borderRadiusLG:u,motionEaseInOutCirc:c,withDescriptionIconSize:p,colorText:f,colorTextHeading:g,withDescriptionPadding:m,defaultPadding:d}=e;return{[t]:Object.assign(Object.assign({},ft(e)),{position:"relative",display:"flex",alignItems:"center",padding:d,wordWrap:"break-word",borderRadius:u,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:i,lineHeight:o},"&-message":{color:g},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${r} ${c}, opacity ${r} ${c}, padding-top ${r} ${c}, padding-bottom ${r} ${c}, margin-bottom ${r} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:a,fontSize:p,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:n,color:g,fontSize:s},[`${t}-description`]:{display:"block",color:f}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},Cn=e=>{const{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:a,colorWarning:i,colorWarningBorder:s,colorWarningBg:o,colorError:u,colorErrorBorder:c,colorErrorBg:p,colorInfo:f,colorInfoBorder:g,colorInfoBg:m}=e;return{[t]:{"&-success":Le(a,n,r,e,t),"&-info":Le(m,g,f,e,t),"&-warning":Le(o,s,i,e,t),"&-error":Object.assign(Object.assign({},Le(p,c,u,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},Sn=e=>{const{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:a,fontSizeIcon:i,colorIcon:s,colorIconHover:o}=e;return{[t]:{"&-action":{marginInlineStart:a},[`${t}-close-icon`]:{marginInlineStart:a,padding:0,overflow:"hidden",fontSize:i,lineHeight:ie(i),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${r}-close`]:{color:s,transition:`color ${n}`,"&:hover":{color:o}}},"&-close-text":{color:s,transition:`color ${n}`,"&:hover":{color:o}}}}},xn=e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}),En=pt("Alert",e=>[$n(e),Cn(e),Sn(e)],xn);var Et=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};const In={success:zt,info:Or,error:Wt,warning:Pr},On=e=>{const{icon:t,prefixCls:r,type:n}=e,a=In[n]||null;return t?Ir(t,l.createElement("span",{className:`${r}-icon`},t),()=>({className:ae(`${r}-icon`,{[t.props.className]:t.props.className})})):l.createElement(a,{className:`${r}-icon`})},Pn=e=>{const{isClosable:t,prefixCls:r,closeIcon:n,handleClose:a,ariaProps:i}=e,s=n===!0||n===void 0?l.createElement(Ut,null):n;return t?l.createElement("button",Object.assign({type:"button",onClick:a,className:`${r}-close-icon`,tabIndex:0},i),s):null},Dn=l.forwardRef((e,t)=>{const{description:r,prefixCls:n,message:a,banner:i,className:s,rootClassName:o,style:u,onMouseEnter:c,onMouseLeave:p,onClick:f,afterClose:g,showIcon:m,closable:d,closeText:y,closeIcon:v,action:E,id:$}=e,j=Et(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[I,h]=l.useState(!1),O=l.useRef(null);l.useImperativeHandle(t,()=>({nativeElement:O.current}));const{getPrefixCls:S,direction:F,alert:b}=l.useContext(Re),C=S("alert",n),[z,te,K]=En(C),Y=R=>{var k;h(!0),(k=e.onClose)===null||k===void 0||k.call(e,R)},V=l.useMemo(()=>e.type!==void 0?e.type:i?"warning":"info",[e.type,i]),H=l.useMemo(()=>typeof d=="object"&&d.closeIcon||y?!0:typeof d=="boolean"?d:v!==!1&&v!==null&&v!==void 0?!0:!!(b!=null&&b.closable),[y,v,d,b==null?void 0:b.closable]),N=i&&m===void 0?!0:m,x=ae(C,`${C}-${V}`,{[`${C}-with-description`]:!!r,[`${C}-no-icon`]:!N,[`${C}-banner`]:!!i,[`${C}-rtl`]:F==="rtl"},b==null?void 0:b.className,s,o,K,te),P=xr(j,{aria:!0,data:!0}),A=l.useMemo(()=>{var R,k;return typeof d=="object"&&d.closeIcon?d.closeIcon:y||(v!==void 0?v:typeof(b==null?void 0:b.closable)=="object"&&(!((R=b==null?void 0:b.closable)===null||R===void 0)&&R.closeIcon)?(k=b==null?void 0:b.closable)===null||k===void 0?void 0:k.closeIcon:b==null?void 0:b.closeIcon)},[v,d,y,b==null?void 0:b.closeIcon]),M=l.useMemo(()=>{const R=d??(b==null?void 0:b.closable);return typeof R=="object"?Et(R,["closeIcon"]):{}},[d,b==null?void 0:b.closable]);return z(l.createElement(mt,{visible:!I,motionName:`${C}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:R=>({maxHeight:R.offsetHeight}),onLeaveEnd:g},(R,k)=>{let{className:w,style:T}=R;return l.createElement("div",Object.assign({id:$,ref:Er(O,k),"data-show":!I,className:ae(x,w),style:Object.assign(Object.assign(Object.assign({},b==null?void 0:b.style),u),T),onMouseEnter:c,onMouseLeave:p,onClick:f,role:"alert"},P),N?l.createElement(On,{description:r,icon:e.icon,prefixCls:C,type:V}):null,l.createElement("div",{className:`${C}-content`},a?l.createElement("div",{className:`${C}-message`},a):null,r?l.createElement("div",{className:`${C}-description`},r):null),E?l.createElement("div",{className:`${C}-action`},E):null,l.createElement(Pn,{isClosable:H,prefixCls:C,closeIcon:A,handleClose:Y,ariaProps:M}))}))}),ar=Dn;function ze(e){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ze(e)}function or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(or=function(){return!!e})()}function Fn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jn(e,t){if(t&&(Dr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fn(e)}function Rn(e,t,r){return t=ze(t),jn(e,or()?Reflect.construct(t,r||[],ze(e).constructor):t.apply(e,r))}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ct(e,t)}function Tn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ct(e,t)}let kn=function(e){function t(){var r;return jr(this,t),r=Rn(this,t,arguments),r.state={error:void 0,info:{componentStack:""}},r}return Tn(t,e),Fr(t,[{key:"componentDidCatch",value:function(n,a){this.setState({error:n,info:a})}},{key:"render",value:function(){const{message:n,description:a,id:i,children:s}=this.props,{error:o,info:u}=this.state,c=(u==null?void 0:u.componentStack)||null,p=typeof n>"u"?(o||"").toString():n,f=typeof a>"u"?c:a;return o?l.createElement(ar,{id:i,type:"error",message:p,description:l.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},f)}):s}}])}(l.Component);const Nn=kn,ir=ar;ir.ErrorBoundary=Nn;const It=ir;var Ln={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},An=function(){var t=l.useRef([]),r=l.useRef(null);return l.useEffect(function(){var n=Date.now(),a=!1;t.current.forEach(function(i){if(i){a=!0;var s=i.style;s.transitionDuration=".3s, .3s, .3s, .06s",r.current&&n-r.current<100&&(s.transitionDuration="0s, 0s")}}),a&&(r.current=Date.now())}),t.current},Ot=0,Mn=Tr();function Bn(){var e;return Mn?(e=Ot,Ot+=1):e="TEST_OR_SSR",e}const _n=function(e){var t=l.useState(),r=Rr(t,2),n=r[0],a=r[1];return l.useEffect(function(){a("rc_progress_".concat(Bn()))},[]),e||n};var Pt=function(t){var r=t.bg,n=t.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:r}},n)};function Dt(e,t){return Object.keys(e).map(function(r){var n=parseFloat(r),a="".concat(Math.floor(n*t),"%");return"".concat(e[r]," ").concat(a)})}var Un=l.forwardRef(function(e,t){var r=e.prefixCls,n=e.color,a=e.gradientId,i=e.radius,s=e.style,o=e.ptg,u=e.strokeLinecap,c=e.strokeWidth,p=e.size,f=e.gapDegree,g=n&&Ee(n)==="object",m=g?"#FFF":void 0,d=p/2,y=l.createElement("circle",{className:"".concat(r,"-circle-path"),r:i,cx:d,cy:d,stroke:m,strokeLinecap:u,strokeWidth:c,opacity:o===0?0:1,style:s,ref:t});if(!g)return y;var v="".concat(a,"-conic"),E=f?"".concat(180+f/2,"deg"):"0deg",$=Dt(n,(360-f)/360),j=Dt(n,1),I="conic-gradient(from ".concat(E,", ").concat($.join(", "),")"),h="linear-gradient(to ".concat(f?"bottom":"top",", ").concat(j.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:v},y),l.createElement("foreignObject",{x:0,y:0,width:p,height:p,mask:"url(#".concat(v,")")},l.createElement(Pt,{bg:h},l.createElement(Pt,{bg:I}))))}),Fe=100,Ye=function(t,r,n,a,i,s,o,u,c,p){var f=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,g=n/100*360*((360-s)/360),m=s===0?0:{bottom:0,top:180,left:90,right:-90}[o],d=(100-a)/100*r;c==="round"&&a!==100&&(d+=p/2,d>=r&&(d=r-.01));var y=Fe/2;return{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(r,"px ").concat(t),strokeDashoffset:d+f,transform:"rotate(".concat(i+g+m,"deg)"),transformOrigin:"".concat(y,"px ").concat(y,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},zn=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Ft(e){var t=e??[];return Array.isArray(t)?t:[t]}var Wn=function(t){var r=nt(nt({},Ln),t),n=r.id,a=r.prefixCls,i=r.steps,s=r.strokeWidth,o=r.trailWidth,u=r.gapDegree,c=u===void 0?0:u,p=r.gapPosition,f=r.trailColor,g=r.strokeLinecap,m=r.style,d=r.className,y=r.strokeColor,v=r.percent,E=Ht(r,zn),$=Fe/2,j=_n(n),I="".concat(j,"-gradient"),h=$-s/2,O=Math.PI*2*h,S=c>0?90+c/2:-90,F=O*((360-c)/360),b=Ee(i)==="object"?i:{count:i,gap:2},C=b.count,z=b.gap,te=Ft(v),K=Ft(y),Y=K.find(function(M){return M&&Ee(M)==="object"}),V=Y&&Ee(Y)==="object",H=V?"butt":g,N=Ye(O,F,0,100,S,c,p,f,H,s),x=An(),P=function(){var R=0;return te.map(function(k,w){var T=K[w]||K[K.length-1],B=Ye(O,F,R,k,S,c,p,T,H,s);return R+=k,l.createElement(Un,{key:w,color:T,ptg:k,radius:h,prefixCls:a,gradientId:I,style:B,strokeLinecap:H,strokeWidth:s,gapDegree:c,ref:function(J){x[w]=J},size:Fe})}).reverse()},A=function(){var R=Math.round(C*(te[0]/100)),k=100/C,w=0;return new Array(C).fill(null).map(function(T,B){var _=B<=R-1?K[0]:f,J=_&&Ee(_)==="object"?"url(#".concat(I,")"):void 0,re=Ye(O,F,w,k,S,c,p,_,"butt",s,z);return w+=(F-re.strokeDashoffset+z)*100/F,l.createElement("circle",{key:B,className:"".concat(a,"-circle-path"),r:h,cx:$,cy:$,stroke:J,strokeWidth:s,opacity:1,style:re,ref:function(ce){x[B]=ce}})})};return l.createElement("svg",Oe({className:Xt("".concat(a,"-circle"),d),viewBox:"0 0 ".concat(Fe," ").concat(Fe),style:m,id:n,role:"presentation"},E),!C&&l.createElement("circle",{className:"".concat(a,"-circle-trail"),r:h,cx:$,cy:$,stroke:f,strokeLinecap:H,strokeWidth:o||s,style:N}),C?A():P())};function he(e){return!e||e<0?0:e>100?100:e}function We(e){let{success:t,successPercent:r}=e,n=r;return t&&"progress"in t&&(n=t.progress),t&&"percent"in t&&(n=t.percent),n}const Hn=e=>{let{percent:t,success:r,successPercent:n}=e;const a=he(We({success:r,successPercent:n}));return[a,he(he(t)-a)]},Xn=e=>{let{success:t={},strokeColor:r}=e;const{strokeColor:n}=t;return[n||at.green,r||null]},Ve=(e,t,r)=>{var n,a,i,s;let o=-1,u=-1;if(t==="step"){const c=r.steps,p=r.strokeWidth;typeof e=="string"||typeof e>"u"?(o=e==="small"?2:14,u=p??8):typeof e=="number"?[o,u]=[e,e]:[o=14,u=8]=Array.isArray(e)?e:[e.width,e.height],o*=c}else if(t==="line"){const c=r==null?void 0:r.strokeWidth;typeof e=="string"||typeof e>"u"?u=c||(e==="small"?6:8):typeof e=="number"?[o,u]=[e,e]:[o=-1,u=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[o,u]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[o,u]=[e,e]:Array.isArray(e)&&(o=(a=(n=e[0])!==null&&n!==void 0?n:e[1])!==null&&a!==void 0?a:120,u=(s=(i=e[0])!==null&&i!==void 0?i:e[1])!==null&&s!==void 0?s:120));return[o,u]},qn=3,Vn=e=>qn/e*100,Gn=e=>{const{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:a,gapDegree:i,width:s=120,type:o,children:u,success:c,size:p=s,steps:f}=e,[g,m]=Ve(p,"circle");let{strokeWidth:d}=e;d===void 0&&(d=Math.max(Vn(g),6));const y={width:g,height:m,fontSize:g*.15+6},v=l.useMemo(()=>{if(i||i===0)return i;if(o==="dashboard")return 75},[i,o]),E=Hn(e),$=a||o==="dashboard"&&"bottom"||void 0,j=Object.prototype.toString.call(e.strokeColor)==="[object Object]",I=Xn({success:c,strokeColor:e.strokeColor}),h=ae(`${t}-inner`,{[`${t}-circle-gradient`]:j}),O=l.createElement(Wn,{steps:f,percent:f?E[1]:E,strokeWidth:d,trailWidth:d,strokeColor:f?I[1]:I,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:v,gapPosition:$}),S=g<=20,F=l.createElement("div",{className:h,style:y},O,!S&&u);return S?l.createElement(qt,{title:u},F):F},Kn=Gn,He="--progress-line-stroke-color",sr="--progress-percent",jt=e=>{const t=e?"100%":"-100%";return new ot(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},Yn=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},ft(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${He})`]},height:"100%",width:`calc(1 / var(${sr}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${ie(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:jt(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:jt(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},Jn=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},Qn=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},Zn=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}},ea=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),ta=pt("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),r=Vt(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[Yn(r),Jn(r),Qn(r),Zn(r)]},ea);var ra=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};const na=e=>{let t=[];return Object.keys(e).forEach(r=>{const n=parseFloat(r.replace(/%/g,""));isNaN(n)||t.push({key:n,value:e[r]})}),t=t.sort((r,n)=>r.key-n.key),t.map(r=>{let{key:n,value:a}=r;return`${a} ${n}%`}).join(", ")},aa=(e,t)=>{const{from:r=at.blue,to:n=at.blue,direction:a=t==="rtl"?"to left":"to right"}=e,i=ra(e,["from","to","direction"]);if(Object.keys(i).length!==0){const o=na(i),u=`linear-gradient(${a}, ${o})`;return{background:u,[He]:u}}const s=`linear-gradient(${a}, ${r}, ${n})`;return{background:s,[He]:s}},oa=e=>{const{prefixCls:t,direction:r,percent:n,size:a,strokeWidth:i,strokeColor:s,strokeLinecap:o="round",children:u,trailColor:c=null,percentPosition:p,success:f}=e,{align:g,type:m}=p,d=s&&typeof s!="string"?aa(s,r):{[He]:s,background:s},y=o==="square"||o==="butt"?0:void 0,v=a??[-1,i||(a==="small"?6:8)],[E,$]=Ve(v,"line",{strokeWidth:i}),j={backgroundColor:c||void 0,borderRadius:y},I=Object.assign(Object.assign({width:`${he(n)}%`,height:$,borderRadius:y},d),{[sr]:he(n)/100}),h=We(e),O={width:`${he(h)}%`,height:$,borderRadius:y,backgroundColor:f==null?void 0:f.strokeColor},S={width:E<0?"100%":E},F=l.createElement("div",{className:`${t}-inner`,style:j},l.createElement("div",{className:ae(`${t}-bg`,`${t}-bg-${m}`),style:I},m==="inner"&&u),h!==void 0&&l.createElement("div",{className:`${t}-success-bg`,style:O})),b=m==="outer"&&g==="start",C=m==="outer"&&g==="end";return m==="outer"&&g==="center"?l.createElement("div",{className:`${t}-layout-bottom`},F,u):l.createElement("div",{className:`${t}-outer`,style:S},b&&u,F,C&&u)},ia=oa,sa=e=>{const{size:t,steps:r,percent:n=0,strokeWidth:a=8,strokeColor:i,trailColor:s=null,prefixCls:o,children:u}=e,c=Math.round(r*(n/100)),f=t??[t==="small"?2:14,a],[g,m]=Ve(f,"step",{steps:r,strokeWidth:a}),d=g/r,y=new Array(r);for(let v=0;v<r;v++){const E=Array.isArray(i)?i[v]:i;y[v]=l.createElement("div",{key:v,className:ae(`${o}-steps-item`,{[`${o}-steps-item-active`]:v<=c-1}),style:{backgroundColor:v<=c-1?E:s,width:d,height:m}})}return l.createElement("div",{className:`${o}-steps-outer`},y,u)},la=sa;var ca=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};const ua=["normal","exception","active","success"],da=l.forwardRef((e,t)=>{const{prefixCls:r,className:n,rootClassName:a,steps:i,strokeColor:s,percent:o=0,size:u="default",showInfo:c=!0,type:p="line",status:f,format:g,style:m,percentPosition:d={}}=e,y=ca(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:v="end",type:E="outer"}=d,$=Array.isArray(s)?s[0]:s,j=typeof s=="string"||Array.isArray(s)?s:void 0,I=l.useMemo(()=>{if($){const P=typeof $=="string"?$:Object.values($)[0];return new kr(P).isLight()}return!1},[s]),h=l.useMemo(()=>{var P,A;const M=We(e);return parseInt(M!==void 0?(P=M??0)===null||P===void 0?void 0:P.toString():(A=o??0)===null||A===void 0?void 0:A.toString(),10)},[o,e.success,e.successPercent]),O=l.useMemo(()=>!ua.includes(f)&&h>=100?"success":f||"normal",[f,h]),{getPrefixCls:S,direction:F,progress:b}=l.useContext(Re),C=S("progress",r),[z,te,K]=ta(C),Y=p==="line",V=Y&&!i,H=l.useMemo(()=>{if(!c)return null;const P=We(e);let A;const M=g||(k=>`${k}%`),R=Y&&I&&E==="inner";return E==="inner"||g||O!=="exception"&&O!=="success"?A=M(he(o),he(P)):O==="exception"?A=Y?l.createElement(Wt,null):l.createElement(Ut,null):O==="success"&&(A=Y?l.createElement(zt,null):l.createElement(vn,null)),l.createElement("span",{className:ae(`${C}-text`,{[`${C}-text-bright`]:R,[`${C}-text-${v}`]:V,[`${C}-text-${E}`]:V}),title:typeof A=="string"?A:void 0},A)},[c,o,h,O,p,C,g]);let N;p==="line"?N=i?l.createElement(la,Object.assign({},e,{strokeColor:j,prefixCls:C,steps:typeof i=="object"?i.count:i}),H):l.createElement(ia,Object.assign({},e,{strokeColor:$,prefixCls:C,direction:F,percentPosition:{align:v,type:E}}),H):(p==="circle"||p==="dashboard")&&(N=l.createElement(Kn,Object.assign({},e,{strokeColor:$,prefixCls:C,progressStatus:O}),H));const x=ae(C,`${C}-status-${O}`,{[`${C}-${p==="dashboard"&&"circle"||p}`]:p!=="line",[`${C}-inline-circle`]:p==="circle"&&Ve(u,"circle")[0]<=20,[`${C}-line`]:V,[`${C}-line-align-${v}`]:V,[`${C}-line-position-${E}`]:V,[`${C}-steps`]:i,[`${C}-show-info`]:c,[`${C}-${u}`]:typeof u=="string",[`${C}-rtl`]:F==="rtl"},b==null?void 0:b.className,n,a,te,K);return z(l.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},b==null?void 0:b.style),m),className:x,role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100},Nr(y,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),N))}),pa=da;var fa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const ma=fa;var ha=function(t,r){return l.createElement(Te,ke({},t,{ref:r,icon:ma}))},ga=l.forwardRef(ha);const va=ga;var ba={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const ya=ba;var wa=function(t,r){return l.createElement(Te,ke({},t,{ref:r,icon:ya}))},$a=l.forwardRef(wa);const Ca=$a;var Sa={icon:function(t,r){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:r}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"};const xa=Sa;var Ea=function(t,r){return l.createElement(Te,ke({},t,{ref:r,icon:xa}))},Ia=l.forwardRef(Ea);const Oa=Ia;var Pa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"};const Da=Pa;var Fa=function(t,r){return l.createElement(Te,ke({},t,{ref:r,icon:Da}))},ja=l.forwardRef(Fa);const Ra=ja;var Ta={icon:function(t,r){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:r}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:r}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:r}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"};const ka=Ta;var Na=function(t,r){return l.createElement(Te,ke({},t,{ref:r,icon:ka}))},La=l.forwardRef(Na);const Aa=La,Je=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",a=e.type||"",i=a.replace(/\/.*$/,"");return r.some(function(s){var o=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(o.charAt(0)==="."){var u=n.toLowerCase(),c=o.toLowerCase(),p=[c];return(c===".jpg"||c===".jpeg")&&(p=[".jpg",".jpeg"]),p.some(function(f){return u.endsWith(f)})}return/\/\*$/.test(o)?i===o.replace(/\/.*$/,""):a===o?!0:/^\w+$/.test(o)?(Lr(!1,"Upload takes an invalidate 'accept' type '".concat(o,"'.Skip for check.")),!0):!1})}return!0};function Ma(e,t){var r="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),n=new Error(r);return n.status=t.status,n.method=e.method,n.url=e.action,n}function Rt(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function Ba(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(i){i.total>0&&(i.percent=i.loaded/i.total*100),e.onProgress(i)});var r=new FormData;e.data&&Object.keys(e.data).forEach(function(a){var i=e.data[a];if(Array.isArray(i)){i.forEach(function(s){r.append("".concat(a,"[]"),s)});return}r.append(a,i)}),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(i){e.onError(i)},t.onload=function(){return t.status<200||t.status>=300?e.onError(Ma(e,t),Rt(t)):e.onSuccess(Rt(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return n["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(a){n[a]!==null&&t.setRequestHeader(a,n[a])}),t.send(r),{abort:function(){t.abort()}}}var _a=function(){var e=Ie(pe().mark(function t(r,n){var a,i,s,o,u,c,p,f;return pe().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:c=function(){return c=Ie(pe().mark(function y(v){return pe().wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.abrupt("return",new Promise(function(j){v.file(function(I){n(I)?(v.fullPath&&!I.webkitRelativePath&&(Object.defineProperties(I,{webkitRelativePath:{writable:!0}}),I.webkitRelativePath=v.fullPath.replace(/^\//,""),Object.defineProperties(I,{webkitRelativePath:{writable:!1}})),j(I)):j(null)})}));case 1:case"end":return $.stop()}},y)})),c.apply(this,arguments)},u=function(y){return c.apply(this,arguments)},o=function(){return o=Ie(pe().mark(function y(v){var E,$,j,I,h;return pe().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:E=v.createReader(),$=[];case 2:return S.next=5,new Promise(function(F){E.readEntries(F,function(){return F([])})});case 5:if(j=S.sent,I=j.length,I){S.next=9;break}return S.abrupt("break",12);case 9:for(h=0;h<I;h++)$.push(j[h]);S.next=2;break;case 12:return S.abrupt("return",$);case 13:case"end":return S.stop()}},y)})),o.apply(this,arguments)},s=function(y){return o.apply(this,arguments)},a=[],i=[],r.forEach(function(d){return i.push(d.webkitGetAsEntry())}),p=function(){var d=Ie(pe().mark(function y(v,E){var $,j;return pe().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(v){h.next=2;break}return h.abrupt("return");case 2:if(v.path=E||"",!v.isFile){h.next=10;break}return h.next=6,u(v);case 6:$=h.sent,$&&a.push($),h.next=15;break;case 10:if(!v.isDirectory){h.next=15;break}return h.next=13,s(v);case 13:j=h.sent,i.push.apply(i,_e(j));case 15:case"end":return h.stop()}},y)}));return function(v,E){return d.apply(this,arguments)}}(),f=0;case 9:if(!(f<i.length)){m.next=15;break}return m.next=12,p(i[f]);case 12:f++,m.next=9;break;case 15:return m.abrupt("return",a);case 16:case"end":return m.stop()}},t)}));return function(r,n){return e.apply(this,arguments)}}(),Ua=+new Date,za=0;function Qe(){return"rc-upload-".concat(Ua,"-").concat(++za)}var Wa=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],Ha=function(e){Gt(r,e);var t=Kt(r);function r(){var n;Yt(this,r);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=t.call.apply(t,[this].concat(i)),oe(le(n),"state",{uid:Qe()}),oe(le(n),"reqs",{}),oe(le(n),"fileInput",void 0),oe(le(n),"_isMounted",void 0),oe(le(n),"onChange",function(o){var u=n.props,c=u.accept,p=u.directory,f=o.target.files,g=_e(f).filter(function(m){return!p||Je(m,c)});n.uploadFiles(g),n.reset()}),oe(le(n),"onClick",function(o){var u=n.fileInput;if(u){var c=o.target,p=n.props.onClick;if(c&&c.tagName==="BUTTON"){var f=u.parentNode;f.focus(),c.blur()}u.click(),p&&p(o)}}),oe(le(n),"onKeyDown",function(o){o.key==="Enter"&&n.onClick(o)}),oe(le(n),"onFileDrop",function(){var o=Ie(pe().mark(function u(c){var p,f,g;return pe().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(p=n.props.multiple,c.preventDefault(),c.type!=="dragover"){d.next=4;break}return d.abrupt("return");case 4:if(!n.props.directory){d.next=11;break}return d.next=7,_a(Array.prototype.slice.call(c.dataTransfer.items),function(y){return Je(y,n.props.accept)});case 7:f=d.sent,n.uploadFiles(f),d.next=14;break;case 11:g=_e(c.dataTransfer.files).filter(function(y){return Je(y,n.props.accept)}),p===!1&&(g=g.slice(0,1)),n.uploadFiles(g);case 14:case"end":return d.stop()}},u)}));return function(u){return o.apply(this,arguments)}}()),oe(le(n),"uploadFiles",function(o){var u=_e(o),c=u.map(function(p){return p.uid=Qe(),n.processFile(p,u)});Promise.all(c).then(function(p){var f=n.props.onBatchStart;f==null||f(p.map(function(g){var m=g.origin,d=g.parsedFile;return{file:m,parsedFile:d}})),p.filter(function(g){return g.parsedFile!==null}).forEach(function(g){n.post(g)})})}),oe(le(n),"processFile",function(){var o=Ie(pe().mark(function u(c,p){var f,g,m,d,y,v,E,$,j;return pe().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(f=n.props.beforeUpload,g=c,!f){h.next=14;break}return h.prev=3,h.next=6,f(c,p);case 6:g=h.sent,h.next=12;break;case 9:h.prev=9,h.t0=h.catch(3),g=!1;case 12:if(g!==!1){h.next=14;break}return h.abrupt("return",{origin:c,parsedFile:null,action:null,data:null});case 14:if(m=n.props.action,typeof m!="function"){h.next=21;break}return h.next=18,m(c);case 18:d=h.sent,h.next=22;break;case 21:d=m;case 22:if(y=n.props.data,typeof y!="function"){h.next=29;break}return h.next=26,y(c);case 26:v=h.sent,h.next=30;break;case 29:v=y;case 30:return E=(Ee(g)==="object"||typeof g=="string")&&g?g:c,E instanceof File?$=E:$=new File([E],c.name,{type:c.type}),j=$,j.uid=c.uid,h.abrupt("return",{origin:c,data:v,parsedFile:j,action:d});case 35:case"end":return h.stop()}},u,null,[[3,9]])}));return function(u,c){return o.apply(this,arguments)}}()),oe(le(n),"saveFileInput",function(o){n.fileInput=o}),n}return Jt(r,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(a){var i=this,s=a.data,o=a.origin,u=a.action,c=a.parsedFile;if(this._isMounted){var p=this.props,f=p.onStart,g=p.customRequest,m=p.name,d=p.headers,y=p.withCredentials,v=p.method,E=o.uid,$=g||Ba,j={action:u,filename:m,data:s,file:c,headers:d,withCredentials:y,method:v||"post",onProgress:function(h){var O=i.props.onProgress;O==null||O(h,c)},onSuccess:function(h,O){var S=i.props.onSuccess;S==null||S(h,c,O),delete i.reqs[E]},onError:function(h,O){var S=i.props.onError;S==null||S(h,O,c),delete i.reqs[E]}};f(o),this.reqs[E]=$(j)}}},{key:"reset",value:function(){this.setState({uid:Qe()})}},{key:"abort",value:function(a){var i=this.reqs;if(a){var s=a.uid?a.uid:a;i[s]&&i[s].abort&&i[s].abort(),delete i[s]}else Object.keys(i).forEach(function(o){i[o]&&i[o].abort&&i[o].abort(),delete i[o]})}},{key:"render",value:function(){var a=this.props,i=a.component,s=a.prefixCls,o=a.className,u=a.classNames,c=u===void 0?{}:u,p=a.disabled,f=a.id,g=a.name,m=a.style,d=a.styles,y=d===void 0?{}:d,v=a.multiple,E=a.accept,$=a.capture,j=a.children,I=a.directory,h=a.openFileDialogOnClick,O=a.onMouseEnter,S=a.onMouseLeave,F=a.hasControlInside,b=Ht(a,Wa),C=Xt(oe(oe(oe({},s,!0),"".concat(s,"-disabled"),p),o,o)),z=I?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},te=p?{}:{onClick:h?this.onClick:function(){},onKeyDown:h?this.onKeyDown:function(){},onMouseEnter:O,onMouseLeave:S,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:F?void 0:"0"};return it.createElement(i,Oe({},te,{className:C,role:F?void 0:"button",style:m}),it.createElement("input",Oe({},Ar(b,{aria:!0,data:!0}),{id:f,name:g,disabled:p,type:"file",ref:this.saveFileInput,onClick:function(Y){return Y.stopPropagation()},key:this.state.uid,style:nt({display:"none"},y.input),className:c.input,accept:E},z,{multiple:v,onChange:this.onChange},$!=null?{capture:$}:{})),j)}}]),r}(l.Component);function Ze(){}var ut=function(e){Gt(r,e);var t=Kt(r);function r(){var n;Yt(this,r);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=t.call.apply(t,[this].concat(i)),oe(le(n),"uploader",void 0),oe(le(n),"saveUploader",function(o){n.uploader=o}),n}return Jt(r,[{key:"abort",value:function(a){this.uploader.abort(a)}},{key:"render",value:function(){return it.createElement(Ha,Oe({},this.props,{ref:this.saveUploader}))}}]),r}(l.Component);oe(ut,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Ze,onError:Ze,onSuccess:Ze,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const Xa=e=>{const{componentCls:t,iconCls:r}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${ie(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:e.padding},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${ie(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[` &:not(${t}-disabled):hover, &-hover:not(${t}-disabled) `]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[r]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${ie(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${r}, p${t}-text, p${t}-hint `]:{color:e.colorTextDisabled}}}}}},qa=Xa,Va=e=>{const{componentCls:t,antCls:r,iconCls:n,fontSize:a,lineHeight:i,calc:s}=e,o=`${t}-list-item`,u=`${o}-actions`,c=`${o}-action`,p=e.fontHeightSM;return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},Qt()),{lineHeight:e.lineHeight,[o]:{position:"relative",height:s(e.lineHeight).mul(a).equal(),marginTop:e.marginXS,fontSize:a,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${o}-name`]:Object.assign(Object.assign({},Zt),{padding:`0 ${ie(e.paddingXS)}`,lineHeight:i,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[u]:{whiteSpace:"nowrap",[c]:{opacity:0},[n]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[` ${c}:focus-visible, &.picture ${c} `]:{opacity:1},[`${c}${r}-btn`]:{height:p,border:0,lineHeight:1}},[`${t}-icon ${n}`]:{color:e.colorTextDescription,fontSize:a},[`${o}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:s(a).add(e.paddingXS).equal(),fontSize:a,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${o}:hover ${c}`]:{opacity:1},[`${o}-error`]:{color:e.colorError,[`${o}-name, ${t}-icon ${n}`]:{color:e.colorError},[u]:{[`${n}, ${n}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Ga=Va,Ka=e=>{const{componentCls:t}=e,r=new ot("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),n=new ot("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),a=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${a}-appear, ${a}-enter, ${a}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${a}-appear, ${a}-enter`]:{animationName:r},[`${a}-leave`]:{animationName:n}}},{[`${t}-wrapper`]:Mr(e)},r,n]},Ya=Ka,Ja=e=>{const{componentCls:t,iconCls:r,uploadThumbnailSize:n,uploadProgressOffset:a,calc:i}=e,s=`${t}-list`,o=`${s}-item`;return{[`${t}-wrapper`]:{[` ${s}${s}-picture, ${s}${s}-picture-card, ${s}${s}-picture-circle `]:{[o]:{position:"relative",height:i(n).add(i(e.lineWidth).mul(2)).add(i(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${ie(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${o}-thumbnail`]:Object.assign(Object.assign({},Zt),{width:n,height:n,lineHeight:ie(i(n).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[r]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${o}-progress`]:{bottom:a,width:`calc(100% - ${ie(i(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:i(n).add(e.paddingXS).equal()}},[`${o}-error`]:{borderColor:e.colorError,[`${o}-thumbnail ${r}`]:{[`svg path[fill='${yt[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${yt.primary}']`]:{fill:e.colorError}}},[`${o}-uploading`]:{borderStyle:"dashed",[`${o}-name`]:{marginBottom:a}}},[`${s}${s}-picture-circle ${o}`]:{[`&, &::before, ${o}-thumbnail`]:{borderRadius:"50%"}}}}},Qa=e=>{const{componentCls:t,iconCls:r,fontSizeLG:n,colorTextLightSolid:a,calc:i}=e,s=`${t}-list`,o=`${s}-item`,u=e.uploadPicCardSize;return{[` ${t}-wrapper${t}-picture-card-wrapper, ${t}-wrapper${t}-picture-circle-wrapper `]:Object.assign(Object.assign({},Qt()),{display:"block",[`${t}${t}-select`]:{width:u,height:u,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${ie(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${s}${s}-picture-card, ${s}${s}-picture-circle`]:{display:"flex",flexWrap:"wrap","@supports not (gap: 1px)":{"& > *":{marginBlockEnd:e.marginXS,marginInlineEnd:e.marginXS}},"@supports (gap: 1px)":{gap:e.marginXS},[`${s}-item-container`]:{display:"inline-block",width:u,height:u,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[o]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${ie(i(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${ie(i(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${o}:hover`]:{[`&::before, ${o}-actions`]:{opacity:1}},[`${o}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[` ${r}-eye, ${r}-download, ${r}-delete `]:{zIndex:10,width:n,margin:`0 ${ie(e.marginXXS)}`,fontSize:n,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:a,"&:hover":{color:a},svg:{verticalAlign:"baseline"}}},[`${o}-thumbnail, ${o}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${o}-name`]:{display:"none",textAlign:"center"},[`${o}-file + ${o}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${ie(i(e.paddingXS).mul(2).equal())})`},[`${o}-uploading`]:{[`&${o}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${r}-eye, ${r}-download, ${r}-delete`]:{display:"none"}},[`${o}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${ie(i(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},Za=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},eo=Za,to=e=>{const{componentCls:t,colorTextDisabled:r}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},ft(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:r,cursor:"not-allowed"}})}},ro=e=>({actionsColor:e.colorTextDescription}),no=pt("Upload",e=>{const{fontSizeHeading3:t,fontHeight:r,lineWidth:n,controlHeightLG:a,calc:i}=e,s=Vt(e,{uploadThumbnailSize:i(t).mul(2).equal(),uploadProgressOffset:i(i(r).div(2)).add(n).equal(),uploadPicCardSize:i(a).mul(2.55).equal()});return[to(s),qa(s),Ja(s),Qa(s),Ga(s),Ya(s),eo(s),Br(s)]},ro);function Ae(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function Me(e,t){const r=Ue(t),n=r.findIndex(a=>{let{uid:i}=a;return i===e.uid});return n===-1?r.push(e):r[n]=e,r}function et(e,t){const r=e.uid!==void 0?"uid":"name";return t.filter(n=>n[r]===e[r])[0]}function ao(e,t){const r=e.uid!==void 0?"uid":"name",n=t.filter(a=>a[r]!==e[r]);return n.length===t.length?null:n}const oo=function(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},lr=e=>e.indexOf("image/")===0,io=e=>{if(e.type&&!e.thumbUrl)return lr(e.type);const t=e.thumbUrl||e.url||"",r=oo(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r)?!0:!(/^data:/.test(t)||r)},me=200;function so(e){return new Promise(t=>{if(!e.type||!lr(e.type)){t("");return}const r=document.createElement("canvas");r.width=me,r.height=me,r.style.cssText=`position: fixed; left: 0; top: 0; width: ${me}px; height: ${me}px; z-index: 9999; display: none;`,document.body.appendChild(r);const n=r.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:i,height:s}=a;let o=me,u=me,c=0,p=0;i>s?(u=s*(me/i),p=-(u-o)/2):(o=i*(me/s),c=-(o-u)/2),n.drawImage(a,c,p,o,u);const f=r.toDataURL();document.body.removeChild(r),window.URL.revokeObjectURL(a.src),t(f)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const i=new FileReader;i.onload=()=>{i.result&&typeof i.result=="string"&&(a.src=i.result)},i.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const i=new FileReader;i.onload=()=>{i.result&&t(i.result)},i.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}const lo=l.forwardRef((e,t)=>{let{prefixCls:r,className:n,style:a,locale:i,listType:s,file:o,items:u,progress:c,iconRender:p,actionIconRender:f,itemRender:g,isImgUrl:m,showPreviewIcon:d,showRemoveIcon:y,showDownloadIcon:v,previewIcon:E,removeIcon:$,downloadIcon:j,extra:I,onPreview:h,onDownload:O,onClose:S}=e;var F,b;const{status:C}=o,[z,te]=l.useState(C);l.useEffect(()=>{C!=="removed"&&te(C)},[C]);const[K,Y]=l.useState(!1);l.useEffect(()=>{const G=setTimeout(()=>{Y(!0)},300);return()=>{clearTimeout(G)}},[]);const V=p(o);let H=l.createElement("div",{className:`${r}-icon`},V);if(s==="picture"||s==="picture-card"||s==="picture-circle")if(z==="uploading"||!o.thumbUrl&&!o.url){const G=ae(`${r}-list-item-thumbnail`,{[`${r}-list-item-file`]:z!=="uploading"});H=l.createElement("div",{className:G},V)}else{const G=m!=null&&m(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${r}-list-item-image`,crossOrigin:o.crossOrigin}):V,X=ae(`${r}-list-item-thumbnail`,{[`${r}-list-item-file`]:m&&!m(o)});H=l.createElement("a",{className:X,onClick:de=>h(o,de),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},G)}const N=ae(`${r}-list-item`,`${r}-list-item-${z}`),x=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,P=(typeof y=="function"?y(o):y)?f((typeof $=="function"?$(o):$)||l.createElement(va,null),()=>S(o),r,i.removeFile,!0):null,A=(typeof v=="function"?v(o):v)&&z==="done"?f((typeof j=="function"?j(o):j)||l.createElement(Ca,null),()=>O(o),r,i.downloadFile):null,M=s!=="picture-card"&&s!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ae(`${r}-list-item-actions`,{picture:s==="picture"})},A,P),R=typeof I=="function"?I(o):I,k=R&&l.createElement("span",{className:`${r}-list-item-extra`},R),w=ae(`${r}-list-item-name`),T=o.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:w,title:o.name},x,{href:o.url,onClick:G=>h(o,G)}),o.name,k):l.createElement("span",{key:"view",className:w,onClick:G=>h(o,G),title:o.name},o.name,k),B=(typeof d=="function"?d(o):d)&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:G=>h(o,G),title:i.previewFile},typeof E=="function"?E(o):E||l.createElement(mn,null)):null,_=(s==="picture-card"||s==="picture-circle")&&z!=="uploading"&&l.createElement("span",{className:`${r}-list-item-actions`},B,z==="done"&&A,P),{getPrefixCls:J}=l.useContext(Re),re=J(),Z=l.createElement("div",{className:N},H,T,M,_,K&&l.createElement(mt,{motionName:`${re}-fade`,visible:z==="uploading",motionDeadline:2e3},G=>{let{className:X}=G;const de="percent"in o?l.createElement(pa,Object.assign({},c,{type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]})):null;return l.createElement("div",{className:ae(`${r}-list-item-progress`,X)},de)})),ce=o.response&&typeof o.response=="string"?o.response:((F=o.error)===null||F===void 0?void 0:F.statusText)||((b=o.error)===null||b===void 0?void 0:b.message)||i.uploadError,ue=z==="error"?l.createElement(qt,{title:ce,getPopupContainer:G=>G.parentNode},Z):Z;return l.createElement("div",{className:ae(`${r}-list-item-container`,n),style:a,ref:t},g?g(ue,o,u,{download:O.bind(null,o),preview:h.bind(null,o),remove:S.bind(null,o)}):ue)}),co=lo,uo=(e,t)=>{const{listType:r="text",previewFile:n=so,onPreview:a,onDownload:i,onRemove:s,locale:o,iconRender:u,isImageUrl:c=io,prefixCls:p,items:f=[],showPreviewIcon:g=!0,showRemoveIcon:m=!0,showDownloadIcon:d=!1,removeIcon:y,previewIcon:v,downloadIcon:E,extra:$,progress:j={size:[-1,2],showInfo:!1},appendAction:I,appendActionVisible:h=!0,itemRender:O,disabled:S}=e,F=_r(),[b,C]=l.useState(!1);l.useEffect(()=>{r!=="picture"&&r!=="picture-card"&&r!=="picture-circle"||(f||[]).forEach(w=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(w.originFileObj instanceof File||w.originFileObj instanceof Blob)||w.thumbUrl!==void 0||(w.thumbUrl="",n&&n(w.originFileObj).then(T=>{w.thumbUrl=T||"",F()}))})},[r,f,n]),l.useEffect(()=>{C(!0)},[]);const z=(w,T)=>{if(a)return T==null||T.preventDefault(),a(w)},te=w=>{typeof i=="function"?i(w):w.url&&window.open(w.url)},K=w=>{s==null||s(w)},Y=w=>{if(u)return u(w,r);const T=w.status==="uploading",B=c!=null&&c(w)?l.createElement(Aa,null):l.createElement(Oa,null);let _=T?l.createElement($t,null):l.createElement(Ra,null);return r==="picture"?_=T?l.createElement($t,null):B:(r==="picture-card"||r==="picture-circle")&&(_=T?o.uploading:B),_},V=(w,T,B,_,J)=>{const re={type:"text",size:"small",title:_,onClick:Z=>{var ce,ue;T(),l.isValidElement(w)&&((ue=(ce=w.props).onClick)===null||ue===void 0||ue.call(ce,Z))},className:`${B}-list-item-action`};if(J&&(re.disabled=S),l.isValidElement(w)){const Z=wt(w,Object.assign(Object.assign({},w.props),{onClick:()=>{}}));return l.createElement(st,Object.assign({},re,{icon:Z}))}return l.createElement(st,Object.assign({},re),l.createElement("span",null,w))};l.useImperativeHandle(t,()=>({handlePreview:z,handleDownload:te}));const{getPrefixCls:H}=l.useContext(Re),N=H("upload",p),x=H(),P=ae(`${N}-list`,`${N}-list-${r}`),A=Ue(f.map(w=>({key:w.uid,file:w})));let R={motionDeadline:2e3,motionName:`${N}-${r==="picture-card"||r==="picture-circle"?"animate-inline":"animate"}`,keys:A,motionAppear:b};const k=l.useMemo(()=>{const w=Object.assign({},Ur(x));return delete w.onAppearEnd,delete w.onEnterEnd,delete w.onLeaveEnd,w},[x]);return r!=="picture-card"&&r!=="picture-circle"&&(R=Object.assign(Object.assign({},k),R)),l.createElement("div",{className:P},l.createElement(zr,Object.assign({},R,{component:!1}),w=>{let{key:T,file:B,className:_,style:J}=w;return l.createElement(co,{key:T,locale:o,prefixCls:N,className:_,style:J,file:B,items:f,progress:j,listType:r,isImgUrl:c,showPreviewIcon:g,showRemoveIcon:m,showDownloadIcon:d,removeIcon:y,previewIcon:v,downloadIcon:E,extra:$,iconRender:Y,actionIconRender:V,itemRender:O,onPreview:z,onDownload:te,onClose:K})}),I&&l.createElement(mt,Object.assign({},R,{visible:h,forceRender:!0}),w=>{let{className:T,style:B}=w;return wt(I,_=>({className:ae(_.className,T),style:Object.assign(Object.assign(Object.assign({},B),{pointerEvents:T?"none":void 0}),_.style)}))}))},po=l.forwardRef(uo),fo=po;var mo=globalThis&&globalThis.__awaiter||function(e,t,r,n){function a(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function o(p){try{c(n.next(p))}catch(f){s(f)}}function u(p){try{c(n.throw(p))}catch(f){s(f)}}function c(p){p.done?i(p.value):a(p.value).then(o,u)}c((n=n.apply(e,t||[])).next())})};const je=`__LIST_IGNORE_${Date.now()}__`,ho=(e,t)=>{const{fileList:r,defaultFileList:n,onRemove:a,showUploadList:i=!0,listType:s="text",onPreview:o,onDownload:u,onChange:c,onDrop:p,previewFile:f,disabled:g,locale:m,iconRender:d,isImageUrl:y,progress:v,prefixCls:E,className:$,type:j="select",children:I,style:h,itemRender:O,maxCount:S,data:F={},multiple:b=!1,hasControlInside:C=!0,action:z="",accept:te="",supportServerRender:K=!0,rootClassName:Y}=e,V=l.useContext(Wr),H=g??V,[N,x]=Hr(n||[],{value:r,postState:L=>L??[]}),[P,A]=l.useState("drop"),M=l.useRef(null),R=l.useRef(null);l.useMemo(()=>{const L=Date.now();(r||[]).forEach((W,Q)=>{!W.uid&&!Object.isFrozen(W)&&(W.uid=`__AUTO__${L}_${Q}__`)})},[r]);const k=(L,W,Q)=>{let U=Ue(W),q=!1;S===1?U=U.slice(-1):S&&(q=U.length>S,U=U.slice(0,S)),Ct.flushSync(()=>{x(U)});const se={file:L,fileList:U};Q&&(se.event=Q),(!q||L.status==="removed"||U.some(be=>be.uid===L.uid))&&Ct.flushSync(()=>{c==null||c(se)})},w=(L,W)=>mo(void 0,void 0,void 0,function*(){const{beforeUpload:Q,transformFile:U}=e;let q=L;if(Q){const se=yield Q(L,W);if(se===!1)return!1;if(delete L[je],se===je)return Object.defineProperty(L,je,{value:!0,configurable:!0}),!1;typeof se=="object"&&se&&(q=se)}return U&&(q=yield U(q)),q}),T=L=>{const W=L.filter(q=>!q.file[je]);if(!W.length)return;const Q=W.map(q=>Ae(q.file));let U=Ue(N);Q.forEach(q=>{U=Me(q,U)}),Q.forEach((q,se)=>{let be=q;if(W[se].parsedFile)q.status="uploading";else{const{originFileObj:Ce}=q;let ye;try{ye=new File([Ce],Ce.name,{type:Ce.type})}catch{ye=new Blob([Ce],{type:Ce.type}),ye.name=Ce.name,ye.lastModifiedDate=new Date,ye.lastModified=new Date().getTime()}ye.uid=q.uid,be=ye}k(be,U)})},B=(L,W,Q)=>{try{typeof L=="string"&&(L=JSON.parse(L))}catch{}if(!et(W,N))return;const U=Ae(W);U.status="done",U.percent=100,U.response=L,U.xhr=Q;const q=Me(U,N);k(U,q)},_=(L,W)=>{if(!et(W,N))return;const Q=Ae(W);Q.status="uploading",Q.percent=L.percent;const U=Me(Q,N);k(Q,U,L)},J=(L,W,Q)=>{if(!et(Q,N))return;const U=Ae(Q);U.error=L,U.response=W,U.status="error";const q=Me(U,N);k(U,q)},re=L=>{let W;Promise.resolve(typeof a=="function"?a(L):a).then(Q=>{var U;if(Q===!1)return;const q=ao(L,N);q&&(W=Object.assign(Object.assign({},L),{status:"removed"}),N==null||N.forEach(se=>{const be=W.uid!==void 0?"uid":"name";se[be]===W[be]&&!Object.isFrozen(se)&&(se.status="removed")}),(U=M.current)===null||U===void 0||U.abort(W),k(W,q))})},Z=L=>{A(L.type),L.type==="drop"&&(p==null||p(L))};l.useImperativeHandle(t,()=>({onBatchStart:T,onSuccess:B,onProgress:_,onError:J,fileList:N,upload:M.current,nativeElement:R.current}));const{getPrefixCls:ce,direction:ue,upload:G}=l.useContext(Re),X=ce("upload",E),de=Object.assign(Object.assign({onBatchStart:T,onError:J,onProgress:_,onSuccess:B},e),{data:F,multiple:b,action:z,accept:te,supportServerRender:K,prefixCls:X,disabled:H,beforeUpload:w,onChange:void 0,hasControlInside:C});delete de.className,delete de.style,(!I||H)&&delete de.id;const Pe=`${X}-wrapper`,[fe,$e,ve]=no(X,Pe),[mr]=Xr("Upload",qr.Upload),{showRemoveIcon:vt,showPreviewIcon:hr,showDownloadIcon:gr,removeIcon:vr,previewIcon:br,downloadIcon:yr,extra:wr}=typeof i=="boolean"?{}:i,$r=typeof vt>"u"?!H:vt,Ge=(L,W)=>i?l.createElement(fo,{prefixCls:X,listType:s,items:N,previewFile:f,onPreview:o,onDownload:u,onRemove:re,showRemoveIcon:$r,showPreviewIcon:hr,showDownloadIcon:gr,removeIcon:vr,previewIcon:br,downloadIcon:yr,iconRender:d,extra:wr,locale:Object.assign(Object.assign({},mr),m),isImageUrl:y,progress:v,appendAction:L,appendActionVisible:W,itemRender:O,disabled:H}):L,Ke=ae(Pe,$,Y,$e,ve,G==null?void 0:G.className,{[`${X}-rtl`]:ue==="rtl",[`${X}-picture-card-wrapper`]:s==="picture-card",[`${X}-picture-circle-wrapper`]:s==="picture-circle"}),Cr=Object.assign(Object.assign({},G==null?void 0:G.style),h);if(j==="drag"){const L=ae($e,X,`${X}-drag`,{[`${X}-drag-uploading`]:N.some(W=>W.status==="uploading"),[`${X}-drag-hover`]:P==="dragover",[`${X}-disabled`]:H,[`${X}-rtl`]:ue==="rtl"});return fe(l.createElement("span",{className:Ke,ref:R},l.createElement("div",{className:L,style:Cr,onDrop:Z,onDragOver:Z,onDragLeave:Z},l.createElement(ut,Object.assign({},de,{ref:M,className:`${X}-btn`}),l.createElement("div",{className:`${X}-drag-container`},I))),Ge()))}const Sr=ae(X,`${X}-select`,{[`${X}-disabled`]:H}),bt=l.createElement("div",{className:Sr,style:I?void 0:{display:"none"}},l.createElement(ut,Object.assign({},de,{ref:M})));return fe(s==="picture-card"||s==="picture-circle"?l.createElement("span",{className:Ke,ref:R},Ge(bt,!!I)):l.createElement("span",{className:Ke,ref:R},bt,Ge()))},go=l.forwardRef(ho),cr=go;var vo=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};const bo=l.forwardRef((e,t)=>{var{style:r,height:n,hasControlInside:a=!1}=e,i=vo(e,["style","height","hasControlInside"]);return l.createElement(cr,Object.assign({ref:t,hasControlInside:a},i,{type:"drag",style:Object.assign(Object.assign({},r),{height:n})}))}),yo=bo,ht=cr;ht.Dragger=yo;ht.LIST_IGNORE=je;const wo=ht;function ur(e,t){return e&&yn(e,t,Vr)}function $o(e,t){return function(r,n){if(r==null)return r;if(!er(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var Co=$o(ur);const So=Co;function xo(e,t,r){var n;return r(e,function(a,i,s){if(t(a,i,s))return n=i,!1}),n}function Eo(e,t){return xo(e,nr(t),ur)}function Io(e,t){var r=-1,n=er(e)?Array(e.length):[];return So(e,function(a,i,s){n[++r]=t(a,i,s)}),n}function Oo(e,t){var r=tr(e)?Gr:Io;return r(e,nr(t))}var Po={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const Do=Po;var Fo=function(t,r){return l.createElement(rr,Oe({},t,{ref:r,icon:Do}))};const pi=l.forwardRef(Fo);var jo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const Ro=jo;var To=function(t,r){return l.createElement(rr,Oe({},t,{ref:r,icon:Ro}))};const ko=l.forwardRef(To);/*! * Compressor.js v1.2.1 * https://fengyuanchen.github.io/compressorjs * * Copyright 2018-present Chen Fengyuan * Released under the MIT license * * Date: 2023-02-28T14:09:41.732Z */function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tt(Object(r),!0).forEach(function(n){Ao(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function No(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dr(n.key),n)}}function Lo(e,t,r){return t&&kt(e.prototype,t),r&&kt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ao(e,t,r){return t=dr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xe.apply(this,arguments)}function Mo(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dr(e){var t=Mo(e,"string");return typeof t=="symbol"?t:String(t)}var pr={exports:{}};(function(e){typeof window>"u"||function(t){var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,n=t.Blob&&function(){try{return!!new Blob}catch{return!1}}(),a=n&&t.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),i=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,s=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,o=(n||i)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(u){var c,p,f,g,m,d,y,v,E;if(c=u.match(s),!c)throw new Error("invalid data URI");for(p=c[2]?c[1]:"text/plain"+(c[3]||";charset=US-ASCII"),f=!!c[4],g=u.slice(c[0].length),f?m=atob(g):m=decodeURIComponent(g),d=new ArrayBuffer(m.length),y=new Uint8Array(d),v=0;v<m.length;v+=1)y[v]=m.charCodeAt(v);return n?new Blob([a?y:d],{type:p}):(E=new i,E.append(d),E.getBlob(p))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(u,c,p){var f=this;setTimeout(function(){p&&r.toDataURL&&o?u(o(f.toDataURL(c,p))):u(f.mozGetAsFile("blob",c))})}:r.toDataURL&&o&&(r.msToBlob?r.toBlob=function(u,c,p){var f=this;setTimeout(function(){(c&&c!=="image/png"||p)&&r.toDataURL&&o?u(o(f.toDataURL(c,p))):u(f.msToBlob(c))})}:r.toBlob=function(u,c,p){var f=this;setTimeout(function(){u(o(f.toDataURL(c,p)))})})),e.exports?e.exports=o:t.dataURLtoBlob=o}(window)})(pr);var Nt=pr.exports,Bo=function(t){return typeof Blob>"u"?!1:t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"},Lt={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},_o=typeof window<"u"&&typeof window.document<"u",ge=_o?window:{},qe=function(t){return t>0&&t<1/0},Uo=Array.prototype.slice;function gt(e){return Array.from?Array.from(e):Uo.call(e)}var zo=/^image\/.+$/;function dt(e){return zo.test(e)}function Wo(e){var t=dt(e)?e.substr(6):"";return t==="jpeg"&&(t="jpg"),".".concat(t)}var fr=String.fromCharCode;function Ho(e,t,r){var n="",a;for(r+=t,a=t;a<r;a+=1)n+=fr(e.getUint8(a));return n}var Xo=ge.btoa;function At(e,t){for(var r=[],n=8192,a=new Uint8Array(e);a.length>0;)r.push(fr.apply(null,gt(a.subarray(0,n)))),a=a.subarray(n);return"data:".concat(t,";base64,").concat(Xo(r.join("")))}function qo(e){var t=new DataView(e),r;try{var n,a,i;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var s=t.byteLength,o=2;o+1<s;){if(t.getUint8(o)===255&&t.getUint8(o+1)===225){a=o;break}o+=1}if(a){var u=a+4,c=a+10;if(Ho(t,u,4)==="Exif"){var p=t.getUint16(c);if(n=p===18761,(n||p===19789)&&t.getUint16(c+2,n)===42){var f=t.getUint32(c+4,n);f>=8&&(i=c+f)}}}if(i){var g=t.getUint16(i,n),m,d;for(d=0;d<g;d+=1)if(m=i+d*12+2,t.getUint16(m,n)===274){m+=8,r=t.getUint16(m,n),t.setUint16(m,1,n);break}}}catch{r=1}return r}function Vo(e){var t=0,r=1,n=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:n}}var Go=/\.\d*(?:0|9){12}\d*$/;function Mt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Go.test(e)?Math.round(e*t)/t:e}function De(e){var t=e.aspectRatio,r=e.height,n=e.width,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",i=qe(n),s=qe(r);if(i&&s){var o=r*t;(a==="contain"||a==="none")&&o>n||a==="cover"&&o<n?r=n/t:n=r*t}else i?r=n/t:s&&(n=r*t);return{width:n,height:r}}function Ko(e){for(var t=gt(new Uint8Array(e)),r=t.length,n=[],a=0;a+3<r;){var i=t[a],s=t[a+1];if(i===255&&s===218)break;if(i===255&&s===216)a+=2;else{var o=t[a+2]*256+t[a+3],u=a+o+2,c=t.slice(a,u);n.push(c),a=u}}return n.reduce(function(p,f){return f[0]===255&&f[1]===225?p.concat(f):p},[])}function Yo(e,t){var r=gt(new Uint8Array(e));if(r[2]!==255||r[3]!==224)return e;var n=r[4]*256+r[5],a=[255,216].concat(t,r.slice(4+n));return new Uint8Array(a)}var Jo=ge.ArrayBuffer,tt=ge.FileReader,we=ge.URL||ge.webkitURL,Qo=/\.\w+$/,Zo=ge.Compressor,ei=function(){function e(t,r){No(this,e),this.file=t,this.exif=[],this.image=new Image,this.options=Be(Be({},Lt),r),this.aborted=!1,this.result=null,this.init()}return Lo(e,[{key:"init",value:function(){var r=this,n=this.file,a=this.options;if(!Bo(n)){this.fail(new Error("The first argument must be a File or Blob object."));return}var i=n.type;if(!dt(i)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!we||!tt){this.fail(new Error("The current browser does not support image compression."));return}Jo||(a.checkOrientation=!1,a.retainExif=!1);var s=i==="image/jpeg",o=s&&a.checkOrientation,u=s&&a.retainExif;if(we&&!o&&!u)this.load({url:we.createObjectURL(n)});else{var c=new tt;this.reader=c,c.onload=function(p){var f=p.target,g=f.result,m={},d=1;o&&(d=qo(g),d>1&&Xe(m,Vo(d))),u&&(r.exif=Ko(g)),o||u?!we||d>1?m.url=At(g,i):m.url=we.createObjectURL(n):m.url=g,r.load(m)},c.onabort=function(){r.fail(new Error("Aborted to read the image with FileReader."))},c.onerror=function(){r.fail(new Error("Failed to read the image with FileReader."))},c.onloadend=function(){r.reader=null},o||u?c.readAsArrayBuffer(n):c.readAsDataURL(n)}}},{key:"load",value:function(r){var n=this,a=this.file,i=this.image;i.onload=function(){n.draw(Be(Be({},r),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){n.fail(new Error("Aborted to load the image."))},i.onerror=function(){n.fail(new Error("Failed to load the image."))},ge.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ge.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=a.name,i.src=r.url}},{key:"draw",value:function(r){var n=this,a=r.naturalWidth,i=r.naturalHeight,s=r.rotate,o=s===void 0?0:s,u=r.scaleX,c=u===void 0?1:u,p=r.scaleY,f=p===void 0?1:p,g=this.file,m=this.image,d=this.options,y=document.createElement("canvas"),v=y.getContext("2d"),E=Math.abs(o)%180===90,$=(d.resize==="contain"||d.resize==="cover")&&qe(d.width)&&qe(d.height),j=Math.max(d.maxWidth,0)||1/0,I=Math.max(d.maxHeight,0)||1/0,h=Math.max(d.minWidth,0)||0,O=Math.max(d.minHeight,0)||0,S=a/i,F=d.width,b=d.height;if(E){var C=[I,j];j=C[0],I=C[1];var z=[O,h];h=z[0],O=z[1];var te=[b,F];F=te[0],b=te[1]}$&&(S=F/b);var K=De({aspectRatio:S,width:j,height:I},"contain");j=K.width,I=K.height;var Y=De({aspectRatio:S,width:h,height:O},"cover");if(h=Y.width,O=Y.height,$){var V=De({aspectRatio:S,width:F,height:b},d.resize);F=V.width,b=V.height}else{var H=De({aspectRatio:S,width:F,height:b}),N=H.width;F=N===void 0?a:N;var x=H.height;b=x===void 0?i:x}F=Math.floor(Mt(Math.min(Math.max(F,h),j))),b=Math.floor(Mt(Math.min(Math.max(b,O),I)));var P=-F/2,A=-b/2,M=F,R=b,k=[];if($){var w=0,T=0,B=a,_=i,J=De({aspectRatio:S,width:a,height:i},{contain:"cover",cover:"contain"}[d.resize]);B=J.width,_=J.height,w=(a-B)/2,T=(i-_)/2,k.push(w,T,B,_)}if(k.push(P,A,M,R),E){var re=[b,F];F=re[0],b=re[1]}y.width=F,y.height=b,dt(d.mimeType)||(d.mimeType=g.type);var Z="transparent";g.size>d.convertSize&&d.convertTypes.indexOf(d.mimeType)>=0&&(d.mimeType="image/jpeg");var ce=d.mimeType==="image/jpeg";if(ce&&(Z="#fff"),v.fillStyle=Z,v.fillRect(0,0,F,b),d.beforeDraw&&d.beforeDraw.call(this,v,y),!this.aborted&&(v.save(),v.translate(F/2,b/2),v.rotate(o*Math.PI/180),v.scale(c,f),v.drawImage.apply(v,[m].concat(k)),v.restore(),d.drew&&d.drew.call(this,v,y),!this.aborted)){var ue=function(X){if(!n.aborted){var de=function(ve){return n.done({naturalWidth:a,naturalHeight:i,result:ve})};if(X&&ce&&d.retainExif&&n.exif&&n.exif.length>0){var Pe=function(ve){return de(Nt(At(Yo(ve,n.exif),d.mimeType)))};if(X.arrayBuffer)X.arrayBuffer().then(Pe).catch(function(){n.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var fe=new tt;n.reader=fe,fe.onload=function($e){var ve=$e.target;Pe(ve.result)},fe.onabort=function(){n.fail(new Error("Aborted to read the compressed image with FileReader."))},fe.onerror=function(){n.fail(new Error("Failed to read the compressed image with FileReader."))},fe.onloadend=function(){n.reader=null},fe.readAsArrayBuffer(X)}}else de(X)}};y.toBlob?y.toBlob(ue,d.mimeType,d.quality):ue(Nt(y.toDataURL(d.mimeType,d.quality)))}}},{key:"done",value:function(r){var n=r.naturalWidth,a=r.naturalHeight,i=r.result,s=this.file,o=this.image,u=this.options;if(we&&o.src.indexOf("blob:")===0&&we.revokeObjectURL(o.src),i)if(u.strict&&!u.retainExif&&i.size>s.size&&u.mimeType===s.type&&!(u.width>n||u.height>a||u.minWidth>n||u.minHeight>a||u.maxWidth<n||u.maxHeight<a))i=s;else{var c=new Date;i.lastModified=c.getTime(),i.lastModifiedDate=c,i.name=s.name,i.name&&i.type!==s.type&&(i.name=i.name.replace(Qo,Wo(i.type)))}else i=s;this.result=i,u.success&&u.success.call(this,i)}},{key:"fail",value:function(r){var n=this.options;if(n.error)n.error.call(this,r);else throw r}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Zo,e}},{key:"setDefaults",value:function(r){Xe(Lt,r)}}]),e}();const ti=e=>new Promise((t,r)=>{new ei(e,{quality:.9,maxWidth:800,minWidth:100,success(n){t(n)},error(n){r(n)},convertSize:300*1e3})}),ri=async e=>{const t=new FormData;t.append("file",e);const{data:r}=await lt.post("/characters/pic-review",t,{headers:{"Content-Type":"multipart/form-data"}});return r},{Title:Bt}=bn,rt={lg:{offset:6,span:18},xs:{offset:0,span:24}},ni={name:"Name",description:"Introduction",personality:"Personality",scenario:"Scenario",first_message:"Initial message",example_dialogs:"Example dialogs",whole:"description"},fi=({id:e,values:t})=>{const r=Kr(),{profile:n,localData:a,updateLocalData:i}=l.useContext(Yr),s=Jr(),[o,u]=l.useState({name:null,description:null,personality:null,scenario:null,first_message:null,example_dialogs:null,whole:null}),[c,p]=l.useState(!1),[f,g]=l.useState([]),[m]=ne.useForm(),[d,y]=l.useState(),v=ne.useWatch("avatar_payload",m),E=ne.useWatch("personality",m),$=ne.useWatch("scenario",m),j=ne.useWatch("example_dialogs",m),I=ne.useWatch("first_message",m),h=pn(),{message:O}=Qr.useApp(),S=e?"edit":"create",[F,b]=l.useState(""),C=l.useMemo(()=>c?"Submitting, please wait":S==="create"?"Create Character":"Update Character",[S,c]),z=l.useCallback(x=>ln.tokenCountFormat(x),[]),te=async x=>{var P,A;try{p(!0);const M=(P=x.avatar_payload)==null?void 0:P.file;if(S==="create"&&!M){O.error("Please set an avatar for your character");return}a.alreadyReportedCreateCharacter||(nn(),i({alreadyReportedCreateCharacter:!0}));let R=d;if(!R&&M){const T=await ti(M),B=T.name.substring(M.name.lastIndexOf(".")+1);let _;try{_=crypto?crypto.randomUUID():`${(Math.random()*1e8).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e12).toFixed(0)}`}catch{_=`${(Math.random()*1e8).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e4).toFixed(0)}-${(Math.random()*1e12).toFixed(0)}`}const{code:J,msg:re}=await ri(T);if(J!==200)throw b(re),m.scrollToField("avatar_payload"),`Character's avatar may contain ${re}`;const Z=await an.storage.from("bot-avatars").upload(`${_}.${B}`,T,{cacheControl:"1209600",upsert:!0});(A=Z==null?void 0:Z.data)!=null&&A.path&&(R=Z.data.path,y(R))}const{avatar_payload:k,...w}=x;if(S==="create"){const{data:T}=await lt.post("/characters",{...w,avatar:R||t.avatar});if(T.code===200){O.success("Character created successfully!"),r.invalidateQueries(["characters",n==null?void 0:n.id]);const B=T.data;s(St(B.id,B.name)),u(_=>{const J=Ne(_);for(const re of Object.keys(_)){const Z=re;J[Z]=null}return J});return}K(T)}else if(S==="edit"){const{data:T}=await lt.patch("/characters/"+e,{...w,avatar:R||t.avatar});if(T.code===200){O.success("Character updated successfully!"),r.invalidateQueries(["character",e]),r.invalidateQueries(["characters",n==null?void 0:n.id]),u(B=>{const _=Ne(B);for(const J of Object.keys(B)){const re=J;_[re]=null}return _});return}K(T)}}catch(M){console.error("error",M),wn(M)?O.error(M):O.error(JSON.stringify(M))}finally{p(!1)}},K=x=>{const P={"self-harm/instructions":"Instigating Self-harm","sexual/minors":"Child Pornography","harassment/threatening":"Heavy Gore/Sexual Violence"};if(x.code!==200)if(tr(x.data)){const A=Ne(o),M=x.data.map(k=>{const w=k.label;let T=w;const B=P[k.reason];return w in o&&(A[w]=_t(B)),{label:T,reason:B}});u(A);const R=Eo(A,function(k){return!!k});R&&m.scrollToField(R),O.error({content:ee("p",{children:["This character's ",Oo(M,k=>ni[k.label]).join(", ")," may contain"," ",D("strong",{children:"prohibited information"})]})})}else O.error(x.msg??"something error in handle response error method")},Y=x=>{const P=x==null?void 0:x.file;return P?D("img",{src:URL.createObjectURL(P),style:{maxWidth:"100%",alignSelf:"flex-start",maxHeight:"10rem"}}):t!=null&&t.avatar?D("img",{src:on(t.avatar),style:{maxWidth:"100%",alignSelf:"flex-start",maxHeight:"10rem"}}):ee("div",{children:[D(ko,{})," Upload"]})},V=async(x,P)=>{if(S==="edit")return;const A=await dn({name:x,personality:P.substring(0,200)});g(A)},N={onBlur:x=>{x.target.value=sn(x.target.value),m.setFieldValue(x.target.id,x.target.value);const P=x.target.getAttribute("id"),A=Ne(o);P in A&&(A[P]=null,u(A))}};return D(un,{children:ee(ne,{labelCol:{span:6},wrapperCol:{span:18},form:m,onFinish:te,initialValues:t,children:[D(Bt,{level:4,children:"Character Info (How will your character be displayed and searched)"}),D(ne.Item,{label:"Name",name:"name",help:o.name,validateStatus:o.name?"error":void 0,rules:[{required:!0,message:"Please enter a name."}],children:D(xe,{placeholder:"Name",...N})}),ee(ne.Item,{name:"avatar_payload",label:"Avatar",className:"mb-16",children:[D(wo,{accept:"image/jpeg, image/png, image/jpg",listType:"picture-card",className:"avatar_payload",showUploadList:!1,onChange:x=>{const[P]=x.fileList;if(P.type!=="image/png"&&P.type!=="image/jpeg"){m.setFieldValue("avatar_payload",null);return}b(""),m.setFieldValue("avatar_payload",x)},beforeUpload:async x=>{try{if(x.type!=="image/png"&&x.type!=="image/jpeg")return O.error(Zr),!1;const{character:P}=await cn(x);P&&P.name&&(m.setFieldsValue({name:P.name,description:P.description,personality:P.personality,first_message:P.first_message,example_dialogs:P.example_dialogs,scenario:P.scenario}),V(P.name,P.personality))}catch(P){O.error(JSON.stringify(P,null,2))}return!1},maxCount:1,children:Y(v)}),!en(F)&&_t(F)]}),S==="create"&&ee(ne.Item,{wrapperCol:rt,children:[ee("p",{children:["Select an image as bot avatar, or you can import Tavern PNG file. You can also"," ",D("a",{href:"/search",target:"_blank",children:"search for existing character"})," ","before importing a new one!"]}),ee("span",{children:["Please make sure your image/character does not violate our"," ",D("a",{href:"/policy",target:"_blank",children:"content policy"}),". Otherwise we will be forced to remove it."]})]}),f.length>0&&D(ne.Item,{wrapperCol:rt,children:D(It,{className:"mb-4",message:"This character seems to already existed in our system!",description:ee("div",{children:[D(hn,{className:"mt-4",children:f.map(x=>D(gn,{xs:24,lg:12,children:D(tn,{to:St(x.id,x.name),target:"_blank",children:D(fn,{character:x},x.id)})}))}),ee("p",{className:"mt-4 mb-0",children:["If this character is originally made by you, please click to view it and click"," ",D("strong",{children:"Report this character"}),".",D("br",{}),"We will help to transfer it back to your account."]})]}),type:"warning"})}),D(ne.Item,{name:"description",className:"pb-4",label:"Introduction",help:o.description??"This will be displayed in your character detail, not including in prompt or influence your character.",validateStatus:o.description?"error":void 0,children:D(xe.TextArea,{autoSize:!0,...N,placeholder:"Short introduction about your character"})}),D(ne.Item,{label:"Tags",name:"tag_ids",help:ee("div",{children:[D("span",{children:"Tag your character, maximum 5 tags only."})," ",D("br",{}),ee("span",{children:["Please use ",D("strong",{children:"Non English"})," tag if your character don't speak English."]})]}),className:"pb-4",children:D(xt,{mode:"multiple",placeholder:"Select gender/type/ of your character",optionLabelProp:"label",filterOption:(x,P)=>String((P==null?void 0:P.label)??"").toLocaleLowerCase().includes(x.toLocaleLowerCase()),children:h&&h.map(x=>ee(xt.Option,{value:x.id,label:x.name,children:[x.name," (",x.description,")"]},x.id))})}),D(ne.Item,{label:"Type",name:"is_public",help:S==="create"?D("div",{}):t.is_force_remove?D(It,{message:"Bot set to private!",description:"Your bot was set to private due to original's creator request, or marked as duplicated/spam/harmful by admin. You can still chat or modify it.",type:"warning",showIcon:!0}):void 0,children:ee(Se.Group,{disabled:t.is_force_remove,children:[D(Se,{value:!0,children:"🌟 Public Bot "}),D(Se,{className:"private-radio",value:!1,children:"🔒 Private Bot (only you can see it)"})]})}),D(ne.Item,{label:"Rating",name:"is_nsfw",className:"pt-2 mb-4",children:ee(Se.Group,{children:[D(Se,{value:!1,children:"👪 SFW "}),D(Se,{value:!0,children:"🔞 NSFW"})]})}),D(Bt,{level:4,children:"Character Definition (How your character will act)"}),D(ne.Item,{className:"pb-5",label:"Personality",name:"personality",extra:z(E),rules:[{required:!0,message:"Define the personality for your character."}],help:o.personality??ee("div",{children:[D("span",{children:"Describe the character's persona here. Think of this as CharacterAI's description + definitions in one box."}),D("br",{}),ee("span",{children:["This field is called ",D("strong",{children:"Description"})," in TavernAI and",D("strong",{children:"Personality"})," in Character Editor."]})]}),validateStatus:o.personality?"error":void 0,children:D(xe.TextArea,{rows:4,...N,autoSize:!0,placeholder:"Personality"})}),D(ne.Item,{className:"pb-5",label:"Initial message",name:"first_message",extra:z(I),rules:[{required:!0,message:"Please enter character's initial message."}],help:o.first_message??"First message from your character. Provide a lengthy first message to encourage the character to give longer responses.",validateStatus:o.first_message?"error":void 0,children:D(xe.TextArea,{rows:4,...N,autoSize:!0,placeholder:"First message"})}),D(ne.Item,{className:"pb-5",label:"Scenario",name:"scenario",extra:z($),help:o.scenario??"The current circumstances and context of the conversation and the characters.",validateStatus:o.scenario?"error":void 0,children:D(xe.TextArea,{rows:2,...N,autoSize:!0,placeholder:"Scenario"})}),D(ne.Item,{name:"example_dialogs",label:"Example dialogs",extra:z(j),help:o.example_dialogs??"Example chat between you and the character. This section is very important for teaching your character how they should speak.",validateStatus:o.example_dialogs?"error":void 0,children:D(xe.TextArea,{rows:4,...N,autoSize:!0,placeholder:"Example dialogs"})}),ee(ne.Item,{wrapperCol:rt,className:"pt-4",children:[ee("p",{children:["Total:"," ",z(E+I+$+j),". Permanent: ",z(E+$)]}),o.whole&&D("p",{className:"mb-3 t-red",children:o.whole}),D(st,{type:"primary",htmlType:"submit",block:!0,loading:c,children:C})]})]})})},_t=e=>ee(rn,{children:[ee("p",{className:"mb-2 t-red",children:["It may contain prohibited information (",D("a",{href:"/blocked-content-policy",target:"_blank",children:e}),")"]}),ee("p",{children:["Feedback: ",D("a",{href:"mailto:contact@pephop.ai",children:"contact@pephop.ai"})]})]});export{It as A,fi as C,_t as E,wo as U,pi as a,ko as b,ti as c,Eo as f,ri as i,Oo as m};