PageSourceSearch

https://app.heymarket.com/_next/static/chunks/1734-5c876220deb4c49a.js

js heymarket.com collected 2026-10-01 10:44:13 UTC 34,410 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1734],{8039:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var a=n(37876),i=n(14579),l=n(15039),s=n.n(l),o=n(14232),r=n(15897),c=n(48761),d=n(87432),m=n(51843),u=n.n(m),p=n(44938),h=n.n(p),g=n(11488);let f=e=>{let{className:t,campaign:n,updateCampaign:l,showLabel:m=!0,isEmailInbox:p,onPromoSettingChange:f}=e,{isPromotional:x,footerId:_,updateEmailSettings:v,availableFooterId:y}=(0,c.k)(),b=(0,o.useCallback)(e=>{v({isPromotional:e,footerId:e?y:null}),f&&f(e)},[v,f,y]);return(0,o.useEffect)(()=>{n.id||b(p)},[p,n.id,b]),(0,a.jsxs)("div",{className:s()(h().campaignSettings,t),children:[m?(0,a.jsx)("label",{className:h().label,htmlFor:"campaign-settings",children:"Email Settings"}):null,(0,a.jsx)(i.A,{className:h().campaignSettingOption,checked:x,onChange:e=>{b(e.target.checked)},children:(0,a.jsx)("div",{className:h().description,children:d.yow.is_promotional})}),x&&(0,a.jsx)("div",{className:s()(u().box,u().noTopBorder),children:(0,a.jsxs)("div",{className:u().footerOptionsWrapper,children:["This is required for marketing/promotional emails. The following business address footer will be added to the end of any email steps in the campaign:",(0,a.jsx)(g.A,{initialId:_,onSelect:e=>{v({footerId:e}),(0,r.Zv)(d.JnH.ChangeBusinessAddressFooter)}})]})})]})}},11488:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var a=n(37876),i=n(55098),l=n(14232),s=n(66064),o=n(2408),r=n(75537),c=n(65332),d=n.n(c),m=n(69233);let u=e=>{let{onSelect:t,initialId:n}=e,c=(0,s.GV)(o.X9),[u,p]=(0,l.useState)(n);(0,l.useEffect)(()=>{(null==c?void 0:c.length)&&(u?c.find(e=>e.id===u)||(t(null),p(null)):(t(c[0].id),p(c[0].id)))},[c]);let h=(0,l.useMemo)(()=>c.map(e=>({value:e.id,label:e.company_name,business:e})),[c]);return(0,a.jsx)(i.A,{value:u,suffixIcon:h.length<=1?null:(0,a.jsx)(m.F,{}),className:d().businessFooterDropdownWrapper,placeholder:"Select business address",onChange:e=>{c.find(t=>t.id===e)&&(t(e),p(e))},disabled:h.length<=1,options:h.map(e=>({...e,label:(0,a.jsxs)("div",{className:d().businessFooterOption,children:[" ",(0,r.sj)(e.business)]})})),dropdownStyle:{minWidth:300}})}},22920:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(37876),i=n(14232),l=n(93592),s=n(72448);let o=e=>{let{className:t,step:n,timezone:o,type:r}=e,c=(null==n?void 0:n.offset)!=null?n.offset:void 0,d=o||(0,s.GF)(c),m=(0,i.useMemo)(()=>{let{execute:e,hours:t,minutes:a,send_immediately:i}=n||{};return e&&null!=t&&null!=a||c||i?o?"(".concat((0,l.A)().tz(o).format("z"),")"):"(".concat((0,s.Cj)(c),")"):""},[c,n,o]),u=(0,i.useMemo)(()=>{if(n){if(n.execute)return(0,l.A)(n.execute).tz(d);else if(null!=n.hours&&null!=n.minutes)return(0,s.Dm)(n.hours,n.minutes);else if(void 0===c&&!n.send_immediately)return(0,s.Dm)(+(0,l.A)(n.time_after).format("HH"),+(0,l.A)(n.time_after).format("mm"))}},[c,n,d]);return(0,a.jsxs)("div",{className:t,children:[n.send_immediately&&(0,a.jsxs)("p",{children:["Sent ",(0,a.jsx)("b",{children:"immediately"})," after contact is added to a campaign."]}),!n.send_immediately&&"day"===r&&(0,a.jsxs)("p",{children:["Sending in ",(0,a.jsx)("b",{children:n.days_after})," day(s), at ",l.A.isDayjs(u)?u.format("h:mmA"):u," ",m,", after contact is added to a campaign."]}),!n.send_immediately&&"date"===r&&(0,a.jsxs)("p",{children:[(0,l.A)(n.execute).isBefore((0,l.A)())?"Sent on":"Sending on"," ",(0,a.jsxs)("b",{children:[(0,l.A)(u).format("M/DD/YYYY h:mmA")," ",m]}),"."]}),n.recurrence_type&&(0,a.jsxs)("p",{children:["Repeat ",n.recurrence_type]})]})}},29236:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var a=n(37876),i=n(60690),l=n(1001),s=n(63235),o=n(78337),r=n(14232),c=n(86690),d=n(17012);function m(e){let[t,n]=(0,r.useState)(e.inboxes&&e.inboxes.length?e.inboxes[0]:null),m=()=>{e.handleInboxSelected(t)};return(0,a.jsx)(i.A,{title:e.header,open:!0,centered:!0,onCancel:e.handleClose,destroyOnClose:!0,transitionName:null,footer:"campaign"==e.type||"hosted-number"==e.type?[(0,a.jsx)(l.Ay,{size:"large",className:"white-button",onClick:e.handleClose,children:"Not Now"},"cancel"),(0,a.jsx)(l.Ay,{size:"large",className:"orange-button",onClick:m,children:e.okText},"ok")]:[(0,a.jsx)(l.Ay,{size:"large",className:"orange-button",onClick:m,children:e.okText},"ok")],children:(0,a.jsxs)(a.Fragment,{children:[e.topCaption&&(0,a.jsx)("p",{children:e.topCaption}),e.inboxes&&(0,a.jsx)(s.Ay.Group,{onChange:t=>{let a=t.target.value;n(e.inboxes.find(e=>e.id==a))},buttonStyle:"solid",style:{maxHeight:"265px",overflowY:"scroll",width:"100%"},defaultValue:t?t.id:null,children:(0,a.jsx)(o.A,{direction:"vertical",children:e.inboxes.map(t=>(0,a.jsx)(s.Ay,{value:t.id,children:e.showInboxNumber&&t.phone?"".concat((0,c.NX)(t,!0)," - ").concat(t.name):t.name},t.id))})}),!e.inboxes&&(0,a.jsx)(d.A,{useValidInbox:e.useValidInbox,placeholder:"Please select an inbox",onInboxChange:n,style:{width:"100%"},showPhoneInOptions:e.showInboxNumber}),e.bottomCaption&&(0,a.jsx)("p",{className:"help-text",children:e.bottomCaption})]})})}},48761:(e,t,n)=>{"use strict";n.d(t,{_:()=>c,k:()=>d});var a=n(37876),i=n(14232),l=n(66064),s=n(2408),o=n(83698);let r=(0,i.createContext)(null),c=e=>{let{children:t,campaign:n,setCampaign:c,isEmailInbox:d=!1}=e,m=(0,l.GV)(s.nS),u=m?null==m?void 0:m.id:null,p=(0,i.useMemo)(()=>{var e;return!!n&&!!n.steps&&(0===n.steps.length&&!!d&&!n.id||(null==(e=n.steps)?void 0:e.some(e=>{var t;return null==(t=e.email_content)?void 0:t.is_promotional})))},[n,d]),h=(0,i.useMemo)(()=>{var e;let t=n.steps.find(e=>e.is_email&&e.email_content);return(null==t||null==(e=t.email_content)?void 0:e.footer_id)||null},[n.steps]),g=(0,i.useMemo)(()=>
1{if(!h)return null;let e=o.Ay.getState();return(0,s.Bv)([h,e])},[h]),f=(0,i.useCallback)(e=>{c(t=>{let n=t.steps.map(t=>t.email_content?{...t,email_content:{...t.email_content,...void 0!==e.isPromotional&&{is_promotional:e.isPromotional},...void 0!==e.footerId&&{footer_id:e.footerId}}}:t);return{...t,steps:n}})},[c]);return(0,a.jsx)(r.Provider,{value:{isPromotional:p,footerId:h,businessAddress:g,isEmailInbox:d,availableFooterId:u,updateEmailSettings:f,campaign:n,setCampaign:c},children:t})},d=()=>{let e=(0,i.useContext)(r);if(!e)throw Error("useCampaignEmail must be used within CampaignEmailProvider");return e}},52221:(e,t,n)=>{"use strict";n.d(t,{A:()=>et});var a=n(37876),i=n(26423),l=n(15039),s=n.n(l),o=n(41946),r=n.n(o),c=n(14232),d=n(89395),m=n(48761),u=n(87432),p=n(93592),h=n(86667),g=n(66064),f=n(26520),x=n(9355),_=n(15340),v=n(13560),y=n(1640),b=n(18993),j=n.n(b),C=n(87621),S=n(1001),w=n(63235),N=n(40727),A=n(58728),I=n(55098),E=n(57410),k=n.n(E),T=n(15897),P=n(23885),z=n(67856),D=n(72448),H=n(69233),M=n(30637),O=n(56932),V=n(30137);let F=["images","pdf"],L=e=>{var t,n;let{step:i,campaign:l,isTextEditDisabled:s,onAttachmentChange:o,onStepUpdate:r}=e,[d,m]=(0,c.useState)((null==(t=i.content)?void 0:t.text)||""),[u,p]=(0,c.useState)([]),[h,g]=(0,c.useState)([]),[f,x]=(0,c.useState)(null);return(0,c.useEffect)(()=>{var e,t;if(null==(t=i.content)||null==(e=t.gallery)?void 0:e.length){let e=(0,M.b7)(i.content.gallery),t=e[0].name;(0,O.Pz)(t)?g(e):p(e)}},[null==i||null==(n=i.content)?void 0:n.gallery]),(0,c.useEffect)(()=>{o(i.local_id,{imageList:u,fileList:h,gDriveDoc:f})},[u,h,f]),(0,a.jsx)("div",{className:j().compose,children:(0,a.jsx)("div",{className:j().messageComposer,children:(0,a.jsx)(V.A,{placeholder:"Enter Content for the Template",emojiPickerPosition:"top",enableAttachments:!0,enableCustomFields:!0,enableTemplates:!0,enableLinkShortener:!0,linkShortenerContext:{campaign_id:null==l?void 0:l.id,source:"campaign"},inboxId:l.inbox_id,isShopify:!1,text:d,mediaAttachmentList:u,fileAttachmentList:h,gDriveDoc:f,onMediaChange:p,onFileChange:g,onGDocChange:x,onTemplateChange:function(e){r(i.local_id,t=>({...t,content:{...t.content,template:e.id}}))},supportAllTypes:!1,messageCount:1,attachmentMenus:F,autoSize:{minRows:6,maxRows:6},isReadOnly:s,onTextChange:m,closePopup:!1,shouldVerifyAddFile:!0,parentType:"campaign",onBlur:function(){r(i.local_id,e=>({...e,content:{...e.content,text:d}}))}})})})};var Y=n(58451),R=n(2408),B=n(61078),G=n(10991),U=n(23515),W=n(43786),X=n(55624),q=n(41870),J=n(88660);let Q=(0,c.forwardRef)((e,t)=>{var n,i,l,o,r,d;let{step:u,campaign:p,isEditDisabled:h,onStepUpdate:f,onEmailComposerRef:v,onEditEmail:y,onInlineImageUploadStart:b,onInlineImageUploaded:C}=e,w=(0,g.jL)(),{isPromotional:N,footerId:A}=(0,m.k)(),I=(0,g.GV)(e=>(0,R.Bv)([A,e])),[E,k]=(0,c.useState)((null==(n=u.email_content)?void 0:n.subject)||""),[T,P]=(0,c.useState)((null==(i=u.email_content)?void 0:i.preview_text)||""),[z,D]=(0,c.useState)(u.email_content?(0,G.s_)(u.email_content):"email-rich"),[H]=(0,c.useState)(!1),M=(0,c.useRef)(null),O=(0,c.useRef)(null),V=(0,c.useRef)(null),F=(0,c.useRef)(null),[L,Q]=(0,c.useState)(!1),[Z,K]=(0,c.useState)(null),[$,ee]=(0,c.useState)(u.email_content),[et,en]=(0,c.useState)(!1),ea={focus:()=>{},getQuill:()=>null,setBusinessAddress:()=>{},setEmailContent:async e=>{let t=e||u;if(h)return Promise.resolve({stepId:t.local_id,emailContent:t.email_content});let n=T&&""!==T.trim(),a={subject:E,preview_text:T,is_promotional:N,footer_id:A,html:"",text:"",data_html:"",data_json:"",data_code:""};if("email-rich"===z){let e=M.current.getContent(),i={...a,html:n?(0,G.Yz)(e,T):e,text:M.current.getText(),data_html:e},l=M.current.getAttachments();return l&&l.length>0?(w((0,_.yO)(!0,"listMessage",null,!1)),new Promise(e=>{(0,B.K1)(l,n=>{i.attachments=n,e({stepId:t.local_id,emailContent:i})},n=>{n>0&&(0,_.f8)("Error Uploading","Unable to upload ".concat(n," attachments. Please try again.")),e({stepId:t.local_id,emailContent:i})})})):Promise.resolve({stepId:t.local_id,emailContent:i})}if("email-code"===z){let e={...a};if(V.current){let{html:t,text:a}=V.current.getContent();e.html=n?(0,G.Yz)(t,T):t,e.text=a,e.data_code=t}else if(p.id){let a=t.email_content;e.html=n?(0,G.Yz)(a.html,T):a.html,e.text=a.text,e.data_code=a.data_code}return Promise.resolve({stepId:t.local_id,emailContent:e})}if("email-builder"===z){let e={...a};if(O.current)return new Promise(a=>{O.current.getTemplateData(async(i,l)=>{e.html=n?(0,G.Yz)(i,T):i,e.text=(0,J.T)(i),e.data_json=l,a({stepId:t.local_id,emailContent:e})})});if(p.id){let a=t.email_content;return e.html=n?(0,G.Yz)(a.html,T):a.html,e.text=a.text,e.data_json=a.data_json,Promise.resolve({stepId:t.local_id,emailContent:e})}}return Promise.resolve({stepId:t.local_id,emailContent:{}})}};(0,c.useImperativeHandle)(t,()=>ea),(0,c.useImperativeHandle)(F,()=>ea),(0,c.useEffect)(()=>{v&&F.current&&v(F.current)},[v]);let ei=(0,c.useCallback)(e=>{k(e),f(u.local_id,t=>({...t,email_content:{...t.email_content,subject:e}}))},[u.local_id,f]),el=(0,c.useCallback)(e=>{P(e),f(u.local_id,t=>({...t,email_content:{...t.email_content,preview_text:e}}))},[u.local_id,f]),es=e=>{ee({...$,...e.content}),D(e.type),f(u.local_id,t=>(0,x.np)(e,t))};
1return(0,a.jsx)("div",{className:j().compose,children:h?(0,a.jsx)("div",{className:j().messageComposer,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"px-12",style:{position:"relative"},children:(0,a.jsxs)("div",{className:"box-content mb-8 radius-8",children:[(0,a.jsx)(Y.L,{compact:!0,label:"SUBJECT",content:null==(l=u.email_content)?void 0:l.subject,placeholder:"Enter email subject"}),(0,a.jsx)(Y.L,{compact:!0,label:"PREVIEW TEXT",content:null==(o=u.email_content)?void 0:o.preview_text,placeholder:"Enter email preview text"})]})}),(0,a.jsx)("div",{className:"box-content p-16 mt-8 mb-0",children:(0,a.jsx)(X.n,{content:u.raw_content},u.id)})]})}):(0,a.jsxs)("div",{className:j().messageComposer,children:[(0,a.jsxs)("div",{className:"box-content mb-8 radius-8",children:[(0,a.jsx)(Y.L,{compact:!0,label:"SUBJECT",content:E,placeholder:"Enter email subject",onChange:ei,shouldFocus:!0,editable:!0}),(0,a.jsx)(Y.L,{compact:!0,label:"PREVIEW TEXT",content:T,placeholder:"Enter email preview text",onChange:el,charLimit:90,editable:!0})]}),p.id&&("email-builder"===z||"email-code"===z)&&(0,a.jsx)("div",{className:"box-content p-16 mt-8",children:(0,a.jsxs)("div",{className:j().emailPreviewOverlay,children:[(0,a.jsx)(X.n,{content:Z||u.email_content||{html:"",text:"",attachments:[]},isLoading:et},"".concat(u.id,"-").concat((null==(r=u.raw_content)?void 0:r.html)||"","-").concat((null==(d=u.raw_content)?void 0:d.text)||"")),y&&(0,a.jsx)("div",{className:j().emailOverlay,children:(0,a.jsx)(S.Ay,{className:"white-button",size:"large",onClick:()=>y(u),children:"Edit Content"})})]})}),"email-rich"===z?(0,a.jsx)("div",{children:(0,a.jsx)(q.A,{ref:M,origContent:$,showEmojiPicker:!0,enableAttachments:!0,enableCustomFields:!0,enableTemplates:!0,disablePreviewExit:H,placeholder:"",showSignature:!0,parentType:"campaign",allowInlineImage:!0,onTemplateChanged:es,onPreviewToggle:H?void 0:Q,isPromotional:N,footerId:A,businessAddress:I,onInlineImageUploadStart:b,onInlineImageUploaded:C})}):"email-code"===z?(0,a.jsx)("div",{className:p.id&&"visually-offscreen",style:{marginTop:H?"":"16px"},children:(0,a.jsx)(U.A,{className:s()({preview:H}),source:"campaign",ref:V,initialValue:(null==$?void 0:$.data_code)||"",allowTemplateSelection:!0,previewOnly:H,height:"600px",width:"100%",showValidation:!0,showToolbar:!0,onTemplateChanged:es,isPromotional:N,footerId:A,businessAddress:I})}):(0,a.jsx)(W.A,{className:p.id&&"visually-offscreen",source:"campaign",content:$,showPreviewButtons:!1,ref:O,onTemplateChanged:es,footerId:A,onPreviewToggle:H?null:Q,inboxId:p.inbox_id,onLoaded:()=>{en(!0),setTimeout(()=>{if(!O.current)return void en(!1);O.current.getTemplateData(async(e,t)=>{K({html:e,text:(0,J.T)(e),data_json:t,type:"email-builder"}),en(!1)})},100)},isPromotional:N,businessAddress:I})]})})});Q.displayName="EmailCampaignMessageComposer";var Z=n(22920);let K=(0,p.A)(),$=e=>{let{className:t,campaign:n,errorMessages:i,onRemoveMessage:l,onScheduleUpdate:o=k(),onStepUpdate:r,setErrorMessages:d,step:m,updateSendType:f,onAttachmentChange:_,onEmailComposerRef:v,onEditEmail:y,onChangeMessageType:b,complianceWarning:E,handleComplianceWarnings:M,onInlineImageUploadStart:O,onInlineImageUploaded:V}=e,F=(0,g.GV)(e=>(0,z.vg)([e,n.inbox_id])),Y=n.steps.length,R=m.id&&n.status!==h.Hu[h.Hu.created],B=R&&"date"===n.type&&(m.send_immediately||(0,p.A)(m.execute).isBefore((0,p.A)())),[G,U]=(0,c.useState)(null);(0,T.VI)(u.JnH.ValidateCampaignMessage,e=>{let{step:t}=e;t.local_id===m.local_id&&W()}),(0,c.useEffect)(()=>{W()},[m,F,n.timezone_mode]);let W=()=>{var e;let t=[];if(!m.send_immediately&&!R)if("date"===n.type)if(m.execute){let e=(0,p.A)(m.execute);if(!e.isValid()||e.isBefore((0,p.A)()))t.push("Please enter a valid date and time.");else if("contact"!==n.timezone_mode&&(0,D.Y4)(e,F))t.push("Selected time is outside of business hours.");else if(m.recurrence_type&&"no"!=m.recurrence_type)if(m.end_date){let n=(0,p.A)(m.end_date);n.isValid()&&e.startOf("day").isBefore(n.startOf("day"))||t.push("Invalid end date.")}else t.push("Invalid end date.")}else t.push("Please enter a valid date and time.");else"day"===n.type&&(null==m.days_after||isNaN(m.days_after)||m.days_after<0)&&t.push("Please enter a valid schedule.");return B||m.is_email||(null==(e=m.content)?void 0:e.text)||t.push("Content cannot be empty."),d(()=>t),0===t.length},X=(0,c.useMemo)(()=>
1{if(!n.timezone){if(null!=m.offset)return(0,D.GF)(m.offset);else if(m.execute||m.send_immediately)return p.A.tz.guess()}return n.timezone},[n.timezone,m.execute,m.offset,m.send_immediately]);(0,c.useEffect)(()=>{if(X){if(m.time_after||m.execute){let e=(0,p.A)();m.execute?U(e=(0,p.A)(m.execute).tz(X)):null!=m.hours&&null!=m.minutes?U(e=(0,p.A)().hour(m.hours).minute(m.minutes).tz(X,!0)):m.time_after&&(U(e=X?(0,p.A)(m.time_after,"HH:mm").tz(X,!0):(0,p.A)(m.time_after,"HH:mm")),en(e));return}!m.execute&&X&&U((0,p.A)().hour(9).minute(0).tz(X,!0))}},[X,m.execute,m.time_after,m.hours]);let[q,J]=(0,c.useState)(()=>"date"===n.type&&m.execute&&m.recurrence_type?(0,x.yb)((0,p.A)(m.execute)):[{label:"Does Not Repeat",value:"no"}]),[$,ee]=(0,c.useState)(m.recurrence_type||"no");function et(e){let t=e.format("YYYY-MM-DD"),n="".concat(t," ").concat(G.hour(),":").concat(G.minute());return p.A.tz(n,X)}function en(e){U(e);let t=e.hour(),a=e.minute(),i={};"day"===n.type?i.time_after=(0,p.A)().hour(t).minute(a).toISOString():i.execute=p.A.tz(m.execute,X).hour(t).minute(a).toISOString(),r(m.local_id,{...i,hours:t,minutes:a}),o()}return(0,a.jsxs)("div",{className:s()(j().messageCampaign,{date:"date"===n.type},t),children:[(0,a.jsx)("div",{className:j().lineCompose}),(0,a.jsx)("div",{className:"icon-black-bg",children:(0,a.jsx)("i",{className:m.is_email?"icon-email-white":"icon-msg-white","aria-label":"White message icon"})}),(0,a.jsxs)("div",{className:s()(j().titleMessage,j().title),children:["Message ".concat(m.order," - ").concat(m.is_email?"Email":"SMS"),m.is_email&&E&&M&&(0,a.jsxs)(S.Ay,{className:s()("text-only","red-text"),onClick:()=>M(E),style:{marginLeft:"8px"},children:[(0,a.jsx)(C.A,{style:{marginRight:"4px"}}),"Compliance"]}),1===m.order&&"created"===n.status&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("button",{className:"text-only ml-16",onClick:b,children:"Switch to ".concat(m.is_email?"SMS":"Email")})})]}),(0,a.jsx)("div",{className:j().buttonWrapper,children:(1!==m.order||1!==Y)&&(0,a.jsx)("button",{type:"button",className:s()("text-only","red-text"),onClick:()=>l(m),children:"Remove Message"})}),R&&(0,a.jsx)(Z.A,{className:j().hintText,step:m,type:n.type,timezone:n.timezone}),(0,a.jsxs)("div",{className:s()(j().schedule,{hidden:R}),children:[1===m.order&&(0,a.jsx)("div",{className:s()("immediate",j().formGroup,{selected:m.send_immediately}),children:(0,a.jsx)("div",{className:s()(j().inputSelectContainer,j().radioType),children:(0,a.jsx)(w.Ay,{checked:m.send_immediately,className:s()(j().checkbox,j().sendNow),id:"send-now-".concat(m.local_id),name:"send-now-".concat(m.local_id),onChange:()=>f(m.local_id,"send-now"),type:"radio",children:"Send Immediately"})})}),(0,a.jsxs)("div",{className:s()(j().formGroup,j().formGroupComplex,{"step-one":1===m.order,selected:1===m.order&&!m.send_immediately||!R&&!m.send_immediately}),children:[(0,a.jsxs)("div",{className:j().defaultOptionsWrapper,children:[1===m.order&&(0,a.jsx)("div",{className:s()(j().inputSelectContainer,j().radioType),children:(0,a.jsx)(w.Ay,{checked:!m.send_immediately,className:s()(j().checkbox,j().sendNow),id:"send-later-".concat(m.local_id),name:"send-later-".concat(m.local_id),onChange:()=>f(m.local_id,"send-later"),type:"radio"})}),(0,a.jsxs)("div",{className:j().scheduleDateWrapper,children:["day"===n.type&&(0,a.jsxs)("span",{className:"mr-4",children:["Send ",(0,a.jsx)(N.A,{type:"number",name:"day",maxLength:3,value:m.days_after,onChange:function(e){let t=e.target.value?Number.parseInt(e.target.value,10):void 0;r(m.local_id,{days_after:t}),o()},onWheel:e=>e.currentTarget.blur()}),"day(s) later"]}),"date"===n.type&&(0,a.jsxs)("span",{className:"mr-4",children:[(0,a.jsx)("span",{className:j().inputDateLabel,children:"Send on"}),(0,a.jsx)(A.A,{format:"MM/DD/YYYY",id:"startDate",minDate:K,name:"startDate",onChange:function(e){let t=e?et(e):null;r(m.local_id,{execute:t?t.toISOString():""}),e&&J((0,x.yb)(e))},placeholder:"mm/dd/yyyy",value:m.execute?(0,p.A)(m.execute).tz(X):null})]}),(0,a.jsx)("span",{children:"at\xa0"}),(0,a.jsx)("span",{children:(0,a.jsx)(P.A,{size:"large",className:j().timeSelector,selectedTime:G,disable:!1,minuteOptions:u.Wqh,handleUpdate:en})})]}),"\xa0","day"===n.type&&(0,a.jsx)("span",{children:"after contact added to campaign"})]}),"date"===n.type&&(0,a.jsxs)("div",{className:j().datetimeSpecficWrapper,children:[(0,a.jsxs)("div",{className:j().repeatContainer,children:[(0,a.jsx)("span",{className:j().repeatText,children:"Repeat:"}),(0,a.jsx)(I.A,{disabled:q.length<=1,dropdownStyle:{width:"fit-content"},id:"repeat-options",notFoundContent:"No option item available",onCh
1ange:function(e){ee(e),r(m.local_id,{recurrence_type:e})},options:q,size:"small",suffixIcon:q.length>1?(0,a.jsx)(H.F,{}):null,value:$,variant:"borderless"})]}),(0,a.jsxs)("div",{className:s()(j().endDateContainer,{hidden:"no"===$}),children:[(0,a.jsx)("span",{className:j().inputDateLabel,children:"End on"}),(0,a.jsx)(A.A,{format:"MM/DD/YYYY",id:"endDate",minDate:m.execute?(0,p.A)(m.execute).tz(X):K,name:"endDate",onChange:function(e){r(m.local_id,t=>{let n={...t};if("weekly"===t.recurrence_type||"monthly"===t.recurrence_type){let e=(0,p.A)(t.execute).tz(X);if(n.day_of_week=e.day(),"monthly"===t.recurrence_type){let t=Math.ceil(e.date()/7);n.week_of_month="".concat(t<5?t:"L")}}return{...n,end_date:e?et(e).toISOString():""}})},placeholder:"mm/dd/yyyy",value:m.end_date?(0,p.A)(m.end_date).tz(X):null})]})]})]}),"contact"===n.timezone_mode&&(0,a.jsx)("div",{className:j().hintText,children:(0,a.jsx)("p",{children:"Message will be sent in each contact's local timezone."})})]}),m.is_email?(0,a.jsx)(Q,{step:m,campaign:n,isEditDisabled:B,onStepUpdate:r,onEmailComposerRef:v,onEditEmail:y,onInlineImageUploadStart:O,onInlineImageUploaded:V}):(0,a.jsx)(L,{step:m,campaign:n,isTextEditDisabled:B,onAttachmentChange:_,onStepUpdate:r}),B?null:(0,a.jsx)("div",{className:j().error,children:i.map((e,t)=>(0,a.jsx)("div",{className:j().errorMessage,children:e},t))})]})},ee=[{key:"sms",label:"SMS"},{key:"email",label:"Email"}],et=(0,c.forwardRef)((e,t)=>{var n;let{campaign:l,setCampaign:o,onMessageRemove:b,toggleMessageError:C,isVisible:S,onEditEmail:w,list:N,inboxId:A,complianceResults:I,handleComplianceWarnings:E,onInlineImageUploadStart:k,onInlineImageUploaded:T}=e,P=(0,g.jL)(),{isPromotional:z,footerId:D}=(0,m.k)(),[H,M]=(0,c.useState)({}),[O,V]=(0,c.useState)({}),F=(0,c.useRef)({}),{verifyCampaignEmailStep:L,verifySendEmail:Y,handlePhoneVerified:R,handlePhoneVerifyFailed:B}=(0,f.bG)({inboxId:A,list:N,excludedCount:(null==(n=l.excluded)?void 0:n.length)||0,type:"campaign"}),G=(0,c.useMemo)(()=>S&&l.steps.length>0&&l.steps.some(e=>e.is_email),[S,l.steps]);(0,f.No)(A,l.team_id,G);let U=l.steps.length>=u.R32;function W(e){o(t=>({...t,...e}))}function X(e,t){o(n=>{let a=n.steps.map(n=>n.local_id===e?"function"==typeof t?t(n):{...n,...t}:n);return{...n,steps:a}})}function q(e){if(l.steps.length<2)return void(0,_.f8)("Oops...","Campaign must have at least one message.");b&&b(e),o(t=>{let n=e.order!==t.steps.length,a=t.steps.filter(t=>t.local_id!==e.local_id),i=n?a.map((e,t)=>({...e,order:t+1})):a;return{...t,steps:i}})}function J(e,t){"send-now"===t?X(e,{send_immediately:!0,execute:void 0,recurrence_type:void 0,end_date:void 0,day_of_week:void 0,week_of_month:void 0,hours:0,minutes:0,time_after:void 0}):X(e,{send_immediately:!1,..."day"===l.type?{hours:9,minutes:0,time_after:(0,p.A)().hour(9).minute(0).toISOString()}:{}})}function Q(e,t){var n,a;let i=x.xz.createCampaignStep(1,l.type,t,null==(n=e.email_content)?void 0:n.is_promotional,null==(a=e.email_content)?void 0:a.footer_id);X(e.local_id,{is_email:!e.is_email,content:i.content,email_content:i.email_content})}return(0,c.useImperativeHandle)(t,()=>({getAttachmentsForSteps:()=>O,setEmailContentForSteps:async e=>{P((0,y.tR)("set-email-content-for-campaign-steps","add"));let t=l.steps.filter(e=>e.is_email).map(e=>{if(F.current[e.local_id]){let t=F.current[e.local_id];if(t&&t.setEmailContent)return t.setEmailContent(e)}return Promise.resolve({stepId:e.local_id,emailContent:{}})}),n=await Promise.all(t);P((0,y.tR)("set-email-content-for-campaign-steps","remove"));let a=l.steps.map(e=>{let t=n.find(t=>t.stepId===e.local_id);return t&&t.emailContent?{...e,email_content:{...e.email_content,...t.emailContent}}:e});e&&e(a)}})),(0,c.useEffect)(()=>{let e={};for(let t of l.steps)H[t.local_id]&&(e[t.local_id]=H[t.local_id]);r()(H,e)||M(e)},[l.steps.length,H]),(0,c.useEffect)(()=>{let e=Object.values(H).some(e=>e.length>0);null==C||C(e)},[H,C]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:s()(j().scheduledMessage,j().campaignSteps,{hidden:!S}),children:(0,a.jsxs)("div",{className:j().messageCampaignContainer,children:[l.steps.map(e=>{let t=null==I?void 0:I.find(t=>t.step_order===e.order);return!t&&e.is_email&&e.compliance_details&&(t=e.compliance_details),(0,a.jsx)($,{campaign:l,errorMessages:H[e.local_id]||[],onRemoveMessage:q,onStepUpdate:X,onAttachmentChange:(e,t)=>
1{V(n=>({...n,[e]:{imageList:t.imageList,fileList:t.fileList,gDriveDoc:t.gDriveDoc}}))},step:e,setErrorMessages:t=>M(n=>({...n,[e.local_id]:t(n[e.local_id]||[])})),updateSendType:J,onEmailComposerRef:t=>{e.is_email&&(F.current[e.local_id]=t)},onEditEmail:w,onChangeMessageType:()=>(e=>{let t=e.is_email?"sms":"email";"email"===t?L(()=>Q(e,t)):P((0,v.pI)(A,()=>Q(e,t)))})(e),complianceWarning:t,handleComplianceWarnings:E,onInlineImageUploadStart:k,onInlineImageUploaded:T},e.id||e.local_id)}),!U&&(0,a.jsx)(i.A,{menu:{items:ee,onClick:e=>{let{key:t}=e;("sms"===t||"email"===t)&&("email"===t?L(()=>{l.status!==h.Hu[h.Hu.created]&&(0,_.f8)("","Current contacts in the campaign will not receive this message."),W({steps:l.steps.concat((0,x.X2)(1,l.steps.length,{type:l.type,timezone:l.timezone,channel:"email",isPromotional:z,footerId:D}))})}):P((0,v.pI)(A,()=>{l.status!==h.Hu[h.Hu.created]&&(0,_.f8)("","Current contacts in the campaign will not receive this message."),W({steps:l.steps.concat((0,x.X2)(1,l.steps.length,{type:l.type,timezone:l.timezone,channel:"sms",isPromotional:z,footerId:D}))})})))}},trigger:["click"],placement:"top",children:(0,a.jsx)("button",{type:"button",className:j().addToCampaign,children:"Add"})})]})}),Y&&(0,a.jsx)(d.M,{completionHandler:R,errorHandler:B})]})})},69465:e=>{e.exports=function(e,t,n){if("function"!=typeof e)throw TypeError("Expected a function");return setTimeout(function(){e.apply(void 0,n)},t)}},69822:(e,t,n)=>{var a=n(69465);e.exports=n(83720)(function(e,t){return a(e,1,t)})},78550:(e,t,n)=>{"use strict";n.d(t,{t:()=>C});var a=n(37876),i=n(11806),l=n(4917),s=n.n(l),o=n(40123),r=n.n(o),c=n(14232),d=n(86667),m=n(81109),u=n(66064),p=n(82707),h=n(67856),g=n(72448),f=n(29581),x=n(14019),_=n(15340),v=n(96315),y=n(13560),b=n(29236),j=n(82362);let C=e=>{let{campaignFromProps:t,isOnCreate:n,onDone:l}=e,o=(0,u.jL)(),C=(0,u.GV)(e=>(0,h.yx)([e,!0])),S=function(e){return(0,u.GV)(t=>{var n,a,i;if(null==e||r()(e.list_ids))return[];let l=(0,p.tp)(t),s=(null==(n=e.list_ids)?void 0:n.length)?e.list_ids[0]:null;return s&&(null==(i=l[s])||null==(a=i.targets)?void 0:a.length)?Object.keys(l[s].targets):[]})}(t),[w,{setTrue:N,setFalse:A}]=(0,u.Cg)(!1),[I,E]=(0,c.useState)(!1),[k,T]=(0,c.useState)({...t}),[P,z]=(0,c.useState)(null),D=s()(e=>{if(k.steps.some(e=>!e.is_email)&&(0,g.V$)(null==e?void 0:e.business_hours)&&("day"===k.type||k.steps[0].send_immediately)&&(0,_.f8)("Quiet Hours Enabled","The selected inbox for this campaign has quiet hours turned on. Campaign messages will not be sent during quiet hours."),k.steps.some(e=>e.is_email)&&o((0,x.GA)()),n)l(!0);else{let e={id:k.id,status:d.Hu[d.Hu.active],team_id:k.team_id,inbox_id:k.inbox_id};o((0,v.yi)(e)).unwrap().finally(l)}},500,{leading:!1,trailing:!0}),H=(0,c.useCallback)(()=>{D(P)},[P,D]),M=()=>{if(k.status!==d.Hu[d.Hu.active]){if(0===k.list_ids.length){(0,_.f8)((0,i.t)("modal.header.statusChangeFail",{ns:"campaigns"}),(0,i.t)("modal.content.statusChangeFail",{ns:"campaigns"})),l();return}if(!k.inbox_id)if(0!=C.length)return void N();else{(0,_.f8)("No Valid Inbox Found","Please create an inbox with a valid phone number before starting a campaign."),l();return}}if(k.status===d.Hu[d.Hu.created])(0,_.to)({type:"confirm",isNegative:!1,props:{title:"Permission to Send?",okButtonProps:{className:"positive-button",size:"large"},content:(0,a.jsxs)("div",{children:["Please confirm the contacts in this campaign have given you permission to message them and that you comply with our"," ",(0,a.jsx)("a",{href:"https://www.heymarket.com/tos/",target:"_blank",rel:"noreferrer",children:"terms of service"}),"."]}),onOk:()=>{E(!0)},onCancel:()=>{l()}}});else{k.status===d.Hu[d.Hu.paused]&&(0,_.f8)("","Restarting a paused Campaign will only trigger for newly added contacts to the associated list. For existing contacts of the list, you will need to re-add them to the list for the Campaign to retrigger. The Campaign will start from the first message.");let e=k.status!==d.Hu[d.Hu.active]?d.Hu[d.Hu.active]:d.Hu[d.Hu.paused],t={id:k.id,status:e,team_id:k.team_id,inbox_id:k.inbox_id};o((0,v.yi)(t)).unwrap().finally(l)}};return(0,c.useEffect)(()=>{(null==k?void 0:k.inbox_id)?o((0,y.g7)([null==k?void 0:k.inbox_id],{})).then(e=>{z(e[null==k?void 0:k.inbox_id]||null),M()}).catch(e=>{(0,f.yA)("Error fetching inbox:",e),z(null),M()}):M()},[null==k?void 0:k.inbox_id,o]),(0,a.jsxs)(a.Fragment,{children:[w&&(0,a.jsx)(b.Y,{bottomCaption:"You can pause the campaign at any time.",handleInboxSelected:function(e){(null==e?void 0:e.id)?(T({...k,inbox_id:e.id}),z(e)):((0,_.f8)("Oops...","No inbox selected for this campaign."),l()),A()},header:"Start Campaign",okText:"Start",topCaption:"Select which inbox to send campaign from:",type:"campaign",useValidInbox:!0,handleClose:()=>{A(),l()},showInboxNumber:!0}),I&&(0,a.jsx)(j.X,{completionHandler:H,errorHandler:l,inbox:P,phoneVerifyType:m.Ij.CampaignStart,phoneGrantSource:m.eB.CampaignStart,channelType:null,list:S})]})}},98300:(e,t,n)=>{"use strict";n.d(t,{j:()=>E});var a=n(37876),i=n(11806),l=n(52076),s=n.n(l),o=n(69822),r=n.n(o),c=n(89099),d=n.n(c),m=n(14232),u=n(87432),p=n(86667),h=n(66064),g=n(64090),f=n(62007),x=n(74741),_=n(61078),v=n(30637),y=n(9355),b=n(59679),j=n(7598),C=n(38421),S=n(15340),w=n(96315),N=n(59574),A=n(1640),I=n(78550);let E=e=>{let{campaign:t,hasMessageError:n,removedSteps:l,isScheduleUpdated:o,excludedTargets:c,t
1ype:E,onError:k,attachmentsForSteps:T,onComplianceResults:P}=e,z=(0,h.jL)(),D=(0,h.GV)(e=>(0,f.Sv)([e,"campaigns"])),H=(0,h.GV)(g.ye),M=(0,h.GV)(x.kW),O=(0,h.GV)(f.Oh),V=(0,h.GV)(f.zj),[F,L]=(0,m.useState)(!1),[Y,R]=(0,m.useState)(null);function B(){let{isValidOrder:e,isValidSchedule:n}=(0,y.Dp)(t.steps,t.type,t.status);if(!e){z((0,A.P0)({title:"Change Message Order",message:"Messages must be in chronological order. Please update the dates and times below.",type:"negative",duration:3})),k();return}if(!n){z((0,A.P0)({title:"Invalid Schedule",message:"One or more of the messages doesn't have a valid schedule. Please update the dates and times below.",type:"negative",duration:3})),k();return}for(let e of(t.id||t.list_ids.length,l))z((0,w.QE)({id:e.id,team_id:M}));t.status!==p.Hu[p.Hu.created]&&o?(0,S.to)({type:"confirm",props:{title:(0,i.t)("common.saveButton",{ns:"campaigns"}),content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"Schedule changes will only apply to new contacts added to the campaign."}),(0,a.jsx)("p",{children:"They will not impact existing contacts in the campaign."})]}),okText:(0,i.t)("button.save",{ns:"common"}),onOk:()=>{G()},onCancel:()=>{k()}}}):G()}function G(){let e=t.steps.map(e=>({...e})),n=(0,_.HO)(T);if(n.length>0)z((0,S.yO)(!1,"campaignMessage",t.id,!1)),(0,_.Zn)(n,a=>{for(let t of(a.length<n.length&&(0,S.f8)("Error Uploading","Unable to upload ".concat(n.length-a.length," attachments.")),e)){if(t.is_email)continue;let e=(0,b.U2)(a,T[t.local_id].imageList,T[t.local_id].fileList),n=(0,v.vr)([...e.mediaAttachmentList,...e.fileAttachmentList]);n.length&&(t.content={...t.content,gallery:n}),U(t,T[t.local_id].gDriveDoc)}R({campaign:t,steps:e})});else{for(let t of e)if(!t.is_email){let e=(0,v.vr)([...T[t.local_id].imageList,...T[t.local_id].fileList]);if(e.length)t.content={...t.content,gallery:e};else{let{gallery:e,...n}=t.content;t.content=n}U(t,T[t.local_id].gDriveDoc)}R({campaign:t,steps:e})}}function U(e,t){(null==t?void 0:t.url)&&(e.content.attachments=[{url:t.url,type:"gdoc",name:t.name}])}return(0,m.useEffect)(()=>{if(!t)return;if(!D)return void z((0,j.wo)({feature:"campaigns"}));if(n){z((0,A.P0)({title:"Unable to ".concat(s()(E)," Campaign"),message:"Please fix the errors in the messages before saving.",type:"negative",duration:3})),k();return}if(t.steps.some(e=>e.is_email&&(!e.email_content.subject||0===e.email_content.subject.length))){z((0,A.P0)({title:"Invalid Subject",message:"Please enter a subject for each email message.",type:"negative",duration:3})),k();return}if(t.steps.some(e=>{var t;return e.is_email&&!(0,b.FS)(e.email_content.text)&&!(null==(t=e.email_content.attachments)?void 0:t.length)})){z((0,A.P0)({title:"Invalid Content",message:"Please enter a content for each email message.",type:"negative",duration:3})),k();return}if(t.steps.length>u.R32){z((0,A.P0)({title:"Message limit exceeded",message:"Campaigns cannot exceed ".concat(u.R32," messages."),type:"negative",duration:3})),k();return}let e=t.steps.filter(e=>!e.is_email),a=e.length>0,i=t.steps.some(e=>e.is_email);if(a&&!O||i&&!V){z((0,N.W5)("Unable to ".concat(s()(E)," Campaign"),"Check inbox phone or compliance settings.")),k();return}let l=e.map(e=>e.content.text),o=t.steps.flatMap(e=>{var t,n;return e.is_email?[null==(t=e.email_content)?void 0:t.subject,null==(n=e.email_content)?void 0:n.text]:[e.content.text]}).filter(Boolean).join(" ").trim();if(!o)return void B();z((0,C.eN)({q:o,team_id:t.team_id},"campaign",t.id,H,a,()=>{l.some(C.cn)?z((0,S.J5)("Save",()=>r()(B))):B()},()=>k()))},[]),(0,m.useEffect)(()=>{Y&&!Y.doneSubmit&&z(("create"==E?w.bi:w.SX)((0,y.oV)(Y.campaign,c,Y.steps,!1))).unwrap().then(e=>{var n;if("create"==E){let t={...Y.campaign,...e};R({...Y,campaign:t,doneSubmit:!0})}if(e.compliance_results&&e.compliance_results.length>0){P&&P(e.compliance_results,e),k();return}"create"==E&&(null==(n=t.list_ids)?void 0:n.length)?(0,S.to)({type:"confirm",props:{title:"Start Campaign",okButtonProps:{className:"positive-button",size:"large"},content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"This will begin sending c
1ampaign messages."}),(0,a.jsx)("p",{children:"You can pause the campaign at anytime."})]}),okText:"Start",cancelText:"Not Now",onOk:()=>{L(!0)},onCancel:()=>{d().push(u.BVt.Campaigns)}}}):d().push(u.BVt.Campaigns)}).catch(e=>{if((null==e?void 0:e.compliance_results)&&e.compliance_results.length>0){P&&P(e.compliance_results,e),k();return}(0,S.f8)("Unable to ".concat(E," campaign"),"There was an error ".concat("create"==E?"creating":"updating"," the campaign. Please verify campaign data and try again.")),k()})},[Y]),F&&(0,a.jsx)(I.t,{campaignFromProps:Y.campaign,onDone:function(){L(!1),d().push(u.BVt.Campaigns)}})}}}]);

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.