1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/productFunnel-DiJFcMU2.js","assets/index-L9AYrVUw.js","assets/index-DnDj_hub.css"])))=>i.map(i=>d[i]); 2import{r as x,j as t,_ as te}from"./index-L9AYrVUw.js";import{A as oe}from"./FloatingTopMenu-CIhwk2RR.js";import{s as z}from"./productFunnel-DiJFcMU2.js";import{m as ie}from"./ArrowsClockwise.es-CX8V1pij.js";import{s as re}from"./ChatCircle.es-ys8V5LKI.js";import{d2 as ne,aE as U,a as _,a3 as q,aB as se,u as D,d3 as ae}from"./PlanAccessModal-P_W2GThH.js";import{m as Y}from"./FloppyDisk.es-DCGe340Q.js";import{n as H}from"./Globe.es-5iBT42E4.js";import{o as le}from"./Image.es-BLTC_PgL.js";import{m as de}from"./MagicWand.es-CAihBnXI.js";import{n as ce}from"./Package.es-CyLjTX4J.js";import{n as pe}from"./Palette.es-Dd5ZEM4v.js";import{n as L}from"./Target.es-Ds7XP-fd.js";import{m as ue}from"./WarningCircle.es-CHfqKWRY.js";import{hydrateStoreContextFromSupabase as De}from"./hydrateStoreContext-CnRDd9GD.js";import"./locale-Cctu0V3Y.js";import"./SnewLogo-Cg53XTnQ.js";const K="snew:store-context";function me(){try{const n=localStorage.getItem(K),p=n?JSON.parse(n):null,s=ne();return s?{brandReferences:[],...p??{},...s}:n?{brandReferences:[],...p}:null}catch{return null}}function C(n){if(ae()){console.warn("[demo-store] saveStoreContext ignorado: perfil demo ativo");return}try{localStorage.setItem(K,JSON.stringify(n))}catch(p){console.warn("Failed to save store context to localStorage:",p)}fe(n).catch(console.error)}function ge(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"default"}async function fe(n){var p;try{const{supabase:s}=await te(async()=>{const{supabase:h}=await import("./productFunnel-DiJFcMU2.js").then(T=>T.g);return{supabase:h}},__vite__mapDeps([0,1,2])),a=s,{data:u,error:y}=await s.auth.getSession();if(y)throw y;const o=(p=u.session)==null?void 0:p.user.id;if(!o)throw new Error("authenticated_session_required");const{data:l,error:m}=await a.from("team_members").select("team_id").eq("user_id",o).order("team_id").limit(2);if(m)throw m;if(((l==null?void 0:l.length)??0)!==1)throw new Error("active_team_selection_required");const g=l[0].team_id,f=new Date().toISOString(),{data:d,error:S}=await a.from("store_contexts").select("id").eq("team_id",g).order("updated_at",{ascending:!1}).limit(1).maybeSingle();if(S)throw S;const A=d!=null&&d.id?a.from("store_contexts").update({data:n,user_id:o,team_id:g,updated_at:f}).eq("id",d.id):a.from("store_contexts").insert({slug:`${ge(n.name||"default")}-${g}`,data:n,user_id:o,team_id:g,updated_at:f}),{error:k}=await A;k&&console.warn("Supabase persist failed:",k.message)}catch(s){console.warn("persistStoreContextToSupabase error:",s)}}async function Be(n,p=3){const s=[];for(const a of n.slice(0,p))try{const y=await(await fetch(a.url)).blob(),o=await new Promise(l=>{const m=new FileReader;m.onload=()=>l(m.result.split(",")[1]),m.readAsDataURL(y)});o&&s.push(o)}catch{}return s}const v=({icon:n,label:p,value:s,onEdit:a,accent:u})=>{const[y,o]=x.useState(!1),[l,m]=x.useState(Array.isArray(s)?s.join(", "):s),g=Array.isArray(s)?s.join(", "):s;return t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"14px 0",borderBottom:"1px solid #F0F0EC"},children:[t.jsx("div",{style:{width:32,height:32,borderRadius:8,background:`${u}08`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(n,{size:15,style:{color:u}})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:11,fontWeight:500,color:"#999",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:4},children:p}),y?t.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[t.jsx("input",{autoFocus:!0,value:l,onChange:f=>m(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(a==null||a(l),o(!1)),f.key==="Escape"&&o(!1)},style:{flex:1,padding:"4px 10px",borderRadius:6,border:`1.5px solid ${u}`,fontSize:13,color:"#1A1A1A",outline:"none",fontFamily:"inherit",background:"#FAFAF8"}}),t.jsx("button",{onClick:()=>{a==null||a(l),o(!1)},style:{padding:"4px 12px",borderRadius:6,border:"none",background:u,color:"#FFF",fontSize:12,cursor:"pointer",fontFamily:"inherit"},children:"OK"})]}):t.jsxs("p",{onClick:()=>a&&o(!0),style:{fontSize:13,color:g?"#333":"#BBB",margin:0,lineHeight:1.5,cursor:a?"pointer":"default",borderRadius:4,padding:"2px 0",transition:"color 0.1s"},title:a?"Clique para editar":void 0,children:[g||"â",a&&g&&t.jsx("span",{style:{fontSize:11,color:"#CCC",marginLeft:8},children:"editar"})]})]})]})},I={fontSize:11,fontWeight:700,color:"#666",textTransform:"uppercase",letterSpacing:"0.06em",margin:"0 0 8px"}
2,W={fontSize:10,color:"#AAA",margin:"0 0 6px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},E=n=>({padding:"6px 12px",borderRadius:99,border:n?"1.5px solid #1A1A1A":"1.5px solid #E0DDD8",background:n?"#1A1A1A":"#FAFAF8",color:n?"#FFF":"#555",fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"inherit",display:"flex",alignItems:"center",gap:4,transition:"all 0.12s",whiteSpace:"nowrap"});function Pe(){var O;const[n,p]=x.useState(!0),[s,a]=x.useState(""),[u,y]=x.useState(!1),[o,l]=x.useState(me),[m,g]=x.useState(null),f=x.useRef(null),[d,S]=x.useState([]),[A,k]=x.useState(!1),h="#1A1A1A",T=e=>{var F;const r=10-((((F=o==null?void 0:o.brandReferences)==null?void 0:F.length)??0)+d.length),j=e.slice(0,r);j.length&&j.forEach((c,P)=>{const N=new FileReader;N.onload=X=>{var M;const Z=(M=X.target)==null?void 0:M.result;S(ee=>[...ee,{id:`pending-${Date.now()}-${P}`,file:c,dataUrl:Z,label:c.name.replace(/\.[^.]+$/,"").slice(0,20)}])},N.readAsDataURL(c)})},J=e=>{S(i=>i.filter(r=>r.id!==e))},G=async()=>{if(!(!d.length||!o)){k(!0);try{const e=[];for(const i of d){const r=i.file.name.split(".").pop()||"jpg",j=`${Date.now()}-${Math.random().toString(36).slice(2,8)}.${r}`,{error:F}=await z.storage.from("brand-references").upload(j,i.file,{contentType:i.file.type});if(F){console.error("UploadSimple error:",F);continue}const{data:c}=z.storage.from("brand-references").getPublicUrl(j);e.push({id:`bref-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,url:c.publicUrl,label:i.label})}if(e.length){const i={...o,brandReferences:[...o.brandReferences??[],...e],updatedAt:new Date().toISOString()};l(i),C(i),D.success(`${e.length} referência${e.length>1?"s":""} salva${e.length>1?"s":""} e ativada${e.length>1?"s":""}!`)}S([])}catch(e){D.error("Erro ao salvar referências: "+(e.message??""))}finally{k(!1)}}},V=async e=>{if(!o)return;try{const r=e.url.split("/brand-references/");r[1]&&await z.storage.from("brand-references").remove([r[1]])}catch{}const i={...o,brandReferences:o.brandReferences.filter(r=>r.id!==e.id),updatedAt:new Date().toISOString()};l(i),C(i)},Q=async()=>{if(!o)return;for(const i of o.brandReferences)try{const r=i.url.split("/brand-references/");r[1]&&await z.storage.from("brand-references").remove([r[1]])}catch{}const e={...o,brandReferences:[],updatedAt:new Date().toISOString()};l(e),C(e),S([])},$=async()=>{const e=s.trim();if(e){y(!0),g(null);try{const{data:i,error:r}=await z.functions.invoke("gemini-generate",{body:{prompt:`You are a brand analyst. Analyze this e-commerce store URL and extract brand context. 3 4URL: ${e} 5 6Fetch the website content and analyze it. Return ONLY a valid JSON object with this exact structure: 7{ 8 "name": "store name", 9 "description": "1-2 sentence description of what the store sells", 10 "tone": "one of: luxury / casual / bold / minimalist / playful / professional / organic", 11 "niche": "specific niche in Portuguese (ex: moda feminina, cosméticos naturais, eletrônicos)", 12 "audience": "target audience in Portuguese (ex: mulheres 25-40 anos, jovens 18-30)", 13 "colors": ["#hex1", "#hex2", "#hex3"], 14 "keywords": ["keyword1", "keyword2", "keyword3", "keyword4", "keyword5"], 15 "productTypes": ["type1", "type2", "type3"] 16} 17 18If you cannot access the URL, infer from the URL itself. Return ONLY the JSON, no other text.`,model:"gemini-3.1-flash-image-preview",responseType:"text"}});if(r)throw new Error(r.message);const F=((i==null?void 0:i.text)??"").match(/\{[\s\S]*\}/);if(!F)throw new Error("Não foi possÃvel extrair contexto da loja.");const c=JSON.parse(F[0]),P={url:e,name:c.name??"",description:c.description??"",tone:c.tone??"",niche:c.niche??"",audience:c.audience??"",colors:c.colors??[],keywords:c.keywords??[],productTypes:c.productTypes??[],brandReferences:(o==null?void 0:o.brandReferences)??[],updatedAt:new Date().toISOString()};l(P),C(P),D.success("Contexto da loja extraÃdo com sucesso!")}catch(i){g(i.message??"Erro ao analisar o site.")}finally{y(!1)}}},b=(e,i)=>{if(!o)return;const r={...o,[e]:["colors","keywords","productTypes"].includes(e)?i.split(",").map(j=>
18j.trim()).filter(Boolean):i,updatedAt:new Date().toISOString()};l(r),C(r),D.success("Atualizado!")},w=e=>{if(!o)return;const i={...o,...e,updatedAt:new Date().toISOString()};l(i),C(i)},R=((O=o==null?void 0:o.brandReferences)==null?void 0:O.length)??0,B=R+d.length;return t.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",overflow:"hidden",background:"#F2F2F2"},children:[t.jsx(oe,{collapsed:n,onToggleCollapse:()=>p(e=>!e)}),t.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto",padding:"12px 12px 12px 0",boxSizing:"border-box"},children:t.jsxs("div",{style:{maxWidth:640,margin:"0 auto",padding:"48px 0 80px",animation:"fadeSlideIn 0.3s ease"},children:[t.jsxs("div",{style:{marginBottom:32},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[t.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"#1A1A1A",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(H,{size:16,style:{color:"#FFF"}})}),t.jsx("h1",{style:{fontSize:20,fontWeight:600,color:"#1A1A1A",margin:0,letterSpacing:"-0.02em"},children:"Knowledge Base"})]}),t.jsx("p",{style:{fontSize:13,color:"#888",margin:0,lineHeight:1.6},children:"Conecte sua loja e o Snew entende automaticamente o contexto, tom de voz e produtos â aplicando esse conhecimento em todas as gerações de assets e documentos."})]}),t.jsxs("div",{style:{background:"#FFFFFF",borderRadius:12,padding:"20px 24px",marginBottom:20,border:"1px solid #E8E8E4"},children:[t.jsx("div",{style:{fontSize:12,fontWeight:500,color:"#999",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:10},children:"URL da loja"}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"stretch"},children:[t.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:8,border:"1.5px solid #E0E0DC",borderRadius:8,padding:"0 12px",background:"#FAFAF8",transition:"border-color 0.15s"},children:[t.jsx(H,{size:14,style:{color:"#BBB",flexShrink:0}}),t.jsx("input",{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>e.key==="Enter"&&$(),placeholder:"https://sualojaonline.com.br",style:{flex:1,border:"none",outline:"none",fontSize:13,color:"#1A1A1A",background:"transparent",fontFamily:"inherit",padding:"11px 0"},onFocus:e=>e.target.parentElement.style.borderColor="#1A1A1A",onBlur:e=>e.target.parentElement.style.borderColor="#E0E0DC"})]}),t.jsx("button",{onClick:$,disabled:u||!s.trim(),style:{padding:"0 18px",borderRadius:8,border:"none",background:h,color:"#FFF",fontSize:12,fontWeight:500,cursor:u?"wait":"pointer",fontFamily:"inherit",display:"flex",alignItems:"center",gap:6,opacity:u||!s.trim()?.5:1,transition:"opacity 0.15s"},children:u?t.jsxs(t.Fragment,{children:[t.jsx(U,{size:13,className:"animate-spin"})," Analisando..."]}):o?t.jsxs(t.Fragment,{children:[t.jsx(ie,{size:13})," Reanalisar"]}):t.jsxs(t.Fragment,{children:[t.jsx(_,{size:13})," Analisar loja"]})})]}),m&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:12,padding:"10px 14px",background:"#FFF5F5",borderRadius:8,border:"1px solid #FFE0E0"},children:[t.jsx(ue,{size:14,style:{color:"#E53E3E",flexShrink:0}}),t.jsx("p",{style:{fontSize:12,color:"#C53030",margin:0},children:m})]})]}),o&&t.jsxs("div",{style:{background:"#FFFFFF",borderRadius:12,padding:"24px",border:"1px solid #E8E8E4",animation:"fadeSlideIn 0.3s ease"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[t.jsx(q,{size:14,style:{color:"#38A169"}}),t.jsx("span",{style:{fontSize:14,fontWeight:600,color:"#1A1A1A"},children:o.name||"Loja conectada"})]}),t.jsxs("span",{style:{fontSize:11,color:"#BBB"},children:["Atualizado ",new Date(o.updatedAt).toLocaleDateString("pt-BR")]})]}),o.colors.length>0&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:20,padding:"12px 14px",background:"#FAFAF8",borderRadius:8},children:[o.colors.map((e,i)=>t.jsx("div",{style:{width:24,height:24,borderRadius:6,background:e,border:"1px solid rgba(0,0,0,0.08)"}},i)),t.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:"paleta de cores detectada"})]}),t.jsx(v,{icon:se,label:"Nome",value:o.name,accent:h,onEdit:e=>b("name",e)}),t.jsx(v,{icon:re,label:"Descrição",value:o.description,accent:h,onEdit:e=>b("description",e)}),t.jsx(v,{icon:L,label:"Nicho",value:o.niche,accent:h,onEdit:e=>b("niche",e)}),t.jsx(v,{icon:L,label:"Público-alvo",value:o.audience,accent:h,onEdit:e=>b("audience",e)}),t.jsx(v,{icon:_,label:"Tom de voz",value:o.tone,accent:h,onEdit:e=>b("tone",e)}),t.jsx(v,{icon:ce,label:"Tipos de produto",value:o.productTypes,accent:h,onEdit:e=>b("productTypes",e)}),t.jsx(v,{icon:L,label:"Palavras-chave",value:o.keywords,accent:h,onEdit:e=>b("keywords",e)}),t.jsx(v,{icon:pe,label:"Cores",value:o.colors,accent:h,onEdit:e=>b("colors",e)}),t.jsxs("div",{style:{marginTop:32},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:20},children:[t.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"#F0EBFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(de,{size:14,style:{color:"#7C3AED"}})}),t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:14,fontWeight:700,color:"#1A1A1A",margin:0},children:"Direção Visual"}),t.jsx("p",{style:{fontSize:11,color:"#999",margin:0},children:"Define o estilo visual de todas as gerações"})]})]}),t.jsxs("div",{style:{marginBottom:20},children:[t.jsx("p",{style:I,children:"Conceito visual"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[{id:"moderno",label:"Moderno",emoji:""},{id:"classico",label:"Clássico",emoji:""},{id:"premium",label:"Premium",emoji:""},{id:"contemporaneo",label:"Contemporâneo",emoji:""},{id:"sutil-infantil",label:"Infantil sutil",emoji:""}
18,{id:"tech",label:"Tech",emoji:""},{id:"sustentavel",label:"Sustentável",emoji:""},{id:"bold",label:"TextB",emoji:""},{id:"minimalista",label:"Minimalista",emoji:"â»"},{id:"funny",label:"Funny",emoji:""},{id:"serio",label:"Sério",emoji:""},{id:"lifestyle",label:"Lifestyle",emoji:""}].map(e=>t.jsxs("button",{onClick:()=>w({visualConcept:e.id===(o==null?void 0:o.visualConcept)?"":e.id}),style:{padding:"7px 14px",borderRadius:99,border:(o==null?void 0:o.visualConcept)===e.id?"1.5px solid #7C3AED":"1.5px solid #E0DDD8",background:(o==null?void 0:o.visualConcept)===e.id?"#F0EBFF":"#FAFAF8",color:(o==null?void 0:o.visualConcept)===e.id?"#7C3AED":"#555",fontSize:12,fontWeight:500,cursor:"pointer",fontFamily:"inherit",display:"flex",alignItems:"center",gap:4,transition:"all 0.12s"},children:[t.jsx("span",{children:e.emoji}),e.label]},e.id))})]}),t.jsxs("div",{style:{marginBottom:20},children:[t.jsx("p",{style:I,children:"Modelo / Protagonista"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsxs("div",{children:[t.jsx("p",{style:W,children:"Tipo"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[{id:"feminino",label:"Feminino",emoji:""},{id:"masculino",label:"Masculino",emoji:""},{id:"neutro",label:"Neutro",emoji:""},{id:"bebê",label:"Bebê",emoji:""},{id:"criança",label:"Criança",emoji:""},{id:"famÃlia",label:"FamÃlia",emoji:""}].map(e=>{var i;return t.jsxs("button",{onClick:()=>{var r;return w({modelProfile:{...o==null?void 0:o.modelProfile,gender:((r=o==null?void 0:o.modelProfile)==null?void 0:r.gender)===e.id?void 0:e.id}})},style:E(((i=o==null?void 0:o.modelProfile)==null?void 0:i.gender)===e.id),children:[e.emoji," ",e.label]},e.id)})})]}),t.jsxs("div",{children:[t.jsx("p",{style:W,children:"Faixa etária"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:["0-12 meses","1-3 anos","3-8 anos","18-25","25-35","35-45","45+"].map(e=>{var i;return t.jsx("button",{onClick:()=>{var r;return w({modelProfile:{...o==null?void 0:o.modelProfile,ageRange:((r=o==null?void 0:o.modelProfile)==null?void 0:r.ageRange)===e?void 0:e}})},style:E(((i=o==null?void 0:o.modelProfile)==null?void 0:i.ageRange)===e),children:e},e)})})]}),t.jsxs("div",{children:[t.jsx("p",{style:W,children:"Pose e atitude"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[{id:"candid",label:"Candid / Natural"},{id:"lifestyle",label:"Lifestyle"},{id:"attitude",label:"Attitude / Poder"},{id:"suave",label:"Suave / Delicado"},{id:"brincalhao",label:"Brincalhão"},{id:"confiante",label:"Confiante"},{id:"sorridente",label:"Sorridente"},{id:"serio",label:"Sério"}].map(e=>{var i;return t.jsx("button",{onClick:()=>{var r;return w({modelProfile:{...o==null?void 0:o.modelProfile,pose:((r=o==null?void 0:o.modelProfile)==null?void 0:r.pose)===e.id?void 0:e.id}})},style:E(((i=o==null?void 0:o.modelProfile)==null?void 0:i.pose)===e.id),children:e.label},e.id)})})]})]})]}),t.jsxs("div",{style:{marginBottom:20},children:[t.jsx("p",{style:I,children:"Estilo de shooting"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[{id:"lifestyle",label:"Lifestyle",emoji:""},{id:"editorial",label:"Editorial",emoji:""},{id:"studio",label:"Studio",emoji:""},{id:"packshot",label:"Packshot",emoji:""},{id:"street",label:"Street",emoji:""},{id:"natureza",label:"Natureza",emoji:""},{id:"interior",label:"Interior",emoji:""}].map(e=>t.jsxs("button",{onClick:()=>w({shootingStyle:e.id===(o==null?void 0:o.shootingStyle)?"":e.id}),style:E((o==null?void 0:o.shootingStyle)===e.id),children:[e.emoji," ",e.label]},e.id))})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,marginBottom:20},children:[t.jsxs("div",{children:[t.jsx("p",{style:I,children:"Iluminação"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[{id:"luz-natural",label:"Luz natural"},{id:"golden-hour",label:"Golden hour"},{id:"studio-suave",label:"Studio suave"},{id:"studio-duro",label:"Studio duro"},{id:"high-key",label:"High key"},{id:"low-key",label:"Low key"}].map(e=>t.jsx("button",{onClick:()=>w({lightingMood:e.id===(o==null?void 0:o.lightingMood)?"":e.id}),style:{...E((o==null?void 0:o.lightingMood)===e.id),justifyContent:"flex-start",width:"100%"},children:e.label},e.id))})]}),t.jsxs("div",{children:[t.jsx("p",{style:I,children:"Paleta de humor"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[{id:"quente",label:"Quente / Ãmbar"},{id:"frio",label:"Frio / Azulado"},{id:"neutro",label:"Neutro / Orgânico"},{id:"vibrante",label:"Vibrante / Saturado"},{id:"monocromatico",label:"Monocromático"},{id:"pastel",label:"Pastel / Suave"}].map(e=>t.jsx("button",{onClick:()=>w({colorMood:e.id===(o==null?void 0:o.colorMood)?"":e.id}),style:{...E((o==null?void 0:o.colorMood)===e.id),justifyContent:"flex-start",width:"100%"},children:e.label},e.id))})]})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
18p:10,marginTop:20,padding:"14px 16px",background:"#F8FFF8",borderRadius:8,border:"1px solid #E0F0E0"},children:[t.jsx(_,{size:14,style:{color:"#38A169",flexShrink:0,marginTop:1}}),t.jsxs("p",{style:{fontSize:12,color:"#555",margin:0,lineHeight:1.6},children:["Este contexto está sendo aplicado em todas as gerações â imagens, vÃdeos, carrosséis, relatórios e copies serão adaptados ao tom, nicho e identidade da ",o.name||"sua loja","."]})]})]}),o&&t.jsxs("div",{style:{background:"#FFFFFF",borderRadius:12,padding:"20px 24px",border:"1px solid #E8E8E4",marginTop:16,animation:"fadeSlideIn 0.3s ease"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:11,fontWeight:600,color:"#999",textTransform:"uppercase",letterSpacing:"0.06em",margin:"0 0 3px"},children:"Referências visuais da marca"}),t.jsx("p",{style:{fontSize:12,color:"#BBB",margin:0},children:"Imagens que definem a identidade visual â usadas em toda geração de assets"})]}),R+d.length>0&&t.jsx("button",{onClick:Q,style:{fontSize:11,color:"#CCC",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit"},onMouseEnter:e=>e.currentTarget.style.color="#E53E3E",onMouseLeave:e=>e.currentTarget.style.color="#CCC",children:"Limpar tudo"})]}),B>0&&t.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[o.brandReferences.map(e=>t.jsxs("div",{style:{position:"relative"},children:[t.jsx("img",{src:e.url,alt:e.label??"",style:{width:72,height:72,borderRadius:10,objectFit:"cover",display:"block",border:"1.5px solid #EEEDE9"}}),t.jsx("button",{onClick:()=>V(e),style:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:"50%",background:"#EF4444",border:"2px solid #FFFFFF",cursor:"pointer",color:"white",fontSize:9,display:"flex",alignItems:"center",justifyContent:"center",padding:0,lineHeight:1}}),e.label&&t.jsx("p",{style:{fontSize:9,color:"#999",margin:"3px 0 0",textAlign:"center",maxWidth:72,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]},e.id)),d.map(e=>t.jsxs("div",{style:{position:"relative"},children:[t.jsx("img",{src:e.dataUrl,alt:e.label??"",style:{width:72,height:72,borderRadius:10,objectFit:"cover",display:"block",border:"1.5px dashed #F59E0B",opacity:.85}}),t.jsx("button",{onClick:()=>J(e.id),style:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:"50%",background:"#EF4444",border:"2px solid #FFFFFF",cursor:"pointer",color:"white",fontSize:9,display:"flex",alignItems:"center",justifyContent:"center",padding:0,lineHeight:1}}),t.jsx("p",{style:{fontSize:8,color:"#F59E0B",margin:"3px 0 0",textAlign:"center",maxWidth:72,fontWeight:600},children:"pendente"})]},e.id)),B<10&&t.jsxs("button",{onClick:()=>{var e;return(e=f.current)==null?void 0:e.click()},style:{width:72,height:72,borderRadius:10,border:"1.5px dashed #D0CFC9",background:"#FAFAF8",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#CCC",transition:"all 0.12s",gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor="#1A1A1A",e.currentTarget.style.color="#666"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#D0CFC9",e.currentTarget.style.color="#CCC"},children:[t.jsx("span",{style:{fontSize:24,lineHeight:1,marginBottom:-2},children:"+"}),t.jsx("span",{style:{fontSize:9},children:"adicionar"})]})]}),B===0&&t.jsxs("div",{onDragOver:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#1A1A1A",e.currentTarget.style.background="#F5F5F3"},onDragLeave:e=>{e.currentTarget.style.borderColor="#D0CFC9",e.currentTarget.style.background="#FAFAF8"},onDrop:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#D0CFC9",e.currentTarget.style.background="#FAFAF8";const i=Array.from(e.dataTransfer.files).filter(r=>r.type.startsWith("image/")).slice(0,10);i.length&&T(i)},onClick:()=>{var e;return(e=f.current)==null?void 0:e.click()},style:{border:"1.5px dashed #D0CFC9",borderRadius:12,padding:"28px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,cursor:"pointer",transition:"all 0.15s",background:"#FAFAF8"},children:[t.jsx("div",{style:{width:44,height:44,borderRadius:11,background:"#EEEDE9",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(le,{size:20,style:{color:"#AAA"}})}),t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:13,fontWeight:500,color:"#555",margin:"0 0 3px"},children:"Arraste ou clique para adicionar referências"}),t.jsx("p",{style:{fontSize:12,color:"#BBB",margin:0},children:"Fotos de produto, lookbook, editorial â até 10 imagens · JPG, PNG, WEBP"})]})]}),t.jsx("input",{ref:f,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{const i=10-B,r=Array.from(e.target.files??[]).slice(0,i);r.length&&T(r),e.target.value=""}}),d.length>0&&t.jsx("button",{className:"snew-main-action",onClick:G,disabled:A,style:{width:"100%",padding:"12px 0",borderRadius:8,border:"none",fontSize:13,fontWeight:600,cursor:A?"wait":"pointer",fontFamily:"inherit",display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginTop:12,opacity:A?.6:1,transition:"opacity 0.15s"},children:A?t.jsxs(t.Fragment,{children:[t.jsx(U,{size:14,className:"animate-spin"})," Salvando..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14})," Salvar ",d.length," referência",d.length>
181?"s":""]})}),R>0&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,padding:"8px 12px",borderRadius:8,background:"#F7F6F3",border:"1px solid #EEEDE9"},children:[t.jsx(q,{size:12,style:{color:"#22C55E",flexShrink:0}}),t.jsxs("p",{style:{fontSize:11,color:"#666",margin:0},children:[t.jsxs("strong",{children:[R," referência",R>1?"s":""]})," ativas â a IA usa essas imagens como direção visual em todas as gerações do Studio."]})]})]}),o&&t.jsx("div",{style:{position:"sticky",bottom:20,display:"flex",justifyContent:"center",marginTop:24,zIndex:10},children:t.jsxs("button",{className:"snew-main-action",onClick:()=>{C(o),D.success("Knowledge Base sincronizada!",{description:`${o.name} â contexto aplicado em todas as gerações.`})},style:{padding:"12px 32px",borderRadius:12,border:"none",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"inherit",display:"flex",alignItems:"center",gap:8,boxShadow:"0 4px 20px rgba(0,0,0,0.18)",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 6px 24px rgba(0,0,0,0.24)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 20px rgba(0,0,0,0.18)"},children:[t.jsx(Y,{size:14}),"Salvar e sincronizar"]})})]})}),t.jsx("style",{children:` 19 @keyframes fadeSlideIn { 20 from { opacity: 0; transform: translateY(8px); } 21 to { opacity: 1; transform: translateY(0); } 22 } 23 `})]})}export{K as STORE_CONTEXT_KEY,Pe as default,De as hydrateStoreContextFromSupabase,Be as loadBrandReferencesBase64,me as loadStoreContext,fe as persistStoreContextToSupabase,C as saveStoreContext};
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.