PageSourceSearch

https://stuvio.ai/_next/static/chunks/8224-68eab1344d409075.js

js stuvio.ai collected 2026-10-04 15:52:59 UTC 27,157 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8224],{13503:(e,t,r)=>{r.d(t,{Ve:()=>c,cu:()=>d,pu:()=>l,qS:()=>m});var a=r(47900),s=r(29534),o=r(85104);function i(e,t){let r=a.$3.downloadGate;return null!=r&&!!r.enabled&&!!t&&!(0,s.W5)(e,r.requiredTier)}function l(){let{userTier:e,creditsLoaded:t}=o.C.getState();return i(e,t)}let n={download:"Upgrade to download your masterpiece ✨",share:"Upgrade to share your masterpiece ✨",export:"Upgrade to export your edited image ✨"};function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"download";return!!l()&&(o.C.setState({toastMessage:n[e]}),o.C.getState().openPricing(a.$3.downloadGate.pricingSource),!0)}function c(){return i((0,o.C)(e=>e.userTier),(0,o.C)(e=>e.creditsLoaded))}let m={onContextMenu:e=>e.preventDefault(),draggable:!1}},23693:(e,t,r)=>{r.d(t,{q:()=>a});function a(e,t){var r,a;return e?null!==(a=null==t?void 0:null===(r=t.labels)||void 0===r?void 0:r[e])&&void 0!==a?a:e:""}},40823:(e,t,r)=>{r.d(t,{m:()=>i});let a=/\.(mp4|mov|webm|m4v)(?:[?#].*)?$/i,s=/(^|[_-])(video|videos)([_-]|$)|source[_-]?video|video[_-]?list|ref[_-]?videos?/i,o=/(^|[_-])audio(s)?([_-]|$)|audio[_-]?ids?/i;function i(e){let t=new Map,r=(e,r)=>{let i=e.trim();if(!i||r&&o.test(r))return;let l=r&&s.test(r)||a.test(i)?"video":"image",n=t.get(i);if(!n){t.set(i,{url:i,mediaType:l,slotId:r});return}"video"!==n.mediaType&&"video"===l&&t.set(i,{url:i,mediaType:l,slotId:r||n.slotId})};for(let t of e.userUploadUrls||[])"string"==typeof t&&r(t);for(let[t,a]of Object.entries(e.inputMediaSlots||{}))for(let e of a||[])"string"==typeof e&&r(e,t);return Array.from(t.values())}},65832:(e,t,r)=>{r.d(t,{A:()=>d});var a=r(6605),s=r(68633),o=r(27340),i=r(43340),l=r(72463),n=r(13503);let d=e=>{let{src:t,mediaType:r,fileName:d,autoPlay:c=!0,onClose:m}=e,u=(0,n.Ve)()?n.qS:void 0;return(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&m()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m]),(0,o.createPortal)((0,a.jsxs)("div",{"data-media-preview-modal":"true",className:"fixed inset-0 z-[80] bg-black/80 backdrop-blur-sm flex items-center justify-center animate-in fade-in duration-150",onClick:m,children:[(0,a.jsx)("button",{onClick:m,className:"absolute top-4 right-4 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center text-white transition-colors z-10",children:(0,a.jsx)(i.A,{size:20})}),"image"===r&&(0,a.jsx)("img",{src:t,className:"max-w-[90vw] max-h-[85vh] object-contain rounded-xl shadow-2xl",alt:"Preview",referrerPolicy:"no-referrer",onClick:e=>e.stopPropagation(),...u}),"video"===r&&(0,a.jsx)("video",{src:t,controls:!0,autoPlay:c,className:"max-w-[90vw] max-h-[85vh] rounded-xl shadow-2xl",onClick:e=>e.stopPropagation(),...u}),"audio"===r&&(0,a.jsxs)("div",{className:"bg-bgCard rounded-2xl p-6 shadow-2xl min-w-[320px] max-w-[400px]",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-orange-50 border border-orange-200 flex items-center justify-center",children:(0,a.jsx)(l.A,{size:20,className:"text-orange-500"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-bold text-textPrimary truncate",children:d||"Audio"}),(0,a.jsx)("p",{className:"text-xs text-textSecondary",children:"Audio file"})]})]}),(0,a.jsx)("audio",{src:t,controls:!0,autoPlay:c,className:"w-full"})]})]}),document.body)}},98224:(e,t,r)=>{r.r(t),r.d(t,{default:()=>z});var a=r(6605),s=r(68633),o=r(27340),i=r(43340),l=r(57766),n=r(24150),d=r(97937),c=r(2678),m=r(10451),u=r(19097),x=r(26174),p=r(68232),b=r(80673),f=r(29910),h=r(23693),g=r(65832),v=r(14633),j=r(93936),y=r(24380),w=r(6269),N=r(88769),k=r(40823);function C(e){return/\.(mp4|mov|webm|m4v)(?:[?#].*)?$/i.test(e)}function S(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString()}function P(e){return e.id||e.uuid}function A(e){var t;return{id:e.taskId,prompt:null!==(t=e.generationPrompt)&&void 0!==t?t:e.prompt,imageUrls:e.userUploadUrls,inputMediaSlots:e.inputMediaSlots,paramsSnapsh
1ot:e.paramsSnapshot,modelId:e.model,aspectRatio:e.aspectRatio||"-",duration:e.duration?String(e.duration):"-",resolution:e.resolution,type:e.type,resultUrls:e.resultUrls,resultAssets:e.resultAssets,previewUrl:e.thumbnailUrl||void 0,error:void 0}}function z(e){let{item:t,onClose:r,onCreateSimilar:n,detailMode:d="api",videoPlayback:c="current",videoLoadingIndicator:m="custom",galleryItems:u=[],currentId:x,onSelect:p}=e,[b,f]=(0,s.useState)(!1),[h,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(t),[S,z]=(0,s.useState)("api"===d),[U,D]=(0,s.useState)(!1),[T,L]=(0,s.useState)("loading"),I=(0,s.useRef)(!1),O=(0,s.useRef)(0),F=(0,s.useRef)(!1),q="api"===d,$=x||P(t),W=(0,s.useRef)(null),V=(0,s.useRef)(null),G=u.length>1&&!!p,H=v.mediaUrl,Y=!!(H&&("video"===v.mediaType||C(H))),X="image"===v.mediaType,B=(0,s.useMemo)(()=>(0,k.m)({userUploadUrls:v.userUploadUrls,inputMediaSlots:v.inputMediaSlots}),[v]),J=(0,s.useMemo)(()=>(function(e){let t=new Set(["aspect_ratio","duration","image_size","importedAt","importedFrom","importTaskId","output_format","provider_prompt","resolution","sourceDirectory","sourceModelLabel","targetModelName","title"]);return Object.entries(e.paramsSnapshot||{}).filter(e=>{let[r]=e;return!r.startsWith("__")&&!t.has(r)}).map(e=>{let[t,r]=e;return[t.replace(/_/g," "),String(r)]})})(v),[v]);(0,s.useEffect)(()=>{let e=V.current;if(L("loading"),I.current=!1,F.current=!1,O.current="undefined"!=typeof performance?performance.now():Date.now(),!e||!H)return;let t=!1,r="muted-loop"===c;if(e.muted=r,r)return()=>{t=!0};let a=e.play();return a&&"function"==typeof a.catch&&a.catch(()=>{if(!t&&V.current){if(r){L("error");return}V.current.muted=!0,V.current.play().catch(()=>{})}}),()=>{t=!0}},[H,c]);let K=(0,s.useMemo)(()=>u.findIndex(e=>P(e)===$),[$,u]),Q=(0,s.useCallback)(e=>{if(!G||!p)return;let t=(K>=0?K:0)+e;t<0||t>=u.length||p(u[t])},[K,u,p,G]);if((0,s.useEffect)(()=>{if(g(!1),!q){j(t),z(!1),D(!1);return}let e=new AbortController;j(t),z(!0),D(!1);let r=new URLSearchParams({uuid:t.uuid,type:t.type});return fetch("/api/curated?".concat(r.toString()),{cache:"no-store",signal:e.signal}).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error||"Failed to load curated asset");t.item&&j(t.item)}).catch(e=>{"AbortError"!==e.name&&(console.error("[CuratedAssetDetailModal]",e),D(!0))}).finally(()=>{e.signal.aborted||z(!1)}),()=>e.abort()},[q,t]),(0,s.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[]),(0,s.useEffect)(()=>{var e;null===(e=W.current)||void 0===e||e.scrollTo({top:0,behavior:"auto"})},[$]),(0,s.useEffect)(()=>{if(!G)return;let e=e=>{(function(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return"input"===t||"textarea"===t||"select"===t||e.isContentEditable})(e.target)||document.querySelector('[data-media-preview-modal="true"]')||("ArrowDown"===e.key?(e.preventDefault(),Q(1)):"ArrowUp"===e.key&&(e.preventDefault(),Q(-1)))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Q,G]),"undefined"==typeof document)return null;let Z=async()=>{await navigator.clipboard.writeText(v.prompt),f(!0),window.setTimeout(()=>f(!1),1200)},ee=()=>{if(!H)return;let e=document.createElement("a");e.href=H,e.target="_blank",e.rel="noopener noreferrer",e.download="".concat(v.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"curated-asset",".").concat(function(e,t){var r;let a=null===(r=new URL(e,window.location.origin).pathname.split(".").pop())||void 0===r?void 0:r.toLowerCase();return a&&/^[a-z0-9]+$/.test(a)?a:"video"===t?"mp4":"png"}(H,v.mediaType)),document.body.appendChild(e),e.click(),document.body.removeChild(e)},et=()=>{n(v),r()},er=()=>{(0,w.XW)(A(v)),r()},ea=()=>{(0,w.Ix)(A(v)),r()},es=(0,s.useRef)(0),eo=(0,s.useRef)(0),ei=(0,s.useRef)(0),el=(0,s.useRef)(0),en=(0,s.useRef)(!1),ed=(0,s.useCallback)(e=>{if(window.matchMedia("(max-width: 767px)").matches||!G)return;let t=Math.abs(e.deltaY);
1if(t<10)return;let r=Date.now(),a=r-es.current;es.current=r;let s=e.deltaY>0?1:-1,o=a>150||s!==el.current||t>Math.max(30,2.5*ei.current);if(el.current=s,ei.current=o?t:.7*ei.current+.3*t,o&&(en.current=!1),e.preventDefault(),en.current&&!(t>=50&&a>=80)||r-eo.current<80)return;let i=(K>=0?K:0)+s;i<0||i>=u.length||(en.current=!0,eo.current=r,null==p||p(u[i]))},[K,v.mediaType,u,p,G]);return(0,o.createPortal)((0,a.jsxs)("div",{className:"fixed inset-0 z-[130] flex items-center justify-center bg-black/82 p-2 backdrop-blur-md md:p-4",role:"dialog","aria-modal":"true",children:[(0,a.jsx)("button",{type:"button","aria-label":"Close detail",className:"absolute inset-0 cursor-default",onClick:r}),(0,a.jsxs)("div",{ref:W,"data-media-detail-shell":"true",className:"relative flex h-[min(940px,calc(100dvh-1rem))] w-full max-w-[1520px] flex-col overflow-y-auto overscroll-contain rounded-xl border border-white/10 bg-bgCard shadow-2xl md:h-[min(920px,calc(100dvh-2rem))] md:flex-row md:overflow-hidden",children:[(0,a.jsx)("button",{type:"button",onClick:r,"data-media-detail-close":"true",className:"absolute right-3 top-3 z-30 flex h-8 w-8 items-center justify-center rounded-full border border-borderCustom bg-bgCard/95 text-textSecondary shadow-md backdrop-blur transition-colors hover:bg-bgSurface hover:text-textPrimary md:right-4 md:top-4","aria-label":"Close detail",children:(0,a.jsx)(i.A,{size:16})}),(0,a.jsxs)("div",{"data-media-detail-stage":"true",className:"relative flex w-full shrink-0 items-center justify-center bg-[#070707] md:h-auto md:min-h-0 md:min-w-0 md:flex-1 md:p-8 ".concat(X?"min-h-0 p-0":"h-[34dvh] max-h-[380px] min-h-[220px] p-3 md:max-h-none"),onWheel:ed,children:[Y&&"custom"===m&&"loading"===T?(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",children:(0,a.jsx)(l.A,{size:32,className:"animate-spin text-white/80"})}):null,Y&&"custom"===m&&"rebuffering"===T?(0,a.jsx)("div",{className:"pointer-events-none absolute left-4 top-4 z-10 rounded-full bg-black/55 p-1.5 backdrop-blur-sm md:left-6 md:top-6",children:(0,a.jsx)(l.A,{size:16,className:"animate-spin text-white/80"})}):null,Y&&"error"===T?(0,a.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,a.jsx)("button",{type:"button",className:"rounded-full bg-black/70 px-5 py-2.5 text-sm font-medium text-white backdrop-blur-sm transition hover:bg-black/80",onClick:()=>{let e=V.current;e&&(L("loading"),I.current=!1,e.load(),e.muted=!0,e.play().catch(()=>L("error")))},children:"Playback failed — tap to retry"})}):null,H?Y?(0,a.jsx)("video",{ref:V,src:H,poster:v.thumbnailUrl||void 0,className:"h-full max-h-full w-full max-w-full rounded-md object-contain shadow-2xl",controls:!0,playsInline:!0,autoPlay:"muted-loop"===c,muted:"muted-loop"===c,loop:"muted-loop"===c,preload:"auto",onLoadedData:()=>{if(I.current=!0,L("ready"),!F.current&&O.current>0){F.current=!0;let e="undefined"!=typeof performance?performance.now():Date.now();(0,y.u)("curated_video_first_frame",{itemId:P(v),modelId:v.model,ms:Math.round(e-O.current),prefetched:!!H&&(0,N.U5)(H)})}},onWaiting:()=>L(I.current?"rebuffering":"loading"),onPlaying:()=>{I.current=!0,L("ready")},onError:()=>L("error")},H):(0,a.jsx)("img",{src:H,alt:v.title,className:"w-full max-w-full object-contain shadow-2xl ".concat(X?"block h-auto max-h-[78dvh] rounded-none md:h-full md:max-h-full md:rounded-md":"h-full max-h-full rounded-md")}):(0,a.jsx)("div",{className:"flex h-48 w-64 items-center justify-center rounded-md border border-white/10 bg-white/5 text-sm text-white/60",children:"No media"})]}),G&&!X&&(0,a.jsx)(E,{items:u,activeId:$,onSelect:p,orientation:"horizontal"}),(0,a.jsx)("aside",{"data-media-detail-panel":"true",className:"hidden w-[420px] shrink-0 flex-col border-l border-borderCustom bg-bgCard md:flex",children:(0,a.jsx)(M,{item:v,copied:b,copyPrompt:Z,references:B,extraParams:J,parametersOpen:h,setParametersOpen:g,detailLoading:S,detailError:U,onCreateSimilar:et,onReprompt:er,onEditFurther:ea,onDownload:ee,hasMedia:!!H,showEditFurther:q})}),G&&(0,a.jsx)(E,{items:u,activeId:$,onSelect:p,orientation:"vertical"}),(0,a.jsx)("div",{"data-media-detail-panel":"true",className:"shrink-0 border-t border-borderCustom bg-bgCard md:hidden",children:X?(0,a.jsx)(R,{item:v,activeId:$,galleryItems:u,detailLoa
1ding:S,onCreateSimilar:et,onCreateRelated:e=>{n(e),r()},onReprompt:er,onEditFurther:ea,onDownload:ee,onSelect:p,hasMedia:!!H,showEditFurther:q},$):(0,a.jsx)(_,{item:v,copied:b,copyPrompt:Z,detailLoading:S,detailError:U,onCreateSimilar:et,onReprompt:er,onEditFurther:ea,onDownload:ee,hasMedia:!!H,showEditFurther:q},$)})]})]}),document.body)}function E(e){let{items:t,activeId:r,onSelect:s,orientation:o}=e,i="vertical"===o;return(0,a.jsx)("div",{"data-media-detail-rail":"true",className:i?"hidden w-[100px] shrink-0 border-l border-borderCustom bg-bgCard px-2 pb-3 pt-14 md:flex md:flex-col":"border-t border-borderCustom bg-bgCard px-3 py-2 md:hidden","aria-label":"Other curated assets",children:(0,a.jsx)("div",{className:i?"flex min-h-0 flex-1 flex-col items-center gap-3 overflow-y-auto px-1 scrollbar-thin":"flex gap-2 overflow-x-auto pb-1 scrollbar-thin",children:t.map(e=>{let t=P(e),o=e.thumbnailUrl||e.mediaUrl||void 0,i=t===r,l=!!o&&C(o),m="video"===e.mediaType||!!e.mediaUrl&&C(e.mediaUrl);return(0,a.jsxs)("button",{type:"button",onClick:()=>s(e),"data-media-detail-thumb":"true",className:"group relative h-16 w-16 shrink-0 overflow-hidden rounded-xl border bg-bgSurface transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accentPrimary/50 md:h-[74px] md:w-[74px] ".concat(i?"border-accentPrimary shadow-[0_0_0_2px_rgba(255,255,255,0.08)]":"border-white/10 opacity-70 hover:border-white/40 hover:opacity-100"),"aria-current":i?"true":void 0,"aria-label":"Open ".concat(e.title),children:[o?l?(0,a.jsx)("video",{src:o,className:"h-full w-full object-cover",muted:!0,playsInline:!0,preload:"metadata"}):(0,a.jsx)("img",{src:o,alt:"",className:"h-full w-full object-cover",loading:"lazy",decoding:"async"}):(0,a.jsx)("div",{className:"flex h-full w-full items-center justify-center text-textSecondary",children:"video"===e.type?(0,a.jsx)(n.A,{size:18}):(0,a.jsx)(d.A,{size:18})}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/10 transition-colors group-hover:bg-black/0"}),m&&(0,a.jsx)("div",{className:"absolute bottom-1 right-1 flex h-5 w-5 items-center justify-center rounded-full bg-black/70 text-white",children:(0,a.jsx)(c.A,{size:11,fill:"currentColor",className:"ml-0.5"})})]},t)})})})}function R(e){var t;let{item:r,activeId:o,galleryItems:i,detailLoading:l,onCreateSimilar:n,onCreateRelated:c,onReprompt:b,onEditFurther:f,onDownload:g,onSelect:y,hasMedia:w,showEditFurther:N}=e,k=null===(t=(0,j.pM)())||void 0===t?void 0:t.workspace,C=e=>(0,h.q)(e,k),S=(0,s.useRef)(null),[A,z]=(0,s.useState)(!1),[E,R]=(0,s.useState)(!1),_=(0,s.useMemo)(()=>i.filter(e=>"image"===e.mediaType&&P(e)!==o).slice(0,12),[o,i]);return(0,s.useEffect)(()=>{let e=S.current;if(!e)return;let t=0,r=()=>{R(e.scrollWidth>e.clientWidth+1)};t=window.requestAnimationFrame(r);let a=new ResizeObserver(r);return a.observe(e),()=>{window.cancelAnimationFrame(t),a.disconnect()}},[r.prompt]),(0,a.jsxs)("div",{className:"px-4 pb-8 pt-4",children:[(0,a.jsxs)("button",{type:"button",onClick:n,disabled:l,className:"inline-flex h-11 w-full min-w-0 items-center justify-center gap-2 rounded-lg bg-accentPrimary px-4 text-sm font-black text-textOnAccent transition-transform hover:scale-[1.01] disabled:cursor-wait disabled:opacity-60",children:[(0,a.jsx)(m.A,{size:16,className:"shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap",children:C("Create Similar")})]}),(0,a.jsxs)("div",{className:"mt-2 grid gap-2 ".concat(N?"grid-cols-3":"grid-cols-2"),children:[(0,a.jsx)(D,{icon:(0,a.jsx)(u.A,{size:15}),label:C("Reprompt"),onClick:b,disabled:l}),N&&(0,a.jsx)(D,{icon:(0,a.jsx)(x.A,{size:15}),label:C("Edit further"),onClick:f,disabled:l||!w}),(0,a.jsx)(D,{icon:w?(0,a.jsx)(p.A,{size:15}):(0,a.jsx)(d.A,{size:15}),label:C("Download"),onClick:g,disabled:!w})]}),(0,a.jsx)("section",{className:"mt-5 border-t border-borderCustom pt-4",children:A?(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-6 text-textPrimary",children:r.prompt}),(0,a.jsx)("button",{type:"button",onClick:()=>z(!1),className:"mt-2 text-xs font-black text-textPrimary underline decoration-textSecondary/40 underline-offset-4","aria-expanded":"true",children:C("Show less")})]}):(0,a.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,a.jsx)("p",{ref:S,className:"min-w-0 flex-1 truncate text-sm leading-6 text-textPrimary",children:r.prompt}),E&&(0,a.jsx)("button",{type:"button",onClick:()=>z(!0),className:"shrink-0 text-xs font-black text-textPrimary","aria-expanded":"false",children:C("Show more")})]})}),_.length>0&&y&&(0,a.jsxs)("section",{className:"mt-6",children:[(0,a.jsx)("h3",{className:"mb-3 text-base font-black text-textPrimary",children:C("More like this")}),(0,a.jsx)("div",{className:"columns-2 gap-2",children:_.map((e,t)=>(0,a.jsx)("div",{className:"mb-2 break-inside-avoid",children:(0,a.jsx)(v.A,{item:e,onOpen:y,onCreateSimilar:c,autoPlayVideo:!1,showPlayIcon:!1,priority:t<4,className:"w-full",createSimilarLabel:C("Create Similar")})},P(e)))})]})]})}function _(e){var t,r;
1let{item:s,copied:o,copyPrompt:i,detailLoading:n,detailError:c,onCreateSimilar:f,onReprompt:g,onEditFurther:v,onDownload:y,hasMedia:w,showEditFurther:N}=e,k=null===(t=(0,j.pM)())||void 0===t?void 0:t.workspace,C=e=>(0,h.q)(e,k),P=!!(null===(r=s.prompt)||void 0===r?void 0:r.trim());return(0,a.jsxs)("div",{className:"px-4 pt-4",children:[(0,a.jsx)("div",{className:"text-xs font-bold uppercase tracking-wide text-textSecondary",children:C("Curated asset")}),(0,a.jsx)("h2",{className:"mt-1.5 pr-8 text-lg font-black leading-6 text-textPrimary",children:s.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-xs text-textSecondary",children:[(0,a.jsx)("span",{children:S(s.createdAt)}),n&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(l.A,{size:11,className:"animate-spin"}),C("Loading details")]}),c&&(0,a.jsx)("span",{children:C("Details unavailable")})]}),P&&(0,a.jsxs)("section",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-textSecondary",children:C("Prompt")}),(0,a.jsxs)("button",{type:"button",onClick:i,className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-borderCustom bg-bgSurface px-2 text-xs font-bold text-textPrimary hover:bg-bgPrimary",children:[(0,a.jsx)(b.A,{size:12}),C(o?"Copied":"Copy")]})]}),(0,a.jsx)("div",{className:"whitespace-pre-wrap rounded-lg border border-borderCustom bg-bgSurface p-3 text-sm leading-6 text-textPrimary",children:s.prompt})]}),(0,a.jsxs)("div",{className:"sticky bottom-0 -mx-4 mt-5 border-t border-borderCustom bg-bgCard px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3",children:[(0,a.jsxs)("button",{type:"button",onClick:f,disabled:n,className:"inline-flex h-11 w-full min-w-0 items-center justify-center gap-2 rounded-lg bg-accentPrimary px-4 text-sm font-black text-textOnAccent transition-transform hover:scale-[1.01] disabled:cursor-wait disabled:opacity-60",children:[(0,a.jsx)(m.A,{size:16,className:"shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap",children:C("Create Similar")})]}),(0,a.jsxs)("div",{className:"mt-2 grid gap-2 ".concat(N?"grid-cols-3":"grid-cols-2"),children:[(0,a.jsx)(D,{icon:(0,a.jsx)(u.A,{size:15}),label:C("Reprompt"),onClick:g,disabled:n}),N&&(0,a.jsx)(D,{icon:(0,a.jsx)(x.A,{size:15}),label:C("Edit further"),onClick:v,disabled:n||!w}),(0,a.jsx)(D,{icon:w?(0,a.jsx)(p.A,{size:15}):(0,a.jsx)(d.A,{size:15}),label:C("Download"),onClick:y,disabled:!w})]})]})]})}function M(e){var t,r;let{item:o,copied:i,copyPrompt:n,references:c,extraParams:v,parametersOpen:y,setParametersOpen:w,detailLoading:N,detailError:k,onCreateSimilar:C,onReprompt:P,onEditFurther:A,onDownload:z,hasMedia:E,showEditFurther:R}=e,_=null===(t=(0,j.pM)())||void 0===t?void 0:t.workspace,M=e=>(0,h.q)(e,_),[T,L]=(0,s.useState)(null),I=[[M("Model"),o.modelName||o.model],[M("Aspect Ratio"),o.aspectRatio||"-"],..."video"===o.type?[[M("Duration"),o.duration?"".concat(o.duration,"s").replace(/ss$/,"s"):"-"]]:[],...o.resolution?[[M("Resolution"),o.resolution]]:[],...null!=o.creditsUsed?[[null!==(r=null==_?void 0:_.credits)&&void 0!==r?r:"Credits",String(o.creditsUsed)]]:[]];return(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"border-b border-borderCustom p-5",children:[(0,a.jsx)("div",{className:"text-sm font-bold text-textSecondary",children:M("Curated asset")}),(0,a.jsx)("h2",{className:"mt-2 pr-10 text-lg font-black leading-6 text-textPrimary",children:o.title}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-xs text-textSecondary",children:[(0,a.jsx)("span",{children:S(o.createdAt)}),N&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(l.A,{size:11,className:"animate-spin"}),M("Loading details")]}),k&&(0,a.jsx)("span",{children:M("Details unavailable")})]})]}),(0,a.jsxs)("div",{className:"min-h-0 flex-1 space-y-6 overflow-y-auto p-5",children:[(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-textSecondary",children:M("Prompt")}),(0,a.jsxs)("button",{type:"button",onClick:n,className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-borderCustom bg-bgSurface px-2 text-xs font-bold text-textPrimary hover:bg-bgPrimary",children:[(0,a.jsx)(b.A,{size:12}),M(i?"Copied":"Copy")]})]}),(0,a.jsx)("div",{className:"max-h-56 overflow-y-auto rounded-md border border-borderCustom bg-bgSurface p-3 text-sm leading-6 text-textPrimary",children:o.prompt})]}),c.length>0&&(0,a.jsxs)("section",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-semibold text-textSecondary",children:M("Reference images or videos")}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2",children:c.map((e,t)=>(0,a.jsx)(U,{item:e,index:t,onPreview:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return L({src:e.url,mediaType:e.mediaType,autoPlay:t})}},e.url))})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>w(!y),className:"flex w-full items-center justify-between rounded-md px-1 py-1.5 text-left text-textSecondary transition-colors hover:text-textPrimary","aria-expanded":y,children:[(0,a.jsx)("span",{className:"text-[12px] font-semibold",children:M("Details")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-semibold",children:[M(y?"Hide":"See details"),(0,a.jsx)(f.A,{size:14,className:"transition-transform ".concat(y?"rotate-180":"")})]})]}),y&&(0,a.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-3 rounded-lg border border-borderCustom/60 bg-bgSurface/10 p-3",children:[[...I,...v].map(e=>{let[t,r]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold text-textSecondary",children:t}),(0,a.jsx)("div",{className:"mt-1 break-words text-sm font-bold text-textPrimary",children:r})]},t)}),o.category&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold text-textSecondary",children:M("Category")}),(0,a.jsx)("div",{className:"mt-1 break-words text-sm font-bold text-textPrimary",children:o.category})]})]})]})]}),(0,a.jsxs)("div",{className:"border-t border-borderCustom p-5",children:[(0,a.jsxs)("button",{type:"button",onClick:C,className:"inline-flex h-10 w-full min-w-0 items-center justify-center gap-2 rounded-md bg-accentPrimary px-4 text-sm font-black text-textOnAccent transition-transform hover:scale-[1.01]",children:[(0,a.jsx)(m.A,{size:16,className:"shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap",children:M("Create Similar")})]}),(0,a.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-1.5",children:[(0,a.jsx)(D,{icon:(0,a.jsx)(u.A,{size:15}),label:M("Reprompt"),onClick:P,disabled:N}),R&&(0,a.jsx)(D,{icon:(0,a.jsx)(x.A,{size:15}),label:M("Edit further"),onClick:A,disabled:N||!E}),(0,a.jsx)(D,{icon:E?(0,a.jsx)(p.A,{size:15}):(0,a.jsx)(d.A,{size:15}),label:M("Download"),onClick:z,disabled:!E})]})]}),T&&(0,a.jsx)(g.A,{src:T.src,mediaType:T.mediaType,autoPlay:T.autoPlay,onClose:()=>L(null)})]})}function U(e){let{item:t,index:r,onPreview:o}
1=e,[i,l]=(0,s.useState)(!1),d="video"===t.mediaType?"Reference video ".concat(r+1):"Reference image ".concat(r+1);return"video"===t.mediaType?(0,a.jsxs)("div",{className:"group relative aspect-square overflow-hidden rounded-md border border-borderCustom bg-black",children:[i?(0,a.jsxs)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"flex h-full w-full flex-col items-center justify-center gap-1 px-2 text-center text-[11px] font-bold text-white/80","aria-label":"Open ".concat(d),onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(n.A,{size:16}),"Video"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("video",{src:t.url,className:"h-full w-full object-cover opacity-80 transition-opacity group-hover:opacity-100",muted:!0,playsInline:!0,preload:"metadata",onError:()=>l(!0)}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/10 transition-colors group-hover:bg-black/0"})]}),!i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(t,!1),className:"absolute inset-0 cursor-pointer","aria-label":"Preview ".concat(d)}),(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),o(t,!0)},className:"absolute left-1/2 top-1/2 z-10 flex h-9 w-9 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-black/70 text-white shadow-lg transition-transform hover:scale-105 hover:bg-black","aria-label":"Play ".concat(d),children:(0,a.jsx)(c.A,{size:16,fill:"currentColor",className:"ml-0.5"})})]})]}):(0,a.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group relative aspect-square overflow-hidden rounded-md border border-borderCustom bg-black","aria-label":"Open ".concat(d),children:(0,a.jsx)("img",{src:t.url,alt:d,className:"h-full w-full object-cover opacity-80 transition-opacity group-hover:opacity-100",loading:"lazy",decoding:"async"})})}function D(e){let{icon:t,label:r,onClick:s,disabled:o}=e;return(0,a.jsxs)("button",{type:"button",onClick:s,disabled:o,className:"flex min-h-[48px] flex-col items-center justify-center gap-1 rounded-lg border border-borderCustom px-2 py-1.5 text-[13px] font-bold transition-colors ".concat(o?"cursor-not-allowed bg-bgSurface text-textSecondary/40":"bg-bgSurface text-textPrimary hover:bg-bgPrimary"),children:[t,r]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.