1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66960],{34904:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]])},44173:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]])},66960:(e,t,a)=>{a.r(t),a.d(t,{default:()=>E});var s=a(95155),r=a(12115),i=a(87454),l=a(65229),n=a(23327),o=a(5917),c=a(86651),d=a(44173),x=a(35299),m=a(96047),p=a(6191),u=a(1524),h=a(91761),b=a(6613),g=a(18514),f=a(71360),j=a(34527),y=a(78384),v=a(35637),N=a(34904);let k=(0,a(71847).A)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);var w=a(89733);let M={zoom:1,x:0,y:0};function z(e){var t;let{produto:a,parceiro:i,restaurantId:n,onClose:c,onSaved:d}=e,[m,p]=(0,r.useState)({...M,...null!=(t=a.mix_photo_adjust)?t:{}}),[u,h]=(0,r.useState)(!1),[b,g]=(0,r.useState)(null),f=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>"Escape"===e.key&&c();return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c]);let y=(e,t,a)=>Math.max(t,Math.min(a,e)),v=()=>{f.current=null},z=(e,t)=>({id:e.id,name:e.name,image:e.image,adjust:t}),C=1===m.zoom&&0===m.x&&0===m.y,_=async()=>{h(!0),g(null);let e=C?null:m,{error:t}=await (0,j.l6)(a.id,n,e);if(h(!1),t)return void g(t.message);d(e)};return(0,s.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/50 p-4",onClick:c,children:(0,s.jsxs)("div",{className:"max-h-[92vh] w-full max-w-3xl overflow-y-auto rounded-2xl bg-white shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 border-b border-border-brand px-6 py-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-bold text-text-main",children:"Ajustar foto no Meio a Meio"}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-text-sec",children:[a.name," â arraste a foto e use o zoom at\xe9 a pizza preencher o c\xedrculo."]})]}),(0,s.jsx)("button",{onClick:c,className:"rounded-lg p-1.5 text-text-sec hover:bg-bg-base","aria-label":"Fechar",children:(0,s.jsx)(l.A,{size:18})})]}),a.image?(0,s.jsxs)("div",{className:"grid gap-6 px-6 py-6 md:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-[11px] font-black uppercase tracking-wider text-text-sec",children:"Enquadramento"}),(0,s.jsx)("div",{onPointerDown:e=>{a.image&&(e.currentTarget.setPointerCapture(e.pointerId),f.current={px:e.clientX,py:e.clientY,x:m.x,y:m.y})},onPointerMove:e=>{let t=f.current;t&&p(a=>({...a,x:y(t.x+(e.clientX-t.px)*.009765625,-1,1),y:y(t.y+(e.clientY-t.py)*.009765625,-1,1)}))},onPointerUp:v,onPointerCancel:v,className:"mx-auto flex touch-none cursor-grab justify-center rounded-2xl bg-bg-base p-3 active:cursor-grabbing",style:{width:"fit-content"},children:(0,s.jsx)(w.s,{size:240,slices:[z(a,m)]})}),(0,s.jsxs)("label",{className:"mt-4 flex items-center gap-3",children:[(0,s.jsx)(N.A,{size:16,className:"shrink-0 text-text-sec"}),(0,s.jsx)("input",{type:"range",min:1,max:3,step:.02,value:m.zoom,onChange:e=>p(t=>({...t,zoom:Number(e.target.value)})),className:"h-1.5 w-full cursor-pointer appearance-none rounded-full bg-border-brand accent-primary"}),(0,s.jsxs)("span",{className:"w-10 shrink-0 text-right text-xs font-bold tabular-nums text-text-sec",children:[m.zoom.toFixed(1),"x"]})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>p({...M}),className:"mt-3 inline-flex items-center gap-1.5 text-xs font-bold text-primary hover:underline",children:[(0,s.jsx)(k,{size:13})," Centralizar de novo"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-[11px] font-black uppercase tracking-wider text-text-sec",children:"Como o cliente v\xea"}),(0,s.jsx)("div",{className:"flex justify-center rounded-2xl bg-bg-base p-3",children:(0,s.jsx)(w.s,{size:240,slices:[z(a,m),i?z(i,i.mix_photo_adjust):null]})}),(0,s.jsxs)("p",{className:"mt-3 text-center text-xs text-text-sec",children:["Metade ",(0,s.jsx)("strong",{className:"text-text-main",children:a.name}),i?(0,s.jsxs)(s.Fragment,{children:[" ","\xb7 metade ",(0,s.jsx)("strong",{className:"text-text-main",children:i.name})]}):null]})]})]}):(0,s.jsxs)("div",{className:"px-6 py-10 text-center",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-text-main",children:"Este produto ainda n\xe3o tem foto."}),(0,s.jsx)("p",{className:"mx-auto mt-1 max-w-sm text-xs text-text-sec",children:"Sem foto, o cliente v\xea uma
1ilustra\xe7\xe3o gerada automaticamente para este sabor. Cadastre uma imagem no Gestor de card\xe1pio para poder enquadrar aqui."})]}),b&&(0,s.jsx)("p",{className:"px-6 pb-2 text-xs font-bold text-red-600",children:b}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border-brand px-6 py-4",children:[(0,s.jsx)("button",{onClick:c,className:"rounded-xl px-4 py-2 text-sm font-bold text-text-sec hover:bg-bg-base",children:"Cancelar"}),(0,s.jsxs)("button",{onClick:_,disabled:u||!a.image,className:"inline-flex items-center gap-2 rounded-xl bg-primary px-5 py-2 text-sm font-bold text-white transition-colors hover:bg-primary-dark disabled:opacity-50",children:[u?(0,s.jsx)(x.A,{size:15,className:"animate-spin"}):(0,s.jsx)(o.A,{size:15}),"Salvar enquadramento"]})]})]})})}function C(e){return"".concat(e.strategy,"|").concat(Number(e.splitFee)||0)}let _={proportional:"Metade de cada (proporcional)",highest:"Maior pre\xe7o",average:"M\xe9dia dos sabores"},A={proportional:"Cada fra\xe7\xe3o paga metade do seu pr\xf3prio pre\xe7o. Padr\xe3o recomendado.",highest:"Cliente paga o valor do sabor mais caro entre os escolhidos.",average:"Pre\xe7o final \xe9 a m\xe9dia entre os sabores escolhidos."};function S(e){return"R$ ".concat(e.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}))}function P(e){return null!=e.promo_price?Number(e.promo_price):Number(e.price)}function q(e){let{series:t}=e,a=Math.max(1,...t.map(e=>e.count));return(0,s.jsx)("div",{className:"flex items-end gap-1 h-12",children:t.map((e,t)=>{let r=Math.max(4,Math.round(e.count/a*48)),i=new Date(e.date+"T12:00:00").toLocaleDateString("pt-BR",{weekday:"short"}).replace(".","");return(0,s.jsxs)("div",{className:"flex flex-col items-center gap-0.5",children:[(0,s.jsx)("div",{className:"w-5 rounded-t ".concat(e.count>0?"bg-primary":"bg-slate-200"),style:{height:"".concat(r,"px")},title:"".concat(e.count," pedidos em ").concat(i)}),(0,s.jsx)("span",{className:"text-[9px] font-bold uppercase text-slate-400",children:i.slice(0,3)})]},t)})})}function F(e){var t,a,m,p,u,h,b,g,f,y,N,k;let{initial:w,products:M,categories:q,sizeNames:F,restaurantId:E,onClose:I,onSaved:G}=e,W=!w,[D,L]=(0,r.useState)(null!=(m=null==w?void 0:w.name)?m:""),[O,B]=(0,r.useState)(null!=(p=null==w?void 0:w.max_flavors)?p:2),[R,Q]=(0,r.useState)(null!=(u=null==w?void 0:w.price_strategy)?u:"proportional"),[T,V]=(0,r.useState)(null!=(h=null==w?void 0:w.split_fee)?h:0),[U,Y]=(0,r.useState)(null!=(b=null==w?void 0:w.item_label_prefix)?b:"Pizza de"),[Z,X]=(0,r.useState)(null==(g=null==w?void 0:w.active)||g),[H,$]=(0,r.useState)(new Map(null!=(f=null==w?void 0:w.products.map(e=>[e.product_id,e.half_price_override]))?f:[])),[J,K]=(0,r.useState)(""),[ee,et]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(""),[er,ei]=(0,r.useState)(new Set(null!=(y=null==w?void 0:w.category_ids)?y:[])),el=q.filter(e=>e.hasSizes),en=el.filter(e=>er.has(e.id)),eo=en.length>0?C(en[0]):null,ec=e=>null!==eo&&!er.has(e.id)&&C(e)!==eo,ed=(0,r.useMemo)(()=>en.length<2?[]:[...new Set(en.flatMap(e=>e.sizeDefinitionIds))].filter(e=>en.some(t=>!t.sizeDefinitionIds.includes(e))).map(e=>{var t;return{id:e,name:null!=(t=F.get(e))?t:"Tamanho",em:en.filter(t=>t.sizeDefinitionIds.includes(e)).map(e=>e.name)}}),[en,F]),[ex,em]=(0,r.useState)(null),[ep,eu]=(0,r.useState)(new Map),eh=e=>{var t,a;return ep.has(e.id)?null!=(t=ep.get(e.id))?t:null:null!=(a=e.mix_photo_adjust)?a:null},eb=(0,r.useMemo)(()=>{let e=J.trim().toLowerCase();return M.filter(e=>!1!==e.active).filter(t=>!e||t.name.toLowerCase().includes(e)).sort((e,t)=>e.name.localeCompare(t.name))},[M,J]),eg=(0,r.useMemo)(()=>{let e,t=Array.from(H.entries()).map(e=>{let[t,a]=e,s=M.find(e=>e.id===t);if(!s)return null;let r=null!=a?a:P(s)/2,i=null!=a?2*a/2:P(s)/2;return{product:s,halfPrice:r,fractionPrice:i}}).filter(Boolean).slice(0,2);return t.length<2?null:(e=("proportional"===R?t.reduce((e,t)=>e+t.fractionPrice,0):"highest"===R?Math.max(...t.map(e=>P(e.product))):t.reduce((e,t)=>e+P(t.product),0)/t.length)+(t.length>1?T:0),{picks:t,totalPrice:e})},[H,M,O,R,T]),ef=async()=>
1{if(es(""),!D.trim())return void es("D\xea um nome para o grupo (ex: Pizzas Grandes).");if(0===er.size&&H.size<2)return void es("Escolha as categorias que podem se combinar, ou selecione pelo menos 2 produtos.");if(new Set(en.map(C)).size>1)return void es("As categorias marcadas t\xeam regras de pre\xe7o diferentes. Deixe a estrat\xe9gia e a taxa iguais nelas antes de combin\xe1-las.");et(!0);let{error:e}=await (0,j.tF)({id:null==w?void 0:w.id,restaurant_id:E,name:D.trim(),max_flavors:2,price_strategy:R,split_fee:Number(T)||0,item_label_prefix:U.trim(),active:Z,products:Array.from(H.entries()).map(e=>{let[t,a]=e;return{product_id:t,half_price_override:null!=a&&a>0?Number(a):null}}),category_ids:Array.from(er)});if(et(!1),e)return void es("Erro ao salvar: "+e.message);G()};return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 backdrop-blur-sm",children:[(0,s.jsxs)("div",{className:"w-full sm:max-w-3xl bg-white rounded-t-3xl sm:rounded-3xl shadow-2xl overflow-hidden flex flex-col max-h-[92vh]",children:[(0,s.jsxs)("header",{className:"px-6 py-4 border-b border-border-brand flex items-center justify-between flex-shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-10 w-10 rounded-xl bg-primary-light text-primary flex items-center justify-center",children:(0,s.jsx)(i.A,{size:18,strokeWidth:2.4})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-base font-black text-text-main",children:W?"Novo grupo":"Editar grupo"}),(0,s.jsx)("p",{className:"text-xs text-text-sec",children:"Configure como esse combo Meio a Meio funciona"})]})]}),(0,s.jsx)("button",{onClick:I,className:"h-9 w-9 rounded-full hover:bg-bg-base flex items-center justify-center text-text-sec",children:(0,s.jsx)(l.A,{size:18})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-6",children:[(0,s.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-black uppercase tracking-widest text-text-sec mb-1.5",children:"Nome do grupo"}),(0,s.jsx)("input",{value:D,onChange:e=>L(e.target.value.slice(0,60)),placeholder:"Ex: Pizzas Grandes",className:"w-full rounded-xl border border-border-brand bg-white px-4 py-2.5 text-sm focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-black uppercase tracking-widest text-text-sec mb-1.5",children:["Prefixo do nome ",(0,s.jsx)("span",{className:"text-slate-400 normal-case font-medium",children:"(opcional)"})]}),(0,s.jsx)("input",{value:U,onChange:e=>Y(e.target.value.slice(0,30)),placeholder:"Pizza de",className:"w-full rounded-xl border border-border-brand bg-white px-4 py-2.5 text-sm focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20"}),(0,s.jsxs)("p",{className:"text-[10px] text-text-sec mt-1",children:["Usado no resumo do pedido: ",(0,s.jsxs)("span",{className:"font-bold",children:["Metade ",U||""," [sabor]"]})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[11px] font-black uppercase tracking-widest text-text-sec mb-2",children:"Sabores por item"}),(0,s.jsxs)("div",{className:"flex items-start gap-2.5 rounded-xl bg-primary-light px-3 py-2.5",children:[(0,s.jsx)(n.A,{size:15,className:"mt-0.5 shrink-0 text-primary"}),(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-main",children:["O cliente leva a pizza ",(0,s.jsx)("b",{children:"inteira"})," ou divide em ",(0,s.jsx)("b",{children:"duas metades iguais"}),". Onde o meio a meio n\xe3o deve aparecer, marque 1 sabor no tamanho, dentro da categoria."]})]})]}),er.size>0?(0,s.jsxs)("div",{className:"flex gap-2.5 rounded-xl bg-primary-light px-3 py-2.5",children:[(0,s.jsx)(n.A,{size:15,className:"mt-0.5 shrink-0 text-primary"}),(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-main",children:["A ",(0,s.jsx)("b",{children:"estrat\xe9gia de pre\xe7o"})," e a ",(0,s.jsx)("b",{children:"taxa por dividir"})," deste grupo v\xeam da categoria â hoje,"," ",(0,s.jsxs)("b",{children:[_[null!=(N=null==(t=en[0])?void 0:t.strategy)?N:"proportional"],(null!=(k=null==(a=en[0])?void 0:a.splitFee)?k:0)>
10?" \xb7 taxa ".concat(S(en[0].splitFee)):""]}),". Para mudar, abra o ",(0,s.jsx)("b",{children:"Gestor de card\xe1pio"}),", edite a categoria e procure"," ",(0,s.jsx)("b",{children:'"Quando o cliente divide ao meio"'}),"."]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[11px] font-black uppercase tracking-widest text-text-sec mb-2",children:"Estrat\xe9gia de pre\xe7o"}),(0,s.jsx)("div",{className:"grid sm:grid-cols-3 gap-2",children:["proportional","highest","average"].map(e=>{let t=R===e;return(0,s.jsxs)("button",{type:"button",onClick:()=>Q(e),className:"text-left rounded-xl p-3 border transition-all ".concat(t?"border-primary bg-primary-light":"border-border-brand bg-white hover:border-primary/30"),children:[(0,s.jsx)("p",{className:"text-sm font-black ".concat(t?"text-primary":"text-text-main"),children:_[e]}),(0,s.jsx)("p",{className:"text-[11px] text-text-sec mt-1 leading-relaxed",children:A[e]})]},e)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-[11px] font-black uppercase tracking-widest text-text-sec mb-2",children:["Taxa fixa por dividir ",(0,s.jsx)("span",{className:"text-slate-400 normal-case font-medium",children:"(opcional)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-40",children:(0,s.jsx)(v.A,{value:Number(T)||0,onValueChange:e=>V(Number(e)||0)})}),(0,s.jsx)("p",{className:"text-[11px] text-text-sec",children:"Cobrada s\xf3 quando o cliente combina 2+ sabores."})]})]})]}),el.length>0&&(0,s.jsxs)("div",{className:"mb-7",children:[(0,s.jsxs)("p",{className:"text-[11px] font-black uppercase tracking-widest text-text-sec mb-1",children:["Categorias que podem se combinar",er.size>0&&(0,s.jsxs)("span",{className:"text-primary normal-case font-bold ml-1",children:["(",er.size," marcadas)"]})]}),(0,s.jsx)("p",{className:"text-xs text-text-sec mb-3",children:"Marque duas ou mais e o cliente poder\xe1 pegar a outra metade em qualquer uma delas, sempre no mesmo tamanho. Marcando uma s\xf3, os sabores dela se combinam entre si."}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:el.map(e=>{let t=er.has(e.id),a=ec(e);return(0,s.jsxs)("button",{type:"button",disabled:a,title:a?"Regra de pre\xe7o diferente das categorias j\xe1 marcadas":void 0,onClick:()=>{let t;return t=e.id,ei(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:"flex items-center gap-3 rounded-xl border-2 px-3 py-2.5 text-left transition-all ".concat(t?"border-primary bg-primary-light":a?"border-border-brand bg-slate-50 opacity-55 cursor-not-allowed":"border-border-brand bg-white hover:border-primary/40"),children:[(0,s.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md border-2 ".concat(t?"border-primary bg-primary":"border-slate-300 bg-white"),children:t&&(0,s.jsx)(o.A,{size:13,className:"text-white",strokeWidth:4})}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block text-sm font-bold text-text-main truncate",children:e.name}),(0,s.jsxs)("span",{className:"block text-[11px] text-text-sec truncate",children:[_[e.strategy],e.splitFee>0?" \xb7 taxa ".concat(S(e.splitFee)):""]})]})]},e.id)})}),ed.length>0&&(0,s.jsxs)("div",{className:"mt-3 flex gap-2.5 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2.5",children:[(0,s.jsx)(n.A,{size:15,className:"mt-0.5 shrink-0 text-amber-600"}),(0,s.jsxs)("div",{className:"text-[11px] leading-relaxed text-text-main",children:[(0,s.jsx)("p",{className:"font-bold",children:"Nem todo tamanho vai combinar."}),(0,s.jsx)("ul",{className:"mt-1 space-y-0.5",children:ed.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:e.name})," s\xf3 existe em ",e.em.join(", ")," â nesse tamanho o cliente ver\xe1 apenas os sabores de ",(e.em.length,"l\xe1"),"."]},e.id))}),(0,s.jsx)("p",{className:"mt-1.5 text-text-sec",children:"Para o meio a meio valer no tamanho todo, cadastre-o tamb\xe9m nas outras categorias marcadas."})]})]}),el.some(e=>ec(e))&&(0,s.jsxs)("div",{className:"mt-3 flex gap-2.5 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2.5",children:[(0,s.jsx)(n.A,{size:15,className:"mt-0.5 shrink-0 text-slate-500"}),(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-main",children:["As categorias apagadas t\xeam ",(0,s.jsx)("b",{children:"regra de pre\xe7o diferente"})," das que voc\xea marcou. Mistur\xe1-las faria a mesma pizza custar dois valores, dependendo de qual metade o cliente escolhesse primeiro. Para junt\xe1-las, deixe a estrat\xe9gia e a taxa iguais nas duas â isso se ajusta dentro de cada categoria, no gestor do card\xe1pio."]})]}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2.5 rounded-xl bg-primary-light px-3 py-2.5",children:[(0,s.jsx)(n.A,{size:15,className:"mt-0.5 shrink-0 text-primary"}),(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-main",children:["O tamanho amarra pelo ",(0,s.jsx)("b",{children:"cadastro"}),': a "Grande" de uma categoria combina com a "Grande" da outra. Categoria que n\xe3o tenha aquele tamanho n\xe3o aparece ali. Ca
1da sabor mant\xe9m o pre\xe7o da ',(0,s.jsx)("b",{children:"sua pr\xf3pria"})," categoria, ent\xe3o meia premium continua custando premium."]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("p",{className:"text-[11px] font-black uppercase tracking-widest text-text-sec",children:["Produtos no grupo ",(0,s.jsxs)("span",{className:"text-primary normal-case font-bold ml-1",children:["(",H.size," selecionados)"]})]})}),el.length>0&&(0,s.jsxs)("p",{className:"mb-3 text-xs text-text-sec",children:["S\xf3 para categorias ",(0,s.jsx)("b",{children:"sem"})," tamanho. Se voc\xea marcou categorias acima, pode deixar esta lista vazia."]}),(0,s.jsxs)("div",{className:"relative mb-3",children:[(0,s.jsx)(c.A,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),(0,s.jsx)("input",{value:J,onChange:e=>K(e.target.value),placeholder:"Buscar produto...",className:"w-full rounded-xl border border-border-brand bg-white pl-10 pr-4 py-2.5 text-sm focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{className:"max-h-72 overflow-y-auto border border-border-brand rounded-xl divide-y divide-slate-100",children:[0===eb.length&&(0,s.jsx)("p",{className:"p-6 text-center text-sm text-text-sec",children:"Nenhum produto encontrado."}),eb.map(e=>{let t=H.has(e.id),a=H.get(e.id);return(0,s.jsx)("div",{className:"px-3 py-2.5",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void $(e=>{let a=new Map(e);return a.has(t)?a.delete(t):a.set(t,null),a})},className:"w-5 h-5 rounded-md border-2 flex shrink-0 items-center justify-center transition-colors ".concat(t?"border-primary bg-primary":"border-slate-300 bg-white"),children:t&&(0,s.jsx)(o.A,{size:13,className:"text-white",strokeWidth:3.5})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-text-main truncate",children:e.name}),e.category_id&&q.some(t=>t.id===e.category_id&&t.hasSizes)?(0,s.jsx)("p",{className:"text-[11px] font-semibold text-amber-700",children:"Vende por tamanho â o pre\xe7o sai da grade da categoria"}):(0,s.jsxs)("p",{className:"text-[11px] text-text-sec",children:["Inteira: ",S(P(e)),"proportional"===R&&!t&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 Sugest\xe3o metade: ",S(P(e)/2)]})]})]}),t&&(0,s.jsxs)("button",{type:"button",onClick:()=>em(e),className:"inline-flex shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-[11px] font-bold transition-colors ".concat(e.image_url?"border-border-brand text-text-sec hover:border-primary hover:text-primary":"border-dashed border-border-brand text-text-sec/60"),title:e.image_url?"Ajustar como a foto aparece na metade":"Produto sem foto",children:[(0,s.jsx)(d.A,{size:12}),eh(e)?"Foto ajustada":"Ajustar foto"]}),t&&"proportional"===R&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-text-sec uppercase tracking-wider whitespace-nowrap",children:"Meia por:"}),(0,s.jsx)("div",{className:"w-24",children:(0,s.jsx)(v.A,{value:null!=a?a:0,onValueChange:t=>{var a,s;return a=e.id,s=Number(t)||null,void $(e=>{let t=new Map(e);return t.has(a)&&t.set(a,s),t})},placeholder:S(P(e)/2),allowEmpty:!0})})]})]})},e.id)})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-sec mt-2 leading-relaxed",children:"proportional"===R?(0,s.jsx)(s.Fragment,{children:'Deixe "Meia por" em branco para usar a estrat\xe9gia padr\xe3o. Quando definido, esse valor \xe9 o pre\xe7o de 1/2; para 1/3 ou 1/4, o sistema rateia proporcional.'}):(0,s.jsxs)(s.Fragment,{children:["Nesta estrat\xe9gia o pre\xe7o vem ","highest"===R?"do sabor mais caro":"da m\xe9dia dos sabores",', ent\xe3o n\xe3o h\xe1 pre\xe7o por metade para cadastrar. Mude para "Metade de cada" se quiser definir um valor por sabor.']})})]}),eg&&(0,s.jsxs)("div",{className:"rounded-xl border border-primary/20 bg-primary-light p-4",children:[(0,s.jsx)("p",{className:"text-[10px] font-black uppercase tracking-widest text-primary mb-2",children:"Preview do cliente"}),(0,s.jsx)("div",{className:"space-y-1",children:eg.picks.map((e,t)=>(0,s.jsxs)("p",{className:"text-sm text-text-main",children:[2===eg.picks.length?"Metade":"1/".concat(eg.picks.length)," ",U&&(0,s.jsxs)("span",{children:[U," "]}),(0,s.jsx)("strong",{children:e.product.name}),"proportional"===R&&(0,s.jsxs)("span",{className:"text-text-sec",children:[" â ",S(e.fractionPrice)]})]},t))}),(0,s.jsxs)("p",{className:"text-base font-black text-primary mt-2",children:["Cliente paga: ",S(eg.totalPrice)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:Z,onChange:e=>X(e.target.checked),className:"sr-only peer"}),(0,s.jsx)("div",{className:"w-11 h-6 bg-slate-200 rounded-full peer peer-checked:bg-primary transition-colors after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-transform peer-checked:after:translate-x-5"})]}),(0,s.jsx)("span",{className:"text-sm font-bold text-text-main",children:Z?"Grupo ativo (cliente v\xea o bot\xe3o Meio a meio)":"Grupo desativado"})]}),ea&&(0,s.jsx)("div",{className:"rounded-xl bg-red-50 border border-red-200 px-4 py-2.5 text-sm font-bold text-red-700",children:ea})]}),(0,s.jsxs)("footer",{className:"px-6 py-4 border-t border-border-brand bg-bg-base flex items-center justify-end gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:I,className:"px-4 py-2.5 rounded-xl text-sm font-bold text-text-sec hover:bg-white",children:"Cancelar"}),(0,s.jsxs)("button",{onClick:ef,disabled:ee,className:"bg-primary text-white font-bold px-5 py-2.5 rounded-xl hover:bg-primary-dark transition-all flex items-center gap-2 disabled:opacity-60",children:[ee?(0,s.jsx)(x.A,{size:16,className:"animate-spin"}):null,ee?"Salvando...":W?"Criar grupo":"Salvar altera\xe7\xf5es"]})]})]}),ex&&(0,s.jsx)(z,{produto:{id:ex.id,name:ex.name,image:ex.image_url,mix_photo_adjust:eh(ex)},parceiro:(()=>{let e=M.find(e=>e.id!==ex.id&&H.has(e.id));return e?{id:e.id,name:e.name,image:e.image_url,mix_photo_adjust:eh(e)}:null})(),restaurantId:E,onClose:()=>em(null),onSaved:e=>{eu(t=>new Map(t).set(ex.id,e)),em(null)}})]})}function E(){var e,t;let{restaurantId:a}=(0,y.p)(),[l,o]=(0,r.useState)([]),[c,d]=(0,r.useState)([]),[v,N]=(0,r.useState)([]),[k,w]=(0,r.useState)([]),M=(0,r.useMemo)(()=>new Map(k.map(e=>[e.id,e.name])),[k]),z=v.some(e=>e.hasSizes),[C,A]=(0,r.useState)(null),[P,E]=(0,r.useState)(!0),[I,G]=(0,r.useState)(null),[W,D]=(0,r.useState)(null),[L,O]=(0,r.useState)(!1),B=async()=>{var e,t,s;if(!a)return;E(!0);let[r,i,l,n,c]=await Promise.all([(0,j.fs)(a),(0,j.eN)(a),(0,j.BG)(a),(0,j.jE)(a),(0,j.fW)(a,{asAdmin:!0})]);o(r),d(i);let x=new Set(c.map(e=>e.category_id)),m=new Map;for(let t of c){let a=null!=(e=m.get(t.category_id))?e:[];a.push(t.definition_id),m.set(t.category_id,a)}N((null!=n?n:[]).filter(e=>e.id).map(e=>{var t,a;return{id:String(e.id),name:String(e.name),hasSizes:x.has(String(e.id)),strategy:null!=(t=e.flavor_price_strategy)?t:"proportional",splitFee:Number(e.split_fee)||0,sizeDefinitionIds:null!=(a=m.get(String(e.id)))?a:[]}}));let p=new Map;for(let e of c){let a=p.get(e.definition_id);p.set(e.definition_id,{name:e.name,categorias:(null!=(t=null==a?void 0:a.categorias)?t:0)+1,divide:null!=(s=null==a?void 0:a.divide)&&s||e.max_flavors>=2})}w([...p.entries()].map(e=>
1{let[t,a]=e;return{id:t,name:a.name,categorias:a.categorias}})),A(l),E(!1)};(0,r.useEffect)(()=>{B()},[a]);let R=(0,r.useMemo)(()=>{let e=new Map;for(let t of c)e.set(t.id,t.name);return e},[c]),Q=async()=>{W&&a&&(O(!0),await (0,j.L4)(W.id,a),O(!1),D(null),B())};return(0,s.jsxs)("div",{className:"flex-1 flex flex-col bg-bg-base",children:[(0,s.jsx)("header",{className:"px-6 lg:px-10 pt-8 pb-6 border-b border-border-brand bg-white max-md:px-4 max-md:pb-4 max-md:pt-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-4 max-w-6xl",children:[(0,s.jsx)("div",{className:"h-12 w-12 rounded-2xl bg-primary-light text-primary flex items-center justify-center flex-shrink-0 max-md:hidden",children:(0,s.jsx)(m.A,{size:24,strokeWidth:2.4})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h1",{className:"text-2xl font-black text-text-main tracking-tight font-[family-name:var(--font-heading)] max-md:text-xl",children:"Meio a Meio"}),(0,s.jsx)("p",{className:"text-sm text-text-sec mt-1 leading-relaxed",children:z?(0,s.jsxs)(s.Fragment,{children:["Como as suas pizzas est\xe3o vendendo. A configura\xe7\xe3o mora no"," ",(0,s.jsx)("span",{className:"font-bold",children:"Gestor de card\xe1pio"}),": abra a categoria e procure"," ",(0,s.jsx)("span",{className:"font-bold text-primary",children:'"Quando o cliente divide ao meio"'}),"."]}):(0,s.jsxs)(s.Fragment,{children:["Para loja que n\xe3o trabalha com tamanhos: agrupe os produtos que podem ser combinados num pedido s\xf3. O cliente ver\xe1 um bot\xe3o"," ",(0,s.jsx)("span",{className:"font-bold text-primary",children:'"Meio a meio"'})," no card do produto."]})})]}),!z&&(0,s.jsxs)("button",{onClick:()=>G({initial:null}),disabled:!a||0===c.length,className:"flex items-center gap-2 rounded-xl bg-primary text-white font-bold px-4 py-2.5 hover:bg-primary-dark transition-all disabled:opacity-50",children:[(0,s.jsx)(p.A,{size:18,strokeWidth:2.5}),"Novo grupo"]})]})}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto px-6 lg:px-10 py-6 max-md:px-0 max-md:py-4",children:(0,s.jsxs)("div",{className:"max-w-6xl space-y-6",children:[(0,s.jsxs)("section",{className:"grid sm:grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"bg-white rounded-2xl border border-border-brand p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(u.A,{size:14,className:"text-primary"}),(0,s.jsx)("p",{className:"text-[10px] font-black uppercase tracking-widest text-text-sec",children:"Pedidos Meio a Meio \xb7 \xfaltimos 30d"})]}),(0,s.jsx)("p",{className:"text-3xl font-black text-text-main",children:null!=(e=null==C?void 0:C.totalOrders)?e:0}),(0,s.jsx)("div",{className:"mt-3",children:(null==C?void 0:C.series)?(0,s.jsx)(q,{series:C.series}):null})]}),(0,s.jsxs)("div",{className:"bg-white rounded-2xl border border-border-brand p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(h.A,{size:14,className:"text-primary"}),(0,s.jsx)("p",{className:"text-[10px] font-black uppercase tracking-widest text-text-sec",children:"Faturamento dividido \xb7 30d"})]}),(0,s.jsx)("p",{className:"text-3xl font-black text-text-main",children:S(null!=(t=null==C?void 0:C.totalRevenue)?t:0)}),(0,s.jsx)("p",{className:"text-[11px] text-text-sec mt-2",children:"Soma do total cobrado em itens Meio a Meio."})]}),(0,s.jsxs)("div",{className:"bg-white rounded-2xl border border-border-brand p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(b.A,{size:14,className:"text-primary"}),(0,s.jsx)("p",{className:"text-[10px] font-black uppercase tracking-widest text-text-sec",children:"Top 3 combina\xe7\xf5es"})]}),(null==C?void 0:C.topCombos)&&C.topCombos.length>0?(0,s.jsx)("ol",{className:"space-y-1.5 mt-2",children:C.topCombos.map((e,t)=>(0,s.jsxs)("li",{className:"text-sm text-text-main flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[10px] font-black text-primary bg-primary-light w-5 h-5 rounded-full flex items-center justify-center",children:t+1}),(0,s.jsx)("span",{className:"flex-1 truncate font-bold",children:e.names.join(" + ")}),(0,s.jsxs)("span",{className:"text-xs text-text-sec tabular-nums",children:[e.count,"x"]})]},t))}):(0,s.jsx)("p",{className:"text-xs text-text-sec mt-2 leading-relaxed",children:"Sem combina\xe7\xf5es ainda. Quando os clientes come\xe7arem a pedir, aparecem aqui."})]})]}),(0,s.jsxs)("section",{className:"space-y-3",children:[P&&(0,s.jsx)("div",{className:"rounded-2xl border border-border-brand bg-white p-8 text-center text-sm text-text-sec",children:"Carregando grupos..."}),!P&&0===l.length&&(0,s.jsxs)("div",{className:"rounded-2xl border border-dashed border-border-brand bg-white p-10 text-center",children:[(0,s.jsx)(m.A,{className:"mx-auto mb-3 text-text-sec",size:32,strokeWidth:1.5}),z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-base font-black text-text-main",children:"N\xe3o falta nada aqui"}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-text-sec",children:["Suas pizzas j\xe1 divi
1dem ao meio: quem vende por tamanho tem isso resolvido dentro da categoria, sem grupo nenhum. Para mudar quem divide, de onde vem a outra metade ou quanto custa, abra o ",(0,s.jsx)("b",{children:"Gestor de card\xe1pio"})," e edite a categoria."]}),(0,s.jsx)("button",{onClick:()=>G({initial:null}),disabled:0===c.length,className:"mt-4 text-[11px] font-bold text-text-sec underline decoration-border-brand underline-offset-2 hover:text-text-main disabled:opacity-50",children:"Criar um grupo por produtos (avan\xe7ado)"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-base font-black text-text-main",children:"Nenhum grupo Meio a Meio ainda"}),(0,s.jsx)("p",{className:"text-sm text-text-sec mt-1",children:"Sua loja n\xe3o trabalha com tamanhos, ent\xe3o o grupo \xe9 o caminho para o cliente poder dividir: junte aqui os produtos que se combinam."}),(0,s.jsxs)("button",{onClick:()=>G({initial:null}),disabled:0===c.length,className:"mt-4 inline-flex items-center gap-2 rounded-xl bg-primary text-white font-bold px-4 py-2.5 hover:bg-primary-dark transition-all disabled:opacity-50",children:[(0,s.jsx)(p.A,{size:18,strokeWidth:2.5}),"Criar primeiro grupo"]}),0===c.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-sec mt-3",children:"Cadastre alguns produtos primeiro em Gest\xe3o de Produtos â Produtos."})]})]}),!P&&l.map(e=>{var t,a,r;return(0,s.jsxs)("article",{className:"rounded-2xl border bg-white p-5 transition-all ".concat(e.active?"border-primary/20 shadow-[0_4px_16px_rgba(26,86,219,0.06)]":"border-border-brand opacity-80"),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"h-11 w-11 rounded-xl flex items-center justify-center flex-shrink-0 ".concat(e.active?"bg-primary text-white":"bg-bg-base text-text-sec"),children:(0,s.jsx)(i.A,{size:20,strokeWidth:2.4})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-base font-black text-text-main truncate",children:e.name}),(null!=(a=null==(t=e.category_ids)?void 0:t.length)?a:0)>0?(0,s.jsxs)("p",{className:"text-xs text-text-sec mt-0.5",children:[(null!=(r=e.category_ids)?r:[]).map(e=>{var t;return null==(t=v.find(t=>t.id===e))?void 0:t.name}).filter(Boolean).join(" + ")||"categorias removidas"," ","\xb7 configurado na categoria"]}):(0,s.jsxs)("p",{className:"text-xs text-text-sec mt-0.5",children:[e.products.length," produtos \xb7 at\xe9 ",e.max_flavors," sabores \xb7"," ",_[e.price_strategy],e.split_fee>0&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 taxa ",S(e.split_fee)]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[!e.active&&(0,s.jsx)("span",{className:"text-[10px] font-black text-text-sec bg-bg-base px-2 py-1 rounded-full uppercase tracking-wider",children:"Inativo"}),(0,s.jsx)("button",{onClick:()=>G({initial:e}),className:"h-9 w-9 rounded-lg hover:bg-bg-base flex items-center justify-center text-text-sec",title:"Editar",children:(0,s.jsx)(g.A,{size:15})}),(0,s.jsx)("button",{onClick:()=>D(e),className:"h-9 w-9 rounded-lg hover:bg-red-50 hover:text-red-600 flex items-center justify-center text-text-sec",title:"Excluir",children:(0,s.jsx)(f.A,{size:15})})]})]}),e.products.length>0&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.products.slice(0,6).map(e=>{var t;return(0,s.jsxs)("span",{className:"text-[11px] font-bold text-text-sec bg-bg-base px-2 py-1 rounded-full",children:[null!=(t=R.get(e.product_id))?t:"â",null!=e.half_price_override&&(0,s.jsxs)("span",{className:"text-primary ml-1",children:["\xb7 meia ",S(e.half_price_override)]})]},e.product_id)}),e.products.length>6&&(0,s.jsxs)("span",{className:"text-[11px] font-bold text-text-sec px-2 py-1",children:["+",e.products.length-6," produtos"]})]})]},e.id)})]}),(0,s.jsx)("section",{className:"rounded-2xl bg-primary-light border border-primary/20 p-5 max-md:p-4",children:(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(n.A,{size:18,className:"text-primary flex-shrink-0 mt-0.5"}),(0,s.jsx)("div",{className:"text-xs text-text-main leading-relaxed",children:z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-bold mb-1",children:"Onde fica cada coisa"}),(0,s.jsxs)("ul",{className:"space-y-1 list-disc pl-4",children:[(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:"Quais tamanhos dividem"}),", ",(0,s.jsx)("b",{children:"de onde vem a outra metade"})," e"," ",(0,s.jsx)("b",{children:"quanto custa a metade"}),": Gestor de card\xe1pio â edite a categoria."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:"Pre\xe7o de cada sabor em cada tamanho"})," e o ",(0,s.jsx)("b",{children:'"Meia por"'}),": Gestor de card\xe1pio â categoria â Pre\xe7os por tamanho."]}),(0,s.jsx)("li",{children:"Esta tela: como o meio a meio est\xe1 vendendo."})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-bold mb-1",children:"Como organizar"}),(0,s.jsxs)("ul",{className:"space-y-1 list-disc pl-4",children:[(0,s.jsx)("li",{children:'Crie um grupo por tamanho (ex: "Pizzas Grandes" e "Pizzas M\xe9dias" separados).'}),(0,s.jsx)("li",{children:"Um mesmo produto pode estar em mais de um grupo."}),(0,s.jsx)("li",{children:'Em "Meia por" voc\xea pode dar desconto espec\xedfico para o sabor quando entrar como metade.'})]})]})})]})})]})}),I&&a&&(0,s.jsx)(F,{initial:I.initial,products:c,categories:v,sizeNames:M,restaurantId:a,onClose:()=>G(null),onSaved:()=>{G(null),B()}}),W&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl max-w-sm w-full p-6 shadow-2xl",children:[(0,s.jsx)("h3",{className:"text-base font-black text-text-main",children:"Excluir grupo?"}),(0,s.jsxs)("p",{className:"text-sm text-text-sec mt-2",children:['O grupo "',(0,s.jsx)("strong",{children:W.name}),'" ser\xe1 removido e o bot\xe3o Meio a Meio some dos produtos que pertenciam s\xf3 a este grupo. Os produtos em si n\xe3o s\xe3o apagados.']}),(0,s.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>D(null),className:"px-4 py-2 rounded-xl text-sm font-bold text-text-sec hover:bg-bg-base",children:"Cancelar"}),(0,s.jsxs)("button",{onClick:Q,disabled:L,className:"px-4 py-2 rounded-xl bg-red-600 text-white font-bold hover:bg-red-700 transition-all flex items-center gap-2 disabled:opacity-60",children:[L?(0,s.jsx)(x.A,{size:14,className:"animate-spin"}):(0,s.jsx)(f.A,{size:14}),"Excluir"]})]})]})})]})}},89733:(e,t,a)=>{a.d(t,{s:()=>o});var s=a(95155),r=a(12115);function i(e){let t=e>>>0||1;return()=>(t=1664525*t+0x3c6ef35f>>>0)/0x100000000}function l(e,t,a){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5.5,n=i(e),o=[];for(let e=0;e<r;e++){let i=e/r*Math.PI*2+.1*n(),c=t-.75*l;o.push((0,s.jsx)("circle",{cx:150+Math.cos(i)*c,cy:150+Math.sin(i)*c,r:l*(.7+.6*n()),fill:a},e))}return o}function n(e){let{seed:t}=e,a=i(t),r=t%3,n=[];for(let e=0;e<26;e++){let t=a()*Math.PI*2,r=113+16*a(),i=150+Math.cos(t)*r,l=150+Math.sin(t)*r,o=3+6*a();n.push((0,s.jsx)("ellipse",{cx:i,cy:l,rx:o,ry:.7*o,fill:"#8a5116",opacity:.12+.36*a()},e))}let o=[];for(let e=0;e<22;e++){let t=a()*Math.PI*2,r=91*Math.sqrt(a());o.push((0,s.jsx)("ellipse",{cx:150+Math.cos(t)*r,cy:150+Math.sin(t)*r,rx:5+10*a(),ry:4+7*a(),fill:"#fff2cc",opacity:.26+.32*a()},e))}let c=[],d=0===r?9:1===r?7:8;for(let e=0;e<d;e++){let t=a()*Math.PI*2,i=18+76*Math.sqrt(a()),l=150+Math.cos(t)*i,n=150+Math.sin(t)*i;0===r?c.push((0,s.jsxs)("g",{children:[(0,s.jsx)("ellipse",{cx:l,cy:n+2.4,rx:14,ry:13,fill:"#000",opacity:.2}),(0,s.jsx)("circle",{cx:l,cy:n,r:14,fill:"#9c2317"}),(0,s.jsx)("circle",{cx:l,cy:n,r:12.6,fill:"#c3392a"}),(0,s.jsx)("ellipse",{cx:l-4,cy:n-5,rx:4.6,ry:2.8,fill:"#e0705d",opacity:.4})]},e)):1===r?c.push((0,s.jsxs)("g",{transform:"rotate(".concat(90*a()-45," ").concat(l," ").concat(n,")"),children:[(0,s.jsx)("ellipse",{cx:l,cy:n+2,rx:15,ry:11,fill:"#000",opacity:.14}),(0,s.jsx)("ellipse",{cx:l,cy:n,rx:15,ry:11,fill:"#f6f1de"}),(0,s.jsx)("circle",{cx:l-4,cy:n-2,r:2.3,fill:"#6b8f6f"}),(0,s.jsx)("circle",{cx:l+5,cy:n+3,r:1.8,fill:"#6b8f6f"})]},e)):c.push((0,s.jsxs)("g",{transform:"translate(".concat(l," ").concat(n,") rotate(").concat(360*a(),")"),children:[(0,s.jsx)("path",{d:"M0,-13 C10,-8 10,8 0,13 C-10,8 -10,-8 0,-13 Z",fill:"#2f7d32"}),(0,s.jsx)("path",{d:"M0,-11 L0,11",stroke:"#1b5e20",strokeWidth:1.1,opacity:.7})]},e))}return(0,s.jsxs)("g",{children:[(0,s.jsx)("circle",{cx:150,cy:150,r:128,fill:"#dda451"}),l(t+3,128,"#dda451"),(0,s.jsx)("circle",{cx:150,cy:150,r:124,fill:"#e8b662"}),n,(0,s.jsx)("circle",{cx:150,cy:150,r:108,fill:"#a8291a"}),(0,s.jsx)("circle",{cx:150,cy:150,r:103,fill:"#f2c25c"}),l(t+7,105,"#eeb949",44,4.5),o,c]})}function o(e){var t,a;let{slices:i,size:l=176,className:o}=e,c=(0,r.useId)().replace(/:/g,""),d=Math.max(1,i.length);return(0,s.jsxs)("svg",{width:l,height:l,viewBox:"0 0 ".concat(300," ").concat(300),className:o,role:"img","aria-label":i.filter(
1Boolean).length>1?"Pizza dividida: ".concat(i.map(e=>{var t;return null!=(t=null==e?void 0:e.name)?t:"sabor n\xe3o escolhido"}).join(", ")):null!=(a=null==(t=i[0])?void 0:t.name)?a:"Pizza",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("radialGradient",{id:"luz".concat(c),cx:"34%",cy:"26%",r:"76%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.42"}),(0,s.jsx)("stop",{offset:"62%",stopColor:"#fff",stopOpacity:"0.04"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#3a1e05",stopOpacity:"0.26"})]}),i.map((e,t)=>(0,s.jsx)("clipPath",{id:"fatia".concat(c,"-").concat(t),children:(0,s.jsx)("path",{d:function(e,t,a){if(t<=1)return"M ".concat(20," ").concat(150," A ").concat(a," ").concat(a," 0 1 1 ").concat(150+a," ").concat(150," A ").concat(a," ").concat(a," 0 1 1 ").concat(150-a," ").concat(150," Z");let s=e/t*2*Math.PI-Math.PI/2,r=(e+1)/t*2*Math.PI-Math.PI/2,i=150+a*Math.cos(s),l=150+a*Math.sin(s),n=150+a*Math.cos(r),o=150+a*Math.sin(r),c=+(r-s>Math.PI);return"M ".concat(150," ").concat(150," L ").concat(i," ").concat(l," A ").concat(a," ").concat(a," 0 ").concat(c," 1 ").concat(n," ").concat(o," Z")}(t,d,130)})},t))]}),(0,s.jsx)("ellipse",{cx:150,cy:157,rx:132,ry:128,fill:"#0f172a",opacity:.16}),i.map((e,t)=>{var a,r,i;if(!e)return(0,s.jsxs)("g",{clipPath:"url(#fatia".concat(c,"-").concat(t,")"),children:[(0,s.jsx)("circle",{cx:150,cy:150,r:128,fill:"#f1f5f9"}),(0,s.jsx)("circle",{cx:150,cy:150,r:103,fill:"#e2e8f0"})]},t);let l=function(e){let t=0x811c9dc5;for(let a=0;a<e.length;a++)t^=e.charCodeAt(a),t=Math.imul(t,0x1000193);return t>>>0}(e.id||e.name);if(!e.image)return(0,s.jsx)("g",{clipPath:"url(#fatia".concat(c,"-").concat(t,")"),children:(0,s.jsx)(n,{seed:l})},t);let o=Math.max(1,Math.min(3,Number(null==(a=e.adjust)?void 0:a.zoom)||1)),d=128*Math.max(-1,Math.min(1,Number(null==(r=e.adjust)?void 0:r.x)||0)),x=128*Math.max(-1,Math.min(1,Number(null==(i=e.adjust)?void 0:i.y)||0)),m=256*o;return(0,s.jsxs)("g",{clipPath:"url(#fatia".concat(c,"-").concat(t,")"),children:[(0,s.jsx)("circle",{cx:150,cy:150,r:128,fill:"#1c1410"}),(0,s.jsx)("image",{href:e.image,x:150-128*o+d,y:150-128*o+x,width:m,height:m,preserveAspectRatio:"xMidYMid slice"})]},t)}),d>1&&Array.from({length:d}).map((e,t)=>{let a=t/d*2*Math.PI-Math.PI/2,r=150+129*Math.cos(a),i=150+129*Math.sin(a);return(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:150,y1:150,x2:r,y2:i,stroke:"#0f172a",strokeWidth:6,opacity:.28,strokeLinecap:"round"}),(0,s.jsx)("line",{x1:150,y1:150,x2:r,y2:i,stroke:"#fffaf0",strokeWidth:3,opacity:.95,strokeLinecap:"round"})]},t)}),(0,s.jsx)("circle",{cx:150,cy:150,r:128,fill:"url(#luz".concat(c,")"),style:{mixBlendMode:"soft-light"}}),(0,s.jsx)("circle",{cx:150,cy:150,r:128,fill:"none",stroke:"#7a4a12",strokeWidth:2.5,opacity:.42}),(0,s.jsx)("circle",{cx:150,cy:150,r:126.5,fill:"none",stroke:"#fff",strokeWidth:1,opacity:.18})]})}},96047:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("pizza",[["path",{d:"m12 14-1 1",key:"11onhr"}],["path",{d:"m13.75 18.25-1.25 1.42",key:"1yisr3"}],["path",{d:"M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12",key:"1qtqk6"}],["path",{d:"M18.8 9.3a1 1 0 0 0 2.1 7.7",key:"fbbbr2"}],["path",{d:"M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z",key:"1hyfdd"}]])}}]);
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.