PageSourceSearch

https://www.volumn.ai/_next/static/chunks/18771.eec3d9a6002a2c0a.js

js volumn.ai collected 2026-10-01 16:18:14 UTC 49,548 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18771,70145,92526],{10062:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},14125:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},17671:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},18006:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},18028:(e,t,s)=>{s.d(t,{Mq:()=>j,Nu:()=>d,W0:()=>N,XI:()=>A,Yx:()=>z,Zo:()=>f,b3:()=>v,eV:()=>w,eh:()=>y,iD:()=>M,oC:()=>u,ty:()=>o});var a=s(4018);let l=new Set,n={status:"checking",session:null,accessToken:null,userId:null,sessionTimedOut:!1,updatedAtMs:0},i=null,r=0;function c(e){let t=n;if(t.status!==e.status||t.userId!==e.userId||t.accessToken!==e.accessToken||t.sessionTimedOut!==e.sessionTimedOut||t.updatedAtMs!==e.updatedAtMs)for(let t of(n=e,l))t()}function d(e){return l.add(e),()=>l.delete(e)}function o(){return n}async function u(e){let t=Date.now(),s="number"==typeof e?.maxAgeMs&&e.maxAgeMs>=0?Math.floor(e.maxAgeMs):4e3,l=!!e?.force;return!l&&n.updatedAtMs>0&&t-n.updatedAtMs<s?n:i&&!l?await i:!l&&t-r<400?n:(r=t,i=(async()=>{if(!a.$G){let e={status:"signed_out",session:null,accessToken:null,userId:null,sessionTimedOut:!1,updatedAtMs:Date.now()};return c(e),e}let{session:t,timedOut:s}=await (0,a.getSessionWithTimeout)({timeoutMs:e?.timeoutMs,retries:e?.retries,retryDelayMs:e?.retryDelayMs}),l=t?.user?.id??null,n=t?.access_token??null,i=l?{status:"signed_in",
1session:t,accessToken:n,userId:l,sessionTimedOut:s,updatedAtMs:Date.now()}:s?{status:"timed_out",session:null,accessToken:null,userId:null,sessionTimedOut:!0,updatedAtMs:Date.now()}:{status:"signed_out",session:null,accessToken:null,userId:null,sessionTimedOut:!1,updatedAtMs:Date.now()};return c(i),i})().catch(()=>n).finally(()=>{i=null}),await i)}let m=new Set,x={userId:null,status:"unknown",updatedAtMs:0},h=null,g=0;function p(e){let t=x;if(t.userId!==e.userId||t.status!==e.status||t.updatedAtMs!==e.updatedAtMs)for(let t of(x=e,m))t()}function b(e){let t=(e??"unknown").toString().trim().toLowerCase();return t?"free"===t?"free":"unknown"===t?"unknown":t:"unknown"}function f(e){return m.add(e),()=>m.delete(e)}function v(){return x.status}function j(e,t){let s=b(e);if(!s||"unknown"===s)return;let a=t?.userId??n.userId??x.userId??null;a&&p({userId:a,status:s,updatedAtMs:Date.now()})}async function y(e){let t=Date.now(),s="number"==typeof e?.maxAgeMs&&e.maxAgeMs>=0?Math.floor(e.maxAgeMs):15e3,a=!!e?.forceRefresh;return!a&&x.updatedAtMs>0&&t-x.updatedAtMs<s?x.status:h&&!a?await h:!a&&t-g<800?x.status:(g=t,h=(async()=>(await N({sessionTimeoutMs:e?.sessionTimeoutMs,sessionRetries:e?.sessionRetries,sessionRetryDelayMs:e?.sessionRetryDelayMs,membershipMaxAgeMs:s,forceRefreshMembership:a})).membershipStatus)().catch(()=>x.status).finally(()=>{h=null}),await h)}async function N(e){if(!a.$G)return p({userId:null,status:"free",updatedAtMs:Date.now()}),{session:null,accessToken:null,userId:null,membershipStatus:"free",sessionTimedOut:!1};let{session:t,timedOut:s}=await (0,a.getSessionWithTimeout)({timeoutMs:e?.sessionTimeoutMs,retries:e?.sessionRetries,retryDelayMs:e?.sessionRetryDelayMs}),l=t?.user?.id??null,n=t?.access_token??null;if(!l)return p({userId:null,status:"unknown",updatedAtMs:Date.now()}),{session:null,accessToken:null,userId:null,membershipStatus:"unknown",sessionTimedOut:s};let i="number"==typeof e?.membershipMaxAgeMs&&e.membershipMaxAgeMs>=0?e.membershipMaxAgeMs:void 0;e?.forceRefreshMembership;let r={session:t,accessToken:n,userId:l,membershipStatus:b(await (0,a.M3)({sessionTimeoutMs:e?.sessionTimeoutMs,sessionRetries:e?.sessionRetries,sessionRetryDelayMs:e?.sessionRetryDelayMs,maxAgeMs:i,forceRefresh:!0})),sessionTimedOut:s};return p({userId:l,status:r.membershipStatus,updatedAtMs:Date.now()}),r}let k=Object.freeze({timeoutMs:6e3,retries:1,retryDelayMs:350});async function w(e){return await u({timeoutMs:e?.timeoutMs??k.timeoutMs,retries:e?.retries??k.retries,retryDelayMs:e?.retryDelayMs??k.retryDelayMs,maxAgeMs:e?.maxAgeMs,force:e?.force})}async function A(e){return await M({timeoutMs:e?.timeoutMs??k.timeoutMs,retries:e?.retries??k.retries,retryDelayMs:e?.retryDelayMs??k.retryDelayMs,signal:e?.signal??null})}async function M(e){let{session:t}=await (0,a.getSessionWithTimeout)(e);return t?.access_token??null}async function z(e){let t="number"==typeof e?.maxWaitMs&&e.maxWaitMs>0?Math.floor(e.maxWaitMs):4500,s="number"==typeof e?.pollEveryMs&&e.pollEveryMs>0?Math.floor(e.pollEveryMs):500,l=Date.now();for(;Date.now()-l<t;){let{session:t}=await (0,a.getSessionWithTimeout)({timeoutMs:e?.timeoutMs,retries:e?.retries,retryDelayMs:e?.retryDelayMs,signal:e?.signal??null});if(t?.user)return t;await function(e){return new Promise(t=>setTimeout(t,e))}(s)}return null}let I=globalThis;if(!I.__aipersona_auth_store_listener){let{data:e}=a.ND.auth.onAuthStateChange((e,t)=>{let s=t?.user?.id??null,a=t?.access_token??null;
1"SIGNED_OUT"!==e&&s?c({status:"signed_in",session:t,accessToken:a,userId:s,sessionTimedOut:!1,updatedAtMs:Date.now()}):c({status:"signed_out",session:null,accessToken:null,userId:null,sessionTimedOut:!1,updatedAtMs:Date.now()})});I.__aipersona_auth_store_listener=e?.subscription??null}let C=globalThis;if(!C.__aipersona_membership_listener){let{data:e}=a.ND.auth.onAuthStateChange((e,t)=>{let s=t?.user?.id??null;s&&"SIGNED_OUT"!==e?(p({userId:s,status:x.status,updatedAtMs:x.updatedAtMs}),("SIGNED_IN"===e||"TOKEN_REFRESHED"===e)&&y({maxAgeMs:0}).catch(()=>null)):p({userId:null,status:"unknown",updatedAtMs:Date.now()})});C.__aipersona_membership_listener=e?.subscription??null}},18771:(e,t,s)=>{s.r(t),s.d(t,{default:()=>_});var a=s(53757),l=s(40148),n=s.n(l),i=s(24361),r=s(70145),c=s(79428),d=s(14125),o=s(48240),u=s(18006),m=s(88858),x=s(55675),h=s(27357),g=s(21318),p=s(10062),b=s(79191),f=s(94138),v=s(17671),j=s(59560),y=s(31925),N=s(65207);let k=[{value:"official",label:"Official",angle:"产品发布、里程碑与权威信息"},{value:"founder",label:"Founder",angle:"创始人观点、愿景与幕后故事"},{value:"product",label:"Product",angle:"产品能力、教程与 use case"},{value:"ecosystem",label:"Ecosystem",angle:"合作伙伴、社区与生态新闻"},{value:"regional",label:"Regional",angle:"本地化语言与地区社区话题"},{value:"custom",label:"Custom",angle:"自定义内容角度"}],w=[{value:"community_growth",label:"Discord 社区增长"},{value:"waitlist",label:"Waitlist 注册"},{value:"testnet",label:"Testnet 参与"},{value:"ama",label:"AMA 报名"},{value:"listing",label:"Listing 宣发"},{value:"partnerships",label:"合作伙伴拓展"},{value:"custom",label:"自定义目标"}],A=[{key:"scheduled",label:"已排期",short:"Schedule"},{key:"published",label:"已发布",short:"Published"},{key:"autoplugged",label:"AutoPlug",short:"AutoPlug"},{key:"link_clicked",label:"链接点击",short:"Clicks"},{key:"discord_joined",label:"Discord 入群",short:"Joined"},{key:"discord_activated",label:"社区激活",short:"Activated"},{key:"converted",label:"完成转化",short:"Converted"}];function M(e){return e.username?`@${e.username.replace(/^@/,"")}`:e.displayName||e.name||"X account"}function z(e){return e.replace(/^@/,"").slice(0,2).toUpperCase()||"X"}async function I(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`Request failed (${e.status})`);if(!t)throw Error("Empty server response");return t}function C(e){let{className:t="",children:s}=e;return(0,a.jsx)("section",{className:`rounded-[24px] border border-zinc-200/90 bg-white/95 shadow-[0_16px_48px_rgba(15,23,42,0.06)] backdrop-blur-xl dark:border-zinc-800 dark:bg-zinc-900/95 ${t}`,children:s})}function D(e){let{children:t}=e;return(0,a.jsx)("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-[0.12em] text-zinc-500 dark:text-zinc-400",children:t})}let S="w-full rounded-xl border border-zinc-200 bg-white px-3.5 py-2.5 text-sm text-zinc-950 outline-none transition placeholder:text-zinc-400 focus:border-blue-400 focus:ring-4 focus:ring-blue-500/10 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-50";function _(){let[e,t]=(0,i.useState)(null),[s,l]=(0,i.useState)(!0),[h,g]=(0,i.useState)(!1),[p,b]=(0,i.useState)(!1),[f,v]=(0,i.useState)(!1),[j,y]=(0,i.useState)(!1),[N,w]=(0,i.useState)(null),[A,M]=(0,i.useState)(null),[z,D]=(0,i.useState)([]),[S,_]=(0,i.useState)([]),[P,$]=(0,i.useState)(null),[E,W]=(0,i.useState)(null),[O,U]=(0,i.useState)(!1),[G,L]=(0,i.useState)(""),[B,V]=(0,i.useState)("community_growth"),[X,q]=(0,i.useState)(""),[F,H]=(0,i.useState)([]),[J,K]=(0,i.useState)(""),[Y,Z]=(0,i.useState)(""),[Q,ee]=(0,i.useState)(""),[et,es]=(0,i.useState)("Welcome {{user}} — pick your role and start here."),[ea,el]=(0,i.useState)(""),[en,ei]=(0,i.useState)(""),[er,ec]=(0,i.useState)(""),[ed,eo]=(0,i.useState)(!0),[eu,em]=(0,i.useState)("metric_gt"),[ex,eh]=(0,i.useState)("replies"),[eg,ep]=(0,i.useState)(2),[eb,ef]=(0,i.useState)("The full update and community discussion are live → {{discord_link}}"),[ev,ej]=(0,i.useState)({}),[ey,eN]=(0,i.useState)(()=>{var e;return new Date((e=new Date(Date.now()+12e5)).getTime()-6e4*e.getTimezoneOffset()).toISOString().slice(0,16)}),[ek,ew]=(0,i.useState)(12),[eA,eM]=(0,i.useState)([]),ez=(0,i.useMemo)(()=>S.find(e=>e.id===E)??null,[S,E]),eI=(0,i.useCallback)(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{...e?{Authorization:`Bearer ${e}`}:{},...t?{"Content-Type":"application/json"}:{}}},[e]),eC=(0,i.useCallback)(e=>{_(t=>t.some(t=>t.id===e.id)?t.map(t=>
1t.id===e.id?e:t):[e,...t]),W(e.id)},[]),eD=(0,i.useCallback)(async e=>{let t=await I(await fetch("/api/crypto-growth/campaigns",{headers:{Authorization:`Bearer ${e}`}}));_(t.campaigns),$(t.discordBotInviteUrl),W(e=>e??t.campaigns[0]?.id??null)},[]);(0,i.useEffect)(()=>{let e=!1;return(async()=>{l(!0),w(null);try{let{session:s}=await (0,r.KE)({timeoutMs:4e3,retries:2,retryDelayMs:150}),a=s?.access_token??null;if(!a)throw Error("请先登录 Volumn");if(e)return;t(a);let[l]=await Promise.all([I(await fetch("/api/integrations/x/status?lite=1",{headers:{Authorization:`Bearer ${a}`}})),eD(a)]);if(e)return;D(l.accounts.filter(e=>e.id))}catch(t){e||w(t instanceof Error?t.message:"加载 Crypto Growth 失败")}finally{e||l(!1)}})(),()=>{e=!0}},[eD]),(0,i.useEffect)(()=>{ez&&ej(e=>{let t={...e};for(let e of ez.accounts.filter(e=>e.enabled)){if(void 0!==t[e.accountId])continue;let s=e.username?`@${e.username.replace(/^@/,"")}`:"this account";t[e.accountId]=`${s}: ${e.contentAngle||"Share the campaign update from this account's point of view."}`}return t})},[ez]);let eS=(0,i.useCallback)(()=>{L(""),V("community_growth"),q(""),H([]),K(""),Z(""),ee(""),el(""),ei(""),ec(""),M(null),w(null)},[]),e_=(0,i.useCallback)(()=>{eS(),U(!0),W(null)},[eS]),eT=(0,i.useCallback)(e=>{H(t=>{if(t.find(t=>t.accountId===e.id))return t.filter(t=>t.accountId!==e.id);let s=k[Math.min(t.length,k.length-1)];return[...t,{accountId:e.id,username:e.username,displayName:e.name,role:s.value,language:null,contentAngle:s.angle,enabled:!0}]})},[]),eR=(0,i.useCallback)((e,t)=>{H(s=>s.map(s=>s.accountId===e?{...s,...t}:s))},[]),eP=(0,i.useCallback)(async()=>{if(e){g(!0),w(null),M(null);try{let e=await I(await fetch("/api/crypto-growth/campaigns",{method:"POST",headers:eI(!0),body:JSON.stringify({name:G,goal:B,customGoalLabel:"custom"===B?X:null,accounts:F,discord:{inviteUrl:J,guildId:Y,welcomeChannelId:Q,welcomeMessage:et,autoRoleId:ea,activationRoleId:en,conversionRoleId:er},autoPlug:{enabled:ed,timing:eu,metric:ex,threshold:eg,contentTemplate:eb}})}));eC(e.campaign),$(e.discordBotInviteUrl),U(!1),M("Campaign 已创建。现在为每个矩阵账号写一条内容并排期。")}catch(e){w(e instanceof Error?e.message:"创建 Campaign 失败")}finally{g(!1)}}},[F,en,eC,eI,ed,ex,eb,eg,eu,ea,er,X,Y,J,B,G,e,Q,et]),e$=(0,i.useCallback)(async()=>{if(!ez||!e)return;let t=new Date(ey);if(Number.isNaN(t.getTime()))return void w("请选择有效的排期时间");let s=ez.accounts.filter(e=>e.enabled).map((e,s)=>({accountId:e.accountId,content:(ev[e.accountId]??"").trim(),scheduledAt:new Date(t.getTime()+s*Math.max(0,ek)*6e4).toISOString()})).filter(e=>e.content);if(0===s.length)return void w("至少为一个矩阵账号填写推文内容");b(!0),w(null),M(null);try{let e=await I(await fetch(`/api/crypto-growth/campaigns/${encodeURIComponent(ez.id)}/launch`,{method:"POST",headers:eI(!0),body:JSON.stringify({variations:s})}));eC(e.campaign),eM(e.items),M(`${e.items.length} 条矩阵内容已进入 Schedule,AutoPlug 追踪链接已分别生成。`)}catch(e){w(e instanceof Error?e.message:"排期失败")}finally{b(!1)}},[eC,eI,ey,ev,ez,ek,e]),eE=(0,i.useCallback)(async t=>{if(ez&&e){v(!0),w(null),M(null);try{let e=await I(await fetch(`/api/crypto-growth/campaigns/${encodeURIComponent(ez.id)}`,{method:"PATCH",headers:eI(!0),body:JSON.stringify(t)}));eC(e.campaign),M("Campaign 的 Discord 与 AutoPlug 设置已保存。")}catch(e){w(e instanceof Error?e.message:"保存 Campaign 设置失败")}finally{v(!1)}}},[eC,eI,ez,e]),eW=(0,i.useCallback)(async()=>{if(e){y(!0),w(null);try{await eD(e)}catch(e){w(e instanceof Error?e.message:"刷新失败")}finally{y(!1)}}},[eD,e]);return s?(0,a.jsx)("main",{className:"flex min-h-[calc(100vh-72px)] items-center justify-center",children:(0,a.jsx)(c.A,{className:"h-7 w-7 animate-spin text-[#1547ff]"})}):(0,a.jsxs)("main",{className:"relative isolate min-h-[calc(100vh-72px)] overflow-hidden px-4 pb-20 pt-10 text-zinc-950 dark:text-zinc-50 sm:px-6 sm:pt-14 lg:px-8",children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 -top-72 -z-10 h-[760px]",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_50%_0%,rgba(37,99,235,0.22)_0%,rgba(79,70,229,0.12)_36%,rgba(34,211,238,0.07)_55%,transparent_76%)] blur-[100px]"})}),(0,a.jsxs)("div",{className:"mx-auto max-w-7xl space-y-6",children:[(0,a.jsxs)("header",{className:"relative pb-3 sm:pb-5","aria-labelledby":"
1crypto-growth-title",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-blue-200 bg-blue-50/90 px-3 py-1.5 text-[11px] font-semibold uppercase tracking-[0.14em] text-blue-700 shadow-sm dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-300 sm:text-xs",children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"})," Crypto Growth Engine"]}),(0,a.jsxs)("div",{className:"mt-5 flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between",children:[(0,a.jsxs)("div",{className:"max-w-4xl",children:[(0,a.jsx)("h1",{id:"crypto-growth-title",className:"font-sans text-[clamp(2.25rem,5.2vw,4rem)] font-bold leading-[1.03] tracking-[-0.04em] md:font-serif",children:"把 X 矩阵流量,变成可追踪的 Discord 转化"}),(0,a.jsx)("p",{className:"mt-4 max-w-3xl text-sm leading-7 text-zinc-600 dark:text-zinc-400 sm:text-base",children:"一次配置多账号内容角度、发布时间、互动触发回复与 Discord 承接;每一步自动进入同一条增长漏斗。"})]}),(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-3 sm:flex-row",children:[(0,a.jsxs)(n(),{href:"/schedule",className:"inline-flex h-12 items-center justify-center gap-2 rounded-2xl border border-zinc-300 bg-white/90 px-5 text-sm font-semibold text-zinc-700 transition hover:-translate-y-0.5 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-950/80 dark:text-zinc-200 dark:hover:bg-zinc-900",children:[(0,a.jsx)(o.A,{className:"h-4 w-4"})," 查看 Schedule"]}),(0,a.jsxs)("button",{onClick:e_,className:"inline-flex h-12 items-center justify-center gap-2 rounded-2xl border border-[#102A9E] bg-[#1547ff] px-5 text-sm font-semibold text-white shadow-[0_10px_28px_rgba(30,64,175,0.30)] transition hover:-translate-y-0.5 hover:bg-[#103bd6]",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"})," 新建 Campaign"]})]})]})]}),(N||A)&&(0,a.jsx)("div",{className:`rounded-2xl border px-4 py-3 text-sm ${N?"border-rose-200 bg-rose-50 text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300":"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300"}`,children:N||A}),(0,a.jsxs)("div",{className:"grid gap-5 lg:grid-cols-[280px_minmax(0,1fr)]",children:[(0,a.jsxs)(C,{className:"h-fit overflow-hidden lg:sticky lg:top-[92px]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-zinc-100 px-4 py-4 dark:border-zinc-800",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-semibold",children:"Campaigns"}),(0,a.jsxs)("div",{className:"text-xs text-zinc-500",children:[S.length," 个增长项目"]})]}),(0,a.jsx)("button",{onClick:eW,disabled:j,className:"rounded-lg p-2 text-zinc-500 hover:bg-zinc-100 disabled:opacity-50 dark:hover:bg-zinc-800","aria-label":"刷新漏斗",children:(0,a.jsx)(m.A,{className:`h-4 w-4 ${j?"animate-spin":""}`})})]}),(0,a.jsxs)("div",{className:"space-y-1.5 p-2",children:[S.map(e=>{let t=!O&&e.id===E;return(0,a.jsxs)("button",{onClick:()=>{U(!1),W(e.id),M(null),w(null)},className:`w-full rounded-2xl border px-3.5 py-3 text-left transition ${t?"border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-950/30":"border-transparent hover:bg-zinc-50 dark:hover:bg-zinc-800/70"}`,children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsx)("span",{className:"truncate text-sm font-semibold",children:e.name}),(0,a.jsx)("span",{className:`mt-0.5 h-2 w-2 shrink-0 rounded-full ${"active"===e.status?"bg-emerald-500":"bg-zinc-300 dark:bg-zinc-600"}`})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-xs text-zinc-500",children:[(0,a.jsxs)("span",{children:[e.accounts.length," X accounts"]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[e.funnel.totals.discord_joined," joined"]})]})]},e.id)}),0===S.length&&!O&&(0,a.jsxs)("button",{onClick:e_,className:"w-full rounded-2xl border border-dashed border-zinc-300 px-4 py-8 text-center text-sm text-zinc-500 hover:border-blue-400 hover:text-[#1547ff] dark:border-zinc-700",children:[(0,a.jsx)(u.A,{className:"mx-auto mb-2 h-5 w-5"})," 创建第一个 Campaign"]})]})]}
1),O?(0,a.jsx)(T,{accounts:z,name:G,setName:L,goal:B,setGoal:V,customGoalLabel:X,setCustomGoalLabel:q,accountDrafts:F,toggleAccount:eT,updateAccountDraft:eR,discordInviteUrl:J,setDiscordInviteUrl:K,discordGuildId:Y,setDiscordGuildId:Z,welcomeChannelId:Q,setWelcomeChannelId:ee,welcomeMessage:et,setWelcomeMessage:es,autoRoleId:ea,setAutoRoleId:el,activationRoleId:en,setActivationRoleId:ei,conversionRoleId:er,setConversionRoleId:ec,autoPlugEnabled:ed,setAutoPlugEnabled:eo,autoPlugTiming:eu,setAutoPlugTiming:em,autoPlugMetric:ex,setAutoPlugMetric:eh,autoPlugThreshold:eg,setAutoPlugThreshold:ep,autoPlugTemplate:eb,setAutoPlugTemplate:ef,onCancel:()=>{U(!1),W(S[0]?.id??null)},onCreate:eP,saving:h}):ez?(0,a.jsx)(R,{campaign:ez,discordBotInviteUrl:P,postDrafts:ev,setPostDrafts:ej,launchAt:ey,setLaunchAt:eN,spacingMinutes:ek,setSpacingMinutes:ew,onLaunch:e$,launching:p,launchedItems:eA,onUpdateSettings:eE,savingSettings:f}):(0,a.jsxs)(C,{className:"flex min-h-[560px] flex-col items-center justify-center p-8 text-center",children:[(0,a.jsx)("div",{className:"mb-4 rounded-2xl bg-blue-50 p-4 text-[#1547ff] dark:bg-blue-950/40 dark:text-blue-300",children:(0,a.jsx)(x.A,{className:"h-8 w-8"})}),(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"把矩阵流量变成可归因的社区增长"}),(0,a.jsx)("p",{className:"mt-2 max-w-lg text-sm leading-6 text-zinc-500",children:"连接 X 账号后创建 Campaign。系统会为每条 AutoPlug 生成独立链接,并追踪到 Discord 激活与转化。"}),(0,a.jsxs)("div",{className:"mt-5 flex gap-2",children:[(0,a.jsx)(n(),{href:"/integration",className:"rounded-xl border border-zinc-200 px-4 py-2.5 text-sm font-medium hover:bg-zinc-50 dark:border-zinc-700 dark:hover:bg-zinc-800",children:"连接 X / Discord"}),(0,a.jsx)("button",{onClick:e_,className:"rounded-xl bg-[#1547ff] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#103bd6]",children:"新建 Campaign"})]})]})]})]})]})}function T(e){return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(C,{className:"p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"mb-5 flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:e.onCancel,className:"mb-2 inline-flex items-center gap-1 text-xs font-medium text-zinc-500 hover:text-zinc-900 dark:hover:text-white",children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"})," 返回"]}),(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"创建 Crypto Campaign"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-zinc-500",children:"把 X 矩阵角色、Discord 承接和 AutoPlug 触发一次配好。"})]}),(0,a.jsx)("span",{className:"rounded-full bg-blue-50 px-3 py-1 text-xs font-semibold text-[#1547ff] dark:bg-blue-950/40 dark:text-blue-300",children:"Step 1 / 3"})]}),(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Campaign 名称"}),(0,a.jsx)("input",{value:e.name,onChange:t=>e.setName(t.target.value),className:S,placeholder:"例如:Testnet Season 2"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"主要转化目标"}),(0,a.jsx)("select",{value:e.goal,onChange:t=>e.setGoal(t.target.value),className:S,children:w.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),"custom"===e.goal&&(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)(D,{children:"自定义目标"}),(0,a.jsx)("input",{value:e.customGoalLabel,onChange:t=>e.setCustomGoalLabel(t.target.value),className:S,placeholder:"描述本次 Campaign 的最终转化"})]})]})]}),(0,a.jsxs)(C,{className:"p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(g.A,{className:"h-4 w-4 text-[#1547ff]"})," X 账号矩阵"]}),(0,a.jsx)("p",{className:"mt-1 text-sm text-zinc-500",children:"每个账号承担一个叙事角色,避免矩阵内容完全重复。"})]}),(0,a.jsxs)("span",{className:"text-xs font-medium text-zinc-500",children:["已选 ",e.accountDrafts.length]})]}),0===e.accounts.length?(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-zinc-300 p-8 text-center dark:border-zinc-700",children:[(0,a.jsx)("p",{className:"text-sm text-zinc-500",children:"还没有可用的 X 账号。"}),(0,a.jsx)(n(),{href:"/integration",className:"mt-3 inline-flex rounded-xl bg-zinc-950 px-4 py-2 text-sm font-semibold text-white dark:bg-white dark:text-zinc-950",children:"去连接账号"})]}):(0,a.jsx)("div",{className:"space-y-3",children:e.accounts.map(t=>{let s=e.accountDrafts.find(e=>e.accountId===t.id),l=!!s;return(0,a.jsxs)("div",{className:`rounded-2xl border p-3.5 transition ${l?"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20":"border-zinc-200 dark:border-zinc-800"}`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{onClick:()=>e.toggleAccount(t),className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md border ${l?"border-[#1547ff] bg-[#1547ff] text-white":"border-zinc-300 dark:border-zinc-600"}`,"aria-label":l?"移除账号":"选择账号",children:l&&(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-zinc-950 text-xs font-semibold text-white dark:bg-white dark:text-zinc-950",children:z(M(t))}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate text-sm font-semibold",children:M(t)}),(0,a.jsxs)("div",{className:"truncate text-xs text-zinc-500",children:[t.name||"Connected X account",t.needsReconnect?" \xb7 需要重新连接":""]})]})]}),s&&(0,a.jsxs)("div",{className:"mt-3 grid gap-3 border-t border-blue-100 pt-3 dark:border-blue-900/60 sm:grid-cols-[160px_minmax(0,1fr)]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"矩阵角色"}),(0,a.jsx)("select",{value:s.role,onChange:a=>{let l=a.target.value,n=k.find(e=>e.value===l);e.updateAccountDraft(t.id,{role:l,contentAngle:n?.angle??s.contentAngle})},className:S,children:k.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"内容角度"}),(0,a.jsx)("input",{value:s.contentAngle??"",onChange:s=>e.updateAccountDraft(t.id,{contentAngle:s.target.value}),className:S})]})]})]},t.id)})})]}),(0,a.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,a.jsxs)(C,{className:"p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-[#5865F2]"})," Discord 承接"]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Campaign Invite URL"}),(0,a.jsx)("input",{value:e.discordInviteUrl,onChange:t=>e.setDiscordInviteUrl(t.target.value),className:S,placeholder:"https://discord.gg/your-campaign"})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Guild ID"}),(0,a.jsx)("input",{value:e.discordGuildId,onChange:t=>e.setDiscordGuildId(t.target.value),className:S,placeholder:"Server ID"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Welcome Channel ID"}),(0,a.jsx)("input",{value:e.welcomeChannelId,onChange:t=>e.setWelcomeChannelId(t.target.value),className:S,placeholder:"Channel ID"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"自动身份组 ID"}),(0,a.jsx)("input",{value:e.autoRoleId,onChange:t=>e.setAutoRoleId(t.target.value),className:S,placeholder:"New member role"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"激活身份组 ID"}),(0,a.jsx)("input",{value:e.activationRoleId,onChange:t=>e.setActivationRoleId(t.target.value),className:S,placeholder:"Activated role"})]}),(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)(D,{children:"转化身份组 ID"}),(0,a.jsx)("input",{value:e.conversionRoleId,onChange:t=>e.setConversionRoleId(t.target.value),className:S,placeholder:"Converted / Customer role"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"欢迎语"}),(0,a.jsx)("textarea",{value:e.welcomeMessage,onChange:t=>e.setWelcomeMessage(t.target.value),className:`${S} min-h-20 resize-y`}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-zinc-400",children:["支持变量:","{{user}}","、","{{campaign}}"]})]})]})]}),(0,a.jsxs)(C,{className:"p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(f.A,{className:"h-4 w-4 text-emerald-600"})," Smart AutoPlug"]}),(0,a.jsx)("button",{onClick:()=>e.setAutoPlugEnabled(!e.autoPlugEnabled),className:`relative h-6 w-11 rounded-full transition ${e.autoPlugEnabled?"bg-emerald-500":"bg-zinc-300 dark:bg-zinc-700"}`,children:(0,a.jsx)("span",{className:`absolute top-1 h-4 w-4 roun
1ded-full bg-white shadow transition ${e.autoPlugEnabled?"left-6":"left-1"}`})})]}),(0,a.jsxs)("div",{className:`space-y-3 ${e.autoPlugEnabled?"":"pointer-events-none opacity-40"}`,children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"触发时机"}),(0,a.jsxs)("select",{value:e.autoPlugTiming,onChange:t=>e.setAutoPlugTiming(t.target.value),className:S,children:[(0,a.jsx)("option",{value:"metric_gt",children:"互动达标后"}),(0,a.jsx)("option",{value:"immediate",children:"发布后立即"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"互动指标"}),(0,a.jsxs)("select",{value:e.autoPlugMetric,onChange:t=>e.setAutoPlugMetric(t.target.value),className:S,children:[(0,a.jsx)("option",{value:"replies",children:"Replies"}),(0,a.jsx)("option",{value:"likes",children:"Likes"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"阈值"}),(0,a.jsx)("input",{type:"number",min:0,value:e.autoPlugThreshold,onChange:t=>e.setAutoPlugThreshold(Number(t.target.value)||0),className:S})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"回复模板"}),(0,a.jsx)("textarea",{value:e.autoPlugTemplate,onChange:t=>e.setAutoPlugTemplate(t.target.value),className:`${S} min-h-28 resize-y`}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-zinc-400",children:["{{discord_link}}"," 会替换成该账号独立的追踪链接。"]})]})]})]})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{onClick:e.onCancel,className:"rounded-xl border border-zinc-200 px-4 py-2.5 text-sm font-medium hover:bg-white dark:border-zinc-700 dark:hover:bg-zinc-900",children:"取消"}),(0,a.jsxs)("button",{onClick:e.onCreate,disabled:e.saving||!e.name.trim()||0===e.accountDrafts.length||!e.discordInviteUrl.trim(),className:"inline-flex items-center gap-2 rounded-xl bg-[#1547ff] px-5 py-2.5 text-sm font-semibold text-white hover:bg-[#103bd6] disabled:cursor-not-allowed disabled:opacity-40",children:[e.saving?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(v.A,{className:"h-4 w-4"})," 创建并进入排期"]})]})]})}function R(e){let{campaign:t}=e,s=(0,i.useMemo)(()=>new Map(t.funnel.byAccount.map(e=>[e.accountId,e])),[t.funnel.byAccount]);return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(C,{className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 border-b border-zinc-100 px-5 py-5 dark:border-zinc-800 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,a.jsx)("span",{className:`h-2.5 w-2.5 rounded-full ${"active"===t.status?"bg-emerald-500":"bg-amber-400"}`}),(0,a.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-zinc-500",children:t.status})]}),(0,a.jsx)("h2",{className:"text-xl font-semibold",children:t.name}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-zinc-500",children:[w.find(e=>e.value===t.goal)?.label," \xb7 ",t.accounts.length," 个矩阵账号 \xb7 Invite ",t.discord.inviteCode?`/${t.discord.inviteCode}`:"已连接"]})]}),(0,a.jsxs)("a",{href:t.discord.inviteUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-xl border border-zinc-200 px-3.5 py-2 text-sm font-medium hover:bg-zinc-50 dark:border-zinc-700 dark:hover:bg-zinc-800",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-[#5865F2]"})," 打开 Discord ",(0,a.jsx)(j.A,{className:"h-3.5 w-3.5"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 divide-x divide-y divide-zinc-100 dark:divide-zinc-800 sm:grid-cols-4 xl:grid-cols-7",children:A.map((e,s)=>(0,a.jsxs)("div",{className:"relative px-4 py-4",children:[s>0&&(0,a.jsx)("span",{className:"absolute -left-1.5 top-1/2 hidden h-3 w-3 -translate-y-1/2 rotate-45 border-r border-t border-zinc-200 bg-white xl:block dark:border-zinc-700 dark:bg-zinc-900"}),(0,a.jsx)("div",{className:"text-2xl font-semibold tabular-nums",children:t.funnel.totals[e.key]}),(0,a.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500",children:e.label})]},e.key))})]}),(0,a.jsxs)("div",{className:"grid gap-5 xl:grid-cols-[minmax(0,1.45fr)_minmax(300px,0.55fr)]",children:[(0,a.jsxs)(C,{className:"p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 text-[#1547ff]"})," Launch a content wave"]}),(0,a.jsx)("p",{className:"mt-1 text-sm text-zinc-500",children:"每个账号写一条原生内容,系统按间隔进入现有 Schedule。"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"首发时间"}),(0,a.jsx)("input",{type:"datetime-local",value:e.launchAt,onChange:t=>e.setLaunchAt(t.target.value),className:S})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"账号间隔(分钟)"}),(0,a.jsx)("input",{type:"number",min:0,value:e.spacingMinutes,onChange:t=>e.setSpacingMinutes(Number(t.target.value)||0),className:S})]})]})]}),(0,a.jsx)("div",{className:"space-y-3",children:t.accounts.filter(e=>e.enabled).map((t,s)=>{let l=new Date(new Date(e.launchAt).getTime()+s*e.spacingMinutes*6e4);return(0,a.jsxs)("div",{className:"rounded-2xl border border-zinc-200 p-4 dark:border-zinc-800",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-zinc-950 text-xs font-semibold text-white dark:bg-white dark:text-zinc-950",children:z(M(t))}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate text-sm font-semibold",children:M(t)}),(0,a.jsxs)("div",{className:"truncate text-xs text-zinc-500",children:[k.find(e=>e.value===t.role)?.label," \xb7 ",t.contentAngle||"Custom angle"]})]}),(0,a.jsxs)("div",{className:"text-right text-xs text-zinc-500",children:[(0,a.jsxs)("div",{children:["Wave ",s+1]}),(0,a.jsx)("div",{children:Number.isNaN(l.getTime())?"—":l.toLocaleStr
1ing([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),(0,a.jsx)("textarea",{value:e.postDrafts[t.accountId]??"",onChange:s=>e.setPostDrafts(e=>({...e,[t.accountId]:s.target.value})),className:`${S} min-h-28 resize-y`,placeholder:"写这一个账号的原生推文内容…"}),(0,a.jsxs)("div",{className:"mt-2 text-right text-xs tabular-nums text-zinc-400",children:[(e.postDrafts[t.accountId]??"").length," chars"]})]},t.accountId)})}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col items-start justify-between gap-3 rounded-2xl bg-zinc-50 p-4 dark:bg-zinc-950 sm:flex-row sm:items-center",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"rounded-xl bg-emerald-100 p-2 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-sm font-semibold",children:["AutoPlug ",t.autoPlug.enabled?"已开启":"已关闭"]}),(0,a.jsxs)("div",{className:"mt-0.5 text-xs text-zinc-500",children:["immediate"===t.autoPlug.timing?"推文发布后立即回复":`${t.autoPlug.metric} > ${t.autoPlug.threshold} 后回复`,",每个账号生成独立追踪链接。"]})]})]}),(0,a.jsxs)("button",{onClick:e.onLaunch,disabled:e.launching,className:"inline-flex shrink-0 items-center gap-2 rounded-xl bg-[#1547ff] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#103bd6] disabled:opacity-50",children:[e.launching?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(d.A,{className:"h-4 w-4"})," 排期并启动"]})]}),e.launchedItems.length>0&&(0,a.jsxs)("div",{className:"mt-4 rounded-2xl border border-emerald-200 bg-emerald-50/60 p-4 dark:border-emerald-900/60 dark:bg-emerald-950/20",children:[(0,a.jsx)("div",{className:"mb-2 text-sm font-semibold text-emerald-800 dark:text-emerald-300",children:"最近生成的追踪链接"}),(0,a.jsx)("div",{className:"space-y-2",children:e.launchedItems.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 text-xs",children:[(0,a.jsx)("span",{className:"truncate text-zinc-600 dark:text-zinc-300",children:M(t.accounts.find(t=>t.accountId===e.accountId)??{username:null})}),(0,a.jsxs)("a",{href:e.publicLink,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-medium text-emerald-700 hover:underline dark:text-emerald-300",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})," ",e.publicLink.replace(/^https?:\/\//,"")]})]},e.scheduleItemId))})]})]}),(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(C,{className:"p-5",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 text-[#1547ff]"})," 转化效率"]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)($,{label:"Click → Discord Join",value:t.funnel.clickToJoinRate}),(0,a.jsx)($,{label:"Join → Activated",value:t.funnel.joinToActivationRate}),(0,a.jsx)($,{label:"Activated → Converted",value:t.funnel.activationToConversionRate})]})]}),(0,a.jsxs)(C,{className:"p-5",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-base font-semibold",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-[#5865F2]"})," Discord Bot"]}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-zinc-600 dark:text-zinc-300",children:[(0,a.jsx)(E,{done:!!t.discord.guildId,text:"配置 Guild ID"}),(0,a.jsx)(E,{done:!!t.discord.welcomeChannelId,text:"配置欢迎频道"}),(0,a.jsx)(E,{done:!!t.discord.activationRoleId,text:"配置激活身份组"}),(0,a.jsx)(E,{done:!!t.discord.conversionRoleId,text:"配置转化身份组"})]}),e.discordBotInviteUrl?(0,a.jsxs)("a",{href:e.discordBotInviteUrl,target:"_blank",rel:"noreferrer",className:"mt-4 inline-flex w-full items-center justify-center gap-2 rounded-xl bg-[#5865F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#4752C4]",children:["安装 Volumn Bot ",(0,a.jsx)(j.A,{className:"h-4 w-4"})]}):(0,a.jsx)("div",{className:"mt-4 rounded-xl bg-amber-50 px-3 py-2.5 text-xs text-amber-700 dark:bg-amber-950/30 dark:text-amber-300",children:"服务端需要配置 DISCORD_CLIENT_ID 才能生成 Bot 安装链接。"}),(0,a.jsx)("p",{className:"mt-3 text-xs leading-5 text-zinc-400",children:"在 Discord Developer Portal 打开 Server Members Intent;Bot 需要查看 Invite 和管理 Role 的权限。"})]}),(0,a.jsx)(P,{campaign:t,onSave:e.onUpdateSettings,saving:e.savingSettings},t.id),(0,a.jsxs)(C,{className:"overflow-hidden",children:[(0,a.jsx)("div",{className:"border-b border-zinc-100 px-5 py-4 text-sm font-semibold dark:border-zinc-800",children:"账号表现"}),(0,a.jsx)("div",{className:"divide-y divide-zinc-100 dark:divide-zinc-800",children:t.accounts.map(e=>{let t=s.get(e.accountId);return(0,a.jsxs)("div",{className:"px-5 py-3.5",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:M(e)}),(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:k.find(t=>t.value===e.role)?.label})]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[(0,a.jsx)(W,{label:"Published",value:t?.published??0}),(0,a.jsx)(W,{label:"AutoPlug",value:t?.autoplugged??0}),(0,a.jsx)(W,{label:"Clicks",value:t?.link_clicked??0})]})]},e.accountId)})})]})]})]})]})}function P(e){let{campaign:t,onSave:s,saving:l}=e,[n,r]=(0,i.useState)(!1),[d,o]=(0,i.useState)(t.discord),[u,m]=(0,i.useState)(t.autoPlug),x=(e,t)=>{o(s=>({...s,[e]:t}))},h=(e,t)=>{m(s=>({...s,[e]:t}))};return(0,a.jsxs)(C,{className:"overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>r(e=>!e),className:"flex w-full items-center justify-between gap-3 px-5 py-4 text-left hover:bg-zinc-50 dark:hover:bg-zinc-800/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-semibold",children:"Campaign Settings"}),(0,a.jsx)("div",{className:"mt-0.5 text-xs text-zinc-500",children:"补填 Discord IDs 或调整 AutoPlug"})]}),(0,a.jsx)("span",{className:"text-xs font-semibold text-[#1547ff] dark:text-blue-300",children:n?"收起":"编辑"})]}),n&&(0,a.jsxs)("div",{className:"space-y-4 border-t border-zinc-100 p-5 dark:border-zinc-800",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Discord Invite URL"}),(0,a.jsx)("input",{value:d.inviteUrl,onChange:e=>x("inviteUrl",e.target.value),className:S})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Guild ID"}),(0,a.jsx)("input",{value:d.guildId??"",onChange:e=>x("guildId",e.target.value||null),className:S})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Welcome Channel ID"}),(0,a.jsx)("input",{value:d.welcomeChannelId??"",onChange:e=>x("welcomeChannelId",e.target.value||null),className:S})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Auto Role ID"}),(0,a.jsx)("input",{value:d.autoRoleId??"",onChange:e=>x("autoRoleId",e.target.value||null),className:S})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Activation Role ID"}),(0,a.jsx)("input",{value:d.activationRoleId??"",onChange:e=>x("activationRoleId",e.target.value||null),className:S})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Conversion Role ID"}),(0,a.jsx)("input",{value:d.conversionRoleId??"",onChange:e=>x("conversionRoleId",e.target.value||null),className:S})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Welcome Message"}),(0,a.jsx)("textarea",{value:d.welcomeMessage??"",onChange:e=>x("welcomeMessage",e.target.value||null),className:`${S} min-h-20 resize-y`})]}),(0,a.jsxs)("div",{className:"border-t border-zinc-100 pt-4 dark:border-zinc-800",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-zinc-500",children:"AutoPlug"}),(0,a.jsx)("button",{onClick:()=>h("enabled",!u.enabled),className:`relative h-6 w-11 rounded-full transition ${u.enabled?"bg-emerald-500":"bg-zinc-300 dark:bg-zinc-700"}`,children:(0,a.jsx)("span",{className:`absolute top-1 h-4 w-4 roun
1ded-full bg-white transition ${u.enabled?"left-6":"left-1"}`})})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3 xl:grid-cols-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Timing"}),(0,a.jsxs)("select",{value:u.timing,onChange:e=>h("timing",e.target.value),className:S,children:[(0,a.jsx)("option",{value:"metric_gt",children:"互动达标后"}),(0,a.jsx)("option",{value:"immediate",children:"立即"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Metric"}),(0,a.jsxs)("select",{value:u.metric,onChange:e=>h("metric",e.target.value),className:S,children:[(0,a.jsx)("option",{value:"replies",children:"Replies"}),(0,a.jsx)("option",{value:"likes",children:"Likes"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D,{children:"Threshold"}),(0,a.jsx)("input",{type:"number",min:0,value:u.threshold,onChange:e=>h("threshold",Number(e.target.value)||0),className:S})]})]}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(D,{children:"Reply Template"}),(0,a.jsx)("textarea",{value:u.contentTemplate,onChange:e=>h("contentTemplate",e.target.value),className:`${S} min-h-24 resize-y`})]})]}),(0,a.jsxs)("button",{onClick:()=>s({discord:d,autoPlug:u}),disabled:l||!d.inviteUrl.trim(),className:"inline-flex w-full items-center justify-center gap-2 rounded-xl bg-zinc-950 px-4 py-2.5 text-sm font-semibold text-white disabled:opacity-40 dark:bg-white dark:text-zinc-950",children:[l?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(p.A,{className:"h-4 w-4"})," 保存设置"]})]})]})}function $(e){let{label:t,value:s}=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-zinc-50 px-3.5 py-3 dark:bg-zinc-950",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-zinc-500",children:t}),(0,a.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:null===s?"—":`${s}%`})]})}function E(e){let{done:t,text:s}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`flex h-5 w-5 items-center justify-center rounded-full ${t?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300":"bg-zinc-100 text-zinc-400 dark:bg-zinc-800"}`,children:t?(0,a.jsx)(p.A,{className:"h-3 w-3"}):(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-current"})}),(0,a.jsx)("span",{children:s})]})}function W(e){let{label:t,value:s}=e;return(0,a.jsxs)("div",{className:"rounded-lg bg-zinc-50 px-2 py-2 text-center dark:bg-zinc-950",children:[(0,a.jsx)("div",{className:"font-semibold tabular-nums text-zinc-900 dark:text-white",children:s}),(0,a.jsx)("div",{className:"mt-0.5 text-[10px] text-zinc-400",children:t})]})}},21318:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},27357:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},31925:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},48240:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]])},55675:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("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"}]])},59560:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},65207:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},70145:(e,t,s)=>{s.d(t,{cB:()=>n,iD:()=>d.iD,W0:()=>d.W0,XI:()=>d.XI,eV:()=>d.eV,KE:()=>a.getSessionWithTimeout,Mq:()=>d.Mq,$G:()=>a.$G,oC:()=>d.oC,eh:()=>d.eh,cU:()=>i,bb:()=>c,ND:()=>a.ND,Yx:()=>d.Yx});var a=s(4018);let l="__aipersona_hard_signout_at_v1";function n(e){return a.ND.auth.exchangeCodeForSession(e)}function i(e){try{window.localStorage.removeItem(l),window.sessionStorage.removeItem(l)}catch{}return a.ND.auth.signInWithOAuth(e)}function r(e,t){if("u"<typeof document)return;let s="https:"===window.location.protocol,a=["path=/","samesite=lax","max-age=0"];s&&a.push("secure"),t&&a.push(`domain=${t}`),document.cookie=`${e}=; ${a.join("; ")}`}async function c(e){let t=(e?.redirectTo??"/").toString()||"/",s="number"==typeof e?.timeoutMs&&e.timeoutMs>0?Math.floor(e.timeoutMs):1200;try{let e=String(Date.now());window.localStorage.setItem(l,e),window.sessionStorage.setItem(l,e)}catch{}try{a.ND.auth.stopAutoRefresh()}catch{}let n=new Promise(e=>setTimeout(e,s));await Promise.race([a.ND.auth.signOut({scope:"local"}).then(()=>void 0).catch(()=>void 0),n]),a.ND.auth.signOut({scope:"global"}).catch(()=>null);try{window.localStorage.removeItem("__aipersona_membership_cache_v1")}catch{}try{window.localStorage.removeItem("aipersona.lastPath")}catch{}try{let e=(e,t)=>
1{let s=[];for(let t=0;t<e.length;t+=1){let a=e.key(t);a&&s.push(a)}for(let a of s)t(a)&&e.removeItem(a)};for(let t of[window.localStorage,window.sessionStorage])e(t,e=>e.startsWith("sb-")&&(e.endsWith("-auth-token")||e.endsWith("-auth-token-storage")||e.includes("-auth-token"))||e.startsWith("dashboard.")||e.startsWith("autoReply.")||e.startsWith("context.")||"schedule.weekStart"===e)}catch{}let i=function(){let e=(window.location.hostname??"").toString().trim().toLowerCase();if(!e||"localhost"===e||e.endsWith(".vercel.app")||/^\d{1,3}(\.\d{1,3}){3}$/.test(e))return;if(e.startsWith("www."))return e.slice(4);let t=e.split(".").filter(Boolean);return t.length>=2?t.slice(-2).join("."):e}();for(let e of["__aipersona_rt_v1","x_supabase_token","gcal_supabase_token","notion_supabase_token"])r(e,void 0),i&&r(e,i);window.location.assign(t)}var d=s(18028)},79191:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},79428:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},88858:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]])},94138:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(56059).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])}}]);

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.