(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,271596,e=>{"use strict";var t=e.i(16043);let n=t.forwardRef(function({title:e,titleId:n,...s},r){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},s),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))});e.s(["f",0,n],271596)},227049,e=>{"use strict";var t=e.i(16043);let n=t.forwardRef(function({title:e,titleId:n,...s},r){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},s),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"}))});e.s(["f",0,n],227049)},250141,e=>{"use strict";var t=e.i(663456),n=e.i(674896),s=e.i(205194),r=e.i(16043),l=e.i(215370),a=e.i(426431);function i(e){return e.setWorkspacePartition}e.s(["f",0,function(){let e,o,c=(0,t.c)(6),d=(0,l.f)(),u=(0,a.B)(i),m=(0,s.f)();c[0]!==d.isReady||c[1]!==d.partitionId||c[2]!==m||c[3]!==u?(e=()=>{if(!d.isReady)return;let{didResolveWorkspacePartition:e,workspacePartitionId:t}=a.B.getState(),s=e&&t!==d.partitionId;u(d.partitionId),s&&window.location.pathname.includes("/fusion/")&&m.replace((0,n.P)(window.location.pathname,n.L.Fusion))},o=[d.isReady,d.partitionId,u,m],c[0]=d.isReady,c[1]=d.partitionId,c[2]=m,c[3]=u,c[4]=e,c[5]=o):(e=c[4],o=c[5]),(0,r.useEffect)(e,o)}])},411349,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(435754),r=e.i(359903),l=e.i(512157),a=e.i(338749),i=e.i(657288),o=e.i(16043);let c=o.forwardRef(function({title:e,titleId:t,...n},s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971Z"}))});var d=e.i(134611),u=e.i(136562),m=e.i(233452),h=e.i(894868),x=e.i(261499),f=e.i(262646),p=e.i(797521);e.i(707060);var g=e.i(387086),j=e.i(196991),b=e.i(919035),y=e.i(426431),v=e.i(925204),N=e.i(866969),w=e.i(288265);function k(e){let s,r,l,a,i,c,d,m,x,p,g,b,y=(0,n.c)(26),{models:v,className:k}=e,S=(0,w.f)(),[C,T]=(0,o.useState)(0);if(y[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{T(_)},y[0]=s):s=y[0],(0,N.f)(s,1e3),y[1]!==C||y[2]!==S||y[3]!==v.length){var B,z;l=Math.min(Math.floor(C/4),(r=[(B=S,0===(z=v.length)?B("Reading every model response"):B(1===z?"Reading {count} model response":"Reading {count} model responses",{count:z})),S("Comparing answers side by side"),S("Finding where the models agree"),S("Spotting contradictions and trade-offs"),S("Surfacing unique insights and blind spots"),S("Writing up the analysis")]).length-1),y[1]=C,y[2]=S,y[3]=v.length,y[4]=r,y[5]=l}else r=y[4],l=y[5];let R=l,M=r[R]??r[0],L=0===R&&v.length>0?C%v.length:-1;if(y[6]!==k?(a=(0,u.f)("flex flex-col gap-3",k),y[6]=k,y[7]=a):a=y[7],y[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(f.f,{decorative:!0,tone:"muted",className:"h-4 w-4 shrink-0"}),y[8]=i):i=y[8],y[9]!==M?(c=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:M}),y[9]=M,y[10]=c):c=y[10],y[11]!==C){let e,t;e=Math.floor(C/60),t=Math.floor(C%60),d=`${e}:${t.toString().padStart(2,"0")}`,y[11]=C,y[12]=d}else d=y[12];return y[13]!==d?(m=(0,t.jsx)("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground",children:d}),y[13]=d,y[14]=m):m=y[14],y[15]!==c||y[16]!==m?(x=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[i,c,m]}),y[15]=c,y[16]=m,y[17]=x):x=y[17],y[18]!==L||y[19]!==v?(p=v.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:v.map((e,n)=>(0,t.jsxs)("span",{className:(0,u.f)("inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs transition-colors",n===L?"border-border bg-muted text-foreground":"border-border/60 text-muted-foreground"),children:[(0,t.jsx)(h.f,{author:e.author,permaslug:e.permaslug,className:"!size-3.5 shrink-0 !border-0 !p-0"}),e.name]},`${e.author}-${e.name}`))}),y[18]=L,y[19]=v,y[20]=p):p=y[20],y[21]===Symbol.for("react.memo_cache_sentinel")?(g=(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:(0,t.jsx)(j.T,{children:"We’re gathering and comparing every response, which can take up to a minute. The full analysis will appear once done."})}),y[21]=g):g=y[21],y[22]!==a||y[23]!==x||y[24]!==p?(b=(0,t.jsxs)("div",{role:"status","aria-live":"polite",className:a,children:[x,p,g]}),y[22]=a,y[23]=x,y[24]=p,y[25]=b):b=y[25],b}function _(e){return e+1}let S=[{key:"consensus",label:(0,g.b)("Agreement"),icon:s.f,color:"text-muted-foreground"},{key:"contradictions",label:(0,g.b)("Key Differences"),icon:c,color:"text-muted-foreground"},{key:"partial_coverage",label:(0,g.b)("Partial Coverage"),icon:i.f,color:"text-muted-foreground"},{key:"unique_insights",label:(0,g.b)("Unique Insights"),icon:a.f,color:"text-muted-foreground"},{key:"blind_spots",label:(0,g.b)("Blind Spots"),icon:l.f,color:"text-muted-foreground"}];function C(e){let s,r,l=(0,n.c)(4),{items:a}=e;return l[0]!==a?(s=a.map(T),l[0]=a,l[1]=s):s=l[1],l[2]!==s?(r=(0,t.jsx)("ul",{className:"pl-5",children:s}),l[2]=s,l[3]=r):r=l[3],r}function T(e){return(0,t.jsx)("li",{className:"mt-1.5 first:mt-0 text-sm text-foreground/85 leading-relaxed list-disc marker:text-muted-foreground/40",children:e},e)}function B(e){let s,r,l=(0,n.c)(5),{modelName:a,identity:i}=e;return l[0]!==i?(s=i&&(0,t.jsx)(h.f,{author:i.author,permaslug:i.permaslug,className:"!size-3.5 !border-0 !p-0 shrink-0"}),l[0]=i,l[1]=s):s=l[1],l[2]!==a||l[3]!==s?(r=(0,t.jsxs)(m.Badge,{size:"sm",variant:"muted",className:"shrink-0 bg-muted",children:[s,a]}),l[2]=a,l[3]=s,l[4]=r):r=l[4],r}function z(e){let s,r,l=(0,n.c)(7),{items:a,authorMap:i}=e;if(l[0]!==i||l[1]!==a){let e;l[3]!==i?(e=e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground/90 mb-1",children:e.topic}),(0,t.jsx)("div",{className:"flex flex-col gap-y-1 pl-3 border-l-2 border-border",children:e.stances.map(e=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2 text-sm",children:[(0,t.jsx)(B,{modelName:e.model,identity:i.get(e.model)}),(0,t.jsx)("span",{className:"text-foreground/75",children:e.stance})]},`${e.model}-${e.stance}`))})]},e.topic),l[3]=i,l[4]=e):e=l[4],s=a.map(e),l[0]=i,l[1]=a,l[2]=s}else s=l[2];return l[5]!==s?(r=(0,t.jsx)("div",{className:"flex flex-col gap-y-3",children:s}),l[5]=s,l[6]=r):r=l[6],r}function R(e){let s,r,l=(0,n.c)(7),{items:a,authorMap:i}=e;if(l[0]!==i||l[1]!==a){let e;l[3]!==i?(e=e=>(0,t.jsxs)("li",{className:"mt-1.5 first:mt-0 text-sm text-foreground/85 leading-relaxed list-disc marker:text-muted-foreground/40",children:[e.point,e.models.length>0&&(0,t.jsx)("span",{className:"inline-flex gap-1 ml-1.5 align-middle",children:e.models.map(e=>(0,t.jsx)(B,{modelName:e,identity:i.get(e)},e))})]},e.point),l[3]=i,l[4]=e):e=l[4],s=a.map(e),l[0]=i,l[1]=a,l[2]=s}else s=l[2];return l[5]!==s?(r=(0,t.jsx)("ul",{className:"pl-5",children:s}),l[5]=s,l[6]=r):r=l[6],r}function M(e){let s,r,l=(0,n.c)(7),{items:a,authorMap:i}=e;if(l[0]!==i||l[1]!==a){let e;l[3]!==i?(e=e=>(0,t.jsxs)("li",{className:"mt-1.5 first:mt-0 text-sm text-foreground/85 leading-relaxed list-disc marker:text-muted-foreground/40",children:[e.insight,(0,t.jsx)("span",{className:"inline-flex ml-1.5 align-middle",children:(0,t.jsx)(B,{modelName:e.model,identity:i.get(e.model)})})]},`${e.model}-${e.insight}`),l[3]=i,l[4]=e):e=l[4],s=a.map(e),l[0]=i,l[1]=a,l[2]=s}else s=l[2];return l[5]!==s?(r=(0,t.jsx)("ul",{className:"pl-5",children:s}),l[5]=s,l[6]=r):r=l[6],r}function L(e){let s,r,l=(0,n.c)(4),{items:a}=e;return l[0]!==a?(s=a.map(A),l[0]=a,l[1]=s):s=l[1],l[2]!==s?(r=(0,t.jsx)("ul",{className:"pl-5",children:s}),l[2]=s,l[3]=r):r=l[3],r}function A(e){return(0,t.jsx)("li",{className:"mt-1.5 first:mt-0 text-sm text-foreground/85 leading-relaxed list-disc marker:text-muted-foreground/40",children:e},e)}function I(e){let s=(0,n.c)(13),{analysis:r,dimensionKey:l,authorMap:a}=e;switch(l){case"consensus":{let e;return s[0]!==r.consensus?(e=(0,t.jsx)(C,{items:r.consensus}),s[0]=r.consensus,s[1]=e):e=s[1],e}case"contradictions":{let e;return s[2]!==r.contradictions||s[3]!==a?(e=(0,t.jsx)(z,{items:r.contradictions,authorMap:a}),s[2]=r.contradictions,s[3]=a,s[4]=e):e=s[4],e}case"partial_coverage":{let e;return s[5]!==r.partial_coverage||s[6]!==a?(e=(0,t.jsx)(R,{items:r.partial_coverage,authorMap:a}),s[5]=r.partial_coverage,s[6]=a,s[7]=e):e=s[7],e}case"unique_insights":{let e;return s[8]!==r.unique_insights||s[9]!==a?(e=(0,t.jsx)(M,{items:r.unique_insights,authorMap:a}),s[8]=r.unique_insights,s[9]=a,s[10]=e):e=s[10],e}case"blind_spots":{let e;return s[11]!==r.blind_spots?(e=(0,t.jsx)(L,{items:r.blind_spots}),s[11]=r.blind_spots,s[12]=e):e=s[12],e}default:return null}}function $(e){let s,l,a,i,c,d,m,h,f,g,j,y,v,N,w,k,_=(0,n.c)(46),{config:S,analysis:C,authorMap:T}=e,B=(0,b.f)(),z=(0,p.f)(),[R,M]=(0,o.useState)(!1);_[0]!==C||_[1]!==S.key?(s=function(e,t){switch(t){case"consensus":return e.consensus.length;case"contradictions":return e.contradictions.length;case"partial_coverage":return e.partial_coverage.length;case"unique_insights":return e.unique_insights.length;case"blind_spots":return e.blind_spots.length;default:return 0}}(C,S.key),_[0]=C,_[1]=S.key,_[2]=s):s=_[2];let L=s;if(0===L)return null;if(_[3]!==C||_[4]!==S.key||_[5]!==z.list){let e=function(e,{key:t,list:n}){switch(t){case"consensus":return e.consensus[0]??"";case"contradictions":return n(e.contradictions.map(e=>e.topic));case"partial_coverage":return n(e.partial_coverage.map(e=>e.point));case"unique_insights":return n(e.unique_insights.map(e=>e.insight));case"blind_spots":return e.blind_spots[0]??"";default:return""}}(C,{key:S.key,list:z.list});l=e.length>120?`${e.slice(0,120)}…`:e,_[3]=C,_[4]=S.key,_[5]=z.list,_[6]=l}else l=_[6];let A=l,$=S.icon,P=R?"border-border bg-background":"border-border bg-background hover:bg-muted/50";_[7]!==P?(a=(0,u.f)("rounded-lg border transition-colors",P),_[7]=P,_[8]=a):a=_[8],_[9]===Symbol.for("react.memo_cache_sentinel")?(i=()=>M(E),_[9]=i):i=_[9],_[10]!==S.color?(c=(0,u.f)("h-4 w-4 shrink-0",S.color),_[10]=S.color,_[11]=c):c=_[11],_[12]!==$||_[13]!==c?(d=(0,t.jsx)($,{className:c}),_[12]=$,_[13]=c,_[14]=d):d=_[14],_[15]!==S.label||_[16]!==B?(m=B(S.label),_[15]=S.label,_[16]=B,_[17]=m):m=_[17],_[18]!==m?(h=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground flex-1 truncate",children:m}),_[18]=m,_[19]=h):h=_[19],_[20]!==L?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:L}),_[20]=L,_[21]=f):f=_[21];let D=R&&"-scale-y-100";return _[22]!==D?(g=(0,u.f)("h-3.5 w-3.5 text-muted-foreground shrink-0",x.a,D),_[22]=D,_[23]=g):g=_[23],_[24]!==g?(j=(0,t.jsx)(r.f,{className:g}),_[24]=g,_[25]=j):j=_[25],_[26]!==f||_[27]!==j||_[28]!==d||_[29]!==h?(y=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[d,h,f,j]}),_[26]=f,_[27]=j,_[28]=d,_[29]=h,_[30]=y):y=_[30],_[31]!==R||_[32]!==A?(v=!R&&A&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1.5 line-clamp-2 leading-relaxed pl-7",children:A}),_[31]=R,_[32]=A,_[33]=v):v=_[33],_[34]!==y||_[35]!==v?(N=(0,t.jsxs)("button",{type:"button",onClick:i,className:"w-full text-left px-4 py-3",children:[y,v]}),_[34]=y,_[35]=v,_[36]=N):N=_[36],_[37]!==C||_[38]!==T||_[39]!==S.key||_[40]!==R?(w=R&&(0,t.jsx)("div",{className:"px-4 pb-3",children:(0,t.jsx)(I,{analysis:C,dimensionKey:S.key,authorMap:T})}),_[37]=C,_[38]=T,_[39]=S.key,_[40]=R,_[41]=w):w=_[41],_[42]!==N||_[43]!==w||_[44]!==a?(k=(0,t.jsxs)("div",{className:a,children:[N,w]}),_[42]=N,_[43]=w,_[44]=a,_[45]=k):k=_[45],k}function E(e){return!e}function P(e){let s,r,l,a,i=(0,n.c)(10),{isAnalyzing:o}=e,c=(0,y.B)(F),u=(0,v.e)(c),m=(0,y.B)(D);if(i[0]!==m){for(let e of(s=new Map,m)){let t={author:e.author,permaslug:e.permaslug};s.set(e.short_name,t),s.set((0,d.i)(e),t)}i[0]=m,i[1]=s}else s=i[1];let h=s;return u&&(u.consensus.length>0||u.contradictions.length>0||u.partial_coverage.length>0||u.unique_insights.length>0||u.blind_spots.length>0)?(i[2]!==u||i[3]!==h?(r=S.map(e=>(0,t.jsx)($,{config:e,analysis:u,authorMap:h},e.key)),i[2]=u,i[3]=h,i[4]=r):r=i[4],i[5]!==o?(l=o&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground py-2 px-4",children:[(0,t.jsx)(f.f,{decorative:!0,className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-xs",children:(0,t.jsx)(j.T,{children:"Loading more sections..."})})]}),i[5]=o,i[6]=l):l=i[6],i[7]!==r||i[8]!==l?(a=(0,t.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,l]}),i[7]=r,i[8]=l,i[9]=a):a=i[9],a):null}function D(e){return e.selectedModels}function F(e){return e.currentRunDbId}function O(){let e,s,r,l=(0,n.c)(9),a=(0,y.B)(H),i=(0,y.B)(W);l[0]!==a?(e=e=>(0,v.A)(e,a),l[0]=a,l[1]=e):e=l[1];let o=(0,v.H)(e);if(l[2]!==o||l[3]!==i){let e;l[5]!==o?(e=e=>{let t=o[(0,d.i)(e)];return void 0!==t&&!t.isLoading&&!t.error},l[5]=o,l[6]=e):e=l[6],s=i.filter(e).map(q),l[2]=o,l[3]=i,l[4]=s}else s=l[4];let c=s;return l[7]!==c?(r=(0,t.jsx)(k,{models:c}),l[7]=c,l[8]=r):r=l[8],r}function q(e){return{name:e.short_name,author:e.author,permaslug:e.permaslug}}function W(e){return e.selectedModels}function H(e){return e.currentRunDbId}function K(e){return e.currentRunDbId}function V(e){return e.isAnalyzing}e.s(["C",0,function(){let e,s,r,l,a=(0,n.c)(10),i=(0,y.B)(V),o=(0,y.B)(K);a[0]!==o?(e=e=>null!==(0,v.P)(e,o),a[0]=o,a[1]=e):e=a[1];let c=(0,v.H)(e);return a[2]!==c||a[3]!==i?(s=i&&!c&&(0,t.jsx)(O,{}),a[2]=c,a[3]=i,a[4]=s):s=a[4],a[5]!==i?(r=(0,t.jsx)(P,{isAnalyzing:i}),a[5]=i,a[6]=r):r=a[6],a[7]!==s||a[8]!==r?(l=(0,t.jsxs)("div",{className:"ph-no-capture","data-dd-privacy":"hidden",children:[s,r]}),a[7]=s,a[8]=r,a[9]=l):l=a[9],l},"i",0,S,"Q",0,$],411349)},895394,214872,539313,894686,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(16043);let r=s.forwardRef(function({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))});var l=e.i(139697),a=e.i(624112),i=e.i(554395),o=e.i(751155);e.i(707060);var c=e.i(196991),d=e.i(288265),u=e.i(679728);e.s(["f",0,function(){let e,m,h,x,f,p,g,j,b,y=(0,n.c)(20),v=(0,d.f)(),[N,w]=(0,s.useState)(""),[k,_]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),T=(0,s.useRef)(void 0);if(y[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>()=>clearTimeout(T.current),m=[],y[0]=e,y[1]=m):(e=y[0],m=y[1]),(0,s.useEffect)(e,m),!u.U)return null;y[2]===Symbol.for("react.memo_cache_sentinel")?(h=e=>{clearTimeout(T.current),_(e),e||C(!1)},y[2]=h):h=y[2];let B=h;y[3]!==N?(x=()=>{let e=N.trim();e&&((0,u.f)(e),w(""),C(!0),T.current=setTimeout(()=>{_(!1),C(!1)},1500))},y[3]=N,y[4]=x):x=y[4];let z=x;return y[5]!==v||y[6]!==k?(f=k?void 0:v("Send feedback"),y[5]=v,y[6]=k,y[7]=f):f=y[7],y[8]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(a.J,{render:(0,t.jsx)(l.Button,{variant:"ghost",tone:"subdued",size:"icon",className:"rounded-lg bg-muted/80 [&_svg]:size-5",children:(0,t.jsx)(r,{className:"h-5 w-5"})})}),y[8]=p):p=y[8],y[9]!==f?(g=(0,t.jsx)(o.Tooltip,{content:f,children:p}),y[9]=f,y[10]=g):g=y[10],y[11]!==S||y[12]!==N||y[13]!==v||y[14]!==z?(j=(0,t.jsx)(a.T,{side:"top",align:"end",className:"w-80 p-3",children:S?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-2",children:(0,t.jsx)(c.T,{children:"Thanks for your feedback!"})}):(0,t.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:(0,t.jsx)(c.T,{children:"What can we do to improve Model Fusion?"})}),(0,t.jsx)(i.o,{value:N,onChange:e=>w(e.target.value),placeholder:v("Share bugs, ideas, or general feedback"),className:"min-h-20 text-sm resize-none",maxLength:2e3}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(l.Button,{size:"sm",onClick:z,disabled:!N.trim(),children:(0,t.jsx)(c.T,{children:"Submit"})})})]})}),y[11]=S,y[12]=N,y[13]=v,y[14]=z,y[15]=j):j=y[15],y[16]!==k||y[17]!==g||y[18]!==j?(b=(0,t.jsxs)(a.V,{open:k,onOpenChange:B,children:[g,j]}),y[16]=k,y[17]=g,y[18]=j,y[19]=b):b=y[19],b}],895394);var m=e.i(510433),h=e.i(361694),x=e.i(231171),f=e.i(829104),p=e.i(673897),g=e.i(136562),j=e.i(6146),b=e.i(670168);function y(e){let s,r,l,a,i,o,c=(0,n.c)(12),{variant:u}=e,m=(0,d.f)(),h=(0,j.B)();return c[0]!==m?(s=m("Loading Fusion"),c[0]=m,c[1]=s):s=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,g.f)("fixed inset-x-0 bottom-0 top-[calc(var(--navbar-top,0px)+var(--navbar-height))] flex flex-col md:flex-row","w-full text-foreground","overflow-hidden","bg-background","border-t border-border"),c[2]=r):r=c[2],c[3]!==h?(l=!h&&(0,t.jsx)("div",{className:"h-full min-h-0 hidden md:block",children:(0,t.jsx)(v,{})}),c[3]=h,c[4]=l):l=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,g.f)("flex flex-1 flex-col min-w-0","min-h-0 h-full overflow-hidden"),c[5]=a):a=c[5],c[6]!==u?(i=(0,t.jsx)("div",{className:a,children:"composer"===u?(0,t.jsx)(N,{}):(0,t.jsx)(w,{})}),c[6]=u,c[7]=i):i=c[7],c[8]!==s||c[9]!==l||c[10]!==i?(o=(0,t.jsxs)("div",{role:"status","aria-label":s,"data-workspace-surface-shell":"",className:r,children:[l,i]}),c[8]=s,c[9]=l,c[10]=i,c[11]=o):o=c[11],o}function v(){let e,s,r,l,a,i=(0,n.c)(5);return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,g.f)("flex h-full w-65 shrink-0 flex-col gap-2","bg-background border-r border-border","p-2"),i[0]=e):e=i[0],i[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,t.jsx)(b.l,{className:"h-5 w-16"}),(0,t.jsx)(b.l,{className:"size-7 rounded-md"})]}),r=(0,t.jsx)(b.l,{className:"h-8 w-full rounded-md"}),l=(0,t.jsx)(b.l,{className:"h-8 w-full rounded-md"}),i[1]=s,i[2]=r,i[3]=l):(s=i[1],r=i[2],l=i[3]),i[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsxs)("div",{className:e,children:[s,r,l,(0,t.jsx)("div",{className:"shrink-0 -mx-2 py-4",children:(0,t.jsx)("div",{className:"h-px bg-border"})}),(0,t.jsx)(b.l,{className:"ml-3 h-3 w-12"}),(0,t.jsx)(b.A,{className:"mt-1",count:8,skeletonClassName:"h-8 w-full"})]}),i[4]=a):a=i[4],a}function N(){let e,s,r,l=(0,n.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(b.l,{className:"h-7 w-64"}),s=(0,t.jsx)(b.l,{className:"h-36 w-full rounded-xl"}),l[0]=e,l[1]=s):(e=l[0],s=l[1]),l[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"w-full max-w-3xl mx-auto px-4 py-8 flex flex-col gap-4",children:[e,s,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.l,{className:"h-8 w-32 rounded-md"}),(0,t.jsx)(b.l,{className:"h-8 w-24 rounded-md"}),(0,t.jsx)(b.l,{className:"ml-auto size-8 rounded-full"})]})]})}),l[2]=r):r=l[2],r}function w(){let e,s,r,l=(0,n.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.l,{className:"h-4 w-24"}),(0,t.jsx)(b.l,{className:"h-4 w-16"})]}),(0,t.jsx)(b.l,{className:"h-3 w-full"}),(0,t.jsx)(b.l,{className:"h-3 w-2/3"})]}),l[0]=e):e=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)(k,{children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(b.l,{className:"h-8 w-28 rounded-md"}),(0,t.jsx)(b.l,{className:"h-8 w-28 rounded-md"}),(0,t.jsx)(b.l,{className:"h-8 w-28 rounded-md"})]}),(0,t.jsx)(_,{})]}),l[1]=s):s=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsxs)("div",{className:"w-full max-w-3xl mx-auto px-4 pt-8 pb-12 flex flex-col gap-y-6",children:[e,s,(0,t.jsx)(k,{children:(0,t.jsx)(_,{})})]}),l[2]=r):r=l[2],r}function k(e){let s,r,l=(0,n.c)(3),{children:a}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.l,{className:"h-4 w-20"}),(0,t.jsx)(b.l,{className:"h-3 w-8"})]}),l[0]=s):s=l[0],l[1]!==a?(r=(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[s,a]}),l[1]=a,l[2]=r):r=l[2],r}function _(){let e,s=(0,n.c)(1);return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(b.l,{className:"h-3 w-full"}),(0,t.jsx)(b.l,{className:"h-3 w-full"}),(0,t.jsx)(b.l,{className:"h-3 w-full"}),(0,t.jsx)(b.l,{className:"h-3 w-1/2"})]}),s[0]=e):e=s[0],e}e.s(["D",0,y,"v",0,function(){let e,s,r,l=(0,n.c)(5),a=(0,d.f)();return l[0]!==a?(e=a("Loading run"),l[0]=a,l[1]=e):e=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(w,{}),l[2]=s):s=l[2],l[3]!==e?(r=(0,t.jsx)("div",{role:"status","aria-label":e,children:s}),l[3]=e,l[4]=r):r=l[4],r}],214872);let S={fusion:"composer","fusion-run":"run"};function C(e){let s,r=(0,n.c)(2),{children:l}=e;return r[0]!==l?(s=(0,t.jsx)("div",{className:"flex h-[calc(100dvh-var(--navbar-height))] w-full items-center justify-center border-t border-border bg-background text-foreground",children:l}),r[0]=l,r[1]=s):s=r[1],s}e.s(["A",0,function(e){let s,r=(0,n.c)(5),{surface:l,noWorkspaceGate:a,fusionCapabilityGate:i,isPartitionCurrent:o}=e,c=S[l];r[0]!==c?(s=(0,t.jsx)(y,{variant:c}),r[0]=c,r[1]=s):s=r[1];let d=s;if(!o)return d;if(a===f.u.Blocked){let e;return r[2]!==l?(e=(0,t.jsx)(C,{children:(0,t.jsx)(h.f,{surface:l})}),r[2]=l,r[3]=e):e=r[3],e}if(i===x.L.Blocked){let e;return r[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(C,{children:(0,t.jsx)(p.WorkspaceCapabilityUnavailableState,{capability:m.J.Fusion})}),r[4]=e):e=r[4],e}return d},"B",0,function({noWorkspaceGate:e,fusionCapabilityGate:t,isPartitionCurrent:n}){return e===f.u.Allowed&&t===x.L.Allowed&&n}],539313);var T=e.i(795647),B=e.i(674896),z=e.i(205194),R=e.i(463686),M=e.i(524268),L=e.i(426431),A=e.i(677453);function I(e){return e.prompt}function $(e){return e.resetWorkspace}e.s(["f",0,function(){let e,r,l,a,i,o,u,m,h,x,f,p,j,b,y=(0,n.c)(34),v=(0,d.f)(),[N,w]=(0,s.useState)(!1),k=(0,L.B)($),_=(0,L.B)(I),S=(0,z.f)(),C=(0,B.W)(B.L.Fusion),E=(0,R.useParams)(),P=E?.runId,D=(0,s.useRef)(P);y[0]!==P?(e=()=>{P!==D.current&&(D.current=P,w(!1))},r=[P],y[0]=P,y[1]=e,y[2]=r):(e=y[1],r=y[2]),(0,s.useEffect)(e,r),y[3]!==C||y[4]!==k||y[5]!==S?(l=()=>{k(),S.push(C)},y[3]=C,y[4]=k,y[5]=S,y[6]=l):l=y[6];let F=l;y[7]!==_?(a=_.trim(),y[7]=_,y[8]=a):a=y[8];let O=a;y[9]!==v?(i=v("Runs"),y[9]=v,y[10]=i):i=y[10],y[11]!==v?(o=v("Open runs"),y[11]=v,y[12]=o):o=y[12],y[13]!==v?(u=v("New fusion"),y[13]=v,y[14]=u):u=y[14],y[15]!==F||y[16]!==u?(m={label:u,icon:T.f,onClick:F},y[15]=F,y[16]=u,y[17]=m):m=y[17],y[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(A.f,{}),y[18]=h):h=y[18],y[19]!==N||y[20]!==i||y[21]!==o||y[22]!==m?(x=(0,t.jsx)(M.f,{title:i,triggerAriaLabel:o,isOpen:N,onOpenChange:w,newAction:m,children:h}),y[19]=N,y[20]=i,y[21]=o,y[22]=m,y[23]=x):x=y[23];let q=!O&&"italic text-faint";return y[24]!==q?(f=(0,g.f)("ph-no-capture truncate text-sm font-medium text-foreground",q),y[24]=q,y[25]=f):f=y[25],y[26]!==O?(p=O||(0,t.jsx)(c.T,{children:"New fusion"}),y[26]=O,y[27]=p):p=y[27],y[28]!==f||y[29]!==p?(j=(0,t.jsx)("span",{className:f,"data-dd-privacy":"hidden",children:p}),y[28]=f,y[29]=p,y[30]=j):j=y[30],y[31]!==j||y[32]!==x?(b=(0,t.jsxs)("div",{className:"md:hidden flex items-center gap-1 px-2 py-2 border-b bg-background shrink-0",children:[x,j]}),y[31]=j,y[32]=x,y[33]=b):b=y[33],b}],894686)},547670,816443,791092,665996,397847,596807,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(572677),r=e.i(382526),l=e.i(16043);let a=l.forwardRef(function({title:e,titleId:t,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))});var i=e.i(485741),o=e.i(510433),c=e.i(139697),d=e.i(80676),u=e.i(978242),m=e.i(236614),h=e.i(231171),x=e.i(674896),f=e.i(205194);e.i(707060);var p=e.i(196991),g=e.i(288265),j=e.i(447131);e.i(818009);var b=e.i(982432),y=e.i(761821),v=e.i(647204),N=e.i(67089),w=e.i(295654),k=e.i(447680),_=e.i(227327),S=e.i(911585),C=e.i(22422),T=e.i(624621),B=e.i(735961),z=e.i(907781),R=e.i(978567),M=e.i(155771),L=e.i(426431),A=e.i(925204);async function I(e,{router:t,getModelInfoByVariantSlug:n,storageInstanceId:s,chatPath:r}){var l;let a,i,o=(i=[{role:"user",content:e.prompt},{role:"user",content:(l=e.responses,a=Object.entries(l).filter(([,e])=>e.content.trim().length>0&&!e.error).map(([e,t])=>{let s=n(e),r=s?.short_name??e;return`### ${r} ${t.content}`}),`## Model Responses ${a.join("\n\n")}`)}],e.analysisContent&&i.push({role:"user",content:function(e){let t=[];if(e.consensus.length>0&&t.push(`### Agreement ${e.consensus.map(e=>`- ${e}`).join("\n")}`),e.contradictions.length>0){let n=e.contradictions.map(e=>{let t=e.stances.map(e=>` - ${e.model}: ${e.stance}`).join("\n");return`- ${e.topic} ${t}`});t.push(`### Key Differences ${n.join("\n")}`)}if(e.partial_coverage.length>0){let n=e.partial_coverage.map(e=>`- ${e.point} (raised by: ${e.models.join(", ")})`);t.push(`### Partial Coverage ${n.join("\n")}`)}if(e.unique_insights.length>0){let n=e.unique_insights.map(e=>`- ${e.insight} (from: ${e.model})`);t.push(`### Unique Insights ${n.join("\n")}`)}return e.blind_spots.length>0&&t.push(`### Blind Spots ${e.blind_spots.map(e=>`- ${e}`).join("\n")}`),`## Analysis ${t.join("\n\n")}`}(e.analysisContent)}),i.push({role:"assistant",content:e.synthesisContent}),i),c=(0,_.f)({getModelInfoByVariantSlug:n,variantSlugs:[e.synthesizerSlug]});await C.z.initStore({payload:{storageInstanceId:s}});let d=(0,S.f)(e.prompt),u=await C.z.createChatroom({payload:{title:d,characters:c}}),m=Object.keys(u.characters).find(e=>!(0,w.P)(e))??null;if(!m)return void t.push(`${r}?room=${u.id}`);let{messages:h,items:x,systemPrompt:f}=(0,R.f)(o,m);f&&await C.z.updateCharacter({payload:{roomId:u.id,characterId:m,partialCharacter:{description:f,includeDefaultSystemPrompt:!1}}}),await C.z.addMessages({payload:{roomId:u.id,messages:h}}),B.useItemStore.getState().actions.loadItems(x);let p=T.f.getState().storageInstanceId;p&&await k.f.saveItems(p,u.id,Object.values(x)),t.push(`${r}?room=${u.id}`)}function $(e){return e.resetWorkspace}function E(e){return e.phase}e.s(["f",0,function(){let e,w,k,_,S,C,T,B,R,P,D,F,O,q,W,H,K,V,Z,J,U,G,Q,Y,X,ee=(0,n.c)(55),et=(0,g.f)(),en=(0,L.B)(E),es=(0,L.B)($),er=(0,f.f)(),el=(0,x.W)(x.L.Fusion),ea=function(){let e,t,s=(0,n.c)(8),r=(0,f.f)(),{getModelInfoByVariantSlug:l}=(0,y.S)(),a=(0,z.f)(),i=(0,M.f)(),o=(0,g.f)();s[0]!==l||s[1]!==o||s[2]!==r?(e=async(e,t)=>{let n=function(){let{prompt:e,synthesizerSlug:t,currentRunDbId:n}=L.B.getState(),s=A.H.getState(),r=(0,A.A)(s,n),l=(0,A.P)(s,n),a=(0,A.R)(s,n);return e&&a&&t?{prompt:e,synthesizerSlug:t,responses:r,analysisContent:l,synthesisContent:a}:null}();if(!n)return;let s=await (0,v.$)(()=>I(n,{router:r,getModelInfoByVariantSlug:l,storageInstanceId:e,chatPath:t}));(0,v.V)(s)&&((0,N.s)("Failed to continue fusion in chat",{error:s.error}),(0,b.c)({title:o("Failed to open chat"),variant:"destructive"}))},s[0]=l,s[1]=o,s[2]=r,s[3]=e):e=s[3];let c=e;return s[4]!==i||s[5]!==c||s[6]!==a?(t=null===a?null:()=>c(a,i),s[4]=i,s[5]=c,s[6]=a,s[7]=t):t=s[7],t}(),ei=(0,m.f)(o.J.Fusion),eo=(0,m.f)(o.J.Chatroom),ec=null===ea?h.L.Loading:h.L.Allowed;ee[0]!==ei||ee[1]!==eo||ee[2]!==ec?(e=(0,h.d)([ei,eo,ec]),ee[0]=ei,ee[1]=eo,ee[2]=ec,ee[3]=e):e=ee[3];let ed=e,[eu,em]=(0,l.useState)(null);if("complete"!==en)return null;ee[4]!==el||ee[5]!==es||ee[6]!==er?(w=()=>{es(),er.push(el)},ee[4]=el,ee[5]=es,ee[6]=er,ee[7]=w):w=ee[7];let eh=w;ee[8]!==eh||ee[9]!==eu?(k=()=>{"refuse"===eu?L.B.getState().rerun():"new-fusion"===eu&&eh(),em(null)},ee[8]=eh,ee[9]=eu,ee[10]=k):k=ee[10];let ex=k,ef="refuse"===eu;ee[11]!==ea?(_=()=>{ea?.()},ee[11]=ea,ee[12]=_):_=ee[12],ee[13]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(a,{className:"h-4 w-4"}),C=(0,t.jsx)(p.T,{children:"Continue in Chat"}),ee[13]=S,ee[14]=C):(S=ee[13],C=ee[14]),ee[15]!==ed||ee[16]!==_?(T=(0,t.jsxs)(j.f,{gate:ed,size:"sm",onClick:_,children:[S,C]}),ee[15]=ed,ee[16]=_,ee[17]=T):T=ee[17],ee[18]!==et?(B=et("More actions"),ee[18]=et,ee[19]=B):B=ee[19],ee[20]===Symbol.for("react.memo_cache_sentinel")?(R=(0,t.jsx)(i.f,{className:"h-4 w-4 text-muted-foreground"}),ee[20]=R):R=ee[20],ee[21]!==B?(P=(0,t.jsx)(u.X,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-sm",title:B,children:R})}),ee[21]=B,ee[22]=P):P=ee[22],ee[23]===Symbol.for("react.memo_cache_sentinel")?(D=(0,t.jsxs)(u.r,{onClick:()=>em("refuse"),children:[(0,t.jsx)(r.f,{className:"h-4 w-4"}),(0,t.jsx)(p.T,{children:"Re-fuse"})]}),F=(0,t.jsx)(u.U,{}),ee[23]=D,ee[24]=F):(D=ee[23],F=ee[24]),ee[25]===Symbol.for("react.memo_cache_sentinel")?(O=(0,t.jsxs)(u.L,{align:"center",children:[D,F,(0,t.jsxs)(u.r,{onClick:()=>em("new-fusion"),children:[(0,t.jsx)(s.f,{className:"h-4 w-4"}),(0,t.jsx)(p.T,{children:"New Fusion"})]})]}),ee[25]=O):O=ee[25],ee[26]!==P?(q=(0,t.jsxs)(u.G,{children:[P,O]}),ee[26]=P,ee[27]=q):q=ee[27],ee[28]!==q||ee[29]!==T?(W=(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 pt-2",children:[T,q]}),ee[28]=q,ee[29]=T,ee[30]=W):W=ee[30];let ep=null!==eu;ee[31]===Symbol.for("react.memo_cache_sentinel")?(H=e=>{e||em(null)},ee[31]=H):H=ee[31],ee[32]!==ef?(K=(0,t.jsx)(d.F,{children:ef?(0,t.jsx)(p.T,{children:"Re-fuse synthesis?"}):(0,t.jsx)(p.T,{children:"Start a new fusion?"})}),ee[32]=ef,ee[33]=K):K=ee[33],ee[34]!==ef?(V=(0,t.jsx)(d.C,{children:ef?(0,t.jsx)(p.T,{children:"This will re-run the whole fusion with the same prompt and models, replacing the current responses and synthesis."}):(0,t.jsx)(p.T,{children:"This will open a fresh workspace. The current run stays in your history — click it in the sidebar any time to come back."})}),ee[34]=ef,ee[35]=V):V=ee[35],ee[36]!==K||ee[37]!==V?(Z=(0,t.jsxs)(d.s,{children:[K,V]}),ee[36]=K,ee[37]=V,ee[38]=Z):Z=ee[38],ee[39]===Symbol.for("react.memo_cache_sentinel")?(J=(0,t.jsx)(c.Button,{variant:"ghost",size:"sm",onClick:()=>em(null),children:(0,t.jsx)(p.T,{children:"Cancel"})}),ee[39]=J):J=ee[39];let eg=ef?"default":"destructive";return ee[40]!==ef?(U=ef?(0,t.jsx)(p.T,{children:"Re-fuse"}):(0,t.jsx)(p.T,{children:"New Fusion"}),ee[40]=ef,ee[41]=U):U=ee[41],ee[42]!==ex||ee[43]!==eg||ee[44]!==U?(G=(0,t.jsxs)(d.c,{children:[J,(0,t.jsx)(c.Button,{variant:eg,size:"sm",onClick:ex,children:U})]}),ee[42]=ex,ee[43]=eg,ee[44]=U,ee[45]=G):G=ee[45],ee[46]!==Z||ee[47]!==G?(Q=(0,t.jsxs)(d.d,{showCloseButton:!1,children:[Z,G]}),ee[46]=Z,ee[47]=G,ee[48]=Q):Q=ee[48],ee[49]!==ep||ee[50]!==Q?(Y=(0,t.jsx)(d.N,{open:ep,onOpenChange:H,children:Q}),ee[49]=ep,ee[50]=Q,ee[51]=Y):Y=ee[51],ee[52]!==W||ee[53]!==Y?(X=(0,t.jsxs)(t.Fragment,{children:[W,Y]}),ee[52]=W,ee[53]=Y,ee[54]=X):X=ee[54],X}],547670);let P=l.forwardRef(function({title:e,titleId:t,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))});var D=e.i(359903),F=e.i(271596),O=e.i(214051),q=e.i(525567),W=e.i(227049),H=e.i(136562),K=e.i(758427),V=e.i(751155);function Z(e){return e.stopPropagation()}function J(e){return e.stopPropagation()}function U(e){return e.stopPropagation()}function G(e){return e.stopPropagation()}function Q(e){return e.stopPropagation()}function Y(e){return e.stopPropagation()}function X(e){return!e}e.s(["f",0,function(e){let r,a,i,o,d,u,m,h,x,f,j,b,y,v,N,w,k,_,S,C,T,B,z,R,M,L,A,I,$,E=(0,n.c)(71),{prompt:ee,modelSetLabel:et,timestamp:en,defaultCollapsed:es,isWebSearchEnabled:er,onRerun:el,onStop:ea}=e,ei=void 0!==er&&er,eo=(0,g.f)(),ec=(0,l.useRef)(null),[ed,eu]=(0,l.useState)(!(void 0!==es&&es)),[em,eh]=(0,l.useState)(!1);E[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{let e=ec.current;e&&eh(e.scrollHeight>120)},E[0]=r):r=E[0];let ex=r;E[1]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{ex()},E[1]=a):a=E[1],E[2]!==ee?(i=[ee,ex],E[2]=ee,E[3]=i):i=E[3],(0,l.useEffect)(a,i);let ef=em&&!ed;E[4]===Symbol.for("react.memo_cache_sentinel")?(o=()=>eu(X),E[4]=o):o=E[4];let ep=o,eg=em?"button":void 0,ej=em?0:void 0,eb=em&&"cursor-pointer";E[5]!==eb?(d=(0,H.f)("flex items-center justify-between px-5 py-3 border-b bg-muted/30",eb),E[5]=eb,E[6]=d):d=E[6];let ey=em?ep:void 0;E[7]!==em?(u=em?e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),ep())}:void 0,E[7]=em,E[8]=u):u=E[8],E[9]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:(0,t.jsx)(p.T,{children:"Prompt"})}),E[9]=m):m=E[9],E[10]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(W.f,{className:"h-3 w-3 text-muted-foreground"}),E[10]=h):h=E[10],E[11]!==et?(x=(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-muted/60 border border-border/50 shrink-0",children:[h,(0,t.jsx)("span",{className:"text-2xs font-medium text-muted-foreground whitespace-nowrap",children:et})]}),E[11]=et,E[12]=x):x=E[12],E[13]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(P,{className:"h-3 w-3 text-muted-foreground"}),E[13]=f):f=E[13],E[14]!==en?(j=(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-muted/60 border border-border/50 shrink-0",children:[f,(0,t.jsx)("span",{className:"text-2xs font-medium text-muted-foreground whitespace-nowrap",children:en})]}),E[14]=en,E[15]=j):j=E[15],E[16]!==ei?(b=ei&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-primary/10 border border-primary/20 shrink-0",children:[(0,t.jsx)(O.f,{className:"h-3 w-3 text-primary"}),(0,t.jsx)("span",{className:"text-2xs font-medium text-primary whitespace-nowrap",children:(0,t.jsx)(p.T,{children:"Web Search"})})]}),E[16]=ei,E[17]=b):b=E[17],E[18]!==x||E[19]!==j||E[20]!==b?(y=(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[m,x,j,b]}),E[18]=x,E[19]=j,E[20]=b,E[21]=y):y=E[21],E[22]!==eo||E[23]!==ea?(v=ea&&(0,t.jsx)("div",{role:"presentation",onClick:Y,onKeyDown:Q,children:(0,t.jsx)(V.Tooltip,{content:eo("Stop this fusion"),children:(0,t.jsx)(c.Button,{variant:"ghost-muted",size:"icon-sm",onClick:ea,"aria-label":eo("Stop fusion"),children:(0,t.jsx)(q.f,{className:"h-4 w-4"})})})}),E[22]=eo,E[23]=ea,E[24]=v):v=E[24],E[25]!==eo?(N=eo("Copy prompt"),E[25]=eo,E[26]=N):N=E[26],E[27]!==ee?(w=(0,t.jsx)(K.f,{text:ee,size:"sm",variant:"ghost",tone:"muted",hideCopyText:!0}),E[27]=ee,E[28]=w):w=E[28],E[29]!==N||E[30]!==w?(k=(0,t.jsx)("div",{role:"presentation",onClick:G,onKeyDown:U,children:(0,t.jsx)(V.Tooltip,{content:N,children:w})}),E[29]=N,E[30]=w,E[31]=k):k=E[31],E[32]!==eo||E[33]!==el?(_=el&&(0,t.jsx)("div",{role:"presentation",className:"flex items-center gap-1",onClick:J,onKeyDown:Z,children:(0,t.jsx)(V.Tooltip,{content:eo("Rerun"),children:(0,t.jsx)(c.Button,{variant:"ghost-muted",size:"icon-sm",onClick:el,children:(0,t.jsx)(s.f,{className:"h-4 w-4"})})})}),E[32]=eo,E[33]=el,E[34]=_):_=E[34],E[35]!==ed||E[36]!==em?(S=em&&(ed?(0,t.jsx)(F.f,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(D.f,{className:"h-4 w-4 text-muted-foreground"})),E[35]=ed,E[36]=em,E[37]=S):S=E[37],E[38]!==v||E[39]!==k||E[40]!==_||E[41]!==S?(C=(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[v,k,_,S]}),E[38]=v,E[39]=k,E[40]=_,E[41]=S,E[42]=C):C=E[42],E[43]!==d||E[44]!==ey||E[45]!==u||E[46]!==y||E[47]!==C||E[48]!==eg||E[49]!==ej?(T=(0,t.jsxs)("div",{role:eg,tabIndex:ej,className:d,onClick:ey,onKeyDown:u,children:[y,C]}),E[43]=d,E[44]=ey,E[45]=u,E[46]=y,E[47]=C,E[48]=eg,E[49]=ej,E[50]=T):T=E[50];let ev=ef?"max-h-(--collapsed-max-height) overflow-hidden":"max-h-[40vh] overflow-y-auto";return E[51]!==ev?(B=(0,H.f)("px-6 py-6",ev),E[51]=ev,E[52]=B):B=E[52],E[53]===Symbol.for("react.memo_cache_sentinel")?(z={"--collapsed-max-height":"120px"},E[53]=z):z=E[53],E[54]!==ee?(R=(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:ee}),E[54]=ee,E[55]=R):R=E[55],E[56]!==B||E[57]!==R?(M=(0,t.jsx)("div",{ref:ec,className:B,"data-allow-inline-style":!0,style:z,children:R}),E[56]=B,E[57]=R,E[58]=M):M=E[58],E[59]!==ef?(L=ef&&(0,t.jsx)("div",{className:"absolute bottom-0 inset-x-0 h-16 bg-gradient-to-t from-background to-transparent pointer-events-none"}),E[59]=ef,E[60]=L):L=E[60],E[61]!==M||E[62]!==L?(A=(0,t.jsxs)("div",{className:"relative",children:[M,L]}),E[61]=M,E[62]=L,E[63]=A):A=E[63],E[64]!==ed||E[65]!==em?(I=em&&(0,t.jsx)(c.Button,{variant:"ghost-muted",size:"sm",shape:"none",onClick:ep,className:"flex w-full py-2.5 font-medium border-t",children:ed?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.T,{children:"Show less"}),(0,t.jsx)(F.f,{className:"h-3 w-3"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.T,{children:"Show more"}),(0,t.jsx)(D.f,{className:"h-3 w-3"})]})}),E[64]=ed,E[65]=em,E[66]=I):I=E[66],E[67]!==T||E[68]!==A||E[69]!==I?($=(0,t.jsxs)("div",{className:"ph-no-capture rounded-xl border border-border bg-background shadow-sm overflow-hidden","data-dd-privacy":"hidden",children:[T,A,I]}),E[67]=T,E[68]=A,E[69]=I,E[70]=$):$=E[70],$}],816443);var ee=e.i(153746);function et(e){let s,r,l,a,i,o=(0,n.c)(9),{label:c,progress:d}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("div",{className:"w-px h-4 bg-border"}),o[0]=s):s=o[0],o[1]!==d?(r=d&&(0,t.jsx)("div",{className:"flex items-center justify-center px-2 h-6 rounded-full bg-muted text-2xs font-bold text-muted-foreground border border-border shrink-0 tabular-nums",children:(0,t.jsxs)(p.T,{children:["Step ",(0,t.jsx)(ee.d,{children:d})]})}),o[1]=d,o[2]=r):r=o[2],o[3]!==c?(l=(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground whitespace-nowrap",children:c}),o[3]=c,o[4]=l):l=o[4],o[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:"h-px flex-1 bg-border"}),o[5]=a):a=o[5],o[6]!==r||o[7]!==l?(i=(0,t.jsxs)("div",{className:"flex items-center gap-3 py-4",children:[s,r,l,a]}),o[6]=r,o[7]=l,o[8]=i):i=o[8],i}e.s(["f",0,et],791092);var en=e.i(39835),es=e.i(139659),er=e.i(998224),el=e.i(657288),ea=e.i(279496),ei=e.i(707028),eo=e.i(233452),ec=e.i(894868),ed=e.i(261499),eu=e.i(262646),em=e.i(138257),eh=e.i(304903),ex=e.i(660298),ef=e.i(679728),ep=e.i(29876),eg=e.i(411349);let ej=["[animation-delay:calc(var(--duration-quick)*0)]","[animation-delay:calc(var(--duration-quick)*1)]","[animation-delay:calc(var(--duration-quick)*2)]"];function eb(e){let s,r,l=(0,n.c)(4),{dotClassName:a}=e;return l[0]!==a?(s=ej.map(e=>(0,t.jsx)("span",{className:(0,H.f)("h-1 w-1 rounded-full animate-pulse",a,e)},e)),l[0]=a,l[1]=s):s=l[1],l[2]!==s?(r=(0,t.jsx)("span",{className:"flex gap-0.5 shrink-0",children:s}),l[2]=s,l[3]=r):r=l[3],r}var ey=e.i(435754),ev=e.i(915663),eN=e.i(609303),ew=e.i(850110),ek=e.i(199630),e_=e.i(797521),eS=e.i(919035),eC=e.i(18728),eT=e.i(297272);function eB({gt:e,locale:t},n){return e("{seconds}s",{seconds:(0,eT.B)(n/1e3,{locale:t,fractionDigits:1})??"—"})}function ez(){return(0,L.B)(eR)}function eR(e){return e.currentRunDbId}function eM(){let e,t=(0,n.c)(3),s=(0,g.f)(),r=(0,em.useLocale)();return t[0]!==s||t[1]!==r?(e={gt:s,locale:r},t[0]=s,t[1]=r,t[2]=e):e=t[2],e}let eL="fusion-layout",eA=(0,H.f)("[&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_h4]:text-sm [&_h5]:text-sm [&_h6]:text-xs","[&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:mt-4 [&_h2]:mb-2 [&_h3]:mt-3 [&_h3]:mb-1.5"),eI=(0,H.f)(ed.B,"data-[active=false]:**:[animation-play-state:paused]");function e$(e){let s,r=(0,n.c)(6),{icon:l,status:a,className:i,children:o}=e,c=l===a,d=!c||void 0;return r[0]!==o||r[1]!==i||r[2]!==l||r[3]!==c||r[4]!==d?(s=(0,t.jsx)("span",{className:i,"data-active":c,"data-icon":l,"aria-hidden":d,children:o}),r[0]=o,r[1]=i,r[2]=l,r[3]=c,r[4]=d,r[5]=s):s=r[5],s}function eE(e){let s,r,l,a,i,o,c,d=(0,n.c)(15),{status:u,hasContent:m}=e;return d[0]!==m?(s=m?(0,t.jsx)(eb,{dotClassName:"bg-primary"}):(0,t.jsx)(eu.f,{decorative:!0,tone:"accent",className:"h-3.5 w-3.5 shrink-0"}),d[0]=m,d[1]=s):s=d[1],d[2]!==u||d[3]!==s?(r=(0,t.jsx)(e$,{icon:"loading",status:u,className:eI,children:s}),d[2]=u,d[3]=s,d[4]=r):r=d[4],d[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(ey.f,{className:"h-3.5 w-3.5 text-success shrink-0"}),d[5]=l):l=d[5],d[6]!==u?(a=(0,t.jsx)(e$,{icon:"complete",status:u,className:ed.R,children:l}),d[6]=u,d[7]=a):a=d[7],d[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(ew.f,{className:"h-3.5 w-3.5 text-destructive shrink-0"}),d[8]=i):i=d[8],d[9]!==u?(o=(0,t.jsx)(e$,{icon:"error",status:u,className:ed.R,children:i}),d[9]=u,d[10]=o):o=d[10],d[11]!==r||d[12]!==a||d[13]!==o?(c=(0,t.jsxs)("span",{className:ed.W,"data-testid":"status-icon-slot",children:[r,a,o]}),d[11]=r,d[12]=a,d[13]=o,d[14]=c):c=d[14],c}function eP(e){let s,r=(0,n.c)(3),{response:l}=e;if(l.content){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(p.T,{children:"Generating"}),r[0]=e):e=r[0],e}if(l.reasoning){let e;return r[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(p.T,{children:"Thinking"}),r[1]=e):e=r[1],e}return r[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(p.T,{children:"Processing"}),r[2]=s):s=r[2],s}function eD(e){let s,r,l,a,i,o,c,d=(0,n.c)(18),{response:u}=e,m=eM(),{gt:h}=m,x=(0,e_.f)();if(d[0]!==x||d[1]!==h||d[2]!==u.tokenCount||d[3]!==u.totalTime||d[4]!==m){i=Symbol.for("react.early_return_sentinel");e:{let e=[u.tokenCount?h("{count} tokens",{count:x.number(u.tokenCount,{preset:"integer"})}):null,u.totalTime?eB(m,u.totalTime):null].filter(eF);if(0===e.length){let e;d[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(p.T,{children:"Complete"}),d[10]=e):e=d[10],i=e;break e}r=p.T,a="Complete (",s=ee.d,l=x.list(e,{style:"comma"})}d[0]=x,d[1]=h,d[2]=u.tokenCount,d[3]=u.totalTime,d[4]=m,d[5]=s,d[6]=r,d[7]=l,d[8]=a,d[9]=i}else s=d[5],r=d[6],l=d[7],a=d[8],i=d[9];return i!==Symbol.for("react.early_return_sentinel")?i:(d[11]!==s||d[12]!==l?(o=(0,t.jsx)(s,{children:l}),d[11]=s,d[12]=l,d[13]=o):o=d[13],d[14]!==r||d[15]!==a||d[16]!==o?(c=(0,t.jsxs)(r,{children:[a,o,")"]}),d[14]=r,d[15]=a,d[16]=o,d[17]=c):c=d[17],c)}function eF(e){return null!==e}function eO(e){let s=(0,n.c)(5),{status:r,response:l}=e;switch(r){case"loading":{let e;return s[0]!==l?(e=(0,t.jsx)(eP,{response:l}),s[0]=l,s[1]=e):e=s[1],e}case"error":{let e;return s[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(p.T,{children:"Error occurred"}),s[2]=e):e=s[2],e}case"complete":{let e;return s[3]!==l?(e=(0,t.jsx)(eD,{response:l}),s[3]=l,s[4]=e):e=s[4],e}default:return r}}function eq(e){let s,r,l,a,i,o,c=(0,n.c)(16),{slug:d}=e,u=(0,A.J)(ez(),d);if(!u)return null;if(c[0]!==u)s=u.isLoading?"loading":u.error?"error":"complete",c[0]=u,c[1]=s;else s=c[1];let m=s,h=!!u.content;c[2]!==m||c[3]!==h?(r=(0,t.jsx)(eE,{status:m,hasContent:h}),c[2]=m,c[3]=h,c[4]=r):r=c[4];let x="error"===m?"text-destructive/80":"text-muted-foreground";return c[5]!==x?(l=(0,H.f)("text-xs",x),c[5]=x,c[6]=l):l=c[6],c[7]!==u||c[8]!==m?(a=(0,t.jsx)(eO,{status:m,response:u}),c[7]=u,c[8]=m,c[9]=a):a=c[9],c[10]!==l||c[11]!==a?(i=(0,t.jsx)("span",{className:l,children:a}),c[10]=l,c[11]=a,c[12]=i):i=c[12],c[13]!==r||c[14]!==i?(o=(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[r,i]}),c[13]=r,c[14]=i,c[15]=o):o=c[15],o}function eW(e){let s,r,l,a=(0,n.c)(11),{slug:i}=e,o=(0,eS.f)(),c=ez(),d=(0,A.J)(c,i);if(!d)return null;let u=d.isLoading&&!!d.content,m=!!d.error,h=!!d.content&&!m;return a[0]!==h||a[1]!==u||a[2]!==d.content?(s=h&&(0,t.jsxs)("div",{className:"text-sm leading-relaxed",children:[(0,t.jsx)(ei.f,{className:eA,children:d.content}),u&&(0,t.jsx)("div",{className:"flex items-center gap-1.5 mt-3 text-muted-foreground",children:(0,t.jsx)(eb,{dotClassName:"bg-primary"})})]}),a[0]=h,a[1]=u,a[2]=d.content,a[3]=s):s=a[3],a[4]!==m||a[5]!==o||a[6]!==d.error?(r=m&&(0,t.jsxs)("div",{className:"rounded-md bg-destructive/5 border border-destructive/20 p-3",children:[(0,t.jsx)("p",{className:"text-sm text-destructive font-medium",children:(0,t.jsx)(p.T,{children:"Response unavailable"})}),(0,t.jsx)("p",{className:"text-xs text-destructive/80 mt-1",children:d.error&&o(d.error)})]}),a[4]=m,a[5]=o,a[6]=d.error,a[7]=r):r=a[7],a[8]!==s||a[9]!==r?(l=(0,t.jsxs)(t.Fragment,{children:[s,r]}),a[8]=s,a[9]=r,a[10]=l):l=a[10],l}function eH(e){let s,r,l,a=(0,n.c)(9),{slug:i}=e,o=(0,e_.f)(),c=eM(),d=(0,A.J)(ez(),i);return d?.tokenCount||d?.totalTime?(a[0]!==o||a[1]!==d.tokenCount?(s=d.tokenCount?(0,t.jsx)("span",{children:(0,t.jsxs)(p.T,{children:[(0,t.jsx)(ee.d,{children:o.number(d.tokenCount,{preset:"integer"})})," tokens"]})}):null,a[0]=o,a[1]=d.tokenCount,a[2]=s):s=a[2],a[3]!==d.totalTime||a[4]!==c?(r=d.totalTime?(0,t.jsx)("span",{children:eB(c,d.totalTime)}):null,a[3]=d.totalTime,a[4]=c,a[5]=r):r=a[5],a[6]!==s||a[7]!==r?(l=(0,t.jsxs)("div",{className:"flex items-center gap-3 px-5 py-2.5 border-t text-xs text-muted-foreground shrink-0",children:[s,r]}),a[6]=s,a[7]=r,a[8]=l):l=a[8],l):null}function eK(e){let s,r,l,a,i,o,c,d,u=(0,n.c)(20),{tab:m,isSelected:h,onClick:x}=e,f=h?"border-primary/40 bg-primary/5 ring-1 ring-primary/20":"border-border bg-background";return u[0]!==f?(s=(0,H.f)("w-full text-left px-4 py-3 rounded-lg border transition-colors","hover:bg-muted/50",f),u[0]=f,u[1]=s):s=u[1],u[2]!==m.author||u[3]!==m.key?(r=m.author&&(0,t.jsx)(ec.f,{author:m.author,permaslug:m.key,className:"!size-5 shrink-0"}),u[2]=m.author,u[3]=m.key,u[4]=r):r=u[4],u[5]!==m.name?(l=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate block",children:m.name}),u[5]=m.name,u[6]=l):l=u[6],u[7]!==m.key?(a=(0,t.jsx)(eq,{slug:m.key}),u[7]=m.key,u[8]=a):a=u[8],u[9]!==l||u[10]!==a?(i=(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[l,a]}),u[9]=l,u[10]=a,u[11]=i):i=u[11],u[12]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(eN.f,{className:"h-4 w-4 text-muted-foreground/50 shrink-0"}),u[12]=o):o=u[12],u[13]!==r||u[14]!==i?(c=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[r,i,o]}),u[13]=r,u[14]=i,u[15]=c):c=u[15],u[16]!==x||u[17]!==s||u[18]!==c?(d=(0,t.jsx)("button",{type:"button",onClick:x,className:s,children:c}),u[16]=x,u[17]=s,u[18]=c,u[19]=d):d=u[19],d}function eV(e){let s,r,l,a,i,o,d,u,m,h,x,f,p,j,b,y,v,N,w,k,_,S,C,T,B,z=(0,n.c)(66),{tabs:R,activeKey:M,onSelectTab:L,onClose:A,onExpand:I}=e,$=(0,g.f)();z[0]!==M?(s=e=>e.key===M,z[0]=M,z[1]=s):s=z[1];let E=R.findIndex(s),P=R[E];if(!P)return null;let D=E>0,F=E{D&&L(R[E-1].key)},z[2]=E,z[3]=D,z[4]=L,z[5]=R,z[6]=r):r=z[6];let O=r;z[7]!==E||z[8]!==F||z[9]!==L||z[10]!==R?(l=()=>{F&&L(R[E+1].key)},z[7]=E,z[8]=F,z[9]=L,z[10]=R,z[11]=l):l=z[11];let q=l;z[12]===Symbol.for("react.memo_cache_sentinel")?(a=(0,H.f)("ph-no-capture absolute top-0 right-0 bottom-0 z-40","flex flex-col","border-l border-border bg-background shadow-xl","w-140 max-w-full"),z[12]=a):a=z[12];let W=!D;z[13]!==$?(i=$("Previous model"),z[13]=$,z[14]=i):i=z[14],z[15]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(ev.f,{className:"h-4 w-4"}),z[15]=o):o=z[15],z[16]!==O||z[17]!==W||z[18]!==i?(d=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:O,disabled:W,title:i,children:o}),z[16]=O,z[17]=W,z[18]=i,z[19]=d):d=z[19];let K=!F;z[20]!==$?(u=$("Next model"),z[20]=$,z[21]=u):u=z[21],z[22]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(eN.f,{className:"h-4 w-4"}),z[22]=m):m=z[22],z[23]!==q||z[24]!==u||z[25]!==K?(h=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:q,disabled:K,title:u,children:m}),z[23]=q,z[24]=u,z[25]=K,z[26]=h):h=z[26],z[27]!==h||z[28]!==d?(x=(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[d,h]}),z[27]=h,z[28]=d,z[29]=x):x=z[29],z[30]!==P.author||z[31]!==P.key?(f=P.author&&(0,t.jsx)(ec.f,{author:P.author,permaslug:P.key,className:"!size-5 shrink-0"}),z[30]=P.author,z[31]=P.key,z[32]=f):f=z[32],z[33]!==P.name?(p=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:P.name}),z[33]=P.name,z[34]=p):p=z[34];let V=E+1;return z[35]!==V||z[36]!==R.length?(j=(0,t.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[V,"/",R.length]}),z[35]=V,z[36]=R.length,z[37]=j):j=z[37],z[38]!==f||z[39]!==p||z[40]!==j?(b=(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[f,p,j]}),z[38]=f,z[39]=p,z[40]=j,z[41]=b):b=z[41],z[42]!==$?(y=$("Compare all side by side"),z[42]=$,z[43]=y):y=z[43],z[44]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)(es.f,{className:"h-4 w-4"}),z[44]=v):v=z[44],z[45]!==I||z[46]!==y?(N=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:I,className:"shrink-0",title:y,children:v}),z[45]=I,z[46]=y,z[47]=N):N=z[47],z[48]!==$?(w=$("Close panel"),z[48]=$,z[49]=w):w=z[49],z[50]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(ea.f,{className:"h-4 w-4"}),z[50]=k):k=z[50],z[51]!==A||z[52]!==w?(_=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:A,className:"shrink-0",title:w,children:k}),z[51]=A,z[52]=w,z[53]=_):_=z[53],z[54]!==x||z[55]!==b||z[56]!==N||z[57]!==_?(S=(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b shrink-0",children:[x,b,N,_]}),z[54]=x,z[55]=b,z[56]=N,z[57]=_,z[58]=S):S=z[58],z[59]!==P.key?(C=(0,t.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",children:(0,t.jsx)("div",{className:"max-w-full overflow-hidden",children:(0,t.jsx)(eW,{slug:P.key})})}),T=(0,t.jsx)(eH,{slug:P.key}),z[59]=P.key,z[60]=C,z[61]=T):(C=z[60],T=z[61]),z[62]!==S||z[63]!==C||z[64]!==T?(B=(0,t.jsxs)("aside",{className:a,"data-dd-privacy":"hidden",children:[S,C,T]}),z[62]=S,z[63]=C,z[64]=T,z[65]=B):B=z[65],B}function eZ(e){let s,r,l,a,i,o,c,d,u=(0,n.c)(21),{tab:m,isLast:h}=e,x=!h&&"border-r";return u[0]!==x?(s=(0,H.f)("flex flex-col h-full flex-1 min-w-87.5",x),u[0]=x,u[1]=s):s=u[1],u[2]!==m.author||u[3]!==m.key?(r=m.author&&(0,t.jsx)(ec.f,{author:m.author,permaslug:m.key,className:"!size-5 shrink-0"}),u[2]=m.author,u[3]=m.key,u[4]=r):r=u[4],u[5]!==m.name?(l=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:m.name}),u[5]=m.name,u[6]=l):l=u[6],u[7]!==m.key?(a=(0,t.jsx)(eq,{slug:m.key}),u[7]=m.key,u[8]=a):a=u[8],u[9]!==r||u[10]!==l||u[11]!==a?(i=(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-5 py-3 border-b bg-muted/20 shrink-0",children:[r,l,a]}),u[9]=r,u[10]=l,u[11]=a,u[12]=i):i=u[12],u[13]!==m.key?(o=(0,t.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",children:(0,t.jsx)(eW,{slug:m.key})}),c=(0,t.jsx)(eH,{slug:m.key}),u[13]=m.key,u[14]=o,u[15]=c):(o=u[14],c=u[15]),u[16]!==s||u[17]!==i||u[18]!==o||u[19]!==c?(d=(0,t.jsxs)("div",{className:s,children:[i,o,c]}),u[16]=s,u[17]=i,u[18]=o,u[19]=c,u[20]=d):d=u[20],d}function eJ(e){let s,r,l,a,i,o,d,u,m=(0,n.c)(19),{tabs:h,onClose:x}=e,f=(0,g.f)();m[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("span",{className:"text-sm font-medium text-foreground flex-1",children:(0,t.jsx)(p.T,{children:"All Model Responses"})}),m[0]=s):s=m[0],m[1]!==f?(r=f("Close comparison"),m[1]=f,m[2]=r):r=m[2],m[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(ea.f,{className:"h-4 w-4"}),m[3]=l):l=m[3],m[4]!==x||m[5]!==r?(a=(0,t.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b shrink-0",children:[s,(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:x,title:r,children:l})]}),m[4]=x,m[5]=r,m[6]=a):a=m[6];let j=`${400*h.length}px`;if(m[7]!==j?(i={"--tabs-min-width":j},m[7]=j,m[8]=i):i=m[8],m[9]!==h){let e;m[11]!==h.length?(e=(e,n)=>(0,t.jsx)(eZ,{tab:e,isLast:n===h.length-1},e.key),m[11]=h.length,m[12]=e):e=m[12],o=h.map(e),m[9]=h,m[10]=o}else o=m[10];return m[13]!==i||m[14]!==o?(d=(0,t.jsx)("div",{className:"flex-1 overflow-x-auto overflow-y-hidden",children:(0,t.jsx)("div",{className:"flex h-full min-w-(--tabs-min-width)","data-allow-inline-style":!0,style:i,children:o})}),m[13]=i,m[14]=o,m[15]=d):d=m[15],m[16]!==a||m[17]!==d?(u=(0,t.jsxs)("div",{className:"ph-no-capture fixed inset-0 z-modal bg-background flex flex-col","data-dd-privacy":"hidden",children:[a,d]}),m[16]=a,m[17]=d,m[18]=u):u=m[18],u}function eU({onOverflowChange:e}){let n=(0,L.B)(e=>e.currentRunDbId),s=(0,A.Y)(n),r=(0,l.useRef)(null),a=!!s&&s.length>0,i=(0,l.useRef)(!1),o=(0,l.useRef)(0);if(s&&s.length!==o.current&&(o.current=s.length,i.current||queueMicrotask(()=>{let t=r.current;t&&t.scrollHeight>200&&(i.current=!0,e(!0))})),!a)return null;let c=s.length>800?s.slice(0,800):s;return(0,t.jsx)("div",{ref:r,className:"px-6 py-6 max-h-(--collapsed-max-height) overflow-hidden","data-allow-inline-style":!0,style:{"--collapsed-max-height":"200px"},children:(0,t.jsx)("div",{className:"max-w-none text-sm leading-relaxed",children:(0,t.jsx)(ei.f,{className:eA,children:c})})})}function eG(){let e,s=(0,n.c)(2),r=(0,L.B)(eQ),l=(0,A.Y)(r)??"";return s[0]!==l?(e=(0,t.jsx)("div",{className:"px-6 py-6 [content-visibility:auto]",children:(0,t.jsx)("div",{className:"max-w-none text-sm leading-relaxed",children:(0,t.jsx)(ei.f,{className:eA,children:l})})}),s[0]=l,s[1]=e):e=s[1],e}function eQ(e){return e.currentRunDbId}function eY(){let e,s=(0,n.c)(1);return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(K.f,{getText:eX,size:"sm",variant:"ghost",tone:"muted",hideCopyText:!0}),s[0]=e):e=s[0],e}function eX(){let e=L.B.getState().currentRunDbId;return(0,A.R)(A.H.getState(),e)??""}function e0(e,t){return function(e,t,n,s){let r=n.trim(),l=r;if(r.length>40){let e=r.lastIndexOf(" ",40);l=e>0?r.slice(0,e):r.slice(0,40)}let a=l.replaceAll(/[/\\:*?"<>|\r\n\t]/g,"-").replaceAll(/-{2,}/g,"-");return{name:a?`Fusion - ${a} -`:"Fusion -",date:(0,ep.f)(s,{locale:e,timeZone:t})??"—"}}(e,t,L.B.getState().prompt,new Date)}function e1(){let e,s,r,l,a=(0,n.c)(9),i=(0,g.f)(),o=(0,em.useLocale)(),d=(0,eh.P)();a[0]!==o||a[1]!==d?(e=()=>{let e=L.B.getState().currentRunDbId,t=(0,A.R)(A.H.getState(),e)??"";if(!t)return;(0,ef.V)(ef.G.DownloadMarkdown);let{name:n,date:s}=e0(o,d);(0,ex.f)(t,{name:n,date:s})},a[0]=o,a[1]=d,a[2]=e):e=a[2];let u=e;return a[3]!==i?(s=i("Download as Markdown"),a[3]=i,a[4]=s):s=a[4],a[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(en.f,{className:"h-4 w-4"}),a[5]=r):r=a[5],a[6]!==u||a[7]!==s?(l=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:u,title:s,children:r}),a[6]=u,a[7]=s,a[8]=l):l=a[8],l}function e2(e){let s,r,l,a,i=(0,n.c)(10),{currentRunDbId:o}=e,d=(0,g.f)(),u=(0,em.useLocale)(),m=(0,eh.P)();i[0]!==o||i[1]!==u||i[2]!==m?(s=()=>{let e=(0,A.R)(A.H.getState(),o)??"";if(!e)return;(0,ef.V)(ef.G.DownloadMarkdown);let{name:t,date:n}=e0(u,m);(0,ex.f)(e,{name:t,date:n})},i[0]=o,i[1]=u,i[2]=m,i[3]=s):s=i[3];let h=s;return i[4]!==d?(r=d("Download as Markdown"),i[4]=d,i[5]=r):r=i[5],i[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(en.f,{className:"h-4 w-4"}),i[6]=l):l=i[6],i[7]!==h||i[8]!==r?(a=(0,t.jsx)(c.Button,{variant:"ghost",tone:"subdued",size:"icon-xs",onClick:h,title:r,children:l}),i[7]=h,i[8]=r,i[9]=a):a=i[9],a}function e3(){let e,s,r,a,i,o,c,d=(0,n.c)(13),u=(0,L.B)(e4),[m,h]=(0,l.useState)(!1);if(!u)return null;d[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>h(e5),d[0]=e):e=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(er.f,{className:"h-4 w-4 text-muted-foreground shrink-0"}),d[1]=s):s=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground flex-1",children:(0,t.jsx)(p.T,{children:"Prompt"})}),d[2]=r):r=d[2];let x=m&&"-scale-y-100";return d[3]!==x?(a=(0,H.f)("h-3.5 w-3.5 text-muted-foreground shrink-0",ed.a,x),d[3]=x,d[4]=a):a=d[4],d[5]!==a?(i=(0,t.jsxs)("button",{type:"button",onClick:e,className:"flex items-center gap-2.5 w-full px-6 py-3 text-left",children:[s,r,(0,t.jsx)(D.f,{className:a})]}),d[5]=a,d[6]=i):i=d[6],d[7]!==m||d[8]!==u?(o=m&&(0,t.jsx)("div",{className:"px-6 pb-4 text-sm text-foreground/80 leading-relaxed whitespace-pre-wrap",children:u}),d[7]=m,d[8]=u,d[9]=o):o=d[9],d[10]!==i||d[11]!==o?(c=(0,t.jsxs)("div",{className:"border-b",children:[i,o]}),d[10]=i,d[11]=o,d[12]=c):c=d[12],c}function e5(e){return!e}function e4(e){return e.prompt}function e6(){let e,s,r,a,i,o,c,d,u=(0,n.c)(16),[m]=(0,l.useState)(e9),h=(0,L.B)(e8);if(u[0]!==h){for(let t of(e=new Map,h))e.set(t.short_name,{author:t.author,permaslug:t.permaslug});u[0]=h,u[1]=e}else e=u[1];let x=e,[f,g]=(0,l.useState)(!1);if(!m||!(m.consensus.length>0||m.contradictions.length>0||m.partial_coverage.length>0||m.unique_insights.length>0||m.blind_spots.length>0))return null;u[2]===Symbol.for("react.memo_cache_sentinel")?(s=()=>g(e7),u[2]=s):s=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(el.f,{className:"h-4 w-4 text-muted-foreground shrink-0"}),u[3]=r):r=u[3],u[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground flex-1",children:(0,t.jsx)(p.T,{children:"Analysis"})}),u[4]=a):a=u[4];let j=f&&"-scale-y-100";return u[5]!==j?(i=(0,H.f)("h-3.5 w-3.5 text-muted-foreground shrink-0",ed.a,j),u[5]=j,u[6]=i):i=u[6],u[7]!==i?(o=(0,t.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-2.5 w-full px-6 py-3 text-left",children:[r,a,(0,t.jsx)(D.f,{className:i})]}),u[7]=i,u[8]=o):o=u[8],u[9]!==m||u[10]!==x||u[11]!==f?(c=f&&(0,t.jsx)("div",{className:"px-6 pb-4 flex flex-col gap-y-2",children:eg.i.map(e=>(0,t.jsx)(eg.Q,{config:e,analysis:m,authorMap:x},e.key))}),u[9]=m,u[10]=x,u[11]=f,u[12]=c):c=u[12],u[13]!==o||u[14]!==c?(d=(0,t.jsxs)("div",{className:"border-b",children:[o,c]}),u[13]=o,u[14]=c,u[15]=d):d=u[15],d}function e7(e){return!e}function e8(e){return e.selectedModels}function e9(){let e=L.B.getState().currentRunDbId;return null!==e?A.H.getState().runs[e]?.analysisContent??null:null}function te(e){let s,r,l,a,i,o,c,u,m,h,x,f,p,j,b,y,v=(0,n.c)(34),{open:N,onOpenChange:w,displayName:k,displayAuthor:_,displayPermaslug:S,sourceModels:C}=e,T=(0,g.f)();return v[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,H.f)("ph-no-capture flex max-w-3xl flex-col gap-0 overflow-hidden p-0","rounded-xl bg-background shadow-2xl","h-[calc(100dvh-2rem)] sm:h-auto sm:max-h-[85vh]"),v[0]=s):s=v[0],v[1]!==T?(r=T("Full synthesis response"),v[1]=T,v[2]=r):r=v[2],v[3]!==r?(l=(0,t.jsx)(d.F,{className:"sr-only",children:r}),v[3]=r,v[4]=l):l=v[4],v[5]!==_||v[6]!==S?(a=_&&(0,t.jsx)(ec.f,{author:_,permaslug:S,className:"!size-5 shrink-0"}),v[5]=_,v[6]=S,v[7]=a):a=v[7],v[8]!==k?(i=(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground truncate",children:k}),v[8]=k,v[9]=i):i=v[9],v[10]!==C?(o=(0,t.jsx)(tt,{sourceModels:C,animate:!1}),v[10]=C,v[11]=o):o=v[11],v[12]!==a||v[13]!==i||v[14]!==o?(c=(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[a,i,o]}),v[12]=a,v[13]=i,v[14]=o,v[15]=c):c=v[15],v[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(eY,{}),m=(0,t.jsx)(e1,{}),v[16]=u,v[17]=m):(u=v[16],m=v[17]),v[18]!==T?(h=T("Close"),v[18]=T,v[19]=h):h=v[19],v[20]===Symbol.for("react.memo_cache_sentinel")?(x=(0,t.jsx)(ea.f,{className:"h-4 w-4"}),v[20]=x):x=v[20],v[21]!==h?(f=(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[u,m,(0,t.jsx)(d.t,{title:h,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground transition-colors",children:x})]}),v[21]=h,v[22]=f):f=v[22],v[23]!==f||v[24]!==c?(p=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-3 sm:px-5 border-b bg-muted/30 shrink-0",children:[c,f]}),v[23]=f,v[24]=c,v[25]=p):p=v[25],v[26]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:[(0,t.jsx)(e3,{}),(0,t.jsx)(e6,{}),(0,t.jsx)(eG,{})]}),v[26]=j):j=v[26],v[27]!==p||v[28]!==l?(b=(0,t.jsxs)(d.d,{showCloseButton:!1,keepMounted:!1,overlayClassName:"backdrop-blur-xs","data-dd-privacy":"hidden",className:s,children:[l,p,j]}),v[27]=p,v[28]=l,v[29]=b):b=v[29],v[30]!==w||v[31]!==N||v[32]!==b?(y=(0,t.jsx)(d.N,{open:N,onOpenChange:w,children:b}),v[30]=w,v[31]=N,v[32]=b,v[33]=y):y=v[33],y}function tt(e){let s,r,l,a,i,o,c=(0,n.c)(13),{sourceModels:d,animate:u}=e;if(0===d.length)return null;let m=u?"animated":"static",h=u&&ed.I;return c[0]!==h?(s=(0,H.f)("flex shrink-0",h),c[0]=h,c[1]=s):s=c[1],c[2]!==d?(r=d.map(tn),c[2]=d,c[3]=r):r=c[3],c[4]!==r?(l=(0,t.jsx)("div",{className:"flex items-center",children:r}),c[4]=r,c[5]=l):l=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"whitespace-nowrap",children:(0,t.jsx)(p.T,{children:"Fused"})}),c[6]=a):a=c[6],c[7]!==l?(i=(0,t.jsxs)(eo.Badge,{variant:"muted",className:"gap-1.5 bg-muted/60",children:[l,a]}),c[7]=l,c[8]=i):i=c[8],c[9]!==m||c[10]!==s||c[11]!==i?(o=(0,t.jsx)("div",{"data-testid":"fused-badge",className:s,children:i},m),c[9]=m,c[10]=s,c[11]=i,c[12]=o):o=c[12],o}function tn(e){return(0,t.jsx)("div",{className:"size-3.5 min-w-3.5 min-h-3.5 ring-1 ring-background rounded-full bg-background shrink-0 -me-1 last:me-0",children:(0,t.jsx)(ec.f,{author:e.author,permaslug:e.key,className:"!size-3.5 !min-w-3.5 !min-h-3.5 !p-0.5"})},e.key)}function ts(){let e,s=(0,n.c)(1);return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:"flex items-center gap-1.5 ml-1 text-xs text-muted-foreground",children:(0,t.jsx)(eb,{dotClassName:"bg-foreground/50"})}),s[0]=e):e=s[0],e}function tr(){let e,s,r=(0,n.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(eu.f,{decorative:!0,className:"h-4 w-4"}),r[0]=e):e=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex items-center justify-center gap-3 text-muted-foreground py-12 px-6",children:[e,(0,t.jsx)("span",{className:"text-sm",children:(0,t.jsx)(p.T,{children:"Fusing responses..."})})]}),r[1]=s):s=r[1],s}function tl(e){let s,r,l,a=(0,n.c)(4),{onClick:i}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(p.T,{children:"Read full response"}),r=(0,t.jsx)(es.f,{className:"h-3 w-3"}),a[0]=s,a[1]=r):(s=a[0],r=a[1]),a[2]!==i?(l=(0,t.jsxs)("button",{type:"button",onClick:i,className:"flex items-center justify-center gap-1.5 w-full py-2.5 text-xs font-medium text-muted-foreground hover:text-foreground border-t transition-colors",children:[s,r]}),a[2]=i,a[3]=l):l=a[3],l}function ta(e,t){return e?{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}:{}}function ti(e){let s,r,l,a,i=(0,n.c)(10),{show:o,currentRunDbId:c,getCopyText:d,animate:u}=e;if(!o)return null;let m=u&&ed.o;return i[0]!==m?(s=(0,H.f)("flex items-center gap-1",m),i[0]=m,i[1]=s):s=i[1],i[2]!==d?(r=(0,t.jsx)(K.f,{getText:d,size:"sm",variant:"ghost",tone:"muted",hideCopyText:!0}),i[2]=d,i[3]=r):r=i[3],i[4]!==c?(l=(0,t.jsx)(e2,{currentRunDbId:c}),i[4]=c,i[5]=l):l=i[5],i[6]!==s||i[7]!==r||i[8]!==l?(a=(0,t.jsxs)("div",{role:"presentation","data-testid":"completion-actions",className:s,onClick:tc,onKeyDown:to,children:[r,l]}),i[6]=s,i[7]=r,i[8]=l,i[9]=a):a=i[9],a}function to(e){return e.stopPropagation()}function tc(e){return e.stopPropagation()}function td(e){return e.phase}function tu(e){return{key:e.slug,author:e.author}}function tm(e){return e.selectedModels}function th(e){return e.synthesizerSlug}function tx(e){let s,r,l,a,i,o,c,d=(0,n.c)(20),{displayAuthor:u,displayPermaslug:m,displayName:h,sourceModels:x,isSynthesizing:f,animateCompletion:p,actions:g}=e;return d[0]!==u||d[1]!==m?(s=u&&(0,t.jsx)(ec.f,{author:u,permaslug:m,className:"!size-5 shrink-0"}),d[0]=u,d[1]=m,d[2]=s):s=d[2],d[3]!==h?(r=(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:h}),d[3]=h,d[4]=r):r=d[4],d[5]!==p||d[6]!==x?(l=(0,t.jsx)(tt,{sourceModels:x,animate:p}),d[5]=p,d[6]=x,d[7]=l):l=d[7],d[8]!==f?(a=f&&(0,t.jsx)(ts,{}),d[8]=f,d[9]=a):a=d[9],d[10]!==s||d[11]!==r||d[12]!==l||d[13]!==a?(i=(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[s,r,l,a]}),d[10]=s,d[11]=r,d[12]=l,d[13]=a,d[14]=i):i=d[14],d[15]!==g?(o=(0,t.jsx)("div",{className:"flex items-center gap-1",children:g}),d[15]=g,d[16]=o):o=d[16],d[17]!==i||d[18]!==o?(c=(0,t.jsxs)(t.Fragment,{children:[i,o]}),d[17]=i,d[18]=o,d[19]=c):c=d[19],c}function tf(e){let s,r,l,a,i,o,c,d,u=(0,n.c)(23),{showPlaceholder:m,isOverflowing:h,onOverflowChange:x,openModal:f}=e;u[0]!==h||u[1]!==f?(s=ta(h,f),u[0]=h,u[1]=f,u[2]=s):s=u[2];let p=h&&"cursor-pointer";return u[3]!==p?(r=(0,H.f)("relative",p),u[3]=p,u[4]=r):r=u[4],u[5]!==m?(l=m&&(0,t.jsx)(tr,{}),u[5]=m,u[6]=l):l=u[6],u[7]!==x?(a=(0,t.jsx)(eU,{onOverflowChange:x}),u[7]=x,u[8]=a):a=u[8],u[9]!==h?(i=h&&(0,t.jsx)("div",{className:"absolute bottom-0 inset-x-0 h-16 bg-gradient-to-t from-background to-transparent pointer-events-none"}),u[9]=h,u[10]=i):i=u[10],u[11]!==s||u[12]!==r||u[13]!==l||u[14]!==a||u[15]!==i?(o=(0,t.jsxs)("div",{...s,className:r,children:[l,a,i]}),u[11]=s,u[12]=r,u[13]=l,u[14]=a,u[15]=i,u[16]=o):o=u[16],u[17]!==h||u[18]!==f?(c=h&&(0,t.jsx)(tl,{onClick:f}),u[17]=h,u[18]=f,u[19]=c):c=u[19],u[20]!==o||u[21]!==c?(d=(0,t.jsxs)(t.Fragment,{children:[o,c]}),u[20]=o,u[21]=c,u[22]=d):d=u[22],d}function tp(e){return e.currentRunDbId}e.s(["y",0,eL,"S",0,eA,"$",0,function(e){let s,r,a,i,o,c,d,u,m,h,x,f,p,g=(0,n.c)(37),{tabs:j,label:b,progress:y}=e,[v,N]=(0,l.useState)("cards"),[w,k]=(0,l.useState)(null),_=(0,ek.f)()?document.querySelector(`#${eL}`):null;g[0]!==w||g[1]!==v?(s=e=>{"panel"===v&&w===e?(N("cards"),k(null)):(k(e),N("panel"))},g[0]=w,g[1]=v,g[2]=s):s=g[2];let S=s;g[3]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{N("cards"),k(null)},g[3]=r):r=g[3];let C=r;g[4]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{N("fullscreen")},g[4]=a):a=g[4];let T=a;g[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{N("panel")},g[5]=i):i=g[5];let B=i;if(g[6]!==v?(o=()=>{let e=e=>{"Escape"===e.key&&("fullscreen"===v?N("panel"):"panel"===v&&(N("cards"),k(null)))};return"cards"!==v&&document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},c=[v],g[6]=v,g[7]=o,g[8]=c):(o=g[7],c=g[8]),(0,l.useEffect)(o,c),0===j.length)return null;g[9]!==b||g[10]!==y?(d=b&&(0,t.jsx)(et,{label:b,progress:y}),g[9]=b,g[10]=y,g[11]=d):d=g[11];let z=b&&"mt-4";if(g[12]!==z?(u=(0,H.f)("flex flex-col gap-y-2",z),g[12]=z,g[13]=u):u=g[13],g[14]!==S||g[15]!==w||g[16]!==j||g[17]!==v){let e;g[19]!==S||g[20]!==w||g[21]!==v?(e=e=>(0,t.jsx)(eK,{tab:e,isSelected:"panel"===v&&e.key===w,onClick:()=>S(e.key)},e.key),g[19]=S,g[20]=w,g[21]=v,g[22]=e):e=g[22],m=j.map(e),g[14]=S,g[15]=w,g[16]=j,g[17]=v,g[18]=m}else m=g[18];g[23]!==m||g[24]!==u?(h=(0,t.jsx)("div",{className:u,children:m}),g[23]=m,g[24]=u,g[25]=h):h=g[25],g[26]!==h||g[27]!==d?(x=(0,t.jsxs)("div",{className:"ph-no-capture","data-dd-privacy":"hidden",children:[d,h]}),g[26]=h,g[27]=d,g[28]=x):x=g[28];let R="panel"===v&&w&&_&&(0,eC.createPortal)((0,t.jsx)(eV,{tabs:j,activeKey:w,onSelectTab:k,onClose:C,onExpand:T}),_);return g[29]!==B||g[30]!==j||g[31]!==v?(f="fullscreen"===v&&(0,eC.createPortal)((0,t.jsx)(eJ,{tabs:j,onClose:B}),document.body),g[29]=B,g[30]=j,g[31]=v,g[32]=f):f=g[32],g[33]!==x||g[34]!==R||g[35]!==f?(p=(0,t.jsxs)(t.Fragment,{children:[x,R,f]}),g[33]=x,g[34]=R,g[35]=f,g[36]=p):p=g[36],p}],665996),e.s(["f",0,function(e){let s,r,a,i,o,c,d,u,m,h,x,f,p,j,b,v,N,w,k,_,S,C,T,B,z,R,M,I,$,E=(0,n.c)(43),{overrides:P}=e,D=(0,L.B)(tp);E[0]!==D?(s=e=>{let t=(0,A.R)(e,D);return!!t&&t.length>0},E[0]=D,E[1]=s):s=E[1];let F=(0,A.H)(s),{sourceModels:O,displayAuthor:q,displayPermaslug:W,displayName:K}=(k=(0,n.c)(15),_=(0,g.f)(),S=(0,L.B)(th),C=(0,L.B)(tm),T=(0,y.S)(),B=T?.getModelInfoByVariantSlug,k[0]!==B||k[1]!==S?(b=S&&B?B(S):null,k[0]=B,k[1]=S,k[2]=b):b=k[2],z=b,k[3]!==P?.sourceModels||k[4]!==C?(v=P?.sourceModels??C.map(tu),k[3]=P?.sourceModels,k[4]=C,k[5]=v):v=k[5],R=v,M=P?.synthesizerAuthor??z?.author,I=z?.permaslug,k[6]!==_||k[7]!==P?.synthesizerName||k[8]!==z?.short_name?(N=P?.synthesizerName??z?.short_name??_("Fused Answer"),k[6]=_,k[7]=P?.synthesizerName,k[8]=z?.short_name,k[9]=N):N=k[9],$=N,k[10]!==M||k[11]!==$||k[12]!==I||k[13]!==R?(w={sourceModels:R,displayAuthor:M,displayPermaslug:I,displayName:$},k[10]=M,k[11]=$,k[12]=I,k[13]=R,k[14]=w):w=k[14],w),{isSynthesizing:V,isComplete:Z,animateCompletion:J}=function(e){let t,s=(0,n.c)(4),r=(0,L.B)(td),a=e?.isComplete??"complete"===r,[i]=(0,l.useState)(a),o="synthesizing"===r,c=a&&!i;return s[0]!==a||s[1]!==o||s[2]!==c?(t={isSynthesizing:o,isComplete:a,animateCompletion:c},s[0]=a,s[1]=o,s[2]=c,s[3]=t):t=s[3],t}(P),[U,G]=(0,l.useState)(!1),[Q,Y]=(0,l.useState)(!1);E[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{G(e)},E[2]=r):r=E[2];let X=r;E[3]!==D?(a=()=>(0,A.R)(A.H.getState(),D)??"",E[3]=D,E[4]=a):a=E[4];let ee=a;E[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{Y(!0)},E[5]=i):i=E[5];let et=i;E[6]===Symbol.for("react.memo_cache_sentinel")?(o=(0,H.f)("ph-no-capture rounded-xl border border-border bg-background shadow-sm overflow-hidden",ed.o),E[6]=o):o=E[6],E[7]!==U?(c=ta(U,et),E[7]=U,E[8]=c):c=E[8];let en=U&&"cursor-pointer";E[9]!==en?(d=(0,H.f)("flex items-center justify-between px-5 py-3 border-b bg-muted/30",en),E[9]=en,E[10]=d):d=E[10];let es=Z&&F;E[11]!==J||E[12]!==D||E[13]!==ee||E[14]!==es?(u=(0,t.jsx)(ti,{show:es,currentRunDbId:D,getCopyText:ee,animate:J}),E[11]=J,E[12]=D,E[13]=ee,E[14]=es,E[15]=u):u=E[15],E[16]!==J||E[17]!==q||E[18]!==K||E[19]!==W||E[20]!==V||E[21]!==O||E[22]!==u?(m=(0,t.jsx)(tx,{displayAuthor:q,displayPermaslug:W,displayName:K,sourceModels:O,isSynthesizing:V,animateCompletion:J,actions:u}),E[16]=J,E[17]=q,E[18]=K,E[19]=W,E[20]=V,E[21]=O,E[22]=u,E[23]=m):m=E[23],E[24]!==m||E[25]!==c||E[26]!==d?(h=(0,t.jsx)("div",{...c,className:d,children:m}),E[24]=m,E[25]=c,E[26]=d,E[27]=h):h=E[27];let er=V&&!F;return E[28]!==U||E[29]!==er?(x=(0,t.jsx)(tf,{showPlaceholder:er,isOverflowing:U,onOverflowChange:X,openModal:et}),E[28]=U,E[29]=er,E[30]=x):x=E[30],E[31]!==h||E[32]!==x?(f=(0,t.jsxs)("div",{className:o,"data-dd-privacy":"hidden",children:[h,x]}),E[31]=h,E[32]=x,E[33]=f):f=E[33],E[34]!==q||E[35]!==K||E[36]!==W||E[37]!==Q||E[38]!==O?(p=(0,t.jsx)(te,{open:Q,onOpenChange:Y,displayName:K,displayAuthor:q,displayPermaslug:W,sourceModels:O}),E[34]=q,E[35]=K,E[36]=W,E[37]=Q,E[38]=O,E[39]=p):p=E[39],E[40]!==f||E[41]!==p?(j=(0,t.jsxs)(t.Fragment,{children:[f,p]}),E[40]=f,E[41]=p,E[42]=j):j=E[42],j}],397847);var tg=e.i(234281);e.s(["f",0,function(e){let t,s=(0,n.c)(6),r=(0,tg.n)(void 0,"expiration");if("live"===e.kind){let t;return s[0]!==e.startTime||s[1]!==r?(t=e.startTime?r(e.startTime)??"":"",s[0]=e.startTime,s[1]=r,s[2]=t):t=s[2],t}return s[3]!==e.createdAt||s[4]!==r?(t=r(e.createdAt)??"",s[3]=e.createdAt,s[4]=r,s[5]=t):t=s[5],t}],596807)}]); //# sourceMappingURL=1kv_4oh1x5xf3.js.map