PageSourceSearch

https://www.vefogix.com/_next/static/chunks/88349.33a038982383996c.js

js vefogix.com collected 2026-09-24 09:33:43 UTC 111,448 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88349,6410,23595,71575],{6410:function(e,t,a){a.r(t);var s=a(57437),l=a(29),r=a.n(l),n=a(99551),i=a(83464),o=a(33145),c=a(2265),d=a(75186),u=a(3462),p=a(63253),m=a(76417),g=a(61273),h=a(49089),f=a(32909),x=a(77076),b=a(10353),v=a(99376),y=a(20241),j=a(82189),k=a(22653),w=a(54600),A=a(9583),_=a(80165);t.default=e=>{let{show:t}=e,[a,l]=(0,c.useState)(""),[N,C]=(0,c.useState)(""),[S,T]=(0,c.useState)(""),[F,P]=(0,c.useState)(""),[E,R]=(0,c.useState)(""),[Z,I]=(0,c.useState)(""),[B,U]=(0,c.useState)(""),[M,z]=(0,c.useState)(""),[L,D]=(0,c.useState)([]),[V,W]=(0,c.useState)("us +1"),[J,G]=(0,c.useState)(!1),[H,Y]=(0,c.useState)(""),[O,K]=(0,c.useState)(""),[q,X]=(0,c.useState)("buyer"),[Q,$]=(0,c.useState)(!1),ee=(0,v.useRouter)(),et=(0,v.usePathname)(),ea=[{Icon:p.YZm,link:"https://www.linkedin.com/company/vefogix?trk=public_profile_topcard-current-company",label:"LinkedIn",color:"#0077B5"},{Icon:g.LCd,link:"https://x.com/vefogix",label:"Twitter",color:"#14171A"},{Icon:g.V2E,link:"https://www.youtube.com/@VefoGix",label:"YouTube",color:"#FF0000"},{Icon:m.V6w,link:"https://www.instagram.com/vefogix/",label:"Instagram",color:"#D62976"},{Icon:g.Am9,link:"https://www.facebook.com/people/Vefogix/61572936027890/",label:"Facebook",color:"#1877F2"},{Icon:g.cad,link:"https://www.pinterest.com/VefoGix/",label:"Pinterest",color:"#E60023"},{Icon:g.xpo,link:"https://api.whatsapp.com/send/?phone=18288000589",label:"WhatsApp",color:"#25D366"},{Icon:h.AGi,link:"https://t.me/Vefogix_Ai_Bot",label:"Telegram",color:"#229ED9"},{Icon:f.ARK,link:"https://www.trustpilot.com/review/vefogix.com",label:"Trustpilot",color:"#00B67A"},{img:{gray:y.Z,white:j.Z},link:"https://clutch.co/profile/vefogix-0",label:"Clutch",color:"#e62415"},{img:{gray:k.Z,white:w.Z},link:"https://topfirms.co/company-detail/5269/vefogix",label:"TopFirms",color:"#012140"},{img:{gray:A.Z,white:_.Z},link:"https://www.goodfirms.co/software/vefogix",label:"GoodFirms",color:"#1b66f3"}];(0,c.useEffect)(()=>{(async()=>{try{var e;let t=await i.default.get("".concat(n.BASE_URL,"countrieswithcode/")),a=Array.isArray(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)?t.data.data:[],s=e=>{if(!e)return[];if(Array.isArray(e)){let t=e.flatMap(e=>e?"string"==typeof e?[e]:"number"==typeof e?["+".concat(e)]:"object"==typeof e?[e.country_code,e.countryCode,e.code,e.dial_code,e.dialCode,e.value].filter(e=>"string"==typeof e&&e.trim()):[]:[]).map(e=>e.trim()).map(e=>e.startsWith("+")?e:"+".concat(e.replace(/^\+/,""))).filter(e=>"+"!==e);return Array.from(new Set(t))}if("string"==typeof e){let t=e.trim();return t?[t.startsWith("+")?t:"+".concat(t)]:[]}return[]},l=a.flatMap(e=>{if(!e||(null==e?void 0:e.is_published)===!1)return[];let t=((null==e?void 0:e.name)||"").trim(),a=((null==e?void 0:e.flag)||"").toString().trim(),l=((null==e?void 0:e.country_code)||(null==e?void 0:e.countryCode)||"").toString().trim(),r=s(null==e?void 0:e.country_codes);return t&&0!==r.length?r.map(e=>({label:"".concat(a?"".concat(a," "):"").concat(e).trim(),value:e,searchText:"".concat(t," ").concat(a," ").concat(l," ").concat(e).toLowerCase()})):[]}).filter(e=>"+"!==e.value);D(l)}catch(e){console.error("Error fetching country codes:",e)}})()},[]);let es=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),el=e=>/^[a-zA-Z\s]+$/.test(e)&&""!==e.trim(),er=e=>/^[0-9\s]+$/.test(e)&&""!==e.trim(),en=e=>""!==e.trim(),ei=async e=>{if(e.preventDefault(),!es(S)||!el(a)||!er(N)||!en(F)){d.default.error("Please fix the errors before submitting");return}try{$(!0),await i.default.post("".concat(n.BASE_URL,"contact-form/"),{name:a,email:S,message:"Selected Tab: ".concat(q,", Company Size: ").concat(H,", Goal: ").concat(O,", Message: ").concat(F),phone_number:V+N,marketing_consent:J}),d.default.success("Message Sent Successfully."),l(""),C(""),T(""),P(""),G(!1),t&&ee.push("/thank-you")}catch(e){d.default.error("Error Sending Message.")}finally{$(!1)}};return(0,s.jsxs)("section",{style:{backgroundImage:"url(/images/image1.png)",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},className:"jsx-c14f9b9c8888089d relative w-full min-h-[568px] flex items-center justify-center py-16 px-4 sm:px-6 lg:px-8 overflow-hidden",children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d absolute inset-0 bg-gradient-to-b from-black/40 via-black/30 to-black/40 z-0"}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d container mx-auto max-w-[1440px] grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-20 relative z-10",children:[(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d lg:col-span-5 flex flex-col justify-center space-y-10",children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d",children:(0,s.jsxs)("h2",{className:"jsx-c14f9b9c8888089d text-5xl md:text-6xl font-extrabold text-white leading-[1.1]",children:["Let's get in ",(0,s.jsx)("br",{className:"jsx-c14f9b9c8888089d"})," touch."]})}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-6",children:[(0,s.jsxs)("button",{onClick:()=>X("buyer"),type:"button",className:"jsx-c14f9b9c8888089d "+"\n                                relative flex items-center gap-6 p-1 rounded-[50px] border-2 cursor-pointer transition-all duration-300 h-[100px] overflow-hidden w-full text-left\n                                ".concat("buyer"===q?"border-white bg-white/10 backdrop-blur-sm":"border-gray-600 hover:border-gray-400","\n                            "),children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d relative w-20 h-full ml-2",children:(0,s.jsx)(o.default,{src:"/images/forBuyer.svg",alt:"Buyer",fill:!0,className:"object-contain"})}),(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d flex flex-col text-white",children:(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-2xl font-bold",children:"For Buyer"})})]}),(0,s.jsxs)("button",{onClick:()=>
1X("publishers"),type:"button",className:"jsx-c14f9b9c8888089d "+"\n                                relative flex items-center gap-6 p-1 rounded-[50px] border-2 cursor-pointer transition-all duration-300 h-[100px] overflow-hidden w-full text-left\n                                ".concat("publishers"===q?"border-white bg-white/10 backdrop-blur-sm":"border-gray-600 hover:border-gray-400","\n                            "),children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d relative w-20 h-full ml-2",children:(0,s.jsx)(o.default,{src:"/images/forPublisher.svg",alt:"Publisher",fill:!0,className:"object-contain"})}),(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d flex flex-col text-white",children:(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-2xl font-bold",children:"For Publisher"})})]})]}),"/premium-guest-posting-services/"!==et&&(0,s.jsx)(u.E.div,{className:"flex flex-wrap gap-2 mt-4",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},children:ea.map((e,t)=>(0,s.jsx)(u.E.a,{href:e.link,target:"_blank",rel:"noopener noreferrer","aria-label":e.label,className:"group w-10 h-10 bg-white rounded-full flex items-center justify-center hover:scale-110 transition-transform duration-200 relative overflow-hidden",whileHover:{scale:1.1,backgroundColor:e.color||"#000"},whileTap:{scale:.95},transition:{duration:.2},children:e.img?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d absolute inset-0 flex items-center justify-center opacity-100 group-hover:opacity-0 transition-opacity duration-200",children:(0,s.jsx)(o.default,{src:e.img.gray,alt:e.label,width:20,height:20,className:"object-contain"})}),(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:(0,s.jsx)(o.default,{src:e.img.white,alt:e.label,width:20,height:20,className:"object-contain"})})]}):(0,s.jsx)(e.Icon,{className:"text-black text-lg group-hover:text-white transition-colors duration-200"})},t))})]}),(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d lg:col-span-7 flex flex-col justify-center",children:(0,s.jsxs)("form",{onSubmit:ei,className:"jsx-c14f9b9c8888089d w-full space-y-6",children:[(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"name",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"Your Name"}),(0,s.jsx)("input",{id:"name",type:"text",placeholder:"Name",value:a,onChange:e=>{let t=e.target.value;l(t),I(el(t)?"":"Name should only contain letters")},className:"jsx-c14f9b9c8888089d w-full bg-transparent border border-gray-500 rounded-lg px-4 py-3 text-white placeholder-gray-600 focus:border-white focus:outline-none transition-colors"}),Z&&(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-red-400 text-xs ml-1",children:Z})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"email",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"Your Email"}),(0,s.jsx)("input",{id:"email",type:"email",placeholder:"Email",value:S,onChange:e=>{let t=e.target.value;T(t),R(es(t)?"":"Please enter a valid email address")},className:"jsx-c14f9b9c8888089d w-full bg-transparent border border-gray-500 rounded-lg px-4 py-3 text-white placeholder-gray-600 focus:border-white focus:outline-none transition-colors"}),E&&(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-red-400 text-xs ml-1",children:E})]})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"phone",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"Phone No"}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d flex bg-transparent border border-gray-500 rounded-lg overflow-hidden focus-within:border-white transition-colors",children:[(0,s.jsx)("div",{className:"jsx-c14f9b9c8888089d w-[100px] border-r border-gray-600",children:(0,s.jsx)(x.default,{showSearch:!0,value:V,onChange:W,options:L,filterOption:(e,t)=>((null==t?void 0:t.searchText)||(null==t?void 0:t.label)||"").toString().toLowerCase().includes((e||"").toString().toLowerCase()),popupMatchSelectWidth:!1,bordered:!1,style:{width:"100%",color:"white",height:"46px"},dropdownStyle:{backgroundColor:"#1f1f1f",color:"white"},className:"text-white!important custom-ant-select"})}),(0,s.jsx)("input",{id:"phone",type:"tel",placeholder:"Phone Number",value:N,onChange:e=>{let t=e.target.value;C(t),U(er(t)?"":"Invalid phone number")},className:"jsx-c14f9b9c8888089d flex-1 bg-transparent px-4 py-3 text-white placeholder-gray-600 focus:outline-none"})]}),B&&(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-red-400 text-xs ml-1",children:B})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"companySize",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"Your company size"}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d relative",children:[(0,s.jsxs)("select",{id:"companySize",value:H,onChange:e=>Y(e.target.value),className:"jsx-c14f9b9c8888089d w-full bg-transparent border border-gray-500 rounded-lg px-4 py-3 text-white appearance-none focus:border-white focus:outline-none transition-colors cursor-pointer",children:[(0,s.jsx)("option",{value:"",className:"jsx-c14f9b9c8888089d bg-black text-gray-500",children:"Size"}),["1-49","50-99","100-249","250-999","1000+"].map(e=>(0,s.jsx)("option",{value:e,className:"jsx-c14f9b9c8888089d bg-black text-white",children:e},e))]}),(0,s.jsx)("div",{"aria-hidden":"true",className:"jsx-c14f9b9c8888089d absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-gray-400",children:"▼"})]})]})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"goal",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"buyer"===q?"What are your goals as a buyer?":"What are your goals as a publisher?"}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d relative",children:[(0,s.jsxs)("select",{id:"goal",value:O,onChange:e=>K(e.target.value),className:"jsx-c14f9b9c8888089d w-full bg-transparent border border-gray-500 rounded-lg px-4 py-3 text-white appearance-none focus:border-white focus:outline-none transition-colors cursor-pointer",children:[(0,s.jsx)("option",{value:"",className:"jsx-c14f9b9c8888089d bg-black text-gray-500",children:"Select Your Goal"}),("buyer"===q?["Grow backlink profile for your company/site","Reach higher SERP positions","Build links for clients","Grow brand awareness","Get more pages indexed","Other"]:["Earn by placing or writing & placing content on my site(s)","Earn by placing or writing & placing content on third-party sites","Get more content for my/clients' sites","Other"]).map(e=>(0,s.jsx)("option",{value:e,className:"jsx-c14f9b9c8888089d bg-black text-white",children:e},e))]}),(0,s.jsx)("div",{"aria-hidden":"true",className:"jsx-c14f9b9c8888089d absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-gray-400",children:"▼"})]})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d space-y-2",children:[(0,s.jsx)("label",{htmlFor:"message",className:"jsx-c14f9b9c8888089d text-sm text-gray-300 ml-1",children:"Message"}),(0,s.jsx)("textarea",{id:"message",value:F,onChange:e=>{let t=e.target.value;P(t),z(en(t)?"":"Message cannot be empty")},placeholder:"Message",rows:4,className:"jsx-c14f9b9c8888089d w-full bg-transparent border border-gray-500 rounded-lg px-4 py-3 text-white placeholder-gray-600 focus:border-white focus:outline-none transition-colors resize-none"}),M&&(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-red-400 text-xs ml-1",children:M})]}),(0,s.jsxs)("label",{htmlFor:"contact_marketing_consent",className:"jsx-c14f9b9c8888089d flex cursor-pointer items-start gap-2.5 pt-2 text-xs text-gray-400",children:[(0,s.jsx)("input",{id:"contact_marketing_consent",name:"marketing_consent",type:"checkbox",checked:J,onChange:e=>G(e.target.checked),className:"jsx-c14f9b9c8888089d mt-0.5 h-4 w-4 flex-shrink-0 cursor-pointer rounded border-gray-500 bg-transparent text-[#1877F2] focus:ring-2 focus:ring-[#1877F2]"}),(0,s.jsxs)("span",{className:"jsx-c14f9b9c8888089d leading-snug",children:["I agree to re
1ceive marketing emails, updates, and promotional communications from Vefogix."," ",(0,s.jsx)("span",{className:"jsx-c14f9b9c8888089d text-gray-500",children:"(Optional)"})]})]}),(0,s.jsxs)("div",{className:"jsx-c14f9b9c8888089d flex flex-col md:flex-row items-center justify-between gap-4 pt-2",children:[(0,s.jsxs)("p",{className:"jsx-c14f9b9c8888089d text-xs text-gray-400 text-center md:text-left max-w-md",children:["By submitting your message you agree to our",(0,s.jsx)("a",{href:"/terms-and-conditions/",className:"jsx-c14f9b9c8888089d text-blue-400 hover:text-blue-300 ml-1",children:"Terms and Conditions"})," and",(0,s.jsx)("a",{href:"/privacy-policy/",className:"jsx-c14f9b9c8888089d text-blue-400 hover:text-blue-300 ml-1",children:"Privacy Policy"})]}),(0,s.jsx)("button",{type:"submit",disabled:Q||!!(E||Z||B||M),className:"jsx-c14f9b9c8888089d bg-[#1877F2] hover:bg-blue-600 text-white font-semibold px-10 py-3 rounded-lg transition-all transform active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-blue-900/50",children:Q?(0,s.jsx)(b.Z,{size:"small"}):"Submit"})]})]})})]}),(0,s.jsx)(r(),{id:"c14f9b9c8888089d",children:".custom-ant-select .ant-select-selector{background-color:transparent!important;border:none!important;color:white!important;height:100%!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.custom-ant-select .ant-select-arrow{color:#9ca3af!important}.custom-ant-select .ant-select-selection-item{color:white!important}.ant-select-dropdown{background-color:#1f1f1f!important}.ant-select-item{color:white!important}.ant-select-item-option-selected{background-color:#1890ff!important}.ant-select-item-option-active{background-color:#2c2c2c!important}"})]})}},98288:function(e,t,a){var s=a(57437),l=a(29),r=a.n(l),n=a(2265),i=a(46938),o=a(94725),c=a(17213),d=a(79006),u=a(78302),p=a(76879),m=a(84110),g=a(36750),h=a(67966),f=a(65318),x=a(54816),b=a(63676),v=a(5172),y=a(78234),j=a(71190),k=a(24475),w=a(13694),A=a(70570),_=a(77076),N=a(99981),C=a(5545),S=a(23496),T=a(79326),F=a(84519),P=a(29747),E=a(7586),R=a(28645),Z=a(81328),I=a(19680),B=a(17494),U=a(31734),M=a(58310),z=a(17881),L=a(98335),D=a(53113),V=a(12805),W=a(6387),J=a(77838),G=a(1759),H=a(18930),Y=a(82029),O=a(72613),K=a(75965),q=a(44353);let{Option:X}=_.default,Q=x.ZP.extend({addAttributes(){var e;let{rel:t,...a}=(null===(e=this.parent)||void 0===e?void 0:e.call(this))||{};return{...a,href:{default:null},target:{default:"_blank",parseHTML:e=>e.getAttribute("target")||"_blank",renderHTML:e=>({target:e.target})}}},renderHTML(e){let{HTMLAttributes:t}=e,{rel:a,...s}=t;return["a",s,0]}}).configure({openOnClick:!1,HTMLAttributes:{class:"doc-link"}}),$=new c.H$("greyNicheHighlight");t.Z=e=>{var t;let{content:a,setContent:l,onInit:x,readOnly:ee=!1,showToolbar:et=!0,greyNicheKeywords:ea=[],autoHeight:es=!1}=e,el=(0,n.useRef)(ea),er=(0,i.jE)({extensions:[u.Z,w.pn,A.Z,k.I,y.Z,j.ZP.configure({multicolor:!0}),Q,b.ZP.configure({allowBase64:!0}),p.iA.configure({resizable:!0}),m.Z,h.Z,g.Z,f.Z.configure({types:["heading","paragraph"]}),v.Z.configure({placeholder:"Write content here..."}),o.hj.create({name:"greyNicheHighlight",addProseMirrorPlugins:()=>[new c.Sy({key:$,state:{init:()=>d.EH.empty,apply(e,t){var a;let s=null!==(a=e.getMeta($))&&void 0!==a?a:null;if(null===s)return e.docChanged?t.map(e.mapping,e.doc):t;if(0===s.length)return d.EH.empty;let l=[];return e.doc.descendants((e,t)=>{if(!e.isText||!e.text)return;let a=e.text.toLowerCase();for(let e of s){let s;let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=RegExp("(?<![a-z0-9])".concat(r,"(?![a-z0-9])"),"gi");for(;null!==(s=n.exec(a));)l.push(d.p.inline(t+s.index,t+s.index+s[0].length,{class:"grey-niche-highlight"}))}}),d.EH.create(e.doc,l)}},props:{decorations:e=>$.getState(e)}})]})],content:a||"",editable:!ee,immediatelyRender:!1,onUpdate:e=>{let{editor:t}=e,a=t.getHTML();console.log("Tiptap HTML snippet:",a.slice(0,500)),l(a)}});if((0,n.useEffect)(()=>{er&&x&&x(er)},[er,x]),(0,n.useEffect)(()=>
1{if(!er)return;let e=er.getHTML();(""!==a||"<p></p>"!==e)&&a!==e&&er.commands.setContent(a||"")},[a,er]),(0,n.useEffect)(()=>{if(el.current=ea,!er)return;let{state:e,dispatch:t}=er.view;t(e.tr.setMeta($,ea))},[ea,er]),!er)return(0,s.jsx)("div",{className:"h-[400px] border-2 rounded-xl flex items-center justify-center bg-gray-50 text-gray-400",children:"Loading editor..."});let en=[{label:"Sans Serif",value:"Inter, sans-serif"},{label:"Serif",value:"serif"},{label:"Monospace",value:"monospace"},{label:"Cursive",value:"cursive"}],ei=["#000000","#444444","#666666","#999999","#cccccc","#eeeeee","#f3f3f3","#ffffff","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#0000ff","#9900ff","#ff00ff","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"];return(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 w-full border-2 rounded-xl overflow-hidden bg-white shadow-sm border-gray-100 flex flex-col",children:[et&&(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex flex-wrap items-center gap-1 p-2 border-b bg-gray-50/50 min-h-[50px]",children:[(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1 mr-2",children:[(0,s.jsx)(N.Z,{title:"Heading 1",children:(0,s.jsx)(C.ZP,{type:er.isActive("heading",{level:1})?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleHeading({level:1}).run(),icon:(0,s.jsx)(F.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Heading 2",children:(0,s.jsx)(C.ZP,{type:er.isActive("heading",{level:2})?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleHeading({level:2}).run(),icon:(0,s.jsx)(P.Z,{size:16})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsx)(_.default,{size:"small",style:{width:120},placeholder:"Font",value:(null===(t=en.find(e=>er.isActive("textStyle",{fontFamily:e.value})))||void 0===t?void 0:t.value)||"Inter, sans-serif",onChange:e=>er.chain().focus().setFontFamily(e).run(),children:en.map(e=>(0,s.jsx)(X,{value:e.value,children:e.label},e.value))}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(N.Z,{title:"Bullet List",children:(0,s.jsx)(C.ZP,{type:er.isActive("bulletList")?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleBulletList().run(),icon:(0,s.jsx)(E.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Ordered List",children:(0,s.jsx)(C.ZP,{type:er.isActive("orderedList")?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleOrderedList().run(),icon:(0,s.jsx)(R.Z,{size:16})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(N.Z,{title:"Bold",children:(0,s.jsx)(C.ZP,{type:er.isActive("bold")?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleBold().run(),icon:(0,s.jsx)(Z.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Italic",children:(0,s.jsx)(C.ZP,{type:er.isActive("italic")?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleItalic().run(),icon:(0,s.jsx)(I.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Underline",children:(0,s.jsx)(C.ZP,{type:er.isActive("underline")?"primary":"text",size:"small",onClick:()=>er.chain().focus().toggleUnderline().run(),icon:(0,s.jsx)(B.Z,{size:16})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(N.Z,{title:"Align Left",children:(0,s.jsx)(C.ZP,{type:er.isActive({textAlign:"left"})?"primary":"text",size:"small",onClick:()=>er.chain().focus().setTextAlign("left").run(),icon:(0,s.jsx)(U.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Align Center",children:(0,s.jsx)(C.ZP,{type:er.isActive({textAlign:"center"})?"primary":"text",size:"small",onClick:()=>er.chain().focus().setTextAlign("center").run(),icon:(0,s.jsx)(M.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Align Right",children:(0,s.jsx)(C.ZP,{type:er.isActive({textAlign:"right"})?"primary":"text",size:"small",onClick:()=>er.chain().focus().setTextAlign("right").run(),icon:(0,s.jsx)(z.Z,{size:16})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(N.Z,{title:"Add Link",children:(0,s.jsx)(C.ZP,{type:er.isActive("link")?"primary":"text",size:"small",onClick:()=>{let e=window.prompt("URL");e&&er.chain().focus().setLink({href:e}).run()},icon:(0,s.jsx)(L.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Image",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",onClick:()=>{let e=window.prompt("Image URL");e&&er.chain().focus().setImage({src:e}).run()},icon:(0,s.jsx)(D.Z,{size:16})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(T.Z,{title:"Text Color",content:(0,s.jsx)("div",{className:"jsx-f228d096ec691338 grid grid-cols-8 gap-1",children:ei.map(e=>(0,s.jsx)("div",{style:{backgroundColor:e},onClick:()=>er.chain().focus().setColor(e).run(),className:"jsx-f228d096ec691338 w-5 h-5 cursor-pointer rounded border border-gray-200"},e))}),trigger:"click",children:(0,s.jsx)(N.Z,{title:"Text Color",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",icon:(0,s.jsx)(V.Z,{size:16})})})}),(0,s.jsx)(T.Z,{title:"Highlight Color",content:(0,s.jsx)("div",{className:"jsx-f228d096ec691338 grid grid-cols-8 gap-1",children:ei.map(e=>(0,s.jsx)("div",{style:{backgroundColor:e},onClick:()=>er.chain().focus().setHighlight({color:e}).run(),className:"jsx-f228d096ec691338 w-5 h-5 cursor-pointer rounded border border-gray-200"},e))}),trigger:"click",children:(0,s.jsx)(N.Z,{title:"Highlight Color",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",icon:(0,s.jsx)(W.Z,{size:16})})})})]}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsx)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:(0,s.jsx)(T.Z,{title:"Table Operations",content:(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex flex-col space-y-2",children:[(0,s.jsx)(C.ZP,{block:!0,size:"small",onClick:()=>er.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:"Insert Table"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex space-x-2",children:[(0,s.jsx)(C.ZP,{size:"small",icon:(0,s.jsx)(J.Z,{size:14}),onClick:()=>er.chain().focus().addRowAfter().run(),children:"Row"}),(0,s.jsx)(C.ZP,{size:"small",icon:(0,s.jsx)(J.Z,{size:14}),onClick:()=>er.chain().focus().addColumnAfter().run(),children:"Col"})]}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex space-x-2",children:[(0,s.jsx)(C.ZP,{size:"small",danger:!0,icon:(0,s.jsx)(G.Z,{size:14}),onClick:()=>er.chain().focus().deleteRow().run(),children:"Row"}),(0,s.jsx)(C.ZP,{size:"small",danger:!0,icon:(0,s.jsx)(G.Z,{size:14}),onClick:()=>er.chain().focus().deleteColumn().run(),children:"Col"})]}),(0,s.jsx)(C.ZP,{block:!0,danger:!0,size:"small",icon:(0,s.jsx)(H.Z,{size:14}),onClick:()=>er.chain().focus().deleteTable().run(),children:"Delete Table"})]}),trigger:"click",children:(0,s.jsx)(N.Z,{title:"Table Tools",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",icon:(0,s.jsx)(Y.Z,{size:16})})})})}),(0,s.jsx)(S.Z,{type:"vertical"}),(0,s.jsxs)("div",{className:"jsx-f228d096ec691338 flex items-center space-x-1",children:[(0,s.jsx)(N.Z,{title:"Clear Formatting",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",onClick:()=>er.chain().focus().unsetAllMarks().clearNodes().run(),icon:(0,s.jsx)(O.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Undo",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",onClick:()=>
1er.chain().focus().undo().run(),disabled:!er.can().undo(),icon:(0,s.jsx)(K.Z,{size:16})})}),(0,s.jsx)(N.Z,{title:"Redo",children:(0,s.jsx)(C.ZP,{type:"text",size:"small",onClick:()=>er.chain().focus().redo().run(),disabled:!er.can().redo(),icon:(0,s.jsx)(q.Z,{size:16})})})]})]}),(0,s.jsx)("div",{style:es?{width:"100%"}:{width:"100%",height:"400px"},className:"jsx-f228d096ec691338 "+((es?"p-4 outline-none min-h-[400px]":"p-4 outline-none overflow-y-auto min-h-[400px] flex-grow")||""),children:(0,s.jsx)(i.kg,{editor:er})}),(0,s.jsx)(r(),{id:"f228d096ec691338",children:".ProseMirror{min-height:100%;outline:none;line-height:1.6}.ProseMirror h1{font-size:1.875rem;line-height:2.25rem;font-weight:700;margin:0 0 .75rem}.ProseMirror h2{font-size:1.5rem;line-height:2rem;font-weight:600;margin:1.25rem 0 .5rem}.ProseMirror p{margin:0 0 .75rem;text-align:justify}.ProseMirror img{max-width:100%;height:auto;display:block;margin:1rem auto}.ProseMirror a,.ProseMirror .doc-link{color:#2563eb;text-decoration:underline}.ProseMirror a:hover,.ProseMirror .doc-link:hover{color:#1d4ed8}.ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;overflow:hidden}.ProseMirror table td,.ProseMirror table th{min-width:1em;border:1px solid#ced4da;padding:3px 5px;vertical-align:top;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}.ProseMirror table th{font-weight:bold;text-align:left;background-color:#f8f9fa}.ProseMirror ul,.ProseMirror ol{padding-left:1.5rem;margin-bottom:1rem}.ProseMirror ul{list-style-type:disc}.ProseMirror ol{list-style-type:decimal}.grey-niche-highlight{background-color:#fca5a5;color:#7f1d1d;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;padding:0 1px;font-weight:600}"})]})}},88349:function(e,t,a){a.r(t);var s=a(57437),l=a(71575),r=a(42056),n=a(99551),i=a(53154),o=a(42264),c=a(50337),d=a(63134),u=a(79326),p=a(1829),m=a(867),g=a(28297),h=a(81382),f=a(40908),x=a.n(f);a(57074);var b=a(83464),v=a(55710),y=a(3462),j=a(64131),k=a(51817),w=a(33145),A=a(27648),_=a(99376),N=a(2265),C=a(75186),S=a(63400),T=a(63253),F=a(49089),P=a(32768),E=a(22744),R=a(84154),Z=a(32909),I=a(16534),B=a(98288),U=a(6410),M=a(75017),z=a(23595);t.default=()=>{var e,t,a,f,L,D,V,W,J,G,H,Y,O,K,q,X,Q,$,ee,et,ea;let{publisher_Tasks:es}=(0,l.G)(),{isPublisher:el,currentRole:er}=(0,r.$)(),{userdata:en}=(0,z.U)(),ei=(0,_.useRouter)();(0,N.useEffect)(()=>{if(!j.default.get("login_access_token")){C.default.error("You need to log in first."),ei.push("/signin");return}},[ei]);let[eo,ec]=(0,N.useState)(!1),[ed,eu]=(0,N.useState)(""),[ep,em]=(0,N.useState)(!1),[eg,eh]=(0,N.useState)(),[ef,ex]=(0,N.useState)(!1),[eb,ev]=(0,N.useState)(),[ey,ej]=(0,N.useState)(""),[ek,ew]=(0,N.useState)(!1),{messages:eA,messageCount:e_,loading:eN,sending:eC,sendMessage:eS}=(0,i.Ac)(ed),[eT,eF]=(0,N.useState)(!1),[eP,eE]=(0,N.useState)(!1),[eR,eZ]=(0,N.useState)(!1),[eI,eB]=(0,N.useState)(!1),[eU,eM]=(0,N.useState)(!0),[ez,eL]=(0,N.useState)(""),[eD,eV]=(0,N.useState)(!0),[eW,eJ]=(0,N.useState)(""),[eG,eH]=(0,N.useState)(""),[eY,eO]=(0,N.useState)(!1),[eK,eq]=(0,N.useState)(!1),[eX,eQ]=(0,N.useState)(null),[e$,e0]=(0,N.useState)(null),[e1,e8]=(0,N.useState)(null),[e9,e2]=(0,N.useState)(!1),[e4,e5]=(0,N.useState)(!1),[e6,e3]=(0,N.useState)(""),[e7,te]=(0,N.useState)(!1),[tt,ta]=(0,N.useState)(!1),ts=(((null==en?void 0:en.email)==="[email protected]"||(null==en?void 0:en.id)===3872)&&(null==eg?void 0:eg.is_pr)||((null==en?void 0:en.email)==="[email protected]"||(null==en?void 0:en.id)===8)&&!(null==eg?void 0:eg.is_pr))&&eg&&((null==eg?void 0:null===(e=eg.task_status)||void 0===e?void 0:e.title)==="Not Started"||(null==eg?void 0:null===(t=eg.task_status)||void 0===t?void 0:t.title)==="In Progress")&&(!(null==eg?void 0:eg.post_url)||(null==eg?void 0:eg.post_url)===null||(null==eg?void 0:eg.post_url)===""||(null==eg?void 0:eg.post_url)==="N/A"),tl=e9||e7||(null==eg?void 0:null===(a=eg.task_additional_info)||void 0===a?void 0:a.response_json)!==null&&(null==eg?void 0:null===(f=eg.task_additional_info)||void 0===f?void 0:f.response_json)!==void 0,tr=(null==eg?void 0:null===(L=eg.task_additional_info)||void 0===L?void 0:L.response_message)||(null==eg?void 0:null===(D=eg.additional_info)||void 0===D?void 0:D.response_message)||(null==eg?void 0:eg.response_message)||null;(0,N.useEffect)(()=>{eg&&e0(eg)},[eg]);let tn=async()=>{try{e8(eX);let e=j.default.get("login_access_token");if(!e){o.ZP.error("You need to log in first.");return}await b.default.post("".concat(n.BASE_URL,"post-url-status-checker/"),{task_id:eX},{headers:{Authorization:"Bearer ".concat(e)}}),o.ZP.success("Re-check triggered successfully!"),ed&&await ty(ed)}catch(e){console.error("API Error:",e.response||e),o.ZP.error("Failed to trigger re-check.")}finally{eq(!1),eQ(null)}},[ti,to]=(0,N.useState)({sendingMessage:!1,acceptingTask:!1,rejectingTask:!1,sendingForApproval:!1,completingTask:!1,sendingForImprovement:!1,sendingForFinalApproval:!1,updatingPostUrl:!1,sendingAwaiting:!1}),tc=(0,N.useRef)(null),td=(0,N.useRef)(null),tu=(0,N.useCallback)((e,t)=>{to(a=>({...a,[e]:t}))},[]);(0,N.useEffect)(()=>{x().init({}),eZ(!0);let e=new URLSearchParams(window.location.search).get("uid");e&&eu(e)},[]),(0,N.useEffect)(()=>{eM("publisher"===(localStorage.getItem("currentUserRole")||"buyer"))},[el]);let tp=(0,N.useCallback)(e=>/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{1,20}(:[0-9]{1,5})?(\/.*)?$/i.test(e),[]);(0,N.useEffect)(()=>{(null==eg?void 0:eg.post_url)&&eL(eg.post_url)},[eg]),(0,N.useEffect)(()=>{eV(tp(ez))},[ez,tp]),(0,N.useEffect)(()=>{ek?eE(!0):eE(!1)},[ek]),(0,N.useEffect)(()=>
1{if(eP){let e=setTimeout(()=>{var e;null===(e=td.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},0);return()=>clearTimeout(e)}},[eP,eA]);let tm=(0,N.useCallback)(e=>{ej(e.target.value)},[]),tg=(0,N.useCallback)(e=>{eL(e.target.value||"")},[]),th=(0,N.useCallback)(()=>{eO(!0)},[]),tf=(0,N.useCallback)(()=>{eO(!1)},[]),tx=(0,N.useCallback)(()=>{ew(!0)},[]),tb=(0,N.useCallback)(()=>{ex(!0)},[]),tv=(0,N.useCallback)(()=>{ex(!1)},[]),ty=(0,N.useCallback)(async e=>{if(!e)return;eZ(!0);let t=j.default.get("login_access_token");try{let a=await b.default.post("".concat(n.BASE_URL,"my-tasks/task_detail/"),{uid:e,is_publisher:eU},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(a.data)}catch(t){var a,s,l,r,i,o;console.error("Failed to fetch task details:",t);let e=localStorage.getItem("currentUserRole")||"buyer";if((null==t?void 0:null===(a=t.response)||void 0===a?void 0:a.status)===403){C.default.error("Access denied. This task doesn't belong to you."),ei.push("buyer"===e?"/buyer-orders":"/publisher-guestpost-tasks");return}if((null==t?void 0:null===(s=t.response)||void 0===s?void 0:s.status)===404){C.default.error("Task not found. It may have been deleted or doesn't exist."),ei.push("buyer"===e?"/buyer-orders":"/publisher-guestpost-tasks");return}if(null==t?void 0:null===(r=t.response)||void 0===r?void 0:null===(l=r.data)||void 0===l?void 0:l.error){C.default.error(null==t?void 0:null===(o=t.response)||void 0===o?void 0:null===(i=o.data)||void 0===i?void 0:i.error),ei.push("buyer"===e?"/buyer-orders":"/publisher-guestpost-tasks");return}C.default.error("Failed to load task details"),ei.push("buyer"===e?"/buyer-orders":"/publisher-guestpost-tasks")}finally{eZ(!1)}},[eU,ei]),tj=(0,N.useCallback)(async()=>{if(!ey.trim()||eC)return;let e=(null==eg?void 0:eg.task_type)==="pr_p"?"pr_p":"gp";await eS(ey,e)?(C.default.success("Message sent successfully"),ej("")):C.default.error("Failed to send message")},[ey,null==eg?void 0:eg.task_type,eC,eS]),tk=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.acceptingTask)return;if(!tt){C.default.error("Please accept the Publisher Task Acceptance Agreement to continue.");return}tu("acceptingTask",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"2deed0bc-c233-43e2-ab11-70dfd5f164c9",task_type:null==eg?void 0:eg.task_type},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});ec(!1),ta(!1),eh(t=>{var a;return{...t,task_status:null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.task_status}}),C.default.success("The task has been sent in progress.")}catch(e){console.error("Failed to accept task:",e),C.default.error("Failed to accept task")}finally{tu("acceptingTask",!1)}},[ed,null==eg?void 0:eg.task_type,ti.acceptingTask,tt,tu]),tw=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.updatingPostUrl||!eD)return;tu("updatingPostUrl",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{task_type:null==eg?void 0:eg.task_type,post_url:ez},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(t=>{var a;return{...t,post_url:null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.post_url}}),C.default.success("Post Placement URL has been updated")}catch(e){console.error("Failed to send for approval:",e),C.default.error("Failed to update Post Placement URL")}finally{tu("updatingPostUrl",!1)}},[ed,null==eg?void 0:eg.task_type,ez,eD,ti.updatingPostUrl,tu]),tA=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.sendingForApproval||!eD)return;tu("sendingForApproval",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"fc1e5d23-68a7-4755-bf6b-d4ebbdcacb0a",task_type:null==eg?void 0:eg.task_type,post_url:ez},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(e.data),C.default.success("The task has been sent for approval")}catch(e){console.error("Failed to send for approval:",e),C.default.error("Failed to send for approval")}finally{tu("sendingForApproval",!1)}},[ed,null==eg?void 0:eg.task_type,ez,eD,ti.sendingForApproval,tu]),t_=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.updatingPostUrl||!eD)return;tu("updatingPostUrl",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"2e771c7d-cfe1-4ef2-9769-a37cea2f02aa",task_type:null==eg?void 0:eg.task_type,post_url:ez},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});
1eh(e.data),tf(),C.default.success("The Post Url has been Updated")}catch(e){console.error("Failed to update post URL:",e),C.default.error("Failed to update post URL")}finally{tu("updatingPostUrl",!1)}},[ed,null==eg?void 0:eg.task_type,ez,eD,ti.updatingPostUrl,tu,tf]),tN=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.completingTask)return;tu("completingTask",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"eadb51a1-3433-4a70-89ce-bbfcb2d5ab1d",task_type:null==eg?void 0:eg.task_type},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(e.data),C.default.success("The task has been completed")}catch(e){console.error("Failed to complete task:",e),C.default.error("Failed to complete task")}finally{tu("completingTask",!1)}},[ed,null==eg?void 0:eg.task_type,ti.completingTask,tu]),tC=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.sendingForImprovement)return;if(!(null==eG?void 0:eG.trim())){C.default.error("Please enter a reason for improvement");return}tu("sendingForImprovement",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"2e771c7d-cfe1-4ef2-9769-a37cea2f02aa",improvement_text:eG,task_type:null==eg?void 0:eg.task_type},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(e.data),C.default.success("The task has been sent for improvement")}catch(e){console.error("Failed to send for improvement:",e),C.default.error("Failed to send for improvement")}finally{tu("sendingForImprovement",!1)}},[ed,null==eg?void 0:eg.task_type,eG,ti.sendingForImprovement,tu]),tS=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.sendingForFinalApproval)return;tu("sendingForFinalApproval",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"97cb629b-d405-4a84-9fcb-07b933c3754b",task_type:null==eg?void 0:eg.task_type},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(e.data),C.default.success("The task has been sent for final approval")}catch(e){console.error("Failed to send for final approval:",e),C.default.error("Failed to send for final approval")}finally{tu("sendingForFinalApproval",!1)}},[ed,null==eg?void 0:eg.task_type,ti.sendingForFinalApproval,tu]),tT=()=>{try{for(let e of["profile_id","userProfileId","userId","user_id","currentUserId"]){let t=localStorage.getItem(e);if(t){let e=parseInt(t,10);if(!isNaN(e))return e}}let e=localStorage.getItem("userProfile");if(e)try{let t=JSON.parse(e);if(null==t?void 0:t.id){let e=parseInt(t.id,10);if(!isNaN(e))return e}}catch(e){console.warn("⚠️ [BuyerTaskView] Error parsing userProfile from localStorage:",e)}console.warn("⚠️ [BuyerTaskView] No profile_id found in localStorage, checking all localStorage items:");for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);localStorage.getItem(t)}return null}catch(e){return console.error("❌ [BuyerTaskView] Error getting user_id from localStorage:",e),null}},tF=(0,N.useCallback)(async e=>{if(e.preventDefault(),ti.rejectingTask)return;if(!(null==eW?void 0:eW.trim())){C.default.error("Please enter a reason for cancellation");return}tu("rejectingTask",!0);let t=j.default.get("login_access_token");try{let e=await b.default.put("".concat(n.BASE_URL,"my-tasks/").concat(ed,"/"),{taskstatus:"7bb73c4e-fbee-4e37-b039-4877fdad6f43",rejection_reason:eW,task_type:null==eg?void 0:eg.task_type},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});eh(e.data),C.default.success("The task has been cancelled");let a=tT();if(eg){let e={task_id:eg.uid,order_id:eg.uid,user_id:a||eg.buyer_id||eg.user_id,buyer_id:eg.buyer_id,amount:eU?eg.publisher_amount:eg.buyer_amount,task_amount:eU?eg.publisher_amount:eg.buyer_amount,publisher_name:eg.publisher_name,publisher_site:eg.publishersite_domain,publisher_site_id:eg.publishersite||eg.publishersite_uid,rejection_reason:eW,completion_date:eg.estimate_time,rejection_date:new Date};(0,M.BY)(e)}}catch(e){console.error("Failed to cancel task:",e),C.default.error("Failed to cancel task")}finally{tu("rejectingTask",!1)}},[ed,eg,eU,eW,ti.rejectingTask,tu]);(0,N.useCallback)(async e=>{if(!e)return;let t=j.default.get("login_access_token");eZ(!0);try{let a=await b.default.get("".concat(n.BASE_URL,"publisher-sites/").concat(e,"/"),{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});ev(a.data)}catch(e){console.error("Failed to fetch websites:",e)}finally{eZ(!1)}},[]);let tP=(0,N.useCallback)(async()=>
1{if(!ed){C.default.error("Task ID is required");return}if(tl)return;e2(!0);let e=j.default.get("login_access_token");try{(await b.default.post("".concat(n.BASE_URL,"task/post-to-wordpress/"),{task_id:ed},{headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})).status,te(!0),ed&&await ty(ed),C.default.success("Task posted successfully!")}catch(r){var t,a,s,l;console.error("Failed to post task:",r);let e=(null==r?void 0:null===(a=r.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.message)||(null==r?void 0:null===(l=r.response)||void 0===l?void 0:null===(s=l.data)||void 0===s?void 0:s.error)||"Failed to post task";C.default.error(e),e2(!1)}},[ed,ty,tl]),tE=(0,N.useCallback)(e=>{e3(e),e5(!0)},[]),tR=(0,N.useCallback)(e=>{try{window.open(e,"_blank","noopener,noreferrer")}catch(e){console.error("Failed to open image:",e),C.default.error("Failed to open image")}},[]),tZ=(0,N.useCallback)(async()=>{let e=tc.current;if(e)try{let t=e.getHTML(),a=e.getText?e.getText():t.replace(/<[^>]+>/g,"");await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([a],{type:"text/plain"})})]),em(!0),C.default.success("Content copied to clipboard!"),setTimeout(()=>em(!1),2e3)}catch(e){console.error("Failed to copy content:",e),C.default.error("Failed to copy content")}},[]);(0,N.useEffect)(()=>{ed&&ty(ed),localStorage.getItem("messageDrawerOpen")&&(ew(!0),localStorage.removeItem("messageDrawerOpen"))},[ed]),(0,N.useEffect)(()=>{var e,t,a;(null==eg?void 0:null===(e=eg.task_additional_info)||void 0===e?void 0:e.response_json)===null||(null==eg?void 0:null===(t=eg.task_additional_info)||void 0===t?void 0:t.response_json)===void 0?te(!1):(null==eg?void 0:null===(a=eg.task_additional_info)||void 0===a?void 0:a.response_json)!==null&&(te(!0),e9&&e2(!1))},[null==eg?void 0:null===(V=eg.task_additional_info)||void 0===V?void 0:V.response_json,e9]),(0,N.useEffect)(()=>{var e;e9&&((null==eg?void 0:null===(e=eg.task_additional_info)||void 0===e?void 0:e.response_json)!==null||(null==eg?void 0:eg.post_url))&&e2(!1)},[null==eg?void 0:null===(W=eg.task_additional_info)||void 0===W?void 0:W.response_json,null==eg?void 0:eg.post_url,e9]);let tI={hidden:{opacity:0},visible:e=>({opacity:1,transition:{delay:.06*e,duration:.2,ease:"easeInOut"}})},tB=(0,N.useCallback)(function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3?arguments[3]:void 0;return(0,s.jsx)(s.Fragment,{children:eR?(0,s.jsx)("tr",{className:"font-semibold",children:(0,s.jsx)(c.Z.Input,{active:!0,block:!0,className:"py-1"})}):(0,s.jsxs)(y.E.tr,{variants:tI,initial:"hidden",animate:"visible",custom:l,className:"border-b ".concat(a?"bg-primary/20 text-primary font-semibold dark:bg-red-900":""),children:[(0,s.jsx)("td",{className:"py-2 px-4 font-medium",children:e}),(0,s.jsxs)("td",{className:"py-2 px-4 flex items-center justify-between ".concat("string"==typeof t&&t.startsWith("http")?"text-blue-600 hover:underline":""),children:["string"==typeof t&&t.startsWith("http")?(0,s.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primarydark font-medium hover:text-primary smooth1_5",children:t}):Array.isArray(t)?(0,s.jsx)("span",{children:t[0]}):t,"Task ID"===e&&!eU&&(0,s.jsxs)(A.default,{href:Array.isArray(t)&&t[1]?"/top-publishers/".concat(t[1]):"/",className:"border px-4 py-1 rounded-lg bg-primarydark hover:bg-primary smooth1_5 text-white",children:["View ",t[1],"'s Profile"]})]})]})})},[eR,eU]),tU=(0,s.jsx)("div",{className:"text-red",children:"We read all messages and your account will be suspended if you discuss the price of the service. It is prohibited to promote or make any negotiation or exchange email, phone numbers or links to any sites. We reserve the right to suspend or ban your account if you fail to follow this rule."}),tM=null==eg?void 0:null===(J=eg.estimate_time)||void 0===J?void 0:J.split("T")[0],tz=null==eg?void 0:null===(G=eg.posting_manager)||void 0===G?void 0:G.status;return(0,s.jsxs)(s.Fragment,{children:["buyer"!==er&&(0,s.jsxs)("div",{onClick:tx,className:"h-10 w-22 group rounded-s-lg hover:w-32 transition-all ease-in-out duration-100 cursor-pointer bg-primarydark flex items-center gap-2 justify-center top-[50%] right-0 fixed z-99999\n        ".concat(ek?"hidden":"","\n        ").concat(e_>0?"animate-blink bg-primarydark":"hover:w-30 hover:bg-primary"),children:[(0,s.jsx)(S.e$J,{className:"text-xl text-white"}),e_>0&&(0,s.jsx)("span",{className:"text-white text-sm font-semibold bg-primary px-2 py-0.5 rounded-full animate-pulse",children:e_}),(0,s.jsx)("p",{className:"text-white hidden group-hover:block transition-all duration-200 ease-in-out",children:"Chat"})]}),"buyer"!==er&&(0,s.jsx)(d.Z,{closable:!0,destroyOnClose:!0,zIndex:1e5,title:(0,s.jsxs)("div",{className:"flex flex-col gap-1 py-1",children:[(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-primarydark font-bold text-base",children:[(0,s.jsx)("div",{className:"p-1.5 rounded-lg bg-blue-50 text-blue-600 dar
1k:bg-blue-950/40 dark:text-blue-400",children:(0,s.jsx)(S.e$J,{className:"text-lg"})}),(0,s.jsx)("span",{children:"Task Message Box"})]})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 mt-1",children:[(0,s.jsxs)("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-semibold bg-gray-100 text-gray-800 border border-gray-200",children:["Task ID: #",(null==eg?void 0:eg.uid)||(null==eg?void 0:eg.id)||(null==eg?void 0:eg.task_id)||ed]}),(0,s.jsxs)("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-semibold bg-blue-100 text-blue-800 border border-blue-200 uppercase",children:["Task Type: ",(null==eg?void 0:eg.task_type)?String(eg.task_type).toUpperCase():"GP"]})]})]}),placement:"right",open:ek,loading:eT,onClose:()=>ew(!1),children:(0,s.jsxs)("div",{className:"flex flex-col h-full gap-2",children:[(0,s.jsx)("div",{className:"flex-[4] bg-white overflow-y-auto flex flex-col gap-2 custom-scrollbar",children:eA.length>0?(0,s.jsxs)(s.Fragment,{children:[eA.map(e=>(0,s.jsx)("div",{className:"flex w-full ".concat(e.is_current_user?"justify-end":"justify-start"),children:(0,s.jsxs)("div",{className:"max-w-[85%] gap-2 py-2 px-4 rounded-lg flex flex-col ".concat(e.is_current_user?"bg-blue-100 text-black rounded-br-none":"bg-gray-100 text-black rounded-bl-none"),children:[(0,s.jsxs)("div",{className:"flex border-b border-gray-300/60 items-center gap-2 pb-1",children:[(0,s.jsx)(R.lYX,{className:"text-xl shrink-0"}),(0,s.jsx)("span",{className:"text-sm font-semibold break-all",children:(0,i.Us)(e)})]}),(0,s.jsx)("p",{className:"break-words whitespace-pre-wrap",children:e.message}),(0,s.jsx)("p",{className:"flex justify-end text-end text-xs text-gray-500",children:(0,v.Q)(new Date(e.created_at),{addSuffix:!0})})]})},e.uid)),(0,s.jsx)("div",{ref:td})]}):eN?(0,s.jsx)("div",{className:"w-full h-full py-4 text-center text-gray-400 font-medium flex items-center justify-center",children:"Loading messages…"}):(0,s.jsxs)("div",{className:"w-full h-full py-4 text-center text-gray-500 font-bold flex items-center justify-center flex-col",children:["No messages found.",(0,s.jsx)(w.default,{alt:"No messages",src:"/images/new/noMsg.svg",width:100,height:100,className:"w-full h-full",objectFit:"contain"})]})}),(null==eg?void 0:eg.task_status.title)!=="Completed"&&(0,s.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,s.jsx)("textarea",{value:ey,onChange:tm,className:"w-full h-full resize-none border p-2 outline-none rounded-lg",disabled:eC}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsx)("button",{onClick:tj,disabled:!(null==ey?void 0:ey.trim())||eC,className:"rounded-lg w-full text-white bg-blue-500 px-4 py-1 hover:bg-primary transition-all ease-in-out duration-300 disabled:cursor-not-allowed disabled:bg-gray-5 flex items-center justify-center gap-2",children:eC?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"h-4 w-4 animate-spin"}),"Sending..."]}):"Send"}),(0,s.jsx)(u.Z,{rootClassName:"custom-popover",content:tU,children:(0,s.jsx)(T.Fs0,{className:"text-2xl text-red"})})]})]})]})}),(0,s.jsxs)("div",{className:"text-black",children:[!eU&&(0,s.jsxs)("button",{onClick:()=>ei.push("/buyer-orders"),className:"bg-newcolor text-white text-base rounded-lg px-4 py-1 flex gap-2 items-center group hover:bg-blue-500 transition-all ease-in-out duration-300",children:[(0,s.jsx)(F.Dli,{className:"group-hover:scale-125 transition-all ease-in-out duration-300 rotate-180"}),"Go Back To My Orders"]}),eU&&(0,s.jsxs)("button",{onClick:()=>ei.push("/publisher-guestpost-tasks"),className:"bg-newcolor text-white text-base rounded-lg px-4 py-1 flex gap-2 items-center group hover:bg-blue-500 transition-all ease-in-out duration-300",children:[(0,s.jsx)(F.Dli,{className:"group-hover:scale-125 transition-all ease-in-out duration-300 rotate-180"}),"Go Back Guest Post Tasks"]}),(0,s.jsxs)("div",{onClick:()=>eB(!eI),className:"w-full h-[50px] bg-newcolor mt-4 rounded-lg flex items-center p-4 gap-4 cursor-pointer transition-all ease-in-out duration-300 hover:bg-gradient-to-r from-primary to-[#2c7be5] mb-4 ".concat(eI?"bg-gradient-to-r from-primary to-[#2c7be5]":"bg-[rgba(87,80,241,0.7)]"),children:[(0,s.jsx)(F.Dli,{className:"text-white transform transition-transform duration-300 ".concat(eI?"rotate-90":"")}),(0,s.jsx)("p",{className:"text-white font-bold",children:"Please click here to read and familiarise yourself with things you can and cannot do."})]}),eI&&(0,s.jsxs)("div",{className:"h-[80vh] md:h-[50vh] bg-white my-4 transition-all ease-in-out duration-300 flex flex-col gap-2 p-4 text-gray-600 font-medium overflow-auto dark:bg-dark dark:text-white","data-aos":"fade",children:[(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Before you start working on a task, make sure you have accepted it."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Cancel the task as soon as you think you cannot complete it."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• The article must not be on the subdomain."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Don't ask the buyer to approve the task."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• If the Buyer doesn't approve the task, it will be automatically marked as approved after 3 days."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• If the Buyer requests any changes, make sure you fix it as soon as possible if not the task may be cancelled by the buyer or Vefogix."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Before you deliver the task, make sure that all links and target URLs are in place and follow all the instructions."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Don't try to renegotiate the price with the Buyer."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Don't exchange email, phone numbers or links to any sites with the Buyer."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• We read all messages and we reserve the right to suspend or ban your account if you fail any of these rules."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• As a website Owner: After delivering the task, if the Buyer doesn't approve it, it will be automatically marked as complete after 3 days and the funds will be Available For Withdrawal."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• As a contributor on a website: After delivering the task, if the Buyer doesn't approve it, it will be automatically marked as complete after 3 days and the funds will move to your Balance Awaiting and will be Available For Withdrawal After 21 Days."}),(0,s.jsx)("p",{className:"text-sm md:text-base",children:"• Payments are made weekly (Every Monday). Please Make sure to request your payment before Sunday Midnight UK Time."})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mx-auto",children:[eR?(0,s.jsx)("div",{className:"w-full flex items-center justify-center text-center gap-2 smooth",children:(0,s.jsx)(c.Z.Input,{active:!0,block:!0,className:"mb-1"})}):eg?(null==eg?void 0:eg.is_amount_paid)?null:(0,s.jsxs)("div",{className:"w-full flex items-center justify-center text-center gap-2 smooth",children:[(0,s.jsx)("a",{onClick:tb,className:"text-red-500 font-semibold shake-horizontal cursor-pointer hover:underline smooth",children:"Your Task Has Not Been Sent To Publisher Please Clear Your Dues."}),(0,s.jsx)(p.Z,{title:"Contact Us",open:ef,footer:null,closable:!0,onCancel:tv,children:(0,s.jsx)("div",{style:{position:"relative"},children:(0,s.jsx)(U.default,{show:!1})})})]}):(0,s.jsx)("div",{className:"w-full flex items-center justify-center text-center gap-2 smooth",children:(0,s.jsx)(c.Z.Input,{active:!0,block:!0,className:"mb-1"})}),(0,s.jsx)(y.E.table,{className:"w-full border-collapse",children:(0,s.jsxs)("tbody",{children:[tB("Task ID",[null==eg?void 0:eg.uid,null==eg?void 0:eg.publisher_name],!1,0),tB("Price",eU?"$".concat(null==eg?void 0:eg.publisher_amount):"$".concat(null==eg?void 0:eg.buyer_amount),!1,1),tB("Task Status",null==eg?void 0:eg.task_status.title,!0,2),
1(null==eb?void 0:null===(H=eb.linktype_detail)||void 0===H?void 0:H.title)&&tB("Link Type",null==eb?void 0:null===(Y=eb.linktype_detail)||void 0===Y?void 0:Y.title,!1,3),tB("Service Type",(()=>{switch(null==eg?void 0:eg.task_type){case"cp":return"Content Placement";case"ccp":return"Content Creation & Placement";case"li":return"Link Insertion";case"cbdcp":return"CBD/Casino Content Placement";case"cbdccp":return"CBD/Casino Content Creation & Placement";case"cbdli":return"CBD/Casino Link Insertion";case"adultcp":return"Adult Content Placement";case"adultccp":return"Adult Content Creation & Placement";case"adultli":return"Adult Link Insertion";default:return null==eg?void 0:eg.task_type}})(),!1,4),tB("Publisher's URL",null==eg?void 0:eg.publishersite_domain,!1,5),(null==eg?void 0:eg.post_url)&&tB("Post URL",(null==eg?void 0:eg.task_status.title)==="Improvement"&&eU&&!tz?eY?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"text",value:ez,onChange:tg,className:"flex-grow p-1 border rounded-lg ".concat(eD?"border-green-500":"border-red-500"),disabled:ti.updatingPostUrl}),(0,s.jsx)("button",{onClick:t_,disabled:ti.updatingPostUrl||!eD,className:"ml-2 text-green-600 hover:scale-110 transition-transform text-xl disabled:opacity-50 disabled:cursor-not-allowed",children:ti.updatingPostUrl?(0,s.jsx)(k.Z,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(F.wO,{})}),(0,s.jsx)(E.xg7,{className:"ml-2 text-red-600 cursor-pointer hover:scale-110 transition-transform text-xl",onClick:tf})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:null==eg?void 0:eg.post_url}),(0,s.jsx)(F.fmQ,{className:"ml-2 text-primary cursor-pointer hover:scale-110 transition-transform text-lg",onClick:th}),(0,s.jsx)(h.Z,{isUrlWorking:null==e$?void 0:e$.is_url_working,lastCheckedAt:null==e$?void 0:e$.last_checked_at,isUrlIndexed:null==eg?void 0:eg.is_url_indexed,lastIndexedAt:null==eg?void 0:eg.last_indexed_at,onFoundClick:()=>{eQ(null==e$?void 0:e$.uid),eq(!0)},disabled:e1===(null==e$?void 0:e$.uid)})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:null==eg?void 0:eg.post_url}),(0,s.jsx)(h.Z,{isUrlWorking:null==e$?void 0:e$.is_url_working,lastCheckedAt:null==e$?void 0:e$.last_checked_at,isUrlIndexed:null==eg?void 0:eg.is_url_indexed,lastIndexedAt:null==eg?void 0:eg.last_indexed_at,onFoundClick:()=>{eQ(null==e$?void 0:e$.uid),eq(!0)},disabled:e1===(null==e$?void 0:e$.uid)})]}),!1,6),tB("Anchor Text",null==eg?void 0:eg.anchor_text,!1,7),tB("Target URL",null==eg?void 0:eg.target_url,!1,8),(null==eg?void 0:eg.task_status.title)==="Improvement"&&tB("Improvement Reason",(null==eg?void 0:eg.improvement_text)||"",!0,9),(null==eg?void 0:eg.task_status.title)==="Awaiting"&&(null==eg?void 0:null===(O=eg.improvement_text)||void 0===O?void 0:O.trim())&&tB("Improvement Reason",(null==eg?void 0:eg.improvement_text)||"",!0,9),(null==eg?void 0:eg.task_status.title)==="Awaiting"&&((null==eg?void 0:null===(K=eg.awaiting_message)||void 0===K?void 0:K.trim())||(null==eg?void 0:null===(q=eg.message)||void 0===q?void 0:q.trim()))&&tB("Awaiting Message",(null==eg?void 0:eg.awaiting_message)||(null==eg?void 0:eg.message),!0,9.5),(null==eg?void 0:eg.task_status.title)==="Rejected"&&tB("Cancellation Reason",(null==eg?void 0:eg.rejection_reason)||"",!0,9),(null==eg?void 0:eg.special_requirment)&&tB("Special Requirements",(null==eg?void 0:eg.special_requirment)||"",!1,10),tB("Estimated At",tM||"",!1,11),(null==eg?void 0:eg.task_additional_info)&&(0,s.jsxs)(s.Fragment,{children:[(null==eg?void 0:null===(X=eg.task_additional_info)||void 0===X?void 0:X.title)&&tB("Title",eg.task_additional_info.title,!1,12),(null==eg?void 0:null===(Q=eg.task_additional_info)||void 0===Q?void 0:Q.category)&&tB("Category",eg.task_additional_info.category,!1,13),(null==eg?void 0:null===($=eg.task_additional_info)||void 0===$?void 0:$.feature_image)&&(0,s.jsxs)(y.E.tr,{variants:tI,initial:"hidden",animate:"visible",custom:14,className:"border-b",children:[(0,s.jsx)("td",{className:"py-2 px-4 font-medium",children:"Feature Image"}),(0,s.jsx)("td",{className:"py-2 px-4 flex items-center gap-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("img",{src:eg.task_additional_info.feature_image,alt:"Feature",className:"max-w-[100px] max-h-[100px] object-contain rounded-lg border border-gray-300 cursor-pointer hover:opacity-80 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),tE(eg.task_additional_info.feature_image)},onContextMenu:e=>{e.preventDefault()},draggable:!1}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("button",{onClick:e=>{e.preventDefault(),tE(eg.task_additional_info.feature_image)},className:"flex items-center gap-1 text-blue-600 hover:text-blue-800 text-sm px-2 py-1 rounded hover:bg-blue-50 transition-colors",children:[(0,s.jsx)(F.dSq,{className:"text-xs"}),"Preview"]}),(0,s.jsxs)("button",{onClick:e=>{e.preventDefault(),tR(eg.task_additional_info.feature_image,"feature-image-".concat((null==eg?void 0:eg.uid)||"image",".png"))},className:"flex items-center gap-1 text-green-600 hover:text-green-800 text-sm px-2 py-1 rounded hover:bg-green-50 transition-colors",children:[(0,s.jsx)(F.aBF,{className:"text-xs"}),"Download"]})]})]})})]})]})]})}),(null==eg?void 0:eg.is_pr)&&(null==eg?void 0:null===(ee=eg.company_details)||void 0===ee?void 0:ee.length)>0&&(0,s.jsx)("div",{className:"p-4 rounded-2xl shadow-sm bg-white",children:(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-6 text-gray-800",children:[(0,s.jsxs)("div",{className:"bg-gray-50 rounded-2xl p-6 border border-gray-200 space-y-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Company Details"}),(0,s.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Company Name:"})," ",eg.company_details[0].company_name||"N/A"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Contact Person:"})," ",eg.company_details[0].company_person||"N/A"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Email:"})," ",eg.company_details[0].company_email||"N/A"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Phone:"})," ",eg.company_details[0].comapny_phone||"N/A"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Address:"})," ",[eg.company_details[0].comapny_address1,eg.company_details[0].comapny_address2,eg.company_details[0].company_city,eg.company_details[0].company_
1state,eg.company_details[0].company_country].filter(Boolean).join(", ")||"N/A"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Website:"})," ",eg.company_details[0].website_url?(0,s.jsx)("a",{href:"https://".concat(eg.company_details[0].website_url.replace(/^https?:\/\//,"")),target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline break-words",children:eg.company_details[0].website_url}):"N/A"]}),eg.company_details[0].company_facebook&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Facebook:"})," ",(0,s.jsx)("a",{href:eg.company_details[0].company_facebook,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"Link"})]}),eg.company_details[0].company_linkedin&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-medium",children:"LinkedIn:"})," ",(0,s.jsx)("a",{href:eg.company_details[0].company_linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"Link"})]})]})]}),(0,s.jsxs)("div",{className:"bg-gray-50 rounded-2xl p-6 border border-gray-200 space-y-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Meta Information"}),(0,s.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-gray-700",children:"Meta Title"}),(0,s.jsx)("div",{className:"text-gray-600",children:eg.company_details[0].meta_title||"N/A"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-gray-700",children:"Meta Description"}),(0,s.jsx)("div",{className:"text-gray-600 whitespace-pre-line",children:eg.company_details[0].meta_description||"N/A"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-gray-700",children:"Meta Keywords"}),(0,s.jsx)("div",{className:"text-gray-600",children:eg.company_details[0].meta_keyword||"N/A"})]})]})]})]})}),(null==eg?void 0:eg.task_status.title)==="In Progress"&&eU&&(0,s.jsxs)(y.E.div,{className:"mt-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2",children:"Post Placement URL"}),(0,s.jsx)("input",{type:"text",value:ez,onChange:tg,placeholder:"Enter Post Placement URL",className:"w-full p-2 border outline-none rounded-lg ".concat(eD?"border-green-500":"border-red-500"),disabled:ti.sendingForApproval})]}),(0,s.jsxs)(y.E.div,{className:"mt-6 flex justify-between items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[["Not Started","In Progress"].includes(null==eg?void 0:eg.task_status.title)&&!tz&&(0,s.jsx)(m.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Are you sure you want to cancel this task?"}),(0,s.jsx)(g.default.TextArea,{rows:4,value:eW,onChange:e=>eJ(e.target.value),placeholder:"Provide a reason...",disabled:ti.rejectingTask}),eW.length>0&&eW.length<10&&(0,s.jsx)("p",{style:{color:"red"},children:"Reason must be at least 10 characters."})]}),onConfirm:tF,okText:"Yes",cancelText:"No",disabled:ti.rejectingTask,okButtonProps:{disabled:eW.trim().length<10||ti.rejectingTask},children:(0,s.jsx)("button",{className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:ti.rejectingTask,children:ti.rejectingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.MPJ,{className:"mr-2"}),"Cancel The Task"]})})}),["Awaiting"].includes(null==eg?void 0:eg.task_status.title)&&!tz&&!eU&&(0,s.jsx)(m.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Are you sure you want to cancel this task?"}),(0,s.jsx)(g.default.TextArea,{rows:4,value:eW,onChange:e=>eJ(e.target.value),placeholder:"Provide a reason...",disabled:ti.rejectingTask}),eW.length>0&&eW.length<10&&(0,s.jsx)("p",{style:{color:"red"},children:"Reason must be at least 10 characters."})]}),onConfirm:tF,okText:"Yes",cancelText:"No",disabled:ti.rejectingTask,okButtonProps:{disabled:eW.trim().length<10||ti.rejectingTask},children:(0,s.jsx)("button",{className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 roun
1ded-lg flex items-center transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:ti.rejectingTask,children:ti.rejectingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.MPJ,{className:"mr-2"}),"Cancel The Task"]})})}),ts&&!tz&&(0,s.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,s.jsx)("button",{onClick:tP,disabled:tl,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 ".concat(tl?"opacity-50 cursor-not-allowed":""),children:e9?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Posting..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Post Now"]})}),e9&&(0,s.jsxs)("div",{className:"text-sm text-blue-600 bg-blue-50 px-3 py-2 rounded-lg",children:[(0,s.jsx)(k.Z,{className:"inline-block mr-2 h-3 w-3 animate-spin"}),"Your task is being posted to WordPress. Please wait..."]}),tr&&!e9&&(0,s.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-700 max-w-md",children:[(0,s.jsx)("p",{className:"font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Response Message:"}),(0,s.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:tr})]}),e7&&!e9&&(0,s.jsx)("div",{className:"text-sm text-green-600 bg-green-50 px-3 py-2 rounded-lg border border-green-200",children:"✓ Task has been successfully posted to WordPress!"})]})]}),(null==eg?void 0:eg.task_status.title)==="Not Started"&&eU&&(0,s.jsx)("button",{onClick:()=>ec(!0),disabled:ti.acceptingTask,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ti.acceptingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Accepting..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Accept This Task"]})}),(null==eg?void 0:eg.task_status.title)==="In Progress"&&eU&&tz&&(0,s.jsx)("div",{className:"flex gap-4 items-center",children:(0,s.jsx)("button",{onClick:tw,disabled:!eD||ti.updatingPostUrl,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:bg-gray-400 disabled:cursor-not-allowed",children:ti.updatingPostUrl?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Update Post URL"]})})}),(null==eg?void 0:eg.task_status.title)==="In Progress"&&eU&&!tz&&(0,s.jsx)("div",{className:"flex gap-4 items-center",children:(0,s.jsx)("button",{onClick:tA,disabled:!eD||ti.sendingForApproval,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:bg-gray-400 disabled:cursor-not-allowed",children:ti.sendingForApproval?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Send For Buyer's Approval"]})})}),(null==eg?void 0:eg.task_status.title)==="Pending Approval"&&!eU&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(m.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Are you sure you want to send this task for Improvement?"}),(0,s.jsx)(g.default.TextArea,{rows:4,value:eG,onChange:e=>eH(e.target.value),placeholder:"Provide Improvements ...",disabled:ti.sendingForImprovement})]}),onConfirm:tC,okText:"Yes",cancelText:"No",disabled:ti.sendingForImprovement,children:(0,s.jsx)("button",{className:"bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:ti.sendingForImprovement,children:ti.sendingForImprovement?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(I.TFr,{className:"mr-2"}),"Improvement"]})})}),(0,s.jsx)("button",{onClick:tN,disabled:ti.completingTask,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 roun
1ded-lg flex items-center transition-colors duration-300 disabled:bg-gray-400 disabled:cursor-not-allowed",children:ti.completingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Completing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Complete The Task"]})})]}),(null==eg?void 0:eg.task_status.title)==="Improvement"&&eU&&!tz&&(0,s.jsx)("button",{onClick:tS,disabled:ti.sendingForFinalApproval,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ti.sendingForFinalApproval?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Send For Final Approval"]})}),(null==eg?void 0:eg.task_status.title)==="Awaiting"&&!eU&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[((null==eg?void 0:null===(et=eg.awaiting_message)||void 0===et?void 0:et.trim())||(null==eg?void 0:null===(ea=eg.message)||void 0===ea?void 0:ea.trim()))&&(0,s.jsxs)("div",{className:"bg-blue-50 border border-blue-200 text-blue-800 p-4 rounded-lg text-sm mb-2",children:[(0,s.jsx)("span",{className:"font-semibold",children:"Message: "}),(null==eg?void 0:eg.awaiting_message)||(null==eg?void 0:eg.message)]}),(0,s.jsx)("button",{onClick:tN,disabled:ti.completingTask,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300 disabled:bg-gray-400 disabled:cursor-not-allowed w-fit",children:ti.completingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Completing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z.tAF,{className:"mr-2"}),"Complete The Task"]})})]})]})]}),(0,s.jsx)(p.Z,{title:(0,s.jsx)("div",{style:{textAlign:"center",width:"100%"},children:"Publisher Task Acceptance Agreement"}),open:eo,onCancel:()=>{ec(!1),ta(!1)},footer:null,centered:!0,width:720,style:{height:"unset"},children:(0,s.jsxs)("div",{className:"w-full flex flex-col gap-4 px-1 py-2",children:[(0,s.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:"By accepting this task, you acknowledge and agree to the following terms:"}),(0,s.jsx)("div",{className:"max-h-[50vh] overflow-y-auto custom-scrollbar border border-gray-200 dark:border-gray-700 rounded-lg p-4 text-sm text-gray-700 dark:text-gray-200 flex flex-col gap-3",children:[["No Direct Contact","You must not contact the buyer/website owner/admin directly through email, phone, WhatsApp, Telegram, Skype, LinkedIn, social media, or any other communication channel like contact form over website etc."],["No Circumvention","You must not attempt to bypass the Vefogix platform for current or future business with any buyer introduced through the platform."],["No Sharing of Contact Information","You must not request, share, or exchange personal or business contact details with the buyer, including email addresses, phone numbers, websites, social media accounts, or messaging IDs."],["No Direct Payments","You must not request or accept payment directly from the buyer. All payments must be processed exclusively through the Vefogix platform."],["Confidentiality","Buyer information, project details, URLs, documents, and communications are confidential and must not be disclosed to any third party."],["Platform Communication Only","All project-related discussions must take place through the Vefogix platform unless prior written approval is provided by the Vefogix team."],["No Promotion of External Services","You must not promote your own website, agency, marketplace, or any competing services to buyers during or after task completion."],["No Future Solicitation","You must not approach or solicit any buyer introduced by Vefogix for future projects, regardless of whether the current task has been completed."],["Evidence of Violation","Any screenshots, emails, messages, payment records, or other evidence showing an attempt to bypass the platform may be treated as sufficient proof of a policy violation."],["Penalty for Violation","If you are found attempting to bypass the platform or contact buyers directly, Vefogix reserves the right to: immediately suspend or permanently terminate your publisher account; cancel pending payouts and withhold unpaid earnings; remove all active listings and publisher websites; reject current and future withdrawal requests; restrict access to the platform permanently;
1 and take legal action where applicable to recover business losses."],["No Refund or Appeal Guarantee","Accounts suspended for confirmed circumvention or buyer solicitation may not be eligible for reinstatement or recovery of withheld earnings."],["Binding Agreement",'By clicking "Accept Task," you confirm that you have read, understood, and agreed to these terms. Violation of any of the above conditions may result in immediate action without prior notice.']].map((e,t)=>{let[a,l]=e;return(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("span",{className:"font-semibold shrink-0",children:[t+1,"."]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"font-semibold",children:a}),(0,s.jsx)("span",{className:"block mt-0.5",children:l})]})]},t)})}),(0,s.jsxs)("label",{className:"flex items-start gap-2 text-sm text-gray-700 dark:text-gray-200 cursor-pointer select-none",children:[(0,s.jsx)("input",{type:"checkbox",checked:tt,onChange:e=>ta(e.target.checked),disabled:ti.acceptingTask,className:"mt-1 h-4 w-4 shrink-0 cursor-pointer accent-green-600"}),(0,s.jsx)("span",{children:"I have read, understood, and agree to the Publisher Task Acceptance Agreement."})]}),(0,s.jsx)("div",{className:"w-full flex items-center justify-center",children:(0,s.jsx)("button",{onClick:tk,disabled:ti.acceptingTask||!tt,className:"group bg-newcolor transition-all ease-in-out duration-300 hover:bg-green-500 text-white text-base rounded-lg px-4 py-2 flex gap-2 items-center disabled:opacity-50 disabled:cursor-not-allowed",children:ti.acceptingTask?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"text-white h-4 w-4 animate-spin"}),"Accepting..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(E.XJM,{className:"text-white group-hover:scale-125 transition-all ease-in-out duration-300 text-lg"}),"Accept Task"]})})})]})}),(0,s.jsxs)("div",{className:"mt-4 bg-white flex flex-col dark:bg-dark dark:text-white shadow-lg rounded-lg",children:[(0,s.jsxs)("div",{className:"px-4 py-2 bg-newcolor rounded-t-lg text-white",children:[eg&&["Not Started","In Progress"].includes(eg.task_status.title)&&(0,s.jsxs)("p",{className:"flex justify-between items-center",children:["Content to be published -> This article must be posted with all the links and if you can't, just cancel it",(0,s.jsx)(u.Z,{title:"Copy",children:(0,s.jsx)(F.Dup,{className:"text-lg hover:text-2xl transition-all ease-in-out duration-300 cursor-pointer",onClick:tZ})})]}),eg&&!["Not Started","In Progress"].includes(eg.task_status.title)&&(0,s.jsxs)("p",{className:"flex justify-between items-center",children:["Content to be published",(0,s.jsx)(u.Z,{title:"Copy",children:(0,s.jsx)(F.Dup,{className:"text-lg hover:text-2xl transition-all ease-in-out duration-300 cursor-pointer",onClick:tZ})})]})]}),(0,s.jsx)("div",{className:"px-4 py-2 bg-white rounded-t-lg dark:bg-dark dark:text-white mb-5",children:(0,s.jsx)("div",{className:"resizable-container pb-10",style:{width:"100%",height:"50vh",backgroundColor:"#f5f5f5",borderRadius:"8px"},children:(0,s.jsx)(B.Z,{content:eg&&eg.content||"",setContent:()=>{},onInit:e=>{tc.current=e},readOnly:!0,showToolbar:!0})})})]})]}),(0,s.jsx)(p.Z,{open:eK,onCancel:()=>eq(!1),footer:null,centered:!0,closable:!0,children:(0,s.jsxs)("div",{className:"pt-8 text-center",children:[" ",(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:eX?"Do you want to re-check the URL status for Task ID: ".concat(eX,"?"):"Do you want to re-check this URL status?"}),(0,s.jsxs)("div",{className:"flex justify-center gap-4",children:[(0,s.jsx)("button",{onClick:()=>eq(!1),className:"bg-gray-300 px-4 py-2 rounded-md hover:bg-gray-400",children:"No"}),(0,s.jsx)("button",{onClick:tn,className:"bg-primarydark text-white px-4 py-2 rounded-md hover:bg-primary",children:"Yes"})]})]})}),(0,s.jsx)(p.Z,{open:e4,onCancel:()=>e5(!1),footer:null,centered:!0,width:800,className:"image-preview-modal",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4 p-4",children:[(0,s.jsx)("img",{src:e6,alt:"Preview",className:"max-w-full max-h-[70vh] object-contain rounded-lg",onContextMenu:e=>e.preventDefault(),draggable:!1,onClick:e=>e.preventDefault()}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("button",{onClick:()=>tR(e6,"feature-image-".concat((null==eg?void 0:eg.uid)||"image",".png")),className:"flex items-center gap-2 bg-green-500 hover:bg-green-600 text-white font-semibold py-2 px-4 roun
1ded-lg transition-colors",children:[(0,s.jsx)(F.aBF,{}),"Download Image"]}),(0,s.jsx)("button",{onClick:()=>e5(!1),className:"bg-gray-500 hover:bg-gray-600 text-white font-semibold py-2 px-4 rounded-lg transition-colors",children:"Close"})]})]})})]})}},81382:function(e,t,a){a.d(t,{Z:function(){return d}});var s=a(57437);a(2265);var l=a(33145),r=a(99981);let n="inline-flex items-center justify-center w-6 h-6 rounded-md text-xs font-bold border select-none transition-colors overflow-hidden",i="bg-green-100 text-green-700 border-green-300",o="bg-red-100 text-red-700 border-red-300";function c(e){if(!e)return"";try{return new Date(e).toLocaleString()}catch(e){return""}}function d(e){let{isUrlWorking:t,lastCheckedAt:a,isUrlIndexed:d,lastIndexedAt:u,onFoundClick:p,disabled:m=!1,className:g=""}=e,h=null!=t,f=null!=d;return h||f?(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5 ".concat(g),children:[h&&(0,s.jsx)(r.Z,{getPopupContainer:()=>document.body,title:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"font-bold",children:[(0,s.jsx)("span",{className:t?"text-green-400":"text-red-400",children:t?"✓":"✕"})," ",t?"Link Found":"Link Not Found"]}),a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"opacity-80",children:"Last checked:"}),(0,s.jsx)("div",{children:c(a)})]})]}),children:(0,s.jsx)("span",{onClick:()=>{!m&&p&&p()},className:"".concat(n," ").concat(t?i:o," ").concat(p?"cursor-pointer":""," ").concat(m?"opacity-50 cursor-not-allowed":""),children:t?"F":"NF"})}),f&&(0,s.jsx)(r.Z,{getPopupContainer:()=>document.body,title:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"font-bold",children:[(0,s.jsx)("span",{className:d?"text-green-400":"text-red-400",children:d?"✓":"✕"})," ",d?"Indexed on Google":"Not Indexed on Google"]}),u&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"opacity-80",children:"Last checked:"}),(0,s.jsx)("div",{children:c(u)})]})]}),children:(0,s.jsx)("span",{className:"".concat(n," ").concat(d?i:o),children:(0,s.jsx)(l.default,{src:"/images/Googlesvg.svg",alt:"Google",width:16,height:16})})})]}):null}},42056:function(e,t,a){a.d(t,{$:function(){return u},a:function(){return d}});var s=a(57437),l=a(2265),r=a(99376),n=a(64131),i=a(38695),o=a(93131);let c=(0,l.createContext)(void 0),d=e=>{let{children:t}=e,a=(0,r.usePathname)(),d=(0,l.useRef)(null),u=(0,o.K)(),p=(0,l.useMemo)(()=>(0,i.h)((0,i.YE)(),{resolved:!1}),[]),m=u.isResolved?u:p;(0,l.useRef)(m).current=m;let g=(0,l.useCallback)(()=>!1,[]),[h,f]=(0,l.useState)(()=>{try{let e=localStorage.getItem("currentUserRole");if(e){let t;if(t=e.startsWith('"')&&e.endsWith('"')?JSON.parse(e):e,["buyer","seller","publisher","agency"].includes(t)){if("agency"===t&&!g())return"buyer";return t}console.warn("Invalid role in localStorage: ".concat(t,", defaulting to buyer"))}}catch(e){console.warn("Error parsing role from localStorage:",e)}return"buyer"}),x=e=>"/backlink-monitor"===e||"/backlink-report"===e||"/feedback"===e||"/support-tickets"===e?null:e.startsWith("/publisher-")||e.includes("/publisher/")||"/balance"===e||e.startsWith("/balance/")||"/press-release-tasks"===e||e.startsWith("/press-release-tasks/")||"/publisher-my-platform"===e||"/publisher-dashboard"===e||"/publisher-guestpost-tasks"===e||"/publisher-task-view"===e||e.startsWith("/publisher-task-view")||"/update-owner"===e?"publisher":e.startsWith("/seller-")||e.includes("/seller/")||"/testing-seller-db"===e||e.startsWith("/testing-seller-db/")||"/my-clients"===e||"/my-requests"===e||e.startsWith("/my-requests/")||"/my-tasks"===e||"/client-details"===e?"seller":e.startsWith("/buyer-")||e.includes("/buyer/")||"/all-publisher-sites"===e||"/premium-sites"===e||"/favorite-sites"===e||"/blacklisted-sites"===e||"/trusted-sites"===e||"/verified-websites"===e||"/projects"===e||e.startsWith("/projects/")||"/project-publisher-site"===e||"/top-publishers"===e||e.startsWith("/top-publishers/")||"/invoices"===e||"/my-packages"===e||e.startsWith("/my-packages/")||"/backlink-monitor"===e||"/backlink-report"===e||"/company-dashboard"===e||"/owner-sites"===e||"/task-create"===e||"/all-invoices"===e||"/buyer-encode"===e||e.startsWith("/buyer-encode/")||"/create-website-earn-money"===e||"/partner"===e||e.startsWith("/press-release-")||"/buyer-task-view"===e||e.startsWith("/buyer-task-view")?"buyer":null,b=()=>{f("buyer"),localStorage.removeItem("currentUserRole"),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu"),(0,i.Rg)()},v=()=>{f(e=>e)};return(0,l.useEffect)(()=>{let e=()=>{if(!(localStorage.getItem("login_access_token")||n.default.get("login_access_token"))){"buyer"!==h&&b();return}try{let e=localStorage.getItem("currentUserRole");if(!e){"buyer"!==h&&f("buyer");return}let t=e.startsWith('"')&&e.endsWith('"')?JSON.parse(e):e;if(!["buyer","seller","publisher","agency"].includes(t)){console.warn("Invalid role in localStorage: ".concat(t,", resetting to buyer")),b();return}let a="agency"!==t||g()?t:"buyer";a!==h&&a!==d.current&&f(a)}catch(e){console.warn("Error parsing role from localStorage:",e),b()}};return e(),window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[h,m.hasAgencyAccess]),(0,l.useEffect)(()=>
1{if(!a)return;let e=x(a);if(e&&e!==h){d.current=e,f(e),localStorage.setItem("currentUserRole",e),setTimeout(()=>{d.current=null},100);return}"agency"===h&&m.isResolved&&!m.hasAgencyAccess&&(f("buyer"),localStorage.setItem("currentUserRole","buyer"))},[a,m.hasAgencyAccess,m.isResolved]),(0,l.useEffect)(()=>{{let e=setTimeout(()=>{v()},100);return()=>clearTimeout(e)}},[]),(0,s.jsx)(c.Provider,{value:{currentRole:h,switchToRole:(e,t)=>{let a="agency"!==e||g()?e:"buyer";if(!["buyer","seller","publisher","agency"].includes(e)){console.error("Invalid role: ".concat(e));return}if(f(a),localStorage.setItem("currentUserRole",a),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu"),t){let e=(()=>{switch(a){case"buyer":default:return"/buyer-dashboard/";case"seller":return"/seller-dashboard/";case"publisher":return"/publisher-dashboard/";case"agency":return g()?"/agency-dashboard/":"/buyer-dashboard/"}})();setTimeout(()=>{t.push(e)},100)}else console.warn("No router provided for navigation")},resetRole:b,handleLogin:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"buyer",t="agency"!==e||g()?e:"buyer";f(t),localStorage.setItem("currentUserRole",t),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu")},forceRefresh:v,isPublisher:"publisher"===h},children:t})},u=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("useLayout must be used within a LayoutProvider");return e}},71575:function(e,t,a){a.d(t,{G:function(){return u},P:function(){return d}});var s=a(57437),l=a(2265),r=a(83464),n=a(99551),i=a(64131),o=a(75186);let c=(0,l.createContext)(),d=e=>{let{children:t}=e,[a,d]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[m,g]=(0,l.useState)([]),[h,f]=(0,l.useState)(null),[x,b]=(0,l.useState)(null),[v,y]=(0,l.useState)(null),[j,k]=(0,l.useState)(0),[w,A]=(0,l.useState)(1),[_,N]=(0,l.useState)(10),[C,S]=(0,l.useState)(!1),[T,F]=(0,l.useState)(""),P=(0,l.useRef)(new Set),E=(0,l.useRef)(new Map),R=(0,l.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=i.default.get("login_access_token");if(!s)return{error:!0,detail:"Authentication credentials were not provided."};let l={headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},params:t};a&&"function"==typeof a.addEventListener&&(l.signal=a);try{return(await r.default.get(e,l)).data}catch(e){if(!r.default.isCancel(e)){var n,o;let t=null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.status,a=null==e?void 0:null===(o=e.response)||void 0===o?void 0:o.data;if(401===t)return{error:!0,detail:(null==a?void 0:a.detail)||"Authentication credentials were not provided."};if(400===t)return{error:!0,detail:(null==a?void 0:a.error)||(null==a?void 0:a.message)||"Bad request",status:400,data:a};if(404===t)return{error:!0,detail:"Resource not found",status:404};if(a)return{error:!0,detail:a,status:t};return console.error("API call failed:",e),{error:!0,detail:e.message||"An error occurred"}}return null}},[]),Z=(0,l.useCallback)(async()=>{let e="publisher-tasks";if(!P.current.has(e)){P.current.add(e),S(!0);try{let e=await R("".concat(n.BASE_URL,"my-tasks/publisher/"));e&&!e.error?(p(e),y(null)):(null==e?void 0:e.error)&&(y(e),b(e))}finally{S(!1),P.current.delete(e)}}},[R]),I=(0,l.useCallback)(async()=>{let e="buyer-tasks";if(!P.current.has(e)){P.current.add(e),S(!0);try{let e=await R("".concat(n.BASE_URL,"my-tasks/buyer/"));e&&!e.error?(g(e),y(null)):(null==e?void 0:e.error)&&y(e)}finally{S(!1),P.current.delete(e)}}},[R]),B=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Not Started",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"",p=arguments.length>11&&void 0!==arguments[11]?arguments[11]:null,m=arguments.length>12&&void 0!==arguments[12]&&arguments[12],g=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"",h=arguments.length>14&&void 0!==arguments[14]?arguments[14]:"",f=arguments.length>15&&void 0!==arguments[15]?arguments[15]:"all",x=arguments.length>16&&void 0!==arguments[16]?arguments[16]:"",v=arguments.length>17&&void 0!==arguments[17]?arguments[17]:"",j="publisher-tasks-".concat(e,"-").concat(t,"-").concat(a,"-").concat(h,"-").concat(s,"-").concat(l,"-").concat(r,"-").concat(i,"-").concat(o,"-").concat(c,"-").concat(d,"-").concat(u,"-").concat(m,"-").concat(g,"-").concat(f,"-").concat(x,"-").concat(v),k=Date.now(),w=E.current.get(j);if(!(w&&k-w<1e3||P.current.has(j))){P.current.add(j),E.current.set(j,k),S(!0);try{let j={status:e,page:t,page_size:a,task_id:s,query:h,searchSeller:l,searchDomain:r,post_url:i,start_date:o,end_date:c,sortTask:d,ownership:u,searchPostingManager:g};m&&(j.press_task=!0),f&&"all"!==f&&(j.project_ownership=f),x&&(j.url_status=x),v&&(j.index_status=v);let k=await R("".concat(n.BASE_URL,"publisher-tasks/"),j,p);k&&k.error?(b(k),y(k)):k&&!k.error?(b(k),y(null)):b(null)}finally{S(!1),P.current.delete(j)}}},[R]),U=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Not Started",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,c=arguments.length>8&&void 0!==arguments[8]&&arguments[8],d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"",p=arguments.length>11&&void 0!==arguments[11]?arguments[11]:"",m=arguments.length>12&&void 0!==arguments[12]?arguments[12]:"",g=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"all",h="buyer-tasks-".concat(e,"-").concat(t,"-").concat(a,"-").concat(s,"-").concat(l,"-").concat(r,"-").concat(i,"-").concat(d,"-").concat(u,"-").concat(p,"-").concat(m,"-").concat(g);if(!P.current.has(h)){P.current.add(h),S(!0);try{let h={status:e,page:t,page_size:a,search:l,task_id:s,publisher:r,post_url:i,start_date:d,end_date:u,postingManager:p,query:m};
1Object.keys(h).forEach(e=>{(""===h[e]||null===h[e]||void 0===h[e])&&delete h[e]}),c&&(h.press_task=!0),g&&"all"!==g&&(h.project_ownership=g);let x=await R("".concat(n.BASE_URL,"buyer-tasks/"),h,o);x&&x.error?(f(x),y(x)):x&&!x.error?(f(x),y(null)):f(null)}finally{S(!1),P.current.delete(h)}}},[R]),M=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s="websites-".concat(e,"-").concat(t,"-").concat(a);if(!P.current.has(s)){P.current.add(s),S(!0);try{let s=await R("".concat(n.BASE_URL,"publisher-sites/"),{page:e,page_size:t,search:a});s&&!s.error?(d(s.results||[]),k(s.count||0),y(null)):(null==s?void 0:s.error)&&y(s)}finally{S(!1),P.current.delete(s)}}},[R]),z=(0,l.useCallback)(async e=>{let t=i.default.get("login_access_token");if(!t)return null;try{let a=await r.default.post("".concat(n.BASE_URL,"publisher-sites/"),e,{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});return d(e=>[...e,a.data]),a}catch(e){var a;throw console.error("Error adding website:",e),(null===(a=e.response)||void 0===a?void 0:a.data)&&o.default.error(e.response.data[0]||"Failed to add website"),e}},[]),L=(0,l.useCallback)(async(e,t)=>{let a=i.default.get("login_access_token");if(!a)return null;try{let s=await r.default.put("".concat(n.BASE_URL,"publisher-sites/").concat(e,"/"),t,{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}});return d(a=>a.map(a=>a.uid===e?{...a,...t}:a)),s}catch(e){throw console.error("Error updating website:",e),e}},[]),D=(0,l.useCallback)(async e=>{let t=i.default.get("login_access_token");if(!t)return null;try{await r.default.put("".concat(n.BASE_URL,"publisher-sites/").concat(e,"/"),{delete_status:!0},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}}),d(t=>t.filter(t=>t.id!==e))}catch(e){throw console.error("Error deleting website:",e),e}},[]),V=(0,l.useCallback)(e=>{A(e),M(e,_,T)},[M,_,T]),W=(0,l.useCallback)((e,t)=>{N(t),A(1),M(1,t,T)},[M,T]),J=(0,l.useCallback)((e,t,a)=>{let s=e[0];F(s),M(w,_,s)},[M,w,_]),G=(0,l.useCallback)(e=>{e&&e(),F(""),M(w,_,"")},[M,w,_]),H=(0,l.useCallback)(()=>{d([]),p([]),g([]),f(null),b(null),k(0),A(1),N(10),S(!1),F(""),y(null),P.current.clear(),E.current.clear()},[]),Y=(0,l.useMemo)(()=>({websites:a,publisherTasks:u,buyerTasks:m,buyerTasksPaginated:h,publisherTasksPaginated:x,dataCount:j,currentPage:w,pageSize:_,loading:C,searchText:T,apiError:v,fetchWebsites:M,publisher_Tasks:Z,buyer_Tasks:I,buyer_Tasks_Paginated:U,publisher_Tasks_Paginated:B,addWebsite:z,updateWebsite:L,deleteWebsite:D,handlePageChange:V,handlePageSizeChange:W,handleSearch:J,handleReset:G,setSearchText:F,clearWebsiteData:H}),[a,u,m,h,x,j,w,_,C,T,v,M,Z,I,U,B,z,L,D,V,W,J,G,H]);return(0,s.jsx)(c.Provider,{value:Y,children:t})},u=()=>{let e=(0,l.useContext)(c);if(!e)throw Error("useWebsites must be used within a WebsiteProvider");return e}},93131:function(e,t,a){a.d(t,{K:function(){return n}});var s=a(2265),l=a(40525),r=a(38695);let n=()=>{let e=(0,l.C)(e=>e.profile.userdata),t=(0,l.C)(e=>e.profile.loading);return(0,s.useMemo)(()=>(0,r.h)(e,{resolved:!!e&&!t}),[e,t])}},23595:function(e,t,a){a.d(t,{U:function(){return o}});var s=a(2265),l=a(40525),r=a(60937),n=a(64131),i=a(42056);let o=()=>{let e=(0,l.T)(),{userdata:t,userprofile:a,buyerBalance:o,loading:c,error:d}=(0,l.C)(e=>e.profile),{currentRole:u}=(0,i.$)(),p=(0,s.useRef)(!1),m=(0,s.useCallback)(async()=>{try{return await e((0,r.In)()).unwrap()}catch(e){var t;(null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)!==401&&console.error("Failed to fetch profile:",e);return}},[e]);return(0,s.useEffect)(()=>{let e=n.default.get("login_access_token");"publisher"!==u&&(t||c||!e||p.current?!e&&p.current&&(p.current=!1):(p.current=!0,m()))},[t,c,m,u]),{userdata:t,userprofile:a,buyerBalance:o,loading:c,error:d,fetchUsers:m,updateUserData:(0,s.useCallback)(t=>{e((0,r.ck)(t))},[e]),clearUserData:(0,s.useCallback)(()=>{e((0,r.FZ)()),localStorage.removeItem("profile_cache"),localStorage.removeItem("profile_id")},[e])}}},53154:function(e,t,a){a.d(t,{Ac:function(){return c},Us:function(){return o}});var s=a(2265),l=a(83464),r=a(64131),n=a(99551);let i=()=>{let e=r.default.get("login_access_token");return{...e?{Authorization:"Bearer ".concat(e)}:{},"Content-Type":"application/json"}},o=e=>{let t=(e.username||"").trim(),a=(e.message_by||"").trim();return t&&a?"".concat(t," (").concat(a,")"):t||a||(e.is_current_user?"Me":"User")},c=e=>
1{let[t,a]=(0,s.useState)([]),[r,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[u,p]=(0,s.useState)(null),m=(0,s.useRef)(void 0),[g,h]=(0,s.useState)(e);e!==g&&(h(e),null!=e&&""!==e&&e!==m.current&&(a([]),p(null),o(!0)));let f=(0,s.useCallback)(async()=>{var t,s,r,c,d;if(null!=e&&""!==e){m.current=e,o(!0),p(null);try{let s=await l.default.get("".concat(n.BASE_URL,"my-tasks/task_messages/"),{params:{uid:e},headers:i()}),r=Array.isArray(null===(t=s.data)||void 0===t?void 0:t.messages)?s.data.messages:[];a(r)}catch(e){console.error("Failed to fetch task messages:",(null==e?void 0:e.response)||e),p((null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(s=r.data)||void 0===s?void 0:s.error)||(null==e?void 0:null===(d=e.response)||void 0===d?void 0:null===(c=d.data)||void 0===c?void 0:c.message)||"Failed to load messages"),a([])}finally{o(!1)}}},[e]),x=(0,s.useCallback)(async function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"gp",s=(t||"").trim();if(!s)return!1;if(null==e||""===e)return p("Task ID missing. Cannot send message."),!1;d(!0);try{return await l.default.post("".concat(n.BASE_URL,"task-message/"),{task_type:a,task_id:e,message:s},{headers:i()}),await f(),!0}catch(e){var r,o,c,u;return console.error("Error sending task message:",(null==e?void 0:e.response)||e),p((null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:r.error)||(null==e?void 0:null===(u=e.response)||void 0===u?void 0:null===(c=u.data)||void 0===c?void 0:c.message)||"Failed to send message"),!1}finally{d(!1)}},[e,f]);return(0,s.useEffect)(()=>{f()},[f]),{messages:t,messageCount:t.length,unreadCount:t.filter(e=>!e.is_current_user&&!1===e.is_read).length,loading:r,sending:c,error:u,fetchMessages:f,sendMessage:x}}},38695:function(e,t,a){a.d(t,{PD:function(){return c},Rg:function(){return g},YE:function(){return p},h:function(){return o},tw:function(){return m}});var s=a(82374);let l=["admin","member"],r=["pending","approved","rejected","changes_requested","suspended"],n=e=>l.includes(e)?e:null,i=e=>r.includes(e)?e:null,o=(e,t)=>{var a;let l=n(null==e?void 0:e.agency_role),r=i(null==e?void 0:e.agency_status),o="member"===l||"admin"===l,c="approved"===r,d="admin"===l;return{role:l,status:r,isMember:o,isAdmin:d,hasAgencyAccess:s.K&&c&&d,canReachDashboard:s.K&&(d||!o&&null!=r),canRegister:s.K&&!o&&null==r,canEditAgency:s.K&&d&&(c||"changes_requested"===r),canAssignProjects:s.K&&c&&d,isSuspended:"suspended"===r,isResolved:null!==(a=null==t?void 0:t.resolved)&&void 0!==a&&a}};o(null,{resolved:!0});let c=e=>null,d="agencyRole",u="agencyStatus",p=()=>{try{return{agency_role:localStorage.getItem(d),agency_status:localStorage.getItem(u)}}catch(e){return null}},m=e=>{try{let t="string"==typeof e.agency_role?e.agency_role:"",a="string"==typeof e.agency_status?e.agency_status:"";localStorage.setItem(d,t),localStorage.setItem(u,a)}catch(e){}},g=()=>{try{localStorage.removeItem(d),localStorage.removeItem(u)}catch(e){}}},82374:function(e,t,a){a.d(t,{K:function(){return s}});let s=!0},40525:function(e,t,a){a.d(t,{C:function(){return r},T:function(){return l}});var s=a(68575);let l=()=>(0,s.I0)(),r=s.v9},60937:function(e,t,a){a.d(t,{FZ:function(){return u},In:function(){return c},ck:function(){return p}});var s=a(39129),l=a(83464),r=a(64131),n=a(99551),i=a(38695),o=a(51083);let c=(0,s.hg)("profile/fetchProfile",async(e,t)=>{var a,s,i,c,d,u,p,m,g,h,f,x,b,v,y;let{rejectWithValue:j}=t,k=r.default.get("login_access_token");if(!k)return j("No authentication token found");try{let e=await l.default.get("".concat(n.BASE_URL,"marketplace/profile/buyerdashboard/"),{headers:{Authorization:"Bearer ".concat(k),"Content-Type":"application/json"},validateStatus:e=>e<500});if(401===e.status)return(0,o.k)().catch(()=>{}),r.default.remove("login_access_token"),j("Authentication failed");let t=(null===(a=e.data)||void 0===a?void 0:a.profile)||e.data,b=(null===(s=e.data)||void 0===s?void 0:s.about)||{};return{...t,agency_role:null!==(m=null===(i=e.data)||void 0===i?void 0:i.agency_role)&&void 0!==m?m:null,agency_status:null!==(g=null===(c=e.data)||void 0===c?void 0:c.agency_status)&&void 0!==g?g:null,agency_name:null!==(h=null===(d=e.data)||void 0===d?void 0:d.agency_name)&&void 0!==h?h:null,agency_logo:null!==(f=null===(u=e.data)||void 0===u?void 0:u.agency_logo)&&void 0!==f?f:null,is_invite:null!==(x=null===(p=e.data)||void 0===p?void 0:p.is_invite)&&void 0!==x?x:null,gig_publisher_status:b.gig_publisher_status,bio:b.bio,intro_video:b.intro_video,languages:b.languages}}catch(e){if((null===(b=e.response)||void 0===b?void 0:b.status)!==401)return j((null===(y=e.response)||void 0===y?void 0:null===(v=y.data)||void 0===v?void 0:v.message)||"Failed to fetch profile");return j("Authentication required")}}),d=(0,s.oM)({name:"profile",initialState:{userdata:null,userprofile:null,buyerBalance:0,loading:!1,error:null},reducers:{clearProfile:e=>{e.userdata=null,e.userprofile=null,e.buyerBalance=0,e.error=null,e.loading=!1,(0,i.Rg)()},updateProfile:(e,t)=>
1{if(e.userdata){var a;e.userdata={...e.userdata,...t.payload},(null===(a=t.payload.buyer_wallet)||void 0===a?void 0:a.remain_balance)!==void 0&&(e.buyerBalance=t.payload.buyer_wallet.remain_balance)}}},extraReducers:e=>{e.addCase(c.pending,e=>{e.loading=!0,e.error=null}).addCase(c.fulfilled,(e,t)=>{var a,s,l,r,n;e.loading=!1,e.userdata=t.payload,e.userprofile=(null===(a=t.payload)||void 0===a?void 0:a.email)||null,e.buyerBalance=Number((null===(l=t.payload)||void 0===l?void 0:null===(s=l.buyer_wallet)||void 0===s?void 0:s.remain_balance)||0),e.error=null,(0,i.tw)({agency_role:null===(r=t.payload)||void 0===r?void 0:r.agency_role,agency_status:null===(n=t.payload)||void 0===n?void 0:n.agency_status})}).addCase(c.rejected,(e,t)=>{e.loading=!1,e.error=t.payload,e.userdata=null,(0,i.Rg)()})}}),{clearProfile:u,updateProfile:p}=d.actions;t.ZP=d.reducer},99551:function(e,t,a){a.r(t),a.d(t,{BASE_URL:function(){return l}});var s=a(83464);let l="https://www.vefogix.com/api/".replace(/^http:\/\//,"https://");s.default.interceptors.request.use(e=>("string"==typeof e.url&&(e.url=e.url.replace(/^http:\/\//,"https://")),e))},7444:function(e,t,a){a.d(t,{D$:function(){return d},S:function(){return p},dv:function(){return n}});var s=a(64131),l=a(83464),r=a(99551);async function n(){let e=["".concat(r.BASE_URL,"marketplace/firebase/config/"),"".concat(r.BASE_URL,"notifications/firebase-config/"),"".concat(r.BASE_URL,"auth/firebase-config/")],t=!1;for(let r of e)try{let e=await l.default.get(r,{validateStatus:e=>e<500});if(e.status>=200&&e.status<300)return e.data;if(e.status>=400&&e.status<500){e.status;continue}}catch(i){var a,s;let l=null==i?void 0:null===(a=i.response)||void 0===a?void 0:a.status,n=null==i?void 0:null===(s=i.response)||void 0===s?void 0:s.data;if(l>=500){t=!0,r===e[0]&&(console.error("❌ [Firebase] Server error (".concat(l,") at ").concat(r)),console.error("❌ [Firebase] Error details:",{error:(null==n?void 0:n.error)||i.message,detail:(null==n?void 0:n.detail)||"No details available",endpoint:r}),console.error("❌ [Firebase] This indicates a backend server issue. Notifications may not work."));break}if(404===l)continue}return t?console.error("❌ [Firebase] Failed to fetch Firebase config due to server error.\n   Please check the backend logs and ensure:\n   1. The Firebase config endpoint is working correctly\n   2. The backend service is running properly\n   3. The endpoint returns valid Firebase configuration\n   Notifications will not work until this is fixed."):console.warn("⚠️ [Firebase] Failed to fetch Firebase config - no backend endpoint available.\n   The backend needs to implement one of these endpoints:\n   - GET /api/marketplace/firebase/config/\n   - GET /api/notifications/firebase-config/\n   - GET /api/auth/firebase-config/\n   Notifications will not work until this is fixed."),null}let i=!1,o=null,c=null;async function d(e){if(o===e)return;if(i&&c)return c;let t=s.default.get("login_access_token");if(!t){console.warn("No access token found, skipping FCM token registration");return}return i=!0,c=(async()=>{try{let n=["".concat(r.BASE_URL,"marketplace/firebase/fcm-token/"),"".concat(r.BASE_URL,"notifications/fcm-token/"),"".concat(r.BASE_URL,"auth/fcm-token/")],i=!1;for(let r of n)try{let a=await l.default.post(r,{token:e},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},validateStatus:e=>e<500});if(a.status>=200&&a.status<300){o=e;return}if(a.status>=400&&a.status<500){console.warn("⚠️ Client error (".concat(a.status,") at ").concat(r,":"),a.data),a.status;continue}}catch(l){var a,s;let e=null==l?void 0:null===(a=l.response)||void 0===a?void 0:a.status,t=null==l?void 0:null===(s=l.response)||void 0===s?void 0:s.data;if(e>=500){i=!0,console.error("❌ Server error (".concat(e,") at ").concat(r,":"),{error:(null==t?void 0:t.error)||l.message,detail:(null==t?void 0:t.detail)||"No details available",endpoint:r});break}if(404===e)continue;console.warn("⚠️ Error (".concat(e||"unknown",") with ").concat(r,":"),t||l.message)}i?console.error("❌ FCM token registration failed due to server error.\n   Please check the backend logs and ensure:\n   1. The FCMToken model migration is applied\n   2. The database table exists\n   3. The backend service is running correctly"):console.warn("⚠️ FCM token registration failed - no backend endpoint available.\n   The backend needs to implement one of these endpoints:\n   - POST /api/marketplace/firebase/fcm-token/\n   - POST /api/notifications/fcm-token/\n   - POST /api/auth/fcm-token/\n   Notifications will still work via Firebase Realtime Database listeners.")}finally{i=!1,c=null}})()}async function u(e){if(e)return e;if(o)return o;try{var t;let{getMessaging:e,getToken:s,isSupported:l}=await a.e(27012).then(a.bind(a,27012));if(!await l())return null;let r=await n(),i=null==r?void 0:r.vapidKey;if(!i)return null;let{initializeFirebase:o}=await Promise.all([a.e(21401),a.e(27012),a.e(8858)]).then(a.bind(a,8858)),c=await o();if(!c)return null;let d=await (null===(t=navigator.serviceWorker)||void 0===t?void 0:t.getRegistration("/firebase-messaging-sw.js"));return await s(e(c),{vapidKey:i,...d?{serviceWorkerRegistration:d}:{}})||null}catch(e){return null}}async function p(e){try{let i=s.default.get("login_access_token");if(!i)return;let o=await u(e);if(!o)return;let c=["".concat(r.BASE_URL,"marketplace/firebase/fcm-token/"),"".concat(r.BASE_URL,"notifications/fcm-token/"),"".concat(r.BASE_URL,"auth/fcm-token/")],d=!1;for(let e of c)try{let t=await l.default.delete(e,{data:{token:o},headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},validateStatus:e=>e<500});if(t.status>=200&&t.status<300){d=!0;break}if(404===t.status)continue;console.warn("⚠️ Client error (".concat(t.status,") deactivating FCM token at ").concat(e,":"),t.data);continue}catch(l){var t,n;let a=null==l?void 0:null===(t=l.response)||void 0===t?void 0:t.status,s=null==l?void 0:null===(n=l.response)||void 0===n?void 0:n.data;if(a>=500){console.error("❌ Server error (".concat(a,") deactivating FCM token at ").concat(e,":"),{error:(null==s?void 0:s.error)||l.message,detail
1:(null==s?void 0:s.detail)||"No details available",endpoint:e});break}if(404===a)continue;console.warn("⚠️ Error (".concat(a||"unknown",") deactivating FCM token at ").concat(e,":"),s||l.message)}d||console.warn("⚠️ FCM token deactivation failed - the token may stay active on the backend.\n   Expected one of these endpoints to accept DELETE:\n   - DELETE /api/marketplace/firebase/fcm-token/\n   - DELETE /api/notifications/fcm-token/\n   - DELETE /api/auth/fcm-token/");try{let{getMessaging:e,deleteToken:t,isSupported:s}=await a.e(27012).then(a.bind(a,27012));if(await s()){let{initializeFirebase:s}=await Promise.all([a.e(21401),a.e(27012),a.e(8858)]).then(a.bind(a,8858)),l=await s();l&&await t(e(l))}}catch(e){console.warn("⚠️ Failed to delete local FCM token:",(null==e?void 0:e.message)||e)}}catch(e){console.warn("⚠️ FCM token cleanup skipped due to an unexpected error:",(null==e?void 0:e.message)||e)}finally{o=null,i=!1,c=null}}},51083:function(e,t,a){a.d(t,{k:function(){return l}});var s=a(7444);async function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3,t=(async()=>{await (0,s.S)();try{let{resetNotificationFcmToken:e}=await Promise.all([a.e(21401),a.e(27012),a.e(10278),a.e(81803),a.e(64767),a.e(22081)]).then(a.bind(a,64767));e()}catch(e){console.warn("⚠️ Failed to reset chat notification FCM state:",(null==e?void 0:e.message)||e)}})(),l=new Promise(t=>{setTimeout(()=>{console.warn("⚠️ Push notification cleanup timed out after ".concat(e,"ms - continuing logout")),t()},e)});try{await Promise.race([t,l])}catch(e){console.warn("⚠️ Push notification cleanup failed - continuing logout:",(null==e?void 0:e.message)||e)}}},20241:function(e,t){t.Z={src:"/_next/static/media/clutchgray.1972f58b.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAALVBMVEVMaXFLVWJKUmJJVGJNV2VJVGJKU2JMVmRLVmRLVWNGUlhKVGJIW21NWWdRXGw+1s44AAAADnRSTlMAci5J/odAxdynFVoO84xsNkgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA5SURBVHicFcpJEoAwDASx9hbHBOb/z6VylgC3Oi9gqdR+8OzlZmCKyXNF0TJgqT0igNK3b4Y1U84PLLMBTQOlWFMAAAAASUVORK5CYII=",blurWidth:8,blurHeight:8}},82189:function(e,t){t.Z={src:"/_next/static/media/clutchwhite.62ce35bb.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAM1BMVEVMaXH////////////////////////////////////////////////////+/v7///////+MSePHAAAAEXRSTlMAPtOFXzMR/nRItqEo38WKF3QLv78AAAAJcEhZcwAACxMAAAsTAQCanBgAAAA6SURBVHicHclJEoAgEATBAgZ6mkX9/2sNvWYCO+8YQEpSHXTV0iM/8FL840sJFM1uG2jS0XkAr9k2LzLXAX7q4fJBAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},9583:function(e,t){t.Z={src:"/_next/static/media/goodgray.22570bc1.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAMFBMVEVtdIJsdIFtdYJrc39pcX5xeodrdIFpcn9rcoBMaXFsc4FsdIBscn9qcn92f45/iJgN1ukFAAAADnRSTlN6kYM5rdT88W0AQ2Q9ucr1/0kAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA3SURBVHicFcjHDQAgDATBxYGsc//dIuY5LG/fxockFaCYYI6J7GP8oUXKQPMQMqzIUt9c8wN3PTRRAYaaT71JAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},80165:function(e,t){t.Z={src:"/_next/static/media/goodwhite.29c79014.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAKlBMVEX8/Pz6+vv8/P39/f39/f77/Pz7+/v5+/v7/PxMaXH4+Pj39/fz8/b///+RJphdAAAADXRSTlNyhIrY7KM6SrwAKCRbOYGdrwAAAAlwSFlzAAALEwAACxMBAJqcGAAAADZJREFUeJwVyMkNwDAMxEDqtpNs/+0GmhdB7stqntQCdDDzBtnJyD1WEfKNj5KBPCQNXYP73B8xaAFl78pMhQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},22653:function(e,t){t.Z={src:"/_next/static/media/topgray.4dce6751.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAOVBMVEVyfIp9h5NscoJmb31xeYgAAABycnJMaXFzc4JkbXpodYFocX5odIBpc3+Hlp2DjZqGj5xpc4ByfIl6SGH7AAAAE3RSTlMJckNTGAEGABFvH7KInSLEped4TwFDAQAAAAlwSFlzAAALEwAACxMBAJqcGAAAADxJREFUeJwVy0cSwDAIBMERQiwoOPz/sy73vRkDdyQEUoYIq6pqF97Xe3Zzpmw9dxNT+2AuyOrkvyITDX04SQGdee3HTgAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},54600:function(e,t){t.Z={src:"/_next/static/media/topwhite.1ac3dee4.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAKlBMVEX19fVMaXH1+Pj+//74+/v+/v79/v7+///9/f39/f37///////////9/f1KEyGhAAAADnRSTlMKABV6HEtxjaXBIidc5u194SQAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA4SURBVHicHcs5EoAwEMRAzd428P/vUnaijoREB
1BLi9JBe7vUQ73zTHmzlmlViq5s0gXli9zJD0g8ezwDZJKYWiAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}}}]);

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.