import{i as se,aN as q,bM as Se,j as U,k as j,m as $e,r as i,l as Z,bN as ye,p as P,U as xe,bo as Ae,d as Fe,e as Ve,_ as Le,b as qe,g as me,f as Ze,a as ge,ao as we,bp as Ge,ap as Ue,ar as Oe,aq as Xe,at as Ke,as as Ye,aK as Je,n as Qe,bn as et,q as y,a3 as le,a4 as Ne,L as J,s as z,ah as tt,S as ot,A as nt,x as rt,w as it,ak as fe,bO as at,bP as st,ai as lt,ab as ct,ac as dt,I as ke,ae as ut,G as bt,E as mt}from"./index-e81753a9.js";import{t as gt,a as ft,E as pt,d as ht,D as Ct,b as vt,V as St,q as $t,C as pe,c as yt,B as xt,v as wt,r as Ot,s as Nt,k as kt}from"./PrivateIndicator-a8617a69.js";import{c as Et}from"./chat-service-9c87cc28.js";import{a as he}from"./index-45b5d804.js";const Rt=new q("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),Bt=new q("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),It=new q("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),jt=new q("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),Tt=new q("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),zt=new q("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),Pt=e=>{const{componentCls:n,iconCls:r,antCls:o,badgeShadowSize:t,textFontSize:s,textFontSizeSM:l,statusSize:h,dotSize:f,textFontWeight:S,indicatorHeight:g,indicatorHeightSM:c,marginXS:a,calc:b}=e,d=`${o}-scroll-number`,v=Se(e,(p,C)=>{let{darkColor:u}=C;return{[`&${n} ${n}-color-${p}`]:{background:u,[`&:not(${n}-count)`]:{color:u},"a:hover &":{background:u}}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},U(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${n}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:g,height:g,color:e.badgeTextColor,fontWeight:S,fontSize:s,lineHeight:j(g),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:b(g).div(2).equal(),boxShadow:`0 0 0 ${j(t)} ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${n}-count-sm`]:{minWidth:c,height:c,fontSize:l,lineHeight:j(c),borderRadius:b(c).div(2).equal()},[`${n}-multiple-words`]:{padding:`0 ${j(e.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${n}-dot`]:{zIndex:e.indicatorZIndex,width:f,minWidth:f,height:f,background:e.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${j(t)} ${e.badgeShadowColor}`},[`${n}-count, ${n}-dot, ${d}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${r}-spin`]:{animationName:zt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${n}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${n}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:h,height:h,verticalAlign:"middle",borderRadius:"50%"},[`${n}-status-success`]:{backgroundColor:e.colorSuccess},[`${n}-status-processing`]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:t,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:Rt,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${n}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${n}-status-error`]:{backgroundColor:e.colorError},[`${n}-status-warning`]:{backgroundColor:e.colorWarning},[`${n}-status-text`]:{marginInlineStart:a,color:e.colorText,fontSize:e.fontSize}}}),v),{[`${n}-zoom-appear, ${n}-zoom-enter`]:{animationName:Bt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`${n}-zoom-leave`]:{animationName:It,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`&${n}-not-a-wrapper`]:{[`${n}-zoom-appear, ${n}-zoom-enter`]:{animationName:jt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${n}-zoom-leave`]:{animationName:Tt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${n}-status)`]:{verticalAlign:"middle"},[`${d}-custom-component, ${n}-count`]:{transform:"none"},[`${d}-custom-component, ${d}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[d]:{overflow:"hidden",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${d}-only`]:{position:"relative",display:"inline-block",height:g,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${d}-only-unit`]:{height:g,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${d}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${n}-count, ${n}-dot, ${d}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},Ee=e=>{const{fontHeight:n,lineWidth:r,marginXS:o,colorBorderBg:t}=e,s=n,l=r,h=e.colorBgContainer,f=e.colorError,S=e.colorErrorHover;return $e(e,{badgeFontHeight:s,badgeShadowSize:l,badgeTextColor:h,badgeColor:f,badgeColorHover:S,badgeShadowColor:t,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},Re=e=>{const{fontSize:n,lineHeight:r,fontSizeSM:o,lineWidth:t}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(n*r)-2*t,indicatorHeightSM:n,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}},_t=se("Badge",e=>{const n=Ee(e);return Pt(n)},Re),Dt=e=>{const{antCls:n,badgeFontHeight:r,marginXS:o,badgeRibbonOffset:t,calc:s}=e,l=`${n}-ribbon`,h=`${n}-ribbon-wrapper`,f=Se(e,(S,g)=>{let{darkColor:c}=g;return{[`&${l}-color-${S}`]:{background:c,color:c}}});return{[h]:{position:"relative"},[l]:Object.assign(Object.assign(Object.assign(Object.assign({},U(e)),{position:"absolute",top:o,padding:`0 ${j(e.paddingXS)}`,color:e.colorPrimary,lineHeight:j(r),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${l}-text`]:{color:e.colorTextLightSolid},[`${l}-corner`]:{position:"absolute",top:"100%",width:t,height:t,color:"currentcolor",border:`${j(s(t).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),f),{[`&${l}-placement-end`]:{insetInlineEnd:s(t).mul(-1).equal(),borderEndEndRadius:0,[`${l}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${l}-placement-start`]:{insetInlineStart:s(t).mul(-1).equal(),borderEndStartRadius:0,[`${l}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},Mt=se(["Badge","Ribbon"],e=>{const n=Ee(e);return Dt(n)},Re),Wt=e=>{const{className:n,prefixCls:r,style:o,color:t,children:s,text:l,placement:h="end",rootClassName:f}=e,{getPrefixCls:S,direction:g}=i.useContext(Z),c=S("ribbon",r),a=`${c}-wrapper`,[b,d,v]=Mt(c,a),p=ye(t,!1),C=P(c,`${c}-placement-${h}`,{[`${c}-rtl`]:g==="rtl",[`${c}-color-${t}`]:p},n),u={},x={};return t&&!p&&(u.background=t,x.color=t),b(i.createElement("div",{className:P(a,f,d,v)},s,i.createElement("div",{className:P(C,d),style:Object.assign(Object.assign({},u),o)},i.createElement("span",{className:`${c}-text`},l),i.createElement("div",{className:`${c}-corner`,style:x}))))},Ht=Wt,Ce=e=>{const{prefixCls:n,value:r,current:o,offset:t=0}=e;let s;return t&&(s={position:"absolute",top:`${t}00%`,left:0}),i.createElement("span",{style:s,className:P(`${n}-only-unit`,{current:o})},r)};function At(e,n,r){let o=e,t=0;for(;(o+10)%10!==n;)o+=r,t+=r;return t}const Ft=e=>{const{prefixCls:n,count:r,value:o}=e,t=Number(o),s=Math.abs(r),[l,h]=i.useState(t),[f,S]=i.useState(s),g=()=>{h(t),S(s)};i.useEffect(()=>{const b=setTimeout(g,1e3);return()=>clearTimeout(b)},[t]);let c,a;if(l===t||Number.isNaN(t)||Number.isNaN(l))c=[i.createElement(Ce,Object.assign({},e,{key:t,current:!0}))],a={transition:"none"};else{c=[];const b=t+10,d=[];for(let C=t;C<=b;C+=1)d.push(C);const v=d.findIndex(C=>C%10===l);c=d.map((C,u)=>{const x=C%10;return i.createElement(Ce,Object.assign({},e,{key:C,value:x,offset:u-v,current:u===v}))});const p=f<s?1:-1;a={transform:`translateY(${-At(l,t,p)}00%)`}}return i.createElement("span",{className:`${n}-only`,style:a,onTransitionEnd:g},c)},Vt=Ft;var Lt=globalThis&&globalThis.__rest||function(e,n){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r};const qt=i.forwardRef((e,n)=>{const{prefixCls:r,count:o,className:t,motionClassName:s,style:l,title:h,show:f,component:S="sup",children:g}=e,c=Lt(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:a}=i.useContext(Z),b=a("scroll-number",r),d=Object.assign(Object.assign({},c),{"data-show":f,style:l,className:P(b,t,s),title:h});let v=o;if(o&&Number(o)%1===0){const p=String(o).split("");v=i.createElement("bdi",null,p.map((C,u)=>i.createElement(Vt,{prefixCls:b,count:Number(o),value:C,key:p.length-u})))}return l!=null&&l.borderColor&&(d.style=Object.assign(Object.assign({},l),{boxShadow:`0 0 0 1px ${l.borderColor} inset`})),g?xe(g,p=>({className:P(`${b}-custom-component`,p==null?void 0:p.className,s)})):i.createElement(S,Object.assign({},d,{ref:n}),v)}),Zt=qt;var Gt=globalThis&&globalThis.__rest||function(e,n){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r};const Ut=i.forwardRef((e,n)=>{var r,o,t,s,l;const{prefixCls:h,scrollNumberPrefixCls:f,children:S,status:g,text:c,color:a,count:b=null,overflowCount:d=99,dot:v=!1,size:p="default",title:C,offset:u,style:x,className:I,rootClassName:T,classNames:$,styles:E,showZero:w=!1}=e,R=Gt(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:_,direction:O,badge:m}=i.useContext(Z),N=_("badge",h),[D,B,A]=_t(N),V=b>d?`${d}+`:b,F=V==="0"||V===0,te=b===null||F&&!w,G=(g!=null||a!=null)&&te,k=v&&!F,H=k?"":V,W=i.useMemo(()=>(H==null||H===""||F&&!w)&&!k,[H,F,w,k]),ce=i.useRef(b);W||(ce.current=b);const L=ce.current,de=i.useRef(H);W||(de.current=H);const oe=de.current,ue=i.useRef(k);W||(ue.current=k);const X=i.useMemo(()=>{if(!u)return Object.assign(Object.assign({},m==null?void 0:m.style),x);const M={marginTop:u[1]};return O==="rtl"?M.left=parseInt(u[0],10):M.right=-parseInt(u[0],10),Object.assign(Object.assign(Object.assign({},M),m==null?void 0:m.style),x)},[O,u,x,m==null?void 0:m.style]),ze=C??(typeof L=="string"||typeof L=="number"?L:void 0),Pe=W||!c?null:i.createElement("span",{className:`${N}-status-text`},c),_e=!L||typeof L!="object"?void 0:xe(L,M=>({style:Object.assign(Object.assign({},X),M.style)})),K=ye(a,!1),De=P($==null?void 0:$.indicator,(r=m==null?void 0:m.classNames)===null||r===void 0?void 0:r.indicator,{[`${N}-status-dot`]:G,[`${N}-status-${g}`]:!!g,[`${N}-color-${a}`]:K}),ne={};a&&!K&&(ne.color=a,ne.background=a);const be=P(N,{[`${N}-status`]:G,[`${N}-not-a-wrapper`]:!S,[`${N}-rtl`]:O==="rtl"},I,T,m==null?void 0:m.className,(o=m==null?void 0:m.classNames)===null||o===void 0?void 0:o.root,$==null?void 0:$.root,B,A);if(!S&&G){const M=X.color;return D(i.createElement("span",Object.assign({},R,{className:be,style:Object.assign(Object.assign(Object.assign({},E==null?void 0:E.root),(t=m==null?void 0:m.styles)===null||t===void 0?void 0:t.root),X)}),i.createElement("span",{className:De,style:Object.assign(Object.assign(Object.assign({},E==null?void 0:E.indicator),(s=m==null?void 0:m.styles)===null||s===void 0?void 0:s.indicator),ne)}),c&&i.createElement("span",{style:{color:M},className:`${N}-status-text`},c)))}return D(i.createElement("span",Object.assign({ref:n},R,{className:be,style:Object.assign(Object.assign({},(l=m==null?void 0:m.styles)===null||l===void 0?void 0:l.root),E==null?void 0:E.root)}),S,i.createElement(Ae,{visible:!W,motionName:`${N}-zoom`,motionAppear:!1,motionDeadline:1e3},M=>{let{className:Me}=M;var re,ie;const We=_("scroll-number",f),ae=ue.current,He=P($==null?void 0:$.indicator,(re=m==null?void 0:m.classNames)===null||re===void 0?void 0:re.indicator,{[`${N}-dot`]:ae,[`${N}-count`]:!ae,[`${N}-count-sm`]:p==="small",[`${N}-multiple-words`]:!ae&&oe&&oe.toString().length>1,[`${N}-status-${g}`]:!!g,[`${N}-color-${a}`]:K});let Y=Object.assign(Object.assign(Object.assign({},E==null?void 0:E.indicator),(ie=m==null?void 0:m.styles)===null||ie===void 0?void 0:ie.indicator),X);return a&&!K&&(Y=Y||{},Y.background=a),i.createElement(Zt,{prefixCls:We,show:!W,motionClassName:Me,className:He,count:oe,title:ze,style:Y,key:"scrollNumber"},_e)}),Pe))}),Be=Ut;Be.Ribbon=Ht;const Xt=Be,Ie=i.createContext(null),Kt=Ie.Provider,je=i.createContext(null),Yt=je.Provider;var Jt=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Qt=i.forwardRef(function(e,n){var r=e.prefixCls,o=r===void 0?"rc-checkbox":r,t=e.className,s=e.style,l=e.checked,h=e.disabled,f=e.defaultChecked,S=f===void 0?!1:f,g=e.type,c=g===void 0?"checkbox":g,a=e.title,b=e.onChange,d=Fe(e,Jt),v=i.useRef(null),p=i.useRef(null),C=Ve(S,{value:l}),u=Le(C,2),x=u[0],I=u[1];i.useImperativeHandle(n,function(){return{focus:function(w){var R;(R=v.current)===null||R===void 0||R.focus(w)},blur:function(){var w;(w=v.current)===null||w===void 0||w.blur()},input:v.current,nativeElement:p.current}});var T=qe(o,t,me(me({},"".concat(o,"-checked"),x),"".concat(o,"-disabled"),h)),$=function(w){h||("checked"in e||I(w.target.checked),b==null||b({target:ge(ge({},e),{},{type:c,checked:w.target.checked}),stopPropagation:function(){w.stopPropagation()},preventDefault:function(){w.preventDefault()},nativeEvent:w.nativeEvent}))};return i.createElement("span",{className:T,title:a,style:s,ref:p},i.createElement("input",Ze({},d,{className:"".concat(o,"-input"),ref:v,onChange:$,disabled:h,checked:!!x,type:c})),i.createElement("span",{className:"".concat(o,"-inner")}))});const eo=e=>{const{componentCls:n,antCls:r}=e,o=`${n}-group`;return{[o]:Object.assign(Object.assign({},U(e)),{display:"inline-block",fontSize:0,[`&${o}-rtl`]:{direction:"rtl"},[`&${o}-block`]:{display:"flex"},[`${r}-badge ${r}-badge-count`]:{zIndex:1},[`> ${r}-badge:not(:first-child) > ${r}-button-wrapper`]:{borderInlineStart:"none"}})}},to=e=>{const{componentCls:n,wrapperMarginInlineEnd:r,colorPrimary:o,radioSize:t,motionDurationSlow:s,motionDurationMid:l,motionEaseInOutCirc:h,colorBgContainer:f,colorBorder:S,lineWidth:g,colorBgContainerDisabled:c,colorTextDisabled:a,paddingXS:b,dotColorDisabled:d,lineType:v,radioColor:p,radioBgColor:C,calc:u}=e,x=`${n}-inner`,I=4,T=u(t).sub(u(I).mul(2)),$=u(1).mul(t).equal({unit:!0});return{[`${n}-wrapper`]:Object.assign(Object.assign({},U(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:r,cursor:"pointer",[`&${n}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${n}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${j(g)} ${v} ${o}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[n]:Object.assign(Object.assign({},U(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${n}-wrapper:hover &,
        &:hover ${x}`]:{borderColor:o},[`${n}-input:focus-visible + ${x}`]:Object.assign({},we(e)),[`${n}:hover::after, ${n}-wrapper:hover &::after`]:{visibility:"visible"},[`${n}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:$,height:$,marginBlockStart:u(1).mul(t).div(-2).equal({unit:!0}),marginInlineStart:u(1).mul(t).div(-2).equal({unit:!0}),backgroundColor:p,borderBlockStart:0,borderInlineStart:0,borderRadius:$,transform:"scale(0)",opacity:0,transition:`all ${s} ${h}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:$,height:$,backgroundColor:f,borderColor:S,borderStyle:"solid",borderWidth:g,borderRadius:"50%",transition:`all ${l}`},[`${n}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${n}-checked`]:{[x]:{borderColor:o,backgroundColor:C,"&::after":{transform:`scale(${e.calc(e.dotSize).div(t).equal()})`,opacity:1,transition:`all ${s} ${h}`}}},[`${n}-disabled`]:{cursor:"not-allowed",[x]:{backgroundColor:c,borderColor:S,cursor:"not-allowed","&::after":{backgroundColor:d}},[`${n}-input`]:{cursor:"not-allowed"},[`${n}-disabled + span`]:{color:a,cursor:"not-allowed"},[`&${n}-checked`]:{[x]:{"&::after":{transform:`scale(${u(T).div(t).equal()})`}}}},[`span${n} + *`]:{paddingInlineStart:b,paddingInlineEnd:b}})}},oo=e=>{const{buttonColor:n,controlHeight:r,componentCls:o,lineWidth:t,lineType:s,colorBorder:l,motionDurationSlow:h,motionDurationMid:f,buttonPaddingInline:S,fontSize:g,buttonBg:c,fontSizeLG:a,controlHeightLG:b,controlHeightSM:d,paddingXS:v,borderRadius:p,borderRadiusSM:C,borderRadiusLG:u,buttonCheckedBg:x,buttonSolidCheckedColor:I,colorTextDisabled:T,colorBgContainerDisabled:$,buttonCheckedBgDisabled:E,buttonCheckedColorDisabled:w,colorPrimary:R,colorPrimaryHover:_,colorPrimaryActive:O,buttonSolidCheckedBg:m,buttonSolidCheckedHoverBg:N,buttonSolidCheckedActiveBg:D,calc:B}=e;return{[`${o}-button-wrapper`]:{position:"relative",display:"inline-block",height:r,margin:0,paddingInline:S,paddingBlock:0,color:n,fontSize:g,lineHeight:j(B(r).sub(B(t).mul(2)).equal()),background:c,border:`${j(t)} ${s} ${l}`,borderBlockStartWidth:B(t).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:t,cursor:"pointer",transition:[`color ${f}`,`background ${f}`,`box-shadow ${f}`].join(","),a:{color:n},[`> ${o}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:B(t).mul(-1).equal(),insetInlineStart:B(t).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:t,paddingInline:0,backgroundColor:l,transition:`background-color ${h}`,content:'""'}},"&:first-child":{borderInlineStart:`${j(t)} ${s} ${l}`,borderStartStartRadius:p,borderEndStartRadius:p},"&:last-child":{borderStartEndRadius:p,borderEndEndRadius:p},"&:first-child:last-child":{borderRadius:p},[`${o}-group-large &`]:{height:b,fontSize:a,lineHeight:j(B(b).sub(B(t).mul(2)).equal()),"&:first-child":{borderStartStartRadius:u,borderEndStartRadius:u},"&:last-child":{borderStartEndRadius:u,borderEndEndRadius:u}},[`${o}-group-small &`]:{height:d,paddingInline:B(v).sub(t).equal(),paddingBlock:0,lineHeight:j(B(d).sub(B(t).mul(2)).equal()),"&:first-child":{borderStartStartRadius:C,borderEndStartRadius:C},"&:last-child":{borderStartEndRadius:C,borderEndEndRadius:C}},"&:hover":{position:"relative",color:R},"&:has(:focus-visible)":Object.assign({},we(e)),[`${o}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${o}-button-wrapper-disabled)`]:{zIndex:1,color:R,background:x,borderColor:R,"&::before":{backgroundColor:R},"&:first-child":{borderColor:R},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:O,borderColor:O,"&::before":{backgroundColor:O}}},[`${o}-group-solid &-checked:not(${o}-button-wrapper-disabled)`]:{color:I,background:m,borderColor:m,"&:hover":{color:I,background:N,borderColor:N},"&:active":{color:I,background:D,borderColor:D}},"&-disabled":{color:T,backgroundColor:$,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:T,backgroundColor:$,borderColor:l}},[`&-disabled${o}-button-wrapper-checked`]:{color:w,backgroundColor:E,borderColor:l,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},no=e=>{const{wireframe:n,padding:r,marginXS:o,lineWidth:t,fontSizeLG:s,colorText:l,colorBgContainer:h,colorTextDisabled:f,controlItemBgActiveDisabled:S,colorTextLightSolid:g,colorPrimary:c,colorPrimaryHover:a,colorPrimaryActive:b,colorWhite:d}=e,v=4,p=s,C=n?p-v*2:p-(v+t)*2;return{radioSize:p,dotSize:C,dotColorDisabled:f,buttonSolidCheckedColor:g,buttonSolidCheckedBg:c,buttonSolidCheckedHoverBg:a,buttonSolidCheckedActiveBg:b,buttonBg:h,buttonCheckedBg:h,buttonColor:l,buttonCheckedBgDisabled:S,buttonCheckedColorDisabled:f,buttonPaddingInline:r-t,wrapperMarginInlineEnd:o,radioColor:n?c:d,radioBgColor:n?h:c}},Te=se("Radio",e=>{const{controlOutline:n,controlOutlineWidth:r}=e,o=`0 0 0 ${j(r)} ${n}`,s=$e(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[eo(s),to(s),oo(s)]},no,{unitless:{radioSize:!0,dotSize:!0}});var ro=globalThis&&globalThis.__rest||function(e,n){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r};const io=(e,n)=>{var r,o;const t=i.useContext(Ie),s=i.useContext(je),{getPrefixCls:l,direction:h,radio:f}=i.useContext(Z),S=i.useRef(null),g=Ge(n,S),{isFormItemInput:c}=i.useContext(Ue),a=D=>{var B,A;(B=e.onChange)===null||B===void 0||B.call(e,D),(A=t==null?void 0:t.onChange)===null||A===void 0||A.call(t,D)},{prefixCls:b,className:d,rootClassName:v,children:p,style:C,title:u}=e,x=ro(e,["prefixCls","className","rootClassName","children","style","title"]),I=l("radio",b),T=((t==null?void 0:t.optionType)||s)==="button",$=T?`${I}-button`:I,E=Oe(I),[w,R,_]=Te(I,E),O=Object.assign({},x),m=i.useContext(Xe);t&&(O.name=t.name,O.onChange=a,O.checked=e.value===t.value,O.disabled=(r=O.disabled)!==null&&r!==void 0?r:t.disabled),O.disabled=(o=O.disabled)!==null&&o!==void 0?o:m;const N=P(`${$}-wrapper`,{[`${$}-wrapper-checked`]:O.checked,[`${$}-wrapper-disabled`]:O.disabled,[`${$}-wrapper-rtl`]:h==="rtl",[`${$}-wrapper-in-form-item`]:c,[`${$}-wrapper-block`]:!!(t!=null&&t.block)},f==null?void 0:f.className,d,v,R,_,E);return w(i.createElement(Ke,{component:"Radio",disabled:O.disabled},i.createElement("label",{className:N,style:Object.assign(Object.assign({},f==null?void 0:f.style),C),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:u},i.createElement(Qt,Object.assign({},O,{className:P(O.className,{[Ye]:!T}),type:"radio",prefixCls:$,ref:g})),p!==void 0?i.createElement("span",null,p):null)))},ao=i.forwardRef(io),Q=ao,so=i.forwardRef((e,n)=>{const{getPrefixCls:r,direction:o}=i.useContext(Z),{prefixCls:t,className:s,rootClassName:l,options:h,buttonStyle:f="outline",disabled:S,children:g,size:c,style:a,id:b,optionType:d,name:v,defaultValue:p,value:C,block:u=!1,onChange:x,onMouseEnter:I,onMouseLeave:T,onFocus:$,onBlur:E}=e,[w,R]=Je(p,{value:C}),_=i.useCallback(k=>{const H=w,W=k.target.value;"value"in e||R(W),W!==H&&(x==null||x(k))},[w,R,x]),O=r("radio",t),m=`${O}-group`,N=Oe(O),[D,B,A]=Te(O,N);let V=g;h&&h.length>0&&(V=h.map(k=>typeof k=="string"||typeof k=="number"?i.createElement(Q,{key:k.toString(),prefixCls:O,disabled:S,value:k,checked:w===k},k):i.createElement(Q,{key:`radio-group-value-options-${k.value}`,prefixCls:O,disabled:k.disabled||S,value:k.value,checked:w===k.value,title:k.title,style:k.style,id:k.id,required:k.required},k.label)));const F=Qe(c),te=P(m,`${m}-${f}`,{[`${m}-${F}`]:F,[`${m}-rtl`]:o==="rtl",[`${m}-block`]:u},s,l,B,A,N),G=i.useMemo(()=>({onChange:_,value:w,disabled:S,name:v,optionType:d,block:u}),[_,w,S,v,d,u]);return D(i.createElement("div",Object.assign({},et(e,{aria:!0,data:!0}),{className:te,style:a,onMouseEnter:I,onMouseLeave:T,onFocus:$,onBlur:E,id:b,ref:n}),i.createElement(Kt,{value:G},V)))}),lo=i.memo(so);var co=globalThis&&globalThis.__rest||function(e,n){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r};const uo=(e,n)=>{const{getPrefixCls:r}=i.useContext(Z),{prefixCls:o}=e,t=co(e,["prefixCls"]),s=r("radio",o);return i.createElement(Yt,{value:"button"},i.createElement(Q,Object.assign({prefixCls:s},t,{type:"radio",ref:n})))},bo=i.forwardRef(uo),ee=Q;ee.Button=bo;ee.Group=lo;ee.__ANT_RADIO=!0;const So=ee,mo=({tag:e})=>y(J,{to:gt(e.id,e.slug),target:"_blank",children:y(le,{title:`${e.description} - Click to view more`,children:y(Ne,{children:e.name})},e.id)}),go="5695c612-fcf0-472c-9111-74b2823bb677.jpg",ve=({character:e,editable:n,hidden:r,onDelete:o})=>{var t;return z(pe,{hoverable:!0,size:"small",style:{height:"100%"},className:"d-flex flex-column",title:z("span",{children:[y(ft,{isPublic:e.is_public??!1,isAudit:e.audited}),r?"Blocked":e.name]}),cover:y("img",{className:"character-img",alt:e.name,src:tt(r?go:e.avatar)}),actions:n?[z(J,{to:`/edit_character/${e.id}`,children:[y(pt,{})," Edit"]}),y("span",{onClick:s=>{s.stopPropagation(),s.preventDefault()},children:z(ht,{title:"Delete this character?",description:z("div",{children:["Are you sure to delete this character? ",y("br",{})," All your chats will be lost forever!"]}),onConfirm:()=>{o==null||o(e.id)},okText:"Yes",cancelText:"No",children:[y(Ct,{})," Delete"]})})]:void 0,children:[!n&&y(J,{to:vt(e.creator_id,e.creator_name),children:z("p",{className:"creator-name",children:[z("span",{children:["@",e.creator_name]})," ",e.creator_verified&&y(St,{size:"small"})]})}),y(pe.Meta,{description:y(le,{title:e.description,children:r?"":$t(e.description,{length:100})})}),z(ot,{className:"mt-4 ",size:[0,4],wrap:!0,children:[e.is_nsfw?y(Ne,{color:"error",children:"🔞 NSFW"}):"","tags"in e&&((t=e.tags)==null?void 0:t.slice(0,4).map(s=>y(mo,{tag:s})))]})]},e.id)},fo=({characters:e,editable:n,size:r="medium",onCharacterDeleted:o})=>{const{profile:t,localData:s}=i.useContext(nt),l=rt(),{modal:h,message:f}=it.useApp();async function S(a,b){if(t?ct("click_character",a):s.visitorId&&dt(s.visitorId,"click_character",a),!n){if(!t&&s.visitorId&&s.visitorCreatedAt&&!he(s.visitorId,s.visitorCreatedAt))b.preventDefault(),l(wt(a));else if(t&&t.visitor_id&&s.visitorCreatedAt&&!he(t.visitor_id,s.visitorCreatedAt)){b.preventDefault();try{const{data:d}=await ke.get(`/chats/exist/${a}`);if(d.error&&d.error.code==ut.NOT_FOUND)return h.info({title:"Can not find this character!",content:y("p",{children:"Can not find this character. It might be deleted or set to private."})});if(d.data)l(`/chats/${d.data.id}`);else{const v=await Et.createChat(a);v&&l(`/chats/${v.id}`)}}catch(d){f.error(JSON.stringify(d,null,2))}}}}const g=async a=>{await Ot(a),o==null||o()},c=i.useCallback(a=>t?fe(t.block_list,"bots",a.id)||fe(t.block_list,"creators",a.creator_id)||at(t.block_list,(a.tags||[]).map(b=>b.id)):!1,[t]);return e.length===0?y("p",{children:"No characters"}):y("div",{className:`character-container ${r}`,children:e.map(a=>{var b,d,v,p;return y(J,{to:yt(a.id,a.name),onClick:C=>{st(),S(a.id,C)},children:a.stats?y(Xt.Ribbon,{text:a.stats&&y(le,{title:`Total: ${(b=a.stats)==null?void 0:b.chat} chats, ${(d=a.stats)==null?void 0:d.message} messages`,children:z("span",{style:{fontSize:"0.8rem"},children:[y(xt,{}),(v=a.stats)==null?void 0:v.chat," ",y(lt,{}),(p=a.stats)==null?void 0:p.message]})}),children:y(ve,{character:a,editable:n,onDelete:g,hidden:c(a)})}):y(ve,{character:a,editable:n,onDelete:g,hidden:c(a)})},a.id)})})},$o=({cacheKey:e,size:n,page:r,onPageChange:o,additionalParams:t})=>{const s=i.useMemo(()=>!o,[o]),[l,h]=i.useState(r||1),[f,S]=i.useState(void 0),[g,c]=i.useState(!1),a=i.useRef({});i.useEffect(()=>{r&&r!==l&&h(r)},[r]);const b=async()=>{try{c(!0);const u=await Nt({page:l||1,...t});S(u),c(!1)}catch{c(!1)}};if(a.current.getData=b,i.useEffect(()=>{a.current.getData()},[e,t,l]),i.useEffect(()=>{s&&h(1)},[s,t]),!f||g)return y(bt,{className:"mt-4"});const{total:d,size:v,data:p}=f,C=y(kt,{total:d,showTotal:u=>z("span",{children:["Total ",y("strong",{children:u})," characters"]}),defaultPageSize:v,defaultCurrent:1,current:l,responsive:!0,showQuickJumper:!0,showSizeChanger:!1,onChange:u=>{o==null||o(u),s&&h(u)}});return z("div",{className:"mt-4",children:[z("p",{children:["Chats and messages count are updated ",y("strong",{children:"every 15-30 minutes."})]}),C,y(fo,{size:n,characters:p}),C]})},yo=()=>{const{data:e}=mt("tags",async()=>await ke.get("/tags"));return e==null?void 0:e.data};export{Xt as B,$o as C,So as R,mo as T,fo as a,Qt as b,ve as c,yo as u};