1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[503],{11312:(e,a,t)=>{t.d(a,{K7:()=>i,Wr:()=>d,qT:()=>n});var l=t(95155),r=t(80021),s=t(23327),o=t(46767);function n(e){let{text:a,className:t=""}=e;return(0,l.jsx)(o.Bc,{delayDuration:150,children:(0,l.jsxs)(o.m_,{children:[(0,l.jsx)(o.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"More info",className:"inline-flex text-gray-400 hover:text-indigo-600 ".concat(t),children:(0,l.jsx)(r.A,{className:"h-3.5 w-3.5"})})}),(0,l.jsx)(o.ZI,{className:"max-w-xs text-xs leading-relaxed",children:a})]})})}function i(e){let{label:a,tip:t,htmlFor:r,className:s="block text-sm font-medium text-gray-700"}=e;return(0,l.jsxs)("label",{htmlFor:r,className:"".concat(s," flex items-center gap-1"),children:[a,(0,l.jsx)(n,{text:t})]})}function d(e){let{title:a,children:t}=e;return(0,l.jsxs)("div",{className:"flex gap-2 rounded-lg border border-blue-200 bg-blue-50 p-3 text-xs text-blue-900",children:[(0,l.jsx)(s.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-blue-500"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-semibold",children:a}),(0,l.jsx)("div",{className:"mt-0.5 leading-relaxed text-blue-800",children:t})]})]})}},21873:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(71847).A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},23327:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},46767:(e,a,t)=>{t.d(a,{Bc:()=>n,ZI:()=>c,k$:()=>d,m_:()=>i});var l=t(95155),r=t(12115),s=t(69216),o=t(64269);let n=s.Kq,i=s.bL,d=s.l9,c=r.forwardRef((e,a)=>{let{className:t,sideOffset:r=4,...n}=e;return(0,l.jsx)(s.ZL,{children:(0,l.jsx)(s.UC,{ref:a,sideOffset:r,className:(0,o.cn)("z-50 overflow-hidden rounded-[4px] border border-warm-border bg-white px-3 py-1.5 text-sm text-[#6b7384] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",t),...n})})});c.displayName=s.UC.displayName},52260:(e,a,t)=>{function l(e){if(null==e||e<=0)return"â";let a=Math.round(e/1e3);if(a<90)return"~".concat(a,"s");let t=Math.floor(a/60),l=a%60;return l?"~".concat(t,"m").concat(l,"s"):"~".concat(t,"m")}function r(e){return e?"historical"===e.latency_source?"Tempo mediano de ".concat(e.n," gera\xe7\xe3o(\xf5es) reais deste modelo."):"Tempo estimado por tokens â ainda sem hist\xf3rico medido.":""}t.d(a,{X:()=>l,q:()=>r})},70503:(e,a,t)=>{t.r(a),t.d(a,{RetratoTab:()=>f});var l=t(95155),r=t(12115),s=t(20063),o=t(89715),n=t(21873),i=t(80344),d=t(88832),c=t(52260),u=t(11312),m=t(43435);let x=[{value:"build_house",label:"Construir casa"},{value:"buy_land",label:"Comprar terreno"},{value:"tourism",label:"Turismo rural"},{value:"agriculture",label:"Agricultura"},{value:"warehouse",label:"Armaz\xe9m / neg\xf3cio"},{value:"just_checking",label:"S\xf3 a ver"}],h=[{value:"auto",label:"Auto (parcela ou ponto)"},{value:"point",label:"Ponto"},{value:"area",label:"\xc1rea desenhada"}],p=["gpt-5.6","gpt-5.5","gpt-5-mini","gpt-5-nano","o4-mini"],g=["minimal","low","medium","high"],v=[{value:"pt-PT",label:"Portugu\xeas"},{value:"en",label:"English"}],b=[{value:"v2",label:"Layout: v2 (novo)"},{value:"v1",label:"Layout: v1 (atual)"}];function f(){var e,a;let t=(0,d.v)(),f=(0,s.useSearchParams)(),j=(0,s.useRouter)(),y=(0,s.usePathname)(),[N,w]=(0,r.useState)(()=>{var e;return null!=(e=f.get("lat"))?e:"37.125"}),[k,C]=(0,r.useState)(()=>{var e;return null!=(e=f.get("lon"))?e:"-8.563"}),[S,A]=(0,r.useState)(null),[_,M]=(0,r.useState)("build_house"),[R,q]=(0,r.useState)("auto"),[E,L]=(0,r.useState)("pt-PT"),[T,z]=(0,r.useState)("v2"),[P,F]=(0,r.useState)(""),[U,D]=(0,r.useState)(""),[O,H]=(0,r.useState)(null),I="area"===R,[B,Z]=(0,r.useState)(!1),[$,G]=(0,r.useState)(null),[K,W]=(0,r.useState)(""),[X,V]=(0,r.useState)(!1),[J,Q]=(0,r.useState)(null);(0,r.useEffect)(()=>
1{if(!t)return;let e=!0;return i.uE.landAgentReportCostEstimates().then(a=>{e&&Q(a)}).catch(()=>{}),()=>{e=!1}},[t]);let Y=(0,r.useCallback)((e,a)=>{let t=new URLSearchParams(f.toString());t.set("lat",String(e)),t.set("lon",String(a)),j.replace("".concat(y,"?").concat(t.toString()),{scroll:!1})},[f,j,y]),ee=(0,r.useCallback)((e,a)=>{w(String(e)),C(String(a)),A({lat:e,lng:a}),H(null),Y(e,a)},[Y]),ea=(0,r.useRef)(0),et=async()=>{let e=Number(N),a=Number(k);if(!t||Number.isNaN(e)||Number.isNaN(a))return;if("area"===R&&!O)return void W("Desenhe uma \xe1rea no mapa antes de gerar.");let l=++ea.current;Z(!0),W(""),G("A prepararâ¦"),V(!1);try{let t=(await i.uE.landAgentCreateSession({language:E,user_goal:_})).public_id;if(await i.uE.landAgentSetLocation(t,{location_type:"area"===R?"area":R,lat:"area"===R?null:e,lon:"area"===R?null:a,resolve_containing_parcel:"auto"===R,geometry:"area"===R?O:null}),l!==ea.current)return;let r=await i.uE.landAgentCreateReport(t,R,E,{report_layout:T,model:P||void 0,reasoning_effort:U||void 0}),s=r.id,o=r.report_status||"queued";for(;"done"!==o&&"error"!==o;){if(await new Promise(e=>setTimeout(e,3e3)),l!==ea.current)return;try{o=(await i.uE.landAgentGetReport(t,s)).report_status||o,l===ea.current&&G(el(o))}catch(e){}}if(l!==ea.current)return;if("error"===o)return void W("Falha ao gerar o relat\xf3rio Retrato");let{blob:n}=await i.uE.landAgentDownloadReport(t,s),d=URL.createObjectURL(n),c=document.createElement("a");c.href=d,c.download="retrato-".concat(T,"-").concat(_,".pdf"),document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(d),1e3),V(!0)}catch(e){l===ea.current&&W(e instanceof Error?e.message:"Falha ao gerar o relat\xf3rio")}finally{l===ea.current&&(Z(!1),G(null))}},el=e=>{switch(e){case"queued":return"Na filaâ¦";case"running":return"A gerar PDFâ¦";default:return"A gerarâ¦"}},er=J?P||J.defaults.report.model:"",es=J?U||J.defaults.report.reasoning||"low":"",eo=J&&null!=(a=null==(e=J.estimates[P||"default"])?void 0:e[U||J.defaults.report.reasoning||"low"])?a:null,en=(null==eo?void 0:eo.report_usd)==null?"â":"â $".concat(eo.report_usd.toFixed(4)),ei=(0,c.X)(null==eo?void 0:eo.latency_ms),ed=t&&!B&&("area"!==R||null!=O),ec="mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-indigo-500 focus:outline-none",eu="block text-xs font-medium text-gray-700";return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)(u.Wr,{title:"Retrato do Terreno (v2)",children:["Pr\xe9-visualiza\xe7\xe3o do relat\xf3rio ",(0,l.jsx)("b",{children:"Retrato do Terreno"})," antes de o publicar em"," ",(0,l.jsx)("code",{children:"/terra/explorar"}),". Escolha o terreno e o ",(0,l.jsx)("b",{children:"objetivo"})," â no layout v2 o relat\xf3rio \xe9 reorganizado \xe0 volta desse objetivo (abertura âO essencialâ, envolvente com leitura, âO que investigarâ, âSinais locaisâ). Corre o rail real (sess\xe3o â localiza\xe7\xe3o â relat\xf3rio), pelo que precisa do worker local. Admins n\xe3o consomem quota. Compare v1 \xd7 v2 do mesmo terreno."]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,l.jsxs)("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-white p-4",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Objetivo"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:eu,children:"O que quer fazer no terreno?"}),(0,l.jsx)("select",{value:_,onChange:e=>M(e.target.value),className:ec,children:x.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:eu,children:"Tipo de an\xe1lise"}),(0,l.jsx)("select",{value:R,onChange:e=>{q(e.target.value),H(null)},className:ec,children:h.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("label",{className:eu,children:"Latitude"}),(0,l.jsx)("input",{value:N,onChange:e=>w(e.target.value),inputMode:"decimal",className:ec})]}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("label",{className:eu,children:"Longitude"}),(0,l.jsx)("input",{value:k,onChange:e=>C(e.target.value),inputMode:"decimal",className:ec})]})]}),(0,l.jsxs)("div",{className:"border-t border-gray-100 pt-3 space-y-2",children:[(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("select",{value:T,onChange:e=>z(e.target.value),disabled:B,title:"Layout do relat\xf3rio â v2 \xe9 o novo; v1 \xe9 o produto atual (para A/B)",className:ec,children:b.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,l.jsx)("select",{value:E,onChange:e=>L(e.target.value),disabled:B,title:"Idioma do relat\xf3rio",className:ec,children:v.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("select",{value:P,onChange:e=>F(e.target.value),disabled:B,title:"Modelo LLM da narrativa (predefinido = configura\xe7\xe3o do pipeline)",className:ec,children:[(0,l.jsx)("option",{value:"",children:"Modelo: predefinido"}),p.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]}),(0,l.jsxs)("select",{value:U,onChange:e=>D(e.target.value),disabled:B,title:"N\xedvel de racioc\xednio (modelos gpt-5
1*/o*)",className:ec,children:[(0,l.jsx)("option",{value:"",children:"Racioc\xednio: predefinido"}),g.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})]}),J&&(0,l.jsxs)("div",{className:"rounded-md bg-indigo-50/70 px-2.5 py-1.5 text-xs text-gray-700",children:[(0,l.jsxs)("span",{className:"font-semibold text-indigo-700",children:["Estimativa \xb7 ",er," \xb7 ",es]})," ",(0,l.jsx)("span",{title:"Custo estimado (USD) da chamada de narrativa deste relat\xf3rio.",children:(0,l.jsx)("b",{children:en})})," ",(0,l.jsx)("span",{className:"text-gray-400",children:"\xb7"})," ",(0,l.jsxs)("span",{title:(0,c.q)(eo),children:["Tempo: ",(0,l.jsx)("b",{children:ei})]})]}),(0,l.jsxs)("button",{onClick:()=>void et(),disabled:!ed,className:"w-full flex items-center justify-center gap-1 rounded-md bg-indigo-600 px-4 py-2 text-sm font-semibold text-white hover:bg-indigo-700 disabled:opacity-50",children:[(0,l.jsx)(o.A,{className:"h-4 w-4"})," ",B?null!=$?$:"A gerarâ¦":"Gerar relat\xf3rio Retrato"]}),K&&(0,l.jsx)("p",{className:"text-sm text-red-600",children:K}),X&&(0,l.jsx)("p",{className:"text-xs text-emerald-700",children:"Relat\xf3rio descarregado â cada gera\xe7\xe3o fica registada para auditoria de custo/qualidade."})]})]}),(0,l.jsxs)("div",{className:"space-y-3 lg:col-span-2",children:[(0,l.jsx)(m.B,{pin:S,onPick:e=>{I||ee(e.lat,e.lng)},drawMode:I,onDrawComplete:e=>{let a=e.coordinates[0],t=a.length-1,l=0,r=0;for(let e=0;e<t;e++)l+=a[e][0],r+=a[e][1];H(e),ee(r/t,l/t)},onDrawClear:()=>H(null)}),(0,l.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-white p-3 text-xs text-gray-500",children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-indigo-600"}),S?"".concat(S.lat.toFixed(5),", ").concat(S.lng.toFixed(5)):"Clique no mapa (ou introduza coordenadas) para escolher o terreno.",I&&(0,l.jsx)("span",{children:"\xb7 desenhe a \xe1rea no mapa"})]})]})]})]})}},80021:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(71847).A)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},89715:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(71847).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])}}]);
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.