1import{j as e,$ as l,r as c,ak as _,al as F,cx as V,bE as re,M as le,aA as k,n as O,dh as ce,e as de,a as i,i as pe,p as me,hw as $,C as ge,H as Q,z as X,hx as Y,hy as he,hz as xe,gF as ue}from"./index-4ng2XTnA.js";import{A as je}from"./Add-Dse8OIWe.js";import{u as fe}from"./useTitle-rR1gVfd5.js";import{P as q}from"./PageHeader.component-BpeIptwP.js";import{M as Ce,R as be,F as ye,S as De}from"./SidebarFolders.component-CIg9FG2w.js";import{H as ke}from"./HeaderTabs.component-CUQ7wvEw.js";import{a as Ie,D as J}from"./dripCampaigns.types-BIQG0yzx.js";import{r as Pe,u as Te,h as Z,i as ve,j as Se,k as Me}from"./dripCampaigns.actions-6RtCojrF.js";import{T as Ee,a as ee,H as x,B as u}from"./TableContainer.component-BPCWxmiG.js";import{B as Fe}from"./Button.component-O5CMdWRp.js";import{I as Ae}from"./Input.component-CPVwgqMM.js";import{C as we}from"./Checkbox.component-_QQn2Po1.js";import{C as He}from"./Copy.icon-DKldJgDe.js";import{R as Be}from"./RoundExclamation.icon-MfZI-HnW.js";import{T as We}from"./TableHead-MSrR7fh-.js";import{T as Re}from"./TableRow-D4ufOvb2.js";import{T as te}from"./Trash.icon-CUB2qZRk.js";import{D as Le}from"./DripModal.component-BE8aKRaL.js";import"./InnerHeader.component-DPSRXCuc.js";import"./Card-B5Fc8mGU.js";import"./ChevronLeft-BuOEyZ_L.js";import"./promise.hook-wd1IaplE.js";import"./Delete-MiIL4XdO.js";import"./Edit-B0e9vEuE.js";import"./ListItem-C9hh78RL.js";import"./join-BC1qQDoa.js";import"./KeyboardArrowDown-CzpkpEHj.js";import"./automations.actions-DHJ72rga.js";import"./subtract-CHVk6NsV.js";import"./RadioButtonUnchecked-D8ULpBtf.js";import"./PartialChecked.icon-CnUB2hmO.js";import"./Checkbox-C2SsTmJY.js";import"./ChevronRight-CWmp6BsF.js";import"./inputAdornmentClasses-KKEdjY5_.js";import"./ApptTypeSelector.component-tCBR-xHP.js";import"./ExpandLess-CRhzpiHX.js";import"./Search-C6qLVgz9.js";import"./KeyboardArrowUp-D-P9jgu4.js";import"./Radio-DdYO-vd4.js";import"./useDrop-B9lXQYo6.js";import"./difference-DiS0lA3X.js";import"./Box-Ub7yqHE6.js";import"./InputAdornment-CotEGcwv.js";import"./Collapse-BYAOfYJP.js";import"./intersection-pUrj288D.js";import"./Autocomplete.component-ZUgp-4Bl.js";import"./DrawerList.component-68D3muZq.js";import"./FilterHeader.component-DxaEtuTF.js";import"./Help-BWeY0ugT.js";import"./Tag.component-CGxw2agV.js";import"./TagsSelector.component-DGPGSYYJ.js";import"./phone-Dk2r7rNG.js";import"./FormControlLabel-FyK8eetS.js";import"./RadioGroup-Bpv63DL7.js";import"./FormGroup-B0tYDUoy.js";const Ne="/assets/drip-campaigns-page-DyMjgv9V.png",ze=({open:a,path:o,drips:I,search:d,extraButtons:m})=>{const P=I.filter(r=>r.selected).map(r=>r.listId);return e.jsxs(l,{position:"absolute",display:"flex",alignItems:"center",top:0,left:8,style:{background:"#F5F5F5"},children:[e.jsx(Ce,{open:a,path:o,tag:"ClientList",prefix:"cl_",ids:P,onMove:r=>{d(r==null?void 0:r.join("."))}}),e.jsx(be,{open:a,path:o,ids:P,tag:"ClientList",prefix:"cl_",onMove:r=>{d(r==null?void 0:r.join("."))}}),m]})},_e="Delete several campaigns",se=({headerHeight:a,dripCampaigns:o,busy:I,selecteds:d,selectAll:m,onSelect:P,path:r,onDelete:A,copyDrip:w,tz:H,redirect:B,paginationData:W,onDeleteSelecteds:g,isTemplate:p,reload:C,redirectToContacts:v})=>{const[h,b]=c.useState(null),[R,T]=c.useState(!1),[S,L]=c.useState(""),y=()=>{b(null),T(!1),L("")},M=()=>{h?A(h.listId):g(),y()},f=c.useMemo(()=>{var s;return h?h.name:d===1?(s=o.find(E=>E.selected))==null?void 0:s.name:_e},[o,h]),j=c.useMemo(()=>!(h||d===1),[h,d]),N=c.useMemo(()=>S.toLowerCase()===(f==null?void 0:f.toLocaleLowerCase()),[S,f]);return e.jsxs(l,{children:[e.jsxs(Ee,{maxHeight:`calc(100vh - ${a}px - 45px)`,scrollPaddingBottom:45,pagination:!!W,paginationData:W,className:"sked-test-drip-campaigns-table-list",children:[e.jsx(We,{children:e.jsxs(ee,{hasSelect:!p,checked:(o==null?void 0:o.length)&&d===(o==null?void 0:o.length),setChecked:m,noSelectHover:!0,someChecked:d>0,children:[e.jsxs(x,{fixed:!0,children:[d>0&&e.jsx(ze,{drips:o,open:!0,path:r,search:s=>C(s),extraButtons:[e.jsx(_,{title:"Delete selected",children:e.jsx(F,{onClick:()=>T(!0),children:e.jsx(te,{})})},"delete")]}),"Name"]}),p&&e.jsx(x,{children:"Description"}),e.jsx(x,{children:"Campaign Steps"}),!p&&e.jsxs(e.Fragment,{children:[e.jsx(x,{children:"Messages"}),e.jsx(x,{children:"Enabled"}),e.jsx(x,{children:e.jsxs(l,{display:"flex",alignItems:"center",children:["Active",e.jsx(_,{arrow:!0,title:"Active contacts are currently in the campaign and receiving messages.",slotProps:{tooltip:{sx:{maxWidth:264}}},children:e.jsx(F,{style:{padding:2,marginLeft:4},children:e.jsx(V,{})})})]})}),e.jsx(x,{children:e.jsxs(l,{display:"flex",alignItems:"center",children:["Enrolled",e.jsx(_,{arrow:!0,title:"Enrolled contacts are active or opted-out.",slotProps:{tooltip:{sx:{maxWidth:4
110}}},children:e.jsx(F,{style:{padding:2,marginLeft:4},children:e.jsx(V,{})})})]})}),e.jsx(x,{children:"Completed"}),e.jsx(x,{children:"Created"}),e.jsx(x,{nowrap:!0,children:"Actions"})]})]})}),e.jsx(Re,{children:o.map(s=>e.jsxs(ee,{hasSelect:!p,checked:s.selected,setChecked:E=>P({listId:s.listId,selected:E}),children:[e.jsx(u,{fixed:!0,children:e.jsx("a",{onClick:()=>B(s),children:s.name})}),p&&e.jsx(u,{sx:{maxWidth:"300px"},children:s.description}),e.jsxs(u,{children:[s.steps+(p?1:0)," step",s.steps===1?"":"s"]}),!p&&e.jsxs(e.Fragment,{children:[e.jsx(u,{children:s.messages||0}),e.jsx(u,{children:e.jsx(_,{arrow:!0,title:s.isEnabled?"":"Campaigns can be enabled from within the campaign editor.",slotProps:{tooltip:{sx:{maxWidth:240}}},children:e.jsx("span",{children:e.jsx(we,{checked:s.isEnabled,disabled:!0})})})}),e.jsx(u,{nowrap:!0,children:e.jsxs("a",{onClick:()=>v(s.listId,"Active"),children:[s.active," contact",s.active===1?"":"s"]})}),e.jsx(u,{children:e.jsxs("a",{onClick:()=>v(s.listId,"Enrolled"),children:[s.enrolled," contact",s.enrolled===1?"":"s"]})}),e.jsx(u,{children:e.jsxs("a",{onClick:()=>v(s.listId,"Completed"),children:[s.completed," contact",s.completed===1?"":"s"]})}),e.jsx(u,{nowrap:!0,children:s.created?re(s.created,H,"MM/dd/yyyy h:mm a"):""}),e.jsxs(u,{nowrap:!0,children:[e.jsx(F,{onClick:()=>w(s),disabled:I,style:{marginRight:5},children:e.jsx(He,{})}),e.jsx(F,{onClick:()=>b(s),disabled:I,children:e.jsx(te,{})})]})]})]},s.listId))})]}),e.jsxs(le,{title:`Delete Drip Campaign${j?"s":""}?`,open:!!h||R,onClose:y,maxWidth:535,contentMarginBottom:0,innerSx:{padding:0},buttons:[e.jsx(Fe,{color:"error",onClick:M,disabled:!N,children:"Yes, delete"},"btn")],children:[e.jsx(l,{padding:"15px",children:e.jsxs(k,{variant:"subtitle1",fontWeight:400,children:["Are you sure you want to delete ",j?"these":"this"," drip campaign",j?"s":"","? This action cannot be undone."]})}),e.jsxs(l,{sx:s=>({background:s.palette.red[50],padding:"15px"}),children:[e.jsxs(l,{display:"flex",children:[e.jsx(Be,{color:"#DE3B45"})," Â ",e.jsx(k,{variant:"body1",color:"info",fontWeight:600,children:"Warning: Â "}),e.jsxs(k,{variant:"body1",color:"info",children:["All data about ",j?"these":"this"," drip campaign",j?"s":""," will be deleted."]})]}),e.jsxs(k,{variant:"body1",children:["To make sure you donât accidentally lose important information, ",j?"type the text bellow":"type the name of this drip campaign below:"]}),e.jsxs(l,{marginTop:"10px",children:[e.jsxs(k,{variant:"h5",children:["Write â",f,"â"]}),e.jsx(Ae,{value:S,onChange:s=>L(s.target.value),placeholder:f,style:{marginTop:5}})]})]})]})]})},$e=O(l)({display:"flex",alignItems:"center",flexDirection:"column",paddingTop:76}),Ge=O(k)(({theme:a})=>({color:a.palette.gray[600],marginTop:20,marginBottom:9,fontSize:21,fontWeight:600})),Ke=O(k)(({theme:a})=>({color:a.palette.gray[600],marginBottom:5,fontSize:16,fontWeight:400,textAlign:"center",lineHeight:"26px","& strong":{fontWeight:600},"& a":{color:a.palette.primary.main,cursor:"pointer",textDecoration:"none"}})),Vt=()=>{const a=ce(),o=de(),[I,d]=c.useState(!1),[m,P]=c.useState("campaigns"),[r,A]=c.useState(""),[w,H]=c.useState(""),[B,W]=c.useState(0);fe("Drip Campaigns");const g=i(t=>t.dripCampaigns.dripCampaigns),p=i(t=>t.dripCampaigns.page),C=i(t=>t.dripCampaigns.perPage),v=i(t=>t.dripCampaigns.totalCount),h=i(t=>t.dripCampaigns.totalPages),b=i(t=>t.dripCampaigns.templates),R=i(t=>t.dripCampaigns.tmpPage),T=i(t=>t.dripCampaigns.tmpPerPage),S=i(t=>t.dripCampaigns.tmpTotalCount),L=i(t=>t.dripCampaigns.tmpTotalPages),y=i(t=>t.dripCampaigns.busy),M=i(t=>t.login.headerHeight),f=i(t=>pe(Ie,me([],["login","features"],t))),j=i(t=>{var n;return(n=t.login.office)==null?void 0:n.id}),N=i(t=>t.login.office.timezone),s=i(t=>t.login.openedFolder),E=i(t=>t.login.isMobile),G=i(t=>t.dripCampaigns.folderPath),z=(t,n,D)=>{a(ve({page:t,perPage:n,path:G,isTemplate:m==="sked-templates"}))},ae=c.useMemo(()=>(g==null?void 0:g.filter(t=>t.selected).length)||0,[g]);if(c.useEffect(()=>{z(p,C)},[j,C,T,m,G]),c.useEffect(()=>(a(Pe()),()=>{a($("all"))}),[]),!f)return e.jsxs(l,{children:[e.jsx(q,{title:"Drip Campaigns",pageId:"drip-campaigns",className:"sked-test-drip-campaigns-no-feature-page-header"}),e.jsx($e,{height:`calc(100vh - ${M+45}px)`,children:e.jsxs(l,{maxWidth:610,display:"flex",alignItems:"center",flexDirection:"column",children:[e.jsx("img",{src:Ne,className:"sked-test-drip-campaigns-upgrade-image"}),e.jsx(Ge,{variant:"h2",children:"Upgrade to use Drip Campaigns"}),e.jsxs(Ke,{children:["Drip Campaigns let you message patients across their customer journey. This industry-leading drip campaign builder enables ",e.jsx("strong",{children:"superior engagement and retention"}),". ",e.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://calendly.com/sked-demos/upgrades",children:"Contact sales"})," for more information."]})]})})]});const K=(t,n)=>{const D=n?{isCreate:!0}:{};o(`/drip-campaign/${t}`,{state:D})},ne=(t,n)=>{n&&a(ue(n)),o(`/drip-campaign-contacts/${t}`)},ie=()=>{var t,n;a(Me({name:(t=r.replace(/\s+/g," "))==null?void 0:t.trim(),description:(n=w.replace(/\s+/g," "))==null?void 0:n.trim()})).then(D=>{D&&K(D.list.id,!0)}),d(!1),A(""),H("")},U=(t,n)=>{a(Se({sDrip:t,callback:D=>K(D,!0),template:n,officeId:j}))},oe=()=>{const t=g.filter(n=>n.selected);a(Z(t.map(n=>n.listId)))};return e.jsxs(l,{children:[e.jsx(q,{title:"Drip Campaigns",pageId:"drip-campaigns",className:"sked-test-drip-campaigns-page-header",leftIcons:[m==="campaigns"&&!s||E?e.jsx(Q,{Icon:ye,onClick:()=>a(X({openedFolder:!0})),title:"Folders",onlyIcon:!0,marginRight:5,padding:7,active:!!B,type:"filter"},"folders"):e.jsx("div",{},"no-folders"),e.jsx(ke,{setTab:P,value:m,tabs:[{label:"Campaigns",value:"campaigns",className:"sked-test-drip-tab-campaigns"},{label:"SKED Templates",value:"sked-templates",className:"sked-test-drip-tab-sked-templates"}]},"tabs")],rightIcons:[y&&e.jsx(ge,{size:20},"busy"),m==="campaigns"&&e.jsx(Q,{title:"New Campaign",className:"sked-test-drip-campaigns-new-btn",Icon:je,disabled:y,onClick:()=>d(!0)},"new")]}),e.jsxs(l,{display:"flex",children:[e.jsx(l,{children:m==="campaigns"&&e.jsx(De,{path:[J],open:s,onClose:()=>a(X({openedFolder:!1})),selectedId:B,setSelectedId:t=>W(t),noFolder:G==="unassigned",onClick:(t,n=!1)=>{a(n?$("unassigned"):t?$(t):$("all"))}})}),e.jsxs(l,{flex:1,children:[m==="sked-templates"?e.jsx(se,{isTemplate:!0,dripCampaigns:b,redirect:t=>U(t,!0),busy:y,headerHeight:M,tz:N,paginationData:{page:R,perPage:T,addPage:t=>z(R+t,T),setPerPage:t=>a(Y({page:t,isTemplate:!0})),totalCount:S,totalPages:L,currentLength:b==null?void 0:b.length}}):e.jsx(se,{dripCampaigns:g,redirect:t=>K(t.listId),redirectToContacts:ne,busy:y,copyDrip:U,headerHeight:M,onDelete:t=>a(Z([t])),onDeleteSelecteds:oe,onSelect:t=>a(xe(t)),selectAll:t=>a(he(t)),handleEnable:(t,n)=>a(Te(t,n)),selecteds:ae,tz:N,path:[J],reload:t=>z(p,C),paginationData:{page:p,perPage:C,addPage:t=>z(p+t,C),setPerPage:t=>a(Y({page:t})),totalCount:v,totalPages:h,currentLength:g==null?void 0:g.length}}),e.jsx(Le,{open:I,onClose:()=>d(!1),title:r,setTitle:A,description:w,setDescription:H,onSave:ie})]})]})]})};export{Vt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.