1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8690],{45058:function(e,t,n){n.d(t,{P:function(){return r}});var i=n(85893),o=n(61769);let r=()=>(0,i.jsx)(o.Z,{href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer",children:"[email protected]"})},68555:function(e,t,n){n.d(t,{R:function(){return l}});var i=n(85893),o=n(3314),r=n(84166),a=n(96788),s=n(45058);let l=e=>{let{message:t}=e;return(0,i.jsx)(o.Z,{sx:{p:4,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,i.jsxs)(r.Z,{spacing:1,children:[(0,i.jsx)(a.Z,{variant:"h6",align:"center",children:t||"There was an error loading this content."}),(0,i.jsxs)(a.Z,{align:"center",color:"text.secondary",children:["Please try again or contact support at ",(0,i.jsx)(s.P,{}),"."]})]})})}},48720:function(e,t,n){n.d(t,{Q:function(){return r}});var i=n(85893),o=n(3314);let r=e=>{let{actions:t,disablePadding:n=!1,children:r}=e;return(0,i.jsxs)(o.Z,{sx:{height:"100%",px:n?1:3,py:n?0:3},children:[t&&(0,i.jsx)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:t}),r]})}},30190:function(e,t,n){n.d(t,{s:function(){return F}});var i=n(85893),o=(0,n(30139).Z)((0,i.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"}),"MailOutline"),r=n(15509),a=n(3314),s=n(21038),l=n(8480),c=n(96788),d=n(61769),u=n(84677),h=n(48889),p=n(67294),m=n(83870),x=n(60272),g=n(64611),f=n(56978),b=n(95639),v=n(35774),y=n(88196),w=n(92365),j=n(52857),Z=n(40110),C=n(92608),S=n(47090),M=n(93445);let I=e=>{let{contributionId:t,contribution:n,log:o,onReviewChange:r,busy:s}=e,l=(0,x.rH)(n.contributionVisibility),h=l.charAt(0).toUpperCase()+l.slice(1),p=(0,x.fw)(n.responderCode).replace(/^Failed: /,""),f=(0,x.vy)(n.responderCode),b=(0,m._f)(n),v="resolved"===n.reviewStatus;return(0,i.jsxs)(a.Z,{component:"aside","aria-label":"Submission status and site reference",sx:{position:{md:"sticky"},top:0,alignSelf:"start",p:2,bgcolor:"action.hover",borderRadius:1,overflowWrap:"anywhere"},children:[(0,i.jsx)(c.Z,{variant:"subtitle1",component:"h3",fontWeight:600,children:"Submission"}),(0,i.jsxs)(c.Z,{variant:"caption",color:"text.secondary",component:"p",sx:{mt:.5,mb:1},children:["Contribution ",t]}),(0,i.jsxs)(c.Z,{variant:"body2",sx:{mt:1},children:[(0,i.jsx)("strong",{children:"Status:"})," ",(0,i.jsx)(a.Z,{component:"span",sx:{color:["failed","deleted"].includes(l)?"error.main":"text.primary"},children:h})]}),(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"Reason:"})," ",p]}),n.moderationConfirmed&&(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"Moderation:"})," ","safe"===n.moderationConfirmed?"Marked safe by admin":"Marked not safe by admin"]}),"none"===n.responderStatus&&(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"Notifications:"})," Turned off"]}),f&&(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",component:"p",sx:{mt:1},children:f}),b&&(0,i.jsxs)(a.Z,{sx:{mt:2,pt:2,borderTop:1,borderColor:"divider"},children:[(0,i.jsx)(c.Z,{variant:"body2",fontWeight:600,children:b}),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",component:"p",sx:{mt:.5,mb:1},children:v?"Cleared from Needs attention. The original failure is unchanged.":"Mark resolved if no further action is needed. The failure reason is kept."}),(0,i.jsx)(u.Z,{variant:"outlined",color:"inherit",size:"small",disabled:s,onClick:()=>r(v?"needs_attention":"resolved"),children:v?"Reopen review":"Mark resolved"})]}),(0,i.jsx)(c.Z,{variant:"subtitle1",component:"h3",fontWeight:600,sx:{mt:3},children:"Site reference"}),"available"===o.status?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Z,{href:"/site/".concat(encodeURIComponent(o.data.code)),target:"_blank",rel:"noopener noreferrer",variant:"body2",title:"Open site in a new tab",sx:{display:"inline-flex",alignItems:"center",gap:.5,mt:1.5},children:[o.data.code,(0,i.jsx)(S.Z,{fontSize:"inherit"})]}),o.data.featuredContributionId?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M.e,{src:(0,g.$b)(o.data.featuredContributionId,"500_2"),alt:"Site reference for ".concat(o.data.code),unavailableMessage:"The site reference photo could not be loaded.",marginY:.5},o.data.featuredContributionId),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",component:"p",sx:{m:0,lineHeight:1.4},children:"Current featured photo."})]}):(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This log has no featured photo."})]}):(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{mt:1},role:"error"===o.status?"alert":void 0,children:o.message})]})};var k=n(8100);let P=e=>
1{let t=(0,p.useRef)({generation:0,cleanup:e});t.current.cleanup=e,(0,p.useEffect)(()=>{let e=t.current,n=++e.generation;return()=>queueMicrotask(()=>{e.generation===n&&e.cleanup()})},[])},R=e=>(null==e?void 0:e.email.status)==="error"||(null==e?void 0:e.log.status)==="error",z=(e,t)=>{let n=(0,p.useRef)(null),i=(0,p.useRef)(0),o=(0,k.ZP)(["".concat(e,"/submission"),t],async e=>{let t=new AbortController;n.current=t,i.current+=1;let o=await fetch(e,{signal:t.signal,cache:"no-store"});if(!o.ok)throw Error("Unable to load this submission. Close and reopen it if the problem persists.");return o.json()},{revalidateOnFocus:!1,errorRetryCount:2,errorRetryInterval:1500,refreshInterval:e=>R(e)&&i.current<3?1500:0}),{mutate:r}=o;return P(()=>{var e;null===(e=n.current)||void 0===e||e.abort(),r(void 0,!1)}),o},T=(e,t,n,i)=>{let[o,r]=(0,p.useState)(!1),[a,s]=(0,p.useState)(""),[l,c]=(0,p.useState)(""),d=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.abort()},[]);let u=(0,p.useRef)(null),{data:h,error:m,mutate:x}=(0,k.ZP)(["".concat(e,"/submissionPhoto"),i],async e=>{let t=new AbortController;u.current=t;let n=await fetch(e,{cache:"no-store",signal:t.signal});if(!n.ok)throw Error("Unable to check processing status. Close and reopen this submission if the problem persists.");return n.json()},{fallbackData:t,revalidateOnMount:!1,refreshInterval:0,errorRetryCount:2,errorRetryInterval:1500});P(()=>{var e;null===(e=u.current)||void 0===e||e.abort(),x(void 0,!1)}),(0,p.useEffect)(()=>{h&&h!==t&&n(h)},[h,t,n]);let g=async function(i){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(d.current)return;let a=new AbortController;d.current=a,r(!0),c(""),s("Submitting selected photo. Contributor notifications are turned off for this recovery.");try{let r=await fetch("".concat(e,"/submissionPhoto"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attachmentIndex:i,confirmSafe:o}),signal:a.signal});if(!r.ok){let e=await r.json(),t=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:"Could not submit the photo. Its status will be checked automatically.";throw Error(t)}a.signal.aborted||(n({contributionVisibility:"pending",responderCode:"pending",responderStatus:"none",canSelectPhoto:!1,reviewStatus:"needs_attention",moderationConfirmed:o?"safe":null==t?void 0:t.moderationConfirmed},!0),await x({contributionVisibility:"pending",responderCode:"pending",responderStatus:"none",canSelectPhoto:!1,reviewStatus:"needs_attention",moderationConfirmed:o?"safe":null==t?void 0:t.moderationConfirmed},!1),s("Photo submitted for processing. Contributor notifications are turned off. Reopen this submission to check progress."))}catch(e){a.signal.aborted||(s(""),c(e instanceof Error?e.message:"Could not confirm the request. Its status will be checked automatically."))}finally{a.signal.aborted||(d.current=null,r(!1),x().catch(()=>{}))}},f=async t=>{if(d.current)return;let i=new AbortController;d.current=i,r(!0),c(""),s("");try{await x(async()=>{let o=await fetch("".concat(e,"/submissionReview"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewStatus:t}),signal:i.signal});if(!o.ok){let e=await o.json();throw Error(e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:"Could not save the review status. Please try again.")}let r=await o.json();return i.signal.aborted||n(r),r},!1)}catch(e){i.signal.aborted||c(e instanceof Error?e.message:"Could not save the review status.")}finally{i.signal.aborted||(d.current=null,r(!1),x().catch(()=>{}))}};return{submitting:o,message:a,error:l||(null==m?void 0:m.message)||"",selectPhoto:g,setReviewStatus:f}},D=e=>{let{contributionId:t,onClose:n,onStatusChange:o}=e,r=(0,p.useId)(),l="/api/admin/contributions/".concat(encodeURIComponent(t)),{data:d,error:h,mutate:m}=z(l,r),x=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(l,"/submissionAsset?asset=").concat(e).concat(void 0===t?"":"&index=".concat(t)).concat(n?"&preview=1":"")},g=(0,p.useCallback)(e=>{m(t=>t?{...t,contribution:e}:t,!1),null==o||o(e)},[m,o]),f=T(l,null==d?void 0:d.contribution,g,r),S=(null==d?void 0:d.contribution.responderCode)==="failExplicitContent",k=S?"Mark safe & submit":"Submit this photo",P=(null==d?void 0:d.email.status)==="available"?d.email.data:null;return(0,i.jsxs)(y.Z,{open:!0,onClose:n,fullWidth:!0,maxWidth:"lg","aria-labelledby":"submission-viewer-title",children:[(0,i.jsxs)(w.Z,{id:"submission-viewer-title",sx:{dis
1play:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:["Inspect submission",(0,i.jsx)(j.Z,{"aria-label":"Close",onClick:n,edge:"end",children:(0,i.jsx)(b.Z,{})})]}),(0,i.jsxs)(Z.Z,{dividers:!0,sx:{borderBottom:0,pt:3,pb:4,minHeight:120},children:[!d&&!h&&(0,i.jsx)(C.Z,{"aria-label":"Loading submission",sx:{mt:2}}),h&&(0,i.jsx)(c.Z,{role:"alert",sx:{mt:2},children:h.message}),(f.message||f.error)&&(0,i.jsx)(c.Z,{role:f.error?"alert":"status",sx:{mt:2},children:f.error||f.message}),d&&(0,i.jsxs)(a.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"minmax(0, 1fr)",md:"250px minmax(0, 1fr)"},gap:3,alignItems:"start"},children:[(0,i.jsx)(I,{contributionId:t,contribution:d.contribution,log:d.log,onReviewChange:f.setReviewStatus,busy:f.submitting}),(0,i.jsx)(a.Z,{sx:{minWidth:0},children:(0,i.jsxs)(a.Z,{component:"section","aria-labelledby":"submission-email-title",children:[(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,i.jsx)(c.Z,{id:"submission-email-title",variant:"h6",component:"h3",children:"Email"}),"unavailable"!==d.email.status&&(0,i.jsx)(u.Z,{component:"a",href:x("email"),download:!0,target:"_blank",rel:"noopener noreferrer",size:"small",startIcon:(0,i.jsx)(v.Z,{}),children:"Download .eml"})]}),P?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.Z,{sx:{my:2,p:2,bgcolor:"action.hover",borderRadius:1,overflowWrap:"anywhere"},children:[(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"From:"})," ",P.from||"Unknown"]}),(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"To:"})," ",P.to||"Unknown"]}),(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"Subject:"})," ",P.subject]}),(0,i.jsxs)(c.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:"Date:"})," ",P.date?new Date(P.date).toLocaleString():"Unknown"]})]}),P.text.trim()?(0,i.jsx)(a.Z,{component:"pre",sx:{fontFamily:"inherit",fontSize:"0.875rem",whiteSpace:"pre-wrap",overflowWrap:"anywhere",bgcolor:"action.hover",p:2,borderRadius:1,my:2,maxHeight:360,overflow:"auto"},tabIndex:0,"aria-label":"Email message",children:P.text}):(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{my:2,p:2,bgcolor:"action.hover",borderRadius:1},children:"Empty email body."}),P.textTruncated&&(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"Message preview shortened. Download the email to read the complete message."}),(0,i.jsxs)(a.Z,{component:"section","aria-labelledby":"submission-attachments-title",sx:{mt:2,p:2,bgcolor:"action.hover",borderRadius:1},children:[(0,i.jsxs)(c.Z,{id:"submission-attachments-title",variant:"subtitle1",component:"h4",children:["Attachments (",P.attachments.length,")"]}),0===P.attachments.length&&(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",children:"No attachments."}),d.contribution.canSelectPhoto&&(0,i.jsxs)(c.Z,{variant:"body2",color:"text.secondary",children:[S?"Mark the selected photo safe to override the explicit-content filter and process it. Other image checks still apply.":"Select one photo to process for this contribution."," ","Contributor notifications will be turned off. JPEG, HEIC, and PNG are supported."]}),P.attachments.map((e,t)=>(0,i.jsxs)(a.Z,{sx:{pt:2,mt:t>0?2:0,borderTop:t>0?1:0,borderColor:"divider"},children:[(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,i.jsx)(c.Z,{variant:"body2",sx:{overflowWrap:"anywhere",minWidth:0},children:e.filename}),(0,i.jsx)(j.Z,{component:"a",href:x("attachment",e.index),download:!0,target:"_blank",rel:"noopener noreferrer",size:"small",color:"primary","aria-label":"Download ".concat(e.filename),title:"Download ".concat(e.filename),sx:{flexShrink:0},children:(0,i.jsx)(v.Z,{fontSize:"small"})})]}),d.contribution.canSelectPhoto&&e.canProcess&&(0,i.jsx)(s.Z,{title:S?"Confirm this photo is safe and process it without the explicit-content check. No contributor notification.":"Process this photo for this contribution. No contributor notification.",describeChild:!0,children:(0,i.jsx)(a.Z,{component:"span",sx:{flexShrink:0,display:"inline-flex"},children:(0,i.jsx)(u.Z,{onClick:()=>void f.selectPhoto(e.index,S),disabled:f.submitting,"aria-label":"".concat(k,": ").concat(e.filename),size:"small",variant:"contained",color:"primary",children:k})})})]}),(0,i.jsxs)(c.Z,{variant:"caption",color:"text.secondary",children:[e.contentType," \xb7"," ",Math.
1ceil(e.size/1024).toLocaleString()," KB"]}),e.canPreview?(0,i.jsx)(M.e,{src:x("attachment",e.index,!0),alt:"Attachment: ".concat(e.filename)}):(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",children:"Preview unavailable for this file type."})]},e.index))]})]}):"available"!==d.email.status&&(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",role:"error"===d.email.status?"alert":void 0,children:d.email.message})]})})]})]})]})},H=e=>({finished:"Delivered",pending:"Pending",none:"Turned off"})[e]||e,L=e=>{let{src:t,alt:n}=e;return(0,i.jsx)(a.Z,{component:"img",src:t,alt:n,sx:{width:128,height:64,borderRadius:1,objectFit:"cover",border:1,borderColor:"divider",flexShrink:0}})},N=e=>{let{label:t}=e;return(0,i.jsx)(a.Z,{sx:{width:128,height:64,borderRadius:1,border:1,borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",textTransform:"uppercase",letterSpacing:.3,flexShrink:0},children:t})},W=e=>"visible"===e||"hidden"===e,F=e=>{let{contributions:t,logs:n,orgNameById:b=new Map,fillHeight:v=!1,onRetriggerPendingContribution:y,retriggerLoadingIds:w,onContributionsChanged:j,onContributionStatusChange:Z,emptyMessage:C="No contributions found.",loading:S=!1,prioritizeActionable:M=!1}=e,[I,k]=(0,p.useState)(null),P=(0,p.useRef)(!1),R=(0,p.useCallback)(e=>{P.current=!0,I&&(null==Z||Z(I,e))},[I,Z]),z=(0,p.useMemo)(()=>new Map(n.map(e=>[e.id,e])),[n]),T=(0,p.useMemo)(()=>new Map(t.map(e=>[e.id,(0,m.Qx)(e.responderCode)])),[t]),F=[{field:"responderCode",headerName:"Submission",width:188,minWidth:188,renderCell:e=>{let t=e.row.responderCode,n=(0,x.fw)(t),r=t.startsWith("fail"),[d,...u]=n.split(": "),h="success"===t?"success.main":"pending"===t?"warning.main":r?"error.main":"text.primary",p="submission-status-".concat(e.row.id),g="submission-reason-".concat(e.row.id),f=r?u.join(": "):"",b=(0,m._f)(e.row),v="submission-review-".concat(e.row.id);return(0,i.jsx)(s.Z,{title:r?"":"Inspect submission",describeChild:!0,children:(0,i.jsxs)(l.Z,{tabIndex:e.hasFocus?0:-1,onClick:()=>k(e.row.id),"aria-label":"Inspect submission ".concat(e.row.id),"aria-describedby":[p,f&&g,b&&v].filter(Boolean).join(" "),sx:{display:"grid",gridTemplateColumns:"6px minmax(0, 1fr)",alignContent:"center",alignItems:"center",columnGap:.75,rowGap:.5,width:"100%",minHeight:64,p:.5,textAlign:"left",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focusVisible":{bgcolor:"action.hover",outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}},children:[(0,i.jsx)(a.Z,{component:"span","aria-hidden":"true",sx:{width:6,height:6,borderRadius:"50%",bgcolor:h}}),(0,i.jsxs)(a.Z,{component:"span",sx:{gridColumn:2,display:"flex",alignItems:"center",gap:1},children:[(0,i.jsx)(c.Z,{component:"span",id:p,variant:"body2",fontWeight:600,sx:{lineHeight:1.3},children:"deleted"===e.row.contributionVisibility?"Failed":r?d:n}),b&&(0,i.jsx)(a.Z,{component:"span",id:v,sx:{fontSize:"0.625rem",lineHeight:1.5,px:.75,py:.125,borderRadius:1,bgcolor:"action.hover",color:"Needs attention"===b?"text.primary":"text.secondary",fontWeight:"Needs attention"===b?600:400,whiteSpace:"nowrap"},children:b})]}),f&&(0,i.jsx)(c.Z,{component:"span",id:g,variant:"caption",color:"text.secondary",sx:{gridColumn:2,lineHeight:1.3,whiteSpace:"normal"},children:f}),r&&(0,i.jsxs)(a.Z,{component:"span",sx:{gridColumn:2,justifySelf:"start",display:"inline-flex",alignItems:"center",gap:.5,border:"1px solid currentColor",borderRadius:1,px:.75,py:.25,fontSize:"0.6875rem",fontWeight:600,lineHeight:1.5,whiteSpace:"nowrap"},children:[(0,i.jsx)(o,{sx:{fontSize:14}}),"Inspect submission"]})]})})}},{field:"id",headerName:"Public Photo",width:360,sortable:!1,renderCell:e=>{var t,n;let o=e.row.contributionVisibility,l=W(o),h="pending"===o,p=null!==(n=null==w?void 0:w.has(e.row.id))&&void 0!==n&&n,m=e.row.organizationId;return(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,width:"100%",height:"100%"},children:[l?(0,i.jsx)(L,{src:(0,g.$b)(e.row.id,"300_2"),alt:e.row.id}):(0,i.jsx)(N,{label:"failed"===o||"deleted"===o?"":o}),(0,i.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",minWidth:0},children:[l&&m?(0,i.jsxs)(d.Z,{href:"/dashboard/org/".concat(m,"?tab=photos&photoId=").concat(e.row.id),target:"_blank",rel:"noopener noreferrer",sx:{dis
1play:"inline-flex",alignItems:"center",gap:.5,lineHeight:1.2},children:["View Photo",(0,i.jsx)(r.Z,{sx:{width:14,height:14}})]}):h&&y?(0,i.jsx)(s.Z,{placement:"right",title:"Sets responderStatus to 'none' and re-uploads this photo to the raw image bucket to retrigger image processing.",children:(0,i.jsx)(u.Z,{size:"small",variant:"outlined",onClick:()=>void y(e.row.id),disabled:p,sx:{alignSelf:"flex-start",lineHeight:1.2,mb:.5},children:p?"Retrying...":"Retrigger"})}):(0,i.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.2},children:"No public photo"}),(0,i.jsxs)(c.Z,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Photo ID:"," ",(0,i.jsx)(s.Z,{title:e.row.id,children:(0,i.jsx)(a.Z,{component:"span",sx:{textDecoration:"underline",textDecorationStyle:"dotted",textUnderlineOffset:2,cursor:"help"},children:e.row.id.slice(0,6)})})]}),(0,i.jsxs)(c.Z,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Contributor ID:"," ",(0,i.jsx)(s.Z,{title:e.row.userId,children:(0,i.jsx)(a.Z,{component:"span",sx:{textDecoration:"underline",textDecorationStyle:"dotted",textUnderlineOffset:2,cursor:"help"},children:(null===(t=e.row.userId)||void 0===t?void 0:t.slice(0,6))||"Unknown"})})]})]})]})}},{field:"storyId",headerName:"Log",minWidth:360,flex:1,renderCell:e=>{let t=e.row.storyId,n=t?z.get(t):void 0,o=n?b.get(n.organizationId)||"Unknown organization":null;return t?n?(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,minWidth:0,height:"100%"},children:[n.featuredContributionId?(0,i.jsx)(L,{src:(0,g.$b)(n.featuredContributionId,"300_2"),alt:"Featured for ".concat(n.storyCode)}):(0,i.jsx)(N,{label:"no feat"}),(0,i.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",minWidth:0},children:[(0,i.jsx)(d.Z,{href:"/site/".concat(n.storyCode),target:"_blank",rel:"noopener noreferrer",sx:{display:"block",lineHeight:1.2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:"".concat(n.storyCode," | ").concat(n.name||"Untitled Log")}),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:o})]})]}):(0,i.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,minWidth:0,height:"100%"},children:(0,i.jsx)(N,{label:"unknown"})}):(0,i.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,height:"100%"},children:(0,i.jsx)(N,{label:""})})}},{field:"submittedAt",headerName:"Submitted At",width:180,renderHeader:()=>(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(c.Z,{variant:"body2",sx:{fontWeight:600},children:"Submitted At"}),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"(Your Timezone)"})]}),valueGetter:(e,t)=>t.submittedAt,getSortComparator:M?e=>(t,n,i,o)=>{var r,a;return(null!==(r=T.get(String(i.id)))&&void 0!==r?r:7)-(null!==(a=T.get(String(o.id)))&&void 0!==a?a:7)||("asc"===e?1:-1)*String(t).localeCompare(String(n))}:void 0,renderCell:e=>(0,i.jsx)(a.Z,{sx:{height:"100%",display:"flex",alignItems:"center"},children:(0,i.jsx)(c.Z,{variant:"body2",children:(0,f.dI)(e.row.submittedAt,!0,!0).fullString})})},{field:"observedAt",headerName:"Observed At",width:180,renderHeader:()=>(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(c.Z,{variant:"body2",sx:{fontWeight:600},children:"Observed At"}),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"(Log Timezone)"})]}),valueGetter:(e,t)=>t.observedAt,renderCell:e=>(0,i.jsx)(a.Z,{sx:{height:"100%",display:"flex",alignItems:"center"},children:W(e.row.contributionVisibility)?(0,i.jsx)(c.Z,{variant:"body2",children:(0,f.dI)(e.row.observedAt,e.row.hasAccurateTime,!0).fullString}):null})},{field:"responderStatus",headerName:"Notification Status",width:170,renderHeader:()=>(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(c.Z,{variant:"body2",sx:{fontWeight:600},children:"Notification Status"}),(0,i.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"(Responder Status)"})]}),renderCell:e=>{let t=e.row.responderStatus,n=H(t),o="text.primary";return"finished"===t?o="success.main":"pending"===t?o="warning.main":"none"===t&&(o="text.secondary"),(0,i.jsx)(a.Z,{sx:{height:"100%",display:"flex",alignItems:"center"},children:(0,i.jsx)(c.Z,{variant:"body2",color:o,fontWeight:"bold",sx:{lineHeight:1.2},children:n})})}}];return(0,i.jsxs)(a.Z,{sx:v?{flex:1,minHeight:0}:{height:500},children:[(0,i.jsx)(h._,{rows:t,loading:S,columns:F,rowHeight:92,localeText:{noRowsLabel:C},sx:{height:"100%","& .MuiDataGrid-cell":{display:"flex",alignItems:"center"}},initialState:{sorting:{sortModel:[{field:"submittedAt",sort:"desc"}]}},disableRowSelectionOnClick:!0}),I&&(0,i.jsx)(D,{contributionId:I,onClose:()=>{k(null),P.current&&(null==j||j()),P.current=!1},onStatusChange:R},I)]})}},93445:function(e,t,n){n.d(t,{e:function(){return s}});var i=n(85893),o=n(96788),r=n(3314),a=n(67294);let s=e=>{let{src:t,alt:n,marginY:s=1,unavailableMessage:l="Preview unavailable. You can still download the file."}=e,[c,d]=(0,a.useState)(!1),[u,h]=(0,a.useState)(!1);return c?(0,i.jsx)(o.Z,{variant:"body2",color:"text.secondary",children:l}):(0,i.jsxs)(i.Fragment,{children:[!u&&(0,i.jsx)(o.Z,{role:"status",variant:"body2",color:"text.secondary",sx:{my:s},children:"Loading previewâ¦"}),(0,i.jsx)(r.Z,{component:"img",src:t,alt:n,loading:"lazy",onLoad:()=>h(!0),onError:()=>d(!0),sx:{display:"block",maxWidth:"100%",maxHeight:480,objectFit:"contain",my:s}})]})}},44921:function(e,t,n){n.d(t,{g:function(){return o}});var i=n(85893);n(67294);let o=e=>{let{children:t}=e;return(0,i.jsx)(i.Fragment,{children:t})}},83870:function(e,t,n){n.d(t,{K4:function(){return d},Qx:function(){return c},_f:function(){return l},vT:function(){return s}});let i=e=>["failed","deleted"].includes(e.contributionVisibility)&&"failExplicitContent"===e.responderCode,o=e=>"failed"===e.contributionVisibility||i(e),r=new Map([["failImageMany",0],["failExplicitContent",1]]),a=e=>{var t;return o(e)&&r.has(null!==(t=e.responderCode)&&void 0!==t?t:"")},s=e=>a(e)&&"resolved"!==e.reviewStatus,l=e=>a(e)?s(e)?"Needs attention":"Resolved":null,c=e=>{var t;return null!==(t=r.get(e))&&void 0!==t?t:r.size},d=e=>{let t={multiplePhotos:0,explicitContent:0};for(let n of e)s(n)&&("failImageMany"===n.responderCode?t.multiplePhotos+=1:"failExplicitContent"===n.responderCode&&(t.explicitContent+=1));return t}},60272:function(e,t,n){n.d(t,{fw:function(){return o},rH:function(){return a},vy:function(){return r}});let i={success:"Success",pending:"Pending",failImageNone:"Failed: N
1o Supported Photo",failFilteredContent:"Failed: Photo Automatically Filtered",failExplicitContent:"Failed: Explicit Content",failImageMany:"Failed: Too Many Photos",failImageUnsupported:"Failed: Unsupported Type",failStoryCode:"Failed: No Location Found",failImageOrientation:"Failed: Incorrect Photo Orientation",failUnhandledError:"Failed: Processing Error"},o=e=>i[e]||e,r=e=>"failImageNone"===e?"This recorded reason covers both missing photos and unsupported image formats. An attachment can be previewable here even if processing rejected its format.":null,a=e=>"deleted"===e?"failed":e},38724:function(e,t,n){n.d(t,{F0:function(){return g},FL:function(){return j},R5:function(){return w},S3:function(){return d},Sb:function(){return h},TV:function(){return u},UO:function(){return f},Wg:function(){return m},g$:function(){return l},h$:function(){return s},hY:function(){return p},pS:function(){return v},sm:function(){return c},t9:function(){return y},tP:function(){return a},z0:function(){return b},zJ:function(){return x}});var i=n(8100),o=n(35518),r=n(87738);let a=()=>{let{data:e,error:t,mutate:n}=(0,i.ZP)("/api/logs",o._i);return{logs:e,isLoading:!e&&!t,error:t,mutate:n}},s=e=>{let{data:t,error:n,mutate:r}=(0,i.ZP)(e?"/api/logs/".concat(e,"/settings"):null,o._i);return{logSettings:t,isLoading:!t&&!n,error:n,mutate:r}},l=e=>{let{data:t,error:n,mutate:r}=(0,i.ZP)(e?"/api/logs/".concat(e,"/preview"):null,o._i);return{logPreview:t,isLoading:!t&&!n,error:n,mutate:r}},c=e=>{let{data:t,error:n,mutate:r}=(0,i.ZP)(e?"/api/logs/".concat(e,"/explorerDetails"):null,o._i);return{logExplorerDetails:t,isLoading:!t&&!n,error:n,mutate:r}},d=e=>{let{data:t,error:n,mutate:r}=(0,i.ZP)(e?"/api/logs/".concat(e,"/contributions"):null,o._i);return{contributions:t,isLoading:!!e&&!t&&!n,error:n,mutate:r}},u=e=>{let{data:t,error:n,mutate:r}=(0,i.ZP)(e?"/api/logs/".concat(e,"/videoMode"):null,o._i);return{videoModeStatus:t,isLoading:!!e&&!t&&!n,error:n,mutate:r}},h=e=>{let{mutate:t}=s(e);return{updateLogName:async n=>{await (0,o.Mt)("/api/logs/".concat(e,"/name"),{name:n}),await t()}}},p=e=>{let{mutate:t}=s(e);return{updateLogCategories:async n=>{await (0,o.Mt)("/api/logs/".concat(e,"/categories"),{categorySlugs:n}),await t()}}},m=e=>{let{mutate:t}=s(e);return{updateLogDescription:async(n,i)=>{await (0,o.Mt)("/api/logs/".concat(e,"/description"),{description:n,descriptionPlainText:i}),await t()}}},x=e=>{let{mutate:t}=s(e);return{updateLogLocation:async(n,i,r,a,s,l)=>{await (0,o.Mt)("/api/logs/".concat(e,"/location"),{latitude:n,longitude:i,countryShort:r,countryLong:a,regionShort:s,regionLong:l}),await t()}}},g=e=>({updateLogFeaturedContribution:async t=>{await (0,o.Mt)("/api/logs/".concat(e,"/featuredContribution"),{contributionId:t})}}),f=e=>{let{mutate:t}=(0,r.o8)(e);return{createLog:async(n,i,r,a)=>{await (0,o.ZU)("/api/logs",{logCode:n,orgId:e,pricePerYearInDollars:i,durationInYears:r,logIsInvoiced:a}),await t()}}},b=(e,t,n)=>{let{mutate:r}=(0,i.kY)(),{data:a,error:s,isValidating:l,mutate:c}=(0,i.ZP)(n?"/api/logs/".concat(e,"/reset"):null,o._i,{revalidateOnFocus:!1});return{resetLog:async n=>{await (0,o.Mt)("/api/logs/".concat(e,"/reset"),{confirmationCode:n}),await Promise.allSettled(["/api/logs","/api/logs/".concat(e,"/reset"),"/api/logs/".concat(e,"/settings"),"/api/logs/".concat(e,"/preview"),"/api/logs/".concat(e,"/contributions"),"/api/logs/".concat(e,"/explorerDetails"),"/api/logs/".concat(e,"/videoMode"),"/api/organizations/".concat(t),"/api/organizations/".concat(t,"/contributions"),"/api/organizations/".concat(t,"/billing"),"/api/organizations/".concat(t,"/billing/logs")].map(e=>r(e)))},preview:a,error:s,isValidating:l,refreshPreview:c}},v=(e,t)=>{let{mutate:n}=(0,r.o8)(t);return{deleteLog:async()=>{await (0,o.hs)("/api/logs/".concat(e)),await n()}}},y=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{mutate:i}=(0,r.o8)(n?t:null);return{updateLogEndedAt:async t=>{await (0,o.Mt)("/api/logs/".concat(e,"/endedAt"),{endedAt:t}),n&&(await i(n=>n?{...n,stories:{...n.stories,items:n.stories.items.map(n=>n.id===e?{...n,endedAt:t}:n)}}:n,!1),await i())}}},w=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{mutate:a}=(0,r.o8)(n?t:null),{mutate:s}=(0,i.kY)();return{updateLogVideoMode:async t=>{await (0,o.Mt)("/api/logs/".concat(e,"/videoMode"),{videoModeEnabled:t}),n&&(await a(n=>n?{...n,stories:{...n.stories,items:n.stories.items.map(n=>n.storyCode===e?{...n,videoModeEnabled:t}:n)}}:n,!1),await a()),await s("/api/logs",n=>n?n.map(n=>n.storyCode===e?{...n,videoModeEnabled:t}:n):n,!1)}}},j=e=>({generateLogVideo:async()=>(0,o.ZU)("/api/logs/".concat(e,"/videoMode"),{})})},56978:function(e,t,n){n.d(t,{BZ:function(){return h},GQ:function(){return p},Q1:function(){return g},_J:function(){return b},dI:function(){return c},sz:function(){return f},tR:function(){return x},ub:function(){return d}});var i=n(27484),o=n.n(i),r=n(29387),a=n.n(r),s=n(34576),l=n.n(s);n(89128),o().extend(l()),o().extend(a());let c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=o()(e),r=n?i.format("MMM D, YY"):i.format("MMMM D, YYYY"),a=t?i.format("h:mm A"):null;return{date:r,time:a,fullString:"".concat(r).concat(a?" at ".concat(a):"")}},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=o()(e),i=n.year(),r=n.month()+1,a=n.date(),s=n.hour(),l=n.minute(),c="".concat(i,"-").concat(r.toString().padStart(2,"0"),"-").concat(a.toString().padStart(2,"0"));return t?"".concat(c,"_").concat(s.toString().padStart(2,"0"),"-").concat(l.toString().padStart(2,"0")):c},u=e=>{let t=new Date,n=new Date(e),i=Math.round((t.getTime()-n.getTime())/6e4);return"".concat(i,"m ago")},h=e=>{let t=new Date,n=new Date(e),i=Math.round((t.getTime()-n.getTime())/36e5);return i<1?u(e):"".concat(i,"h ago")},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();if(!e)return null;let n=new Date(e).getTime();if(Number.isNaN(n))return null;let i=Math.max(0,t-n),o=Math.round(i/6e4);if(o<1)return"just now";if(o<60)return"".concat(o," ").concat(1===o?"minute":"minutes"," ago");let r=Math.round(i/36e5);if(r<24)return"".concat(r," ").concat(1===r?"hour":"hours"," ago");let a=Math.round(i/864e5);return"".concat(a," ").concat(1===a?"day":"days"," ago")},m=(e,t)=>
1{if(!e)return null;let n=o()(e);return n.isValid()?n.format(t):null},x=e=>m(e,"MMM YYYY"),g=e=>m(e,"MMMM YYYY"),f=e=>m(e,"MMM D, YYYY"),b=e=>!!e&&o()(e).isValid()},95639:function(e,t,n){var i=n(64836);t.Z=void 0;var o=i(n(33651)),r=n(85893),a=(0,o.default)((0,r.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.Z=a},35774:function(e,t,n){var i=n(64836);t.Z=void 0;var o=i(n(33651)),r=n(85893),a=(0,o.default)((0,r.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download");t.Z=a}}]);
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.