1"use strict";(self.webpackChunktrf_frontend=self.webpackChunktrf_frontend||[]).push([[5272],{55285(e,t,n){function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},s.apply(null,arguments)}n.d(t,{A:()=>s})},96442(e,t,n){n.d(t,{A:()=>p});var s=n(96540),a=n(28454),o=n(61784),i=n(40364),l=n(11936),r=n(61409),c=n(74848);const d=({onClose:e,myCampaign:t})=>{const n=i.c.CDN_PATH,s=()=>{e(!1)},{mutate:d,isPending:p}=(0,a.n)({mutationFn:()=>(0,l.R1)(t.uid),onError:e=>{r.oR.error(e.message)},onSuccess:()=>{r.oR.success("Application Closed Successfully.");const n=t;n.collaboration_disabled=!0,e(n),e(!0)}});return(0,c.jsxs)(o.A,{show:!0,className:"close-applicant-campaign-modal text-center campaign-modal",onHide:()=>s(),children:[(0,c.jsx)(o.A.Body,{children:(0,c.jsxs)("div",{className:"modal__container",children:[(0,c.jsx)("button",{type:"button",className:"close",onClick:()=>s()}),(0,c.jsx)("img",{className:"action-icon",src:n+"/svg/campaigns/icons/icon-stop.svg",alt:"delete",title:"Delete"}),(0,c.jsx)("h5",{className:"modal-heading",children:"Would you like to close application?"}),(0,c.jsx)("p",{className:"modal-sub-heading",children:"This campaign will be hidden from the Campaign Feed and Creators can no longer apply. You can reopen this campaign again."})]})}),(0,c.jsx)(o.A.Footer,{children:(0,c.jsxs)("div",{className:"leave-review-modal__footer d-flex justify-content-between align-items-center w-100",children:[(0,c.jsx)("button",{type:"button",className:"btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>s(),children:"CANCEL"}),(0,c.jsxs)("button",{type:"button",className:"btn btn-trf-yellow btn-rounded text-uppercase",onClick:()=>{d()},disabled:p,children:["Close Application",p?(0,c.jsx)("span",{children:(0,c.jsx)("i",{className:"ml-2 fa fa-spinner fa-pulse"})}):null]})]})})]})},p=({myCampaign:e,classes:t,onCloseApplicant:n})=>{const[a,o]=(0,s.useState)(!1);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",title:" Close Application",className:null!=t?t:"btn btn-trf-secondary",onClick:()=>{o(!0)},children:"Close Application"}),a&&(0,c.jsx)(d,{onClose:e=>{"boolean"!=typeof e&&n(e),o(!1)},myCampaign:e})]})}},52245(e,t,n){n.d(t,{A:()=>g});var s=n(96540),a=n(28454),o=n(61784),i=n(49785),l=n(40364),r=n(11936),c=n(61409),d=n(26571),p=n(50289),m=n(13838),u=n(74848);const h=({onClose:e,myCampaign:t})=>{const n=l.c.CDN_PATH,s=(0,d.A)(),{handleSubmit:h,register:g,formState:{errors:b}}=(0,i.mN)({mode:"onChange"}),f=()=>{e(!1)},{mutate:y,isPending:x}=(0,a.n)({mutationFn:e=>(0,r.dg)(t.uid,e.remarks),onError:e=>{var t,n;null!=(t=e.response)&&null!=(t=t.data)&&t.message&&c.oR.error(null==(n=e.response)||null==(n=n.data)?void 0:n.message)},onSuccess:async()=>{p.queryClient.invalidateQueries({queryKey:["getPermissions"]}),await s.getUser(),c.oR.success("Campaign closed.");const n=t;n.status="closed",e(n)}});return(0,u.jsx)(o.A,{show:!0,className:"close-campaign-modal text-center campaign-modal",onHide:()=>f(),children:(0,u.jsxs)("form",{onSubmit:h(async e=>{0===Object.keys(b).length&&y(e)}),className:"trf-form",children:[(0,u.jsx)(o.A.Body,{children:(0,u.jsxs)("div",{className:"modal__container",children:[(0,u.jsx)("button",{type:"button",className:"close close-button-modal",onClick:()=>f()}),(0,u.jsx)("img",{className:"action-icon",src:n+"/svg/campaigns/icons/icon-stop.svg",alt:"delete",title:"Delete"}),(0,u.jsx)("h5",{className:"modal-heading",children:"Would you like to close this campaign?"}),(0,u.jsx)("p",{className:"modal-sub-heading",children:"You have active collabs in this campaign, please provide a reason for closing the campaign and our team will approve within 24 hours."}),(0,u.jsxs)("div",{className:"form-group review-form-group "+(b.remarks?"invalid":""),children:[(0,u.jsx)("label",{children:"Provide a reason for why you want to close the campaign *"}),(0,u.jsx)("textarea",Object.assign({},g("remarks",{required:"Reason is required"}),{className:"form-control inner-shadow",id:"remarks"}))]})]})}),(0,u.jsx)(o.A.Footer,{children:(0,u.jsxs)("div",{className:"leave-review-modal__footer d-flex justify-content-between align-items-center w-100",children:[(0,u.jsx)("button",{type:"button",className:"btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>f(),children:"CANCEL"}),(0,u.jsx)(m.$n,{theme:"outline-danger",isLoading:x,disabled:x,type:"submit",children:"CLOSE CAMPAIGN"})]})})]})})},g=({myCampaign:e,classes:t,onClose:n})=>
1{const[a,o]=(0,s.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{type:"button",title:"Close Campaign",className:null!=t?t:"btn text-danger btn-trf-secondary",onClick:()=>{o(!0)},children:"Close Campaign"}),a&&(0,u.jsx)(h,{onClose:e=>{"boolean"!=typeof e&&n(e),o(!1)},myCampaign:e})]})}},6906(e,t,n){n.d(t,{A:()=>u});var s=n(96540),a=n(28454),o=n(61784),i=n(40364),l=n(11936),r=n(61409),c=n(50289),d=n(13838),p=n(74848);const m=({onClose:e,myCampaign:t})=>{const n=i.c.CDN_PATH,s=()=>{e(!1)},{mutate:m,isPending:u}=(0,a.n)({mutationFn:()=>{const e=null!=t&&t.uid?null==t?void 0:t.uid:"";return(0,l.K_)(e)},onError:e=>{r.oR.error(e.message)},onSuccess:()=>{c.queryClient.invalidateQueries({queryKey:["getPermissions"]}),r.oR.success("Successfully deleted."),e(!0)}});return(0,p.jsxs)(o.A,{show:!0,className:"delete-campaign-modal text-center campaign-modal",onHide:()=>s(),children:[(0,p.jsx)(o.A.Body,{children:(0,p.jsxs)("div",{className:"modal__container",children:[(0,p.jsx)("button",{type:"button",className:"close",onClick:()=>s()}),(0,p.jsx)("img",{className:"action-icon",src:n+"/svg/campaigns/icons/icon-trash.svg",alt:"delete",title:"Delete"}),(0,p.jsx)("h5",{className:"modal-heading",children:"Would you like to permanently delete this campaign?"}),(0,p.jsx)("p",{className:"modal-sub-heading",children:"Once deleted, this draft will no longer be accessible."})]})}),(0,p.jsx)(o.A.Footer,{children:(0,p.jsxs)("div",{className:"leave-review-modal__footer d-flex justify-content-between align-items-center w-100",children:[(0,p.jsx)("button",{type:"button",className:"btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>s(),children:"CANCEL"}),(0,p.jsx)(d.$n,{theme:"outline-danger",isLoading:u,disabled:u,onClick:()=>{m()},children:"PERMANENTLY DELETE"})]})})]})},u=({myCampaign:e,classes:t,onDelete:n})=>{const[a,o]=(0,s.useState)(!1);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{type:"button",title:" Delete Campaign",className:null!=t?t:"btn text-danger btn-trf-secondary",onClick:()=>{o(!0)},children:"Delete Campaign"}),a&&(0,p.jsx)(m,{onClose:t=>{if(t&&e){const t=e;t.deleted=!0,n(t)}o(!1)},myCampaign:e})]})}},72958(e,t,n){n.d(t,{A:()=>o});n(96540);var s=n(3433),a=n(74848);const o=({myCampaign:e,classes:t})=>{const n=(0,s.Zp)();return(0,a.jsx)("button",{type:"button",title:"Manage Applicants",className:null!=t?t:"btn btn-trf-secondary",onClick:()=>{n(`/campaign/${e.uid}/application?type=new`)},children:"Manage Applicants"})}},2545(e,t,n){n.d(t,{A:()=>p});var s=n(96540),a=n(28454),o=n(61784),i=n(40364),l=n(11936),r=n(61409),c=n(74848);const d=({onClose:e,myCampaign:t})=>{const n=i.c.CDN_PATH,s=()=>{e(!1)},{mutate:d,isPending:p}=(0,a.n)({mutationFn:()=>(0,l.R1)(t.uid),onError:e=>{r.oR.error(e.message)},onSuccess:()=>{r.oR.success("Application Opened Successfully.");const n=t;n.collaboration_disabled=!1,e(n)}});return(0,c.jsxs)(o.A,{show:!0,className:"open-applicant-campaign-modal text-center campaign-modal",onHide:()=>s(),children:[(0,c.jsx)(o.A.Body,{children:(0,c.jsxs)("div",{className:"modal__container",children:[(0,c.jsx)("button",{type:"button",className:"close",onClick:()=>s()}),(0,c.jsx)("img",{className:"action-icon",src:n+"/svg/campaigns/icons/icon-arrow-squareline-left.svg",alt:"delete",title:"Delete"}),(0,c.jsx)("h5",{className:"modal-heading",children:"Would you like to open applications?"}),(0,c.jsx)("p",{className:"modal-sub-heading",children:"This campaign will be visible in the Campaign Feed and Creators can apply."})]})}),(0,c.jsx)(o.A.Footer,{children:(0,c.jsxs)("div",{className:"leave-review-modal__footer d-flex justify-content-between align-items-center w-100",children:[(0,c.jsx)("button",{type:"button",className:"btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>s(),children:"CANCEL"}),(0,c.jsxs)("button",{type:"button",className:"btn btn-trf-yellow btn-rounded text-uppercase",onClick:()=>{d()},disabled:p,children:["Open Application",p?(0,c.jsx)("span",{children:(0,c.jsx)("i",{className:"ml-2 fa fa-spinner fa-pulse"})}):null]})]})})]})},p=({myCampaign:e,classes:t,onOpenApplicant:n})=>
1{const[a,o]=(0,s.useState)(!1);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",title:"Open Applications",className:null!=t?t:"btn btn-trf-secondary",onClick:()=>{o(!0)},children:"Open Applications"}),a&&(0,c.jsx)(d,{onClose:e=>{"boolean"!=typeof e&&n(e),o(!1)},myCampaign:e})]})}},24981(e,t,n){n.d(t,{A:()=>o});n(96540);var s=n(3433),a=n(74848);const o=({myCampaign:e,classes:t})=>{const n=(0,s.Zp)();return(0,a.jsx)("button",{type:"button",title:"Submit Campaign",className:null!=t?t:"btn btn-rounded mr-2",onClick:()=>{n("/campaign-flow/"+(null==e?void 0:e.uid))},children:"SUBMIT CAMPAIGN"})}},15272(e,t,n){n.d(t,{A:()=>o});n(96540);var s=n(3433),a=n(74848);const o=({myCampaign:e,classes:t})=>{const n=(0,s.Zp)();return(0,a.jsx)("button",{type:"button",title:"View Public Campaign",className:null!=t?t:"btn btn-trf-secondary",onClick:()=>{n("/campaign/"+e.slug)},children:"View Public Campaign"})}},75983(e,t,n){n.d(t,{A:()=>u});var s=n(96540),a=n(28454),o=n(61784),i=n(40364),l=n(11936),r=n(61409),c=n(50289),d=n(13838),p=n(74848);const m=({onClose:e,myCampaign:t})=>{const n=i.c.CDN_PATH,s=()=>{e(!1)},{mutate:m,isPending:u}=(0,a.n)({mutationFn:()=>(0,l.t_)(t.uid,"draft"),onError:e=>{r.oR.error(e.message)},onSuccess:()=>{c.queryClient.invalidateQueries({queryKey:["getPermissions"]}),r.oR.success("Successfully withdrawn.");const n=t;n.status="draft",e(n)}});return(0,p.jsxs)(o.A,{show:!0,className:"withdraw-campaign-modal text-center campaign-modal",onHide:()=>s(),children:[(0,p.jsx)(o.A.Body,{children:(0,p.jsxs)("div",{className:"modal__container",children:[(0,p.jsx)("button",{type:"button",className:"close",onClick:()=>s()}),(0,p.jsx)("img",{className:"action-icon",src:n+"/svg/campaigns/icons/icon-multiply-incircle.svg",alt:"delete",title:"Delete"}),(0,p.jsx)("h5",{className:"modal-heading",children:"Would you like to withdraw this campaign?"}),(0,p.jsx)("p",{className:"modal-sub-heading",children:"Once withdrawn, this campaign will be moved to draft."})]})}),(0,p.jsx)(o.A.Footer,{children:(0,p.jsxs)("div",{className:"leave-review-modal__footer d-flex justify-content-between align-items-center w-100",children:[(0,p.jsx)("button",{type:"button",className:"btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>s(),children:"CANCEL"}),(0,p.jsx)(d.$n,{theme:"outline-danger",isLoading:u,disabled:u,onClick:()=>{m()},children:"WITHDRAW CAMPAIGN"})]})})]})},u=({myCampaign:e,classes:t,onWithdraw:n})=>{const[a,o]=(0,s.useState)(!1);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{type:"button",title:"Withdraw",className:null!=t?t:"btn text-danger btn-trf-secondary",onClick:()=>{o(!0)},children:"Withdraw"}),a&&(0,p.jsx)(m,{onClose:e=>{"boolean"!=typeof e&&n(e),o(!1)},myCampaign:e})]})}},89459(e,t,n){n.d(t,{A:()=>v});var s=n(96540),a=n(95171),o=n(3433),i=n(43795),l=n(53496),r=(n(51446),n(74848));const c=({myCampaign:e})=>{const t=(0,o.Zp)();return(0,r.jsx)("button",{type:"button",title:"Manage Applicants",className:"btn btn-trf-outline-black btn-rounded text-uppercase mr-2",onClick:()=>{"pending"===e.status?t("/campaign/"+e.uid+"/application?type=suggested&keyword="):t("/campaign/"+e.uid+"/application")},children:"Manage Applicants"})};var d=n(24981),p=n(6906),m=n(75983),u=n(52245),h=n(2545),g=n(96442),b=n(15272),f=n(4256);const y=({myCampaign:e,classes:t,onClose:n})=>{const[a,o]=(0,s.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",title:"Duplicate Campaign",className:null!=t?t:"btn btn-trf-secondary",onClick:()=>{o(!0)},children:"Duplicate Campaign"}),(0,r.jsx)(f.K,{show:a,onClickSecondaryAction:()=>o(!1)})]})};var x=n(72958);const v=({myCampaign:e,count:t,onCampaignUpdate:n,isLoading:v})=>{const j=(0,o.Zp)(),[C,w]=(0,s.useState)(!1),_=(0,s.useRef)(null),N=null!=e&&e.created_at?("draft"===e.status?"Started ":"Posted ")+(0,a.A)(new Date(e.created_at))+" ago":"",k=e.title?e.title:"TRF-"+e.id,A=(e,t)=>{"boolean"!=typeof e&&n(e,t)},S=t=>{j(`/campaign/${e.uid}/application?type=${t}&keyword=`)};return(0,r.jsxs)("div",{className:"trf-search-campaigns__item "+(null!=e&&e.deleted?"deleted":""),children:[(0,r.jsxs)("div",{className:"trf-search-campaigns__item__left-box",children:[(0,r.jsx)("button",{className:`btn btn-rounded status-btn open ${e.status}`,children:e.status}),"open"===e.status&&e.collaboration_disabled&&(0,r.jsx)("button",{className:"btn btn-rounded status-btn ml-2 open closed",children:"Not Accepting Application"}),(null==e?void 0:e.campaign_matchie_type)&&(0,r.jsx)("button",{className:"btn btn-rounded status-btn ml-2 open matchie-type-button",children:e.campaign_matchie_type}),(0,r.jsx)("h6",{onClick:()=>{"open"===e.status||"pending"===e.status||"closed"===e.status?j(`/campaign-details/${e.uid}`):w(!0)},children:k}),(0,r.jsx)("div",{className:"date",children:N}),"open"===e.status&&(0,r.jsxs)("div",{className:"trf-search-campaigns__applicants",children:[(0,r.jsxs)("div",{className:"trf-search-campaigns__applicants__count",onClick:()=>{S("new")},children:[!v&&(0,r.jsx)("span",{className:"counter",children:null==t?void 0:t.new}),v&&(0,r.jsx)(l.A,{className:"counter-loader"}),(0,r.jsx)("span",{className:"counter-name",children:"New"})]}),(0,r.jsxs)("div",{className:"trf-search-campaigns__applicants__count",onClick:()=>{S("shortlist")},children:[!v&&(0,r.jsx)("span",{className:"counter",children:null==t?void 0:t.shortlist}),v&&(0,r.jsx)(l.A,{className:"counter-loader"}),(0,r.jsx)("span",{className:"counter-name",children:"Shortlist"})]}),(0,r.jsxs)("div",{className:"trf-search-campaigns__applicants__count",onClick:()=>{S("booked")},children:[!v&&(0,r.jsx)("span",{className:"counter",children:null==t?void 0:t.booked}),v&&(0,r.jsx)(l.A,{className:"counter-loader"}),(0,r.jsx)("span",{className:"counter-name",children:"Booked"})]})]})]}),(0,r.jsxs)("div",{className:"trf-search-campaigns__item__right-box",children:[(0,r.jsxs)("div",{className:"action-btns",children:["draft"===e.status&&(0,r.jsx)(d.A,{myCampaign:e}),"declined"===e.status&&(0,r.jsx)(d.A,{myCampaign:e,classes:"btn btn-trf-outline-black btn-rounded text-uppercase mr-2"}),("open"===e.status||"pending"===e.status)&&(0,r.jsx)(c,{myCampaign:e})]}),(0,r.jsxs)(i.A,{align:"end",children:[(0,r.jsx)(i.A.Toggle,{ref:_,variant:"Info",i
1d:"dropdown-basic",className:"btn btn-rounded btn-toggle",children:(0,r.jsx)("i",{className:"fa fa-ellipsis-v"})}),(0,r.jsxs)(i.A.Menu,{className:"dropdown-menu-left campaigns__toggle__menu",children:["draft"===e.status||"declined"===e.status&&(0,r.jsx)(d.A,{myCampaign:e,classes:"btn btn-trf-secondary mobile-btn"}),"pending"===e.status&&(0,r.jsx)(m.A,{myCampaign:e,onWithdraw:A}),"open"===e.status&&!0===e.collaboration_disabled&&(0,r.jsx)(h.A,{myCampaign:e,onOpenApplicant:A}),"open"===e.status&&(0,r.jsx)(x.A,{myCampaign:e}),"open"===e.status&&(0,r.jsx)(b.A,{myCampaign:e}),(0,r.jsx)(y,{myCampaign:Object.assign({},e,{title:e.title||k}),onClose:(e,t)=>{var n;null==(n=_.current)||n.click(),A(e,t)}}),"open"===e.status&&!1===e.collaboration_disabled&&(0,r.jsx)(g.A,{myCampaign:e,onCloseApplicant:A}),"open"===e.status&&(0,r.jsx)(u.A,{myCampaign:e,onClose:A}),["closed","draft","declined"].includes(e.status)&&(0,r.jsx)(p.A,{myCampaign:e,onDelete:A})]})]})]}),(0,r.jsx)(f.K,{show:C,onClickSecondaryAction:()=>w(!1)})]})}},49319(e,t,n){n.d(t,{e:()=>o});var s=n(28454),a=n(12332);const o=e=>(0,s.n)(Object.assign({},e,{mutationKey:["useGetCampaignListApplicationsCount"],mutationFn:e=>(0,a.p4)(e)}))},11936(e,t,n){n.d(t,{Au:()=>d,BA:()=>c,Di:()=>f,Dl:()=>i,F4:()=>k,GR:()=>_,K_:()=>u,Kr:()=>N,R1:()=>h,SM:()=>C,Tb:()=>v,V3:()=>b,ZK:()=>g,dg:()=>p,gj:()=>r,lg:()=>x,nc:()=>y,o7:()=>o,sq:()=>j,t3:()=>w,t_:()=>m,yL:()=>l});var s=n(55029),a=n(58755);const o=(e,t,n,a=20)=>(0,s.Jt)("/campaign/list?page="+n+"&filter="+e+"&keyword="+t+"&limit="+a),i=(e,t,n,a=20)=>(0,s.Jt)("collabs?page="+n+"&status="+e+"&keyword="+t+"&limit="+a),l=e=>(0,s.Jt)(`/campaign/${e}`),r=(e,t,n,a,o=20)=>(0,s.Jt)(`campaign/${e}/applications?page=`+a+"&filter="+t+"&keyword="+n+"&limit="+o),c=(e,t,n,a=20)=>(0,s.Jt)(`campaign/${e}/invited-applicants-list?page=`+n+"&keyword="+t+"&limit="+a),d=(e,t,n,a=20)=>(0,s.Jt)(`campaign/${e}/talent-recommendations?page=`+n+"&keyword="+t+"&limit="+a),p=(e,t)=>(0,s.bE)(`/campaign/${e}/status-change/closed`,{remarks:t}),m=(e,t)=>(0,s.bE)(`/campaign/${e}/status-change/${t}`,{}),u=e=>(0,s.Wv)(`/campaign/${e}/delete`),h=e=>(0,s.bE)(`/campaign/${e}/toggle-application-disabled`,{}),g=(e,t)=>(0,s.bE)(`/campaign/${e}/application/${t}/shortlist`,{}),b=(e,t)=>(0,s.bE)(`/campaign/${e}/application/${t}/unsuitable`,{}),f=(e,t)=>(0,s.Jt)(`/campaign/application/${t}/`),y=e=>(0,s.Jt)(`/campaign-application/${e}/payment-request`),x=(e,t,n)=>(0,s.bE)(`/campaign-application/${e}/payment-process`,null),v=e=>e.deliverable_quotes.reduce((e,t)=>e+Number(t.quote||0),0),j=e=>{var t;return(null==e||null==(t=e.deliverable_quotes)?void 0:t.reduce((e,t)=>e+Number(t.client_quote||0),0))||0},C=(e,t)=>(0,s.yJ)(`/collaboration/${t}/application/${e}/book`,{}),w=(e,t)=>(0,s.bE)(`/campaign-application/${e}/mark-as-complete`,{deliverable_ids:t}),_=(e,t,n)=>(0,s.bE)(`/campaign/application/${t}/cancel`,{reason:n}),N=(e,t)=>(0,s.bE)(`/campaign/${e}/send-bulk-message`,t),k=(e,t)=>(0,a.F)(`campaign-application/${t}/review`,e)},47068(e,t,n){n.r(t),n.d(t,{default:()=>y});var s=n(96540),a=n(67310),o=n(71468),i=n(3433),l=n(11936),r=n(85383),c=n(89459),d=n(40364),p=n(13838),m=n(87778),u=n(38366),h=n(49319),g=n(4256),b=n(74848);const f=["all","open","draft","pending","declined","closed"],y=()=>{var e;const t=(0,i.Zp)(),n=(0,o.d4)(e=>e.userDetail.data),y=d.c.CDN_PATH,x=(0,s.useRef)(null),[v,j]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!0),[_,N]=(0,s.useState)(!1),[k,A]=(0,s.useState)(),[S,E]=(0,s.useState)(),[T,L]=(0,s.useState)(!1),D=new URLSearchParams(window.location.search),P=D.get("type"),R=D.get("keyword"),O={type:P||"",keyword:R||"",page:S?S.current_page:1},{data:$,isLoading:M}=(0,u.G)(),[F,Y]=(0,s.useState)(O),[H,B]=(0,s.useState)({}),[q,W]=(0,s.useState)(R||""),[U,K]=(0,s.useState)(!1),J=(0,h.e)({onSuccess:e=>{B(t=>Object.assign({},t,e.data))}});(0,s.useEffect)(()=>{(async()=>{w(!0);try{const e=await(0,l.o7)(F?"all"===F.type?"":F.type:"",F?F.keyword:"",F?F.page.toString():"1"),t=e.data,n=t.filter(e=>["open","closed"].includes(e.status)).map(e=>{var t;return(null==(t=e.id)?void 0:t.toString())||""});n.length&&J.mutate(n),A(e=>[...e||[],...t||[]]),E(e.meta)}catch(e){console.error("Error fetching data:",e)}finally{w(!1)}})(),I()},[F]),(0,s.useEffect)(()=>{A([]),E(void 0),I()},[F.keyword,F.type]);const I=()=>{const e=window.location.pathname;if(F){const t=`${e}?type=${F.type}&keyword=${F.keyword}`;window.history.pushState({},"",t)}},G=()=>{A([]),E(void 0),W(""),Y(e=>Object.assign({},e,{keyword:"",page:1}))},Z=(e,t)=>{t?(A([]),E(void 0),Y(e=>Object.assign({},e,{page:1}))):A(t=>(t||[]).map(t=>
1t.id===e.id?e:t))},V=async()=>{K(!0)};return(0,b.jsxs)("div",{className:"trf-my-campaigns",children:[(0,b.jsxs)("div",{className:"trf-my-campaigns__header d-flex justify-content-between align-items-center",children:[(0,b.jsx)("button",{className:"btn btn-rounded back-btn",onClick:()=>{t("/dashboard")},children:(0,b.jsx)("i",{className:"fa fa-angle-left"})}),(0,b.jsx)("h1",{children:"Campaigns"}),(0,b.jsx)("button",{type:"button",title:"post a Campaign",className:"btn btn-trf-yellow btn-rounded text-uppercase",onClick:V,children:"Post a Campaign"})]}),n&&!n.has_campaign&&(0,b.jsx)("div",{className:"trf-my-campaigns__banner",children:(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"col-md-6",children:(0,b.jsxs)("div",{className:"d-flex justify-content-start align-items-center",children:[(0,b.jsx)("img",{className:"mr-4",src:y+"/images/static_pages/dashboard/icons/thunder.svg",alt:"info"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h6",{children:"Get started and post your first campaign"}),(0,b.jsx)("p",{children:"It\u2019s FREE to post a campaign and connect with the right talent, fast."})]})]})}),(0,b.jsx)("div",{className:"col-md-6",children:(0,b.jsx)("div",{className:"d-flex justify-content-end align-items-center",children:(0,b.jsx)("button",{type:"button",title:"post a Campaign",className:"btn-trf-outline-black btn-rounded btn-rounded-new--dark text-uppercase",onClick:V,children:"post a Campaign"})})})]})}),n&&n.has_campaign&&(0,b.jsxs)("div",{className:"trf-my-campaigns__container",children:[(0,b.jsxs)("div",{className:"trf-my-campaigns__filter d-flex justify-content-between align-items-center",children:[(0,b.jsx)("div",{className:"trf-my-campaigns__tabs",children:f.map((e,t)=>(0,b.jsx)("div",{className:"trf-my-campaigns__tabs__tab "+(F.type===e||"all"===e&&""==F.type?"active":""),onClick:()=>{(e=>{A([]),E(void 0),Y(t=>Object.assign({},t,{page:1,type:e}))})(e)},children:e},t))}),(0,b.jsxs)("div",{className:"trf-my-campaigns__filter__search",children:[(0,b.jsxs)("div",{className:"trf-my-campaigns__filter__search__full "+(v?"show":""),children:[(0,b.jsx)("input",{ref:x,type:"search",className:"form-control",placeholder:"Search by Job Title or Job ID",onFocus:()=>{N(!0)},value:q,onChange:e=>{const t=e.target;W(t.value)},onKeyUp:e=>{if("Enter"===e.key){A([]),E(void 0);const t=e.target;Y(e=>Object.assign({},e,{keyword:t.value,page:1}))}}}),(0,b.jsx)("button",{type:"button",className:"btn btn-link btn-search-icon",onClick:()=>{A([]),E(void 0),Y(e=>Object.assign({},e,{keyword:x.current?x.current.value:"",page:1}))},children:(0,b.jsx)("i",{className:"fa fa-search"})}),_&&x.current&&x.current.value.length>0&&(0,b.jsx)("button",{type:"button",className:"btn btn-link btn-clear-icon",onClick:G,children:(0,b.jsx)("i",{className:"fa fa-close"})})]}),!v&&(0,b.jsx)("button",{className:"btn btn-rounded btn-search",onClick:()=>{j(!0)},children:(0,b.jsx)("i",{className:"fa fa-search"})})]})]}),!(null!=$&&null!=(e=$.permissions)&&e.multiple_active_campaign_enabled)&&!M&&(0,b.jsx)("div",{className:"trf-my-campaigns__alert",children:(0,b.jsxs)(p.o5,{weight:"500",children:["Upgrade to PLUS to run multiple active campaigns."," ",(0,b.jsx)(p.Ex,{type:"information",shape:"rounded",className:"trf-my-campaigns__alert__upgrade",leftNode:(0,b.jsx)(m.h,{width:10,height:10}),onClick:()=>L(!0),children:(0,b.jsx)(p.o5,{variant:"small",weight:"500",color:"brand-information",children:"PLUS"})})]})}),(0,b.jsxs)("div",{className:"trf-my-campaigns__content",children:[F.keyword.length>0&&(0,b.jsx)("div",{className:"keyword-block-container",children:(0,b.jsxs)("div",{className:"keyword-block d-flex d-flex justify-content-between align-items-center",children:[(0,b.jsx)("i",{className:"fa fa-search mr-2"})," ",(0,b.jsx)("p",{className:"m-0",children:F.keyword}),(0,b.jsx)("i",{className:"fa fa-close ml-2",onClick:G})]})}),(0,b.jsx)(a.A,{dataLength:k?k.length:0,next:()=>{C||Y(e=>Object.assign({},e,{page:e.page+1}))},style:{overflow:C?"hidden":"inherit"},hasMore:!((!S||S.current_page==S.last_page)&&S),loader:(0,b.jsx)(r.A,{loading:C}),children:k&&k&&k.length>0?k.map(e=>{var t;return(0,b.jsx)(c.A,{myCampaign:e,count:H[(null==(t=e.id)?void 0:t.toString())||""],onCampaignUpdate:Z,isLoading:null==J?void 0:J.isPending},e.uid)}):(0,b.jsx)(b.Fragment,{children:" "})}),!C&&0===(null==k?void 0:k.length)&&(0,b.jsx)("h6",{className:"trf-my-campaigns__no-search-result",children:"We cannot find any match for your search term. Please try again."})]})]}),(0,b.jsx)(p.aS,{show:T,feature:"multiple_active_campaigns",headline:"Run more campaigns with Plus",title:"Run more campaigns with Plus",description:"With PLUS, you can launch up to 5 campaigns at once. Multitasking never looked this good.",primaryActionLabel:"Upgrade to plus",secondaryActionLabel:"Create A Draft",onClickPrimaryAction:()=>t("/subscription"),onClickSecondaryAction:()=>t("/campaign-flow"),onClickOutside:()=>L(!1)}),(0,b.jsx)(g.K,{show:U,onClickSecondaryAction:()=>K(!1)})]})}},67310(e,t,n){n.d(t,{A:()=>p});
1var s=n(96540),a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},a(e,t)};var o=function(){return o=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},o.apply(this,arguments)};var i="Pixel",l="Percent",r={unit:l,value:.8};function c(e){return"number"==typeof e?{unit:l,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:i,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:l,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),r):(console.warn("scrollThreshold should be string or number"),r)}var d=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,s){var a,o=!1,i=0;function l(){a&&clearTimeout(a)}function r(){var r=this,c=Date.now()-i,d=arguments;function p(){i=Date.now(),n.apply(r,d)}o||(s&&!a&&p(),l(),void 0===s&&c>e?p():!0!==t&&(a=setTimeout(s?function(){a=void 0}:p,void 0===s?e-c:e)))}return"boolean"!=typeof t&&(s=n,n=t,t=void 0),r.cancel=function(){l(),o=!0},r}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)
1))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?o(o({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,s=c(t);return s.unit===i?e.scrollTop<=s.value+n-e.scrollHeight+1:e.scrollTop<=s.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,s=c(t);return s.unit===i?e.scrollTop+n>=e.scrollHeight-s.value:e.scrollTop+n>=s.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=o({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),a=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return s.createElement("div",{style:a,className:"infinite-scroll-component__outerdiv"},s.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&s.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},s.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(s.Component);const p=d}}]);
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.