PageSourceSearch

https://diligentenergy.ai/_next/static/chunks/47857-43f100a453ed6ecd.js

js diligentenergy.ai collected 2026-10-05 13:55:35 UTC 16,107 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d2dbfc56-6527-4f82-a12b-b93db6ef4ab8",e._sentryDebugIdIdentifier="sentry-dbid-d2dbfc56-6527-4f82-a12b-b93db6ef4ab8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[47857],{47857:(e,t,s)=>{s.r(t),s.d(t,{default:()=>S});var a=s(95155),r=s(12115),n=s(62804),l=s(83209),i=s(67812),o=s(97003),d=s(67001),c=s(31558),u=s(54664),m=s(54679),h=s(96633),p=s(35299),x=s(87066),f=s(39867),w=s(24722),j=s(14285),y=s(18085),g=s(32978),b=s(61362),N=s(65820);function v(e,t,s){return"".concat(e," ").concat(1===e?t:s)}let k={critical:"text-rose-600 dark:text-rose-400",high:"text-rose-600 dark:text-rose-400",medium:"text-amber-600 dark:text-amber-400",low:"text-muted-foreground"},_={open:"Awaiting answer",answered:"Answered",closed:"Closed",not_available:"Not available"};function A(e){if(!e)return"—";try{return new Date(e).toLocaleDateString()}catch(t){return e}}function S(){let e=(0,n.M9)()||"",[t,s]=(0,r.useState)([]),[S,C]=(0,r.useState)(!0),[T,R]=(0,r.useState)(!1),[E,D]=(0,r.useState)(null),[I,z]=(0,r.useState)({}),[P,O]=(0,r.useState)(null),[$,W]=(0,r.useState)(null),[F,H]=(0,r.useState)(null),[q,J]=(0,r.useState)(null),[M,U]=(0,r.useState)(null),[Y,Z]=(0,r.useState)(null),B=(0,r.useRef)(null),L=(0,r.useRef)(null),X=(0,r.useRef)(null),G=(0,r.useCallback)(async()=>{if(e)try{let t=await fetch("/api/projects/".concat(e,"/rfi"));if(!t.ok)return void R(!0);let a=await t.json(),r=(null==a?void 0:a.rounds)||[];s(r),R(!1),D(e=>e||(r.length?r[r.length-1].id:null))}catch(e){console.error("[rfi] failed to load rounds",e),R(!0)}finally{C(!1)}},[e]);(0,r.useEffect)(()=>{G()},[G]);let K=(0,r.useMemo)(()=>t.find(e=>e.id===E)||null,[t,E]),Q=(0,r.useRef)(null),V=async()=>{if(Q.current)return Q.current;let t=await fetch("/api/projects/".concat(e));if(!t.ok)throw Error("project_meta");let s=await t.json();if(!(null==s?void 0:s.client_schema))throw Error("project_meta");return Q.current={client_schema:s.client_schema,client_id:s.client_id},Q.current},ee=async t=>{let s=await V(),a=t.type||"application/octet-stream",r=await fetch("/api/projects/".concat(e,"/documents/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:t.name,contentType:a,clientSchema:s.client_schema})});if(!r.ok)throw Error("sign");let n=await r.json();if(!(null==n?void 0:n.url))throw Error("sign");if(!(await fetch(n.url,{method:n.method||"PUT",headers:n.headers||{"Content-Type":a},body:t})).ok)throw Error("storage");if(!(await fetch("/api/projects/".concat(e,"/documents/upload/record"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e,fileName:t.name,filePath:n.blobName||"",fileSize:t.size||0,fileType:a,clientSchema:s.client_schema,clientId:s.client_id,metadata:{upload_context:"information_requests"}})})).ok)throw Error("record");return{name:t.name,path:n.blobName||"",size:t.size,content_type:a}},et=async function(t){var s,a;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null!=(a=null!=(s=I[t.id])?s:t.answer_text)?a:"",l=r.status||"answered";if("answered"===l&&!n.trim()&&!(r.attachments||[]).length)return void N.oR.error("Write an answer or attach the document first");O(t.id);try{let s=await fetch("/api/projects/".concat(e,"/rfi/items/").concat(t.id,"/answer"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({answer_text:n.trim()||null,status:l,attachments:r.attachments||[]})});if(!s.ok){let e=await s.json().catch(()=>({}));N.oR.error("Your answer could not be saved",{description:"string"==typeof(null==e?void 0:e.detail)?e.detail:"Please retry in a few minutes, and contact your Diligent Energy team if it persists."});return}N.oR.success("not_available"===l?"Marked as not available":"Answer sent to your review team"),z(e=>({...e,[t.id]:""})),H(null),await G()}catch(e){console.error("[rfi] answer failed",e),N.oR.error("Your answer could not be saved",{description:"Please retry in a few minutes."})}finally{O(null)}},es=async e=>{var t;let s=null==(t=e.target.files)?void 0:t[0],a=X.current;if(!s||!a)return;let r=null==K?void 0:K.items.find(e=>e.id===a);if(r){W(a);try{let e=await ee(s);await et(r,{attachments:[e]})}catch(e){console.error("[rfi] upload failed",e),N.oR.error("The file could not be uploaded",{description:"Please retry in a few minutes, and contact your Diligent Energy team if it persists."})}finally{W(null),X.current=null,B.current&&(B.current.value="")}}},ea=async(t,s,a)=>{let r=new FormData;r.append("file",s);let n=await fetch("/api/projects/".concat(e,"/rfi/rounds/").concat(t,"/import?preview=").concat(a?"1":"0"),{method:"POST",body:r}),l=await n.json().catch(()=>({}));return{ok:n.ok,data:l}},er=e=>
1"string"==typeof(null==e?void 0:e.detail)?e.detail:"Please retry in a few minutes, and contact your Diligent Energy team if it persists.",en=()=>{"apply"!==Y&&(J(null),U(null))},el=async e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(L.current&&(L.current.value=""),s&&K){Z("preview");try{let{ok:e,data:t}=await ea(K.id,s,!0);if(!e)return void N.oR.error("The workbook could not be read",{description:er(t)});J(s),U(t.summary)}catch(e){console.error("[rfi] workbook preview failed",e),N.oR.error("The workbook could not be read",{description:er(null)})}finally{Z(null)}}},ei=async()=>{if(q&&K){Z("apply");try{var e,t;let{ok:s,data:a}=await ea(K.id,q,!1);if(!s)return void N.oR.error("The answers could not be applied",{description:er(a)});let r=null!=(t=null==a||null==(e=a.summary)?void 0:e.updated)?t:0;N.oR.success(r?"".concat(v(r,"answer","answers")," applied and sent to your review team"):"Nothing new to apply — the workbook matches what is already here"),Z(null),J(null),U(null),await G()}catch(e){console.error("[rfi] workbook apply failed",e),N.oR.error("The answers could not be applied",{description:er(null)})}finally{Z(null)}}};return S?(0,a.jsx)("div",{className:"flex h-full items-center justify-center py-20",children:(0,a.jsx)(p.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,a.jsxs)(c.F,{className:"h-full",children:[(0,a.jsx)("input",{type:"file",ref:B,onChange:es,className:"hidden",accept:".pdf,.xlsx,.xls,.doc,.docx,.jpg,.jpeg,.png,.kmz,.kml,.zip,.csv"}),(0,a.jsx)("input",{type:"file",ref:L,onChange:el,className:"hidden",accept:".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),(0,a.jsxs)("div",{className:"py-8 px-4 sm:px-6 md:px-8 space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-3 dd-fade-up",children:[(0,a.jsx)("span",{className:"rounded-xl border border-primary/15 bg-gradient-to-br from-primary/10 via-primary/5 to-transparent p-1.5 shadow-sm",children:(0,a.jsx)(x.A,{className:"h-6 w-6 text-primary"})}),"Information requests"]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"What your review team still needs, grouped into numbered rounds. Answer here, or download the round as a spreadsheet to circulate and upload it back once it is filled in."})]}),T&&(0,a.jsx)(l.Zp,{className:"border-dashed",children:(0,a.jsx)(l.Wu,{className:"py-8 text-center text-sm text-muted-foreground",children:"Information requests are temporarily unavailable. Please refresh in a few minutes, and contact your Diligent Energy team if it persists."})}),!T&&0===t.length&&(0,a.jsx)(l.Zp,{className:"border-dashed",children:(0,a.jsxs)(l.Wu,{className:"py-10 text-center space-y-2",children:[(0,a.jsx)(x.A,{className:"h-10 w-10 text-primary mx-auto"}),(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"No information requests yet"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:"Your review team opens the first round when the report is delivered. It lists the documents and clarifications that would close the remaining gaps."})]})}),t.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:t.map(e=>{var t,s;let r=e.id===E;return(0,a.jsxs)("button",{type:"button",onClick:()=>D(e.id),className:r?"rounded-lg border border-primary/40 bg-primary/10 px-3 py-1.5 text-sm font-medium":"rounded-lg border border-border px-3 py-1.5 text-sm text-muted-foreground hover:bg-muted/50",children:["Round ",e.round_number,(0,a.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground",children:[null!=(t=e.answered_count)?t:0,"/",null!=(s=e.item_count)?s:e.items.length]})]},e.id)})}),K&&(0,a.jsx)(l.Zp,{children:(0,a.jsxs)(l.Wu,{className:"p-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold",children:K.title}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Opened ",A(K.created_at)," \xb7"," ","closed"===K.status?"Closed ".concat(A(K.closed_at)):"Open for answers"]}),K.note&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-2 max-w-2xl",children:K.note})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(o.$,{variant:"outline",size:"sm",onClick:()=>{window.location.href="/api/projects/".concat(e,"/rfi/rounds/").concat(K.id,"/export")},children:[(0,a.jsx)(f.A,{className:"h-4 w-4 mr-2"}),"Download round (xlsx)"]}),"open"===K.status&&(0,a.jsxs)(o.$,{variant:"outline",size:"sm",disabled:null!==Y,onClick:()=>{var e;return null==(e=L.current)?void 0:e.click()},children:["preview"===Y?(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2 animate-spin"}):(0,a.jsx)(w.A,{className:"h-4 w-4 mr-2"}),"Upload the completed workbook"]})]})]}),(0,a.jsx)(u.Separator,{}
1),(0,a.jsxs)(h.XI,{children:[(0,a.jsx)(h.A0,{children:(0,a.jsxs)(h.Hj,{children:[(0,a.jsx)(h.nd,{className:"w-[45%]",children:"What we need"}),(0,a.jsx)(h.nd,{className:"w-[12%]",children:"Priority"}),(0,a.jsx)(h.nd,{className:"w-[16%]",children:"Status"}),(0,a.jsx)(h.nd,{className:"w-[12%]",children:"Due"}),(0,a.jsx)(h.nd,{className:"w-[15%] text-right",children:"Answer"})]})}),(0,a.jsxs)(h.BF,{children:[K.items.map(e=>{var t,s,n;let l=F===e.id;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(h.Hj,{children:[(0,a.jsxs)(h.nA,{className:"align-top",children:[(0,a.jsx)("p",{className:"font-medium",children:e.title}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.description}),(null==(t=e.attachments)?void 0:t.length)>0&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 flex items-center gap-1",children:[(0,a.jsx)(j.A,{className:"h-3 w-3"}),e.attachments.map(e=>e.name).join(", ")]})]}),(0,a.jsx)(h.nA,{className:"align-top",children:(0,a.jsx)("span",{className:"text-xs font-medium ".concat(k[e.priority]||"text-muted-foreground"),children:e.priority})}),(0,a.jsxs)(h.nA,{className:"align-top",children:[(0,a.jsx)(i.E,{variant:"outline",className:"answered"===e.status?"border-l-4 border-l-emerald-500/60":"open"===e.status?"border-l-4 border-l-amber-400/60":"",children:_[e.status]||e.status}),e.answer_text&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.answer_text})]}),(0,a.jsx)(h.nA,{className:"align-top text-sm text-muted-foreground",children:A(e.due_date)}),(0,a.jsx)(h.nA,{className:"align-top text-right",children:"closed"===K.status?(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Round closed"}):(0,a.jsx)(o.$,{variant:"ghost",size:"sm",onClick:()=>H(l?null:e.id),children:l?"Cancel":"answered"===e.status?"Update":"Answer"})})]}),l&&"closed"!==K.status&&(0,a.jsx)(h.Hj,{children:(0,a.jsx)(h.nA,{colSpan:5,className:"bg-muted/30",children:(0,a.jsxs)("div",{className:"space-y-3 py-2",children:[(0,a.jsx)(d.T,{value:null!=(n=null!=(s=I[e.id])?s:e.answer_text)?n:"",onChange:t=>z(s=>({...s,[e.id]:t.target.value})),placeholder:"Answer, or say where the document sits",rows:3}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(o.$,{size:"sm",onClick:()=>et(e),disabled:P===e.id,children:[P===e.id?(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2 animate-spin"}):(0,a.jsx)(y.A,{className:"h-4 w-4 mr-2"}),"Send answer"]}),(0,a.jsxs)(o.$,{size:"sm",variant:"outline",onClick:()=>{var t;X.current=e.id,null==(t=B.current)||t.click()},disabled:$===e.id,children:[$===e.id?(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2 animate-spin"}):(0,a.jsx)(j.A,{className:"h-4 w-4 mr-2"}),"Attach the document"]}),(0,a.jsxs)(o.$,{size:"sm",variant:"ghost",onClick:()=>et(e,{status:"not_available"}),disabled:P===e.id,children:[(0,a.jsx)(g.A,{className:"h-4 w-4 mr-2"}),"Not available"]})]})]})})})]},e.id)}),0===K.items.length&&(0,a.jsx)(h.Hj,{children:(0,a.jsx)(h.nA,{colSpan:5,className:"text-center text-sm text-muted-foreground py-8",children:"This round has no items yet."})})]})]})]})}),K&&"open"===K.status&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(b.A,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400"}),"Answered items tell your review team exactly which parts of the analysis to run again."]})]})]}),(0,a.jsx)(m.lG,{open:null!==M,onOpenChange:e=>!e&&en(),children:(0,a.jsxs)(m.Cf,{className:"max-w-3xl",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Check the answers before they are applied"}),(0,a.jsxs)(m.rr,{children:[null==q?void 0:q.name," \xb7 Round ",null==K?void 0:K.round_number,". Nothing has been saved yet."]})]}),M&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("ul",{className:"space-y-1 text-sm",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("span",{className:"font-medium",children:v(M.updated,"answer","answers")})," ","will be applied."]}),M.unchanged>0&&(0,a.jsxs)("li",{className:"text-muted-foreground",children:[v(M.unchanged,"row repeats","rows repeat")," an answer already given here and stays as it is."]}),M.skipped>0&&(0,a.jsxs)("li",{className:"text-muted-foreground",children:[v(M.skipped,"row has","rows have")," no answer and"," ",1===M.skipped?"stays":"stay"," as ",1===M.skipped?"it is":"they are","."]}),M.not_in_round>0&&(0,a.jsxs)("li",{className:"text-amber-700 dark:text-amber-400",children:[v(M.not_in_round,"row","rows")," could not be matched to this round. Rows whose Item ID was edited cannot be matched and are listed below."]}),M.duplicates>0&&(0,a.jsxs)("li",{className:"text-muted-foreground",children:[v(M.duplicates,"item appears","items appear")," more than once; the last row is used."]})]}),M.rows.length>0&&(0,a.jsx)("div",{className:"max-h-[45vh] overflow-auto rounded-md border",children:(0,a.jsxs)(h.XI,{children:[(0,a.jsx)(h.A0,{
1children:(0,a.jsxs)(h.Hj,{children:[(0,a.jsx)(h.nd,{className:"w-[40%]",children:"What we need"}),(0,a.jsx)(h.nd,{className:"w-[45%]",children:"Answer"}),(0,a.jsx)(h.nd,{className:"w-[15%]",children:"Result"})]})}),(0,a.jsx)(h.BF,{children:M.rows.map((e,t)=>(0,a.jsxs)(h.Hj,{children:[(0,a.jsx)(h.nA,{className:"align-top text-sm",children:"not_in_round"===e.outcome?(0,a.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.item_id}):e.title}),(0,a.jsx)(h.nA,{className:"align-top text-sm text-muted-foreground whitespace-pre-wrap",children:e.answer||"—"}),(0,a.jsx)(h.nA,{className:"align-top text-sm",children:"apply"===e.outcome?_[e.status||"answered"]||"Answered":(0,a.jsx)("span",{className:"text-amber-700 dark:text-amber-400",children:"Not matched"})})]},"".concat(e.item_id,"-").concat(t)))})]})}),M.rows_truncated&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["The first ",M.rows.length," rows are listed; all of them will be applied."]})]}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(o.$,{variant:"outline",onClick:en,disabled:"apply"===Y,children:"Cancel"}),(0,a.jsxs)(o.$,{onClick:ei,disabled:null!==Y||!M||0===M.updated,children:["apply"===Y&&(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Apply answers"]})]})]})})]})}}}]);

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.