1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7243],{87243:(e,a,r)=>{r.r(a),r.d(a,{default:()=>k});var t=r(74034),o=r(75834),l=r(69216),n=r(20761);let s=[{chave:"melhor",rotulo:"Melhores",cor:"fill-teal-600 stroke-teal-600"},{chave:"parecido",rotulo:"Parecidos",cor:"fill-primary-600 stroke-primary-600"},{chave:"pior",rotulo:"Piores",cor:"fill-orange-600 stroke-orange-600"},{chave:"sem",rotulo:"Sem marca",cor:"fill-gray-400 stroke-gray-400"}];function i(e){var a;let r,{itens:l,area:n,faixa:i,valorDono:m,valorAvaliado:x,selecionado:u,onSelecionar:p}=e,[h,g]=(0,o.useState)(null),y=l.filter(e=>e.preco_m2>0&&!1!==e.na_faixa&&!e.fora_do_raio),v=(0,o.useMemo)(()=>{let e=y.filter(e=>!e.fora_da_curva||"incluir"===e.decisao),a=(e.length?e:y).map(e=>e.preco_m2);if(i&&n>0&&a.push(i.minimo/n,i.maximo/n),m&&n>0&&a.push(m/n),x&&n>0&&a.push(x/n),!a.length)return null;let r=Math.min(...a),t=Math.max(...a),o=(t-r)*.06||.05*t,l=r-o,s=t+o,c=Math.max(500,500*Math.ceil((s-l)/4/500)),d=[];for(let e=Math.ceil(l/c)*c;e<=s;e+=c)d.push(e);return{x:e=>72+(Math.min(s,Math.max(l,e))-l)/(s-l)*316,marcas:d,fora:e=>e>s?"acima":e<l?"abaixo":null}},[y,i,n,m,x]);if(!v)return(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"Sem compar\xe1veis para desenhar a curva."});let b=22+30*s.length+26,f=22+30*s.length,j=y.find(e=>e.id===h);return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("svg",{viewBox:"0 0 ".concat(400," ").concat(b),className:"w-full h-auto",role:"img","aria-label":"Pre\xe7o por metro quadrado de cada compar\xe1vel, com a faixa sugerida e o valor avaliado",children:[i&&n>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("rect",{x:v.x(i.minimo/n),y:18,width:Math.max(2,v.x(i.maximo/n)-v.x(i.minimo/n)),height:30*s.length+4,rx:4,className:"fill-primary-100 dark:fill-primary-900/40"}),(0,t.jsx)("line",{x1:v.x(i.mediana/n),x2:v.x(i.mediana/n),y1:18,y2:f,className:"stroke-primary-500",strokeWidth:1,strokeDasharray:"3 3"})]}),s.map((e,a)=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:72,x2:388,y1:22+30*a+15,y2:22+30*a+15,className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:1}),(0,t.jsx)("text",{x:64,y:22+30*a+15+4,textAnchor:"end",className:"fill-gray-600 dark:fill-gray-300",fontSize:11,children:e.rotulo})]},e.chave)),(0,t.jsx)("line",{x1:72,x2:388,y1:f,y2:f,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1}),v.marcas.map(e=>(0,t.jsxs)("text",{x:v.x(e),y:f+14,textAnchor:"middle",className:"fill-gray-500 dark:fill-gray-400",fontSize:10,children:[(e/1e3).toLocaleString("pt-BR",{maximumFractionDigits:1})," mil"]},e)),(0,t.jsx)("text",{x:388,y:f+25,textAnchor:"end",className:"fill-gray-400",fontSize:9,children:"R$/m\xb2"}),m&&n>0&&(0,t.jsx)(c,{x:v.x(m/n),topo:8,base:f,rotulo:"dono pede",classe:"stroke-gray-700 fill-gray-700 dark:stroke-gray-200 dark:fill-gray-200",tracejado:!0}),x&&n>0&&(0,t.jsx)(c,{x:v.x(x/n),topo:8,base:f,rotulo:"avaliado",classe:"stroke-primary-700 fill-primary-700 dark:stroke-primary-100 dark:fill-primary-100"}),y.map((e,a)=>{var r;let o=s.findIndex(a=>{var r;return a.chave===(null!=(r=e.condicao_relativa)?r:"sem")}),l=s[o],n=22+30*o+15+(7*a%11-5),i=v.x(e.preco_m2),c=!(null!=(r=e.na_conta)?r:e.na_faixa)&&"pior"!==e.condicao_relativa&&"melhor"!==e.condicao_relativa,m=e.id===u||e.id===h;return(0,t.jsxs)("g",{className:"cursor-pointer",onMouseEnter:()=>g(e.id),onMouseLeave:()=>g(null),onClick:()=>null==p?void 0:p(e.id),children:[(0,t.jsx)("circle",{cx:i,cy:n,r:10,className:"fill-transparent"}),(0,t.jsx)(d,{x:i,y:n,tipo:l.chave,classe:l.cor,vazado:c,ativo:m}),v.fora(e.preco_m2)&&(0,t.jsx)("text",{x:"acima"===v.fora(e.preco_m2)?i+8:i-8,y:n+4,fontSize:11,textAnchor:"acima"===v.fora(e.preco_m2)?"start":"end",className:"fill-gray-500 dark:fill-gray-400",children:"acima"===v.fora(e.preco_m2)?"âº":"â¹"})]},e.id)})]}),j&&(0,t.jsxs)("div",{className:"pointer-events-none absolute right-0 top-0 rounded-md border border-gray-200 bg-white px-2 py-1 text-[11px] text-gray-800 shadow-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",children:[(0,t.jsx)("p",{className:"font-medium",children:(r=j.preco_m2,"R$ ".concat(Math.round(r).toLocaleStr
1ing("pt-BR"),"/m\xb2"))}),(0,t.jsxs)("p",{className:"text-gray-500 dark:text-gray-400",children:[j.preco.toLocaleString("pt-BR",{style:"currency",currency:"BRL",maximumFractionDigits:0})," \xb7 ",j.area," m\xb2"]}),(0,t.jsx)("p",{className:"text-gray-500 dark:text-gray-400 max-w-[14rem] truncate",children:null!=(a=j.endereco)?a:"sem endere\xe7o"})]}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-gray-500",children:"Faixa azul = faixa sugerida \xb7 ponto vazado = fora da conta \xb7 ⹠⺠= al\xe9m da borda (fora da curva) \xb7 clique num ponto para achar o im\xf3vel."})]})}function c(e){let{x:a,topo:r,base:o,rotulo:l,classe:n,tracejado:s=!1}=e;return(0,t.jsxs)("g",{className:n,children:[(0,t.jsx)("line",{x1:a,x2:a,y1:r+4,y2:o,strokeWidth:2,strokeDasharray:s?"4 3":void 0}),(0,t.jsx)("text",{x:a,y:r,textAnchor:"middle",fontSize:10,className:"stroke-0",style:{stroke:"none"},children:l})]})}function d(e){let{x:a,y:r,tipo:o,classe:l,vazado:n,ativo:s}=e,i=s?7:5,c="".concat(l," ").concat(n?"!fill-white dark:!fill-gray-900":""),d=(0,t.jsx)("circle",{cx:a,cy:r,r:i+3,className:"fill-none stroke-gray-900 dark:stroke-white",strokeWidth:1.5});if("pior"===o||"melhor"===o){let e="melhor"===o?"M ".concat(a," ").concat(r-i-1," L ").concat(a+i+1," ").concat(r+i," L ").concat(a-i-1," ").concat(r+i," Z"):"M ".concat(a," ").concat(r+i+1," L ").concat(a+i+1," ").concat(r-i," L ").concat(a-i-1," ").concat(r-i," Z");return(0,t.jsxs)(t.Fragment,{children:[s&&d,(0,t.jsx)("path",{d:e,className:c,strokeWidth:1.5,strokeLinejoin:"round"})]})}return(0,t.jsxs)(t.Fragment,{children:[s&&d,(0,t.jsx)("circle",{cx:a,cy:r,r:i,className:c,strokeWidth:1.5})]})}var m=r(51462),x=r(21229);let u=e=>e.toLocaleString("pt-BR",{style:"currency",currency:"BRL",maximumFractionDigits:0});function p(e){var a,r,l,s,i,c,d,p,h;let{itens:g,area:y,bairroId:v,tipo:b,finalidade:f,quartos:j,valorDono:N,avaliado:k,anuncio:w,minimo:_,rendimentoMesPct:C,estudo:S,onEstudo:M}=e,[q,R]=(0,o.useState)(null),[A,L]=(0,o.useState)(null!=(l=null==S?void 0:S.condominio)?l:null),[B,E]=(0,o.useState)(null!=(s=null==S?void 0:S.iptu)?s:null),[P,z]=(0,o.useState)(null!=(i=null==S?void 0:S.ocupacao)?i:"desocupado"),[F,D]=(0,o.useState)(null!=(c=null==S?void 0:S.aluguel)?c:null),[O,T]=(0,o.useState)(null),[I,W]=(0,o.useState)(null!=(d=null==S||null==(a=S.rendimento)?void 0:a.fonte)?d:"cdi"),[V,X]=(0,o.useState)(String((null==S||null==(r=S.rendimento)?void 0:r.fonte)==="manual"?S.rendimento.pct:C).replace(".",","));(0,o.useEffect)(()=>{let e=!0;return m.A.get("/captacao/comparaveis/indices").then(a=>{var r;e&&T(null!=(r=a.data)?r:[])}).catch(()=>{e&&T([])}),()=>{e=!1}},[]),(0,o.useEffect)(()=>{O&&"manual"!==I&&!O.some(e=>e.id===I)&&W("manual")},[O,I]);let $="manual"===I?null:null!=(p=null==O?void 0:O.find(e=>e.id===I))?p:null,Z=Number(V.replace(",",".")),G=$?$.pct:Number.isFinite(Z)&&Z>=0?Z:C;(0,o.useEffect)(()=>{if(!v||!b)return;let e=!0;return m.A.get("/captacao/comparaveis/demanda",{params:{bairroId:v,tipo:b,finalidade:"locacao"===f?"locacao":"venda",quartos:null!=j?j:void 0}}).then(a=>{e&&R(a.data)}).catch(()=>{e&&R("erro")}),()=>{e=!1}},[v,b,f,j]);let Q=(0,o.useMemo)(()=>g.filter(e=>{var a;return e.preco_m2>0&&!e.fora_do_raio&&!1!==e.na_faixa&&((null!=(a=e.na_conta)?a:e.na_faixa)||"pior"===e.condicao_relativa||"melhor"===e.condicao_relativa)}).map(e=>e.preco_m2),[g]),U=[N?{rotulo:"O dono pede",valor:N}:null,k?{rotulo:"Avaliado",valor:k}:null,w?{rotulo:"Anunciar por",valor:w}:null].filter(Boolean),J=(0,o.useRef)(M);J.current=M,(0,o.useEffect)(()=>{var e,a;null!==O&&(null==(e=J.current)||e.call(J,{condominio:A,iptu:B,ocupacao:P,aluguel:F,rendimento:{fonte:I,pct:G,referencia:null!=(a=null==$?void 0:$.referencia)?a:null},demanda:q&&"erro"!==q?q:null}))},[A,B,P,F,I,G,null==$?void 0:$.referencia,q,O]);let Y=null!=(h=null!=w?w:k)?h:0,H=Y>0?Math.round(Y*G/100):0,K=(0,x.MX)({condominio:A,iptuMes:B,aluguel:F,ocupacao:P}),ee=H+K,ea=(0,o.useMemo)(()=>{if(!k||!(Y>0))return null;let e=(0,x.Z2)(k,null!=_?_:null);return N&&!e.includes(N)&&e.push(N),(0,x.Yp)({precos:e.sort((e,a)=>e-a),referencia:Y,custoMensal:K,rendimentoMesPct:G})},[k,_,Y,K,G,N]),er=ea?Math.max(1,...ea.flatMap(e=>e.celulas.map(Math.abs))):1,et=Array.from({length:13},(e,a)=>{if(0===a)return"hoje";let r=new Date;return r.setDate(1),r.setMonth(r.getMonth()+a),r.toLocaleDateString("pt-BR",{month:"short",year:"2-digit"}).replace(". de ","/").replace(".","")}),eo=N&&w&&N>w?N-w:null,el=eo&&ee>0?eo/ee:null;return U.length?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg border border-gray-200",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{className:"bg-gray-50 text-left text-gray-500",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"Pre\xe7o"}),(0,t.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"Na fila dos parecidos"}),(0,t.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"Leads que c
1abem"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-gray-100",children:U.map(e=>{let a,r=(e=>{if(!(y>0)||!Q.length)return null;let a=e/y;return{posicao:Q.filter(e=>e<a).length+1,total:Q.length+1}})(e.valor),o=(a=e.valor,q&&"erro"!==q?q.orcamentos.filter(e=>e>=a).length:null);return(0,t.jsxs)("tr",{children:[(0,t.jsxs)("td",{className:"px-2 py-1.5",children:[(0,t.jsx)("p",{className:"text-gray-500",children:e.rotulo}),(0,t.jsx)("p",{className:"font-medium text-gray-900",children:u(e.valor)})]}),(0,t.jsx)("td",{className:"px-2 py-1.5 text-gray-800",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("b",{children:[r.posicao,"\xba"]})," mais barato de ",r.total]}):(0,t.jsx)("span",{className:"text-gray-400",children:"sem compar\xe1veis"})}),(0,t.jsx)("td",{className:"px-2 py-1.5 text-gray-800",children:null==o?(0,t.jsx)("span",{className:"text-gray-400",children:"â"}):(0,t.jsx)("b",{children:o})})]},e.rotulo)})})]})}),(0,t.jsx)("p",{className:"text-[11px] text-gray-500",children:null===q?"Contando os leads que procuram este im\xf3velâ¦":"erro"===q?"N\xe3o deu para contar os leads agora.":(0,t.jsxs)(t.Fragment,{children:["Nos \xfaltimos ",q.periodo_dias," dias, ",(0,t.jsx)("b",{children:q.no_produto})," lead",1===q.no_produto?"":"s"," procurou",1===q.no_produto?"":"ram"," ",b," neste bairro",j?" com at\xe9 ".concat(j," quartos"):"","; ",q.orcamentos.length," disse",1===q.orcamentos.length?"":"ram"," o or\xe7amento",q.sem_orcamento?" (".concat(q.sem_orcamento," sem or\xe7amento â podem caber em qualquer pre\xe7o)"):"",". S\xf3 leads da casa: \xe9 a procura que chega at\xe9 n\xf3s, n\xe3o o mercado inteiro."]})}),(0,t.jsxs)("div",{className:"rounded-lg border border-gray-200 p-3 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Quanto custa esperar"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[11px] text-gray-500 mb-0.5",children:"Condom\xednio por m\xeas"}),(0,t.jsx)(n.XR,{valor:A,onChange:L,centavos:!1,placeholder:"0"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[11px] text-gray-500 mb-0.5",children:"IPTU por m\xeas"}),(0,t.jsx)(n.XR,{valor:B,onChange:E,centavos:!1,placeholder:"0"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[11px] text-gray-500 mb-0.5",children:"O im\xf3vel est\xe1"}),(0,t.jsxs)("select",{value:P,onChange:e=>z(e.target.value),className:"w-full rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs",children:[(0,t.jsx)("option",{value:"desocupado",children:"Desocupado"}),(0,t.jsx)("option",{value:"alugado",children:"Alugado"}),(0,t.jsx)("option",{value:"mora",children:"O dono mora nele"})]})]}),"desocupado"!==P&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[11px] text-gray-500 mb-0.5",children:"alugado"===P?"Aluguel recebido por m\xeas":"Aluguel que ele pagaria"}),(0,t.jsx)(n.XR,{valor:F,onChange:D,centavos:!1,placeholder:"0"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[11px] text-gray-500 mb-0.5",children:"Quanto o dinheiro renderia por m\xeas"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(null!=O?O:[]).map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>W(e.id),title:"Banco Central â ".concat(e.nome," de ").concat(e.referencia),className:"text-[11px] px-2 py-0.5 rounded-full border ".concat(I===e.id?"bg-primary-600 text-white border-primary-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"),children:[e.nome," ",e.pct.toLocaleString("pt-BR"),"%"]},e.id)),(0,t.jsx)("button",{type:"button",onClick:()=>W("manual"),className:"text-[11px] px-2 py-0.5 rounded-full border ".concat("manual"===I?"bg-primary-600 text-white border-primary-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"),children:"Outro %"}),"manual"===I&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-gray-600",children:[(0,t.jsx)("input",{value:V,onChange:e=>X(e.target.value.replace(/[^\d,.]/g,"")),inputMode:"decimal",className:"w-16 rounded border border-gray-300 px-2 py-0.5 text-xs","aria-label":"Rendimento ao m\xeas, em %"}),"% ao m\xeas"]})]}),(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-gray-400",children:null===O?"Buscando os \xedndices do Banco Centralâ¦":$?"".concat($.nome," de ").concat($.referencia,", Banco Central."):O.length?"Percentual digitado.":"Banco Central fora do ar agora â vale o percentual digitado."})]}),(0,t.jsxs)("p",{className:"text-xs text-gray-800",children:["Cada m\xeas parado custa ",(0,t.jsx)("b",{children:u(ee)}),(0,t.jsxs)("span",{className:"text-gray-500",children:[" ","â ",u(H)," que ",u(Y)," renderiam aplicados (",G.toLocaleStr
1ing("pt-BR"),"% ao m\xeas)",K>0?" + ".concat(u(K)," de condom\xednio e IPTU").concat("desocupado"!==P&&F?" (j\xe1 descontado o aluguel)":""):"",K<0?" â ".concat(u(-K)," de sobra do aluguel sobre condom\xednio e IPTU"):"","."]})]}),eo&&el?(0,t.jsxs)("p",{className:"text-xs text-gray-800",children:["O dono pede ",u(eo)," a mais que o pre\xe7o de an\xfancio. Esperando, esse valor vai embora em"," ",(0,t.jsx)("b",{children:el<1?"menos de 1 m\xeas":"".concat(Math.round(10*el)/10," meses")}),"."]}):null]}),ea&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Quanto custa esperar para vender â em R$ mil, daqui a 12 meses"}),(0,t.jsxs)("p",{className:"mb-1 text-[11px] text-gray-500",children:["Comparado a vender hoje por ",u(Y),": verde = melhor, vermelho = pior. Linha = pre\xe7o de venda; coluna = m\xeas em que vende."]}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full border-separate text-[10px]",style:{borderSpacing:1},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-1 text-left font-medium text-gray-500",children:"Pre\xe7o"}),et.map(e=>(0,t.jsx)("th",{className:"px-0.5 font-medium text-gray-500",children:e},e))]})}),(0,t.jsx)("tbody",{children:ea.map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsxs)("td",{className:"whitespace-nowrap px-1 text-right font-medium ".concat(e.preco===N?"text-amber-700":"text-gray-800"),children:[e.preco===N?"pedido ":"",(e.preco/1e3).toLocaleString("pt-BR")," mil"]}),e.celulas.map((a,r)=>{let o=.6*Math.min(1,Math.abs(a)/er),l=Math.round(a/1e3);return(0,t.jsxs)("td",{className:"px-0.5 py-0.5 text-center text-gray-900 dark:text-gray-100",style:{background:a>=0?"rgba(22,163,74,".concat(o,")"):"rgba(220,38,38,".concat(o,")")},title:"Vendendo por ".concat(u(e.preco)," em ").concat(et[r],": ").concat(l>=0?"+":"").concat(u(a)," em 12 meses"),children:[l>0?"+":"",l]},r)})]},e.preco))})]})})]}),(0,t.jsx)("p",{className:"text-[11px] text-gray-400",children:"Tempo estimado para vender: precisa do ritmo de vendas da regi\xe3o (quantos im\xf3veis assim vendem por m\xeas), que o sistema ainda n\xe3o tem."})]}):(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"Preencha o valor avaliado para ver o estudo de demanda."})}var h=r(27756),g=r(92632);let y=(0,l.default)(()=>Promise.all([r.e(6906),r.e(474),r.e(9193)]).then(r.bind(r,69193)),{loadableGenerated:{webpack:()=>[69193]},ssr:!1}),v=[{valor:"pior",rotulo:"Pior",simbolo:"â¼",ativo:"bg-orange-600 border-orange-600 text-white"},{valor:"parecido",rotulo:"Parecido",simbolo:"â",ativo:"bg-primary-600 border-primary-600 text-white"},{valor:"melhor",rotulo:"Melhor",simbolo:"â²",ativo:"bg-teal-600 border-teal-600 text-white"}],b=[{valor:null,rotulo:"Sem raio"},{valor:300,rotulo:"300 m"},{valor:500,rotulo:"500 m"},{valor:1e3,rotulo:"1 km"},{valor:2e3,rotulo:"2 km"}],f=e=>e.toLocaleString("pt-BR",{style:"currency",currency:"BRL",maximumFractionDigits:0}),j=e=>"R$ ".concat(Math.round(e).toLocaleString("pt-BR"),"/m\xb2"),N={fechado:"Fechado pela casa",acervo:"Acervo da casa",portal:"Portal"};function k(e){var a,r,l,s,c,d;let{resultado:m,endereco:u,recalculando:v,buscandoPortais:N,erro:k,podeBuscarPortais:_,onBuscarPortais:C,onMarcar:S,onMarcarVarios:M,onJuntar:q,onLimparPuxados:R,onSeparar:A,onRaio:L,valorAvaliado:B,valorDono:E,onValor:P,onFechar:z,bairroId:F,finalidade:D,quartos:O,valorAnuncio:T,valorMinimo:I,onAnuncio:W,onMinimo:V,onEstudo:X,coletor:$,coletando:Z,onTrazerColetor:G}=e,[Q,U]=(0,o.useState)(!1),J=(0,x.dR)(),Y=(0,x.Iy)(B,{anuncio:T,minimo:I},J),H=Y.anuncio,[K,ee]=(0,o.useState)("todos"),[ea,er]=(0,o.useState)("m2"),[et,eo]=(0,o.useState)(new Set),[el,en]=(0,o.useState)(!1),[es,ei]=(0,o.useState)(null),ec=(0,o.useRef)(new Map);(0,o.useEffect)(()=>{let e=e=>{"Escape"===e.key&&z()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[z]);let ed=(0,o.useMemo)(()=>{var e;return[...m.fechados,...m.acervo,...null!=(e=m.portal)?e:[]]},[m]),em=e=>{var a;return!!(null!=(a=e.na_conta)?a:e.na_faixa)},ex=e=>"pior"===e.condicao_relativa||"melhor"===e.condicao_relativa,eu=e=>em(e)||ex(e),ep=Number(m.alvo.area),eh=(0,o.useMemo)(()=>{let e=ed.filter(e=>"na_conta"===K?eu(e):"fora"===K?!eu(e):"sem_marca"!==K||!e.condicao_relativa),a=e=>{var a;return"preco"===ea?e.preco:"distancia"===ea?null!=(a=e.distancia_m)?a:Number.MAX_SAFE_INTEGER:e.preco_m2},r=e=>+!!(0,g.NG)(e,ep);return[...e].sort((e,t)=>
1r(e)-r(t)||a(e)-a(t))},[ed,K,ea,ep]),eg=m.faixa,ey=m.busca_portal,ev=null!=(r=null==ey?void 0:ey.anuncios_lidos)?r:0,eb=ed.filter(e=>null!=e.lat&&null!=e.lng).length,ef=ed.length-eb,ej=ed.filter(em).length,eN=null!=(l=null==(a=m.portal)?void 0:a.length)?l:0,ek=eh.filter(e=>e.na_faixa&&!e.fora_do_raio&&!ex(e)),ew=ek.filter(em).map(e=>e.id),e_=ek.filter(e=>!em(e)).map(e=>e.id);function eC(e){var a;ei(e),null==(a=ec.current.get(e))||a.scrollIntoView({behavior:"smooth",block:"center"})}let eS=e=>"text-xs px-2.5 py-1 rounded-full border ".concat(e?"bg-gray-900 text-white border-gray-900 dark:bg-gray-100 dark:text-gray-900 dark:border-gray-100":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50");return(0,t.jsxs)("div",{className:"fixed inset-0 z-[60] flex flex-col bg-gray-50",role:"dialog","aria-modal":"true","aria-label":"Avalia\xe7\xe3o em tela cheia",children:[(0,t.jsxs)("header",{className:"flex flex-wrap items-center gap-3 border-b border-gray-200 bg-white px-5 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("h2",{className:"text-base font-semibold text-gray-900 truncate",children:["Avalia\xe7\xe3o",u?" â ".concat(u):""]}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:[m.alvo.tipo," \xb7 ",ep," m\xb2 \xb7 ",(0,t.jsx)("b",{children:ed.length})," im\xf3veis distintos",ev?" (de ".concat(ev," an\xfancios lidos)"):""," \xb7 ",(0,t.jsx)("b",{children:ej})," na conta",v&&(0,t.jsx)("span",{className:"text-gray-400",children:" \xb7 refazendo a contaâ¦"})]})]}),_&&(0,t.jsx)("button",{type:"button",onClick:C,disabled:N,className:"text-sm font-medium px-3 py-1.5 rounded-lg border border-primary-600 text-primary-700 hover:bg-primary-50 disabled:opacity-50",children:N?"Buscando nos portaisâ¦":ey?"Buscar de novo nos portais":"Buscar nos portais"}),$.instalado?(0,t.jsx)("button",{type:"button",onClick:G,disabled:Z,title:"Traz as p\xe1ginas de portal que voc\xea mandou pelo coletor do Chrome",className:"text-sm font-medium px-3 py-1.5 rounded-lg border border-primary-600 text-primary-700 hover:bg-primary-50 disabled:opacity-50",children:Z?"Trazendoâ¦":"Trazer do navegador".concat($.paginas?" (".concat($.paginas,")"):"")}):(0,t.jsx)("button",{type:"button",onClick:()=>U(e=>!e),className:"text-sm text-primary-700 hover:underline",children:"Puxar Zap, VivaReal, OLX e Im\xf3velWeb"}),eN>0&&(el?(0,t.jsxs)("span",{className:"flex items-center gap-1.5 rounded-lg border border-amber-200 bg-amber-50 px-2.5 py-1 text-xs text-amber-900",children:["Apagar os ",eN," im\xf3veis puxados dos portais, com as marcas?",(0,t.jsx)("button",{type:"button",onClick:()=>{R(),eo(new Set),en(!1)},className:"font-medium px-2 py-0.5 rounded-md bg-red-600 text-white hover:bg-red-700",children:"Limpar"}),(0,t.jsx)("button",{type:"button",onClick:()=>en(!1),className:"px-2 py-0.5 rounded-md hover:bg-white",children:"Cancelar"})]}):(0,t.jsx)("button",{type:"button",onClick:()=>en(!0),title:"Tira da lista tudo o que veio dos portais e do navegador â o que \xe9 da casa (fechados e acervo) fica",className:"text-sm font-medium px-3 py-1.5 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50",children:"Limpar puxados"})),(0,t.jsx)("button",{type:"button",onClick:z,className:"text-sm font-medium px-3 py-1.5 rounded-lg bg-gray-900 text-white hover:bg-gray-700 dark:bg-gray-100 dark:text-gray-900",children:"Voltar \xe0 ficha"})]}),Q&&!$.instalado&&(0,t.jsxs)("div",{className:"border-b border-gray-200 bg-white px-5 py-3 text-sm text-gray-700",children:[(0,t.jsx)("p",{className:"font-medium",children:"Zap, VivaReal, OLX e Im\xf3velWeb bloqueiam a busca autom\xe1tica â mas n\xe3o bloqueiam voc\xea."}),(0,t.jsxs)("ol",{className:"mt-1 list-decimal space-y-0.5 pl-5 text-xs text-gray-600",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("a",{href:"/coletor-imovia.zip",download:!0,className:"text-primary-700 underline",children:"Baixe o coletor do Chrome"})," ","e descompacte a pasta."]}),(0,t.jsxs)("li",{children:["No Chrome, abra ",(0,t.jsx)("b",{children:"chrome://extensions"}),", ligue o ",(0,t.jsx)("b",{children:"Modo do desenvolvedor"}
1)," e clique em ",(0,t.jsx)("b",{children:"Carregar sem compacta\xe7\xe3o"}),", escolhendo a pasta."]}),(0,t.jsxs)("li",{children:["Abra a busca no portal (bairro, tipo e metragem) e clique no bot\xe3o azul"," ",(0,t.jsx)("b",{children:"Mandar para o CRM (iMovia)"}),", no canto da p\xe1gina. Pode mandar v\xe1rias p\xe1ginas e v\xe1rios portais."]}),(0,t.jsxs)("li",{children:["Volte aqui e clique em ",(0,t.jsx)("b",{children:"Trazer do navegador"}),": os an\xfancios entram com foto, anunciante e repetidos agrupados."]})]})]}),k&&(0,t.jsx)("p",{className:"px-5 pt-2 text-sm text-red-600",children:k}),ey&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 px-5 pt-2 text-xs",children:ey.portais.map(e=>{var a,r;return(0,t.jsxs)("li",{className:e.ok?"text-gray-700":"text-gray-400",title:null!=(a=e.erro)?a:void 0,children:[e.ok?"â":"â"," ",e.nome,e.ok?" \xb7 ".concat(e.anuncios):" â ".concat(null!=(r=e.erro)?r:"n\xe3o respondeu")]},e.portal)})}),(0,t.jsxs)("div",{className:"grid min-h-0 flex-1 grid-cols-1 lg:grid-cols-[minmax(0,1fr)_380px] xl:grid-cols-[minmax(0,1fr)_440px]",children:[(0,t.jsxs)("section",{className:"flex min-h-0 flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-5 py-3",children:[[["todos","Todos"],["na_conta","Entram na avalia\xe7\xe3o"],["fora","Fora da avalia\xe7\xe3o"],["sem_marca","Sem marca"]].map(e=>{let[a,r]=e;return(0,t.jsx)("button",{type:"button",onClick:()=>ee(a),className:eS(K===a),children:r},a)}),ew.length>0&&(0,t.jsxs)("button",{type:"button",onClick:()=>M(ew,{decisao:"excluir"}),className:"text-xs text-gray-600 underline hover:text-gray-900",children:["Tirar todos da avalia\xe7\xe3o (",ew.length,")"]}),e_.length>0&&(0,t.jsxs)("button",{type:"button",onClick:()=>M(e_,{decisao:"incluir"}),className:"text-xs text-gray-600 underline hover:text-gray-900",children:["P\xf4r todos na avalia\xe7\xe3o (",e_.length,")"]}),(0,t.jsxs)("label",{className:"ml-2 flex items-center gap-1.5 text-xs text-gray-600",children:["Ordenar",(0,t.jsxs)("select",{value:ea,onChange:e=>er(e.target.value),className:"rounded-md border border-gray-300 bg-white px-2 py-1 text-xs",children:[(0,t.jsx)("option",{value:"m2",children:"R$/m\xb2 (menor primeiro)"}),(0,t.jsx)("option",{value:"preco",children:"Pre\xe7o (menor primeiro)"}),(0,t.jsx)("option",{value:"distancia",children:"Dist\xe2ncia (mais perto primeiro)"})]})]}),et.size>0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-600",children:[et.size," selecionado",et.size>1?"s":""]}),(0,t.jsx)("button",{type:"button",disabled:et.size<2,onClick:()=>{q([...et]),eo(new Set)},className:"text-xs font-medium px-3 py-1.5 rounded-lg bg-primary-600 text-white hover:bg-primary-700 disabled:opacity-40",children:"Juntar como o mesmo im\xf3vel"}),(0,t.jsx)("button",{type:"button",onClick:()=>eo(new Set),className:"text-xs text-gray-500 hover:text-gray-700",children:"Limpar"})]})]}),(0,t.jsxs)("p",{className:"px-5 pb-2 text-xs text-gray-500",children:["Marque cada im\xf3vel como ",(0,t.jsx)("b",{children:"pior"}),", ",(0,t.jsx)("b",{children:"parecido"})," ou ",(0,t.jsx)("b",{children:"melhor"}),' que o avaliado. Com 3 parecidos, a faixa passa a ser s\xf3 deles. An\xfancios repetidos: selecione os cart\xf5es (caixa no canto da foto) e junte. Cart\xe3o sem a caixa "Entra na avalia\xe7\xe3o" n\xe3o pode entrar â o motivo est\xe1 nele (raio, \xe1rea mais de 30% diferente, ou lan\xe7amento quando j\xe1 h\xe1 3 usados). N\xe3o h\xe1 limite de quantidade.']}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-6",children:0===eh.length?(0,t.jsx)("p",{className:"py-10 text-center text-sm text-gray-500",children:"Nenhum im\xf3vel neste filtro."}):(0,t.jsx)("ul",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(210px,1fr))]",children:eh.map(e=>(0,t.jsx)(w,{c:e,areaAlvo:ep,ref_:a=>{a?ec.current.set(e.id,a):ec.current.delete(e.id)},selecionado:es===e.id,marcado:et.has(e.id),onMarcadoAlternar:()=>{var a;return a=e.id,void eo(e=>{let r=new Set(e);return r.has(a)?r.delete(a):r.add(a),r})},onMarcar:S,onSeparar:A,onFoco:()=>ei(e.id)},e.id))})})]}),(0,t.jsxs)("aside",{className:"min-h-0 overflow-y-auto border-t border-gray-200 bg-white px-5 py-4 lg:border-l lg:border-t-0 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:"Mapa"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:b.map(e=>{var a;return(0,t.jsx)("button",{type:"button",onClick:()=>L(e.valor),disabled:null!=e.valor&&null==m.alvo.lat,className:"".concat(eS((null!=(a=m.raio_m)?a:null)===e.valor)," disabled:opacity-40"),children:e.rotulo},e.rotulo)})})]}),(0,t.jsx)("div",{className:"h-72",children:(0,t.jsx)(y,{alvo:m.alvo,itens:ed,raio:null!=(s=m.raio_m)?s:null,
1selecionado:es,onSelecionar:eC})}),(0,t.jsxs)("p",{className:"mt-1 text-[11px] text-gray-500",children:[null==m.alvo.lat?"O endere\xe7o do avaliado n\xe3o foi achado no mapa â o raio fica desligado. Confira o endere\xe7o na ficha e busque de novo.":"Pino = o im\xf3vel avaliado.",ef>0?" ".concat(ef," im\xf3ve").concat(1===ef?"l":"is"," sem ponto no mapa (o QuintoAndar s\xf3 informa a rua) â continuam na avalia\xe7\xe3o."):""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-gray-500",children:"Onde cada um cai (R$/m\xb2)"}),(0,t.jsx)(i,{itens:ed,area:ep,faixa:eg,valorDono:E,valorAvaliado:B,selecionado:es,onSelecionar:eC})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-gray-500",children:"Estudo de demanda"}),(0,t.jsx)(p,{itens:ed,area:ep,bairroId:F,tipo:m.alvo.tipo,finalidade:D,quartos:O,valorDono:E,avaliado:null!=(c=null!=B?B:null==eg?void 0:eg.mediana)?c:null,anuncio:H,minimo:Y.minimo,rendimentoMesPct:J.rendimentoMesPct,estudo:null!=(d=m.estudo)?d:null,onEstudo:X})]}),m.avisos.length>0&&(0,t.jsx)("div",{className:"space-y-1",children:m.avisos.map(e=>(0,t.jsx)("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-2 py-1.5 text-[11px] text-amber-800",children:e},e))}),(0,t.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-gray-50 p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"Calculado pelas refer\xeancias"}),(0,t.jsx)("p",{className:"text-lg font-semibold text-gray-900",children:eg?f(eg.mediana):"â"}),eg&&(0,t.jsxs)("p",{className:"text-[11px] text-gray-500",children:["entre ",f(eg.minimo)," e ",f(eg.maximo)," \xb7"," ",j(eg.preco_m2_mediano),m.criterio?" \xb7 com ".concat(m.criterio):""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-gray-500",children:"O dono pede"}),(0,t.jsx)("p",{className:"text-lg font-semibold text-gray-900",children:E?f(E):"â"}),E&&ep>0?(0,t.jsx)("p",{className:"text-[11px] text-gray-500",children:j(E/ep)}):null]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:["Avaliamos em ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(n.XR,{valor:B,onChange:P,centavos:!1,placeholder:"0"})}),eg&&(0,t.jsx)("button",{type:"button",onClick:()=>P(eg.mediana),className:"shrink-0 text-xs font-medium px-3 rounded-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50",children:"Usar o calculado"})]}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-gray-500",children:"O n\xfamero do avaliador \xe9 o que vai no parecer ao dono e vira o pre\xe7o do im\xf3vel quando a capta\xe7\xe3o for ganha. O calculado \xe9 s\xf3 refer\xeancia."})]}),(0,t.jsx)(h.A,{avaliado:B,anuncio:T,minimo:I,onAnuncio:W,onMinimo:V}),(0,t.jsx)("button",{type:"button",onClick:z,className:"w-full text-sm font-medium px-3 py-2 rounded-lg bg-primary-600 text-white hover:bg-primary-700",children:"Concluir e voltar \xe0 ficha"})]})]})]})]})}function w(e){var a,r,l,n,s,i,c;let d,{c:m,areaAlvo:x,ref_:u,selecionado:p,marcado:h,onMarcadoAlternar:y,onMarcar:b,onSeparar:k,onFoco:w}=e,[_,C]=(0,o.useState)(!1),[S,M]=(0,o.useState)(!!m.nota),q="pior"===m.condicao_relativa||"melhor"===m.condicao_relativa,R=!!(null!=(r=m.na_conta)?r:m.na_faixa)||q,A=m.na_faixa&&!m.fora_do_raio,L=null!=(l=m.membros)?l:[],B=[...new Map(L.filter(e=>e.anunciante).map(e=>[e.anunciante.nome,e.anunciante])).values()],E=(0,g.NG)(m,x),P=E?"N\xe3o pode entrar â ".concat(E):"excluir"===m.decisao?"Voc\xea tirou da avalia\xe7\xe3o":m.fora_da_curva?"Fora da curva: puxaria para ".concat("acima"===m.fora_da_curva?"cima":"baixo",' â marque "Entra na avalia\xe7\xe3o" para incluir mesmo assim'):null;return(0,t.jsxs)("li",{ref:u,onMouseEnter:w,className:"overflow-hidden rounded-xl border bg-white transition-shadow ".concat(p?"border-primary-600 ring-2 ring-primary-600":"border-gray-200"," ").concat(R?"":"opacity-60"),children:[(0,t.jsxs)("div",{className:"relative aspect-[3/2] bg-gray-100",children:[m.foto_url?(0,t.jsx)("img",{src:m.foto_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-xs text-gray-400",children:"portal"===m.fonte?"sem foto":N[m.fonte]}),"portal"===m.fonte&&(0,t.jsxs)("label",{className:"absolute left-2 top-2 flex items-center gap-1 rounded-md bg-white/90 px-1.5 py-1 text-[11px] text-gray-700 shadow-sm cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:h,onChange:y,"aria-label":"Selecionar para juntar"}),"juntar"]}),(0,t.jsx)("span",{className:"absolute right-2 top-2 rounded-md bg-gray-900/80 px-1.5 py-0.5 text-[11px] text-white",children:"portal"===m.fonte?(null!=(n=m.anuncios)?n:1)>1?"".concat(m.anuncios," an\xfancios"):"1 an\xfancio":N[m.fonte]})]}),(0,t.jsxs)("div",{className:"space-y-1.5 p-2.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-gray-900 ".concat(R?"":"line-through"),children:f(m.preco)}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:j(m.preco_m2)})]}),(0,t.jsxs)("p",{className:"text-xs text-gray-600",children:[m.area," m\xb2",m.quartos?" \xb7 ".concat(m.quartos," quartos"):"","novo"===m.condicao?" \xb7 lan\xe7amento":"",null!=m.distancia_m?" \xb7 ".concat(null==(d=m.distancia_m)?null:d>
1=1e3?"".concat((d/1e3).toLocaleString("pt-BR",{maximumFractionDigits:1})," km"):"".concat(d," m")," do avaliado"):"",m.local_aproximado?" (ponto aproximado)":""]}),(0,t.jsxs)("p",{className:"text-xs text-gray-800 break-words",children:[m.codigo?(0,t.jsx)("span",{className:"mr-1 font-mono text-[11px]",children:m.codigo}):null,null!=(s=m.endereco)?s:"sem endere\xe7o"]}),"portal"===m.fonte&&(0,t.jsx)("p",{className:"text-[11px] text-gray-600",children:B.length?B.map((e,a)=>(0,t.jsxs)("span",{children:[a>0?" \xb7 ":"",e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary-700",children:e.nome}):e.nome,(0,t.jsxs)("span",{className:"text-gray-400",children:[" ","(","pessoa"===e.tipo?"dono":"portal"===e.tipo?"portal":"imobili\xe1ria",")"]})]},e.nome)):"Anunciante n\xe3o informado"}),"portal"===m.fonte&&(null!=(i=null==(a=m.links)?void 0:a.length)?i:0)>0&&(0,t.jsx)("p",{className:"text-[11px] text-gray-500",children:m.links.map((e,a)=>{var r;return(0,t.jsxs)("span",{children:[a>0?" \xb7 ":"",(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary-700",children:["Abrir no ",null!=(r=g.x7[e.portal])?r:e.portal]})]},"".concat(e.url,"-").concat(a))})}),P&&(0,t.jsx)("p",{className:"inline-block rounded border border-amber-200 bg-amber-50 px-1.5 py-0.5 text-[11px] text-amber-800",children:P}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[v.map(e=>{let a=m.condicao_relativa===e.valor;return(0,t.jsxs)("button",{type:"button","aria-pressed":a,onClick:()=>b(m.id,{condicao_relativa:a?null:e.valor}),className:"text-[11px] px-1.5 py-0.5 rounded-full border ".concat(a?e.ativo:"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"),children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.simbolo})," ",e.rotulo]},e.valor)}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>!e),title:"Nota","aria-label":"Nota",className:"text-[11px] px-1.5 py-0.5 rounded-full border ".concat(S?"bg-gray-900 text-white border-gray-900":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"),children:"â"})]}),S&&(0,t.jsx)("input",{value:null!=(c=m.nota)?c:"",maxLength:80,onChange:e=>b(m.id,{nota:e.target.value},!0),placeholder:"Ex.: sem vaga, reformado, andar baixo",className:"w-full rounded-md border border-gray-300 px-2 py-1 text-[11px] focus:outline-none focus:ring-2 focus:ring-primary-500"}),A&&(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-gray-700 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:R,disabled:q,onCh
1ange:e=>b(m.id,{decisao:e.target.checked?"incluir":"excluir"})}),"Entra na avalia\xe7\xe3o",q&&(0,t.jsx)("span",{className:"text-[11px] text-gray-400",children:"(pior/melhor viram piso e teto)"})]}),L.length>1&&(0,t.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>C(e=>!e),className:"text-[11px] font-medium text-primary-700 hover:underline",children:[_?"Esconder":"Ver"," os ",L.length," an\xfancios deste im\xf3vel"]}),_&&(0,t.jsx)("ul",{className:"mt-2 space-y-2",children:L.map(e=>{var a,r,o,l;return(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-10 w-14 shrink-0 overflow-hidden rounded bg-gray-100",children:e.foto_url&&(0,t.jsx)("img",{src:e.foto_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 text-[11px] text-gray-600",children:[(0,t.jsxs)("p",{className:"truncate",children:[e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary-700",children:null!=(r=g.x7[e.portal])?r:e.portal}):null!=(o=g.x7[e.portal])?o:e.portal," \xb7 ",f(e.preco)," \xb7 ",e.area," m\xb2"]}),(0,t.jsx)("p",{className:"truncate text-gray-400",children:null!=(l=null==(a=e.anunciante)?void 0:a.nome)?l:"anunciante n\xe3o informado"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>k(e.chave),className:"shrink-0 text-[11px] px-2 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-50",title:"N\xe3o \xe9 o mesmo im\xf3vel: vira um im\xf3vel separado",children:"Separar"})]},e.chave)})})]})]})]})}}}]);
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.