PageSourceSearch

https://donate-portal.vercel.app/_next/static/chunks/563-e77e41575df17ff2.js

js donate-portal.vercel.app collected 2026-10-03 07:16:25 UTC 53,262 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[563],{563:(e,a,n)=>{n.r(a),n.d(a,{default:()=>eb});var t=n(4848),s=n(6540),l=n(3261),i=n(6715),o=n(8334),r=n(6658),d=n(2491),c=n(3928),m=n(5626),u=n(4511),p=n(9998),h=n(2572),g=n(5729),x=n(3816),v=n(5418),f=n(8302),j=n(5026),b=n(1339),y=n(1896),A=n(9976),C=n(4672),w=n(5640),S=n(2480),k=n(7156),N=n(3041),D=n(5319),P=n(4258),F=n(8637),B=n(1498),I=n(7768),T=n(8864),z=n(6294),E=n(7728),L=n(4505),Z=n(5093),q=n.n(Z),M=n(6405),U=n(8465),R=n.n(U),O=n(8874);n(6425);let W={display:"inline-flex",padding:30};function H(e){var a,n,l;let{campaign:r,mobile:d,preview:c,createdDate:m}=e,[u,p]=(0,s.useState)({}),[h,g]=(0,s.useState)({}),x=(0,i.useRouter)();(0,s.useEffect)(()=>{Object.keys(x.query).forEach(e=>{if(!r.pfp||"object"!=typeof r.pfp)return;let a=r.pfp.find(a=>a.shortLink==e);a&&p(a)})},[x]),(0,s.useEffect)(()=>{if((null==r?void 0:r.donations)&&(null==r?void 0:r.showProgress)){let e=[{name:"Alumni",count:0,y:0},{name:"Parents",count:0,y:0},{name:"Trustees",count:0,y:0},{name:"Friends",count:0,y:0}];r.donations.map(a=>{let n=["Alumni","Parent","Trustee","Friend"].indexOf(a.donorType);(isNaN(n)||n<0)&&(n=0),e[n].y+=a.amount,e[n].count++}),g(e)}},[r]);let v=void 0!==u.pfpData,f="\n  .progress {\n    display: block;\n    /* default: inline-block; \n    width: 300px; */\n    margin: 2em auto;\n    padding: 4px;\n    padding-left:15px;\n    border: 0 none;\n    background: ".concat((null==r?void 0:r.backgroundColor)?r.backgroundColor:"#444",";\n    border-radius: 14px;\n    box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(1, 146, 103 ,0.2);\n  }\n  .progress::-moz-progress-bar {\n    border-radius: 12px;\n    background: rgb(1, 146, 103);\n    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.4), 0 2px 5px 0px rgba(0,0,0,0.3);\n  }\n  /* webkit */\n  @media screen and (-webkit-min-device-pixel-ratio:0) {\n    .progress {\n      height: 25px;\n    }\n  }\n  .progress::-webkit-progress-bar {\n      background: transparent;\n  }  \n  .progress::-webkit-progress-value {  \n    border-radius: 12px;\n    background: rgb(1, 146, 103);\n    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.4), 0 2px 5px 0px rgba(0,0,0,0.3); \n  } \n  "),j=r.percentCompleted||0,b=(null==r?void 0:r.backgroundColor)||"rgb(1, 146, 103)";return(0,t.jsxs)(o.A,{id:"infoBox",className:"campaignColor",style:Object.assign({flexDirection:"column",fontSize:"1rem",flexGrow:1,color:"#000",marginTop:"70px"},W),item:!0,lg:d?12:c?6:4,md:d?12:6,sm:12,xs:12,children:[v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("img",{src:u.pfpData.image,style:{maxWidth:"100%",marginBottom:20}}),(0,t.jsx)(S.A,{variant:"h4",style:(r.backgroundImage&&r.backgroundPosition,{marginTop:30,fontSize:40,fontWeight:700}),children:u.pfpData.title}),(0,t.jsx)(S.A,{variant:"body2",dangerouslySetInnerHTML:{__html:u.pfpData.description.replace(/<\/?[^>]+(>|$)/g,"").replace(/(?:\r\n|\r|\n)/g,"<br />")}}),(0,t.jsx)("a",{target:"_blank",href:window.location.href,style:{color:"inherit"},children:"PFP Link to Share"}),(0,t.jsx)("hr",{})]}),(0,t.jsxs)(S.A,{variant:"h4",style:(r.backgroundImage&&r.backgroundPosition,{marginTop:30,fontSize:40,fontWeight:700}),children:[r.title,(0,t.jsx)(S.A,{variant:"body2",dangerouslySetInnerHTML:{__html:r.description.replace(/<\/?[^>]+(>|$)/g,"").replace(/(?:\r\n|\r|\n)/g,"<br />")}}),(0,t.jsx)("hr",{style:{borderColor:"rgba(256,256,256,0.4)"}})]}),r.showProgress&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"Goal :"})," $",(0,O.ej)(r.targetAmount)," ",(0,t.jsx)("br",{}),(0,t.jsx)("b",{children:"Amount received towards goal :"})," $",(0,O.ej)(r.totalRecieved)||0," (",r.percentCompleted||0,"%) ",(0,t.jsx)("br",{})]})}),(0,t.jsx)("div",{children:(0,t.jsxs)("small",{style:{fontSize:12},children:["Created ",m," | ",null===(a=M.J7.find(e=>e.key==r.organisationType))||void 0===a?void 0:a.label," | ",null===(n=M.R1.find(e=>e.key==r.campaignType))||void 0===n?void 0:n.label]})}),r&&r.backgroundImage&&3==r.backgroundPosition&&(0,t.jsx)("img",{src:convertImgPath(r.backgroundImage),style:campaignImage}),(0,t.jsx)("div",{className:"mt-10"}),r.showProgress?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:f}),(0,t.jsxs)("div",{className:"progress",style:{height:30,width:"100%",background:"linear-gradient(to right, #19857b 0%, #19857b ".concat(j,"%, ","#19857b"," ").concat(j,"%, ").concat(b," ").concat(j,"%, ").concat(b," 100%)")},children:[r.percentCompleted||0,"%"]})]}):(0,t.jsx)("hr",{style:{borderColor:"rgba(256,256,256,0.4)"}}),(0,t.jsxs)("h3",{children:[(null==r?void 0:r.donations)&&(0,t.jsxs)("div",{children:["Number of Donations: ",r.donations.length]}),(0,t.jsx)("b",{children:"Number of Donors: "}),(0,t.jsx)("span",{children:(null==r?void 0:null===(l=r.donations)||void 0===l?void 0:l.length)&&function(e,a){let n=e.map(e=>e[a]);return e.filter((e,t)=>
1n.indexOf(e[a])===t)}(r.donations,"userId").length})," ",(0,t.jsx)("br",{}),(0,t.jsx)("b",{children:"Total Raised to date: "}),(0,t.jsxs)("span",{children:["$",(0,O.ej)(r.totalRecieved)]}),r.showProgress&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)("div",{className:"flexcontainer flex-wrap"})]})]})]})}var _=n(1346),$=n(8457),G=n(2665),Y=n(2877),J=n(2926);let V=(0,n(7427).c)("pk_test_9aFdyGszY6FoEGjnoLDhid5H");function Q(e){let{finalAmount:a,handleCreateSubmit:n,paymentMethod:l,setpaymentMethod:i}=e,[r,d]=(0,s.useState)(!1),[c,m]=(0,s.useState)("");(0,s.useEffect)(()=>{fetch("/api/Stripe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:"xl-tshirt"}]})}).then(e=>e.json()).then(e=>m(e.clientSecret))},[]);let u={appearance:{theme:"stripe"}};c&&(u.clientSecret=c);let p=function(e){e.data.firstpay&&(console.log("",JSON.stringify(e.data)),104==e.data.code&&"generatingCryptogramFinished"==e.data.type&&n())};return((0,O.nW)("https://secure.1stpaygateway.net/secure/paymenthostedform/scripts/firstpay/firstpay.cryptogram.js"),(0,s.useEffect)(()=>(window.addEventListener?window.addEventListener("message",p,!1):window.attachEvent("onmessage",p),()=>{window.removeEventListener?window.removeEventListener("message",p,!1):window.detachEvent("onmessage",p)}),[]),!parseFloat(a)||parseFloat(a<5))?(0,t.jsx)("div",{children:"Please select an amount ( greater than $5 )."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.A,{sx:{borderBottom:1,borderColor:"divider"},children:(0,t.jsxs)($.A,{value:l,onChange:(e,a)=>i(a),children:[(0,t.jsx)(G.A,{label:"IATS",value:"iats"}),(0,t.jsx)(G.A,{label:"Stripe",value:"stripe"}),(0,t.jsx)(G.A,{label:"PayPal",value:"paypal"}),(0,t.jsx)(G.A,{label:"Check / Offline",value:"check"})]})}),"iats"==l?(0,t.jsx)(_.A,{sx:{p:3},value:0,index:0,children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:'\n        /* scrollbarStyles */\n        ::-webkit-scrollbar {width: 0px;}\n        ::-webkit-scrollbar-track {background:#ddd;}\n        ::-webkit-scrollbar-thumb  {background:#ccc;}\n        ::-webkit-scrollbar-thumb:hover {background:#bbb;}\n      \n        /* Styles for Payment Form */\n        #firstpay-iframe{width:80vw;height:500px;overflow:hidden;border:0}\n        .firstpay-container{font-family:Roboto,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400}\n        .firstpay-label{font-weight:400;display:inline-block;margin-bottom:.5rem}\n        .firstpay-input2{display:block;width:75%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}select.firstpay-input2:not([size]):not([multiple]){height:calc(2.25rem + 2px)}\n        .firstpay-input{\n          color: #000;\n          background: #eee;\n          outline: none;\n          border: none;\n          font-size: 16px;\n          border-bottom: 1px solid #848484;\n          padding: 27px 12px 10px;\n          border-radius: 5px 5px 0px 0px;\n          transition: all 0.3s ease;\n        }\n        .firstpay-input:hover{\n          border-bottom: 1px solid #000;\n          background: #dfdfdf;\n        }\n        .firstpay-input:focus{\n          border-bottom: 1px solid #158aec;\n        }\n        select.firstpay-input2:not([size]):not([multiple]){height:calc(2.25rem + 2px)}\n        \n        .firstpay-button{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s easein-out,box-shadow .15s ease-in-out;color:#fff;background-color:#007bff;border-color:#007bff}\n        .firstpay-button:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}\n        .firstpay-button:disabled{color:#fff;background-color:#007bff;border-color:#007bff}\n        .firstpay-form{display:block !important;}\n        .firstpay-column-expiration-month, .firstpay-column-expiration-year{width:100% !important;}\n        '}),(0,t.jsx)("iframe",{id:"firstpay-iframe",src:"https://secure.1stpaygateway.net/secure/paymenthostedform/v3/CreditCard?amount=".concat(encodeURIComponent(a),"&cvv2_code=123"),"data-transcenter-id":"1234567890","data-
1processor-id":"1234567890","data-transaction-type":"Sale","data-submit-text":"Save"})]})}):"stripe"==l?(0,t.jsx)(_.A,{sx:{p:3},value:1,index:1,children:(0,t.jsx)(o.A,{item:!0,xs:12,children:(0,t.jsxs)(J.Elements,{stripe:V,options:u,children:[(0,t.jsx)(J.CardElement,{options:{style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}}}}),(0,t.jsx)(j.A,{variant:"contained",size:"small",className:"creditcardbtn",type:"submit",style:{backgroundColor:"#ffc439",color:"rgb(0,48,135)",marginTop:20},children:"Submit"})]})})}):"check"===l?(0,t.jsx)(_.A,{sx:{p:3},value:3,index:3,children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)("p",{children:"Please mail your check to the organization address."}),(0,t.jsx)("p",{children:'Your donation status will be "Pending" until received.'}),(0,t.jsx)(j.A,{variant:"contained",color:"primary",onClick:n,children:"Submit Pledge"})]})}):(0,t.jsx)(_.A,{sx:{p:3},value:2,index:2,children:(0,t.jsx)("div",{style:{maxWidth:150,margin:"auto"},children:(0,t.jsx)(Y.ag,{options:{"client-id":"test",currency:"USD",intent:"capture"},children:(0,t.jsx)(Y.JV,{style:{layout:"horizontal",height:32},disabled:!a,createOrder:(e,n)=>n.order.create({purchase_units:[{amount:{value:a}}]}).then(e=>(d(e),e)),forceRender:[a]})})})})]})}var K=n(6578);let X=n(6425),ee=(e,a)=>{""===e.target.value||/^\d+$/.test(e.target.value)?(0,K.ZB)(e,a):L.Ay.error("Only Numbers Please.")},ea="mt-12 smallinput p-05",en="mt-12 p-05",et={flexGrow:1,margin:0,padding:0,minHeight:"100vh",backgroundSize:"cover",position:"relative"},es={display:"inline-flex",padding:30},el={padding:20,textAlign:"center",color:"#000",flexGrow:1,borderRadius:15},ei={width:"100%",maxHeight:"200px",objectFit:"cover"},eo=(0,I.A)(e=>({root:{width:"100%"},button:{marginRight:e.spacing(1)},instructions:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}}));function er(e,a){if("quick"==a.formType)switch(e){case 1:return(0,t.jsx)(em,{...a});case 2:return(0,t.jsx)(Q,{...a})}switch(e){case 0:return(0,t.jsx)(ed,{...a});case 1:return(0,t.jsx)(ec,{...a});case 2:return(0,t.jsx)(em,{...a});case 3:return(0,t.jsx)(Q,{...a});default:return"Unknown step"}}function ed(e){var a,n,l,i,f,j,b,y,A,C;let w;let[S,k]=(0,s.useState)(""),[N,D]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flexcontainer",children:(0,t.jsxs)(o.A,{item:!0,xs:12,children:[(0,t.jsx)(r.A,{onChange:a=>{e.setanonymous(a.target.checked)},checked:e.anonymous}),"Make me Anonymous"]})}),(0,t.jsx)("div",{className:"flexcontainer",children:(!e.campaign||void 0===e.campaign.organisation||!0==e.campaign.organisation)&&(0,t.jsxs)(o.A,{item:!0,xs:12,children:[(0,t.jsx)(r.A,{onChange:a=>{e.setorganisation(a.target.checked)},checked:e.organisation}),"Represent an Organization ?"]})}),(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(null===(a=e.campaign)||void 0===a?void 0:a.singleNameField)?(0,t.jsx)(d.A,{className:ea,style:{width:"100%"},label:"Full Name",variant:"filled",value:N?S:(e.firstname+" "+e.lastname).trim(),required:"required",InputProps:{errorMessage:"Please enter Full Name"},onFocus:()=>{k((e.firstname+" "+e.lastname).trim()),D(!0)},onBlur:()=>{D(!1)},onChange:a=>{k(a.target.value);let n=a.target.value.split(" ");e.setfirstname(n[0]),e.setlastname(n.slice(1).join(" ")),(0,K.ZB)({target:{value:n[0]}},e.setfirstname),(0,K.ZB)({target:{value:n.slice(1).join(" ")}},e.setlastname)}}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.A,{className:ea,label:"First Name",variant:"filled",value:e.firstname,required:"required",InputProps:{errorMessage:"Please enter First Name"},onChange:a=>e.handleUserUpdate(a,"firstname")}),(0,t.jsx)(d.A,{className:ea,label:"(Middle) Last Name",variant:"filled",value:e.lastname,required:"required",InputProps:{errorMessage:"Please enter Last Name"},onChange:a=>e.handleUserUpdate(a,"lastname")})]})}),(0,t.jsx)("div",{className:"flexcontainer",children:(0,t.jsx)(d.A,{variant:"filled",className:en,fullWidth:!0,required:"required",InputProps:{errorMessage:"Please enter Email"},onChange:a=>e.handleUserUpdate(a,"email"),value:e.email,label:"Email"})}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,fullWidth:!0,variant:"filled",required:"required",InputProps:{errorMessage:"Please enter Phone"},onChange:a=>e.handleUserUpdate(a,"phone"),value:e.phone,label:"Phone"}),(0,t.jsxs)(c.A,{variant:"filled",className:ea,sx:{m:1,minWidth:120},children:[(0,t.jsx)(m.A,{id:"demo-simple-select-filled-label",children:"I am:"}),(0,t.jsx)(u.A,{labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",value:e.donorType||"Alumni",onChange:a=>{(0,K.ZB)(a,e.setdonorType)},children:((w=null===(b=e.campaign)||void 0===b?void 0:b.donorTitle)&&0!==w.length||(w=["Friend"],(null==e?void 0:null===(y=e.campaign)||void 0===y?void 0:y.organisationType)!=M.J7[3].key&&w.unshift("Trustee/Board Member"),(null==e?void 0:null===(A=e.campaign)||void 0===A?void 0:A.organisationType)==M.J7[1].key&&(w.unshift("Parent"),w.unshift("Alumni")),(null==e?void 0:null===(C=e.campaign)||void 0===C?void 0:C.campaignType)==M.R1[3].key&&w.push("Sponsor")),w.map((e,a)=>(0,t.jsx)(p.A,{value:e,children:e},a)))})]})]}),(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:null===(l=e.campaign)||void 0===l?void 0:null===(n=l.customFields)||void 0===n?void 0:n.map((a,n)=>{var s;return(0,t.jsx)(d.A,{className:ea,label:a||"Custom Field",variant:"filled",value:(null===(s=e.customFieldValues)||void 0===s?void 0:s[a])||"",onChange:n=>{e.setCustomFieldValues({...e.customFieldValues,[a]:n.target.value})}},n)})}),(null===(i=e.campaign)||void 0===i?void 0:i.badges)&&(0,t.jsx)("div",{className:"flexcontainer",children:(0,t.jsxs)(c.A,{component:"fieldset",className:en,children:[(0,t.jsx)(h.A,{component:"legend",children:"Get a Badge"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,t.jsxs)("div",{style:{border:"1px solid #ccc",padding:"5px",borderRadius:"5px"},children:[(0,t.jsx)(r.A,{})," \uD83C\uDFC5 Gold Supporter"]}),(0,t.jsxs)("div",{style:{border:"1px solid #ccc",padding:"5px",borderRadius:"5px"},children:[(0,t.jsx)(r.A,{})," \uD83E\uDD48 Silver Supporter"]})]})]})}),e.organisation?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(0,t.jsx)(d.A,{variant:"filled",className:ea,onChange:a=>{(0,K.ZB)(a,e.setname)},value:e.name,label:"Organisation Name"})})}):(0,t.jsx)(t.Fragment,{}),"standard"==e.formType&&(0,t.jsx)("div",{className:"text-left mt-12",children:(0,t.jsxs)(c.A,{component:"fieldset",className:en,children:[(0,t.jsx)(h.A,{component:"legend",children:"I want to make this gift in Honor or Memory of:"}),(0,t.jsxs)(g.A,{row:!0,"aria-label":"memory",name:"row-radio-buttons-group",value:null===(f=e.honorDetails)||void 0===f?void 0:f.enabled,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"enabled")},children:[(0,t.jsx)(x.A,{value:"true",control:(0,t.jsx)(v.A,{}),label:"Yes"}),(0,t.jsx)(x.A,{value:"false",control:(0,t.jsx)(v.A,{}),label:"No"})]})]})}),(null===(j=e.honorDetails)||void 0===j?void 0:j.enabled)=="true"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"smalltext mt-12 p-05",children:"Tell us who we should notify that a gift was made in their honor or love one’s honor "}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"First Name",variant:"filled",value:e.honorDetails.firstname,onChange:a=>
1{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"firstname")}}),(0,t.jsx)(d.A,{className:ea,label:"Last Name",variant:"filled",value:e.honorDetails.lastname,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"lastname")}})]})]}),(0,t.jsx)("div",{className:"text-left mt-12",children:(0,t.jsxs)(c.A,{component:"fieldset",className:en,children:[(0,t.jsx)(h.A,{component:"legend",children:"How would you like to Notify the person in Honour?"}),(0,t.jsxs)(g.A,{row:!0,"aria-label":"notify",name:"row-radio-buttons-group",value:e.honorDetails.notifyPerson,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"notifyPerson")},children:[(0,t.jsx)(x.A,{value:"mail",control:(0,t.jsx)(v.A,{}),label:"Mail"}),(0,t.jsx)(x.A,{value:"email",control:(0,t.jsx)(v.A,{}),label:"Email"})]})]})}),"mail"==e.honorDetails.notifyPerson?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"Address Line 1",variant:"filled",value:e.honorDetails.addressLine1,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"addressLine1")}})}),(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"Address Line 2",variant:"filled",value:e.honorDetails.addressLine2,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"addressLine2")}})}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"City",variant:"filled",value:e.honorDetails.city,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"city")}}),(0,t.jsx)(d.A,{className:ea,label:"State",variant:"filled",value:e.honorDetails.state,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"state")}})]}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"Zipcode",variant:"filled",value:e.honorDetails.zipCode,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"zipCode")}}),(0,t.jsx)(d.A,{className:ea,label:"Country",variant:"filled",value:e.honorDetails.country,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"country")}})]})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"Person in Honour's Email",variant:"filled",value:e.honorDetails.email,onChange:a=>{(0,K.ZB)(a,e.honorDetails,e.sethonorDetails,"email")}})})}),(0,t.jsx)("div",{children:(0,t.jsx)(d.A,{className:en,fullWidth:!0,id:"filled-multiline-flexible",label:"Personalized Message",multiline:!0,maxRows:4,value:e.personalizedMessage,onChange:a=>{(0,K.ZB)(a,e.setpersonalizedMessage)},variant:"filled"})})]}),"standard"==e.formType&&(0,t.jsx)("div",{className:"text-left mt-12",children:(0,t.jsxs)(c.A,{component:"fieldset",className:en,children:[(0,t.jsx)(h.A,{component:"legend",children:"Do you want to add your spouse or significant-other to this gift?"}),(0,t.jsxs)(g.A,{row:!0,"aria-label":"memory",name:"row-radio-buttons-group",onChange:a=>{(0,K.ZB)(a,e.setisSpouseAdded)},value:e.isSpouseAdded,children:[(0,t.jsx)(x.A,{value:"true",control:(0,t.jsx)(v.A,{}),label:"Yes"}),(0,t.jsx)(x.A,{value:"false",control:(0,t.jsx)(v.A,{}),label:"No"})]})]})}),"true"==e.isSpouseAdded&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"First Name",variant:"filled",value:e.otherfirstname,onChange:a=>{(0,K.ZB)(a,e.setotherfirstname)}}),(0,t.jsx)(d.A,{className:ea,label:"Last Name",variant:"filled",value:e.otherlastname,onChange:a=>{(0,K.ZB)(a,e.setotherlastname)}})]}),(0,t.jsx)("div",{className:"text-left",children:(0,t.jsxs)(c.A,{variant:"filled",className:"mt-12 p-05 smallinput",sx:{m:1,minWidth:120},children:[(0,t.jsx)(m.A,{id:"demo-simple-select-filled-label",children:"Relation"}),(0,t.jsxs)(u.A,{labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",value:e.relation,onChange:a=>{(0,K.ZB)(a,e.setrelation)},children:[(0,t.jsx)(p.A,{value:"Partner",children:"Partner"}),(0,t.jsx)(p.A,{value:"Friend",children:"Friend"})]})]})})]})]})}function ec(e){var a,n,s,l,i,o,r,c,m;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flexcontainer spacebtw",children:(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"Address Line 1",variant:"filled",value:null===(a=e.donorAddress)||void 0===a?void 0:a.line1,onChange:a=>e.handleUserUpdate(a,"line1")}
1)}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(null===(n=e.campaign)||void 0===n?void 0:n.googleAddressValidation)&&(0,t.jsxs)("div",{style:{width:"100%",marginBottom:"10px"},children:[(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"\uD83D\uDD0D Start typing address...",variant:"filled"}),(0,t.jsxs)("small",{style:{color:"green"},children:["Saved as: ",null===(s=e.donorAddress)||void 0===s?void 0:s.line1," ",null===(l=e.donorAddress)||void 0===l?void 0:l.city]})]}),(0,t.jsx)(d.A,{className:en,fullWidth:!0,label:"Address Line 2",variant:"filled",value:null===(i=e.donorAddress)||void 0===i?void 0:i.line2,onChange:a=>e.handleUserUpdate(a,"line2")})]}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"City",variant:"filled",value:null===(o=e.donorAddress)||void 0===o?void 0:o.city,onChange:a=>e.handleUserUpdate(a,"city")}),(0,t.jsx)(d.A,{className:ea,label:"State",variant:"filled",value:null===(r=e.donorAddress)||void 0===r?void 0:r.state,onChange:a=>e.handleUserUpdate(a,"state")})]}),(0,t.jsxs)("div",{className:"flexcontainer spacebtw",children:[(0,t.jsx)(d.A,{className:ea,label:"Zipcode",variant:"filled",value:null===(c=e.donorAddress)||void 0===c?void 0:c.zipcode,onChange:a=>e.handleUserUpdate(a,"zipcode")}),(0,t.jsx)(d.A,{className:ea,label:"Country",variant:"filled",value:null===(m=e.donorAddress)||void 0===m?void 0:m.country,onChange:a=>e.handleUserUpdate(a,"country")})]})]})}function em(e){var a,n;let s=(a,n)=>{let t=[...e.fundPercentages];n>=0&&(t[a]=parseInt(n));let s=t.reduce((e,a,n)=>0!=n&&e?e-a:e,100);t[0]=s,s<0&&(t=[100]),e.setfundPercentages(t)};return(0,t.jsx)("div",{container:!0,spacing:0,className:"mt-12 p-05",children:(0,t.jsxs)("div",{className:"",children:[(!e.campaign||void 0===e.campaign.multiyear||!0==e.campaign.multiyear)&&(0,t.jsxs)(o.A,{item:!0,xs:12,children:[(0,t.jsx)(c.A,{component:"fieldset",className:"text-center",children:(0,t.jsxs)(g.A,{row:!0,name:"gifttype",value:e.gifttype,onClick:a=>{"pledge"==a.target.value&&e.setPledgeDialogOpen(!0)},onChange:a=>{(0,K.ZB)(a,e.setgifttype),"pledge"==a.target.value&&e.setPledgeDialogOpen(!0)},children:[(0,t.jsx)(x.A,{control:(0,t.jsx)(v.A,{checked:"onetime"===e.gifttype}),label:"One-Time",value:"onetime"}),(0,t.jsx)(x.A,{control:(0,t.jsx)(v.A,{checked:"pledge"===e.gifttype}),label:"Pledge",value:"pledge"}),(0,t.jsx)(x.A,{control:(0,t.jsx)(v.A,{checked:"pledgepayment"===e.gifttype}),label:"Pledge Payment",value:"pledgepayment"})]})}),(0,t.jsx)("br",{})]}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsx)(ep,{pageData:e}),(0,t.jsx)("div",{className:"",children:(null===(a=e.campaign.funds)||void 0===a?void 0:a.length)>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"headingfont mt-36",children:"Selected Funds"}),e.campaign.funds.map((a,n)=>(0,t.jsxs)("div",{className:"mt-3 flexcontainer spacebtw",children:[(0,t.jsxs)("div",{className:"smalltext m-a-0",children:[(0,t.jsx)(r.A,{checked:0==n||e.fundPercentages[n]>0?"checked":"",onChange:a=>s(n,e.fundPercentages[n]>0?0:1)}),a]}),(0,t.jsxs)("span",{className:"float-right text-right",children:[(0,t.jsxs)("span",{style:{marginTop:8,display:"inline-block"},children:["$",parseInt(e.finalAmount)/100*parseInt(e.fundPercentages[n]||0)," \xa0"]}),(0,t.jsx)(d.A,{type:"number",style:{maxWidth:84},disabled:0==n,value:parseInt(e.fundPercentages[n]||0).toString(),onChange:e=>s(n,e.target.value),InputProps:{endAdornment:(0,t.jsx)(f.A,{position:"end",children:" %"})},className:"right-stat m-a-0"})]})]}))]})}),(0,t.jsx)("div",{className:"headingfont mt-36",children:"Summary"}),(0,t.jsxs)("div",{className:"",children:["pledge"===e.gifttype&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-3 flexcontainer spacebtw",children:[(0,t.jsx)("div",{className:"smalltext left-stat m-a-0",children:"Total Payments"}),(0,t.jsx)("div",{className:"smalltext right-stat w-24p m-a-0",children:e.pledgeMonthCount})]}),(0,t.jsxs)("div",{className:"mt-3 flexcontainer spacebtw mt-",children:[(0,t.jsxs)("div",{className:"smalltext left-stat m-a-0",children:[1==e.PledgeType?M.fv[0]:3==e.PledgeType?M.fv[1]:M.fv[2]," Amount being paid"]}),(0,t.jsxs)("div",{className:"smalltext right-stat w-24p m-a-0",children:["$","pledge"==e.gifttype?(e.donationAmount/e.pledgeMonthCount).toFixed(2):e.donationAmount]})]})]}),(0,t.jsxs)("div",{className:"mt-3 flexcontainer spacebtw mt-",children:[(0,t.jsxs)("div",{className:"smalltext left-stat m-a-0",children:["Transaction Fee (",e.transactionFee,"%)"]}),(0,t.jsxs)("div",{className:"smalltext right-stat w-24p m-a-0",children:["$",e.transactionFeeAmount]})]}),(0,t.jsxs)("div",{className:"mt-3 flexcontainer spacebtw mt-",children:[(0,t.jsx)("div",{className:"smalltext left-stat m-a-0",children:"Total Amount"}),(0,t.jsxs)("div",{className:"smalltext right-stat w-24p m-a-0",children:["$",e.finalAmount]})]})]}),(0,t.jsxs)(o.A,{item:!0,xs:12,children:[(0,t.jsx)(r.A,{value:!!e.transactionFee,onChange:a=>{e.settransactionFee(a.target.checked?parseInt(e.campaign.taxPercent||0):0)}})," ","I'd like to cover the cost of transaction fees.",(null===(n=e.campaign)||void 0===n?void 0:n.campaignType)==M.R1[3].key&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)(r.A,{}),"I don't want to attend"]})]})]})]})})}function eu(e){var a;let{LoggedIn:n,handleLogout:s}=e,l=(0,i.useRouter)();return n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"#",onClick:s,children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",style:{float:"right"},fill:"currentColor",className:"bi bi-box-arrow-right",viewBox:"0 0 16 16",children:[" ",(0,t.jsx)("path",{"fill-rule":"evenodd",d:"M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z"})," ",(0,t.jsx)("path",{"fill-rule":"evenodd",d:"M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"})]})}),(0,t.jsx)("a",{href:"/user/home",children:(0,t.jsx)("svg",{id:"i-home",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:"16",height:"16",className:"bi bi-pers
1on-plus mr-10",style:{float:"right"},fill:"none",stroke:"currentcolor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:(0,t.jsx)("path",{d:"M12 20 L12 30 4 30 4 12 16 2 28 12 28 30 20 30 20 20 Z"})})})]}):(0,t.jsx)("a",{href:(null==l?void 0:null===(a=l.query)||void 0===a?void 0:a.id)&&"/user?login&donor="+l.query.id.toString(),children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",style:{float:"right"},fill:"currentColor",className:"bi bi-person-plus",viewBox:"0 0 16 16",children:[(0,t.jsx)("path",{d:"M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H1s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C9.516 10.68 8.289 10 6 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"}),(0,t.jsx)("path",{"fill-rule":"evenodd",d:"M13.5 5a.5.5 0 0 1 .5.5V7h1.5a.5.5 0 0 1 0 1H14v1.5a.5.5 0 0 1-1 0V8h-1.5a.5.5 0 0 1 0-1H13V5.5a.5.5 0 0 1 .5-.5z"})]})})}function ep(e){var a,n,l,i;let{pageData:o}=e,r=(null===(a=o.campaign)||void 0===a?void 0:a.campaignType)==M.R1[3].key,[c,m]=(0,s.useState)(r?"event":"custom");return(0,t.jsxs)(t.Fragment,{children:["custom"==c&&(0,t.jsxs)(t.Fragment,{children:[null==o?void 0:null===(l=o.campaign)||void 0===l?void 0:null===(n=l.amounts)||void 0===n?void 0:n.map((e,a)=>(0,t.jsx)("button",{className:o.donationAmount==e?"mr-3 squareBtnSelected":"mr-3 squareBtn",onClick:()=>o.setDonationAmount(e),children:"$"+e},a)),(!o.campaign||void 0===o.campaign.customamount||!0==o.campaign.customamount)&&(0,t.jsx)("button",{className:o.showCustomAmountField?"squareBtnSelected":"squareBtn",onClick:()=>o.setshowCustomAmountField(!o.showCustomAmountField),children:"Other"}),r&&(0,t.jsx)("button",{className:"squareBtn",onClick:()=>m("event"),children:"Tables"}),(0,t.jsx)("br",{})]}),!0==o.showCustomAmountField&&"custom"==c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.A,{variant:"filled",className:"otheramount mt-12 ",value:o.currency,onChange:e=>{(0,K.ZB)(e,o.setcurrency)},children:[(0,t.jsx)(p.A,{value:"US $",children:"US $"}),(0,t.jsx)(p.A,{value:"EURO €",children:"EURO €"}),(0,t.jsx)(p.A,{value:"Yen \xa5",children:"Yen \xa5"})]}),(0,t.jsx)(d.A,{className:"mt-12 p-05 mediuminput",type:"number",label:"",variant:"filled",value:o.donationAmount,onChange:e=>{e.target.value<0&&(e.target.value=0),(0,K.ZB)(e,o.setDonationAmount)}})]}),"event"==c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)(d.A,{type:"number",className:"otheramount ml-10",onChange:e=>{var a,n,t;let s=(null===(a=o.campaign)||void 0===a?void 0:a.tableChairRatio)||10;e.target.value=e.target.value*s;let l=(null==o?void 0:null===(t=o.campaign)||void 0===t?void 0:null===(n=t.amounts)||void 0===n?void 0:n[0])*e.target.value;o.setDonationAmount(e.target.value>=s?1*l:l),ee(e,o.setquantity)},value:parseInt(o.quantity/((null===(i=o.campaign)||void 0===i?void 0:i.tableChairRatio)||10)),label:"Tables",id:"quantity"}),(0,t.jsx)(d.A,{type:"number",className:"otheramount ml-10",onChange:e=>{var a,n;let t=(null==o?void 0:null===(n=o.campaign)||void 0===n?void 0:null===(a=n.amounts)||void 0===a?void 0:a[0])*e.target.value;o.setDonationAmount(e.target.value>=6?1*t:t),ee(e,o.setquantity)},value:o.quantity,label:"Tickets",id:"quantity"}),!0==o.campaign.customamount&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{className:"squareBtn",onClick:()=>m("custom"),children:"Custom"}),(0,t.jsx)("p",{children:"If you want to make a straight charitable donation select “Custom”"})]})]})]})}let eh=0;function eg(e){let{preview:a,mobile:n,campaignDetails:l}=e,r=new Date,[m,u]=(0,s.useState)(null),[p,f]=(0,s.useState)(!1),[I,Z]=(0,s.use
1State)(""),[U,W]=(0,s.useState)(!1),[_,$]=(0,s.useState)(""),[G,Y]=(0,s.useState)(""),[J,V]=(0,s.useState)(""),[Q,ea]=(0,s.useState)(""),[en,ed]=(0,s.useState)(""),[ec,em]=(0,s.useState)({}),[eg,ex]=(0,s.useState)(0),[ev,ef]=(0,s.useState)("false"),[ej,eb]=(0,s.useState)({enabled:"false",notifyPerson:"mail"}),[ey,eA]=(0,s.useState)(""),[eC,ew]=(0,s.useState)(""),[eS,ek]=(0,s.useState)(""),[eN,eD]=(0,s.useState)(""),[eP,eF]=(0,s.useState)(""),[eB,eI]=(0,s.useState)({}),[eT,ez]=(0,s.useState)([100]),[eE,eL]=(0,s.useState)(!0),[eZ,eq]=(0,s.useState)("onetime"),[eM,eU]=(0,s.useState)(0),[eR,eO]=(0,s.useState)("US $"),[eW,eH]=(0,s.useState)(0),[e_,e$]=(0,s.useState)(0),[eG,eY]=(0,s.useState)(0),[eJ,eV]=(0,s.useState)("quick"),[eQ,eK]=(0,s.useState)(0),[eX,e0]=(0,s.useState)(!1),[e1,e5]=(0,s.useState)(1),[e2,e3]=(0,s.useState)(1),[e4,e6]=(0,s.useState)(r.getFullYear()+"-"+("0"+r.getMonth()).slice(-2)+"-"+r.getDate()),[e8,e7]=(0,s.useState)(r.getFullYear()+1+"-"+("0"+r.getMonth()).slice(-2)+"-"+r.getDate()),[e9,ae]=(0,s.useState)(!1),[aa,an]=(0,s.use
1State)(!1),[at,as]=(0,s.useState)(""),[al,ai]=(0,s.useState)(""),[ao,ar]=(0,s.useState)(""),[ad,ac]=(0,s.useState)(""),[am,au]=(0,s.useState)(!1),[ap,ah]=(0,s.useState)(""),[ag,ax]=(0,s.useState)(""),[av,af]=(0,s.useState)(0),[aj,ab]=(0,s.useState)(!1),[ay,aA]=(0,s.useState)(!1),[aC,aw]=(0,s.useState)({}),[aS,ak]=(0,s.useState)(!0),[aN,aD]=(0,s.useState)("stripe"),aP=(0,i.useRouter)(),aF=(0,T.A)(),aB=eo();(0,s.useEffect)(()=>{localStorage.firstname&&localStorage.firstname.length>0&&!a&&L.Ay.success("Welcome back "+localStorage.firstname),localStorage.userid&&localStorage.userid.length>0&&(ae(!0),localStorage.name&&$(localStorage.name),localStorage.firstname&&Y(localStorage.firstname),localStorage.lastname&&V(localStorage.lastname),localStorage.email&&ea(localStorage.email),localStorage.phone&&ed(localStorage.phone),X.post("/api/User",{action:"userDetail",userid:localStorage.userid}).then(e=>{var a,n,t;localStorage.userAddress=JSON.stringify((null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.address)||{}),em((null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(n=t.address)||void 0===n?void 0:n.home)||{})}))},[]),(0,s.useEffect)(()=>{l&&((null==l?void 0:l.campaignId)!=(null==m?void 0:m.campaignId)&&X.post("/api/User",{action:"changeLastPage",userid:localStorage.userid,lastPage:null==l?void 0:l.campaignId,lastOrganisation:null==l?void 0:l.ownerId}),u(l),ah(q()(l.creationDate).fromNow()),localStorage.thankYouMessage=l.thankYouMessage)},[l]);let aI=async function(e){var a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=null==e?void 0:null===(a=e.target)||void 0===a?void 0:a.value;if(localStorage[n]=t,"firstname"==n?(aY.firstname=t,(0,K.ZB)(e,aY.setfirstname)):"lastname"==n?(aY.lastname=t,(0,K.ZB)(e,aY.setlastname)):"email"==n?(aY.email=t,(0,K.ZB)(e,aY.setemail)):"phone"==n?(aY.phone=t,ee(e,aY.setphone)):"line1"==n?(aY.donorAddress.line1=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"line1")):"line2"==n?(aY.donorAddress.line2=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"line2")):"city"==n?(aY.donorAddress.city=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"city")):"state"==n?(aY.donorAddress.state=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"state")):"zipcode"==n?(aY.donorAddress.zipcode=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"zipcode")):"country"==n&&(aY.donorAddress.country=t,(0,K.ZB)(e,aY.donorAddress,aY.setDonorAddress,"country")),localStorage.userid){let e=JSON.parse(localStorage.userAddress);e.home=aY.donorAddress,await X.post("/api/User",{action:"editProfile",userid:localStorage.userid,name:aY.firstname+" "+aY.lastname,firstname:aY.firstname,lastname:aY.lastname,phone:aY.phone,email:aY.email,address:e})}},aT=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===e){let e=parseInt(q()(aY.PledgeStartDate).diff(q()(aY.PledgeEndDate),"months",!0));e<0&&(e*=-1),e3((e/=aY.PledgeType)||1)}e0(!1)};eh=eM||0;let az=(0,O.ej)(parseFloat(eh)*(av/100).toFixed(2));eh=(0,O.ej)(parseFloat(parseInt(eh)+parseInt(az)).toFixed(2));let aE=e=>{aw(Object.assign({},aC,{[e.target.name]:e.target.value}))},aL=async()=>{aA(!0);let e=new FormData,a=Object.assign({},aC);a.ownerId=localStorage.userid,a.CreatePfpImage&&(a.image=await (0,O.Sk)(await (0,O.w4)(a.CreatePfpImage)),delete a.CreatePfpImage),e.append("data",JSON.stringify({action:"pfp",parentCampaignId:m._id,pfpData:a})),(0,L.Ay)("Saving PFP"),X.post("/api/Campaign/Create",e,{headers:{"content-type":"multipart/form-data"}}).then(e=>{R().fire("Created!","Successfully Created with Link - "+O.$W.server+"page/donate?"+(null==e?void 0:e.data),"success")}).finally(()=>{aw({}),aA(!1),ab(!1)})},aZ=e=>{let a=!0;return document.querySelectorAll("[required]").forEach(e=>{if(!e.value){var n,t,s;a=!1,L.Ay.error((null==e?void 0:null===(s=e.parentNode)||void 0===s?void 0:null===(t=s.attributes)||void 0===t?void 0:null===(n=t.errormessage)||void 0===n?void 0:n.nodeValue)||"Please fill out the required fields.")}}),a},aq=()=>{document.querySelector(".stepContent")&&(document.querySelector(".stepContent").scrollTop=0)},aM=()=>{aq(),aZ()&&eK(e=>e+1)},aU=()=>{aq(),aZ()&&eK(e=>e-1)},aR=e=>()=>{aq(),aZ()&&eK(e)},[aO,aW]=s.useState(null),[aH,a_]=s.useState(""),a$=(e,a)=>{aW(e.currentTarget),a_(a)},aG=()=>{aW(null),a_("")},aY={campaign:m,setcampaign:u,organisation:U,setorganisation:W,anonymous:p,setanonymous:f,name:I,setname:Z,contactname:_,setcontactname:$,firstname:G,setfirstname:Y,lastname:J,setlastname:V,email:Q,setemail:ea,phone:en,setphone:ed,honorDetails:ej,sethonorDetails:eb,personalizedMessage:ey,setpersonalizedMessage:eA,isSpouseAdded:ev,setisSpouseAdded:ef,other:eC,setother:ew,otherfirstname:eS,setotherfirstname:ek,otherlastname:eN,setotherlastname:eD,relation:eP,setrelation:eF,customFieldValues:eB,setCustomFieldValues:eI,currency:eR,setcurrency:eO,quantity:eW,setquantity:eH,donorAddress:ec,setDonorAddress:em,donationAmount:eM,setDonationAmount:eU,donorType:eg,setdonorType:ex,gifttype:eZ,setgifttype:eq,pledgeMonthCount:e2,setPledgeMonthCount:e3,monthlyAmount:e_,setmonthlyAmount:e$,totalPledgedAmount:eG,settotalPledgedAmount:eY,AccountName:at,setAccountName:as,CardNumber:al,setCardNumber:ai,ExpiryMonth:ao,setExpiryMonth:ar,ExpiryYear:ad,setExpiryYear:ac,paymentoptions:aS,setpaymentoptions:ak,paymentMethod:aN,setpaymentMethod:a
1D,finalAmount:eh,transactionFeeAmount:az,handleUserUpdate:aI,handleCreateSubmit:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e||e.preventDefault(),(0,O.ki)({type:"donationCompleted",to:Q,amount:eh,firstname:G,lastname:J,donorAddress:ec}),X.post("/api/Donation",{action:"create",userId:localStorage.userid,campaignId:m._id,ownerId:m.ownerId,organisationName:I,organisationContactName:_,organisation:U,name:I,firstname:G,lastname:J,email:Q,phone:en,donorAddress:ec,donorType:eg,honorDetails:ej,personalizedMessage:ey,other:eC,otherfirstname:eS,otherlastname:eN,relation:eP,customFields:eB,gifttype:eZ,amount:eh,monthlyAmount:e_,totalPledgedAmount:eG,paymentMethod:aN,status:"check"===aN?"Pending":"Paid"}).then(e=>{aP.push("/page/thankyou")}),!1},setPledgeDialogOpen:e0,formType:eJ,setformType:eV,iatsPay:am,setiatsPay:au,setActiveStep:eK,PledgeStartDate:e4,setPledgeStartDate:e6,PledgeEndDate:e8,setPledgeEndDate:e7,setpayfrequency:ax,payfrequency:ag,PledgeType:e1,setPledgeType:e5,fundPercentages:eT,setfundPercentages:ez,showCustomAmountField:eE,setshowCustomAmountField:eL,transactionFee:av,settransactionFee:af,preview:a,router:aP},aJ="quick"==eJ?["About You","Amount","Payment"]:["About You","Address","Amount","Payment"];return(0,t.jsxs)(o.A,{id:"pagecontainer",className:"small",container:!0,style:Object.assign({},m&&m.backgroundColor&&{backgroundColor:m.backgroundColor||"#30475e"},m&&m.backgroundImage&&1==m.backgroundPosition&&{backgroundImage:"linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url("+(0,O.wx)(m.backgroundImage)},et),children:[(0,t.jsx)("style",{children:"\n  #pagecontainer{\n    background-size:cover;\n  }\n  @media(max-width:958px){\n    #infoBox{\n      height: fit-content;\n    }\n    #pagecontainer{\n      align-content: flex-start;\n    }\n  }\n  .creditcardbtn{background:#ffc439;border:0px;color:rgb(0,48,135);margin-left:20px;height:32px;font-weight:bold;}\n  .creditcardbtn:hover,.creditcardbtn:focus{background:#ce8518 !important;}\n  .otheramount{max-width:100px;}\n\n  .rightForm{\n    max-height: 70vh;\n  }\n  .rightFormInner{\n    max-height: 50vh;\n  }\n  .stepContent{\n    overflow-x:hidden;\n    overflow-y:scroll;\n  }\n  .squareBtn{\n    font-weight:600;\n    font-size: 18px;\n    background: #fff;\n    border-radius: 0px;\n    border: 2px solid #505050;\n    padding: 10px 30px;\n    color: #505050;\n    cursor: pointer;\n    text-align:left;\n  }\n  .squareBtn:hover{\n    background:#ddd;\n  }\n  .squareBtnSelected{\n    font-weight:600;\n    font-size: 18px;\n    color: #fff;\n    background: #505050;\n    border-radius: 0px;\n    border: 2px solid #505050;\n    padding: 10px 30px;\n    cursor: pointer;\n    text-align:left;\n  }\n\n  /* Remove icons in number input */\n  /* Chrome, Safari, Edge, Opera */\n  input::-webkit-outer-spin-button,\n  input::-webkit-inner-spin-button {\n    -webkit-appearance: none;\n    margin: 0;\n  }\n  /* Firefox */\n  input[type=number] {\n    -moz-appearance: textfield;\n  }  \n  \n  /* Styling by Akshay */\n  .smallinput{width: 49% !important; }\n  .milliinput{width: 24% !important;}\n  .p-05{padding: 0 5px !important;}\n  .smalltext{color: rgba(0, 0, 0, 0.54); font-size: 17px !important; text-align: left;}\n  .right-stat{text-align: center; margin: 0 10px; background: #eee; padding: 5px 15px; border:0; border-bottom: 1px solid #000;}\n  .MuiTextField-root.right-stat{padding: 0px 10px;}\n  .w-24p{width: 24%; }\n  .left-stat{padding: 5px 0;}\n  .m-a-0{margin: auto 0;}\n  .mt-3{margin-top: 3px;}\n  .right-input{background: #eee; outline: none; border: none; text-align: center; font-size: 16px; border-bottom: 1px solid #000; }\n  .recentdonation{padding: 3px 10px; border: 1px solid #fff; border-radius: 15px;flex: 1 1 45%;font-size: 0.9rem;}\n  "}),(null==m?void 0:m.fontcolor)&&(0,t.jsx)("style",{children:"\n          .campaignColor{color:".concat(m.fontcolor," !important}\n        ")}),(0,t.jsx)("style",{children:n&&"\n        #infoBox{\n        height: fit-content;\n        }\n        #pagecontainer{\n        align-content: flex-start;\n        }\n        "}),(0,t.jsx)("script",{src:"https://code.highcharts.com/highcharts.js"}),(0,t.jsx)("script",{src:"https://code.highcharts.com/modules/series-label.js"}),(0,t.jsx)("script",{src:"https://code.highcharts.com/modules/exporting.js"}),(0,t.jsx)("script",{src:"https://code.highcharts.com/modules/export-data.js"}),(0,t.jsx)("script",{src:"https://code.highcharts.com/modules/accessibility.js"}),(null==m?void 0:m.campaignType)==M.R1[1].key&&(0,t.jsx)(j.A,{id:"pfpBtn",variant:"contained",color:"secondary",size:"small",style:{position:"fixed",backgroundColor:"#505050",left:0,bottom:0,borderRadius:0},onClick:()=>{ab(!0)},children:"Create Personalized Link"}
1),(null==m?void 0:m.campaignType)==M.R1[2].key&&(0,t.jsx)(j.A,{id:"pfpBtn",variant:"contained",color:"secondary",size:"small",style:{position:"fixed",backgroundColor:"#505050",left:0,bottom:0,borderRadius:0},onClick:()=>{ab(!0)},children:"I am a team camptain"}),(0,t.jsxs)(b.A,{open:aj,onClose:()=>{ab(!1)},children:[(0,t.jsx)(y.A,{children:"PFP Form"}),(0,t.jsxs)(A.A,{children:[(0,t.jsx)(d.A,{label:"Custom Title",name:"title",value:aC.title||"",onChange:aE,variant:"filled"})," ",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)(d.A,{label:"Custom Description",name:"description",value:aC.description||"",onChange:aE,variant:"filled",multiline:!0})," ",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)("b",{children:"Custom Image: "})," ",(0,t.jsx)("br",{}),(0,t.jsx)("input",{type:"file",id:"CreatePfpImage",onChange:e=>{aw(Object.assign({},aC,{CreatePfpImage:e.target.files[0]}))}}),aC.CreatePfpImage&&(0,t.jsx)(j.A,{className:"btn-danger",onClick:()=>{var e;aw(Object.assign({},aC,{CreatePfpImage:null})),(null===(e=document)||void 0===e?void 0:e.getElementById("CreatePfpImage"))&&(document.getElementById("CreatePfpImage").value="")},children:"Clear"})]}),(0,t.jsx)(C.A,{children:(0,t.jsx)(j.A,{color:"primary",onClick:aL,disabled:ay,children:"Create Link"})})]}),(0,t.jsxs)(b.A,{open:eX,onClose:aT,fullWidth:!0,maxWidth:"sm","aria-labelledby":"form-dialog-title",children:[(0,t.jsx)(y.A,{id:"form-dialog-title",children:"Make a Pledge"}),(0,t.jsxs)(A.A,{children:[(0,t.jsx)("b",{children:"What is the total amount you want to donate ?"})," ",(0,t.jsx)("br",{}),(0,t.jsx)(ep,{pageData:aY}),(0,t.jsx)(h.A,{component:"legend",style:{marginTop:20},children:"How do you want to pledge for "+(m&&m.title)}),(0,t.jsxs)(g.A,{"aria-label":"pledgeType",name:"pledgeType",row:!0,value:parseInt(e1),onChange:e=>{(0,K.ZB)(e,aY.setPledgeType)},children:[(0,t.jsx)(x.A,{value:1,control:(0,t.jsx)(v.A,{}),label:M.fv[0]}),(0,t.jsx)(x.A,{value:3,control:(0,t.jsx)(v.A,{}),label:M.fv[1]}),(0,t.jsx)(x.A,{value:12,control:(0,t.jsx)(v.A,{}),label:M.fv[2]})]}),(0,t.jsx)("b",{children:"Start Date"}),(0,t.jsx)(d.A,{label:"",type:"date",view:"months years",fullWidth:!0,onChange:e=>{(0,K.ZB)(e,aY.setPledgeStartDate)},value:e4,style:{marginTop:20}}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)("b",{children:"End Date"}),(0,t.jsx)(d.A,{label:"",type:"date",fullWidth:!0,onChange:e=>{(0,K.ZB)(e,aY.setPledgeEndDate)},value:e8,style:{marginTop:20}})]}),(0,t.jsxs)(C.A,{children:[(0,t.jsx)(j.A,{onClick:()=>{aT(!1)},color:"primary",children:"Cancel"}),(0,t.jsx)(j.A,{onClick:()=>{aT(!0)},color:"primary",children:"Calculate"})]})]}),(0,t.jsx)(j.A,{size:"small",className:"campaignColor",style:{position:"fixed",right:0,top:0,borderRadius:0},onClick:()=>{aP.push(e9?"/user/home":"/")},children:"Home"}),m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.A,{item:!0,xs:12,className:"campaignColor text-center",children:m&&m.backgroundImage&&2==m.backgroundPosition&&(0,t.jsx)("img",{src:(0,O.wx)(m.backgroundImage),style:ei})}),(0,t.jsx)(o.A,{item:!0,lg:a?0:1,md:0,sm:!1,xs:!1}),(0,t.jsx)(H,{campaign:m,mobile:n,preview:a,createdDate:ap}),(0,t.jsxs)(o.A,{id:"donationForm",style:Object.assign({flexGrow:2,flexDirection:"column"},es),item:!0,lg:n?12:6,md:n?12:6,sm:12,xs:12,children:[(0,t.jsx)("div",{className:"light mb-10 text-center",children:(0,t.jsx)(c.A,{component:"fieldset",children:(0,t.jsxs)(g.A,{row:!0,name:"formType",value:eJ,onChange:e=>{(0,K.ZB)(e,eV)},children:[(0,t.jsx)(x.A,{control:(0,t.jsx)(v.A,{color:"primary",style:{color:"white"},checked:"quick"===eJ}),label:"Quick Gift",value:"quick","aria-haspopup":"true",onMouseEnter:e=>{a$(e,"(approx 30s to complete)")},onMouseLeave:aG}),(0,t.jsx)(x.A,{control:(0,t.jsx)(v.A,{color:"primary",style:{color:"white"},checked:"standard"===eJ}),label:"Standard Gift",value:"standard","aria-haspopup":"true",onMouseEnter:e=>{a$(e,"use this for pledges")},onMouseLeave:aG})]})})}),(0,t.jsx)(w.Ay,{open:!!aO,anchorEl:aO,style:{pointerEvents:"none"},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},onClose:aG,disableRestoreFocus:!0,children:(0,t.jsx)(S.A,{style:{padding:"5px 10px"},children:aH})}),(0,t.jsxs)(k.A,{className:"rightForm",style:el,elevation:3,children:[(0,t.jsx)("b",{style:{marginBottom:"-20px",fontSize:17},children:aJ[eQ]}),(0,t.jsx)(eu,{LoggedIn:e9,handleLogout:e=>(e.preventDefault(),ae(!1),$(""),Y(""),V(""),ed(""),localStorage.clear(),!1)}),!n&&(0,t.jsx)(N.A,{smDown:!0,children:(0,t.jsxs)("div",{className:aB.root,id:"Desktop Stepper",children:[(0,t.jsx)(D.A,{alternativeLabel:!0,nonLinear:!0,activeStep:eQ,children:aJ.map((e,a)=>(0,t.jsx)(P.A,{children:(0,t.jsx)(F.A,{onClick:aR(a)})},e))}),(0,t.jsxs)("div",{className:"stepContent rightFormInner",children:[er(eQ,aY),(0,t.jsxs)("div",{style:{marginTop:20},children:[0!=eQ&&(0,t.jsx)(j.A,{onClick:aU,className:aB.button,children:"Back"}),eQ<aJ.length-1&&(2!=eQ||parseFloat(eh)>0)&&(0,t.jsx)(j.A,{variant:"contained",color:"primary",onClick:aM,children:"Next"})]})]})]})}),(0,t.jsxs)(N.A,{mdUp:!n||void 0,children:[(0,t.jsx)("div",{className:"stepContent rightFormInner",children:er(eQ,aY)}),(0,t.jsx)(B.A,{variant:"dots",steps:aJ.length,position:"static",activeStep:eQ,className:aB.root+" stepContent",nextButton:(0,t.jsxs)(j.A,{size:"small",onClick:aM,disabled:eQ>aJ.length-2||2==eQ&&!parseFloat(eh),children:[" Next ","rtl"===aF.direction?(0,t.jsx)(z.A,{}):(0,t.jsx)(E.A,{}),"   "]}),backButton:(0,t.jsxs)(j.A,{size:"small",onClick:aU,disabled:0===eQ,children:[" ","rtl"===aF.direction?(0,t.jsx)(E.A,{}):(0,t.jsx)(z.A,{})," Back "]})})]}),(null==m?void 0:m.customHTML)&&(0,t.jsx)("div",{id:"customCode",dangerouslySetInnerHTML:{__html:m.customHTML}})]})]})]}):(0,t.jsx)("div",{style:{lineHeight:"95vh",width:"95vw",textAlign:"center"},children:(0,t.jsx)("h1",{children:"Loading..."})})]})}var ex=n(4335);let ev="\n    .themeContainer{\n        padding:50px;\n    }\n";function ef(e){var a,n,l,r,c;let{campaignDetails:h,mobile:g}
1=e,[x,v]=(0,s.useState)({}),[f,j]=(0,s.useState)(null==h?void 0:null===(a=h.amounts)||void 0===a?void 0:a[0]),[b,y]=(0,s.useState)(null==h?void 0:null===(n=h.funds)||void 0===n?void 0:n[0]),[A,C]=(0,s.useState)("onetime"),[w,S]=(0,s.useState)(!1),k=(0,i.useRouter)();return(0,s.useEffect)(()=>{let e={};localStorage.firstname&&(e.FirstName=localStorage.firstname),localStorage.lastname&&(e.LastName=localStorage.lastname),localStorage.phone&&(e.Email=localStorage.phone),localStorage.email&&(e.Phone=localStorage.email),v(e)},[]),(0,t.jsxs)(o.A,{container:!0,className:"themeContainer",children:[(0,t.jsx)("style",{children:"\n.themeContainer{\n    padding:200px;\n}\nbutton,.themeBtn{\n    border-radius: 0;\n    border:2px solid grey;\n    padding:13px 30px;\n    background:white;\n    color:black;\n}\nbutton:hover{\n    background:white;\n    color: navy;\n    border:2px solid black;\n    cursor:pointer;\n}\nbutton.active{\n    background: navy;\n    color: white;\n    border: 2px solid navy;\n}\n"}),(0,t.jsx)("style",{children:g?ev:""}),(0,t.jsx)("style",{children:"\n        .themeContainer{\n          background: ".concat(h.backgroundColor,";\n        }\n        .themeColor, .MuiInputLabel-root{\n          color: ").concat(h.fontcolor,";\n        }\n        @media(max-width:768px){\n            ").concat(ev,"\n        }\n        ")}),!g&&(0,t.jsx)(o.A,{item:!0,xs:0,md:1,lg:2}),(0,t.jsxs)(o.A,{item:!0,xs:12,md:g?12:10,lg:g?12:8,className:"themeColor",children:[(0,t.jsx)("h1",{children:h.title||"Donate"}),(0,t.jsx)("p",{dangerouslySetInnerHTML:{__html:h.description},style:{maxWidth:"150ch"}}),(0,t.jsx)(d.A,{label:"First Name",value:x.FirstName,onChange:e=>(0,K.ZB)(e,x,v,"FirstName")}),(0,t.jsx)(d.A,{label:"Last Name",value:x.LastName,onChange:e=>(0,K.ZB)(e,x,v,"LastName")}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)(d.A,{label:"Email",value:x.Email,onChange:e=>(0,K.ZB)(e,x,v,"Email")}),(0,t.jsx)(d.A,{label:"Phone",value:x.Phone,onChange:e=>(0,K.ZB)(e,x,v,"Phone")}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)(m.A,{className:"mb-10",children:"I want to give"}),null==h?void 0:null===(l=h.amounts)||void 0===l?void 0:l.map(e=>(0,t.jsx)("button",{className:f==e?"active mr-10":"mr-10",onClick:()=>j(e),children:"$ "+e})),(0,t.jsx)("input",{type:"number",className:"themeBtn",placeholder:"Custom Amount"}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)(m.A,{className:"mb-10",children:"as a"}),(0,t.jsx)("button",{className:"onetime"==A?"active mr-10":"mr-10",onClick:()=>C("onetime"),children:"One-Time Gift"}),(0,t.jsx)("button",{className:"pledge"==A?"active":"",onClick:()=>C("pledge"),children:"Recurring Gift"}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"pledge"==A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("select",{className:"themeBtn",children:[(0,t.jsx)("option",{value:"1",children:"Monthly"}),(0,t.jsx)("option",{value:"4",children:"Quarterly"}),(0,t.jsx)("option",{value:"12",children:"Yearly"})]}),(0,t.jsx)("input",{className:"themeBtn",placeholder:"Number of Times"}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{})]}),(null==h?void 0:null===(r=h.funds)||void 0===r?void 0:r.length)>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(m.A,{className:"mb-10",children:"Select a fund"}),(0,t.jsx)(u.A,{value:b,onChange:e=>y(e.target.value),children:null==h?void 0:null===(c=h.funds)||void 0===c?void 0:c.map(e=>(0,t.jsx)(p.A,{value:e,children:e}))}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{})]}),(0,t.jsx)("br",{}),w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>S(!1),children:"Go Back"}),(0,t.jsx)(Q,{finalAmount:f,handleCreateSubmit:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e||e.preventDefault(),(0,O.ki)({type:"donationCompleted",to:x.Email,amount:f}),ex.A.post("/api/Donation",{action:"create",userId:localStorage.userid,campaignId:k.query.id,amount:f,firstname:x.FirstName,lastname:x.LastName,email:x.Email,phone:x.Phone}).then(e=>{k.push("/page/thankyou")}),!1}})]}):(0,t.jsx)("button",{className:"active",onClick:()=>S(!0),children:"Make Payment"})]})]})}let ej=n(6425);function eb(e){let{pageData:a,mobile:n}
1=e,[o,r]=(0,s.useState)(a),d=(0,i.useRouter)(),c=!!a;(0,s.useEffect)(()=>{r(a)},[a]),(0,s.useEffect)(()=>{c||(async()=>{let e=Object.keys(d.query).find(e=>!d.query[e])||d.query.id||d.query.edit;ej.post("/api/Campaign/General",{action:"campaignDetail",campaignId:e}).then(e=>{e&&e.data&&e.data.length>=1&&r(e.data[0])})})()},[d]);let m=(null==o?void 0:o.theme)||"modern";return c?"onepage"==m?(0,t.jsx)(ef,{campaignDetails:o,mobile:n}):(0,t.jsx)(eg,{preview:!0,mobile:n,campaignDetails:o}):(0,t.jsx)(l.A,{Component:"onepage"==m?ef:eg,pageProps:{campaignDetails:o}})}}}]);

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.