PageSourceSearch

https://snew.ai/assets/VibeCollectionPage-YT8Rz4vR.js

js snew.ai collected 2026-10-05 15:08:31 UTC 16,358 bytes, 1 lines download raw bytes

1import{u as je,av as Se,R as n,j as t}from"./index-L9AYrVUw.js";import"./productFunnel-DiJFcMU2.js";import"./FloatingTopMenu-CIhwk2RR.js";import{bi as Ce,dM as Ie,l as $e,c as Re,eZ as ke,e9 as Pe,ba as oe,ev as we,b2 as ce,R as I,C as u,bl as Te,u as B,bM as Oe}from"./PlanAccessModal-P_W2GThH.js";import{n as Ae}from"./Package.es-CyLjTX4J.js";import{a as Me}from"./PencilSimple.es-DDA0fpvv.js";import{C as ze,a as Ee,b as re,T as Ue,c as de,d as Le,e as Ne,f as De,A as Be,g as Fe,h as ae,i as _e,s as Ge,j as He}from"./itemCovers-DIwg2Xx-.js";import{Q as Ve}from"./QuickCoverModal-ByhENJnt.js";import{a as qe}from"./ProductPickerModal-DZV-fDl_.js";import{a as We,b as se}from"./CastPickerPopover-DyZqYUSW.js";import{T as F}from"./TemplateSettingRow-CyiRtPF0.js";import{P as Ke}from"./pill-dropdown-menu-CmrSXir-.js";import{a as ie,A as Ye}from"./aspectRatios-DDqw6bsx.js";import{c as ne}from"./eligibility-B5UjMwH6.js";import{t as le}from"./catalog-CkHlpXUG.js";import{o as Qe}from"./overImage-BfLII5AZ.js";import{p as Je,r as Ze}from"./runTemplateShot-DXBX0_Iy.js";import{s as Xe}from"./saveImages-BpUrLvEr.js";import{v as _}from"./entries-DM0IuApj.js";import"./locale-Cctu0V3Y.js";import"./SnewLogo-Cg53XTnQ.js";import"./Plus.es-BeVefyFz.js";import"./SquaresFour.es-BpA8mwXA.js";import"./privateMedia-B7Po080i.js";import"./useRecentBoards-Drv6qcH_.js";import"./history-CQXQpNXw.js";import"./generationAdapter-BXonAKVC.js";import"./jobRuntime-D9imWnJq.js";import"./snewDefault-bcI9V4vY.js";import"./visualDirection-6RyRmTlC.js";import"./worksMode-DPF33FWh.js";import"./durableRepository-CrJ1KOcD.js";import"./durableDocument-CwDQPJIK.js";import"./boardSaveRetry-DOnjTgch.js";import"./KnowledgeBasePage-DJT9Fkps.js";import"./ArrowsClockwise.es-CX8V1pij.js";import"./ChatCircle.es-ys8V5LKI.js";import"./FloppyDisk.es-DCGe340Q.js";import"./Globe.es-5iBT42E4.js";import"./Image.es-BLTC_PgL.js";import"./MagicWand.es-CAihBnXI.js";import"./Palette.es-Dd5ZEM4v.js";import"./Target.es-Ds7XP-fd.js";import"./WarningCircle.es-CHfqKWRY.js";import"./hydrateStoreContext-CnRDd9GD.js";import"./generation-shimmer-CRk6nK9x.js";import"./UploadSimple.es-BDJIa312.js";import"./ArrowClockwise.es-CEsBpyry.js";import"./resolveCasting-1-rDPxyF.js";import"./productHeight-D88Bzh8q.js";import"./qaSignal-BzonQWWb.js";import"./shadow-1gm38VU4.js";import"./scoring-Oj4SgCwH.js";import"./extrairProdutoPrincipal-DiA7rESH.js";import"./generationHistory-D4RTxXIf.js";import"./historyKey-GcKgTVWl.js";import"./sceneCovers-B-dE7_Ce.js";import"./overrides-DxGb-X-q.js";import"./types-YVLQw7aQ.js";import"./useFileDrop-Bndg9qCI.js";import"./firstAsset-DWUwvZpm.js";import"./modal-close-button-BhLoO4jQ.js";import"./tabs-CmDZA0dx.js";import"./index-BKpKuXmL.js";import"./index-Eo00qZvG.js";import"./SearchInput-h5gAN-Be.js";import"./ImageSquare.es-Ckk4CjAE.js";import"./castingThumbnail-BTwl0DD5.js";import"./brandDnaToCampaignDna-Dm6109r0.js";import"./store-CVXWfzEM.js";function et(p,m){let d=2166136261;for(let h=0;h<m.length;h+=1)d^=m.charCodeAt(h),d=Math.imul(d,16777619)>>>0;return`${p}-asset-${d.toString(36)}`}function tt(p){return{width:280,height:Math.round(280*({"1:1":1,"4:5":1.25,"3:4":1.3333333333333333,"9:16":1.7777777777777777,"16:9":.5625}[p]??4/3))}}const G=[["Herói","A imagem que apresenta o universo da campanha."],["Interação","O produto em uma ação física e observável."],["História","Um momento que amplia a narrativa da marca."],["Retrato","Pessoa, expressão e produto em uma relação clara."],["Detalhe","Material, construção e acabamento em primeiro plano."],["Produto no lugar","O produto integrado ao mundo da campanha."]];function ot(p){return p?p.charAt(0).toUpperCase()+p.slice(1).replace(/\.$/,"")+".":"Direção definida quando o produto for escolhido."}function rt(p,m){var h,r,k;const d=p==null?void 0:p.shots[m];return d!=null&&d.blueprint?{title:d.label.split(" · ")[0]||((k=G[m])==null?void 0:k[0])||`Shot ${m+1}`,body:ot(d.blueprint.primaryAction),meta:d.blueprint.location||d.blueprint.camera}:{title:((h=G[m])==null?void 0:h[0])??`Shot ${m+1}`,body:((r=G[m])==null?void 0:r[1])??"Plano complementar da sequência.",meta:"Aguardando produto"}}function at(p,m){const d=new FileReader;d.onload=()=>{typeof d.result=="string"&&m({id:`upload-${Date.now()}`,name:p.name.replace(/\.[^.]+$/,"")||"Produto enviado",image:d.result})},d.readAsDataURL(p)}function Po(){var te;const p=je(),{vibeId:m=""}=Se(),[d,h]=n.useState(0),[r,k]=n.useState(null),[pe,z]=n.useState(!1),[V,E]=n.useState(!1),[q,P]=n.useState(!1),[W,w]=n.useState(!1),[S,K]=n.useState(null),[$,me]=n.useState(()=>{var o;const e=(o=Ce())==null?void 0:o.id;return e?[e]:[]}),[v,ue]=n.useState("3:4"),[U,Y]=n.useState([]),[Q,T]=n.useState({}),[ge,L]=n.useState({}),[R,N]=n.useState(!1),[x,O]=n.useState(null),J=n.useRef(null),C=n.useRef(null),A=n.useRef(!1),he=Ie(),[fe,dt]=n.useState(()=>null);n.useEffect(()=>{},[fe]),n.useEffect(()=>{let e=!0;$e().finally(()=>{e&&h(s=>s+1)});const o=Re(()=>h(s=>s+1));return()=>{e=!1,o()}},[]);const a=n.useMemo(()=>ke(`vibe-${m.toLowerCase()}`),[m,d]),be=n.useMemo(()=>Pe(m),[m]),c=n.useMemo(()=>
1{if(!r||!a||!oe(a))return null;const e=ne({productName:r.name});return we({vibeId:a.execution.vibeId,category:e.category,productName:r.name,productDescription:e.subcategory,includeStill:!0,setSize:a.execution.setSize})},[a,r]);if(!a||!be||!oe(a))return t.jsx("div",{style:{minHeight:"100vh",background:"#fff",display:"grid",placeItems:"center"},children:t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("p",{children:"Esta Vibe Collection não está disponível."}),t.jsx("button",{type:"button",onClick:()=>p("/library"),children:"Voltar à biblioteca"})]})});const f=Array.from({length:a.execution.setSize},(e,o)=>rt(c,o)),M=a.moodboardUrls??a.thumbs,b=U.flatMap((e,o)=>e?[{shot:e,index:o}]:[]),ye=b.length>0||R||Object.values(Q).some(e=>e==="error"),Z=()=>{C.current=null,A.current=!1,N(!1),Y([]),T({}),L({})},D=e=>{Z(),k(e)},ve=async(e,o,s)=>{if(!r||!(c!=null&&c.ok))return;const l=c.shots[e];if(l!=null&&l.prompt){T(i=>({...i,[e]:"generating"})),L(i=>{const g={...i};return delete g[e],g});try{const i=ne({productName:r.name}),g=await Ze({slug:a.slug,batchId:o,cardId:`${a.slug}-shot-${e+1}`,styleId:a.execution.styleId,productImageUrl:r.image,productName:r.name,productDescription:i.subcategory,casting:se,castMemberId:s,promptOverride:l.prompt,negativePromptOverride:l.negativeRules.join(", "),requiresCasting:l.role!=="still"&&l.role!=="detail",format:v,rotationSeed:e+1});if(C.current!==o)return;Y(y=>{const j=[...y];return j[e]=g,j}),T(y=>({...y,[e]:"idle"}))}catch(i){if(C.current!==o)return;const g=await Oe(i);if(C.current!==o)return;L(y=>({...y,[e]:g.message})),T(y=>({...y,[e]:"error"}))}}},X=async e=>{if(!r||!(c!=null&&c.ok)||A.current)return;const o=e===void 0?c.shots.map((i,g)=>g).filter(i=>!U[i]):[e];if(!o.length)return;const s=`vibe_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,l=Je(a.execution.styleId,$,a.styleCastMembers??{});C.current=s,A.current=!0,N(!0);try{await Promise.allSettled(o.map(i=>ve(i,s,l)))}finally{C.current===s&&(A.current=!1,N(!1))}},xe=()=>{const e=Xe(b.map(({shot:o,index:s})=>{var l;return{imageUrl:o.imageUrl,mediaLocator:o.mediaLocator,jobId:o.jobId,heading:((l=f[s])==null?void 0:l.title)??a.title,sceneId:a.execution.styleId}}));B.success(e===1?"1 imagem salva":`${e} imagens salvas`)},ee=e=>{const{width:o,height:s}=tt(v),l=He(e).map((i,g)=>({id:et(e.id,i.mediaLocator??i.url),imageUrl:i.url,mediaLocator:i.mediaLocator??void 0,generationJobId:i.jobId??void 0,x:g%3*(o+24),y:Math.floor(g/3)*(s+24),width:o,height:s,label:i.label??e.title,type:"image",aspectRatio:i.aspectRatio??v,styleId:i.styleId}));p("/board",{state:{boardId:e.id,boardTitle:e.title,initialBoardAssets:l,collectionSlug:a.slug,vibeId:a.execution.vibeId,_ts:Date.now()}})};return t.jsxs(ze,{backLabel:"Voltar à biblioteca",onBack:()=>p("/library"),breadcrumb:t.jsxs(t.Fragment,{children:["Vibes ",t.jsx("span",{style:{color:`hsl(${u.border.secondary})`},children:"/"})," ",t.jsx("span",{style:{color:`hsl(${u.text.primary})`,fontWeight:500},children:a.title})]}),children:[t.jsxs(Ee,{children:[t.jsxs("aside",{style:{gridColumn:1,gridRow:1,height:`calc(100vh - ${re}px - 24px)`,minHeight:620,padding:20,border:"1px solid hsl(var(--border))",borderRadius:I.xl,background:"#fff",boxShadow:ce.sm,position:"sticky",top:re,display:"flex",flexDirection:"column",gap:8,overflow:"visible"},children:[t.jsx(Ue,{imageUrl:(r==null?void 0:r.image)??a.sampleProductUrl??a.coverUrl,name:(r==null?void 0:r.name)??a.sampleProductName,selected:!!r,onPick:()=>z(!0),onUpload:()=>{var e;return(e=J.current)==null?void 0:e.click()},onRemove:r?()=>D(null):void 0}),t.jsx("input",{ref:J,type:"file",accept:"image/*",hidden:!0,onChange:e=>{var s;const o=(s=e.target.files)==null?void 0:s[0];o&&at(o,D),e.target.value=""}}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(F,{label:"Presets",value:`${f.length} no board`,active:V,onClick:()=>{P(!1),w(!1),E(e=>!e)}}),V&&t.jsxs("div",{style:lt,children:[t.jsx("div",{style:{padding:"8px 10px 10px",fontSize:11,color:`hsl(${u.text.tertiary})`},children:"Sequência da Vibe"}),f.map((e,o)=>t.jsxs("div",{style:ct,children:[t.jsx("span",{style:{color:`hsl(${u.text.tertiary})`,fontSize:10},children:String(o+1).padStart(2,"0")}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]},`${e.title}-${o}
1`))]})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(F,{label:"Cast",value:$.length?`${$.length} selecionado${$.length>1?"s":""}`:"Auto",active:q,onClick:()=>{E(!1),w(!1),P(e=>!e)}}),q&&t.jsx(We,{roleId:se,memberIds:$,onClose:()=>P(!1),onApply:({memberIds:e})=>{me(e),Te(e.length===1?e[0]:null)}})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(F,{label:"Formato",value:v,icon:t.jsx(ie,{ratioId:v,size:13}),active:W,onClick:()=>{E(!1),P(!1),w(e=>!e)}}),W&&t.jsx(Ke,{value:v,minWidth:240,aspectRatio:!0,options:Ye.map(e=>({id:e.id,label:e.label,leftIcon:t.jsx(ie,{ratioId:e.id,size:14})})),onPick:e=>{ue(e),w(!1)},style:{top:0,left:"calc(100% + 8px)",maxHeight:320,overflowY:"auto"}})]}),t.jsx("div",{style:{flex:1}}),t.jsx("button",{type:"button",disabled:!r||!(c!=null&&c.ok)||R||b.length===f.length,onClick:()=>void X(),style:{...st,width:"100%",opacity:!r||!(c!=null&&c.ok)||R||b.length===f.length?.38:1,cursor:!r||!(c!=null&&c.ok)||R||b.length===f.length?"not-allowed":"pointer"},children:R?"Gerando imagens…":b.length>0?b.length===f.length?"Imagens geradas":"Gerar pendentes":"Gerar imagens"})]}),t.jsxs("section",{style:{gridColumn:2,gridRow:1,minWidth:0},children:[ye?t.jsxs("div",{style:it,children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[t.jsx("span",{style:{fontSize:14,fontWeight:560,color:`hsl(${u.text.primary})`},children:"Imagens criadas"}),t.jsxs("span",{style:{fontSize:12,color:`hsl(${u.text.tertiary})`},children:[b.length," de ",f.length]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[b.length>0?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>O(b.map(({shot:e,index:o})=>{var s;return{url:e.imageUrl,mediaLocator:e.mediaLocator,jobId:e.jobId,label:((s=f[o])==null?void 0:s.title)??a.title,styleId:a.execution.styleId,aspectRatio:v}})),style:H,children:"Adicionar ao board"}),t.jsx("button",{type:"button",onClick:xe,style:H,children:"Salvar"}),t.jsx("span",{"aria-hidden":!0,style:nt})]}):null,t.jsx("button",{type:"button",onClick:Z,style:{...H,color:`hsl(${u.text.tertiary})`},children:"Resetar"})]})]}):null,t.jsx("section",{style:{display:"grid",gridTemplateColumns:`repeat(${Le}, minmax(0, 1fr))`,gap:de},children:f.map((e,o)=>{var g,y;const s=_(o),l=((g=U[o])==null?void 0:g.imageUrl)??((y=a.sceneThumbs)==null?void 0:y[s])??M[o%Math.max(1,M.length)],i=Q[o]??"idle";return t.jsxs("article",{className:"group","aria-label":`${String(o+1).padStart(2,"0")} · ${e.title}`,style:{position:"relative",aspectRatio:"3 / 4",minWidth:0,borderRadius:I.boardCard,overflow:"hidden",background:l?"#efefec":`hsl(${u.bg.secondary})`},children:[l?t.jsx("img",{src:l,alt:"",onError:j=>{j.currentTarget.style.display="none"},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}):r?t.jsx("img",{src:r.image,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",filter:"saturate(.72)",opacity:.28}}):t.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",color:`hsl(${u.text.tertiary})`},children:t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx(Ae,{size:23}),t.jsx("div",{style:{marginTop:8,fontSize:11},children:"escolha um produto"})]})}),t.jsx("div",{"aria-hidden":!0,className:"opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0.08) 44%, transparent)",pointerEvents:"none"}}),t.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{position:"absolute",left:12,right:12,bottom:12,color:"#fff",pointerEvents:"none"},children:[t.jsxs("div",{style:{fontSize:12,fontWeight:560,lineHeight:1.3},children:[String(o+1).padStart(2,"0")," · ",e.title]}),t.jsx("div",{style:{marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:10,color:"rgba(255,255,255,.74)"},children:e.meta})]}),he&&le(a.execution.styleId)?t.jsx("button",{type:"button","aria-label":`Editar capa de ${e.title}`,title:"Editar capa",onClick:j=>{j.preventDefault(),j.stopPropagation(),K(o)},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity duration-200",style:{...Qe(28),position:"absolute",top:8,right:8,zIndex:3},children:t.jsx(Me,{size:13})}):null,i==="generating"?t.jsx(Ne,{}):null,i==="error"?t.jsx(De,{message:ge[o],onRetry:()=>void X(o)}):null]},`${(r==null?void 0:r.id)??"empty"}-${o}`)})}),r&&c&&!c.ok?t.jsxs("div",{style:{marginTop:24,padding:16,borderRadius:I.lg,background:"#fff3f1",color:"#9b332b",fontSize:13}
1,children:["Esta Vibe não fechou uma sequência segura para este produto: ",c.reason]}):null]})]}),t.jsx(qe,{open:pe,onClose:()=>z(!1),onPick:e=>{D(e),z(!1)}}),t.jsx(Be,{media:x??[],open:x!==null,count:(x==null?void 0:x.length)??0,defaultName:`${a.title} · ${(r==null?void 0:r.name)??"campanha"}`,onClose:()=>O(null),onCreateNew:e=>{const s=_e(e,x??[]);O(null),B.success(`board "${s.title}" criado`),ee(s)},onPickBoard:e=>{const s=Fe(e,x??[]);O(null);const l=ae(s)-ae(e);B.success(l>0?`${l===1?"1 imagem adicionada":`${l} imagens adicionadas`} em ${s.title}`:`essas imagens já estavam em ${s.title}`),ee(s)}}),t.jsx(Ve,{entry:S===null?null:le(a.execution.styleId),segment:null,initialProductUrl:(r==null?void 0:r.image)??a.sampleProductUrl??null,initialProductName:(r==null?void 0:r.name)??a.sampleProductName??null,initialCoverUrl:S===null?null:((te=a.sceneThumbs)==null?void 0:te[_(S)])??M[S%Math.max(1,M.length)]??null,saveLabel:"Usar como capa deste shot",onClose:()=>K(null),onSaved:()=>h(e=>e+1),onSave:async e=>{S!==null&&await Ge(a,_(S),e)}})]})}const st={minHeight:48,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,padding:"0 18px",borderRadius:999,border:0,background:`hsl(${u.text.primary})`,color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:"pointer"},it={minHeight:62,marginBottom:de,padding:"12px 14px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,borderRadius:I.lg,background:`hsl(${u.bg.primary})`,border:"1px solid hsl(var(--border))"},H={height:38,padding:"0 16px",borderRadius:999,border:"1px solid hsl(var(--border))",background:`hsl(${u.bg.primary})`,color:`hsl(${u.text.primary})`,fontFamily:"inherit",fontSize:13,fontWeight:500,cursor:"pointer"},nt={width:1,alignSelf:"stretch",margin:"2px 2px",background:`hsl(${u.border.secondary})`},lt={position:"absolute",zIndex:70,top:0,left:"calc(100% + 8px)",width:260,padding:6,border:"1px solid hsl(var(--border))",borderRadius:I.lg,background:"#fff",boxShadow:ce.floatRaised},ct={minHeight:38,display:"grid",gridTemplateColumns:"24px minmax(0, 1fr)",alignItems:"center",gap:6,padding:"0 10px",borderRadius:I.md,fontSize:12,color:`hsl(${u.text.primary})`,background:`hsl(${u.bg.tertiary})`,marginTop:2};export{Po 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.