PageSourceSearch

https://soundvision-infq.web.app/assets/pledge-main.component-mQem6YHI.js

js soundvision-infq.web.app collected 2026-10-03 12:38:09 UTC 11,243 bytes, 1 lines download raw bytes

1import{e,a8 as I,B as m,F as b}from"./ui-vendor-CaFOqX7E.js";import{r as a,u as S,R as T}from"./react-vendor-Diu8YNKx.js";import{e as j,u as _}from"./redux-vendor-kFPYml90.js";import{S as k}from"./pledge-plus-icon-BcZ_HP6Z.js";import{c as R,d as B,K as F,j3 as L,j4 as H,aq as M,j5 as z,aG as h,aQ as x,dP as $,iz as O,o as W,aa as Z,e as U,j6 as u}from"./index-qNf3TKpL.js";import{S as Q}from"./simple-pagination-component-D4cx2QYN.js";import{S as q}from"./simple-page-size-select.component-DXf1DsRB.js";import{u as K,g as Y}from"./pledgeeColumns-B9haSOi8.js";import{S as J}from"./simple-resuable-mui-table.component-DEjojnAx.js";import"./firebase-vendor-DpNCE-dN.js";import"./form-vendor-D7Pc5Nza.js";import"./chart-vendor-DSC_euA_.js";import"./mail-icon-B7FeeeOp.js";import"./trash-icon-Cl48LPg6.js";import"./detailed-pencil-icon-CFm8exdq.js";const X=s=>a.createElement("svg",{width:100,height:100,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},a.createElement("g",{filter:"url(#filter0_d_9233_37995)"},a.createElement("rect",{x:2,y:1,width:96,height:96,rx:12,fill:"white"}),a.createElement("rect",{x:2.5,y:1.5,width:95,height:95,rx:11.5,stroke:"#EAECF0"}),a.createElement("path",{d:"M65.04 58.2001C65.6642 56.8803 65.9919 55.4399 66 53.9801V42.5201C65.9986 42.0272 65.8874 41.5408 65.6746 41.0962C65.4618 40.6517 65.1527 40.2601 64.7697 39.9498C64.3867 39.6396 63.9394 39.4185 63.4604 39.3027C62.9813 39.1868 62.4824 39.1791 62 39.2801C61.8361 38.9358 61.6202 38.6188 61.36 38.3401H61.22V29.9201C61.2174 29.534 61.1387 29.1522 60.9886 28.7965C60.8384 28.4408 60.6196 28.1182 60.3448 27.847C60.0699 27.5759 59.7443 27.3615 59.3866 27.2162C59.0289 27.0709 58.6461 26.9974 58.26 27.0001H34.9C34.129 27.0053 33.3915 27.3153 32.8482 27.8624C32.3049 28.4094 32 29.1491 32 29.9201V62.1001C32.0052 62.8676 32.3125 63.6022 32.8552 64.1449C33.3979 64.6876 34.1325 64.9948 34.9 65.0001H48V67.5201C47.9945 67.9006 48.1377 68.2682 48.3992 68.5446C48.6607 68.821 49.0198 68.9845 49.4 69.0001H64C64.3891 69.0001 64.7625 68.8469 65.0395 68.5737C65.3165 68.3004 65.4747 67.9291 65.48 67.5401V61.7201C65.4777 61.3955 65.3688 61.0807 65.1701 60.8241C64.9713 60.5675 64.6937 60.3834 64.38 60.3001C64.58 59.4801 64.8 58.7801 64.9 58.4601L65.04 58.2001ZM62.34 57.1001V57.3001C61.96 58.4601 61.68 59.4201 61.48 60.2601H52.2C52.1451 59.5375 51.9387 58.8345 51.5941 58.197C51.2495 57.5595 50.7745 57.0018 50.2 56.5601L49.8 56.3201C49.2062 56.0043 48.6879 55.5637 48.2805 55.0285C47.8731 54.4934 47.5864 53.8765 47.44 53.2201C46.9386 52.1743 46.3214 51.1881 45.6 50.2801C45.7517 50.222 45.9167 50.2081 46.076 50.24C46.2353 50.2718 46.3823 50.3481 46.5 50.4601L48.6 52.4601C48.8139 52.6584 49.0797 52.7918 49.3665 52.8449C49.6533 52.898 49.9493 52.8686 50.22 52.7601C50.4799 52.6448 50.7011 52.4572 50.8571 52.2195C51.0132 51.9819 51.0975 51.7044 51.1 51.4201V40.8201C51.0966 40.7419 51.1131 40.6641 51.1481 40.5941C51.1831 40.5241 51.2354 40.4642 51.3 40.4201C51.3 40.4201 51.44 40.3001 51.48 40.3001C51.6027 40.3121 51.7167 40.3691 51.8 40.4601C51.8336 40.49 51.86 40.5271 51.8773 40.5687C51.8947 40.6102 51.9024 40.6551 51.9 40.7001V49.0001C51.9 49.3873 52.0538 49.7586 52.3276 50.0324C52.6014 50.3062 52.9728 50.4601 53.36 50.4601C53.7472 50.4601 54.1186 50.3062 54.3924 50.0324C54.6662 49.7586 54.82 49.3873 54.82 49.0001V38.1401C54.8183 38.0472 54.8415 37.9555 54.8872 37.8746C54.9329 37.7937 54.9995 37.7265 55.08 37.6801C55.1393 37.6517 55.2042 37.6369 55.27 37.6369C55.3358 37.6369 55.4007 37.6517 55.46 37.6801C55.5056 37.7152 55.5422 37.7608 55.5665 37.813C55.5909 37.8652 55.6024 37.9225 55.6 37.9801V50.1401C55.6 50.3318 55.6378 50.5217 55.7111 50.6988C55.7845 50.8759 55.8921 51.0369 56.0276 51.1724C56.1632 51.308 56.3241 51.4156 56.5013 51.4889C56.6784 51.5623 56.8683 51.6001 57.06 51.6001C57.4491 51.6001 57.8225 51.4469 58.0995 51.1737C58.3765 50.9004 58.5347 50.5291 58.54 50.1401V40.7001C58.534 40.6186 58.5544 40.5373 58.5982 40.4683C58.642 40.3992 58.7069 40.3462 58.7832 40.317C58.8596 40.2878 58.9433 40.284 59.022 40.3062C59.1007 40.3284 59.1701 40.3753 59.22 40.4401C59.241 40.4802 59.252 40.5248 59.252 40.5701C59.252 40.6154 59.241 40.66 59.22 40.7001V49.0001C59.22 49.3873 59.3738 49.7586 59.6476 50.0324C59.9214 50.3062 60.2928 50.4601 60.68 50.4601C60.8732 50.4656 61.0656 50.4316 61.2452 50.3602C61.4248 50.2888 61.588 50.1814 61.7247 50.0447C61.8614 49.9081 61.9687 49.7449 62.0401 49.5653C62.1115 49.3856 62.1455 49.1933 62.14 49.0001V42.5401C62.147 42.4595 62.1772 42.3826 62.2269 42.3188C62.2766 42.2549 62.3436 42.2067 62.42 42.1801C62.4831 42.1411 62.5558 42.1205 62.63 42.1205C62.7042 42.1205 62.7769 42.1411 62.84 42.1801C62.84 42.1801 62.84 42.1801 62.84 42.4401V54.0001C62.9041 55.0576 62.7333 56.1163 62.34 57.1001ZM58.34 36.6601C58.1763 36.2998 57.9455 35.9741 57.66 35.7001C57.2386 35.2518 56.7004 34.9303 56.106 34.7717C55.5115 34.6132 54.8846 34.6239 54.296 34.8028C53.7074 34.9817 53.1805 35.3215 52.7748 35.784C52.369 36.2465 52.1007 36.8132 52 37.4201H51.72C51.276 37.3913 50.8309 37.4565 50.4139 37.6116C49.9969 37.7667 49.6173 38.0081 49.3 38.3201C48.9584 38.6418 48.685 39.0289 48.4961 39.4583C48.3071 39.8878 48.2064 40.3509 48.2 40.8201V48.0601C47.4953 47.5271 46.6247 47.2608 45.7424 47.3084C44.8602 47.356 44.0233 47.7144 43.38 48.3201C42.8819 48.7786 42.5823 49.4134 42.545 50.0895C42.5076 50.7655 42.7354 51.4294 43.18 51.9401C43.7529 52.6538 44.2615 53.4167 44.7 54.2201C44.9501 55.1885 45.3971 56.0949 46.013 56.8829C46.629 57.6709 47.4007 58.3235 48.28 58.8001L48.66 59.0401C48.9586 59.3931 49.1526 59.8226 49.22 60.2801C48.8682 60.3238 48.5443 60.494 48.3088 60.759C48.0732 61.0239 47.9422 61.3656 47.94 61.7201V62.1001H34.92V29.9201H58.26L58.34 36.6601ZM50.86 63.1801H62.6V66.0201H50.86V63.1801Z",fill:"#101828"})),a.createElement("defs",null,a.createElement("filter",{id:"filter0_d_9233_37995",x:0,y:0,width:100,height:100,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"}
1,a.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),a.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),a.createElement("feOffset",{dy:1}),a.createElement("feGaussianBlur",{stdDeviation:1}),a.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"}),a.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_9233_37995"}),a.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_9233_37995",result:"shape"})))),ee=()=>{const s=j(),C=S(),[n,d]=a.useState(0),[o,l]=a.useState(10),[i,c]=a.useState(""),[r,te]=a.useState(""),{allPledgeGroups:v,allPledgeGroupLoading:y}=_(t=>t.pledges),f=t=>{c(t.target.value),d(0)},p=((t,g,V)=>T.useMemo(()=>(t==null?void 0:t.length)===0?[]:t.filter(G=>G.name.toLowerCase().includes(g.toLowerCase())),[t,g,V]))(v,i,r),E=t=>{d(t-1)},w=({value:t})=>{l(t),d(0)},{deleteConfirm:P,confirmDelete:A,cancelDelete:N}=K(),D=t=>{t.doc_id&&(s(L({docId:t.doc_id,groupId:t.group_id})),C(`/pledges/create-pledge-group?docId=${t.doc_id}&groupId=${t.group_id}`,{state:{type:"editMode",docId:t.doc_id,groupId:t.group_id}}))};return e.jsxs("div",{className:"pledge-group-table-wrapper",children:[e.jsx("div",{className:"search-wrapper",children:e.jsx(I,{type:"text",placeholder:"Search records",value:i,onChange:f,sx:{width:"320px",height:"44px",color:"#101828",fontSize:"16px",borderRadius:"10px",fontFamily:"Nunito Sans",padding:"0 14px",backgroundColor:"#fff",border:"1px solid #D0D5DD","&:hover":{border:"1px solid var(--primary-color)"},"&:focus-within":{border:"2px solid var(--primary-color)",outline:"none"},"& .MuiInputBase-input::placeholder":{color:"#667085",opacity:1}},startAdornment:e.jsx(m,{mr:1,mb:"1px",children:e.jsx(B,{stroke:"#667085"})}),endAdornment:i?e.jsx(m,{children:e.jsx(R,{stroke:"#667085",onClick:()=>f(""),style:{cursor:"pointer"}})}):null})}),e.jsxs(m,{sx:{fontSize:"12px",color:"#334054",padding:"2px 8px",fontWeight:500,padding:"12px",fontWeight:600,border:"1px solid #EAECF0"},children:["        ",p.length>0&&`${p.length} pledge groups`]}),e.jsx(J,{columns:Y(),data:p.slice(n*o,n*o+o),loading:y,paginationComponent:e.jsxs(b,{display:"flex",direction:"row",justifyContent:"flex-end",alignItems:"center",gap:2,sx:{width:"100%",mt:2},children:[e.jsx(q,{pageSize:o,options:[10,50,100],onPageSizeChange:w}),e.jsx(Q,{count:p.length,page:n+1,rowsPerPage:o,onPageChange:(t,g)=>E(g)})]}),handleRowClickAction:D,tableStyles:{borderRadius:"8px",border:"1px solid #EAECF0"}}),P&&e.jsx(F,{title:"Do you want to delete this pledge group?",subText:`This will delete "${P.name||""}" and all its pledgees.`,confirmText:"Yes, delete",cancelText:"Cancel",onConfirm:A,onCancel:N})]})},Pe=()=>{const s=j(),C=S(),{allPledgeGroups:n,allPledgeGroupLoading:d,pledgeDashboardMetric:o}=_(r=>r.pledges),[l,i]=a.useState({});a.useEffect(()=>{s({type:"SET_PLEDGE_GROUP",payload:{pledgeName:"",pledgeDate:new Date,groupStatus:"incomplete",fundraiserId:"",linkedEvent:"",pledgeeList:[],fundraiserType:""}}),s({type:"SET_PLDG_GRP_METRIC",payload:{total_pledge_amount:0,total_pledge_paid:0,total_pending_amount:0,total_refused_amount:0,total_pledge_amount_cnt:0,total_pledge_paid_cnt:0,total_pending_amount_cnt:0,total_refused_amount_cnt:0}}),s(H()),s(M({})),s(z({}))},[]),a.useEffect(()=>{let r={};r.totalPledgeGroups=o.totalPledgeGroups,r.totalPledgePaidAmount="$"+h(x(o.totalPledgePaidAmount||0)),r.totalPledgePendingAmount="$"+h(x(o.totalPledgePendingAmount||0)),r.totalPledgeRefusedAmount="$"+h(x(o.totalPledgeRefusedAmount||0)),i(r)},[n]);const c=()=>{C("/pledges/create-pledge-group")};return e.jsx("div",{className:"pledge-main-wrapper",children:d?e.jsx("div",{className:"fetch-all-loader-wrapper",children:e.jsx($,{size:20,color:"gray"})}):(n==null?void 0:n.length)===0?e.jsxs("div",{className:"no-pledge-wrapper",children:[e.jsx("div",{className:"no-pledge-icon",children:e.jsx(X,{})}),e.jsxs("div",{className:"text-container",children:[e.jsx("p",{className:"main-text",children:"No pledge group created"}),e.jsx("p",{className:"sub-text",children:"Start by creating your first pledge group now"})]}),e.jsx("div",{className:"no-pledge-actions",children:e.jsx(O,{onClick:c,startIcon:e.jsx(k,{stroke:"#101828"}),children:"Create new pledge group"})})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"some-pledge-wrapper",children:[e.jsx(W,{crumbs:["Fundraising","Pledges"],onCrumbClick:()=>{}}),e.jsxs("div",{className:"header-wrapper",children:[e.jsx(Z,{children:"Pledges"}),e.jsx(U,{size:"large",variant:"contained",onClick:c,children:"Create new pledge group"})]}),e.jsx("span",{className:"divider"}),e.jsxs("div",{className:"stats-stack",children:[e.jsx(u,{title:"Total pledge groups",count:(l==null?void 0:l.totalPledgeGroups)||0}),e.jsx(u,{title:"Total paid pledge amounts",count:(l==null?void 0:l.totalPledgePaidAmount)||0}),e.jsx(u,{title:"Total pending pledge amounts",count:(l==null?void 0:l.totalPledgePendingAmount)||0}),e.jsx(u,{title:"Total refused pledge amounts",count:(l==null?void 0:l.totalPledgeRefusedAmount)||0})]}),e.jsx("div",{className:"table-wrapper",children:e.jsx(ee,{})})]})})})};export{Pe 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.