From 0903543994c08b790ef2014bf021b0f3ebc84896 Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Fri, 26 Jun 2026 15:57:46 +0800 Subject: [PATCH] 1 --- .../{index-BNvl4Dex.js => index-4U-_hqyL.js} | 2 +- video-gen-app/dist/index.html | 2 +- video-gen-app/src/App.css | 15 ++++- .../src/components/Layout/AppLayout.tsx | 62 +++++++++++++++---- video-gen-app/src/pages/LoginPage.tsx | 6 +- 5 files changed, 67 insertions(+), 20 deletions(-) rename video-gen-app/dist/assets/{index-BNvl4Dex.js => index-4U-_hqyL.js} (96%) diff --git a/video-gen-app/dist/assets/index-BNvl4Dex.js b/video-gen-app/dist/assets/index-4U-_hqyL.js similarity index 96% rename from video-gen-app/dist/assets/index-BNvl4Dex.js rename to video-gen-app/dist/assets/index-4U-_hqyL.js index 103578cf..610acbd1 100644 --- a/video-gen-app/dist/assets/index-BNvl4Dex.js +++ b/video-gen-app/dist/assets/index-4U-_hqyL.js @@ -402,7 +402,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } } - `})]})},n9={HomeOutlined:(0,$.jsx)(b3,{}),DashboardOutlined:(0,$.jsx)(F4,{}),CodeOutlined:(0,$.jsx)(b4,{}),PlayCircleOutlined:(0,$.jsx)(C6,{}),WalletOutlined:(0,$.jsx)($8,{}),SettingOutlined:(0,$.jsx)(X6,{}),BellOutlined:(0,$.jsx)(F2,{}),UserOutlined:(0,$.jsx)(q8,{}),AppstoreOutlined:(0,$.jsx)(d2,{}),FileTextOutlined:(0,$.jsx)(PU,{}),StarOutlined:(0,$.jsx)(b8,{}),HeartOutlined:(0,$.jsx)(d3,{}),CameraOutlined:(0,$.jsx)(X2,{}),RobotOutlined:(0,$.jsx)(C6,{}),CalculatorOutlined:(0,$.jsx)(q2,{}),DollarOutlined:(0,$.jsx)(V4,{}),GiftOutlined:(0,$.jsx)(a3,{}),ThunderboltOutlined:(0,$.jsx)(M8,{}),FireOutlined:(0,$.jsx)($4,{}),CloudOutlined:(0,$.jsx)(d4,{}),SmileOutlined:(0,$.jsx)(d8,{}),TrophyOutlined:(0,$.jsx)(R8,{}),RocketOutlined:(0,$.jsx)(R6,{}),BulbOutlined:(0,$.jsx)(W2,{}),PictureOutlined:(0,$.jsx)(m6,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),AudioOutlined:(0,$.jsx)(C2,{}),MailOutlined:(0,$.jsx)(W3,{}),PhoneOutlined:(0,$.jsx)(d6,{}),GlobalOutlined:(0,$.jsx)(c3,{}),ShoppingCartOutlined:(0,$.jsx)($6,{}),TeamOutlined:(0,$.jsx)(k8,{}),BarChartOutlined:(0,$.jsx)(M2,{}),PieChartOutlined:(0,$.jsx)(_6,{}),LineChartOutlined:(0,$.jsx)(F3,{}),SecurityScanOutlined:(0,$.jsx)(W6,{}),ApiOutlined:(0,$.jsx)(c2,{}),DatabaseOutlined:(0,$.jsx)(R4,{}),CloudServerOutlined:(0,$.jsx)(m4,{})},ute=240,r9=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(TJ,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(X4,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(k4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(E2,{})}],dte=()=>{let e=Je(),t=Ge(),{user:n,logout:r}=e9(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c]=CW.useForm(),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[x,C]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteLogo||``;if(t){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=t,e.type=`image/png`}return t}),[w,T]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(`alipay`),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(180),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),[z,B]=(0,S.useState)({alipay:!1,wechat:!1}),[V,H]=(0,S.useState)(!1),[U]=CW.useForm(),[ee,te]=(0,S.useState)(!1),[ne,W]=(0,S.useState)(!1),re=`pending_payment_order`;(0,S.useEffect)(()=>{Y5().then(e=>{let t=e.siteName||`民众智创`,n=e.siteLogo||``;if(t!==y&&(b(t),document.title=t),n&&n!==x){C(n);let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=n,e.type=`image/png`}localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(()=>{})},[]);let G=()=>{e7().then(e=>{v(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(re);if(e)try{let t=JSON.parse(e),n=await c7(t.orderNo);if(n.status===`pending`){k({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),R.current=t.orderNo;let e=Date.now(),n=new Date(t.createdAt).getTime(),r=t.timeoutSeconds||180,i=Math.floor((e-n)/1e3),a=Math.max(0,r-i);a>0?(D(!0),ue(t.orderNo,a)):localStorage.removeItem(re)}else n.status===`paid`?(Z.success(`支付成功!积分已到账`),e9.getState().refreshUser(),localStorage.removeItem(re)):localStorage.removeItem(re)}catch{localStorage.removeItem(re)}})()},[]),(0,S.useEffect)(()=>{r7().then(e=>{f(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),i7().then(e=>{m(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),a7().then(e=>{B(e),e.alipay?j(`alipay`):e.wechat&&j(`wechat`)}).catch(()=>{}),G()},[n]);let K=t.pathname.startsWith(`/records`)?`/records`:t.pathname,q=ute,ie=[{key:`profile`,icon:(0,$.jsx)(q8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)($8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},{key:`myCredits`,icon:(0,$.jsx)($8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(PU,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(F2,{}),label:`消息中心${_>0?`(${_})`:``}`},{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(R3,{}),label:`修改密码`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(V3,{}),label:`退出登录`,danger:!0}],J=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?a(!0):t===`messages`?e(`/messages`):t===`recharge`?s(!0):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`&&e(`/user-center?tab=orders`)},ae=async()=>{try{await c.validateFields(),Z.success(`密码修改成功(演示)`),a(!1),c.resetFields()}catch{}},oe=()=>{r(),e(`/login`)},se=()=>{s(!0)},ce=async()=>{if(!n){Z.warning(`请先登录`);return}try{let e=await U.validateFields();W(!0),await $7({phone:e.phone,company_name:e.companyName,industry:e.industry,name:e.name,message:e.message}),Z.success(`提交成功,我们会尽快与您联系`),H(!1),U.resetFields()}catch(e){Z.error(e?.message||`提交失败`)}finally{W(!1)}},le=(0,S.useCallback)(()=>{I.current&&=(clearInterval(I.current),null),L.current&&=(clearInterval(L.current),null)},[]),ue=(0,S.useCallback)((e,t=180)=>{le(),F(t),I.current=setInterval(async()=>{try{let t=await c7(e);t.status===`paid`?(le(),R.current=null,localStorage.removeItem(re),Z.success(`支付成功!积分已到账`),e9.getState().refreshUser(),D(!1),k(null),u(null)):t.status===`cancelled`&&(le(),R.current=null,localStorage.removeItem(re))}catch{}},2e3),L.current=setInterval(()=>{F(e=>e<=1?(le(),R.current&&=(l7(R.current).catch(()=>{}),null),localStorage.removeItem(re),Z.warning(`订单已超时,请重新充值`),D(!1),k(null),u(null),0):e-1)},1e3)},[le]);return(0,$.jsxs)(pK,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:q,position:`fixed`,left:16,top:16,bottom:16,zIndex:100,background:`linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,display:`flex`,flexDirection:`column`,transition:`width 0.25s ease, left 0.25s ease`,overflow:`hidden`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:[(0,$.jsx)(`div`,{style:{height:80,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,padding:`0 20px`,flexShrink:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:x?(0,$.jsx)(`img`,{src:x,alt:`logo`,style:{width:28,height:28,objectFit:`contain`}}):(0,$.jsx)(M8,{style:{fontSize:20,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:17,fontWeight:700,letterSpacing:-.02,whiteSpace:`nowrap`,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:(()=>{let t={};d.forEach(e=>{let n=e.parent_id??e.parentId;n&&(t[n]||(t[n]=[]),t[n].push(e))});let n=d.filter(e=>!(e.parent_id??e.parentId));n.sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0));let r=[],i=(n,r=0)=>{let a=n.path===K,o=n9[n.icon]||(0,$.jsx)(b3,{}),s=t[n.id]&&t[n.id].length>0,c=h[n.id]!==!0;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{onClick:()=>{s?g(e=>({...e,[n.id]:!e[n.id]})):n.path&&e(n.path)},style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:10,padding:r>0?`6px 12px 6px 32px`:`6px 14px`,borderRadius:12,margin:`1px 4px`,cursor:`pointer`,fontSize:r>0?13:14,fontWeight:a?600:400,color:a?`#4f46e5`:`#475569`,background:a?`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)`:`transparent`,transition:`all 0.2s ease`},children:[(0,$.jsx)(`span`,{style:{fontSize:r>0?14:16,flexShrink:0,color:a?`#6366f1`:`#64748b`},children:o}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`,flex:1,textAlign:`left`},children:n.label}),s&&(0,$.jsx)(`span`,{style:{fontSize:14,color:`#94a3b8`,transition:`transform 0.2s ease`,transform:c?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Ug,{})})]}),s&&c&&(0,$.jsx)(`div`,{style:{overflow:`hidden`},children:(t[n.id]||[]).sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)).map(e=>i(e,r+1))})]},n.id)};return n.forEach(e=>{(e.menu_type??e.menuType)===`group`?r.push((0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12,fontWeight:600,padding:`10px 14px 4px`,letterSpacing:.5,textTransform:`uppercase`},children:e.label}),(t[e.id]||[]).sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)).map(e=>i(e,1))]},e.id)):r.push(i(e))}),r})()}),(0,$.jsxs)(`div`,{onClick:()=>s(!0),style:{margin:`8px 12px`,padding:`12px 20px`,borderRadius:14,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,color:`#ffffff`,fontSize:14,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%)`,e.currentTarget.style.transform=`translateY(-1px)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.5)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.4)`},children:[(0,$.jsx)(vR,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0},children:(0,$.jsx)(jU,{menu:{items:ie,onClick:J},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:`10px 14px`,borderRadius:14,cursor:`pointer`,transition:`all 0.25s ease`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0, 0, 0, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04)`},children:[(0,$.jsx)(dT,{size:36,icon:(0,$.jsx)(q8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:14,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:12,fontWeight:500,letterSpacing:0,background:`rgba(99, 102, 241, 0.08)`,padding:`2px 8px`,borderRadius:6,display:`inline-block`},children:[`积分: `,n?.credits||0]})]})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:q+28,marginRight:12,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#ffffffff`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:(0,$.jsx)(Ct,{})})}),(0,$.jsxs)(`div`,{className:`mobile-bottom-nav`,children:[d.filter(e=>(e.menu_type??e.menuType)!==`group`).map(t=>t.path?(0,$.jsxs)(`div`,{className:`nav-item ${t.path===K?`active`:``}`,onClick:()=>e(t.path),children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:n9[t.icon]||(0,$.jsx)(b3,{})}),(0,$.jsx)(`span`,{children:t.label})]},t.id):null),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:se,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(E6,{})}),(0,$.jsx)(`span`,{children:`充值`})]}),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:oe,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(V3,{})}),(0,$.jsx)(`span`,{children:`退出`})]})]}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(R3,{}),`修改密码`]}),open:i,onOk:ae,onCancel:()=>{a(!1),c.resetFields()},okText:`确认修改`,cancelText:`取消`,width:440,children:(0,$.jsxs)(CW,{form:c,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(CW.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(iK.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(CW.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(iK.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(CW.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(iK.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})})]})}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(a3,{}),`积分充值`]}),open:o,onCancel:()=>{s(!1),u(null)},footer:null,width:680,children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(kU,{style:{marginBottom:16},children:[(0,$.jsx)($8,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`rgba(99, 102, 241, 0.06)`,borderRadius:10,marginBottom:16,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(E3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(Q.Text,{style:{color:`#ff0000ff`,fontSize:13},children:`当前平台仅支持支付宝/微信扫码充值,如需转账支付请联系我们`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:p.map((e,t)=>{let n=r9[t%r9.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>u(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:l===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:l===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(D$,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(Q.Text,{style:{fontSize:14,fontWeight:600,color:`#6366f1`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})}),!z.alipay&&!z.wechat?(0,$.jsx)(`div`,{style:{marginTop:20,marginBottom:8,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(Q.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginTop:20,marginBottom:8},children:[(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(BL.Group,{value:A,onChange:e=>j(e.target.value),style:{display:`flex`,gap:12},children:[z.alipay&&(0,$.jsxs)(BL.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`alipay`?`#1677ff`:void 0,color:A===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(a2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),z.wechat&&(0,$.jsxs)(BL.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`wechat`?`#07c160`:void 0,color:A===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(a5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:[(0,$.jsx)(xD,{size:`large`,onClick:()=>{s(!1),u(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(xD,{type:`primary`,size:`large`,disabled:!l||!z.alipay&&!z.wechat,loading:M,onClick:async()=>{let e=p.find(e=>e.id===l);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{N(!0);let n=await o7(e.id,A),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(k({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),s(!1),D(!0),R.current=n.orderNo,localStorage.setItem(re,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),ue(n.orderNo)):(Z.success(`充值成功!积分已到账`),e9.getState().refreshUser(),s(!1),u(null))}catch(e){Z.error(e?.message||`创建订单失败,请重试`)}finally{N(!1)}},style:{borderRadius:10,fontWeight:600,background:l?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:l?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]})]})}),(0,$.jsx)(Iq,{open:E,onCancel:async()=>{if(le(),R.current){try{await l7(R.current)}catch{}R.current=null}localStorage.removeItem(re),D(!1),k(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:O?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:O?.method===`alipay`?(0,$.jsx)(a2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(a5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:O?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:O?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:O&&(0,$.jsx)(n2,{value:O.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,O?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,O?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:P<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:P<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:P<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:P}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(xD,{size:`large`,block:!0,onClick:async()=>{if(le(),R.current){try{await l7(R.current)}catch{}R.current=null}localStorage.removeItem(re),D(!1),k(null),u(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(lte,{}),(0,$.jsx)(`div`,{style:{position:`fixed`,right:24,bottom:24,zIndex:1e3},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:64,bottom:8,padding:`8px 16px`,background:`#1e293b`,color:`#ffffff`,borderRadius:8,fontSize:13,whiteSpace:`nowrap`,opacity:+!!ee,transition:`opacity 0.2s ease`,pointerEvents:`none`},children:`联系我们`}),(0,$.jsx)(`button`,{onClick:()=>H(!0),style:{width:40,height:40,borderRadius:`50%`,border:`none`,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,color:`#ffffff`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`,e.currentTarget.style.boxShadow=`0 6px 24px rgba(99, 102, 241, 0.5)`,te(!0)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.4)`,te(!1)},children:(0,$.jsx)(X3,{style:{fontSize:20}})})]})}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(X3,{}),`联系我们`]}),open:V,onCancel:()=>{H(!1),U.resetFields()},footer:null,width:480,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(CW,{form:U,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(iK,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(iK.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(xD,{size:`large`,onClick:()=>{H(!1),U.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(xD,{type:`primary`,size:`large`,onClick:ce,loading:ne,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},fte=`http://localhost:8000/api`,pte=()=>{let{checkAuth:e}=e9(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(0),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)(!1),E=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[D,O]=(0,S.useState)(E.siteName),[k,A]=(0,S.useState)(E.siteLogo),[j,M]=(0,S.useState)(``),[N,P]=(0,S.useState)(``),F=Je(),{login:I}=e9(),[L]=CW.useForm(),[R]=CW.useForm(),[z]=CW.useForm();(0,S.useEffect)(()=>{Y5().then(e=>{O(e.siteName),A(e.siteLogo),M(e.userAgreementUrl),P(e.privacyPolicyUrl)}).catch(()=>{})},[]);let B=()=>d?!0:(Z.warning(`请先阅读并同意用户协议和隐私政策`),!1),V=async()=>{if(B())try{let t=await L.validateFields();await I(t.phone,t.password,void 0,t.rememberMe),Z.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}},H=async()=>{if(B())try{let t=R.getFieldsValue();if(!t.phone||!t.code){Z.error(`请填写手机号和验证码`);return}n(!0),await N5(t.phone,t.code),Z.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}finally{n(!1)}},U=async()=>{if(B())try{let t=await z.validateFields();n(!0),await P5(t.phone,t.regCode,t.password),Z.success(`注册成功`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Z.error(t)}finally{n(!1)}},ee=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),m(!1),t?C(!0):T(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{s===0&&r===`phone`&&v(!1)},[s,r]);let te=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Z.error(`请输入正确的手机号`);return}if(t){m(!0),g(!1);return}if(!_){m(!0),v(!1);return}let n=``;n=r===`register`?`register`:`login`,await Q5(e,n),ee(t?u:c),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(g(!1),u(0)):(v(!1),c(0)),b(e=>e+1)}},ne=async(e=!1)=>{let t=r===`register`?z.getFieldValue(`phone`):R.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await Q5(t,e),r===`register`?(g(!0),ee(u,!0)):(v(!0),ee(c,!1)),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(g(!1),u(0),C(!0)):(v(!1),c(0),T(!0)),b(e=>e+1)}},W=e=>{o(e),i(e),c(0),u(0),v(!1),g(!1),m(!1),C(!1),T(!1),b(e=>e+1),e===`password`?L.resetFields():R.resetFields()},re=[{icon:(0,$.jsx)(W2,{}),title:`AI 智能优化`,desc:`输入原始提示词,AI 自动为您生成专业级视频、图片描述`},{icon:(0,$.jsx)(C6,{}),title:`一键生成视频、图片`,desc:`支持多种规格生成视频、图片`},{icon:(0,$.jsx)(_3,{}),title:`项目维度管理`,desc:`按项目行业分类视频、图片,支持多种行业`}],G={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,height:48,borderRadius:10,fontSize:14},K=e=>{e&&window.open(`${fte.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-container`,style:{backgroundImage:`url(/backimage.png)`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`,backgroundAttachment:`fixed`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(240,244,255,0.9) 0%, rgba(232,236,248,0.85) 40%, rgba(240,240,255,0.9) 70%, rgba(248,249,255,0.95) 100%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:500,height:500,borderRadius:`50%`,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,top:-150,right:-100,filter:`blur(40px)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:400,height:400,borderRadius:`50%`,background:`radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%)`,bottom:-100,left:-80,filter:`blur(50px)`}}),(0,$.jsx)(`div`,{className:`login-left-section`,children:(0,$.jsxs)(kU,{direction:`vertical`,size:24,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:16},children:[k?(0,$.jsx)(`img`,{src:k,alt:`logo`,style:{width:48,height:48,borderRadius:12,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:(0,$.jsx)(M8,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:24,fontWeight:800,letterSpacing:-.5},children:D})]}),(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{fontSize:20},children:(0,$.jsx)(`span`,{className:`shiny-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(Q.Paragraph,{style:{color:`#64748b`,fontSize:15,maxWidth:480,lineHeight:1.8},children:`专业的 AI 素材生成平台,通过智能提示词优化,让您的创意快速转化为精美视频、图片`})]}),(0,$.jsx)(`div`,{className:`login-features`,children:re.map((e,t)=>(0,$.jsxs)(`div`,{className:`electric-border-card`,style:{position:`relative`,display:`flex`,gap:16,alignItems:`flex-start`,padding:`18px 22px`,borderRadius:14,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(12px)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{className:`electric-border`}),(0,$.jsx)(`div`,{className:`electric-border-inner`}),(0,$.jsx)(`div`,{style:{position:`relative`,zIndex:1},children:(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:`linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15))`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6366f1`,fontSize:20},children:e.icon})}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(Q.Text,{style:{color:`#1e293b`,fontSize:15,fontWeight:600,display:`block`,marginBottom:4},children:e.title}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,lineHeight:1.6},children:e.desc})]})]},t))})]})}),(0,$.jsx)(`div`,{className:`login-right-section`,children:(0,$.jsxs)(Az,{style:{width:`100%`,maxWidth:440,borderRadius:20,boxShadow:`0 20px 60px rgba(0,0,0,0.08)`,border:`1px solid #e2e8f0`,background:`#fff`},styles:{body:{padding:`28px 24px`}},children:[(0,$.jsx)(Q.Title,{level:3,style:{textAlign:`center`,marginBottom:6,color:`#1e293b`,fontWeight:700},children:r===`register`?`创建账号`:`欢迎回来`}),(0,$.jsx)(Q.Text,{style:{display:`block`,textAlign:`center`,marginBottom:28,color:`#94a3b8`,fontSize:14},children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作视频`}),r!==`register`&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:0,marginBottom:24,background:`#f1f5f9`,borderRadius:10,padding:4,border:`1px solid #e2e8f0`},children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>W(e),style:{flex:1,textAlign:`center`,padding:`10px 0`,borderRadius:8,cursor:`pointer`,fontSize:14,fontWeight:a===e?600:400,color:a===e?`#6366f1`:`#64748b`,background:a===e?`#fff`:`transparent`,border:a===e?`1px solid rgba(99,102,241,0.2)`:`1px solid transparent`,boxShadow:a===e?`0 2px 8px rgba(99,102,241,0.1)`:`none`,transition:`all 0.3s ease`},children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(CW,{form:L,size:`large`,layout:`vertical`,onFinish:V,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:G})}),(0,$.jsx)(CW.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(iK.Password,{prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:G})}),(0,$.jsx)(CW.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(sV,{children:`记住我的登录状态`})}),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,htmlType:`submit`,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(CW,{form:R,size:`large`,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:G})}),(0,$.jsx)(CW.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(kU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(iK,{prefix:(0,$.jsx)(V6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!_,style:{...G,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(xD,{disabled:s>0,onClick:()=>{w?(v(!1),m(!0),b(e=>e+1)):te(R.getFieldValue(`phone`))},style:{height:48,borderRadius:`0 10px 10px 0`,background:s>0||_?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:s>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:s>0?`${s}s`:w?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(i9,{onSuccess:ne,isVerified:_})},y),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,onClick:H,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(CW,{form:z,size:`large`,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:G})}),(0,$.jsx)(CW.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(kU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(iK,{prefix:(0,$.jsx)(V6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!h,style:{...G,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(xD,{disabled:l>0,onClick:()=>{x?(g(!1),m(!0),b(e=>e+1)):te(z.getFieldValue(`phone`),!0)},style:{height:48,borderRadius:`0 10px 10px 0`,background:l>0||h?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:l>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:l>0?`${l}s`:x?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(i9,{onSuccess:ne,isVerified:h})},y),(0,$.jsx)(CW.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(iK.Password,{prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:G})}),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,onClick:U,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`注 册`})})]}),(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(sV,{checked:d,onChange:e=>f(e.target.checked),children:(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#64748b`},children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),K(j)},style:{color:`#6366f1`,cursor:`pointer`},children:`《用户协议》`}),`和`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),K(N)},style:{color:`#6366f1`,cursor:`pointer`},children:`《隐私政策》`})]})})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:r===`register`?(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`password`),o(`password`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1),z.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`register`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1)},children:`没有账号?立即注册`})})]})})]})},i9=({onSuccess:e,isVerified:t})=>{let n=S.useRef(null),r=S.useRef(null),i=S.useRef(null),a=S.useRef(0),o=S.useRef(!1),[s,c]=S.useState(360),l=s-50;S.useEffect(()=>{let e=()=>{if(n.current){let e=n.current.offsetWidth;e>0&&c(e)}};e();let t=new ResizeObserver(e);return n.current&&t.observe(n.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let u=n=>{if(o.current||t)return;let c=Math.max(0,Math.min(n,l));a.current=c,r.current&&(r.current.style.left=`${c}px`),i.current&&(i.current.style.width=`${c+50}px`),c>=l-5&&(o.current=!0,r.current&&(r.current.style.background=`#22c55e`,r.current.innerHTML=``),i.current&&(i.current.style.width=`${s}px`,i.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:n,onMouseDown:e=>{if(e.preventDefault(),o.current||t)return;let s=n.current;if(!s)return;let c=s.getBoundingClientRect(),d=e=>{u(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f),!o.current&&a.current({page:1,pageSize:10,total:0,items:[]}),a9=m5((e,t)=>({projects:[],records:mte(),loading:!1,mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await R5(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await z5(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await B5(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await V5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await H5(n,r);try{await e9.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await q5(n,r);try{await e9.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[]})}));function o9(e){if(!e)return`-`;let t=e.trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);return n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``),t.replace(`T`,` `).slice(0,16)}var s9=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],c9={ShoppingCartOutlined:(0,$.jsx)($6,{}),BookOutlined:(0,$.jsx)(R2,{}),HomeOutlined:(0,$.jsx)(b3,{}),FireOutlined:(0,$.jsx)($4,{}),RocketOutlined:(0,$.jsx)(R6,{}),SkinOutlined:(0,$.jsx)(c8,{}),CompassOutlined:(0,$.jsx)(E4,{}),HeartOutlined:(0,$.jsx)(d3,{}),CarOutlined:(0,$.jsx)($2,{}),CameraOutlined:(0,$.jsx)(X2,{}),CloudOutlined:(0,$.jsx)(d4,{}),StarOutlined:(0,$.jsx)(b8,{}),TrophyOutlined:(0,$.jsx)(R8,{}),ThunderboltOutlined:(0,$.jsx)(M8,{}),BulbOutlined:(0,$.jsx)(W2,{}),CoffeeOutlined:(0,$.jsx)(C4,{}),CrownOutlined:(0,$.jsx)(M4,{}),DashboardOutlined:(0,$.jsx)(F4,{}),FlagOutlined:(0,$.jsx)(n3,{}),GlobalOutlined:(0,$.jsx)(c3,{}),GiftOutlined:(0,$.jsx)(a3,{}),LaptopOutlined:(0,$.jsx)(k3,{}),MobileOutlined:(0,$.jsx)($3,{}),MonitorOutlined:(0,$.jsx)(n6,{}),PayCircleOutlined:(0,$.jsx)(c6,{}),PictureOutlined:(0,$.jsx)(m6,{}),PlayCircleOutlined:(0,$.jsx)(C6,{}),SafetyOutlined:(0,$.jsx)(V6,{}),ShoppingOutlined:(0,$.jsx)(n8,{}),SmileOutlined:(0,$.jsx)(d8,{}),SoundOutlined:(0,$.jsx)(_8,{}),TagOutlined:(0,$.jsx)(E8,{}),TeamOutlined:(0,$.jsx)(k8,{}),ToolOutlined:(0,$.jsx)(F8,{}),TruckOutlined:(0,$.jsx)(V8,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),WalletOutlined:(0,$.jsx)($8,{}),BankOutlined:(0,$.jsx)(k2,{}),BuildOutlined:(0,$.jsx)(V2,{}),ExperimentOutlined:(0,$.jsx)(W4,{}),HighlightOutlined:(0,$.jsx)(m3,{}),IdcardOutlined:(0,$.jsx)(C3,{}),MedicineBoxOutlined:(0,$.jsx)(q3,{}),ReadOutlined:(0,$.jsx)(k6,{}),RestOutlined:(0,$.jsx)(M6,{}),SketchOutlined:(0,$.jsx)(a8,{}),SolutionOutlined:(0,$.jsx)(m8,{})},hte=()=>{let[e,t]=(0,S.useState)(!1),[n]=CW.useForm(),r=Je(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=a9(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),n7().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:s9[t%s9.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`22px 24px`,borderRadius:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:200,height:200,borderRadius:`50%`,background:`rgba(255,255,255,0.08)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(Q.Title,{level:3,style:{margin:`0 0 4px`,color:`#fff`,fontWeight:700},children:`我的项目`}),(0,$.jsxs)(Q.Text,{style:{color:`rgba(255,255,255,0.7)`,fontSize:14},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]}),(0,$.jsx)(xD,{icon:(0,$.jsx)(vR,{}),onClick:()=>t(!0),size:`large`,style:{background:`rgba(255,255,255,0.15)`,border:`1px solid rgba(255,255,255,0.3)`,color:`#fff`,fontWeight:600,backdropFilter:`blur(10px)`,borderRadius:10,height:42},children:`新建项目`})]}),i.length===0?(0,$.jsx)(PC,{image:PC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(xD,{type:`primary`,icon:(0,$.jsx)(vR,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:c9[u[e.industry]?.icon]||(0,$.jsx)(d2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(D$,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(DH,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,o9(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(xD,{type:`primary`,icon:(0,$.jsx)(C6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(Bq,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Z.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(xD,{danger:!0,icon:(0,$.jsx)(A$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Ug,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(d2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Z.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(CW,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(CW.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(iK,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(CZ,{}),size:`large`})}),(0,$.jsx)(CW.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(uw,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(uw.Option,{value:e.key,children:(0,$.jsxs)(kU,{children:[c9[e.icon]||(0,$.jsx)(d2,{}),` `,e.label]})},e.key))})})]})})]})};function gte(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var l9=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(C6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},_te=()=>{let{projectId:e}=Qe(),t=Je(),[n]=CW.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=a9(),l=i.items,{user:u}=e9(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)([]),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),H=(0,S.useRef)(null),[U,ee]=(0,S.useState)({}),[te,ne]=(0,S.useState)({}),[W,re]=(0,S.useState)({}),[G,K]=(0,S.useState)(null),[q,ie]=(0,S.useState)({}),[J,ae]=(0,S.useState)(null),[oe,se]=(0,S.useState)(5),[ce,le]=(0,S.useState)(`16:9`),[ue,de]=(0,S.useState)(`720p`),[fe,pe]=(0,S.useState)(null),[me,he]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[ge,_e]=(0,S.useState)(0),[ve,ye]=(0,S.useState)(0),[be,xe]=(0,S.useState)(`image`),[Se,Ce]=(0,S.useState)(`1:1`),[we,Te]=(0,S.useState)(`2K`),[Ee,De]=(0,S.useState)(2048),[Oe,ke]=(0,S.useState)(2048),[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(0,S.useState)([]),[Pe,Fe]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(u7().then(e=>{Ne(e.video),Fe(e.image)}),!Ae)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&je(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[Ae]);let Ie=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{qe(e)},ze=e=>{Xe(parseInt(e))},[Be,Ve]=(0,S.useState)([]),[He,Ue]=(0,S.useState)([]),[We,Ge]=(0,S.useState)([]),[Ke,qe]=(0,S.useState)(0),[Ye,Xe]=(0,S.useState)(0);(0,S.useEffect)(()=>{We[Ye]&&We[Ye][Ke]!==void 0&&(De(We[Ye][Ke].substring(0,4)),ke(We[Ye][Ke].substring(5)))},[Ke]),(0,S.useEffect)(()=>{We[Ye]&&We[Ye][Ke]!==void 0&&(De(We[Ye][Ke].substring(0,4)),ke(We[Ye][Ke].substring(5)))},[Ye]);let Ze=()=>{De(Oe),ke(Ee)},$e=e=>{xe(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{n7().then(e=>{ee(Object.fromEntries(e.map(e=>[e.key,e.label]))),ne(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Z5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);n.forEach((e,t)=>{Ve(n=>[...n,{value:e,label:String(t)}])});for(let e in t[`4K`])i.push(t[`4K`][e]);Ge([r,i]);let a=[];for(let e in t)a.push(e);a.forEach((e,t)=>{Ue(n=>[...n,{value:e,label:String(t)}])})}).catch(()=>{}),X5().then(e=>{if(e.items?.length){let t=e.items[0];he({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let et=(0,S.useRef)(!1);(0,S.useEffect)(()=>{et.current||l.length===0||(et.current=!0,console.log(`aaaa`,l),l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Dt(t.id)),t.projectId===e&&t.status===`optimizing`&&ct(t.id)}))},[l,e]);let tt=(0,S.useRef)(new Set),nt=(0,S.useRef)(null),rt=(0,S.useRef)(null),it=e=>{tt.current.add(e),st()},at=e=>{tt.current.delete(e),tt.current.size===0&&ot()},ot=()=>{nt.current&&=(clearInterval(nt.current),null),rt.current&&=(rt.current.abort(),null)},st=()=>{nt.current||=setInterval(async()=>{try{rt.current&&rt.current.abort();let t=new AbortController;rt.current=t;let n=await V5({projectId:e,page:1,pageSize:100,signal:t.signal});rt.current=null;let r=Array.from(tt.current),i=[];if(r.length>0){let e=a9.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});a9.setState({records:{...e,items:t}}),i.forEach(e=>{at(e)})}}catch(e){e.name!==`AbortError`&&console.error(`Optimizing polling error:`,e)}},3e3)},ct=e=>{it(e)},lt=(0,S.useRef)(!1),ut=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(lt.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(ut.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(lt.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),_e(s.textCreditsCost),ye(s.textTokensUsed),m(!0),Z.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let dt=r.find(t=>t.id===e),ft=l.filter(t=>t.projectId===e),pt=dt?.name??`项目`,mt=dt&&te[dt.industry]||[],ht=u?.credits??0,gt=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=_t,yt=async()=>{try{if(!e){Z.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Z.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(W).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=gte();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:oe,ts:Date.now()})),ut.current=a;let o=await s(e,{prompt:i,duration:oe,genType:be,resolution:we,references:M.length>0?M:void 0,idempotencyKey:a,image_size:we,image_proportion:Se,image_px:Ee+`x`+Oe});localStorage.removeItem(`pending_optimize`),ut.current=null,g(o.record),v(o.record.optimizedPrompt||``),_e(o.textCreditsCost),ye(o.textTokensUsed),m(!0),Z.success({content:`「${pt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){console.error(`优化提示词失败:`,e);let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Z.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),ut.current=null}},bt=(0,S.useRef)(new Set),xt=(0,S.useRef)(null),St=(0,S.useRef)(null),Ct=e=>{bt.current.add(e),Et()},wt=e=>{bt.current.delete(e),bt.current.size===0&&Tt()},Tt=()=>{xt.current&&=(clearInterval(xt.current),null),St.current&&=(St.current.abort(),null)},Et=()=>{xt.current||=setInterval(async()=>{try{St.current&&St.current.abort();let t=new AbortController;St.current=t;let n=await V5({projectId:e,page:1,pageSize:100,signal:t.signal});St.current=null;let r=Array.from(bt.current),i=[];if(r.length>0){let e=a9.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`generating`&&i.push(e.id),t}return e});a9.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);wt(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Z.success({content:`「${pt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Z.error({content:`「${pt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name!==`AbortError`&&console.error(`Global polling error:`,e)}},5e3)},Dt=e=>{Ct(e)};(0,S.useEffect)(()=>()=>{Tt(),ot()},[]);let Ot=async e=>{if(!vt){Z.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${pt}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:ce,resolution:ue})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Z.error({content:`「${pt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${pt}」已提交,正在生成中...`,key:e,duration:3}),Dt(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},kt=async e=>{let t=ft.find(t=>t.id===e);if(t){C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${pt}」正在重新提交...`,duration:0,key:e});try{let n=E[e];n&&n!==t.optimizedPrompt&&await K5(e,n);let r=await c(e,{aspectRatio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`});console.log(`重新提交视频生成结果:`,r),r.status===`failed`?(T(t=>({...t,[e]:`failed`})),console.log(`12312`),Z.error({content:`「${pt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${pt}」已提交,正在生成中...`,key:e,duration:3}),Dt(e))}catch(t){T(t=>({...t,[e]:`failed`})),console.log(`1231`,t);let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}}},At=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},jt={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(AH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(a4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(c4,{})}},Mt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(EQ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,zi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Nt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(EQ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,zi.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`20px 28px`,borderRadius:16,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-30,bottom:-30,width:160,height:160,borderRadius:`50%`,background:`rgba(255,255,255,0.05)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,position:`relative`},children:[(0,$.jsx)(xD,{icon:(0,$.jsx)(_2,{}),onClick:()=>t(`/projects`),style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:10}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0,color:`#fff`,fontWeight:700},children:pt}),dt&&(0,$.jsx)(D$,{style:{background:`rgba(255,255,255,0.12)`,border:`1px solid rgba(255,255,255,0.2)`,color:`rgba(255,255,255,0.8)`,borderRadius:6},children:U[dt.industry]||dt.industry})]}),(0,$.jsx)(Q.Text,{style:{color:`rgba(255,255,255,0.5)`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]})]}),(0,$.jsxs)(D$,{style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,ht,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(BL.Group,{defaultValue:`image`,buttonStyle:`solid`,onChange:$e,children:[(0,$.jsxs)(BL.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(m6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]}),(0,$.jsxs)(BL.Button,{value:`video`,children:[(0,$.jsx)(X8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]})]})]}),be===`video`&&[{icon:(0,$.jsx)(M$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(M8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(R6,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),be===`image`&&[{icon:(0,$.jsx)(M$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(M8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(R6,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(CW,{form:n,initialValues:{},children:[(0,$.jsx)(CW.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[M.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ae(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(CG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(l9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),G5(e.url).catch(()=>{}),N(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(c4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Z.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Z.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=M.filter(e=>e.type===`image`).length,a=M.filter(e=>e.type===`video`).length;return t&&i>=10?(Z.error(`最多上传10张图片`),!1):n&&a>=3?(Z.error(`最多上传3个视频`),!1):(F(!0),(t?U5:W5)(e).then(e=>{let n=t?`图片`:`视频`,r=t?i+1:a+1;N(i=>[...i,{url:e.url,type:t?`image`:`video`,name:`${n}${r}`}]),Z.success(`${n}上传成功`)}).catch(()=>Z.error(`上传失败`)).finally(()=>F(!1)),!1)},children:(0,$.jsx)(eT,{title:`参考内容(${M.length}/10)`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:P?(0,$.jsx)(Xm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(vR,{style:{fontSize:18,color:`#94a3b8`}})})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(iK.TextArea,{ref:H,value:I,onChange:e=>{let t=e.target.value;L(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` + `})]})},n9={HomeOutlined:(0,$.jsx)(b3,{}),DashboardOutlined:(0,$.jsx)(F4,{}),CodeOutlined:(0,$.jsx)(b4,{}),PlayCircleOutlined:(0,$.jsx)(C6,{}),WalletOutlined:(0,$.jsx)($8,{}),SettingOutlined:(0,$.jsx)(X6,{}),BellOutlined:(0,$.jsx)(F2,{}),UserOutlined:(0,$.jsx)(q8,{}),AppstoreOutlined:(0,$.jsx)(d2,{}),FileTextOutlined:(0,$.jsx)(PU,{}),StarOutlined:(0,$.jsx)(b8,{}),HeartOutlined:(0,$.jsx)(d3,{}),CameraOutlined:(0,$.jsx)(X2,{}),RobotOutlined:(0,$.jsx)(C6,{}),CalculatorOutlined:(0,$.jsx)(q2,{}),DollarOutlined:(0,$.jsx)(V4,{}),GiftOutlined:(0,$.jsx)(a3,{}),ThunderboltOutlined:(0,$.jsx)(M8,{}),FireOutlined:(0,$.jsx)($4,{}),CloudOutlined:(0,$.jsx)(d4,{}),SmileOutlined:(0,$.jsx)(d8,{}),TrophyOutlined:(0,$.jsx)(R8,{}),RocketOutlined:(0,$.jsx)(R6,{}),BulbOutlined:(0,$.jsx)(W2,{}),PictureOutlined:(0,$.jsx)(m6,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),AudioOutlined:(0,$.jsx)(C2,{}),MailOutlined:(0,$.jsx)(W3,{}),PhoneOutlined:(0,$.jsx)(d6,{}),GlobalOutlined:(0,$.jsx)(c3,{}),ShoppingCartOutlined:(0,$.jsx)($6,{}),TeamOutlined:(0,$.jsx)(k8,{}),BarChartOutlined:(0,$.jsx)(M2,{}),PieChartOutlined:(0,$.jsx)(_6,{}),LineChartOutlined:(0,$.jsx)(F3,{}),SecurityScanOutlined:(0,$.jsx)(W6,{}),ApiOutlined:(0,$.jsx)(c2,{}),DatabaseOutlined:(0,$.jsx)(R4,{}),CloudServerOutlined:(0,$.jsx)(m4,{})},ute=240,r9=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(TJ,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(X4,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(k4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(E2,{})}],dte=()=>{let e=Je(),t=Ge(),{user:n,logout:r}=e9(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c]=CW.useForm(),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[x,C]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteLogo||``;if(t){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=t,e.type=`image/png`}return t}),[w,T]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(`alipay`),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(180),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),[z,B]=(0,S.useState)({alipay:!1,wechat:!1}),[V,H]=(0,S.useState)(!1),[U]=CW.useForm(),[ee,te]=(0,S.useState)(!1),[ne,W]=(0,S.useState)(!1),re=`pending_payment_order`;(0,S.useEffect)(()=>{Y5().then(e=>{let t=e.siteName||`民众智创`,n=e.siteLogo||``;if(t!==y&&(b(t),document.title=t),n&&n!==x){C(n);let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=n,e.type=`image/png`}localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(()=>{})},[]);let G=()=>{e7().then(e=>{v(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(re);if(e)try{let t=JSON.parse(e),n=await c7(t.orderNo);if(n.status===`pending`){k({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),R.current=t.orderNo;let e=Date.now(),n=new Date(t.createdAt).getTime(),r=t.timeoutSeconds||180,i=Math.floor((e-n)/1e3),a=Math.max(0,r-i);a>0?(D(!0),ue(t.orderNo,a)):localStorage.removeItem(re)}else n.status===`paid`?(Z.success(`支付成功!积分已到账`),e9.getState().refreshUser(),localStorage.removeItem(re)):localStorage.removeItem(re)}catch{localStorage.removeItem(re)}})()},[]),(0,S.useEffect)(()=>{r7().then(e=>{f(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),i7().then(e=>{m(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),a7().then(e=>{B(e),e.alipay?j(`alipay`):e.wechat&&j(`wechat`)}).catch(()=>{}),G()},[n]);let K=t.pathname.startsWith(`/records`)?`/records`:t.pathname,q=ute,ie=[{key:`profile`,icon:(0,$.jsx)(q8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)($8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},{key:`myCredits`,icon:(0,$.jsx)($8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(PU,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(F2,{}),label:`消息中心${_>0?`(${_})`:``}`},{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(R3,{}),label:`修改密码`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(V3,{}),label:`退出登录`,danger:!0}],J=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?a(!0):t===`messages`?e(`/messages`):t===`recharge`?s(!0):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`&&e(`/user-center?tab=orders`)},ae=async()=>{try{await c.validateFields(),Z.success(`密码修改成功(演示)`),a(!1),c.resetFields()}catch{}},oe=()=>{r(),e(`/login`)},se=()=>{s(!0)},ce=async()=>{if(!n){Z.warning(`请先登录`);return}try{let e=await U.validateFields();W(!0),await $7({phone:e.phone,company_name:e.companyName,industry:e.industry,name:e.name,message:e.message}),Z.success(`提交成功,我们会尽快与您联系`),H(!1),U.resetFields()}catch(e){Z.error(e?.message||`提交失败`)}finally{W(!1)}},le=(0,S.useCallback)(()=>{I.current&&=(clearInterval(I.current),null),L.current&&=(clearInterval(L.current),null)},[]),ue=(0,S.useCallback)((e,t=180)=>{le(),F(t),I.current=setInterval(async()=>{try{let t=await c7(e);t.status===`paid`?(le(),R.current=null,localStorage.removeItem(re),Z.success(`支付成功!积分已到账`),e9.getState().refreshUser(),D(!1),k(null),u(null)):t.status===`cancelled`&&(le(),R.current=null,localStorage.removeItem(re))}catch{}},2e3),L.current=setInterval(()=>{F(e=>e<=1?(le(),R.current&&=(l7(R.current).catch(()=>{}),null),localStorage.removeItem(re),Z.warning(`订单已超时,请重新充值`),D(!1),k(null),u(null),0):e-1)},1e3)},[le]);return(0,$.jsxs)(pK,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:q,position:`fixed`,left:16,top:16,bottom:16,zIndex:100,background:`linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,display:`flex`,flexDirection:`column`,transition:`width 0.25s ease, left 0.25s ease`,overflow:`hidden`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:[(0,$.jsx)(`div`,{style:{height:80,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,padding:`0 20px`,flexShrink:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:x?(0,$.jsx)(`img`,{src:x,alt:`logo`,style:{width:28,height:28,objectFit:`contain`}}):(0,$.jsx)(M8,{style:{fontSize:20,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:17,fontWeight:700,letterSpacing:-.02,whiteSpace:`nowrap`,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:(()=>{let t={};d.forEach(e=>{let n=e.parent_id??e.parentId;n&&(t[n]||(t[n]=[]),t[n].push(e))});let n=d.filter(e=>!(e.parent_id??e.parentId));n.sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0));let r=[],i=(n,r=0)=>{let a=n.path===K,o=n9[n.icon]||(0,$.jsx)(b3,{}),s=t[n.id]&&t[n.id].length>0,c=h[n.id]!==!0;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{onClick:()=>{s?g(e=>({...e,[n.id]:!e[n.id]})):n.path&&e(n.path)},style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:10,padding:r>0?`8px 12px 8px 32px`:`8px 14px`,borderRadius:12,margin:`2px 4px`,cursor:`pointer`,fontSize:r>0?13:14,fontWeight:a?600:400,color:a?`#4f46e5`:`#475569`,background:a?`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)`:`transparent`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{a||(e.currentTarget.style.background=`transparent`)},children:[(0,$.jsx)(`span`,{style:{fontSize:r>0?14:16,flexShrink:0,color:a?`#6366f1`:`#64748b`},children:o}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`,flex:1,textAlign:`left`},children:n.label}),s&&(0,$.jsx)(`span`,{style:{fontSize:14,color:`#94a3b8`,transition:`transform 0.2s ease`,transform:c?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Ug,{})})]}),s&&c&&(0,$.jsx)(`div`,{style:{overflow:`hidden`},children:(t[n.id]||[]).sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)).map(e=>i(e,r+1))})]},n.id)};return n.forEach(e=>{let n=e.menu_type??e.menuType;t[e.id]&&t[e.id].length;let a=h[e.id]!==!0;n===`group`?r.push((0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{onClick:()=>{g(t=>({...t,[e.id]:!t[e.id]}))},style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,color:`#94a3b8`,fontSize:12,fontWeight:600,padding:`10px 14px 4px`,letterSpacing:.5,textTransform:`uppercase`,cursor:`pointer`},children:[(0,$.jsx)(`span`,{children:e.label}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#cbd5e1`,transition:`transform 0.2s ease`,transform:a?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Ug,{})})]}),a&&(0,$.jsx)(`div`,{style:{overflow:`hidden`},children:(t[e.id]||[]).sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)).map(e=>i(e,1))})]},e.id)):r.push(i(e))}),r})()}),(0,$.jsxs)(`div`,{onClick:()=>s(!0),style:{margin:`8px 12px`,padding:`12px 20px`,borderRadius:14,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,color:`#ffffff`,fontSize:14,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%)`,e.currentTarget.style.transform=`translateY(-1px)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.5)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.4)`},children:[(0,$.jsx)(vR,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0},children:(0,$.jsx)(jU,{menu:{items:ie,onClick:J},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:`10px 14px`,borderRadius:14,cursor:`pointer`,transition:`all 0.25s ease`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0, 0, 0, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04)`},children:[(0,$.jsx)(dT,{size:36,icon:(0,$.jsx)(q8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:14,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:12,fontWeight:500,letterSpacing:0,background:`rgba(99, 102, 241, 0.08)`,padding:`2px 8px`,borderRadius:6,display:`inline-block`},children:[`积分: `,n?.credits||0]})]})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:q+28,marginRight:12,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#ffffffff`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:(0,$.jsx)(Ct,{})})}),(0,$.jsxs)(`div`,{className:`mobile-bottom-nav`,children:[d.filter(e=>(e.menu_type??e.menuType)!==`group`).map(t=>t.path?(0,$.jsxs)(`div`,{className:`nav-item ${t.path===K?`active`:``}`,onClick:()=>e(t.path),children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:n9[t.icon]||(0,$.jsx)(b3,{})}),(0,$.jsx)(`span`,{children:t.label})]},t.id):null),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:se,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(E6,{})}),(0,$.jsx)(`span`,{children:`充值`})]}),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:oe,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(V3,{})}),(0,$.jsx)(`span`,{children:`退出`})]})]}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(R3,{}),`修改密码`]}),open:i,onOk:ae,onCancel:()=>{a(!1),c.resetFields()},okText:`确认修改`,cancelText:`取消`,width:440,children:(0,$.jsxs)(CW,{form:c,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(CW.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(iK.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(CW.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(iK.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(CW.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(iK.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}})})})]})}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(a3,{}),`积分充值`]}),open:o,onCancel:()=>{s(!1),u(null)},footer:null,width:680,children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(kU,{style:{marginBottom:16},children:[(0,$.jsx)($8,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`rgba(99, 102, 241, 0.06)`,borderRadius:10,marginBottom:16,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(E3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(Q.Text,{style:{color:`#ff0000ff`,fontSize:13},children:`当前平台仅支持支付宝/微信扫码充值,如需转账支付请联系我们`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:p.map((e,t)=>{let n=r9[t%r9.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>u(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:l===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:l===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(D$,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(Q.Text,{style:{fontSize:14,fontWeight:600,color:`#6366f1`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})}),!z.alipay&&!z.wechat?(0,$.jsx)(`div`,{style:{marginTop:20,marginBottom:8,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(Q.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginTop:20,marginBottom:8},children:[(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(BL.Group,{value:A,onChange:e=>j(e.target.value),style:{display:`flex`,gap:12},children:[z.alipay&&(0,$.jsxs)(BL.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`alipay`?`#1677ff`:void 0,color:A===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(a2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),z.wechat&&(0,$.jsxs)(BL.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`wechat`?`#07c160`:void 0,color:A===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(a5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:[(0,$.jsx)(xD,{size:`large`,onClick:()=>{s(!1),u(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(xD,{type:`primary`,size:`large`,disabled:!l||!z.alipay&&!z.wechat,loading:M,onClick:async()=>{let e=p.find(e=>e.id===l);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{N(!0);let n=await o7(e.id,A),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(k({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),s(!1),D(!0),R.current=n.orderNo,localStorage.setItem(re,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),ue(n.orderNo)):(Z.success(`充值成功!积分已到账`),e9.getState().refreshUser(),s(!1),u(null))}catch(e){Z.error(e?.message||`创建订单失败,请重试`)}finally{N(!1)}},style:{borderRadius:10,fontWeight:600,background:l?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:l?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]})]})}),(0,$.jsx)(Iq,{open:E,onCancel:async()=>{if(le(),R.current){try{await l7(R.current)}catch{}R.current=null}localStorage.removeItem(re),D(!1),k(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:O?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:O?.method===`alipay`?(0,$.jsx)(a2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(a5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:O?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:O?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:O&&(0,$.jsx)(n2,{value:O.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,O?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,O?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:P<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:P<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:P<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:P}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(xD,{size:`large`,block:!0,onClick:async()=>{if(le(),R.current){try{await l7(R.current)}catch{}R.current=null}localStorage.removeItem(re),D(!1),k(null),u(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(lte,{}),(0,$.jsx)(`div`,{style:{position:`fixed`,right:24,bottom:24,zIndex:1e3},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:64,bottom:8,padding:`8px 16px`,background:`#1e293b`,color:`#ffffff`,borderRadius:8,fontSize:13,whiteSpace:`nowrap`,opacity:+!!ee,transition:`opacity 0.2s ease`,pointerEvents:`none`},children:`联系我们`}),(0,$.jsx)(`button`,{onClick:()=>H(!0),style:{width:40,height:40,borderRadius:`50%`,border:`none`,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,color:`#ffffff`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`,e.currentTarget.style.boxShadow=`0 6px 24px rgba(99, 102, 241, 0.5)`,te(!0)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.4)`,te(!1)},children:(0,$.jsx)(X3,{style:{fontSize:20}})})]})}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(X3,{}),`联系我们`]}),open:V,onCancel:()=>{H(!1),U.resetFields()},footer:null,width:480,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(CW,{form:U,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(iK,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(iK,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(CW.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(iK.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(xD,{size:`large`,onClick:()=>{H(!1),U.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(xD,{type:`primary`,size:`large`,onClick:ce,loading:ne,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},fte=`http://localhost:8000/api`,pte=()=>{let{checkAuth:e}=e9(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(0),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)(!1),E=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[D,O]=(0,S.useState)(E.siteName),[k,A]=(0,S.useState)(E.siteLogo),[j,M]=(0,S.useState)(``),[N,P]=(0,S.useState)(``),F=Je(),{login:I}=e9(),[L]=CW.useForm(),[R]=CW.useForm(),[z]=CW.useForm();(0,S.useEffect)(()=>{Y5().then(e=>{O(e.siteName),A(e.siteLogo),M(e.userAgreementUrl),P(e.privacyPolicyUrl)}).catch(()=>{})},[]);let B=()=>d?!0:(Z.warning(`请先阅读并同意用户协议和隐私政策`),!1),V=async()=>{if(B())try{let t=await L.validateFields();await I(t.phone,t.password,void 0,t.rememberMe),Z.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}},H=async()=>{if(B())try{let t=R.getFieldsValue();if(!t.phone||!t.code){Z.error(`请填写手机号和验证码`);return}n(!0),await N5(t.phone,t.code),Z.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}finally{n(!1)}},U=async()=>{if(B())try{let t=await z.validateFields();n(!0),await P5(t.phone,t.regCode,t.password),Z.success(`注册成功`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Z.error(t)}finally{n(!1)}},ee=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),m(!1),t?C(!0):T(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{s===0&&r===`phone`&&v(!1)},[s,r]);let te=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Z.error(`请输入正确的手机号`);return}if(t){m(!0),g(!1);return}if(!_){m(!0),v(!1);return}let n=``;n=r===`register`?`register`:`login`,await Q5(e,n),ee(t?u:c),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(g(!1),u(0)):(v(!1),c(0)),b(e=>e+1)}},ne=async(e=!1)=>{let t=r===`register`?z.getFieldValue(`phone`):R.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await Q5(t,e),r===`register`?(g(!0),ee(u,!0)):(v(!0),ee(c,!1)),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(g(!1),u(0),C(!0)):(v(!1),c(0),T(!0)),b(e=>e+1)}},W=e=>{o(e),i(e),c(0),u(0),v(!1),g(!1),m(!1),C(!1),T(!1),b(e=>e+1),e===`password`?L.resetFields():R.resetFields()},re=[{icon:(0,$.jsx)(W2,{}),title:`AI 智能优化`,desc:`输入原始提示词,AI 自动为您生成专业级视频、图片描述`},{icon:(0,$.jsx)(C6,{}),title:`一键生成视频、图片`,desc:`支持多种规格生成视频、图片`},{icon:(0,$.jsx)(_3,{}),title:`项目维度管理`,desc:`按项目行业分类视频、图片,支持多种行业`}],G={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,height:48,borderRadius:10,fontSize:14},K=e=>{e&&window.open(`${fte.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-container`,style:{backgroundImage:`url(/backimage.png)`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`,backgroundAttachment:`fixed`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(240,244,255,0.9) 0%, rgba(232,236,248,0.85) 40%, rgba(240,240,255,0.9) 70%, rgba(248,249,255,0.95) 100%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:500,height:500,borderRadius:`50%`,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,top:-150,right:-100,filter:`blur(40px)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:400,height:400,borderRadius:`50%`,background:`radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%)`,bottom:-100,left:-80,filter:`blur(50px)`}}),(0,$.jsx)(`div`,{className:`login-left-section`,children:(0,$.jsxs)(kU,{direction:`vertical`,size:24,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:16},children:[k?(0,$.jsx)(`img`,{src:k,alt:`logo`,style:{width:48,height:48,borderRadius:12,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:(0,$.jsx)(M8,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:24,fontWeight:800,letterSpacing:-.5},children:D})]}),(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{fontSize:20},children:(0,$.jsx)(`span`,{className:`shiny-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(Q.Paragraph,{style:{color:`#64748b`,fontSize:15,maxWidth:480,lineHeight:1.8},children:`专业的 AI 素材生成平台,通过智能提示词优化,让您的创意快速转化为精美视频、图片`})]}),(0,$.jsx)(`div`,{className:`login-features`,children:re.map((e,t)=>(0,$.jsxs)(`div`,{className:`electric-border-card`,style:{position:`relative`,display:`flex`,gap:16,alignItems:`flex-start`,padding:`18px 22px`,borderRadius:14,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(12px)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{className:`electric-border`}),(0,$.jsx)(`div`,{className:`electric-border-inner`}),(0,$.jsx)(`div`,{style:{position:`relative`,zIndex:1},children:(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:`linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15))`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6366f1`,fontSize:20},children:e.icon})}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(Q.Text,{style:{color:`#1e293b`,fontSize:15,fontWeight:600,display:`block`,marginBottom:4},children:e.title}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,lineHeight:1.6},children:e.desc})]})]},t))})]})}),(0,$.jsx)(`div`,{className:`login-right-section`,children:(0,$.jsxs)(Az,{style:{width:`100%`,maxWidth:400,borderRadius:16,boxShadow:`0 12px 40px rgba(0,0,0,0.08)`,border:`1px solid #e2e8f0`,background:`#fff`},styles:{body:{padding:`24px 20px`}},children:[(0,$.jsx)(Q.Title,{level:3,style:{textAlign:`center`,marginBottom:6,color:`#1e293b`,fontWeight:700},children:r===`register`?`创建账号`:`欢迎回来`}),(0,$.jsx)(Q.Text,{style:{display:`block`,textAlign:`center`,marginBottom:28,color:`#94a3b8`,fontSize:14},children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作视频`}),r!==`register`&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:0,marginBottom:24,background:`#f1f5f9`,borderRadius:10,padding:4,border:`1px solid #e2e8f0`},children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>W(e),style:{flex:1,textAlign:`center`,padding:`10px 0`,borderRadius:8,cursor:`pointer`,fontSize:14,fontWeight:a===e?600:400,color:a===e?`#6366f1`:`#64748b`,background:a===e?`#fff`:`transparent`,border:a===e?`1px solid rgba(99,102,241,0.2)`:`1px solid transparent`,boxShadow:a===e?`0 2px 8px rgba(99,102,241,0.1)`:`none`,transition:`all 0.3s ease`},children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(CW,{form:L,size:`large`,layout:`vertical`,onFinish:V,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:G})}),(0,$.jsx)(CW.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(iK.Password,{prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:G})}),(0,$.jsx)(CW.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(sV,{children:`记住我的登录状态`})}),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,htmlType:`submit`,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(CW,{form:R,size:`large`,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:G})}),(0,$.jsx)(CW.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(kU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(iK,{prefix:(0,$.jsx)(V6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!_,style:{...G,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(xD,{disabled:s>0,onClick:()=>{w?(v(!1),m(!0),b(e=>e+1)):te(R.getFieldValue(`phone`))},style:{height:48,borderRadius:`0 10px 10px 0`,background:s>0||_?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:s>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:s>0?`${s}s`:w?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(i9,{onSuccess:ne,isVerified:_})},y),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,onClick:H,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(CW,{form:z,size:`large`,layout:`vertical`,children:[(0,$.jsx)(CW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(iK,{prefix:(0,$.jsx)($3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:G})}),(0,$.jsx)(CW.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(kU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(iK,{prefix:(0,$.jsx)(V6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!h,style:{...G,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(xD,{disabled:l>0,onClick:()=>{x?(g(!1),m(!0),b(e=>e+1)):te(z.getFieldValue(`phone`),!0)},style:{height:48,borderRadius:`0 10px 10px 0`,background:l>0||h?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:l>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:l>0?`${l}s`:x?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(i9,{onSuccess:ne,isVerified:h})},y),(0,$.jsx)(CW.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(iK.Password,{prefix:(0,$.jsx)(R3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:G})}),(0,$.jsx)(CW.Item,{style:{marginBottom:12},children:(0,$.jsx)(xD,{type:`primary`,onClick:U,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`注 册`})})]}),(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(sV,{checked:d,onChange:e=>f(e.target.checked),children:(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#64748b`},children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),K(j)},style:{color:`#6366f1`,cursor:`pointer`},children:`《用户协议》`}),`和`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),K(N)},style:{color:`#6366f1`,cursor:`pointer`},children:`《隐私政策》`})]})})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:r===`register`?(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`password`),o(`password`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1),z.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`register`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1)},children:`没有账号?立即注册`})})]})})]})},i9=({onSuccess:e,isVerified:t})=>{let n=S.useRef(null),r=S.useRef(null),i=S.useRef(null),a=S.useRef(0),o=S.useRef(!1),[s,c]=S.useState(360),l=s-50;S.useEffect(()=>{let e=()=>{if(n.current){let e=n.current.offsetWidth;e>0&&c(e)}};e();let t=new ResizeObserver(e);return n.current&&t.observe(n.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let u=n=>{if(o.current||t)return;let c=Math.max(0,Math.min(n,l));a.current=c,r.current&&(r.current.style.left=`${c}px`),i.current&&(i.current.style.width=`${c+50}px`),c>=l-5&&(o.current=!0,r.current&&(r.current.style.background=`#22c55e`,r.current.innerHTML=``),i.current&&(i.current.style.width=`${s}px`,i.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:n,onMouseDown:e=>{if(e.preventDefault(),o.current||t)return;let s=n.current;if(!s)return;let c=s.getBoundingClientRect(),d=e=>{u(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f),!o.current&&a.current({page:1,pageSize:10,total:0,items:[]}),a9=m5((e,t)=>({projects:[],records:mte(),loading:!1,mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await R5(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await z5(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await B5(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await V5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await H5(n,r);try{await e9.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await q5(n,r);try{await e9.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[]})}));function o9(e){if(!e)return`-`;let t=e.trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);return n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``),t.replace(`T`,` `).slice(0,16)}var s9=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],c9={ShoppingCartOutlined:(0,$.jsx)($6,{}),BookOutlined:(0,$.jsx)(R2,{}),HomeOutlined:(0,$.jsx)(b3,{}),FireOutlined:(0,$.jsx)($4,{}),RocketOutlined:(0,$.jsx)(R6,{}),SkinOutlined:(0,$.jsx)(c8,{}),CompassOutlined:(0,$.jsx)(E4,{}),HeartOutlined:(0,$.jsx)(d3,{}),CarOutlined:(0,$.jsx)($2,{}),CameraOutlined:(0,$.jsx)(X2,{}),CloudOutlined:(0,$.jsx)(d4,{}),StarOutlined:(0,$.jsx)(b8,{}),TrophyOutlined:(0,$.jsx)(R8,{}),ThunderboltOutlined:(0,$.jsx)(M8,{}),BulbOutlined:(0,$.jsx)(W2,{}),CoffeeOutlined:(0,$.jsx)(C4,{}),CrownOutlined:(0,$.jsx)(M4,{}),DashboardOutlined:(0,$.jsx)(F4,{}),FlagOutlined:(0,$.jsx)(n3,{}),GlobalOutlined:(0,$.jsx)(c3,{}),GiftOutlined:(0,$.jsx)(a3,{}),LaptopOutlined:(0,$.jsx)(k3,{}),MobileOutlined:(0,$.jsx)($3,{}),MonitorOutlined:(0,$.jsx)(n6,{}),PayCircleOutlined:(0,$.jsx)(c6,{}),PictureOutlined:(0,$.jsx)(m6,{}),PlayCircleOutlined:(0,$.jsx)(C6,{}),SafetyOutlined:(0,$.jsx)(V6,{}),ShoppingOutlined:(0,$.jsx)(n8,{}),SmileOutlined:(0,$.jsx)(d8,{}),SoundOutlined:(0,$.jsx)(_8,{}),TagOutlined:(0,$.jsx)(E8,{}),TeamOutlined:(0,$.jsx)(k8,{}),ToolOutlined:(0,$.jsx)(F8,{}),TruckOutlined:(0,$.jsx)(V8,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),WalletOutlined:(0,$.jsx)($8,{}),BankOutlined:(0,$.jsx)(k2,{}),BuildOutlined:(0,$.jsx)(V2,{}),ExperimentOutlined:(0,$.jsx)(W4,{}),HighlightOutlined:(0,$.jsx)(m3,{}),IdcardOutlined:(0,$.jsx)(C3,{}),MedicineBoxOutlined:(0,$.jsx)(q3,{}),ReadOutlined:(0,$.jsx)(k6,{}),RestOutlined:(0,$.jsx)(M6,{}),SketchOutlined:(0,$.jsx)(a8,{}),SolutionOutlined:(0,$.jsx)(m8,{})},hte=()=>{let[e,t]=(0,S.useState)(!1),[n]=CW.useForm(),r=Je(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=a9(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),n7().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:s9[t%s9.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`22px 24px`,borderRadius:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:200,height:200,borderRadius:`50%`,background:`rgba(255,255,255,0.08)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(Q.Title,{level:3,style:{margin:`0 0 4px`,color:`#fff`,fontWeight:700},children:`我的项目`}),(0,$.jsxs)(Q.Text,{style:{color:`rgba(255,255,255,0.7)`,fontSize:14},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]}),(0,$.jsx)(xD,{icon:(0,$.jsx)(vR,{}),onClick:()=>t(!0),size:`large`,style:{background:`rgba(255,255,255,0.15)`,border:`1px solid rgba(255,255,255,0.3)`,color:`#fff`,fontWeight:600,backdropFilter:`blur(10px)`,borderRadius:10,height:42},children:`新建项目`})]}),i.length===0?(0,$.jsx)(PC,{image:PC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(xD,{type:`primary`,icon:(0,$.jsx)(vR,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:c9[u[e.industry]?.icon]||(0,$.jsx)(d2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(D$,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(DH,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,o9(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(xD,{type:`primary`,icon:(0,$.jsx)(C6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(Bq,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Z.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(xD,{danger:!0,icon:(0,$.jsx)(A$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Ug,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(d2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Z.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(CW,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(CW.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(iK,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(CZ,{}),size:`large`})}),(0,$.jsx)(CW.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(uw,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(uw.Option,{value:e.key,children:(0,$.jsxs)(kU,{children:[c9[e.icon]||(0,$.jsx)(d2,{}),` `,e.label]})},e.key))})})]})})]})};function gte(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var l9=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(C6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},_te=()=>{let{projectId:e}=Qe(),t=Je(),[n]=CW.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=a9(),l=i.items,{user:u}=e9(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)([]),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),H=(0,S.useRef)(null),[U,ee]=(0,S.useState)({}),[te,ne]=(0,S.useState)({}),[W,re]=(0,S.useState)({}),[G,K]=(0,S.useState)(null),[q,ie]=(0,S.useState)({}),[J,ae]=(0,S.useState)(null),[oe,se]=(0,S.useState)(5),[ce,le]=(0,S.useState)(`16:9`),[ue,de]=(0,S.useState)(`720p`),[fe,pe]=(0,S.useState)(null),[me,he]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[ge,_e]=(0,S.useState)(0),[ve,ye]=(0,S.useState)(0),[be,xe]=(0,S.useState)(`image`),[Se,Ce]=(0,S.useState)(`1:1`),[we,Te]=(0,S.useState)(`2K`),[Ee,De]=(0,S.useState)(2048),[Oe,ke]=(0,S.useState)(2048),[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(0,S.useState)([]),[Pe,Fe]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(u7().then(e=>{Ne(e.video),Fe(e.image)}),!Ae)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&je(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[Ae]);let Ie=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{qe(e)},ze=e=>{Xe(parseInt(e))},[Be,Ve]=(0,S.useState)([]),[He,Ue]=(0,S.useState)([]),[We,Ge]=(0,S.useState)([]),[Ke,qe]=(0,S.useState)(0),[Ye,Xe]=(0,S.useState)(0);(0,S.useEffect)(()=>{We[Ye]&&We[Ye][Ke]!==void 0&&(De(We[Ye][Ke].substring(0,4)),ke(We[Ye][Ke].substring(5)))},[Ke]),(0,S.useEffect)(()=>{We[Ye]&&We[Ye][Ke]!==void 0&&(De(We[Ye][Ke].substring(0,4)),ke(We[Ye][Ke].substring(5)))},[Ye]);let Ze=()=>{De(Oe),ke(Ee)},$e=e=>{xe(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{n7().then(e=>{ee(Object.fromEntries(e.map(e=>[e.key,e.label]))),ne(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Z5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);n.forEach((e,t)=>{Ve(n=>[...n,{value:e,label:String(t)}])});for(let e in t[`4K`])i.push(t[`4K`][e]);Ge([r,i]);let a=[];for(let e in t)a.push(e);a.forEach((e,t)=>{Ue(n=>[...n,{value:e,label:String(t)}])})}).catch(()=>{}),X5().then(e=>{if(e.items?.length){let t=e.items[0];he({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let et=(0,S.useRef)(!1);(0,S.useEffect)(()=>{et.current||l.length===0||(et.current=!0,console.log(`aaaa`,l),l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Dt(t.id)),t.projectId===e&&t.status===`optimizing`&&ct(t.id)}))},[l,e]);let tt=(0,S.useRef)(new Set),nt=(0,S.useRef)(null),rt=(0,S.useRef)(null),it=e=>{tt.current.add(e),st()},at=e=>{tt.current.delete(e),tt.current.size===0&&ot()},ot=()=>{nt.current&&=(clearInterval(nt.current),null),rt.current&&=(rt.current.abort(),null)},st=()=>{nt.current||=setInterval(async()=>{try{rt.current&&rt.current.abort();let t=new AbortController;rt.current=t;let n=await V5({projectId:e,page:1,pageSize:100,signal:t.signal});rt.current=null;let r=Array.from(tt.current),i=[];if(r.length>0){let e=a9.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});a9.setState({records:{...e,items:t}}),i.forEach(e=>{at(e)})}}catch(e){e.name!==`AbortError`&&console.error(`Optimizing polling error:`,e)}},3e3)},ct=e=>{it(e)},lt=(0,S.useRef)(!1),ut=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(lt.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(ut.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(lt.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),_e(s.textCreditsCost),ye(s.textTokensUsed),m(!0),Z.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let dt=r.find(t=>t.id===e),ft=l.filter(t=>t.projectId===e),pt=dt?.name??`项目`,mt=dt&&te[dt.industry]||[],ht=u?.credits??0,gt=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=_t,yt=async()=>{try{if(!e){Z.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Z.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(W).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=gte();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:oe,ts:Date.now()})),ut.current=a;let o=await s(e,{prompt:i,duration:oe,genType:be,resolution:we,references:M.length>0?M:void 0,idempotencyKey:a,image_size:we,image_proportion:Se,image_px:Ee+`x`+Oe});localStorage.removeItem(`pending_optimize`),ut.current=null,g(o.record),v(o.record.optimizedPrompt||``),_e(o.textCreditsCost),ye(o.textTokensUsed),m(!0),Z.success({content:`「${pt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){console.error(`优化提示词失败:`,e);let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Z.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),ut.current=null}},bt=(0,S.useRef)(new Set),xt=(0,S.useRef)(null),St=(0,S.useRef)(null),Ct=e=>{bt.current.add(e),Et()},wt=e=>{bt.current.delete(e),bt.current.size===0&&Tt()},Tt=()=>{xt.current&&=(clearInterval(xt.current),null),St.current&&=(St.current.abort(),null)},Et=()=>{xt.current||=setInterval(async()=>{try{St.current&&St.current.abort();let t=new AbortController;St.current=t;let n=await V5({projectId:e,page:1,pageSize:100,signal:t.signal});St.current=null;let r=Array.from(bt.current),i=[];if(r.length>0){let e=a9.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`generating`&&i.push(e.id),t}return e});a9.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);wt(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Z.success({content:`「${pt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Z.error({content:`「${pt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name!==`AbortError`&&console.error(`Global polling error:`,e)}},5e3)},Dt=e=>{Ct(e)};(0,S.useEffect)(()=>()=>{Tt(),ot()},[]);let Ot=async e=>{if(!vt){Z.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${pt}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:ce,resolution:ue})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Z.error({content:`「${pt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${pt}」已提交,正在生成中...`,key:e,duration:3}),Dt(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},kt=async e=>{let t=ft.find(t=>t.id===e);if(t){C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${pt}」正在重新提交...`,duration:0,key:e});try{let n=E[e];n&&n!==t.optimizedPrompt&&await K5(e,n);let r=await c(e,{aspectRatio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`});console.log(`重新提交视频生成结果:`,r),r.status===`failed`?(T(t=>({...t,[e]:`failed`})),console.log(`12312`),Z.error({content:`「${pt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${pt}」已提交,正在生成中...`,key:e,duration:3}),Dt(e))}catch(t){T(t=>({...t,[e]:`failed`})),console.log(`1231`,t);let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}}},At=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},jt={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(AH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(a4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(c4,{})}},Mt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(EQ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,zi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Nt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(EQ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,zi.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`20px 28px`,borderRadius:16,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-30,bottom:-30,width:160,height:160,borderRadius:`50%`,background:`rgba(255,255,255,0.05)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,position:`relative`},children:[(0,$.jsx)(xD,{icon:(0,$.jsx)(_2,{}),onClick:()=>t(`/projects`),style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:10}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0,color:`#fff`,fontWeight:700},children:pt}),dt&&(0,$.jsx)(D$,{style:{background:`rgba(255,255,255,0.12)`,border:`1px solid rgba(255,255,255,0.2)`,color:`rgba(255,255,255,0.8)`,borderRadius:6},children:U[dt.industry]||dt.industry})]}),(0,$.jsx)(Q.Text,{style:{color:`rgba(255,255,255,0.5)`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]})]}),(0,$.jsxs)(D$,{style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,ht,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(BL.Group,{defaultValue:`image`,buttonStyle:`solid`,onChange:$e,children:[(0,$.jsxs)(BL.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(m6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]}),(0,$.jsxs)(BL.Button,{value:`video`,children:[(0,$.jsx)(X8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]})]})]}),be===`video`&&[{icon:(0,$.jsx)(M$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(M8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(R6,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),be===`image`&&[{icon:(0,$.jsx)(M$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(M8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(R6,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(CW,{form:n,initialValues:{},children:[(0,$.jsx)(CW.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[M.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ae(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(CG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(l9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),G5(e.url).catch(()=>{}),N(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(c4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Z.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Z.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=M.filter(e=>e.type===`image`).length,a=M.filter(e=>e.type===`video`).length;return t&&i>=10?(Z.error(`最多上传10张图片`),!1):n&&a>=3?(Z.error(`最多上传3个视频`),!1):(F(!0),(t?U5:W5)(e).then(e=>{let n=t?`图片`:`视频`,r=t?i+1:a+1;N(i=>[...i,{url:e.url,type:t?`image`:`video`,name:`${n}${r}`}]),Z.success(`${n}上传成功`)}).catch(()=>Z.error(`上传失败`)).finally(()=>F(!1)),!1)},children:(0,$.jsx)(eT,{title:`参考内容(${M.length}/10)`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:P?(0,$.jsx)(Xm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(vR,{style:{fontSize:18,color:`#94a3b8`}})})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(iK.TextArea,{ref:H,value:I,onChange:e=>{let t=e.target.value;L(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` `)){z(!0),V(e);return}}z(!1)},rows:3,placeholder:`上传参考素材、输入文字,自由组合图、文多元素。输入 @ 可引用参考内容...`,maxLength:500,bordered:!1,autoSize:{minRows:2,maxRows:6},style:{padding:`6px 2px`,fontSize:15,lineHeight:1.7,resize:`none`,caretColor:`#6366f1`}})}),R&&M.length>0&&(0,$.jsx)(`div`,{style:{margin:`0 16px 8px`,background:`#fff`,borderRadius:10,boxShadow:`0 6px 24px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`,padding:6,maxHeight:180,overflowY:`auto`},children:M.filter(e=>!B||e.name.includes(B)).map((e,t)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 10px`,borderRadius:8,cursor:`pointer`,transition:`background 0.15s`},onMouseEnter:e=>e.currentTarget.style.background=`#f1f5f9`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onMouseDown:t=>{t.preventDefault();let r=H.current?.resizableTextArea?.textArea||H.current?.nativeElement?.querySelector(`textarea`)||H.current;if(!r||!r.value)return;let i=r.value,a=i.lastIndexOf(`@`),o=i.slice(0,a)+`@${e.name} `;L(o),n.setFieldValue(`prompt`,o),z(!1),setTimeout(()=>{r.focus(),r.selectionStart=o.length,r.selectionEnd=o.length},50)},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,overflow:`hidden`,background:e.type===`image`?`#f1f5f9`:`#1a1a2e`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(C6,{style:{color:`#fff`,fontSize:14}})}),(0,$.jsx)(Q.Text,{style:{fontSize:13},children:e.name}),(0,$.jsx)(D$,{style:{marginLeft:`auto`,fontSize:11},children:e.type===`image`?`图片`:`视频`})]},t))}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px 12px`,gap:8,flexWrap:`wrap`,position:`relative`,zIndex:50,minHeight:48},children:[be!==`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,flexWrap:`wrap`},children:[(0,$.jsx)(Mt,{label:`时长`,value:`${oe}`,options:me.durations.map(e=>`${e}`),suffix:`秒`,expanded:fe===`duration`,onToggle:()=>pe(fe===`duration`?null:`duration`),onSelect:e=>se(parseInt(e)),onClose:()=>pe(null)}),mt.map((e,t)=>{let n=G===e.name,r=W[e.name];return(0,$.jsx)(Nt,{group:e,selected:r,expanded:n,onToggle:()=>K(n?null:e.name),onSelect:t=>{re(n=>{let r={...n};return r[e.name]===t?delete r[e.name]:r[e.name]=t,r})},onClose:()=>K(null)},`og-${t}`)})]}),be==`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>je(!Ae),className:`image-settings-trigger`,style:{minWidth:220,padding:`0px 16px`,height:30,borderRadius:10,border:`1px solid #e2e8f0`,backgroundColor:`#f8f9fc`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:(0,$.jsxs)(`div`,{style:{textAlign:`left`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:600,color:`#374151`,marginRight:10},children:Se===`auto`?`智能`:Se}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#9ca3af`},children:[we==`2K`?`高清 2K`:`超清 4K`,`| `,Ee,`×`,Oe]})]})}),(0,$.jsx)(EQ,{style:{fontSize:14,color:`#9ca3af`}})]}),Ae&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:520,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:20,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:Be.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{Ce(e.value),Re(e.label)},style:{flex:`0 0 calc(11.11% - 5px)`,minWidth:48,height:56,borderRadius:8,border:Se===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Se===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:e.value===`auto`?16:20,height:e.value===`auto`?16:20,border:`2px solid ${Se===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:(e.value,3),marginBottom:3,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:8,color:Se===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:10,color:Se===e.value?`#6366f1`:`#6b7280`,fontWeight:Se===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:He.map(e=>(0,$.jsx)(`button`,{onClick:()=>{Te(e.value),ze(e.label)},style:{flex:1,height:48,borderRadius:8,border:we===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:we===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:13,fontWeight:600,color:we===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4k`&&(0,$.jsx)(`span`,{style:{marginLeft:3},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`W`}),(0,$.jsx)(iK,{value:Ee,onChange:e=>De(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:Ze,style:{width:28,height:28,borderRadius:6,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(cG,{style:{fontSize:12}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`H`}),(0,$.jsx)(iK,{value:Oe,onChange:e=>ke(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12},children:`PX`})]})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[be===`image`&&(0,$.jsx)(`span`,{style:{color:`#7c7c7c`,fontSize:14},children:`(请在左侧选择图片比例和尺寸)`}),(0,$.jsx)(xD,{type:`primary`,size:`large`,onClick:yt,loading:d,style:{borderRadius:10,fontWeight:600,minWidth:140,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99,102,241,0.35)`},children:`AI优化提示词`})]})]})]})]})]}),p&&h&&(0,$.jsxs)(Az,{className:`animate-fadeInUp`,style:{borderRadius:16},styles:{body:{padding:`24px 28px`}},children:[!w[h.id]||w[h.id]===`idle`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:24,padding:`14px 18px`,borderRadius:12,background:`linear-gradient(135deg, rgba(16,185,129,0.06), rgba(5,150,105,0.06))`,border:`1px solid rgba(16,185,129,0.15)`},children:[(0,$.jsx)(a4,{style:{color:`#10b981`,fontSize:22}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`},children:`提示词优化完成`}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`文本优化消耗 `,ge,` 积分· 您可以编辑提示词后选择参数生成视频`]})]})]}):(0,$.jsxs)(`div`,{style:{marginBottom:24,padding:`16px 18px`,borderRadius:12,display:`flex`,alignItems:`center`,gap:12,background:w[h.id]===`failed`?`rgba(239,68,68,0.04)`:w[h.id]===`done`?`rgba(16,185,129,0.04)`:`rgba(99,102,241,0.04)`,border:`1px solid ${w[h.id]===`failed`?`rgba(239,68,68,0.12)`:w[h.id]===`done`?`rgba(16,185,129,0.12)`:`rgba(99,102,241,0.12)`}`},children:[w[h.id]===`generating`&&(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:18},spin:!0}),w[h.id]===`done`&&(0,$.jsx)(a4,{style:{color:`#10b981`,fontSize:18}}),w[h.id]===`failed`&&(0,$.jsx)(c4,{style:{color:`#ef4444`,fontSize:18}}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:w[h.id]===`failed`?`#ef4444`:w[h.id]===`done`?`#10b981`:`#6366f1`},children:[w[h.id]===`generating`&&`${be===`image`?`图片`:`视频`}生成中,请稍候...`,w[h.id]===`done`&&`${be===`image`?`图片`:`视频`}生成成功`,w[h.id]===`failed`&&`${be===`image`?`图片`:`视频`}生成失败,请重试`]})]}),!w[h.id]||w[h.id]===`idle`||w[h.id]===`failed`?(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#64748b`,lineHeight:1.7},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(kU,{size:4,children:[(0,$.jsx)(eT,{title:`复制`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:()=>{navigator.clipboard.writeText(_),Z.success(`已复制`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(eT,{title:`编辑`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(iK.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:14,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(xD,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(xD,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#1a1a2e`,lineHeight:1.7},children:_})})]})]}):(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 55%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:80},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.6},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(kU,{size:4,children:[(0,$.jsx)(eT,{title:`复制`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:()=>{navigator.clipboard.writeText(_),Z.success(`已复制`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(eT,{title:`编辑`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(iK.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:13,lineHeight:1.6,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(xD,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(xD,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:120},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.6},children:_})})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:280},children:[h.videoUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成视频`}),(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,background:`#000`},children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${h.videoUrl}`,controls:!0,style:{width:`100%`,maxHeight:350,display:`block`}})})]}),h.imageUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成图片`}),(0,$.jsx)(CG,{src:`http://ceshi.apiforeign.minzhong.cn${h.imageUrl}`,style:{width:`100%`,maxHeight:350,objectFit:`contain`,borderRadius:12,border:`1px solid #f0f0f5`},preview:!0})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:20,padding:`14px 18px`,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:[be!==`image`&&(0,$.jsxs)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,fontWeight:600,display:`block`,marginBottom:12},children:`选择视频参数`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[oe,`s`]})]}),(0,$.jsx)(Mt,{label:`比例`,value:ce,options:me.ratios,expanded:fe===`ratio`,onToggle:()=>pe(fe===`ratio`?null:`ratio`),onSelect:e=>le(e),onClose:()=>pe(null)}),(0,$.jsx)(Mt,{label:`分辨率`,value:ue,options:me.resolutions,expanded:fe===`resolution`,onToggle:()=>pe(fe===`resolution`?null:`resolution`),onSelect:e=>de(e),onClose:()=>pe(null)})]})]}),be==`image`&&h&&(0,$.jsx)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-around`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`分辨率`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageSize||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面比例`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageProportion||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面尺寸`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imagePx||`-`})]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`文字积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#6366f1`},children:ge})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`+`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:[`预估`,be===`image`?`图片`:`视频`,`积分`]}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#10b981`},children:be===`image`&&h.imageSize?gt(h.imageSize)||_t:Ie(oe,ue)})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`=`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`总计`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1a1a2e`},children:(ge+(be===`image`?gt(h.imageSize):Ie(oe,ue))).toFixed(2)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsxs)(xD,{size:`large`,onClick:()=>{m(!1),g(null),v(``),L(``),N([]),re({}),K(null),pe(null),n.resetFields()},style:{borderRadius:12,minWidth:120,height:44,fontWeight:500},children:[`配置新`,be===`image`?`图片`:`视频`]}),(0,$.jsx)(eT,{title:vt?``:`积分不足`,children:(0,$.jsx)(xD,{type:`primary`,size:`large`,icon:(0,$.jsx)(R6,{}),onClick:()=>Ot(h.id),loading:w[h.id]===`generating`,disabled:!vt||w[h.id]===`generating`||w[h.id]===`done`,style:{borderRadius:12,minWidth:180,height:44,fontWeight:600,background:w[h.id]===`done`?`#10b981`:vt?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#d1d5db`,border:`none`,boxShadow:vt?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:w[h.id]===`done`?`生成完成`:w[h.id]===`generating`?`生成中...`:`生成${be===`image`?`图片`:`视频`} (${be===`image`?gt(h.imageSize):Ie(oe,ue)}积分)`})})]})]}),h.references&&h.references.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`参考内容`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:h.references.map((e,t)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ae(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:[e.type===`image`?(0,$.jsx)(CG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(l9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,width:64,height:64}),(0,$.jsx)(D$,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:e.name})]},t))})]})]}),ft.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:24},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`,marginBottom:12},children:`本项目生成记录`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:ft.map((e,t)=>{let n=At(e),r=E[e.id]??(e.optimizedPrompt||e.originalPrompt),i=A===e.id,a=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.05}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>j(i?null:e.id),style:{padding:`12px 16px`,borderRadius:i?`12px 12px 0 0`:12,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:a===`image`?`#fef3c7`:`#dbeafe`},children:a===`image`?(0,$.jsx)(m6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(X8,{style:{color:`#2563eb`,fontSize:12}})}),i?(0,$.jsx)(EQ,{style:{color:`#6366f1`,fontSize:11,flexShrink:0}}):(0,$.jsx)(n4,{style:{color:`#cbd5e1`,fontSize:11,flexShrink:0}}),(0,$.jsx)(D$,{color:jt[n]?.color,icon:jt[n]?.icon,style:{margin:0},children:jt[n]?.text}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),n===`prompt_optimized`&&(0,$.jsx)(D$,{color:`processing`,style:{padding:`3px 10px`,fontSize:12,margin:0,flexShrink:0},children:`待配置`}),a===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` ·`,` `,e.imageProportion||`-`,` ·`,` `,e.imagePx||`-`,` ·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:o9(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` ·`,` `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` `,`·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:o9(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsx)(kU,{children:n===`failed`&&(0,$.jsx)(xD,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(C6,{}),loading:x[e.id],onClick:()=>kt(e.id),style:{borderRadius:8},children:`重试`})})})]}),i&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 12px 12px`,padding:`18px 20px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:260},children:[(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,(n===`prompt_optimized`||n===`failed`)&&O!==e.id&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),O!==e.id&&(0,$.jsxs)(kU,{size:4,children:[(0,$.jsx)(eT,{title:`复制`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:()=>{navigator.clipboard.writeText(r),Z.success(`已复制`)},style:{color:`#94a3b8`}})}),(n===`prompt_optimized`||n===`failed`)&&(0,$.jsx)(eT,{title:`编辑`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{k(e.id),D(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt??``}))},style:{color:`#6366f1`}})})]})]}),O===e.id?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(iK.TextArea,{value:r,onChange:t=>D(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(xD,{size:`small`,onClick:()=>k(null),children:`取消`}),(0,$.jsx)(xD,{size:`small`,type:`primary`,onClick:()=>{D(t=>({...t,[e.id]:r})),k(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:n===`prompt_optimized`?`rgba(99,102,241,0.02)`:`#f8f9fc`,border:n===`prompt_optimized`?`1px solid rgba(99,102,241,0.1)`:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),a===`image`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`图片积分`,value:`${e.creditsCost||0}`},{label:`分辨率`,value:e.imageSize?`${e.imageSize}`:`-`},{label:`比例`,value:e.imageProportion||`-`},{label:`尺寸`,value:e.imagePx||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}):(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`视频积分`,value:`${e.creditsCost||0}`},{label:`时长`,value:e.duration?`${e.duration}秒`:`-`},{label:`比例`,value:e.aspectRatio||`-`},{label:`分辨率`,value:e.resolution||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}),(e.references&&e.references.length>0||n===`failed`)&&(0,$.jsxs)(`div`,{style:{marginTop:14},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:[`参考素材`,` `,n===`failed`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可删除/添加后重试)`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[e.references?.map((t,r)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`visible`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{t.type===`video`&&ae(`http://ceshi.apiforeign.minzhong.cn${t.url}`)},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`},children:t.type===`image`?(0,$.jsx)(CG,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(l9,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,width:64,height:64})}),(0,$.jsx)(D$,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:t.name}),n===`failed`&&(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),G5(t.url).catch(()=>{});let i=e.references.filter((e,t)=>t!==r);a9.getState().updateRecordReferences(e.id,i)},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(239,68,68,0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`},children:(0,$.jsx)(c4,{style:{color:`#fff`,fontSize:10}})})]},r)),n===`failed`&&(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`);return!n&&!r?(Z.error(`仅支持图片或视频文件`),!1):((n?U5:W5)(t).then(r=>{let i={url:r.url,type:n?`image`:`video`,name:t.name||(n?`图片`:`视频`)},a=e.references||[];a9.getState().updateRecordReferences(e.id,[...a,i]),Z.success(`上传成功`)}).catch(()=>Z.error(`上传失败`)),!1)},children:(0,$.jsx)(eT,{title:`添加参考素材`,children:(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`},children:(0,$.jsx)(vR,{style:{fontSize:18,color:`#94a3b8`}})})})})]})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:220,position:`relative`},children:[n===`prompt_optimized`&&(0,$.jsxs)(`div`,{style:{marginTop:16,position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`transparent`},children:[a===`video`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`,marginBottom:12},children:[(0,$.jsxs)(`div`,{translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,marginLeft:12},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[e.duration,`秒`]})]}),(0,$.jsx)(Mt,{label:`比例`,value:q[e.id]?.aspectRatio||`选择比例`,options:me.ratios,expanded:fe===`ratio-${e.id}`,onToggle:()=>pe(fe===`ratio-${e.id}`?null:`ratio-${e.id}`),onSelect:t=>ie(n=>({...n,[e.id]:{...n[e.id],aspectRatio:t,resolution:n[e.id]?.resolution||``}})),onClose:()=>pe(null)}),(0,$.jsx)(Mt,{label:`分辨率`,value:q[e.id]?.resolution||`选择分辨率`,options:me.resolutions,expanded:fe===`res-${e.id}`,onToggle:()=>pe(fe===`res-${e.id}`?null:`res-${e.id}`),onSelect:t=>ie(n=>({...n,[e.id]:{...n[e.id],aspectRatio:n[e.id]?.aspectRatio||``,resolution:t}})),onClose:()=>pe(null)})]}),(0,$.jsxs)(xD,{type:`primary`,size:`large`,icon:(0,$.jsx)(R6,{}),block:!0,loading:x[e.id],disabled:a===`video`&&(!q[e.id]?.aspectRatio||!q[e.id]?.resolution),onClick:async()=>{let t=q[e.id];if(a===`video`){if(!t?.aspectRatio||!t?.resolution){Z.error(`请选择比例和分辨率`);return}if(ht({...t,[e.id]:!0})),T(t=>({...t,[e.id]:`generating`}));let n=a===`video`?`视频`:`图片`;Z.loading({content:`「${pt}」正在生成${n}...`,duration:0,key:e.id});try{await c(e.id,{aspectRatio:t?.aspectRatio,resolution:t?.resolution}),T(t=>({...t,[e.id]:`done`})),Z.success({content:`「${pt}」${n}生成成功!`,key:e.id,duration:3})}catch{T(t=>({...t,[e.id]:`failed`})),Z.error({content:`「${pt}」${n}生成失败`,key:e.id,duration:3})}finally{C(t=>({...t,[e.id]:!1}))}},style:{borderRadius:12,fontWeight:600,color:`#fff`,height:48,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,position:`absolute`,bottom:18,left:0},children:[`生成`,a===`video`?`视频`:`图片`,a===`video`?(0,$.jsx)(`span`,{style:{color:`#d2d2d2`,fontSize:`14px`,marginLeft:`6px`},children:`(请选择上方的比例分辨率)`}):``,` `,a===`video`&&q[e.id]?.resolution?`(${Ie(e.duration||5,q[e.id].resolution)}积分)`:``,a===`image`&&e.imageSize?`(${Le(e.imageSize)}积分)`:a===`image`?`(积分)`:``]})]}),n===`failed`&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:18,right:20},children:(0,$.jsxs)(xD,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(C6,{}),block:!0,loading:x[e.id],onClick:()=>kt(e.id),style:{borderRadius:12,fontWeight:600,height:48},children:[`重新生成`,a===`video`?`视频`:`图片`]})}),n===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:28},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:[a===`video`?`视频`:`图片`,`生成中...`]})]}):n===`completed`&&e.videoUrl||e.imageUrl?(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(eT,{title:`下载${a===`video`?`视频`:`图片`}`,children:(0,$.jsx)(xD,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${a===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${a===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:180,overflow:`hidden`},children:a===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,borderRadius:0}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,borderRadius:0}})}),(0,$.jsxs)(`div`,{style:{padding:`8px 12px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(kU,{children:[a===`video`?(0,$.jsx)(X8,{style:{color:`#6366f1`,fontSize:13}}):(0,$.jsx)(m6,{style:{color:`#6366f1`,fontSize:13}}),(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:11,color:`#94a3b8`},children:o9(e.generatedAt)})]})]}):n===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10,padding:16},children:[(0,$.jsx)(c4,{style:{color:`#ef4444`,fontSize:28}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:[a===`video`?`视频`:`图片`,`生成失败`]}),e.errorMessage&&(0,$.jsx)(Q.Text,{style:{color:`#ef4444`,fontSize:12,textAlign:`center`,lineHeight:1.6},children:e.errorMessage})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(AH,{style:{color:`#94a3b8`,fontSize:28}}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:a===`image`?`待生成图片`:n===`prompt_optimized`?`待配置视频参数`:`待生成视频`})]})]})]})})]},e.id)})})]}),(0,$.jsx)(Iq,{open:!!J,onCancel:()=>ae(null),footer:null,width:480,centered:!0,destroyOnClose:!0,closable:!1,title:null,styles:{body:{padding:0,background:`#000`,position:`relative`}},children:J&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:J,controls:!0,autoPlay:!0,style:{width:`100%`,display:`block`,maxHeight:`70vh`}}),(0,$.jsx)(`div`,{onClick:()=>ae(null),style:{position:`absolute`,top:8,right:8,width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,transition:`background 0.15s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.85)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.6)`},children:(0,$.jsx)(c4,{style:{color:`#fff`,fontSize:16}})})]})})]})},u9={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{spin:!0})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(AH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(a4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(c4,{})}},vte=()=>{let{records:e,projects:t,fetchRecords:n,fetchProjects:r,generateVideo:i}=a9(),a=e.items,[o,s]=(0,S.useState)(1),[c,l]=(0,S.useState)(10),[u,d]=(0,S.useState)({}),[f,p]=(0,S.useState)(void 0),[m,h]=(0,S.useState)(void 0),[g,_]=(0,S.useState)({}),[v,y]=(0,S.useState)(null),[b,x]=(0,S.useState)(null),[C,w]=(0,S.useState)(null);(0,S.useEffect)(()=>{r()},[r]),(0,S.useEffect)(()=>{n({projectId:f,status:m,page:o,pageSize:c})},[n,f,m,o,c]);let T=async()=>{if(!C)return;let{recordId:e,projectName:t,ratio:n,resolution:r}=C;d(t=>({...t,[e]:!0})),w(null),Z.loading({content:`「${t}」正在生成视频...`,duration:0,key:e});try{await i(e,{aspectRatio:n,resolution:r}),Z.success({content:`「${t}」视频生成成功!`,key:e,duration:3})}catch{Z.error({content:`「${t}」视频生成失败`,key:e,duration:3})}finally{d(t=>({...t,[e]:!1}))}},E=e=>{if((e.genType||`image`)===`image`){d(t=>({...t,[e.id]:!0})),Z.loading({content:`「${e.projectName}」正在生成图片...`,duration:0,key:e.id}),i(e.id,{}).then(()=>{Z.success({content:`「${e.projectName}」图片生成成功!`,key:e.id,duration:3})}).catch(()=>{Z.error({content:`「${e.projectName}」图片生成失败`,key:e.id,duration:3})}).finally(()=>{d(t=>({...t,[e.id]:!1}))});return}w({recordId:e.id,projectName:e.projectName,ratio:e.aspectRatio||`16:9`,resolution:e.resolution||`720p`})},D=a;return(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#94a3b8`},children:`查看所有视频生成记录,点击记录查看完整内容和视频`})}),(0,$.jsxs)(`div`,{className:`record-filter-bar animate-fadeInUp`,style:{display:`flex`,gap:12,marginBottom:20,padding:`14px 20px`,borderRadius:14,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(kU,{children:[(0,$.jsx)(q4,{style:{color:`#94a3b8`}}),(0,$.jsx)(uw,{placeholder:`全部项目`,allowClear:!0,style:{width:200},onChange:e=>{p(e),s(1)},children:t.map(e=>(0,$.jsx)(uw.Option,{value:e.id,children:e.name},e.id))}),(0,$.jsxs)(uw,{placeholder:`全部状态`,allowClear:!0,style:{width:140},onChange:e=>{h(e),s(1)},children:[(0,$.jsx)(uw.Option,{value:`prompt_optimized`,children:`待生成`}),(0,$.jsx)(uw.Option,{value:`generating`,children:`生成中`}),(0,$.jsx)(uw.Option,{value:`completed`,children:`已完成`}),(0,$.jsx)(uw.Option,{value:`failed`,children:`失败`})]})]}),(0,$.jsxs)(Q.Text,{style:{marginLeft:`auto`,lineHeight:`32px`,color:`#94a3b8`,fontSize:13},children:[`共 `,e.total,` 条记录`]})]}),D.length===0?(0,$.jsx)(PC,{image:PC.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:60}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:D.map((e,t)=>{let n=v===e.id,r=g[e.id]??e.optimizedPrompt,i=u[e.id],a=b===e.id,o=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.04}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>x(a?null:e.id),style:{padding:`14px 20px`,borderRadius:a?`14px 14px 0 0`:14,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:o===`image`?`#fef3c7`:`#dbeafe`},children:o===`image`?(0,$.jsx)(m6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(X8,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(EQ,{style:{color:`#6366f1`,fontSize:12,flexShrink:0}}):(0,$.jsx)(n4,{style:{color:`#cbd5e1`,fontSize:12,flexShrink:0}}),(0,$.jsx)(D$,{color:u9[e.status].color,icon:u9[e.status].icon,style:{margin:0},children:u9[e.status].text}),(0,$.jsx)(D$,{style:{background:`#f0f0ff`,border:`none`,color:`#6366f1`,margin:0},children:e.projectName}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),o===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` · `,e.imageProportion||`-`,` · `,e.imagePx||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:o9(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` · `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:o9(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(kU,{children:[e.status===`prompt_optimized`&&(0,$.jsx)(xD,{type:`primary`,size:`small`,icon:(0,$.jsx)(C6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`生成`}),e.status===`generating`&&(0,$.jsx)(D$,{color:`processing`,icon:(0,$.jsx)(Xm,{spin:!0}),style:{padding:`4px 12px`,fontSize:12},children:`生成中...`}),e.status===`failed`&&(0,$.jsx)(xD,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(C6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:8},children:`重试`})]})})]}),a&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 14px 14px`,padding:`20px 24px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词 `,e.status===`prompt_optimized`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!n&&(0,$.jsxs)(kU,{size:4,children:[(0,$.jsx)(eT,{title:`复制`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:()=>{navigator.clipboard.writeText(r),Z.success(`已复制`)},style:{color:`#94a3b8`}})}),e.status===`prompt_optimized`&&(0,$.jsx)(eT,{title:`编辑`,children:(0,$.jsx)(xD,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{y(e.id),_(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt}))},style:{color:`#6366f1`}})})]})]}),n?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(iK.TextArea,{value:r,onChange:t=>_(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(xD,{size:`small`,onClick:()=>y(null),children:`取消`}),(0,$.jsx)(xD,{size:`small`,type:`primary`,onClick:()=>{_(t=>({...t,[e.id]:r})),y(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:16,padding:`12px 16px`,borderRadius:10,background:`#f8f9fc`},children:o===`image`?[{label:`分辨率`,value:e.imageSize?`${e.imageSize} `:`-`},{label:`画面比例`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`画面尺寸`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost} `:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t)):[{label:`时长`,value:e.duration?`${e.duration} 秒`:`-`},{label:`画面比例`,value:e.aspectRatio||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`分辨率`,value:e.resolution||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost}`:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t))}),e.status===`prompt_optimized`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsx)(xD,{type:`primary`,size:`large`,icon:(0,$.jsx)(R6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:12,fontWeight:600,height:44,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.3)`},children:o===`video`?`选择参数生成视频`:`生成图片`})}),e.status===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsxs)(xD,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(C6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:12,fontWeight:600,height:44},children:[`重新生成`,o===`video`?`视频`:`图片`]})})]}),(0,$.jsx)(`div`,{style:{flex:`1 1 40%`,minWidth:240},children:e.status===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:32},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成中...`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`请耐心等待,生成完成后将自动展示`})]}):e.status===`completed`&&(e.videoUrl||e.imageUrl)?(0,$.jsxs)(`div`,{style:{borderRadius:14,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(eT,{title:`下载${o===`video`?`视频`:`图片`}`,children:(0,$.jsx)(xD,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${o===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${o===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:280,overflow:`hidden`},children:o===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,display:`block`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,display:`block`}})}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(kU,{children:[o===`video`?(0,$.jsx)(X8,{style:{color:`#6366f1`}}):(0,$.jsx)(m6,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`生成于 `,o9(e.generatedAt)]})]})]}):e.status===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(c4,{style:{color:`#ef4444`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成失败`]}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:12},children:`请在左侧点击重新生成`})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(AH,{style:{color:`#94a3b8`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[`待生成`,o===`video`?`视频`:`图片`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`点击左侧生成按钮开始生成`})]})})]})})]},e.id)})}),e.total>0&&(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:18},children:(0,$.jsx)(WK,{current:e.page||o,pageSize:e.pageSize||c,total:e.total,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{s(e),l(t)}})}),(0,$.jsx)(Iq,{title:(0,$.jsxs)(kU,{children:[(0,$.jsx)(R6,{}),`生成视频`]}),open:!!C,onCancel:()=>w(null),onOk:T,okText:`提交生成`,cancelText:`取消`,width:420,children:C&&(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:(()=>{let e=a.find(e=>e.id===C.recordId);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,children:[e?.duration||5,`秒`]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`画面比例`}),(0,$.jsx)(uw,{value:C.ratio,onChange:e=>w(t=>t?{...t,ratio:e}:null),style:{width:`100%`},options:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`].map(e=>({value:e,label:e}))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,$.jsx)(uw,{value:C.resolution,onChange:e=>w(t=>t?{...t,resolution:e}:null),style:{width:`100%`},options:[`480p`,`720p`,`1080p`].map(e=>({value:e,label:e}))})]})]})})()})})]})},d9=({value:e,duration:t=1200})=>{let[n,r]=(0,S.useState)(0),i=(0,S.useRef)(0);return(0,S.useEffect)(()=>{let a=n,o=e-a;if(o===0)return;let s=performance.now(),c=e=>{let n=e-s,l=Math.min(n/t,1);r(a+o*(1-(1-l)**3)),l<1&&(i.current=requestAnimationFrame(c))};return i.current=requestAnimationFrame(c),()=>cancelAnimationFrame(i.current)},[e]),(0,$.jsx)($.Fragment,{children:n.toLocaleString()})},yte=()=>{let{user:e}=e9(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(1),[s,c]=(0,S.useState)(10),[l,u]=(0,S.useState)(0);(0,S.useEffect)(()=>{(async()=>{i(!0);let e=await J5(a,s);n(e.records),u(e.total),i(!1)})()},[a,s]);let d=(e,t)=>{o(e),c(t)},f=t.filter(e=>e.type===`recharge`).reduce((e,t)=>e+t.amount,0),p=t.filter(e=>e.type===`consume`).reduce((e,t)=>e+Math.abs(t.amount),0);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(EJ,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(mV,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(kU,{style:{marginBottom:10},children:[(0,$.jsx)($8,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`当前可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:(0,$.jsx)(d9,{value:e?.credits??0})})]})]})}),(0,$.jsx)(mV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.06s`},children:[(0,$.jsxs)(kU,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(b2,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:(0,$.jsx)(d9,{value:f})})]})}),(0,$.jsx)(mV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.12s`},children:[(0,$.jsxs)(kU,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(m2,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:(0,$.jsx)(d9,{value:p})})]})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{animationDelay:`0.15s`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(M8,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(m$,{columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>(0,$.jsx)(D$,{color:e===`recharge`?`green`:`orange`,icon:e===`recharge`?(0,$.jsx)(b2,{}):(0,$.jsx)(m2,{}),children:e===`recharge`?`充值`:`消费`})},{title:`积分变动`,dataIndex:`amount`,key:`amount`,width:120,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`说明`,dataIndex:`description`,key:`description`},{title:`时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{color:`#94a3b8`},children:o9(e)})}],dataSource:t,rowKey:`id`,loading:r,pagination:{current:a,pageSize:s,total:l,onChange:d,showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},scroll:{x:500}})})]})]})},bte=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d()},[c]);let d=async()=>{t(!0);try{let e=await J5(c,u);r(e.records||[]),a(e.credits||0),s(e.total||0)}catch{r([])}t(!1)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(EJ,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(mV,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #f59e0b 0%, #ea580c 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)($8,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:i.toLocaleString()})]})]})}),(0,$.jsx)(mV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(E6,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount>0).reduce((e,t)=>e+t.amount,0).toLocaleString()})]})}),(0,$.jsx)(mV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(M8,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount<0).reduce((e,t)=>e+Math.abs(t.amount),0).toLocaleString()})]})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(M8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(dq,{spinning:e,children:n.length===0?(0,$.jsx)(PC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无积分变动记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m$,{dataSource:n,columns:[{title:`变动类型`,dataIndex:`type`,key:`type`,width:120,render:e=>{let t={recharge:{color:`#10b981`,label:`充值`,bg:`rgba(16,185,129,0.1)`},consume:{color:`#ef4444`,label:`消费`,bg:`rgba(239,68,68,0.1)`},admin:{color:`#f59e0b`,label:`管理员调整`,bg:`rgba(245,158,11,0.1)`},refund:{color:`#8b5cf6`,label:`退款`,bg:`rgba(139,92,246,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(D$,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`描述`,dataIndex:`description`,key:`description`,ellipsis:!0},{title:`变动积分`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt||t.create_time||t.createTime;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(WK,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})]})},xte=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(1),[c]=(0,S.useState)(10);(0,S.useEffect)(()=>{l()},[o]);let l=async()=>{t(!0);try{let e=await s7(o,c);r(e.items||[]),a(e.total||0)}catch{r([])}t(!1)};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(PU,{style:{color:`#0ea5e9`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`订单记录`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`共 `,n.length,` 条记录`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(dq,{spinning:e,children:n.length===0?(0,$.jsx)(PC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无订单记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m$,{dataSource:n,columns:[{title:`订单号`,key:`orderNo`,width:200,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:t.order_no||t.orderNo||t.id})},{title:`支付方式`,key:`paymentMethod`,width:100,render:(e,t)=>{let n=t.payment_method||t.paymentMethod||`wechat`,r={alipay:{icon:(0,$.jsx)(a2,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(a5,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(Q.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:100,render:(e,t)=>{let n=t.status||`pending`,r={pending:{color:`#f59e0b`,label:`待支付`,bg:`rgba(245,158,11,0.1)`},paid:{color:`#10b981`,label:`已支付`,bg:`rgba(16,185,129,0.1)`},refunded:{color:`#94a3b8`,label:`已退款`,bg:`rgba(148,163,184,0.1)`},failed:{color:`#ef4444`,label:`支付失败`,bg:`rgba(239,68,68,0.1)`},cancelled:{color:`#64748b`,label:`已取消`,bg:`rgba(100,116,139,0.1)`},processing:{color:`#0ea5e9`,label:`处理中`,bg:`rgba(14,165,233,0.1)`}}[n]||{color:`#64748b`,label:n,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(D$,{color:r.color,style:{background:r.bg,fontWeight:500,padding:`4px 12px`},children:r.label})}},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}},{title:`支付时间`,key:`paidAt`,width:180,render:(e,t)=>{let n=t.paid_at||t.paidAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`order_no`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(WK,{current:o,pageSize:c,total:i,onChange:e=>{s(e)},size:`small`})})]})})})]})})},Ste=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d(),f()},[c]);let d=async()=>{t(!0);try{let e=await $5(c,u);r(e.items||[]),s(e.total||0)}catch{r([])}t(!1)},f=async()=>{try{a(await e7())}catch{a(0)}},p=async e=>{try{await t7(e),d(),f()}catch{}};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(F2,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`消息中心`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`未读 `,i,` 条`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(dq,{spinning:e,children:n.length===0?(0,$.jsx)(PC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无消息`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m$,{dataSource:n,columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>{let t={system:{color:`#6366f1`,label:`系统`,bg:`rgba(99,102,241,0.1)`,icon:(0,$.jsx)(X6,{style:{fontSize:14}})},credit:{color:`#f59e0b`,label:`积分`,bg:`rgba(245,158,11,0.1)`,icon:(0,$.jsx)($8,{style:{fontSize:14}})},promo:{color:`#8b5cf6`,label:`活动`,bg:`rgba(139,92,246,0.1)`,icon:(0,$.jsx)(a3,{style:{fontSize:14}})}},n=t[e]||t.system;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:n.color},children:n.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:n.color,fontWeight:500},children:n.label})]})}},{title:`标题`,dataIndex:`title`,key:`title`,ellipsis:!0},{title:`内容`,dataIndex:`content`,key:`content`,ellipsis:!0},{title:`状态`,dataIndex:`isRead`,key:`isRead`,width:80,render:(e,t)=>e??t.is_read?(0,$.jsx)(D$,{color:`gray`,style:{background:`rgba(148,163,184,0.1)`},children:`已读`}):(0,$.jsx)(D$,{color:`purple`,style:{background:`rgba(139,92,246,0.1)`},children:`未读`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>{if(!e)return`-`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/(1e3*60*60));if(r<1)return`刚刚`;if(r<24)return`${r}小时前`;let i=Math.floor(r/24);return i<7?`${i}天前`:t.toLocaleDateString(`zh-CN`)}},{title:`操作`,key:`action`,width:100,render:(e,t)=>t.isRead??t.is_read?null:(0,$.jsx)(xD,{type:`text`,size:`small`,onClick:()=>p(t.id),style:{color:`#6366f1`},children:`标记已读`})}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(WK,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})})},f9=()=>{let[e]=Dn(),[t,n]=(0,S.useState)(`credits`);return(0,S.useEffect)(()=>{(e.get(`tab`)||`credits`)===`orders`?n(`orders`):n(`credits`)},[e]),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(gz,{activeKey:t,onChange:n,items:[{key:`credits`,label:`积分明细`},{key:`orders`,label:`订单记录`}],style:{marginBottom:24},size:`large`}),t===`credits`&&(0,$.jsx)(bte,{}),t===`orders`&&(0,$.jsx)(xte,{})]})},Cte=`/assets/bg1-CQh9PRPW.png`,wte=`/assets/bg2-CNoKndHs.png`,{Header:Tte,Sider:Ete,Content:Dte}=pK,{TextArea:Ote}=iK,{Option:p9}=uw,{Text:m9}=Q,kte=()=>{let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(`1`),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(``),{mediaType:c,countType:l,selectedRatio:u,selectedResolution:d,width:f,height:p,videoDuration:m,videoAspectRatio:h,videoResolution:g,engineOptions:_,enginesele:v,setMediaType:y,setCountType:b,setSelectedRatio:x,setSelectedResolution:C,setWidth:w,setHeight:T,setVideoDuration:E,setVideoAspectRatio:D,setVideoResolution:O,setEngineOptions:k,setEnginesele:A}=a9(),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(``),[V,H]=(0,S.useState)(`image`),U=(0,S.useRef)(null),[ee,te]=(0,S.useState)(new Set),ne=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},W=e=>{let t=ne(e);return t?Math.floor(Date.now()/1e3)>t:!1},[re,G]=(0,S.useState)(!1),[K,q]=(0,S.useState)(``),[ie,J]=(0,S.useState)(`image`),[ae,oe]=(0,S.useState)(``),[se,ce]=(0,S.useState)(!1),[le,ue]=(0,S.useState)(null),[de,fe]=(0,S.useState)({x:0,y:0}),[pe,me]=(0,S.useState)(!1),[he,ge]=(0,S.useState)(!1),[_e,ve]=(0,S.useState)([]),[ye,be]=(0,S.useState)([]),[xe,Se]=(0,S.useState)([]),[Ce,we]=(0,S.useState)(0),[Te,Ee]=(0,S.useState)(0),[De,Oe]=(0,S.useState)(!1),[ke,Ae]=(0,S.useState)([]),[je,Me]=(0,S.useState)([]),[Ne,Pe]=(0,S.useState)([]),Fe=()=>{let e={};return e=Ne.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?g:d)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1},g===`1080p`?e.ratio=2:g===`720p`?e.ratio=1.5:g===`480p`&&(e.ratio=1)):(e={perSecondCredits:.1,baseCredits:4,ratio:1},d===`2K`?e.ratio=1:d===`4K`&&(e.ratio=2))),c===`video`?Math.round((m*e.perSecondCredits+e.baseCredits)*e.ratio):e.baseCredits*e.ratio},Ie=(0,S.useRef)(null),Le=(0,S.useRef)(null),Re=(0,S.useRef)(null);(0,S.useRef)(!0),i.find(e=>e.id===n);let[ze,Be]=(0,S.useState)([]),[Ve,He]=(0,S.useState)({page:1,pageSize:20}),[Ue,We]=(0,S.useState)(0),[Ge,Ke]=(0,S.useState)(!1),qe=(0,S.useRef)(!1),Je=(0,S.useCallback)((e=`instant`)=>{let t=Le.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})})},[]);(0,S.useEffect)(()=>{if(ze.length>0&&!qe.current){let e=setTimeout(()=>{Je(`smooth`),qe.current=!0},300);return()=>clearTimeout(e)}},[ze.length,Je]),(0,S.useEffect)(()=>{let e=c===`image`?v.image:v.video;e&&e.length>0&&(e.some(e=>e.id===l)||b(e[0].id))},[c,v]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;De&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&Oe(!1),pe&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&me(!1),he&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ge(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[De,pe,he]),(0,S.useEffect)(()=>{d7().then(e=>{if(A(e.engine),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;k({ratios:n.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:n.supportedResolutions||[`480p`,`720p`,`1080p`],durations:n.supportedDurations||[5,8,10,12,15]}),n.supportedRatios?.includes(h)||D(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(g)||O(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(m)||E(n.supportedDurations?.[0]||5),l===`请选择`&&b(n.id)}}).catch(()=>{}),u7().then(e=>{Ae(e.video||[]),Me(e.image||[])}).catch(e=>{}),_7().then(e=>{Pe(e)}),p7(Ve).then(e=>{let t=e.items,n=e.total;Be(t),We(n)}),Z5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);ve(n.map((e,t)=>({value:e,label:String(t)})));for(let e in t[`4K`])i.push(t[`4K`][e]);Se([r,i]),be([{value:`2K`,label:`高清 2K`},{value:`4K`,label:`超清 4K`}])}).catch(()=>{})},[]),(0,S.useEffect)(()=>{if(Re.current&&=(clearInterval(Re.current),null),ze.some(e=>e.status===`generating`))return Re.current=window.setInterval(()=>{p7(Ve).then(e=>{Be(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),We(e.total)}).catch(e=>{})},1e4),()=>{Re.current&&=(clearInterval(Re.current),null)}},[ze,Ve]),(0,S.useEffect)(()=>{if(!pe)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&me(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[pe]),(0,S.useEffect)(()=>{if(!he)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ge(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[he]),(0,S.useEffect)(()=>{xe[Te]&&xe[Te][Ce]!==void 0&&(w(Number(xe[Te][Ce].substring(0,4))),T(Number(xe[Te][Ce].substring(5))))},[Ce]),(0,S.useEffect)(()=>{xe[Te]&&xe[Te][Ce]!==void 0&&(w(Number(xe[Te][Ce].substring(0,4))),T(Number(xe[Te][Ce].substring(5))))},[Te]);let Ye=e=>{we(e)},Xe=e=>{Ee(parseInt(e===`2K`?`0`:`1`))},Ze=()=>{w(p),T(f)},Qe=async()=>{if(!o.trim()&&F.length===0){Z.warning(`请输入内容或上传图片/视频`);return}let e={id:``,gen_type:c,original_prompt:o.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),media_references:F.length>0?[...F]:void 0,...c===`image`&&{image_size:d,image_proportion:u,image_px:f+`x`+p},...c===`video`&&{duration:m,aspect_ratio:h,resolution:g}};P(!0),f7(e).then(()=>{s(``),I([]);let e={...Ve,page:1};He(e),p7(e).then(e=>{Be(t=>[...t,e.items[e.items.length-1]]),We(e.total),setTimeout(()=>{Ie.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(e=>{let t=`创建任务失败`;e?.response?.data?.detail?t=e.response.data.detail:e?.data?.detail?t=e.data.detail:e?.detail?t=e.detail:e?.message&&(t=e.message),Z.error({content:t,duration:3})}).finally(()=>{P(!1)}),setTimeout(()=>{P(!1)},3e3)},$e=async()=>{if(ze.length>=Ue)return;let e=Le.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;Ke(!0);try{let r=Ve.page+1,i=await p7({...Ve,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&We(a.total),He(e=>({...e,page:r})),Be(e=>{let t=new Set(e.map(e=>e.id));return[...a.items.filter(e=>!e.id||t.has(e.id)?!1:(t.add(e.id),!0)),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{Ke(!1)}},et=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Z.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Z.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=F.filter(e=>e.type===`image`).length;if(t&&i>=4)return Z.error(`最多上传4张图片`),!1;let a=F.filter(e=>e.type===`video`).length;if(n&&a>=1)return Z.error(`最多上传1个视频`),!1;M(!0);try{let n=await(t?U5:W5)(e);I(r=>[...r,{name:e.name,type:t?`image`:`video`,url:n.url}]),Z.success(`${t?`图片`:`视频`}上传成功`)}catch{Z.error(`上传失败`)}finally{M(!1)}return!1},tt=e=>{I(t=>t.filter((t,n)=>n!==e))},nt=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Qe())},rt=()=>{R(!1),B(``),U.current&&U.current.pause()},it=e=>{if(e.preventDefault(),e.stopPropagation(),!z)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${z}&download=1`,t.download=V===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)};return(0,$.jsxs)(pK,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,background:`linear-gradient(135deg, #f8fafc 0%, #f0f4ff 50%, #faf5ff 100%)`,backgroundImage:`url(${wte})`,backgroundRepeat:`no-repeat`,backgroundSize:`100% 100%`,backgroundPosition:`center`},children:[!1,(0,$.jsxs)(pK,{style:{display:`flex`,flex:1,background:`transparent`},children:[(0,$.jsx)(Tte,{style:{borderRadius:`20px 20px 0 0`,background:`rgba(255,255,255,0.1)`,backdropFilter:`blur(20px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 24px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(F6,{style:{fontSize:18,color:`#fff`}})}),(0,$.jsx)(`div`,{children:(0,$.jsx)(m9,{strong:!0,style:{fontSize:16,background:`linear-gradient(90deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`开启创作`})})]})}),(0,$.jsxs)(Dte,{style:{flex:1,margin:0,padding:24,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[ze.length===0&&(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:50,background:`linear-gradient(135deg, #6366f1 0%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(F6,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#333`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#999`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),ze.length>0&&(0,$.jsxs)(`div`,{ref:Le,style:{flex:1,overflowY:`auto`,paddingRight:8},children:[(0,$.jsx)(`div`,{style:{padding:`8px 0`,textAlign:`center`,marginBottom:16},children:ze.length>=Ue?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#999`},children:`消息全部加载`}):(0,$.jsx)(`button`,{onClick:$e,disabled:Ge,style:{fontSize:12,color:`#6366f1`,background:`none`,border:`none`,cursor:Ge?`not-allowed`:`pointer`},children:Ge?`加载中...`:`加载更多`})}),(()=>{let e=Z;return ze.map(t=>(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,marginBottom:16},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},children:(0,$.jsx)(F6,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:`16px 16px 16px 4px`,padding:`12px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0,0,0,0.04)`,position:`relative`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#999`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:t.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:t.genType===`image`?`rgba(34, 197, 94, 0.12)`:`rgba(249, 115, 22, 0.12)`,color:t.genType===`image`?`#22c55e`:`#f97316`,padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:t.genType===`image`?`图片生成`:`视频生成`})]}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(Bq,{title:`确定要删除吗?`,onConfirm:async()=>{try{await g7(t.id),e.success(`删除成功`),Be(e=>e.filter(e=>e.id!==t.id)),We(e=>e-1)}catch(t){let n=t?.response?.data?.message||t?.message||`删除失败`;e.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(`button`,{onClick:e=>e.stopPropagation(),style:{width:28,height:28,borderRadius:8,border:`none`,background:`rgba(99, 102, 241, 0.08)`,color:`#6366f1`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,padding:0},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.08)`,e.currentTarget.style.color=`#6366f1`},children:(0,$.jsx)(A$,{style:{fontSize:12}})})})}),(t.status===`generating`||t.status===`failed`||t.status===`completed`)&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16,marginTop:16,width:`100%`,alignItems:`flex-start`},children:[(0,$.jsx)(`div`,{style:{width:`50%`,overflow:`hidden`,borderRadius:12,position:`relative`,height:220,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%)`},children:t.status===`generating`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:12,left:12,display:`flex`,alignItems:`center`,gap:8,zIndex:2}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%)`,animation:`shimmer 2s infinite`}}),(0,$.jsxs)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:`50%`,background:`rgba(99, 102, 241, 0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 0 30px rgba(99, 102, 241, 0.2)`},children:(0,$.jsx)(`div`,{style:{width:48,height:48,border:`3px solid #c7d2fe`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500},children:`生成中...`})]})]}):t.status===`failed`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:`50%`,background:`rgba(254, 226, 226, 0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(n5,{style:{color:`#ef4444`,fontSize:22}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#94a3b8`},children:`生成失败`})]}):(0,$.jsx)($.Fragment,{children:t.genType===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${t.imageUrl}&w=300&p=50`,alt:t.name,style:{width:`100%`,height:`100%`,borderRadius:12,objectFit:`contain`,cursor:`pointer`,transition:`transform 0.3s ease`},onClick:()=>{B(t.imageUrl),H(`image`),R(!0)},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${t.videoCoverUrl}&w=300&p=50`,alt:t.name,style:{width:`100%`,height:`100%`,borderRadius:12,objectFit:`contain`,cursor:`pointer`,transition:`transform 0.3s ease`},onClick:()=>{B(t.videoUrl),H(`video`),R(!0)},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:56,height:56,background:`rgba(99, 102, 241, 0.85)`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.4)`},children:(0,$.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})]})})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:12,padding:12,border:`1px solid rgba(99, 102, 241, 0.08)`,flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`p`,{style:{width:`100%`,height:150,overflow:`auto`,padding:0,marginTop:0,marginBottom:0,lineHeight:2,color:`#475569`,fontSize:13},children:t.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#64748b`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#6366f1`,fontWeight:500},children:t.engineSnapshot.name}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#64748b`},children:t.genType===`image`?`${t.imageProportion||``} · ${t.imagePx||``} · ${t.imageSize||``}`:`${t.duration||``}s · ${t.aspectRatio||``} · ${t.resolution||``}`}),(0,$.jsxs)(`span`,{style:{borderRadius:16,color:`#ef4444`,fontWeight:500},children:[`消耗积分:`,t.creditsCost]})]})]})]}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:t.mediaReferences&&t.mediaReferences.length>0&&(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#6366f1`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.04)`},onClick:e=>{e.stopPropagation();let n=e.currentTarget.getBoundingClientRect();fe({x:n.left,y:n.top-10}),ue(t.id),ce(!0)},children:`附件详情`})})]})})]})},t.id))})(),(0,$.jsx)(`div`,{ref:Ie})]}),se&&le&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{ce(!1),ue(null)}}),(0,$.jsxs)(`div`,{style:{position:`fixed`,top:de.y-100,left:de.x,background:`#fff`,borderRadius:12,boxShadow:`0 4px 20px rgba(0,0,0,0.15)`,padding:16,minWidth:200,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500},children:`附件列表`}),(0,$.jsx)(`button`,{onClick:()=>{ce(!1),ue(null)},style:{width:24,height:24,borderRadius:`50%`,border:`none`,background:`#ff4d4f`,cursor:`pointer`,fontSize:14,color:`#fff`,fontWeight:`bold`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`#ff7875`,e.currentTarget.style.transform=`scale(1.1)`},onMouseLeave:e=>{e.currentTarget.style.background=`#ff4d4f`,e.currentTarget.style.transform=`scale(1)`},children:`×`})]}),ze.find(e=>e.id===le)?.mediaReferences?.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>{q(e.url),J(e.url.includes(`.mp4`)||e.url.includes(`.mov`)||e.url.includes(`.avi`)||e.url.includes(`.video`)?`video`:`image`),oe(e.name),G(!0),ce(!1),ue(null)},style:{display:`flex`,alignItems:`center`,gap:8,padding:`8px 12px`,borderRadius:6,cursor:`pointer`,fontSize:13,color:`#333`,transition:`background 0.2s`},onMouseEnter:e=>e.currentTarget.style.background=`#f5f5f5`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[e.type===`image`?(0,$.jsx)(m6,{style:{color:`#3b82f6`,fontSize:14}}):(0,$.jsx)(X8,{style:{color:`#f59e0b`,fontSize:14}}),e.name]},t))]})]}),(0,$.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.1)`,backdropFilter:`blur(20px)`,borderRadius:24,padding:16,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(0,0,0,0.04)`,transition:`all 0.3s ease`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[F.length>0&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,overflowX:`auto`},children:F.map((e,t)=>(0,$.jsxs)(`div`,{style:{position:`relative`,width:e.type===`video`?120:80,flexShrink:0},children:[e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,alt:e.name,style:{width:`100%`,height:80,objectFit:`cover`,borderRadius:8}}):(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:80,objectFit:`cover`,borderRadius:8}}),(0,$.jsx)(`button`,{onClick:()=>tt(t),style:{position:`absolute`,top:0,right:0,width:20,height:20,border:`none`,background:`#ff4d4f`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:12,display:`flex`,alignItems:`center`,justifyContent:`center`},children:`×`})]},`media-${t}`))}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`12px 16px`,backgroundColor:`rgba(248,250,252,0.6)`,borderRadius:16,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,transition:`all 0.2s ease`},children:[(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,beforeUpload:et,children:(0,$.jsx)(eT,{title:`图片${F.filter(e=>e.type===`image`).length}/4,视频${F.filter(e=>e.type===`video`).length}/1`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:14,border:`2px dashed rgba(99, 102, 241, 0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,flexShrink:0,backgroundColor:`rgba(255,255,255,0.7)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.backgroundColor=`rgba(99, 102, 241, 0.06)`,e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.backgroundColor=`rgba(255,255,255,0.7)`,e.currentTarget.style.transform=`scale(1)`},children:j?(0,$.jsx)(Xm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(vR,{style:{fontSize:18,color:`#64748b`}})})})}),(0,$.jsx)(Ote,{value:o,onChange:e=>s(e.target.value),onKeyPress:nt,placeholder:`上传最多4张参考图,输入提示词描述您想生成的画面...`,autoSize:{minRows:1,maxRows:4},style:{flex:1,height:`100%`,borderRadius:12,border:`none`,outline:`none`,boxShadow:`none`,fontSize:14,lineHeight:1.5,color:`#1e293b`},disabled:N}),(0,$.jsx)(xD,{type:`primary`,shape:`circle`,icon:(0,$.jsx)(q6,{}),onClick:Qe,disabled:!o.trim()&&F.length===0,loading:N,style:{flexShrink:0,width:48,height:48,borderRadius:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.2s ease`,border:`none`}})]}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:12,paddingTop:12,borderTop:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsxs)(kU,{size:`middle`,children:[(0,$.jsxs)(uw,{value:c,onChange:e=>y(e),style:{width:100,height:34,outline:`none`,border:`none`,backgroundColor:`#f1f5f9`,borderRadius:10},size:`middle`,children:[(0,$.jsxs)(p9,{value:`image`,children:[(0,$.jsx)(m6,{style:{marginRight:6,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:`图片`})]}),(0,$.jsxs)(p9,{value:`video`,children:[(0,$.jsx)(X8,{style:{marginRight:6,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:`视频`})]})]}),(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>Oe(!0),className:`image-settings-trigger`,style:{minWidth:200,padding:`6px 14px`,height:34,borderRadius:10,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`0 4px 12px rgba(99, 102, 241, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.15)`,e.currentTarget.style.boxShadow=`0 2px 8px rgba(99, 102, 241, 0.04)`},children:[(0,$.jsx)(X6,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(m9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:c===`image`?v.image?.find(e=>e.id===l)?.name:v.video?.find(e=>e.id===l)?.name||`选择引擎`})]}),De&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:360,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:600,color:`#475569`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:(c===`image`?v.image:v.video)?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{b(e.id),c===`video`&&(k({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(h)||D(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(g)||O(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(m)||E(e.supportedDurations?.[0]||5)),Oe(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:l===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:l===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:l===e.id?600:500,color:l===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),c===`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>me(!pe),className:`image-settings-trigger`,style:{minWidth:220,padding:`4px 12px`,height:34,borderRadius:8,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(M3,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsxs)(m9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[u===`auto`?`智能`:u,` · `,d==`2K`?`2K高清`:`4K超清`,` · `,f,`×`,p]})]}),pe&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:480,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:_e.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{x(e.value),Ye(e.label)},style:{flex:`0 0 calc(11.11% - 4px)`,minWidth:44,height:52,borderRadius:6,border:u===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:u===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:e.value===`auto`?14:18,height:e.value===`auto`?14:18,border:`2px solid ${u===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:7,color:u===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:9,color:u===e.value?`#6366f1`:`#6b7280`,fontWeight:u===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ye.map(e=>(0,$.jsx)(`button`,{onClick:()=>{C(e.value),Xe(e.value)},style:{flex:1,height:42,borderRadius:6,border:d===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:d===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,color:d===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4K`&&(0,$.jsx)(`span`,{style:{marginLeft:2},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:120},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11,marginRight:4},children:`W`}),(0,$.jsx)(iK,{value:f,onChange:e=>w(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:4,height:34,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:12,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:Ze,style:{width:24,height:24,borderRadius:4,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(cG,{style:{fontSize:10}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:120},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11,marginRight:4},children:`H`}),(0,$.jsx)(iK,{value:p,onChange:e=>T(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:4,height:34,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:12,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11},children:`PX`})]})]})]})]}),c===`video`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>ge(!he),className:`image-settings-trigger`,style:{minWidth:220,padding:`4px 12px`,height:34,borderRadius:8,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(M3,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsxs)(m9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[h,` · `,m,`s · `,g]})]}),he&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:400,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:_.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>D(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:h===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:h===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${h===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:h===e?`#6366f1`:`#6b7280`,fontWeight:h===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(m-Math.min(..._.durations))/(Math.max(..._.durations)-Math.min(..._.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(..._.durations),max:Math.max(..._.durations),value:m,onChange:e=>E(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:m}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(m9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:_.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>O(e),style:{flex:1,height:42,borderRadius:6,border:g===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:g===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:g===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,backgroundColor:`rgba(99, 102, 241, 0.06)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(m9,{style:{fontSize:13,color:`#6366f1`,fontWeight:500},children:`预估积分`}),(0,$.jsx)(m9,{style:{fontSize:14,color:`#6366f1`,fontWeight:600},children:Fe()})]})]})})]})]})]}),(0,$.jsx)(`style`,{children:` @keyframes blink { 0%, 50% { opacity: 1; } diff --git a/video-gen-app/dist/index.html b/video-gen-app/dist/index.html index c9cc8146..33e049cc 100644 --- a/video-gen-app/dist/index.html +++ b/video-gen-app/dist/index.html @@ -28,7 +28,7 @@ } })(); - + diff --git a/video-gen-app/src/App.css b/video-gen-app/src/App.css index 0aa9e8bf..d8d6df25 100644 --- a/video-gen-app/src/App.css +++ b/video-gen-app/src/App.css @@ -202,7 +202,7 @@ display: flex; flex-direction: column; justify-content: center; - padding: 40px 24px; + padding: 32px 16px; z-index: 1; } @@ -230,7 +230,7 @@ align-items: center; justify-content: center; z-index: 1; - padding: 20px 24px 40px; + padding: 16px 16px 32px; } @media (min-width: 900px) { @@ -238,3 +238,14 @@ padding: 40px 24px; } } + +@media (max-width: 480px) { + .login-left-section { + padding: 24px 12px; + text-align: center; + } + + .login-right-section { + padding: 12px 12px 24px; + } +} diff --git a/video-gen-app/src/components/Layout/AppLayout.tsx b/video-gen-app/src/components/Layout/AppLayout.tsx index 419bd2a0..ef641563 100644 --- a/video-gen-app/src/components/Layout/AppLayout.tsx +++ b/video-gen-app/src/components/Layout/AppLayout.tsx @@ -505,13 +505,21 @@ const AppLayout: React.FC = () => { display: 'flex', alignItems: 'center', justifyContent: 'flex-start', gap: 10, - padding: depth > 0 ? '6px 12px 6px 32px' : '6px 14px', - borderRadius: 12, margin: '1px 4px', cursor: 'pointer', + padding: depth > 0 ? '8px 12px 8px 32px' : '8px 14px', + borderRadius: 12, margin: '2px 4px', cursor: 'pointer', fontSize: depth > 0 ? 13 : 14, fontWeight: isActive ? 600 : 400, color: isActive ? '#4f46e5' : '#475569', background: isActive ? 'linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)' : 'transparent', transition: 'all 0.2s ease', }} + onMouseEnter={(e) => { + e.currentTarget.style.background = 'rgba(99, 102, 241, 0.05)'; + }} + onMouseLeave={(e) => { + if (!isActive) { + e.currentTarget.style.background = 'transparent'; + } + }} > 0 ? 14 : 16, @@ -546,23 +554,51 @@ const AppLayout: React.FC = () => { topLevelItems.forEach(item => { const menuType = item.menu_type ?? item.menuType; - + const hasChildren = childMap[item.id] && childMap[item.id].length > 0; + const isExpanded = collapsedGroups[item.id] !== true; + if (menuType === 'group') { items.push(
-
- {item.label} +
{ + setCollapsedGroups(prev => ({ + ...prev, + [item.id]: !prev[item.id] + })); + }} + style={{ + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + color: '#94a3b8', fontSize: 12, fontWeight: 600, + padding: '10px 14px 4px', letterSpacing: 0.5, textTransform: 'uppercase', + cursor: 'pointer', + }} + > + {item.label} + + +
- {(childMap[item.id] || []).sort((a, b) => { - const orderA = typeof a.sortOrder === 'number' ? a.sortOrder : Infinity; - const orderB = typeof b.sortOrder === 'number' ? b.sortOrder : Infinity; - return orderA - orderB; - }).map(c => renderMenuItem(c, 1))} + {isExpanded && ( +
+ {(childMap[item.id] || []).sort((a, b) => { + const orderA = typeof a.sortOrder === 'number' ? a.sortOrder : Infinity; + const orderB = typeof b.sortOrder === 'number' ? b.sortOrder : Infinity; + return orderA - orderB; + }).map(c => renderMenuItem(c, 1))} +
+ )}
); + } else if (hasChildren) { + items.push(renderMenuItem(item)); } else { items.push(renderMenuItem(item)); } diff --git a/video-gen-app/src/pages/LoginPage.tsx b/video-gen-app/src/pages/LoginPage.tsx index de16ed78..d478f0b2 100644 --- a/video-gen-app/src/pages/LoginPage.tsx +++ b/video-gen-app/src/pages/LoginPage.tsx @@ -372,10 +372,10 @@ const LoginPage: React.FC = () => { {/* Right side - login/register form */}
+ }} styles={{ body: { padding: '24px 20px' } }}> {mode === 'register' ? '创建账号' : '欢迎回来'}