PageSourceSearch

https://the-stevie-awards.com/assets/list-e2c85d11.js

js the-stevie-awards.com collected 2026-10-08 05:11:30 UTC 7,635 bytes, 1 lines download raw bytes

1import{j as a,a3 as C,a1 as E,X as I,K as R,aa as N,bU as L,bV as F}from"./mui-f398fe60.js";import{r}from"./react-6ced0908.js";import{j as B,w as q,b as $,g as z,d as H,p as O,L as V,M as U}from"./refine-3c729a1b.js";import{j as K,c as p,f as Q,u as X,a7 as J}from"./index-768edca3.js";import{i as Y}from"./mui-x-61e6070d.js";import{E as Z}from"./EditButton-a6d45374.js";import{D as w}from"./DeleteButton-1b85c75e.js";import{C as ee}from"./CloneButton-3032fc2d.js";import{D as te}from"./DataGridActions-08c29665.js";import{D as ae}from"./index-2a20b3cb.js";import{P as ie}from"./Page-9c4bb6e6.js";import{f as se}from"./formatDate-3c7d970d.js";import{A as le}from"./AdvancedFilter-c1f1f4f2.js";import{A as ne}from"./email_templates-88a2a04f.js";import"./utils-78d57de0.js";import"./i18n-a37d409d.js";import"./auth-utils-7ac2656c.js";import"./LoadingCircle-ff3fc190.js";import"./Modal-18508748.js";import"./BaseFilter-dffebb55.js";import"./AdapterDayjs-cde123c0.js";import"./nominationStatus-7a417cf8.js";import"./judgeStatus-abdba509.js";var k={},re=Y;Object.defineProperty(k,"__esModule",{value:!0});var M=k.default=void 0,oe=re(K()),de=a;M=k.default=(0,oe.default)((0,de.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const ce=({data:_,columns:f,isDialog:h=!0,report:y=void 0})=>{const[b,v]=r.useState(!1),[o,d]=r.useState([{type:"checkbox",key:"is_admin",name:"Is Admin"},{type:"select",key:"selected_audience",name:"Audience",options:[...ne.map(l=>({key:l,label:p(l)})),{key:"unpaid invoices",label:p("unpaid invoices")},{key:"target email",label:p("target email")}]},{type:"radio",key:"is_active",name:"Active",options:[{key:"true",label:"Active"},{key:"false",label:"Inactive"}]}
1,{type:"radio",key:"is_manual",name:"Type",options:[{key:"true",label:"Manual"},{key:"false",label:"Automatic"}]}]);return a.jsx(le,{filters:o,setFilters:d,filterOpen:b,setFilterOpen:v,data:_,columns:f,table:"emails",to:"/emails",isDialog:h,report:y,hideDownload:!0})},Ge=()=>{const{canEdit:_}=Q(),{mutate:f,mutation:{isPending:h}}=B(),{mutate:y,mutation:{isPending:b}}=B(),v=q(),o=$(),d=z(),{open:l}=H(),{selectedProgram:n}=X(),[A,g]=r.useState({}),[c,S]=r.useState([]);r.useEffect(()=>{n==="all"&&c.length>0&&S([])},[n]);const{dataGridProps:m}=O({dataProviderName:"default",resource:"email_templates",sorters:{mode:"server"},filters:{mode:"server"}}),G=t=>t?{queued:"Queued",sending:"Sending",sent:"Sent",failed:"Failed",partial_sent:"Partial Sent",cancelled:"Cancelled"}[t]??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase()):"-",D=r.useMemo(()=>[{field:"actions",headerName:"Actions",sortable:!1,align:"center",headerAlign:"center",minWidth:180,renderCell:function({row:e}){return a.jsxs(te,{children:[a.jsx("span",{children:a.jsx(C,{title:"View Email History",children:a.jsx(E,{color:"primary","aria-label":"View Email History",onClick:()=>{const s=((e==null?void 0:e.name)||"").trim();d({to:"/email_history",...s?{query:{search:s}}:{}})},children:a.jsx(J,{fontSize:"small"})})})}),a.jsx(ee,{hideText:!0,recordItemId:e.id,onClick:()=>{f({url:`/email_templates/${e.id}`,method:"post",values:{}},{onSuccess:()=>{o({resource:"email_templates",invalidates:["list"]})}})},disabled:!_("emails")||h}
1),a.jsx(Z,{hideText:!0,recordItemId:e.id,allowDomains:"emails"}),a.jsx(w,{hideText:!0,recordItemId:e.id,resource:"email_templates",allowDomains:"emails"})]})}},{field:"name",flex:1,headerName:"Name",minWidth:250,valueGetter:(t,e)=>p((e==null?void 0:e.name)||"-"),renderCell:({row:t})=>a.jsx("a",{style:{cursor:"pointer"},onClick:()=>{d({to:`/emails/show/${t.id}`})},dangerouslySetInnerHTML:{__html:t.name}})},{field:"is_manual",flex:1,headerName:"Manual/Automatic",minWidth:150,valueGetter:(t,e)=>e!=null&&e.is_manual?"Manual":"Automatic"},{field:"last_sent_status",flex:1,headerName:"Status",minWidth:120,sortable:!0,valueGetter:(t,e)=>G((e==null?void 0:e.last_sent_status)??null),filterable:!0},{field:"last_send_date",flex:1,headerName:"Last Sent",minWidth:120,valueGetter:(t,e)=>se(e==null?void 0:e.last_send_date)||"-"},{field:"is_active",flex:1,display:"flex",align:"center",headerAlign:"center",headerName:"Active",minWidth:100,renderCell:({row:t})=>a.jsx(I,{checked:!!(t!=null&&t.is_active),disabled:!0})},{field:"selected_audience",flex:1,headerName:"Audience",minWidth:120,valueGetter:(t,e)=>e!=null&&e.selected_audience?p(e.selected_audience):"-"},{field:"estimated_targets",headerName:"Estimated Targets",minWidth:160,sortable:!1,display:"flex",align:"center",headerAlign:"center",renderCell:({row:t})=>{const e=t.id,s=e!==void 0?A[e]:void 0;return e?s==="loading"?a.jsx(R,{size:20}):typeof s=="number"?a.jsx(N,{variant:"body2",children:s.toLocaleString()}):a.jsx(C,{title:t.is_manual?"":"Fetch estimated recipients",children:a.jsx("span",{children:a.jsx(E,{disabled:!!t.is_manual,onClick:async()=>{try{g(u=>({...u,[e]:"loading"}));const x=await v().getOne({resource:"email_templates",id:`${e}/recipient_count`}),P="count"in x?x.count:void 0;typeof P=="number"?g(u=>({...u,[e]:P})):(g(u=>({...u,[e]:"error"})),l==null||l({message:"No count available for this template.",type:"error"}))}catch{g(x=>({...x,[e]:"error"})),l==null||l({message:"Failed to fetch recipient count.",type:"error"})}},children:a.jsx(M,{fontSize:"small"})})})}):a.jsx("span",{children:"-"})}},{field:"total_sends",headerName:"Template Sends",minWidth:120,type:"number",sortable:!0,valueGetter:(t,e)=>typeof(e==null?void 0:e.total_sends)=="number"?e.total_sends:0,align:"center",headerAlign:"center"},{field:"has_notes",flex:1,display:"flex",headerName:"Notes",minWidth:70,type:"boolean",valueGetter:(t,e)=>((e==null?void 0:e.notes)||"").toString().trim().length>0,renderCell:({row:t})=>a.jsx(I,{checked:((t==null?void 0:t.notes)||"").toString().trim().length>0,disabled:!0})}],[h,f,o,d,v,l,A]),j="data"in m.rows?m.rows.data:m.rows,T=async t=>{if(n==="all"){l==null||l({message:"Select a program to update",type:"error"});return}y({url:`/programs/${n.id}/email_templates/activation/`,method:"post",values:{ids:c,is_active:t}},{onSuccess:()=>{l==null||l({message:t?"Activated selected templates":"Deactivated selected templates",type:"success"}),S([]),o({resource:"email_templates",invalidates:["list"]})},onError:()=>{l==null||l({message:"Bulk update failed",type:"error"})}})},W=()=>{if(c.length===0)return[];const t=j.filter(i=>c.includes(i.id)),s=t.length>0&&t.every(i=>!i.is_active);return[{name:s?"Activate Selected":"Deactivate Selected",onClick:()=>T(s),disabled:n==="all"||b,icon:s?a.jsx(L,{}):a.jsx(F,{})}]};return a.jsx(ie,{title:"Email Templates",children:a.jsxs(V,{canCreate:!0,headerButtons:({createButtonProps:t})=>{const e=n==="all",s={...t??{}};return e?(delete s.to,s.component="button",s.onClick=i=>{i!=null&&i.preventDefault&&i.preventDefault(),i!=null&&i.stopPropagation&&i.stopPropagation()},s.onMouseDown=i=>{i!=null&&i.preventDefault&&i.preventDefault(),i!=null&&i.stopPropagation&&i.stopPropagation()}):"component"in s&&s.component===void 0&&delete s.component,a.jsx(C,{title:e?"Select a program to create":"",children:a.jsx("span",{children:a.jsx(U,{...s,disabled:e})})})},title:a.jsx(N,{variant:"h5",children:"Email Templates"}),children:[a.jsx(ce,{data:j,columns:D}),a.jsx(ae,{...m,rows:j,columns:D,autoHeight:!0,checkboxSelection:!0,rowSelectionModel:c,onRowSelectionModelChange:t=>S(t),isRowSelectable:()=>n!=="all",rowSelectionColumnPosition:"right",disableColumnMenu:!0,filterDebounceMs:500,loading:m.loading,actionButtons:W()})]})})};export{Ge as AllEmails};

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.