PageSourceSearch

https://www.volumn.ai/_next/static/chunks/27557.8b4dd6445296e5dd.js

js volumn.ai collected 2026-10-01 16:18:35 UTC 23,419 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[27557],{9647:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(56059).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},27557:(e,t,a)=>{a.r(t),a.d(t,{TabEmailCampaign:()=>z});var s=a(53757),r=a(24361),n=a(17671),i=a(59301),l=a(21318),d=a(79428),c=a(9647),o=a(22893),m=a(66016),x=a(60074),h=a(30286),u=a(35376);function p(e){let{accessToken:t}=e,[a,l]=(0,r.useState)(null);return((0,r.useEffect)(()=>{t&&fetch("/api/admin/email-gmail-status",{headers:{Authorization:`Bearer ${t}`}}).then(e=>e.json()).then(e=>l(!!e?.configured)).catch(()=>l(!1))},[t]),null===a)?null:(0,s.jsxs)("div",{className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-sm ${a?"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-900/20 dark:text-emerald-300":"border-yellow-200 bg-yellow-50 text-yellow-700 dark:border-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-300"}`,children:[a?(0,s.jsx)(n.A,{className:"h-4 w-4 shrink-0"}):(0,s.jsx)(i.A,{className:"h-4 w-4 shrink-0"}),(0,s.jsx)("span",{children:a?"Gmail API configured — ready to send via Gmail OAuth2":"Gmail API not configured. Set GMAIL_SENDER_EMAIL, GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET, GMAIL_REFRESH_TOKEN."})]})}function b(e){let{accessToken:t,onSent:a}=e,[n,i]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[u,p]=(0,r.useState)(""),[b,g]=(0,r.useState)(""),[f,z]=(0,r.useState)(!0),[j,k]=(0,r.useState)(!1),[y,N]=(0,r.useState)(null),[w,v]=(0,r.useState)(null),[S,A]=(0,r.useState)(!1),[_,T]=(0,r.useState)(null),[C,E]=(0,r.useState)(null),P=(0,r.useCallback)(async()=>{k(!0),N(null),v(null);try{let e=new URLSearchParams({limit:"200"});u.trim()&&e.set("target_email",u.trim()),b.trim()&&e.set("days",b.trim());let a=await fetch(`/api/admin/email-campaign-preview?${e}`,{headers:{Authorization:`Bearer ${t}`}}),s=await a.json();if(!s.ok)throw Error(s.error??`HTTP ${a.status}`);v(s.count??0),N(s.users??[])}catch(e){v(null)}finally{k(!1)}},[t,u,b]),$=(0,r.useCallback)(async()=>{A(!0),T(null),E(null);try{let e=await fetch("/api/admin/email-campaign-send",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({subject:n.trim()||void 0,customBody:x.trim()||void 0,targetEmail:u.trim()||void 0,registeredAfterDays:b.trim()?parseInt(b.trim(),10):void 0,dryRun:f})}),s=await e.json();if(!s.ok)throw Error(s.error??`HTTP ${e.status}`);T(s),a()}catch(e){E(e instanceof Error?e.message:String(e))}finally{A(!1)}}
1,[t,n,x,u,b,f,a]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-4 w-4 text-zinc-500"}),(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Target Audience"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-xs text-zinc-500",children:"Target email (optional — if filled, only this address receives the campaign)"}),(0,s.jsx)("input",{type:"email",value:u,onChange:e=>p(e.target.value),placeholder:"e.g. [email protected]",className:"h-9 w-full rounded-md border border-zinc-200 bg-white px-3 text-sm text-zinc-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-50"})]}),(0,s.jsxs)("div",{className:"flex items-end gap-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"mb-1 block text-xs text-zinc-500",children:"Registered within last N days (leave empty for all time)"}),(0,s.jsx)("input",{type:"number",value:b,onChange:e=>g(e.target.value),placeholder:"e.g. 30",className:"h-9 w-full rounded-md border border-zinc-200 bg-white px-3 text-sm text-zinc-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-50"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void P(),disabled:j,className:"inline-flex h-9 items-center gap-1.5 rounded-md border border-zinc-200 bg-white px-3 text-xs font-medium text-zinc-700 shadow-sm hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200",children:[j?(0,s.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(c.A,{className:"h-3.5 w-3.5"}),"Preview Audience"]})]})]}),null!==w&&(0,s.jsxs)("div",{className:"mt-3 rounded-md bg-zinc-50 p-3 dark:bg-zinc-900/60",children:[(0,s.jsxs)("p",{className:"mb-2 text-xs font-medium text-zinc-700 dark:text-zinc-200",children:[w," free user",1!==w?"s":""," will receive this campaign"]}),y&&y.length>0&&(0,s.jsxs)("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:[y.slice(0,50).map(e=>{var t;let a;return(0,s.jsxs)("div",{className:"rounded border border-zinc-100 bg-white px-2 py-1.5 text-[11px] dark:border-zinc-800 dark:bg-zinc-950",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,s.jsx)("span",{className:"font-mono text-zinc-800 dark:text-zinc-200",children:e.email}),e.name&&(0,s.jsxs)("span",{className:"text-zinc-400",children:["(",e.name,")"]}),e.attribution&&(0,s.jsx)("span",{className:"rounded-full bg-zinc-100 px-1.5 py-0.5 text-[10px] text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300",children:(a=(t=e.attribution).source??t.name??t.code)?t.medium?`${a} / ${t.medium}`:a:"Direct / unknown"}),e.attribution?.campaign&&(0,s.jsx)("span",{className:"rounded-full border border-zinc-200 px-1.5 py-0.5 text-[10px] text-zinc-500 dark:border-zinc-700",children:e.attribution.campaign})]}),(e.attribution?.referrer||e.attribution?.landingPath)&&(0,s.jsxs)("p",{className:"mt-0.5 text-[10px] text-zinc-400",children:[e.attribution?.referrer?`Referrer: ${function(e){if(!e)return"";try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}(e.attribution.referrer)}`:"Referrer: direct",e.attribution?.landingPath?` \xb7 Landing: ${e.attribution.landingPath}`:""]})]},e.id)}),w>50&&(0,s.jsxs)("p",{className:"text-[11px] text-zinc-400",children:["... and ",w-50," more"]})]})]})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)(o.A,{className:"h-4 w-4 text-zinc-500"}),(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Email Content"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-xs text-zinc-500",children:"Subject (leave empty to use default)"}),(0,s.jsx)("input",{value:n,onChange:e=>i(e.target.value),placeholder:"e.g. A quick update from Volumn.ai",className:"h-9 w-full rounded-md border border-zinc-200 bg-white px-3 text-sm text-zinc-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-50"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-xs text-zinc-500",children:"Custom HTML body (leave empty to use default template)"}),(0,s.jsx)("textarea",{value:x,onChange:e=>h(e.target.value),placeholder:"<p>Hi there,</p><p>...</p>",rows:6,className:"w-full rounded-md border border-zinc-200 bg-white px-3 py-2 font-mono text-xs text-zinc-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-50"})]})]})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)(m.A,{className:"h-4 w-4 text-zinc-500"}),(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Send"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("label",{className:"flex cursor-pointer select-none items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:f,onChange:e=>
1z(e.target.checked),className:"h-4 w-4 rounded border-zinc-300"}),(0,s.jsx)("span",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:"Dry run (count only, don't actually send)"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void $(),disabled:S,className:"inline-flex h-9 items-center gap-2 rounded-md bg-zinc-900 px-4 text-sm font-medium text-white hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[S?(0,s.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(m.A,{className:"h-3.5 w-3.5"}),S?"Sending…":f?"Dry Run":"Send Emails"]}),_&&(0,s.jsxs)("div",{className:`rounded-lg border p-3 text-sm ${0===_.sent&&!_.dryRun?"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-300":"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-900/20 dark:text-emerald-300"}`,children:[(0,s.jsx)("p",{className:"font-medium",children:_.dryRun?"Dry run complete":_.sent>0?"Emails sent!":"No emails sent"}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs",children:["✓ ",_.sent," ",_.dryRun?"would be sent":"sent"," / ",_.attempted," attempted",_.skipped>0&&` \xb7 ${_.skipped} skipped`,_.targetEmail&&` \xb7 target: ${_.targetEmail}`]}),_.errorSamples&&_.errorSamples.length>0&&(0,s.jsxs)("div",{className:"mt-2 space-y-0.5",children:[(0,s.jsx)("p",{className:"font-medium",children:"Sample errors:"}),_.errorSamples.map((e,t)=>(0,s.jsxs)("p",{className:"break-all text-xs",children:[e.email,": ",e.message]},t))]})]}),C&&(0,s.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-300",children:C})]})]})]})}function g(e){let{accessToken:t}=e,[a,n]=(0,r.useState)([]),[i,l]=(0,r.useState)(!1),[c,o]=(0,r.useState)(null),m=(0,r.useCallback)(async()=>{l(!0),o(null);try{let e=await fetch("/api/admin/email-campaign-runs?limit=50",{headers:{Authorization:`Bearer ${t}`}}),a=await e.json();if(!a.ok)throw Error(a.error??`HTTP ${e.status}`);n(a.runs??[])}catch(e){o(e instanceof Error?e.message:"Failed to load")}finally{l(!1)}},[t]);return(0,r.useEffect)(()=>{m()},[m]),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("p",{className:"text-xs text-zinc-500",children:["Last ",a.length," campaign send",1!==a.length?"s":""]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void m(),disabled:i,className:"inline-flex items-center gap-1.5 text-xs text-zinc-500 underline-offset-2 hover:underline disabled:cursor-not-allowed disabled:opacity-60",children:[i?(0,s.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(x.A,{className:"h-3 w-3"}),"Refresh"]})]}),c&&(0,s.jsx)("div",{className:"rounded-md bg-red-50 px-3 py-2 text-xs text-red-700 dark:bg-red-900/20 dark:text-red-300",children:c}),!i&&0===a.length&&!c&&(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-8 text-center text-sm text-zinc-400 dark:border-zinc-800 dark:bg-zinc-900",children:["No campaigns sent yet. Use the ",(0,s.jsx)("strong",{children:"Create Campaign"})," tab to send your first one."]}),a.map(e=>{let t=e.attempted>0?Math.round(e.sent/e.attempted*100):0;return(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:e.subject||"(default subject)"}),e.dryRun&&(0,s.jsx)("span",{className:"shrink-0 rounded-full border border-zinc-200 px-2 py-0.5 text-[10px] text-zinc-500 dark:border-zinc-700",children:"Dry Run"}),e.targetEmail&&(0,s.jsxs)("span",{className:"shrink-0 rounded-full bg-zinc-100 px-2 py-0.5 text-[10px] text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300",children:["Target: ",e.targetEmail]}),e.registeredAfterDays&&(0,s.jsxs)("span",{className:"shrink-0 rounded-full bg-zinc-100 px-2 py-0.5 text-[10px] text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300",children:["Last ",e.registeredAfterDays,"d"]})]}),(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-zinc-400",children:(0,u.TS)(e.createdAt)})]}),(0,s.jsxs)("div",{className:"shrink-0 text-right",children:[(0,s.jsxs)("p",{className:"text-sm font-semibold",children:[e.sent,(0,s.jsxs)("span",{className:"font-normal text-zinc-400",children:[" / ",e.attempted]})]}),(0,s.jsxs)("p",{className:"text-[11px] text-zinc-400",children:[t,"% success"]})]})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-4 text-xs",children:[(0,s.jsxs)("span",{className:"font-medium text-emerald-600 dark:text-emerald-400",children:["✓ ",e.sent," sent"]}),e.skipped>0&&(0,s.jsxs)("span",{className:"text-yellow-600 dark:text-yellow-400",children:["⚠ ",e.skipped," skipped"]})]}),e.errorSamples.length>0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md bg-red-50 p-2 dark:bg-red-900/20",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:"Sample errors:"}),e.errorSamples.map((e,t)=>(0,s.jsxs)("p",{className:"break-all text-xs text-red-600 dark:text-red-400",children:[e.email,": ",e.message]},t))]})]},e.id)})]})}function f(e){let{accessToken:t}=e,[a,n]=(0,r.useState)("onboarding"),[i,l]=(0,r.useState)([]),[c,o]=(0,r.useState)(!1),[m,h]=(0,r.useState)(null),p=(0,r.useCallback)(async e=>{o(!0),h(null);try{let a=await fetch(`/api/admin/email-transactional-logs?type=${encodeURIComponent(e)}&limit=100`,{headers:{Authorization:`Bearer ${t}`}}),s=await a.json();if(!s.ok)throw Error(s.error??`HTTP ${a.status}`);l(s.logs??[])}catch(e){h(e instanceof Error?e.message:"Failed to load")}finally{o(!1)}},[t]);(0,r.useEffect)(()=>{p(a)},[p,a]);let b=i.filter(e=>"sent"===e.status).length,g=i.filter(e=>"failed"===e.status).length,f=i.filter(e=>"skipped"===e.status).length;return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("p",{className:"mb-3 text-xs text-zinc-500",children:["These emails are sent automatically by the system. The ",(0,s.jsx)("strong",{children:"Onboarding"})," email is triggered once per user when they complete the onboarding flow."]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex gap-2",children:[{value:"onboarding",label:"Onboarding"},{value:"welcome",label:"Welcome"}].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>n(e.value),className:`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${a===e.value?"bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900":"border border-zinc-200 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300"}`,children:e.label},e.value))}),(0,s.jsxs)("button",{type:"button",onClick:()=>
1void p(a),disabled:c,className:"inline-flex items-center gap-1.5 text-xs text-zinc-500 underline-offset-2 hover:underline disabled:cursor-not-allowed disabled:opacity-60",children:[c?(0,s.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(x.A,{className:"h-3 w-3"}),"Refresh"]})]})]}),i.length>0&&(0,s.jsx)("div",{className:"grid grid-cols-3 gap-3",children:[{label:"Sent",count:b,color:"text-emerald-600 dark:text-emerald-400"},{label:"Failed",count:g,color:"text-red-600 dark:text-red-400"},{label:"Skipped",count:f,color:"text-yellow-600 dark:text-yellow-400"}].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-3 text-center shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsx)("p",{className:`text-xl font-bold ${e.color}`,children:e.count}),(0,s.jsx)("p",{className:"text-xs text-zinc-400",children:e.label})]},e.label))}),m&&(0,s.jsx)("div",{className:"rounded-md bg-red-50 px-3 py-2 text-xs text-red-700 dark:bg-red-900/20 dark:text-red-300",children:m}),c&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-zinc-400",children:[(0,s.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"})," Loading…"]}),!c&&0===i.length&&!m&&(0,s.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-white p-8 text-center text-sm text-zinc-400 dark:border-zinc-800 dark:bg-zinc-900",children:["No ",(0,s.jsx)("strong",{children:a})," emails logged yet.",(0,s.jsx)("p",{className:"mt-1 text-xs",children:"Logs will appear here once the system sends emails."})]}),!c&&i.length>0&&(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("p",{className:"text-xs text-zinc-400",children:["Showing last ",i.length," ",a," email",1!==i.length?"s":""]}),(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-zinc-200 dark:border-zinc-800",children:(0,s.jsxs)("table",{className:"w-full text-xs",children:[(0,s.jsx)("thead",{className:"bg-zinc-50 dark:bg-zinc-900/60",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium text-zinc-500",children:"Recipient"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium text-zinc-500",children:"Name"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium text-zinc-500",children:"Status"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium text-zinc-500",children:"Sent At"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium text-zinc-500",children:"Error"})]})}),(0,s.jsx)("tbody",{children:i.map(e=>{let t;return(0,s.jsxs)("tr",{className:"border-t border-zinc-100 hover:bg-zinc-50/50 dark:border-zinc-800 dark:hover:bg-zinc-900/40",children:[(0,s.jsx)("td",{className:"px-3 py-2 font-mono text-zinc-700 dark:text-zinc-300",children:e.email}),(0,s.jsx)("td",{className:"px-3 py-2 text-zinc-400",children:e.name||"—"}),(0,s.jsxs)("td",{className:`px-3 py-2 font-medium ${"sent"===(t=e.status)?"text-emerald-600 dark:text-emerald-400":"failed"===t?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["sent"===e.status?"✓":"failed"===e.status?"✗":"–"," ",e.status]}),(0,s.jsx)("td",{className:"whitespace-nowrap px-3 py-2 text-zinc-400",children:(0,u.TS)(e.sentAt)}),(0,s.jsx)("td",{className:"max-w-[180px] truncate px-3 py-2 text-red-500",children:e.errorMessage||"—"})]},e.id)})})]})})]})]})}function z(e){let{accessToken:t,authReady:a}=e,[n,i]=(0,r.useState)("create"),[l,c]=(0,r.useState)(0),u=(0,r.useCallback)(()=>{c(e=>e+1)},[]);if(!a||!t)return(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-zinc-50 px-3 py-2 text-sm text-zinc-500 dark:bg-zinc-900/60",children:[(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin"}),(0,s.jsx)("span",{children:"Loading…"})]});let z=[{id:"create",label:"Create Campaign",icon:(0,s.jsx)(m.A,{className:"h-3.5 w-3.5"})},{id:"history",label:"Campaign History",icon:(0,s.jsx)(h.A,{className:"h-3.5 w-3.5"})},{id:"recurring",label:"Recurring Emails",icon:(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"})}];return(0,s.jsxs)("section",{className:"space-y-5",children:[(0,s.jsx)("div",{className:"flex items-center justify-between gap-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(o.A,{className:"h-4 w-4 text-zinc-500"}),(0,s.jsx)("h2",{className:"text-sm font-semibold",children:"Email Campaigns"})]})}),(0,s.jsx)(p,{accessToken:t}),(0,s.jsx)("div",{className:"flex gap-1 rounded-lg border border-zinc-200 bg-zinc-50 p-1 dark:border-zinc-800 dark:bg-zinc-900/60",children:z.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>i(e.id),className:`flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-2 text-xs font-medium transition-colors ${n===e.id?"bg-white text-zinc-900 shadow-sm dark:bg-zinc-800 dark:text-zinc-50":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"}`,children:[e.icon,e.label]},e.id))}),"create"===n&&(0,s.jsx)(b,{accessToken:t,onSent:u}),"history"===n&&(0,s.jsx)(g,{accessToken:t},l),"recurring"===n&&(0,s.jsx)(f,{accessToken:t})]})}},35376:(e,t,a)=>{a.d(t,{$Q:()=>i,GO:()=>c,IM:()=>r,TS:()=>o,XL:()=>n,_W:()=>s,hB:()=>l,we:()=>d});let s=[{value:"basic_monthly",label:"Basic Monthly"},{value:"basic_yearly",label:"Basic Yearly"},{value:"pro_monthly",label:"Pro Monthly"},{value:"pro_yearly",label:"Pro Yearly"},{value:"team_monthly",label:"Team Monthly"}];function r(e){let t=(e??"").toString().trim().toLowerCase();return t&&s.some(e=>e.value===t)?t:null}let n={"board_chat2edit_system_ask.txt":["Board","chat2edit","System(Ask)"],"board_chat2edit_system_create.txt":["Board","chat2edit","System(Create)"],"board_chat2edit_user.txt":["Board","chat2edit","User Template"],"xhs_batch_system.txt":["Skill:xhs-batch","System","JSON Plan"],"xhs_batch_copy_system.txt":["Skill:xhs-batch","System","Copy Only"],"xhs_image_prompt_short.txt":["Image","XHS Template(Sh
1ort)","Fallback"],"xhs_image_prompt.txt":["Image","XHS Template(Long)","Used:xhs-batch,board"],"ip_summary_x.txt":["Persona","IP Summary","System"],"oss_autocomplete_system.txt":["Persona","OSS Autocomplete","System"],"outline_prompt.txt":["XHS Outline","Unused"],"content_prompt.txt":["XHS Content","Unused"]},i=[{id:"persona-ai",name:"Volumn.ai (Gemini 3.0 Pro)"},{id:"gpt-5.2",name:"GPT5.2 (GPT-5.2)"},{id:"gpt-oss",name:"GPT oss (GPT-OSS 120B Free)"},{id:"nanobanana",name:"Nanobanana (Gemini 3 Pro Image)"},{id:"gemini-3.0-pro",name:"Gemini 3.0 Pro"},{id:"minimax-m2",name:"Minimax M2"},{id:"kimi-0905",name:"Kimi 0905"}],l={"xhs-batch":["copy","outline","content","repair","image"]},d=[{id:"persona-ai",name:"Volumn.ai(高质量)",creditsPerK:.9},{id:"advanced-bundle",name:"高级组合(Nanobanana / GPT5.2 / Gemini3.0 Pro / Minimax M2 / Kimi0905)",creditsPerK:.45}];function c(e){let t=("string"==typeof e?e:"").trim();if(!t)return"";let a=(t.split("\n")[0]??"").trim();if(!a)return"";let s=a.split(/[·•|]/).map(e=>e.trim()).filter(Boolean);if(0===s.length)return"";let r=function(e){let t=(e??"").trim();if(!t)return"";let a=/^sales\s*engine(?:\s*\((from\s+replies|from\s+retweets)\))?$/i.exec(t);if(!a)return t;let s=(a[1]??"").toLowerCase().trim();return s?`Sales Engine (${s})`:"Sales Engine"}(s[0]??""),n=s[1]??"";return/^audience\s*extract$/i.test(n)?`${r} \xb7 Audience extract`:r}function o(e){if(!e)return"--";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString():e}},60074:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(56059).A)("refresh-cw",[["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"}]])},66016:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(56059).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},79428:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(56059).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}}]);

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.