1import{r as w,u as Be,j as e,R as te,e as Rt,f as At}from"./react-vendor-DvpaPdNC.js";import{c as Pt,m as Ne,af as Et,l as ke,ad as Lt,a8 as rt,v as le,C as it,Y,a as Dt,ab as Fe,bH as Ut,dn as _t,cM as Bt,i as Le,q as Ft,g as zt,h as $t,a5 as lt,$ as De,d1 as ct,cu as Ot,k as dt,z as Vt,j as Gt,cf as Yt,aW as St,al as qt,cz as Xt,c4 as Ht,cx as Kt,aB as Qt,cA as Jt,c7 as Zt}from"./index-CC9uFMyS.js";import{D as Wt}from"./DesktopGate-NNEWls9S.js";import{o as ze,u as mt,v as es,w as ts,N as Ze,Q as ss,L as as}from"./firebase-C-c4J6sC.js";import{s as ns,b as We,r as os,c as rs}from"./thumbnailSetModelPreference-CMzMbhiK.js";import{d as et,S as is,D as ls,e as cs,g as ds}from"./firebaseStorage-DJncOvoR.js";import{S as ms}from"./ScoreBreakdownCard-Dlsh_M42.js";import{T as us}from"./ObjectiveModal-CjgbfLE6.js";import{S as fs}from"./SelectionActionBar-Co9qG6zX.js";import{F as gs}from"./FullScreenStudioLayout-BK2qqmjE.js";import{e as xs}from"./budgetBlock-CjYGAlkp.js";import{b as ps}from"./buildGenerateMoreNavigation-uNIr7pRT.js";import{l as tt,a as hs,S as ws,c as bs,s as js,d as ys,b as $e,e as Oe,f as Ve,g as vs,h as ks}from"./CopyImageButton-B8hyvqiF.js";import{A as Ns}from"./arrow-left-CDZhYzDt.js";import{S as Cs}from"./share-2-J_85g-R8.js";import{I as Ts}from"./image-off-BbUzhTx-.js";import{A as Ue}from"./AssetThumb-C8CApnyx.js";import{B as Is}from"./ban-Cw_-Q_yb.js";import{P as st}from"./package-XzPaHfgd.js";import{U as Ms}from"./user-DCysGZDz.js";import{D as Rs}from"./DevelopingPreview-DC94gMdg.js";import{P as As}from"./pencil-915jFrfV.js";import{u as Ps}from"./usePaywallShownTracking-ClnlHjvM.js";import{R as Es}from"./rotate-ccw-BFNQeEkV.js";import"./motion-CVWa5O5W.js";import"./monitor-D_WAHq52.js";import"./mouse-pointer-click-C_fzeVSl.js";import"./contextLibraryCache-BjKkQgSF.js";import"./useStudioOwnerUid-DulZtH0a.js";import"./studioTemplatesMeta-CqcwUatV.js";import"./recipesService-BX4QSxQr.js";import"./recipeDefinition--498iKko.js";import"./RecipeZoneCanvas-8RLHPC-c.js";import"./useBrandFont-DZ59soTP.js";import"./gamepad-2-Bkhl9AG4.js";import"./scoreUtils-CP2LNv06.js";import"./SocialShareButton-eRguuQ6M.js";import"./chevron-up-Bz3IeRxN.js";import"./thumbs-up-knXFjpUH.js";import"./campaignConfig-cJlBQZ2Y.js";import"./ResponsiveModal-CcCJoQC6.js";import"./constants-DGJngyuA.js";/** 2 * @license lucide-react v0.548.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ls=[["path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16",key:"xik6mr"}],["path",{d:"M15.697 14h5.606",key:"1stdlc"}],["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}]],Ds=Pt("a-large-small",Ls);function Us(t,n,o){const[a,s]=w.useState(null),[i,f]=w.useState(!!o),[r,m]=w.useState("generating"),[l,u]=w.useState(null);w.useEffect(()=>{if(!t||!n||!o)return;s(null),f(!0),m("generating"),u(null);const x=ze(Ne,"users",t,"studios",n,"thumbnailSets",o),p=mt(x,N=>{var v,d,I,_;const P=N.metadata.fromCache;if(!N.exists()){if(P)return;f(!1);return}const b=N.data();s({id:N.id,title:b.title,createdBy:b.createdBy,prompt:b.prompt||"",fullPrompt:b.fullPrompt,variationCount:b.variationCount||1,originalVariationCount:b.originalVariationCount,textStyle:b.textStyle,modelId:b.modelId,status:b.status||"processing",aspectRatio:b.aspectRatio,completedCount:b.completedCount,budgetLimited:b.budgetLimited,timeoutVariationIndexes:b.timeoutVariationIndexes,timeoutVariationCount:b.timeoutVariationCount,timeoutFailureMessage:b.timeoutFailureMessage,safetySummary:b.safetySummary,error:b.error,errorReason:b.errorReason,styleReference:b.styleReference,selfieReference:b.selfieReference,propsReference:b.propsReference,setType:b.setType,compositionId:b.compositionId,compositionName:b.compositionName,compositionProcessedImageUrl:b.compositionProcessedImageUrl,compositionSlots:b.compositionSlots,compositionPersonImages:b.compositionPersonImages,compositionPropImages:b.compositionPropImages,compositionHasText:b.compositionHasText,createdAt:((d=(v=b.createdAt)==null?void 0:v.toMillis)==null?void 0:d.call(v))??b.createdAt,updatedAt:((_=(I=b.updatedAt)==null?void 0:I.toMillis)==null?void 0:_.call(I))??b.updatedAt}),f(!1),b.status==="complete"?m("complete"):b.status==="failed"&&(m("error"),u(b.error||"No charge was applied for this attempt. Please try again."))},N=>{console.error("[useThumbnailSet] Listener error:",N),f(!1),u("Failed to load generation"),m("error")});return()=>p()},[t,n,o]);const g=9e5,c=(a==null?void 0:a.updatedAt)??(a==null?void 0:a.createdAt);if(r==="generating"&&a!==null&&typeof c=="number"&&Date.now()-c>g){const x=(a.completedCount??0)>0;return{thumbnailSet:a,isLoading:i,status:x?"complete":"error",error:x?l:l??"Generation timed out. Please try again."}}return{thumbnailSet:a,isLoading:i,status:r,error:l}}function _s(t,n,o){const[a,s]=w.useState([]);w.useEffect(()=>{if(!t||!n||!o)return;const f=es(Ne,"users",t,"contextLibrary"),r=ts(f,Ze("setId","==",o),Ze("studioId","==",n)),m=mt(r,l=>{const u=[];l.forEach(g=>{var h,x,p,N;const c=g.data();u.push({id:g.id,status:c.status||"pending",storageUrl:c.storageUrl,storagePath:c.storagePath,mimeType:c.mimeType,variationIndex:c.variationIndex,totalVariations:c.totalVariations,aspectRatio:c.aspectRatio,promptText:c.promptText,previewUrl:c.previewUrl,insights:c.insights,analysisStatus:c.analysisStatus,analysisStartedAt:((x=(h=c.analysisStartedAt)==null?void 0:h.toMillis)==null?void 0:x.call(h))??c.analysisStartedAt,uploadedAt:((N=(p=c.uploadedAt)==null?void 0:p.toMillis)==null?void 0:N.call(p))??c.uploadedAt})}),u.sort((g,c)=>(g.variationIndex??0)-(c.variationIndex??0)),s(u)},l=>{console.error("[useThumbnailSetResults] Listener error:",l)});return()=>m()},[t,n,o]);const i=a.filter(f=>f.status==="complete").length;return{results:a,completedCount:i}}function ut(){const t=document.activeElement;return!!((t==null?void 0:t.tagName)==="INPUT"||(t==null?void 0:t.tagName)==="TEXTAREA"||document.querySelector('[role="dialog"]'))}function Bs({userId:t,studioId:n,teamId:o,setId:a,thumbnailSet:s,thumbnailSetState:i,results:f,selectedIndex:r,setSelectedIndex:m}){const l=Be(),[u,g]=w.useState(!1),[c,h]=w.useState(!1),[x,p]=w.useState(!1),[N,P]=w.useState(""),[b,v]=w.useState(!1),[d,I]=w.useState(null),[_,D]=w.useState("image/png"),[E,X]=w.useState(!1),O=w.useRef(null),U=w.useCallback(async C=>
6{if(!C.id||!t||!n||u)return;g(!0);const A=(s==null?void 0:s.title)||(i==null?void 0:i.title)||"Custom Thumbnail",$=(C.variationIndex??0)+1,z=((s==null?void 0:s.variationCount)||(i==null?void 0:i.variationCount)||1)>1?`${A} - #${$}`:A;try{const H=await Et({studioId:n,teamId:o,contextImageId:C.id,projectName:z});ke.activation.setPendingEditorLoad({creationMode:"thumbnail_set_ai",entrySurface:"thumbnail_set_page",deviceClass:ke.activation.getDeviceClass()}),l(`/studio/${n}/editor/${H.projectId}`)}catch(H){console.error("[useThumbnailSetActions] Failed to create project:",H),g(!1)}},[t,n,o,l,u,s,i]),M=w.useCallback(()=>{l(`/studio/${n}/assets?tab=sets`)},[l,n]),S=w.useCallback(()=>{l(`/studio/${n}/thumbnails?tab=sets`)},[l,n]),j=w.useCallback(()=>{const C=(s==null?void 0:s.title)||(i==null?void 0:i.title)||"Custom Thumbnail";P(C),p(!0),setTimeout(()=>{var A;return(A=O.current)==null?void 0:A.focus()},50)},[s==null?void 0:s.title,i==null?void 0:i.title]),k=w.useCallback(async()=>{if(!t||!n||!a)return;const C=N.trim()||"Custom Thumbnail";p(!1);try{const A=ze(Ne,"users",t,"studios",n,"thumbnailSets",a);await ss(A,{title:C})}catch(A){console.error("[useThumbnailSetActions] Failed to update title:",A)}},[t,n,a,N]),R=w.useCallback(C=>{C.key==="Enter"?k():C.key==="Escape"&&p(!1)},[k]),G=w.useCallback(()=>{if(!n)return;const{path:C,state:A}=ps(n,s??{});l(C,{state:A})},[l,n,s]),Z=w.useCallback(async C=>{const A=C??f.find($=>$.variationIndex===r);if(!(!(A!=null&&A.storageUrl)||E)){X(!0);try{const $=await et(A.storageUrl),L=new FileReader,z=await new Promise((H,fe)=>{L.onloadend=()=>H(L.result),L.onerror=fe,L.readAsDataURL($)});I(z),D($.type||"image/png"),v(!0)}catch($){console.error("[useThumbnailSetActions] Failed to load image for download:",$)}finally{X(!1)}}},[f,r,E]),ue=w.useCallback(()=>{v(!1),I(null)},[]),ce=f.find(C=>C.variationIndex===r),B=w.useCallback(async C=>{const A=f.find($=>$.variationIndex===r);if(!(!(A!=null&&A.storageUrl)||c)){h(!0);try{const $=await et(A.storageUrl),L=new Image;L.crossOrigin="anonymous",await new Promise((me,Q)=>{L.onload=()=>me(),L.onerror=()=>Q(new Error("Failed to load image")),L.src=URL.createObjectURL($)});const z=document.createElement("canvas");z.width=L.naturalWidth,z.height=L.naturalHeight;const H=z.getContext("2d");if(!H)throw new Error("Failed to get canvas context");H.drawImage(L,0,0),URL.revokeObjectURL(L.src);const fe=C.format==="jpeg"?"image/jpeg":"image/png",Ce=C.format==="jpeg"?C.quality:void 0;z.toBlob(me=>{if(!me){console.error("[useThumbnailSetActions] Failed to convert image"),h(!1);return}const Q=URL.createObjectURL(me),W=document.createElement("a");W.href=Q;const ge=C.format==="jpeg"?"jpg":"png",he=((s==null?void 0:s.title)||(i==null?void 0:i.title)||"thumbnail").replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"thumbnail";W.download=`${he}-${r+1}.${ge}`,document.body.appendChild(W),W.click(),document.body.removeChild(W),URL.revokeObjectURL(Q),h(!1)},fe,Ce)}catch($){console.error("[useThumbnailSetActions] Failed to download:",$),h(!1)}}},[f,r,c,s==null?void 0:s.title,i==null?void 0:i.title]),K=w.useCallback(()=>{var L;const C=f.filter(z=>z.status==="complete");if(C.length===0)return;const A=C.findIndex(z=>z.variationIndex===r),$=A<=0?C.length-1:A-1;m(((L=C[$])==null?void 0:L.variationIndex)??0)},[f,r,m]),de=w.useCallback(()=>{var L;const C=f.filter(z=>z.status==="complete");if(C.length===0)return;const A=C.findIndex(z=>z.variationIndex===r),$=A>=C.length-1?0:A+1;m(((L=C[$])==null?void 0:L.variationIndex)??0)},[f,r,m]);return w.useEffect(()=>{const C=A=>{u||A.key!=="ArrowLeft"&&A.key!=="ArrowRight"||ut()||(A.key==="ArrowLeft"?K():de())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[K,de,u]),{isCreatingProject:u,isDownloading:c,isEditingTitle:x,editedTitle:N,titleInputRef:O,setEditedTitle:P,isDownloadModalOpen:b,selectedResult:ce,downloadImageBase64:d,downloadImageMimeType:_,isLoadingDownloadImage:E,handleCreateProject:U,handleViewInLibrary:M,handleBack:S,handleStartEditTitle:j,handleSaveTitle:k,handleTitleKeyDown:R,handleGenerateMore:G,handleDownload:B,handleOpenDownloadModal:Z,handleCloseDownloadModal:ue,handlePrevious:K,handleNext:de}}
6const J=t=>{const n=Math.sin(t)*1e4;return n-Math.floor(n)};function Fs({thumbnailSet:t,results:n}){const[o,a]=w.useState(!1),s=(t==null?void 0:t.aspectRatio)==="9:16",i=(t==null?void 0:t.aspectRatio)==="both",f=w.useCallback(async r=>{var u;let m=n.filter(g=>g.status==="complete"&&g.storageUrl),l=s;if(i){l=r==="9:16";const g=m.filter(c=>c.aspectRatio==="9:16"===l);g.length>0?m=g:l=((u=m[0])==null?void 0:u.aspectRatio)==="9:16"}if(m.length!==0){a(!0);try{const g={"16:9":{width:1200,height:675},"9:16":{width:1080,height:1920},"1:1":{width:1080,height:1080}}[r],c=document.createElement("canvas");c.width=g.width,c.height=g.height;const h=c.getContext("2d");if(!h)throw new Error("Canvas context not available");const x=m.map(I=>I.storageUrl),[p,...N]=await Promise.all([tt("/logo-192.png"),...x.map(I=>tt(I).catch(()=>null))]),P=N.filter(Boolean);r==="16:9"?zs(h,g,p,P,l):r==="9:16"?$s(h,g,p,P,l):Os(h,g,p,P,l);const b=await hs(c,ws);if(!b){console.error("[useThumbnailSetShare] Failed to create blob"),a(!1);return}const v=`thumio-set-${r.replace(":","x")}-${Date.now()}.jpg`;if(typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches&&bs()){const I=await js(b,{filename:v,text:"Made with Thumio: thumio.com"});if(I==="shared"){ke.app.socialShare("native","thumbnail_set",{shareFormat:r,itemCount:P.length,generationEntry:"thumbnail_set_share"}),a(!1);return}if(I==="cancelled"){a(!1);return}}ys(b,v),a(!1),ke.app.shareAssetDownloaded("thumbnail_set",{shareFormat:r,itemCount:P.length,downloadContext:"thumbnail_set_export",generationEntry:"thumbnail_set_share"})}catch(g){console.error("[useThumbnailSetShare] Failed to generate share image:",g),a(!1)}}},[n,s,i]);return{isGenerating:o,generateShareImage:f}}function Ge(t,n,o){vs(t,n,o),ks(t,n,o,{verticalColor:"rgba(147, 51, 234, 0.03)"})}function zs(t,n,o,a,s){const{width:i,height:f}=n,r=28;Ge(t,i,f),$e(t,o,r,16);const m=56,l=f-m-24;let u=260,g=u/(16/9);if(s){const h=Math.max(a.length,1),x=h<=4?1:Math.ceil(h/4);g=Math.min(480,(l-(x-1)*15)/x),u=g*(9/16)}const c=Ye(a.length,i-r*2,l,u,g,"16:9");a.forEach((h,x)=>{if(x>=c.length)return;const p=c[x],N=J(x*7)*10-5;Oe(t,h,r+p.x,m+p.y,u,g,10,{rotation:N,shadow:!0,border:!0}),Se(t,x+1,r+p.x+8,m+p.y+8,N)}),Ve(t,i,f,r)}function $s(t,n,o,a,s){const{width:i,height:f}=n,r=40;Ge(t,i,f),$e(t,o,r,50);const m=95,l=f-m-50,u=.9;let g=i-r*2-20,c=g/(16/9);if(s){const x=Math.max(a.length,1);c=Math.min(1e3,l/(u*(1+(x-1)*.4))),g=c*(9/16)}const h=Ye(a.length,i-r*2,l,g*u,c*u,"9:16");a.forEach((x,p)=>{if(p>=h.length)return;const N=h[p],P=J(p*7)*8-4;Oe(t,x,r+N.x,m+N.y,g*u,c*u,12,{rotation:P,shadow:!0,border:!0}),Se(t,p+1,r+N.x+10,m+N.y+10,P)}),Ve(t,i,f,r)}function Os(t,n,o,a,s){const{width:i,height:f}=n,r=32;Ge(t,i,f),$e(t,o,r,20);const m=60,l=f-m-35;let u=340,g=u/(16/9);if(s){const h=Math.max(a.length,1),x=h<=4?2:3,p=Math.ceil(h/x);g=Math.min(560,(l-(p-1)*20)/p),u=g*(9/16)}const c=Ye(a.length,i-r*2,l,u,g,"1:1");a.forEach((h,x)=>{if(x>=c.length)return;const p=c[x],N=J(x*7)*10-5;Oe(t,h,r+p.x,m+p.y,u,g,10,{rotation:N,shadow:!0,border:!0}),Se(t,x+1,r+p.x+8,m+p.y+8,N)}),Ve(t,i,f,r)}function Ye(t,n,o,a,s,i){const f=[];if(i==="16:9"){const r=t<=4,m=r?t:4,l=r?1:Math.ceil(t/4),u=m>1?(n-a*m)/(m-1):0,g=s+15,c=l*s+(l-1)*15,h=(o-c)/2;for(let x=0;x<t;x++){const p=r?0:Math.floor(x/4),N=r?x:x%4,P=r?t:Math.min(4,t-p*4),b=P*a+(P-1)*Math.min(u,20),v=(n-b)/2,d=P>1?Math.min(u,20):0,I=v+N*(a+d),_=h+p*g,D=J(x*3)*12-6,E=J(x*5)*10-5;f.push({x:Math.max(0,Math.min(I+D,n-a)),y:Math.max(0,Math.min(_+E,o-s))})}}else if(i==="9:16"){const m=s*.4,l=s+(t-1)*m,u=Math.max(0,(o-l)/2);for(let g=0;g<t;g++){const c=(n-a)/2,h=u+g*m,p=(g%2===0?-1:1)*20+J(g*3)*16-8,N=J(g*5)*10-5;f.push({x:Math.max(0,Math.min(c+p,n-a)),y:Math.max(0,Math.min(h+N,o-s))})}}else{const r=t<=4?2:3,m=Math.ceil(t/r),l=r>1?Math.min(25,(n-a*r)/(r-1)):0,u=m>1?Math.min(20,(o-s*m)/(m-1)):0,g=m*s+(m-1)*u,c=(o-g)/2;for(let h=0;h<t;h++){const x=Math.floor(h/r),p=h%r,N=Math.min(r,t-x*r),P=N*a+(N-1)*l,v=(n-P)/2+p*(a+l),d=c+x*(s+u),I=J(h*3)*16-8,_=J(h*5)*12-6;f.push({x:Math.max(0,Math.min(v+I,n-a)),y:Math.max(0,Math.min(d+_,o-s))})}}return f}function Se(t,n,o,a,s){t.save(),s!==0&&(t.translate(o+12,a+12),t.rotate(-s*Math.PI/180),t.translate(-(o+12),-(a+12))),t.fillStyle="rgba(60, 60, 60, 0.95)",t.beginPath(),t.arc(o+12,a+12,12,0,Math.PI*2),t.fill(),t.strokeStyle="rgba(255, 255, 255, 0.2)",t.lineWidth=1,t.stroke(),t.font="bold 12px system-ui, -apple-system, BlinkMacSystemFont, sans-serif",t.textAlign="center",t.textBaseline="middle",t.fillStyle="#fff",t.fillText(String(n),o+12,a+12),t.restore(
6)}function Vs(t){const[n,o]=w.useState(!1),[a,s]=w.useState(new Set),i=w.useMemo(()=>t.filter(c=>c.status==="complete"&&!!c.id).map(c=>c.id),[t]),f=w.useMemo(()=>new Set(i),[i]);w.useEffect(()=>{s(c=>{if(c.size===0)return c;let h=!1;const x=new Set;for(const p of c)f.has(p)?x.add(p):h=!0;return h?x:c})},[f]);const r=w.useCallback(()=>{s(new Set),o(!1)},[]),m=w.useCallback(()=>{if(n){r();return}o(!0)},[n,r]),l=w.useCallback(c=>{f.has(c)&&s(h=>{const x=new Set(h);return x.has(c)?x.delete(c):x.add(c),x})},[f]),u=i.length>0&&a.size===i.length,g=w.useCallback(()=>{s(c=>c.size===i.length?new Set:new Set(i))},[i]);return{isSelectMode:n,selectedResultIds:a,areAllSelected:u,toggleSelectMode:m,toggleResultSelection:l,toggleSelectAll:g,exitSelectMode:r}}var ot;const ft=((ot=_t.find(t=>t.id==="campaign"))==null?void 0:ot.icon)||Lt,at=[{id:"16:9",label:"Twitter / X",description:"1200Ã675"},{id:"9:16",label:"TikTok / Reels",description:"1080Ã1920"},{id:"1:1",label:"Instagram",description:"1080Ã1080"}],Gs=({title:t,isEditingTitle:n,editedTitle:o,titleInputRef:a,completedCount:s,expectedCount:i,generationStatus:f="generating",onEditTitle:r,onSaveTitle:m,onTitleChange:l,onTitleKeyDown:u,onBack:g,onViewInLibrary:c,onShare:h,isGeneratingShare:x=!1,isSelectMode:p=!1,onToggleSelectMode:N,canSelectResults:P=!1,onToggleSelectAll:b,areAllSelected:v=!1})=>{const[d,I]=w.useState(!1),[_,D]=w.useState(!1),{isMobile:E}=rt(),X=w.useRef(null),[O,U]=w.useState(!1),M=w.useRef(f);w.useEffect(()=>{const B=M.current==="generating";if(M.current=f,B&&f==="complete"){U(!0);const K=setTimeout(()=>U(!1),2500);return()=>clearTimeout(K)}},[f]);const S=f==="complete"||f==="error",j=s>0,k=x||!S||!j,R=S&&j&&P,G=f==="generating",Z=i>0?Math.min(100,Math.round(s/i*100)):0;w.useEffect(()=>{if(!d||E)return;const B=K=>{X.current&&!X.current.contains(K.target)&&I(!1)};return document.addEventListener("click",B),()=>document.removeEventListener("click",B)},[d,E]);const ue=()=>{k||(E?D(!0):I(!d))},ce=B=>{h==null||h(B),I(!1),D(!1)};return e.jsxs("header",{className:"relative z-10 flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-ink/[0.06] bg-rh-bg/80 backdrop-blur-sm sticky top-0",children:[e.jsxs("button",{onClick:g,className:"flex items-center gap-2 text-rh-text-light hover:text-fg transition-colors p-2 -ml-2 sm:ml-0 sm:p-0",children:[e.jsx(Ns,{size:20}),e.jsx("span",{className:"hidden sm:inline",children:"Back to Studio"})]}),e.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 flex items-center gap-2 max-w-[240px] sm:max-w-[380px]",children:[n?e.jsx("input",{ref:a,type:"text",value:o,onChange:B=>{B.target.value.length<=60&&l(B.target.value)},onBlur:m,onKeyDown:u,maxLength:60,size:Math.max(o.length+2,10),className:"text-sm font-semibold bg-ink/5 text-fg px-2 py-1 rounded border border-rh-green/50 focus:outline-none focus:border-rh-green selection:bg-rh-green/30",autoFocus:!0,onFocus:B=>B.target.select()}):e.jsx("button",{onClick:r,className:"group hover:text-rh-green transition-colors min-w-0",title:"Click to rename",children:e.jsx("span",{className:"text-sm font-semibold text-fg group-hover:text-rh-green transition-colors truncate block",children:t||"Thumbnail"})}),G&&i>0&&e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(le,{size:11,className:"animate-spin text-fg/50"}),e.jsxs("span",{className:"text-[10px] font-medium text-fg/60 tabular-nums whitespace-nowrap",children:[s,"/",i]})]}),O&&e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-green-500/10 border border-green-500/20 flex-shrink-0 animate-in fade-in zoom-in-95 duration-200",children:[e.jsx(it,{size:11,className:"text-green-400"}),e.jsx("span",{className:"text-[10px] font-medium text-green-400 whitespace-nowrap",children:"All ready"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[p&&b&&e.jsx("button",{onClick:b,className:"hidden sm:block px-3 py-2 text-sm rounded-lg text-fg/70 hover:text-fg hover:bg-ink/5 transition-colors",children:v?"Deselect all":"Select all"}),N&&e.jsxs("button",{onClick:N,disabled:!p&&!R,className:Y("flex items-center gap-1.5 p-2 sm:px-3 sm:py-2 text-sm rounded-lg transition-colors",!p&&!R?"bg-ink/5 text-fg/30 curs
6or-not-allowed":p?"bg-fg text-rh-dark hover:bg-fg/90":"bg-ink/10 hover:bg-ink/15 text-fg/85"),children:[e.jsx(ft,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:p?"Cancel":"Bulk Edit"})]}),h&&e.jsxs("div",{className:"relative",ref:X,children:[e.jsxs("button",{onClick:ue,disabled:k,className:Y("flex items-center gap-1.5 p-2 sm:px-3 sm:py-2 text-sm rounded-lg transition-colors",k?"bg-ink/5 text-fg/30 cursor-not-allowed":"bg-ink/10 hover:bg-ink/20 text-fg"),children:[x?e.jsx(le,{size:16,className:"animate-spin"}):e.jsx(Cs,{size:16}),e.jsx("span",{className:"hidden sm:inline",children:"Share"}),!k&&e.jsx(Dt,{size:14,className:Y("hidden sm:block transition-transform",d&&"rotate-180")})]}),!E&&d&&!k&&e.jsx("div",{className:"absolute right-0 top-full mt-2 w-48 bg-rh-surface border border-ink/10 rounded-xl shadow-xl",children:e.jsx("div",{className:"p-1",children:at.map(B=>e.jsxs("button",{type:"button",onClick:()=>ce(B.id),className:"w-full flex items-center justify-between px-3 py-2.5 text-left hover:bg-ink/5 rounded-lg transition-colors",children:[e.jsx("span",{className:"text-sm text-fg",children:B.label}),e.jsx("span",{className:"text-xs text-fg/40",children:B.description})]},B.id))})})]}),e.jsxs("button",{onClick:c,disabled:s===0,className:Y("flex items-center gap-2 p-2 sm:px-4 sm:py-2 text-sm rounded-lg transition-colors",s>0?"bg-ink/10 hover:bg-ink/20 text-fg":"bg-ink/5 text-fg/30 cursor-not-allowed"),children:[e.jsx(Fe,{size:18}),e.jsx("span",{className:"hidden sm:inline",children:"Sets"})]})]}),G&&i>0&&e.jsx("div",{className:"absolute bottom-0 inset-x-0 h-[2px] bg-ink/[0.06]",children:e.jsx("div",{className:"h-full bg-rh-green transition-[width] duration-500 ease-out",style:{width:`${Z}%`}})}),e.jsx(Ut,{open:_,onOpenChange:D,title:"Share Thumbnail Set",children:e.jsxs("div",{className:"px-4 pb-6",children:[e.jsx("p",{className:"text-sm text-fg/50 mb-4",children:"Choose a format for your shareable image"}),e.jsx("div",{className:"space-y-2",children:at.map(B=>e.jsxs("button",{type:"button",onClick:()=>ce(B.id),className:"w-full flex items-center justify-between p-4 bg-ink/5 hover:bg-ink/10 rounded-xl transition-colors",children:[e.jsx("p",{className:"text-base font-medium text-fg",children:B.label}),e.jsx("p",{className:"text-sm text-fg/40",children:B.description})]},B.id))})]})})]})},_e=({size:t="grid",showButtons:n=!1})=>{const o=t==="preview"?64:32;return e.jsxs("div",{className:"absolute inset-0 bg-rh-surface-2",children:[e.jsx("div",{className:"absolute inset-0 animate-[skeleton-shimmer_3s_ease-in-out_infinite]",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%)"}}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(Bt,{size:o,className:"text-ink/[0.06]"})}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute bottom-3 left-3 w-32 h-9 rounded-lg bg-ink/[0.06]"}),e.jsx("div",{className:"absolute bottom-3 right-3 w-10 h-10 rounded-lg bg-ink/[0.06]"}),e.jsx("div",{className:"absolute top-3 right-3 w-12 h-6 rounded-md bg-ink/[0.06]"})]})]})},gt=({src:t,alt:n,size:o,className:a})=>{const[s,i]=te.useState(0);if(te.useEffect(()=>i(0),[t]),s>=2)return e.jsxs("div",{className:"w-full h-full bg-rh-surface-2 flex flex-col items-center justify-center gap-2 text-center p-4",children:[e.jsx(Ts,{size:24,className:"text-fg/25"}),e.jsx("span",{className:"text-xs text-fg/40 font-medium",children:"Removed from library"})]});const f=Le(t,o)||t,r=s===0?f:t;return e.jsx("img",{src:r,alt:n,className:a,onError:()=>{i(m=>m===0&&f!==t?1:2)}})},Ys=({results:t,selectedIndex:n,completedCount:o,expectedCount:a,isCreatingProject:s,isDownloading:i,isVertical:f=!1,hasFailed:r=!1,onPrevious:m,onNext:l,onCreateProject:u,onDownload:g})=>{const c=t.find(p=>p.variationIndex===n&&p.status==="complete"),h=c==null?void 0:c.storageUrl,x=o===0;return e.jsxs("div",{className:Y("relative w-full",f&&"max-w-[300px] sm:max-w-[340px] mx-auto"),children:[e.jsx("div",{className:"absolute -inset-4 sm:-inset-8 rounded-[3rem] blur-2xl pointer-events-none bg-fg/[0.04]"}),e.jsxs("div",{className:Y("group relative rounded-xl sm:rounded-2xl overflow-hidden bg-rh-surface-2 border border-ink/10",f?"aspect-[9/16]":"aspect-video"),children:[x&&r?e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center px-6",children:[e.jsx("p",{className:"text-sm font-medium text-fg/60",children:"Nothing generated yet"}),e.jsx("p",{className:"mt-1 text-xs text-fg/40",children:"Use the retry buttons below: failed variations were never charged."})]}):x?e.jsxs(e.Fragment,{children:[e.jsx(_e,{size:"preview",showButtons:!0}),e.jsx("div",{className:"absolute inset-x-0 top-1/2 mt-12 flex justify-center pointer-events-none",children:e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-black/40 backdrop-blur-sm text-xs font-medium text-white/70",children:[e.jsx(le,{size:13,className:"animate-spin"}),"Generating variation ",n+1,"â¦"]})})]}):h?e.jsx(gt,{src:h,alt:`Thumbnail ${n+1}`,size:"large",className:Y("w-full h-full object-cover transition-all duration-300",s&&"scale-105 blur-sm")}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{size:"preview"}),o<a&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-black/40 backdrop-blur-sm text-xs font-medium text-white/70",children:[e.jsx(le,{size:13,className:"animate-spin"}),"Generating variation ",n+1,"â¦"]})})]}),s&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40 z-10",children:e.jsx("div",{className:"animate-pulse",children:e.jsx(Ft,{size:"lg",className:"!h-16 !w-16 shadow-2xl"})})}),o>1&&!s&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:m,className:"absolute left-2 sm:left-3 top-1/2 -translate-y-1/2 w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-black/50 hover:bg-black/70 flex items-center justify-center transition-all z-10 sm:opacity-0 sm:group-hover:opacity-100 focus-visible:opacity-100","aria-label":"Previous thumbnail",children:e.jsx(zt,{size:20,className:"text-white"})}),e.jsx("button",{onClick:l,className:"absolute right-2 sm:right-3 top-1/2 -translate-y-1/2 w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-black/50 hover:bg-black/70 flex items-center justify-center transition-all z-10 sm:opacity-0 sm:group-hover:opacity-100 focus-visible:opacity-100","aria-label":"Next thumbnail",children:e.jsx($t,{size:20,className:"text-white"})})]}),h&&!s&&!x&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>c&&u(c),className:"absolute bottom-3 left-3 flex items-center gap-2 px-4 sm:px-5 py-2 rounded-lg bg-fg hover:bg-fg/90 text-rh-dark text-sm font-semibold transition-colors shadow-lg",children:"Edit Thumbnail"}),e.jsx("button",{onClick:g,disabled:i,className:"absolute bottom-3 right-3 w-10 h-10 rounded-lg bg-black/60 hover:bg-black/80 flex items-center justify-center transition-colors",title:"Download",children:i?e.jsx(le,{size:18,className:"animate-spin text-white"}):e.jsx(lt,{size:18,className:"text-white"})})]}),!s&&!x&&e.jsxs("div",{className:"absolute top-3 right-3 px-2 py-1 rounded-md bg-black/60 text-white text-xs font-medium tabular-nums",children:[n+1," / ",a]})]})]})};function Ss(t,n){const[o,a]=w.useState({}),s=w.useMemo(()=>[...n].sort().join(","),[n]);return w.useEffect(()=>{if(!t||!s)return;let i=!1;
6const f=s.split(",").filter(Boolean);return(async()=>{const r=await Promise.all(f.map(async l=>{try{const u=await as(ze(Ne,"users",t,"contextLibrary",l));if(!u.exists())return[l,null];const g=u.data().storageUrl;return typeof g=="string"?[l,g]:[l,null]}catch{return null}}));if(i)return;const m={};for(const l of r)l&&(m[l[0]]=l[1]);a(m)})(),()=>{i=!0}},[t,s]),{urls:o}}const ve=(t,n)=>!t||t.startsWith("ctx_")?n:t,ie=({label:t,children:n})=>e.jsxs("div",{className:"flex items-center gap-2.5 min-h-11 px-3 py-1.5 rounded-xl bg-rh-surface border border-ink/[0.08] lg:justify-between",children:[e.jsx("span",{className:"text-[9px] text-fg/40 font-bold tracking-widest uppercase whitespace-nowrap",children:t}),e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap justify-end",children:n})]}),xt=({count:t,shape:n})=>e.jsx("div",{className:Y("w-7 h-7 bg-ink/[0.05] border border-ink/10 flex items-center justify-center flex-shrink-0",n==="circle"?"rounded-full":"rounded-md"),children:e.jsxs("span",{className:"text-[9px] text-fg/50",children:["+",t]})}),nt=({entries:t,shape:n,fallbackIcon:o})=>e.jsxs(e.Fragment,{children:[t.slice(0,3).map(a=>e.jsx(Ue,{src:a.src,fullSrc:a.fullSrc,alt:a.alt,shape:n,fallbackIcon:o},a.key)),t.length>3&&e.jsx(xt,{count:t.length-3,shape:n})]}),qs={normal:{icon:De,label:"Normal"},minimal:{icon:Ds,label:"Minimal"},none:{icon:Is,label:"None"}},Xs=({thumbnailSet:t,isLoading:n=!1,userId:o})=>{var M,S;const{styleReference:a,selfieReference:s,propsReference:i,textStyle:f,setType:r,compositionName:m,compositionProcessedImageUrl:l,compositionSlots:u,compositionPersonImages:g,compositionPropImages:c,compositionHasText:h,modelId:x}=t??{},p=r==="composition",N=te.useMemo(()=>{var k;const j=[];for(const R of s??[])R.id&&j.push(R.id);for(const R of i??[])R.id&&j.push(R.id);for(const R of[...g??[],...c??[]]){const G=R.id?(k=u==null?void 0:u[R.id])==null?void 0:k.contextImageId:void 0;G&&j.push(G)}return j},[s,i,g,c,u]),{urls:P}=Ss(o,N),b=te.useCallback((j,k)=>j&&j in P?P[j]:k??null,[P]),v=te.useMemo(()=>p?(g??[]).map((j,k)=>{var G;const R=b(j.id?(G=u==null?void 0:u[j.id])==null?void 0:G.contextImageId:void 0,j.imageUrl);return{key:j.id||String(k),src:R,fullSrc:R,alt:ve(j.label,`Person ${k+1}`)}}):(s??[]).map((j,k)=>{const R=b(j.id,j.imageUrl);return{key:j.id||String(k),src:Le(R,"thumb"),fullSrc:R,alt:ve(j.handle,`Person ${k+1}`)}}),[p,g,u,s,b]),d=te.useMemo(()=>p?(c??[]).map((j,k)=>{var G;const R=b(j.id?(G=u==null?void 0:u[j.id])==null?void 0:G.contextImageId:void 0,j.imageUrl);return{key:j.id||String(k),src:R,fullSrc:R,alt:ve(j.label,`Prop ${k+1}`)}}):(i??[]).map((j,k)=>{const R=b(j.id,j.imageUrl);return{key:j.id||String(k),src:Le(R,"thumb"),fullSrc:R,alt:ve(j.handle,`Image ${k+1}`)}}),[p,c,u,i,b]),I=te.useMemo(()=>Object.values(u??{}).map(k=>k==null?void 0:k.newText).filter(k=>typeof k=="string"&&k.trim().length>0),[u]),_=te.useMemo(()=>{const j=(a==null?void 0:a.thumbnails)??[],k=new Map;for(const R of j)k.has(R.channelId)||k.set(R.channelId,{channelId:R.channelId,channelName:R.channelName,channelAvatarUrl:R.channelAvatarUrl});return Array.from(k.values())},[a==null?void 0:a.thumbnails]);if(n)return e.jsx("div",{className:"flex flex-wrap items-center gap-2 lg:flex-col lg:items-stretch",children:[1,2,3].map(j=>e.jsx("div",{className:"h-11 w-24 lg:w-auto rounded-xl bg-rh-surface border border-ink/[0.08] animate-pulse"},j))});if(!t)return null;const D=(a==null?void 0:a.thumbnails)??[],E=_[0],X=E&&!((M=E.channelId)!=null&&M.startsWith("asset_"))&&E.channelName!=="My Assets",O=f?qs[f]:null,U=(O==null?void 0:O.icon)??De;return e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:flex-col lg:items-stretch",children:[p&&e.jsxs(ie,{label:"Template",children:[e.jsx(Ue,{src:l??null,alt:m||"Composite template",shape:"video",fallbackIcon:e.jsx(ct,{size:14,className:"text-fg/30"})}),m&&e.jsx("span",{className:"text-xs text-fg/80 font-medium truncate max-w-[140px]",children:m})]}),!p&&D.length>0&&e.jsxs(ie,{label:"Style",children:[X&&e.jsx("div",{className:"w-5 h-5 rounded-full bg-ink/10 flex items-center justify-center overflow-hidden flex-shrink-0",children:E.channelAvatarUrl?e.jsx("img",{src:E.channelAvatarUrl,alt:E.channelName,className:"w-full h-full object-cover",referrerPolicy:"no-referrer"}):e.jsx("span",{className:"text-[9px] font-bold text-fg/60",children:((S=E.channelName)==null?void 0:S.charAt(0).toUpperCase())||"?"})}),e.jsx("span",{className:"text-xs text-fg/80 font-medium truncate max-w-[120px]",children:_.length>
61?`${E==null?void 0:E.channelName} +${_.length-1}`:E==null?void 0:E.channelName}),D.slice(0,3).map((j,k)=>e.jsx(Ue,{src:j.url,alt:`Style reference ${k+1}`,shape:"video",fallbackIcon:e.jsx(st,{size:12,className:"text-fg/40"})},k)),D.length>3&&e.jsx(xt,{count:D.length-3,shape:"rounded"})]}),v.length>0&&e.jsx(ie,{label:"People",children:e.jsx(nt,{entries:v,shape:"circle",fallbackIcon:e.jsx(Ms,{size:13,className:"text-fg/40"})})}),d.length>0&&e.jsx(ie,{label:p?"Props":"Images",children:e.jsx(nt,{entries:d,shape:"rounded",fallbackIcon:e.jsx(st,{size:13,className:"text-fg/40"})})}),p?h&&e.jsx(ie,{label:"Text",children:I.length>0?e.jsxs(e.Fragment,{children:[I.slice(0,2).map((j,k)=>e.jsx("span",{title:j,className:"px-2 py-0.5 rounded-md bg-ink/[0.05] border border-ink/10 text-[10px] font-semibold text-fg/70 truncate max-w-[100px]",children:j},k)),I.length>2&&e.jsxs("span",{className:"px-1.5 py-0.5 rounded-md bg-ink/[0.05] border border-ink/10 text-[10px] text-fg/50",children:["+",I.length-2]})]}):e.jsx(De,{size:14,className:"text-fg/60"})}):O&&e.jsxs(ie,{label:"Text",children:[e.jsx(U,{size:14,className:"text-fg/60"}),e.jsx("span",{className:"text-xs text-fg/70 font-medium",children:O.label})]}),(()=>{const j=Ot(x??"gemini-3-pro-image"),k=j.icon;return e.jsxs(ie,{label:"Model",children:[e.jsx(k,{size:13,className:"text-fg/50"}),e.jsx("span",{className:"text-xs text-fg/70 font-medium whitespace-nowrap",children:j.shortName})]})})()]})},Hs=({isComposition:t,onClick:n,disabled:o})=>{const a=t?ct:Fe;return e.jsx("div",{className:"flex items-center gap-3 lg:flex-col lg:items-stretch lg:gap-2",children:e.jsxs("button",{onClick:n,disabled:o,className:Y("h-11 px-6 flex items-center justify-center gap-2 rounded-xl bg-ink/[0.06] hover:bg-ink/10 border border-ink/10 hover:border-ink/20 text-fg transition-all",o&&"opacity-50 cursor-not-allowed"),children:[e.jsx(a,{size:18}),e.jsx("span",{className:"text-sm font-bold",children:"New Set"})]})})},Ks=({prompt:t,isExpanded:n,onToggleExpand:o,isLoading:a=!1})=>{if(a)return e.jsxs("div",{className:"flex items-center gap-2.5 min-h-11 px-3 py-1.5 rounded-xl bg-rh-surface border border-ink/[0.08]",children:[e.jsx("div",{className:"h-3 w-12 rounded bg-ink/[0.06] animate-pulse"}),e.jsx("div",{className:"h-3.5 flex-1 rounded bg-ink/[0.06] animate-pulse"})]});if(!t)return null;const s=t.length>100;return e.jsxs("div",{className:"flex items-start gap-2.5 min-h-11 px-3 py-2.5 rounded-xl bg-rh-surface border border-ink/[0.08]",children:[e.jsx("span",{className:"text-[9px] text-fg/40 font-bold tracking-widest uppercase whitespace-nowrap leading-[18px]",children:"Prompt"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:Y(n&&"max-h-56 overflow-y-auto overscroll-contain pr-1"),children:e.jsxs("p",{className:Y("text-xs text-fg/70 font-medium leading-relaxed",!n&&"line-clamp-1"),children:['"',t,'"']})}),s&&e.jsx("button",{onClick:o,className:"text-[10px] text-fg/40 hover:text-fg/60 mt-0.5",children:n?"Show less":`Show more${t.length>500?` · ${t.length.toLocaleString()} chars`:"..."}`})]})]})},Qs=({result:t,index:n,isVertical:o=!1,isSelected:a,isCreatingProject:s,isSelectionMode:i=!1,isBulkSelected:f=!1,canBulkSelect:r=!1,onToggleBulkSelect:m,onClick:l,onQuickDownload:u,onQuickEdit:g,setActivityAt:c})=>{const h=(t==null?void 0:t.status)==="complete",x=9e5,p=(t==null?void 0:t.uploadedAt)??c,N=typeof p=="number"&&Date.now()-p>x,P=(!t||t.status==="pending")&&!N,b=h&&!s,v=i&&h,d=()=>{if(b){if(i){r&&(m==null||m());return}l()}},I=b&&!i&&(u||g);return e.jsxs("div",{className:Y("group relative rounded-xl overflow-hidden border-2 transition-all duration-300",o?"aspect-[9/16]":"aspect-video",i?r?"border-ink/20 hover:border-ink/60 cursor-pointer":"border-ink/10":h&&!s?"border-ink/20 hover:border-ink/60 cursor-pointer":"border-ink/10",!i&&a&&"border-fg ring-2 ring-ink/30",i&&f&&"border-fg ring-2 ring-ink/30",s&&"opacity-50 cursor-not-allowed"),onClick:d,children:[P&&e.jsxs(e.Fragment,{children:[e.jsx(_e,{size:"grid"}),(t==null?void 0:t.previewUrl)&&e.jsx(Rs,{src:t.previewUrl,className:"absolute inset-0 w-full h-full object-cover",zIndex:0})]}),h&&(t==null?void 0:t.storageUrl)&&e.jsx("div",{className:"w-full h-full animate-in fade-in zoom-in-95 duration-300",children:e.jsx(gt,{src:t.storageUrl,alt:`Variation ${n+1}`,size:"medium",className:"w-full h-full object-cover"})}),e.jsx("div",{className:Y("absolute top-2 left-2 px-2 py-1 rounded-md text-xs",i?f?"bg-fg text-rh-dark font-semibold":"bg-black/60 text-white/70":a?"bg-fg text-rh-dark font-medium":"bg-black/60 text-white/70"),children:n+1}),I&&e.jsxs("div",{className:"absolute bottom-2 right-2 flex items-center gap-1.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[u&&e.jsx("button",{type:"button",title:"Download","aria-label":`Download variation ${n+1}`,onClick:_=>{_.stopPropagation(),u()},className:"w-8 h-8 rounded-lg bg-black/60 hover:bg-black/80 flex items-center justify-center transition-colors",children:e.jsx(lt,{size:14,className:"text-white"})}),g&&e.jsx("button",{type:"button",title:"Edit in Studio","aria-label":`Edit variation ${n+1}`,onClick:_=>{_.stopPropagation(),g()},className:"w-8 h-8 rounded-lg bg-black/60 hover:bg-black/80 flex items-center justify-center transition-colors",children:e.jsx(As,{size:14,className:"text-white"})})]}),v&&e.jsx("div",{className:Y("absolute top-2 right-2 h-5 w-5 rounded-full border flex items-center justify-center transition-all",f?"bg-fg border-fg":"bg-black/45 border-white/35"),children:e.jsx(it,{className:Y("h-3 w-3 transition-transform",f?"text-rh-dark":"text-white",f?"scale-100":"scale-0")})})]})},Js=({generatedCount:t,requestedCount:n,isVertical:o=!1,isTeamBilled:a=!1,teamName:s,canFundTeam:i=!1})=>{var h,x;const f=Be(),{activeStudio:r}
6=dt(),{subscription:m,v2:l}=Vt(),u=r!=null&&r.teamId?`/settings/team?team=${r.teamId}`:"/settings/team",g=((h=m==null?void 0:m.plan)==null?void 0:h.id)??"free",c=(m==null?void 0:m.status)==="past_due"?"past_due":(l==null?void 0:l.downgradeReason)==="payment_failed"?"canceled":l!=null&&l.isInTrial?"trialing":g==="free"?"free":"active";return Ps(!0,{paywallSurface:"thumbnail_set_results",promptVariant:"budget_limit_reached",paywallType:"hard_block",featureGate:"thumbnail_set_generation",currentPlanId:g,currentBillingCycle:(x=m==null?void 0:m.plan)==null?void 0:x.billingCycle,isTrial:l==null?void 0:l.isInTrial,onDemandEnabled:l==null?void 0:l.autoRefillEnabled,billingState:c,entryPoint:"thumbnail_set_results"},"thumbnail_set_results:budget_limit_reached"),e.jsxs("div",{className:Y("relative rounded-xl overflow-hidden border border-ink/10 bg-rh-surface flex flex-col items-center justify-center p-4 text-center",o?"aspect-[9/16]":"aspect-video"),children:[e.jsx("p",{className:"text-sm text-fg/80 font-medium mb-1",children:"Budget Limit Reached"}),e.jsx("p",{className:"text-xs text-fg/50 mb-3",children:a&&!i?"The team's shared pool is out of credits. Ask a team owner or admin to top up.":a?`${s?`${s}'s`:"The team's"} shared pool ran out of credits after generating ${t} of ${n} requested.`:`Generated ${t} of ${n} requested`}),e.jsx("div",{className:"flex gap-2",children:a?e.jsx("button",{onClick:()=>f(u),className:"px-3 py-1.5 text-xs font-medium text-rh-dark bg-fg hover:bg-fg/90 rounded-lg transition-colors",children:i?"Buy team credits":"View team"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>f("/settings/spending"),className:"px-3 py-1.5 text-xs font-medium text-fg/70 hover:text-fg bg-ink/5 hover:bg-ink/10 border border-ink/10 rounded-lg transition-colors",children:"Buy Credits"}),e.jsx("button",{onClick:()=>f("/upgrade"),className:"px-3 py-1.5 text-xs font-medium text-rh-dark bg-fg hover:bg-fg/90 rounded-lg transition-colors",children:"Upgrade"})]})})]})},Zs=({index:t,title:n,detail:o,isRetrying:a,onRetry:s,isVertical:i=!1})=>e.jsxs("div",{className:Y("relative rounded-xl overflow-hidden border-2 border-dashed border-ink/[0.14] bg-rh-surface flex flex-col items-center justify-center px-3 text-center",i?"aspect-[9/16]":"aspect-video"),children:[e.jsx("div",{className:"absolute top-2 left-2 px-2 py-1 rounded-md text-xs bg-black/60 text-white/50",children:t+1}),e.jsx("p",{className:"text-sm font-medium text-fg/70",children:n}),o&&e.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-fg/40 line-clamp-2 max-w-[16rem]",children:o}),s&&e.jsx("button",{type:"button",onClick:s,disabled:a,className:"mt-2.5 flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-ink/[0.08] hover:bg-ink/[0.14] border border-ink/[0.1] text-xs font-semibold text-fg transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:a?e.jsxs(e.Fragment,{children:[e.jsx(le,{size:12,className:"animate-spin"}),"Retryingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(Es,{size:12}),"Retry"]})})]}),Ws=({results:t,expectedCount:n,selectedIndex:o,onSelectIndex:a,thumbnailSet:s,isCreatingProject:i,isSelectionMode:f=!1,selectedResultIds:r=new Set,onToggleResultSelection:m,onQuickDownload:l,onQuickEdit:u,failedIndexes:g=new Set,retryingIndexes:c=new Set,onRetrySlot:h,slotClassName:x,isVertical:p=!1,isTeamBilled:N=!1,teamName:P,canFundTeam:b=!1,slotIndexes:v})=>{const d=(s==null?void 0:s.status)==="complete",I=(s==null?void 0:s.error)||"",_=s==null?void 0:s.errorReason,D=I.toLowerCase().includes("credit"),E=_==="member_cap_reached"?"Spending cap reached":_==="pool_exhausted"&&N?"Team out of credits":D?"Out of credits":"Generation failed",X=_==="member_cap_reached"?"You've hit your team spending cap. Ask an owner to raise it, then retry. Failed variations were never charged.":_==="pool_exhausted"&&N?b?"Add seats or buy team credits, then retry.":"Ask a team owner to top up, then retry.":D?"Top up or upgrade, then retry. Failed variations were never charged.":I||(s==null?void 0:s.timeoutFailureMessage)||"High demand: no charge was applied. Retry in a moment.",O=v??Array.from({length:n},(U,M)=>M);return e.jsx(e.Fragment,{children:O.map(U=>{const M=t.find(G=>G.variationIndex===U),S=(M==null?void 0:M.status)==="complete",j=!f&&o===U&&S,k=!!(M!=null&&M.id&&r.has(M.id));return(s==null?void 0:s.budgetLimited)&&U===((s==null?void 0:s.variationCount)||0)&&U<n?e.jsx("div",{className:x,children:e.jsx(Js,{generatedCount:(s==null?void 0:s.variationCount)||0,requestedCount:(s==null?void 0:s.originalVariationCount)||0,isVertical:p,isTeamBilled:N,teamName:P,canFundTeam:b})},`budget-${U}`):!M&&g.has(U)?e.jsx("div",{className:x,children:e.jsx(Zs,{index:U,title:E,detail:X,isRetrying:c.has(U),onRetry:h?()=>h(U):void 0,isVertical:p})},`failed-${U}`):d&&!M?null:e.jsx("div",{className:x,children:e.jsx(Qs,{result:M,index:U,isVertical:p,isSelected:j,isCreatingProject:i,isSelectionMode:f,isBulkSelected:k,canBulkSelect:!!(M!=null&&M.id&&S),onToggleBulkSelect:M!=null&&M.id?()=>m==null?void 0:m(M.id):void 0,onClick:()=>a(U),onQuickDownload:M&&l?()=>l(M):void 0,onQuickEdit:M&&u?()=>
6u(M):void 0,setActivityAt:(s==null?void 0:s.updatedAt)??(s==null?void 0:s.createdAt)})},U)})})},Ee=({completedCount:t,label:n,displayTotal:o,...a})=>e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-1 mb-2",children:[e.jsx("span",{className:"text-[10px] text-fg/40 font-bold tracking-widest uppercase",children:n??"Variants"}),e.jsxs("span",{className:"text-[10px] text-fg/40 font-medium tabular-nums",children:[t,"/",o??a.expectedCount]})]}),e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 -mx-4 px-4 snap-x scrollbar-thin",children:e.jsx(Ws,{...a,slotClassName:a.isVertical?"w-28 sm:w-32 lg:w-36 flex-shrink-0 snap-start":"w-40 sm:w-52 lg:w-60 flex-shrink-0 snap-start"})})]}),ea={openai:"OpenAI",google:"Google Gemini",both:"Both AI providers"},ta=({summary:t,completedCount:n,timeoutCount:o})=>{const{flaggedCount:a,playbook:s,provider:i}=t,f=i?ea[i]:"The AI provider",r=a+n+o,m=s==="soft_refusal"?`Temporary AI model issue on ${a} ${a===1?"variation":"variations"}.`:`${f} flagged ${a} of ${r} ${r===1?"variation":"variations"}.`,l=s==="likeness"?"Usually recognizable people in the references. Credits refunded.":s==="soft_refusal"?"Usually clears if you generate again. Credits refunded.":"Often a false alarm. Credits refunded.";return e.jsxs("div",{className:"w-full mt-4 rounded-xl border border-ink/10 bg-ink/5 px-4 py-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsx("p",{className:"text-sm font-semibold text-fg",children:m}),e.jsx("p",{className:"text-sm text-fg/60",children:l}),e.jsxs("a",{href:"/help-center/troubleshooting/why-was-my-edit-blocked",target:"_blank",rel:"noopener noreferrer",className:"ml-auto inline-flex items-center gap-1.5 text-sm font-medium text-fg/70 hover:text-fg transition-colors whitespace-nowrap",children:["Learn why",e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"})]})]})]})},Ya=()=>{var Ke,Qe,Je;const t=Be(),n=Rt(),{studioId:o,setId:a}=At(),{user:s}=Gt(),{activeStudio:i,studios:f}=dt(),r=f.find(y=>y.id===o)??i,m=(r==null?void 0:r.ownerUid)??(s==null?void 0:s.uid),l=(r==null?void 0:r.teamId)??null,u=Yt(),{budget:g,isReady:c}=St(),h=!!l,x=u.kind==="team"&&u.teamId===l?u.myRole:r==null?void 0:r.role,p=x==="owner"||x==="admin",{accountSettings:N,editorSettings:P}=qt(),{isTouchDevice:b}=rt(),v=n.state,{thumbnailSet:d,isLoading:I,status:_}=Us(m,o,a),{results:D,completedCount:E}=_s(m,o,a),{getMember:X}=Xt(l),O=X(d==null?void 0:d.createdBy),[U,M]=w.useState(0),[S,j]=w.useState(!1),[k,R]=w.useState(!1),[G,Z]=w.useState(!1),{toastMessage:ue,toastVariant:ce,showToast:B,dismissToast:K}=Ht(),[de,C]=w.useState(null),[A,$]=w.useState(!1),{isSelectMode:L,selectedResultIds:z,areAllSelected:H,toggleSelectMode:fe,toggleResultSelection:Ce,toggleSelectAll:me,exitSelectMode:Q}=Vs(D),W=w.useRef(!1),ge=(d==null?void 0:d.setType)==="composition",he=(d==null?void 0:d.aspectRatio)??(v==null?void 0:v.aspectRatio),we=he==="9:16",xe=he==="both";w.useEffect(()=>{if(k||L)return;const y=D.find(F=>F.status==="complete");y&&y.variationIndex!==void 0&&M(y.variationIndex)},[D,k,L]);const Te=y=>{L||(R(!0),M(y))},pt=w.useCallback(()=>{z.size!==0&&Z(!0)},[z.size]),ht=w.useCallback(y=>{if(!o)return;const F=D.filter(ne=>ne.status==="complete"&&ne.id&&z.has(ne.id)).map(ne=>ne.id);if(F.length===0){Z(!1);return}const ee=new URLSearchParams({objective:y,source:"assets",assets:F.join(",")});Z(!1),Q(),t(`/studio/${o}/campaigns/new?${ee.toString()}`)},[t,D,z,o,Q]);w.useEffect(()=>{const y=F=>{if(F.key==="Escape"&&!ut()){if(L||z.size>0){Q();return}t(`/studio/${o}/thumbnails?tab=sets`)}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[L,t,z.size,o,Q]);const T=Bs({userId:m,studioId:o,teamId:l,setId:a,thumbnailSet:d,thumbnailSetState:v,results:D,selectedIndex:U,setSelectedIndex:Te});w.useEffect(()=>{!v||!s||!o||a||W.current||(W.current=!0,ns(v.prompt,v.mentions,v.variationCount,o,v.title,v.textStyle,We(v.modelId),v.promptMode,v.aspectRatio,l).then(y=>{t(`/studio/${o}/set/${y}`,{replace:!0,state:v})}).catch(y=>{console.error("[ThumbnailSetPage] Failed to start generation:",y)}))},[v,s,o,a,t,l]);const Ie=(d==null?void 0:d.title)||(v==null?void 0:v.title),wt=(d==null?void 0:d.fullPrompt)||(d==null?void 0:d.prompt)||(v==null?void 0:v.prompt)||"",bt=v?v.variationCount*(v.aspectRatio==="both"?2:1):0,se=(d==null?void 0:d.variationCount)||bt||1,be=d!=null&&d.budgetLimited?se+1:se,ae=xe?Math.ceil(se/2):se,Me=w.useCallback(y=>xe?y>=ae:we,[xe,ae,we]),je=D.find(y=>y.variationIndex===U),Re=je!=null&&je.aspectRatio?je.aspectRatio==="9:16":Me(U),qe=xe?Re:we,jt=w.useMemo(()=>{const y=new Set((d==null?void 0:d.timeoutVariationIndexes)??[]);if((d==null?void 0:d.status)==="failed")for(let F=0;F<se;F++)D.some(ee=>ee.variationIndex===F)||y.add(F);return y},[d==null?void 0:d.timeoutVariationIndexes,d==null?void 0:d.status,se,D]),[yt,Xe]=w.useState(new Set),vt=w.useCallback(y=>{if(!d||!o||!a)return;const F=We(d.modelId)??Kt("setDefault"),ee=xs(u,{isReady:c,effectiveRemaining:g.effectiveRemaining},Qt(F));if(ee){const q=ee.reason==="member_cap"?"You've hit your team spending c
6ap. Ask an owner to raise it, then retry. Failed variations were never charged.":ee.reason==="pool"&&h?p?"Add seats or buy team credits, then retry.":"Ask a team owner to top up, then retry.":"Not enough credits to retry this variation.";B(q,"error");return}Xe(q=>new Set(q).add(y)),(ge?os(a,o,d,[y],l):rs(a,o,d,[y],l)).catch(q=>{var pe;console.error("[ThumbnailSetPage] Retry failed:",q);const oe=(pe=q==null?void 0:q.details)==null?void 0:pe.reason,re=oe==="member_cap_reached"?"You've hit your team spending cap. Ask an owner to raise it, then retry. Failed variations were never charged.":oe==="pool_exhausted"&&h?p?"Add seats or buy team credits, then retry.":"Ask a team owner to top up, then retry.":q instanceof Error?q.message:"Retry failed. Please try again.";B(re,"error")}).finally(()=>{Xe(q=>{const oe=new Set(q);return oe.delete(y),oe})})},[d,o,a,u,c,g.effectiveRemaining,h,p,ge,l,B]),{isGenerating:kt,generateShareImage:Nt}=Fs({thumbnailSet:d,results:D}),V=T.selectedResult,Ct=(V==null?void 0:V.analysisStatus)==="running"&&Date.now()-(V.analysisStartedAt??0)<9e4,Tt={insights:(V==null?void 0:V.insights)??null,isScoring:de!==null&&de===(V==null?void 0:V.id)||Ct,isInsightsLoading:!1,currentVersionIndex:U,runScore:async y=>{if(!(V!=null&&V.id)||!o)return null;C(V.id);try{const F=await cs(V.id,o,y==null?void 0:y.draftTitle,l);return{score:F.score,breakdown:F.breakdown,analysis:F.analysis,suggestions:F.suggestions}}catch(F){return console.error("[ThumbnailSetPage] Failed to score result:",F),null}finally{C(null)}},applyFix:()=>{},applyAllFixes:()=>{},canApplyFixes:!1,canRunScore:!!(V!=null&&V.id),isScoreCardOpen:A,setScoreCardOpen:$},ye=(y,F)=>async(ee,ne,q,oe)=>{var pe;if(!((pe=T.selectedResult)!=null&&pe.id))throw new Error("No selected result");const re=await ds({sourceContextImageId:T.selectedResult.id,...l&&o?{studioId:o,teamId:l}:{},projectName:oe,targetFormat:y});return{[F]:re.resultId,storageUrl:re.storageUrl,base64:re.base64,mimeType:re.mimeType,priceUsd:re.priceUsd}},It=w.useCallback(()=>{o&&t(`/studio/${o}/thumbnails`)},[t,o]),Ae=!I&&!v&&!d,[Mt,He]=w.useState(!1);if(w.useEffect(()=>{if(!Ae){He(!1);return}const y=window.setTimeout(()=>He(!0),1500);return()=>window.clearTimeout(y)},[Ae]),b)return e.jsxs("div",{className:"fixed inset-0 bg-rh-dark flex flex-col items-center justify-center gap-4 p-8 text-center",children:[e.jsx("span",{className:"p-4 rounded-2xl bg-ink/[0.05] text-rh-accent",children:e.jsx(Fe,{className:"w-8 h-8"})}),e.jsx("h1",{className:"text-fg font-semibold",children:"Thumbnail Sets on Desktop"}),e.jsx(Wt,{open:!0,onOpenChange:y=>{y||It()},title:"Thumbnail Sets on Desktop",description:"Generating and comparing a full set works best with a bigger screen. Open Thumio on your computer to use Thumbnail Sets.",ctaLabel:"Back to Thumbnails"})]});if(I&&!v||Ae&&!Mt)return e.jsx("div",{className:"min-h-screen bg-rh-bg flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(le,{size:32,className:"animate-spin text-rh-green mx-auto mb-4"}),e.jsx("p",{className:"text-rh-text-dark",children:"Loading generation..."})]})});if(!v&&!d)return e.jsx("div",{className:"min-h-screen bg-rh-bg flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-rh-text-dark mb-4",children:"No thumbnail set in progress"}),e.jsx("button",{onClick:T.handleBack,className:"text-rh-green hover:underline",children:"Go back to studio"})]})});const Pe={results:D,expectedCount:be,isVertical:we,selectedIndex:U,onSelectIndex:Te,thumbnailSet:d,isTeamBilled:h,teamName:(r==null?void 0:r.teamName)??u.teamName,canFundTeam:p,isCreatingProject:T.isCreatingProject,isSelectionMode:L,selectedResultIds:z,onToggleResultSelection:Ce,failedIndexes:jt,retryingIndexes:yt,onRetrySlot:vt,onQuickDownload:y=>{y.variationIndex!==void 0&&Te(y.variationIndex),T.handleOpenDownloadModal(y)},onQuickEdit:y=>void T.handleCreateProject(y)};return e.jsx(gs,{title:"Thumbnail Set - Thumio Studio",children:e.jsx(is,{value:Tt,children:e.jsxs("div",{className:"min-h-screen bg-rh-bg flex flex-col",children:[e.jsx(Gs,{title:Ie||"",isEditingTitle:T.isEditingTitle,editedTitle:T.editedTitle,titleInputRef:T.titleInputRef,completedCount:E,expectedCount:be,generationStatus:_,onEditTitle:T.handleStartEditTitle,onSaveTitle:T.handleSaveTitle,onTitleChange:T.setEditedTitle,onTitleKeyDown:T.handleTitleKeyDown,onBack:T.handleBack,onViewInLibrary:T.handleViewInLibrary,onShare:Nt,isGeneratingShare:kt,isSelectMode:L,onToggleSelectMode:fe,canSelectResults:E>0,onToggleSelectAll:me,areAllSelected:H}),e.jsxs("main",{className:"relative flex-1 w-full max-w-6xl 2xl:max-w-7xl mx-auto px-4 sm:px-6 pt-4 sm:pt-8 pb-12",children:[e.jsxs("div",{className:"w-full max-w-5xl mx-auto flex flex-col lg:flex-row lg:items-stretch gap-4 lg:gap-6",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Ys,{results:D,isVertical:qe,selectedIndex:U,completedCount:E,expectedCount:be,isCreatingProject:T.isCreatingProject,isDownloading:T.isDownloading||T.isLoadingDownloadImage,hasFailed:_==="error",onPrevious:T.handlePrevious,onNext:T.handleNext,onCreateProject:T.handleCreateProject,onDownload:()=>T.handleOpenDownloadModal()})}),e.jsxs("aside",{className:"lg:w-72 xl:w-80 flex-shrink-0 flex flex-col gap-3",children:[e.jsx(Xs,{thumbnailSet:d,isLoading:!d,userId:m}),O&&e.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-ink/[0.06] bg-rh-surface/60 px-3.5 py-2.5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-fg/40",children:"Created by"}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(Jt,{member:O,size:18,showTooltip:!1}),e.jsx("span",{className:"max-w-[160px] truncate text-xs font-medium text-fg",title:O.label,children:O.isYou?"You":O.label}),O.isFormer&&e.jsx("span",{className:"shrink-0 rounded-full bg-ink/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-fg/50",children:"Removed"})]})]}),!(d!=null&&d.compositionId)&&!L&&e.jsx(Ks,{prompt:wt,isExpanded:S,onToggleExpand:()=>j(!S),isLoading:!d}),!L&&e.jsx("div",{className:qe?void 0:"lg:mt-auto",children:e.jsx(Hs,{isComposition:ge,onClick:T.handleGenerateMore,disabled:T.isCreatingProject})})]})]}),(d==null?void 0:d.safetySummary)&&d.safetySummary.flaggedCount>0&&e.jsx(ta,{summary:d.safetySummary,completedCount:d.completedCount??E,timeoutCount:d.timeoutVariationCount??((Ke=d.timeoutVariationIndexes)==null?void 0:Ke.length)??0}),xe?e.jsxs("div",{className:"w-full mt-6 space-y-5",children:[e.jsx(Ee,{...Pe,isVertical:!1,label:"Thumbn
6ails",slotIndexes:Array.from({length:ae},(y,F)=>F),completedCount:D.filter(y=>y.status==="complete"&&!Me(y.variationIndex??0)).length,displayTotal:ae}),e.jsx(Ee,{...Pe,isVertical:!0,label:"Shorts covers",slotIndexes:Array.from({length:be-ae},(y,F)=>ae+F),completedCount:D.filter(y=>y.status==="complete"&&Me(y.variationIndex??0)).length,displayTotal:se-ae})]}):e.jsx("div",{className:"w-full mt-6",children:e.jsx(Ee,{completedCount:E,...Pe})}),_==="complete"&&!L&&e.jsx("p",{className:"hidden sm:block mt-6 text-sm text-rh-text-dark text-center",children:"Click any thumbnail to edit it. All results saved to your Asset Library."}),L&&e.jsx(fs,{count:z.size,onAction:pt,actionLabel:"Continue",actionIcon:e.jsx(ft,{className:"h-4 w-4"})})]}),T.downloadImageBase64&&e.jsx(ls,{isOpen:T.isDownloadModalOpen,onClose:T.handleCloseDownloadModal,onDownload:T.handleDownload,imageSrc:T.downloadImageBase64,imageMimeType:T.downloadImageMimeType,defaultFormat:P.downloadFormat,defaultJpegQuality:P.jpegQuality,downloadQueue:[{imageData:{base64:T.downloadImageBase64.split(",")[1]??T.downloadImageBase64,mimeType:T.downloadImageMimeType,storageUrl:(Qe=T.selectedResult)==null?void 0:Qe.storageUrl},projectName:Ie||"Thumbnail",aspectRatio:Re?"9:16":void 0}],studioType:"youtube",leetOutfit:N.leetOutfit,projectId:(Je=T.selectedResult)==null?void 0:Je.id,studioId:o,versionIndex:U,projectName:Ie||"Thumbnail",onGenerateShorts:Re?void 0:ye("vertical","shortsId"),onGenerateSquare:ye("square","squareId"),onGeneratePortrait:ye("portrait","portraitId"),onGeneratePinterest:ye("pinterest","pinterestId")}),G&&e.jsx(us,{onSelect:ht,onClose:()=>Z(!1)}),e.jsx(Zt,{message:ue,variant:ce,onDismiss:K}),A&&e.jsx("div",{className:"fixed bottom-4 right-4 z-50 w-full max-w-sm",children:e.jsx(ms,{})})]})})})};export{Ya as ThumbnailSetPage,Ya as default};
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.