1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1318],{3838:(e,a,l)=>{"use strict";function r(e){if(!e)return null;let a=String(e).replace(/\D/g,"");return a?a.startsWith("55")&&(12===a.length||13===a.length)?a:10===a.length||11===a.length?`55${a}`:a.length>=11&&a.length<=15?a:null:null}l.d(a,{m:()=>r})},16075:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},16076:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},28113:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},28956:(e,a,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/nutricionista/pacientes/[id]/antropometria/novo",function(){return l(73722)}])},32257:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},34297:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]])},35739:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},45691:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},70948:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},73722:(e,a,l)=>{"use strict";l.r(a),l.d(a,{default:()=>I});var r=l(37876),t=l(14232),i=l(48230),n=l.n(i),o=l(89099),s=l(59724),d=l(72827),c=l(15493),u=l(4270),p=l(14439),m=l(15365),x=l(66253),g=l(21929),h=l(84250),f=l(79503),b=l(72502),y=l(58725),j=l(16076),v=l(16075),_=l(70948),S=l(35739),M=l(3381),k=l(34297);let A={jp3:{label:"3 Pregas (Jackson & Pollock)",folds:{M:["peitoral","abdominal","coxa"],F:["triceps","suprail\xedaca","coxa"]},calc:(e,a,l)=>{let r=e.reduce((e,a)=>e+a,0);return"M"===l?(4.95/(1.10938-8267e-7*r+16e-7*r**2-2574e-7*a)-4.5)*100:(4.95/(1.0994921-9929e-7*r+23e-7*r**2-1392e-7*a)-4.5)*100}},jp7:{label:"7 Pregas (Jackson & Pollock)",folds:{M:["peitoral","axilar_media","triceps","subescapular","abdominal","suprail\xedaca","coxa"],F:["peitoral","axilar_media","triceps","subescapular","abdominal","suprail\xedaca","coxa"]},calc:(e,a,l)=>{let r=e.reduce((e,a)=>e+a,0);return"M"===l?(4.95/(1.112-43499e-8*r+55e-8*r**2-28826e-8*a)-4.5)*100:(4.95/(1.097-46971e-8*r+56e-8*r**2-12828e-8*a)-4.5)*100}},dw4:{label:"4 Pregas (Durnin & Womersley)",folds:{M:["biceps","triceps","subescapular","suprail\xedaca"],F:["biceps","triceps","subescapular","suprail\xedaca"]},calc:(e,a,l)=>{let r=Math.log10(e.reduce((e,a)=>e+a,0));return(4.95/("M"===l?a<20?1.162-.063*r:a<30?1.1631-.0632*r:a<40?1.1422-.0544*r:a<50?1.162-.07*r:1.1715-.0779*r:a<20?1.1549-.0678*r:a<30?1.1599-.0717*r:a<40?1.1423-.0632*r:a<50?1.1333-.0612*r:1.1339-.0645*r)-4.5)*100}},guedes3:{label:"3 Pregas (Guedes)",folds:{M:["triceps","suprail\xedaca","abdominal"],F:["triceps","suprail\xedaca","coxa"]},calc:(e,a,l)=>{let r=e.reduce((e,a)=>e+a,0);return"M"===l?(4.95/(1.17136-.06706*Math.log10(r))-4.5)*100:(4.95/(1.1665-.07063*Math.log10(r))-4.5)*100}},petroski4:{label:"4 Pregas (Petroski)",folds:{M:["triceps","subescapular","suprail\xedaca","panturrilha"],F:["triceps","subescapular","suprail\xedaca","panturrilha"]},calc:(e,a,l)=>{let r=e.reduce((e,a)=>e+a,0);return"M"===l?(4.95/(1.10726863-81201e-8*r+212e-8*r**2-41761e-8*a)-4.5)*100:(4.95/(1.02902361-67159e-8*r+242e-8*r**2-26073e-8*a)-4.5)*100}},faulkner:{label:"Faulkner (Atletas)",folds:{M:["triceps","subescapular","suprail\xedaca","abdominal"],F:["triceps","subescapular","suprail\xedaca","abdominal"]},calc:e=>5.783+.153*e.reduce((e,a)=>e+a,0)}},C={biceps:"B\xedceps",triceps:"Tr\xedceps",peitoral:"Peitoral",axilar_media:"Axilar M\xe9dia",subescapular:"Subescapular",suprailÃaca:"Suprail\xedaca",abdominal:"Abdominal",coxa:"Coxa",panturrilha:"Panturrilha Medial"},P={fontSize:12,fontWeight:500,color:"#6b5e50",marginBottom:4,display:"block"},z={fontSize:13,fontWeight:600,color:"#2d2419",marginBottom:10,paddingBottom:6,borderBottom:"1px solid #e8e2da"};function B(e){let a=String(e||"").trim().toLocaleLowerCase("pt-BR");return["m","masculino","male","homem"].includes(a)?"M":["f","feminino","female","mulher"].includes(a)?"F":""}function w(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,l=(0,g.d)(e);
1return null===l?null:l.toLocaleString("pt-BR",{minimumFractionDigits:a,maximumFractionDigits:a})}function N(e){let{title:a,open:l,onToggle:t,children:i}=e;return(0,r.jsxs)("div",{className:"nutri-card",style:{marginBottom:16},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",marginBottom:12*!!l},onClick:t,children:[(0,r.jsx)("h3",{style:{fontSize:15,fontWeight:600,color:"#2d2419",margin:0},children:a}),(0,r.jsx)("button",{style:{fontSize:12,color:"var(--nn-gold)",fontWeight:500,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer"},children:l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.A,{size:14})," Ocultar"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.A,{size:14})," Exibir"]})})]}),l&&(0,r.jsx)("div",{style:{marginTop:8},children:i})]})}function F(e){let{label:a,value:l,onChange:i,onBlur:n,placeholder:o,suffix:s,required:d}=e,c=t.useId();return(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:c,style:{...P,fontWeight:d?600:500},children:[a,d&&" *"]}),(0,r.jsxs)("div",{style:{position:"relative"},children:[(0,r.jsx)("input",{id:c,className:"nutri-input",type:"text",inputMode:"decimal",pattern:"[0-9]*[.,]?[0-9]*",value:l??"",onChange:e=>i(e.target.value),onBlur:n,placeholder:o||"Sem registro",style:{fontSize:13,padding:"8px 12px",width:"100%"}}),s&&(0,r.jsx)("span",{style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",fontSize:11,color:"#a09484"},children:s})]})]})}function I(){let e=(0,o.useRouter)(),{id:a,edit:i}=e.query,y=Array.isArray(a)?a[0]:a,j=Array.isArray(i)?i[0]:i,I=!!j,{session:T,getAccessToken:D}=(0,c.Y)(),{addAnthropometry:q,updateAnthropometry:W,getAnthropometryDetail:E,getPatientDetail:O}=(0,d.S)(),[R,$]=(0,t.useState)(!1),[L,H]=(0,t.useState)(null),[G,Q]=(0,t.useState)([]),[V,Y]=(0,t.useState)(null),[J,U]=(0,t.useState)(null),[X,K]=(0,t.useState)(null),[Z,ee]=(0,t.useState)(!1),[ea,el]=(0,t.useState)(!1),[er,et]=(0,t.useState)("1\xaa Avalia\xe7\xe3o F\xedsica"),[ei,en]=(0,t.useState)(new Date().toISOString().slice(0,10)),[eo,es]=(0,t.useState)(""),[ed,ec]=(0,t.useState)(""),[eu,ep]=(0,t.useState)(""),[em,ex]=(0,t.useState)(""),[eg,eh]=(0,t.useState)("jp3"),[ef,eb]=(0,t.useState)({}),[ey,ej]=(0,t.useState)({}),ev=e=>{if(!e)return;Y(e),et(e.notas||"Avalia\xe7\xe3o F\xedsica"),en(e.data_medicao?new Date(e.data_medicao).toISOString().slice(0,10):new Date().toISOString().slice(0,10)),ex(null!=e.peso?String(e.peso):""),ep(null!=e.altura?String(e.altura):"");let a={cintura:null!=e.circunferencia_cintura?String(e.circunferencia_cintura):"",quadril:null!=e.circunferencia_quadril?String(e.circunferencia_quadril):"",braco_rel_d:null!=e.circunferencia_braco?String(e.circunferencia_braco):""},l=function(e){if(!e)return{};if("object"==typeof e)return e;if("string"!=typeof e)return{};try{let a=JSON.parse(e);return a&&"object"==typeof a?a:{}}catch{return{}}}(e.dados_extras);if(l.protocolo&&eh(l.protocolo),l.sexo_calculo){let e=B(l.sexo_calculo);e&&es(e)}if(null!=l.idade_calculo){let e=(0,g.d)(l.idade_calculo);null!==e&&ec(String(e))}let r={};l.dobras&&Object.entries(l.dobras).forEach(e=>{let[a,l]=e;r[a]=null!=l?String(l):""}),eb(r);let t={};l.circunferencias&&Object.entries(l.circunferencias).forEach(e=>{let[a,l]=e;t[a]=null!=l?String(l):""}),l.diametros&&Object.entries(l.diametros).forEach(e=>{let[a,l]=e;t[a]=null!=l?String(l):""}),ej({...a,...t})};(0,t.useEffect)(()=>{if(!y)return;let e=!1;return Promise.all([O(y),j?E(j):Promise.resolve(null)]).then(a=>{let[l,r]=a;if(!l||e)return;if(U(l),l.sexo&&es(B(l.sexo)),l.data_nascimento){let e=(0,u.vq)(l.data_nascimento);"number"==typeof e&&ec(String(e))}!j&&l.altura&&ep(String(l.altura));let t=l.anthropometry||[];if(Q(t),j){let e=r||t.find(e=>e.id===j);e?(ev(e),H(null)):H("N\xe3o foi poss\xedvel localizar esta avalia\xe7\xe3o.")}else Y(null),H(null)}).catch(a=>{e||H(a.message||"Erro ao carregar dados da avalia\xe7\xe3o.")}),()=>{e=!0}},[y,j,T,E,O]);let[e_,eS]=(0,t.useState)({circunferencias:!0,diametros:!1,composicao:!0,fotos:!1}),eM=e=>eS(a=>({...a,[e]:!a[e]})),ek=(0,t.useMemo)(()=>{let e=(0,g.d)(eu);if(null===e||e<=0)return null;var a=e>3?e/100:e;if(!a||a<=0||"M"!==eo&&"F"!==eo)return null;let l=39.3701*a-60;
1return l<0?null:"M"===eo?50+2.3*l:45.5+2.3*l},[eu,eo]),eA=A[eg],eC=(0,t.useMemo)(()=>eA?.folds[eo]||[],[eA,eo]),eP=(0,t.useMemo)(()=>{let e=(0,g.d)(eu);if(null===e)return null;let a=e>3?e/100:e,l=(0,g.d)(em);if(!a||!l)return null;let r=l/(a*a),t=eC.map(e=>(0,g.d)(ef[e])),i=t.length>0&&t.every(e=>null!==e&&e>0),n=null,o=null,s=null,d=null,c=null;i&&eA?(n=eA.calc(t,(0,g.d)(ed)??0,eo),c=t.reduce((e,a)=>e+a,0),null!=n&&n>=0&&n<=60?(o=100-n,d=l*n/100,s=l-d):n=null):V&&(n=null!=V.percentual_gordura?(0,g.d)(V.percentual_gordura):null,s=null!=V.massa_magra?(0,g.d)(V.massa_magra):null,d=null!=V.massa_gorda?(0,g.d)(V.massa_gorda):null,null!=n&&(o=100-n));let u=(0,g.d)(ey.cintura),p=(0,g.d)(ey.quadril),m=u&&p?u/p:null,x=(0,g.d)(ey.braco_rel_d),f=(0,g.d)(ef.triceps),b=null,y=null;function j(e,a,l){return null==e||null==a||null==l?null:e<a?{label:"Abaixo da faixa",color:"#d97706"}:e>l?{label:"Acima da faixa",color:"#d97706"}:{label:"Adequado",color:"#3f7036"}}x&&f&&(y=x*x/(4*Math.PI)-(b=Math.pow(x-f/10*Math.PI,2)/(4*Math.PI)));let v=(0,h.uY)(eo,(0,g.d)(ed)),_=v?.ranges?.find(e=>"good"===e.tone),S=_?.min,M=_?.max,k=null!=M?100-M:null,A=null!=S?100-S:null,C=l&&null!=S?l*S/100:null,P=l&&null!=M?l*M/100:null,z=l&&null!=k?l*k/100:null,B=l&&null!=A?l*A/100:null;return{imc:r,fatPct:n,leanPct:o,leanMass:s,fatMass:d,rcq:m,sumFolds:c,amb:b,agb:y,classifyIMC:r?r<18.5?{label:"Abaixo do peso",color:"#d97706"}:r<25?{label:"Normal",color:"#10b981"}:r<30?{label:"Sobrepeso",color:"#d97706"}:r<35?{label:"Obesidade I",color:"#ef4444"}:r<40?{label:"Obesidade II",color:"#ef4444"}:{label:"Obesidade III",color:"#dc2626"}:null,classifyFat:n?function(e,a){let l=(0,h.uY)(a,(0,g.d)(ed)),r=(0,h.aK)(e,l),t=r?.active?.tone;return r?.active?{label:r.active.label,color:"good"===t?"#3f7036":"warn"===t?"#a56d20":"#a0614c"}:null}(n,eo):null,classifyLeanPct:j(o,k,A),classifyFatMass:j(d,C,P),classifyLeanMass:j(s,z,B),classifyRCQ:m?m<("M"===eo?.9:.83)?{label:"Normal",color:"#10b981"}:{label:"Risco elevado",color:"#ef4444"}:null,refs:{imc:"18,50 â 24,99",fatPct:null!=S&&null!=M?`${w(S,1)}% â ${w(M,1)}%`:"",leanPct:null!=S&&null!=M?`${w(100-M,1)}% â ${w(100-S,1)}%`:"Sem registro",fatMass:n&&l&&null!=S&&null!=M?`${w(l*S/100,1)} â ${w(l*M/100,1)} kg`:"Sem registro",leanMass:n&&l&&null!=S&&null!=M?`${w(l*(100-M)/100,1)} â ${w(l*(100-S)/100,1)} kg`:"Sem registro",rcq:"M"===eo?"Abaixo de 0,90":"Abaixo de 0,83"}}},[eu,em,ef,eC,eA,ed,eo,ey,V]),ez=(0,t.useMemo)(()=>{if(!eP)return[];let e=[],a=(0,x.Qn)("imc","IMC",eP.imc,2,(0,h.UD)());if(a&&e.push(a),null!=eP.fatPct&&eo&&ed){let a=(0,h.uY)(eo,(0,g.d)(ed)),l=(0,x.Qn)("fat","Gordura corporal",eP.fatPct,1,a);l&&e.push(l)}return e},[ed,eP,eo]),eB=eC.filter(e=>{let a=(0,g.d)(ef[e]);return null===a||a<=0}),ew=(e,a)=>ej(l=>({...l,[e]:a})),eN=async()=>{if(J&&X&&!ea){el(!0);try{let{saveNutritionistAnthropometryPdf:e}=await Promise.all([l.e(347),l.e(1327),l.e(5984),l.e(2610)]).then(l.bind(l,12610));e(J,X)}catch(e){H(e.message||"N\xe3o foi poss\xedvel gerar o PDF.")}finally{el(!1)}}},eF=async()=>{if(y&&!R){$(!0),H(null);try{let a,l=(0,g.d)(eu),r={};Object.entries(ef).forEach(e=>{let[a,l]=e,t=(0,g.d)(l);null!==t&&(r[a]=t)});let t={};["braco_rel_e","braco_con_d","braco_con_e","antebraco_d","antebraco_e","punho_d","punho_e","pesco\xe7o","ombro","peitoral","abdomen","panturrilha_d","panturrilha_e","coxa_d","coxa_e","coxa_prox_d","coxa_prox_e"].forEach(e=>{let a=(0,g.d)(ey[e]);null!==a&&(t[e]=a)});let i={};["diam_biestiloide","diam_umero","diam_epicondilo_d","diam_epicondilo_e","diam_femur","diam_tibia","diam_bimaleolar","diam_iliocristal"].forEach(e=>{let a=(0,g.d)(ey[e]);null!==a&&(i[e]=a)});let n={protocolo:eg,sexo_calculo:eo||null,idade_calculo:(0,g.d)(ed),soma_dobras:eP?.sumFolds!=null?Number(eP.sumFolds.toFixed(2)):null};Object.keys(r).length>0&&(n.dobras=r),Object.keys(t).length>0&&(n.circunferencias=t),Object.keys(i).length>0&&(n.diametros=i);let o={data_medicao:ei||new Date().toISOString(),peso:(0,g.d)(em),altura:(null!==l&&l>3?l/100:l)||null,circunferencia_cintura:(0,g.d)(ey?.cintura),circunferencia_quadril:(0,g.d)(ey?.quadril),circunferencia_braco:(0,g.d)(ey?.braco_rel_d),percentual_gordura:eP?.fatPct?Number(eP.fatPct):null,massa_magra:eP?.leanMass?Number(eP.leanMass):null,massa_gorda:eP?.fatMass?Number(eP.fatMass):null,notas:er||null,dados_extras:n},s=j||X?.id;a=s?await W(s,y,o):await q(y,o);let d={...o,...a||{},id:a?.id||s};
1K(d),Y(d),$(!1),!j&&a?.id&&await e.replace(`/nutricionista/pacientes/${y}/antropometria/novo?edit=${a.id}`,void 0,{shallow:!0})}catch(e){H(e.message||"Erro ao salvar medi\xe7\xe3o"),$(!1)}}},eI=I?"Editar avalia\xe7\xe3o f\xedsica":"Nova avalia\xe7\xe3o f\xedsica",eT=G.some(e=>e.id!==j);return(0,r.jsxs)(s.A,{pageTitle:eI,breadcrumb:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n(),{href:"/nutricionista",children:"Dashboard"})," /"," ",(0,r.jsx)(n(),{href:"/nutricionista/pacientes",children:"Pacientes"})," /"," ",(0,r.jsx)(n(),{href:`/nutricionista/pacientes/${y}`,children:"Detalhes"})," / Antropometria"]}),children:[(0,r.jsxs)("div",{className:"nutri-card",style:{marginBottom:20,padding:18,border:"1px solid rgba(184, 150, 90, 0.16)",background:"rgba(250, 246, 240, 0.84)",display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:16,flexWrap:"wrap"},children:[(0,r.jsxs)("div",{style:{flex:"1 1 320px",minWidth:0},children:[(0,r.jsx)("div",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--nn-text-tertiary, #a09484)",marginBottom:6},children:I?"Modo edi\xe7\xe3o":"Novo registro"}),(0,r.jsx)("div",{style:{fontSize:22,fontWeight:700,color:"var(--nn-text-primary, #2d2419)",lineHeight:1.15},children:eI}),(0,r.jsx)("div",{style:{fontSize:13,color:"var(--nn-text-secondary, #6b5e50)",marginTop:6,maxWidth:640},children:I?"Revise a avalia\xe7\xe3o j\xe1 salva, ajuste os dados necess\xe1rios e mantenha o hist\xf3rico consistente.":"Registre as medidas antropom\xe9tricas com uma leitura mais limpa e pronta para acompanhamento cl\xednico."}),L&&(0,r.jsx)("div",{style:{marginTop:12,display:"inline-flex",alignItems:"center",padding:"9px 12px",borderRadius:12,fontSize:12,fontWeight:500,color:"#a0614c",background:"rgba(160, 97, 76, 0.08)",border:"1px solid rgba(160, 97, 76, 0.14)"},children:L})]}),(0,r.jsxs)("div",{className:"w-full sm:w-auto",style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",justifyContent:"flex-end"},children:[(0,r.jsx)("button",{className:"nutri-btn nutri-btn-ghost flex-1 sm:flex-none",style:{fontSize:12},onClick:()=>{let e=G.find(e=>e.id!==j);if(!e)return void H("Nenhuma medi\xe7\xe3o anterior dispon\xedvel para carregar.");H(null),ev(e)},disabled:!eT,children:"Usar \xfaltima avalia\xe7\xe3o"}),(0,r.jsx)("button",{className:"nutri-btn nutri-btn-primary flex-1 sm:flex-none",onClick:eF,disabled:R,children:R?"Salvando...":I||X?"Salvar altera\xe7\xf5es":"Salvar avalia\xe7\xe3o"})]})]}),X&&(0,r.jsxs)("div",{className:"nutri-card",role:"status","aria-live":"polite",style:{marginBottom:20,padding:16,border:"1px solid rgba(63, 112, 54, 0.2)",background:"rgba(63, 112, 54, 0.07)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,flex:"1 1 280px"},children:[(0,r.jsx)(b.A,{size:21,"aria-hidden":"true",style:{color:"#3f7036",marginTop:1,flexShrink:0}}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#315c2b"},children:"Avalia\xe7\xe3o salva com sucesso"}),(0,r.jsx)("div",{style:{fontSize:12,color:"#557151",marginTop:2},children:"A vers\xe3o salva j\xe1 pode ser baixada ou enviada ao paciente."})]})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsxs)("button",{type:"button",className:"nutri-btn nutri-btn-primary",onClick:()=>ee(!0),children:[(0,r.jsx)(M.A,{size:15})," Enviar no WhatsApp"]}),(0,r.jsxs)("button",{type:"button",className:"nutri-btn nutri-btn-secondary",onClick:eN,disabled:ea,children:[ea?(0,r.jsx)(S.A,{size:15,className:"animate-spin"}):(0,r.jsx)(v.A,{size:15}),"Baixar PDF"]}),(0,r.jsx)(n(),{href:`/nutricionista/pacientes/${y}?tab=antropometria`,className:"nutri-btn nutri-btn-ghost no-underline",children:"Ver hist\xf3rico"})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)] gap-5 lg:grid-cols-[minmax(0,1fr)_320px]",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"nutri-card",style:{marginBottom:16},children:[(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(180px, 100%), 1fr))",gap:12,marginBottom:14},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:P,children:"Descri\xe7\xe3o"}
1),(0,r.jsx)("input",{className:"nutri-input",value:er,onChange:e=>et(e.target.value),style:{fontSize:13,padding:"8px 12px"}})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:P,children:"Data"}),(0,r.jsx)("input",{className:"nutri-input",type:"date",value:ei,onChange:e=>en(e.target.value),style:{fontSize:13,padding:"8px 12px"}})]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(180px, 100%), 1fr))",gap:12,marginBottom:14},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"anthropometry-sex",style:P,children:"Sexo *"}),(0,r.jsxs)("select",{id:"anthropometry-sex",className:"nutri-input",value:eo,onChange:e=>es(e.target.value),style:{fontSize:13,padding:"8px 12px"},children:[(0,r.jsx)("option",{value:"",children:"Selecione"}),(0,r.jsx)("option",{value:"F",children:"Feminino"}),(0,r.jsx)("option",{value:"M",children:"Masculino"})]})]}),(0,r.jsx)(F,{label:"Idade",value:ed,onChange:ec,suffix:"anos"})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(180px, 100%), 1fr))",gap:12},children:[(0,r.jsx)(F,{label:"Altura",value:eu,onChange:ep,onBlur:()=>{let e=(0,g.d)(eu);null!==e&&e>3&&ep((e/100).toFixed(2))},suffix:"m"}),(0,r.jsx)(F,{label:"Peso atual",value:em,onChange:ex,suffix:"kg"}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{style:{...P,display:"flex",alignItems:"center",gap:4},children:["Peso Ideal",(0,r.jsx)(f.A,{size:11,style:{color:"var(--nn-gold)"}}),(0,r.jsx)("span",{style:{marginLeft:"auto",fontSize:10,color:"#a09484",fontWeight:400},children:"Devine"})]}),(0,r.jsx)("div",{className:"nutri-input",style:{fontSize:13,padding:"8px 12px",background:"#f5f3f0",color:ek?"#2d2419":"#a09484",cursor:"default"},children:ek?`${w(ek,1)} kg`:eo?"Preencha altura":"Informe o sexo"})]})]})]}),(0,r.jsxs)(N,{title:"Circunfer\xeancias",open:e_.circunferencias,onToggle:()=>eM("circunferencias"),children:[(0,r.jsx)("h4",{style:z,children:"Membros superiores (cm)"}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10,marginBottom:16},children:["braco_rel_d","braco_rel_e","braco_con_d","braco_con_e","antebraco_d","antebraco_e","punho_d","punho_e"].map(e=>(0,r.jsx)(F,{label:{braco_rel_d:"Bra\xe7o relaxado Dir.",braco_rel_e:"Bra\xe7o relaxado Esq.",braco_con_d:"Bra\xe7o contra\xeddo Dir.",braco_con_e:"Bra\xe7o contra\xeddo Esq.",antebraco_d:"Antebra\xe7o Dir.",antebraco_e:"Antebra\xe7o Esq.",punho_d:"Punho Dir.",punho_e:"Punho Esq."}[e],value:ey[e],onChange:a=>ew(e,a)},e))}),(0,r.jsx)("h4",{style:z,children:"Tronco (cm)"}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10,marginBottom:16},children:[["pesco\xe7o","Pesco\xe7o"],["ombro","Ombro"],["peitoral","Peitoral"],["cintura","Cintura"],["abdomen","Abd\xf4men"],["quadril","Quadril"]].map(e=>{let[a,l]=e;return(0,r.jsx)(F,{label:l,value:ey[a],onChange:e=>ew(a,e)},a)})}),(0,r.jsx)("h4",{style:z,children:"Membros inferiores (cm)"}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10},children:[["panturrilha_d","Panturrilha Dir."],["panturrilha_e","Panturrilha Esq."],["coxa_d","Coxa Dir."],["coxa_e","Coxa Esq."],["coxa_prox_d","Coxa Prox. Dir."],["coxa_prox_e","Coxa Prox. Esq."]].map(e=>{let[a,l]=e;return(0,r.jsx)(F,{label:l,value:ey[a],onChange:e=>ew(a,e)},a)})})]}),(0,r.jsxs)(N,{title:"Di\xe2metros \xd3sseos",open:e_.diametros,onToggle:()=>eM("diametros"),children:[(0,r.jsx)("div",{style:{padding:"8px 12px",borderRadius:8,background:"rgba(184,150,90,0.06)",border:"1px solid rgba(184,150,90,0.15)",fontSize:12,color:"#6b5e50",marginBottom:14,lineHeight:1.5},children:"Medidas em cent\xedmetros com paqu\xedmetro de Martin. Usados para c\xe1lculo do somat\xf3tipo e avalia\xe7\xe3o da estrutura \xf3ssea."}),(0,r.jsx)("h4",{style:z,children:"Membros superiores (cm)"}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10,marginBottom:16},children:[(0,r.jsx)(F,{label:"Biestiloide (Punho)",value:ey.diam_biestiloide,onCh
1ange:e=>ew("diam_biestiloide",e)}),(0,r.jsx)(F,{label:"Biepic\xf4ndilo \xdamero",value:ey.diam_umero,onChange:e=>ew("diam_umero",e)}),(0,r.jsx)(F,{label:"Biepic\xf4ndilo Dir.",value:ey.diam_epicondilo_d,onChange:e=>ew("diam_epicondilo_d",e)}),(0,r.jsx)(F,{label:"Biepic\xf4ndilo Esq.",value:ey.diam_epicondilo_e,onChange:e=>ew("diam_epicondilo_e",e)})]}),(0,r.jsx)("h4",{style:z,children:"Membros inferiores (cm)"}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10},children:[(0,r.jsx)(F,{label:"Biepic\xf4ndilo F\xeamur",value:ey.diam_femur,onChange:e=>ew("diam_femur",e)}),(0,r.jsx)(F,{label:"Bic\xf4ndilo Tibial",value:ey.diam_tibia,onChange:e=>ew("diam_tibia",e)}),(0,r.jsx)(F,{label:"Bimaleolar",value:ey.diam_bimaleolar,onChange:e=>ew("diam_bimaleolar",e)}),(0,r.jsx)(F,{label:"Bi-iliocristal",value:ey.diam_iliocristal,onChange:e=>ew("diam_iliocristal",e)})]})]}),(0,r.jsxs)(N,{title:"Composi\xe7\xe3o Corporal (Pregas Cut\xe2neas)",open:e_.composicao,onToggle:()=>eM("composicao"),children:[(0,r.jsx)("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,background:"rgba(184,150,90,0.06)",border:"1px solid rgba(184,150,90,0.15)",fontSize:12,color:"#6b5e50",lineHeight:1.5},children:"Preencha Altura, Peso e as pregas obrigat\xf3rias do protocolo selecionado. Os campos exibidos mudam conforme o protocolo."}),(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsx)("label",{htmlFor:"anthropometry-protocol",style:P,children:"Protocolo"}),(0,r.jsx)("select",{id:"anthropometry-protocol",className:"nutri-input",value:eg,onChange:e=>eh(e.target.value),style:{fontSize:13,padding:"8px 12px",maxWidth:400},children:Object.entries(A).map(e=>{let[a,l]=e;return(0,r.jsx)("option",{value:a,children:l.label},a)})})]}),(0,r.jsxs)("h4",{style:z,children:["Pregas: ",eA.label]}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10,marginBottom:20},children:eC.map(e=>(0,r.jsx)(F,{label:C[e]||e,value:ef[e],onChange:a=>eb(l=>({...l,[e]:a})),suffix:"mm",required:!0},e))}),eP&&(0,r.jsxs)("div",{style:{marginBottom:18,padding:16,border:"1px solid var(--border-subtle)",borderRadius:14,background:"linear-gradient(145deg, var(--surface-card), var(--surface-sunken))"},children:[(0,r.jsxs)("div",{style:{marginBottom:12},children:[(0,r.jsx)("div",{style:{color:"var(--text-primary)",fontSize:14,fontWeight:750},children:"Leitura cl\xednica das faixas"}),(0,r.jsx)("div",{style:{marginTop:3,color:"var(--text-secondary)",fontSize:11,lineHeight:1.45},children:"O marcador mostra onde o resultado atual est\xe1 em rela\xe7\xe3o \xe0s refer\xeancias."})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:ez.length>1?"repeat(auto-fit, minmax(260px, 1fr))":"minmax(0, 1fr)",gap:12},children:[ez.map(e=>(0,r.jsx)(p.N,{reading:e,compact:!0},e.key)),null==eP.fatPct?(0,r.jsxs)("div",{style:{display:"flex",minHeight:150,flexDirection:"column",justifyContent:"center",padding:16,border:"1px dashed var(--border-default)",borderRadius:14,background:"var(--surface-card)"},children:[(0,r.jsx)("div",{style:{color:"var(--text-primary)",fontSize:12,fontWeight:750},children:"% de gordura aguardando as dobras"}),(0,r.jsxs)("p",{style:{margin:"5px 0 0",color:"var(--text-secondary)",fontSize:11,lineHeight:1.5},children:["Preencha ",eB.length||"todas"," ",1===eB.length?"dobra obrigat\xf3ria":"dobras obrigat\xf3rias"," ","do protocolo ",eA.label,eB.length?`: ${eB.map(e=>C[e]||e).join(", ")}.`:"."]})]}):null]})]}),(0,r.jsxs)("div",{style:{borderRadius:10,border:"1px solid #e8e2da",overflow:"hidden"},children:[(0,r.jsx)("div",{style:{padding:"12px 20px",background:"#2d2419",color:"white",fontSize:13,fontWeight:600},children:"Resultados"}),(0,r.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{style:{background:"#f5f3f0",fontSize:11,fontWeight:600,color:"#6b5e50",textTransform:"uppercase",letterSpacing:"0.03em"},children:[(0,r.jsx)("th",{style:{padding:"8px 16px",textAlign:"left"},children:"Indicador"}),(0,r.jsx)("th",{style:{padding:"8px 16px",textAlign:"right"},children:"Atual"}),(0,r.jsx)("th",{style:{padding:"8px 16px",textAlign:"right"},children:"Recomenda\xe7\xe3o"}),(0,r.jsx)("th",{style:{padding:"8px 16px",textAlign:"center"},children:"Situa\xe7\xe3o"})]})}),(0,r.jsx)("tbody",{children:[{label:"IMC",value:w(eP?.imc),unit:"",ref:eP?.refs?.imc,status:eP?.classifyIMC},{label:"% Massa Gorda",value:w(eP?.fatPct),unit:"%",ref:eP?.refs?.fatPct,status:eP?.classifyFat},{label:"% Massa Magra",value:w(eP?.leanPct),unit:"%",ref:eP?.refs?.leanPct,status:eP?.classifyLeanPct},{label:"Massa Gorda",value:w(eP?.fatMass),unit:" kg",ref:eP?.refs?.fatMass,status:eP?.classifyFatMass},{label:"Massa Magra",value:w(eP?.leanMass),unit:" kg",ref:eP?.refs?.leanMass,status:eP?.classifyLeanMass},{label:"Soma de Dobras",value:w(eP?.sumFolds),unit:" mm",ref:"Sem registro",status:null},{label:"Raz\xe3o Cintura/Quadril",value:w(eP?.rcq),unit:"",ref:eP?.refs?.rcq,status:eP?.classifyRCQ},{label:"\xc1rea Muscular do Bra\xe7o (AMB)",value:w(eP?.amb),unit:" cm\xb2",ref:"Sem registro",status:null},{label:"\xc1rea de Gordura do Bra\xe7o (AGB)",value:w(eP?.agb),unit:" cm\xb2",ref:"",status:null}].map((e,a)=>(0,r.jsxs)("tr",{style:{borderBottom:"1px solid #f0ece6",background:a%2==0?"white":"#faf9f7"},children:[(0,r.jsx)("td",{style:{padding:"10px 16px",fontWeight:500,color:"#2d2419"},children:e.label}),(0,r.jsx)("td",{style:{padding:"10px 16px",textAlign:"right",fontWeight:600,color:e.value?"#2d2419":"#d1ccc5",fontVariantNumeric:"tabular-nums"},children:e.value?`${e.value}${e.unit}`:""}),(0,r.jsx)("td",{style:{padding:"10px 16px",textAlign:"right",color:"#6b5e50",fontSize:12},children:e.ref||""}),(0,r.jsx)("td",{style:{padding:"10px 16px",textAlign:"center"},children:e.status?(0,r.jsx)("span",{style:{fontSize:11,fontWeight:600,padding:"3px 10px",borderRadius:20,background:`${e.status.color}10`,color:e.status.color,border:`1px solid ${e.status.color}30`},children:e.status.label}):(0,r.jsx)("span",{style:{color:"#d1ccc5"}})})]},e.label))})]}),eP?.fatPct!=null&&(0,r.jsxs)("div",{style:{padding:"10px 16px",fontSize:11,color:"#a09484",borderTop:"1px solid #f0ece6",background:"#faf9f7"},children:["Protocolo: ",eA.label," \xb7 Equa\xe7\xe3o de Siri (1961)"]})]})]}),(0,r.jsx)(N,{title:"Fotos e Anexos",open:e_.fotos,onToggle:()=>eM("fotos"),children:(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,r.jsxs)("div",{style:{padding:24,border:"2px dashed #e8e2da",borderRadius:10,textAlign:"center",cursor:"pointer"},children:[(0,r.jsx)(_.A,{size:20,style:{color:"#a09484",marginBottom:6}}),(0,r.jsx)("div",{style:{fontSize:12,color:"#6b5e50"},children:"Clique para selecionar fotos"}),(0,r.jsx)("div",{style:{fontSize:11,color:"#a09484",marginTop:2},children:"Limite de 5 fotos. JPG, PNG"})]}),(0,r.jsxs)("div",{style:{padding:24,border:"2px dashed #e8e2da",borderRadius:10,textAlign:"center",cursor:"pointer"},children:[(0,r.jsx)(k.A,{size:20,style:{color:"#a09484",marginBottom:6}}),(0,r.jsx)("div",{style:{fontSize:12,color:"#6b5e50"},children:"Anexar laudo de bioimped\xe2ncia"}),(0,r.jsx)("div",{style:{fontSize:11,color:"#a09484",marginTop:2},children:"Limite: 8MB total"})]})]})})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"nutri-card",style:{position:"sticky",top:100,background:"#f5f3f0",border:"none"},children:[(0,r.jsx)("h4",{style:{fontSize:13,fontWeight:600,color:"#2d2419",marginBottom:12},children:"Dicas de preenchimento"}),(0,r.jsxs)("div",{style:{fontSize:12,color:"#6b5e50",lineHeight:1.7},children:[(0,r.jsxs)("p",{style:{marginBottom:10},children:["Preencha ",(0,r.jsx)("strong",{children:"Altura"}),", ",(0,r.jsx)("strong",{children:"Peso atual"})," e as ",(0,r.jsx)("strong",{children:"pregas obrigat\xf3rias"})," do protocolo para obter os resultados de composi\xe7\xe3o corporal."]}),(0,r.jsx)("p",{style:{marginBottom:10},children:"Os campos de pregas mudam automaticamente conforme o protocolo selecionado. Ca
1da protocolo exige um conjunto espec\xedfico de medidas."}),(0,r.jsxs)("p",{children:["O ",(0,r.jsx)("strong",{children:"Peso Ideal"})," \xe9 calculado automaticamente pela f\xf3rmula de Devine (1974) com base na altura e sexo."]})]})]})})]}),(0,r.jsx)(m.c,{isOpen:Z,onClose:()=>ee(!1),patientId:y||"",patient:J||{},record:X,getAccessToken:D})]})}I.noLayout=!0},74206:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},79503:(e,a,l)=>{"use strict";l.d(a,{A:()=>r});let r=(0,l(17963).A)("calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]])}},e=>{e.O(0,[4587,6875,877,9724,3990,8931,636,6593,8792],()=>e(e.s=28956)),_N_E=e.O()}]);
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.