1import{j as e,a7 as d,Q as x,R as u,ac as h,ab as i,T as s,ao as c}from"./mui-CRsYZxVY.js";import{J as g,b as f,T as m,K as y,aN as j}from"./index-TALscxEc.js";import{u as w}from"./useProductVariations-zMUBu_ll.js";import{u as _}from"./useProduct-BltDnkHr.js";import{V as I,d as R}from"./icons-D8aatgQ4.js";import"./vendor-Dwao9eNC.js";import"./query-8ViTdhdk.js";import"./datePickers-BIJXYOKG.js";import"./lab-DSem1Osk.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new o.Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="5506ade4-9927-4e2c-88b7-6c671db2c22f",o._sentryDebugIdIdentifier="sentry-dbid-5506ade4-9927-4e2c-88b7-6c671db2c22f")})()}catch{}const T=()=>e.jsxs(u,{sx:{bgcolor:"white",borderRadius:1,mb:1,"&:last-child":{mb:0}},children:[e.jsx(h,{primary:e.jsx(c,{variant:"text",width:"60%",height:24}),secondary:e.jsxs(i,{spacing:1,sx:{mt:1},children:[e.jsx(c,{variant:"text",width:"30%",height:20}),e.jsx(c,{variant:"text",width:"20%",height:16})]})}),e.jsx(c,{variant:"circular",width:24,height:24})]}),D=()=>{const{productId:o}=g(),a=f(),{data:r,isLoading:l}=w(o),{data:n}=_(o??""),b=t=>{a(`/products/${o}/variations/${t.id}/edit`)},p=t=>j(t);return e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{title:`Variações${!l&&r&&r.length?` (${r.length})`:""}`,navigateBack:!0}),e.jsx(d,{sx:{flex:1,p:2},children:l?e.jsx(x,{disablePadding:!0,children:[1,2,3].map(t=>e.jsx(T,{},t))}):!r||!r.length?e.jsx(y,{primaryText:"Nenhuma variação encontrada",secondaryText:"Configure os atributos do produto para criar variações"}):e.jsx(x,{disablePadding:!0,children:r.map(t=>e.jsxs(u,{onClick:()=>b(t),sx:{cursor:"pointer",bgcolor:"white",borderRadius:1,mb:1,transition:"background-color 0.2s","&:last-child":{mb:0}},children:[e.jsx(h,{primary:e.jsxs(i,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(s,{variant:"body1",sx:{color:t.oculto?"text.disabled":"text.primary",fontWeight:500},children:p(t.valores)}),t.oculto&&e.jsx(I,{sx:{fontSize:16,color:"text.disabled"}})]}),secondary:e.jsxs(i,{spacing:.5,sx:{mt:.5},children:[t.preco_cheio?e.jsxs(i,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(s,{variant:"body2",sx:{color:t.oculto?"text.disabled":"text.secondary",textDecoration:"line-through",fontSize:"0.875rem"},children:new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(t.preco_cheio)}),e.jsx(s,{variant:"body2",sx:{color:t.oculto?"text.disabled":"success.main",fontWeight:600},children:new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(t.preco)}),e.jsxs(d,{sx:{bgcolor:"success.main",color:"success.contrastText",px:.5,borderRadius:.5,fontSize:"0.6rem",fontWeight:500},children:[Math.round((t.preco_cheio-t.preco)/t.preco_cheio*100),"% OFF"]})]}):e.jsx(s,{variant:"body2",sx:{color:t.oculto?"text.disabled":"text.secondary",fontWeight:500},children:new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(t.preco)}),t.codigo_produto&&e.jsxs(s,{variant:"caption",color:"text.disabled",children:["Código: ",t.codigo_produto]}),t.codigo_de_barras&&e.jsxs(s,{variant:"caption",color:"text.disabled",children:["Código de barras: ",t.codigo_de_barras]}),(n==null?void 0:n.controlar_estoque)&&t.controlar_estoque&&e.jsx(s,{variant:"caption",sx:{color:"success.main",fontWeight:500},children:"Controle de estoque ativado"})]})}),e.jsx(R,{sx:{color:t.oculto?"text.disabled":"text.secondary"}})]},t.id))})})]})};export{D 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.