1import{r as l,j as e}from"./index-L9AYrVUw.js";import{m as S}from"./ArrowsClockwise.es-CX8V1pij.js";import{s as E}from"./CheckCircle.es-PkF6a2W-.js";import{v as P}from"./FloatingTopMenu-CIhwk2RR.js";import{a5 as D,n as I,aE as R}from"./PlanAccessModal-P_W2GThH.js";import{I as z}from"./Image.es-BLTC_PgL.js";import{m as U}from"./App-DyVHSnY3.js";import{n as w}from"./Plus.es-BeVefyFz.js";import{n as B}from"./Trash.es-D2Zs5Rpt.js";import{s as F}from"./productFunnel-DiJFcMU2.js";import"./locale-Cctu0V3Y.js";import"./SnewLogo-Cg53XTnQ.js";import"./index-p7aFGi8o.js";import"./dissolve-CQo8GAUH.js";const k=[{id:"editorial-photo",name:"Editorial Photo",category:"photo",promptBase:"editorial fashion photography, high-end magazine style, soft studio lighting, clean background",negativePrompt:"cartoon, blurry, low quality, text, watermark",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"lifestyle",name:"Lifestyle",category:"photo",promptBase:"lifestyle product photography, natural light, warm tones, casual setting, authentic feel",negativePrompt:"studio, artificial, cartoon, blurry",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"flat-illustration",name:"Flat Illustration",category:"illustration",promptBase:"flat vector illustration style, bold colors, clean shapes, modern design",negativePrompt:"photorealistic, 3d, blurry, noisy",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"watercolor",name:"Watercolor",category:"illustration",promptBase:"watercolor illustration, soft washes, artistic brushstrokes, delicate details",negativePrompt:"photorealistic, sharp edges, digital",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"product-3d",name:"3D Product",category:"3d",promptBase:"3D product render, clean studio lighting, smooth materials, floating product, soft shadows",negativePrompt:"flat, 2d, cartoon, low poly",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"gradient-design",name:"Gradient Design",category:"design",promptBase:"modern gradient design, bold typography, geometric shapes, vibrant color palette",negativePrompt:"photorealistic, blurry, noisy",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date},{id:"minimal-design",name:"Minimal Clean",category:"design",promptBase:"minimalist design, lots of whitespace, clean typography, subtle colors, premium feel",negativePrompt:"cluttered, busy, noisy, low quality",thumbnailUrl:"",isActive:!1,isCustom:!1,createdAt:new Date}],W=[{id:"all",label:"Todos"},{id:"photo",label:"Photo"},{id:"illustration",label:"Illustration"},{id:"3d",label:"3D"},{id:"design",label:"Design"}];function N({onClose:s,onSave:c,editingStyle:o}){const[d,p]=l.useState((o==null?void 0:o.name)??""),[m,n]=l.useState((o==null?void 0:o.category)??"photo"),[i,g]=l.useState((o==null?void 0:o.promptBase)??""),[u,h]=l.useState((o==null?void 0:o.negativePrompt)??""),[f,y]=l.useState(!1),[x,v]=l.useState((o==null?void 0:o.thumbnailUrl)??""),j=async()=>{if(i){y(!0);try{const t=`product thumbnail, e-commerce app card cover, ${i}`,{data:r}=await F.functions.invoke("generate-video",{body:{prompt:t}});r!=null&&r.imageUrl&&v(r.imageUrl)}catch(t){console.error("Preview generation failed:",t)}finally{y(!1)}}};return e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:60},children:e.jsxs("div",{style:{width:640,background:"#FFF",borderRadius:16,overflow:"hidden",maxHeight:"90vh"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid #F0F0F0"},children:[e.jsx("h3",{style:{fontSize:16,fontWeight:700,margin:0},children:o?"Editar preset":"Novo preset"}),e.jsx("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",color:"#999"},children:e.jsx(I,{size:15})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",overflowY:"auto"},children:[e.jsx("div",{style:{background:"#F7F7F7",display:"flex",alignItems:"center",justifyContent:"center",minHeight:200},children:x?e.jsx("img",{src:x,alt:"preview",style:{width:"100%",height:"100%",objectFit:"cover"}}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,color:"#CCC",fontSize:12},children:[e.jsx(z,{size:32}),e.jsx("span",{children:"Gere um preview"})]})}),e.jsxs("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:"#AAA"},children:"Nome"}),e.jsx("input",{value:d,onChange:t=>p(t.target.value),placeholder:"Ex: Editorial Photo",style:{padding:"8px 12px",border:"1.5px solid #E2E2E2",borderRadius:8,fontSize:13,color:"#1A1A1A"}})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:"#AAA"},children:"Categoria"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:["photo","illustration","3d","design"].map(t=>e.jsx("button",{onClick:()=>n(t),style:{padding:"4px 10px",borderRadius:999,border:`1.5px solid ${m===t?"#1A1A1A":"#E2E2E2"}`,background:m===t?"#1A1A1A":"#FFF",color:m===t?"#FFF":"#555",fontSize:11,cursor:"pointer",transition:"all 0.12s"},children:t},t))})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:"#AAA"},children:"Prompt base"}),e.jsx("textarea",{value:i,onChange:t=>g(t.target.value),placeholder:"Ex: clean lifestyle photography, soft studio lighting, minimal background",rows:3,style:{padding:"8px 12px",border:"1.5px solid #E2E2E2",borderRadius:8,fontSize:13,color:"#1A1A1A",resize:"none"}}),e.jsx("span",{style:{fontSize:11,color:"#AAA"},children:"Sufixado automaticamente em toda geração com este preset."})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:"#AAA"},children:"Negative prompt"}),e.jsx("textarea",{value:u,onChange:t=>h(t.target.value),placeholder:"Ex: cartoon, blurry, low quality, text, watermark",rows:2,style:{padding:"8px 12px",border:"1.5px solid #E2E2E2",borderRadius:8,fontSize:13,color:"#1A1A1A",resize:"none"}})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[e.jsx("button",{onClick:j,disabled:!i||f,style:{flex:1,height:36,borderRadius:8,border:"1.5px solid #1A1A1A",background:"#FFF",fontSize:12,fontWeight:500,cursor:i&&!f?"pointer":"not-allowed",opacity:!i||f?.35:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:f?e.jsxs(e.Fragment,{children:[e.jsx(R,{size:13,className:"animate-spin"})," Gerando..."]}):"Gerar preview"}),e.jsx("button",{className:"snew-main-action",onClick:()=>c({name:d,category:m,promptBase:i,negativePrompt:u,thumbnailUrl:x}),disabled:!d||!i,style:{flex:1,height:36,borderRadius:8,border:"none",fontSize:12,fontWeight:600,cursor:d&&i?"pointer":"not-allowed",opacity:!d||!i?.35:1},children:"Salvar estilo"})]})]})]})]})})}function T({style:s,isActive:c,onActivate:o,onEdit:d,onDelete:p,onRegenerate:m}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,cursor:"pointer"},children:[e.jsxs("div",{style:{position:"relative",aspectRatio:"1/1",borderRadius:10,overflow:"hidden",background:"#F2F2F2",outline:c?"2px solid #1A1A1A":"none",outlineOffset:2},children:[s.thumbnailUrl?e.jsx("img",{src:s.thumbnailUrl,alt:s.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#CCC"},children:e.jsx(z,{size:20})}),c&&e.jsx("div",{style:{position:"absolute",top:6,left:6,background:"#1A1A1A",color:"#FFF",fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:4},children:"Ativo"}),e.jsxs("div",{className:"sm-card-overlay",style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",gap:6,opacity:0,transition:"opacity 0.15s"},children:[e.jsx("button",{onClick:n=>{n.stopPropagation(),o()},title:"Definir como ativo",style:b,children:c?e.jsx(E,{size:14}):e.jsx(P,{size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),d()},title:"Editar",style:b,children:e.jsx(U,{size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),m()},title:"Regenerar thumbnail",style:b,children:e.jsx(S,{size:14})}),s.isCustom&&e.jsx("button",{onClick:n=>{n.stopPropagation(),p()},title:"Deletar",style:{...b,color:"#DC2626"},children:e.jsx(B,{size:14})})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsxs("p",{style:{fontSize:11,fontWeight:500,color:"#1A1A1A",margin:0},children:["#",s.name.toLowerCase().replace(/\s+/g,"")]}),s.isCustom&&e.jsx("span",{style:{fontSize:9,fontWeight:600,color:"#555",background:"#F0F0F0",borderRadius:3,padding:"1px 4px"},children:"Custom"})]})]})}const b={width:28,height:28,borderRadius:"50%",background:"rgba(255,255,255,0.9)",border:"none",cursor:"pointer",color:"#1A1A1A",dis
1play:"flex",alignItems:"center",justifyContent:"center"};function Z(){const[s,c]=l.useState([]),[o,d]=l.useState(null),[p,m]=l.useState("all"),[n,i]=l.useState(!1),[g,u]=l.useState(null);l.useEffect(()=>{try{const t=localStorage.getItem("app:styles"),r=localStorage.getItem("app:active-style");t?c(JSON.parse(t)):(c(k),localStorage.setItem("app:styles",JSON.stringify(k))),r&&d(JSON.parse(r))}catch{}},[]);const h=l.useCallback((t,r)=>{c(t),d(r),localStorage.setItem("app:styles",JSON.stringify(t)),r?localStorage.setItem("app:active-style",JSON.stringify(r)):localStorage.removeItem("app:active-style")},[]),f=t=>{const a=(o==null?void 0:o.id)===t.id?null:t;h(s,a)},y=t=>{if(g){const r=s.map(a=>a.id===g.id?{...a,...t}:a);h(r,(o==null?void 0:o.id)===g.id?{...g,...t}:o)}else{const r={id:`custom-${Date.now()}`,name:t.name||"Untitled",category:t.category||"photo",promptBase:t.promptBase||"",negativePrompt:t.negativePrompt||"",thumbnailUrl:t.thumbnailUrl||"",isActive:!1,isCustom:!0,createdAt:new Date};h([...s,r],o)}i(!1),u(null)},x=t=>{const r=s.filter(A=>A.id!==t),a=(o==null?void 0:o.id)===t?null:o;h(r,a)},v=async t=>{try{const r=`product thumbnail, e-commerce card cover, ${t.promptBase}`,{data:a}=await F.functions.invoke("generate-video",{body:{prompt:r}});if(a!=null&&a.imageUrl){const A=s.map(C=>C.id===t.id?{...C,thumbnailUrl:a.imageUrl}:C);h(A,(o==null?void 0:o.id)===t.id?{...t,thumbnailUrl:a.imageUrl}:o)}}catch(r){console.error("Regenerate thumbnail error:",r)}},j=p==="all"?s:s.filter(t=>t.category===p);return e.jsxs("div",{style:{padding:"32px 40px",maxWidth:1100},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:24,fontWeight:700,color:"hsl(var(--foreground))",margin:0},children:"Styles"}),e.jsxs("p",{style:{fontSize:13,color:"hsl(var(--muted-foreground))",marginTop:3},children:["Preset ativo: ",e.jsx("strong",{children:(o==null?void 0:o.name)??"Nenhum"})]})]}),e.jsxs("button",{onClick:()=>{u(null),i(!0)},style:{display:"flex",alignItems:"center",gap:6,height:36,padding:"0 16px",borderRadius:10,background:"hsl(var(--foreground))",color:"hsl(var(--background))",border:"none",fontSize:13,fontWeight:500,cursor:"pointer"},children:[e.jsx(w,{size:14})," New style"]})]}),e.jsx("div",{style:{display:"flex",gap:8,marginBottom:24},children:W.map(t=>e.jsxs("button",{onClick:()=>m(t.id),style:{display:"flex",alignItems:"center",gap:4,height:32,padding:"0 14px",borderRadius:999,border:`1.5px solid ${p===t.id?"hsl(var(--foreground))":"hsl(var(--border))"}`,background:p===t.id?"hsl(var(--foreground))":"hsl(var(--background))",color:p===t.id?"hsl(var(--background))":"hsl(var(--muted-foreground))",fontSize:12,fontWeight:500,cursor:"pointer",transition:"all 0.15s"},children:[t.id==="all"&&e.jsx(D,{size:13}),t.label]},t.id))}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(110px, 1fr))",gap:16},children:[j.map(t=>e.jsx(T,{style:t,isActive:(o==null?void 0:o.id)===t.id,onActivate:()=>f(t),onEdit:()=>{u(t),i(!0)},onDelete:()=>x(t.id),onRegenerate:()=>v(t)},t.id)),e.jsxs("button",{onClick:()=>{u(null),i(!0)},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,aspectRatio:"1/1",borderRadius:10,border:"1.5px dashed hsl(var(--border))",background:"hsl(var(--background))",cursor:"pointer",color:"hsl(var(--muted-foreground))",fontSize:12,fontWeight:500,transition:"all 0.15s"},children:[e.jsx(w,{size:24}),e.jsx("span",{children:"New style"})]})]}),n&&e.jsx(N,{onClose:()=>{i(!1),u(null)},onSave:y,editingStyle:g}),e.jsx("style",{children:` 2 .sm-card-overlay:hover { opacity: 1 !important; } 3 div:hover > .sm-card-overlay { opacity: 1 !important; } 4 `})]})}export{Z 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.