1"use strict";(self.webpackChunknew_canvas_admin=self.webpackChunknew_canvas_admin||[]).push([[6496],{6949:(e,t,a)=>{a.d(t,{A:()=>i});a(65043);var n=a(84373),o=a(14303);const i=function(){return(0,o.Y)("div",{css:(0,o.AH)(s,"")},(0,o.Y)(n.A,{variant:"text",height:72,css:(0,o.AH)(c,"")}),(0,o.Y)(n.A,{variant:"rect",height:72,css:(0,o.AH)(l,"")}),(0,o.Y)(n.A,{variant:"rect",height:72,css:(0,o.AH)(r,"")}),(0,o.Y)(n.A,{variant:"rect",height:72,css:(0,o.AH)(r,"")}),(0,o.Y)(n.A,{variant:"rect",height:72,css:(0,o.AH)(r,"")}))},s="\n margin: 20px auto;\n",c="\n margin: 24px auto;\n",l="\n margin: 4px auto;\n",r="\n margin: 1px auto;\n"},82757:(e,t,a)=>{a.d(t,{A:()=>h});var n=a(14303),o=a(5142),i=a(60637),s=(a(65043),a(80345)),c=a(67503),l=a(59691),r=a(72703),d=a(3359),p=a(64759),m=a(18885),u=a(66187),g=a(6949);const h=function(e){let{data:t,columns:a,loading:o,headerColor:i,shadowRow:h=!1,maxHeight:w,stickyHeader:k=!1,customComp:C=(()=>{}),handleClickTableRow:H=(()=>{})}=e;const I={data:t,columns:a,loading:o,headerColor:i,shadowRow:h,maxHeight:w,stickyHeader:k,customComp:C};return(0,n.Y)(d.A,{css:y(I)},o?(0,n.Y)(g.A,null):(0,n.Y)(c.A,{stickyHeader:k,"aria-label":"sticky table"},(0,n.Y)(p.A,{css:A(I)},(0,n.Y)(m.A,{css:(0,n.AH)([Y,x(I)],"")},a.map((e=>(0,n.Y)(r.A,{key:e.accessorKey,align:e.align,style:{...e.style}},e.header))))),0===t.length?(0,n.Y)("div",{css:f},(0,n.Y)("div",null,(0,n.Y)(u.A,{variant:"subtitle2"},s.A.t("label.not_member_data")))):(0,n.Y)(l.A,{css:v},t.map(((e,t)=>(0,n.Y)(m.A,{hover:!0,role:"checkbox",tabIndex:-1,key:t,css:(0,n.AH)([Y,b({...I,isDisabled:e.isDeleting})],""),onClick:()=>H(e.id)},a.map((t=>(0,n.Y)(r.A,{key:t.accessorKey,align:t.align,style:{...t.style}},(0,n.Y)(u.A,{variant:"subtitle2"},(e=>{let{row:t,column:a}=e;const n=a.accessorKey.includes("custom")?C({type:a.accessorKey,props:t}):t[a.accessorKey];return null!==n&&void 0!==n?n:a.emptyValue||s.A.t("report.hint_title")})({row:e,column:t})))))))))))},y=e=>{let{maxHeight:t}=e;return(0,n.AH)("max-height:",t||"auto",";margin-bottom:40px;")},A=e=>{let{stickyHeader:t}=e;return(0,n.AH)(t&&"\n position: sticky;\n top: 0;\n ","")},x=e=>{let{headerColor:t}=e;return(0,n.AH)("& .MuiTableCell-stickyHeader{background-color:",t,";}& *{padding-block:16px;padding-inline:12px;border-bottom:unset;}")},b=e=>{let{isDisabled:t}=e;return(0,n.AH)("& .MuiTableCell-root{border-bottom:none;}& .MuiTableCell-root:last-of-type{justify-content:end;}& .MuiTableRow-root.MuiTableRow-hover:hover{}&:hover{box-shadow:",o.x6,";border:none;cursor:pointer;}border:1px solid ",i.I,";border-radius:8px;",t&&"pointer-events: none; opacity: 0.5; cursor: not-allowed;","")},Y=(0,n.AH)("display:flex;align-items:center;margin-bottom:8px;margin-inline:16px;background:",i.E,";& > *{padding-block:16px;padding-inline:12px;}"),v=(0,n.AH)("& .MuiTableRow-root.MuiTableRow-hover:hover{background-color:",i.E,";}"),f=(0,n.AH)("padding:8px 1px;> div{box-shadow:",o.En,";padding:60px;text-align:center;}")},38200:(e,t,a)=>{a.r(t),a.d(t,{default:()=>it});var n=a(65043),o=a(91688),i=a(60637),s=a(80345),c=a(14303),l=a(4626),r=a(66187),d=a(5142),p=a(97508),m=a(62582),u=a(6513);var g={name:"1vq31f1",styles:"font-weight: 500"};const h=function(e){let{type:t,style:a,disabled:n=!1,children:d}=e;const{url:h}=(0,o.useRouteMatch)(),{id:b}=(0,p.d4)((e=>e.sponsor)),Y=(0,c.Y)(l.A,{key:t,display:"flex",alignItems:"center",justifyContent:"center",color:i.P,borderRadius:8,css:n&&A,style:a},(0,c.Y)(l.A,null,(0,c.Y)(l.A,{css:y},"function"===typeof u.$n[t].imageSrc?(0,c.Y)(l.A,null,u.$n[t].imageSrc):(0,c.Y)("img",{src:u.$n[t].imageSrc,alt:t})),(0,c.Y)(l.A,{mt:3,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},(0,c.Y)(r.A,{variant:"h4",css:g},s.A.t(u.$n[t].i18nNameKey)),(0,c.Y)(r.A,{variant:"subtitle2"},s.A.t(u.$n[t].desc)))),d);return(0,c.Y)(m.N_,{to:n?"#":"".concat(h,"/").concat(t).concat(b&&"?sponsorId=".concat(b)),css:x},Y)},y=(0,c.AH)("width:100%;height:250px;color:",i.O,";display:flex;justify-content:center;align-items:center;"),A=(0,c.AH)("cursor:not-allowed;color:",i.I,";opacity:0.5;"),x=(0,c.AH)("width:100%;max-height:426px;background:",i.E,";border-radius:16px;padding:40px;margin-right:8px;gap:24px;&:last-child{margin-right:0;}border:1px solid ",i.I,";:hover{box-shadow:",d.x6,";border:none;}");var b=a(12745);var Y={name:"189skj",styles:"font-weight: 500;"};function v(){return(0,c.Y)("div",{css:b.o},(0,c.Y)(l.A,{py:3,my:1,color:i.P},(0,c.Y)(l.A,{mb:1},(0,c.Y)(r.A,{variant:"h4"},s.A.t("label.campaign.tool_page.title"))),(0,c.Y)(r.A,{variant:"subtitle1",css:Y},s.A.t("label.campaign.tool_page.desc"))),(0,c.Y)("div",{css:f},Object.values(u.$n).map((e=>(0,c.Y)(h,{key:e.type,disabled:e.disabled,type:e.type})))))}const f={name:"1n2mv2k",styles:"display:flex;justify-content:center;align-items:center;"};var w=a(60446),k=a.n(w),C=a(41517),H=a(8791);var I={name:"1vq31f1",styles:"font-weight: 500"};const P=function(e){let{type:t,style:a,disabled:n=!1,children:d,isCreateMode:g=!1}=e;const{url:h}=(0,o.useRouteMatch)(),{id:y}=(0,p.d4)((e=>e.sponsor)),{timezone:A}=(0,p.d4)((e=>e.sponsor.settings)),x=(0,p.wA)(),b=A||(0,C.Vm)(),Y=(0,C.W8)(k()(new Date).format("YYYY-MM-DD")+" 00:00:00",b),v=(0,C.W8)(k()(new Date).format("YYYY-MM-DD")+" 23:59:59",b),f=(0,c.Y)(l.A,{key:t,display:"flex",alignItems:"center",justifyContent:"space-between",p:g?1:3,mb:1,color:i.P,borderRadius:8,css:(0,c.AH)([!g&&E,n&&S],""),style:a},(0,c.Y)(l.A,{display:"flex",alignItems:"center",justifyContent:"center"},(0,c.Y)(l.A,{css:T},"function"===typeof u.jU[t].imageSrc?(0,c.Y)(l.A,null,u.jU[t].imageSrc):(0,c.Y)("img",{src:u.jU[t].imageSrc,alt:t})),(0,c.Y)(l.A,{ml:2},(0,c.Y)(r.A,{variant:"subtitle1",css:I},s.A.t("campaign.welcome.module.".concat(t,".label"))),(0,c.Y)(r.A,{variant:"body2"},s.A.t("campaign.welcome.module.".concat(t,".description"))))),d);return Object.values(u.y4).includes(t)&&!g?(0,c.Y)(m.N_,{to:n?"#":"".concat(h,"/").concat(t).concat(y&&"?sponsorId=".concat(y))},f):(0,c.Y)(m.N_,{to:"".concat(h,"/create").concat(y&&"?sponsorId=".concat(y)),onClick:()=>x({type:H.Q_,payload:{campaignStartDate:Y,campaignEndDate:v,campaignTimezone:b}})},f)},T=(0,c.AH)("width:40px;height:40px;color:",i.O,";& svg{font-size:40px;}"),S=(0,c.AH)("cursor:not-allowed;color:",i.I,";opacity:0.5;"),E=(0,c.AH)("border:1px solid ",i.I,";:hover{box-shadow:",d.x6,";border:none;}");var M=a(74055);function O(){const e=(0,p.d4)((e=>e.sponsor.id));return(0,c.Y)("div",{css:b.o},(0,c.Y)(l.A,{color:i.P},(0,c.Y)(M.A,{link:"/admin/campaign?sponsorId=".concat(e),disableLinkText:!0,boxStyle:U},(0,c.Y)(r.A,{variant:"h5",css:_},s.A.t("label.campaign.chat")))),(0,c.Y)(l.A,{px:2},Object.values(u.jU).map((e=>(0,c.Y)(P,{key:e.type,disabled:e.disabled,type:e.type})))))}const U={name:"xd6z0z",styles:"margin:0 16px;height:96px;"},_={name:"1c2ww20",styles:"margin-left:8px;font-weight:500;"};var D=a(22317),R=a(17339),L=a(82757),N=a(19227);const z=function(e){let{status:t}=e;return(0,c.Y)(N.A,{label:(0,u.lK)(t),variant:"outlined",css:(0,c.AH)([j,function(e){switch(e){case u.Sv.UNPUBLISHED:return(0,c.AH)("color:",i.O,";background:",i.I,";border-color:",i.O,";");case u.Sv.PUBLISHED:return(0,c.AH)("color:#00a907;background:",i.w,";border-color:#00a907;");case u.Sv.PAUSED:return(0,c.AH)("color:",i.t,";background:",i.q,";border-color:",i.t,";")}}(t)],"")})},j={name:"m2n8tr",styles:"width:92px;height:36px;border:1px solid;font-weight:500;font-size:14px;border-radius:100px;"};var K=a(43254),q=a(48699),F=a(48716),G=a(57699),$=a(55357),B=a(58630);
1const W="editCampaign",V="deleteCampaign";var J=a(34174),Q=a(21440);const Z={vertical:"bottom",horizontal:"left"},X={vertical:"top",horizontal:"center"};function ee(e){let{sponsorId:t,campaignId:a,status:o,editorUrl:i}=e;const l=(0,p.wA)(),[d,m]=(0,n.useState)(null),g=!!d,h=(0,J.A)(),y=(e=>[{type:W,name:s.A.t("button.label.edit"),disabled:!1,onClick:e=>{var t;A(e),t=i,window.open("about:blank","_blank").location=t}},{type:V,name:s.A.t("btn.delete"),disabled:e!==u.Sv.UNPUBLISHED,onClick:async e=>{try{l((0,F.K_)(t,a))}catch(n){h(n,s.A.t("label.delete_fail"),Q.kO)}finally{A(e)}}}].map((e=>({...e,...e.disabled?{onClick:()=>{}}:{}}))))(o);function A(e){e.stopPropagation(),m(null)}return(0,c.Y)(n.Fragment,null,(0,c.Y)(R.A,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:function(e){e.stopPropagation(),m(e.currentTarget)}},(0,c.Y)(B.A,null)),(0,c.Y)(G.A,{id:"long-menu",anchorEl:d,keepMounted:!0,open:g,onClose:A,anchorOrigin:Z,transformOrigin:X,getContentAnchorEl:null},y.map(((e,t)=>(0,c.Y)($.A,{key:e.name,onClick:async t=>{t.stopPropagation(),await(e.onClick||A)(t)},css:te,disabled:e.disabled},(0,c.Y)(r.A,{variant:"body2",css:t===y.length-1?ne:ae},e.name))))))}const te={name:"1p1ky20",styles:"width:240px;padding:12px 11.8px 12px 16px;"},ae=(0,c.AH)("color:",i.O,";"),ne=(0,c.AH)("color:",i.o,";");var oe=a(23913);const ie=()=>(0,c.Y)("img",{src:"https://assets.fevercdn.com/nc-admin/icons/icon_leaderboard.svg",alt:"leaderboard.svg"});const se=function(e){let{sponsorId:t,data:a,isLoading:r,currentPage:d,isEnd:u,campaignType:g,isCampaignOnsite:h,isCampaignChat:y}=e;const A=(0,p.wA)(),{url:x}=(0,o.useRouteMatch)(),[b,Y]=(0,D.Wx)({threshold:0});r||!Y||u||A((0,F.hU)({page:d+1,type:g}));const v=(0,n.useMemo)((()=>[{accessorKey:"name",header:s.A.t("label.promo.name"),style:{width:546,paddingLeft:24,height:68,display:"flex",alignItems:"center"},hidden:!1},{accessorKey:"custom.date",header:s.A.t("label.campaign.table.time"),style:{width:224,height:68,display:"flex",alignItems:"center"},hidden:!1,emptyValue:"-"},{accessorKey:"totalSent",header:s.A.t("label.campaign.table.send_counts"),align:"center",style:{width:144,height:68,display:"flex",alignItems:"center",justifyContent:"center"},hidden:h},{accessorKey:"totalImpressions",header:s.A.t("label.total_impressions"),align:"center",style:{width:144,height:68,display:"flex",alignItems:"center",justifyContent:"center"},hidden:y,emptyValue:"-"},{accessorKey:"custom.status",header:s.A.t("label.promo.status"),align:"center",style:{width:116,height:68,display:"flex",alignItems:"center",justifyContent:"center"},hidden:!1},{accessorKey:"custom.icon",header:null,style:{width:120,flexGrow:1,height:68,display:"flex",alignItems:"center"},hidden:!1}]),[y,h]),f=(0,n.useMemo)((()=>v.filter((e=>!Boolean(e.hidden)))),[v]);return(0,c.Y)(n.Fragment,null,0===a.length&&r?(0,c.Y)(q.A,null):(0,c.Y)(n.Fragment,null,(0,c.Y)(L.A,{data:a,columns:f,customComp:e=>{let{type:a,props:n}=e;const{id:o,startDate:i,endDate:s,timezone:r,status:d}=n;let p=(0,c.Y)("div",null);switch(a){case"custom.date":p=i&&s?(0,oe.pd)({startDate:i,endDate:s,timezone:r,enableEndDate:Boolean(s)?1:0}):null;break;case"custom.status":p=void 0!==d?(0,c.Y)(z,{status:d}):null;break;case"custom.icon":p=(0,c.Y)(l.A,{display:"flex",justifyContent:"flex-end"},(0,c.Y)(m.N_,{to:"".concat(x,"/").concat(o,"/members").concat(t?"?sponsorId=".concat(t):""),style:{display:"inherit"}},(0,c.Y)(R.A,{onClick:e=>e.stopPropagation()},(0,c.Y)(ie,null))),(0,c.Y)(ee,{status:d,campaignId:o,sponsorId:t,editorUrl:"".concat(x,"/").concat(o,"/edit").concat(t?"?sponsorId=".concat(t):"")}));break;default:p="Error: campaign list error."}return p},headerColor:i.E,shadowRow:!0,handleClickTableRow:e=>{const a="".concat(x,"/").concat(e,"/edit").concat(t?"?sponsorId=".concat(t):"");window.open(a,"_blank")}}),!u&&(0,c.Y)("div",{css:(0,c.AH)(ce,""),ref:b},r&&(0,c.Y)(K.A,{size:32}))))},ce="\n margin: 15px auto;\n text-align: center;\n min-height: 36px;\n";const le=function(e){let{desc:t}=e;return(0,c.Y)(l.A,null,(0,c.Y)(l.A,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",mt:8},(0,c.Y)("img",{src:"https://assets.fevercdn.com/nc-admin/images/pronotion-tool-welcome.svg",alt:"welcome"}),(0,c.Y)(r.A,{variant:"subtitle1",css:(0,c.AH)("margin-top: 24px; color: ".concat(i.P),"")},t)))};var re=a(30105);const de=function(e){let{campaignTool:t}=e;return(0,c.Y)(l.A,{my:3,width:"100%"},(0,c.Y)(P,{type:t.type,style:{margin:"auto",boxShadow:"none"},isCreateMode:!0},(0,c.Y)(re.A,{variant:"contained",color:"primary",css:pe},s.A.t("btn.create"))))},pe={name:"1fn46g",styles:"width:90px;height:40px;border-radius:8px;padding:10px 16px;box-shadow:none;"};var me=a(74410);const ue={name:"xd6z0z",styles:"margin:0 16px;height:96px;"},ge=function(){const e=(0,p.wA)(),t=(0,me.YS)(),{toolId:a}=(0,o.useParams)(),{url:i}=(0,o.useRouteMatch)(),l=(0,p.d4)((e=>e.sponsor.id)),{campaignList:r,isFetching:d,currentPage:m,isEnd:g}=(0,p.d4)((e=>e.campaigns)),h=Object.values(u.jU).find((e=>e.type===Number(a))),y=i.split("/")[3]===u.DO.ONSITE,A=i.split("/")[3]===u.DO.CHAT,x=y?u.y4.ONSITE_POPUP:i.split("/")[4],Y=null===h||void 0===h?void 0:h.type;return(0,n.useEffect)((()=>{e({type:F.s$}),e({type:H.wz}),e((0,F.hU)({page:t?1:void 0,type:Y}))}),[e,t,l,Y]),(0,c.Y)("div",{css:b.o},(0,c.Y)(M.A,{link:"/admin/campaign/chat?sponsorId=".concat(l),disableLinkText:!0,boxStyle:ue},(0,c.Y)(de,{campaignTool:h})),0!==r.length||d?(0,c.Y)(se,{sponsorId:l,data:r,isLoading:d,currentPage:m,isEnd:g,campaignType:x,isCampaignOnsite:y,isCampaignChat:A}):(0,c.Y)(le,{desc:s.A.t("label.campaign.onboarding")}))},he=(0,n.lazy)((()=>Promise.all([a.e(5833),a.e(6503),a.e(577),a.e(583),a.e(4491)]).then(a.bind(a,63939)))),ye=(0,n.lazy)((()=>Promise.all([a.e(5833),a.e(7082),a.e(3044),a.e(1219),a.e(9947),a.e(5205)]).then(a.bind(a,15400))));function Ae(e){let{location:t,match:a}=e;const n=a.path;return(0,c.Y)(o.Switch,null,(0,c.Y)(o.Route,{exact:!0,path:"".concat(n),component:ge}),(0,c.Y)(o.Route,{exact:!0,path:"".concat(n,"/create"),component:he}),(0,c.Y)(o.Route,{exact:!0,path:"".concat(n,"/:campaignId/edit"),component:he}),(0,c.Y)(o.Route,{exact:!0,path:"".concat(n,"/:campaignId/:tab"),component:ye}),(0,c.Y)(o.Redirect,{to:{...t,pathname:a.path}}))}var xe=a(77925),be=a(36839);const Ye=e=>
1null===e||void 0===e||isNaN(e)?"0":Number(e).toLocaleString("en-US"),ve=(e,t)=>!t||0===t||isNaN(e)||isNaN(t)?0:Number((e/t*100).toFixed(1));const fe=function(e){let{onOpenPlugInHandler:t,onOpenTemplateHandler:a,loadsUsageData:o}=e;const{totalCampaignLoads:i,limit:d,isUnlimited:p}=o||{},m=void 0!==d&&null!==d&&d>0,u=void 0!==i;return(0,c.Y)(l.A,{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",ml:1},(0,c.Y)(l.A,{py:3,width:"100%"},(0,c.Y)(r.A,{variant:"h5"},s.A.t("label.campaign.onsite"))),(0,c.Y)(l.A,{py:3,width:"100%",display:"flex",justifyContent:"flex-end",alignItems:"center"},u&&(0,c.Y)(l.A,{css:Ce},p?(0,c.Y)(r.A,{variant:"caption",css:He()},"".concat(s.A.t("label.campaign.exposure_total")," : ").concat(Ye(i))):m?(0,c.Y)(n.Fragment,null,(0,c.Y)(r.A,{variant:"caption",css:He(ve(i,d))},"".concat(s.A.t("label.campaign.exposure_total")," : ").concat(Ye(i),"/ ").concat(Ye(d)," (").concat(ve(i,d),"%)")),m&&(0,c.Y)(xe.A,{variant:"determinate",value:ve(i,d),css:Ie(ve(i,d))})):(0,c.Y)(r.A,{variant:"caption",css:He()},"".concat(s.A.t("label.campaign.exposure_total")," : -"))),(0,c.Y)(re.A,{variant:"contained",css:we,onClick:t},s.A.t("label.plugin_snippet.install")),(0,c.Y)(re.A,{variant:"contained",color:"primary",css:ke,onClick:a},s.A.t("btn.create"))))},we=(0,c.AH)("height:40px;border-radius:8px;border:1px solid ",i.L,";background:",i.E,";color:",i.P,";margin-right:8px;box-shadow:none;padding:10px 16px;white-space:nowrap;flex-shrink:0;"),ke={name:"54sumb",styles:"min-width:90px;height:40px;border-radius:8px;box-shadow:none;padding:10px 16px;"},Ce={name:"4qyglm",styles:"display:flex;flex-direction:column;margin-right:16px;flex-shrink:0;"},He=e=>(0,c.AH)("color:",void 0!==e&&e>=100?i.o:i.P,";margin-bottom:",void 0!==e?"4px":"0",";text-align:end;white-space:nowrap;",(0,be.M)("caption"),""),Ie=e=>(0,c.AH)("&.MuiLinearProgress-colorPrimary{background-color:",i.H,";}&,& > .MuiLinearProgress-bar{height:8px;border-radius:100px;}& > .MuiLinearProgress-bar.MuiLinearProgress-barColorPrimary{background-color:",e>=100?i.o:i.S,";}");var Pe=a(34527),Te=a(80153),Se=a(749),Ee=a(18219),Me=a(67327);function Oe(e){let{type:t,imgUrl:a,desc:n,maxWidth:o,onClickHandler:i}=e;return(0,c.Y)(Se.A,{css:(0,c.AH)([Ue(o),_e],""),onClick:()=>i(t)},(0,c.Y)(Me.A,{css:De,image:a,title:t}),(0,c.Y)(Ee.A,{css:Re},(0,c.Y)(r.A,{variant:"caption",css:Le},n)))}const Ue=e=>(0,c.AH)("width:100%;max-width:",e,"px;margin:0 auto;"),_e=(0,c.AH)("border-radius:12px;box-shadow:",d.En,";background-color:",i.E,";cursor:pointer;&:hover{box-shadow:",d.jE,";}"),De={name:"64v8vf",styles:"padding-top:56.25%;"},Re={name:"1kl2kd2",styles:"padding:12px;min-height:20px;&.MuiCardContent-root:last-child{padding-bottom:12px;}"},Le=(0,c.AH)("color:",i.O,";font-weight:600;");var Ne=a(25843);const ze=389.33;function je(e){let{title:t,campaignMessage:a,onClickHandler:n}=e;return(0,c.Y)("div",null,(0,c.Y)(r.A,{variant:"h6",css:Ke},t),(0,c.Y)("div",{css:qe},a.map((e=>{let{campaignMessageType:t,imgUrl:a,desc:o}=e;return(0,c.Y)(Oe,{key:t,type:t,imgUrl:a,desc:o,onClickHandler:n,maxWidth:ze})}))))}const Ke=(0,c.AH)("padding-block:8px;margin-block:8px;",(0,Ne.Gz)("sm"),"{width:",ze,"px;margin:0 auto;}"),qe=(0,c.AH)("display:grid;grid-template-columns:repeat(auto-fill,minmax(30%,1fr));grid-gap:1rem 1rem;justify-content:center;",(0,Ne.Gz)("md"),"{grid-template-columns:repeat(auto-fill,minmax(48%,1fr));}",(0,Ne.Gz)("sm"),"{grid-template-columns:repeat(auto-fill,minmax(100%,1fr));}");var Fe=a(53275),Ge=a(84574),$e=a(32514),Be=a(59756);const We={name:"aickya",styles:"width:100%;margin:0 auto;margin-bottom:48px;"},Ve=()=>{const e=(0,p.wA)(),{uniqueName:t}=(0,p.d4)((e=>e.partner)),a=(0,p.d4)((e=>e.sponsor.id)),{timezone:n}=(0,p.d4)((e=>e.sponsor.settings)),{url:i}=(0,o.useRouteMatch)(),l=(0,Fe.YJ)(s.A),r=n||(0,C.Vm)(),d=async n=>{try{var o,c,l;const e=await(0,$e.dK)(a,{name:s.A.t("label.campaign.onsite"),type:u.y4.ONSITE_POPUP,limit:0});(0,Be.Zl)({campaignType:u.y4.ONSITE_POPUP,campaignId:e.id,sponsorId:a,uniqueName:t,site:window.location.hostname}),await(0,$e.ES)(a,e.id,{settings:{Campaigns:{...null===(o=(0,Fe.KU)(n))||void 0===o?void 0:o.settingCampaign,timezone:r},Styles:{messageTemplateId:null===(c=(0,Fe.KU)(n))||void 0===c||null===(l=c.settingStyle)||void 0===l?void 0:l.messageTemplateId}}}),d="".concat(i,"/").concat(e.id,"/edit").concat(a&&"?sponsorId=".concat(a)),window.location.href=d}catch(p){console.error(p),e((0,Ge.C1)("label.save_fail"))}var d};return(0,c.Y)("div",{css:We},l.filter((e=>{let{campaignMessage:t}=e;return t.length>0})).map((e=>{let{campaignGroupType:t,title:a,campaignMessage:n}=e;return(0,c.Y)(je,{key:t,title:a,campaignMessage:n,onClickHandler:e=>d(e)})})))};const Je=()=>(0,c.Y)("div",{css:Qe},(0,c.Y)(Ve,null)),Qe={name:"8atqhb",styles:"width:100%;"};var Ze=a(37639);const Xe=(0,c.AH)("max-width:1200px;",(0,Ne.G1)("xlg"),"{max-width:1330px;}justify-content:start;"),et={name:"xd6z0z",styles:"margin:0 16px;height:96px;"},tt=function(){const e=(0,p.wA)(),t=(0,me.YS)(),{url:a}=(0,o.useRouteMatch)(),i=(0,p.d4)((e=>e.sponsor.id)),{campaignList:l,isFetching:r,currentPage:d,isEnd:m}=(0,p.d4)((e=>e.campaigns)),{loadsUsageData:g}
1=function(e){const[t,a]=(0,n.useState)(!0),[o,i]=(0,n.useState)(null),c=(0,J.A)();return(0,n.useEffect)((()=>{(async()=>{if(e)try{const t=await(0,$e.Rl)(e);i({totalCampaignLoads:t.totalCampaignLoads||0,limit:t.limit,isUnlimited:t.isUnlimited})}catch(n){var t;const e=(null===n||void 0===n||null===(t=n.payload)||void 0===t?void 0:t.message)||(null===n||void 0===n?void 0:n.message);c(n,Ze.A[e]||s.A.t("campaign.fetch_fail"))}finally{a(!1)}else a(!1)})()}),[c,e]),{isFetching:t,loadsUsageData:o}}(i),[h,y]=(0,n.useState)(u.a.TEMPLATE),[A,x]=(0,n.useState)(!1),Y=a.split("/")[3]===u.DO.ONSITE,v=a.split("/")[3]===u.DO.CHAT,f=Y?u.y4.ONSITE_POPUP:a.split("/")[4];(0,n.useEffect)((()=>{e({type:F.s$}),e({type:H.wz}),e((0,F.hU)({page:t?1:void 0,type:u.y4.ONSITE_POPUP}))}),[e,t,i]);const w=(0,n.useMemo)((()=>({viewComp:()=>(0,c.Y)(Te.A,null)})),[]),k=(0,n.useMemo)((()=>({viewComp:()=>(0,c.Y)(Je,null)})),[]),C=(0,n.useMemo)((()=>h===u.a.TEMPLATE?k:h===u.a.PLUGIN?w:{}),[h,k,w]);return(0,c.Y)("div",{css:b.o},(0,c.Y)(M.A,{link:"/admin/campaign?sponsorId=".concat(i),disableLinkText:!0,boxStyle:et},(0,c.Y)(fe,{onOpenPlugInHandler:()=>{x(!0),y(u.a.PLUGIN)},onOpenTemplateHandler:()=>{x(!0),y(u.a.TEMPLATE)},loadsUsageData:g})),0!==l.length||r?(0,c.Y)(se,{sponsorId:i,data:l,isLoading:r,currentPage:d,isEnd:m,campaignType:f,isCampaignOnsite:Y,isCampaignChat:v}):(0,c.Y)(le,{desc:s.A.t("label.campaign.onsite.onboarding_desc")}),(0,c.Y)(Pe.A,{isOpen:A,onCloseHandler:()=>x(!1),viewComp:C.viewComp,title:h===u.a.TEMPLATE&&s.A.t("label.campaign.onsite.view_template"),customBgWrapperStyle:h===u.a.TEMPLATE?Xe:""}))},at=(0,n.lazy)((()=>Promise.all([a.e(5833),a.e(6503),a.e(2159),a.e(516),a.e(577),a.e(8294),a.e(2216),a.e(5605),a.e(583),a.e(3990),a.e(7327),a.e(6729)]).then(a.bind(a,25429)))),nt=(0,n.lazy)((()=>Promise.all([a.e(5833),a.e(7082),a.e(3044),a.e(1219),a.e(9947),a.e(5205)]).then(a.bind(a,95068))));function ot(e){let{location:t,match:a}=e;const n=a.path;return(0,c.Y)(o.Switch,null,(0,c.Y)(o.Route,{exact:!0,path:"".concat(n),component:tt}),(0,c.Y)(o.Route,{path:"".concat(n,"/:campaignId/edit"),component:()=>(0,c.Y)(at,null)}),(0,c.Y)(o.Route,{exact:!0,path:"".concat(n,"/:campaignId/:tab"),component:nt}),(0,c.Y)(o.Redirect,{to:{...t,pathname:a.path}}))}function it(e){let{location:t,match:a}=e;const n=a.path;return(0,c.Y)(o.Switch,null,(0,c.Y)(o.Route,{exact:!0,path:n,component:v}),(0,c.Y)(o.Route,{path:"".concat(n,"/").concat(u.DO.ONSITE),component:ot}),(0,c.Y)(o.Route,{exact:!0,path:"".concat(n,"/").concat(u.DO.CHAT),component:O}),(0,c.Y)(o.Route,{path:"".concat(n,"/").concat(u.DO.CHAT,"/:toolId"),component:Ae}),(0,c.Y)(o.Redirect,{to:{...t,pathname:a.path}}))}},12745:(e,t,a)=>{a.d(t,{o:()=>n});a(14303);const n={name:"1hrqswa",styles:"max-width:1200px;margin:0 auto;"}},74055:(e,t,a)=>{a.d(t,{A:()=>p});a(65043);var n=a(62582),o=a(14303),i=a(4626),s=a(66187),c=a(17339),l=a(95925),r=a(84373),d=a(60637);const p=e=>{let{children:t,variant:a,text:p,link:u,disableLinkText:g=!1,textStyle:h,iconStyle:y,onClick:A,boxStyle:x}=e;const b="function"===typeof A?i.A:n.N_;return(0,o.Y)(i.A,{display:"flex",alignItems:"center",css:x},(0,o.Y)(b,{to:u},(0,o.Y)(c.A,{style:y,onClick:A},(0,o.Y)(l.A,{style:{color:d.P}}))),g?"":p?(0,o.Y)(s.A,{variant:a,css:m,style:h},p):(0,o.Y)(r.A,{variant:"text",height:32,width:180}),t)},m=(0,o.AH)("color:",d.P,";")},43254:(e,t,a)=>{a.d(t,{A:()=>i});a(65043);var n=a(58425),o=a(14303);const i=function(e){let{size:t}=e;return(0,o.Y)(n.A,{size:t})}},48699:(e,t,a)=>{a.d(t,{A:()=>i});a(65043);var n=a(84373),o=a(14303);const i=()=>(0,o.Y)("div",{css:(0,o.AH)(s,"")},(0,o.Y)(n.A,{variant:"rect",height:49,css:(0,o.AH)(c,"")}),(0,o.Y)(n.A,{variant:"rect",height:49,css:(0,o.AH)(c,"")}),(0,o.Y)(n.A,{variant:"rect",height:49,css:(0,o.AH)(c,"")}),(0,o.Y)(n.A,{variant:"rect",height:49,css:(0,o.AH)(c,"")}),(0,o.Y)(n.A,{variant:"rect",height:49,css:(0,o.AH)(c,"")})),s="\n margin: 20px auto;
1\n",c="\n margin: 4px auto;\n"}}]); 2//# sourceMappingURL=campaigns.4803f91e.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.