1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,738932,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(618566),s=e.i(217255),n=e.i(846932),i=e.i(88653),l=e.i(57135),c=e.i(521292),o=e.i(787906),d=e.i(163858),m=e.i(259792),x=e.i(673130),g=e.i(562718),u=e.i(427217),p=e.i(683512),h=e.i(713691),f=e.i(847604),b=e.i(220316),y=e.i(163341),v=e.i(468094),j=e.i(862536),k=e.i(817264),w=e.i(758253),N=e.i(359161);let z=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"}))});var C=e.i(984174),S=e.i(996874),I=e.i(913107),T=e.i(705766),$=e.i(666298),A=e.i(614677),O=e.i(597830);let _=[.25,.46,.45,.94],P=[{name:"views",label:"Post Views",helper:"Total views target across all posts.",icon:p.EyeIcon,accent:"#3b82f6",type:"integer"},{name:"subscriber_reach",label:"Subscriber Reach",helper:"Combined creator subscriber base for this campaign.",icon:b.UsersIcon,accent:"#f97316",type:"integer"},{name:"clicks",label:"Clicks",helper:"Total link clicks the campaign should drive.",icon:h.CursorArrowRaysIcon,accent:"#f59e0b",type:"integer"},{name:"engagements",label:"Engagements",helper:"Likes + comments + saves + shares.",icon:f.ChatBubbleLeftRightIcon,accent:"#8b5cf6",type:"integer"},{name:"er",label:"Engagement Rate",helper:"Target ER as a percentage of views.",icon:y.ChartBarIcon,accent:"#ec4899",type:"percent",suffix:"%"},{name:"ctr",label:"Click-Through Rate",helper:"Clicks ÷ views, as a percentage.",icon:v.ArrowTrendingUpIcon,accent:"#14b8a6",type:"percent",suffix:"%"}],M=[{id:"brief",number:1,label:"Brief",icon:N.DocumentTextIcon},{id:"setup",number:2,label:"Setup",icon:j.IdentificationIcon},{id:"goals",number:3,label:"Goals",icon:k.TrophyIcon},{id:"overview",number:4,label:"Overview",icon:z}],R=e=>{if(""===e||null==e)return null;let t=Number(String(e).replace(/,/g,""));return Number.isFinite(t)?t:null},E="block text-[10px] font-bold uppercase tracking-[0.12em] text-gray-400 dark:text-zinc-500 mb-2",D="w-full px-4 py-3 rounded-xl text-sm text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-pink-200 focus:bg-white dark:focus:bg-zinc-950 transition-all",F={background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"};function B({activeTab:e,tabValidity:a,progressPct:r,completedSteps:s,onTabClick:i}){return(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("div",{className:"flex items-center gap-0 mb-3",children:M.map((r,s)=>{let l=e===r.id,c=a[r.id],d=r.icon;return(0,t.jsxs)("div",{className:"flex items-center flex-1 last:flex-initial",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(r.id),className:"group flex items-center gap-2.5 shrink-0",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(n.motion.div,{animate:{scale:l?1.05:1},transition:{duration:.3,ease:_},className:"w-9 h-9 rounded-full flex items-center justify-center transition-all",style:c?{background:"linear-gradient(135deg, #ec4899, #f97316)",boxShadow:"0 6px 18px rgba(236,72,153,0.25)"}:l?{background:"var(--surface-panel)",border:"2px solid #ec4899",boxShadow:"0 6px 18px rgba(236,72,153,0.18)"}:{background:"var(--surface-softer)",border:"1px solid var(--border-default)"},children:c?(0,t.jsx)(o.CheckIcon,{className:"w-4 h-4 text-white"}):(0,t.jsx)(d,{className:"w-4 h-4",style:{color:l?"#ec4899":"var(--text-label)"}})})}),(0,t.jsxs)("div",{className:"hidden sm:block text-left",children:[(0,t.jsxs)("div",{className:"text-[10px] font-bold uppercase tracking-[0.12em]",style:{color:l?"#ec4899":c?"#10b981":"var(--text-label)"},children:["Step ",r.number]}),(0,t.jsx)("div",{className:"text-[13px] font-bold tracking-tight",style:{color:l||c?"var(--text-primary)":"var(--text-tertiary)"},children:r.label})]})]}),s<M.length-1&&(0,t.jsx)("div",{className:"flex-1 h-px mx-3 bg-gradient-to-r from-gray-200 to-transparent dark:from-zinc-800"})]},r.id)})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden bg-gray-100 dark:bg-zinc-900",children:(0,t.jsx)(n.motion.div,{className:"h-full rounded-full",style:{background:"linear-gradient(to right, #ec4899, #f97316)"},animate:{width:`${r}%`},transition:{duration:.6,ease:_}})}),(0,t.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-gray-400 dark:text-zinc-500 tabular-nums shrink-0",children:[s,"/1 required"]})]})]})}let U={initial:{opacity:0,y:8}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.3,ease:_}};function L({src:e,name:a,size:r="w-7 h-7",text:s="text-[10px]"}){if(e)return(0,t.jsx)("img",{src:e,alt:a||"",className:`${r} rounded-full object-cover ring-1 ring-black/5 dark:ring-white/10 shrink-0 bg-white dark:bg-zinc-950`});let n=(a||"?").trim().charAt(0).toUpperCase();return(0,t.jsx)("div",{className:`${r} rounded-full flex items-center justify-center shrink-0 ring-1 ring-black/5 dark:ring-white/10`,style:{background:"linear-gradient(135deg, #ec4899, #f97316)"},children:(0,t.jsx)("span",{className:`${s} font-extrabold text-white tracking-tight`,children:n})})}function X({orgMatch:e,onPickOrgFromMatch:r,onCloseOrgMatch:s,onCreateOrgFromMatch:i,name:l,setName:c,abbreviation:o,setAbbreviation:d,searchTermOrg:m,setSearchTermOrg:p,autoCompleteOrg:h,selectedOrg:f,setSelectedOrg:b,setAutoCompleteOrg:y,searchTermAM:v,setSearchTermAM:j,autoCompleteAM:k,selectedAM:w,setSelectedAM:N,setAutoCompleteAM:z,image:C,setImage:S,imageUploading:I,onImageReady:T}){let[$,A]=(0,a.useState)(null),[_,P]=(0,a.useState)(null);return(0,t.jsxs)(n.motion.div,{...U,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:"sm:col-span-2",children:[(0,t.jsx)("label",{className:E,children:"Campaign Name"}),(0,t.jsx)("input",{type:"text",value:l,onChange:e=>c(e.target.value),className:D,style:F,placeholder:"e.g. KegChup",required:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:E,children:["Abbreviation"," ",(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 font-normal normal-case tracking-normal",children:"· optional"})]}),(0,t.jsx)("input",{type:"text",value:o,onChange:e=>d(e.target.value),className:D,style:F,placeholder:"HKC Q3",maxLength:32})]})]}),(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 -mt-2",children:"Abbreviation is a second search vector â the short label your team uses in conversation."}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:E,children:"Organization"}),f&&$?(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-xl",style:{background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.25)"},children:[(0,t.jsx)(L,{src:$.image,name:$.name}),(0,t.jsx)("span",{className:"flex-1 text-sm font-semibold text-gray-900 dark:text-zinc-100 truncate",children:$.name}),(0,t.jsx)("button",{type:"button",onClick:()=>{b(null),A(null),p("")},className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"var(--border-subtle)"},"aria-label":"Clear organization",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]}):(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:m,onChange:e=>{p(e.target.value),f&&(b(null),A(null))},className:D,style:F,placeholder:"Search organizationâ¦"}),h.length>0&&(0,t.jsx)("ul",{className:"absolute z-20 mt-2 w-full rounded-xl max-h-60 overflow-y-auto backdrop-blur-xl",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 40px var(--shadow-ambient-lg)"},children:h.map(e=>(0,t.jsxs)("li",{onClick:()=>{b(e._id),A(e),p(e.name),y([])},className:"px-3 py-2 hover:bg-gray-50 dark:hover:bg-zinc-900 cursor-pointer transition-colors flex items-center gap-2.5 first:rounded-t-xl last:rounded-b-xl",children:[(0,t.jsx)(L,{src:e.image,name:e.name,size:"w-8 h-8",text:"text-[11px]"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 truncate",children:e.name})]},e._id))})]}),(0,t.jsx)(J,{state:e,onPick:r,onClose:s,onCreate:i})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:E,children:"Account Manager"}),w&&_?(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-xl",style:{background:"rgba(236,72,153,0.08)",border:"1px solid rgba(236,72,153,0.25)"},children:[_.image?(0,t.jsx)("img",{src:_.image,alt:_.name,className:"w-7 h-7 rounded-full object-cover ring-1 ring-black/5 shrink-0 dark:ring-zinc-700/5"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full flex items-center justify-center shrink-0 ring-1 ring-black/5 dark:ring-zinc-700/5",style:{background:"linear-gradient(135deg, #ec4899, #f97316)"},children:(0,t.jsx)(x.UserCircleIcon,{className:"w-4 h-4 text-white"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-900 dark:text-zinc-100 truncate",children:_.name}),_.email&&(0,t.jsx)("div",{className:"text-[11px] text-gray-500 dark:text-zinc-400 truncate",children:_.email})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{N(null),P(null),j("")},className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"var(--border-subtle)"},"aria-label":"Clear account manager",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]}):(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:v,onCh
1ange:e=>{j(e.target.value),w&&(N(null),P(null))},className:D,style:F,placeholder:"Search teamâ¦"}),k.length>0&&(0,t.jsx)("ul",{className:"absolute z-20 mt-2 w-full rounded-xl max-h-60 overflow-y-auto backdrop-blur-xl",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 40px var(--shadow-ambient-lg)"},children:k.map(e=>(0,t.jsxs)("li",{onClick:()=>{N(e._id),P(e),j(e.name),z([])},className:"px-3 py-2 hover:bg-gray-50 dark:hover:bg-zinc-900 cursor-pointer transition-colors flex items-center gap-2.5 first:rounded-t-xl last:rounded-b-xl",children:[e.image?(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-8 h-8 rounded-full object-cover ring-1 ring-black/5 dark:ring-zinc-700/5"}):(0,t.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-black/5 dark:ring-zinc-700/5",style:{background:"linear-gradient(135deg, #ec4899, #f97316)"},children:(0,t.jsx)(x.UserCircleIcon,{className:"w-4 h-4 text-white"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 truncate",children:e.name}),e.email&&(0,t.jsx)("div",{className:"text-[11px] text-gray-500 dark:text-zinc-400 truncate",children:e.email})]})]},e._id))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:E,children:["Cover Image"," ",(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 font-normal normal-case tracking-normal",children:"· optional"})]}),C?(0,t.jsxs)("div",{className:"flex items-center gap-3 p-2.5 rounded-xl",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsx)("img",{src:C,alt:"Campaign cover",className:"w-12 h-12 rounded-lg object-cover"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-bold text-gray-900 dark:text-zinc-100 tracking-tight",children:"Image uploaded"}),(0,t.jsx)("div",{className:"text-[11px] text-gray-400 dark:text-zinc-500 truncate",children:"Click remove to re-crop or replace."})]}),(0,t.jsx)("button",{type:"button",onClick:()=>S(""),className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"var(--border-subtle)"},"aria-label":"Remove image",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]}):(0,t.jsxs)("div",{className:"rounded-xl p-3",style:{background:"var(--surface-soft)",border:"1px dashed var(--shadow-ambient-lg)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2 text-gray-500 dark:text-zinc-400",children:[(0,t.jsx)(g.PhotoIcon,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em]",children:"16:9 recommended"}),I&&(0,t.jsx)("span",{className:"ml-auto inline-flex w-3.5 h-3.5 border-2 border-pink-300 border-t-pink-600 rounded-full animate-spin"})]}),(0,t.jsx)(O.default,{onImageReady:T,aspectRatio:16/9,outputWidth:1920,outputHeight:1080})]})]})]})}function q({goals:e,setGoals:a}){return(0,t.jsxs)(n.motion.div,{...U,className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-bold text-gray-900 dark:text-zinc-100 tracking-tight mb-1",children:"Set the targets you'll be tracking against"}),(0,t.jsx)("p",{className:"text-[12px] text-gray-500 dark:text-zinc-400",children:"Optional â set targets to enable pacing alerts, the wrap deck, and AI insights. Skip for now and add them anytime later."})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:P.map(r=>(0,t.jsx)(H,{field:r,value:e[r.name],onChange:t=>((t,r,s)=>{let n=String(r).replace(/,/g,"");if("integer"===s)n=n.replace(/[^0-9]/g,"");else{let e=(n=n.replace(/[^0-9.]/g,"")).indexOf(".");-1!==e&&(n=n.slice(0,e+1)+n.slice(e+1).replace(/\./g,""))}a({...e,[t]:n})})(r.name,t,r.type)},r.name))})]})}function H({field:e,value:a,onChange:r}){let s=e.icon,n=R(a),i=null!==n&&n>0&&("percent"!==e.type||n<=100),l=""!==a&&!i;return(0,t.jsxs)("div",{className:"rounded-2xl p-4 transition-all",style:{background:"var(--surface-frosted)",border:`1px solid ${i?`${e.accent}33`:"var(--border-subtle)"}`,boxShadow:i?`0 4px 16px ${e.accent}10`:"none"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2.5",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center shrink-0",style:{background:`${e.accent}14`},children:(0,t.jsx)(s,{className:"w-4 h-4",style:{color:e.accent}})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-bold text-gray-900 dark:text-zinc-100 tracking-tight",children:e.label}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500 dark:text-zinc-400 leading-tight",children:e.helper})]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",inputMode:"integer"===e.type?"numeric":"decimal",value:"integer"===e.type?(e=>{if(""===e||null==e)return"";let t=String(e).replace(/,/g,"");if(""===t||"-"===t)return t;let[a,r]=t.split("."),s=a.replace(/\B(?=(\d{3})+(?!\d))/g,",");return void 0!==r?`${s}.${r}`:s}
1)(a):a,onChange:e=>r(e.target.value),className:"w-full pl-3 pr-10 py-2.5 rounded-xl text-sm font-semibold text-gray-900 dark:text-zinc-100 placeholder-gray-300 focus:outline-none focus:ring-2 transition-all tabular-nums dark:placeholder-zinc-700",style:{background:"var(--surface-soft)",border:`1px solid ${l?"rgba(239,68,68,0.4)":i?`${e.accent}55`:"var(--border-subtle)"}`,"--tw-ring-color":`${e.accent}33`},placeholder:"percent"===e.type?"0.00":"0"}),e.suffix&&(0,t.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm font-bold pointer-events-none",style:{color:i?e.accent:"var(--text-label)"},children:e.suffix}),i&&(0,t.jsx)(d.CheckCircleIcon,{className:"absolute right-9 top-1/2 -translate-y-1/2 w-4 h-4",style:{color:e.accent}})]}),l&&(0,t.jsx)("p",{className:"text-[11px] text-red-500 mt-1.5",children:"percent"===e.type?"Enter a number between 0 and 100.":"Enter a number greater than 0."})]})}function G({files:e,setFiles:r,briefText:s,setBriefText:l,extracting:c,extractionResult:o,extractionError:m,onExtract:x}){let[g,p]=(0,a.useState)(!1),h=(0,a.useRef)(null),f=e=>{let t=Array.from(e||[]);t.length&&r(e=>{let a=[...e];for(let e of t)a.push({id:(0,A.v4)(),file:e,status:"pending",suggestedName:"",suggestedType:"",suggestedTags:[],suggestedDescription:"",suggestedSummary:""});return a})},b=e.length>0||s.trim().length>0;return(0,t.jsxs)(n.motion.div,{...U,className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-bold text-gray-900 dark:text-zinc-100 tracking-tight",children:"Drop in the brief â we'll fill the rest in"}),(0,t.jsx)("p",{className:"text-[12px] text-gray-500 dark:text-zinc-400",children:"Optional. Anything you upload pre-fills Setup, Goals, and Overview."})]}),(0,t.jsxs)("div",{onDragOver:e=>{e.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:e=>{e.preventDefault(),p(!1),f(e.dataTransfer?.files)},onClick:()=>h.current?.click(),className:"rounded-xl px-3 py-3 cursor-pointer transition-all",style:{background:g?"rgba(236,72,153,0.10)":"var(--surface-soft)",border:`1px dashed ${g?"rgba(236,72,153,0.55)":"var(--border-default)"}`},children:[(0,t.jsx)("input",{ref:h,type:"file",multiple:!0,accept:".pdf,.docx,.pptx,.txt,.md,.png,.jpg,.jpeg,.webp",onChange:e=>{f(e.target.files),e.target.value=""},className:"hidden"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 justify-center",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(236,72,153,0.10)"},children:(0,t.jsx)(S.ArrowUpTrayIcon,{className:"w-4 h-4",style:{color:"#ec4899"}})}),(0,t.jsxs)("div",{className:"text-left min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-bold text-gray-900 dark:text-zinc-100 tracking-tight",children:g?"Drop to attach":"Drop files or click to upload"}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500 dark:text-zinc-400 leading-tight truncate",children:"PDF · DOCX · PPTX · TXT · PNG · JPG · WebP â 8 files / 10MB each"})]})]})]}),e.length>0&&(0,t.jsx)("ul",{className:"space-y-2",children:(0,t.jsx)(i.AnimatePresence,{initial:!1,children:e.map(e=>{var a;return(0,t.jsxs)(n.motion.li,{layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:_},className:"flex items-center gap-3 p-2.5 rounded-xl",style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center shrink-0",style:{background:"rgba(99,102,241,0.10)"},children:(0,t.jsx)(N.DocumentTextIcon,{className:"w-4 h-4",style:{color:"#6366f1"}})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-900 dark:text-zinc-100 truncate",children:e.suggestedName||e.file.name}),"extracted"===e.status&&e.suggestedType&&(0,t.jsx)("span",{className:"inline-flex items-center px-1.5 py-px rounded-full text-[9px] font-bold uppercase tracking-wider shrink-0",style:{background:"rgba(99,102,241,0.10)",border:"1px solid rgba(99,102,241,0.25)",color:"#6366f1"},children:e.suggestedType})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500 dark:text-zinc-400 tabular-nums",children:Number.isFinite(a=e.file.size)?a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1024/1024).toFixed(1)} MB`:""}),"extracted"===e.status&&e.suggestedTags?.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 text-[11px]",children:"·"}),e.suggestedTags.slice(0,3).map(e=>(0,t.jsx)("span",{className:"inline-flex items-center px-1.5 py-px rounded-full text-[10px] font-medium",style:{background:"var(--surface-softer)",color:"var(--text-tertiary)"},children:e},e))]})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void r(e=>e.filter(e=>e.id!==t))},className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"var(--border-subtle)"},"aria-label":"Remove file",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]},e.id)})})}
1),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:E,children:["Notes"," ",(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 font-normal normal-case tracking-normal",children:"· optional"})]}),(0,t.jsx)("textarea",{value:s,onChange:e=>l(e.target.value),rows:3,className:"w-full px-3 py-2 rounded-xl text-sm text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-pink-200 focus:bg-white dark:focus:bg-zinc-950 transition-all resize-none",style:F,placeholder:"Paste call notes or quickly describe the campaignâ¦"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[o&&!c&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-semibold",style:{background:"rgba(16,185,129,0.10)",border:"1px solid rgba(16,185,129,0.30)",color:"#059669"},children:[(0,t.jsx)(d.CheckCircleIcon,{className:"w-3.5 h-3.5"}),"Pre-filled â review the other tabs"]}),m&&!c&&(0,t.jsx)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-semibold",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)",color:"#dc2626"},children:m})]}),(0,t.jsxs)(n.motion.button,{type:"button",whileHover:{scale:b&&!c?1.02:1},whileTap:{scale:b&&!c?.97:1},onClick:x,disabled:!b||c,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full text-sm font-semibold text-white shadow-sm shadow-pink-200/50 transition-all bg-gradient-to-r from-pink-500 to-orange-400 disabled:opacity-50 disabled:cursor-not-allowed",children:[c?(0,t.jsx)("span",{className:"inline-flex w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin dark:border-zinc-800/40"}):(0,t.jsx)(C.SparklesIcon,{className:"w-4 h-4"}),c?"Reading documentsâ¦":o?"Re-extract":"Extract with AI"]})]}),o?.warnings?.length>0&&(0,t.jsx)("ul",{className:"rounded-xl px-3 py-2.5 space-y-1",style:{background:"rgba(245,158,11,0.06)",border:"1px solid rgba(245,158,11,0.20)"},children:o.warnings.map((e,a)=>(0,t.jsxs)("li",{className:"text-[11px] text-amber-700 dark:text-amber-300 leading-relaxed",children:["· ",e]},a))})]})}function K({overview:e,setOverview:a}){return(0,t.jsxs)(n.motion.div,{...U,className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-bold text-gray-900 dark:text-zinc-100 tracking-tight mb-1",children:"Long-form context"}),(0,t.jsx)("p",{className:"text-[12px] text-gray-500 dark:text-zinc-400",children:"Optional but powerful. These three fields feed the AI's memory of the campaign â you'll see them referenced when Scout writes wrap decks, suggests creators, or answers questions on the campaign page."})]}),(0,t.jsx)(W,{label:"Campaign Summary",helper:"One paragraph: audience, hook, deliverables.",value:e.campaign_summary,onChange:e=>a("campaign_summary",e),rows:5}),(0,t.jsx)(W,{label:"Client Goals",helper:"What does the client define as success? Funnel goals, narrative angles, must-mentions.",value:e.client_goals,onChange:e=>a("client_goals",e),rows:5}),(0,t.jsx)(W,{label:"Synopsis",helper:"The 2â3 sentence hallway pitch â gets fed into AI context verbatim.",value:e.synopsis,onChange:e=>a("synopsis",e),rows:3})]})}function W({label:e,helper:a,value:r,onChange:s,rows:n=4}){return(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:E,children:[e," ",(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 font-normal normal-case tracking-normal",children:"· optional"})]}),(0,t.jsx)("textarea",{value:r,onChange:e=>s(e.target.value),rows:n,className:"w-full px-4 py-3 rounded-xl text-sm text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-pink-200 focus:bg-white dark:focus:bg-zinc-950 transition-all resize-none",style:F,placeholder:a}),(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 mt-1",children:a})]})}function J({state:e,onPick:a,onClose:r,onCreate:s}){return(0,t.jsx)(i.AnimatePresence,{initial:!1,children:e?.open&&(0,t.jsx)(n.motion.div,{initial:{opacity:0,y:-4,height:0}
1,animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-4,height:0},transition:{duration:.3,ease:_},className:"overflow-hidden mt-3",children:(0,t.jsxs)("div",{className:"rounded-2xl p-3 sm:p-4",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.06), rgba(249,115,22,0.04))",border:"1px solid rgba(236,72,153,0.20)"},children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 mb-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(236,72,153,0.14)"},children:(0,t.jsx)(C.SparklesIcon,{className:"w-3.5 h-3.5",style:{color:"#ec4899"}})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-[13px] font-bold text-gray-900 dark:text-zinc-100 tracking-tight",children:"Pick the organization"}),(0,t.jsxs)("div",{className:"text-[11px] text-gray-500 dark:text-zinc-400",children:["AI suggested ",(0,t.jsxs)("span",{className:"font-semibold text-gray-700 dark:text-zinc-300",children:['"',e.suggestion,'"']})," â not an exact match. Pick the right one or create a new org."]})]}),(0,t.jsx)("button",{type:"button",onClick:r,className:"w-7 h-7 rounded-xl flex items-center justify-center shrink-0",style:{background:"var(--border-subtle)"},"aria-label":"Dismiss",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]}),e.candidates.length>0&&(0,t.jsx)(n.motion.ul,{initial:"hidden",animate:"show",variants:{hidden:{},show:{transition:{staggerChildren:.04,delayChildren:.05}}},className:"space-y-1.5 mb-2",children:e.candidates.map(e=>(0,t.jsx)(n.motion.li,{variants:{hidden:{opacity:0,y:6,scale:.97},show:{opacity:1,y:0,scale:1}},transition:{duration:.3,ease:_},children:(0,t.jsxs)("button",{type:"button",onClick:()=>a(e),className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-xl text-left transition-all hover:-translate-y-0.5",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)"},children:[e.image?(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-7 h-7 rounded-full object-cover ring-1 ring-black/5 dark:ring-zinc-700/5"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full flex items-center justify-center ring-1 ring-black/5 dark:ring-zinc-700/5",style:{background:"linear-gradient(135deg, #ec4899, #f97316)"},children:(0,t.jsx)("span",{className:"text-[11px] font-extrabold text-white",children:(e.name||"?")[0].toUpperCase()})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-900 dark:text-zinc-100 truncate",children:e.name}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 dark:text-zinc-400",children:[Math.round(100*(e._sim||0)),"% match"]})]}),(0,t.jsx)(o.CheckIcon,{className:"w-3.5 h-3.5 text-pink-500 shrink-0"})]})},e._id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap pt-2 border-t border-black/5 mt-2 dark:border-zinc-700/5",children:[(0,t.jsx)("div",{className:"text-[11px] text-gray-500 dark:text-zinc-400",children:"None of these?"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 px-3 py-1.5 rounded-full text-[12px] font-medium text-gray-600 dark:text-zinc-400 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:"Search yourself"}),(0,t.jsxs)(n.motion.button,{type:"button",whileHover:{scale:e.creating?1:1.02},whileTap:{scale:e.creating?1:.97},onClick:s,disabled:e.creating,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-bold text-white transition-all bg-gradient-to-r from-pink-500 to-orange-400 disabled:opacity-50",children:[e.creating?(0,t.jsx)("span",{className:"inline-flex w-3.5 h-3.5 border-2 border-white/40 border-t-white rounded-full animate-spin dark:border-zinc-800/40"}):(0,t.jsx)(I.PlusIcon,{className:"w-3.5 h-3.5"}),'Create "',e.suggestion,'"']})]})]})]})},"org-match")})}e.s(["default",0,function({embedded:e=!1,onDirtyChange:o,onCreated:d}={}){let x=(0,r.useRouter)(),{data:g}
1=(0,s.useSession)(),[u,p]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(!1),[k,N]=(0,a.useState)(""),[z,C]=(0,a.useState)([]),[S,I]=(0,a.useState)(null),[A,O]=(0,a.useState)(""),[E,D]=(0,a.useState)([]),[F,U]=(0,a.useState)(null),[L,H]=(0,a.useState)({views:"",subscriber_reach:"",clicks:"",engagements:"",er:"",ctr:""}),[W,J]=(0,a.useState)("brief"),[V,Q]=(0,a.useState)(!1),[Y,Z]=(0,a.useState)([]),[ee,et]=(0,a.useState)(""),[ea,er]=(0,a.useState)(!1),[es,en]=(0,a.useState)(null),[ei,el]=(0,a.useState)(null),[ec,eo]=(0,a.useState)({campaign_summary:"",client_goals:"",synopsis:""}),ed=(0,a.useRef)(new Set),em=e=>{ed.current.add(e)},[ex,eg]=(0,a.useState)({open:!1,suggestion:"",candidates:[],creating:!1}),eu=P.filter(e=>""!==String(L[e.name]??"").trim()).length,ep=""!==u.trim()||""!==h.trim()||""!==b||""!==k.trim()||null!==S||""!==A.trim()||null!==F||Y.length>0||""!==ee.trim()||eu>0||Object.values(ec).some(e=>""!==String(e??"").trim());(0,a.useEffect)(()=>{if(!o)return;let e=[],t=k.trim();t&&e.push(t),eu>0&&e.push(`${eu} of ${P.length} goals`),Y.length>0&&e.push(`${Y.length} brief file${1===Y.length?"":"s"}`),o(ep,{title:u.trim()||"Untitled campaign",meta:e.join(" · ")})},[o,ep,u,S,k,eu,Y.length]);let eh=async e=>{j(!0);try{let t=await (0,$.uploadImage)(e,{folder:`campaign_profile_pics/${u||"temp"}`});y(t),T.default.success("Image uploaded")}catch(e){console.error(e),T.default.error("Image upload failed")}finally{j(!1)}};(0,a.useEffect)(()=>{if(!k)return void C([]);let e=!1;return(async()=>{try{let t=await fetch(`/api/searchAutoCompleteOrganizations?query=${encodeURIComponent(k)}`);if(!t.ok)return;let a=await t.json();e||C(a)}catch(e){console.error("[org autocomplete]",e)}})(),()=>{e=!0}},[k]),(0,a.useEffect)(()=>{if(!A)return void D([]);let e=!1;return(async()=>{try{let t=await fetch(`/api/searchAutoCompleteUsers?query=${encodeURIComponent(A)}`);if(!t.ok)return;let a=await t.json();e||D(a)}catch(e){console.error("[am autocomplete]",e)}})(),()=>{e=!0}},[A]);let ef=(0,a.useMemo)(()=>({brief:!0,setup:!!u.trim()&&!!S&&!!F,goals:!0,overview:!0}),[u,S,F]),eb=Number(ef.setup),ey=ef.setup,ev=async()=>{if(0===Y.length&&!ee.trim())return void T.default.error("Add a file or paste some text first.");er(!0),el(null);try{let e=new FormData;ee.trim()&&e.append("text",ee.trim()),Y.forEach(t=>e.append(`file_${t.id}`,t.file));let t=await fetch("/api/ai/extract-campaign-brief",{method:"POST",body:e}),a=await t.json();if(!t.ok)throw Error(a.error||`Status ${t.status}`);en(a),await ej(a),T.default.success("Pre-filled from your brief")}catch(e){console.error("[runExtraction]",e),el(e.message),T.default.error(`Extraction failed: ${e.message}`)}finally{er(!1)}},ej=async e=>{let t=e?.campaign||{};if(!ed.current.has("name")&&t.name&&p(t.name),!ed.current.has("abbreviation")&&t.abbreviation&&f(t.abbreviation),!ed.current.has("organizationName")&&t.organizationName&&await ek(t.organizationName),t.goals&&"object"==typeof t.goals){let e={...L},a=!1;for(let r of P){let s=t.goals[r.name];!ed.current.has(`goals.${r.name}`)&&null!=s&&Number.isFinite(Number(s))&&(e[r.name]=String(s),a=!0)}a&&H(e)}!ed.current.has("campaign_summary")&&"string"==typeof t.campaign_summary&&t.campaign_summary.trim()&&eo(e=>({...e,campaign_summary:t.campaign_summary})),!ed.current.has("client_goals")&&"string"==typeof t.client_goals&&t.client_goals.trim()&&eo(e=>({...e,client_goals:t.client_goals})),!ed.current.has("synopsis")&&"string"==typeof t.synopsis&&t.synopsis.trim()&&eo(e=>({...e,synopsis:t.synopsis}));let a=new Map;for(let t of e?.documents||[])t?.fileId&&a.set(t.fileId,t);Z(e=>e.map(e=>{let t=a.get(e.id);return t?{...e,status:"extracted",suggestedName:t.name,suggestedType:t.type,suggestedTags:t.tags||[],suggestedDescription:t.description||"",suggestedSummary:t.summary||""}:e}))},ek=async e=>{N(e);try{let t=await fetch(`/api/searchAutoCompleteOrganizations?query=${encodeURIComponent(e)}`);
1if(!t.ok)throw Error(`Status ${t.status}`);let a=await t.json(),r=(Array.isArray(a)?a:[]).map(t=>{var a;let r,s;return{...t,_sim:(a=t.name,r=String(a||"").trim().toLowerCase(),s=String(e||"").trim().toLowerCase(),r&&s?1-function(e,t){if(e===t)return 0;let a=e.length,r=t.length;if(0===a)return r;if(0===r)return a;let s=Array(r+1),n=Array(r+1);for(let e=0;e<=r;e++)s[e]=e;for(let i=1;i<=a;i++){n[0]=i;for(let a=1;a<=r;a++){let r=+(e[i-1]!==t[a-1]);n[a]=Math.min(n[a-1]+1,s[a]+1,s[a-1]+r)}for(let e=0;e<=r;e++)s[e]=n[e]}return s[r]}(r,s)/Math.max(r.length,s.length):0)}}).sort((e,t)=>t._sim-e._sim),s=r[0];if(s&&s._sim>=.92){I(s._id),N(s.name),C([]),eg({open:!1,suggestion:"",candidates:[],creating:!1});return}eg({open:!0,suggestion:e,candidates:r.slice(0,3),creating:!1})}catch(e){console.error("[resolveOrgSuggestion]",e)}},ew=async()=>{let e=ex.suggestion;if(e?.trim()){eg(e=>({...e,creating:!0}));try{let t=await fetch("/api/organization",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.trim()})}),a=await t.json();if(!t.ok)throw Error(a.error||a.err||`Status ${t.status}`);let r=a?.organization||a?.data||a,s=r?._id||r?.id,n=r?.name||e.trim();if(!s)throw Error("Organization create returned no id");I(s),N(n),C([]),eg({open:!1,suggestion:"",candidates:[],creating:!1}),T.default.success(`Created organization "${n}"`)}catch(e){console.error("[createOrgFromMatch]",e),T.default.error(`Couldn't create org: ${e.message}`),eg(e=>({...e,creating:!1}))}}},eN=async e=>{if(e.preventDefault(),ey){Q(!0);try{let e={name:u.trim(),abbreviation:h.trim(),organization:S,am:F,image:b,goals:P.reduce((e,t)=>(e[t.name]=R(L[t.name]),e),{}),campaign_summary:ec.campaign_summary||"",client_goals:ec.client_goals||"",synopsis:ec.synopsis||""};g?.user?.agency?.id&&(e.agency=g.user.agency.id);let t=await fetch("https://www.socialscout.ai/api/campaign",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();if(!t.ok)return void T.default.error(a.err||"Failed to create campaign.");if(Y.length>0){let e=T.default.loading(`Uploading ${Y.length} document${1===Y.length?"":"s"}â¦`),t=(await Promise.allSettled(Y.map(e=>{let t=new FormData,r=e.file.type?.startsWith("image/");return t.append("name",e.suggestedName||e.file.name),t.append("type",e.suggestedType||"Brief"),t.append("file",e.file),t.append("uploadType",r?"image":"file"),e.suggestedDescription&&t.append("description",e.suggestedDescription),e.suggestedTags?.length&&t.append("tags",JSON.stringify(e.suggestedTags)),e.suggestedSummary&&t.append("aiContext",e.suggestedSummary),fetch(`/api/campaigns/${a.campaignId}/documents`,{method:"POST",body:t}).then(async e=>{if(!e.ok)throw Error(`Status ${e.status}`);return!0})}))).filter(e=>"rejected"===e.status).length;t>0?T.default.error(`${t} document${1===t?"":"s"} failed to upload`,{id:e}):T.default.success(`Campaign + ${Y.length} document${1===Y.length?"":"s"} created`,{id:e})}else T.default.success(a.success||"Campaign created");x.push(`/dashboard/user/campaign/${a.campaignId}`),d?.(a.campaignId)}catch(e){console.error(e),T.default.error("Something went wrong")}finally{Q(!1)}}};return(0,t.jsx)("div",{className:e?"flex flex-col flex-1 min-h-0 px-4 sm:px-7 pt-5":"min-h-screen py-6 md:py-10",children:(0,t.jsxs)("div",{className:e?"flex flex-col flex-1 min-h-0":"px-4 sm:px-8 max-w-4xl mx-auto",children:[!e&&(0,t.jsxs)("button",{onClick:()=>x.back(),className:"inline-flex items-center gap-1.5 text-sm font-medium text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-300 mb-6 transition-colors group",children:[(0,t.jsx)(l.ArrowLeftIcon,{className:"w-4 h-4 group-hover:-translate-x-0.5 transition-transform"}),"Back"]}),!e&&(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:_},className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-8",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"text-3xl md:text-5xl font-black tracking-tight text-gray-900 dark:text-zinc-100 mb-2",children:["Create"," ",(0,t.jsx)("span",{className:"bg-gradient-to-r from-pink-500 via-rose-500 to-orange-400 bg-clip-text text-transparent",children:"Campaign"})]}),(0,t.jsx)("p",{className:"text-gray-500 dark:text-zinc-400 text-sm sm:text-base max-w-xl",children:"Set the basics, name your team, and lock in the goals you'll be tracking."})]}),g?.user?.agency&&(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-[11px] font-semibold tracking-wide self-start sm:self-auto",style:{background:"rgba(249,115,22,0.10)",border:"1px solid rgba(249,115,22,0.25)",color:"#f97316"},children:[(0,t.jsx)(m.BuildingOffice2Icon,{className:"w-3.5 h-3.5"}),g.user.agency.code," · ",g.user.agency.name]})]}),(0,t.jsx)(B,{activeTab:W,tabValidity:ef,progressPct:100*eb,completedSteps:eb,onTabClick:e=>J(e)}),(0,t.jsxs)("form",{onSubmit:eN,className:`rounded-3xl backdrop-blur-xl overflow-hidden flex flex-col ${e?"flex-1 min-h-0 mb-5":""}`,style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 40px var(--border-subtle)",maxHeight:e?void 0:"calc(100vh - 220p
1x)"},children:[(0,t.jsx)("div",{className:"h-[3px] w-full flex-shrink-0",style:{background:"linear-gradient(to right, rgba(236,72,153,0.6), rgba(249,115,22,0.6), rgba(139,92,246,0.6))"}}),(0,t.jsx)("div",{className:"p-4 sm:p-5 flex-1 min-h-0 overflow-y-auto",children:(0,t.jsxs)(i.AnimatePresence,{mode:"wait",children:["brief"===W&&(0,t.jsx)(G,{files:Y,setFiles:Z,briefText:ee,setBriefText:et,extracting:ea,extractionResult:es,extractionError:ei,onExtract:ev},"brief"),"setup"===W&&(0,t.jsx)(X,{name:u,setName:e=>{em("name"),p(e)},abbreviation:h,setAbbreviation:e=>{em("abbreviation"),f(e)},searchTermOrg:k,setSearchTermOrg:e=>{em("organizationName"),N(e)},autoCompleteOrg:z,selectedOrg:S,setSelectedOrg:e=>{em("organizationName"),I(e)},setAutoCompleteOrg:C,searchTermAM:A,setSearchTermAM:O,autoCompleteAM:E,selectedAM:F,setSelectedAM:U,setAutoCompleteAM:D,image:b,setImage:y,imageUploading:v,onImageReady:eh,orgMatch:ex,onPickOrgFromMatch:e=>{I(e._id),N(e.name),C([]),eg({open:!1,suggestion:"",candidates:[],creating:!1})},onCloseOrgMatch:()=>eg(e=>({...e,open:!1})),onCreateOrgFromMatch:ew},"setup"),"goals"===W&&(0,t.jsx)(q,{goals:L,setGoals:e=>{H(t=>{let a="function"==typeof e?e(t):e;return Object.keys(a).forEach(e=>{t[e]!==a[e]&&em(`goals.${e}`)}),a})}},"goals"),"overview"===W&&(0,t.jsx)(K,{overview:ec,setOverview:(e,t)=>{em(e),eo(a=>({...a,[e]:t}))}},"overview")]})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 px-5 sm:px-7 py-4 border-t flex-shrink-0",style:{borderColor:"var(--border-subtle)",background:"var(--surface-frosted)"},children:[(0,t.jsx)("div",{className:"text-[11px] text-gray-500 dark:text-zinc-400",children:"overview"===W?(0,t.jsxs)(t.Fragment,{children:["Step ",(0,t.jsx)("span",{className:"font-bold",children:M.length})," of"," ",M.length," â review and create."]}):(0,t.jsxs)(t.Fragment,{children:["Step"," ",(0,t.jsx)("span",{className:"font-bold",children:M.findIndex(e=>e.id===W)+1})," ","of ",M.length]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5 justify-end",children:["brief"!==W&&(0,t.jsxs)("button",{type:"button",onClick:()=>{let e=M.findIndex(e=>e.id===W);e>0&&J(M[e-1].id)},className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold text-gray-700 dark:text-zinc-300 transition-all hover:bg-gray-100 dark:hover:bg-zinc-900",style:{background:"var(--surface-softer)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsx)(l.ArrowLeftIcon,{className:"w-4 h-4"}),"Back"]}),"overview"!==W?(0,t.jsxs)(n.motion.button,{type:"button",whileHover:{scale:ef[W]?1.02:1},whileTap:{scale:ef[W]?.97:1},onClick:()=>{let e=M.findIndex(e=>e.id===W);e<M.length-1&&J(M[e+1].id)},disabled:!ef[W],className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full text-sm font-semibold text-white shadow-sm shadow-pink-200/50 transition-all bg-gradient-to-r from-pink-500 to-orange-400 disabled:opacity-50 disabled:cursor-not-allowed",children:["Next",(0,t.jsx)(c.ArrowRightIcon,{className:"w-4 h-4"})]}):(0,t.jsxs)(n.motion.button,{type:"submit",whileHover:{scale:ey?1.02:1},whileTap:{scale:ey?.97:1},disabled:!ey||V,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full text-sm font-semibold text-white shadow-sm shadow-pink-200/50 transition-all bg-gradient-to-r from-pink-500 to-orange-400 disabled:opacity-50 disabled:cursor-not-allowed",children:[V?(0,t.jsx)("span",{className:"inline-flex w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin dark:border-zinc-800/40"}):(0,t.jsx)(w.RocketLaunchIcon,{className:"w-4 h-4"}),V?"Creatingâ¦":"Launch campaign"]})]})]})]})]})})}],738932)}]);
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.