"use strict";(globalThis.webpackChunkwp_event_solution=globalThis.webpackChunkwp_event_solution||[]).push([[760],{73296(e,t,n){n.d(t,{A:()=>v});var l=n(951609),a=n(986087),r=n(892911),i=n(760742),o=n(779888),s=n(790070),c=n(645708),m=n.n(c),d=n(173051),u=n(848842),p=n(406836),g=n(769815);const v=function(e){const{keyName:t,tooltip:n,label:c,initialValue:v,form:E,sx:_,emailPreset:b=["{%site_name%}","{%site_link%}","{%event_title%}","{%customer_name%}","{%customer_email%}","{%event_date%}","{%event_time%}","{%event_location%}"]}=e||{},x=(0,a.useRef)(),[f,h]=(0,a.useState)(""),A=({target:e})=>{const t=x.current.getEditor(),{index:n}=x?.current?.unprivilegedEditor.getSelection(!0);t?.insertText(n,e.value)},y=e=>{const{url:t}=e,n=x.current.getEditor();n.insertEmbed(n.getSelection().index,"image",t),n.setSelection(n.getSelection().index+1)},k=(0,a.useCallback)(()=>{(0,p.handleWpUploader)(y)},[]);(0,a.useEffect)(()=>{E.setFieldValue(t,v)},[]);const S=g.default.div`
		input {
			max-width: 180px;
			background-color: #f6f8f9;
			border-radius: 6px;
			padding: 5px;
			color: #6b7280;
			text-align: center;
			cursor: pointer;
			&:hover {
				background-color: #f6f8f9;
			}
		}
	`,w={toolbar:{container:[[{header:[1,2,3,4,5,!1]},{font:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image"],["code-block"],[{color:[]},{background:[]}],["clean"]],handlers:{image:k}}};return(0,l.createElement)("div",{style:{borderRadius:"6px",backgroundColor:"white",padding:"15px"}},(0,l.createElement)(r.A,{alignItems:"center",style:{marginBottom:"20px"}},(0,l.createElement)(u.A,{style:{fontSize:"16px",color:"#414454",fontWeight:600}},c),n&&(0,l.createElement)(d.A,{title:n})),(0,l.createElement)(i.A.Item,{name:t},(0,l.createElement)(m(),{theme:"snow",modules:w,formats:["header","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","code-block","color","background"],value:f,onChange:e=>{h(e)},ref:x,style:{height:"300px",marginBottom:"65px",..._}})),(0,l.createElement)(s.A,{wrap:!0},b?.map((e,t)=>(0,l.createElement)(S,null,(0,l.createElement)(o.A,{readOnly:!0,key:t,value:e,onClick:A})))))}},173051(e,t,n){n.d(t,{A:()=>i});var l=n(951609),a=n(354725),r=n(832099);function i(e){const{title:t,...n}=e;return(0,l.createElement)(r.A,{title:t,...n},(0,l.createElement)("span",null,"   ",(0,l.createElement)(a.InfoCircleFilled,{width:16,height:16,fill:"#747474"})))}},688760(e,t,n){n.r(t),n.d(t,{default:()=>S});var l=n(951609),a=n(956427),r=n(986087),i=n(527723),o=n(293832),s=n(769815),c=n(16370),m=n(892911),d=n(760742),u=n(747152),p=n(236492),g=n(247767),v=n(354725),E=n(607638),_=n(75093),b=n(818062),x=n(73296),f=n(110012),h=n(557237),A=n(327154),y=n(864282);const k=s.default.div`
	background-color: #ffffff;
	border: 1px solid #e1e4e9;
	border-radius: 8px;
	padding: 20px 40px;
	margin-top: 40px;
	@media ( max-width: 768px ) {
		padding: 10px;
	}
`;function S(){const[e]=d.A.useForm(),{id:t}=(0,g.useParams)(),n=(0,g.useNavigate)(),[s,S]=(0,r.useState)(!1),w=t||localStorage.getItem("rsvpReportId");return(0,l.createElement)("div",{style:{backgroundColor:"#F3F5F7",marginTop:"-20px",height:"100vh"}},(0,l.createElement)(a.Fill,{name:A.PRIMARY_HEADER_NAME},(0,l.createElement)(m.A,{justify:"space-between",align:"center"},(0,l.createElement)(m.A,{align:"center",gap:16},(0,l.createElement)(E.Ay,{variant:E.Vt,icon:(0,l.createElement)(v.AngleLeftIcon,null),sx:{height:"36px",width:"36px",backgroundColor:"#fafafa",borderColor:"transparent",lineHeight:"1"},onClick:()=>{n(`/rsvp-report/${w}`)}}),(0,l.createElement)(b.A,{title:(0,i.__)("RSVP Reminder","eventin")})))),(0,l.createElement)(u.A,{gutter:[16,10],justify:"center",style:{margin:"20px 0px"}},(0,l.createElement)(c.A,{xs:22,md:14},(0,l.createElement)(h.A,{level:3,style:{fontSize:"22px",height:"32px",fontWeight:500}},(0,i.__)("Send RSVP Reminder Email","eventin")),(0,l.createElement)(k,null,(0,l.createElement)(d.A,{layout:"vertical",form:e,scrollToFirstError:!0,size:"large",onFinish:async()=>{S(!0);try{await e.validateFields();const t=e.getFieldsValue(!0),{from:l,subject:a,body:r,status:i}=t,s=(0,o.addQueryArgs)(`${w}/invitations`,{from:l,subject:a,body:r,status:i});(await y.A.rsvpReport.sendEmail(s)).success&&n(`/rsvp-report/${w}`)}catch(e){console.error("Couldn't send email!"),console.error(e)}finally{S(!1)}}},(0,l.createElement)(u.A,{gutter:[16,0]},(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(f.ks,{name:"from",label:(0,i.__)("Email From","eventin"),rules:[{required:!0,message:(0,i.__)("From email is required!","eventin")}],placeholder:(0,i.__)("Sender's email","eventin"),size:"large"})),(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(f.ks,{name:"subject",label:(0,i.__)("Email Subject","eventin"),rules:[{required:!0,message:(0,i.__)("Email Subject is required!","eventin")}],placeholder:(0,i.__)("Your email subject","eventin"),size:"large"})),(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(d.A.Item,{name:"status",label:(0,i.__)("Status","eventin")},(0,l.createElement)(p.A,{options:[{label:(0,i.__)("Going","eventin"),value:"going"},{label:(0,i.__)("Not Going","eventin"),value:"not_going"},{label:(0,i.__)("Maybe","eventin"),value:"maybe"}],size:"large"}))),(0,l.createElement)(c.A,{xs:24},(0,l.createElement)(x.A,{form:e,initialValue:"",keyName:"body",label:(0,i.__)("Email Body","eventin"),sx:{height:"200px"},emailPreset:["{%site_name%}","{%event_name%}","{%event_link%}","{%event_date%}","{%event_time%}","{%event_location%}"]}))),(0,l.createElement)(m.A,{gap:16,style:{marginTop:"10px",padding:"0px 15px"}},(0,l.createElement)(E.Ay,{variant:E.zB,loading:s,htmlType:"submit"},(0,i.__)("Send Email","eventin")),(0,l.createElement)(E.Ay,{variant:E.Rm,htmlType:"reset",onClick:()=>n("/rsvp-report")},(0,i.__)("Cancel","eventin"))))))),(0,l.createElement)(_.FloatingHelpButton,null))}}}]);