1/* ANPG DEVTEAM - 29/09/2026, 14:34:20 */ 2import{e as oe,u as le,d as C,j as e}from"./data-vendor-BRYI0K8G.js";import{u as ne,r as h}from"./react-vendor-Bj9LQV-u.js";import{b as v,w as I,af as ce,ag as de,ah as me,ai as ue,bf as _e,bM as pe,bh as n,Z as x}from"./index-B5fS5HUA.js";import{I as i}from"./input-CtWCrhgd.js";import{L as t}from"./label-ByFBDaC1.js";import{T as c}from"./textarea-DpaYHtFE.js";import{B as F}from"./badge-jukGcCw8.js";import{T as he,a as ve,b as M,c as _,d as ge,e as d}from"./table-BTascmHv.js";import{S as j,a as y,b as f,c as N,d as m}from"./select-CIRt4Z_4.js";import{A as xe,a as je,b as ye,c as fe,d as Ne,e as be,f as Ce,g as we}from"./alert-dialog-J_9uTetV.js";import{C as Se,b as Fe,c as Ae,d as De,a as Ee}from"./card-SWKDiSm6.js";import{A as Oe}from"./AdminLayout-h_nmul7P.js";import{P as Pe}from"./plus-lNvdMfmK.js";import{S as Be}from"./search-B8XA8FkL.js";import{F as qe}from"./filter-zNpgdXs1.js";import{C as Te}from"./copy-DPqCuShI.js";import{P as Le}from"./pencil-C8r3g6iN.js";import{T as Ie}from"./trash-2-BmjaA2Y9.js";import"./charts-vendor-Cs07Jtv5.js";import"./motion-vendor-DMc3mo8t.js";import"./i18n-vendor-BSIZ7LIS.js";import"./index-BdQq_4o_.js";import"./index-BatE7gkT.js";import"./index-D6PzSG9l.js";import"./chevron-up-CYP72WxE.js";import"./message-square-3F19oJ7J.js";import"./newspaper-B1VsFBcy.js";import"./tag-zpo8YYRH.js";import"./camera-DF73IPZH.js";import"./shield-check-DBFg_Isw.js";import"./sliders-horizontal-CI8TRfgr.js";import"./user-check-Omtv7yGv.js";import"./network-Bioht48n.js";import"./clock-DjVV6Aw0.js";import"./book-open-BvZy1lzn.js";import"./bot-Ckp6pNDt.js";import"./gavel-D8KhpCGX.js";import"./presentation-Bg7Ve6-F.js";import"./star-BMTUmwlW.js";import"./clipboard-check-AscQTU3D.js";import"./folder-open-DBolFNfs.js";import"./settings-2-5vee-iyr.js";import"./rocket-OwwOM41y.js";import"./user-B2J0vviq.js";import"./arrow-left-B5pHXlkl.js";import"./circle-check-big-R1zEC76Q.js";function w(J){const l=J.trim();if(!l)return null;try{const p=JSON.parse(l);return Array.isArray(p)?p:null}catch{return null}}const U=["Kwanza","Benguela","Namibe","Congo","Cabinda"],A=[{value:"available",label:"DisponÃvel",color:"bg-status-success"},{value:"licensed",label:"Licenciado",color:"bg-status-info"},{value:"exploration",label:"Exploração",color:"bg-status-warning"},{value:"production",label:"Produção",color:"bg-primary"},{value:"relinquished",label:"Devolvido",color:"bg-status-neutral"}],G={block_name:"",basin:"",operator:"",status:"available",offer_type:"tender",block_type:"",area_km2:void 0,water_depth_m:void 0,description:"",seismic_data:"",geological_data:"",relevant_discoveries:"",brochure_url:"",teaser_url:"",gad_url:"",data_room_url:"",manifest_interest_url:"",investor_portal_url:"",contact_name:"",contact_email:"",contact_phone:"",opportunity_code:"",allows_manifestation:!0,interest_tags:"",opportunity_faq:"",opportunity_timeline:"",public_documents:"",reserved_documents:"",sort_order:0,is_active:!0,discovery_year:void 0,geological_formation:"",reservoir_type:"",estimated_reserves_mmboe:void 0,license_start:"",license_end:"",total_wells:void 0,active_wells:void 0,fpso_name:"",geological_notes:""};function Ea(){const l=ne().pathname.includes("/admin/opportunities"),p=oe(),[D,Z]=h.useState(""),[E,W]=h.useState("all"),[O,X]=h.useState("all"),[Y,S]=h.useState(!1),[b,P]=h.useState(null),[s,r]=h.useState(G),[g,B]=h.useState(null),{data:q,isLoading:k}=le({queryKey:["admin-blocks"],queryFn:async()=>(await x.list({sort:"block_name",limit:1e3})).data}),z=C({mutationFn:async a=>{await x.create(a)},onSuccess:()=>{p.invalidateQueries({queryKey:["admin-blocks"]}),n.success("Bloco criado com sucesso"),T()},onError:a=>{n.error(`Erro ao criar bloco: ${a.message}`)}}),R=C({mutationFn:async({id:a,data:o})=>{await x.update(a,o)},onSuccess:()=>{p.invalidateQueries({queryKey:["admin-blocks"]}),n.success("Bloco actualizado com sucesso"),T()},onError:a=>{n.error(`Erro ao actualizar bloco: ${a.message}`)}}),Q=C({mutationFn:async a=>{await x.delete(a)},onSuccess:()=>{p.invalidateQueries({queryKey:["admin-blocks"]}),n.success("Bloco eliminado com sucesso"),B(null)},onError:a=>{n.error(`Erro ao eliminar bloco: ${a.message}`)}}),K=C({mutationFn:async({id:a,isActive:o})=>{await x.update(a,{is_active:o})},onSuccess:(a,o)=>{p.invalidateQueries({queryKey:["admin-blocks"]}),n.success(o.isActive?"Oportunidade publicada com sucesso":"Oportunidade arquivada com sucesso")},onError:a=>{n.error(`Erro ao actualizar publicação: ${a.message}`)}}),V=C({mutationFn:async a=>{const o={...a};delete o.id,delete o.created_at,delete o.updated_at,o.block_name=`${a.block_name} (Cópia)`,o.is_active=!1,await x.create(o)},onSuccess:()=>{p.invalidateQueries({queryKey:["admin-blocks"]}),n.success("Registo duplicado com sucesso (guardado como rascunho).")},onError:a=>{n.error(`Erro ao duplicar registo: ${a.message}`)}}),ee=()=>{P(null),r(G),S(!0)},ae=a=>{P(a),r({block_name:a.block_name,basin:a.basin||"",operator:a.operator||"",status:a.status||"available",offer_type:a.offer_type||"tender",block_type:a.block_type||"",area_km2:a.area_km2?Number(a.area_km2):void 0,water_depth_m:a.water_depth_m||void 0,description:a.description||"",seismic_data:a.seismic_data||"",geological_data:a.geological_data||"",relevant_discoveries:a.relevant_discoveries||"",brochure_url:a.brochure_url||"",teaser_url:a.teaser_url||"",gad_url:a.gad_url||"",data_room_url:a.data_room_url||"",manifest_interest_url:a.manifest_interest_url||"",investor_portal_url:a.investor_portal_url||"",contact_name:a.contact_name||"",contact_email:a.contact_email||"",contact_phone:a.contact_phone||"",opportunity_code:a.opportunity_code||"",allows_manifestation:a.allows_manifestation!==!1&&a.allows_manifestation!==0,interest_tags:Array.isArray(a.interest_tags)?JSON.stringify(a.interest_tags,null,2):a.interest_tags||"",opportunity_faq:Array.isArray(a.opportunity_faq)?JSON.stringify(a.opportunity_faq,null,2):a.opportunity_faq||"",opportunity_timeline:Array.isArray(a.opportunity_timeline)?JSON.stringify(a.opportunity_timeline,null,2):a.opportunity_timeline||"",public_documents:Array.isArray(a.public_documents)?JSON.stringify(a.public_documents,null,2):a.public_documents||"",reserved_documents:Array.isArray(a.reserved_documents)?JSON.stringify(a.reserved_documents,null,2):a.reserved_documents||"",sort_order:a.sort_order||0,is_active:a.is_active!==!1&&a.is_active!==0,discovery_year:a.discovery_year||void 0,geological_formation:a.geological_formation||"",reservoir_type:a.reservoir_type||"",estimated_reserves_mmboe:a.estimated_reserves_mmboe?Number(a.estimated_reserves_mmboe):void 0,license_start:a.license_start||"",license_end:a.license_end||"",total_wells:a.total_wells||void 0,active_wells:a.active_wells||void 0,fpso_name:a.fpso_name||"",geological_notes:a.geological_notes||""}),S(!0)},T=()=>{S(!1),P(null),r(G)},se=a=>{if(a.preventDefault(),!s.block_name){n.error("Nome do bloco é obrigatório");return}const o={block_name:s.block_name,basin:s.basin||null,operator:s.operator||null,status:s.status||"available",offer_type:s.offer_type||"tender",block_type:s.block_type||null,area_km2:s.area_km2||null,water_depth_m:s.water_depth_m||null,description:s.description||null,seismic_data:s.seismic_data||null,geological_data:s.geological_data||null,relevant_discoveries:s.relevant_discoveries||null,brochure_url:s.brochure_url||null,teaser_url:s.teaser_url||null,gad_url:s.gad_url||null,data_room_url:s.data_room_url||null,manifest_interest_url:s.manifest_interest_url||null,investor_portal_url:s.investor_portal_url||null,contact_name:s.contact_name||null,contact_email:s.contact_email||null,contact_phone:s.contact_phone||null,opportunity_code:s.opportunity_code||null,allows_manifestation:s.allows_manifestation!==!1,interest_tags:w(String(s.interest_tags||"")),opportunity_faq:w(String(s.opportunity_faq||"")),opportunity_timeline:w(String(s.opportunity_timeline||"")),public_documents:w(String(s.public_documents||"")),reserved_documents:w(String(s.reserved_documents||"")),sort_order:Number(s.sort_order)||0,is_active:s.is_active!==!1,discovery_year:s.discovery_year||null,geological_formation:s.geological_formation||null,reservoir_type:s.reservoir_type||null,estimated_reserves_mmboe:s.estimated_reserves_mmboe||null,license_start:s.license_start||null,license_end:s.license_end||null,total_wells:s.total_wells||null,active_wells:s.active_wells||null,fpso_name:s.fpso_name||null,geological_notes:s.geological_notes||null};b?R.mutate({id:b.id,data:o}):z.mutate(o)},u=q==null?void 0:q.filter(a=>{var H;const o=a.block_name.toLowerCase().includes(D.toLowerCase())||((H=a.operator)==null?void 0:H.toLowerCase().includes(D.toLowerCase())),L=E==="all"||a.basin===E,ie=O==="all"||a.status===O;return o&&L&&ie}),re=a=>{const o=A.find(L=>
2L.value===a)||A[0];return e.jsx(F,{variant:"secondary",className:`${o.color} text-white`,children:o.label})},te=a=>a!==!1&&a!==0?e.jsx(F,{className:"bg-status-success text-white",children:"Publicada"}):e.jsx(F,{variant:"outline",children:"Arquivada/Rascunho"}),$=z.isPending||R.isPending;return e.jsxs(Oe,{title:l?"Gestão de Oportunidades":"Blocos PetrolÃferos",subtitle:l?"CMS operacional de oportunidades para o Portal do Investidor":"Gerir blocos de exploração e produção",children:[e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs(Se,{children:[e.jsx(Fe,{children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(Ae,{children:l?"Gestão de Oportunidades":"Gestão de Blocos"}),e.jsx(De,{children:l?"Gerir listagem, publicação, arquivo e duplicação de oportunidades.":"Gerir blocos petrolÃferos, concessões e operadores"})]}),e.jsxs(v,{onClick:ee,children:[e.jsx(Pe,{className:"h-4 w-4 mr-2"}),l?"Nova Oportunidade":"Novo Bloco"]})]})}),e.jsxs(Ee,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(i,{placeholder:"Pesquisar por nome ou operador...",value:D,onChange:a=>Z(a.target.value),className:"pl-10"})]}),e.jsxs(j,{value:E,onValueChange:W,children:[e.jsxs(y,{className:"w-full sm:w-[180px]",children:[e.jsx(qe,{className:"h-4 w-4 mr-2"}),e.jsx(f,{placeholder:"Bacia"})]}),e.jsxs(N,{children:[e.jsx(m,{value:"all",children:"Todas as Bacias"}),U.map(a=>e.jsx(m,{value:a,children:a},a))]})]}),e.jsxs(j,{value:O,onValueChange:X,children:[e.jsx(y,{className:"w-full sm:w-[180px]",children:e.jsx(f,{placeholder:"Estado"})}),e.jsxs(N,{children:[e.jsx(m,{value:"all",children:"Todos os Estados"}),A.map(a=>e.jsx(m,{value:a.value,children:a.label},a.value))]})]})]}),k?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(I,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"rounded-md border",children:e.jsxs(he,{children:[e.jsx(ve,{children:e.jsxs(M,{children:[e.jsx(_,{children:"Nome"}),e.jsx(_,{children:"Bacia"}),e.jsx(_,{children:"Operador"}),e.jsx(_,{children:"Ãrea (km²)"}),e.jsx(_,{children:"Prof. Ãgua (m)"}),e.jsx(_,{children:"Estado"}),l&&e.jsx(_,{children:"Permite MI"}),l&&e.jsx(_,{children:"Publicação"}),e.jsx(_,{className:"text-right",children:"Acções"})]})}),e.jsx(ge,{children:(u==null?void 0:u.length)===0?e.jsx(M,{children:e.jsx(d,{colSpan:l?9:7,className:"text-center py-8 text-muted-foreground",children:"Nenhum bloco encontrado"})}):u==null?void 0:u.map(a=>e.jsxs(M,{children:[e.jsx(d,{className:"font-medium",children:a.block_name}),e.jsx(d,{children:a.basin||"â"}),e.jsx(d,{children:a.operator||"â"}),e.jsx(d,{children:a.area_km2?Number(a.area_km2).toLocaleString():"â"}),e.jsx(d,{children:a.water_depth_m?a.water_depth_m.toLocaleString():"â"}),e.jsx(d,{children:re(a.status)}),l&&e.jsx(d,{children:e.jsx(F,{variant:a.allows_manifestation!==!1&&a.allows_manifestation!==0?"default":"outline",children:a.allows_manifestation!==!1&&a.allows_manifestation!==0?"Sim":"Não"})}),l&&e.jsx(d,{children:te(a.is_active)}),e.jsx(d,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[l&&e.jsxs(e.Fragment,{children:[e.jsx(v,{variant:"ghost",size:"icon",title:"Duplicar",onClick:()=>V.mutate(a),disabled:V.isPending,children:e.jsx(Te,{className:"h-4 w-4"})}),e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>K.mutate({id:a.id,isActive:!(a.is_active!==!1&&a.is_active!==0)}),disabled:K.isPending,children:a.is_active!==!1&&a.is_active!==0?"Arquivar":"Publicar"})]}),e.jsx(v,{variant:"ghost",size:"icon",onClick:()=>ae(a),children:e.jsx(Le,{className:"h-4 w-4"})}),e.jsx(v,{variant:"ghost",size:"icon",onClick:()=>B(a),children:e.jsx(Ie,{className:"h-4 w-4 text-destructive"})})]})})]},a.id))})]})}),e.jsxs("div",{className:"mt-4 text-sm text-muted-foreground",children:[(u==null?void 0:u.length)||0," bloco(s) encontrado(s)"]})]})]})}),e.jsx(ce,{open:Y,onOpenChange:S,children:e.jsxs(de,{className:"sm:max-w-[700px] max-h-[85vh] overflow-y-auto",children:[e.jsxs(me,{children:[e.jsx(ue,{children:b?"Editar Bloco":"Criar Novo Bloco"}),e.jsx(_e,{children:b?"Actualizar informações do bloco petrolÃfero":"Preencha os dad
2os do novo bloco petrolÃfero"})]}),e.jsxs("form",{onSubmit:se,children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"block_name",children:"Nome do Bloco *"}),e.jsx(i,{id:"block_name",value:s.block_name||"",onChange:a=>r({...s,block_name:a.target.value}),placeholder:"Ex: Bloco 15",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"basin",children:"Bacia"}),e.jsxs(j,{value:s.basin||"",onValueChange:a=>r({...s,basin:a}),children:[e.jsx(y,{children:e.jsx(f,{placeholder:"Seleccionar bacia"})}),e.jsx(N,{children:U.map(a=>e.jsx(m,{value:a,children:a},a))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"operator",children:"Operador"}),e.jsx(i,{id:"operator",value:s.operator||"",onChange:a=>r({...s,operator:a.target.value}),placeholder:"Ex: TotalEnergies"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"status",children:"Estado"}),e.jsxs(j,{value:s.status||"available",onValueChange:a=>r({...s,status:a}),children:[e.jsx(y,{children:e.jsx(f,{})}),e.jsx(N,{children:A.map(a=>e.jsx(m,{value:a.value,children:a.label},a.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"offer_type",children:"Tipo de Oferta"}),e.jsx(i,{id:"offer_type",value:s.offer_type||"",onChange:a=>r({...s,offer_type:a.target.value}),placeholder:"Ex: permanent_offer"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"block_type",children:"Tipo de Bloco"}),e.jsx(i,{id:"block_type",value:s.block_type||"",onChange:a=>r({...s,block_type:a.target.value}),placeholder:"Ex: Onshore / Offshore"})]})]}),l&&e.jsxs("div",{className:"border rounded-md p-4 space-y-4 bg-primary/5 border-primary/20",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Governança da Oportunidade (CMS)"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"opportunity_code",children:"Código da Oportunidade"}),e.jsx(i,{id:"opportunity_code",value:s.opportunity_code||"",onChange:a=>r({...s,opportunity_code:a.target.value}),placeholder:"Ex: OPP-2026-001"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"allows_manifestation",children:"Permite Manifestação"}),e.jsxs(j,{value:s.allows_manifestation===!1?"no":"yes",onValueChange:a=>r({...s,allows_manifestation:a==="yes"}),children:[e.jsx(y,{id:"allows_manifestation",children:e.jsx(f,{})}),e.jsxs(N,{children:[e.jsx(m,{value:"yes",children:"Sim"}),e.jsx(m,{value:"no",children:"Não"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"interest_tags",children:"Ãreas de Interesse (JSON array de texto)"}),e.jsx(c,{id:"interest_tags",value:String(s.interest_tags||""),onChange:a=>r({...s,interest_tags:a.target.value}),rows:3,placeholder:'["Gás", "Offshore", "Onshore"]'})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"public_documents",children:"Documentação Pública (JSON)"}),e.jsx(c,{id:"public_documents",value:String(s.public_documents||""),onChange:a=>r({...s,public_documents:a.target.value}),rows:5,placeholder:'[{"title":"Brochura","url":"/docs/brochura.pdf"}]'})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"reserved_documents",children:"Documentação Reservada (JSON)"}),e.jsx(c,{id:"reserved_documents",value:String(s.reserved_documents||""),onChange:a=>r({...s,reserved_documents:a.target.value}),rows:5,placeholder:'[{"title":"Data Room","url":"/docs/dataroom.zip"}]'})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"opportunity_timeline",children:"Cronograma (JSON)"}),e.jsx(c,{id:"opportunity_timeline",value:String(s.opportunity_timeline||""),onChange:a=>r({...s,opportunity_timeline:a.target.value}),rows:5,placeholder:'[{"date":"2026-10-01","label":"Abertura"}]'})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"opportunity_faq",children:"FAQ (JSON)"}),e.jsx(c,{id:"opportunity_faq",value:String(s.opportunity_faq||""),onChange:a=>r({...s,opportunity_faq:a.target.value}),rows:5,placeholder:'[{"question":"Como participar?","answer":"..."}]'})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"area_km2",children:"Ãrea (km²)"}),e.jsx(i,{id:"area_km2",type:"number",value:s.area_km2||"",onChange:a=>r({...s,area_km2:a.target.value?Number(a.target.value):void 0}),placeholder:"Ex: 5000"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"water_depth_m",children:"Profundidade da Ãgua (m)"}),e.jsx(i,{id:"water_depth_m",type:"number",value:s.water_depth_m||"",onChange:a=>r({...s,water_depth_m:a.target.value?Number(a.target.value):void 0}),placeholder:"Ex: 1500"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"description",children:"Descrição"}),e.jsx(c,{id:"description",value:s.description||"",onChange:a=>r({...s,description:a.target.value}),placeholder:"Informações adicionais sobre o bloco...",rows:3})]}),e.jsxs("div",{className:"border-t pt-4 mt-2",children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Dados técnicos e ligações do investidor"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"seismic_data",children:"Dados SÃsmicos"}),e.jsx(c,{id:"seismic_data",value:s.seismic_data||"",onChange:a=>r({...s,seismic_data:a.target.value}),rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"geological_data",children:"Dados Geológicos"}),e.jsx(c,{id:"geological_data",value:s.geological_data||"",onChange:a=>r({...s,geological_data:a.target.value}),rows:3})]})]}),e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsx(t,{htmlFor:"relevant_discoveries",children:"Descobertas Relevantes"}),e.jsx(c,{id:"relevant_discoveries",value:s.relevant_discoveries||"",onChange:a=>r({...s,relevant_discoveries:a.target.value}),rows:3})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"brochure_url",children:"Link Brochura"}),e.jsx(i,{id:"brochure_url",value:s.brochure_url||"",onChange:a=>r({...s,brochure_url:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"teaser_url",children:"Link Teaser"}),e.jsx(i,{id:"teaser_url",value:s.teaser_url||"",onChange:a=>r({...s,teaser_url:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"gad_url",children:"Link GAD"}),e.jsx(i,{id:"gad_url",value:s.gad_url||"",onChange:a=>r({...s,gad_url:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"data_room_url",children:"Link Data Room"}),e.jsx(i,{id:"data_room_url",value:s.data_room_url||"",onChange:a=>r({...s,data_room_url:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"manifest_interest_url",children:"Link Manifestação de Interesse"}),e.jsx(i,{id:"manifest_interest_url",value:s.manifest_interest_url||"",onChange:a=>r({...s,manifest_interest_url:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"investor_portal_url",children:"Link Portal do Investidor"}),e.jsx(i,{id:"investor_portal_url",value:s.investor_portal_url||"",onChange:a=>r({...s,investor_portal_url:a.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"contact_name",children:"Contacto Associado"}),e.jsx(i,{id:"contact_name",value:s.contact_name||"",onChange:a=>r({...s,contact_name:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"contact_email",children:"Email de C
2ontacto"}),e.jsx(i,{id:"contact_email",value:s.contact_email||"",onChange:a=>r({...s,contact_email:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"contact_phone",children:"Telefone de Contacto"}),e.jsx(i,{id:"contact_phone",value:s.contact_phone||"",onChange:a=>r({...s,contact_phone:a.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"sort_order",children:"Ordem"}),e.jsx(i,{id:"sort_order",type:"number",value:s.sort_order||0,onChange:a=>r({...s,sort_order:a.target.value?Number(a.target.value):0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"is_active",children:"Activo"}),e.jsxs(j,{value:s.is_active===!1?"inactive":"active",onValueChange:a=>r({...s,is_active:a==="active"}),children:[e.jsx(y,{children:e.jsx(f,{})}),e.jsxs(N,{children:[e.jsx(m,{value:"active",children:"Activo"}),e.jsx(m,{value:"inactive",children:"Inactivo"})]})]})]})]})]}),e.jsxs("div",{className:"border-t pt-4 mt-2",children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Informação Geológica e Licença"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"discovery_year",children:"Ano de Descoberta"}),e.jsx(i,{id:"discovery_year",type:"number",value:s.discovery_year||"",onChange:a=>r({...s,discovery_year:a.target.value?Number(a.target.value):void 0}),placeholder:"Ex: 1996"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"estimated_reserves_mmboe",children:"Reservas Estimadas (MMboe)"}),e.jsx(i,{id:"estimated_reserves_mmboe",type:"number",value:s.estimated_reserves_mmboe||"",onChange:a=>r({...s,estimated_reserves_mmboe:a.target.value?Number(a.target.value):void 0}),placeholder:"Ex: 500"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"geological_formation",children:"Formação Geológica"}),e.jsx(i,{id:"geological_formation",value:s.geological_formation||"",onChange:a=>r({...s,geological_formation:a.target.value}),placeholder:"Ex: Pinda, Albian"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"reservoir_type",children:"Tipo de Reservatório"}),e.jsx(i,{id:"reservoir_type",value:s.reservoir_type||"",onChange:a=>r({...s,reservoir_type:a.target.value}),placeholder:"Ex: TurbidÃtico, Carbonático"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"license_start",children:"InÃcio da Licença"}),e.jsx(i,{id:"license_start",type:"date",value:s.license_start||"",onChange:a=>r({...s,license_start:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"license_end",children:"Fim da Licença"}),e.jsx(i,{id:"license_end",type:"date",value:s.license_end||"",onChange:a=>r({...s,license_end:a.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"total_wells",children:"Total de Poços"}),e.jsx(i,{id:"total_wells",type:"number",value:s.total_wells||"",onChange:a=>r({...s,total_wells:a.target.value?Number(a.target.value):void 0}),placeholder:"0"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"active_wells",children:"Poços Activos"}),e.jsx(i,{id:"active_wells",type:"number",value:s.active_wells||"",onChange:a=>r({...s,active_wells:a.target.value?Number(a.target.value):void 0}),placeholder:"0"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{htmlFor:"fpso_name",children:"Nome do FPSO"}),e.jsx(i,{id:"fpso_name",value:s.fpso_name||"",onChange:a=>r({...s,fpso_name:a.target.value}),placeholder:"Ex: FPSO Dália"})]})]}),e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsx(t,{htmlFor:"geological_notes",children:"Notas Geológicas"}),e.jsx(c,{id:"geological_notes",value:s.geological_notes||"",onChange:a=>r({...s,geological_notes:a.target.value}),placeholder:"Notas técnicas adicionais sobre a geologia do bloco...",rows:3})]})]})]}),e.jsxs(pe,{children:[e.jsx(v,{type:"button",variant:"outline",onClick:T,children:"Cancelar"}),e.jsxs(v,{type:"submit",disabled:$,children:[$&&e.jsx(I,{className:"h-4 w-4 mr-2 animate-spin"}),b?"Guardar Alterações":"Criar Bloco"]})]})]})]})}),e.jsx(xe,{open:!!g,onOpenChange:()=>B(null),children:e.jsxs(je,{children:[e.jsxs(ye,{children:[e.jsx(fe,{children:"Eliminar Bloco"}),e.jsxs(Ne,{children:['Tem a certeza que deseja eliminar o bloco "',g==null?void 0:g.block_name,'"? Esta acção não pode ser revertida.']})]}),e.jsxs(be,{children:[e.jsx(Ce,{children:"Cancelar"}),e.jsx(we,{onClick:()=>g&&Q.mutate(g.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Q.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):"Eliminar"})]})]})})]})}export{Ea as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.