!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a08fa9-66ef-7f00-b3fb-b5168e47c086")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,131830,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(749509);e.i(270401);var l=e.i(883534),o=e.i(658108);function s(e){let t,l,s=(0,r.c)(7),a=(0,n.useSearchParams)();s[0]!==a?(t=(0,o.readHighlightedModel)(a),s[0]=a,s[1]=t):t=s[1];let i=t;if(s[2]!==i||s[3]!==e){let t;s[5]!==i?(t=e=>({...e,href:(0,o.withHighlightedModel)(e.href,i)}),s[5]=i,s[6]=t):t=s[6],l=e.map(t),s[2]=i,s[3]=e,s[4]=l}else l=s[4];return l}e.s(["ExploreScenarioRailWithSearchParams",0,function(e){let n,o=(0,r.c)(3),a=s(e.items);return o[0]!==e||o[1]!==a?(n=(0,t.jsx)(l.ExploreScenarioRail,{...e,items:a}),o[0]=e,o[1]=a,o[2]=n):n=o[2],n},"ExploreScenarioStripWithSearchParams",0,function(e){let n,o=(0,r.c)(3),a=s(e.items);return o[0]!==e||o[1]!==a?(n=(0,t.jsx)(l.ExploreScenarioStrip,{...e,items:a}),o[0]=e,o[1]=a,o[2]=n):n=o[2],n}])},769031,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(553215),l=e.i(452473),o=e.i(252358);e.i(406201);var s=e.i(806024),a=e.i(658108);function i(e){let n,o,a=(0,r.c)(8),{href:i,isActive:c,onSelect:d,children:u}=e,m=c?"page":void 0,h=c?"bg-accent font-medium text-accent-foreground":"text-muted-foreground hover:bg-accent-subtle hover:text-accent-foreground";return a[0]!==h?(n=(0,l.cn)("text-body flex min-h-10 items-center rounded-md px-3 transition-colors",h),a[0]=h,a[1]=n):n=a[1],a[2]!==u||a[3]!==i||a[4]!==d||a[5]!==m||a[6]!==n?(o=(0,t.jsx)(s.Link,{href:i,"aria-current":m,onClick:d,className:n,children:u}),a[2]=u,a[3]=i,a[4]=d,a[5]=m,a[6]=n,a[7]=o):o=a[7],o}e.s(["ExploreSubjectFilter",0,function(e){let l,s,c,d,u,m=(0,r.c)(29),{basePath:h,section:f,lens:p,subjects:g,activeSubject:x,highlightedModelId:b}=e,v=(0,o.usePosthogClient)();m[0]!==h||m[1]!==b?(l=(0,a.withHighlightedModel)(h,b),m[0]=h,m[1]=b,m[2]=l):l=m[2];let j=void 0===x;if(m[3]!==p||m[4]!==v||m[5]!==f?(s=()=>v.capture(n.PostHogEvent.ClickBenchmarkExploreSubject,{lens:p,section:f,subject:null}),m[3]=p,m[4]=v,m[5]=f,m[6]=s):s=m[6],m[7]!==l||m[8]!==j||m[9]!==s?(c=(0,t.jsx)(i,{href:l,isActive:j,onSelect:s,children:"All"}),m[7]=l,m[8]=j,m[9]=s,m[10]=c):c=m[10],m[11]!==x||m[12]!==h||m[13]!==b||m[14]!==p||m[15]!==v||m[16]!==f||m[17]!==g){let e;m[19]!==x||m[20]!==h||m[21]!==b||m[22]!==p||m[23]!==v||m[24]!==f?(e=e=>(0,t.jsx)(i,{href:(0,a.withHighlightedModel)(`${h}?variant=${encodeURIComponent(e.id)}`,b),isActive:e.id===x,onSelect:()=>v.capture(n.PostHogEvent.ClickBenchmarkExploreSubject,{lens:p,section:f,subject:e.id}),children:e.label},e.id),m[19]=x,m[20]=h,m[21]=b,m[22]=p,m[23]=v,m[24]=f,m[25]=e):e=m[25],d=g.map(e),m[11]=x,m[12]=h,m[13]=b,m[14]=p,m[15]=v,m[16]=f,m[17]=g,m[18]=d}else d=m[18];return m[26]!==c||m[27]!==d?(u=(0,t.jsxs)("div",{role:"group","aria-label":"Filter by subject",className:"flex flex-wrap gap-1.5",children:[c,d]}),m[26]=c,m[27]=d,m[28]=u):u=m[28],u}])},361323,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(749509),l=e.i(658108),o=e.i(769031),s=e.i(189360),a=e.i(880414),i=e.i(75534),c=e.i(761787);function d(e){let n,l,d,u,m,h,f,p=(0,r.c)(26),{challenge:g,scenarios:x,tab:b,selectedVariant:v,highlightedModelId:j,isTabEntry:y}=e,w=void 0!==y&&y?"h3":"h2",_="style"===g.kind?"styles":"challenges";if(p[0]!==w||p[1]!==g.kind||p[2]!==g.modality||p[3]!==g.slug||p[4]!==j||p[5]!==_||p[6]!==x||p[7]!==v||p[8]!==b){let e,{activeVariant:r,shownScenarios:c}=function({challengeKind:e,scenarios:t,selectedVariant:r}){let n=t.some(e=>e.id===r)?r:void 0,l="style"===e?t.filter(e=>void 0===n||e.id===n):t;return{activeVariant:n,shownScenarios:l}}({challengeKind:g.kind,scenarios:x,selectedVariant:v});u="style"===g.kind&&x.length>1&&(0,t.jsx)(o.ExploreSubjectFilter,{basePath:`${(0,s.mediaBenchmarkBasePath)(b)}/${g.slug}`,section:g.slug,lens:_,subjects:x,activeSubject:r,highlightedModelId:j}),n=i.MediaGallerySelectionProvider,l=g.modality,p[13]!==w||p[14]!==g.kind||p[15]!==j||p[16]!==_?(e=e=>(0,t.jsxs)("section",{children:["style"===g.kind&&(0,t.jsx)(w,{className:"text-heading font-medium tracking-tight",children:e.heading}),(0,t.jsx)(a.MediaGallery,{scenario:e,lens:_,isSortable:"challenge"===g.kind,highlightedModelId:j})]},e.id),p[13]=w,p[14]=g.kind,p[15]=j,p[16]=_,p[17]=e):e=p[17],d=c.map(e),p[0]=w,p[1]=g.kind,p[2]=g.modality,p[3]=g.slug,p[4]=j,p[5]=_,p[6]=x,p[7]=v,p[8]=b,p[9]=n,p[10]=l,p[11]=d,p[12]=u}else n=p[9],l=p[10],d=p[11],u=p[12];return p[18]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(c.MediaGallerySelectionBar,{}),p[18]=m):m=p[18],p[19]!==n||p[20]!==l||p[21]!==d?(h=(0,t.jsxs)(n,{modality:l,children:[d,m]}),p[19]=n,p[20]=l,p[21]=d,p[22]=h):h=p[22],p[23]!==u||p[24]!==h?(f=(0,t.jsxs)(t.Fragment,{children:[u,h]}),p[23]=u,p[24]=h,p[25]=f):f=p[25],f}e.s(["MediaEvaluationScenariosWithSearchParams",0,function(e){let o,s,a,i=(0,r.c)(8),c=(0,n.useSearchParams)();return i[0]!==c?(o=c?.get("variant")??void 0,i[0]=c,i[1]=o):o=i[1],i[2]!==c?(s=(0,l.readHighlightedModel)(c),i[2]=c,i[3]=s):s=i[3],i[4]!==e||i[5]!==o||i[6]!==s?(a=(0,t.jsx)(d,{...e,selectedVariant:o,highlightedModelId:s}),i[4]=e,i[5]=o,i[6]=s,i[7]=a):a=i[7],a}],361323)},880414,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(553215),l=e.i(528164),o=e.i(897575),s=e.i(738286),a=e.i(252358),i=e.i(779100),c=e.i(586404),d=e.i(411365),u=e.i(888557);let m=(0,e.i(202913).default)("square-check",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var h=e.i(270401),f=e.i(988855),p=e.i(78138),g=e.i(644807),x=e.i(658108);function b(e){return e>=7?"positive":e<4?"negative":"warning"}var v=e.i(536960);function j(e){return e.mediaType.startsWith("video/")}function y(e){return e.mediaType.startsWith("video/")}var w=e.i(452473);let _="w-14 shrink-0 text-body text-muted-foreground";function N(e){let n,l,o,a,i,c,d,u,m,h=(0,r.c)(21),{options:f,author:p,onSelect:g}=e;if(h[0]!==p||h[1]!==f){let e;h[3]!==p?(e=e=>e.slug===p,h[3]=p,h[4]=e):e=h[4],n=f.find(e),h[0]=p,h[1]=f,h[2]=n}else n=h[2];let x=n;h[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("span",{className:(0,w.cn)(_,"sm:w-auto"),children:"Author"}),h[5]=l):l=h[5];let b=p??"all";h[6]!==g?(o=e=>g("all"===e?null:e),h[6]=g,h[7]=o):o=h[7];let v=`Filter by author: ${x?.label??"All"}`;return h[8]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(s.SelectValue,{}),h[8]=a):a=h[8],h[9]!==v?(i=(0,t.jsx)(s.SelectTrigger,{"aria-label":v,className:"min-h-10 flex-1 sm:min-h-8 sm:w-44 sm:flex-none",children:a}),h[9]=v,h[10]=i):i=h[10],h[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(s.SelectItem,{value:"all",children:"All"}),h[11]=c):c=h[11],h[12]!==f?(d=f.map(S),h[12]=f,h[13]=d):d=h[13],h[14]!==d?(u=(0,t.jsxs)(s.SelectContent,{children:[c,d]}),h[14]=d,h[15]=u):u=h[15],h[16]!==u||h[17]!==b||h[18]!==o||h[19]!==i?(m=(0,t.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[l,(0,t.jsxs)(s.Select,{value:b,onValueChange:o,children:[i,u]})]}),h[16]=u,h[17]=b,h[18]=o,h[19]=i,h[20]=m):m=h[20],m}function S(e){return(0,t.jsx)(s.SelectItem,{value:e.slug,children:e.label},e.slug)}var k=e.i(126154),C=e.i(557225),E=e.i(253167);e.i(406201);var P=e.i(806024),R=e.i(586534),M=e.i(714170),O=e.i(381084),I=e.i(9251),z=e.i(699937),$=e.i(693004);function B(e){let n,l,o,s,a,i,c=(0,r.c)(17),{checked:d,pinned:u,label:m,onClick:h}=e,f=`Select ${m} for comparison`;c[0]!==h?(n=e=>{e.stopPropagation(),h()},c[0]=h,c[1]=n):n=c[1];let p=u?"opacity-100":"opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/cell:opacity-100";c[2]!==p?(l=(0,w.cn)("absolute left-1.5 top-1.5 z-10 flex size-5 items-center justify-center rounded-sm text-primary-foreground transition-opacity focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary before:absolute before:-inset-2.5 before:content-['']",p),c[2]=p,c[3]=l):l=c[3];let g=d?"border-primary bg-primary":"border-border";return c[4]!==g?(o=(0,w.cn)("flex size-5 items-center justify-center rounded border bg-background/80 backdrop-blur-sm",g),c[4]=g,c[5]=o):o=c[5],c[6]!==d?(s=d&&(0,t.jsx)(z.Check,{className:"size-3.5"}),c[6]=d,c[7]=s):s=c[7],c[8]!==o||c[9]!==s?(a=(0,t.jsx)("span",{"aria-hidden":!0,className:o,children:s}),c[8]=o,c[9]=s,c[10]=a):a=c[10],c[11]!==d||c[12]!==f||c[13]!==n||c[14]!==l||c[15]!==a?(i=(0,t.jsx)("button",{type:"button",role:"checkbox","aria-checked":d,"aria-label":f,onClick:n,className:l,children:a}),c[11]=d,c[12]=f,c[13]=n,c[14]=l,c[15]=a,c[16]=i):i=c[16],i}function A(e){let n,l,o,s=(0,r.c)(7),{label:a,pinned:i,onClick:c}=e,d=`Open ${a} output in the lightbox`,u=i&&"visible pointer-events-auto opacity-100";return s[0]!==u?(n=(0,w.cn)("absolute right-1.5 top-1.5 z-10 flex size-6 items-center justify-center rounded-sm bg-[color-mix(in_srgb,var(--or-ink)_70%,transparent)] text-white opacity-0 backdrop-blur-sm transition-opacity focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:outline-none","invisible pointer-events-none","[@media(hover:hover)]:visible [@media(hover:hover)]:group-hover/cell:pointer-events-auto [@media(hover:hover)]:group-hover/cell:opacity-100",u),s[0]=u,s[1]=n):n=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)($.Maximize2,{className:"size-3"}),s[2]=l):l=s[2],s[3]!==c||s[4]!==d||s[5]!==n?(o=(0,t.jsx)("button",{type:"button",onClick:c,"aria-label":d,className:n,children:l}),s[3]=c,s[4]=d,s[5]=n,s[6]=o):o=s[6],o}var L=e.i(994740);function T(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[length:8px_8px] bg-[position:0_0,4px_4px] opacity-[0.02] [background-image:linear-gradient(45deg,var(--foreground)_25%,transparent_25%,transparent_75%,var(--foreground)_75%),linear-gradient(45deg,var(--foreground)_25%,transparent_25%,transparent_75%,var(--foreground)_75%)] dark:opacity-[0.025]"}),n[0]=e):e=n[0],e}function H(e){let n,l,o,s,a,i,c,d,u=(0,r.c)(22),{asset:m,alt:f,sizes:p}=e,[g,x]=(0,h.useState)(!1),b=(0,h.useRef)(null),v=j(m)&&null===m.thumbnailUrl,y=m.thumbnailUrl??m.url;u[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{x(b.current?.complete??!1)},u[0]=n):n=u[0],u[1]!==y?(l=[y],u[1]=y,u[2]=l):l=u[2],(0,h.useEffect)(n,l),u[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>x(!0),u[3]=o):o=u[3];let _=o;if(v){let e,r;return u[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(T,{}),u[4]=e):e=u[4],u[5]!==m.url?(r=(0,t.jsxs)(t.Fragment,{children:[e,(0,t.jsx)("video",{src:m.url,muted:!0,playsInline:!0,preload:"metadata",className:"absolute inset-0 size-full object-cover"})]}),u[5]=m.url,u[6]=r):r=u[6],r}u[7]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(T,{}),u[7]=s):s=u[7],u[8]!==g?(a=!g&&(0,t.jsx)("span",{"aria-hidden":"true",className:"absolute inset-0 animate-pulse bg-muted/60"}),u[8]=g,u[9]=a):a=u[9];let N=m.width,S=m.height,k=g?"opacity-100":"opacity-0";return u[10]!==k?(i=(0,w.cn)("absolute inset-0 size-full object-cover transition-opacity duration-200",k),u[10]=k,u[11]=i):i=u[11],u[12]!==f||u[13]!==m.height||u[14]!==m.width||u[15]!==y||u[16]!==p||u[17]!==i?(c=(0,t.jsx)(L.default,{ref:b,src:y,alt:f,width:N,height:S,sizes:p,loading:"lazy",onLoad:_,className:i}),u[12]=f,u[13]=m.height,u[14]=m.width,u[15]=y,u[16]=p,u[17]=i,u[18]=c):c=u[18],u[19]!==c||u[20]!==a?(d=(0,t.jsxs)(t.Fragment,{children:[s,a,c]}),u[19]=c,u[20]=a,u[21]=d):d=u[21],d}var D=e.i(834814),G=e.i(21614),F=e.i(370066);let q="Median of the judges’ scores. Rated by AI, may contain errors.";function U(e,t){return(0,F.formatNumber)(t,{locale:e,preset:"fixed-1"})??"—"}function V(e){let n,l,o,s,a,c=(0,r.c)(18),{quality:d,emphasised:u,className:m}=e,h=(0,i.useLocale)();c[0]!==d.score?(n=b(d.score),c[0]=d.score,c[1]=n):n=c[1];let f=n,p="positive"===f&&"border-positive/60 bg-positive/10 text-positive",g="warning"===f&&"border-warning/60 bg-warning/10 text-warning",x="negative"===f&&"border-negative/60 bg-negative/10 text-negative",v=u&&"font-medium";c[2]!==m||c[3]!==p||c[4]!==g||c[5]!==x||c[6]!==v?(l=(0,w.cn)("inline-flex shrink-0 items-center rounded-sm border px-1 tabular-nums",p,g,x,v,m),c[2]=m,c[3]=p,c[4]=g,c[5]=x,c[6]=v,c[7]=l):l=c[7],c[8]!==h||c[9]!==d.score?(o=U(h,d.score),c[8]=h,c[9]=d.score,c[10]=o):o=c[10];let j=`Quality ${o} out of 10`;return c[11]!==h||c[12]!==d.score?(s=U(h,d.score),c[11]=h,c[12]=d.score,c[13]=s):s=c[13],c[14]!==l||c[15]!==j||c[16]!==s?(a=(0,t.jsx)("span",{className:l,"aria-label":j,children:s}),c[14]=l,c[15]=j,c[16]=s,c[17]=a):a=c[17],a}function K(e){let n,l,o,s=(0,r.c)(12),{quality:a,className:c}=e,d=(0,i.useLocale)();if(s[0]!==c||s[1]!==d||s[2]!==a.judges){let e,r=[...a.judges].sort(W);s[5]!==c?(n=(0,w.cn)("flex flex-col gap-1",c),s[5]=c,s[6]=n):n=s[6],s[7]!==d?(e=e=>(0,t.jsx)(Q,{judge:e,locale:d},e.id),s[7]=d,s[8]=e):e=s[8],l=r.map(e),s[0]=c,s[1]=d,s[2]=a.judges,s[3]=n,s[4]=l}else n=s[3],l=s[4];return s[9]!==n||s[10]!==l?(o=(0,t.jsx)("ul",{className:n,children:l}),s[9]=n,s[10]=l,s[11]=o):o=s[11],o}function W(e,t){return t.score-e.score}function Q(e){let n,l,o,s,a,i,c=(0,r.c)(15),{judge:d,locale:u}=e;return c[0]!==d.author?(n=(0,t.jsx)(C.AuthorIcon,{author:d.author,frame:!0,className:"size-3.5 shrink-0"}),c[0]=d.author,c[1]=n):n=c[1],c[2]!==d?(l=(0,I.galleryModelShortName)(d),c[2]=d,c[3]=l):l=c[3],c[4]!==l?(o=(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:l}),c[4]=l,c[5]=o):o=c[5],c[6]!==d.score||c[7]!==u?(s=U(u,d.score),c[6]=d.score,c[7]=u,c[8]=s):s=c[8],c[9]!==s?(a=(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:s}),c[9]=s,c[10]=a):a=c[10],c[11]!==n||c[12]!==o||c[13]!==a?(i=(0,t.jsxs)("li",{className:"flex items-center gap-1.5 text-overline leading-5",children:[n,o,a]}),c[11]=n,c[12]=o,c[13]=a,c[14]=i):i=c[14],i}function J(e){let l,o,s,i,c,d,u,m,f=(0,r.c)(19),{quality:p,emphasised:g,scenarioId:x}=e,b=(0,a.usePosthogClient)(),[v,j]=(0,h.useState)(!1);f[0]!==b||f[1]!==p||f[2]!==x?(l=e=>{j(e),e&&b.capture(n.PostHogEvent.OpenBenchmarkExploreQualityBreakdown,{scenario:x,score:p.score,spread:p.spread,judge_count:p.judges.length})},f[0]=b,f[1]=p,f[2]=x,f[3]=l):l=f[3];let y=l;return f[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:"mb-1 block text-overline font-medium text-muted-foreground",children:"Quality Score out of 10"}),f[4]=o):o=f[4],f[5]!==p?(s=(0,t.jsx)(K,{quality:p}),f[5]=p,f[6]=s):s=f[6],f[7]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(D.Separator,{className:"my-1.5"}),c=(0,t.jsx)("p",{className:"text-overline leading-5 text-muted-foreground",children:q}),f[7]=i,f[8]=c):(i=f[7],c=f[8]),f[9]!==s?(d=(0,t.jsxs)(t.Fragment,{children:[o,s,i,c]}),f[9]=s,f[10]=d):d=f[10],f[11]!==g||f[12]!==p?(u=(0,t.jsx)("button",{type:"button",className:"inline-flex rounded-sm focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",children:(0,t.jsx)(V,{quality:p,emphasised:g,className:"h-4"})}),f[11]=g,f[12]=p,f[13]=u):u=f[13],f[14]!==y||f[15]!==v||f[16]!==d||f[17]!==u?(m=(0,t.jsx)(G.TooltipPopover,{inline:!0,side:"bottom",align:"end",className:"w-max max-w-[240px]",open:v,onOpenChange:y,content:d,children:u}),f[14]=y,f[15]=v,f[16]=d,f[17]=u,f[18]=m):m=f[18],m}var X=e.i(778084);let Y="How was this graded",Z=`${Y}?`;function ee(e){let n,l,o,s,a,i,c=(0,r.c)(9),{judges:d}=e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("p",{className:"text-overline leading-5 text-muted-foreground",children:"Each check was graded independently by:"}),c[0]=n):n=c[0],c[1]!==d?(l=d.map(et),c[1]=d,c[2]=l):l=c[2],c[3]!==l?(o=(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:l}),c[3]=l,c[4]=o):o=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(D.Separator,{}),a=(0,t.jsx)("p",{className:"text-overline leading-5 text-muted-foreground",children:"A check passes on majority vote. AI can make mistakes, so treat results as a signal, not a guarantee."}),c[5]=s,c[6]=a):(s=c[5],a=c[6]),c[7]!==o?(i=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[n,o,s,a]}),c[7]=o,c[8]=i):i=c[8],i}function et(e){return(0,t.jsxs)("li",{className:"flex items-center gap-1.5 text-overline leading-5 text-foreground",children:[(0,t.jsx)(C.AuthorIcon,{author:e.author,frame:!0,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:(0,I.galleryModelShortName)(e)})]},e.id)}function er(e){let n,l,o,s,a,i=(0,r.c)(16),{score:c,emphasised:d,className:u}=e;i[0]!==c?(n=c.score===c.total?"positive":0===c.score?"negative":"warning",i[0]=c,i[1]=n):n=i[1];let m=n,h="positive"===m&&"border-positive/60 bg-positive/10 text-positive",f="warning"===m&&"border-warning/60 bg-warning/10 text-warning",p="negative"===m&&"border-negative/60 bg-negative/10 text-negative",g=d&&"font-medium";return(i[2]!==u||i[3]!==h||i[4]!==f||i[5]!==p||i[6]!==g?(l=(0,w.cn)("inline-flex shrink-0 items-center rounded-sm border px-1 tabular-nums",h,f,p,g,u),i[2]=u,i[3]=h,i[4]=f,i[5]=p,i[6]=g,i[7]=l):l=i[7],i[8]!==c)?(o=1===c.total?1===c.score?"Passed":"Failed":`${c.score} of ${c.total} checks passed`,i[8]=c,i[9]=o):o=i[9],i[10]!==c?(s=1===c.total?1===c.score?"Pass":"Fail":`${c.score}/${c.total}`,i[10]=c,i[11]=s):s=i[11],i[12]!==l||i[13]!==o||i[14]!==s?(a=(0,t.jsx)("span",{className:l,"aria-label":o,children:s}),i[12]=l,i[13]=o,i[14]=s,i[15]=a):a=i[15],a}function en(e){let n,l,o,s=(0,r.c)(7),{score:a,className:i}=e;return s[0]!==i?(n=(0,w.cn)("flex flex-col gap-1",i),s[0]=i,s[1]=n):n=s[1],s[2]!==a.checks?(l=a.checks.map(el),s[2]=a.checks,s[3]=l):l=s[3],s[4]!==n||s[5]!==l?(o=(0,t.jsx)("ul",{className:n,children:l}),s[4]=n,s[5]=l,s[6]=o):o=s[6],o}function el(e){return(0,t.jsxs)("li",{className:"flex items-start gap-1.5 text-overline leading-5",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"flex h-5 shrink-0 items-center",children:(0,t.jsx)("span",{className:(0,w.cn)("size-1.5 rounded-full",e.pass?"bg-positive":"bg-negative")})}),(0,t.jsx)("span",{className:e.pass?"text-foreground":"text-muted-foreground",children:e.label}),(0,t.jsx)("span",{className:"sr-only",children:e.pass?" — passed":" — failed"})]},e.label)}function eo(e){let n,l,o,s=(0,r.c)(6),{hasJudges:a,onOpenGrading:i}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)(D.Separator,{className:"my-1.5"}),s[0]=n):n=s[0],s[1]!==a||s[2]!==i?(l=a&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsxs)("button",{type:"button",onClick:i,"aria-label":Z,className:"rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:"underline underline-offset-2",children:Y}),"?"]})]}),s[1]=a,s[2]=i,s[3]=l):l=s[3],s[4]!==l?(o=(0,t.jsxs)(t.Fragment,{children:[n,(0,t.jsxs)("p",{className:"text-overline leading-5 text-muted-foreground",children:["Graded by AI, may contain errors.",l]})]}),s[4]=l,s[5]=o):o=s[5],o}function es(e){let n,l,o,s=(0,r.c)(13),{score:a,emphasised:i,judges:c,grading:d}=e;if(0===c.length){let e;return s[0]!==i||s[1]!==a?(e=(0,t.jsx)(er,{score:a,emphasised:i,className:"h-4"}),s[0]=i,s[1]=a,s[2]=e):e=s[2],e}return s[3]!==c?(n=(0,t.jsx)(ee,{judges:c}),s[3]=c,s[4]=n):n=s[4],s[5]!==i||s[6]!==a?(l=(0,t.jsx)("button",{type:"button",className:"inline-flex rounded-sm focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",children:(0,t.jsx)(er,{score:a,emphasised:i,className:"h-4"})}),s[5]=i,s[6]=a,s[7]=l):l=s[7],s[8]!==d.onOpenChange||s[9]!==d.open||s[10]!==n||s[11]!==l?(o=(0,t.jsx)(G.TooltipPopover,{inline:!0,side:"bottom",align:"end",className:"w-max max-w-[260px]",open:d.open,onOpenChange:d.onOpenChange,content:n,children:l}),s[8]=d.onOpenChange,s[9]=d.open,s[10]=n,s[11]=l,s[12]=o):o=s[12],o}function ea(e){let l,o,s,i,c,d,u,m,f,p,g,x,b,v,j=(0,r.c)(46),{score:y,emphasised:w,judges:_,scenarioId:N}=e,S=(0,a.usePosthogClient)(),k=(0,h.useRef)(null),C=(0,h.useRef)(!1),[E,P]=(0,h.useState)(!1);j[0]!==S||j[1]!==N||j[2]!==y.score||j[3]!==y.total?(l=e=>{if(e&&C.current){C.current=!1;return}P(e),e&&S.capture(n.PostHogEvent.OpenBenchmarkExploreScoreBreakdown,{scenario:N,score:y.score,total:y.total})},j[0]=S,j[1]=N,j[2]=y.score,j[3]=y.total,j[4]=l):l=j[4];let R=l;j[5]!==_.length||j[6]!==N?(o={scenarioId:N,judgeCount:_.length},j[5]=_.length,j[6]=N,j[7]=o):o=j[7];let M=function(e){let t,l,o=(0,r.c)(7),{scenarioId:s,judgeCount:i}=e,c=(0,a.usePosthogClient)(),[d,u]=(0,h.useState)(!1);return o[0]!==i||o[1]!==c||o[2]!==s?(t=e=>{u(e),e&&c.capture(n.PostHogEvent.OpenBenchmarkExploreGradingDisclosure,{scenario:s,judge_count:i})},o[0]=i,o[1]=c,o[2]=s,o[3]=t):t=o[3],o[4]!==d||o[5]!==t?(l={open:d,onOpenChange:t},o[4]=d,o[5]=t,o[6]=l):l=o[6],l}(o);j[8]!==M?(s=()=>{P(!1),M.onOpenChange(!0)},j[8]=M,j[9]=s):s=j[9];let O=s;j[10]!==M?(i=e=>{e||(C.current=!0),M.onOpenChange(e)},j[10]=M,j[11]=i):i=j[11];let I=i;if(1===y.total){let e;return j[12]!==w||j[13]!==M||j[14]!==_||j[15]!==y?(e=(0,t.jsx)(es,{score:y,emphasised:w,judges:_,grading:M}),j[12]=w,j[13]=M,j[14]=_,j[15]=y,j[16]=e):e=j[16],e}let z=E&&!M.open;j[17]!==y.score||j[18]!==y.total?(c=(0,t.jsxs)("span",{className:"mb-1 block text-overline font-medium text-muted-foreground",children:[y.score," of ",y.total," checks"]}),j[17]=y.score,j[18]=y.total,j[19]=c):c=j[19],j[20]!==y?(d=(0,t.jsx)(en,{score:y}),j[20]=y,j[21]=d):d=j[21];let $=_.length>0;return j[22]!==O||j[23]!==$?(u=(0,t.jsx)(eo,{hasJudges:$,onOpenGrading:O}),j[22]=O,j[23]=$,j[24]=u):u=j[24],j[25]!==c||j[26]!==d||j[27]!==u?(m=(0,t.jsxs)(t.Fragment,{children:[c,d,u]}),j[25]=c,j[26]=d,j[27]=u,j[28]=m):m=j[28],j[29]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{C.current=!1},p=()=>{C.current=!1},j[29]=f,j[30]=p):(f=j[29],p=j[30]),j[31]!==w||j[32]!==y?(g=(0,t.jsx)("button",{ref:k,type:"button",onBlur:f,onClick:p,className:"inline-flex rounded-sm focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",children:(0,t.jsx)(er,{score:y,emphasised:w,className:"h-4"})}),j[31]=w,j[32]=y,j[33]=g):g=j[33],j[34]!==R||j[35]!==m||j[36]!==g||j[37]!==z?(x=(0,t.jsx)(G.TooltipPopover,{inline:!0,side:"bottom",align:"end",className:"w-max max-w-[220px]",open:z,onOpenChange:R,content:m,children:g}),j[34]=R,j[35]=m,j[36]=g,j[37]=z,j[38]=x):x=j[38],j[39]!==M.open||j[40]!==_||j[41]!==I?(b=_.length>0&&(0,t.jsx)(X.Popover,{open:M.open,onOpenChange:I,children:(0,t.jsx)(X.PopoverContent,{anchor:k,side:"bottom",align:"end",finalFocus:k,className:"w-max max-w-[260px] p-2 text-xs",children:(0,t.jsx)(ee,{judges:_})})}),j[39]=M.open,j[40]=_,j[41]=I,j[42]=b):b=j[42],j[43]!==x||j[44]!==b?(v=(0,t.jsxs)(t.Fragment,{children:[x,b]}),j[43]=x,j[44]=b,j[45]=v):v=j[45],v}var ei=e.i(202107),ec=e.i(691038),ed=e.i(197070);function eu(e){let n,l,o,s,a,i,c,d,u,m,f,p,g,x,b,v,j,y,_,N,S,k,C,E,P=(0,r.c)(74),{cell:R,frames:M,onOpen:O,onScrub:I,selectionEnabled:z,selectionActive:$,selected:T,highlighted:H,onSelect:D}=e,G=(0,ec.useMatchMedia)("(hover: hover) and (pointer: fine)"),[F,q]=(0,h.useState)(0),[U,V]=(0,h.useState)(!1),[K,W]=(0,h.useState)(!1);P[0]===Symbol.for("react.memo_cache_sentinel")?(n=new Set,P[0]=n):n=P[0];let[Q,J]=(0,h.useState)(n),X=(0,h.useRef)(null),Y=(0,h.useRef)(!1),Z=M.length;P[1]!==Z||P[2]!==Q?(l=function({loadedFrames:e,frameCount:t}){return t>0&&Array.from({length:t},(e,t)=>t).every(t=>e.has(t))}({loadedFrames:Q,frameCount:Z}),P[1]=Z,P[2]=Q,P[3]=l):l=P[3];let ee=l;P[4]===Symbol.for("react.memo_cache_sentinel")?(o={rootMargin:"200px",freezeOnceVisible:!0},P[4]=o):o=P[4];let{ref:et,isIntersecting:er}=(0,ei.useIntersectionObserver)(o);P[5]!==G||P[6]!==er?(s=()=>{G&&er&&V(!0)},a=[G,er],P[5]=G,P[6]=er,P[7]=s,P[8]=a):(s=P[7],a=P[8]),(0,h.useEffect)(s,a),P[9]!==et?(i=e=>{X.current=e,et(e)},P[9]=et,P[10]=i):i=P[10];let en=i;P[11]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{V(!0)},P[11]=c):c=P[11];let el=c;P[12]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{J(t=>t.has(e)?t:new Set(t).add(e))},P[12]=d):d=P[12];let eo=d;P[13]!==G?(u=()=>{G&&V(!0)},P[13]=G,P[14]=u):u=P[14];let es=u;P[15]!==G||P[16]!==Z||P[17]!==ee||P[18]!==I?(m=e=>{if(!G||(V(!0),!ee))return;let t=X.current?.getBoundingClientRect();t&&0!==t.width&&(q(function({clientX:e,left:t,width:r,frameCount:n}){return Math.floor(Math.min(.999,Math.max(0,(e-t)/r))*n)}({clientX:e.clientX,left:t.left,width:t.width,frameCount:Z})),Y.current||(Y.current=!0,I()),W(!0))},P[15]=G,P[16]=Z,P[17]=ee,P[18]=I,P[19]=m):m=P[19];let ea=m;P[20]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{Y.current=!1,W(!1),q(0)},P[20]=f):f=P[20];let eu=f;P[21]!==Z||P[22]!==ee?(p=e=>{ee&&("ArrowRight"===e.key?(e.preventDefault(),W(!0),q(e=>Math.min(Z-1,e+1))):"ArrowLeft"===e.key&&(e.preventDefault(),W(!0),q(em)))},P[21]=Z,P[22]=ee,P[23]=p):p=P[23];let eh=p,ef=$?D:O,ep=$?`Toggle ${R.model.name} selection`:`${R.model.name} — play clip. Arrow keys step through frames.`,eg=(T||H)&&"ring-2 ring-primary ring-offset-2 ring-offset-background";if(P[24]!==eg?(g=(0,w.cn)("group relative block w-full cursor-pointer overflow-hidden rounded-md border border-border bg-muted/40 transition-shadow hover:ring-1 hover:ring-border focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",eg),P[24]=eg,P[25]=g):g=P[25],P[26]!==M||P[27]!==U?(x=U?M:M.slice(0,1),P[26]=M,P[27]=U,P[28]=x):x=P[28],P[29]!==R.model.name||P[30]!==F||P[31]!==x){let e;P[33]!==R.model.name||P[34]!==F?(e=(e,r)=>(0,t.jsx)(L.default,{src:e,alt:0===r?`${R.model.name}: first frame`:"","aria-hidden":0!==r,fill:!0,sizes:"(min-width: 1024px) 400px, (min-width: 640px) 50vw, 100vw",loading:0===r?"lazy":"eager",fetchPriority:0===r?void 0:"low",onLoad:()=>{eo(r)},onError:()=>{eo(r)},className:(0,w.cn)("absolute inset-0 size-full object-cover",r===F?"opacity-100":"opacity-0")},e),P[33]=R.model.name,P[34]=F,P[35]=e):e=P[35],b=x.map(e),P[29]=R.model.name,P[30]=F,P[31]=x,P[32]=b}else b=P[32];let ex=K?"opacity-0":"opacity-100";return P[36]!==ex?(v=(0,w.cn)("pointer-events-none absolute inset-0 flex items-center justify-center transition-opacity",ex),P[36]=ex,P[37]=v):v=P[37],P[38]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)("span",{className:"flex size-11 items-center justify-center rounded-full bg-background/70 ring-1 ring-border backdrop-blur-sm",children:(0,t.jsx)(ed.Play,{className:"size-5","aria-hidden":!0})}),P[38]=j):j=P[38],P[39]!==v?(y=(0,t.jsx)("span",{className:v,children:j}),P[39]=v,P[40]=y):y=P[40],P[41]!==G||P[42]!==F||P[43]!==M||P[44]!==K?(_=G&&(0,t.jsx)("span",{className:(0,w.cn)("pointer-events-none absolute inset-x-1.5 bottom-1.5 flex gap-0.5 transition-opacity",K?"opacity-100":"opacity-0"),"aria-hidden":!0,children:M.map((e,r)=>(0,t.jsx)("span",{className:(0,w.cn)("h-0.5 flex-1 rounded-full",r===F?"bg-foreground":"bg-foreground/25")},e))}),P[41]=G,P[42]=F,P[43]=M,P[44]=K,P[45]=_):_=P[45],P[46]!==b||P[47]!==y||P[48]!==_?(N=(0,t.jsxs)("span",{className:"relative block aspect-video",children:[b,y,_]}),P[46]=b,P[47]=y,P[48]=_,P[49]=N):N=P[49],P[50]!==eh||P[51]!==es||P[52]!==ea||P[53]!==en||P[54]!==ef||P[55]!==ep||P[56]!==g||P[57]!==N?(S=(0,t.jsx)("button",{ref:en,type:"button",onPointerEnter:es,onFocus:el,onPointerMove:ea,onPointerLeave:eu,onBlur:eu,onClick:ef,onKeyDown:eh,"aria-label":ep,className:g,children:N}),P[50]=eh,P[51]=es,P[52]=ea,P[53]=en,P[54]=ef,P[55]=ep,P[56]=g,P[57]=N,P[58]=S):S=P[58],P[59]!==R.model.name||P[60]!==D||P[61]!==T||P[62]!==$||P[63]!==z?(k=z&&(0,t.jsx)(B,{checked:T,pinned:$,label:R.model.name,onClick:D}),P[59]=R.model.name,P[60]=D,P[61]=T,P[62]=$,P[63]=z,P[64]=k):k=P[64],P[65]!==R.model.name||P[66]!==O||P[67]!==$?(C=(0,t.jsx)(A,{label:R.model.name,pinned:$,onClick:O}),P[65]=R.model.name,P[66]=O,P[67]=$,P[68]=C):C=P[68],P[69]!==es||P[70]!==S||P[71]!==k||P[72]!==C?(E=(0,t.jsxs)("span",{className:"group/cell relative block before:absolute before:-inset-x-2 before:-top-2 before:bottom-0 before:content-['']",onPointerEnter:es,children:[S,k,C]}),P[69]=es,P[70]=S,P[71]=k,P[72]=C,P[73]=E):E=P[73],E}function em(e){return Math.max(0,e-1)}function eh(e){let n,l,o,s,a,c,d,u,m,h,p,g,x,b,j,y,w,_=(0,r.c)(63),{cell:N,isVideoScenario:S,showScore:E,showQuality:R,scenarioId:z,sortKey:$,scenarioHeading:B,onOpen:A,onOpenModel:L,onScrub:T,selectionEnabled:H,selectionActive:D,selected:G,highlighted:F,onSelect:q}=e,U=(0,i.useLocale)();_[0]!==N||_[1]!==F||_[2]!==S||_[3]!==A||_[4]!==T||_[5]!==q||_[6]!==B||_[7]!==G||_[8]!==D||_[9]!==H?(n=N.asset?(0,t.jsx)(ef,{cell:N,asset:N.asset,isVideoScenario:S,scenarioHeading:B,onOpen:A,onScrub:T,selectionEnabled:H,selectionActive:D,selected:G,highlighted:F,onSelect:q}):(0,t.jsx)(ep,{cell:N,isVideoScenario:S,selectionEnabled:H,selectionActive:D,selected:G,highlighted:F,onSelect:q}),_[0]=N,_[1]=F,_[2]=S,_[3]=A,_[4]=T,_[5]=q,_[6]=B,_[7]=G,_[8]=D,_[9]=H,_[10]=n):n=_[10],_[11]!==N.model.author?(l=(0,t.jsx)(C.AuthorIcon,{author:N.model.author,frame:!0,className:"size-4"}),_[11]=N.model.author,_[12]=l):l=_[12],_[13]!==N.model?(o=(0,O.getGalleryModelHref)(N.model),_[13]=N.model,_[14]=o):o=_[14];let V=N.model.name;_[15]!==N.model?(s=(0,I.galleryModelLabel)(N.model),_[15]=N.model,_[16]=s):s=_[16],_[17]!==N.model.name||_[18]!==L||_[19]!==o||_[20]!==s?(a=(0,t.jsx)(P.Link,{href:o,title:V,onClick:L,prefetch:!1,className:"truncate rounded-sm text-overline font-medium leading-tight transition-colors hover:text-accent-foreground hover:underline focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",children:s}),_[17]=N.model.name,_[18]=L,_[19]=o,_[20]=s,_[21]=a):a=_[21],_[22]!==l||_[23]!==a?(c=(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[l,a]}),_[22]=l,_[23]=a,_[24]=c):c=_[24];let K="cost"===$?"text-foreground":"text-muted-foreground";_[25]!==N.costUsd||_[26]!==U?(d=(0,M.formatCost)(U,N.costUsd),_[25]=N.costUsd,_[26]=U,_[27]=d):d=_[27],_[28]!==K||_[29]!==d?(u=(0,t.jsx)("span",{className:K,children:d}),_[28]=K,_[29]=d,_[30]=u):u=_[30],_[31]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),_[31]=m):m=_[31];let W="time"===$?"text-foreground":"text-muted-foreground";if(_[32]!==N.durationMs||_[33]!==U?(h=(0,v.formatGenerationDuration)(U,N.durationMs),_[32]=N.durationMs,_[33]=U,_[34]=h):h=_[34],_[35]!==W||_[36]!==h?(p=(0,t.jsx)("span",{className:W,children:h}),_[35]=W,_[36]=h,_[37]=p):p=_[37],_[38]!==N||_[39]!==U||_[40]!==z||_[41]!==E||_[42]!==$)g=E&&void 0!==N.score&&(0,t.jsx)(ea,{score:N.score,emphasised:"score"===$,judges:[...new Map([N].flatMap(e=>e.score?.judges??[]).map(e=>[e.id,e])).values()].sort((e,t)=>(0,f.compareDisplayText)(e.name,t.name,{locale:U})),scenarioId:z}),_[38]=N,_[39]=U,_[40]=z,_[41]=E,_[42]=$,_[43]=g;else g=_[43];return _[44]!==N.quality||_[45]!==z||_[46]!==R||_[47]!==$?(x=R&&void 0!==N.quality&&(0,t.jsx)(J,{quality:N.quality,emphasised:"quality"===$||"controversial"===$,scenarioId:z}),_[44]=N.quality,_[45]=z,_[46]=R,_[47]=$,_[48]=x):x=_[48],_[49]!==u||_[50]!==p||_[51]!==g||_[52]!==x?(b=(0,t.jsxs)("div",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 text-overline leading-tight tabular-nums",children:[u,m,p,g,x]}),_[49]=u,_[50]=p,_[51]=g,_[52]=x,_[53]=b):b=_[53],_[54]!==N.provider?(j=null===N.provider?null:(0,t.jsx)("span",{className:"mt-0.5 shrink-0 truncate text-overline leading-tight text-muted-foreground",children:N.provider}),_[54]=N.provider,_[55]=j):j=_[55],_[56]!==b||_[57]!==j||_[58]!==c?(y=(0,t.jsxs)("div",{className:"flex h-[3.4rem] min-w-0 flex-col justify-start",children:[c,b,j]}),_[56]=b,_[57]=j,_[58]=c,_[59]=y):y=_[59],_[60]!==n||_[61]!==y?(w=(0,t.jsxs)("li",{className:"flex min-w-0 flex-col gap-1.5",children:[n,y]}),_[60]=n,_[61]=y,_[62]=w):w=_[62],w}function ef(e){let n,l,o,s,a,i,c,d,u,m=(0,r.c)(47),{cell:h,asset:f,isVideoScenario:p,scenarioHeading:g,onOpen:x,onScrub:b,selectionEnabled:v,selectionActive:y,selected:_,highlighted:N,onSelect:S}=e;m[0]!==f?(n=j(f)?f.frameThumbnailUrls??[]:[],m[0]=f,m[1]=n):n=m[1];let k=n,C=j(f)&&0===k.length?f.url:null,{shouldPlayVideo:E,isVideoRendering:P,handlePlayStart:M,handlePlayStop:O,handleVideoPlaying:I}=(0,R.useHoverVideo)(C);if(k.length>0){let e;return m[2]!==h||m[3]!==N||m[4]!==x||m[5]!==b||m[6]!==S||m[7]!==k||m[8]!==_||m[9]!==y||m[10]!==v?(e=(0,t.jsx)(eu,{cell:h,frames:k,onOpen:x,onScrub:b,selectionEnabled:v,selectionActive:y,selected:_,highlighted:N,onSelect:S}),m[2]=h,m[3]=N,m[4]=x,m[5]=b,m[6]=S,m[7]=k,m[8]=_,m[9]=y,m[10]=v,m[11]=e):e=m[11],e}let z=y?S:x,$=y?`Toggle ${h.model.name} selection`:`View ${h.model.name} output full size`,L=(_||N)&&"ring-2 ring-primary ring-offset-2 ring-offset-background",T=p?"aspect-video":"aspect-square";m[12]!==L||m[13]!==T?(l=(0,w.cn)("relative block w-full cursor-pointer overflow-hidden rounded-md border border-border bg-muted/40 transition-colors focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",L,T),m[12]=L,m[13]=T,m[14]=l):l=m[14];let D=h.model.name;m[15]!==g?(o=g.toLowerCase(),m[15]=g,m[16]=o):o=m[16];let G=`${D} rendering of the ${o} prompt`;return m[17]!==f||m[18]!==G?(s=(0,t.jsx)(H,{asset:f,alt:G,sizes:"(min-width: 1280px) 240px, (min-width: 1024px) 280px, (min-width: 640px) 33vw, 50vw"}),m[17]=f,m[18]=G,m[19]=s):s=m[19],m[20]!==I||m[21]!==C||m[22]!==P||m[23]!==E?(a=E&&C?(0,t.jsx)("video",{src:C,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-hidden":!0,onPlaying:I,className:(0,w.cn)("pointer-events-none absolute inset-0 size-full object-cover transition-opacity duration-300",P?"opacity-100":"opacity-0")}):null,m[20]=I,m[21]=C,m[22]=P,m[23]=E,m[24]=a):a=m[24],m[25]!==s||m[26]!==a||m[27]!==z||m[28]!==$||m[29]!==l?(i=(0,t.jsxs)("button",{type:"button",onClick:z,"aria-label":$,className:l,children:[s,a]}),m[25]=s,m[26]=a,m[27]=z,m[28]=$,m[29]=l,m[30]=i):i=m[30],m[31]!==h.model.name||m[32]!==S||m[33]!==_||m[34]!==y||m[35]!==v?(c=v&&(0,t.jsx)(B,{checked:_,pinned:y,label:h.model.name,onClick:S}),m[31]=h.model.name,m[32]=S,m[33]=_,m[34]=y,m[35]=v,m[36]=c):c=m[36],m[37]!==h.model.name||m[38]!==x||m[39]!==y?(d=(0,t.jsx)(A,{label:h.model.name,pinned:y,onClick:x}),m[37]=h.model.name,m[38]=x,m[39]=y,m[40]=d):d=m[40],m[41]!==M||m[42]!==O||m[43]!==i||m[44]!==c||m[45]!==d?(u=(0,t.jsxs)("div",{className:"group/cell relative",onMouseEnter:M,onMouseLeave:O,onFocus:M,onBlur:O,children:[i,c,d]}),m[41]=M,m[42]=O,m[43]=i,m[44]=c,m[45]=d,m[46]=u):u=m[46],u}function ep(e){let n,l,o,s,a,i,c,d=(0,r.c)(22),{cell:u,isVideoScenario:m,selectionEnabled:h,selectionActive:f,selected:p,highlighted:g,onSelect:x}=e,b=f?x:void 0,v=m?"aspect-video":"aspect-square",j=(p||g)&&"ring-2 ring-primary ring-offset-2 ring-offset-background",y=f&&"cursor-pointer";return d[0]!==v||d[1]!==j||d[2]!==y?(n=(0,w.cn)("flex flex-col items-center justify-center gap-1.5 rounded-md",v,"border border-dashed border-border bg-muted/30 px-2 text-center",j,y),d[0]=v,d[1]=j,d[2]=y,d[3]=n):n=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(E.ImageOff,{className:"size-4 shrink-0 text-muted-foreground/60"}),d[4]=l):l=d[4],d[5]!==u?(o=function(e){switch(e.failure){case"ref-limit":return e.failureNote??"Does not accept references";case"refused":return"Refused the prompt";case"unsupported":return"Prompt unsupported";case"error":case void 0:return"No output returned";default:return e.failure}}(u),d[5]=u,d[6]=o):o=d[6],d[7]!==o?(s=(0,t.jsx)("span",{className:"text-overline leading-tight text-muted-foreground",children:o}),d[7]=o,d[8]=s):s=d[8],d[9]!==n||d[10]!==s?(a=(0,t.jsxs)("div",{className:n,children:[l,s]}),d[9]=n,d[10]=s,d[11]=a):a=d[11],d[12]!==u||d[13]!==x||d[14]!==p||d[15]!==f||d[16]!==h?(i=h&&(0,t.jsx)(B,{checked:p,pinned:f,label:u.model.name,onClick:x}),d[12]=u,d[13]=x,d[14]=p,d[15]=f,d[16]=h,d[17]=i):i=d[17],d[18]!==b||d[19]!==i||d[20]!==a?(c=(0,t.jsxs)("div",{className:"group/cell relative",onClick:b,children:[a,i]}),d[18]=b,d[19]=i,d[20]=a,d[21]=c):c=d[21],c}function eg(e){let n,l,o,s=(0,r.c)(9),{harshest:a,mostLenient:c}=e,d=(0,i.useLocale)();return s[0]!==a||s[1]!==d?(n=(0,t.jsx)(ex,{label:"Toughest critic",tendency:a,locale:d}),s[0]=a,s[1]=d,s[2]=n):n=s[2],s[3]!==d||s[4]!==c?(l=(0,t.jsx)(ex,{label:"Biggest fan",tendency:c,locale:d}),s[3]=d,s[4]=c,s[5]=l):l=s[5],s[6]!==n||s[7]!==l?(o=(0,t.jsxs)("dl",{className:"grid w-max grid-cols-[auto_auto_auto] items-center gap-x-2 gap-y-1.5 text-overline leading-5",children:[n,l]}),s[6]=n,s[7]=l,s[8]=o):o=s[8],o}function ex(e){var n,l;let o,s,a,i,c,d,u,m,h,f=(0,r.c)(20),{label:p,tendency:g,locale:x}=e;return f[0]!==p?(s=(0,t.jsx)("dt",{className:"text-muted-foreground",children:p}),f[0]=p,f[1]=s):s=f[1],f[2]!==g.judge.author?(a=(0,t.jsx)(C.AuthorIcon,{author:g.judge.author,frame:!0,className:"size-3.5 shrink-0"}),f[2]=g.judge.author,f[3]=a):a=f[3],f[4]!==g.judge?(i=(0,I.galleryModelShortName)(g.judge),f[4]=g.judge,f[5]=i):i=f[5],f[6]!==a||f[7]!==i?(c=(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-foreground",children:[a,i]}),f[6]=a,f[7]=i,f[8]=c):c=f[8],f[9]!==x||f[10]!==g.deviation?(n=x,l=g.deviation,o=(0,F.formatNumber)(Math.abs(l),{locale:n,preset:"fixed-1"})??"—",d=`${l<0?"−":"+"}${o} vs median`,f[9]=x,f[10]=g.deviation,f[11]=d):d=f[11],f[12]!==d?(u=(0,t.jsx)("span",{className:"tabular-nums text-muted-foreground",children:d}),f[12]=d,f[13]=u):u=f[13],f[14]!==c||f[15]!==u?(m=(0,t.jsxs)("dd",{className:"contents",children:[c,u]}),f[14]=c,f[15]=u,f[16]=m):m=f[16],f[17]!==s||f[18]!==m?(h=(0,t.jsxs)(t.Fragment,{children:[s,m]}),f[17]=s,f[18]=m,f[19]=h):h=f[19],h}var eb=e.i(79247),ev=e.i(859672),ej=e.i(394333),ey=e.i(626824),ew=e.i(8842);let e_=(0,ey.createQueryKeys)("arena-source",{text:e=>[e]});async function eN(e,t){let r=await fetch(e,{signal:t});if(!r.ok)throw await r.body?.cancel(),Error(`Source fetch failed with status ${r.status}`);let n=Number(r.headers.get("content-length"));if(Number.isFinite(n)&&n>1048576)throw await r.body?.cancel(),Error("Source exceeds the display limit");return null===r.body?"":eS(r.body,1048576)}async function eS(e,t){let r=e.getReader(),n=new TextDecoder,l=[],o=0;try{for(;;){let{done:e,value:s}=await r.read();if(e)return l.push(n.decode()),l.join("");if((o+=s.byteLength)>t)throw await r.cancel(),Error("Source exceeds the display limit");l.push(n.decode(s,{stream:!0}))}}catch(e){throw await r.cancel().catch(()=>void 0),e}}let ek="image/svg+xml";function eC(e){let n,o,s=(0,r.c)(16),{url:a,mediaType:i,className:c}=e;if(s[0]!==a)n=(0,ew.queryOptions)({queryKey:e_.text(a),queryFn:({signal:e})=>eN(a,e),staleTime:1/0}),s[0]=a,s[1]=n;else n=s[1];let{data:d,isPending:u,isError:m,refetch:h}=(0,eb.useQuery)(n);if(u){let e,r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(ej.Skeleton,{className:"h-40 w-full"}),s[2]=e):e=s[2],s[3]!==c?(r=(0,t.jsx)("div",{className:c,role:"status","aria-live":"polite","aria-label":"Loading generated source",children:e}),s[3]=c,s[4]=r):r=s[4],r}if(m){let e,r,n;return s[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"The generated source could not be loaded."}),s[5]=e):e=s[5],s[6]!==h?(r=(0,t.jsx)(l.Button,{size:"sm",variant:"outline",onClick:()=>void h(),children:"Retry"}),s[6]=h,s[7]=r):r=s[7],s[8]!==c||s[9]!==r?(n=(0,t.jsxs)("div",{className:c,role:"alert",children:[e,r]}),s[8]=c,s[9]=r,s[10]=n):n=s[10],n}let f=i===ek?"SVG source":"Pixel grid source",p=i===ek?"xml":"text";return s[11]!==c||s[12]!==d||s[13]!==f||s[14]!==p?(o=(0,t.jsx)(ev.CodeBlock,{className:c,title:f,rawLanguage:p,value:d}),s[11]=c,s[12]=d,s[13]=f,s[14]=p,s[15]=o):o=s[15],o}var eE=e.i(389097),eP=e.i(164588),eR=e.i(607296),eM=e.i(379497),eO=e.i(988278);function eI(e){let n,l=(0,r.c)(6),{asset:o}=e;if(j(o)&&null===o.thumbnailUrl){let e;return l[0]!==o.url?(e=(0,t.jsx)("video",{src:o.url,muted:!0,playsInline:!0,preload:"metadata",className:"size-full object-cover"}),l[0]=o.url,l[1]=e):e=l[1],e}let s=o.thumbnailUrl??o.url;return l[2]!==o.height||l[3]!==o.width||l[4]!==s?(n=(0,t.jsx)(L.default,{src:s,alt:"",width:o.width,height:o.height,sizes:"152px",loading:"lazy",className:"size-full object-cover"}),l[2]=o.height,l[3]=o.width,l[4]=s,l[5]=n):n=l[5],n}function ez(e){let n,l,o,s,a,i,c,d,u,m,f,p=(0,r.c)(24),{cells:g,index:x,onSelect:b}=e;p[0]!==g?(n=g.flatMap(e$),p[0]=g,p[1]=n):n=p[1];let v=n,j=(0,h.useRef)(null),y=(0,h.useRef)(null);p[2]===Symbol.for("react.memo_cache_sentinel")?(l={top:!1,bottom:!1},p[2]=l):l=p[2];let[_,N]=(0,h.useState)(l);p[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=y.current;if(!e)return;let t={top:e.scrollTop>1,bottom:e.scrollTop+e.clientHeighte.top===t.top&&e.bottom===t.bottom?e:t)},p[3]=o):o=p[3];let S=o;if(p[4]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{j.current?.scrollIntoView({block:"nearest",inline:"nearest"}),S()},p[4]=s):s=p[4],p[5]!==x?(a=[x,S],p[5]=x,p[6]=a):a=p[6],(0,h.useEffect)(s,a),p[7]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{S();let e=y.current;if(!e||"u"t.disconnect()},p[7]=i):i=p[7],p[8]!==v.length?(c=[v.length,S],p[8]=v.length,p[9]=c):c=p[9],(0,h.useEffect)(i,c),v.length<2)return null;let k=_.top?"transparent 0, #000 2.5rem":"#000 0",E=_.bottom?"#000 calc(100% - 2.5rem), transparent 100%":"#000 100%";p[10]!==k||p[11]!==E?(d=[k,E],p[10]=k,p[11]=E,p[12]=d):d=p[12];let P=d.join(", ");p[13]!==_.bottom||p[14]!==_.top||p[15]!==P?(u=_.top||_.bottom?{maskImage:`linear-gradient(to bottom, ${P})`,WebkitMaskImage:`linear-gradient(to bottom, ${P})`}:void 0,p[13]=_.bottom,p[14]=_.top,p[15]=P,p[16]=u):u=p[16];let R=u;return p[17]!==x||p[18]!==v||p[19]!==b?(m=v.map(e=>{let{asset:r,at:n,cell:l}=e,o=n===x;return(0,t.jsxs)("button",{ref:o?j:void 0,type:"button",onClick:()=>b(n),"aria-label":`View ${l.model.name} output`,"aria-current":o?"true":void 0,className:"group w-full shrink-0 cursor-pointer text-left focus-visible:outline-none",children:[(0,t.jsx)("div",{className:(0,w.cn)("overflow-hidden rounded-sm border transition-colors",o?"border-transparent ring-2 ring-focus-border ring-offset-2 ring-offset-popover":"border-border group-hover:border-focus-border"),style:{aspectRatio:`${r.width} / ${r.height}`},children:(0,t.jsx)(eI,{asset:r})}),(0,t.jsxs)("div",{className:"mt-1 flex min-w-0 items-center gap-1",children:[(0,t.jsx)(C.AuthorIcon,{author:l.model.author,frame:!0,className:"size-3.5"}),(0,t.jsx)("span",{className:(0,w.cn)("min-w-0 truncate text-overline leading-tight",o?"font-medium text-foreground":"text-muted-foreground"),children:(0,I.galleryModelLabel)(l.model)})]})]},l.id)}),p[17]=x,p[18]=v,p[19]=b,p[20]=m):m=p[20],p[21]!==R||p[22]!==m?(f=(0,t.jsx)("nav",{ref:y,"aria-label":"Other models",onScroll:S,style:R,className:"hidden h-[min(60dvh,60vh)] w-[9.5rem] shrink-0 flex-col gap-2 overflow-y-auto scroll-py-10 p-1 lg:flex",children:m}),p[21]=R,p[22]=m,p[23]=f):f=p[23],f}function e$(e,t){return null===e.asset?[]:[{asset:e.asset,at:t,cell:e}]}function eB(e){let n,l,o,s,a,i,c=(0,r.c)(18),{asset:d,alt:u}=e,[m,f]=(0,h.useState)(!1);c[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{if(null===e)return;let t=()=>f(!0);return e.complete&&t(),e.addEventListener("load",t),e.addEventListener("error",t),()=>{e.removeEventListener("load",t),e.removeEventListener("error",t)}},c[0]=n):n=c[0];let p=n;if(j(d)){let e;return c[1]!==u||c[2]!==d?(e=(0,t.jsx)(eA,{asset:d,alt:u}),c[1]=u,c[2]=d,c[3]=e):e=c[3],e}let g=`${d.width} / ${d.height}`;c[4]!==g?(l={aspectRatio:g},c[4]=g,c[5]=l):l=c[5],c[6]!==m?(o=!m&&(0,t.jsx)("span",{"aria-hidden":"true","data-slot":"lightbox-media-pending",className:"absolute inset-0 animate-pulse bg-muted/60"}),c[6]=m,c[7]=o):o=c[7];let x=d.url,b=m?"opacity-100":"opacity-0";return c[8]!==b?(s=(0,w.cn)("object-contain transition-opacity duration-200",b),c[8]=b,c[9]=s):s=c[9],c[10]!==u||c[11]!==d.url||c[12]!==s?(a=(0,t.jsx)(L.default,{ref:p,src:x,alt:u,fill:!0,sizes:"(min-width: 1024px) 860px, calc(100vw - 4rem)",className:s}),c[10]=u,c[11]=d.url,c[12]=s,c[13]=a):a=c[13],c[14]!==l||c[15]!==o||c[16]!==a?(i=(0,t.jsxs)("figure",{"data-slot":"lightbox-media-frame",className:"relative w-[min(var(--lightbox-frame-width),var(--lightbox-frame-height-width),100%)] shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",style:l,children:[o,a]}),c[14]=l,c[15]=o,c[16]=a,c[17]=i):i=c[17],i}function eA(e){let n,l,o,s=(0,r.c)(9),{asset:a,alt:i}=e,c=`${a.width} / ${a.height}`;s[0]!==c?(n={aspectRatio:c},s[0]=c,s[1]=n):n=s[1];let d=a.thumbnailUrl??void 0;return s[2]!==i||s[3]!==a.url||s[4]!==d?(l=(0,t.jsx)("video",{src:a.url,poster:d,controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-label":i,className:"absolute inset-0 size-full object-contain"}),s[2]=i,s[3]=a.url,s[4]=d,s[5]=l):l=s[5],s[6]!==n||s[7]!==l?(o=(0,t.jsx)("figure",{"data-slot":"lightbox-media-frame",className:"relative w-[min(var(--lightbox-frame-width),var(--lightbox-frame-height-width),100%)] shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",style:n,children:l}),s[6]=n,s[7]=l,s[8]=o):o=s[8],o}var eL=e.i(324872),eT=e.i(325100);e.i(250238);var eH=e.i(373641),eD=e.i(99074);function eG(e){let l,o,s,c=(0,r.c)(16),{judges:d,className:u}=e,m=(0,i.useLocale)(),h=(0,a.usePosthogClient)();if(c[0]!==u||c[1]!==d||c[2]!==m||c[3]!==h){let e,r,s=[...d].sort(eF);c[6]!==h?(e=e=>{h.capture(n.PostHogEvent.OpenBenchmarkExploreQualityJudgeRatings,{judge:e.id,score:e.score})},c[6]=h,c[7]=e):e=c[7];let a=e;c[8]!==u?(l=(0,w.cn)("flex flex-col gap-1.5",u),c[8]=u,c[9]=l):l=c[9],c[10]!==m||c[11]!==a?(r=(e,r)=>(0,t.jsx)(eq,{judge:e,locale:m,defaultOpen:0===r,onOpen:a},e.id),c[10]=m,c[11]=a,c[12]=r):r=c[12],o=s.map(r),c[0]=u,c[1]=d,c[2]=m,c[3]=h,c[4]=l,c[5]=o}else l=c[4],o=c[5];return c[13]!==l||c[14]!==o?(s=(0,t.jsx)("ul",{className:l,children:o}),c[13]=l,c[14]=o,c[15]=s):s=c[15],s}function eF(e,t){return t.score-e.score}function eq(e){let n,l,o,s,a,i,c,d,u,m,h,f,p,g=(0,r.c)(35),{judge:x,locale:v,defaultOpen:j,onOpen:y}=e;if(g[0]!==x||g[1]!==y?(n=e=>{e&&y(x)},g[0]=x,g[1]=y,g[2]=n):n=g[2],g[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,w.cn)("flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-overline leading-5","rounded-md focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none"),g[3]=l):l=g[3],g[4]!==x.author?(o=(0,t.jsx)(C.AuthorIcon,{author:x.author,frame:!0,className:"size-3.5 shrink-0"}),g[4]=x.author,g[5]=o):o=g[5],g[6]!==x?(s=(0,I.galleryModelShortName)(x),g[6]=x,g[7]=s):s=g[7],g[8]!==s?(a=(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:s}),g[8]=s,g[9]=a):a=g[9],g[10]!==x.score?(i=(0,w.cn)("shrink-0 tabular-nums",eV[b(x.score)]),g[10]=x.score,g[11]=i):i=g[11],g[12]!==x.score||g[13]!==v?(c=eK(v,x.score),g[12]=x.score,g[13]=v,g[14]=c):c=g[14],g[15]!==i||g[16]!==c?(d=(0,t.jsx)("span",{className:i,children:c}),g[15]=i,g[16]=c,g[17]=d):d=g[17],g[18]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(eD.ChevronDown,{className:"size-3.5 shrink-0 text-faint transition-transform group-data-open:rotate-180"}),g[18]=u):u=g[18],g[19]!==o||g[20]!==a||g[21]!==d?(m=(0,t.jsxs)(eH.CollapsibleTrigger,{className:l,children:[o,a,d,u]}),g[19]=o,g[20]=a,g[21]=d,g[22]=m):m=g[22],g[23]!==x.ratings||g[24]!==v){let e;g[26]!==v?(e=e=>(0,t.jsx)(eU,{rating:e,locale:v},e.label),g[26]=v,g[27]=e):e=g[27],h=x.ratings.map(e),g[23]=x.ratings,g[24]=v,g[25]=h}else h=g[25];return g[28]!==h?(f=(0,t.jsx)(eH.CollapsibleContent,{children:(0,t.jsx)("ul",{className:"flex flex-col gap-1.5 border-t border-border px-2.5 py-2",children:h})}),g[28]=h,g[29]=f):f=g[29],g[30]!==j||g[31]!==n||g[32]!==m||g[33]!==f?(p=(0,t.jsx)("li",{children:(0,t.jsxs)(eH.Collapsible,{defaultOpen:j,onOpenChange:n,className:"group rounded-md border border-border",children:[m,f]})}),g[30]=j,g[31]=n,g[32]=m,g[33]=f,g[34]=p):p=g[34],p}function eU(e){let n,l,o,s,a,i,c=(0,r.c)(16),{rating:d,locale:u}=e;return c[0]!==d.score?(n=(0,w.cn)("tabular-nums",eV[b(d.score)]),c[0]=d.score,c[1]=n):n=c[1],c[2]!==u||c[3]!==d.score?(l=eK(u,d.score),c[2]=u,c[3]=d.score,c[4]=l):l=c[4],c[5]!==n||c[6]!==l?(o=(0,t.jsx)("span",{className:n,children:l}),c[5]=n,c[6]=l,c[7]=o):o=c[7],c[8]!==d.label?(s=(0,t.jsx)("span",{className:"whitespace-nowrap text-foreground",children:d.label}),c[8]=d.label,c[9]=s):s=c[9],c[10]!==d.reason?(a=void 0!==d.reason&&(0,t.jsx)("span",{className:"col-start-2 text-muted-foreground sm:col-start-3",children:d.reason}),c[10]=d.reason,c[11]=a):a=c[11],c[12]!==o||c[13]!==s||c[14]!==a?(i=(0,t.jsxs)("li",{className:"grid grid-cols-[1.75rem_1fr] gap-x-2 text-overline leading-5 sm:grid-cols-[1.75rem_auto_1fr]",children:[o,s,a]}),c[12]=o,c[13]=s,c[14]=a,c[15]=i):i=c[15],i}let eV={positive:"text-positive",warning:"text-warning",negative:"text-negative"};function eK(e,t){return(0,F.formatNumber)(t,{locale:e,preset:"fixed-1"})??"—"}var eW=e.i(498885);function eQ(e){var n,o;let s,a,i,c,d,u,m,f,g,x,b,v,j,y,_,N,S,E,R,M,z,$,B,A,L,T,H,D,G,F,U,K,W,Q,J,X,Y,Z,ee,et,el,eo,es,ea,ei,ec,ed,eu,em,eh,ef,ep,eg,ex,eb,ev=(0,r.c)(156),{cells:ej,index:ey,showScore:ew,showQuality:e_,prompt:eN,chatReferences:eS,scenarioHeading:ek,onClose:eI,onIndex:e$,onStep:eA,onOpenModel:eH,onCopyLink:eD,onTryChat:eF,onModelCta:eq,onToggleSource:eU}=e,{isCopied:eV,copyToClipboard:eK}=(0,eP.useCopyToClipboard)(),[eQ,eZ]=(0,h.useState)(!0),[e1,e0]=(0,h.useState)(null),e2=e1!==ey,e3=(0,h.useRef)(null);ev[0]!==ej?(a=ej.flatMap(eJ),ev[0]=ej,ev[1]=a):a=ev[1];let e4=a,e5=e4.indexOf(ey),e6=ej[ey];ev[2]!==ej||ev[3]!==ey||ev[4]!==e$||ev[5]!==eA||ev[6]!==e5||ev[7]!==e4?(i=(e,t)=>{if(-1===e5)return;let r=e4[(e5+e+e4.length)%e4.length],n=void 0===r?void 0:ej[r];void 0!==r&&r!==ey&&n&&(eA({direction:e>0?"next":"previous",modelId:n.model.id,input:t}),e0(null),e$(r))},ev[2]=ej,ev[3]=ey,ev[4]=e$,ev[5]=eA,ev[6]=e5,ev[7]=e4,ev[8]=i):i=ev[8];let e7=i;ev[9]!==e7?(c=e=>e7(e,"keyboard"),ev[9]=e7,ev[10]=c):c=ev[10];let e8=c;ev[11]!==e8?(d={onStep:e8},ev[11]=e8,ev[12]=d):d=ev[12],(0,eW.useMediaGalleryLightboxArrowKeys)(d),ev[13]!==ej||ev[14]!==ey||ev[15]!==e$||ev[16]!==eA?(u=e=>{let t=ej[e];e!==ey&&t&&(eA({direction:e>ey?"next":"previous",modelId:t.model.id,input:"thumbnail"}),e0(null),e$(e))},ev[13]=ej,ev[14]=ey,ev[15]=e$,ev[16]=eA,ev[17]=u):u=ev[17];let e9=u;ev[18]!==eK||ev[19]!==eD?(m=()=>{eD(),eK(window.location.href)},ev[18]=eK,ev[19]=eD,ev[20]=m):m=ev[20];let te=m;ev[21]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{null===e3.current&&(e3.current=e,eZ(!1))},ev[21]=f):f=ev[21];let tt=f;ev[22]!==ey||ev[23]!==e2||ev[24]!==eU?(g=()=>{let e=!e2;e0(e?null:ey),eU(e)},ev[22]=ey,ev[23]=e2,ev[24]=eU,ev[25]=g):g=ev[25];let tr=g;if(!e6?.asset)return null;let tn=e4.length>1;ev[26]!==e6.asset||ev[27]!==tn?(n=e6.asset,o=tn,s=60*n.width/n.height,x={"--lightbox-frame-width":`${n.width}px`,"--lightbox-frame-height-width":`${s}dvh`,"--lightbox-rail-allowance":o?"12.25rem":"2rem"},ev[26]=e6.asset,ev[27]=tn,ev[28]=x):x=ev[28];let tl=x;ev[29]===Symbol.for("react.memo_cache_sentinel")?(b=(e,t)=>{e?eZ(!0):"escape-key"===t.reason?tt("escape"):"outside-press"===t.reason&&tt("scrim")},ev[29]=b):b=ev[29],ev[30]!==eI?(v=e=>{e||null===e3.current||eI(e3.current)},ev[30]=eI,ev[31]=v):v=ev[31];let to=`${e6.model.name} output`;ev[32]===Symbol.for("react.memo_cache_sentinel")?(j=(0,w.cn)("flex max-h-[calc(100dvh-2rem)] w-full max-w-[min(calc(100vw-2rem),calc(min(var(--lightbox-frame-width),var(--lightbox-frame-height-width))+2rem))] flex-col gap-3 overflow-y-auto rounded-xl p-4 lg:max-w-[min(calc(100vw-2rem),calc(min(var(--lightbox-frame-width),var(--lightbox-frame-height-width))+var(--lightbox-rail-allowance)))]",eX),ev[32]=j):j=ev[32],ev[33]!==e6.model.author?(y=(0,t.jsx)(C.AuthorIcon,{author:e6.model.author,frame:!0,className:"size-6"}),ev[33]=e6.model.author,ev[34]=y):y=ev[34],ev[35]!==e6.model?(_=(0,O.getGalleryModelHref)(e6.model),ev[35]=e6.model,ev[36]=_):_=ev[36];let ts=e6.model.name;ev[37]!==e6.model?(N=(0,I.galleryModelLabel)(e6.model),ev[37]=e6.model,ev[38]=N):N=ev[38],ev[39]!==e6.model.name||ev[40]!==eH||ev[41]!==_||ev[42]!==N?(S=(0,t.jsx)(P.Link,{href:_,onClick:eH,prefetch:!1,className:"block truncate rounded-sm text-heading font-medium leading-tight transition-colors hover:underline focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",title:ts,children:N}),ev[39]=e6.model.name,ev[40]=eH,ev[41]=_,ev[42]=N,ev[43]=S):S=ev[43],ev[44]!==e6.provider?(E=null===e6.provider?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),e6.provider]}),ev[44]=e6.provider,ev[45]=E):E=ev[45],ev[46]!==e6.model.author||ev[47]!==E?(R=(0,t.jsxs)("p",{className:"flex items-center gap-1.5 truncate text-overline text-muted-foreground",children:[e6.model.author,E]}),ev[46]=e6.model.author,ev[47]=E,ev[48]=R):R=ev[48],ev[49]!==S||ev[50]!==R?(M=(0,t.jsxs)("div",{className:"min-w-0",children:[S,R]}),ev[49]=S,ev[50]=R,ev[51]=M):M=ev[51],ev[52]!==y||ev[53]!==M?(z=(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[y,M]}),ev[52]=y,ev[53]=M,ev[54]=z):z=ev[54],ev[55]===Symbol.for("react.memo_cache_sentinel")?($=()=>tt("button"),ev[55]=$):$=ev[55],ev[56]!==e6.source||ev[57]!==e2||ev[58]!==tr?(B=void 0===e6.source?void 0:{isShown:e2,onToggle:tr},ev[56]=e6.source,ev[57]=e2,ev[58]=tr,ev[59]=B):B=ev[59],ev[60]!==te||ev[61]!==eV||ev[62]!==B?(A=(0,t.jsx)(eT.MediaGalleryOutputControls,{isCopied:eV,onCopyLink:te,onClose:$,source:B}),ev[60]=te,ev[61]=eV,ev[62]=B,ev[63]=A):A=ev[63],ev[64]!==z||ev[65]!==A?(L=(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[z,A]}),ev[64]=z,ev[65]=A,ev[66]=L):L=ev[66];let ta=e6.asset.url,ti=e6.asset,tc=e6.model.name;ev[67]!==ek?(T=ek.toLowerCase(),ev[67]=ek,ev[68]=T):T=ev[68];let td=`${tc} rendering of the ${T} prompt, full size`;ev[69]!==e6.asset||ev[70]!==td?(H=(0,t.jsx)("div",{className:"flex min-w-0 flex-1 items-start justify-center",children:(0,t.jsx)(eB,{asset:ti,alt:td},ta)}),ev[69]=e6.asset,ev[70]=td,ev[71]=H):H=ev[71],ev[72]!==ej||ev[73]!==ey||ev[74]!==e9?(D=(0,t.jsx)(ez,{cells:ej,index:ey,onSelect:e9}),ev[72]=ej,ev[73]=ey,ev[74]=e9,ev[75]=D):D=ev[75],ev[76]!==H||ev[77]!==D?(G=(0,t.jsxs)("div",{"data-slot":"lightbox-media-row",className:"flex shrink-0 flex-col gap-3 lg:flex-row",children:[H,D]}),ev[76]=H,ev[77]=D,ev[78]=G):G=ev[78],ev[79]!==e6?(F=(0,t.jsx)(eY,{cell:e6}),ev[79]=e6,ev[80]=F):F=ev[80],ev[81]!==e6.score||ev[82]!==ew?(U=ew&&void 0!==e6.score&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Correctness "}),(0,t.jsx)(er,{score:e6.score})]})]}),ev[81]=e6.score,ev[82]=ew,ev[83]=U):U=ev[83],ev[84]!==e6.quality||ev[85]!==e_?(K=e_&&void 0!==e6.quality&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Quality "}),(0,t.jsx)(V,{quality:e6.quality})]})]}),ev[84]=e6.quality,ev[85]=e_,ev[86]=K):K=ev[86],ev[87]===Symbol.for("react.memo_cache_sentinel")?(W=(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),ev[87]=W):W=ev[87],ev[88]!==e6.asset.height||ev[89]!==e6.asset.width?(Q=(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e6.asset.width,"×",e6.asset.height]}),ev[88]=e6.asset.height,ev[89]=e6.asset.width,ev[90]=Q):Q=ev[90],ev[91]!==e6.reasoningEffort?(J=void 0!==e6.reasoningEffort&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Reasoning "}),e6.reasoningEffort]})]}),ev[91]=e6.reasoningEffort,ev[92]=J):J=ev[92],ev[93]!==e7?(X=()=>e7(-1,"button"),ev[93]=e7,ev[94]=X):X=ev[94],ev[95]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,t.jsx)(eR.ChevronLeft,{className:"size-4"}),ev[95]=Y):Y=ev[95],ev[96]!==X?(Z=(0,t.jsx)(l.Button,{variant:"outline",size:"icon",onClick:X,"aria-label":"Previous output",children:Y}),ev[96]=X,ev[97]=Z):Z=ev[97],ev[98]!==e7?(ee=()=>e7(1,"button"),ev[98]=e7,ev[99]=ee):ee=ev[99],ev[100]===Symbol.for("react.memo_cache_sentinel")?(et=(0,t.jsx)(eM.ChevronRight,{className:"size-4"}),ev[100]=et):et=ev[100],ev[101]!==ee?(el=(0,t.jsx)(l.Button,{variant:"outline",size:"icon",onClick:ee,"aria-label":"Next output",children:et}),ev[101]=ee,ev[102]=el):el=ev[102],ev[103]!==Z||ev[104]!==el?(eo=(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[Z,el]}),ev[103]=Z,ev[104]=el,ev[105]=eo):eo=ev[105],ev[106]!==F||ev[107]!==U||ev[108]!==K||ev[109]!==Q||ev[110]!==J||ev[111]!==eo?(es=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-body tabular-nums",children:[F,U,K,W,Q,J,eo]}),ev[106]=F,ev[107]=U,ev[108]=K,ev[109]=Q,ev[110]=J,ev[111]=eo,ev[112]=es):es=ev[112],ev[113]!==e6.score||ev[114]!==ew?(ea=ew&&void 0!==e6.score&&e6.score.total>1&&(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("p",{className:"mb-1.5 text-overline font-medium text-muted-foreground",children:[e6.score.score," of ",e6.score.total," checks passed"]}),(0,t.jsx)(en,{score:e6.score})]}),ev[113]=e6.score,ev[114]=ew,ev[115]=ea):ea=ev[115],ev[116]!==e6.quality||ev[117]!==e_?(ei=e_&&void 0!==e6.quality&&(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-overline font-medium text-muted-foreground",children:"Quality Score out of 10"}),(0,t.jsx)(eG,{judges:e6.quality.judges,className:"max-w-lg"}),(0,t.jsx)("p",{className:"mt-1.5 text-overline leading-5 text-muted-foreground",children:q})]}),ev[116]=e6.quality,ev[117]=e_,ev[118]=ei):ei=ev[118],ev[119]===Symbol.for("react.memo_cache_sentinel")?(ec=(0,w.cn)("max-h-[5lh] min-w-0 overflow-y-auto rounded-sm text-body leading-relaxed text-muted-foreground focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none",eX),ev[119]=ec):ec=ev[119],ev[120]!==eN?(ed=(0,t.jsx)("p",{tabIndex:0,"data-slot":"lightbox-prompt",className:ec,children:eN}),ev[120]=eN,ev[121]=ed):ed=ev[121],ev[122]!==e6.model||ev[123]!==eq?(eu=(0,t.jsx)(eL.MediaGalleryModelCta,{model:e6.model,onClickCta:eq}),ev[122]=e6.model,ev[123]=eq,ev[124]=eu):eu=ev[124];let tu=e6.model;return ev[125]!==e6||ev[126]!==eS?(em=(0,p.getGalleryChatReferences)(e6,eS),ev[125]=e6,ev[126]=eS,ev[127]=em):em=ev[127],ev[128]!==e6.model||ev[129]!==eF||ev[130]!==eN||ev[131]!==em?(eh=(0,t.jsx)(eO.MediaGalleryChatCta,{model:tu,prompt:eN,references:em,onTryChat:eF}),ev[128]=e6.model,ev[129]=eF,ev[130]=eN,ev[131]=em,ev[132]=eh):eh=ev[132],ev[133]!==eu||ev[134]!==eh?(ef=(0,t.jsxs)("div",{className:"flex w-full shrink-0 flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[eu,eh]}),ev[133]=eu,ev[134]=eh,ev[135]=ef):ef=ev[135],ev[136]!==ed||ev[137]!==ef?(ep=(0,t.jsxs)("div",{className:"flex flex-col items-start gap-3 border-t border-border pt-3 sm:flex-row sm:justify-between",children:[ed,ef]}),ev[136]=ed,ev[137]=ef,ev[138]=ep):ep=ev[138],ev[139]!==e6.source||ev[140]!==e2?(eg=void 0!==e6.source&&e2&&(0,t.jsx)("div",{"data-slot":"lightbox-source",className:"border-t border-border pt-3",children:(0,t.jsx)(eC,{url:e6.source.url,mediaType:e6.source.mediaType,className:"max-h-[40dvh] overflow-y-auto"})}),ev[139]=e6.source,ev[140]=e2,ev[141]=eg):eg=ev[141],ev[142]!==tl||ev[143]!==to||ev[144]!==L||ev[145]!==G||ev[146]!==es||ev[147]!==ea||ev[148]!==ei||ev[149]!==ep||ev[150]!==eg?(ex=(0,t.jsxs)(eE.DialogContent,{"aria-label":to,showCloseButton:!1,keepMounted:!1,className:j,style:tl,children:[L,G,es,ea,ei,ep,eg]}),ev[142]=tl,ev[143]=to,ev[144]=L,ev[145]=G,ev[146]=es,ev[147]=ea,ev[148]=ei,ev[149]=ep,ev[150]=eg,ev[151]=ex):ex=ev[151],ev[152]!==eQ||ev[153]!==v||ev[154]!==ex?(eb=(0,t.jsx)(eE.Dialog,{open:eQ,onOpenChange:b,onOpenChangeComplete:v,children:ex}),ev[152]=eQ,ev[153]=v,ev[154]=ex,ev[155]=eb):eb=ev[155],eb}function eJ(e,t){return e.asset?[t]:[]}let eX="[scrollbar-color:hsl(var(--muted-foreground))_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/30 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5";function eY(e){let n,l,o,s,a,c,d,u,m=(0,r.c)(16),{cell:h}=e,f=(0,i.useLocale)();return m[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cost "}),m[0]=n):n=m[0],m[1]!==h.costUsd||m[2]!==f?(l=(0,M.formatCost)(f,h.costUsd),m[1]=h.costUsd,m[2]=f,m[3]=l):l=m[3],m[4]!==l?(o=(0,t.jsxs)("span",{children:[n,l]}),m[4]=l,m[5]=o):o=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(k.DotSeparator,{className:"text-muted-foreground/40"}),a=(0,t.jsx)("span",{className:"text-muted-foreground",children:"Generation Time "}),m[6]=s,m[7]=a):(s=m[6],a=m[7]),m[8]!==h.durationMs||m[9]!==f?(c=(0,v.formatGenerationDuration)(f,h.durationMs),m[8]=h.durationMs,m[9]=f,m[10]=c):c=m[10],m[11]!==c?(d=(0,t.jsxs)("span",{children:[a,c]}),m[11]=c,m[12]=d):d=m[12],m[13]!==o||m[14]!==d?(u=(0,t.jsxs)(t.Fragment,{children:[o,s,d]}),m[13]=o,m[14]=d,m[15]=u):u=m[15],u}var eZ=e.i(157266),e1=e.i(678915),e0=e.i(249656);function e2(e){let n,o,s,a,i,c,d=(0,r.c)(16),{references:u,onOpenReference:m}=e,[f,p]=(0,h.useState)(null);if(!u||0===u.length)return null;if(d[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("div",{className:"text-overline font-medium uppercase tracking-wider text-muted-foreground/70",children:"INPUT REFERENCES"}),d[0]=n):n=d[0],d[1]!==m||d[2]!==u){let e;d[4]!==m||d[5]!==u.length?(e=(e,r)=>(0,t.jsxs)(l.Button,{variant:"ghost",onClick:()=>{m(),p(r)},"aria-label":`Expand reference ${r+1} of ${u.length}`,className:"group relative h-auto w-auto shrink-0 p-1",children:[(0,t.jsx)(e4,{reference:e,index:r,count:u.length}),(0,t.jsx)("span",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)($.Maximize2,{className:"size-4 text-foreground drop-shadow"})})]},e.url),d[4]=m,d[5]=u.length,d[6]=e):e=d[6],o=u.map(e),d[1]=m,d[2]=u,d[3]=o}else o=d[3];return d[7]!==o?(s=(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:o}),d[7]=o,d[8]=s):s=d[8],d[9]===Symbol.for("react.memo_cache_sentinel")?(a=()=>p(null),d[9]=a):a=d[9],d[10]!==f||d[11]!==u?(i=(0,t.jsx)(e5,{references:u,index:f,onIndex:p,onClose:a}),d[10]=f,d[11]=u,d[12]=i):i=d[12],d[13]!==s||d[14]!==i?(c=(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[n,s,i]}),d[13]=s,d[14]=i,d[15]=c):c=d[15],c}let e3="size-16 rounded-md border border-border bg-muted/30 object-contain transition-opacity group-hover:opacity-80";function e4(e){let n,l=(0,r.c)(9),{reference:o,index:s,count:a}=e;if(y(o)){let e;if(null!==o.thumbnailUrl){let e,r=`Reference video ${s+1} of ${a} sent with this prompt`;return l[0]!==o.thumbnailUrl||l[1]!==r?(e=(0,t.jsx)(L.default,{src:o.thumbnailUrl,alt:r,width:64,height:64,sizes:"64px",className:e3}),l[0]=o.thumbnailUrl,l[1]=r,l[2]=e):e=l[2],e}let r=`Reference video ${s+1} of ${a} sent with this prompt`;return l[3]!==o.url||l[4]!==r?(e=(0,t.jsx)("video",{src:o.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":r,className:e3}),l[3]=o.url,l[4]=r,l[5]=e):e=l[5],e}let i=`Reference image ${s+1} of ${a} sent with this prompt`;return l[6]!==o.url||l[7]!==i?(n=(0,t.jsx)(L.default,{src:o.url,alt:i,width:64,height:64,sizes:"64px",className:e3}),l[6]=o.url,l[7]=i,l[8]=n):n=l[8],n}function e5(e){let n,l=(0,r.c)(5),{references:o,index:s,onIndex:a,onClose:i}=e;return null!==s&&o[s]?(l[0]!==s||l[1]!==i||l[2]!==a||l[3]!==o?(n=(0,t.jsx)(e6,{references:o,index:s,onIndex:a,onClose:i}),l[0]=s,l[1]=i,l[2]=a,l[3]=o,l[4]=n):n=l[4],n):null}function e6(e){let n,o,s,a,i,c,d,u,m,f,p=(0,r.c)(27),{references:g,index:x,onIndex:b,onClose:v}=e,[j,w]=(0,h.useState)(!0);p[0]!==x||p[1]!==b||p[2]!==g.length?(n=e=>b((x+e+g.length)%g.length),p[0]=x,p[1]=b,p[2]=g.length,p[3]=n):n=p[3];let _=n;p[4]!==_?(o={onStep:_},p[4]=_,p[5]=o):o=p[5],(0,eW.useMediaGalleryLightboxArrowKeys)(o),p[6]===Symbol.for("react.memo_cache_sentinel")?(s=()=>w(!1),p[6]=s):s=p[6];let N=s,S=g[x];if(!S)return null;p[7]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{w(e)},p[7]=a):a=p[7],p[8]!==v?(i=e=>{e||v()},p[8]=v,p[9]=i):i=p[9];let k=`Reference ${x+1} of ${g.length}`;return p[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(l.Button,{variant:"outline",size:"icon",onClick:N,"aria-label":"Close",className:"absolute right-6 top-6 z-10 bg-popover/90 backdrop-blur-sm",children:(0,t.jsx)(e0.X,{className:"size-4"})}),p[10]=c):c=p[10],p[11]!==x||p[12]!==S||p[13]!==g.length?(d=y(S)?(0,t.jsx)("video",{src:S.url,poster:S.thumbnailUrl??void 0,controls:!0,muted:!0,playsInline:!0,"aria-label":`Reference video ${x+1} of ${g.length}`,className:"max-h-[70vh] w-full rounded-lg border border-border object-contain"}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("img",{src:S.url,alt:`Reference image ${x+1} of ${g.length}`,className:"max-h-[70vh] w-full rounded-lg border border-border object-contain"})}),p[11]=x,p[12]=S,p[13]=g.length,p[14]=d):d=p[14],p[15]!==x||p[16]!==g.length||p[17]!==_?(u=g.length>1?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-body text-muted-foreground",children:[x+1," of ",g.length]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(l.Button,{variant:"outline",size:"icon-sm",onClick:()=>_(-1),"aria-label":"Previous reference",children:(0,t.jsx)(eZ.ArrowLeft,{className:"size-4"})}),(0,t.jsx)(l.Button,{variant:"outline",size:"icon-sm",onClick:()=>_(1),"aria-label":"Next reference",children:(0,t.jsx)(e1.ArrowRight,{className:"size-4"})})]})]}):null,p[15]=x,p[16]=g.length,p[17]=_,p[18]=u):u=p[18],p[19]!==k||p[20]!==d||p[21]!==u?(m=(0,t.jsxs)(eE.DialogContent,{"aria-label":k,showCloseButton:!1,keepMounted:!1,className:"flex max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-[900px] flex-col gap-3 overflow-y-auto p-4",children:[c,d,u]}),p[19]=k,p[20]=d,p[21]=u,p[22]=m):m=p[22],p[23]!==j||p[24]!==m||p[25]!==i?(f=(0,t.jsx)(eE.Dialog,{open:j,onOpenChange:a,onOpenChangeComplete:i,children:m}),p[23]=j,p[24]=m,p[25]=i,p[26]=f):f=p[26],f}var e7=e.i(75534),e8=e.i(33706);function e9(e){return!e.asset}function te(e){return null!==e.asset}function tt(e){return e.cells}function tr(e){return e.cells}function tn(e){return e.cells.some(tl)}function tl(e){return null!==e.asset&&j(e.asset)}function to(e){return e.setting}function ts(e){let n,l,s,a,i=(0,r.c)(12),{label:c,options:d,active:u,onSelect:m}=e;if(d.length<2)return null;i[0]!==c?(n=(0,t.jsx)("span",{className:"w-[3.5rem] shrink-0 text-body text-muted-foreground",children:c}),i[0]=c,i[1]=n):n=i[1];let h=u??"";return i[2]!==d?(l=d.map(ta),i[2]=d,i[3]=l):l=i[3],i[4]!==c||i[5]!==m||i[6]!==h||i[7]!==l?(s=(0,t.jsx)(o.SegmentedControl,{"aria-label":c,value:h,onValueChange:m,className:"min-w-0 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:l}),i[4]=c,i[5]=m,i[6]=h,i[7]=l,i[8]=s):s=i[8],i[9]!==n||i[10]!==s?(a=(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[n,s]}),i[9]=n,i[10]=s,i[11]=a):a=i[11],a}function ta(e){return(0,t.jsx)(o.SegmentedControlItem,{value:e,className:"shrink-0 text-body",children:e},e)}function ti(e){let n,o,s,a,i=(0,r.c)(8),{cells:c,active:d,onSelect:u}=e;i[0]!==c?(n=c.filter(td).slice(0,3).map(tc),i[0]=c,i[1]=n):n=i[1];let h=n;return d||h.length<2?null:(i[2]!==u||i[3]!==h?(o=()=>u(h),i[2]=u,i[3]=h,i[4]=o):o=i[4],i[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(m,{}),i[5]=s):s=i[5],i[6]!==o?(a=(0,t.jsxs)(l.Button,{variant:"default",size:"sm",className:"ml-auto",onClick:o,children:[s,"Select models to try in chat"]}),i[6]=o,i[7]=a):a=i[7],a)}function tc(e){return e.model.id}function td(e){return null!==e.asset}function tu(e){let n,a,i,c,m,h,f,p,g,x,b,j,y,w,N,S,k=(0,r.c)(44),{keys:C,sortKey:E,dir:P,onSort:R}=e,M="asc"===P?u.ArrowUp:d.ArrowDown;if(k[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("span",{className:"mr-1 text-body text-muted-foreground",children:"Sort by"}),k[0]=n):n=k[0],k[1]!==R?(a=e=>{let t=(0,v.parseSortKey)(e);t&&R(t,"buttons")},k[1]=R,k[2]=a):a=k[2],k[3]!==M||k[4]!==C||k[5]!==E){let e;k[7]!==M||k[8]!==E?(e=e=>(0,t.jsxs)(o.SegmentedControlItem,{value:e,"aria-label":`Sort by ${v.SORT_LABELS[e]}`,className:"text-body",children:[v.SORT_LABELS[e],E===e&&(0,t.jsx)(M,{className:"size-3.5 shrink-0"})]},e),k[7]=M,k[8]=E,k[9]=e):e=k[9],i=C.map(e),k[3]=M,k[4]=C,k[5]=E,k[6]=i}else i=k[6];k[10]!==E||k[11]!==a||k[12]!==i?(c=(0,t.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[n,(0,t.jsx)(o.SegmentedControl,{"aria-label":"Sort image outputs",value:E,onValueChange:a,children:i})]}),k[10]=E,k[11]=a,k[12]=i,k[13]=c):c=k[13],k[14]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("span",{className:_,children:"Sort by"}),k[14]=m):m=k[14],k[15]!==R?(h=e=>{let t=(0,v.parseSortKey)(e);t&&R(t,"select")},k[15]=R,k[16]=h):h=k[16];let O=`Sort by ${v.SORT_LABELS[E]}`;k[17]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(s.SelectValue,{}),k[17]=f):f=k[17],k[18]!==O?(p=(0,t.jsx)(s.SelectTrigger,{"aria-label":O,className:"min-h-10 flex-1",children:f}),k[18]=O,k[19]=p):p=k[19],k[20]!==C?(g=C.map(tm),k[20]=C,k[21]=g):g=k[21],k[22]!==g?(x=(0,t.jsx)(s.SelectContent,{children:g}),k[22]=g,k[23]=x):x=k[23],k[24]!==E||k[25]!==x||k[26]!==h||k[27]!==p?(b=(0,t.jsxs)(s.Select,{value:E,onValueChange:h,children:[p,x]}),k[24]=E,k[25]=x,k[26]=h,k[27]=p,k[28]=b):b=k[28],k[29]!==R||k[30]!==E?(j=()=>R(E,"select"),k[29]=R,k[30]=E,k[31]=j):j=k[31];let I=`Sort ${"asc"===P?"descending":"ascending"}`;return k[32]!==M?(y=(0,t.jsx)(M,{className:"size-4"}),k[32]=M,k[33]=y):y=k[33],k[34]!==j||k[35]!==I||k[36]!==y?(w=(0,t.jsx)(l.Button,{variant:"outline",size:"icon",onClick:j,"aria-label":I,children:y}),k[34]=j,k[35]=I,k[36]=y,k[37]=w):w=k[37],k[38]!==b||k[39]!==w?(N=(0,t.jsxs)("div",{className:"flex w-full items-center gap-2 sm:hidden",children:[m,b,w]}),k[38]=b,k[39]=w,k[40]=N):N=k[40],k[41]!==N||k[42]!==c?(S=(0,t.jsxs)(t.Fragment,{children:[c,N]}),k[41]=N,k[42]=c,k[43]=S):S=k[43],S}function tm(e){return(0,t.jsx)(s.SelectItem,{value:e,children:v.SORT_LABELS[e]},e)}function th(e){let l,o,s,i,c=(0,r.c)(17),{variant:d,scenarioId:u,lens:m}=e,h=(0,a.usePosthogClient)();c[0]!==m||c[1]!==h||c[2]!==u?(l=()=>{h.capture(n.PostHogEvent.CopyBenchmarkExplorePrompt,{lens:m,scenario:u})},c[0]=m,c[1]=h,c[2]=u,c[3]=l):l=c[3];let f=l;c[4]!==m||c[5]!==h||c[6]!==u||c[7]!==d.id?(o=()=>{h.capture(n.PostHogEvent.ClickBenchmarkExploreReference,{lens:m,scenario:u,variant:d.id})},c[4]=m,c[5]=h,c[6]=u,c[7]=d.id,c[8]=o):o=c[8];let p=o;return c[9]!==p||c[10]!==d.id||c[11]!==d.references?(s=(0,t.jsx)(e2,{references:d.references,onOpenReference:p},d.id),c[9]=p,c[10]=d.id,c[11]=d.references,c[12]=s):s=c[12],c[13]!==f||c[14]!==s||c[15]!==d.prompt?(i=(0,t.jsx)(e8.MediaPromptCard,{prompt:d.prompt,onCopy:f,children:s}),c[13]=f,c[14]=s,c[15]=d.prompt,c[16]=i):i=c[16],i}e.s(["MediaGallery",0,function(e){var l,o;let s,d,u,m,b,j,y,w,_,S,k,C,E,P,R,M,O,I,z,$,B,A,L,T,H,D,G,F,q,U,V,K,W,Q,J,X,Y,Z,ee,et,er,en,el,eo,es,ea,ec=(0,r.c)(248),{scenario:ed,lens:eu,isSortable:em,highlightedModelId:ef}=e,ep=void 0===em||em,ex=(0,a.usePosthogClient)();ec[0]!==ed.variants?(s=(0,v.distinctValues)(ed.variants.map(to)),ec[0]=ed.variants,ec[1]=s):s=ec[1];let eb=s,ev=ed.secondAxis,[ej,ey]=(0,h.useState)(eb[0]);ec[2]!==ed.variants||ec[3]!==ej?(l=ed.variants,d=l.find(e=>e.setting===ej)??l[0],ec[2]=ed.variants,ec[3]=ej,ec[4]=d):d=ec[4];let ew=d;ec[5]!==ed.variants?(u=ed.variants.some(tn),ec[5]=ed.variants,ec[6]=u):u=ec[6];let e_=u;ec[7]!==ed.variants?(m=ed.variants.flatMap(tr),ec[7]=ed.variants,ec[8]=m):m=ec[8];let eN=m;ec[9]!==eN?(b=(0,v.availableSortKeys)(eN),ec[9]=eN,ec[10]=b):b=ec[10];let eS=b;ec[11]!==eS?(j=eS.includes("score"),ec[11]=eS,ec[12]=j):j=ec[12];let ek=j;ec[13]!==eS?(y=eS.includes("quality"),ec[13]=eS,ec[14]=y):y=ec[14];let eC=y;ec[15]!==eN?(w=function(e){let t=new Map;for(let r of e){if(void 0===r.quality)continue;let{score:e}=r.quality;for(let n of r.quality.judges){let r=t.get(n.id)??{judge:n,deviations:[]};t.set(n.id,{judge:r.judge,deviations:[...r.deviations,n.score-e]})}}let r=[...t.values()].map(e=>{var t;return{judge:e.judge,deviation:(t=e.deviations).reduce((e,t)=>e+t,0)/t.length}}).sort((e,t)=>e.deviation-t.deviation),n=r[0],l=r.at(-1);return void 0===n||void 0===l||n===l||l.deviation-n.deviation<.1?null:{harshest:n,mostLenient:l}}(eN),ec[15]=eN,ec[16]=w):w=ec[16];let eE=w;ec[17]!==eS?(_=(0,v.defaultSortKey)(eS),ec[17]=eS,ec[18]=_):_=ec[18];let eP=_,[eR,eM]=(0,h.useState)(eP),[eO,eI]=(0,h.useState)(v.NATURAL_DIR[eP]),ez=(0,h.useRef)(!1);ec[19]!==eP||ec[20]!==eR||ec[21]!==eS?(S=()=>{ez.current&&eS.includes(eR)||(eM(eP),eI(v.NATURAL_DIR[eP]))},k=[eS,eR,eP],ec[19]=eP,ec[20]=eR,ec[21]=eS,ec[22]=S,ec[23]=k):(S=ec[22],k=ec[23]),(0,h.useEffect)(S,k);let e$=(0,i.useLocale)();ec[24]!==e$||ec[25]!==ed.variants?(C=function(e,t){let r=new Map;for(let t of e)r.has(t.model.author)||r.set(t.model.author,function(e){let t=e.model.name.indexOf(": ");return t<=0?e.model.author:e.model.name.slice(0,t)}(t));return[...r.entries()].map(([e,t])=>({slug:e,label:t})).sort((e,r)=>(0,f.compareDisplayText)(e.label,r.label,{locale:t}))}(ed.variants.flatMap(tt),e$),ec[24]=e$,ec[25]=ed.variants,ec[26]=C):C=ec[26];let eB=C,[eA,eL]=(0,h.useState)(null);ec[27]!==eA||ec[28]!==eB?(E=null!==eA&&eB.some(e=>e.slug===eA)?eA:null,ec[27]=eA,ec[28]=eB,ec[29]=E):E=ec[29];let eT=E;if(ec[30]!==eT||ec[31]!==eO||ec[32]!==ef||ec[33]!==eR||ec[34]!==ew?.cells){let e;ec[36]!==ew?.cells?(e=ew?.cells??[],ec[36]=ew?.cells,ec[37]=e):e=ec[37],P=(0,x.pinHighlightedCell)((0,v.sortCells)((o=e,null===eT?[...o]:o.filter(e=>e.model.author===eT)),eR,eO),ef),ec[30]=eT,ec[31]=eO,ec[32]=ef,ec[33]=eR,ec[34]=ew?.cells,ec[35]=P}else P=ec[35];let eH=P,eD=(0,e7.useMediaGallerySelection)(),eG=null!==eD;ec[38]!==eH||ec[39]!==eD||ec[40]!==eG?(R=eG&&null!==eD&&!eD.active&&eH.filter(te).length>=2,ec[38]=eH,ec[39]=eD,ec[40]=eG,ec[41]=R):R=ec[41];let eF=R;ec[42]!==eH||ec[43]!==ex||ec[44]!==ed.id||ec[45]!==eD||ec[46]!==eG||ec[47]!==ew?(M=e=>{if(!eG||null===eD)return;let t=!eD.selected.has(e);ex.capture(n.PostHogEvent.ClickBenchmarkExploreSelectModel,{model_id:e,modality:eD.modality,did_select:t,model_count:eD.selected.size+(t?1:-1)}),void 0!==ew&&eD.setPrompt(ed.id,ew.prompt,(0,p.getVariantChatReferences)(eH,ew.chatReferences)),eD.toggle(e)},ec[42]=eH,ec[43]=ex,ec[44]=ed.id,ec[45]=eD,ec[46]=eG,ec[47]=ew,ec[48]=M):M=ec[48];let eq=M;ec[49]!==eH||ec[50]!==ex||ec[51]!==ed.id||ec[52]!==eD||ec[53]!==eG||ec[54]!==ew?(O=e=>{eG&&null!==eD&&(ex.capture(n.PostHogEvent.ClickBenchmarkExploreSelectHint,{modality:eD.modality,model_count:e.length}),void 0!==ew&&eD.setPrompt(ed.id,ew.prompt,(0,p.getVariantChatReferences)(eH,ew.chatReferences)),e.forEach(e=>eD.toggle(e)))},ec[49]=eH,ec[50]=ex,ec[51]=ed.id,ec[52]=eD,ec[53]=eG,ec[54]=ew,ec[55]=O):O=ec[55];let eU=O;ec[56]!==eH||ec[57]!==ed.id||ec[58]!==eD||ec[59]!==ew?(I=()=>{eD?.active===!0&&eD.promptScenarioId===ed.id&&void 0!==ew&&eD.setPrompt(ed.id,ew.prompt,(0,p.getVariantChatReferences)(eH,ew.chatReferences))},ec[56]=eH,ec[57]=ed.id,ec[58]=eD,ec[59]=ew,ec[60]=I):I=ec[60];let eV=eD?.active,eK=eD?.promptScenarioId,eW=eD?.setPrompt,eJ=ew?.chatReferences,eX=ew?.id,eY=ew?.prompt;ec[61]!==eH||ec[62]!==ed.id||ec[63]!==eV||ec[64]!==eK||ec[65]!==eW||ec[66]!==eJ||ec[67]!==eX||ec[68]!==eY?(z=[eH,ed.id,eV,eK,eW,eJ,eX,eY],ec[61]=eH,ec[62]=ed.id,ec[63]=eV,ec[64]=eK,ec[65]=eW,ec[66]=eJ,ec[67]=eX,ec[68]=eY,ec[69]=z):z=ec[69],(0,h.useEffect)(I,z);let[eZ,e1]=(0,h.useState)(null),e0=(0,h.useRef)(null),[e2,e3]=(0,h.useState)(null),e4=ed.variants[0]?.cells.length??0;ec[70]!==ed.variants[0]?.cells?($=ed.variants[0]?.cells.filter(e9).length??0,ec[70]=ed.variants[0]?.cells,ec[71]=$):$=ec[71];let e5=$;ec[72]!==e5||ec[73]!==eu||ec[74]!==e4||ec[75]!==ed.id?(B={lens:eu,scenario:ed.id,modelCount:e4,failureCount:e5},ec[72]=e5,ec[73]=eu,ec[74]=e4,ec[75]=ed.id,ec[76]=B):B=ec[76];let{ref:e6,recordOutputOpen:e8,recordModelClick:tl}=function({lens:e,scenario:t,modelCount:r,failureCount:l}){let o=(0,a.usePosthogClient)(),s=(0,h.useRef)(0),i=(0,h.useRef)(null),c=(0,h.useRef)(0),d=(0,h.useRef)(0),u=(0,h.useRef)(!1),m=(0,h.useRef)(!1),f=(0,h.useRef)(!1),{ref:p,isIntersecting:g}=(0,ei.useIntersectionObserver)({rootMargin:"-25% 0px",initialIsIntersecting:!("IntersectionObserver"in window)}),x=(0,h.useCallback)(()=>{null!==i.current&&(s.current+=Date.now()-i.current,i.current=null)},[]),b=(0,h.useCallback)(()=>{null!==i.current||"hidden"!==document.visibilityState&&(i.current=Date.now())},[]);(0,h.useEffect)(()=>(f.current=g,g)?(b(),u.current||(u.current=!0,o.capture(n.PostHogEvent.ViewBenchmarkExploreScenario,{lens:e,scenario:t,model_count:r,failure_count:l})),x):void x(),[g,o,e,t,r,l,x,b]),(0,h.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState?x():f.current&&b()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[x,b]);let v=(0,h.useRef)({posthog:o,lens:e,scenario:t});v.current={posthog:o,lens:e,scenario:t};let j=(0,h.useCallback)(()=>{u.current&&!m.current&&(m.current=!0,x(),v.current.posthog.capture(n.PostHogEvent.ExitBenchmarkExploreScenario,{lens:v.current.lens,scenario:v.current.scenario,dwell_ms:s.current,outputs_opened:c.current,models_clicked:d.current}))},[x]);return(0,h.useEffect)(()=>{let e=e=>{e.persisted&&(m.current=!1,s.current=0,c.current=0,d.current=0,f.current&&b())};return window.addEventListener("pagehide",j),window.addEventListener("pageshow",e),()=>{window.removeEventListener("pagehide",j),window.removeEventListener("pageshow",e),j()}},[j,b]),{ref:p,recordOutputOpen:(0,h.useCallback)(()=>{c.current+=1},[]),recordModelClick:(0,h.useCallback)(()=>{d.current+=1},[])}}(B);ec[77]!==eO||ec[78]!==eu||ec[79]!==ex||ec[80]!==ed.id||ec[81]!==eR?(A=(e,t)=>{let r="asc"===eO?"desc":"asc",l=e===eR?r:v.NATURAL_DIR[e];ex.capture(n.PostHogEvent.ClickBenchmarkExploreSort,{lens:eu,scenario:ed.id,sort_key:e,sort_dir:l,surface:t}),ez.current=!0,eI(l),eM(e)},ec[77]=eO,ec[78]=eu,ec[79]=ex,ec[80]=ed.id,ec[81]=eR,ec[82]=A):A=ec[82];let ta=A;ec[83]!==eH||ec[84]!==eu||ec[85]!==eZ||ec[86]!==ex||ec[87]!==ed.id?(L=e=>{ex.capture(n.PostHogEvent.CloseBenchmarkExploreOutput,{lens:eu,scenario:ed.id,model_id:null===eZ?null:eH[eZ]?.model.id??null,trigger:e,dwell_ms:null===e0.current?null:Date.now()-e0.current}),e0.current=null,e1(null),(0,g.clearOutputLink)()},ec[83]=eH,ec[84]=eu,ec[85]=eZ,ec[86]=ex,ec[87]=ed.id,ec[88]=L):L=ec[88];let tc=L;ec[89]!==eu||ec[90]!==tc||ec[91]!==eZ||ec[92]!==ex||ec[93]!==ed.id?(T=(e,t)=>{ex.capture(n.PostHogEvent.ClickBenchmarkExploreSecondAxis,{lens:eu,scenario:ed.id,axis:e,value:t}),null!==eZ&&tc("axis_switch"),ey(t)},ec[89]=eu,ec[90]=tc,ec[91]=eZ,ec[92]=ex,ec[93]=ed.id,ec[94]=T):T=ec[94];let td=T;ec[95]!==eu||ec[96]!==tc||ec[97]!==eZ||ec[98]!==ex||ec[99]!==ed.id?(H=e=>{ex.capture(n.PostHogEvent.ClickBenchmarkExploreAuthorFilter,{lens:eu,scenario:ed.id,author:e}),null!==eZ&&tc("author_filter"),eL(e)},ec[95]=eu,ec[96]=tc,ec[97]=eZ,ec[98]=ex,ec[99]=ed.id,ec[100]=H):H=ec[100];let tm=H;ec[101]!==eH||ec[102]!==eu||ec[103]!==ex||ec[104]!==e8||ec[105]!==ed.id||ec[106]!==eR?(D=(e,t)=>{let r=eH[e];r&&(e8(),e0.current=Date.now(),ex.capture(n.PostHogEvent.OpenBenchmarkExploreOutput,{lens:eu,scenario:ed.id,model_id:r.model.id,rank:e+1,sort_key:eR,source:t}),e1(e))},ec[101]=eH,ec[102]=eu,ec[103]=ex,ec[104]=e8,ec[105]=ed.id,ec[106]=eR,ec[107]=D):D=ec[107];let tf=D;ec[108]!==ed.id||ec[109]!==eb?(G=()=>{let e=(0,g.parseOutputLink)(window.location.hash);null!==e&&e.scenario===ed.id&&((0,c.isDefinedAndNotNull)(e.setting)&&eb.includes(e.setting)&&ey(e.setting),e3(e.modelId))},F=[ed.id,eb],ec[108]=ed.id,ec[109]=eb,ec[110]=G,ec[111]=F):(G=ec[110],F=ec[111]),(0,h.useEffect)(G,F),ec[112]!==eH||ec[113]!==e2||ec[114]!==tf?(q=()=>{if(null===e2)return;e3(null);let e=eH.findIndex(e=>e.model.id===e2&&e.asset);-1!==e&&tf(e,"deep_link")},U=[e2,eH,tf],ec[112]=eH,ec[113]=e2,ec[114]=tf,ec[115]=q,ec[116]=U):(q=ec[115],U=ec[116]),(0,h.useEffect)(q,U),ec[117]!==eH||ec[118]!==eZ||ec[119]!==ed.id||ec[120]!==ev||ec[121]!==ej?(V=()=>{if(null===eZ)return;let e=eH[eZ];e&&(0,g.writeOutputLink)({scenario:ed.id,modelId:e.model.id,setting:(0,c.isDefinedAndNotNull)(ev)?ej??null:null})},K=[eZ,eH,ed.id,ev,ej],ec[117]=eH,ec[118]=eZ,ec[119]=ed.id,ec[120]=ev,ec[121]=ej,ec[122]=V,ec[123]=K):(V=ec[122],K=ec[123]),(0,h.useEffect)(V,K),ec[124]!==eu||ec[125]!==ex||ec[126]!==ed.id?(W=e=>{ex.capture(n.PostHogEvent.StepBenchmarkExploreOutput,{lens:eu,scenario:ed.id,direction:e.direction,model_id:e.modelId,input:e.input}),e0.current=Date.now()},ec[124]=eu,ec[125]=ex,ec[126]=ed.id,ec[127]=W):W=ec[127];let tp=W;ec[128]!==eH||ec[129]!==eu||ec[130]!==ex||ec[131]!==tl||ec[132]!==ed.id||ec[133]!==eR?(Q=(e,t)=>{let r=eH[e];r&&(tl(),ex.capture(n.PostHogEvent.ClickBenchmarkExploreModel,{lens:eu,scenario:ed.id,model_id:r.model.id,model_author:r.model.author,source:t,sort_key:eR,rank:e+1,did_generate:!!r.asset}))},ec[128]=eH,ec[129]=eu,ec[130]=ex,ec[131]=tl,ec[132]=ed.id,ec[133]=eR,ec[134]=Q):Q=ec[134];let tg=Q;ec[135]!==eH||ec[136]!==eu||ec[137]!==eZ||ec[138]!==ex||ec[139]!==ed.id||ec[140]!==eR||ec[141]!==ew?.chatReferences?(J=()=>{if(null===eZ)return;let e=eH[eZ];if(!e)return;let t=(0,p.getGalleryChatReferences)(e,ew?.chatReferences);ex.capture(n.PostHogEvent.ClickBenchmarkExploreTryChat,{lens:eu,scenario:ed.id,model_id:e.model.id,model_author:e.model.author,sort_key:eR,rank:eZ+1,did_carry_references:t.length>0,reference_count:t.length})},ec[135]=eH,ec[136]=eu,ec[137]=eZ,ec[138]=ex,ec[139]=ed.id,ec[140]=eR,ec[141]=ew?.chatReferences,ec[142]=J):J=ec[142];let tx=J;ec[143]!==eH||ec[144]!==eu||ec[145]!==eZ||ec[146]!==ex||ec[147]!==ed.id||ec[148]!==eR?(X=e=>{if(null===eZ)return;let t=eH[eZ];t&&ex.capture(n.PostHogEvent.ClickBenchmarkExploreModelCta,{lens:eu,scenario:ed.id,model_id:t.model.id,model_author:t.model.author,cta:e,sort_key:eR,rank:eZ+1})},ec[143]=eH,ec[144]=eu,ec[145]=eZ,ec[146]=ex,ec[147]=ed.id,ec[148]=eR,ec[149]=X):X=ec[149];let tb=X;ec[150]!==eH||ec[151]!==eu||ec[152]!==eZ||ec[153]!==ex||ec[154]!==ed.id?(Y=e=>{if(null===eZ)return;let t=eH[eZ];t&&ex.capture(n.PostHogEvent.ToggleBenchmarkExploreSource,{lens:eu,scenario:ed.id,model_id:t.model.id,model_author:t.model.author,is_shown:e,rank:eZ+1})},ec[150]=eH,ec[151]=eu,ec[152]=eZ,ec[153]=ex,ec[154]=ed.id,ec[155]=Y):Y=ec[155];let tv=Y;ec[156]!==eH||ec[157]!==eu||ec[158]!==ex||ec[159]!==ed.id||ec[160]!==eR?(Z=e=>{let t=eH[e];t&&ex.capture(n.PostHogEvent.ScrubBenchmarkExploreVideoThumbnail,{lens:eu,scenario:ed.id,model_id:t.model.id,frame_count:t.asset?.frameThumbnailUrls?.length??0,sort_key:eR,rank:e+1})},ec[156]=eH,ec[157]=eu,ec[158]=ex,ec[159]=ed.id,ec[160]=eR,ec[161]=Z):Z=ec[161];let tj=Z;ec[162]!==eH||ec[163]!==eu||ec[164]!==eZ||ec[165]!==ex||ec[166]!==ed.id?(ee=()=>{ex.capture(n.PostHogEvent.CopyBenchmarkExploreOutputLink,{lens:eu,scenario:ed.id,model_id:null===eZ?null:eH[eZ]?.model.id??null})},ec[162]=eH,ec[163]=eu,ec[164]=eZ,ec[165]=ex,ec[166]=ed.id,ec[167]=ee):ee=ec[167];let ty=ee;if(!ew)return null;ec[168]!==eT||ec[169]!==eB||ec[170]!==eF||ec[171]!==eH||ec[172]!==eO||ec[173]!==ep||ec[174]!==tm||ec[175]!==eU||ec[176]!==td||ec[177]!==ta||ec[178]!==ev||ec[179]!==eD?.active||ec[180]!==eG||ec[181]!==eb||ec[182]!==eR||ec[183]!==eS||ec[184]!==ew?(et=(ep||(0,c.isDefinedAndNotNull)(ev)||eF||eB.length>1)&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,c.isDefinedAndNotNull)(ev)&&(0,t.jsx)(ts,{label:ev,options:eb,active:ew.setting,onSelect:e=>td(ev,e)}),ep&&(0,t.jsx)(tu,{keys:eS,sortKey:eR,dir:eO,onSort:ta}),eB.length>1&&(0,t.jsx)(N,{options:eB,author:eT,onSelect:tm}),eG&&(0,t.jsx)(ti,{cells:eH,active:eD?.active??!1,onSelect:eU})]}),ec[168]=eT,ec[169]=eB,ec[170]=eF,ec[171]=eH,ec[172]=eO,ec[173]=ep,ec[174]=tm,ec[175]=eU,ec[176]=td,ec[177]=ta,ec[178]=ev,ec[179]=eD?.active,ec[180]=eG,ec[181]=eb,ec[182]=eR,ec[183]=eS,ec[184]=ew,ec[185]=et):et=ec[185],ec[186]!==eC||ec[187]!==eE?(er=eC&&null!==eE&&(0,t.jsx)(eg,{harshest:eE.harshest,mostLenient:eE.mostLenient}),ec[186]=eC,ec[187]=eE,ec[188]=er):er=ec[188],ec[189]!==eu||ec[190]!==ed.id||ec[191]!==ew?(en=(0,t.jsx)(th,{variant:ew,scenarioId:ed.id,lens:eu}),ec[189]=eu,ec[190]=ed.id,ec[191]=ew,ec[192]=en):en=ec[192];let tw=e_?"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:gap-4":"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 xl:gap-4";if(ec[193]!==eH||ec[194]!==ef||ec[195]!==e_||ec[196]!==tf||ec[197]!==tg||ec[198]!==tj||ec[199]!==eq||ec[200]!==ed.heading||ec[201]!==ed.id||ec[202]!==eD?.active||ec[203]!==eD?.selected||ec[204]!==eG||ec[205]!==eC||ec[206]!==ek||ec[207]!==eR){let e;ec[209]!==ef||ec[210]!==e_||ec[211]!==tf||ec[212]!==tg||ec[213]!==tj||ec[214]!==eq||ec[215]!==ed.heading||ec[216]!==ed.id||ec[217]!==eD?.active||ec[218]!==eD?.selected||ec[219]!==eG||ec[220]!==eC||ec[221]!==ek||ec[222]!==eR?(e=(e,r)=>(0,t.jsx)(eh,{cell:e,isVideoScenario:e_,showScore:ek,showQuality:eC,scenarioId:ed.id,sortKey:eR,scenarioHeading:ed.heading,onOpen:()=>tf(r,"grid"),onOpenModel:()=>tg(r,"grid"),onScrub:()=>tj(r),selectionEnabled:eG,selectionActive:eD?.active??!1,selected:eD?.selected.has(e.model.id)??!1,highlighted:e.model.id===ef,onSelect:()=>eq(e.model.id)},e.id),ec[209]=ef,ec[210]=e_,ec[211]=tf,ec[212]=tg,ec[213]=tj,ec[214]=eq,ec[215]=ed.heading,ec[216]=ed.id,ec[217]=eD?.active,ec[218]=eD?.selected,ec[219]=eG,ec[220]=eC,ec[221]=ek,ec[222]=eR,ec[223]=e):e=ec[223],el=eH.map(e),ec[193]=eH,ec[194]=ef,ec[195]=e_,ec[196]=tf,ec[197]=tg,ec[198]=tj,ec[199]=eq,ec[200]=ed.heading,ec[201]=ed.id,ec[202]=eD?.active,ec[203]=eD?.selected,ec[204]=eG,ec[205]=eC,ec[206]=ek,ec[207]=eR,ec[208]=el}else el=ec[208];return ec[224]!==tw||ec[225]!==el?(eo=(0,t.jsx)("ul",{className:tw,children:el}),ec[224]=tw,ec[225]=el,ec[226]=eo):eo=ec[226],ec[227]!==eH||ec[228]!==tc||ec[229]!==ty||ec[230]!==tb||ec[231]!==tg||ec[232]!==tp||ec[233]!==tv||ec[234]!==tx||ec[235]!==eZ||ec[236]!==ed.heading||ec[237]!==eC||ec[238]!==ek||ec[239]!==ew?(es=null!==eZ&&(0,t.jsx)(eQ,{cells:eH,index:eZ,showScore:ek,showQuality:eC,prompt:ew.prompt,chatReferences:ew.chatReferences,scenarioHeading:ed.heading,onClose:tc,onIndex:e1,onStep:tp,onOpenModel:()=>tg(eZ,"lightbox"),onCopyLink:ty,onTryChat:tx,onModelCta:tb,onToggleSource:tv}),ec[227]=eH,ec[228]=tc,ec[229]=ty,ec[230]=tb,ec[231]=tg,ec[232]=tp,ec[233]=tv,ec[234]=tx,ec[235]=eZ,ec[236]=ed.heading,ec[237]=eC,ec[238]=ek,ec[239]=ew,ec[240]=es):es=ec[240],ec[241]!==et||ec[242]!==er||ec[243]!==en||ec[244]!==eo||ec[245]!==es||ec[246]!==e6?(ea=(0,t.jsxs)("section",{ref:e6,className:"flex flex-col gap-4",children:[et,er,en,eo,es]}),ec[241]=et,ec[242]=er,ec[243]=en,ec[244]=eo,ec[245]=es,ec[246]=e6,ec[247]=ea):ea=ec[247],ea}],880414)},75534,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(270401);let l=(0,n.createContext)(null);function o(){return new Set}e.s(["MediaGallerySelectionProvider",0,function(e){let s,a,i,c,d,u,m=(0,r.c)(15),{modality:h,children:f}=e,[p,g]=(0,n.useState)(o),[x,b]=(0,n.useState)(null);m[0]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{g(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},m[0]=s):s=m[0];let v=s;m[1]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{g(new Set)},m[1]=a):a=m[1];let j=a;m[2]===Symbol.for("react.memo_cache_sentinel")?(i=(e,t,r)=>{b({prompt:t,references:[...r],scenarioId:e})},m[2]=i):i=m[2];let y=i,w=p.size>0,_=x?.prompt??"",N=x?.scenarioId??null;m[3]!==x?.references?(c=x?.references??[],m[3]=x?.references,m[4]=c):c=m[4],m[5]!==h||m[6]!==p||m[7]!==w||m[8]!==_||m[9]!==N||m[10]!==c?(d={modality:h,selected:p,active:w,prompt:_,promptScenarioId:N,references:c,toggle:v,clear:j,setPrompt:y},m[5]=h,m[6]=p,m[7]=w,m[8]=_,m[9]=N,m[10]=c,m[11]=d):d=m[11];let S=d;return m[12]!==f||m[13]!==S?(u=(0,t.jsx)(l.Provider,{value:S,children:f}),m[12]=f,m[13]=S,m[14]=u):u=m[14],u},"useMediaGallerySelection",0,function(){return(0,n.useContext)(l)}])},761787,e=>{"use strict";var t=e.i(222666),r=e.i(505962),n=e.i(850658),l=e.i(189511),o=e.i(553215),s=e.i(452473),a=e.i(528164),i=e.i(648156),c=e.i(164588),d=e.i(252358),u=e.i(699937),m=e.i(695227),h=e.i(329492),f=e.i(985024),p=e.i(121850);function g(e,t){let r=JSON.stringify({model:"",prompt:e,...t.length>0?{input_references:t.map(x)}:{}},null,2);return`'${r.replaceAll("'","'\\''")}'`}function x(e){let{url:t}=e;return e.mediaType.startsWith("video/")?{type:"video_url",video_url:{url:t}}:e.mediaType.startsWith("audio/")?{type:"audio_url",audio_url:{url:t}}:{type:"image_url",image_url:{url:t}}}var b=e.i(78138),v=e.i(75534);let j="min-h-10 flex-1 md:flex-none",y="pointer-events-none opacity-50";function w(e){let n,l,o,s,i,c,d,h=(0,r.c)(24),{count:f,isCopied:p,onClear:g,onCopy:x,chatHref:b,chatroomCapabilityGate:v,isSignedIn:y,onChatClick:w}=e,N=1===f?"":"s";h[0]!==f||h[1]!==N?(n=(0,t.jsxs)("span",{className:"text-body font-medium tabular-nums",children:[f," model",N," selected"]}),h[0]=f,h[1]=N,h[2]=n):n=h[2],h[3]!==g?(l=(0,t.jsx)(a.Button,{variant:"ghost",onClick:g,className:"min-h-10 md:ml-auto",children:"Clear"}),h[3]=g,h[4]=l):l=h[4],h[5]!==p?(o=p?(0,t.jsx)(u.Check,{className:"text-positive"}):(0,t.jsx)(m.Copy,{}),h[5]=p,h[6]=o):o=h[6];let S=p?"Copied":"Copy agent prompt";return h[7]!==x||h[8]!==o||h[9]!==S?(s=(0,t.jsxs)(a.Button,{variant:"outline",onClick:x,className:j,children:[o,S]}),h[7]=x,h[8]=o,h[9]=S,h[10]=s):s=h[10],h[11]!==b||h[12]!==v||h[13]!==f||h[14]!==y||h[15]!==w?(i=(0,t.jsx)(_,{chatHref:b,count:f,chatroomCapabilityGate:v,isSignedIn:y,onChatClick:w}),h[11]=b,h[12]=v,h[13]=f,h[14]=y,h[15]=w,h[16]=i):i=h[16],h[17]!==s||h[18]!==i?(c=(0,t.jsxs)("div",{className:"flex w-full items-center gap-2 md:w-auto",children:[s,i]}),h[17]=s,h[18]=i,h[19]=c):c=h[19],h[20]!==n||h[21]!==l||h[22]!==c?(d=(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-[1280px] flex-wrap items-center gap-3 px-4 py-3 md:px-6",children:[n,l,c]}),h[20]=n,h[21]=l,h[22]=c,h[23]=d):d=h[23],d}function _(e){let n,l,o,c=(0,r.c)(18),{chatHref:d,count:u,chatroomCapabilityGate:m,isSignedIn:f,onChatClick:g}=e,x=`Try ${1===u?"it":`all ${u}`} in chat`;if(m===p.WorkspaceCapabilityGateState.Loading&&!1!==f){let e,r,n;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.cn)(j,y),c[0]=e):e=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(h.MessageSquare,{}),c[1]=r):r=c[1],c[2]!==x?(n=(0,t.jsxs)(a.Button,{className:e,"aria-disabled":"true",tabIndex:-1,children:[r,x]}),c[2]=x,c[3]=n):n=c[3],n}if(m===p.WorkspaceCapabilityGateState.Blocked){let e,r,n,l,o;return c[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.cn)(j,y),c[4]=e):e=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(h.MessageSquare,{}),c[5]=r):r=c[5],c[6]!==x?(n=(0,t.jsxs)(a.Button,{className:e,"aria-disabled":"true",tabIndex:-1,children:[r,x]}),c[6]=x,c[7]=n):n=c[7],c[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("span",{className:"sr-only",children:"Not available in this workspace"}),c[8]=l):l=c[8],c[9]!==n?(o=(0,t.jsx)(i.Tooltip,{content:"Not available in this workspace",children:(0,t.jsxs)(i.TooltipNonInteractiveTrigger,{children:[n,l]})}),c[9]=n,c[10]=o):o=c[10],o}return c[11]!==d||c[12]!==g?(n=(0,t.jsx)("a",{href:d,target:"_blank",rel:"noreferrer noopener",onClick:g}),c[11]=d,c[12]=g,c[13]=n):n=c[13],c[14]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(h.MessageSquare,{}),c[14]=l):l=c[14],c[15]!==x||c[16]!==n?(o=(0,t.jsxs)(a.Button,{variant:"default",render:n,className:j,children:[l,x]}),c[15]=x,c[16]=n,c[17]=o):o=c[17],o}function N(){let e,n,l,o=(0,r.c)(3);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:"h-6"}),n=(0,t.jsx)("span",{className:"invisible min-h-10 md:ml-auto"}),o[0]=e,o[1]=n):(e=o[0],n=o[1]),o[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"selected-models-footer-spacer",className:"border-t border-transparent [padding-bottom:env(safe-area-inset-bottom)]",children:(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-[1280px] flex-wrap items-center gap-3 px-4 py-3 md:px-6",children:[e,n,(0,t.jsxs)("div",{className:"flex h-10 w-full items-center gap-2 md:w-auto",children:[(0,t.jsx)("span",{className:"invisible min-h-10 flex-1 md:flex-none"}),(0,t.jsx)("span",{className:"invisible min-h-10 flex-1 md:flex-none"})]})]})}),o[2]=l):l=o[2],l}e.s(["MediaGallerySelectionBar",0,function(){let e,s,a,i,u,m,h,p,x,j,y,_=(0,r.c)(38),S=(0,v.useMediaGallerySelection)(),k=(0,d.usePosthogClient)(),C=(0,f.useWorkspaceCapabilityGate)(l.WorkspaceCapability.Chatroom),{isSignedIn:E}=(0,n.useAuth)(),{isCopied:P,copyToClipboard:R}=(0,c.useCopyToClipboard)();if(_[0]!==S){i=Symbol.for("react.early_return_sentinel");e:{if(e=(s=null===S?[]:Array.from(S.selected)).length,null===S||0===e){i=null;break e}a=(0,b.getGallerySelectionChatHref)(s,S.prompt,S.references)}_[0]=S,_[1]=e,_[2]=s,_[3]=a,_[4]=i}else e=_[1],s=_[2],a=_[3],i=_[4];if(i!==Symbol.for("react.early_return_sentinel"))return i;let M=a;_[5]!==R||_[6]!==e||_[7]!==k||_[8]!==s||_[9]!==S.modality||_[10]!==S.prompt||_[11]!==S.references?(u=()=>{k.capture(o.PostHogEvent.CopyBenchmarkExploreSelectedPrompt,{modality:S.modality,model_count:e}),R(function({modality:e,prompt:t,modelIds:r,references:n=[]}){var l,o,s,a;let i=`Prompt: ${JSON.stringify(t)} Models: ${r.map(e=>`- ${e}`).join("\n")} Auth: use $OPENROUTER_API_KEY if already set in the env; otherwise ask the user for a key from https://openrouter.ai/keys.`;switch(e){case"image":return l=i,o=g(t,n.filter(e=>e.mediaType.startsWith("image/"))),`Generate one image per model below with the OpenRouter Image API, then build a comparison artifact. ${l} For each model, time the call: curl -s -w '\\n%{time_total}\\n' https://openrouter.ai/api/v1/images \\ -H "Authorization: Bearer $OPENROUTER_API_KEY" \\ -H "Content-Type: application/json" \\ -d ${o} Response: {"data":[{"b64_json":"...","media_type":"image/png"}],"usage":{"cost":0.04}} Output into ./openrouter-comparison/: - images/. — decoded data[0].b64_json - results.csv — model_id, cost_usd (usage.cost), seconds, image_path, error - index.html — self-contained grid of the images, each captioned with model ID, cost, and time; keep failures in the grid as an error cell.`;case"video":return s=i,a=g(t,n),`Generate one video per model below with the OpenRouter Video API, then build a comparison artifact. ${s} Video generation is asynchronous. For each model, submit a job and time it from submit to completion: curl -s https://openrouter.ai/api/v1/videos \\ -H "Authorization: Bearer $OPENROUTER_API_KEY" \\ -H "Content-Type: application/json" \\ -d ${a} Response: {"id":"","polling_url":"https://openrouter.ai/api/v1/videos/","status":"pending"} Poll GET the polling_url with the same Authorization header every 5s until status is terminal — "completed", "failed", "cancelled", or "expired" — giving up after 15 minutes. Only "completed" produces a clip; record the other three as that model's error. A completed job reads {"status":"completed","unsigned_urls":["..."],"usage":{"cost":0.25}}; download unsigned_urls[0] with the same header. Run the models concurrently — the jobs take minutes each. Output into ./openrouter-comparison/: - videos/.mp4 — the downloaded unsigned_urls[0] - results.csv — model_id, cost_usd (usage.cost), seconds, video_path, error - index.html — self-contained grid of the clips as muted looping