1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5503],{1824:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/campaign-builder",function(){return a(97973)}])},39200:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},92761:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},83989:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},60493:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},78865:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4307:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},18289:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},12779:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},92429:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},40976:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])},44976:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},69819:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},20113:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},9475:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},27335:function(e,t,a){"use strict";var s=a(85893),n=a(67294),l=a(41664),r=a.n(l),i=a(39200),o=a(33058),c=a(62190);t.Z=()=>
1{let[e,t]=(0,n.useState)(!1),[a,l]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{(()=>{try{var e,t,a;let s=localStorage.getItem("marketing-content-lab-writing-style"),n=localStorage.getItem("marketing-content-lab-brand-voice");if(s){let t=JSON.parse(s);if((null===(e=t.styleGuide)||void 0===e?void 0:e.primary)&&""!==t.styleGuide.primary&&"Chicago Manual of Style"!==t.styleGuide.primary){l(!0);return}}if(n){let e=JSON.parse(n);if((null===(t=e.brandVoice)||void 0===t?void 0:t.tone)||(null===(a=e.brandVoice)||void 0===a?void 0:a.style)||e.writingStyle){l(!0);return}}l(!1)}catch(e){console.error("Error checking writing style configuration:",e),l(!1)}})()},[]),a||e)?null:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("div",{className:"bg-amber-50 border-l-4 border-amber-500 p-4 mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(i.Z,{className:"w-5 h-5 text-amber-500 mr-3 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-amber-800 font-medium",children:"Enhance Your Content"}),(0,s.jsx)("p",{className:"text-amber-700 text-sm mt-1",children:"We recommend using the Branding Wizard or using the standalone tools to set your brand personality and writing style before generating content."})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-3 ml-4",children:[(0,s.jsxs)(r(),{href:"/walkthrough/1",className:"text-xs bg-amber-100 hover:bg-amber-200 text-amber-800 px-3 py-1.5 rounded flex items-center",children:[(0,s.jsx)(o.Z,{className:"w-3.5 h-3.5 mr-1.5"}),"Start Branding Wizard"]}),(0,s.jsx)("button",{onClick:()=>{t(!0)},className:"text-amber-500 hover:text-amber-700","aria-label":"Dismiss notification",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]})]})})})}},66876:function(e,t,a){"use strict";var s=a(85893),n=a(67294),l=a(40782);a(50897);var r=a(43283),i=a(2553),o=a(62190);t.Z=e=>{let{onContentLoaded:t,setFileName:a,content:c,maxSizeMB:d=5,acceptedFormats:m=".txt,.doc,.docx,.md,.rtf,.html,.csv,.xlsx,.pdf",showExport:u=!0}=e,[g,p]=(0,n.useState)(null),[x,h]=(0,n.useState)(!1),[b,y]=(0,n.useState)(""),f=async e=>{if(e.target.files&&e.target.files[0]){let s=e.target.files[0];if(s.size>1048576*d){y("File size must be less than ".concat(d,"MB"));return}a&&a(s.name),p(s),h(!0),y("");try{let e=await (0,l.P)(s);t(e)}catch(e){console.error("Error reading file:",e),y("Error reading file. Please try again.")}finally{h(!1)}}};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600 mb-2",children:[(0,s.jsx)("strong",{children:"Upload a document:"}),(0,s.jsx)("br",{})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("label",{className:"flex items-center px-4 py-2 bg-blue-50 text-blue-600 rounded-lg cursor-pointer hover:bg-blue-100",children:[(0,s.jsx)(r.Z,{className:"w-5 h-5 mr-2"}),(0,s.jsx)("span",{children:"Upload File"}),(0,s.jsx)("input",{type:"file",onChange:f,className:"hidden",accept:m})]}),g&&(0,s.jsxs)("div",{className:"flex items-center p-2 bg-gray-50 rounded",children:[(0,s.jsx)(i.Z,{className:"w-4 h-4 text-gray-500 mr-2"}),(0,s.jsx)("span",{className:"text-sm text-gray-600",children:g.name}),(0,s.jsx)("button",{onClick:()=>{p(null)},className:"ml-2 text-gray-400 hover:text-red-600",children:(0,s.jsx)(o.Z,{className:"w-4 h-4"})})]}),x&&(0,s.jsx)("div",{className:"text-sm text-blue-600",children:"Loading..."})]}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-2",children:["Supports various formats including"," ",(0,s.jsx)("span",{className:"uppercase",children:m.replaceAll(".","").replaceAll(",",", ")})," ","(max ",d,"MB)"]})]}),b&&(0,s.jsx)("div",{className:"text-sm text-red-600",children:b})]})}},84450:function(e,t,a){"use strict";var s=a(85893),n=a(67294),l=a(60641),r=a(78865),i=a(69819),o=a(61535),c=a(11163),d=a.n(c);t.Z=e=>{let{content:t,title:a,contentType:c="other",metadata:m={},className:u="",variant:g="button",clearAutosavedData:p,redirectAfterSave:x=!0}=e,{saveContent:h}
1=(0,o.mL)(),[b,y]=(0,n.useState)(!1),[f,j]=(0,n.useState)(!1),v="string"==typeof t?t:JSON.stringify(t),N=async()=>{if(console.log("\uD83D\uDD0D Content:",typeof t),console.log("\uD83D\uDD0D Safe Content:",v),v.trim())try{y(!0),await h({content:v.trim(),title:a,contentType:c,metadata:m,category:c,tags:[]}),null==p||p(),x&&d().push("/content-library"),j(!0),setTimeout(()=>j(!1),2e3)}catch(e){console.error("Error saving to library:",e)}finally{y(!1)}};return"icon"===g?(0,s.jsx)("button",{onClick:N,disabled:b||!v.trim()||f,className:"p-2 text-gray-600 hover:text-blue-600 transition-colors disabled:opacity-50 ".concat(u),title:"Save to Content Library",children:b?(0,s.jsx)(l.Z,{className:"w-4 h-4 animate-spin"}):f?(0,s.jsx)(r.Z,{className:"w-4 h-4 text-green-600"}):(0,s.jsx)(i.Z,{className:"w-4 h-4"})}):(0,s.jsx)("button",{onClick:N,disabled:b||f,className:"px-3 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center transition-all ".concat(u),children:b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.Z,{className:"w-4 h-4 mr-2 text-green-600"}),"Saved!"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{className:"w-4 h-4 mr-2"}),"Save to Library"]})})}},76678:function(e,t,a){"use strict";var s=a(85893);a(67294);var n=a(9475),l=a(92429),r=a(92761),i=a(83989);t.Z=e=>{let{title:t,subtitle:a,children:o,currentStep:c,totalSteps:d,onNext:m,onBack:u,onSkip:g,onExit:p,showSkip:x=!1,isWalkthrough:h=!1,nextButtonText:b="Next â",hideExitButton:y=!1,aiInsights:f=[],hideNavigation:j=!1}=e;return(0,s.jsxs)("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[(0,s.jsxs)("div",{className:"mb-6",children:["string"==typeof t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{className:"text-3xl font-bold mb-2",children:t}),a&&(0,s.jsx)("p",{className:"text-gray-600",children:a})]}):t,h&&c&&d&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,s.jsxs)("div",{className:"text-sm text-gray-500",children:["Step ",c," of ",d]}),!y&&p&&(0,s.jsxs)("button",{onClick:p,className:"text-sm text-gray-500 hover:text-gray-700 flex items-center",children:[(0,s.jsx)(n.Z,{className:"w-4 h-4 mr-1"}),"Exit Walkthrough"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,s.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:"".concat(c/d*100,"%")}})})]})]}),f&&f.length>0&&(0,s.jsxs)("div",{className:"mb-8 p-4 bg-indigo-50 rounded-lg border border-indigo-100",children:[(0,s.jsxs)("h3",{className:"font-medium mb-2 flex items-center text-indigo-800",children:[(0,s.jsx)(l.Z,{className:"w-5 h-5 mr-2 text-indigo-500"}),"AI Insights"]}),(0,s.jsx)("ul",{className:"space-y-2",children:f.map((e,t)=>(0,s.jsxs)("li",{className:"text-sm text-indigo-700 flex items-start",children:[(0,s.jsx)("span",{className:"text-indigo-500 mr-2",children:"â¢"}),e]},t))})]}),(0,s.jsx)("div",{className:"mb-8",children:o}),h&&!j&&(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("button",{onClick:u,className:"px-4 py-2 text-gray-600 flex items-center ".concat(u?"":"invisible"),children:[(0,s.jsx)(r.Z,{className:"w-4 h-4 mr-2"}),"Back"]}),(0,s.jsxs)("div",{className:"flex gap-4",children:[x&&g&&(0,s.jsx)("button",{onClick:g,className:"px-4 py-2 text-gray-600 border border-gray-300 rounded-lg hover:bg-gray-50",children:"Skip this step"}),m&&(0,s.jsxs)("button",{onClick:m,className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center",children:[b,!b.includes("â")&&(0,s.jsx)(i.Z,{className:"w-4 h-4 ml-2"})]})]})]})]})}},89346:function(e,t,a){"use strict";a.d(t,{Ol:function(){return l},Zb:function(){return n},aY:function(){return i},ll:function(){return r}});var s=a(85893);a(67294);let n=e=>{let{children:t,className:a="",...n}=e;return(0,s.jsx)("div",{className:"bg-white rounded-lg shadow ".concat(a),...n,children:t})},l=e=>{let{children:t,className:a="",...n}=e;return(0,s.jsx)("div",{className:"p-6 pb-0 ".concat(a),...n,children:t})},r=e=>{let{children:t,className:a="",...n}=e;return(0,s.jsx)("h3",{className:"text-lg font-medium ".concat(a),...n,children:t})},i=e=>{let{children:t,className:a="",...n}=e;return(0,s.jsx)("div",{className:"p-6 ".concat(a),...n,children:t})}},97973:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return O}});var s=a(85893),n=a(67294),l=a(89346),r=a(76678),i=a(66876),o=a(20113),c=a(40976),d=a(60493);let m=(0,a(63759).Z)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var u=a(43283),g=a(33058),p=a(2553),x=a(46611),h=a(4307),b=a(18289),y=a(12779),f=a(44976),j=a(27335),v=a(22155),N=a(13410),w=a(58092),C=a(83582),S=a(50897),k=a(84450),D=a(11163),E=a(39752);let T=e=>{let t=(0,D.useRouter)(),{call:a}=(0,E.k)(),s=(0,n.useRef)(null),l=(0,n.useRef)(null),[r,i]=(0,n.use
1State)(null),[o,c]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),[u,g]=(0,n.useState)(!1),[p,x]=(0,n.useState)("idle"),{contentType:h,saveInterval:b=1e3,dbSaveInterval:y=15e3,restoreOnMount:f=!0,saveKey:j="autosave_".concat(t.asPath.replace(/[^a-zA-Z0-9]/g,"_")),autoSaveToDb:v=!0,onSaveSuccess:N,onSaveError:w}=e,C=(0,n.useRef)("session_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9))),S=(0,n.useCallback)((e,t,a,s)=>{try{let n={content:e,timestamp:Date.now(),contentType:h,sessionId:C.current,formData:t,step:a,title:s};return localStorage.setItem(j,JSON.stringify(n)),i(new Date),m(!0),console.log("\uD83D\uDCBE Auto-saved to localStorage: ".concat(h)),!0}catch(e){return console.error("localStorage auto-save failed:",e),!1}},[j,h]),k=(0,n.useCallback)(async(e,t,s,n)=>{if(!v||u)return!1;try{g(!0),x("saving");let l={content:e,contentType:h,formData:t,step:s,title:n||"Auto-saved ".concat(h),timestamp:new Date().toISOString(),isAutoSave:!0},r=await a("save-content",l);if(r.success)return c(new Date),x("success"),console.log("âï¸ Auto-saved to database: ".concat(h)),null==N||N(),!0;throw Error(r.message||"Save failed")}catch(e){return console.error("Database auto-save failed:",e),402!==e.status&&(x("error"),null==w||w(e)),!1}finally{g(!1)}},[v,h,u,N,w]),T=(0,n.useCallback)((e,t,a,n)=>{s.current&&clearTimeout(s.current),l.current&&clearTimeout(l.current),s.current=setTimeout(async()=>{S(e,t,a,n)&&(null==N||N())},b),v&&(l.current=setTimeout(()=>{k(e,t,a,n)},y))},[b,y,S,k,v,N]),Z=(0,n.useCallback)(async(e,t,a,s)=>{let n=S(e,t,a,s),l=!1;return v&&(l=await k(e,t,a,s)),{localSaved:n,dbSaved:l}},[S,k,v]),A=(0,n.useCallback)(()=>{if(!f)return null;try{let e=localStorage.getItem(j);if(e){let t=JSON.parse(e);if(Date.now()-t.timestamp<864e5)return m(!0),i(new Date(t.timestamp)),console.log("\uD83D\uDD04 Restored from localStorage: ".concat(h)),t;localStorage.removeItem(j)}}catch(e){console.error("Failed to restore from localStorage:",e)}return null},[j,f,h]),P=(0,n.useCallback)(()=>{localStorage.removeItem(j),m(!1),i(null),c(null),x("idle"),console.log("\uD83D\uDDD1ï¸ Cleared auto-save data for: ".concat(h))},[j,h]);(0,n.useEffect)(()=>()=>{s.current&&clearTimeout(s.current),l.current&&clearTimeout(l.current)},[]);let R=(0,n.useCallback)(()=>{let e=r&&Date.now()-r.getTime()<5e3,t=!u,a="error"!==p;return e&&t&&a},[r,u,p]);return{autoSave:T,manualSave:Z,restoreFromLocalStorage:A,clearSavedData:P,hasSavedData:d,lastLocalSave:r,lastDbSave:o,isSavingToDb:u,saveStatus:p,isSafeToNavigate:R,saveKey:j}},Z=()=>{let e=(0,D.useRouter)(),[t,a]=(0,n.useState)(()=>
1new URLSearchParams(window.location.search)),[s,l]=(0,n.useState)({});return{updateUrl:t=>{e.push({pathname:e.pathname,query:{...e.query,...t}},void 0,{shallow:!0,scroll:!1})},getParam:t=>e.query[t]||""}},A=[{id:"awareness",name:"Brand Awareness",description:"Increase visibility and recognition of your brand",icon:(0,s.jsx)(o.Z,{className:"w-8 h-8 text-blue-500"}),recommended:["Blog Posts","Social Posts","Press Release"]},{id:"lead_generation",name:"Lead Generation",description:"Capture interest and information from potential customers",icon:(0,s.jsx)(c.Z,{className:"w-8 h-8 text-green-500"}),recommended:["Email Sequence","Blog Posts","Landing Page","Social Posts"]},{id:"conversion",name:"Sales & Conversion",description:"Turn leads into customers with targeted messaging",icon:(0,s.jsx)(d.Z,{className:"w-8 h-8 text-orange-500"}),recommended:["Email Sequence","Social Posts","Press Release"]},{id:"retention",name:"Customer Retention",description:"Keep existing customers engaged and loyal",icon:(0,s.jsx)(m,{className:"w-8 h-8 text-purple-500"}),recommended:["Email Sequence","Blog Posts","Social Posts"]}],P=[{id:"blog-posts",name:"Blog Posts",description:"SEO-optimized blog content to drive organic traffic",icon:"\uD83D\uDCDD",status:"working",insights:["Blog posts generate 67% more leads than businesses that don't blog","Companies that blog get 97% more links to their website"]},{id:"social-posts",name:"Social Posts",description:"Platform-optimized social content for maximum engagement",icon:"\uD83D\uDCF1",status:"working",insights:["Visual content gets 94% more views than text-only posts","Posts with questions get 23% more engagement"]},{id:"email",name:"Single Email",description:"Individual promotional or announcement emails",icon:"\uD83D\uDCE7",status:"working",insights:["Personalized emails deliver 6x higher transaction rates","A/B testing subject lines can improve open rates by 49%"]},{id:"email-sequence",name:"Email Sequence",description:"Multi-email nurture campaigns (3-7 emails)",icon:"\uD83D\uDCEC",status:"working",insights:["Email sequences convert 320% better than single emails","Nurture campaigns generate 50% more sales-ready leads"]},{id:"press-release",name:"Press Release",description:"Professional press releases for media coverage",icon:"\uD83D\uDCF0",status:"working",insights:["Press releases can increase website traffic by 30%","SEO-optimized press releases improve search rankings by 23%"]},{id:"landing-page",name:"Landing Page",description:"High-converting landing pages for lead capture",icon:"\uD83C\uDFAF",status:"working",insights:["Focused landing pages convert 160% better than generic pages","A/B testing can improve conversion rates by 49%"]},{id:"case-study",name:"Case Study",description:"Customer success stories that build credibility",icon:"\uD83D\uDCCA",status:"working",insights:["Case studies are 13x more effective than other content types","B2B buyers read 3+ case studies before making purchase decisions"]},{id:"video-script",name:"Video Script",description:"Scripts for promotional and educational videos",icon:"\uD83C\uDFAC",status:"coming-soon",insights:["Video content gets 1200% more shares than text","Video marketing increases conversion rates by 80%"]}],R=[{value:3,label:"3-Email Sequence",description:"Quick intro series"},{value:5,label:"5-Email Sequence",description:"Standard nurture campaign"},{value:7,label:"7-Email Sequence",description:"Comprehensive nurture series"}];var O=()=>{let[e,t]=(0,n.useState)(["linkedin","twitter","facebook","instagram"]),[a,o]=(0,n.useState)(3),{showNotification:c}=(0,N.l)(),{updateUrl:m,getParam:O}=Z(),{call:F}=(0,E.k)(),[L,I]=(0,n.useState)(""),[B,M]=(0,n.useState)(""),[q,$]=(0,n.useState)(O("workflow")||null),U=parseInt((0,D.useRouter)().query.step)||1,[z,G]=(0,n.useState)({}
1),[_,Y]=(0,n.useState)(""),[W,H]=(0,n.useState)(""),[J,V]=(0,n.useState)(""),[K,Q]=(0,n.useState)(null),[X,ee]=(0,n.useState)(!1),[et,ea]=(0,n.useState)(O("campaignType")||null),[es,en]=(0,n.useState)(O("campaignName")||""),[el,er]=(0,n.useState)(""),[ei,eo]=(0,n.useState)(""),[ec,ed]=(0,n.useState)([]),[em,eu]=(0,n.useState)(""),[eg,ep]=(0,n.useState)([]),[ex,eh]=(0,n.useState)(5),[eb,ey]=(0,n.useState)("professional"),[ef,ej]=(0,n.useState)(!1),[ev,eN]=(0,n.useState)(null),[ew,eC]=(0,n.useState)(null),[eS,ek]=(0,n.useState)(!1),{autoSave:eD,restoreFromLocalStorage:eE}=T({contentType:"campaign-builder",saveInterval:1e3,autoSaveToDb:!1});(0,n.useEffect)(()=>{let e={workflowType:q,step:U,campaignType:et,campaignName:es,campaignPurpose:L,campaignGoal:el,targetAudience:ei,keyThemes:ec,additionalThemes:em,selectedContentTypes:eg,emailSequenceLength:ex,uploadedContent:_,uploadedFileName:W,contentAnalysis:K,callToAction:B,tone:eb,generatedCampaign:ev};eD(e,e,U)},[q,U,et,es,L,el,ei,ec,em,eg,ex,_,W,K,B,eb,ev]),(0,n.useEffect)(()=>{console.log("\uD83D\uDD0D RESTORE: useEffect running");let e=eE();if(console.log("\uD83D\uDD0D RESTORE: restored data:",e),null==e?void 0:e.formData)try{let t=e.formData;console.log("\uD83D\uDD0D RESTORE: parsed data:",t),console.log("\uD83D\uDD0D RESTORE: about to set workflowType to:",t.workflowType),console.log("\uD83D\uDD0D RESTORE: about to set step to:",t.step),t.workflowType&&$(t.workflowType),t.step&&t.step!==U&&eA(t.step),er(t.campaignGoal||""),I(t.campaignPurpose||""),eo(t.targetAudience||""),ed(t.keyThemes||[]),eu(t.additionalThemes||""),ep(t.selectedContentTypes||[]),eh(t.emailSequenceLength||5),M(t.callToAction||""),ey(t.tone||"professional"),t.uploadedContent&&Y(t.uploadedContent),t.uploadedFileName&&H(t.uploadedFileName),t.generatedCampaign&&eN(t.generatedCampaign),t.contentAnalysis&&Q(t.contentAnalysis),console.log("\uD83D\uDD0D RESTORE: finished setting all values")}catch(e){console.log("â RESTORE: Could not restore form data",e)}else console.log("\uD83D\uDD0D RESTORE: No saved data found")},[]),(0,n.useEffect)(()=>{let e=()=>{let e=new URLSearchParams(window.location.search);$(e.get("workflow")||null),ea(e.get("campaignType")||null),en(e.get("campaignName")||"")};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,n.useEffect)(()=>{(async()=>{try{var e,t;let a=await C.Z.getAllStrategicData();eC(a),ek(!!((null==a?void 0:null===(e=a.product)||void 0===e?void 0:e.name)||(null==a?void 0:null===(t=a.audiences)||void 0===t?void 0:t.length)))}catch(e){console.error("Error loading strategic data:",e)}})()},[]);let eT=async(e,t)=>{if("string"==typeof e)Y(e),H(t||"Uploaded Content"),c("File content loaded successfully","success"),await eZ(e);else{let a=JSON.stringify(e,null,2);Y(a),H(t||"Uploaded Data"),c("Structured content loaded successfully","success"),await eZ(a)}},eZ=async e=>{ee(!0);try{let t=await F("content-analysis",{content:e,fileName:W});if(console.log("Content Analysis:",t),Q(t),t.keyThemes&&ed(t.keyThemes),t.recommendedCampaignType){ea(t.recommendedCampaignType),console.log("Recommended campaign type:",t.recommendedCampaignType);let e=["Email Sequence","Blog Posts","Social Posts"];"awareness"===t.recommendedCampaignType?e=["Blog Posts","Social Posts","Press Release"]:"retention"===t.recommendedCampaignType&&(e=["Email Sequence","Blog Posts"]),console.log("Recommended types before filtering:",e),console.log("ENHANCED_CONTENT_TYPES:",P),console.log("ENHANCED_CONTENT_TYPES names and statuses:",P.map(e=>({name:e.name,status:e.status})));let a=e.filter(e=>P.find(t=>t.name===e&&"working"===t.status));console.log("Available recommended after filtering:",a),console.log("Setting selectedContentTypes to:",a),ep(a)}Q(t),c("⨠Content analyzed! Review AI suggestions below and customize as needed.","success"),c("⨠Content analyzed! Check the recommendations below.","success")}catch(e){console.error("Error analyzing content:",e),e instanceof Error&&402===e.status?console.log("Subscription required - modal already displayed"):c("Analysis failed, but you can still proceed manually","warning")}finally{ee(!1)}},eA=e=>{m({step:e.toString()})},eP=e=>{$(e),e&&eA(1),m({workflow:e||"",step:"1"})},eR=e=>{ea(e),m({campaignType:e});let t=A.find(t=>
1t.id===e);(null==t?void 0:t.recommended)&&ep(t.recommended.filter(e=>P.find(t=>t.name===e&&"working"===t.status)))},eO=e=>{ep(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eF=(e,t)=>{if(!e)return e;let a=e;return a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/^H1:\s*(.+)$/gm,"# $1")).replace(/^H1 HEADING:\s*(.+)$/gm,"# $1")).replace(/^H2:\s*(.+)$/gm,"## $1")).replace(/^H3:\s*(.+)$/gm,"### $1")).replace(/^Subheading:\s*(.+)$/gm,"## $1")).replace(/^([A-Z][A-Z\s&-]{8,80})$/gm,"\n\n## $1\n\n")).replace(/([.!?])\s*([A-Z][a-z]+(?:\s+[A-Z][a-z]*)*:?\s*[A-Z][A-Za-z\s]{20,80})\s*([A-Z])/gm,"$1\n\n## $2\n\n$3")).replace(/^(\*\*)?Call To Action(\*\*)?\s*$/gm,"")).replace(/^Strong Conclusion.*$/gm,"")).replace(/^Strong conclusion.*$/gm,"")).replace(/^STRONG CONCLUSION.*$/gm,"")).replace(/^\*\*Strong Conclusion\*\*.*$/gm,"")).replace(/^Strong Conclusion.*$/gm,"")).replace(/^CONCLUSION\s*$/gm,"## Key Takeaways")).replace(/^Conclusion\s*$/gm,"## Key Takeaways")).replace(/^Engaging Opening.*$/gm,"## Introduction")).replace(/^Engaging opening\s*$/gm,"## Introduction")).replace(/^Engaging opening:\s*$/gm,"")).replace(/\n{3,}/g,"\n\n")).replace(/^[-*_=]{3,}.*$/gm,"")).replace(/â{3,}/g,"")).replace(/^[âââ-]{3,}.*$/gm,"")).replace(/^([A-Z][A-Za-z\s]{10,80})$/gm,"## $1"),("email"===t||"Email"===t)&&(a=(a=(a=a.replace(/^#+\s*/gm,"")).replace(/\*\*(.*?)\*\*/g,"$1")).replace(/\*(.*?)\*/g,"$1")),a.trim()};function eL(e,t){if(!t)return e;switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"sentence":return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();case"title":return e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());default:return e}}let eI=async()=>{ej(!0);try{let i={};for(let o of(c("\uD83D\uDE80 Generating campaign content...","info"),eg)){console.log("\uD83C\uDFAF Generating ".concat(o));try{var e,t,s,l,r;if("Blog Posts"===o){let e=B||"Contact us to learn more",t={campaignData:{name:L||"Generated Content",type:"Blog Posts",targetAudience:ei||"general audience",keyMessages:[...ec,...em.split(",").map(e=>e.trim()).filter(e=>e)],tone:eb||"professional",style:"humorous"===eb?"comedy":"professional",mood:"humorous"===eb?"funny":"professional"},contentTypes:["Blog Posts"],writingStyle:(null==ew?void 0:ew.writingStyle)||{styleGuide:{primary:null,customRules:[],completed:!0},formatting:{headingCase:null,numberFormat:null,dateFormat:null,listStyle:null},punctuation:{oxfordComma:null,hyphenation:null},completed:!0},strategicData:ew,uploadedContent:_,callToAction:e},a=(await F("enhance",t))["Blog Posts"];if(a){let e=a.content||a,t=function(e,t){var a,s,l,r;if(!e)return null;let i=eF(e,"blog-post").split("\n").map(e=>e.trim()),o=[],c=[],d=()=>{c.length>0&&(o.push(n.createElement("p",{key:o.length,className:"mb-4 leading-relaxed text-gray-700"},c.join(" "))),c=[])},m=/^(Download|Get|Grab|Sign\s*up|Register|Join|Start|Try|Book|Request|See|Explore|Learn\s*more|Talk|Schedule|Subscribe|Contact|Buy|Shop|Claim|Watch|Read)\b/i,u=i.findIndex(e=>e.length>0);if(-1!==u&&!i[u].startsWith("#")){let e=i[u];o.push(n.createElement("h1",{key:o.length,className:"text-3xl font-bold mb-6 mt-8 text-gray-900 leading-tight"},eL(e,null==t?void 0:null===(a=t.formatting)||void 0===a?void 0:a.headingCase))),i[u]=""}for(let e=0;e<i.length;e++){let a=i[e];if(!a){d();continue}if(m.test(a)){d(),o.push(n.createElement("p",{key:o.length,className:"mt-4 font-semibold text-gray-900"},a));continue}if(a.startsWith("# ")){d();let e=a.substring(2).trim();o.push(n.createElement("h1",{key:o.length,className:"text-3xl font-bold mb-6 mt-8 text-gray-900 leading-tight"},eL(e,null==t?void 0:null===(s=t.formatting)||void 0===s?void 0:s.headingCase)));continue}if(a.startsWith("## ")){d();let e=a.substring(3).trim();o.push(n.createElement("h2",{key:o.length,className:"text-xl font-semibold mb-4 mt-6 text-gray-900 leading-tight"},eL(e,null==t?void 0:null===(l=t.formatting)||void 0===l?void 0:l.headingCase)));continue}if(a.startsWith("### ")){d();let e=a.substring(4).trim();o.push(n.createElement("h3",{key:o.length,className:"text-lg font-semibold mb-3 mt-6 text-gray-900 leading-tight"},eL(e,null==t?void 0:null===(r=t.formatting)||void 0===r?void 0:r.headingCase)));continue}c.push(a)}return d(),n.createElement("div",{},o)}
1(e,null==ew?void 0:ew.writingStyle);i[o]={title:a.title||"Generated Blog Post",content:t,type:"blog-post",isFormatted:!0}}}else if("Single Email"===o){let e=await F("email-generation",{topic:L||"Important update",goal:el||L||"Convert visitors into leads",audience:ei||"professional audience",tone:eb||"professional",maxWords:150,callToAction:B||"Learn more"}),t=eF(e.content,"email");i[o]={title:"Email Content",content:t,type:"email"}}else if("Email Sequence"===o){let e=await F("email-nurture-flow",{campaignName:es||"Email Campaign",audience:ei||"professional audience",keyMessages:[...ec,...em.split(",").map(e=>e.trim()).filter(e=>e),L],goal:el||L||"Convert visitors into leads",campaignType:et,numEmails:ex,callToAction:B||"Learn more"}),t=e.nurtureFlow||e.content;t=t.replace(/^EMAIL NURTURE FLOW:([\s\S]*?\n){4}/,""),i[o]={title:"Email Sequence (".concat(ex," emails)"),content:t,type:"email-sequence"}}else if("Social Posts"===o){let e=await F("social-media",{content:L||"Content topic",platforms:["linkedin","twitter","facebook"],tone:eb||"professional",includeHashtags:!0,includeEmojis:!1,callToAction:B||"Learn more",strategicData:ew,numVariations:a||2}),t="";t=e&&e.socialPosts&&"object"==typeof e.socialPosts?Object.entries(e.socialPosts).map(e=>{let[t,a]=e,s=Array.isArray(null==a?void 0:a.variations)?a.variations:[],n="";return n=s.length>0?s.map(e=>"string"==typeof e?e:e.content).join("\n\n"):(null==a?void 0:a.content)||a,"string"==typeof n&&(n=n.trim()),"".concat(t.toUpperCase(),":\n").concat(n)}).join("\n\n---\n\n"):e&&"string"==typeof e.content?e.content:"No social posts generated. Please check the API response.",i[o]={title:"Social Media Posts",content:t,type:"social-media"}}else if("Press Release"===o){let a="Your Company";if(null==ew?void 0:null===(e=ew.product)||void 0===e?void 0:e.name)a=ew.product.name;else if(null==ew?void 0:null===(t=ew.company)||void 0===t?void 0:t.name)a=ew.company.name;else{let e=localStorage.getItem("marketingProduct");if(e)try{let t=JSON.parse(e);(null==t?void 0:t.name)&&(a=t.name)}catch(e){}}let n="Media Relations Department",l="(555) 123-4567",r="[email protected]";(null==ew?void 0:null===(s=ew.company)||void 0===s?void 0:s.contact)&&(n=ew.company.contact.name||n,l=ew.company.contact.phone||l,r=ew.company.contact.email||r);let c="Write a professional press release using this information:\n COMPANY: ".concat(a,"\n ANNOUNCEMENT: ").concat(L,"\n KEY THEMES: ").concat(ec.join(", "),"\n TARGET AUDIENCE: ").concat(ei,'\n \n STRUCTURE:\n - Start with "FOR IMMEDIATE RELEASE"\n - Include dateline with city\n - Write compelling headline\n - Lead paragraph with who, what, when, where, why\n - Supporting paragraphs with details and quotes\n - Company boilerplate paragraph\n - MANDATORY: End with media contact information:\n \n Media Contact:\n ').concat(n,"\n ").concat(a,"\n Phone: ").concat(l,"\n Email: ").concat(r,"\n \n Use proper press release format and professional tone."),d=await F("improve",{content:_||"",instructions:c,strategicContext:{productName:a,audience:"media and stakeholders",tone:eb||"professional",...ew}});i[o]={title:"Press Release",content:eF(d.content||d,"press-release"),type:"press-release"}}else if("Landing Page"===o){let e=[...ec,...em.split(",").map(e=>e.trim()).filter(e=>e)],t=await F("landing-page",{title:L||es||"Landing Page",goal:el||L||"Convert visitors into leads",bullet1:e[0]||"",bullet2:e[1]||"",bullet3:e[2]||"",bullet4:e[3]||"",bullet5:e[4]||"",callToAction:B||"Get Started",additionalDetails:_||"",audience:ei||"marketers",tone:eb||"professional"});i[o]={title:"Landing Page",content:t.content,type:"landing-page"}}else if("Case Study"===o){let e=[...ec,...em.split(",").map(e=>e.trim()).filter(e=>e)],t=await F("case-study",{customerName:ei||"Customer",company:(null==ew?void 0:null===(l=ew.product)||void 0===l?void 0:l.name)||"Client Company",problem:L||_||"Business challenge",solution:e.join(", ")||"Solution provided",results:el||"Positive outcomes achieved",quote:"",quoteSpeaker:"",additionalDetails:_||"",audience:ei||"business leaders",tone:eb||"professional"});i[o]={title:"Case Study: ".concat((null==ew?void 0:null===(r=ew.product)||void 0===r?void 0:r.name)||"Customer Success"),content:t.content,type:"case-study"}}else{let e=o.toLowerCase().replace(" ","-"),t={campaignData:{name:L||"Generated Content",type:e,goal:L||"Create engaging content",targetAudience:ei||"general audience",keyMessages:[...ec,...em.split(",").map(e=>e.trim()).filter(e=>e)],callToAction:B||"Learn more"}
1,contentTypes:[e],writingStyle:null==ew?void 0:ew.writingStyle,strategicData:ew,specialInstructions:L?"".concat(L,". Follow these instructions precisely."):void 0},a=(await F("enhance",t))[e];if(a){let t=a.content||a,s=eF(t,e);i[o]={title:a.title||"Generated ".concat(o),content:s,type:e}}}console.log("â
Generated ".concat(o," successfully"))}catch(t){console.error("â Failed to generate ".concat(o,":"),t);let e="Unknown error";t instanceof Error&&(e=t.message),i[o]={title:"".concat(o," - Generation Failed"),content:"Failed to generate ".concat(o,". Error: ").concat(e),type:"error"}}}console.log("\uD83C\uDF89 Campaign generation complete. Results:",Object.keys(i)),eN(i),eA("upload"===q?4:3),c("\uD83C\uDF89 Campaign generated successfully!","success")}catch(e){console.error("â Error generating campaign:",e),c("Failed to generate campaign. Please try again.","error")}finally{ej(!1)}},eB=()=>{$(null),Y(""),H(""),Q(null),ea(null),en(""),er(""),eo(""),ed([]),eu(""),ep([]),eN(null),I(""),M(""),ey("professional"),m({workflow:"",step:"",campaignType:"",campaignName:""}),localStorage.removeItem("campaignBuilderData"),c("Campaign builder reset","info")},eM=()=>{if(!et)return"Not Selected";let e=A.find(e=>e.id===et);return e?e.name:et},eq=()=>(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsx)("div",{className:"text-center mb-8",children:(0,s.jsx)("h2",{className:"text-2xl font-bold mb-11",children:" "})}),(0,s.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,s.jsxs)(l.Zb,{className:"cursor-pointer transition-all hover:shadow-xl hover:border-blue-500 border-2 bg-gradient-to-br from-blue-50 to-purple-50",onClick:()=>eP("upload"),children:[(0,s.jsxs)(l.Ol,{className:"text-center pb-4",children:[(0,s.jsx)("div",{className:"mx-auto mb-4 p-4 bg-blue-600 rounded-full w-16 h-16 flex items-center justify-center",children:(0,s.jsx)(u.Z,{className:"w-8 h-8 text-white"})}),(0,s.jsx)(l.ll,{className:"text-xl mb-2",children:"Upload Content & Build Campaign"})]}),(0,s.jsxs)(l.aY,{className:"text-center",children:[(0,s.jsx)("p",{className:"text-gray-700 mb-4",children:"Upload an eBook, white paper, or any content piece and let AI create an entire campaign around it."}),(0,s.jsxs)("div",{className:"bg-white p-4 rounded-lg mb-4",children:[(0,s.jsx)("h4",{className:"font-medium mb-2",children:"What you get:"}),(0,s.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,s.jsx)("li",{children:"⢠AI content analysis & theme extraction"}),(0,s.jsx)("li",{children:"⢠Recommended campaign strategy"}),(0,s.jsx)("li",{children:"⢠All assets based on your content"}),(0,s.jsx)("li",{children:"⢠Coordinated messaging across channels"})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-center text-blue-600",children:[(0,s.jsx)(g.Z,{className:"w-4 h-4 mr-1"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:"AI-Powered"})]})]})]})})]}),e$=()=>{var e,t,a;return(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Upload Your Content"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Upload an eBook, white paper, or any content to build your campaign around"})]}),(0,s.jsxs)(l.Zb,{className:"max-w-2xl mx-auto",children:[(0,s.jsx)(l.Ol,{children:(0,s.jsxs)(l.ll,{className:"flex items-center",children:[(0,s.jsx)(p.Z,{className:"w-6 h-6 text-blue-600 mr-2"}),"Upload Content File"]})}),(0,s.jsxs)(l.aY,{children:[(0,s.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 border border-gray-200 rounded-lg",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Paste your content here:"}),(0,s.jsx)("textarea",{value:J,onChange:e=>V(e.target.value),className:"w-full p-3 border border-gray-300 rounded-lg resize-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",rows:6,placeholder:"Paste your content here and click 'Use Pasted Content'"}),J&&(0,s.jsxs)("button",{onClick:()=>{eT(J,"Pasted Content"),V("")},className:"mt-3 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center text-sm",children:[(0,s.jsx)(p.Z,{className:"w-4 h-4 mr-2"}),"Use Pasted Content"]})]}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-1 border-t border-gray-300"}),(0,s.jsx)("span",{className:"px-3 text-sm text-gray-500",children:"OR"}),(0,s.jsx)("div",{className:"flex-1 border-t border-gray-300"})]}),(0,s.jsx)(i.Z,{onContentLoaded:eT,content:_}),_&&(0,s.jsxs)("div",{className:"mt-6 p-4 bg-green-50 border border-green-200 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center text-green-700 mb-2",children:[(0,s.jsx)(d.Z,{className:"w-5 h-5 mr-2"}),(0,s.jsx)("span",{className:"font-medium",children:W})]}),(0,s.jsxs)("p",{className:"text-sm text-green-600",children:[_.length," characters loaded"]})]})]})]}),X&&(0,s.jsx)(l.Zb,{className:"max-w-2xl mx-auto",children:(0,s.jsxs)(l.aY,{className:"p-8 text-center",children:[(0,s.jsx)("div",{className:"animate-spin w-8 h-8 border-4 border-blue-600 border-t-transparent roun
1ded-full mx-auto mb-4"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Analyzing your content..."})]})}),K&&(0,s.jsxs)(l.Zb,{className:"max-w-4xl mx-auto border-2 border-blue-300",children:[(0,s.jsx)(l.Ol,{className:"bg-blue-50",children:(0,s.jsxs)(l.ll,{className:"flex items-center",children:[(0,s.jsx)(x.Z,{className:"w-6 h-6 text-blue-600 mr-2"}),"AI Content Analysis"]})}),(0,s.jsxs)(l.aY,{className:"p-6",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium mb-3",children:"Key Themes Detected:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mb-4",children:null===(e=K.keyThemes)||void 0===e?void 0:e.map((e,t)=>(0,s.jsx)("span",{className:"px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm",children:e},t))}),(0,s.jsx)("h4",{className:"font-medium mb-2",children:"Recommended Campaign Type:"}),(0,s.jsxs)("div",{className:"p-3 bg-green-50 border border-green-200 rounded-lg",children:[(0,s.jsx)("span",{className:"font-medium text-green-700",children:(null===(t=A.find(e=>e.id===K.recommendedCampaignType))||void 0===t?void 0:t.name)||"Lead Generation"}),(0,s.jsx)("p",{className:"text-sm text-green-600 mt-1",children:"You can change this on the next step"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium mb-2",children:"Target Audience:"}),(0,s.jsx)("p",{className:"text-gray-700 mb-4",children:K.targetAudience}),(0,s.jsx)("h4",{className:"font-medium mb-2",children:"Suggested Campaign Name:"}),(0,s.jsx)("p",{className:"text-gray-700",children:K.suggestedCampaignName})]})]}),(null===(a=K.socialQuotes)||void 0===a?void 0:a.length)>0&&(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t",children:[(0,s.jsx)("h4",{className:"font-medium mb-3",children:"Compelling Quotes for Social:"}),(0,s.jsx)("div",{className:"space-y-2",children:K.socialQuotes.map((e,t)=>(0,s.jsx)("div",{className:"p-3 bg-gray-50 rounded-lg border-l-4 border-blue-500",children:(0,s.jsxs)("p",{className:"text-gray-700 italic",children:['"',e,'"']})},t))})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between max-w-4xl mx-auto",children:[(0,s.jsx)("button",{onClick:()=>eP(null),className:"px-6 py-2 border border-gray-300 rounded-lg hover:bg-gray-50",children:"Back to Start"}),(0,s.jsxs)("button",{onClick:()=>eA(2),disabled:!_,className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed flex items-center",children:["Continue to Campaign Setup ",(0,s.jsx)(h.Z,{className:"ml-2 w-4 h-4"})]})]})]})},eU=()=>(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)(l.Zb,{children:[(0,s.jsx)(l.Ol,{children:(0,s.jsx)(l.ll,{children:"Campaign Type & Strategy"})}),(0,s.jsxs)(l.aY,{children:["upload"===q&&(null==K?void 0:K.recommendedCampaignType)&&(0,s.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,s.jsxs)("p",{className:"text-blue-700",children:[(0,s.jsx)("strong",{children:"AI Recommendation:"})," Based on your content, we suggest a ",(0,s.jsx)("strong",{children:eM()})," campaign. You can change this below."]})}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:A.map(e=>(0,s.jsx)("div",{className:"p-4 cursor-pointer transition-all rounded-lg border-2 ".concat(et===e.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-blue-300"),onClick:()=>eR(e.id),children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("input",{type:"radio",name:"campaignType",checked:et===e.id,onChange:()=>eR(e.id),className:"mt-1"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:e.name}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:e.description}),(0,s.jsxs)("div",{className:"text-xs text-blue-600",children:["Recommended: ",e.recommended.join(", ")]})]})]})},e.id))})]})]}),(0,s.jsxs)(l.Zb,{children:[(0,s.jsx)(l.Ol,{children:(0,s.jsx)(l.ll,{children:"Campaign Details"})}),(0,s.jsxs)(l.aY,{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Campaign Name 2"}),(0,s.jsx)("input",{type:"text",value:es,onChange:e=>{en(e.target.value),m({campaignName:e.target.value})},className:"w-full p-3 border rounded-lg",placeholder:"Enter a descriptive name for your campaign"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Campaign Purpose/Focus"}),(0,s.jsx)("textarea",{value:L,onChange:e=>I(e.target.value),className:"w-full p-3 border rounded-lg h-24",placeholder:"What is this campaign for? (e.g., eBook download, product launch, lead generation, webinar promotion)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Target Audience"}),(0,s.jsx)("textarea",{value:ei,onChange:e=>eo(e.target.value),className:"w-full p-3 border rounded-lg h-24",placeholder:"Describe your target audience (job titles, industries, pain points, etc.)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Call to Action (CTA)"}),(0,s.jsx)("input",{type:"text",value:B,onChange:e=>M(e.target.value),className:"w-full p-3 border rounded-lg",placeholder:"What action should people take? (e.g., Download our eBook, Sign up for webinar, Contact us for demo)"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"This will be included in your content where appropriate"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Tone"}),(0,s.jsxs)("select",{value:eb,onChange:e=>ey(e.target.value),className:"w-full p-3 border rounded-lg",children:[(0,s.jsx)("option",{value:"professional",children:"Professional"}),(0,s.jsx)("option",{value:"casual",children:"Casual"}),(0,s.jsx)("option",{value:"friendly",children:"Friendly"}),(0,s.jsx)("option",{value:"authoritative",children:"Authoritative"}),(0,s.jsx)("option",{value:"conversational",children:"Conversational"}),(0,s.jsx)("option",{value:"humorous",children:"Funny"})]}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Choose the tone for your content"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Key Themes"}),ec.length>0&&(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:"Detected themes:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:ec.map((e,t)=>(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 text-green-700 rounded-full text-sm",children:e},t))})]}),(0,s.jsx)("input",{type:"text",value:em,onChange:e=>eu(e.target.value),className:"w-full p-3 border rounded-lg",placeholder:"Add additional themes or keywords (comma-separated)"})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("button",{onClick:()=>eA(1),className:"px-6 py-2 border border-gray-300 rounded-lg hover:bg-gray-50",children:"Back"}),(0,s.jsxs)("button",{onClick:()=>eA("upload"===q?3:2),disabled:!et||!es,className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-300 flex items-center",children:["Continue to Content Selection"," ",(0,s.jsx)(h.Z,{className:"ml-2 w-4 h-4"})]})]})]}),ez=()=>{var e;return(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)(l.Zb,{children:[(0,s.jsx)(l.Ol,{children:(0,s.jsx)(l.ll,{children:"Select your content types below. Use our recommendations or choose your own:"})}),(0,s.jsxs)(l.aY,{children:["upload"===q&&K&&(0,s.jsxs)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-blue-800 mb-3",children:"\uD83C\uDFAF AI Recommendations for Your Content:"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm text-blue-700 mb-2",children:[(0,s.jsx)("strong",{children:"Recommended Campaign Type:"})," ",eM()]}),(0,s.jsx)("p",{className:"text-sm text-blue-700",children:(0,s.jsx)("strong",{children:"Suggested Content Types:"})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eg.map(e=>(0,s.jsx)("span",{className:"px-2 py-1 bg-blue-100 text-blue-700 rounded text-xs",children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-blue-700 mb-2",children:(0,s.jsx)("strong",{children:"Based on your content themes:"})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:null===(e=K.keyThemes)||void 0===e?void 0:e.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-1 bg-green-100 text-green-700 rounded text-xs",children:e},t))})]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:P.map(e=>(0,s.jsxs)("div",{className:"relative p-4 border-2 rounded-lg transition-all ".concat("coming-soon"===e.status?"border-gray-200 bg-gray-50 opacity-75":eg.includes(e.name)?"border-blue-500 bg-blue-50 cursor-pointer":"border-gray-200 hover:border-blue-300 cursor-pointer"),onClick:()=>{"working"===e.status&&eO(e.name)}
1,children:["coming-soon"===e.status&&(0,s.jsx)("div",{className:"absolute top-2 right-2 bg-orange-100 text-orange-700 px-2 py-1 rounded-full text-xs font-medium",children:"Coming Soon"}),"working"===e.status&&eg.includes(e.name)&&(0,s.jsx)("div",{className:"absolute top-2 right-2",children:(0,s.jsx)(d.Z,{className:"w-5 h-5 text-blue-600"})}),(0,s.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[(0,s.jsx)("span",{className:"text-2xl",children:e.icon}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:e.name}),(0,s.jsx)("p",{className:"text-sm text-gray-600",children:e.description})]})]}),"email-sequence"===e.id&&eg.includes(e.name)&&(0,s.jsxs)("div",{className:"mt-4 p-3 bg-white border rounded-lg",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Sequence Length"}),(0,s.jsx)("select",{value:ex,onChange:e=>eh(parseInt(e.target.value)),className:"w-full p-2 border rounded text-sm",onClick:e=>e.stopPropagation(),children:R.map(e=>(0,s.jsxs)("option",{value:e.value,children:[e.label," - ",e.description]},e.value))})]}),(0,s.jsxs)("div",{className:"mt-3 text-xs text-gray-500",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"\uD83D\uDCA1 Insights:"}),(0,s.jsx)("ul",{className:"space-y-1",children:e.insights.slice(0,1).map((e,t)=>(0,s.jsxs)("li",{children:["⢠",e]},t))})]})]},e.id))}),eg.length>0&&(0,s.jsxs)("div",{className:"mt-6 p-4 bg-green-50 border border-green-200 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-green-800 mb-2",children:"Selected Content Types:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:eg.map(e=>(0,s.jsxs)("span",{className:"px-3 py-1 bg-green-100 text-green-700 rounded-full text-sm",children:[e,"Email Sequence"===e&&" (".concat(ex," emails)")]},e))})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("button",{onClick:()=>eA("upload"===q?2:1),className:"px-6 py-2 border border-gray-300 rounded-lg hover:bg-gray-50",children:"Back"}),(0,s.jsx)("button",{onClick:eI,disabled:0===eg.length||ef,className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-300 flex items-center",children:ef?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}),"Generating Campaign..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.Z,{className:"w-4 h-4 mr-2"}),"Generate Campaign"]})})]})]})},eG=()=>{let e=e=>{G(t=>({...t,[e]:!t[e]}))},t=(e,t)=>{let a="string"==typeof t?t:t.content||JSON.stringify(t,null,2);navigator.clipboard.writeText(a),c("".concat(e," copied to clipboard"),"success")},a=(t,a,s)=>{if(!a){c("No content to export","error");return}let n="".concat(t.toLowerCase().replace(" ","-"),"-").concat(es?es.toLowerCase().replace(" ","-"):"campaign","-").concat(new Date().toISOString().slice(0,10)),l="string"==typeof a?a:a.content||JSON.stringify(a,null,2);l=l.replace(/^[-*_]{3,}\s*$/gm,"").replace(/^[=]{3,}\s*$/gm,"").replace(/%{2,}/g,"").replace(/\n{3,}/g,"\n\n").trim();try{switch(s){case"txt":default:(0,S.QM)(l,"".concat(n,".txt"));break;case"pdf":(0,S.Fk)(l,"".concat(n,".pdf"));break;case"docx":(0,S.uk)(l,"".concat(n,".docx"))}c("".concat(t," exported as ").concat(s.toUpperCase()),"success"),e(t)}catch(e){console.error("Export error:",e),c("Export failed. Please try again.","error")}};return console.log("generatedCampaign:",ev),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"\uD83C\uDF89 Campaign Generated Successfully!"}),(0,s.jsxs)("p",{className:"text-lg text-gray-600",children:["Your ",(0,s.jsx)("strong",{children:eM()}),' campaign "',(0,s.jsx)("strong",{children:es}),'" is ready']})]}),ev&&(0,s.jsx)("div",{className:"space-y-6",children:Object.entries(ev).flatMap(n=>{let[r,i]=n;return r.toLowerCase().includes("social")&&i.socialPosts?Object.entries(i.socialPosts).map(e=>{let[t,a]=e;return(0,s.jsxs)(l.Zb,{className:"border border-gray-200",children:[(0,s.jsx)(l.Ol,{className:"bg-gray-50 border-b",children:(0,s.jsxs)(l.ll,{className:"text-xl",children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Posts"]})}),(0,s.jsx)(l.aY,{className:"p-6",children:(0,s.jsx)("ul",{className:"list-disc pl-6",children:a.variations.map((e,t)=>(0,s.jsx)("li",{className:"mb-2 whitespace-pre-line",children:"string"==typeof e?e:e.content},t))})})]},t)}):[(0,s.jsxs)(l.Zb,{className:"border border-gray-200",children:[(0,s.jsx)(l.Ol,{className:"bg-gray-50 border-b",children:(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.ll,{className:"text-xl",children:r}),i&&i.title&&(0,s.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:i.title})]}),(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsxs)("button",{onClick:()=>t(r,i),className:"px-3 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 flex items-center text-sm",title:"Copy to clipboard",children:[(0,s.jsx)(b.Z,{className:"w-4 h-4 mr-1"}),"Copy"]}),(0,s.jsx)(k.Z,{content:"string"==typeof i?i:JSON.stringify(i,null,2),title:(null==i?void 0:i.title)||"".concat(r," - ").concat(es),contentType:r.toLowerCase().replace(" ","-"),metadata:{campaignName:es,campaignType:et}
1,className:"px-3 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 flex items-center text-sm",redirectAfterSave:!1}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{onClick:()=>e(r),className:"px-3 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 flex items-center text-sm",title:"Export content",children:[(0,s.jsx)(y.Z,{className:"w-4 h-4 mr-1"}),"Export"]}),z[r]&&(0,s.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white border border-gray-300 rounded-lg shadow-lg z-10",children:[(0,s.jsx)("button",{onClick:()=>a(r,i,"txt"),className:"w-full text-left px-4 py-2 hover:bg-gray-100 text-sm",children:"Text (.txt)"}),(0,s.jsx)("button",{onClick:()=>a(r,i,"pdf"),className:"w-full text-left px-4 py-2 hover:bg-gray-100 text-sm",children:"PDF (.pdf)"}),(0,s.jsx)("button",{onClick:()=>a(r,i,"docx"),className:"w-full text-left px-4 py-2 hover:bg-gray-100 text-sm",children:"Word (.docx)"})]})]})]})]})}),(0,s.jsx)(l.aY,{className:"p-6",children:i&&(0,s.jsx)("div",{className:"prose max-w-none",children:(0,s.jsx)("div",{className:"whitespace-pre-wrap text-gray-800",children:"string"==typeof i?i:i&&"object"==typeof i&&"content"in i?i.content:i.isFormatted?i.content:JSON.stringify(i,null,2)})})})]},r)]})}),(0,s.jsx)("div",{className:"flex justify-center space-x-4 pt-6",children:(0,s.jsxs)("button",{onClick:eB,className:"px-6 py-3 border border-gray-300 rounded-lg hover:bg-gray-50 flex items-center",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 mr-2"}),"Create New Campaign"]})})]})};return(0,s.jsx)(N.J,{children:(0,s.jsx)(v.g,{children:(0,s.jsxs)(w.P,{children:[(0,s.jsx)(j.Z,{}),(0,s.jsxs)(r.Z,{title:"Campaign Builder",subtitle:"Create an entire marketing campaign from a single asset",hideNavigation:!0,children:[q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-6 flex justify-end",children:(0,s.jsxs)("button",{onClick:eB,className:"px-4 py-2 text-sm text-gray-600 hover:text-gray-800 border border-gray-300 rounded-lg hover:bg-gray-50 flex items-center",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 mr-2"}),"Start Over"]})}),(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)("div",{className:"flex items-center justify-center space-x-4 max-w-2xl mx-auto",children:("upload"===q?["Upload","Setup","Content","Generate"]:["Setup","Content","Generate"]).map((e,t)=>{let a=t+1,l=U===a,r=U>a;return(0,s.jsxs)(n.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium ".concat(r?"bg-green-600 text-white":l?"bg-blue-600 text-white":"bg-gray-300 text-gray-600"),children:r?(0,s.jsx)(d.Z,{className:"w-4 h-4"}):a}),(0,s.jsx)("span",{className:"text-xs mt-1 ".concat(l?"font-medium text-blue-600":"text-gray-600"),children:e})]}),t<("upload"===q?3:2)&&(0,s.jsx)("div",{className:"w-12 h-0.5 ".concat(U>a?"bg-green-600":"bg-gray-300")})]},e)})})})]}),(()=>{if(!q)return eq();if("upload"===q)switch(U){case 1:return e$();case 2:return eU();case 3:return ez();case 4:return eG();default:return eq()}else switch(U){case 1:return eU();case 2:return ez();case 3:return eG();default:return eq()}})()]})]})})})}}},function(e){e.O(0,[7257,7847,2251,3412,7394,1295,2888,9774,179],function(){return e(e.s=1824)}),_N_E=e.O()}]);
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.