import{r as f,C as fe,u as Le,j as u,g as pe,a as te,c as ae,R as H,I as Oe,i as Ie,h as Pe,k as He,l as q,m as Ge,n as qe,F as Be,o as ze,p as Me,t as We,q as we,s as be,v as Ue,w as Qe,x as Ke}from"./index.741f95d2.js";var de=globalThis&&globalThis.__assign||function(){return de=Object.assign||function(e){for(var a,r=1,n=arguments.length;r0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]0)&&!(t=n.next()).done;)i.push(t.value)}catch(o){l={error:o}}finally{try{t&&!t.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return i};function ur(e){var a=e.children,r=e.copyable,n=e.editable,t=e.ellipsis,i=e.expanding,l=e.setEditing,o=e.onClickExpand,y=e.forceShowExpand,s=e.isEllipsis,p=e.currentContext,E=p===void 0?{}:p,V=He(),x=E.getPrefixCls,b=E.locale,_=x("typography"),j=cr(f.exports.useState(!1),2),T=j[0],L=j[1],N=f.exports.useRef(null),S=q(r)?r:{},A=q(t)?t:{},v=q(n)?n:{},I=Ge(A.expandNodes)?A.expandNodes:[b.Typography.fold,b.Typography.unfold];f.exports.useEffect(function(){return function(){clearTimeout(N.current),N.current=null}},[]);function F(G){if(!T){var D=S.text!==void 0?S.text:ne(a);ar(D),L(!0),S.onCopy&&S.onCopy(D,G),N.current=setTimeout(function(){L(!1)},3e3)}}var R=function(G){v.onStart&&v.onStart(ne(a),G),l(!0)},d=S.tooltips||[b.Typography.copy,b.Typography.copied],z=r&&u(pe,{content:T?d[1]:d[0],children:u("span",{...re({className:T?_+"-operation-copied":_+"-operation-copy",onClick:F,role:"button","aria-label":d[0],tabIndex:0},V({onPressEnter:F})),children:T?u(qe,{}):S.icon||u(or,{})})}),W=n&&u(pe,{content:b.Typography.edit,children:u("span",{...re({tabIndex:0,"aria-label":b.Typography.edit,role:"button",className:_+"-operation-edit",onClick:R},V({onPressEnter:R})),children:u(sr,{})})}),w=y||A.expandable&&s?u("a",{...re({className:_+"-operation-expand",onClick:o,role:"button",tabIndex:0,"aria-label":b.Typography.unfold},V({onPressEnter:o})),children:i?I[0]:I[1]}):null;return te(Be,{children:[w,W,z]})}function pr(e){var a=e.prefixCls,r=e.children,n=e.setEditing,t=e.editableConfig,i=ae(a+"-typography",a+"-edit-content"),l=ne(r),o=f.exports.useRef(null);f.exports.useEffect(function(){if(o.current&&o.current.focus&&o.current.focus(),o.current&&o.current.dom){var E=o.current.dom.value.length;o.current.dom.setSelectionRange(E,E)}},[]);function y(){n(!1),t.onEnd&&t.onEnd(l)}function s(E){t.onChange&&t.onChange(E)}function p(){y()}return u("div",{className:i,children:u(ze.TextArea,{onBlur:p,ref:o,value:l,autoSize:!0,onChange:s,onPressEnter:y})})}var Y=globalThis&&globalThis.__assign||function(){return Y=Object.assign||function(e){for(var a,r=1,n=arguments.length;r0)&&!(t=n.next()).done;)i.push(t.value)}catch(o){l={error:o}}finally{try{t&&!t.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return i},dr="hxj",m;(function(e){e[e.INIT=0]="INIT",e[e.BEFORE_MEASURE=1]="BEFORE_MEASURE",e[e.MEASURING=2]="MEASURING",e[e.MEASURE_END=3]="MEASURE_END",e[e.NO_NEED_ELLIPSIS=4]="NO_NEED_ELLIPSIS"})(m||(m={}));function fr(e){var a=e.children,r=e.rows,n=r===void 0?1:r,t=e.width,i=e.expanding,l=e.renderMeasureContent,o=e.simpleEllipsis,y=e.onEllipsis,s=e.suffix,p=e.expandNodes,E=e.expandable,V=e.ellipsisStr,x=f.exports.useRef(),b=f.exports.useRef(),_=ee(f.exports.useState([0,0,0]),2),j=_[0],T=_[1],L=ee(f.exports.useState(0),2),N=L[0],S=L[1],A=ee(f.exports.useState(m.NO_NEED_ELLIPSIS),2),v=A[0],I=A[1],F=ee(j,3),R=F[0],d=F[1],z=F[2],W=ee(f.exports.useState(!1),2),w=W[0],G=W[1],D=f.exports.useMemo(function(){return H.Children.toArray(a)},[a]),U=f.exports.useRef(0);Me(function(){y&&y(w)},[w]);var ie=function(c){return Ie(c)||Pe(c)},oe=function(c){var g=0;return c.forEach(function(h){ie?g+=String(h).length:g+=1}),g},P=f.exports.useMemo(function(){return oe(D)},[D]),le=We(function(c){return T(c)}),$=function(c){var g=[],h=0;if(c>=P)return D;for(var C in D){var k=D[C];if(h>=c)return g;var M=ie(k)?String(k).length:1;if(M>c-h)return g.push(String(k).slice(0,c-h)),h=c,g;h+=M,g.push(k)}return g},se=function(){var c,g;if(N){if(v===m.INIT){var h=n*N,C=(c=b.current)===null||c===void 0?void 0:c.offsetHeight,k=C>h;!k||o||i?(I(m.MEASURE_END),G(k),T([0,P,P])):(G(!0),I(m.BEFORE_MEASURE))}else if(v===m.BEFORE_MEASURE){var M=x==null?void 0:x.current.offsetWidth,Q=n*t;if(M>n*t){var K=Math.max(Q/M-.1,0),J=Math.min(Q/M+.1,1),X=Math.floor(K*P),ue=Math.ceil(J*P),$e=Math.floor((X+ue)/2);U.current=$e}I(m.MEASURING)}else if(v===m.MEASURING)if(R!==z-1){var C=(g=b.current)===null||g===void 0?void 0:g.offsetHeight,h=n*N,me=R,ye=z;C<=h?me=d:ye=d;var Ve=Math.floor((ye+me)/2);le([me,Ve,ye])}else le([R,R,R]),I(m.MEASURE_END)}};we(function(){e.rows&&t?(T([0,Math.floor(P/2),P]),I(m.INIT)):I(m.NO_NEED_ELLIPSIS)},[P,o,i,t,s,p,E,V,e.rows]),we(function(){if(x.current&&v===m.INIT){var c=x.current.offsetHeight;S(c)}},[v]),we(function(){se()},[v,d,R,z,N]);var Z={zIndex:-999,position:"fixed",opacity:0,padding:0,margin:0},ge=Y({whiteSpace:"nowrap"},Z),ce=o?Y({textOverflow:"clip"},Z):Z,B;if(v===m.INIT||v===m.BEFORE_MEASURE)B=te("div",{children:[u("div",{ref:x,style:ge,children:v===m.INIT?dr:l(a,!1)}),u("div",{ref:b,style:Y({width:t},ce),children:l(a,w)})]}),B=B.props.children;else if(v===m.MEASURING){var he={height:N*n,overflow:"hidden"};B=te("div",{children:[u("div",{ref:b,style:Y({width:t},ce),children:l($(d),w)}),u("div",{style:he,children:$(U.current)})]}),B=B.props.children}else v===m.MEASURE_END?B=l($(d),w):v===m.NO_NEED_ELLIPSIS&&(B=l(a,!1));return{ellipsisNode:B,isEllipsis:w,measureStatus:v}}var vr=globalThis&&globalThis.__read||function(e,a){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),t,i=[],l;try{for(;(a===void 0||a-- >0)&&!(t=n.next()).done;)i.push(t.value)}catch(o){l={error:o}}finally{try{t&&!t.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return i},gr=function(e,a){if(typeof window!="undefined"&&window.CSS&&window.CSS.supports)return be(a)?window.CSS.supports(e):window.CSS.supports(e,a);if(typeof document!="undefined"&&document.createElement){var r=document.createElement("div");return r.setAttribute("style",e+":"+a+";"),typeof r.style[e]!="undefined"}return!1},hr={display:" -webkit-box","-webkit-line-clamp":2},mr=function(){return Object.entries(hr).every(function(e){var a=vr(e,2),r=a[0],n=a[1];return gr(r,n)})};function yr(e){var a=e.cssEllipsis,r=e.ellipsisStr,n=r===void 0?"...":r,t=e.suffix,i=e.rows,l=f.exports.useMemo(function(){return!a||i>1&&!mr()?!1:n==="..."&&!t},[n,a,i,t]),o={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},y={textOverflow:"ellipsis",whiteSpace:"normal",overflow:"hidden",WebkitLineClamp:""+e.rows,WebkitBoxOrient:"vertical",display:"-webkit-box"};return{simpleEllipsis:l,ellipsisStyle:l?e.rows>1?y:o:{}}}var O=globalThis&&globalThis.__assign||function(){return O=Object.assign||function(e){for(var a,r=1,n=arguments.length;r0)&&!(t=n.next()).done;)i.push(t.value)}catch(o){l={error:o}}finally{try{t&&!t.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return i};function Er(e,a){var r=e.type,n=e.bold,t=e.disabled,i=e.mark,l=e.underline,o=e.delete,y=e.code,s=[],p=[];return r&&p.push(a+"-"+r),t&&p.push(a+"-disabled"),n&&s.push("b"),l&&s.push("u"),o&&s.push("del"),y&&s.push("code"),i&&s.push("mark"),{component:s,className:p}}function Se(e){var a=e.componentType,r=e.style,n=e.className,t=e.children,i=e.editable,l=e.ellipsis,o=e.heading,y=e.blockquote,s=wr(e,["componentType","style","className","children","editable","ellipsis","heading","blockquote"]),p=f.exports.useContext(fe),E=p.getPrefixCls,V=p.rtl,x=E("typography"),b=Er(e,x),_=b.component,j=b.className,T=Ee(f.exports.useState(!1),2),L=T[0],N=T[1],S=Ee(f.exports.useState(0),2),A=S[0],v=S[1],I=f.exports.useRef(0),F=q(i)?i:{},R="editing"in F?F.editing:L,d=l?O({rows:1,ellipsisStr:"...",cssEllipsis:!1},q(l)?l:{}):{},z=d.wrapper||H.Fragment,W=Ee(Ue(!1,{defaultValue:d.defaultExpanded,value:d.expanded}),2),w=W[0],G=W[1],D=yr(d),U=D.simpleEllipsis,ie=D.ellipsisStyle,oe=function(c,g){var h=be(d.ellipsisStr)?"...":d.ellipsisStr,C=!be(d.suffix)&&d.suffix;return te(z,{children:[c,g&&!w&&!U?h:"",C,ge(g)]})},P=fr(O(O({},d),{children:t,expanding:w,width:A,renderMeasureContent:oe,simpleEllipsis:U||w})),le=P.ellipsisNode,$=P.isEllipsis,se=P.measureStatus,Z=function(c){var g=(c==null?void 0:c[0]).contentRect,h=+new Date,C=h-I.current;if(g){var k=_.includes("code")?g.width-18:g.width,M=[m.NO_NEED_ELLIPSIS,m.MEASURE_END];M.includes(se)&&C>100&&(I.current=h,v(k))}};function ge(c){return u(Be,{children:u(ur,{...O({},e,{setEditing:N,onClickExpand:ce,expanding:w,isEllipsis:c,currentContext:p})})})}function ce(c){G(!w),e.onClickExpand&&e.onClickExpand(c),d.onExpand&&d.onExpand(!w,c)}Me(function(){d.onEllipsis&&d.onEllipsis($)},[$]);function B(c,g,h,C){C===void 0&&(C={});var k=c;return g.forEach(function(M,Q){var K=Q===0?C:{},J=q(h.mark)&&h.mark.color?O({style:{backgroundColor:h.mark.color}},K):O({},K);k=H.createElement(M,O({},J),k)}),k}function he(){var c,g=ne(H.Children.toArray(t)),h=d.showTooltip,C=q(d.showTooltip)&&d.showTooltip.type==="popover"?"popover":"tooltip",k=q(d.showTooltip)?d.showTooltip.props||{}:{},M=C==="popover"?Je:pe,Q=$&&!h&&!w?{title:g}:{},K=O({style:r},Q),J=$&&h&&!w,X;a==="Paragraph"?X=y?"blockquote":"div":a==="Title"?X="h"+o:a==="Text"&&(X=l?"div":"span");var ue=u(Qe,{onResize:Z,children:u(X,{...O({className:ae(x,j,(c={},c[x+"-rtl"]=V,c),n)},K,Ke(s,["spacing","type","close","bold","disabled","mark","underline","delete","code","copyable","isEllipsis","expanding","onClickExpand","setEditing","forceShowExpand"])),children:U&&se!==m.INIT&&!w&&$?B(oe(u("span",{style:ie,children:t}),$),_.length?_:["span"],e,{className:x+"-simple-ellipsis"}):B(le,_,e)})});return J?u(M,{...O({content:g},k),children:u("span",{children:ue})}):ue}return R?u(pr,{...O({},e,{prefixCls:x,setEditing:N,editableConfig:F})}):he()}var xe=globalThis&&globalThis.__assign||function(){return xe=Object.assign||function(e){for(var a,r=1,n=arguments.length;r