1import{j as e,a7 as s,ab as l,o as x,T as a,C as D,B as N}from"./mui-CRsYZxVY.js";import{r as g}from"./vendor-Dwao9eNC.js";import{dg as U,dl as $,y as q,ds as G,e as J,x as V,N as Q,C as K,D as M,bJ as X,F as Y}from"./index-TALscxEc.js";import{d as Z}from"./RadioButtonUnchecked-BJKJ-TId.js";import{S as ee}from"./SettingsScreenLayout-BWFwVJu5.js";import{u as te}from"./useWebCatalogSettingsSave-Byg91ItV.js";import{S as E}from"./appearanceTokens-DaF_sGil.js";import"./query-8ViTdhdk.js";import"./datePickers-BIJXYOKG.js";import"./icons-D8aatgQ4.js";import"./lab-DSem1Osk.js";import"./UnsavedChangesDialog-gqy_t4YT.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="f5e6200e-6108-4bca-b637-2da27cddc192",t._sentryDebugIdIdentifier="sentry-dbid-f5e6200e-6108-4bca-b637-2da27cddc192")})()}catch{}const C="minhaloja.stoqui.shop",re=t=>{if(!t)return C;const o=t.trim();return o?o.replace(/^https?:\/\//i,"").replace(/\/+$/,""):C},oe=["Camisetas","Calças","Acessórios","Calçados"],se=({fontFamily:t,color:o,logoUrl:r,storeName:d,storeUrl:f})=>{const m=(d==null?void 0:d.trim())||"Sua loja",u=re(f),h={fontFamily:t,"& *":{fontFamily:`${t} !important`}};return e.jsxs(s,{sx:{borderRadius:2,overflow:"hidden",border:"1px solid",borderColor:"divider",bgcolor:"#EEEEF3",...h},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.875,bgcolor:"#E4E4EC"},children:[e.jsx(l,{direction:"row",spacing:.625,children:["#FF6058","#FFBD2E","#28C940"].map(n=>e.jsx(s,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:n}},n))}),e.jsx(s,{sx:{flex:1,ml:1,px:1.25,py:.375,borderRadius:"999px",bgcolor:"white",fontSize:"0.7rem",color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})]}),e.jsxs(s,{sx:{bgcolor:"white",px:2,py:1.5,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:"1px solid",borderColor:x("#000",.06)},children:[r?e.jsx(s,{component:"img",src:r,alt:"",sx:{maxHeight:28,maxWidth:"55%",objectFit:"contain"}}):e.jsxs(l,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(s,{sx:{width:28,height:28,borderRadius:"8px",bgcolor:x(o,.12),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(U,{size:16,color:o})}),e.jsx(a,{sx:{fontWeight:700,fontSize:"0.95rem",color:"text.primary",lineHeight:1.2,maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}),e.jsx(s,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",color:o},children:e.jsx($,{size:18})})]}),e.jsxs(s,{sx:{bgcolor:"white",px:2,pt:2,pb:2.5},children:[e.jsx(a,{sx:{fontWeight:700,fontSize:"1.05rem",color:"text.primary",mb:1.25},children:"Categorias"}),e.jsx(l,{direction:"row",spacing:.75,useFlexGap:!0,flexWrap:"wrap",sx:{rowGap:.75,mb:2},children:oe.map(n=>e.jsx(s,{sx:{px:1.25,py:.5,borderRadius:"999px",bgcolor:x(o,.08),color:"text.primary",fontSize:"0.8125rem",fontWeight:500,lineHeight:1.3},children:n},n))}),e.jsx(a,{sx:{fontWeight:700,fontSize:"1.05rem",color:"text.primary",mb:1},children:"Sobre a loja"}),e.jsx(a,{sx:{fontSize:"0.875rem",lineHeight:1.55,color:"text.secondary"},children:"Produtos selecionados a dedo, com envio rápido para todo o Brasil. Entre em contato pelo WhatsApp para tirar dúvidas."})]})]})},F=[{value:"Plus Jakarta Sans Variable",label:"Plus Jakarta Sans",subtitle:"Padrão. Equilibrada e moderna."},{value:"Open Sans",label:"Open Sans",subtitle:"Limpa, neutra e fácil de ler."},{value:"Outfit",label:"Outfit",subtitle:"Geométrica, com cara de marca jovem."},{value:"Bitter",label:"Bitter",subtitle:"Com serifa, transmite tradição."},{value:"Quicksand",label:"Quicksand",subtitle:"Arredondada, acolhedora e amigável."}],T=F.map(t=>t.value),y="Plus Jakarta Sans Variable",ie=q({fonte:G().oneOf(T,"Fonte inválida").required("Selecione uma fonte")}),ae=t=>typeof t=="string"&&T.includes(t),ye=()=>{const o=D().palette.primary.main,{catalog:r,isLoading:d,save:f}=te(),{data:m}=J(),u=V(m),{storeUrl:h}=Q(),[n,S]=g.useState(!1),[_,j]=g.useState(null),{control:O,handleSubmit:I,reset:b,watch:k,formState:{isDirty:A}}=K({resolver:Y(ie),defaultValues:{fonte:y}}),L=r==null?void 0:r.id,w=ae(r==null?void 0:r.fonte)?r.fonte:y;g.useEffect(()=>{b({fonte:w})},[L,w,b]);const R=()=>new Promise((p,i)=>{I(async c=>{j(null),S(!0);try{await f({fonte:c.fonte},"appearance_typography"),b(c),p()}catch(v){j("Não foi possÃvel salvar. Tente novamente."),i(v instanceof Error?v:new Error("save failed"))}finally{S(!1)}},()=>i(new Error("validation failed")))()}),B=!d&&!u?{plan:"pro",trigger:"store_font"}:void 0,W=k("fonte")||y,P=(r==null?void 0:r.cor_principal)||o,z=(r==null?void 0:r.logo_url)??null,H=(r==null?void 0:r.nome_loja)||"Sua loja";return e.jsx(ee,{title:"Fonte",isLoading:d,isDirty:A,isSaving:n,onSave:R,saveError:_,lock:B,children:e.jsxs(l,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:4},alignItems:"flex-start",children:[e.jsxs(s,{sx:{flex:1,width:"100%",minWidth:0},children:[e.jsx(a,{sx:E,children:"Fontes"}),e.jsx(M,{name:"fonte",control:O,render:({field:p})=>e.jsx(l,{spacing:1,children:F.map(i=>{const c=p.value===i.value;return e.jsx(N,{onClick:()=>p.onChange(i.value),focusRipple:!0,disabled:n,sx:{display:"block",width:"100%",textAlign:"left",bgcolor:c?x(o,.05):"white",borderRadius:2,p:2,border:"2px s
1olid",borderColor:c?o:"transparent",transition:"background-color 120ms ease, border-color 120ms ease"},children:e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(s,{sx:{display:"flex"},children:c?e.jsx(X,{sx:{fontSize:24,color:"primary.main"}}):e.jsx(Z,{sx:{fontSize:24,color:"text.disabled"}})}),e.jsxs(l,{spacing:.25,sx:{flex:1,minWidth:0},children:[e.jsx(a,{sx:{fontFamily:i.value,fontWeight:700,fontSize:"1.125rem",color:"text.primary",lineHeight:1.2},children:i.label}),e.jsx(a,{variant:"caption",color:"text.secondary",children:i.subtitle})]})]})},i.value)})})})]}),e.jsxs(s,{sx:{flex:1,width:"100%",minWidth:0,position:{md:"sticky"},top:{md:16}},children:[e.jsx(a,{sx:E,children:"Prévia"}),e.jsx(se,{fontFamily:W,color:P,logoUrl:z,storeName:H,storeUrl:h}),e.jsx(a,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1,px:.5},children:"As mudanças aparecem aqui em tempo real."})]})]})})};export{ye 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.