@telepat/ideon 0.1.20 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -211,7 +211,7 @@ html body {
211
211
  ${t}-collapse,
212
212
  ${t}-edit,
213
213
  ${t}-copy
214
- `]:{...fx(e),marginInlineStart:e.marginXXS},...A9(e),..._9(e),...B9(),"&-rtl":{direction:"rtl"}}}},L9=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),T$=Xt("Typography",H9,L9),D9=e=>{const{prefixCls:t,"aria-label":o,className:a,style:l,direction:c,maxLength:f,autoSize:m=!0,value:h,onSave:p,onCancel:y,onEnd:b,component:v,enterIcon:$=u.createElement(M9,null)}=e,x=u.useRef(null),E=u.useRef(!1),C=u.useRef(null),[T,M]=u.useState(h);u.useEffect(()=>{M(h)},[h]),u.useEffect(()=>{if(x.current?.resizableTextArea){const{textArea:k}=x.current.resizableTextArea;k.focus();const{length:U}=k.value;k.setSelectionRange(U,U)}},[]);const w=({target:k})=>{M(k.value.replace(/[\n\r]/g,""))},N=()=>{E.current=!0},R=()=>{E.current=!1},_=({keyCode:k})=>{E.current||(C.current=k)},z=()=>{p(T.trim())},B=({keyCode:k,ctrlKey:U,altKey:F,metaKey:P,shiftKey:q})=>{C.current!==k||E.current||U||F||P||q||(k===er.ENTER?(z(),b?.()):k===er.ESC&&y())},H=()=>{z()},[I,L]=T$(t),V=W(t,`${t}-edit-content`,{[`${t}-rtl`]:c==="rtl",[`${t}-${v}`]:!!v},a,I,L);return u.createElement("div",{className:V,style:l},u.createElement(r9,{ref:x,maxLength:f,value:T,onChange:w,onKeyDown:_,onKeyUp:B,onCompositionStart:N,onCompositionEnd:R,onBlur:H,"aria-label":o,rows:1,autoSize:m}),$!==null?pa($,{className:`${t}-edit-content-confirm`}):null)},P9=(e,t)=>{let o=!1;const a=l=>{l.stopPropagation(),l.preventDefault(),l.clipboardData?.clearData(),l.clipboardData?.setData("text/plain",e),t&&l.clipboardData?.setData("text/html",e),o=!0};try{return document.addEventListener("copy",a,{capture:!0}),document.execCommand("copy"),o}catch{return!1}finally{document.removeEventListener("copy",a,{capture:!0})}},I9=async(e,t)=>{try{return t?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]):await navigator.clipboard.writeText(e),!0}catch{return!1}};async function j9(e,t){if(typeof e!="string")return!1;const o=t?.format==="text/html";return!!(await I9(e,o)||P9(e,o))}const V9=({copyConfig:e,children:t})=>{const[o,a]=u.useState(!1),[l,c]=u.useState(!1),f=u.useRef(null),m=()=>{f.current&&clearTimeout(f.current)},h={};e.format&&(h.format=e.format),u.useEffect(()=>m,[]);const p=Tt(async y=>{y?.preventDefault(),y?.stopPropagation(),c(!0);try{const b=typeof e.text=="function"?await e.text():e.text;await j9(b||E$(t,{skipEmpty:!0}).join("")||"",h),c(!1),a(!0),m(),f.current=setTimeout(()=>{a(!1)},3e3),e.onCopy?.(y)}catch(b){throw c(!1),b}});return{copied:o,copyLoading:l,onClick:p}};function tg(e,t){return u.useMemo(()=>{const o=!!e;return[o,{...t,...o&&typeof e=="object"?e:null}]},[e])}const F9=e=>{const t=u.useRef(void 0);return u.useEffect(()=>{t.current=e}),t.current},q9=(e,t,o)=>u.useMemo(()=>e===!0?{title:t??o}:u.isValidElement(e)?{title:e}:typeof e=="object"?{title:t??o,...e}:{title:e},[e,t,o]),M$=u.forwardRef((e,t)=>{const{prefixCls:o,component:a="article",className:l,rootClassName:c,children:f,direction:m,style:h,...p}=e,{getPrefixCls:y,direction:b,className:v,style:$}=cn("typography"),x=m??b,E=y("typography",o),[C,T]=T$(E),M=W(E,v,{[`${E}-rtl`]:x==="rtl"},l,c,C,T),w={...$,...h};return u.createElement(a,{className:M,style:w,ref:t,...p},f)});var U9={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"};function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Up.apply(this,arguments)}const G9=(e,t)=>u.createElement(Dt,Up({},e,{ref:t,icon:U9})),X9=u.forwardRef(G9),uC=e=>e===!1?[!1,!1]:E$(e);function ng(e,t,o){return e===!0||e===void 0?t:e||o&&t}function W9(e){const t=document.createElement("em");e.appendChild(t);const o=e.getBoundingClientRect(),a=t.getBoundingClientRect();return e.removeChild(t),o.left>a.left||a.right>o.right||o.top>a.top||a.bottom>o.bottom}const Qh=e=>["string","number"].includes(typeof e),Y9=e=>{const{prefixCls:t,copied:o,locale:a,iconOnly:l,tooltips:c,icon:f,tabIndex:m,onCopy:h,loading:p}=e,y=uC(c),b=uC(f),{copied:v,copy:$}=a??{},x=o?v:$,E=ng(y[o?1:0],x),C=typeof E=="string"?E:x;return u.createElement(dl,{title:E},u.createElement("button",{type:"button",className:W(`${t}-copy`,{[`${t}-copy-success`]:o,[`${t}-copy-icon-only`]:l}),onClick:h,"aria-label":C,tabIndex:m},o?ng(b[1],u.createElement(bz,null),!0):ng(b[0],p?u.createElement(Th,null):u.createElement(X9,null),!0)))},bu=u.forwardRef(({style:e,children:t},o)=>{const a=u.useRef(null);return u.useImperativeHandle(o,()=>({isExceed:()=>{const l=a.current;return l.scrollHeight>l.clientHeight},getHeight:()=>a.current.clientHeight})),u.createElement("span",{"aria-hidden":!0,ref:a,style:{position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)",...e}},t)}),K9=e=>e.reduce((t,o)=>t+(Qh(o)?String(o).length:1),0);function fC(e,t){let o=0;const a=[];for(let l=0;l<e.length;l+=1){if(o===t)return a;const c=e[l],m=Qh(c)?String(c).length:1,h=o+m;if(h>t){const p=t-o;return a.push(String(c).slice(0,p)),a}a.push(c),o=h}return e}const rg=0,og=1,ag=2,ig=3,dC=4,vu={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function k9(e){const{enableMeasure:t,width:o,text:a,children:l,rows:c,expanded:f,miscDeps:m,onEllipsis:h}=e,p=u.useMemo(()=>br(a),[a]),y=u.useMemo(()=>K9(p),[a]),b=u.useMemo(()=>l(p,!1),[a]),[v,$]=u.useState(null),x=u.useRef(null),E=u.useRef(null),C=u.useRef(null),T=u.useRef(null),M=u.useRef(null),[w,N]=u.useState(!1),[R,_]=u.useState(rg),[z,B]=u.useState(0),[H,I]=u.useState(null);Lt(()=>{_(t&&o&&y?og:rg)},[o,a,c,t,p]),Lt(()=>{if(R===og){_(ag);const U=E.current&&getComputedStyle(E.current).whiteSpace;I(U)}else if(R===ag){const U=!!C.current?.isExceed();_(U?ig:dC),$(U?[0,y]:null),N(U);const F=C.current?.getHeight()||0,P=c===1?0:T.current?.getHeight()||0,q=M.current?.getHeight()||0,G=Math.max(F,P+q);B(G+1),h(U)}},[R]);const L=v?Math.ceil((v[0]+v[1])/2):0;Lt(()=>{const[U,F]=v||[0,0];if(U!==F){const q=(x.current?.getHeight()||0)>z;let G=L;F-U===1&&(G=q?U:F),$(q?[U,G]:[G,F])}},[v,L]);const V=u.useMemo(()=>{if(!t)return l(p,!1);if(R!==ig||!v||v[0]!==v[1]){const U=l(p,!1);return[dC,rg].includes(R)?U:u.createElement("span",{style:{...vu,WebkitLineClamp:c}},U)}return l(f?p:fC(p,v[0]),w)},[f,R,v,p].concat(sn(m))),k={width:o,margin:0,padding:0,whiteSpace:H==="nowrap"?"normal":"inherit"};return u.createElement(u.Fragment,null,V,R===ag&&u.createElement(u.Fragment,null,u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:c},ref:C},b),u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:c-1},ref:T},b),u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:1},ref:M},l([],!0))),R===ig&&v&&v[0]!==v[1]&&u.createElement(bu,{style:{...k,top:400},ref:x},l(fC(p,L),!0)),R===og&&u.createElement("span",{style:{whiteSpace:"inherit"},ref:E}))}const Q9=({enableEllipsis:e,isEllipsis:t,open:o,children:a,tooltipProps:l})=>{if(!l?.title||!e)return a;const c=o&&t;return u.createElement(dl,{open:c,...l},a)};function Z9({mark:e,code:t,underline:o,delete:a,strong:l,keyboard:c,italic:f},m){let h=m;function p(y,b){b&&(h=u.createElement(y,{},h))}return p("strong",l),p("u",o),p("del",a),p("code",t),p("mark",e),p("kbd",c),p("i",f),h}const J9="...",mC=["delete","mark","code","underline","strong","keyboard","italic"],ff=u.forwardRef((e,t)=>{const{prefixCls:o,className:a,style:l,type:c,disabled:f,children:m,ellipsis:h,editable:p,copyable:y,component:b,title:v,onMouseEnter:$,onMouseLeave:x,...E}=e,{getPrefixCls:C,direction:T}=u.useContext(ut),[M]=ba("Text"),w=u.useRef(null),N=u.useRef(null),R=C("typography",o),_=Lr(E,mC),[z,B]=tg(p),[H,I]=yr(!1,B.editing),{triggerType:L=["icon"]}=B,V=je=>{je&&B.onStart?.(),I(je)},k=F9(H);Lt(()=>{!H&&k&&N.current?.focus()},[H]);const U=je=>{je?.preventDefault(),V(!0)},F=je=>{B.onChange?.(je),V(!1)},P=()=>{B.onCancel?.(),V(!1)},[q,G]=tg(y),{copied:Y,copyLoading:Z,onClick:A}=V9({copyConfig:G,children:m}),[D,K]=u.useState(!1),[Q,ee]=u.useState(!1),[ie,le]=u.useState(!1),[de,ye]=u.useState(!1),[ve,we]=u.useState(!0),[be,Se]=tg(h,{expandable:!1,symbol:je=>je?M?.collapse:M?.expand}),[me,he]=yr(Se.defaultExpanded||!1,Se.expanded),pe=be&&(!me||Se.expandable==="collapsible"),{rows:Pe=1}=Se,Le=u.useMemo(()=>pe&&(Se.suffix!==void 0||Se.onEllipsis||Se.expandable||z||q),[pe,Se,z,q]);Lt(()=>{be&&!Le&&(K(CS("webkitLineClamp")),ee(CS("textOverflow")))},[Le,be]);const[Ee,Xe]=u.useState(pe),Oe=u.useMemo(()=>Le?!1:Pe===1?Q:D,[Le,Q,D]);Lt(()=>{Xe(Oe&&pe)},[Oe,pe]);const Re=pe&&(Ee?de:ie),De=pe&&Pe===1&&Ee,Te=pe&&Pe>1&&Ee,et=(je,Fe)=>{he(Fe.expanded),Se.onExpand?.(je,Fe)},[it,ft]=u.useState(0),[Ue,dt]=u.useState(!1),[Me,xe]=u.useState(!1),Ae=({offsetWidth:je})=>{ft(je)},Ye=je=>{le(je),ie!==je&&Se.onEllipsis?.(je)};u.useEffect(()=>{const je=w.current;if(be&&Ee&&je){const Fe=W9(je);de!==Fe&&ye(Fe)}},[be,Ee,m,Te,ve,it]),u.useEffect(()=>{const je=w.current;if(typeof IntersectionObserver>"u"||!je||!Ee||!pe)return;const Fe=new IntersectionObserver(()=>{we(!!je.offsetParent)});return Fe.observe(je),()=>{Fe.disconnect()}},[Ee,pe]);const _e=q9(Se.tooltip,B.text,m),Ce=u.useMemo(()=>{if(!(!be||Ee))return[B.text,m,v,_e.title].find(Qh)},[be,Ee,v,_e.title,Re]);if(H)return u.createElement(D9,{value:B.text??(typeof m=="string"?m:""),onSave:F,onCancel:P,onEnd:B.onEnd,prefixCls:R,className:a,style:l,direction:T,component:b,maxLength:B.maxLength,autoSize:B.autoSize,enterIcon:B.enterIcon});const Ie=()=>{const{expandable:je,symbol:Fe}=Se;return je?u.createElement("button",{type:"button",key:"expand",className:`${R}-${me?"collapse":"expand"}`,onClick:ot=>et(ot,{expanded:!me}),"aria-label":me?M.collapse:M?.expand},typeof Fe=="function"?Fe(me):Fe):null},mt=()=>{if(!z)return;const{icon:je,tooltip:Fe,tabIndex:ot}=B,Pt=br(Fe)[0]||M?.edit,Wt=typeof Pt=="string"?Pt:"";return L.includes("icon")?u.createElement(dl,{key:"edit",title:Fe===!1?"":Pt},u.createElement("button",{type:"button",ref:N,className:`${R}-edit`,onClick:U,"aria-label":Wt,tabIndex:ot},je||u.createElement($9,{role:"button"}))):null},ke=()=>q?u.createElement(Y9,{key:"copy",...G,prefixCls:R,copied:Y,locale:M,onCopy:A,loading:Z,iconOnly:!vr(m)}):null,Ut=je=>{const Fe=je&&Ie(),ot=mt(),Pt=ke();return!Fe&&!ot&&!Pt?null:u.createElement("span",{key:"operations",className:`${R}-actions`,onMouseEnter:()=>dt(!0),onMouseLeave:()=>dt(!1)},Fe,ot,Pt)},bt=je=>[je&&!me&&u.createElement("span",{"aria-hidden":!0,key:"ellipsis"},J9),Se.suffix,Ut(je)];return u.createElement(wo,{onResize:Ae,disabled:!pe},je=>u.createElement(Q9,{tooltipProps:_e,enableEllipsis:pe,isEllipsis:Re,open:Me&&!Ue},u.createElement(M$,{onMouseEnter:Fe=>{xe(!0),$?.(Fe)},onMouseLeave:Fe=>{xe(!1),x?.(Fe)},className:W({[`${R}-${c}`]:c,[`${R}-disabled`]:f,[`${R}-ellipsis`]:be,[`${R}-ellipsis-single-line`]:De,[`${R}-ellipsis-multiple-line`]:Te,[`${R}-link`]:b==="a"},a),prefixCls:o,style:{...l,WebkitLineClamp:Te?Pe:void 0},component:b,ref:Hr(je,w,t),direction:T,onClick:L.includes("text")?U:void 0,"aria-label":Ce?.toString(),title:v,..._},u.createElement(k9,{enableMeasure:pe&&!Ee,text:m,rows:Pe,width:it,onEllipsis:Ye,expanded:me,miscDeps:[Y,me,Z,z,q,M].concat(sn(mC.map(Fe=>e[Fe])))},(Fe,ot)=>Z9(e,u.createElement(u.Fragment,null,Fe.length>0&&ot&&!me&&Ce?u.createElement("span",{key:"show-content","aria-hidden":!0},Fe):Fe,bt(ot)))))))}),e7=u.forwardRef((e,t)=>{const{ellipsis:o,rel:a,children:l,navigate:c,...f}=e,m={...f,rel:a===void 0&&f.target==="_blank"?"noopener noreferrer":a};return u.createElement(ff,{...m,ref:t,ellipsis:!!o,component:"a"},l)}),t7=u.forwardRef((e,t)=>{const{children:o,...a}=e;return u.createElement(ff,{ref:t,...a,component:"div"},o)}),n7=u.forwardRef((e,t)=>{const{ellipsis:o,children:a,...l}=e,c=u.useMemo(()=>o&&typeof o=="object"?Lr(o,["expandable","rows"]):o,[o]);return u.createElement(ff,{ref:t,...l,ellipsis:c,component:"span"},a)}),r7=[1,2,3,4,5],o7=u.forwardRef((e,t)=>{const{level:o=1,children:a,...l}=e,c=r7.includes(o)?`h${o}`:"h1";return u.createElement(ff,{ref:t,...l,component:c},a)}),Sn=M$;Sn.Text=n7;Sn.Link=e7;Sn.Title=o7;Sn.Paragraph=t7;var a7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Gp.apply(this,arguments)}const i7=(e,t)=>u.createElement(Dt,Gp({},e,{ref:t,icon:a7})),l7=u.forwardRef(i7);var s7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{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 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"};function Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Xp.apply(this,arguments)}const c7=(e,t)=>u.createElement(Dt,Xp({},e,{ref:t,icon:s7})),u7=u.forwardRef(c7);var f7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Wp.apply(this,arguments)}const d7=(e,t)=>u.createElement(Dt,Wp({},e,{ref:t,icon:f7})),m7=u.forwardRef(d7);var g7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 10-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"}}]},name:"linkedin",theme:"outlined"};function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Yp.apply(this,arguments)}const p7=(e,t)=>u.createElement(Dt,Yp({},e,{ref:t,icon:g7})),h7=u.forwardRef(p7);var y7={icon:{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 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"};function Kp(){return Kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Kp.apply(this,arguments)}const b7=(e,t)=>u.createElement(Dt,Kp({},e,{ref:t,icon:y7})),v7=u.forwardRef(b7);var S7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function kp(){return kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},kp.apply(this,arguments)}const C7=(e,t)=>u.createElement(Dt,kp({},e,{ref:t,icon:S7})),x7=u.forwardRef(C7);var E7={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"};function Qp(){return Qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Qp.apply(this,arguments)}const $7=(e,t)=>u.createElement(Dt,Qp({},e,{ref:t,icon:E7})),w7=u.forwardRef($7);var T7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0075-94 336.64 336.64 0 01-108.2 41.2A170.1 170.1 0 00672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 00-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 01-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 01-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"}}]},name:"twitter",theme:"outlined"};function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Zp.apply(this,arguments)}const M7=(e,t)=>u.createElement(Dt,Zp({},e,{ref:t,icon:T7})),gC=u.forwardRef(M7);async function Zh(e){const t=await fetch(e);if(!t.ok){let o=`Request failed with status ${t.status}`;try{const a=await t.json();typeof a.error=="string"&&a.error.length>0&&(o=a.error)}catch{}throw new Error(o)}return t.json()}function R7(){return Zh("/api/bootstrap")}function N7(){return Zh("/api/articles")}function z7(e){return Zh(`/api/articles/${encodeURIComponent(e)}`)}const pC=["article","blog-post","x-thread","x-post","linkedin-post","reddit-post","newsletter"],hC=["shared-brief","planning","sections","image-prompts","images","output","links"];function R$(e){return e.reduce((t,o)=>{const a=o.contentType||"article",l=t[a]??[];return l.push(o),l.sort((c,f)=>c.index-f.index),t[a]=l,t},{})}function N$(e){return[...e].sort((t,o)=>{const a=pC.indexOf(t),l=pC.indexOf(o),c=a===-1?Number.MAX_SAFE_INTEGER:a,f=l===-1?Number.MAX_SAFE_INTEGER:l;return c!==f?c-f:t.localeCompare(o)})}function z$(e){const t=Array.isArray(e?.llmCalls)?e.llmCalls:[],o=Array.isArray(e?.t2iCalls)?e.t2iCalls:[],a=t.map((c,f)=>({id:`llm-${f}`,source:"llm",stageId:String(c.stageId||"unknown"),operationId:String(c.operationId||""),status:String(c.status||""),requestType:String(c.requestType||""),provider:String(c.provider||""),modelId:String(c.modelId||""),durationMs:Number(c.durationMs||0),raw:c})),l=o.map((c,f)=>({id:`t2i-${f}`,source:"t2i",stageId:String(c.stageId||"images"),operationId:String(c.operationId||""),status:String(c.status||""),requestType:"t2i",provider:String(c.provider||""),modelId:String(c.modelId||""),durationMs:Number(c.durationMs||0),raw:c}));return a.concat(l).sort((c,f)=>{const m=new Date(yC(c.raw)).getTime(),h=new Date(yC(f.raw)).getTime();return m!==h?m-h:c.id.localeCompare(f.id)})}function O7(e){const t=e.reduce((o,a)=>{const l=o[a.stageId]??[];return l.push(a),o[a.stageId]=l,o},{});return Object.keys(t).sort((o,a)=>{const l=hC.indexOf(o),c=hC.indexOf(a),f=l===-1?Number.MAX_SAFE_INTEGER:l,m=c===-1?Number.MAX_SAFE_INTEGER:c;return f!==m?f-m:o.localeCompare(a)}).map(o=>({stageId:o,items:t[o]??[]}))}function A7(e){if(e.source==="t2i"){const f=e.raw;return{promptText:String(f.prompt||""),responseText:f.errorMessage?`Error: ${f.errorMessage}`:"Image request completed. Inspect Full JSON for the resolved input payload."}}const t=e.raw,o=bC(t.requestBody),a=bC(t.responseBody),l=Array.isArray(o?.messages)?o.messages.map(f=>`[${String(f.role||"unknown")}]
214
+ `]:{...fx(e),marginInlineStart:e.marginXXS},...A9(e),..._9(e),...B9(),"&-rtl":{direction:"rtl"}}}},L9=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),T$=Xt("Typography",H9,L9),D9=e=>{const{prefixCls:t,"aria-label":o,className:a,style:l,direction:c,maxLength:f,autoSize:m=!0,value:h,onSave:p,onCancel:y,onEnd:b,component:v,enterIcon:$=u.createElement(M9,null)}=e,x=u.useRef(null),E=u.useRef(!1),C=u.useRef(null),[T,M]=u.useState(h);u.useEffect(()=>{M(h)},[h]),u.useEffect(()=>{if(x.current?.resizableTextArea){const{textArea:k}=x.current.resizableTextArea;k.focus();const{length:U}=k.value;k.setSelectionRange(U,U)}},[]);const w=({target:k})=>{M(k.value.replace(/[\n\r]/g,""))},N=()=>{E.current=!0},R=()=>{E.current=!1},_=({keyCode:k})=>{E.current||(C.current=k)},z=()=>{p(T.trim())},B=({keyCode:k,ctrlKey:U,altKey:F,metaKey:P,shiftKey:q})=>{C.current!==k||E.current||U||F||P||q||(k===er.ENTER?(z(),b?.()):k===er.ESC&&y())},H=()=>{z()},[I,L]=T$(t),V=W(t,`${t}-edit-content`,{[`${t}-rtl`]:c==="rtl",[`${t}-${v}`]:!!v},a,I,L);return u.createElement("div",{className:V,style:l},u.createElement(r9,{ref:x,maxLength:f,value:T,onChange:w,onKeyDown:_,onKeyUp:B,onCompositionStart:N,onCompositionEnd:R,onBlur:H,"aria-label":o,rows:1,autoSize:m}),$!==null?pa($,{className:`${t}-edit-content-confirm`}):null)},P9=(e,t)=>{let o=!1;const a=l=>{l.stopPropagation(),l.preventDefault(),l.clipboardData?.clearData(),l.clipboardData?.setData("text/plain",e),t&&l.clipboardData?.setData("text/html",e),o=!0};try{return document.addEventListener("copy",a,{capture:!0}),document.execCommand("copy"),o}catch{return!1}finally{document.removeEventListener("copy",a,{capture:!0})}},I9=async(e,t)=>{try{return t?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]):await navigator.clipboard.writeText(e),!0}catch{return!1}};async function j9(e,t){if(typeof e!="string")return!1;const o=t?.format==="text/html";return!!(await I9(e,o)||P9(e,o))}const V9=({copyConfig:e,children:t})=>{const[o,a]=u.useState(!1),[l,c]=u.useState(!1),f=u.useRef(null),m=()=>{f.current&&clearTimeout(f.current)},h={};e.format&&(h.format=e.format),u.useEffect(()=>m,[]);const p=Tt(async y=>{y?.preventDefault(),y?.stopPropagation(),c(!0);try{const b=typeof e.text=="function"?await e.text():e.text;await j9(b||E$(t,{skipEmpty:!0}).join("")||"",h),c(!1),a(!0),m(),f.current=setTimeout(()=>{a(!1)},3e3),e.onCopy?.(y)}catch(b){throw c(!1),b}});return{copied:o,copyLoading:l,onClick:p}};function tg(e,t){return u.useMemo(()=>{const o=!!e;return[o,{...t,...o&&typeof e=="object"?e:null}]},[e])}const F9=e=>{const t=u.useRef(void 0);return u.useEffect(()=>{t.current=e}),t.current},q9=(e,t,o)=>u.useMemo(()=>e===!0?{title:t??o}:u.isValidElement(e)?{title:e}:typeof e=="object"?{title:t??o,...e}:{title:e},[e,t,o]),M$=u.forwardRef((e,t)=>{const{prefixCls:o,component:a="article",className:l,rootClassName:c,children:f,direction:m,style:h,...p}=e,{getPrefixCls:y,direction:b,className:v,style:$}=cn("typography"),x=m??b,E=y("typography",o),[C,T]=T$(E),M=W(E,v,{[`${E}-rtl`]:x==="rtl"},l,c,C,T),w={...$,...h};return u.createElement(a,{className:M,style:w,ref:t,...p},f)});var U9={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"};function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Up.apply(this,arguments)}const G9=(e,t)=>u.createElement(Dt,Up({},e,{ref:t,icon:U9})),X9=u.forwardRef(G9),uC=e=>e===!1?[!1,!1]:E$(e);function ng(e,t,o){return e===!0||e===void 0?t:e||o&&t}function W9(e){const t=document.createElement("em");e.appendChild(t);const o=e.getBoundingClientRect(),a=t.getBoundingClientRect();return e.removeChild(t),o.left>a.left||a.right>o.right||o.top>a.top||a.bottom>o.bottom}const Qh=e=>["string","number"].includes(typeof e),Y9=e=>{const{prefixCls:t,copied:o,locale:a,iconOnly:l,tooltips:c,icon:f,tabIndex:m,onCopy:h,loading:p}=e,y=uC(c),b=uC(f),{copied:v,copy:$}=a??{},x=o?v:$,E=ng(y[o?1:0],x),C=typeof E=="string"?E:x;return u.createElement(dl,{title:E},u.createElement("button",{type:"button",className:W(`${t}-copy`,{[`${t}-copy-success`]:o,[`${t}-copy-icon-only`]:l}),onClick:h,"aria-label":C,tabIndex:m},o?ng(b[1],u.createElement(bz,null),!0):ng(b[0],p?u.createElement(Th,null):u.createElement(X9,null),!0)))},bu=u.forwardRef(({style:e,children:t},o)=>{const a=u.useRef(null);return u.useImperativeHandle(o,()=>({isExceed:()=>{const l=a.current;return l.scrollHeight>l.clientHeight},getHeight:()=>a.current.clientHeight})),u.createElement("span",{"aria-hidden":!0,ref:a,style:{position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)",...e}},t)}),K9=e=>e.reduce((t,o)=>t+(Qh(o)?String(o).length:1),0);function fC(e,t){let o=0;const a=[];for(let l=0;l<e.length;l+=1){if(o===t)return a;const c=e[l],m=Qh(c)?String(c).length:1,h=o+m;if(h>t){const p=t-o;return a.push(String(c).slice(0,p)),a}a.push(c),o=h}return e}const rg=0,og=1,ag=2,ig=3,dC=4,vu={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function k9(e){const{enableMeasure:t,width:o,text:a,children:l,rows:c,expanded:f,miscDeps:m,onEllipsis:h}=e,p=u.useMemo(()=>br(a),[a]),y=u.useMemo(()=>K9(p),[a]),b=u.useMemo(()=>l(p,!1),[a]),[v,$]=u.useState(null),x=u.useRef(null),E=u.useRef(null),C=u.useRef(null),T=u.useRef(null),M=u.useRef(null),[w,N]=u.useState(!1),[R,_]=u.useState(rg),[z,B]=u.useState(0),[H,I]=u.useState(null);Lt(()=>{_(t&&o&&y?og:rg)},[o,a,c,t,p]),Lt(()=>{if(R===og){_(ag);const U=E.current&&getComputedStyle(E.current).whiteSpace;I(U)}else if(R===ag){const U=!!C.current?.isExceed();_(U?ig:dC),$(U?[0,y]:null),N(U);const F=C.current?.getHeight()||0,P=c===1?0:T.current?.getHeight()||0,q=M.current?.getHeight()||0,G=Math.max(F,P+q);B(G+1),h(U)}},[R]);const L=v?Math.ceil((v[0]+v[1])/2):0;Lt(()=>{const[U,F]=v||[0,0];if(U!==F){const q=(x.current?.getHeight()||0)>z;let G=L;F-U===1&&(G=q?U:F),$(q?[U,G]:[G,F])}},[v,L]);const V=u.useMemo(()=>{if(!t)return l(p,!1);if(R!==ig||!v||v[0]!==v[1]){const U=l(p,!1);return[dC,rg].includes(R)?U:u.createElement("span",{style:{...vu,WebkitLineClamp:c}},U)}return l(f?p:fC(p,v[0]),w)},[f,R,v,p].concat(sn(m))),k={width:o,margin:0,padding:0,whiteSpace:H==="nowrap"?"normal":"inherit"};return u.createElement(u.Fragment,null,V,R===ag&&u.createElement(u.Fragment,null,u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:c},ref:C},b),u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:c-1},ref:T},b),u.createElement(bu,{style:{...k,...vu,WebkitLineClamp:1},ref:M},l([],!0))),R===ig&&v&&v[0]!==v[1]&&u.createElement(bu,{style:{...k,top:400},ref:x},l(fC(p,L),!0)),R===og&&u.createElement("span",{style:{whiteSpace:"inherit"},ref:E}))}const Q9=({enableEllipsis:e,isEllipsis:t,open:o,children:a,tooltipProps:l})=>{if(!l?.title||!e)return a;const c=o&&t;return u.createElement(dl,{open:c,...l},a)};function Z9({mark:e,code:t,underline:o,delete:a,strong:l,keyboard:c,italic:f},m){let h=m;function p(y,b){b&&(h=u.createElement(y,{},h))}return p("strong",l),p("u",o),p("del",a),p("code",t),p("mark",e),p("kbd",c),p("i",f),h}const J9="...",mC=["delete","mark","code","underline","strong","keyboard","italic"],ff=u.forwardRef((e,t)=>{const{prefixCls:o,className:a,style:l,type:c,disabled:f,children:m,ellipsis:h,editable:p,copyable:y,component:b,title:v,onMouseEnter:$,onMouseLeave:x,...E}=e,{getPrefixCls:C,direction:T}=u.useContext(ut),[M]=ba("Text"),w=u.useRef(null),N=u.useRef(null),R=C("typography",o),_=Lr(E,mC),[z,B]=tg(p),[H,I]=yr(!1,B.editing),{triggerType:L=["icon"]}=B,V=je=>{je&&B.onStart?.(),I(je)},k=F9(H);Lt(()=>{!H&&k&&N.current?.focus()},[H]);const U=je=>{je?.preventDefault(),V(!0)},F=je=>{B.onChange?.(je),V(!1)},P=()=>{B.onCancel?.(),V(!1)},[q,G]=tg(y),{copied:Y,copyLoading:Z,onClick:A}=V9({copyConfig:G,children:m}),[D,K]=u.useState(!1),[Q,ee]=u.useState(!1),[ie,le]=u.useState(!1),[de,ye]=u.useState(!1),[ve,we]=u.useState(!0),[be,Se]=tg(h,{expandable:!1,symbol:je=>je?M?.collapse:M?.expand}),[me,he]=yr(Se.defaultExpanded||!1,Se.expanded),pe=be&&(!me||Se.expandable==="collapsible"),{rows:Pe=1}=Se,Le=u.useMemo(()=>pe&&(Se.suffix!==void 0||Se.onEllipsis||Se.expandable||z||q),[pe,Se,z,q]);Lt(()=>{be&&!Le&&(K(CS("webkitLineClamp")),ee(CS("textOverflow")))},[Le,be]);const[Ee,Xe]=u.useState(pe),Oe=u.useMemo(()=>Le?!1:Pe===1?Q:D,[Le,Q,D]);Lt(()=>{Xe(Oe&&pe)},[Oe,pe]);const Re=pe&&(Ee?de:ie),De=pe&&Pe===1&&Ee,Te=pe&&Pe>1&&Ee,et=(je,Fe)=>{he(Fe.expanded),Se.onExpand?.(je,Fe)},[it,ft]=u.useState(0),[Ue,dt]=u.useState(!1),[Me,xe]=u.useState(!1),Ae=({offsetWidth:je})=>{ft(je)},Ye=je=>{le(je),ie!==je&&Se.onEllipsis?.(je)};u.useEffect(()=>{const je=w.current;if(be&&Ee&&je){const Fe=W9(je);de!==Fe&&ye(Fe)}},[be,Ee,m,Te,ve,it]),u.useEffect(()=>{const je=w.current;if(typeof IntersectionObserver>"u"||!je||!Ee||!pe)return;const Fe=new IntersectionObserver(()=>{we(!!je.offsetParent)});return Fe.observe(je),()=>{Fe.disconnect()}},[Ee,pe]);const _e=q9(Se.tooltip,B.text,m),Ce=u.useMemo(()=>{if(!(!be||Ee))return[B.text,m,v,_e.title].find(Qh)},[be,Ee,v,_e.title,Re]);if(H)return u.createElement(D9,{value:B.text??(typeof m=="string"?m:""),onSave:F,onCancel:P,onEnd:B.onEnd,prefixCls:R,className:a,style:l,direction:T,component:b,maxLength:B.maxLength,autoSize:B.autoSize,enterIcon:B.enterIcon});const Ie=()=>{const{expandable:je,symbol:Fe}=Se;return je?u.createElement("button",{type:"button",key:"expand",className:`${R}-${me?"collapse":"expand"}`,onClick:ot=>et(ot,{expanded:!me}),"aria-label":me?M.collapse:M?.expand},typeof Fe=="function"?Fe(me):Fe):null},mt=()=>{if(!z)return;const{icon:je,tooltip:Fe,tabIndex:ot}=B,Pt=br(Fe)[0]||M?.edit,Wt=typeof Pt=="string"?Pt:"";return L.includes("icon")?u.createElement(dl,{key:"edit",title:Fe===!1?"":Pt},u.createElement("button",{type:"button",ref:N,className:`${R}-edit`,onClick:U,"aria-label":Wt,tabIndex:ot},je||u.createElement($9,{role:"button"}))):null},ke=()=>q?u.createElement(Y9,{key:"copy",...G,prefixCls:R,copied:Y,locale:M,onCopy:A,loading:Z,iconOnly:!vr(m)}):null,Ut=je=>{const Fe=je&&Ie(),ot=mt(),Pt=ke();return!Fe&&!ot&&!Pt?null:u.createElement("span",{key:"operations",className:`${R}-actions`,onMouseEnter:()=>dt(!0),onMouseLeave:()=>dt(!1)},Fe,ot,Pt)},bt=je=>[je&&!me&&u.createElement("span",{"aria-hidden":!0,key:"ellipsis"},J9),Se.suffix,Ut(je)];return u.createElement(wo,{onResize:Ae,disabled:!pe},je=>u.createElement(Q9,{tooltipProps:_e,enableEllipsis:pe,isEllipsis:Re,open:Me&&!Ue},u.createElement(M$,{onMouseEnter:Fe=>{xe(!0),$?.(Fe)},onMouseLeave:Fe=>{xe(!1),x?.(Fe)},className:W({[`${R}-${c}`]:c,[`${R}-disabled`]:f,[`${R}-ellipsis`]:be,[`${R}-ellipsis-single-line`]:De,[`${R}-ellipsis-multiple-line`]:Te,[`${R}-link`]:b==="a"},a),prefixCls:o,style:{...l,WebkitLineClamp:Te?Pe:void 0},component:b,ref:Hr(je,w,t),direction:T,onClick:L.includes("text")?U:void 0,"aria-label":Ce?.toString(),title:v,..._},u.createElement(k9,{enableMeasure:pe&&!Ee,text:m,rows:Pe,width:it,onEllipsis:Ye,expanded:me,miscDeps:[Y,me,Z,z,q,M].concat(sn(mC.map(Fe=>e[Fe])))},(Fe,ot)=>Z9(e,u.createElement(u.Fragment,null,Fe.length>0&&ot&&!me&&Ce?u.createElement("span",{key:"show-content","aria-hidden":!0},Fe):Fe,bt(ot)))))))}),e7=u.forwardRef((e,t)=>{const{ellipsis:o,rel:a,children:l,navigate:c,...f}=e,m={...f,rel:a===void 0&&f.target==="_blank"?"noopener noreferrer":a};return u.createElement(ff,{...m,ref:t,ellipsis:!!o,component:"a"},l)}),t7=u.forwardRef((e,t)=>{const{children:o,...a}=e;return u.createElement(ff,{ref:t,...a,component:"div"},o)}),n7=u.forwardRef((e,t)=>{const{ellipsis:o,children:a,...l}=e,c=u.useMemo(()=>o&&typeof o=="object"?Lr(o,["expandable","rows"]):o,[o]);return u.createElement(ff,{ref:t,...l,ellipsis:c,component:"span"},a)}),r7=[1,2,3,4,5],o7=u.forwardRef((e,t)=>{const{level:o=1,children:a,...l}=e,c=r7.includes(o)?`h${o}`:"h1";return u.createElement(ff,{ref:t,...l,component:c},a)}),Sn=M$;Sn.Text=n7;Sn.Link=e7;Sn.Title=o7;Sn.Paragraph=t7;var a7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Gp.apply(this,arguments)}const i7=(e,t)=>u.createElement(Dt,Gp({},e,{ref:t,icon:a7})),l7=u.forwardRef(i7);var s7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{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 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"};function Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Xp.apply(this,arguments)}const c7=(e,t)=>u.createElement(Dt,Xp({},e,{ref:t,icon:s7})),u7=u.forwardRef(c7);var f7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Wp.apply(this,arguments)}const d7=(e,t)=>u.createElement(Dt,Wp({},e,{ref:t,icon:f7})),m7=u.forwardRef(d7);var g7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 10-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"}}]},name:"linkedin",theme:"outlined"};function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Yp.apply(this,arguments)}const p7=(e,t)=>u.createElement(Dt,Yp({},e,{ref:t,icon:g7})),h7=u.forwardRef(p7);var y7={icon:{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 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"};function Kp(){return Kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Kp.apply(this,arguments)}const b7=(e,t)=>u.createElement(Dt,Kp({},e,{ref:t,icon:y7})),v7=u.forwardRef(b7);var S7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function kp(){return kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},kp.apply(this,arguments)}const C7=(e,t)=>u.createElement(Dt,kp({},e,{ref:t,icon:S7})),x7=u.forwardRef(C7);var E7={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"};function Qp(){return Qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Qp.apply(this,arguments)}const $7=(e,t)=>u.createElement(Dt,Qp({},e,{ref:t,icon:E7})),w7=u.forwardRef($7);var T7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0075-94 336.64 336.64 0 01-108.2 41.2A170.1 170.1 0 00672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 00-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 01-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 01-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"}}]},name:"twitter",theme:"outlined"};function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},Zp.apply(this,arguments)}const M7=(e,t)=>u.createElement(Dt,Zp({},e,{ref:t,icon:T7})),gC=u.forwardRef(M7);async function Zh(e){const t=await fetch(e);if(!t.ok){let o=`Request failed with status ${t.status}`;try{const a=await t.json();typeof a.error=="string"&&a.error.length>0&&(o=a.error)}catch{}throw new Error(o)}return t.json()}function R7(){return Zh("/api/bootstrap")}function N7(){return Zh("/api/articles")}function z7(e){return Zh(`/api/articles/${encodeURIComponent(e)}`)}const pC=["article","blog-post","x-thread","x-post","linkedin-post","reddit-post","newsletter"],hC=["shared-plan","planning","sections","image-prompts","images","output","links"];function R$(e){return e.reduce((t,o)=>{const a=o.contentType||"article",l=t[a]??[];return l.push(o),l.sort((c,f)=>c.index-f.index),t[a]=l,t},{})}function N$(e){return[...e].sort((t,o)=>{const a=pC.indexOf(t),l=pC.indexOf(o),c=a===-1?Number.MAX_SAFE_INTEGER:a,f=l===-1?Number.MAX_SAFE_INTEGER:l;return c!==f?c-f:t.localeCompare(o)})}function z$(e){const t=Array.isArray(e?.llmCalls)?e.llmCalls:[],o=Array.isArray(e?.t2iCalls)?e.t2iCalls:[],a=t.map((c,f)=>({id:`llm-${f}`,source:"llm",stageId:String(c.stageId||"unknown"),operationId:String(c.operationId||""),status:String(c.status||""),requestType:String(c.requestType||""),provider:String(c.provider||""),modelId:String(c.modelId||""),durationMs:Number(c.durationMs||0),raw:c})),l=o.map((c,f)=>({id:`t2i-${f}`,source:"t2i",stageId:String(c.stageId||"images"),operationId:String(c.operationId||""),status:String(c.status||""),requestType:"t2i",provider:String(c.provider||""),modelId:String(c.modelId||""),durationMs:Number(c.durationMs||0),raw:c}));return a.concat(l).sort((c,f)=>{const m=new Date(yC(c.raw)).getTime(),h=new Date(yC(f.raw)).getTime();return m!==h?m-h:c.id.localeCompare(f.id)})}function O7(e){const t=e.reduce((o,a)=>{const l=o[a.stageId]??[];return l.push(a),o[a.stageId]=l,o},{});return Object.keys(t).sort((o,a)=>{const l=hC.indexOf(o),c=hC.indexOf(a),f=l===-1?Number.MAX_SAFE_INTEGER:l,m=c===-1?Number.MAX_SAFE_INTEGER:c;return f!==m?f-m:o.localeCompare(a)}).map(o=>({stageId:o,items:t[o]??[]}))}function A7(e){if(e.source==="t2i"){const f=e.raw;return{promptText:String(f.prompt||""),responseText:f.errorMessage?`Error: ${f.errorMessage}`:"Image request completed. Inspect Full JSON for the resolved input payload."}}const t=e.raw,o=bC(t.requestBody),a=bC(t.responseBody),l=Array.isArray(o?.messages)?o.messages.map(f=>`[${String(f.role||"unknown")}]
215
215
  ${String(f.content||"")}`).join(`
216
216
 
217
217
  ---
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" type="image/svg+xml" href="./app-assets/favicon-ZM13UXfJ.svg" />
7
7
  <title>Ideon Preview</title>
8
- <script type="module" crossorigin src="./app-assets/index-D3k0cA_1.js"></script>
8
+ <script type="module" crossorigin src="./app-assets/index-C9aRaijU.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./app-assets/index-IigmpN5C.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telepat/ideon",
3
- "version": "0.1.20",
3
+ "version": "0.1.24",
4
4
  "description": "CLI for generating rich articles and images from ideas.",
5
5
  "type": "module",
6
6
  "repository": {