1(this["webpackJsonpguni-sms"]=this["webpackJsonpguni-sms"]||[]).push([[4],{1088:function(e,t,a){"use strict";a.d(t,"a",(function(){return y}));var n=a(0),l=a(20),o=a(73),r=a(8),s=a.n(r),c=a(22),i=a(61),u=a(402),d=a(33);function m(e){return(m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function b(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function g(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(){}var y=function(e){function t(e){var a,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,i=f(t).call(this,e),(a=!i||"object"!==m(i)&&"function"!==typeof i?v(r):i).handleClose=function(e){e.preventDefault();var t=l.findDOMNode(v(a));t.style.height="".concat(t.offsetHeight,"px"),t.style.height="".concat(t.offsetHeight,"px"),a.setState({closing:!0}),(a.props.onClose||E)(e)},a.animationEnd=function(){a.setState({closing:!1,closed:!0}),(a.props.afterClose||E)()},a.renderAlert=function(e){var t,l=e.getPrefixCls,r=a.props,i=r.description,d=r.prefixCls,m=r.message,g=r.closeText,f=r.banner,v=r.className,h=void 0===v?"":v,E=r.style,y=r.icon,C=a.props,S=C.closable,k=C.type,x=C.showIcon,O=C.iconType,w=a.state,j=w.closing,N=w.closed,G=l("alert",d);x=!(!f||void 0!==x)||x,k=f&&void 0===k?"warning":k||"info";var P="filled";if(!O){switch(k){case"success":O="check-circle";break;case"info":O="info-circle";break;case"error":O="close-circle";break;case"warning":O="exclamation-circle";break;default:O="default"}i&&(P="outlined")}g&&(S=!0);var M=s()(G,"".concat(G,"-").concat(k),(b(t={},"".concat(G,"-closing"),j),b(t,"".concat(G,"-with-description"),!!i),b(t,"".concat(G,"-no-icon"),!x),b(t,"".concat(G,"-banner"),!!f),b(t,"".concat(G,"-closable"),S),t),h),B=S?n.createElement("button",{type:"button",onClick:a.handleClose,className:"".concat(G,"-close-icon"),tabIndex:0},g?n.createElement("span",{className:"".concat(G,"-close-text")},g):n.createElement(c.a,{type:"close"})):null,D=Object(u.a)(a.props),I=y&&(n.isValidElement(y)?n.cloneElement(y,{className:s()("".concat(G,"-icon"),b({},y.props.className,y.props.className))}):n.createElement("span",{className:"".concat(G,"-icon")},y))||n.createElement(c.a,{className:"".concat(G,"-icon"),type:O,theme:P});return N?null:n.createElement(o.a,{component:"",showProp:"data-show",transitionName:"".concat(G,"-slide-up"),onEnd:a.animationEnd},n.createElement("div",p({"data-show":!j,className:M,style:E},D),x?I:null,n.createElement("span",{className:"".concat(G,"-message")},m),n.createElement("span",{className:"".concat(G,"-description")},i),B))},Object(d.a)(!("iconType"in e),"Alert","`iconType` is deprecated. Please use `icon` instead."),a.state={closing:!1,closed:!1},a}var a,r,y;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),a=t,(r=[{key:"render",value:function(){return n.createElement(i.a,null,this.renderAlert)}}])&&g(a.prototype,r),y&&g(a,y),t}(n.Component)},1148:function(e,t,a){"use strict";var n=a(0),l=a.n(n),o=a(78),r=a(36),s=a(11),c=a(18),i=a(7),u=a(30),d=a.n(u),m=(a(143),a(405),a(265),a(28)),p=a(58);t.a=e=>{let{visible:t=!0,onCancel:a=(()=>{}),error:u=!1,warning:b=!1,title:g="",modalWidth:f=415,description:v="",closable:h=!1,btn:E=!1,secondaryBtn:y=!1,primaryBtnProps:C={onClick:()=>{}},secondaryBtnProps:S={onClick:()=>{}},className:k="py-0",zIndex:x=1055,loading:O=!1,inputProps:w={},input:j=!1,endComponent:N=null,endPropContainerClass:G="mt-4",descriptionNode:P=null,withoutHeader:M=!1,countDownTime:B=10,bufferTime:D=1}=e;const[I,_]=Object(n.useState)(B);return Object(n.useEffect)(()=>{I>0+D?setTimeout(()=>{_(I-1)},1e3):_(B)},[I]),l.a.createElement(o.a,{centered:!0,zIndex:x,className:k,closeIcon:l.a.createElement("div",{className:"btn "+d.a.modalCloseBtn},l.a.createElement("i",{className:"fas fa-times"}
1)),closable:h,visible:t,onCancel:a,width:f,footer:null,maskStyle:{background:"linear-gradient(135deg, #00000050, #107c9850)"},bodyStyle:{padding:"0"}},l.a.createElement(r.a,{type:"flex",justify:"center",className:""},g&&l.a.createElement(s.a,{span:24,className:"text-center"},l.a.createElement(c.a.Text,{strong:!0,className:"text-dark fs-5 text-capitalize"},g)),P&&l.a.createElement(s.a,{span:20,className:"text-center"},l.a.createElement(c.a.Text,{className:"m-0"},P)),v&&l.a.createElement(s.a,{span:20,className:"text-center"},l.a.createElement(c.a.Text,{className:"m-3"},l.a.createElement("div",{className:"text-center"},l.a.createElement("img",{src:p.f+"/images/running-robo_1.gif",alt:"loading",style:{width:"100%",objectFit:"contain"}}),l.a.createElement("div",{className:"fw-normal mt-2"},l.a.createElement("p",{className:"fs-4 gredient-text"},v," ",I," sec..."))))),j&&l.a.createElement(s.a,{span:20,className:"text-center"},l.a.createElement(m.a,Object.assign({},w,{containerClassname:"mb-0 mt-3",style:{width:"100%"}}))),l.a.createElement(s.a,{span:24,className:"d-flex flex-row justify-content-center gap-3 "+G},y&&l.a.createElement(i.a,Object.assign({light:!0,withoutBg:!0,label:S.label?S.label:"Cancel"},S,{disabled:O})),E&&l.a.createElement(i.a,Object.assign({light:!0,label:C.label?C.label:"Continue"},C,{disabled:O})),N&&N)))}},1226:function(e,t,a){"use strict";var n=a(0),l=a.n(n),o=a(4),r=a(1),s=a(49),c=a(12),i=a.n(c),u=a(181),d=a(22),m=a(48),p=a(36),b=a(11),g=a(18),f=a(629),v=a(28),h=a(55),E=a(557),y=a(558),C=a(327),S=a(1088),k=a(183);const{Column:x}=C.a;var O=e=>{const{onClose:t,data:a,showPaging:n=!0,heading:o="Contact Upload Errors",renderColumns:r,visible:s}=e;return l.a.createElement(l.a.Fragment,null,l.a.createElement(k.a,{label:o,onClose:t,visible:s,width:600},a&&a.length>0?l.a.createElement(C.a,{dataSource:a,pagination:n,scroll:{y:520},rowKey:e=>e},r&&r.map(e=>l.a.createElement(x,{title:e.toUpperCase(),dataIndex:e,key:e}))):l.a.createElement(S.a,{message:"No log data available yet!",type:"error",className:"w-100"})))},w=a(29),j=a(6),N=a(185),G=a.n(N),P=a(78),M=a(30),B=a.n(M),D=a(26),I=a(9),_=a(7);const A=I.g().shape({name:I.i().min(2,"Name must be more then 2 characters long").max(80,"Can not be longer then 80 characters").required("Enter a name for the Group")});var F=Object(o.b)(e=>({groupStore:e.store.groupStore,modalStore:e.store.modalStore}))(Object(o.c)(e=>{const{modalStore:t,groupStore:a,alert:o}=e,{selectedGroup:r,group:s}=a,c=Object(n.useRef)();return l.a.createElement(l.a.Fragment,null,l.a.createElement(D.d,{initialValues:{name:""},validationSchema:A,innerRef:c,onSubmit:(e,n)=>{let{setSubmitting:l,resetForm:r}=n;l(!0);let c={group:s._id,name:e.name,contact_ids:t.selectedContacts};a.addGroupWithContact(c).then(e=>{e.status&&o(!0)}).finally(()=>{t.toggleModal("showCreateGroupModal",!1),t.setData("selectedContacts",void 0),l(!1),r()})}},e=>{let{values:t,errors:a,touched:n,handleChange:o,handleSubmit:r,isSubmitting:s}=e;return l.a.createElement(D.c,{onSubmit:r},l.a.createElement(p.a,{type:"flex",justify:"center"},l.a.createElement(b.a,{span:24},l.a.createElement(v.a,{placeholder:"Name of the Group",value:t.name,name:"name",onChange:o,inputProps:{maxLength:80},error:a.name,touched:n.name})),l.a.createElement(b.a,{span:24,className:"text-center"},l.a.createElement(_.a,{id:"create-group-btn",label:"Create",light:!0,type:"submit",disabled:s,className:"mt-3"}))))}))}));var T=Object(o.b)(e=>({groupStore:e.store.groupStore,modalStore:e.store.modalStore}))(Object(o.c)(e=>{const{modalStore:t,groupStore:a}=e,{selectGroup:o,addGroupResponse:r,setGroupDataPage:c,setGroupDataPageSize:i,setGroupDataSearch:u,setGroupData:d}=a,[m,p]=Object(n.useState)(!1),b=Object(s.g)();return l.a.createElement(l.a.Fragment,null,l.a.createElement(P.a,{destroyOnClose:!0,title:l.a.createElement("div",{className:"text-center"},l.a.createElement("h4",{className:"pt-3 fw-bold"},"Create Group"),l.a.createElement("p",{className:"mb-0 "+B.a.modalDes},"Create a Group for your sales,",l.a.createElement("span",null,l.a.createElement("br",null),"Marketing, Customer Success and Business Communication"))),closeIcon:l.a.createElement("div",{className:"btn "+B.a.modalCloseBtn},l.a.createElement("i",{className:"fas fa-times"})),visible:t.showCreateGroupModal,onCancel:()=>{t.toggleModal("showCreateGroupModal",!1),t.selectedContacts&&t.setData("selectedContacts",void 0),d(null)},maxWidth:800,footer:null,centered:!0,maskStyle:{background:"linear-gradient(135deg, #00000050, #107c9850)"}},l.a.createElement("div",{className:"px-5"},l.a.createElement(F,{alert:p}))),l.a.createElement(w.a,{visible:m,title:"New group created",description:"New group created successfully with the selected contacts.",primaryBtnProps:{label:"Go to Group",onClick:()=>{var e,t;p(!1),c(1),i(10),u(""),b.push("/group/"+(null===r||void 0===r||null===(e=r.data)||void 0===e||null===(t=e.group)||void 0===t?void 0:t._id)),o(void 0)}},secondaryBtn:!0,secondaryBtnProps:{label:"Stay on this page",onClick:()=>p(!1)}}))})),z=a(2583),V=a.n(z);var L=e=>{let{visible:t,menuPosition:a,record:n,onClick:o,menu:r=[]}=e;return t&&l.a.createElement("ul",{className:V.a.popup,style:{left:a.x+"px",top:a.y+"px"}},r.map((e,t)=>l.a.createElement("li",{key:t,onClick:()=>
1o(e.key)},l.a.createElement(d.a,{type:e.icon})," ",e.label)))},R=a(414),Q=a(253),q=a(262),Y=a(569),U=a(413);var W=Object(o.b)(e=>({groupStore:e.store.groupStore,modalStore:e.store.modalStore}))(Object(o.c)(e=>{const{modalStore:t,groupStore:a}=e,{selectGroup:o,addGroupResponse:r,setGroupDataPage:c,setGroupDataPageSize:i,setGroupDataSearch:u,setGroupData:d}=a,m=Object(s.g)(),[p,b]=Object(n.useState)(!1),[g,f]=Object(n.useState)(!1),{id:v}=Object(s.i)();return l.a.createElement(l.a.Fragment,null,l.a.createElement(U.a,{groupViewProps:{showSelectedGroups:!1,excludeGroupId:v},btnLabel:"Move Contact",allowEmptyGroup:!0,heading:l.a.createElement("p",{className:"mb-0 "+B.a.modalDes},"Select group to move contact"),selectType:"radio",isVisible:t.showMoveContact,hideAddGroupButton:!0,handleCancel:()=>{t.toggleModal("showMoveContact",!1),t.selectedContacts&&t.setData("selectedContacts",void 0),d(null)},handleGroupSelect:(e,n)=>{var l;(null===e||void 0===e||null===(l=e.group)||void 0===l?void 0:l.includes(v))?(n(!1),f(!0)):a.moveContactsToGroup({contactGroupMaps:t.selectedContacts},null===e||void 0===e?void 0:e.group).then(e=>{e.status&&b(!0)}).finally(()=>{t.toggleModal("showMoveContact",!1),t.setData("selectedContacts",void 0),n(!1)})}}),l.a.createElement(w.a,{visible:p,title:"Contact has been moved successfully!",primaryBtnProps:{label:"Go to Group",onClick:()=>{var e;b(!1),c(1),i(10),u(""),m.push("/group/"+(null===r||void 0===r||null===(e=r.data)||void 0===e?void 0:e.group)),o(void 0)}},secondaryBtn:!0,secondaryBtnProps:{label:"Stay on this page",onClick:()=>b(!1)}}),l.a.createElement(w.a,{warning:!0,visible:g,title:"Can't Move!",description:"You can't move selected contacts to the same group.",primaryBtnProps:{label:"ok",onClick:()=>{f(!1)}}}))})),J=a(58),H=a(1148),K=a(1019),$=a(141),X=a(135),Z=a(128),ee=a(38);const{Text:te}=g.a;var ae=Object(o.b)(e=>({groupStore:e.store.groupStore}))(Object(o.c)(e=>{let{onApplyFilters:t,groupStore:a}=e;const{group:o,fetchUniqueValues:s,setResponse:c,appliedFilters:i}=a,u=Object(r.p)(o),d=Object(n.useRef)(null),[m,p]=Object(n.useState)({}),[b,g]=Object(n.useState)({}),[f,v]=Object(n.useState)({}),[h,E]=Object(n.useState)(!1),[y,C]=Object(n.useState)(0),S=()=>{var e;E(!1),null===(e=d.current)||void 0===e||e.setSubmitting(!1)};Object(n.useEffect)(()=>{C(Object.keys(i).length)},[i]);const k={selectedValues:{}},x=I.g().shape({selectedValues:I.g()});return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:"position-relative"},y>0&&l.a.createElement("div",{style:{zIndex:"999"},className:"badge badge-dark position-absolute top-0 start-100 translate-middle"},y),l.a.createElement(_.a,{groupBtn:!0,groupBtnConfig:{firstOnClick:()=>{E(!0)},secondOnClick:y>0?()=>{var e,a;c("appliedFilters",{}),C(0),v({}),null===(e=d.current)||void 0===e||e.setFieldValue("selectedValues",{}),null===(a=d.current)||void 0===a||a.resetForm(k),t({})}:null,firstBtnLabel:l.a.createElement("span",{className:"vh-center gap-1"},l.a.createElement("i",{className:"bx bx-filter-alt"}),"Filter"),secondBtnLabel:"X"}})),l.a.createElement(K.a,{title:l.a.createElement("div",{className:"vh-center gap-3 justify-content-start"},l.a.createElement("i",{className:"bx bx-filter-alt",style:{fontSize:"20px"}}),l.a.createElement("h5",{className:"m-0"},"Filter Contacts")),placement:"right",onClose:S,visible:h,width:420,className:"filter-drawer",bodyStyle:{padding:"20px",backgroundColor:"#f8f9fa",height:"calc(100% - 61px)"}},l.a.createElement(D.d,{innerRef:d,initialValues:k,validationSchema:x,onSubmit:e=>{const a=[];Object.keys(e.selectedValues).forEach(t=>{var n;(null===(n=e.selectedValues[t])||void 0===n?void 0:n.length)>0&&a.push({[t]:e.selectedValues[t]})}),c("appliedFilters",a),c("groupDataCurrent",1),t(a),S()}},e=>{var t;let{values:a,handleSubmit:n,setFieldValue:o,isSubmitting:r}=e;return l.a.createElement($.a,{onSubmit:n,className:"h-100 d-flex flex-column"},l.a.createElement("div",{className:"flex-grow-1"},l.a.createElement(te,{type:"secondary",style:{display:"block",marginBottom:"16px"}},"Select fields to filter and choose values from the dropdown"),null===u||void 0===u||null===(t=u.fields)||void 0===t?void 0:t.map((e,t)=>l.a.createElement("div",{key:t,className:"px-3 py-4 bg-white rounded-3 shadow-sm mb-3"},l.a.createElement(X.a,{checked:f[e],onChange:t=>(async(e,t)=>{if(v(a=>({...a,[e]:t})),t){p(t=>({...t,[e]:!0}));try{if(!(null===b||void 0===b?void 0:b[e])){const t=await s(null===u||void 0===u?void 0:u._id,{filters:[e]});g(e=>({...e,...t}))}}catch(a){console.error("Error fetching unique values:",a)}finally{p(t=>({...t,[e]:!1}))}}})(e,t.target.checked)},l.a.createElement(te,{strong:!0},e)),f[e]&&l.a.createElement("div",{style:{marginTop:"12px"}},m[e]?l.a.createElement("p",{className:"placeholder-glow m-0"},l.a.createElement("span",{className:"placeholder col-12 rounded-2"}
1)):l.a.createElement(ee.a,{size:"default",mode:"multiple",style:{width:"100%"},placeholder:`Select ${e} values`,value:a.selectedValues[e]||[],onChange:t=>o("selectedValues."+e,t),options:b?null===b||void 0===b?void 0:b[e]:[],maxTagCount:3}))))),l.a.createElement(Z.a,{style:{margin:"24px 0 16px"}}),l.a.createElement("div",{className:"d-flex justify-content-end",style:{gap:"12px"}},l.a.createElement(_.a,{label:"Reset",onClick:()=>{v({}),o("selectedValues",{})},light:!0,withoutBg:!0,style:{minWidth:"100px"}}),l.a.createElement(_.a,{label:"Apply Filters",type:"submit",light:!0,isSubmitting:r,style:{minWidth:"120px"}})))})))})),ne=a(17);const le={verticalAlign:"middle"};t.a=Object(o.b)(e=>({groupStore:e.store.groupStore,modalStore:e.store.modalStore,messageStore:e.store.messageStore,authStore:e.store.authStore,gatewayBulkStore:e.store.gatewayBulkStore,gatewayMmsStore:e.store.gatewayMmsStore}))(Object(o.c)((function(e){var t,a,o;const{groupStore:c,modalStore:C,gatewayBulkStore:S,gatewayMmsStore:k,authStore:x,messageStore:N,campaign:P=!1,campaignGroup:M,values:B,setFieldValue:D,handleSelectContact:I}=e,{group:_,getGroupById:A,groupDataCurrent:F,setGroupDataPage:z,groupDataSearch:V,setGroupDataSearch:U,groupDataPageSize:K,setGroupDataPageSize:$,getAllGroupDataList:X,groupDataTotal:Z,deleteMultipleContact:ee,blocked:te,getExportGroupContacts:oe,groupDataContactList:re,appliedFilters:se,setResponse:ce}=c,ie=Object(s.g)(),{id:ue}=Object(s.i)(),de=Object(s.h)(),me=new URLSearchParams(null===de||void 0===de?void 0:de.search).get("number"),pe=P?M:ue,[be,ge]=Object(n.useState)(()=>P?(z(1),null===B||void 0===B?void 0:B.selectedGroupIds):[]),[fe,ve]=Object(n.useState)({visible:!1,contact:null}),[he,Ee]=Object(n.useState)(),[ye,Ce]=Object(n.useState)(!1),[Se,ke]=Object(n.useState)([]),[xe,Oe]=Object(n.useState)(!1),[we,je]=Object(n.useState)(!1),[Ne,Ge]=Object(n.useState)(me),[Pe,Me]=Object(n.useState)(!1),[Be,De]=Object(n.useState)(!1),[Ie,_e]=Object(n.useState)(!1),[Ae,Fe]=Object(n.useState)(!1),[Te,ze]=Object(n.useState)(""),[Ve,Le]=Object(n.useState)(!1),[Re,Qe]=Object(n.useState)(!1),[qe,Ye]=Object(n.useState)(!1),[Ue,We]=Object(n.useState)({x:0,y:0}),[Je,He]=Object(n.useState)(!1),[Ke,$e]=Object(n.useState)(),[Xe,Ze]=Object(n.useState)("Something went wrong!"),[et,tt]=Object(n.useState)("error"),[at,nt]=Object(n.useState)(!1),[lt,ot]=Object(n.useState)(!0),[rt,st]=Object(n.useState)([]),[ct,it]=Object(n.useState)(!1),ut=/^(?=(?:.*[A-Za-z]){2,}).*$/,{user:dt}=x,mt=Object(n.useCallback)(G()(e=>Ge(e),j.r),[]),[pt,bt]=Object(n.useState)(""),gt=()=>{A(pe).then(e=>{it(!0),ze(e.name)}).finally(()=>it(!1))};Object(n.useEffect)(()=>{pe&&(ze(""),gt())},[pe,Z]),Object(n.useEffect)(()=>{st(re)},[re]),Object(n.useEffect)(()=>{(null===B||void 0===B?void 0:B.numberList)&&(null===B||void 0===B?void 0:B.selectedGroupIds)&&c.setSelectedGroups(null===B||void 0===B?void 0:B.numberList,null===B||void 0===B?void 0:B.selectedGroupIds)},[P]),Object(n.useEffect)(()=>{U(me),ce("appliedFilters",{})},[]);const ft=()=>{pe&&X(pe,Ne).then(e=>{st(re)}).finally(()=>{ot(!1)})};if(Object(n.useEffect)(()=>{if(ot(!0),_&&"Queued"===_.status){const e=setInterval(gt,15e3);return()=>{clearInterval(e)}}ft()},[Ne,F,K,pe,_]),!_)return l.a.createElement("div",{className:"text-center"},l.a.createElement("img",{src:J.f+"/images/running-robo_1.gif",alt:"loading",width:400}),l.a.createElement("div",{className:"text-center"},l.a.createElement("p",{className:"fw-bold fs-5"},"Fetching contacts...")));const vt=Object(r.p)(_),ht=!0===(null===vt||void 0===vt?void 0:vt.groupstatus)||"processing"===(null===vt||void 0===vt?void 0:vt.groupstatus)||"locked"===(null===vt||void 0===vt?void 0:vt.groupstatus);let Et=Array.isArray(null===vt||void 0===vt?void 0:vt.fields)?vt.fields.map((e,t)=>({title:e,dataIndex:e,key:e,width:"180px",ellipsis:!0,render:(t,a)=>{let n={};return a.fields.map(e=>(n[e.name]=e.value,n)),l.a.createElement(l.a.Fragment,null,n[e])}})):[];Et.splice(0,0,{title:"Number",dataIndex:"number",width:"120px",render:(e,t)=>l.a.createElement("span",{type:"button",onClick:()=>ve({visible:!0,contact:t.number})},t.number)}),P||Et.push({title:"Date",dataIndex:"createdAt",width:"120px",render:e=>i()(e).format(j.p)},{title:"Unsubscribed",width:"120px",className:"text-center",render:(e,t)=>null===t.optIn||t.optIn?"No":"Yes"});const yt={onChange:(e,t)=>
1{if(e.length>0){const a=t.map(e=>{let{number:t,_id:a,optIn:n}=e;return{id:a,number:t,optIn:n}});ge(e),ke(t),c.setSelectedContacts(a,e),t.length>=1&&Ee(t[0]),P&&(D("groupObj",{...B.groupObj,totalContacts:e.length}),I&&I(c.selectedContacts,e))}else Ee(null),ge([]),ke([])},onSelect:(e,t)=>{t?Ee(e):(ge(be.filter(t=>t!==e._id)),ke(Se.filter(t=>t._id!==e._id)),Ee(Se.filter(t=>t._id!==e._id)[0]))},selectedRowKeys:be};let Ct=[{label:"Run Campaign",key:"campaign",icon:"message"},{label:"Create Group",key:"create",icon:"filter"},{label:"Move Contact",key:"move",icon:"scissor"},{label:"Add Contacts",key:"add",icon:"user-add"},{label:"Delete Contacts",key:"delete",icon:"delete"},{label:"Edit Contact",key:"edit",icon:"edit"}],St=[{label:"Edit "+(null===he||void 0===he?void 0:he.number),key:"edit",icon:"edit"},{label:"Delete",key:"delete",icon:"delete"},{label:"Send Quick Message",key:"quick",icon:"message"}];"subaccount"===(null===dt||void 0===dt?void 0:dt.role)&&!(null===dt||void 0===dt||null===(t=dt.roleAccess.find(e=>"group"===e.feature))||void 0===t?void 0:t.delete)&&(null===vt||void 0===vt?void 0:vt.givenToSubAccount)&&vt.subAccount.find(e=>e===(null===dt||void 0===dt?void 0:dt._id))&&(Ct.splice(Ct.findIndex(e=>"delete"===e.key),1),St.splice(St.findIndex(e=>"delete"===e.key),1)),"subaccount"===(null===dt||void 0===dt?void 0:dt.role)&&!(null===dt||void 0===dt||null===(a=dt.roleAccess.find(e=>"group"===e.feature))||void 0===a?void 0:a.edit)&&(null===vt||void 0===vt?void 0:vt.givenToSubAccount)&&vt.subAccount.find(e=>e===(null===dt||void 0===dt?void 0:dt._id))&&(Ct.splice(Ct.findIndex(e=>"add"===e.key),1),Ct.splice(Ct.findIndex(e=>"edit"===e.key),1),St.splice(St.findIndex(e=>"edit"===e.key),1)),"subaccount"===(null===dt||void 0===dt?void 0:dt.role)&&Ct.splice(Ct.findIndex(e=>"create"===e.key),1);const kt=l.a.createElement(u.a,null,Ct.map((e,t)=>l.a.createElement(u.a.Item,{onClick:()=>xt(e.key),key:t},l.a.createElement("span",{className:"text-info-color"},l.a.createElement(d.a,{type:e.icon,style:le})," ",e.label,"edit"==e.key&&l.a.createElement(m.a,{title:"You can edit one contact at a time",placement:"right"},l.a.createElement("i",{className:"fas fa-info-circle mx-2"})))))),xt=e=>{switch($e(e),e){case"campaign":if(vt.totalContacts>0){0===(null===be||void 0===be?void 0:be.length)&&c.setSelectedContacts();let e={group:[vt._id],groupObj:[{...vt,unsubscribe:te}],unsubscribe:te,totalContacts:parseInt(null===vt||void 0===vt?void 0:vt.totalContacts)};Object(ne.isEmpty)(se)||(e.groupObj[0].totalContacts=Z,e.totalContacts=Z,e.filters=se,e.unsubscribe=0,e.groupObj[0].unsubscribe=0),S.setCampaignData(e),k.setCampaignData(e),ie.push("/campaign/create"),N.setCurrentMessage(""),N.setPhoneSubject(""),N.setCurrentImage(null),C.setIsMms(!1),localStorage.setItem("campaign",JSON.stringify(e)),localStorage.setItem("step",0)}else Fe(!0);break;case"delete":be.length>0?Me(!0):De(!0);break;case"create":be.length>0?(C.toggleModal("showCreateGroupModal",!0),C.setData("selectedContacts",be),ge([]),Ee(null)):De(!0);break;case"move":be.length>0?(C.toggleModal("showMoveContact",!0),C.setData("selectedContacts",be),ge([]),Ee(null)):De(!0);break;case"edit":he&&1===be.length?(C.toggleModal("showQuickContactModal",!0),ge([])):be.length<1?De(!0):he&&be.length>1&&_e(!0);break;case"add":ge([]),Ee(null),ht?C.toggleModal("showQuickContactModal",!0):C.toggleModal("showAddContactsModal",!0);break;case"quick":C.toggleModal("quickMessage",!0),C.setQuickSMSData({receiver:he.number});break;default:je(!0)}};function Ot(){Ye(!1),document.removeEventListener("click",Ot)}return l.a.createElement(l.a.Fragment,null,l.a.createElement(p.a,{className:P?"bg-white":"my-3 w-100 rounded-xl bg-white shadow mx-auto p-3",gutter:[10,20],type:"flex",align:"middle",style:{height:C.quickMessage?"auto":"fit-content"}},!P&&l.a.createElement(n.Fragment,null,l.a.createElement(b.a,{span:1},l.a.createElement("i",{className:"fas fa-arrow-left fs-5 text-info-color",onClick:()=>ie.push("/group"),type:"button"}))),l.a.createElement(b.a,{span:19},l.a.createElement(g.a.Title,{level:4,className:"text-info-color mb-0 d-flex align-items-center"},l.a.createElement("span",{className:"text-nowrap"},"Group Name -"),Ve?l.a.createElement(v.a,{name:"groupName",value:Te,containerClassname:"ms-2 m-0",size:"default",onChange:e=>{ze(e.target.value),pt&&bt("")},error:pt,touched:!0,inputProps:{maxLength:80,onBlur:()=>{ut.test(Te)?(Le(!1),Te!==vt.name&&c.updateGroup({name:Te},pe).then(()=>{ze(Te),bt("")})):bt("Group name must contain at least two alphanumeric characters.")},onPressEnter:()=>{ut.test(Te)?(Le(!1),Te!==vt.name&&c.updateGroup({name:Te},pe).then(()=>{ze(Te),bt("")})):bt("Enter a valid input .")}}}
1):l.a.createElement(l.a.Fragment,null,l.a.createElement("span",{className:"text-dark ms-2 text-truncate"}," "+(Te||(null===vt||void 0===vt?void 0:vt.name))),P||"subaccount"===(null===dt||void 0===dt?void 0:dt.role)&&!(null===dt||void 0===dt||null===(o=dt.roleAccess.find(e=>"group"===e.feature))||void 0===o?void 0:o.edit)&&(null===vt||void 0===vt?void 0:vt.givenToSubAccount)&&vt.subAccount.find(e=>e===(null===dt||void 0===dt?void 0:dt._id))?null:l.a.createElement(m.a,{title:"Edit Group Name"},l.a.createElement("i",{className:"fas fa-edit text-info-color ms-2 fs-6",type:"button",onClick:()=>Le(!0)}))))),!P&&l.a.createElement(n.Fragment,null,l.a.createElement(b.a,{span:4,className:"d-flex justify-content-end align-items-center gap-2"},l.a.createElement("span",null,l.a.createElement(m.a,{title:"Total Contacts"},l.a.createElement("i",{className:"fas fa-users text-info-color mx-2"}),": ",vt.status&&"Queued"===vt.status?l.a.createElement(f.a,{className:"ms-2"}):vt.totalContacts)),l.a.createElement("span",null,l.a.createElement(m.a,{title:"Unsubscribed"},l.a.createElement("i",{className:"fas fa-ban text-danger-color mx-2"}),": ",vt.status&&"Queued"===vt.status?l.a.createElement(f.a,{className:"ms-2"}):te)),_&&_.errorLog&&_.errorLog.length>0&&_._id===pe&&l.a.createElement("span",{type:"button",onClick:()=>Ce(!0)},l.a.createElement(m.a,{title:"Error Log",placement:"top"},l.a.createElement("i",{className:"fas fa-exclamation text-danger-color mx-2"}),": ",_.errorLog.length)))),vt.status&&"Queued"===vt.status?l.a.createElement(H.a,{description:"Getting your contacts",countDownTime:15}):l.a.createElement(l.a.Fragment,null,!P&&l.a.createElement(b.a,{span:24},l.a.createElement(Q.a,{md:P?18:10,placeholder:"Search for Contact Name or Number",value:V,onSearch:e=>{U(e.target.value),mt(e.target.value)},disabled:vt.status&&"Queued"===vt.status,menu:kt,refreshBtn:!0,onRefresh:gt,refreshing:ct,dropdown:!0,btn:!P,size:"default",label:"Actions",secondaryBtn:!P,secondaryBtnProps:{onClick:()=>C.toggleModal("showExportNotification",!0),label:"Export",size:"default",disabled:0==parseInt(vt.totalContacts)},endProps:l.a.createElement(ae,{onApplyFilters:ft})})),l.a.createElement(b.a,{span:24},l.a.createElement(h.a,{pagination:{defaultCurrent:1,defaultPageSize:10,current:F,total:Z,pageSize:K,onChange:e=>z(e),showSizeChanger:!0,onShowSizeChange:(e,t)=>
1$(t),className:"float-start",hideOnSinglePage:!0,showQuickJumper:!0,pageSizeOptions:["10","20","40","80","100"]},loading:lt,rowSelection:yt,columns:Et,dataSource:rt,scroll:{x:750,y:675},className:P?"border rounded":"",secondary:!0,rowKey:e=>e._id,onRow:e=>P?null:{onContextMenu:t=>{t.preventDefault(),ht||(document.addEventListener("click",Ot),Ee(e),ge([e._id]),We({x:t.clientX-220,y:t.clientY-180}),Ye(!0))}}}),l.a.createElement(L,{visible:qe,menuPosition:Ue,record:he,onClick:xt,menu:St})))),C.showExportNotification&&l.a.createElement(q.a,{handleExport:async(e,t)=>{let a=null;a=await oe(pe,e),a.success?(C.setData("exportMessage",a.message),C.setData("exportEmail",a.email),Ze(a.message),tt("Success"),t("2")):(Ze(a.message),tt("Error"),nt(!0))},className:"mb-3"}),_?l.a.createElement(O,{visible:ye,onClose:()=>{Ce(!1)},data:_.errorLog,renderColumns:["position","reason"]}):null,l.a.createElement(E.a,null),l.a.createElement(Y.a,{sync:ft}),l.a.createElement(y.a,{setContact:Ee,contact:he}),l.a.createElement(w.a,{visible:xe,title:"Contacts deleted successfully",primaryBtnProps:{label:"Ok",onClick:()=>{Oe(!1),Ee(null)}},closable:!0,onCancel:()=>Oe(!1)}),l.a.createElement(w.a,{visible:we,title:"Something went wrong",primaryBtnProps:{label:"Ok",onClick:()=>{Ee(null),je(!1)}},closable:!0,onCancel:()=>je(!1),error:!0}),l.a.createElement(w.a,{visible:Be,title:"Select Contact",description:"Please select contact to perform this action",primaryBtnProps:{label:"Ok",onClick:()=>De(!1)},closable:!0,onCancel:()=>De(!1),error:!0}),l.a.createElement(w.a,{visible:Ie,title:"Select One Contact",description:"Please select one contact only to perform this action",primaryBtnProps:{label:"Ok",onClick:()=>_e(!1)},closable:!0,onCancel:()=>_e(!1),error:!0}),l.a.createElement(w.a,{visible:Ae,title:"Zero Contacts",description:"No contacts in this group, cannot run campaign.",secondaryBtn:!0,primaryBtnProps:{label:"Ok",onClick:()=>Fe(!1)},secondaryBtnProps:{label:"Add Contacts",onClick:()=>{C.toggleModal("showAddContactsModal",!0),ge([]),Fe(!1)}},error:!0}),l.a.createElement(w.a,{visible:Pe,title:"Delete Contacts",description:"Are you sure to delete selected contacts?",secondaryBtn:!0,primaryBtnProps:{label:"Yes",onClick:()=>{Qe(!0),ee({contact_ids:be,group:pe}).then(e=>{e.status&&(c.setSelectedContacts([]),Oe(!0),A(pe),ge([]),Ee(null))}).finally(()=>{Qe(!1),Me(!1)})}},loading:Re,secondaryBtnProps:{label:"No",onClick:()=>{Me(!1),ge([]),Ee(null)}},warning:!0}),l.a.createElement(T,null),l.a.createElement(W,null),l.a.createElement(R.a,{findGroupBtn:!1,visible:fe.visible,handleClose:()=>ve({visible:!1,contact:null}),number:fe.contact,isMms:!1}),l.a.createElement(w.a,{visible:at,title:et,description:Xe,primaryBtnProps:{label:"Ok",onClick:()=>nt(!1)},closable:!0,onCancel:()=>nt(!1),error:"Error"===et}),l.a.createElement(w.a,{error:!0,visible:Je,title:"Can't perform",description:`This group is in use. You can't ${Ke?Ke+" contact in":"make changes on"} this group now.`,primaryBtnProps:{label:"Ok",onClick:()=>He(!1)},closable:!0,onCancel:()=>He(!1)}))})))},2583:function(e,t,a){e.exports={popup:"popup_popup__Ceggq",fadeIn:"popup_fadeIn__3y0Yu"}}}]); 2//# sourceMappingURL=4.36f0a06c.chunk.js.map
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.