import{c as dt,r,I as be,_ as ve,g as ut,u as pt,a as ft,b as le,d as mt,e as gt,f as yt,C as Me,h as Pe,R as bt,i as J,j as vt,o as De,k as y,B as Ne,l as ht,m as xt,s as Et}from"./index-BK4vUHaK.js";import{l as St}from"./auth-aTo4ljtG.js";import{F as ne,R as Ct,a as Ot,e as wt}from"./encrypt-BN2ZoURD.js";import{T as jt,a as he,t as He,u as Rt,b as je,R as Tt,c as Ae,H as It,I as Re}from"./head-reInfxhK.js";import{K as ie,R as $t,M as _t}from"./index-D1gw9tJC.js";import"./http-B4QJq32f.js";const We=e=>({color:e.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}});var ze=function(t){if(dt()&&window.document.documentElement){var o=Array.isArray(t)?t:[t],n=window.document.documentElement;return o.some(function(s){return s in n.style})}return!1},kt=function(t,o){if(!ze(t))return!1;var n=document.createElement("div"),s=n.style[t];return n.style[t]=o,n.style[t]!==s};function Te(e,t){return!Array.isArray(e)&&t!==void 0?kt(e,t):ze(e)}var Lt=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};const Mt={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-flex"},ye=r.forwardRef((e,t)=>{const o=i=>{const{keyCode:f}=i;f===ie.ENTER&&i.preventDefault()},n=i=>{const{keyCode:f}=i,{onClick:g}=e;f===ie.ENTER&&g&&g()},{style:s,noStyle:a,disabled:u,tabIndex:c=0}=e,p=Lt(e,["style","noStyle","disabled","tabIndex"]);let d={};return a||(d=Object.assign({},Mt)),u&&(d.pointerEvents="none"),d=Object.assign(Object.assign({},d),s),r.createElement("div",Object.assign({role:"button",tabIndex:c,ref:t},p,{onKeyDown:o,onKeyUp:n,style:d}))});var Pt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Dt=function(t,o){return r.createElement(be,ve({},t,{ref:o,icon:Pt}))},Nt=r.forwardRef(Dt),Ht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},At=function(t,o){return r.createElement(be,ve({},t,{ref:o,icon:Ht}))},Wt=r.forwardRef(At);const zt=(e,t,o,n)=>{const{titleMarginBottom:s,fontWeightStrong:a}=n;return{marginBottom:s,color:o,fontWeight:a,fontSize:e,lineHeight:t}},Bt=e=>{const t=[1,2,3,4,5],o={};return t.forEach(n=>{o[`
      h${n}&,
      div&-h${n},
      div&-h${n} > textarea,
      h${n}
    `]=zt(e[`fontSizeHeading${n}`],e[`lineHeightHeading${n}`],e.colorTextHeading,e)}),o},Ut=e=>{const{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},We(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},Ft=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:ut[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),Kt=e=>{const{componentCls:t,paddingSM:o}=e,n=o;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),marginTop:e.calc(n).mul(-1).equal(),marginBottom:`calc(1em - ${pt(n)})`},[`${t}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},Vt=e=>({[`${e.componentCls}-copy-success`]:{"\n    &,\n    &:hover,\n    &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),qt=()=>({"\n  a&-ellipsis,\n  span&-ellipsis\n  ":{display:"inline-block",maxWidth:"100%"},"&-ellipsis-single-line":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),Xt=e=>{const{componentCls:t,titleMarginTop:o}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccess},[`&${t}-warning`]:{color:e.colorWarning},[`&${t}-danger`]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n        div&,\n        p\n      ":{marginBottom:"1em"}},Bt(e)),{[`
      & + h1${t},
      & + h2${t},
      & + h3${t},
      & + h4${t},
      & + h5${t}
      `]:{marginTop:o},"\n      div,\n      ul,\n      li,\n      p,\n      h1,\n      h2,\n      h3,\n      h4,\n      h5":{"\n        + h1,\n        + h2,\n        + h3,\n        + h4,\n        + h5\n        ":{marginTop:o}}}),Ft(e)),Ut(e)),{[`
        ${t}-expand,
        ${t}-collapse,
        ${t}-edit,
        ${t}-copy
      `]:Object.assign(Object.assign({},We(e)),{marginInlineStart:e.marginXXS})}),Kt(e)),Vt(e)),qt()),{"&-rtl":{direction:"rtl"}})}},Jt=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),Be=ft("Typography",e=>[Xt(e)],Jt),Gt=e=>{const{prefixCls:t,"aria-label":o,className:n,style:s,direction:a,maxLength:u,autoSize:c=!0,value:p,onSave:d,onCancel:i,onEnd:f,component:g,enterIcon:b=r.createElement(Wt,null)}=e,R=r.useRef(null),C=r.useRef(!1),T=r.useRef(),[H,k]=r.useState(p);r.useEffect(()=>{k(p)},[p]),r.useEffect(()=>{var x;if(!((x=R.current)===null||x===void 0)&&x.resizableTextArea){const{textArea:h}=R.current.resizableTextArea;h.focus();const{length:_}=h.value;h.setSelectionRange(_,_)}},[]);const E=x=>{let{target:h}=x;k(h.value.replace(/[\n\r]/g,""))},A=()=>{C.current=!0},O=()=>{C.current=!1},w=x=>{let{keyCode:h}=x;C.current||(T.current=h)},K=()=>{d(H.trim())},W=x=>{let{keyCode:h,ctrlKey:_,altKey:j,metaKey:M,shiftKey:q}=x;T.current===h&&!C.current&&!_&&!j&&!M&&!q&&(h===ie.ENTER?(K(),f==null||f()):h===ie.ESC&&i())},v=()=>{K()},z=g?`${t}-${g}`:"",[F,V,L]=Be(t),I=le(t,`${t}-edit-content`,{[`${t}-rtl`]:a==="rtl"},n,z,V,L);return F(r.createElement("div",{className:I,style:s},r.createElement(jt,{ref:R,maxLength:u,value:H,onChange:E,onKeyDown:w,onKeyUp:W,onCompositionStart:A,onCompositionEnd:O,onBlur:v,"aria-label":o,rows:1,autoSize:c}),b!==null?mt(b,{className:`${t}-edit-content-confirm`}):null))};var Qt=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||o.forEach(function(s){e.addRange(s)}),t&&t.focus()}},Yt=Qt,Ie={"text/plain":"Text","text/html":"Url",default:"Text"},Zt="Copy to clipboard: #{key}, Enter";function en(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function tn(e,t){var o,n,s,a,u,c,p=!1;t||(t={}),o=t.debug||!1;try{s=Yt(),a=document.createRange(),u=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),typeof i.clipboardData>"u"){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=Ie[t.format]||Ie.default;window.clipboardData.setData(f,e)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,e);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))}),document.body.appendChild(c),a.selectNodeContents(c),u.addRange(a);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");p=!0}catch(i){o&&console.error("unable to copy using execCommand: ",i),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),p=!0}catch(f){o&&console.error("unable to copy using clipboardData: ",f),o&&console.error("falling back to prompt"),n=en("message"in t?t.message:Zt),window.prompt(n,e)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(a):u.removeAllRanges()),c&&document.body.removeChild(c),s()}return p}var nn=tn;const on=gt(nn);var rn=function(e,t,o,n){function s(a){return a instanceof o?a:new o(function(u){u(a)})}return new(o||(o=Promise))(function(a,u){function c(i){try{d(n.next(i))}catch(f){u(f)}}function p(i){try{d(n.throw(i))}catch(f){u(f)}}function d(i){i.done?a(i.value):s(i.value).then(c,p)}d((n=n.apply(e,t||[])).next())})};const sn=e=>{let{copyConfig:t,children:o}=e;const[n,s]=r.useState(!1),[a,u]=r.useState(!1),c=r.useRef(null),p=()=>{c.current&&clearTimeout(c.current)},d={};t.format&&(d.format=t.format),r.useEffect(()=>p,[]);const i=yt(f=>rn(void 0,void 0,void 0,function*(){var g;f==null||f.preventDefault(),f==null||f.stopPropagation(),u(!0);try{const b=typeof t.text=="function"?yield t.text():t.text;on(b||String(o)||"",d),u(!1),s(!0),p(),c.current=setTimeout(()=>{s(!1)},3e3),(g=t.onCopy)===null||g===void 0||g.call(t,f)}catch(b){throw u(!1),b}}));return{copied:n,copyLoading:a,onClick:i}};function ue(e,t){return r.useMemo(()=>{const o=!!e;return[o,Object.assign(Object.assign({},t),o&&typeof e=="object"?e:null)]},[e])}const ln=e=>{const t=r.useRef();return r.useEffect(()=>{t.current=e}),t.current},an=(e,t)=>{const o=r.useRef(!1);r.useEffect(()=>{o.current?e():o.current=!0},t)};var cn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};const Ue=r.forwardRef((e,t)=>{const{prefixCls:o,component:n="article",className:s,rootClassName:a,setContentRef:u,children:c,direction:p,style:d}=e,i=cn(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:f,direction:g,typography:b}=r.useContext(Me),R=p??g;let C=t;u&&(C=Pe(t,u));const T=f("typography",o),[H,k,E]=Be(T),A=le(T,b==null?void 0:b.className,{[`${T}-rtl`]:R==="rtl"},s,a,k,E),O=Object.assign(Object.assign({},b==null?void 0:b.style),d);return H(r.createElement(n,Object.assign({className:A,style:O,ref:C},i),c))});var dn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},un=function(t,o){return r.createElement(be,ve({},t,{ref:o,icon:dn}))},pn=r.forwardRef(un);function $e(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function oe(e,t,o){return e===!0||e===void 0?t:e||o&&t}const fn=e=>{const{prefixCls:t,copied:o,locale:n,iconOnly:s,tooltips:a,icon:u,loading:c,tabIndex:p,onCopy:d}=e,i=$e(a),f=$e(u),{copied:g,copy:b}=n??{},R=o?oe(i[1],g):oe(i[0],b),T=typeof R=="string"?R:o?g:b;return r.createElement(he,{key:"copy",title:R},r.createElement(ye,{className:le(`${t}-copy`,{[`${t}-copy-success`]:o,[`${t}-copy-icon-only`]:s}),onClick:d,"aria-label":T,tabIndex:p},o?oe(f[1],r.createElement($t,null),!0):oe(f[0],c?r.createElement(bt,null):r.createElement(pn,null),!0)))},re=r.forwardRef((e,t)=>{let{style:o,children:n}=e;const s=r.useRef(null);return r.useImperativeHandle(t,()=>({isExceed:()=>{const a=s.current;return a.scrollHeight>a.clientHeight},getHeight:()=>s.current.clientHeight})),r.createElement("span",{"aria-hidden":!0,ref:s,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},o)},n)});function Fe(e){const t=typeof e;return t==="string"||t==="number"}function mn(e){let t=0;return e.forEach(o=>{Fe(o)?t+=String(o).length:t+=1}),t}function _e(e,t){let o=0;const n=[];for(let s=0;s<e.length;s+=1){if(o===t)return n;const a=e[s],c=Fe(a)?String(a).length:1,p=o+c;if(p>t){const d=t-o;return n.push(String(a).slice(0,d)),n}n.push(a),o=p}return e}const pe=0,fe=1,me=2,ge=3,ke=4,se={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function gn(e){const{enableMeasure:t,width:o,text:n,children:s,rows:a,expanded:u,miscDeps:c,onEllipsis:p}=e,d=r.useMemo(()=>He(n),[n]),i=r.useMemo(()=>mn(d),[n]),f=r.useMemo(()=>s(d,!1),[n]),[g,b]=r.useState(null),R=r.useRef(null),C=r.useRef(null),T=r.useRef(null),H=r.useRef(null),k=r.useRef(null),[E,A]=r.useState(!1),[O,w]=r.useState(pe),[K,W]=r.useState(0),[v,z]=r.useState(null);J(()=>{w(t&&o&&i?fe:pe)},[o,n,a,t,d]),J(()=>{var I,x,h,_;if(O===fe){w(me);const j=C.current&&getComputedStyle(C.current).whiteSpace;z(j)}else if(O===me){const j=!!(!((I=T.current)===null||I===void 0)&&I.isExceed());w(j?ge:ke),b(j?[0,i]:null),A(j);const M=((x=T.current)===null||x===void 0?void 0:x.getHeight())||0,q=a===1?0:((h=H.current)===null||h===void 0?void 0:h.getHeight())||0,Q=((_=k.current)===null||_===void 0?void 0:_.getHeight())||0,ce=q+Q,Y=Math.max(M,ce);W(Y+1),p(j)}},[O]);const F=g?Math.ceil((g[0]+g[1])/2):0;J(()=>{var I;const[x,h]=g||[0,0];if(x!==h){const j=(((I=R.current)===null||I===void 0?void 0:I.getHeight())||0)>K;let M=F;h-x===1&&(M=j?x:h),b(j?[x,M]:[M,h])}},[g,F]);const V=r.useMemo(()=>{if(O!==ge||!g||g[0]!==g[1]){const I=s(d,!1);return O!==ke&&O!==pe?r.createElement("span",{style:Object.assign(Object.assign({},se),{WebkitLineClamp:a})},I):I}return s(u?d:_e(d,g[0]),E)},[u,O,g,d].concat(vt(c))),L={width:o,margin:0,padding:0,whiteSpace:v==="nowrap"?"normal":"inherit"};return r.createElement(r.Fragment,null,V,O===me&&r.createElement(r.Fragment,null,r.createElement(re,{style:Object.assign(Object.assign(Object.assign({},L),se),{WebkitLineClamp:a}),ref:T},f),r.createElement(re,{style:Object.assign(Object.assign(Object.assign({},L),se),{WebkitLineClamp:a-1}),ref:H},f),r.createElement(re,{style:Object.assign(Object.assign(Object.assign({},L),se),{WebkitLineClamp:1}),ref:k},s([],!0))),O===ge&&g&&g[0]!==g[1]&&r.createElement(re,{style:Object.assign(Object.assign({},L),{top:400}),ref:R},s(_e(d,F),!0)),O===fe&&r.createElement("span",{style:{whiteSpace:"inherit"},ref:C}))}const yn=e=>{let{enableEllipsis:t,isEllipsis:o,children:n,tooltipProps:s}=e;return!(s!=null&&s.title)||!t?n:r.createElement(he,Object.assign({open:o?void 0:!1},s),n)};var bn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};function vn(e,t){let{mark:o,code:n,underline:s,delete:a,strong:u,keyboard:c,italic:p}=e,d=t;function i(f,g){g&&(d=r.createElement(f,{},d))}return i("strong",u),i("u",s),i("del",a),i("code",n),i("mark",o),i("kbd",c),i("i",p),d}const hn="...",ae=r.forwardRef((e,t)=>{var o,n,s;const{prefixCls:a,className:u,style:c,type:p,disabled:d,children:i,ellipsis:f,editable:g,copyable:b,component:R,title:C}=e,T=bn(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:H,direction:k}=r.useContext(Me),[E]=Rt("Text"),A=r.useRef(null),O=r.useRef(null),w=H("typography",a),K=De(T,["mark","code","delete","underline","strong","keyboard","italic"]),[W,v]=ue(g),[z,F]=je(!1,{value:v.editing}),{triggerType:V=["icon"]}=v,L=l=>{var m;l&&((m=v.onStart)===null||m===void 0||m.call(v)),F(l)},I=ln(z);an(()=>{var l;!z&&I&&((l=O.current)===null||l===void 0||l.focus())},[z]);const x=l=>{l==null||l.preventDefault(),L(!0)},h=l=>{var m;(m=v.onChange)===null||m===void 0||m.call(v,l),L(!1)},_=()=>{var l;(l=v.onCancel)===null||l===void 0||l.call(v),L(!1)},[j,M]=ue(b),{copied:q,copyLoading:Q,onClick:ce}=sn({copyConfig:M,children:i}),[Y,Ke]=r.useState(!1),[xe,Ve]=r.useState(!1),[Ee,qe]=r.useState(!1),[Se,Xe]=r.useState(!1),[Je,Ge]=r.useState(!0),[B,S]=ue(f,{expandable:!1,symbol:l=>l?E==null?void 0:E.collapse:E==null?void 0:E.expand}),[P,Qe]=je(S.defaultExpanded||!1,{value:S.expanded}),$=B&&(!P||S.expandable==="collapsible"),{rows:X=1}=S,Z=r.useMemo(()=>$&&(S.suffix!==void 0||S.onEllipsis||S.expandable||W||j),[$,S,W,j]);J(()=>{B&&!Z&&(Ke(Te("webkitLineClamp")),Ve(Te("textOverflow")))},[Z,B]);const[D,Ye]=r.useState($),Ce=r.useMemo(()=>Z?!1:X===1?xe:Y,[Z,xe,Y]);J(()=>{Ye(Ce&&$)},[Ce,$]);const Oe=$&&(D?Se:Ee),Ze=$&&X===1&&D,ee=$&&X>1&&D,et=(l,m)=>{var N;Qe(m.expanded),(N=S.onExpand)===null||N===void 0||N.call(S,l,m)},[we,tt]=r.useState(0),nt=l=>{let{offsetWidth:m}=l;tt(m)},ot=l=>{var m;qe(l),Ee!==l&&((m=S.onEllipsis)===null||m===void 0||m.call(S,l))};r.useEffect(()=>{const l=A.current;if(B&&D&&l){const m=ee?l.offsetHeight<l.scrollHeight:l.offsetWidth<l.scrollWidth;Se!==m&&Xe(m)}},[B,D,i,ee,Je,we]),r.useEffect(()=>{const l=A.current;if(typeof IntersectionObserver>"u"||!l||!D||!$)return;const m=new IntersectionObserver(()=>{Ge(!!l.offsetParent)});return m.observe(l),()=>{m.disconnect()}},[D,$]);let U={};S.tooltip===!0?U={title:(o=v.text)!==null&&o!==void 0?o:i}:r.isValidElement(S.tooltip)?U={title:S.tooltip}:typeof S.tooltip=="object"?U=Object.assign({title:(n=v.text)!==null&&n!==void 0?n:i},S.tooltip):U={title:S.tooltip};const te=r.useMemo(()=>{const l=m=>["string","number"].includes(typeof m);if(!(!B||D)){if(l(v.text))return v.text;if(l(i))return i;if(l(C))return C;if(l(U.title))return U.title}},[B,D,C,U.title,Oe]);if(z)return r.createElement(Gt,{value:(s=v.text)!==null&&s!==void 0?s:typeof i=="string"?i:"",onSave:h,onCancel:_,onEnd:v.onEnd,prefixCls:w,className:u,style:c,direction:k,component:R,maxLength:v.maxLength,autoSize:v.autoSize,enterIcon:v.enterIcon});const rt=()=>{const{expandable:l,symbol:m}=S;return!l||P&&l!=="collapsible"?null:r.createElement(ye,{key:"expand",className:`${w}-${P?"collapse":"expand"}`,onClick:N=>et(N,{expanded:!P}),"aria-label":P?E.collapse:E==null?void 0:E.expand},typeof m=="function"?m(P):m)},st=()=>{if(!W)return;const{icon:l,tooltip:m,tabIndex:N}=v,de=He(m)[0]||(E==null?void 0:E.edit),ct=typeof de=="string"?de:"";return V.includes("icon")?r.createElement(he,{key:"edit",title:m===!1?"":de},r.createElement(ye,{ref:O,className:`${w}-edit`,onClick:x,"aria-label":ct,tabIndex:N},l||r.createElement(Nt,{role:"button"}))):null},it=()=>j?r.createElement(fn,Object.assign({key:"copy"},M,{prefixCls:w,copied:q,locale:E,onCopy:ce,loading:Q,iconOnly:i==null})):null,lt=l=>[l&&rt(),st(),it()],at=l=>[l&&!P&&r.createElement("span",{"aria-hidden":!0,key:"ellipsis"},hn),S.suffix,lt(l)];return r.createElement(Tt,{onResize:nt,disabled:!$},l=>r.createElement(yn,{tooltipProps:U,enableEllipsis:$,isEllipsis:Oe},r.createElement(Ue,Object.assign({className:le({[`${w}-${p}`]:p,[`${w}-disabled`]:d,[`${w}-ellipsis`]:B,[`${w}-ellipsis-single-line`]:Ze,[`${w}-ellipsis-multiple-line`]:ee},u),prefixCls:a,style:Object.assign(Object.assign({},c),{WebkitLineClamp:ee?X:void 0}),component:R,ref:Pe(l,A,t),direction:k,onClick:V.includes("text")?x:void 0,"aria-label":te==null?void 0:te.toString(),title:C},K),r.createElement(gn,{enableMeasure:$&&!D,text:i,rows:X,width:we,onEllipsis:ot,expanded:P,miscDeps:[q,P,Q,W,j]},(m,N)=>vn(e,r.createElement(r.Fragment,null,m.length>0&&N&&!P&&te?r.createElement("span",{key:"show-content","aria-hidden":!0},m):m,at(N)))))))});var xn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};const En=r.forwardRef((e,t)=>{var{ellipsis:o,rel:n}=e,s=xn(e,["ellipsis","rel"]);const a=Object.assign(Object.assign({},s),{rel:n===void 0&&s.target==="_blank"?"noopener noreferrer":n});return delete a.navigate,r.createElement(ae,Object.assign({},a,{ref:t,ellipsis:!!o,component:"a"}))}),Sn=r.forwardRef((e,t)=>r.createElement(ae,Object.assign({ref:t},e,{component:"div"})));var Cn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};const On=(e,t)=>{var{ellipsis:o}=e,n=Cn(e,["ellipsis"]);const s=r.useMemo(()=>o&&typeof o=="object"?De(o,["expandable","rows"]):o,[o]);return r.createElement(ae,Object.assign({ref:t},n,{ellipsis:s,component:"span"}))},wn=r.forwardRef(On);var jn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]]);return o};const Rn=[1,2,3,4,5],Tn=r.forwardRef((e,t)=>{const{level:o=1}=e,n=jn(e,["level"]);let s;return Rn.includes(o)?s=`h${o}`:s="h1",r.createElement(ae,Object.assign({ref:t},n,{component:s}))}),G=Ue;G.Text=wn;G.Link=En;G.Title=Tn;G.Paragraph=Sn;const{Text:Le}=G,In=()=>{const{t:e}=Ae(),[t,o]=r.useState(!1),n=()=>{o(!0)},s=()=>{o(!1)};return y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"cursor-pointer text-neutral-500 underline underline-offset-4",onClick:n,children:e("auth.forgetPassword")}),y.jsxs(_t,{title:e("auth.resetPassword"),open:t,onCancel:s,closeIcon:null,footer:null,centered:!0,children:[y.jsxs("div",{className:"flex flex-col space-y-1 pt-1",children:[y.jsx("div",{children:e("auth.reset1")}),y.jsx("div",{children:e("auth.reset2")}),y.jsxs("div",{children:[e("auth.reset3"),y.jsx(Le,{code:!0,children:"/etc/kvm/pwd"})]}),y.jsxs("div",{children:[e("auth.reset4"),y.jsx(Le,{code:!0,children:"admin/admin"})]})]}),y.jsx("div",{className:"flex justify-center pb-3 pt-10",children:y.jsx(Ne,{type:"primary",className:"w-24",onClick:s,children:e("auth.ok")})})]})]})},Dn=()=>{const e=ht(),{t}=Ae(),[o,n]=r.useState("");r.useEffect(()=>{xt()&&e("/",{replace:!0})},[]),r.useEffect(()=>{o&&setTimeout(()=>n(""),3e3)},[o]);function s(a){const u=a.username,c=wt(a.password);St(u,c).then(p=>{if(p.code!==0){p.code===-3?n(t("auth.noAccount")):p.code===-4?n(t("auth.invalidUser")):n(t("auth.error"));return}n(""),Et(p.data.token),e("/",{replace:!0}),window.location.reload()}).catch(()=>{n(t("auth.error"))})}return y.jsxs(y.Fragment,{children:[y.jsx(It,{title:t("head.login")}),y.jsxs("div",{className:"flex h-screen w-screen flex-col items-center justify-center",children:[y.jsx("h2",{className:"text-xl font-semibold text-neutral-100",children:t("auth.login")}),y.jsxs(ne,{style:{minWidth:300,maxWidth:500},initialValues:{remember:!0},onFinish:s,children:[y.jsx(ne.Item,{name:"username",rules:[{required:!0,message:t("auth.noEmptyUsername"),min:1}],children:y.jsx(Re,{prefix:y.jsx(Ct,{}),placeholder:t("auth.placeholderUsername")})}),y.jsx(ne.Item,{name:"password",rules:[{required:!0,message:t("auth.noEmptyPassword"),min:1}],children:y.jsx(Re,{prefix:y.jsx(Ot,{}),type:"password",placeholder:t("auth.placeholderPassword")})}),y.jsx("div",{className:"text-red-500",children:o}),y.jsx(ne.Item,{children:y.jsx(Ne,{type:"primary",htmlType:"submit",className:"w-full",children:t("auth.ok")})}),y.jsx("div",{className:"flex justify-end pb-4 text-sm",children:y.jsx(In,{})})]})]})]})};export{Dn as Login};
