diff --git a/video-gen-app/dist/assets/index-Bkv0KkOY.js b/video-gen-app/dist/assets/index-D_n_SkaH.js similarity index 86% rename from video-gen-app/dist/assets/index-Bkv0KkOY.js rename to video-gen-app/dist/assets/index-D_n_SkaH.js index 3f198cf6..0ecfa0d6 100644 --- a/video-gen-app/dist/assets/index-Bkv0KkOY.js +++ b/video-gen-app/dist/assets/index-D_n_SkaH.js @@ -403,7 +403,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0% { opacity: 0; transform: translateY(20px) scale(0.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } } - `})]})},d7=({data:e})=>{if(!e)return null;let t=(e.limitUnit||`GB`).toUpperCase(),n=t===`GB`?1024**3:t===`MB`?1024**2:1024,r=Number(e.usagePercent)||0,i=Math.min(100,Math.max(0,r)),a=e.limitValue?parseFloat(e.limitValue):e.totalBytes/n,o=a*r/100;a-o;let s=e.exceeded||r>=100,c=1024**2,l=1024**3,u=1024**4,d=(e=>{let t=Number(e)||0;return t>=u?{val:(t/u).toFixed(2),unit:`TB`}:t>=l?{val:(t/l).toFixed(2),unit:`GB`}:t>=c?{val:(t/c).toFixed(2),unit:`MB`}:{val:(t/1024).toFixed(2),unit:`KB`}})(e.usedBytes);return(0,$.jsxs)(`div`,{style:{marginBottom:12,padding:`0 12px`,paddingTop:6,borderRadius:10,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)`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:6,fontSize:12,color:`#475569`},children:e.enabled?(0,$.jsx)($.Fragment,{}):(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#1e293b`},children:[(0,$.jsx)(K4,{style:{fontSize:12,color:s?`#ef4444`:`#6366f1`,marginRight:4}}),`当前使用 `,d.val,` `,d.unit]})}),e.enabled&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginTop:4,display:`flex`,justifyContent:`space-between`,fontSize:11,color:s?`#ef4444`:`#94a3b8`},children:(0,$.jsxs)(`div`,{style:{height:`100%`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:6,fontSize:12,color:`#000000ff`,padding:`0 8px`},children:[(0,$.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(K4,{style:{fontSize:12,color:`#000000ff`}}),r.toFixed(1),`%`]}),e.enabled?(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#000000ff`},children:[o.toFixed(2),` / `,a.toFixed(2),` `,t]}):(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#1e293b`},children:[`当前使用 `,d.val,` `,d.unit]})]})}),(0,$.jsx)(`div`,{style:{width:`100%`,height:6,background:`#e2e8f0`,borderRadius:50,overflow:`hidden`,position:`relative`},children:(0,$.jsx)(`div`,{style:{width:`${i}%`,height:`100%`,background:r<50?`linear-gradient(90deg, #279951, #b7fad0)`:r<85?`linear-gradient(90deg, #ffd759, #fff6d4)`:`linear-gradient(90deg, #ef4444, #dc2626)`,borderRadius:2,transition:`width 0.4s ease`}})})]})]})},f7={HomeOutlined:(0,$.jsx)(O3,{}),DashboardOutlined:(0,$.jsx)(U4,{}),CodeOutlined:(0,$.jsx)(T4,{}),PlayCircleOutlined:(0,$.jsx)(K6,{}),WalletOutlined:(0,$.jsx)(Q8,{}),SettingOutlined:(0,$.jsx)(x8,{}),BellOutlined:(0,$.jsx)(B2,{}),UserOutlined:(0,$.jsx)(J8,{}),AppstoreOutlined:(0,$.jsx)(p2,{}),FileTextOutlined:(0,$.jsx)(eH,{}),StarOutlined:(0,$.jsx)(N8,{}),HeartOutlined:(0,$.jsx)(y3,{}),CameraOutlined:(0,$.jsx)(t4,{}),RobotOutlined:(0,$.jsx)(s8,{}),CalculatorOutlined:(0,$.jsx)(Q2,{}),DollarOutlined:(0,$.jsx)(Y4,{}),GiftOutlined:(0,$.jsx)(p3,{}),ThunderboltOutlined:(0,$.jsx)(z8,{}),FireOutlined:(0,$.jsx)(s3,{}),CloudOutlined:(0,$.jsx)(g4,{}),SmileOutlined:(0,$.jsx)(O8,{}),TrophyOutlined:(0,$.jsx)(H8,{}),RocketOutlined:(0,$.jsx)(u8,{}),BulbOutlined:(0,$.jsx)(Y2,{}),PictureOutlined:(0,$.jsx)(L6,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),AudioOutlined:(0,$.jsx)(O2,{}),MailOutlined:(0,$.jsx)(i6,{}),PhoneOutlined:(0,$.jsx)(P6,{}),GlobalOutlined:(0,$.jsx)(g3,{}),ShoppingCartOutlined:(0,$.jsx)(C8,{}),TeamOutlined:(0,$.jsx)(L8,{}),BarChartOutlined:(0,$.jsx)(L2,{}),PieChartOutlined:(0,$.jsx)(B6,{}),LineChartOutlined:(0,$.jsx)(K3,{}),SecurityScanOutlined:(0,$.jsx)(y8,{}),ApiOutlined:(0,$.jsx)(u2,{}),DatabaseOutlined:(0,$.jsx)(K4,{}),CloudServerOutlined:(0,$.jsx)(y4,{})},woe=240,p7=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(bq,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(i3,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(L4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(j2,{})}],Toe=()=>{let e=Je(),t=Ge(),{user:n,logout:r,refreshUser:i,setOptimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f]=UH.useForm(),[p]=UH.useForm(),[m,h]=(0,S.useState)(null),[g,_]=(0,S.useState)([]),[v,y]=(0,S.useState)([]),[b,x]=(0,S.useState)(0),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=UH.useForm(),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(()=>({x:24,y:window.innerHeight*.75})),[M,N]=(0,S.useState)(!1),P=(0,S.useRef)(!1),F=(0,S.useRef)({x:0,y:0}),[I,L]=(0,S.useState)({}),[R,z]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[B,V]=(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}),[H,U]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[W,G]=(0,S.useState)(!1),[K,ee]=(0,S.useState)(null),[q,te]=(0,S.useState)(`alipay`),[ne,re]=(0,S.useState)(!1),[ie,J]=(0,S.useState)(180),ae=(0,S.useRef)(null),oe=(0,S.useRef)(null),se=(0,S.useRef)(null),[ce,le]=(0,S.useState)({alipay:!1,wechat:!1}),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),ge=`pending_payment_order`;(0,S.useEffect)(()=>{E5().then(e=>{let t=e.siteName||`民众智创`,n=e.siteLogo||``;if(t!==R&&(z(t),document.title=t),n&&n!==B){V(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`}e.operationManual&&he(e.operationManual),e.optimizeHoldCredits!==void 0&&a(e.optimizeHoldCredits),localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(e=>{}),g5().then(e=>{let t=e?.resourceCapacity;t&&de({enabled:!!t.enabled,usedBytes:Number(t.usedBytes)||0,totalBytes:Number(t.totalBytes)||0,availableBytes:Number(t.availableBytes)||0,usagePercent:Number(t.usagePercent)||0,exceeded:!!t.exceeded,limitValue:t.limitValue??``,limitUnit:t.limitUnit||`GB`})}).catch(e=>{})},[]),(0,S.useEffect)(()=>{let e=()=>pe(window.innerWidth<=767);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let _e=e=>{e.button===0&&(N(!0),P.current=!1,F.current={x:e.clientX,y:e.clientY})},ve=e=>{if(!M)return;let t=Math.abs(e.clientX-F.current.x),n=Math.abs(e.clientY-F.current.y);(t>5||n>5)&&(P.current=!0);let r=Math.max(60,Math.min(window.innerHeight-60,e.clientY-(F.current.y-A.y)));j(e=>({x:e.x,y:r}))},ye=()=>{let e=P.current;N(!1),P.current=!1,e||d(!0)};(0,S.useEffect)(()=>{if(M)return document.addEventListener(`mousemove`,ve),document.addEventListener(`mouseup`,ye),()=>{document.removeEventListener(`mousemove`,ve),document.removeEventListener(`mouseup`,ye)}},[M]);let be=()=>{k5().then(e=>{x(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(ge);if(e)try{let t=JSON.parse(e),n=await M5(t.orderNo);if(n.status===`pending`){ee({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),se.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?(G(!0),Ne(t.orderNo,a)):localStorage.removeItem(ge)}else n.status===`paid`?(Q.success(`支付成功!积分已到账`),l7.getState().refreshUser(),localStorage.removeItem(ge)):localStorage.removeItem(ge)}catch{localStorage.removeItem(ge)}})()},[]),(0,S.useEffect)(()=>{Qie().then(e=>{_(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),$ie().then(e=>{y(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),eae().then(e=>{le(e),e.alipay?te(`alipay`):e.wechat&&te(`wechat`)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{n&&be()},[n?.id,n?.credits]);let xe=t.pathname.startsWith(`/records`)?`/records`:t.pathname,Se=woe,Ce={};g.forEach(e=>{let t=e.parent_id??e.parentId;t&&(Ce[t]||(Ce[t]=[]),Ce[t].push(e))});let we=g.filter(e=>!(e.parent_id??e.parentId));we.sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)),Object.keys(Ce).forEach(e=>{Ce[e].sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0))});let Te=t=>{let n=t.menu_type??t.menuType,r=Ce[t.id]&&Ce[t.id].length>0;n===`group`||r?L(e=>({...e,[t.id]:!e[t.id]})):t.path&&(e(t.path),w(!1))},Ee=[{key:`profile`,icon:(0,$.jsx)(J8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)(Q8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},...n?.isTeamManager?[{key:`teamManagement`,icon:(0,$.jsx)(L8,{style:{color:`#6366f1`}}),label:`团队管理`}]:[],{key:`myCredits`,icon:(0,$.jsx)(Q8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(eH,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(B2,{}),label:`消息中心${b>0?`(${b})`:``}`},...me?[{key:`manual`,icon:(0,$.jsx)(eH,{}),label:`操作手册`}]:[],{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(Y3,{}),label:`个人信息`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(t6,{}),label:`退出登录`,danger:!0}],De=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?s(!0):t===`messages`?e(`/messages`):t===`recharge`?l(!0):t===`teamManagement`?e(`/team-management`):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`?e(`/user-center?tab=orders`):t===`manual`&&window.open(me,`_blank`)},Oe=async()=>{try{let e=await f.validateFields();await _5(e.oldPwd,e.newPwd),Q.success(`密码修改成功`),s(!1),f.resetFields()}catch(e){e?.response?.data?.detail?Q.error(e.response.data.detail):e?.message&&Q.error(e.message)}},ke=async()=>{try{let e=await Pie((await p.validateFields()).username);Q.success(e.message||`操作成功`),await i(),g5().then(e=>{let t=e?.resourceCapacity;t&&de({enabled:!!t.enabled,usedBytes:Number(t.usedBytes)||0,totalBytes:Number(t.totalBytes)||0,availableBytes:Number(t.availableBytes)||0,usagePercent:Number(t.usagePercent)||0,exceeded:!!t.exceeded,limitValue:t.limitValue??``,limitUnit:t.limitUnit||`GB`})}).catch(()=>{}),s(!1),p.resetFields()}catch(e){e?.response?.data?.message?Q.error(e.response.data.message):e?.response?.data?.detail?Q.error(e.response.data.detail):e?.message&&Q.error(e.message)}},Ae=()=>{r(),e(`/login`)},je=async()=>{if(!n){Q.warning(`请先登录`);return}try{let e=await D.validateFields();k(!0),await Hae({phone:e.phone,company_name:e.companyName,industry:e.industry,name:e.name,message:e.message}),Q.success(`提交成功,我们会尽快与您联系`),d(!1),D.resetFields()}catch(e){Q.error(e?.message||`提交失败`)}finally{k(!1)}},Me=(0,S.useCallback)(()=>{ae.current&&=(clearInterval(ae.current),null),oe.current&&=(clearInterval(oe.current),null)},[]),Ne=(0,S.useCallback)((e,t=180)=>{Me(),J(t),ae.current=setInterval(async()=>{try{let t=await M5(e);t.status===`paid`?(Me(),se.current=null,localStorage.removeItem(ge),Q.success(`支付成功!积分已到账`),l7.getState().refreshUser(),G(!1),ee(null),h(null)):t.status===`cancelled`&&(Me(),se.current=null,localStorage.removeItem(ge))}catch{}},2e3),oe.current=setInterval(()=>{J(e=>e<=1?(Me(),se.current&&=(N5(se.current).catch(()=>{}),null),localStorage.removeItem(ge),Q.warning(`订单已超时,请重新充值`),G(!1),ee(null),h(null),0):e-1)},1e3)},[Me]),Pe=(t,n=0)=>{let r=t.path===xe,i=f7[t.icon]||(0,$.jsx)(O3,{}),a=Ce[t.id]&&Ce[t.id].length>0,o=(t.menu_type??t.menuType)===`group`;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{onClick:()=>{!(o||a)&&t.path&&e(t.path)},style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:10,padding:n>0?`6px 12px 6px 32px`:`6px 14px`,borderRadius:12,margin:`1px 4px`,cursor:o||a?`default`:`pointer`,fontSize:n>0?13:14,fontWeight:r?600:400,color:r?`#4f46e5`:o?`#94a3b8`:`#475569`,background:r?`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=>{!o&&!r&&!(o||a)&&(e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:[!o&&(0,$.jsx)(`span`,{style:{fontSize:n>0?14:16,flexShrink:0,color:r?`#6366f1`:`#64748b`},children:i}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`,flex:1,textAlign:`left`,fontWeight:o||r?600:400,fontSize:o?12:n>0?13:14,textTransform:o?`uppercase`:`none`,letterSpacing:o?.5:0},children:t.label})]}),(o||a)&&(0,$.jsx)(`div`,{style:{overflow:`hidden`},children:(Ce[t.id]||[]).map(e=>Pe(e,n+1))})]},t.id)};return(0,$.jsxs)(NW,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:Se,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,cursor:`pointer`},onClick:()=>{e(`/home`)},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:B?(0,$.jsx)(`img`,{src:B,alt:`logo`,style:{width:36,height:36,objectFit:`contain`}}):(0,$.jsx)(z8,{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:R})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:we.map(e=>Pe(e))}),(0,$.jsxs)(`div`,{onClick:()=>l(!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)(JI,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(d7,{data:ue}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0,paddingTop:0},children:(0,$.jsx)(ZV,{menu:{items:Ee,onClick:De},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{className:`user-card-container`,style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,borderRadius:14,cursor:`pointer`,transition:`all 0.35s cubic-bezier(0.4,0,0.2,1)`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.8)`,position:`relative`,border:`1px solid rgba(99, 102, 241, 0.15)`,animation:`cardBreath 3s ease-in-out infinite`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 8px 24px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255,255,255,0.9)`,e.currentTarget.style.transform=`translateY(-3px) scale(1.01)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`,e.currentTarget.style.animation=`none`,e.currentTarget.querySelector(`.user-card-arrow`)?.classList.add(`arrow-hover`)},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.8)`,e.currentTarget.style.transform=`translateY(0) scale(1)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.15)`,e.currentTarget.style.animation=`cardBreath 3s ease-in-out infinite`,e.currentTarget.querySelector(`.user-card-arrow`)?.classList.remove(`arrow-hover`)},children:[(0,$.jsx)(`div`,{className:`user-card-glow`,style:{position:`absolute`,inset:-4,borderRadius:18,background:`linear-gradient(90deg, transparent 0%, rgba(99,102,241,0.15) 25%, rgba(139,92,246,0.15) 50%, rgba(99,102,241,0.15) 75%, transparent 100%)`,backgroundSize:`200% 100%`,opacity:.8,animation:`borderShimmer 2.5s linear infinite`,pointerEvents:`none`}}),(0,$.jsx)(Hw,{size:36,icon:(0,$.jsx)(J8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`,transition:`all 0.35s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,zIndex:1,animation:`avatarPulse 2s ease-in-out infinite`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,position:`relative`,zIndex:1},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:16,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:16,fontWeight:500,letterSpacing:0,borderRadius:6,display:`inline-block`,animation:`creditGlow 1.5s ease-in-out infinite`},children:[`积分: `,n?.credits||0]})]}),(0,$.jsx)(`div`,{className:`user-card-arrow`,style:{fontSize:12,color:`#6366f1`,flexShrink:0,position:`relative`,zIndex:1},children:(0,$.jsx)(u6,{})}),(0,$.jsx)(`style`,{children:` + `})]})},d7=({data:e})=>{if(!e)return null;let t=(e.limitUnit||`GB`).toUpperCase(),n=t===`GB`?1024**3:t===`MB`?1024**2:1024,r=Number(e.usagePercent)||0,i=Math.min(100,Math.max(0,r)),a=e.limitValue?parseFloat(e.limitValue):e.totalBytes/n,o=a*r/100;a-o;let s=e.exceeded||r>=100,c=1024**2,l=1024**3,u=1024**4,d=(e=>{let t=Number(e)||0;return t>=u?{val:(t/u).toFixed(2),unit:`TB`}:t>=l?{val:(t/l).toFixed(2),unit:`GB`}:t>=c?{val:(t/c).toFixed(2),unit:`MB`}:{val:(t/1024).toFixed(2),unit:`KB`}})(e.usedBytes);return(0,$.jsxs)(`div`,{style:{marginBottom:12,padding:`0 12px`,paddingTop:6,borderRadius:10,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)`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:6,fontSize:12,color:`#475569`},children:e.enabled?(0,$.jsx)($.Fragment,{}):(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#1e293b`},children:[(0,$.jsx)(K4,{style:{fontSize:12,color:s?`#ef4444`:`#6366f1`,marginRight:4}}),`当前使用 `,d.val,` `,d.unit]})}),e.enabled&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginTop:4,display:`flex`,justifyContent:`space-between`,fontSize:11,color:s?`#ef4444`:`#94a3b8`},children:(0,$.jsxs)(`div`,{style:{height:`100%`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:6,fontSize:12,color:`#000000ff`,padding:`0 8px`},children:[(0,$.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(K4,{style:{fontSize:12,color:`#000000ff`}}),r.toFixed(1),`%`]}),e.enabled?(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#000000ff`},children:[o.toFixed(2),` / `,a.toFixed(2),` `,t]}):(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#1e293b`},children:[`当前使用 `,d.val,` `,d.unit]})]})}),(0,$.jsx)(`div`,{style:{width:`100%`,height:6,background:`#e2e8f0`,borderRadius:50,overflow:`hidden`,position:`relative`},children:(0,$.jsx)(`div`,{style:{width:`${i}%`,height:`100%`,background:r<50?`linear-gradient(90deg, #279951, #b7fad0)`:r<85?`linear-gradient(90deg, #ffd759, #fff6d4)`:`linear-gradient(90deg, #ef4444, #dc2626)`,borderRadius:2,transition:`width 0.4s ease`}})})]})]})},f7={HomeOutlined:(0,$.jsx)(O3,{}),DashboardOutlined:(0,$.jsx)(U4,{}),CodeOutlined:(0,$.jsx)(T4,{}),PlayCircleOutlined:(0,$.jsx)(K6,{}),WalletOutlined:(0,$.jsx)(Q8,{}),SettingOutlined:(0,$.jsx)(x8,{}),BellOutlined:(0,$.jsx)(B2,{}),UserOutlined:(0,$.jsx)(J8,{}),AppstoreOutlined:(0,$.jsx)(p2,{}),FileTextOutlined:(0,$.jsx)(eH,{}),StarOutlined:(0,$.jsx)(N8,{}),HeartOutlined:(0,$.jsx)(y3,{}),CameraOutlined:(0,$.jsx)(t4,{}),RobotOutlined:(0,$.jsx)(s8,{}),CalculatorOutlined:(0,$.jsx)(Q2,{}),DollarOutlined:(0,$.jsx)(Y4,{}),GiftOutlined:(0,$.jsx)(p3,{}),ThunderboltOutlined:(0,$.jsx)(z8,{}),FireOutlined:(0,$.jsx)(s3,{}),CloudOutlined:(0,$.jsx)(g4,{}),SmileOutlined:(0,$.jsx)(O8,{}),TrophyOutlined:(0,$.jsx)(H8,{}),RocketOutlined:(0,$.jsx)(u8,{}),BulbOutlined:(0,$.jsx)(Y2,{}),PictureOutlined:(0,$.jsx)(L6,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),AudioOutlined:(0,$.jsx)(O2,{}),MailOutlined:(0,$.jsx)(i6,{}),PhoneOutlined:(0,$.jsx)(P6,{}),GlobalOutlined:(0,$.jsx)(g3,{}),ShoppingCartOutlined:(0,$.jsx)(C8,{}),TeamOutlined:(0,$.jsx)(L8,{}),BarChartOutlined:(0,$.jsx)(L2,{}),PieChartOutlined:(0,$.jsx)(B6,{}),LineChartOutlined:(0,$.jsx)(K3,{}),SecurityScanOutlined:(0,$.jsx)(y8,{}),ApiOutlined:(0,$.jsx)(u2,{}),DatabaseOutlined:(0,$.jsx)(K4,{}),CloudServerOutlined:(0,$.jsx)(y4,{})},woe=240,p7=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(bq,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(i3,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(L4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(j2,{})}],Toe=()=>{let e=Je(),t=Ge(),{user:n,logout:r,refreshUser:i,setOptimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f]=UH.useForm(),[p]=UH.useForm(),[m,h]=(0,S.useState)(null),[g,_]=(0,S.useState)([]),[v,y]=(0,S.useState)([]),[b,x]=(0,S.useState)(0),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=UH.useForm(),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(()=>({x:24,y:window.innerHeight*.75})),[M,N]=(0,S.useState)(!1),P=(0,S.useRef)(!1),F=(0,S.useRef)({x:0,y:0}),[I,L]=(0,S.useState)({}),[R,z]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[B,V]=(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}),[H,U]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[W,G]=(0,S.useState)(!1),[K,ee]=(0,S.useState)(null),[q,te]=(0,S.useState)(`alipay`),[ne,re]=(0,S.useState)(!1),[ie,J]=(0,S.useState)(180),ae=(0,S.useRef)(null),oe=(0,S.useRef)(null),se=(0,S.useRef)(null),[ce,le]=(0,S.useState)({alipay:!1,wechat:!1}),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),ge=`pending_payment_order`;(0,S.useEffect)(()=>{E5().then(e=>{let t=e.siteName||`智创`,n=e.siteLogo||``;if(t!==R&&(z(t),document.title=t),n&&n!==B){V(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`}e.operationManual&&he(e.operationManual),e.optimizeHoldCredits!==void 0&&a(e.optimizeHoldCredits),localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(e=>{}),g5().then(e=>{let t=e?.resourceCapacity;t&&de({enabled:!!t.enabled,usedBytes:Number(t.usedBytes)||0,totalBytes:Number(t.totalBytes)||0,availableBytes:Number(t.availableBytes)||0,usagePercent:Number(t.usagePercent)||0,exceeded:!!t.exceeded,limitValue:t.limitValue??``,limitUnit:t.limitUnit||`GB`})}).catch(e=>{})},[]),(0,S.useEffect)(()=>{let e=()=>pe(window.innerWidth<=767);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let _e=e=>{e.button===0&&(N(!0),P.current=!1,F.current={x:e.clientX,y:e.clientY})},ve=e=>{if(!M)return;let t=Math.abs(e.clientX-F.current.x),n=Math.abs(e.clientY-F.current.y);(t>5||n>5)&&(P.current=!0);let r=Math.max(60,Math.min(window.innerHeight-60,e.clientY-(F.current.y-A.y)));j(e=>({x:e.x,y:r}))},ye=()=>{let e=P.current;N(!1),P.current=!1,e||d(!0)};(0,S.useEffect)(()=>{if(M)return document.addEventListener(`mousemove`,ve),document.addEventListener(`mouseup`,ye),()=>{document.removeEventListener(`mousemove`,ve),document.removeEventListener(`mouseup`,ye)}},[M]);let be=()=>{k5().then(e=>{x(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(ge);if(e)try{let t=JSON.parse(e),n=await M5(t.orderNo);if(n.status===`pending`){ee({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),se.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?(G(!0),Ne(t.orderNo,a)):localStorage.removeItem(ge)}else n.status===`paid`?(Q.success(`支付成功!积分已到账`),l7.getState().refreshUser(),localStorage.removeItem(ge)):localStorage.removeItem(ge)}catch{localStorage.removeItem(ge)}})()},[]),(0,S.useEffect)(()=>{Qie().then(e=>{_(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),$ie().then(e=>{y(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),eae().then(e=>{le(e),e.alipay?te(`alipay`):e.wechat&&te(`wechat`)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{n&&be()},[n?.id,n?.credits]);let xe=t.pathname.startsWith(`/records`)?`/records`:t.pathname,Se=woe,Ce={};g.forEach(e=>{let t=e.parent_id??e.parentId;t&&(Ce[t]||(Ce[t]=[]),Ce[t].push(e))});let we=g.filter(e=>!(e.parent_id??e.parentId));we.sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0)),Object.keys(Ce).forEach(e=>{Ce[e].sort((e,t)=>(typeof e.sortOrder==`number`?e.sortOrder:1/0)-(typeof t.sortOrder==`number`?t.sortOrder:1/0))});let Te=t=>{let n=t.menu_type??t.menuType,r=Ce[t.id]&&Ce[t.id].length>0;n===`group`||r?L(e=>({...e,[t.id]:!e[t.id]})):t.path&&(e(t.path),w(!1))},Ee=[{key:`profile`,icon:(0,$.jsx)(J8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)(Q8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},...n?.isTeamManager?[{key:`teamManagement`,icon:(0,$.jsx)(L8,{style:{color:`#6366f1`}}),label:`团队管理`}]:[],{key:`myCredits`,icon:(0,$.jsx)(Q8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(eH,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(B2,{}),label:`消息中心${b>0?`(${b})`:``}`},...me?[{key:`manual`,icon:(0,$.jsx)(eH,{}),label:`操作手册`}]:[],{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(Y3,{}),label:`个人信息`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(t6,{}),label:`退出登录`,danger:!0}],De=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?s(!0):t===`messages`?e(`/messages`):t===`recharge`?l(!0):t===`teamManagement`?e(`/team-management`):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`?e(`/user-center?tab=orders`):t===`manual`&&window.open(me,`_blank`)},Oe=async()=>{try{let e=await f.validateFields();await _5(e.oldPwd,e.newPwd),Q.success(`密码修改成功`),s(!1),f.resetFields()}catch(e){e?.response?.data?.detail?Q.error(e.response.data.detail):e?.message&&Q.error(e.message)}},ke=async()=>{try{let e=await Pie((await p.validateFields()).username);Q.success(e.message||`操作成功`),await i(),g5().then(e=>{let t=e?.resourceCapacity;t&&de({enabled:!!t.enabled,usedBytes:Number(t.usedBytes)||0,totalBytes:Number(t.totalBytes)||0,availableBytes:Number(t.availableBytes)||0,usagePercent:Number(t.usagePercent)||0,exceeded:!!t.exceeded,limitValue:t.limitValue??``,limitUnit:t.limitUnit||`GB`})}).catch(()=>{}),s(!1),p.resetFields()}catch(e){e?.response?.data?.message?Q.error(e.response.data.message):e?.response?.data?.detail?Q.error(e.response.data.detail):e?.message&&Q.error(e.message)}},Ae=()=>{r(),e(`/login`)},je=async()=>{if(!n){Q.warning(`请先登录`);return}try{let e=await D.validateFields();k(!0),await Hae({phone:e.phone,company_name:e.companyName,industry:e.industry,name:e.name,message:e.message}),Q.success(`提交成功,我们会尽快与您联系`),d(!1),D.resetFields()}catch(e){Q.error(e?.message||`提交失败`)}finally{k(!1)}},Me=(0,S.useCallback)(()=>{ae.current&&=(clearInterval(ae.current),null),oe.current&&=(clearInterval(oe.current),null)},[]),Ne=(0,S.useCallback)((e,t=180)=>{Me(),J(t),ae.current=setInterval(async()=>{try{let t=await M5(e);t.status===`paid`?(Me(),se.current=null,localStorage.removeItem(ge),Q.success(`支付成功!积分已到账`),l7.getState().refreshUser(),G(!1),ee(null),h(null)):t.status===`cancelled`&&(Me(),se.current=null,localStorage.removeItem(ge))}catch{}},2e3),oe.current=setInterval(()=>{J(e=>e<=1?(Me(),se.current&&=(N5(se.current).catch(()=>{}),null),localStorage.removeItem(ge),Q.warning(`订单已超时,请重新充值`),G(!1),ee(null),h(null),0):e-1)},1e3)},[Me]),Pe=(t,n=0)=>{let r=t.path===xe,i=f7[t.icon]||(0,$.jsx)(O3,{}),a=Ce[t.id]&&Ce[t.id].length>0,o=(t.menu_type??t.menuType)===`group`;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{onClick:()=>{!(o||a)&&t.path&&e(t.path)},style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:10,padding:n>0?`6px 12px 6px 32px`:`6px 14px`,borderRadius:12,margin:`1px 4px`,cursor:o||a?`default`:`pointer`,fontSize:n>0?13:14,fontWeight:r?600:400,color:r?`#4f46e5`:o?`#94a3b8`:`#475569`,background:r?`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=>{!o&&!r&&!(o||a)&&(e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:[!o&&(0,$.jsx)(`span`,{style:{fontSize:n>0?14:16,flexShrink:0,color:r?`#6366f1`:`#64748b`},children:i}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`,flex:1,textAlign:`left`,fontWeight:o||r?600:400,fontSize:o?12:n>0?13:14,textTransform:o?`uppercase`:`none`,letterSpacing:o?.5:0},children:t.label})]}),(o||a)&&(0,$.jsx)(`div`,{style:{overflow:`hidden`},children:(Ce[t.id]||[]).map(e=>Pe(e,n+1))})]},t.id)};return(0,$.jsxs)(NW,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:Se,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,cursor:`pointer`},onClick:()=>{e(`/home`)},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:B?(0,$.jsx)(`img`,{src:B,alt:`logo`,style:{width:36,height:36,objectFit:`contain`}}):(0,$.jsx)(z8,{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:R})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:we.map(e=>Pe(e))}),(0,$.jsxs)(`div`,{onClick:()=>l(!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)(JI,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(d7,{data:ue}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0,paddingTop:0},children:(0,$.jsx)(ZV,{menu:{items:Ee,onClick:De},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{className:`user-card-container`,style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,borderRadius:14,cursor:`pointer`,transition:`all 0.35s cubic-bezier(0.4,0,0.2,1)`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.8)`,position:`relative`,border:`1px solid rgba(99, 102, 241, 0.15)`,animation:`cardBreath 3s ease-in-out infinite`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 8px 24px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255,255,255,0.9)`,e.currentTarget.style.transform=`translateY(-3px) scale(1.01)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`,e.currentTarget.style.animation=`none`,e.currentTarget.querySelector(`.user-card-arrow`)?.classList.add(`arrow-hover`)},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.8)`,e.currentTarget.style.transform=`translateY(0) scale(1)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.15)`,e.currentTarget.style.animation=`cardBreath 3s ease-in-out infinite`,e.currentTarget.querySelector(`.user-card-arrow`)?.classList.remove(`arrow-hover`)},children:[(0,$.jsx)(`div`,{className:`user-card-glow`,style:{position:`absolute`,inset:-4,borderRadius:18,background:`linear-gradient(90deg, transparent 0%, rgba(99,102,241,0.15) 25%, rgba(139,92,246,0.15) 50%, rgba(99,102,241,0.15) 75%, transparent 100%)`,backgroundSize:`200% 100%`,opacity:.8,animation:`borderShimmer 2.5s linear infinite`,pointerEvents:`none`}}),(0,$.jsx)(Hw,{size:36,icon:(0,$.jsx)(J8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`,transition:`all 0.35s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,zIndex:1,animation:`avatarPulse 2s ease-in-out infinite`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,position:`relative`,zIndex:1},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:16,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:16,fontWeight:500,letterSpacing:0,borderRadius:6,display:`inline-block`,animation:`creditGlow 1.5s ease-in-out infinite`},children:[`积分: `,n?.credits||0]})]}),(0,$.jsx)(`div`,{className:`user-card-arrow`,style:{fontSize:12,color:`#6366f1`,flexShrink:0,position:`relative`,zIndex:1},children:(0,$.jsx)(u6,{})}),(0,$.jsx)(`style`,{children:` @keyframes arrowFlash { 0%, 100% { transform: translateY(0) scale(1); @@ -454,7 +454,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho animation: none !important; filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8)) !important; } - `})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:Se+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:`#f1f2f3`,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:!fe&&(0,$.jsx)(Ct,{})})}),(0,$.jsx)(`div`,{className:`mobile-header`,children:(0,$.jsxs)(`div`,{className:`mobile-header-content`,children:[(0,$.jsx)(`div`,{className:`mobile-menu-btn`,onClick:()=>w(!0),children:(0,$.jsx)(u6,{style:{fontSize:20}})}),(0,$.jsx)(`div`,{className:`mobile-header-title`,children:R}),(0,$.jsx)(`div`,{className:`mobile-header-right`,children:(0,$.jsxs)(`div`,{className:`mobile-credits-badge`,onClick:()=>l(!0),children:[(0,$.jsx)(Q8,{}),(0,$.jsx)(`span`,{children:n?.credits||0})]})})]})}),(0,$.jsx)(`div`,{className:`mobile-content`,children:fe&&(0,$.jsx)(Ct,{})}),(0,$.jsxs)(BV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:10,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.35)`},children:B?(0,$.jsx)(`img`,{src:B,alt:`logo`,style:{width:24,height:24,objectFit:`contain`}}):(0,$.jsx)(z8,{style:{fontSize:18,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{fontWeight:700,fontSize:16,color:`#1e293b`},children:R})]}),placement:`left`,onClose:()=>w(!1),open:C,size:280,closable:!0,className:`mobile-menu-drawer`,styles:{header:{borderBottom:`1px solid #f1f5f9`,padding:`16px 20px`},body:{padding:`12px 8px`,display:`flex`,flexDirection:`column`}},children:[(0,$.jsxs)(`div`,{style:{flex:1,overflow:`auto`,paddingBottom:12},children:[(0,$.jsx)(`div`,{style:{padding:`12px 8px 16px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsx)(Hw,{size:44,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0},children:(0,$.jsx)(J8,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,marginBottom:2},children:n?.username||`用户`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`},children:[(0,$.jsx)(Q8,{style:{color:`#f59e0b`,marginRight:4}}),`积分: `,(0,$.jsx)(`span`,{style:{color:`#f59e0b`,fontWeight:600},children:n?.credits??0})]})]})]})}),(0,$.jsx)(d7,{data:ue}),we.map(e=>{let t=e.menu_type??e.menuType,n=Ce[e.id]&&Ce[e.id].length>0,r=e.path===xe,i=I[e.id],a=f7[e.icon]||(0,$.jsx)(O3,{});return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item ${r&&!n?`mobile-menu-item-active`:``} ${t===`group`?`mobile-menu-group`:``}`,onClick:()=>Te(e),children:[t!==`group`&&(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:r?`#6366f1`:`#64748b`},children:a}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{paddingLeft:0,color:t===`group`?`#94a3b8`:r?`#4f46e5`:`#475569`,fontWeight:t===`group`||r?600:400,fontSize:t===`group`?12:15,textTransform:t===`group`?`uppercase`:`none`,letterSpacing:t===`group`?.5:0},children:e.label}),(t===`group`||n)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#cbd5e1`,transition:`transform 0.2s ease`,transform:i?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Bg,{})})]}),(t===`group`||n)&&i&&(0,$.jsx)(`div`,{className:`mobile-submenu`,children:(Ce[e.id]||[]).map(e=>{let t=e.path===xe,n=f7[e.icon]||(0,$.jsx)(O3,{});return(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-submenu-item ${t?`mobile-menu-item-active`:``}`,onClick:()=>Te(e),children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:t?`#6366f1`:`#94a3b8`},children:n}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:t?`#4f46e5`:`#64748b`,fontWeight:t?600:400,fontSize:14},children:e.label})]},e.id)})})]},e.id)})]}),(0,$.jsxs)(`div`,{style:{padding:`8px 0`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=credits`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#f59e0b`},children:(0,$.jsx)(Q8,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`积分明细`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=orders`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#6366f1`},children:(0,$.jsx)(eH,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`订单记录`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/messages`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#8b5cf6`},children:(0,$.jsx)(B2,{})}),(0,$.jsxs)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:[`消息中心`,b>0&&(0,$.jsx)(qQ,{color:`red`,style:{marginLeft:8,fontSize:11},children:b})]})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{s(!0),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#0ea5e9`},children:(0,$.jsx)(Y3,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`个人信息`})]}),(0,$.jsx)(`div`,{style:{height:8}}),(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-recharge-item`,onClick:()=>{l(!0),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#fff`},children:(0,$.jsx)(JI,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#fff`,fontWeight:600},children:`充值积分`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{Ae(),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#ef4444`},children:(0,$.jsx)(t6,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#ef4444`},children:`退出登录`})]})]})]}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(x8,{}),`账号设置`]}),open:o,onCancel:()=>{s(!1),f.resetFields(),p.resetFields()},width:440,footer:null,children:(0,$.jsxs)(vL,{defaultActiveKey:`profile`,children:[(0,$.jsx)(vL.TabPane,{tab:`个人信息`,children:(0,$.jsxs)(UH,{form:p,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(UH.Item,{name:`username`,label:`用户名`,rules:[{required:!0,message:`请输入用户名`},{min:3,message:`用户名至少3位`}],children:(0,$.jsx)(wW,{placeholder:`请输入用户名`,size:`large`,prefix:(0,$.jsx)(J8,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{children:(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:ke,style:{width:`100%`},children:`确认修改`})})]})},`profile`),(0,$.jsx)(vL.TabPane,{tab:`修改密码`,children:(0,$.jsxs)(UH,{form:f,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(UH.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(wW.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(wW.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.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)(wW.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{children:(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:Oe,style:{width:`100%`},children:`确认修改`})})]})},`password`)]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p3,{}),`积分充值`]}),open:c,onCancel:()=>{l(!1),h(null)},width:680,className:`recharge-modal`,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,padding:`12px 0 0`,borderTop:`1px solid #f0f0f0`},children:[(0,$.jsx)(Z,{size:`large`,onClick:()=>{l(!1),h(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,disabled:!m||!ce.alipay&&!ce.wechat,loading:ne,onClick:async()=>{let e=v.find(e=>e.id===m);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{re(!0);let n=await tae(e.id,q),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(ee({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),l(!1),G(!0),se.current=n.orderNo,localStorage.setItem(ge,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),Ne(n.orderNo)):(Q.success(`充值成功!积分已到账`),l7.getState().refreshUser(),l(!1),h(null))}catch(e){Q.error(e?.message||`创建订单失败,请重试`)}finally{re(!1)}},style:{borderRadius:10,fontWeight:600,background:m?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:m?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]}),children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(YV,{style:{marginBottom:16},children:[(0,$.jsx)(Q8,{style:{color:`#6366f1`}}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(w1.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),!ce.alipay&&!ce.wechat?(0,$.jsx)(`div`,{style:{marginBottom:16,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(w1.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(eI.Group,{value:q,onChange:e=>te(e.target.value),style:{display:`flex`,gap:12},children:[ce.alipay&&(0,$.jsxs)(eI.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:q===`alipay`?`#1677ff`:void 0,color:q===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(s2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),ce.wechat&&(0,$.jsxs)(eI.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:q===`wechat`?`#07c160`:void 0,color:q===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(t5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(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)(P3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsxs)(w1.Text,{style:{color:`#64748b`,fontSize:13},children:[`当前平台仅支持支付宝/微信扫码充值,如需转账支付请`,(0,$.jsx)(w1.Text,{style:{color:`#ff0000ff`,cursor:`pointer`,textDecoration:`underline`},onClick:()=>{l(!1),d(!0)},children:`联系我们`})]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:v.map((e,t)=>{let n=p7[t%p7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>h(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:m===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:m===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(qQ,{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)(w1.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(w1.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)})})]})}),(0,$.jsx)(nK,{open:W,onCancel:async()=>{if(Me(),se.current){try{await N5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),G(!1),ee(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:K?.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:K?.method===`alipay`?(0,$.jsx)(s2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(t5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:K?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:13},children:K?.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:K&&(0,$.jsx)(i2,{value:K.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:[`¥`,K?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,K?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:ie<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:ie<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:ie<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:ie}),` 秒后关闭`]})})]})]}),(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)(Z,{size:`large`,block:!0,onClick:async()=>{if(Me(),se.current){try{await N5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),G(!1),ee(null),h(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(Coe,{}),(0,$.jsx)(`div`,{className:`contact-button-wrapper`,style:{right:`${A.x}px`,bottom:`${window.innerHeight-A.y}px`},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{className:`contact-tooltip`,style:{opacity:+!!T},children:`联系我们`}),(0,$.jsx)(`button`,{className:`contact-button ${M?`dragging`:``}`,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),onMouseDown:_e,onMouseUp:ye,children:(0,$.jsx)(p6,{style:{fontSize:20}})})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p6,{}),`联系我们`]}),open:u,onCancel:()=>{d(!1),D.resetFields()},footer:null,width:480,className:`contact-modal`,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(UH,{form:D,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(wW,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(wW.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(Z,{size:`large`,onClick:()=>{d(!1),D.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:je,loading:O,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},Eoe=`http://localhost:8000/api`,Doe=()=>{let{checkAuth:e}=l7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s]=Dn(),c=s.get(`redirect`),l=s.get(`tab`),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(!1),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(()=>{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:``}})(),[M,N]=(0,S.useState)(j.siteName),[P,F]=(0,S.useState)(j.siteLogo),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),[H,U]=(0,S.useState)(``),W=Je(),{login:G}=l7(),[K]=UH.useForm(),[ee]=UH.useForm(),[q]=UH.useForm();(0,S.useEffect)(()=>{E5().then(e=>{N(e.siteName),F(e.siteLogo),L(e.loginBgVideo||``),V(e.userAgreementPrivacyUrl),U(e.siteCopyright)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{l===`register`&&i(`register`)},[l]);let te=()=>{if(c)try{W(decodeURIComponent(c));return}catch{}W(`/home`)},ne=()=>m?!0:(Q.warning(`请先阅读并同意用户协议及隐私政策`),!1),re=async()=>{if(ne())try{let t=await K.validateFields();await G(t.phone,t.password,void 0,t.rememberMe),Q.success(`登录成功,欢迎回来`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}},ie=async()=>{if(ne())try{let t=ee.getFieldsValue();if(!t.phone||!t.code){Q.error(`请填写手机号和验证码`);return}n(!0),await jie(t.phone,t.code),Q.success(`登录成功,欢迎回来`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}finally{n(!1)}},J=async()=>{if(ne())try{let t=await q.validateFields();n(!0),await Mie(t.phone,t.regCode,t.password),Q.success(`注册成功`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Q.error(t)}finally{n(!1)}},ae=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),_(!1),t?O(!0):A(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{u===0&&r===`phone`&&x(!1)},[u,r]);let oe=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Q.error(`请输入正确的手机号`);return}if(t){_(!0),y(!1);return}if(!b){_(!0),x(!1);return}let n=``;n=r===`register`?`register`:`login`,await D5(e,n),ae(t?p:d),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(y(!1),p(0)):(x(!1),d(0)),w(e=>e+1)}},se=async(e=!1)=>{let t=r===`register`?q.getFieldValue(`phone`):ee.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await D5(t,e),r===`register`?(y(!0),ae(p,!0)):(x(!0),ae(d,!1)),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(y(!1),p(0),O(!0)):(x(!1),d(0),A(!0)),w(e=>e+1)}},ce=e=>{o(e),i(e),d(0),p(0),x(!1),y(!1),_(!1),O(!1),A(!1),w(e=>e+1),e===`password`?K.resetFields():ee.resetFields()},le={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,borderRadius:10,fontSize:14},ue=e=>{if(!e){Q.warning(`暂未上传协议文件`);return}e.startsWith(`http://`)||e.startsWith(`https://`)?window.open(e,`_blank`):window.open(`${Eoe.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-page`,children:[(0,$.jsx)(Ooe,{src:I,onReady:()=>z(!0)}),(0,$.jsx)(`div`,{className:`login-bg-overlay`,style:{opacity:+!!R}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,opacity:+!!R,transition:`opacity 0.5s ease`,pointerEvents:R?`auto`:`none`},children:[(0,$.jsx)(`div`,{className:`login-slogan`,children:(0,$.jsx)(`span`,{className:`login-slogan-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(`div`,{className:`login-center`,children:(0,$.jsxs)(bL,{className:`login-card`,styles:{body:{padding:`32px 32px`}},children:[(0,$.jsx)(`div`,{className:`login-card-header`,children:(0,$.jsxs)(`div`,{className:`login-logo-row`,children:[P?(0,$.jsx)(`img`,{src:P,alt:`logo`,className:`login-logo-img`}):(0,$.jsx)(`div`,{className:`login-logo-placeholder`,children:(0,$.jsx)(z8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{className:`login-site-name`,children:M})]})}),(0,$.jsx)(w1.Text,{className:`login-card-subtitle`,children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作`}),r!==`register`&&(0,$.jsx)(`div`,{className:`login-tabs`,children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>ce(e),className:`login-tab ${a===e?`login-tab-active`:``}`,children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(UH,{form:K,size:`large`,layout:`vertical`,onFinish:re,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:le})}),(0,$.jsx)(UH.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(wW.Password,{prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:le})}),(0,$.jsx)(UH.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(kR,{children:`记住我的登录状态`})}),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,htmlType:`submit`,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(UH,{form:ee,size:`large`,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:le})}),(0,$.jsx)(UH.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(YV.Compact,{style:{width:`100%`},children:[(0,$.jsx)(wW,{prefix:(0,$.jsx)(p8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!b,style:{...le,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(Z,{disabled:u>0,style:{fontSize:14,fontWeight:400},onClick:()=>{k?(x(!1),_(!0),w(e=>e+1)):g&&!b?(E(!0),setTimeout(()=>E(!1),500)):oe(ee.getFieldValue(`phone`))},className:`login-code-btn`,children:u>0?`${u}s`:k?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(m7,{onSuccess:se,isVerified:b,shake:T})},C),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,onClick:ie,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(UH,{form:q,size:`large`,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:le})}),(0,$.jsx)(UH.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(YV.Compact,{style:{width:`100%`},children:[(0,$.jsx)(wW,{prefix:(0,$.jsx)(p8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!v,style:{...le,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(Z,{disabled:f>0,style:{fontSize:14,fontWeight:400},onClick:()=>{D?(y(!1),_(!0),w(e=>e+1)):g&&!v?(E(!0),setTimeout(()=>E(!1),500)):oe(q.getFieldValue(`phone`),!0)},className:`login-code-btn`,children:f>0?`${f}s`:D?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(m7,{onSuccess:se,isVerified:v,shake:T})},C),(0,$.jsx)(UH.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(wW.Password,{prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:le})}),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,onClick:J,loading:t,block:!0,className:`login-submit-btn`,children:`注 册`})})]}),(0,$.jsx)(`div`,{className:`login-agreement`,children:(0,$.jsx)(kR,{checked:m,onChange:e=>h(e.target.checked),children:(0,$.jsxs)(`span`,{className:`login-agreement-text`,children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),ue(B)},className:`login-link`,children:`《用户协议及隐私政策》`})]})})}),(0,$.jsx)(`div`,{className:`login-footer`,children:r===`register`?(0,$.jsx)(w1.Text,{className:`login-switch-btn`,onClick:()=>{i(`password`),o(`password`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1),q.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(w1.Text,{className:`login-switch-btn`,onClick:()=>{i(`register`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1)},children:`没有账号?立即注册`})})]})}),H&&(0,$.jsx)(`div`,{className:`login-copyright-wrapper`,children:(0,$.jsx)(`div`,{className:`login-copyright`,children:H})})]})]})},Ooe=({src:e,onReady:t})=>{let[n,r]=(0,S.useState)(!1),i=S.useRef(null),a=()=>{n||(r(!0),i.current?.play().catch(()=>{}),t())};if(!e)return t(),null;let o=e.toLowerCase().endsWith(`.gif`),s=e.toLowerCase().endsWith(`.webp`);return o||s?(0,$.jsx)(`img`,{className:`login-bg-video`,src:e,alt:``,onLoad:a,onError:a}):(0,$.jsxs)($.Fragment,{children:[!n&&(0,$.jsx)(`div`,{className:`login-bg-video login-bg-placeholder`}),(0,$.jsx)(`video`,{ref:i,className:`login-bg-video`,style:{opacity:+!!n},autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:`auto`,onCanPlayThrough:a,onCanPlay:a,onError:a,children:(0,$.jsx)(`source`,{src:e,type:e.endsWith(`.webm`)?`video/webm`:e.endsWith(`.mov`)?`video/quicktime`:`video/mp4`})})]})},m7=({onSuccess:e,isVerified:t,shake:n})=>{let r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=S.useRef(0),s=S.useRef(!1),[c,l]=S.useState(360),u=c-50;S.useEffect(()=>{let e=()=>{if(r.current){let e=r.current.offsetWidth;e>0&&l(e)}};e();let t=new ResizeObserver(e);return r.current&&t.observe(r.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let d=n=>{if(s.current||t)return;let r=Math.max(0,Math.min(n,u));o.current=r,i.current&&(i.current.style.left=`${r}px`),a.current&&(a.current.style.width=`${r+50}px`),r>=u-5&&(s.current=!0,i.current&&(i.current.style.background=`#22c55e`,i.current.innerHTML=``),a.current&&(a.current.style.width=`${c}px`,a.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:r,onMouseDown:e=>{if(e.preventDefault(),s.current||t)return;let n=r.current;if(!n)return;let c=n.getBoundingClientRect(),l=e=>{d(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,f),!s.current&&o.current{if(s.current||t)return;e.preventDefault();let n=r.current;if(!n)return;let c=n.getBoundingClientRect();d(e.touches[0].clientX-c.left-50/2);let l=e=>{d(e.touches[0].clientX-c.left-50/2)},f=()=>{document.removeEventListener(`touchmove`,l),document.removeEventListener(`touchend`,f),!s.current&&o.current({page:1,pageSize:10,total:0,items:[]}),h7=a5((e,t)=>({projects:[],records:koe(),loading:!1,mediaType:`video`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,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:[],inputValue:``,currentMedia:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await Fie(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await Iie(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await Lie(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 Rie(n,r);try{await l7.getState().checkAuth()}catch{}let a=t().records,o=a.items.findIndex(e=>e.id===i.record.id),s=o>=0?a.items.map(e=>e.id===i.record.id?i.record:e):[i.record,...a.items];return e({records:{...a,total:o>=0?a.total:a.total+1,items:s}}),i},generateVideo:async n=>{let r=await Jie(n);try{await l7.getState().checkAuth()}catch{}let i=t().records;return e({records:{...i,items:i.items.map(e=>e.id===n?r:e)}}),r},retryGeneration:async n=>{let r=await Yie(n);try{await l7.getState().checkAuth()}catch{}let i=t().records;return e({records:{...i,items:i.items.map(e=>e.id===n?r:e)}}),r},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}),setGenerationCount:t=>e({generationCount: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}),setInputValue:t=>e({inputValue:t}),setCurrentMedia:t=>e({currentMedia:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,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:[],inputValue:``,currentMedia:[]})})),g7=480;function _7(e){if(!e)return`-`;let t=e.trim();if(!t)return`-`;let n=t.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/);if(!n)return t.slice(0,16).replace(`T`,` `);let[,r,i,a,o,s,c,l]=n,u=Date.UTC(+r,i-1,+a,+o,+s,+c);if(l&&l!==`Z`){let e=l[0]===`+`?1:-1,[t,n]=l.slice(1).split(`:`),r=u-e*(t*60+ +n)*6e4+g7*6e4,i=new Date(r);return`${i.getUTCFullYear()}-${v7(i.getUTCMonth()+1)}-${v7(i.getUTCDate())} ${v7(i.getUTCHours())}:${v7(i.getUTCMinutes())}`}let d=l===`Z`?u+g7*6e4:u,f=new Date(d);return`${f.getUTCFullYear()}-${v7(f.getUTCMonth()+1)}-${v7(f.getUTCDate())} ${v7(f.getUTCHours())}:${v7(f.getUTCMinutes())}`}function v7(e){return e<10?`0${e}`:String(e)}var y7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],b7={ShoppingCartOutlined:(0,$.jsx)(C8,{}),BookOutlined:(0,$.jsx)(U2,{}),HomeOutlined:(0,$.jsx)(O3,{}),FireOutlined:(0,$.jsx)(s3,{}),RocketOutlined:(0,$.jsx)(u8,{}),SkinOutlined:(0,$.jsx)(Kre,{}),CompassOutlined:(0,$.jsx)(P4,{}),HeartOutlined:(0,$.jsx)(y3,{}),CarOutlined:(0,$.jsx)(i4,{}),CameraOutlined:(0,$.jsx)(t4,{}),CloudOutlined:(0,$.jsx)(g4,{}),StarOutlined:(0,$.jsx)(N8,{}),TrophyOutlined:(0,$.jsx)(H8,{}),ThunderboltOutlined:(0,$.jsx)(z8,{}),BulbOutlined:(0,$.jsx)(Y2,{}),CoffeeOutlined:(0,$.jsx)(O4,{}),CrownOutlined:(0,$.jsx)(B4,{}),DashboardOutlined:(0,$.jsx)(U4,{}),FlagOutlined:(0,$.jsx)(u3,{}),GlobalOutlined:(0,$.jsx)(g3,{}),GiftOutlined:(0,$.jsx)(p3,{}),LaptopOutlined:(0,$.jsx)(L3,{}),MobileOutlined:(0,$.jsx)(g6,{}),MonitorOutlined:(0,$.jsx)(y6,{}),PayCircleOutlined:(0,$.jsx)(j6,{}),PictureOutlined:(0,$.jsx)(L6,{}),PlayCircleOutlined:(0,$.jsx)(K6,{}),SafetyOutlined:(0,$.jsx)(p8,{}),ShoppingOutlined:(0,$.jsx)(Hre,{}),SmileOutlined:(0,$.jsx)(O8,{}),SoundOutlined:(0,$.jsx)(j8,{}),TagOutlined:(0,$.jsx)(tie,{}),TeamOutlined:(0,$.jsx)(L8,{}),ToolOutlined:(0,$.jsx)(aie,{}),TruckOutlined:(0,$.jsx)(cie,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),WalletOutlined:(0,$.jsx)(Q8,{}),BankOutlined:(0,$.jsx)(P2,{}),BuildOutlined:(0,$.jsx)(K2,{}),ExperimentOutlined:(0,$.jsx)(Q4,{}),HighlightOutlined:(0,$.jsx)(S3,{}),IdcardOutlined:(0,$.jsx)(j3,{}),MedicineBoxOutlined:(0,$.jsx)(s6,{}),ReadOutlined:(0,$.jsx)(Q6,{}),RestOutlined:(0,$.jsx)(t8,{}),SketchOutlined:(0,$.jsx)(Wre,{}),SolutionOutlined:(0,$.jsx)(Yre,{})},Aoe=()=>{let[e,t]=(0,S.useState)(!1),[n]=UH.useForm(),r=Je(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=h7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),j5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:y7[t%y7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`垂直行业提示词智能优化(新手专属,一键生成标准素材)`}),(0,$.jsxs)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(eH,{}),onClick:()=>r(`/records`),size:`large`,style:{background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`,fontWeight:600,borderRadius:10,height:42},children:`项目记录`}),(0,$.jsx)(Z,{icon:(0,$.jsx)(JI,{}),onClick:()=>t(!0),size:`large`,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`,fontWeight:600,borderRadius:10,height:42,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`},children:`新建项目`})]})]}),i.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),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:b7[u[e.industry]?.icon]||(0,$.jsx)(p2,{})}),(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)(w1.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(qQ,{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)(qB,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,_7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(K6,{}),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)(oK,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Q.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),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)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Q.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(UH,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(UH.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(UX,{}),size:`large`})}),(0,$.jsx)(UH.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(HC,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(HC.Option,{value:e.key,children:(0,$.jsxs)(YV,{children:[b7[e.icon]||(0,$.jsx)(p2,{}),` `,e.label]})},e.key))})})]})})]})};async function x7(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var{Text:S7}=w1,joe={real_person:{title:`选择真人素材库`,empty:`暂无可选 Active 真人素材`,projectError:`加载真人素材项目失败`,assetError:`加载真人素材失败`,fallbackName:`真人素材`},aigc_virtual:{title:`选择虚拟素材库`,empty:`暂无可选 Active 虚拟素材`,projectError:`加载虚拟素材项目失败`,assetError:`加载虚拟素材失败`,fallbackName:`虚拟素材`}},C7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,Moe=e=>e.assetType===`Video`?C7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.providerUrl):C7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.providerUrl),Noe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},w7=({open:e,libraryType:t=`real_person`,selectedIds:n=[],maxCount:r=20,onClose:i,onSelect:a,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,usedVideoDuration:u,maxVideoDuration:d,accept:f})=>{let p=joe[t],[m,h]=(0,S.useState)([]),[g,_]=(0,S.useState)(),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(f===`image/*`?`Image`:void 0),[C,w]=(0,S.useState)([]),[T,E]=(0,S.useState)(new Map),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(0,S.useMemo)(()=>new Set(T.keys()),[T]),M=async()=>{O(!0);try{let e=(await(t===`aigc_virtual`?c7:o7)({page:1,pageSize:100,status:`active`})).items||[];h(e),_(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(e){Q.error(e?.message||p.projectError)}finally{O(!1)}},N=async()=>{A(!0);try{w((await(t===`aigc_virtual`?loe:roe)({projectId:g,keyword:v.trim()||void 0,assetType:b,page:1,pageSize:100})).items||[])}catch(e){Q.error(e?.message||p.assetError)}finally{A(!1)}};(0,S.useEffect)(()=>{e&&setTimeout(()=>{E(new Map),y(``),x(void 0),_(void 0),w([]),M()},0)},[e,t]),(0,S.useEffect)(()=>{g&&setTimeout(()=>{N()},0)},[g,b]);let P=e=>{if(n.includes(e.id)){Q.info(`该素材已添加`);return}if(f===`image/*`&&e.assetType===`Video`){Q.warning(`当前仅支持选择图片素材`);return}E(t=>{let n=new Map(t);return n.has(e.id)?(n.delete(e.id),n):n.size>=r?(Q.warning(`最多选择 ${r} 个参考素材`),t):(n.set(e.id,e),n)})},F=(0,S.useMemo)(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0;return e>r||t>i||n>a},[T,o,c,s,l,d,u]);return(0,$.jsxs)(nK,{title:`${p.title}`,open:e,onCancel:i,width:920,destroyOnHidden:!0,footer:[(0,$.jsx)(Z,{onClick:i,children:`取消`},`cancel`),(0,$.jsxs)(Z,{type:`primary`,onClick:()=>{let e=Array.from(T.values()).filter(e=>!n.includes(e.id));if(!e.length){Q.warning(`请选择至少一个${t===`aigc_virtual`?`虚拟`:`真人`}素材`);return}a(e),i()},disabled:F,style:{background:F?`#94a3b8`:`#8b5cf6`,opacity:F?.6:1,cursor:F?`not-allowed`:`pointer`},children:[`添加选中素材(`,T.size,`)`]},`ok`)],children:[f!==`image/*`&&(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20,marginBottom:16,padding:`12px 16px`,background:`#fafafa`,borderRadius:8},children:(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0,f=e>r,p=t>i,m=n>a;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:f?`#ef4444`:`#64748b`,fontWeight:f?600:400},children:[`还可选取图片 `,e,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:p||m?`#ef4444`:`#64748b`,fontWeight:p||m?600:400},children:[`视频还可选取 `,t,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,n.toFixed(1),`/`,d!==void 0&&u!==void 0?(d-u).toFixed(1):`-`,`秒)`]})]})})()}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(YV,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(S7,{strong:!0,children:`项目组`}),(0,$.jsx)(Z,{size:`small`,icon:(0,$.jsx)(fq,{}),onClick:M,loading:D})]}),(0,$.jsx)(jG,{spinning:D,children:m.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无项目组`}):(0,$.jsx)(`div`,{children:m.map(e=>(0,$.jsx)(`div`,{onClick:()=>_(e.id),style:{cursor:`pointer`,padding:`10px 12px`,borderRadius:10,marginBottom:6,border:g===e.id?`1px solid #8b5cf6`:`1px solid transparent`,background:g===e.id?`#f5f3ff`:`#fff`},children:(0,$.jsxs)(`div`,{style:{width:`100%`},children:[(0,$.jsx)(S7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),(0,$.jsx)(S7,{type:`secondary`,style:{fontSize:12},children:typeof e.activeImageAssetCount==`number`||typeof e.activeVideoAssetCount==`number`?` 图 ${e.activeImageAssetCount||0} / 视 ${e.activeVideoAssetCount||0}`:``})]})},e.id))})})]}),(0,$.jsxs)(`div`,{style:{overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:12},children:[(0,$.jsx)(wW,{allowClear:!0,prefix:(0,$.jsx)(LC,{}),placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onPressEnter:N}),(0,$.jsx)(HC,{allowClear:f!==`image/*`,placeholder:`素材类型`,value:b,onChange:x,style:{width:116},options:f===`image/*`?[{value:`Image`,label:`图片`}]:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:N,loading:k,children:`刷新`})]}),(0,$.jsx)(jG,{spinning:k,children:C.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:p.empty,style:{marginTop:120}}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,maxHeight:420,overflowY:`auto`,paddingRight:4},children:C.filter(e=>f!==`image/*`||e.assetType===`Image`).map(e=>{let t=j.has(e.id)||n.includes(e.id),r=n.includes(e.id),i=Moe(e),a=e.assetType===`Video`;return(0,$.jsxs)(`div`,{onClick:()=>P(e),style:{cursor:r?`not-allowed`:`pointer`,border:t?`2px solid #8b5cf6`:`1px solid #edf0f5`,borderRadius:12,overflow:`hidden`,background:`#fff`,boxShadow:t?`0 8px 20px rgba(139,92,246,0.18)`:`0 4px 12px rgba(15,23,42,0.04)`,opacity:r?.62:1,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{aspectRatio:`1 / 1`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[i?a?(0,$.jsx)(`video`,{src:i,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:i,alt:e.name||p.fallbackName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):a?(0,$.jsx)(X8,{style:{fontSize:32,color:`#94a3b8`}}):(0,$.jsx)(L6,{style:{fontSize:32,color:`#94a3b8`}}),a&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:8,bottom:8,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:Noe(e.videoDuration)})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jC,{})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsx)(S7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name||`未命名素材`}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:6},children:[(0,$.jsx)(qQ,{color:a?`blue`:`default`,children:a?`视频`:`图片`}),(0,$.jsx)(qQ,{children:e.projectName})]})]})]},e.id)})})})]})]})]})},T7=({src:e,size:t=`normal`})=>{let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(1),[d,f]=(0,S.useState)(!1),p=e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`,m=(0,S.useCallback)(()=>{n.current&&(r?n.current.pause():n.current.play(),i(!r))},[r]),h=(0,S.useCallback)(()=>{n.current&&o(n.current.currentTime)},[]),g=(0,S.useCallback)(()=>{n.current&&c(n.current.duration)},[]),_=(0,S.useCallback)(()=>{i(!1),o(0)},[]),v=(0,S.useCallback)(e=>{if(!n.current||s===0)return;let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*s;n.current.currentTime=r,o(r)},[s]),y=(0,S.useCallback)(e=>{if(!n.current)return;let t=parseFloat(e.target.value);n.current.volume=t,u(t),f(t===0)},[]),b=(0,S.useCallback)(()=>{n.current&&(d?(n.current.volume=l||.5,f(!1)):(n.current.volume=0,f(!0)))},[d,l]);(0,S.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`timeupdate`,h),e.addEventListener(`loadedmetadata`,g),e.addEventListener(`ended`,_),()=>{e.removeEventListener(`timeupdate`,h),e.removeEventListener(`loadedmetadata`,g),e.removeEventListener(`ended`,_)}},[h,g,_]);let x=s>0?a/s*100:0;return(0,$.jsxs)(`div`,{style:{width:`100%`,height:t===`small`?130:112,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:t===`small`?`16px 16px`:`12px 16px`},children:[(0,$.jsx)(`audio`,{ref:n,src:e}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[(0,$.jsx)(`button`,{onClick:m,style:{width:48,height:48,borderRadius:`50%`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,flexShrink:0},children:r?(0,$.jsx)(T6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(K6,{style:{fontSize:24,color:`#fff`,marginLeft:2}})}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:8},children:[(0,$.jsxs)(`div`,{onClick:v,style:{height:5,background:`#e2e8f0`,borderRadius:10,cursor:`pointer`,overflow:`visible`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{height:`100%`,width:`${x}%`,background:`linear-gradient(90deg, #8b5cf6, #a78bfa)`,borderRadius:10,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${x}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:t===`small`?12:14,height:t===`small`?12:14,background:`#fff`,borderRadius:`50%`,boxShadow:`0 2px 6px rgba(0,0,0,0.15)`,opacity:+(x>0),transition:`opacity 0.2s`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(a)}),(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(s)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,$.jsx)(`button`,{onClick:b,style:{border:`none`,background:`transparent`,cursor:`pointer`,padding:0},children:d?(0,$.jsx)(p4,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}}):(0,$.jsx)(j8,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}})}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.1`,value:d?0:l,onChange:y,style:{width:t===`small`?40:50,height:4,borderRadius:2,appearance:`none`,background:`#e2e8f0`,cursor:`pointer`}})]})]})]})},{Text:E7}=w1,D7=e=>{if(!e)return``;if(/^data:|blob:/i.test(e))return e;if(/^https?:\/\//i.test(e)){let t=new URL(e);return t.pathname.startsWith(`/uploads`)?t.pathname+t.search:e}return`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`},O7=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},k7=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},Poe=e=>{let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n>0&&r>0)return O7(n,r)}else if(e.resourceType===`video`&&n>0&&r>0)return k7(n,r);return null},Foe=e=>new Promise(t=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}),Ioe=e=>e===`video`?(0,$.jsx)(X8,{}):e===`audio`?(0,$.jsx)(O2,{}):(0,$.jsx)(L6,{}),Loe=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,Roe=({open:e,onClose:t,onSelect:n,allowedTypes:r,selectedIds:i=[],title:a=`选择历史上传素材`,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,maxVideoDuration:u,usedVideoDuration:d,maxAudioCount:f,usedAudioCount:p,maxAudioDuration:m,usedAudioDuration:h,hideLimitHint:g,defaultResourceType:_})=>{let[v,y]=(0,S.useState)(_||``),[b,x]=(0,S.useState)(``),[C,w]=(0,S.useState)(1),[T,E]=(0,S.useState)(10),[D,O]=(0,S.useState)(1),[k,A]=(0,S.useState)(10),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(0),[z,B]=(0,S.useState)(``),[V,H]=(0,S.useState)([]),[U,W]=(0,S.useState)(0),[G,K]=(0,S.useState)(new Map),ee=(0,S.useMemo)(()=>new Set(i),[i]),q=(0,S.useMemo)(()=>new Set(r||[`image`,`video`,`audio`]),[JSON.stringify(r)]),te=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`image`).length,[G]),ne=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`video`).length,[G]),re=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`video`).reduce((e,t)=>e+(t.durationSeconds||0),0),[G]),ie=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`audio`).length,[G]),J=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`audio`).reduce((e,t)=>e+(t.durationSeconds||0),0),[G]),ae=(0,S.useMemo)(()=>o!==void 0&&c!==void 0?o-c:1/0,[o,c]),oe=(0,S.useMemo)(()=>s!==void 0&&l!==void 0?s-l:1/0,[s,l]),se=(0,S.useMemo)(()=>u!==void 0&&d!==void 0?u-d:1/0,[u,d]),ce=(0,S.useMemo)(()=>f!==void 0&&p!==void 0?f-p:1/0,[f,p]),le=(0,S.useMemo)(()=>m!==void 0&&h!==void 0?m-h:1/0,[m,h]),ue=(0,S.useMemo)(()=>te>ae,[te,ae]),de=(0,S.useMemo)(()=>ne>oe,[ne,oe]),fe=(0,S.useMemo)(()=>re>se,[re,se]),pe=(0,S.useMemo)(()=>ie>ce,[ie,ce]),me=(0,S.useMemo)(()=>J>le,[J,le]),he=(0,S.useCallback)(async()=>{if(e){P(!0);try{let e=await r7({resourceType:v||void 0,keyword:b||void 0,page:C,pageSize:T,scene:`picker`});I(C===1?e.groups||[]:t=>[...t,...e.groups||[]]),R(e.totalDays||0)}catch(e){Q.error(e?.message||`加载历史上传素材失败`),C===1&&I([]),R(0)}finally{P(!1)}}},[q,b,e,C,T,v]),ge=(0,S.useCallback)(async e=>{M(!0);try{let t=await i7(e,{resourceType:v||void 0,keyword:b||void 0,page:D,pageSize:8,scene:`picker`});H((t.items||[]).filter(e=>q.has(e.resourceType))),W(t.total||0)}catch(e){Q.error(e?.message||`加载历史上传素材失败`),H([]),W(0)}finally{M(!1)}},[q,b,D,k,v]);(0,S.useEffect)(()=>{e&&he()},[e,C,he]),(0,S.useEffect)(()=>{z&&O(1)},[z]),(0,S.useEffect)(()=>{z&&ge(z)},[z,D,ge]),(0,S.useEffect)(()=>{e&&K(new Map)},[e]);let _e=async e=>{if(ee.has(e.id)){Q.warning(`该素材已经在参考内容中`);return}let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n<=0||r<=0){let t=D7(e.previewUrl||e.displayUrl||e.resourceUrl);if(t){let e=await Foe(t);n=e.width,r=e.height}}if(n>0&&r>0){let t=O7(n,r);if(t){Q.error(`${e.fileName||`图片`}:${t}`);return}}}else if(e.resourceType===`video`&&n>0&&r>0){let t=k7(n,r);if(t){Q.error(`${e.fileName||`视频`}:${t}`);return}}K(t=>{let n=new Map(t);return n.has(e.id)?n.delete(e.id):n.set(e.id,e),n})},ve=()=>{let e=Array.from(G.values());if(e.length===0){Q.warning(`请先选择历史素材`);return}n(e),K(new Map),t()},ye=(0,S.useMemo)(()=>[{label:`全部`,value:``},{label:`图片`,value:`image`},{label:`视频`,value:`video`},{label:`音频`,value:`audio`}].filter(e=>!e.value||q.has(e.value)),[q]);return(0,$.jsxs)(nK,{title:a,open:e,onCancel:t,width:1e3,centered:!0,destroyOnHidden:!0,footer:[(0,$.jsx)(Z,{onClick:t,children:`取消`},`cancel`),(0,$.jsxs)(Z,{type:`primary`,onClick:ve,style:{background:`#8b5cf6`},disabled:ue||de||fe||pe||me,children:[`应用选择 (`,G.size,`)`]},`ok`)],children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(YV,{wrap:!0,children:[(0,$.jsx)(HC,{value:v,options:ye,style:{width:120},onChange:e=>{y(e),w(1)}}),(0,$.jsx)(wW,{allowClear:!0,value:b,prefix:(0,$.jsx)(LC,{}),placeholder:`搜索文件名`,style:{width:220},onChange:e=>x(e.target.value),onPressEnter:()=>{w(1),he()}}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:he,children:`刷新`})]}),!g&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:ue?`#ef4444`:`#64748b`,fontWeight:ue?600:400},children:[`还可选取图片 `,te,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:de||fe?`#ef4444`:`#64748b`,fontWeight:de||fe?600:400},children:[`视频还可选取 `,ne,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,re.toFixed(1),`/`,u!==void 0&&d!==void 0?(u-d).toFixed(1):`-`,`秒)`]}),f!==void 0&&(0,$.jsxs)(`span`,{style:{fontSize:13,color:pe||me?`#ef4444`:`#64748b`,fontWeight:pe||me?600:400},children:[`音频还可选取 `,ie,`/`,f!==void 0&&p!==void 0?f-p:`-`,` 个(`,J.toFixed(1),`/`,m!==void 0&&h!==void 0?(m-h).toFixed(1):`-`,`秒)`]})]})]}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`},children:[(0,$.jsx)(E7,{strong:!0,style:{fontSize:14},children:`日期列表`}),(0,$.jsx)(jG,{spinning:N,children:F.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无日期`,style:{padding:`40px 0`}}):(0,$.jsxs)(`div`,{style:{marginTop:12},children:[F.map(e=>(0,$.jsxs)(`div`,{onClick:()=>B(e.generatedDate),style:{padding:`10px 12px`,borderRadius:10,marginBottom:6,cursor:`pointer`,border:z===e.generatedDate?`1px solid #8b5cf6`:`1px solid transparent`,background:z===e.generatedDate?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(`div`,{style:{fontSize:13,fontWeight:500,color:`#334155`},children:e.generatedDate}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:[`共 `,e.total,` 个素材`]})]},e.generatedDate)),L>F.length&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(Z,{size:`small`,onClick:()=>w(C+1),children:`加载更多`})})]})})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,overflowY:`auto`},children:(0,$.jsx)(jG,{spinning:j,children:z?V.length===0?(0,$.jsx)(fC,{description:`该日期暂无可复用的历史上传素材`,style:{padding:`48px 0`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:14},children:V.map(e=>{let t=G.has(e.id),n=ee.has(e.id),r=Poe(e),i=n||!!r,a=D7(e.previewUrl||e.displayUrl||e.resourceUrl);return(0,$.jsxs)(`div`,{onClick:()=>!i&&_e(e),style:{position:`relative`,borderRadius:14,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,background:i?`#f8fafc`:`#fff`,opacity:i?.55:1,cursor:i?`not-allowed`:`pointer`,overflow:`hidden`,boxShadow:t?`0 10px 24px rgba(139, 92, 246, 0.18)`:`0 6px 18px rgba(15,23,42,0.06)`},title:r||void 0,children:[(0,$.jsx)(`div`,{style:{background:`#f1f5f9`},children:e.resourceType===`image`?(0,$.jsx)(`img`,{src:a,alt:e.fileName||e.id,style:{width:`100%`,height:130,objectFit:`cover`}}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:a,muted:!0,style:{width:`100%`,height:130,objectFit:`cover`}}):(0,$.jsx)(T7,{src:a,size:`small`})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsxs)(YV,{size:6,style:{marginBottom:6},children:[(0,$.jsx)(qQ,{color:`purple`,icon:Ioe(e.resourceType),style:{margin:0},children:Loe(e.resourceType)}),e.durationSeconds?(0,$.jsxs)(qQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null,r&&(0,$.jsx)(qQ,{color:`red`,style:{margin:0},children:`尺寸不符`})]}),(0,$.jsx)(E7,{ellipsis:!0,style:{display:`block`,fontSize:13,color:`#334155`},title:e.fileName||e.id,children:e.fileName||e.id}),(0,$.jsx)(E7,{type:`secondary`,style:{fontSize:12},children:e.moduleLabel||`普通上传`})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jC,{})}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(qQ,{children:`已选`})}),r&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`rgba(239, 68, 68, 0.9)`,color:`#fff`,padding:`4px 8px`,fontSize:11,textAlign:`center`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:r})]},e.id)})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:16,paddingBottom:8},children:(0,$.jsx)(uG,{current:D,pageSize:k,total:U,showSizeChanger:!0,onChange:(e,t)=>{O(e),A(t)}})})]}):(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`请选择日期`,style:{padding:`80px 0`}})})})]})]})},A7=({children:e,accept:t=`image/*,video/*`,multiple:n=!0,onLocalSelect:r,onHistorySelect:i,onPortraitSelect:a,onPortraitLibrarySelect:o,uploading:s,tooltipTitle:c,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,mediaType:b})=>{let x=(0,S.useRef)(null),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(`real_person`),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),N=()=>{A(!1),x.current?.click()},P=e=>{let t=e.target.files;t&&r&&r(Array.from(t)),x.current&&(x.current.value=``)},F=e=>{if(A(!1),a){E(e),w(!0);return}if(o){o(e);return}E(e),w(!0)},I=(0,$.jsxs)(`div`,{style:{padding:`4px 0`,minWidth:180},children:[(0,$.jsxs)(`div`,{onClick:()=>{N()},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(UX,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`本地上传`})]}),(0,$.jsxs)(`div`,{onClick:()=>{A(!1),O(!0)},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(K4,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`从资产中选择`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`real_person`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(J8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`真人素材库`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`aigc_virtual`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(L8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`虚拟素材库`})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`input`,{ref:x,type:`file`,accept:t,multiple:n,onChange:P,style:{display:`none`}}),c?(0,$.jsx)(jw,{title:c,children:(0,$.jsx)(zw,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})})}):(0,$.jsx)(zw,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})}),(0,$.jsx)(Roe,{open:D,onClose:()=>O(!1),onSelect:e=>{i?.(e),O(!1)},allowedTypes:t.includes(`audio`)?[`image`,`video`,`audio`]:[`image`,`video`],maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,maxVideoDuration:m,usedVideoDuration:p,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,defaultResourceType:`image`}),(0,$.jsx)(w7,{open:C,libraryType:T,onClose:()=>w(!1),onSelect:e=>{a?.(e),w(!1)},accept:t,maxCount:t===`image/*`&&!n?1:void 0,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m})]})};function zoe(){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 Boe={prompt_processing:`optimizing`,ready:`prompt_optimized`,generating:`generating`,success:`completed`,failure:`failed`},Voe=new Set([`pending`,`optimizing`,`generating`]),j7=new Set([`queued`,`preparing`,`creating_provider_task`,`provider_result_staged`,`waiting_remote`,`polling`,`result_ready`,`download_queued`,`downloading`,`retry_waiting`,`recovery_inconsistent`,`upscale_queued`,`upscale_processing`,`upscale_polling`,`upscale_downloading`,`upscale_finalizing`,`upscale_retry_waiting`]),M7=new Set([`completed`,`done`]),N7=new Set([`failed`,`timeout`,`download_failed`,`upscale_failed`]),Hoe=new Set([...M7,...N7,`deleted`]),Uoe={pending:`待处理`,optimizing:`提词处理中`,prompt_optimized:`待生成`,generating:`生成中`,queued:`生成中`,preparing:`生成中`,creating_provider_task:`生成中`,provider_result_staged:`生成中`,waiting_remote:`生成中`,polling:`生成中`,result_ready:`生成中`,download_queued:`生成中`,downloading:`生成中`,retry_waiting:`生成中`,recovery_inconsistent:`生成中`,upscale_queued:`生成中`,upscale_processing:`生成中`,upscale_polling:`生成中`,upscale_downloading:`生成中`,upscale_finalizing:`生成中`,upscale_retry_waiting:`生成中`,completed:`成功`,done:`成功`,timeout:`失败`,download_failed:`失败`,upscale_failed:`失败`,failed:`失败`,deleted:`已删除`},Woe={pending:`default`,optimizing:`processing`,prompt_optimized:`blue`,generating:`processing`,queued:`processing`,preparing:`processing`,creating_provider_task:`processing`,provider_result_staged:`processing`,waiting_remote:`processing`,polling:`processing`,result_ready:`processing`,download_queued:`processing`,downloading:`processing`,retry_waiting:`orange`,recovery_inconsistent:`orange`,upscale_queued:`purple`,upscale_processing:`purple`,upscale_polling:`purple`,upscale_downloading:`purple`,upscale_finalizing:`purple`,upscale_retry_waiting:`orange`,completed:`success`,done:`success`,failed:`error`,timeout:`error`,download_failed:`error`,upscale_failed:`error`,deleted:`default`},P7=e=>String(e||``).trim().toLowerCase(),Goe=e=>{let t=P7(e);return Uoe[t]||t||`未知状态`},Koe=e=>Woe[P7(e)]||`default`,F7=e=>{let t=P7(e.status),n=P7(e.displayStatus),r=P7(e.pipelineStage),i=Boe[P7(e.clientStatus)]||``,a=i||n||t||r||`pending`;N7.has(r)||N7.has(t)||N7.has(n)?a=N7.has(r)?r:N7.has(t)?t:n:M7.has(t)||M7.has(n)?a=M7.has(t)?t:n:!i&&r&&j7.has(r)&&(a=r);let o=N7.has(a),s=M7.has(a),c=typeof e.shouldPoll==`boolean`?e.shouldPoll:!o&&!s&&(Voe.has(t)||j7.has(r)),l=c;return{status:t,displayStatus:n,pipelineStage:r,effectiveKey:a,label:Goe(a),color:Koe(a),isActive:l,isSuccess:s,isFailure:o,isTerminal:Hoe.has(a),canGenerate:typeof e.canGenerate==`boolean`?e.canGenerate:t===`prompt_optimized`,canRetry:typeof e.canRetry==`boolean`?e.canRetry:o,shouldPoll:c}},I7=({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:`#fff`,border:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#374151`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(KZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Bi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,maxHeight:200,overflowY:`auto`,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)(w1.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)]})},qoe=({group:e,groupName:t,selected:n,expanded:r,onToggle:i,onSelect:a,onClose:o})=>{let s=(0,S.useRef)(null),c=(0,S.useRef)(null),l=(0,S.useRef)(r),[u,d]=(0,S.useState)(null);return l.current=r,(0,S.useEffect)(()=>{if(r&&s.current){let e=s.current.getBoundingClientRect();d({bottom:window.innerHeight-e.top+4,left:e.left})}else d(null)},[r]),(0,S.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||c.current?.contains(e.target)||l.current&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r,o]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:s,onClick:()=>i(t),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:`#ffffffff`,border:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsx)(w1.Text,{style:{fontSize:13,color:`#374151`,fontWeight:500,lineHeight:`18px`},children:n||e.name}),(0,$.jsx)(KZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:r?`rotate(180deg)`:`rotate(0deg)`}})]}),u&&(0,Bi.createPortal)((0,$.jsxs)(`div`,{ref:c,style:{position:`fixed`,bottom:u.bottom,left:u.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)(w1.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,r)=>{let i=n===e;return(0,$.jsx)(`div`,{onClick:()=>{a(e,t),o()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:i?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:i?`#fff`:`#1a1a2e`,fontWeight:i?600:400},onMouseEnter:e=>{i||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{i||(e.currentTarget.style.background=`transparent`)},children:e},r)})})]}),document.body)]})},L7=({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)(K6,{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)})]})},Joe=()=>{let{projectId:e}=Qe(),t=Je(),[n]=UH.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c,retryGeneration:l}=h7(),u=i.items,{user:d,optimizeHoldCredits:f}=l7(),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)({}),[A,j]=(0,S.useState)({}),[M,N]=(0,S.useState)({}),P=(0,S.useRef)(null),F=(0,S.useCallback)(e=>{if(!e)return 0;let t=new Date(e).getTime(),n=(Date.now()-t)/1e3;return n>=180?99:Math.min(99,n*.6)},[]);(0,S.useEffect)(()=>{let e=Object.entries(E).filter(([,e])=>e===`generating`).map(([e])=>e);if(e.length===0){P.current&&=(clearInterval(P.current),null);return}let t=()=>{e.forEach(e=>{let t=h7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=F(t.createdAt);k(t=>({...t,[e]:n})),j(t=>({...t,[e]:n}))}})};return t(),P.current=window.setInterval(t,1e3),()=>{P.current&&=(clearInterval(P.current),null)}},[E,F]),(0,S.useEffect)(()=>{Object.entries(E).forEach(([e,t])=>{if(t===`done`&&!M[e]){N(t=>({...t,[e]:!0}));let t=A[e]||0,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/800,1),o=1-(1-a)**3,s=t+(100-t)*o;j(t=>({...t,[e]:s})),a<1&&requestAnimationFrame(r)};requestAnimationFrame(r)}})},[E]),(0,S.useEffect)(()=>{Object.entries(E).forEach(([e,t])=>{if(t===`generating`){let t=h7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=F(t.createdAt);k(t=>({...t,[e]:n})),j(t=>({...t,[e]:n}))}}})},[_]);let[I,L]=(0,S.useState)({}),[R,z]=(0,S.useState)(null),[B,V]=(0,S.useState)(null),[H,U]=(0,S.useState)([]),[W,G]=(0,S.useState)(!1),[K,ee]=(0,S.useState)(``),[q,te]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(``),ie=(0,S.useRef)(null),[J,ae]=(0,S.useState)({}),[oe,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)({}),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(null),[me,he]=(0,S.useState)(5),[ge,_e]=(0,S.useState)(`9:16`),[ve,ye]=(0,S.useState)(`720p`),[be,xe]=(0,S.useState)([]),[Se,Ce]=(0,S.useState)([]),[we,Te]=(0,S.useState)(``),[Ee,De]=(0,S.useState)(!1),[Oe,ke]=(0,S.useState)(null),[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(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]});(0,S.useMemo)(()=>Me.durations.map(e=>`${e}`),[Me.durations]),(0,S.useCallback)(()=>{ke(e=>e===`duration`?null:`duration`)},[]),(0,S.useCallback)(()=>{ke(null)},[]);let Pe=(0,S.useCallback)(e=>{de(t=>t===e?null:e)},[]),Fe=(0,S.useCallback)(()=>{de(null)},[]);(0,S.useCallback)(e=>{he(parseInt(e))},[]);let Ie=(0,S.useCallback)((e,t)=>{le(n=>{let r={...n};return r[t]===e?delete r[t]:r[t]=e,r})},[]),[Le,Re]=(0,S.useState)(0),[ze,Be]=(0,S.useState)(0),[Ve,He]=(0,S.useState)(`video`),[Ue,We]=(0,S.useState)(`1:1`),[Ge,Ke]=(0,S.useState)(`2K`),[qe,Ye]=(0,S.useState)(2048),[Xe,Ze]=(0,S.useState)(2048),[$e,et]=(0,S.useState)(!1),[tt,nt]=(0,S.useState)([]),[rt,it]=(0,S.useState)([]),[at,ot]=(0,S.useState)([]),st=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},ct=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},lt=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Q.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Q.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=H.filter(e=>e.type===`image`).length,a=H.filter(e=>e.type===`video`).length,o=H.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(t&&i>=5)return Q.error(`最多上传5张图片`),!1;if(n&&a>=2)return Q.error(`最多上传2个视频`),!1;let s=0;if(n){let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t({duration:n.duration||0,width:n.videoWidth||0,height:n.videoHeight||0}),n.remove()},n.onerror=()=>{t({duration:0,width:0,height:0}),n.remove()},n.src=URL.createObjectURL(e)});if(s=t.duration,t.width>0&&t.height>0){let e=ct(t.width,t.height);if(e)return Q.error(`${e}`),!1}if(o+s>15)return Q.error(`视频总时长不能超过15秒`),!1}else{let t=await new Promise(t=>{let n=document.createElement(`img`);n.onload=()=>{t({width:n.width,height:n.height}),URL.revokeObjectURL(n.src)},n.onerror=()=>{t({width:0,height:0}),URL.revokeObjectURL(n.src)},n.src=URL.createObjectURL(e)});if(t.width>0&&t.height>0){let e=st(t.width,t.height);if(e)return Q.error(`${e}`),!1}}G(!0);try{let r;r=t?await b5(e):await x5(e,s);let o=t?`图片`:`视频`,c=t?i+1:a+1;U(e=>[...e,{url:r.url,type:t?`image`:`video`,name:`${o}${c}`,duration:n?s:void 0}]),Q.success(`${o}上传成功`)}catch{Q.error(`上传失败`)}finally{G(!1)}return!1};(0,S.useEffect)(()=>{if(rae().then(e=>{nt(e.video),ot(e.image)}),L5().then(e=>{it(e)}),!$e&&!Ae)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&(et(!1),je(!1))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[$e,Ae]);let ut=e=>{let t=Array.isArray(e)?e:[];return{inputImageCount:t.filter(e=>e.type===`image`).length,inputVideoDuration:t.filter(e=>e.type===`video`).reduce((e,t)=>e+Number(t.duration||0),0)}},dt=()=>{let e={};if(e=rt.find(e=>e.modelConfigId===(_?.engineId||we)&&e.genType===Ve&&e.resolution===(Ve===`video`?_?.resolution||ve:_?.imageSize||Ge)),e||=Ve===`video`?{perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0}:{perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},Ve===`video`){let t=((_?.duration||me)*e.perSecondCredits+e.baseCredits)*e.ratio;if(_?.includeMediaReferences??Ee){let n=ut(_?.references||H);if(n.inputVideoDuration>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n.inputVideoDuration)*(e.inputVideoRatio||1);t+=r}if(n.inputImageCount>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n.inputImageCount)*(e.inputImageRatio||1);t+=r}}return Number(t.toFixed(2))}else{let t=e.baseCredits*e.ratio;if(_?.includeMediaReferences??Ee){let n=ut(_?.references||H);if(n.inputImageCount>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n.inputImageCount)*(e.inputImageRatio||1);t+=r}}return Number(t.toFixed(2))}},ft=e=>{let t=e.genType||e.gen_type||`video`,n=e.engineId||e.engine_id,r=e.resolution,i=Number(e.duration||0),a=e.imageSize||e.image_size,o=e.includeMediaReferences??e.include_media_references??!1,s=e.references||[],c=rt.find(e=>e.modelConfigId===n&&e.genType===t&&e.resolution===(t===`video`?r:a));c||=t===`video`?{perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0}:{perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let l=0;if(t===`video`){if(l=(i*c.perSecondCredits+c.baseCredits)*c.ratio,o){let e=ut(s);if(e.inputVideoDuration>0){let t=((c.inputVideoBaseCredits||0)+(c.inputVideoPerSecondCredits||0)*e.inputVideoDuration)*(c.inputVideoRatio||1);l+=t}if(e.inputImageCount>0){let t=((c.inputImageBaseCredits||0)+(c.inputImagePerImageCredits||0)*e.inputImageCount)*(c.inputImageRatio||1);l+=t}}}else if(l=c.baseCredits*c.ratio,o){let e=ut(s);if(e.inputImageCount>0){let t=((c.inputImageBaseCredits||0)+(c.inputImagePerImageCredits||0)*e.inputImageCount)*(c.inputImageRatio||1);l+=t}}return Number(l.toFixed(2))},pt=e=>{St(e);let t=Tt[Ge]?.[e];if(t){let[e,n]=t.split(/x/i).map(Number);Ye(e),Ze(n)}},mt=e=>{wt(e);let t=Object.keys(Tt[e]||{});gt(t.map(e=>({value:e,label:e})));let n=t.includes(Ue)?Ue:t[0]||`1:1`;n!==Ue&&We(n);let r=Tt[e]?.[n];if(r){let[e,t]=r.split(/x/i).map(Number);Ye(e),Ze(t)}},[ht,gt]=(0,S.useState)([]),[_t,vt]=(0,S.useState)([]),[yt,bt]=(0,S.useState)([]),[xt,St]=(0,S.useState)(0),[Ct,wt]=(0,S.useState)(0),[Tt,Et]=(0,S.useState)({});(0,S.useEffect)(()=>{yt[Ct]&&yt[Ct][xt]!==void 0&&(Ye(yt[Ct][xt].substring(0,4)),Ze(yt[Ct][xt].substring(5)))},[xt]),(0,S.useEffect)(()=>{yt[Ct]&&yt[Ct][xt]!==void 0&&(Ye(yt[Ct][xt].substring(0,4)),Ze(yt[Ct][xt].substring(5)))},[Ct]);let Dt=()=>{Ye(Xe),Ze(qe)},Ot=e=>{let t=e.target.value===`image`?`image`:`video`;He(t);let n=(t===`image`?Se:be).filter(e=>e.supportsUniversalReference!==!1);n.length>0&&At(n[0].id)};(0,S.useEffect)(()=>{j5().then(e=>{ae(Object.fromEntries(e.map(e=>[e.key,e.label]))),se(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Zie().then(e=>{let t=e.items||[];Ce(t);let n=t?.[0]?.supportedSizes||{};Et(n);let r=Object.keys(n);vt(r.map(e=>({value:e,label:e})));let i=r.includes(Ge)?Ge:r[0]||`2K`,a=Object.keys(n[i]||{});gt(a.map(e=>({value:e,label:e})));let o=a.includes(Ue)?Ue:a[0]||`1:1`;o!==Ue&&We(o);let s=n[i]?.[o];if(s){let[e,t]=s.split(/x/i).map(Number);Ye(e),Ze(t)}}).catch(()=>{}),Xie().then(e=>{if(xe(e.items||[]),e.items?.length){let t=e.items[0];Te(e=>e||t.id),Ne({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)(()=>{if(!_)return;let e=_.genType||Ve,t=e===`image`?Se:be,n=_.engineId||``,r=t.find(e=>e.id===n)||t[0];if(r)if(Te(r.id),e===`image`){let e=r.supportedSizes||{};Et(e);let t=Object.keys(e),n=t.includes(_.imageSize||``)?_.imageSize:t[0]||_.imageSize||`2K`;Ke(n);let i=Object.keys(e[n]||{}),a=i.includes(_.imageProportion||``)?_.imageProportion:i[0]||_.imageProportion||`1:1`;We(a);let o=e[n]?.[a]||_.imagePx||``;if(o){let[e,t]=String(o).split(/x/i).map(Number);e>0&&t>0&&(Ye(e),Ze(t))}}else Ne({ratios:r.supportedRatios?.length?r.supportedRatios:[`16:9`],resolutions:r.supportedResolutions?.length?r.supportedResolutions:[`720p`],durations:r.supportedDurations?.length?r.supportedDurations:[5]}),r.supportedRatios?.includes(ge)||_e(r.supportedRatios?.[0]||`16:9`),r.supportedResolutions?.includes(ve)||ye(r.supportedResolutions?.[0]||`720p`),r.supportedDurations?.includes(me)||he(r.supportedDurations?.[0]||_.duration||5);De(!!_.includeMediaReferences)},[_?.id,_?.engineId,be,Se]);let kt=e=>{let t=be.find(t=>t.id===e)||be[0];return{ratios:t?.supportedRatios?.length?t.supportedRatios:[`16:9`],resolutions:t?.supportedResolutions?.length?t.supportedResolutions:[`720p`],durations:t?.supportedDurations?.length?t.supportedDurations:[5]}},At=e=>{Te(e);let t=(Ve===`image`?Se:be).find(t=>t.id===e);if(!t)return;if(Ve===`image`){let e=t.supportedSizes||{};Et(e);let n=Object.keys(e);vt(n.map(e=>({value:e,label:e})));let r=n.includes(Ge)?Ge:n[0]||`2K`,i=Object.keys(e[r]||{});gt(i.map(e=>({value:e,label:e})));let a=i.includes(Ue)?Ue:i[0]||`1:1`;Ke(r),We(a);let o=e[r]?.[a]||``;if(o){let[e,t]=String(o).split(/x/i).map(Number);e>0&&t>0&&(Ye(e),Ze(t))}return}let n=kt(e);Ne(n),_e(n.ratios[0]),ye(n.resolutions[0]),he(n.durations[0])};(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let jt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{jt.current||u.length===0||(jt.current=!0,u.forEach(t=>{t.projectId===e&&t.status===`generating`&&(D(e=>({...e,[t.id]:`generating`})),nn(t.id)),t.projectId===e&&t.status===`optimizing`&&zt(t.id)}))},[u,e]);let Mt=(0,S.useRef)(new Set),Nt=(0,S.useRef)(null),Pt=(0,S.useRef)(null),Ft=e=>{Mt.current.add(e),Rt()},It=e=>{Mt.current.delete(e),Mt.current.size===0&&Lt()},Lt=()=>{Nt.current&&=(clearInterval(Nt.current),null),Pt.current&&=(Pt.current.abort(),null)},Rt=()=>{Nt.current||=setInterval(async()=>{try{Pt.current&&Pt.current.abort();let t=new AbortController;Pt.current=t;let n=await v5({projectId:e,page:1,pageSize:100,signal:t.signal});Pt.current=null;let r=Array.from(Mt.current),i=[];if(r.length>0){let e=h7.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});h7.setState({records:{...e,items:t}}),i.forEach(e=>{It(e)})}}catch(e){e.name}},3e3)},zt=e=>{Ft(e)},Bt=(0,S.useRef)(!1),Vt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Bt.current||u.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,engineId:o,genType:s,aspectRatio:c,resolution:l,imageSize:d,imageProportion:f,imagePx:p,includeMediaReferences:m,referenceIds:h,ts:_}=JSON.parse(t);if(Date.now()-_>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(Vt.current===n)return;let y=u.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.engineId===o&&String(e.genType||`video`)===String(s||`video`)&&String(e.aspectRatio||``)===String(c||``)&&String(e.resolution||``)===String(l||``)&&String(e.imageSize||``)===String(d||``)&&String(e.imageProportion||``)===String(f||``)&&String(e.imagePx||``)===String(p||``)&&!!e.includeMediaReferences==!!m&&JSON.stringify((e.references||[]).map(e=>e.upload_resource_id||e.url).filter(Boolean).sort())===JSON.stringify((h||[]).slice().sort())&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>_-1e4);y?(Bt.current=!0,localStorage.removeItem(`pending_optimize`),v(y),b(y.optimizedPrompt||``),Re(y.textCreditsCost),Be(y.textTokensUsed),g(!0),Q.success({content:`优化请求已恢复,消耗 ${y.textCreditsCost} 积分`,key:`recovery`})):Date.now()-_>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[u,e]);let Ht=r.find(t=>t.id===e),Ut=u.filter(t=>t.projectId===e),Wt=Ht?.name??`项目`,Gt=(0,S.useMemo)(()=>Ht&&oe[Ht.industry]||[],[Ht,oe]),Kt=d?.credits??0,qt=Kt>=dt(),Jt=async()=>{try{if(!e){Q.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Q.error(`请输入视频/图片描述`);return}if(!we){Q.error(`请选择生成引擎`);return}if(Ve===`video`&&(!ge||!ve)){Q.error(`请选择视频比例和分辨率`);return}m(!0);let r=Object.entries(ce).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=zoe();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:me,engineId:we,genType:Ve,aspectRatio:Ve===`video`?ge:``,resolution:Ve===`video`?ve:``,imageSize:Ve===`image`?Ge:``,imageProportion:Ve===`image`?Ue:``,imagePx:Ve===`image`?`${qe}x${Xe}`:``,includeMediaReferences:Ee,referenceIds:H.map(e=>e.upload_resource_id||e.url).filter(Boolean).sort(),ts:Date.now()})),Vt.current=a;let o=await s(e,{prompt:i,duration:Ve===`video`?me:void 0,genType:Ve,engineId:we,includeMediaReferences:Ee,aspectRatio:Ve===`video`?ge:void 0,resolution:Ve===`video`?ve:void 0,references:H.length>0?H:void 0,idempotencyKey:a,image_size:Ve===`image`?Ge:void 0,image_proportion:Ve===`image`?Ue:void 0,image_px:Ve===`image`?qe+`x`+Xe:void 0});localStorage.removeItem(`pending_optimize`),Vt.current=null,v(o.record),b(o.record.optimizedPrompt||``),Re(o.textCreditsCost),Be(o.textTokensUsed),g(!0),Q.success({content:`「${Wt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Q.error(t)}finally{m(!1),localStorage.removeItem(`pending_optimize`),Vt.current=null}},Yt=(0,S.useRef)(new Set),Xt=(0,S.useRef)(null),Zt=(0,S.useRef)(null),Qt=e=>{Yt.current.add(e),tn()},$t=e=>{Yt.current.delete(e),Yt.current.size===0&&en()},en=()=>{Xt.current&&=(clearInterval(Xt.current),null),Zt.current&&=(Zt.current.abort(),null)},tn=()=>{Xt.current||=setInterval(async()=>{try{Zt.current&&Zt.current.abort();let t=new AbortController;Zt.current=t;let n=await v5({projectId:e,page:1,pageSize:100,signal:t.signal});Zt.current=null;let r=Array.from(Yt.current),i=[];if(r.length>0){let e=h7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t){let n=E[e.id];return t.shouldPoll??t.status===`generating`?n!==`generating`&&D(t=>({...t,[e.id]:`generating`})):i.push(e.id),t}}return e});h7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);$t(e),t?.status===`completed`?(D(t=>({...t,[e]:`done`})),v(n=>n?.id===e?t:n),Q.success({content:`「${Wt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(D(t=>({...t,[e]:`failed`})),v(n=>n?.id===e?t:n),Q.error({content:`「${Wt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name}},5e3)},nn=e=>{Qt(e)};(0,S.useEffect)(()=>()=>{en(),Lt()},[]),(0,S.useEffect)(()=>{u.filter(e=>e.shouldPoll??e.status===`generating`).forEach(e=>{D(t=>({...t,[e.id]:`generating`})),nn(e.id)})},[u]);let rn=async e=>{T(t=>({...t,[e]:!0})),D(t=>({...t,[e]:`generating`})),Q.loading({content:`「${Wt}」正在提交视频生成...`,duration:0,key:e});try{let t=Ut.find(t=>t.id===e)||_;if(!t||t.canGenerate===!1)throw Error(t?.configFallbackHint||`该记录当前不可生成,请重新生成提词`);let n=t.id===_?.id?y:I[e];n&&n!==t.optimizedPrompt&&await w5(e,n),(await c(e)).status===`failed`?(D(t=>({...t,[e]:`failed`})),Q.error({content:`「${Wt}」提交失败`,key:e,duration:3})):(Q.success({content:`「${Wt}」已提交,正在生成中...`,key:e,duration:3}),nn(e))}catch(t){D(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),Q.error({content:`${n}`,key:e,duration:3})}finally{T(t=>({...t,[e]:!1}))}},an=e=>{let t=E[e.id];return F7({status:(t===`done`?`completed`:t)||e.status,pipelineStage:t?null:e.pipelineStage,clientStatus:t?null:e.clientStatus,shouldPoll:t?t===`generating`:e.shouldPoll,canGenerate:e.canGenerate,canRetry:e.canRetry})},on=e=>e.isActive?(0,$.jsx)(Ym,{style:{animation:`spinSlow 1s linear infinite`}}):e.isSuccess?(0,$.jsx)(u4,{}):e.isFailure?(0,$.jsx)(p4,{}):(0,$.jsx)(XB,{});return(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,padding:`24px`,background:`#fff`,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>t(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:Wt}),Ht&&(0,$.jsx)(qQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:6},children:J[Ht.industry]||Ht.industry})]}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsxs)(qQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,Kt,` 积分`]})]}),!h&&(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)(w1.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(eI.Group,{defaultValue:`video`,buttonStyle:`solid`,onChange:Ot,children:[(0,$.jsxs)(eI.Button,{value:`video`,children:[(0,$.jsx)(X8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]}),(0,$.jsxs)(eI.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(L6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]})]})]}),Ve===`video`&&[{icon:(0,$.jsx)(k$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(z8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(u8,{}),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)(w1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),Ve===`image`&&[{icon:(0,$.jsx)(k$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(z8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(u8,{}),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)(w1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(UH,{form:n,initialValues:{},children:[(0,$.jsx)(UH.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:[H.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`&&pe(`https://ceshi.apiforeign.minzhongzc.com${e.url}`)},children:e.type===`image`?(0,$.jsx)(UU,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(L7,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),C5(e.url).catch(()=>{}),U(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)(p4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(A7,{accept:`image/*,video/*`,mediaType:Ve,onLocalSelect:e=>{e.forEach(async e=>{await lt(e)})},onHistorySelect:e=>{e.forEach(e=>{U(t=>[...t,{url:e.resourceUrl||e.previewUrl||e.displayUrl||``,type:e.resourceType,name:e.fileName||``}])}),Q.success(`成功添加${e.length}个历史记录`)},onPortraitSelect:e=>{e.forEach(e=>{U(t=>[...t,{url:e.previewUrl||``,type:e.assetType===`Video`?`video`:`image`,name:e.name||`真人素材`,source:`private_portrait_asset`,private_asset_id:e.id,label:``,duration:e.assetType===`Video`?e.videoDuration||0:void 0}])}),Q.success(`已添加 ${e.length} 个真人素材参考`)},uploading:W,tooltipTitle:`图片${H.filter(e=>e.type===`image`).length}/5,视频${H.filter(e=>e.type===`video`).length}/2`,maxImageCount:5,maxVideoCount:2,usedImageCount:H.filter(e=>e.type===`image`).length,usedVideoCount:H.filter(e=>e.type===`video`).length,usedVideoDuration:H.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,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:W?(0,$.jsx)(Ym,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(JI,{style:{fontSize:18,color:`#94a3b8`}})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(wW.TextArea,{ref:ie,value:K,onChange:e=>{let t=e.target.value;ee(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` + `})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:Se+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:`#f1f2f3`,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:!fe&&(0,$.jsx)(Ct,{})})}),(0,$.jsx)(`div`,{className:`mobile-header`,children:(0,$.jsxs)(`div`,{className:`mobile-header-content`,children:[(0,$.jsx)(`div`,{className:`mobile-menu-btn`,onClick:()=>w(!0),children:(0,$.jsx)(u6,{style:{fontSize:20}})}),(0,$.jsx)(`div`,{className:`mobile-header-title`,children:R}),(0,$.jsx)(`div`,{className:`mobile-header-right`,children:(0,$.jsxs)(`div`,{className:`mobile-credits-badge`,onClick:()=>l(!0),children:[(0,$.jsx)(Q8,{}),(0,$.jsx)(`span`,{children:n?.credits||0})]})})]})}),(0,$.jsx)(`div`,{className:`mobile-content`,children:fe&&(0,$.jsx)(Ct,{})}),(0,$.jsxs)(BV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:10,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.35)`},children:B?(0,$.jsx)(`img`,{src:B,alt:`logo`,style:{width:24,height:24,objectFit:`contain`}}):(0,$.jsx)(z8,{style:{fontSize:18,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{fontWeight:700,fontSize:16,color:`#1e293b`},children:R})]}),placement:`left`,onClose:()=>w(!1),open:C,size:280,closable:!0,className:`mobile-menu-drawer`,styles:{header:{borderBottom:`1px solid #f1f5f9`,padding:`16px 20px`},body:{padding:`12px 8px`,display:`flex`,flexDirection:`column`}},children:[(0,$.jsxs)(`div`,{style:{flex:1,overflow:`auto`,paddingBottom:12},children:[(0,$.jsx)(`div`,{style:{padding:`12px 8px 16px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsx)(Hw,{size:44,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0},children:(0,$.jsx)(J8,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,marginBottom:2},children:n?.username||`用户`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`},children:[(0,$.jsx)(Q8,{style:{color:`#f59e0b`,marginRight:4}}),`积分: `,(0,$.jsx)(`span`,{style:{color:`#f59e0b`,fontWeight:600},children:n?.credits??0})]})]})]})}),(0,$.jsx)(d7,{data:ue}),we.map(e=>{let t=e.menu_type??e.menuType,n=Ce[e.id]&&Ce[e.id].length>0,r=e.path===xe,i=I[e.id],a=f7[e.icon]||(0,$.jsx)(O3,{});return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item ${r&&!n?`mobile-menu-item-active`:``} ${t===`group`?`mobile-menu-group`:``}`,onClick:()=>Te(e),children:[t!==`group`&&(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:r?`#6366f1`:`#64748b`},children:a}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{paddingLeft:0,color:t===`group`?`#94a3b8`:r?`#4f46e5`:`#475569`,fontWeight:t===`group`||r?600:400,fontSize:t===`group`?12:15,textTransform:t===`group`?`uppercase`:`none`,letterSpacing:t===`group`?.5:0},children:e.label}),(t===`group`||n)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#cbd5e1`,transition:`transform 0.2s ease`,transform:i?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Bg,{})})]}),(t===`group`||n)&&i&&(0,$.jsx)(`div`,{className:`mobile-submenu`,children:(Ce[e.id]||[]).map(e=>{let t=e.path===xe,n=f7[e.icon]||(0,$.jsx)(O3,{});return(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-submenu-item ${t?`mobile-menu-item-active`:``}`,onClick:()=>Te(e),children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:t?`#6366f1`:`#94a3b8`},children:n}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:t?`#4f46e5`:`#64748b`,fontWeight:t?600:400,fontSize:14},children:e.label})]},e.id)})})]},e.id)})]}),(0,$.jsxs)(`div`,{style:{padding:`8px 0`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=credits`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#f59e0b`},children:(0,$.jsx)(Q8,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`积分明细`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=orders`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#6366f1`},children:(0,$.jsx)(eH,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`订单记录`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/messages`),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#8b5cf6`},children:(0,$.jsx)(B2,{})}),(0,$.jsxs)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:[`消息中心`,b>0&&(0,$.jsx)(qQ,{color:`red`,style:{marginLeft:8,fontSize:11},children:b})]})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{s(!0),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#0ea5e9`},children:(0,$.jsx)(Y3,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`个人信息`})]}),(0,$.jsx)(`div`,{style:{height:8}}),(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-recharge-item`,onClick:()=>{l(!0),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#fff`},children:(0,$.jsx)(JI,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#fff`,fontWeight:600},children:`充值积分`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{Ae(),w(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#ef4444`},children:(0,$.jsx)(t6,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#ef4444`},children:`退出登录`})]})]})]}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(x8,{}),`账号设置`]}),open:o,onCancel:()=>{s(!1),f.resetFields(),p.resetFields()},width:440,footer:null,children:(0,$.jsxs)(vL,{defaultActiveKey:`profile`,children:[(0,$.jsx)(vL.TabPane,{tab:`个人信息`,children:(0,$.jsxs)(UH,{form:p,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(UH.Item,{name:`username`,label:`用户名`,rules:[{required:!0,message:`请输入用户名`},{min:3,message:`用户名至少3位`}],children:(0,$.jsx)(wW,{placeholder:`请输入用户名`,size:`large`,prefix:(0,$.jsx)(J8,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{children:(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:ke,style:{width:`100%`},children:`确认修改`})})]})},`profile`),(0,$.jsx)(vL.TabPane,{tab:`修改密码`,children:(0,$.jsxs)(UH,{form:f,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(UH.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(wW.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(wW.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.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)(wW.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(UH.Item,{children:(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:Oe,style:{width:`100%`},children:`确认修改`})})]})},`password`)]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p3,{}),`积分充值`]}),open:c,onCancel:()=>{l(!1),h(null)},width:680,className:`recharge-modal`,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,padding:`12px 0 0`,borderTop:`1px solid #f0f0f0`},children:[(0,$.jsx)(Z,{size:`large`,onClick:()=>{l(!1),h(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,disabled:!m||!ce.alipay&&!ce.wechat,loading:ne,onClick:async()=>{let e=v.find(e=>e.id===m);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{re(!0);let n=await tae(e.id,q),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(ee({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),l(!1),G(!0),se.current=n.orderNo,localStorage.setItem(ge,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),Ne(n.orderNo)):(Q.success(`充值成功!积分已到账`),l7.getState().refreshUser(),l(!1),h(null))}catch(e){Q.error(e?.message||`创建订单失败,请重试`)}finally{re(!1)}},style:{borderRadius:10,fontWeight:600,background:m?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:m?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]}),children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(YV,{style:{marginBottom:16},children:[(0,$.jsx)(Q8,{style:{color:`#6366f1`}}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(w1.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),!ce.alipay&&!ce.wechat?(0,$.jsx)(`div`,{style:{marginBottom:16,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(w1.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(eI.Group,{value:q,onChange:e=>te(e.target.value),style:{display:`flex`,gap:12},children:[ce.alipay&&(0,$.jsxs)(eI.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:q===`alipay`?`#1677ff`:void 0,color:q===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(s2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),ce.wechat&&(0,$.jsxs)(eI.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:q===`wechat`?`#07c160`:void 0,color:q===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(t5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(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)(P3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsxs)(w1.Text,{style:{color:`#64748b`,fontSize:13},children:[`当前平台仅支持支付宝/微信扫码充值,如需转账支付请`,(0,$.jsx)(w1.Text,{style:{color:`#ff0000ff`,cursor:`pointer`,textDecoration:`underline`},onClick:()=>{l(!1),d(!0)},children:`联系我们`})]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:v.map((e,t)=>{let n=p7[t%p7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>h(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:m===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:m===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(qQ,{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)(w1.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(w1.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)})})]})}),(0,$.jsx)(nK,{open:W,onCancel:async()=>{if(Me(),se.current){try{await N5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),G(!1),ee(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:K?.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:K?.method===`alipay`?(0,$.jsx)(s2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(t5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:K?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:13},children:K?.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:K&&(0,$.jsx)(i2,{value:K.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:[`¥`,K?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,K?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:ie<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:ie<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:ie<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:ie}),` 秒后关闭`]})})]})]}),(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)(Z,{size:`large`,block:!0,onClick:async()=>{if(Me(),se.current){try{await N5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),G(!1),ee(null),h(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(Coe,{}),(0,$.jsx)(`div`,{className:`contact-button-wrapper`,style:{right:`${A.x}px`,bottom:`${window.innerHeight-A.y}px`},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{className:`contact-tooltip`,style:{opacity:+!!T},children:`联系我们`}),(0,$.jsx)(`button`,{className:`contact-button ${M?`dragging`:``}`,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),onMouseDown:_e,onMouseUp:ye,children:(0,$.jsx)(p6,{style:{fontSize:20}})})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p6,{}),`联系我们`]}),open:u,onCancel:()=>{d(!1),D.resetFields()},footer:null,width:480,className:`contact-modal`,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(UH,{form:D,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(wW,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(wW,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(UH.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(wW.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(Z,{size:`large`,onClick:()=>{d(!1),D.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,onClick:je,loading:O,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},Eoe=`http://localhost:8000/api`,Doe=()=>{let{checkAuth:e}=l7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s]=Dn(),c=s.get(`redirect`),l=s.get(`tab`),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(!1),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`智创`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`智创`,siteLogo:``}})(),[M,N]=(0,S.useState)(j.siteName),[P,F]=(0,S.useState)(j.siteLogo),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),[H,U]=(0,S.useState)(``),W=Je(),{login:G}=l7(),[K]=UH.useForm(),[ee]=UH.useForm(),[q]=UH.useForm();(0,S.useEffect)(()=>{E5().then(e=>{N(e.siteName),F(e.siteLogo),L(e.loginBgVideo||``),V(e.userAgreementPrivacyUrl),U(e.siteCopyright)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{l===`register`&&i(`register`)},[l]);let te=()=>{if(c)try{W(decodeURIComponent(c));return}catch{}W(`/home`)},ne=()=>m?!0:(Q.warning(`请先阅读并同意用户协议及隐私政策`),!1),re=async()=>{if(ne())try{let t=await K.validateFields();await G(t.phone,t.password,void 0,t.rememberMe),Q.success(`登录成功,欢迎回来`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}},ie=async()=>{if(ne())try{let t=ee.getFieldsValue();if(!t.phone||!t.code){Q.error(`请填写手机号和验证码`);return}n(!0),await jie(t.phone,t.code),Q.success(`登录成功,欢迎回来`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}finally{n(!1)}},J=async()=>{if(ne())try{let t=await q.validateFields();n(!0),await Mie(t.phone,t.regCode,t.password),Q.success(`注册成功`),await e(),te()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Q.error(t)}finally{n(!1)}},ae=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),_(!1),t?O(!0):A(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{u===0&&r===`phone`&&x(!1)},[u,r]);let oe=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Q.error(`请输入正确的手机号`);return}if(t){_(!0),y(!1);return}if(!b){_(!0),x(!1);return}let n=``;n=r===`register`?`register`:`login`,await D5(e,n),ae(t?p:d),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(y(!1),p(0)):(x(!1),d(0)),w(e=>e+1)}},se=async(e=!1)=>{let t=r===`register`?q.getFieldValue(`phone`):ee.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await D5(t,e),r===`register`?(y(!0),ae(p,!0)):(x(!0),ae(d,!1)),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(y(!1),p(0),O(!0)):(x(!1),d(0),A(!0)),w(e=>e+1)}},ce=e=>{o(e),i(e),d(0),p(0),x(!1),y(!1),_(!1),O(!1),A(!1),w(e=>e+1),e===`password`?K.resetFields():ee.resetFields()},le={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,borderRadius:10,fontSize:14},ue=e=>{if(!e){Q.warning(`暂未上传协议文件`);return}e.startsWith(`http://`)||e.startsWith(`https://`)?window.open(e,`_blank`):window.open(`${Eoe.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-page`,children:[(0,$.jsx)(Ooe,{src:I,onReady:()=>z(!0)}),(0,$.jsx)(`div`,{className:`login-bg-overlay`,style:{opacity:+!!R}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,opacity:+!!R,transition:`opacity 0.5s ease`,pointerEvents:R?`auto`:`none`},children:[(0,$.jsx)(`div`,{className:`login-slogan`,children:(0,$.jsx)(`span`,{className:`login-slogan-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(`div`,{className:`login-center`,children:(0,$.jsxs)(bL,{className:`login-card`,styles:{body:{padding:`32px 32px`}},children:[(0,$.jsx)(`div`,{className:`login-card-header`,children:(0,$.jsxs)(`div`,{className:`login-logo-row`,children:[P?(0,$.jsx)(`img`,{src:P,alt:`logo`,className:`login-logo-img`}):(0,$.jsx)(`div`,{className:`login-logo-placeholder`,children:(0,$.jsx)(z8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{className:`login-site-name`,children:M})]})}),(0,$.jsx)(w1.Text,{className:`login-card-subtitle`,children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作`}),r!==`register`&&(0,$.jsx)(`div`,{className:`login-tabs`,children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>ce(e),className:`login-tab ${a===e?`login-tab-active`:``}`,children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(UH,{form:K,size:`large`,layout:`vertical`,onFinish:re,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:le})}),(0,$.jsx)(UH.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(wW.Password,{prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:le})}),(0,$.jsx)(UH.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(kR,{children:`记住我的登录状态`})}),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,htmlType:`submit`,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(UH,{form:ee,size:`large`,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:le})}),(0,$.jsx)(UH.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(YV.Compact,{style:{width:`100%`},children:[(0,$.jsx)(wW,{prefix:(0,$.jsx)(p8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!b,style:{...le,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(Z,{disabled:u>0,style:{fontSize:14,fontWeight:400},onClick:()=>{k?(x(!1),_(!0),w(e=>e+1)):g&&!b?(E(!0),setTimeout(()=>E(!1),500)):oe(ee.getFieldValue(`phone`))},className:`login-code-btn`,children:u>0?`${u}s`:k?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(m7,{onSuccess:se,isVerified:b,shake:T})},C),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,onClick:ie,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(UH,{form:q,size:`large`,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(wW,{prefix:(0,$.jsx)(g6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:le})}),(0,$.jsx)(UH.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(YV.Compact,{style:{width:`100%`},children:[(0,$.jsx)(wW,{prefix:(0,$.jsx)(p8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!v,style:{...le,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(Z,{disabled:f>0,style:{fontSize:14,fontWeight:400},onClick:()=>{D?(y(!1),_(!0),w(e=>e+1)):g&&!v?(E(!0),setTimeout(()=>E(!1),500)):oe(q.getFieldValue(`phone`),!0)},className:`login-code-btn`,children:f>0?`${f}s`:D?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(m7,{onSuccess:se,isVerified:v,shake:T})},C),(0,$.jsx)(UH.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(wW.Password,{prefix:(0,$.jsx)(Y3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:le})}),(0,$.jsx)(UH.Item,{style:{marginBottom:12},children:(0,$.jsx)(Z,{type:`primary`,onClick:J,loading:t,block:!0,className:`login-submit-btn`,children:`注 册`})})]}),(0,$.jsx)(`div`,{className:`login-agreement`,children:(0,$.jsx)(kR,{checked:m,onChange:e=>h(e.target.checked),children:(0,$.jsxs)(`span`,{className:`login-agreement-text`,children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),ue(B)},className:`login-link`,children:`《用户协议及隐私政策》`})]})})}),(0,$.jsx)(`div`,{className:`login-footer`,children:r===`register`?(0,$.jsx)(w1.Text,{className:`login-switch-btn`,onClick:()=>{i(`password`),o(`password`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1),q.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(w1.Text,{className:`login-switch-btn`,onClick:()=>{i(`register`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1)},children:`没有账号?立即注册`})})]})}),H&&(0,$.jsx)(`div`,{className:`login-copyright-wrapper`,children:(0,$.jsx)(`div`,{className:`login-copyright`,children:H})})]})]})},Ooe=({src:e,onReady:t})=>{let[n,r]=(0,S.useState)(!1),i=S.useRef(null),a=()=>{n||(r(!0),i.current?.play().catch(()=>{}),t())};if(!e)return t(),null;let o=e.toLowerCase().endsWith(`.gif`),s=e.toLowerCase().endsWith(`.webp`);return o||s?(0,$.jsx)(`img`,{className:`login-bg-video`,src:e,alt:``,onLoad:a,onError:a}):(0,$.jsxs)($.Fragment,{children:[!n&&(0,$.jsx)(`div`,{className:`login-bg-video login-bg-placeholder`}),(0,$.jsx)(`video`,{ref:i,className:`login-bg-video`,style:{opacity:+!!n},autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:`auto`,onCanPlayThrough:a,onCanPlay:a,onError:a,children:(0,$.jsx)(`source`,{src:e,type:e.endsWith(`.webm`)?`video/webm`:e.endsWith(`.mov`)?`video/quicktime`:`video/mp4`})})]})},m7=({onSuccess:e,isVerified:t,shake:n})=>{let r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=S.useRef(0),s=S.useRef(!1),[c,l]=S.useState(360),u=c-50;S.useEffect(()=>{let e=()=>{if(r.current){let e=r.current.offsetWidth;e>0&&l(e)}};e();let t=new ResizeObserver(e);return r.current&&t.observe(r.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let d=n=>{if(s.current||t)return;let r=Math.max(0,Math.min(n,u));o.current=r,i.current&&(i.current.style.left=`${r}px`),a.current&&(a.current.style.width=`${r+50}px`),r>=u-5&&(s.current=!0,i.current&&(i.current.style.background=`#22c55e`,i.current.innerHTML=``),a.current&&(a.current.style.width=`${c}px`,a.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:r,onMouseDown:e=>{if(e.preventDefault(),s.current||t)return;let n=r.current;if(!n)return;let c=n.getBoundingClientRect(),l=e=>{d(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,f),!s.current&&o.current{if(s.current||t)return;e.preventDefault();let n=r.current;if(!n)return;let c=n.getBoundingClientRect();d(e.touches[0].clientX-c.left-50/2);let l=e=>{d(e.touches[0].clientX-c.left-50/2)},f=()=>{document.removeEventListener(`touchmove`,l),document.removeEventListener(`touchend`,f),!s.current&&o.current({page:1,pageSize:10,total:0,items:[]}),h7=a5((e,t)=>({projects:[],records:koe(),loading:!1,mediaType:`video`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,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:[],inputValue:``,currentMedia:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await Fie(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await Iie(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await Lie(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 Rie(n,r);try{await l7.getState().checkAuth()}catch{}let a=t().records,o=a.items.findIndex(e=>e.id===i.record.id),s=o>=0?a.items.map(e=>e.id===i.record.id?i.record:e):[i.record,...a.items];return e({records:{...a,total:o>=0?a.total:a.total+1,items:s}}),i},generateVideo:async n=>{let r=await Jie(n);try{await l7.getState().checkAuth()}catch{}let i=t().records;return e({records:{...i,items:i.items.map(e=>e.id===n?r:e)}}),r},retryGeneration:async n=>{let r=await Yie(n);try{await l7.getState().checkAuth()}catch{}let i=t().records;return e({records:{...i,items:i.items.map(e=>e.id===n?r:e)}}),r},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}),setGenerationCount:t=>e({generationCount: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}),setInputValue:t=>e({inputValue:t}),setCurrentMedia:t=>e({currentMedia:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,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:[],inputValue:``,currentMedia:[]})})),g7=480;function _7(e){if(!e)return`-`;let t=e.trim();if(!t)return`-`;let n=t.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/);if(!n)return t.slice(0,16).replace(`T`,` `);let[,r,i,a,o,s,c,l]=n,u=Date.UTC(+r,i-1,+a,+o,+s,+c);if(l&&l!==`Z`){let e=l[0]===`+`?1:-1,[t,n]=l.slice(1).split(`:`),r=u-e*(t*60+ +n)*6e4+g7*6e4,i=new Date(r);return`${i.getUTCFullYear()}-${v7(i.getUTCMonth()+1)}-${v7(i.getUTCDate())} ${v7(i.getUTCHours())}:${v7(i.getUTCMinutes())}`}let d=l===`Z`?u+g7*6e4:u,f=new Date(d);return`${f.getUTCFullYear()}-${v7(f.getUTCMonth()+1)}-${v7(f.getUTCDate())} ${v7(f.getUTCHours())}:${v7(f.getUTCMinutes())}`}function v7(e){return e<10?`0${e}`:String(e)}var y7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],b7={ShoppingCartOutlined:(0,$.jsx)(C8,{}),BookOutlined:(0,$.jsx)(U2,{}),HomeOutlined:(0,$.jsx)(O3,{}),FireOutlined:(0,$.jsx)(s3,{}),RocketOutlined:(0,$.jsx)(u8,{}),SkinOutlined:(0,$.jsx)(Kre,{}),CompassOutlined:(0,$.jsx)(P4,{}),HeartOutlined:(0,$.jsx)(y3,{}),CarOutlined:(0,$.jsx)(i4,{}),CameraOutlined:(0,$.jsx)(t4,{}),CloudOutlined:(0,$.jsx)(g4,{}),StarOutlined:(0,$.jsx)(N8,{}),TrophyOutlined:(0,$.jsx)(H8,{}),ThunderboltOutlined:(0,$.jsx)(z8,{}),BulbOutlined:(0,$.jsx)(Y2,{}),CoffeeOutlined:(0,$.jsx)(O4,{}),CrownOutlined:(0,$.jsx)(B4,{}),DashboardOutlined:(0,$.jsx)(U4,{}),FlagOutlined:(0,$.jsx)(u3,{}),GlobalOutlined:(0,$.jsx)(g3,{}),GiftOutlined:(0,$.jsx)(p3,{}),LaptopOutlined:(0,$.jsx)(L3,{}),MobileOutlined:(0,$.jsx)(g6,{}),MonitorOutlined:(0,$.jsx)(y6,{}),PayCircleOutlined:(0,$.jsx)(j6,{}),PictureOutlined:(0,$.jsx)(L6,{}),PlayCircleOutlined:(0,$.jsx)(K6,{}),SafetyOutlined:(0,$.jsx)(p8,{}),ShoppingOutlined:(0,$.jsx)(Hre,{}),SmileOutlined:(0,$.jsx)(O8,{}),SoundOutlined:(0,$.jsx)(j8,{}),TagOutlined:(0,$.jsx)(tie,{}),TeamOutlined:(0,$.jsx)(L8,{}),ToolOutlined:(0,$.jsx)(aie,{}),TruckOutlined:(0,$.jsx)(cie,{}),VideoCameraOutlined:(0,$.jsx)(X8,{}),WalletOutlined:(0,$.jsx)(Q8,{}),BankOutlined:(0,$.jsx)(P2,{}),BuildOutlined:(0,$.jsx)(K2,{}),ExperimentOutlined:(0,$.jsx)(Q4,{}),HighlightOutlined:(0,$.jsx)(S3,{}),IdcardOutlined:(0,$.jsx)(j3,{}),MedicineBoxOutlined:(0,$.jsx)(s6,{}),ReadOutlined:(0,$.jsx)(Q6,{}),RestOutlined:(0,$.jsx)(t8,{}),SketchOutlined:(0,$.jsx)(Wre,{}),SolutionOutlined:(0,$.jsx)(Yre,{})},Aoe=()=>{let[e,t]=(0,S.useState)(!1),[n]=UH.useForm(),r=Je(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=h7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),j5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:y7[t%y7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`垂直行业提示词智能优化(新手专属,一键生成标准素材)`}),(0,$.jsxs)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(eH,{}),onClick:()=>r(`/records`),size:`large`,style:{background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`,fontWeight:600,borderRadius:10,height:42},children:`项目记录`}),(0,$.jsx)(Z,{icon:(0,$.jsx)(JI,{}),onClick:()=>t(!0),size:`large`,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`,fontWeight:600,borderRadius:10,height:42,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`},children:`新建项目`})]})]}),i.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),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:b7[u[e.industry]?.icon]||(0,$.jsx)(p2,{})}),(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)(w1.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(qQ,{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)(qB,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,_7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(K6,{}),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)(oK,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Q.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),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)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(p2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Q.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(UH,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(UH.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(UX,{}),size:`large`})}),(0,$.jsx)(UH.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(HC,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(HC.Option,{value:e.key,children:(0,$.jsxs)(YV,{children:[b7[e.icon]||(0,$.jsx)(p2,{}),` `,e.label]})},e.key))})})]})})]})};async function x7(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var{Text:S7}=w1,joe={real_person:{title:`选择真人素材库`,empty:`暂无可选 Active 真人素材`,projectError:`加载真人素材项目失败`,assetError:`加载真人素材失败`,fallbackName:`真人素材`},aigc_virtual:{title:`选择虚拟素材库`,empty:`暂无可选 Active 虚拟素材`,projectError:`加载虚拟素材项目失败`,assetError:`加载虚拟素材失败`,fallbackName:`虚拟素材`}},C7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,Moe=e=>e.assetType===`Video`?C7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.providerUrl):C7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.providerUrl),Noe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},w7=({open:e,libraryType:t=`real_person`,selectedIds:n=[],maxCount:r=20,onClose:i,onSelect:a,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,usedVideoDuration:u,maxVideoDuration:d,accept:f})=>{let p=joe[t],[m,h]=(0,S.useState)([]),[g,_]=(0,S.useState)(),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(f===`image/*`?`Image`:void 0),[C,w]=(0,S.useState)([]),[T,E]=(0,S.useState)(new Map),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(0,S.useMemo)(()=>new Set(T.keys()),[T]),M=async()=>{O(!0);try{let e=(await(t===`aigc_virtual`?c7:o7)({page:1,pageSize:100,status:`active`})).items||[];h(e),_(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(e){Q.error(e?.message||p.projectError)}finally{O(!1)}},N=async()=>{A(!0);try{w((await(t===`aigc_virtual`?loe:roe)({projectId:g,keyword:v.trim()||void 0,assetType:b,page:1,pageSize:100})).items||[])}catch(e){Q.error(e?.message||p.assetError)}finally{A(!1)}};(0,S.useEffect)(()=>{e&&setTimeout(()=>{E(new Map),y(``),x(void 0),_(void 0),w([]),M()},0)},[e,t]),(0,S.useEffect)(()=>{g&&setTimeout(()=>{N()},0)},[g,b]);let P=e=>{if(n.includes(e.id)){Q.info(`该素材已添加`);return}if(f===`image/*`&&e.assetType===`Video`){Q.warning(`当前仅支持选择图片素材`);return}E(t=>{let n=new Map(t);return n.has(e.id)?(n.delete(e.id),n):n.size>=r?(Q.warning(`最多选择 ${r} 个参考素材`),t):(n.set(e.id,e),n)})},F=(0,S.useMemo)(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0;return e>r||t>i||n>a},[T,o,c,s,l,d,u]);return(0,$.jsxs)(nK,{title:`${p.title}`,open:e,onCancel:i,width:920,destroyOnHidden:!0,footer:[(0,$.jsx)(Z,{onClick:i,children:`取消`},`cancel`),(0,$.jsxs)(Z,{type:`primary`,onClick:()=>{let e=Array.from(T.values()).filter(e=>!n.includes(e.id));if(!e.length){Q.warning(`请选择至少一个${t===`aigc_virtual`?`虚拟`:`真人`}素材`);return}a(e),i()},disabled:F,style:{background:F?`#94a3b8`:`#8b5cf6`,opacity:F?.6:1,cursor:F?`not-allowed`:`pointer`},children:[`添加选中素材(`,T.size,`)`]},`ok`)],children:[f!==`image/*`&&(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20,marginBottom:16,padding:`12px 16px`,background:`#fafafa`,borderRadius:8},children:(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0,f=e>r,p=t>i,m=n>a;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:f?`#ef4444`:`#64748b`,fontWeight:f?600:400},children:[`还可选取图片 `,e,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:p||m?`#ef4444`:`#64748b`,fontWeight:p||m?600:400},children:[`视频还可选取 `,t,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,n.toFixed(1),`/`,d!==void 0&&u!==void 0?(d-u).toFixed(1):`-`,`秒)`]})]})})()}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(YV,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(S7,{strong:!0,children:`项目组`}),(0,$.jsx)(Z,{size:`small`,icon:(0,$.jsx)(fq,{}),onClick:M,loading:D})]}),(0,$.jsx)(jG,{spinning:D,children:m.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无项目组`}):(0,$.jsx)(`div`,{children:m.map(e=>(0,$.jsx)(`div`,{onClick:()=>_(e.id),style:{cursor:`pointer`,padding:`10px 12px`,borderRadius:10,marginBottom:6,border:g===e.id?`1px solid #8b5cf6`:`1px solid transparent`,background:g===e.id?`#f5f3ff`:`#fff`},children:(0,$.jsxs)(`div`,{style:{width:`100%`},children:[(0,$.jsx)(S7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),(0,$.jsx)(S7,{type:`secondary`,style:{fontSize:12},children:typeof e.activeImageAssetCount==`number`||typeof e.activeVideoAssetCount==`number`?` 图 ${e.activeImageAssetCount||0} / 视 ${e.activeVideoAssetCount||0}`:``})]})},e.id))})})]}),(0,$.jsxs)(`div`,{style:{overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:12},children:[(0,$.jsx)(wW,{allowClear:!0,prefix:(0,$.jsx)(LC,{}),placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onPressEnter:N}),(0,$.jsx)(HC,{allowClear:f!==`image/*`,placeholder:`素材类型`,value:b,onChange:x,style:{width:116},options:f===`image/*`?[{value:`Image`,label:`图片`}]:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:N,loading:k,children:`刷新`})]}),(0,$.jsx)(jG,{spinning:k,children:C.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:p.empty,style:{marginTop:120}}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,maxHeight:420,overflowY:`auto`,paddingRight:4},children:C.filter(e=>f!==`image/*`||e.assetType===`Image`).map(e=>{let t=j.has(e.id)||n.includes(e.id),r=n.includes(e.id),i=Moe(e),a=e.assetType===`Video`;return(0,$.jsxs)(`div`,{onClick:()=>P(e),style:{cursor:r?`not-allowed`:`pointer`,border:t?`2px solid #8b5cf6`:`1px solid #edf0f5`,borderRadius:12,overflow:`hidden`,background:`#fff`,boxShadow:t?`0 8px 20px rgba(139,92,246,0.18)`:`0 4px 12px rgba(15,23,42,0.04)`,opacity:r?.62:1,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{aspectRatio:`1 / 1`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[i?a?(0,$.jsx)(`video`,{src:i,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:i,alt:e.name||p.fallbackName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):a?(0,$.jsx)(X8,{style:{fontSize:32,color:`#94a3b8`}}):(0,$.jsx)(L6,{style:{fontSize:32,color:`#94a3b8`}}),a&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:8,bottom:8,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:Noe(e.videoDuration)})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jC,{})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsx)(S7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name||`未命名素材`}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:6},children:[(0,$.jsx)(qQ,{color:a?`blue`:`default`,children:a?`视频`:`图片`}),(0,$.jsx)(qQ,{children:e.projectName})]})]})]},e.id)})})})]})]})]})},T7=({src:e,size:t=`normal`})=>{let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(1),[d,f]=(0,S.useState)(!1),p=e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`,m=(0,S.useCallback)(()=>{n.current&&(r?n.current.pause():n.current.play(),i(!r))},[r]),h=(0,S.useCallback)(()=>{n.current&&o(n.current.currentTime)},[]),g=(0,S.useCallback)(()=>{n.current&&c(n.current.duration)},[]),_=(0,S.useCallback)(()=>{i(!1),o(0)},[]),v=(0,S.useCallback)(e=>{if(!n.current||s===0)return;let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*s;n.current.currentTime=r,o(r)},[s]),y=(0,S.useCallback)(e=>{if(!n.current)return;let t=parseFloat(e.target.value);n.current.volume=t,u(t),f(t===0)},[]),b=(0,S.useCallback)(()=>{n.current&&(d?(n.current.volume=l||.5,f(!1)):(n.current.volume=0,f(!0)))},[d,l]);(0,S.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`timeupdate`,h),e.addEventListener(`loadedmetadata`,g),e.addEventListener(`ended`,_),()=>{e.removeEventListener(`timeupdate`,h),e.removeEventListener(`loadedmetadata`,g),e.removeEventListener(`ended`,_)}},[h,g,_]);let x=s>0?a/s*100:0;return(0,$.jsxs)(`div`,{style:{width:`100%`,height:t===`small`?130:112,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:t===`small`?`16px 16px`:`12px 16px`},children:[(0,$.jsx)(`audio`,{ref:n,src:e}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[(0,$.jsx)(`button`,{onClick:m,style:{width:48,height:48,borderRadius:`50%`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,flexShrink:0},children:r?(0,$.jsx)(T6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(K6,{style:{fontSize:24,color:`#fff`,marginLeft:2}})}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:8},children:[(0,$.jsxs)(`div`,{onClick:v,style:{height:5,background:`#e2e8f0`,borderRadius:10,cursor:`pointer`,overflow:`visible`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{height:`100%`,width:`${x}%`,background:`linear-gradient(90deg, #8b5cf6, #a78bfa)`,borderRadius:10,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${x}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:t===`small`?12:14,height:t===`small`?12:14,background:`#fff`,borderRadius:`50%`,boxShadow:`0 2px 6px rgba(0,0,0,0.15)`,opacity:+(x>0),transition:`opacity 0.2s`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(a)}),(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(s)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,$.jsx)(`button`,{onClick:b,style:{border:`none`,background:`transparent`,cursor:`pointer`,padding:0},children:d?(0,$.jsx)(p4,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}}):(0,$.jsx)(j8,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}})}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.1`,value:d?0:l,onChange:y,style:{width:t===`small`?40:50,height:4,borderRadius:2,appearance:`none`,background:`#e2e8f0`,cursor:`pointer`}})]})]})]})},{Text:E7}=w1,D7=e=>{if(!e)return``;if(/^data:|blob:/i.test(e))return e;if(/^https?:\/\//i.test(e)){let t=new URL(e);return t.pathname.startsWith(`/uploads`)?t.pathname+t.search:e}return`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`},O7=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},k7=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},Poe=e=>{let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n>0&&r>0)return O7(n,r)}else if(e.resourceType===`video`&&n>0&&r>0)return k7(n,r);return null},Foe=e=>new Promise(t=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}),Ioe=e=>e===`video`?(0,$.jsx)(X8,{}):e===`audio`?(0,$.jsx)(O2,{}):(0,$.jsx)(L6,{}),Loe=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,Roe=({open:e,onClose:t,onSelect:n,allowedTypes:r,selectedIds:i=[],title:a=`选择历史上传素材`,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,maxVideoDuration:u,usedVideoDuration:d,maxAudioCount:f,usedAudioCount:p,maxAudioDuration:m,usedAudioDuration:h,hideLimitHint:g,defaultResourceType:_})=>{let[v,y]=(0,S.useState)(_||``),[b,x]=(0,S.useState)(``),[C,w]=(0,S.useState)(1),[T,E]=(0,S.useState)(10),[D,O]=(0,S.useState)(1),[k,A]=(0,S.useState)(10),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(0),[z,B]=(0,S.useState)(``),[V,H]=(0,S.useState)([]),[U,W]=(0,S.useState)(0),[G,K]=(0,S.useState)(new Map),ee=(0,S.useMemo)(()=>new Set(i),[i]),q=(0,S.useMemo)(()=>new Set(r||[`image`,`video`,`audio`]),[JSON.stringify(r)]),te=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`image`).length,[G]),ne=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`video`).length,[G]),re=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`video`).reduce((e,t)=>e+(t.durationSeconds||0),0),[G]),ie=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`audio`).length,[G]),J=(0,S.useMemo)(()=>Array.from(G.values()).filter(e=>e.resourceType===`audio`).reduce((e,t)=>e+(t.durationSeconds||0),0),[G]),ae=(0,S.useMemo)(()=>o!==void 0&&c!==void 0?o-c:1/0,[o,c]),oe=(0,S.useMemo)(()=>s!==void 0&&l!==void 0?s-l:1/0,[s,l]),se=(0,S.useMemo)(()=>u!==void 0&&d!==void 0?u-d:1/0,[u,d]),ce=(0,S.useMemo)(()=>f!==void 0&&p!==void 0?f-p:1/0,[f,p]),le=(0,S.useMemo)(()=>m!==void 0&&h!==void 0?m-h:1/0,[m,h]),ue=(0,S.useMemo)(()=>te>ae,[te,ae]),de=(0,S.useMemo)(()=>ne>oe,[ne,oe]),fe=(0,S.useMemo)(()=>re>se,[re,se]),pe=(0,S.useMemo)(()=>ie>ce,[ie,ce]),me=(0,S.useMemo)(()=>J>le,[J,le]),he=(0,S.useCallback)(async()=>{if(e){P(!0);try{let e=await r7({resourceType:v||void 0,keyword:b||void 0,page:C,pageSize:T,scene:`picker`});I(C===1?e.groups||[]:t=>[...t,...e.groups||[]]),R(e.totalDays||0)}catch(e){Q.error(e?.message||`加载历史上传素材失败`),C===1&&I([]),R(0)}finally{P(!1)}}},[q,b,e,C,T,v]),ge=(0,S.useCallback)(async e=>{M(!0);try{let t=await i7(e,{resourceType:v||void 0,keyword:b||void 0,page:D,pageSize:8,scene:`picker`});H((t.items||[]).filter(e=>q.has(e.resourceType))),W(t.total||0)}catch(e){Q.error(e?.message||`加载历史上传素材失败`),H([]),W(0)}finally{M(!1)}},[q,b,D,k,v]);(0,S.useEffect)(()=>{e&&he()},[e,C,he]),(0,S.useEffect)(()=>{z&&O(1)},[z]),(0,S.useEffect)(()=>{z&&ge(z)},[z,D,ge]),(0,S.useEffect)(()=>{e&&K(new Map)},[e]),(0,S.useEffect)(()=>{e&&(y(_||``),w(1))},[e,_]);let _e=async e=>{if(ee.has(e.id)){Q.warning(`该素材已经在参考内容中`);return}let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n<=0||r<=0){let t=D7(e.previewUrl||e.displayUrl||e.resourceUrl);if(t){let e=await Foe(t);n=e.width,r=e.height}}if(n>0&&r>0){let t=O7(n,r);if(t){Q.error(`${e.fileName||`图片`}:${t}`);return}}}else if(e.resourceType===`video`&&n>0&&r>0){let t=k7(n,r);if(t){Q.error(`${e.fileName||`视频`}:${t}`);return}}K(t=>{let n=new Map(t);return n.has(e.id)?n.delete(e.id):n.set(e.id,e),n})},ve=()=>{let e=Array.from(G.values());if(e.length===0){Q.warning(`请先选择历史素材`);return}n(e),K(new Map),t()},ye=(0,S.useMemo)(()=>[{label:`全部`,value:``},{label:`图片`,value:`image`},{label:`视频`,value:`video`},{label:`音频`,value:`audio`}].filter(e=>!e.value||q.has(e.value)),[q]);return(0,$.jsxs)(nK,{title:a,open:e,onCancel:t,width:1e3,centered:!0,destroyOnHidden:!0,footer:[(0,$.jsx)(Z,{onClick:t,children:`取消`},`cancel`),(0,$.jsxs)(Z,{type:`primary`,onClick:ve,style:{background:`#8b5cf6`},disabled:ue||de||fe||pe||me,children:[`应用选择 (`,G.size,`)`]},`ok`)],children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(YV,{wrap:!0,children:[(0,$.jsx)(HC,{value:v,options:ye,style:{width:120},onChange:e=>{y(e),w(1)}}),(0,$.jsx)(wW,{allowClear:!0,value:b,prefix:(0,$.jsx)(LC,{}),placeholder:`搜索文件名`,style:{width:220},onChange:e=>x(e.target.value),onPressEnter:()=>{w(1),he()}}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:he,children:`刷新`})]}),!g&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:ue?`#ef4444`:`#64748b`,fontWeight:ue?600:400},children:[`还可选取图片 `,te,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:de||fe?`#ef4444`:`#64748b`,fontWeight:de||fe?600:400},children:[`视频还可选取 `,ne,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,re.toFixed(1),`/`,u!==void 0&&d!==void 0?(u-d).toFixed(1):`-`,`秒)`]}),f!==void 0&&(0,$.jsxs)(`span`,{style:{fontSize:13,color:pe||me?`#ef4444`:`#64748b`,fontWeight:pe||me?600:400},children:[`音频还可选取 `,ie,`/`,f!==void 0&&p!==void 0?f-p:`-`,` 个(`,J.toFixed(1),`/`,m!==void 0&&h!==void 0?(m-h).toFixed(1):`-`,`秒)`]})]})]}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`},children:[(0,$.jsx)(E7,{strong:!0,style:{fontSize:14},children:`日期列表`}),(0,$.jsx)(jG,{spinning:N,children:F.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无日期`,style:{padding:`40px 0`}}):(0,$.jsxs)(`div`,{style:{marginTop:12},children:[F.map(e=>(0,$.jsxs)(`div`,{onClick:()=>B(e.generatedDate),style:{padding:`10px 12px`,borderRadius:10,marginBottom:6,cursor:`pointer`,border:z===e.generatedDate?`1px solid #8b5cf6`:`1px solid transparent`,background:z===e.generatedDate?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(`div`,{style:{fontSize:13,fontWeight:500,color:`#334155`},children:e.generatedDate}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:[`共 `,e.total,` 个素材`]})]},e.generatedDate)),L>F.length&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(Z,{size:`small`,onClick:()=>w(C+1),children:`加载更多`})})]})})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,overflowY:`auto`},children:(0,$.jsx)(jG,{spinning:j,children:z?V.length===0?(0,$.jsx)(fC,{description:`该日期暂无可复用的历史上传素材`,style:{padding:`48px 0`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:14},children:V.map(e=>{let t=G.has(e.id),n=ee.has(e.id),r=Poe(e),i=n||!!r,a=D7(e.previewUrl||e.displayUrl||e.resourceUrl);return(0,$.jsxs)(`div`,{onClick:()=>!i&&_e(e),style:{position:`relative`,borderRadius:14,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,background:i?`#f8fafc`:`#fff`,opacity:i?.55:1,cursor:i?`not-allowed`:`pointer`,overflow:`hidden`,boxShadow:t?`0 10px 24px rgba(139, 92, 246, 0.18)`:`0 6px 18px rgba(15,23,42,0.06)`},title:r||void 0,children:[(0,$.jsx)(`div`,{style:{background:`#f1f5f9`},children:e.resourceType===`image`?(0,$.jsx)(`img`,{src:a,alt:e.fileName||e.id,style:{width:`100%`,height:130,objectFit:`cover`}}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:a,muted:!0,style:{width:`100%`,height:130,objectFit:`cover`}}):(0,$.jsx)(T7,{src:a,size:`small`})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsxs)(YV,{size:6,style:{marginBottom:6},children:[(0,$.jsx)(qQ,{color:`purple`,icon:Ioe(e.resourceType),style:{margin:0},children:Loe(e.resourceType)}),e.durationSeconds?(0,$.jsxs)(qQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null,r&&(0,$.jsx)(qQ,{color:`red`,style:{margin:0},children:`尺寸不符`})]}),(0,$.jsx)(E7,{ellipsis:!0,style:{display:`block`,fontSize:13,color:`#334155`},title:e.fileName||e.id,children:e.fileName||e.id}),(0,$.jsx)(E7,{type:`secondary`,style:{fontSize:12},children:e.moduleLabel||`普通上传`})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jC,{})}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(qQ,{children:`已选`})}),r&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`rgba(239, 68, 68, 0.9)`,color:`#fff`,padding:`4px 8px`,fontSize:11,textAlign:`center`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:r})]},e.id)})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:16,paddingBottom:8},children:(0,$.jsx)(uG,{current:D,pageSize:k,total:U,showSizeChanger:!0,onChange:(e,t)=>{O(e),A(t)}})})]}):(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`请选择日期`,style:{padding:`80px 0`}})})})]})]})},A7=({children:e,accept:t=`image/*,video/*`,multiple:n=!0,onLocalSelect:r,onHistorySelect:i,onPortraitSelect:a,onPortraitLibrarySelect:o,uploading:s,tooltipTitle:c,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,mediaType:b})=>{let x=(0,S.useRef)(null),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(`real_person`),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),N=()=>{A(!1),x.current?.click()},P=e=>{let t=e.target.files;t&&r&&r(Array.from(t)),x.current&&(x.current.value=``)},F=e=>{if(A(!1),a){E(e),w(!0);return}if(o){o(e);return}E(e),w(!0)},I=(0,$.jsxs)(`div`,{style:{padding:`4px 0`,minWidth:180},children:[(0,$.jsxs)(`div`,{onClick:()=>{N()},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(UX,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`本地上传`})]}),(0,$.jsxs)(`div`,{onClick:()=>{A(!1),O(!0)},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(K4,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`从资产中选择`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`real_person`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(J8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`真人素材库`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`aigc_virtual`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(L8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`虚拟素材库`})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`input`,{ref:x,type:`file`,accept:t,multiple:n,onChange:P,style:{display:`none`}}),c?(0,$.jsx)(jw,{title:c,children:(0,$.jsx)(zw,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})})}):(0,$.jsx)(zw,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})}),(0,$.jsx)(Roe,{open:D,onClose:()=>O(!1),onSelect:e=>{i?.(e),O(!1)},allowedTypes:t.includes(`audio`)?[`image`,`video`,`audio`]:[`image`,`video`],maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,maxVideoDuration:m,usedVideoDuration:p,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,defaultResourceType:b===`image`?`image`:``}),(0,$.jsx)(w7,{open:C,libraryType:T,onClose:()=>w(!1),onSelect:e=>{a?.(e),w(!1)},accept:t,maxCount:t===`image/*`&&!n?1:void 0,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m})]})};function zoe(){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 Boe={prompt_processing:`optimizing`,ready:`prompt_optimized`,generating:`generating`,success:`completed`,failure:`failed`},Voe=new Set([`pending`,`optimizing`,`generating`]),j7=new Set([`queued`,`preparing`,`creating_provider_task`,`provider_result_staged`,`waiting_remote`,`polling`,`result_ready`,`download_queued`,`downloading`,`retry_waiting`,`recovery_inconsistent`,`upscale_queued`,`upscale_processing`,`upscale_polling`,`upscale_downloading`,`upscale_finalizing`,`upscale_retry_waiting`]),M7=new Set([`completed`,`done`]),N7=new Set([`failed`,`timeout`,`download_failed`,`upscale_failed`]),Hoe=new Set([...M7,...N7,`deleted`]),Uoe={pending:`待处理`,optimizing:`提词处理中`,prompt_optimized:`待生成`,generating:`生成中`,queued:`生成中`,preparing:`生成中`,creating_provider_task:`生成中`,provider_result_staged:`生成中`,waiting_remote:`生成中`,polling:`生成中`,result_ready:`生成中`,download_queued:`生成中`,downloading:`生成中`,retry_waiting:`生成中`,recovery_inconsistent:`生成中`,upscale_queued:`生成中`,upscale_processing:`生成中`,upscale_polling:`生成中`,upscale_downloading:`生成中`,upscale_finalizing:`生成中`,upscale_retry_waiting:`生成中`,completed:`成功`,done:`成功`,timeout:`失败`,download_failed:`失败`,upscale_failed:`失败`,failed:`失败`,deleted:`已删除`},Woe={pending:`default`,optimizing:`processing`,prompt_optimized:`blue`,generating:`processing`,queued:`processing`,preparing:`processing`,creating_provider_task:`processing`,provider_result_staged:`processing`,waiting_remote:`processing`,polling:`processing`,result_ready:`processing`,download_queued:`processing`,downloading:`processing`,retry_waiting:`orange`,recovery_inconsistent:`orange`,upscale_queued:`purple`,upscale_processing:`purple`,upscale_polling:`purple`,upscale_downloading:`purple`,upscale_finalizing:`purple`,upscale_retry_waiting:`orange`,completed:`success`,done:`success`,failed:`error`,timeout:`error`,download_failed:`error`,upscale_failed:`error`,deleted:`default`},P7=e=>String(e||``).trim().toLowerCase(),Goe=e=>{let t=P7(e);return Uoe[t]||t||`未知状态`},Koe=e=>Woe[P7(e)]||`default`,F7=e=>{let t=P7(e.status),n=P7(e.displayStatus),r=P7(e.pipelineStage),i=Boe[P7(e.clientStatus)]||``,a=i||n||t||r||`pending`;N7.has(r)||N7.has(t)||N7.has(n)?a=N7.has(r)?r:N7.has(t)?t:n:M7.has(t)||M7.has(n)?a=M7.has(t)?t:n:!i&&r&&j7.has(r)&&(a=r);let o=N7.has(a),s=M7.has(a),c=typeof e.shouldPoll==`boolean`?e.shouldPoll:!o&&!s&&(Voe.has(t)||j7.has(r)),l=c;return{status:t,displayStatus:n,pipelineStage:r,effectiveKey:a,label:Goe(a),color:Koe(a),isActive:l,isSuccess:s,isFailure:o,isTerminal:Hoe.has(a),canGenerate:typeof e.canGenerate==`boolean`?e.canGenerate:t===`prompt_optimized`,canRetry:typeof e.canRetry==`boolean`?e.canRetry:o,shouldPoll:c}},I7=({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:`#fff`,border:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#374151`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(KZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Bi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,maxHeight:200,overflowY:`auto`,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)(w1.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)]})},qoe=({group:e,groupName:t,selected:n,expanded:r,onToggle:i,onSelect:a,onClose:o})=>{let s=(0,S.useRef)(null),c=(0,S.useRef)(null),l=(0,S.useRef)(r),[u,d]=(0,S.useState)(null);return l.current=r,(0,S.useEffect)(()=>{if(r&&s.current){let e=s.current.getBoundingClientRect();d({bottom:window.innerHeight-e.top+4,left:e.left})}else d(null)},[r]),(0,S.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||c.current?.contains(e.target)||l.current&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r,o]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:s,onClick:()=>i(t),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:`#ffffffff`,border:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsx)(w1.Text,{style:{fontSize:13,color:`#374151`,fontWeight:500,lineHeight:`18px`},children:n||e.name}),(0,$.jsx)(KZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:r?`rotate(180deg)`:`rotate(0deg)`}})]}),u&&(0,Bi.createPortal)((0,$.jsxs)(`div`,{ref:c,style:{position:`fixed`,bottom:u.bottom,left:u.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)(w1.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,r)=>{let i=n===e;return(0,$.jsx)(`div`,{onClick:()=>{a(e,t),o()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:i?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:i?`#fff`:`#1a1a2e`,fontWeight:i?600:400},onMouseEnter:e=>{i||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{i||(e.currentTarget.style.background=`transparent`)},children:e},r)})})]}),document.body)]})},L7=({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)(K6,{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)})]})},Joe=()=>{let{projectId:e}=Qe(),t=Je(),[n]=UH.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c,retryGeneration:l}=h7(),u=i.items,{user:d,optimizeHoldCredits:f}=l7(),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)({}),[A,j]=(0,S.useState)({}),[M,N]=(0,S.useState)({}),P=(0,S.useRef)(null),F=(0,S.useCallback)(e=>{if(!e)return 0;let t=new Date(e).getTime(),n=(Date.now()-t)/1e3;return n>=180?99:Math.min(99,n*.6)},[]);(0,S.useEffect)(()=>{let e=Object.entries(E).filter(([,e])=>e===`generating`).map(([e])=>e);if(e.length===0){P.current&&=(clearInterval(P.current),null);return}let t=()=>{e.forEach(e=>{let t=h7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=F(t.createdAt);k(t=>({...t,[e]:n})),j(t=>({...t,[e]:n}))}})};return t(),P.current=window.setInterval(t,1e3),()=>{P.current&&=(clearInterval(P.current),null)}},[E,F]),(0,S.useEffect)(()=>{Object.entries(E).forEach(([e,t])=>{if(t===`done`&&!M[e]){N(t=>({...t,[e]:!0}));let t=A[e]||0,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/800,1),o=1-(1-a)**3,s=t+(100-t)*o;j(t=>({...t,[e]:s})),a<1&&requestAnimationFrame(r)};requestAnimationFrame(r)}})},[E]),(0,S.useEffect)(()=>{Object.entries(E).forEach(([e,t])=>{if(t===`generating`){let t=h7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=F(t.createdAt);k(t=>({...t,[e]:n})),j(t=>({...t,[e]:n}))}}})},[_]);let[I,L]=(0,S.useState)({}),[R,z]=(0,S.useState)(null),[B,V]=(0,S.useState)(null),[H,U]=(0,S.useState)([]),[W,G]=(0,S.useState)(!1),[K,ee]=(0,S.useState)(``),[q,te]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(``),ie=(0,S.useRef)(null),[J,ae]=(0,S.useState)({}),[oe,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)({}),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(null),[me,he]=(0,S.useState)(5),[ge,_e]=(0,S.useState)(`9:16`),[ve,ye]=(0,S.useState)(`720p`),[be,xe]=(0,S.useState)([]),[Se,Ce]=(0,S.useState)([]),[we,Te]=(0,S.useState)(``),[Ee,De]=(0,S.useState)(!1),[Oe,ke]=(0,S.useState)(null),[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(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]});(0,S.useMemo)(()=>Me.durations.map(e=>`${e}`),[Me.durations]),(0,S.useCallback)(()=>{ke(e=>e===`duration`?null:`duration`)},[]),(0,S.useCallback)(()=>{ke(null)},[]);let Pe=(0,S.useCallback)(e=>{de(t=>t===e?null:e)},[]),Fe=(0,S.useCallback)(()=>{de(null)},[]);(0,S.useCallback)(e=>{he(parseInt(e))},[]);let Ie=(0,S.useCallback)((e,t)=>{le(n=>{let r={...n};return r[t]===e?delete r[t]:r[t]=e,r})},[]),[Le,Re]=(0,S.useState)(0),[ze,Be]=(0,S.useState)(0),[Ve,He]=(0,S.useState)(`video`),[Ue,We]=(0,S.useState)(`1:1`),[Ge,Ke]=(0,S.useState)(`2K`),[qe,Ye]=(0,S.useState)(2048),[Xe,Ze]=(0,S.useState)(2048),[$e,et]=(0,S.useState)(!1),[tt,nt]=(0,S.useState)([]),[rt,it]=(0,S.useState)([]),[at,ot]=(0,S.useState)([]),st=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},ct=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},lt=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Q.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Q.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=H.filter(e=>e.type===`image`).length,a=H.filter(e=>e.type===`video`).length,o=H.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(t&&i>=5)return Q.error(`最多上传5张图片`),!1;if(n&&a>=2)return Q.error(`最多上传2个视频`),!1;let s=0;if(n){let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t({duration:n.duration||0,width:n.videoWidth||0,height:n.videoHeight||0}),n.remove()},n.onerror=()=>{t({duration:0,width:0,height:0}),n.remove()},n.src=URL.createObjectURL(e)});if(s=t.duration,t.width>0&&t.height>0){let e=ct(t.width,t.height);if(e)return Q.error(`${e}`),!1}if(o+s>15)return Q.error(`视频总时长不能超过15秒`),!1}else{let t=await new Promise(t=>{let n=document.createElement(`img`);n.onload=()=>{t({width:n.width,height:n.height}),URL.revokeObjectURL(n.src)},n.onerror=()=>{t({width:0,height:0}),URL.revokeObjectURL(n.src)},n.src=URL.createObjectURL(e)});if(t.width>0&&t.height>0){let e=st(t.width,t.height);if(e)return Q.error(`${e}`),!1}}G(!0);try{let r;r=t?await b5(e):await x5(e,s);let o=t?`图片`:`视频`,c=t?i+1:a+1;U(e=>[...e,{url:r.url,type:t?`image`:`video`,name:`${o}${c}`,duration:n?s:void 0}]),Q.success(`${o}上传成功`)}catch{Q.error(`上传失败`)}finally{G(!1)}return!1};(0,S.useEffect)(()=>{if(rae().then(e=>{nt(e.video),ot(e.image)}),L5().then(e=>{it(e)}),!$e&&!Ae)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&(et(!1),je(!1))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[$e,Ae]);let ut=e=>{let t=Array.isArray(e)?e:[];return{inputImageCount:t.filter(e=>e.type===`image`).length,inputVideoDuration:t.filter(e=>e.type===`video`).reduce((e,t)=>e+Number(t.duration||0),0)}},dt=()=>{let e={};if(e=rt.find(e=>e.modelConfigId===(_?.engineId||we)&&e.genType===Ve&&e.resolution===(Ve===`video`?_?.resolution||ve:_?.imageSize||Ge)),e||=Ve===`video`?{perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0}:{perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},Ve===`video`){let t=((_?.duration||me)*e.perSecondCredits+e.baseCredits)*e.ratio;if(_?.includeMediaReferences??Ee){let n=ut(_?.references||H);if(n.inputVideoDuration>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n.inputVideoDuration)*(e.inputVideoRatio||1);t+=r}if(n.inputImageCount>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n.inputImageCount)*(e.inputImageRatio||1);t+=r}}return Number(t.toFixed(2))}else{let t=e.baseCredits*e.ratio;if(_?.includeMediaReferences??Ee){let n=ut(_?.references||H);if(n.inputImageCount>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n.inputImageCount)*(e.inputImageRatio||1);t+=r}}return Number(t.toFixed(2))}},ft=e=>{let t=e.genType||e.gen_type||`video`,n=e.engineId||e.engine_id,r=e.resolution,i=Number(e.duration||0),a=e.imageSize||e.image_size,o=e.includeMediaReferences??e.include_media_references??!1,s=e.references||[],c=rt.find(e=>e.modelConfigId===n&&e.genType===t&&e.resolution===(t===`video`?r:a));c||=t===`video`?{perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0}:{perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let l=0;if(t===`video`){if(l=(i*c.perSecondCredits+c.baseCredits)*c.ratio,o){let e=ut(s);if(e.inputVideoDuration>0){let t=((c.inputVideoBaseCredits||0)+(c.inputVideoPerSecondCredits||0)*e.inputVideoDuration)*(c.inputVideoRatio||1);l+=t}if(e.inputImageCount>0){let t=((c.inputImageBaseCredits||0)+(c.inputImagePerImageCredits||0)*e.inputImageCount)*(c.inputImageRatio||1);l+=t}}}else if(l=c.baseCredits*c.ratio,o){let e=ut(s);if(e.inputImageCount>0){let t=((c.inputImageBaseCredits||0)+(c.inputImagePerImageCredits||0)*e.inputImageCount)*(c.inputImageRatio||1);l+=t}}return Number(l.toFixed(2))},pt=e=>{St(e);let t=Tt[Ge]?.[e];if(t){let[e,n]=t.split(/x/i).map(Number);Ye(e),Ze(n)}},mt=e=>{wt(e);let t=Object.keys(Tt[e]||{});gt(t.map(e=>({value:e,label:e})));let n=t.includes(Ue)?Ue:t[0]||`1:1`;n!==Ue&&We(n);let r=Tt[e]?.[n];if(r){let[e,t]=r.split(/x/i).map(Number);Ye(e),Ze(t)}},[ht,gt]=(0,S.useState)([]),[_t,vt]=(0,S.useState)([]),[yt,bt]=(0,S.useState)([]),[xt,St]=(0,S.useState)(0),[Ct,wt]=(0,S.useState)(0),[Tt,Et]=(0,S.useState)({});(0,S.useEffect)(()=>{yt[Ct]&&yt[Ct][xt]!==void 0&&(Ye(yt[Ct][xt].substring(0,4)),Ze(yt[Ct][xt].substring(5)))},[xt]),(0,S.useEffect)(()=>{yt[Ct]&&yt[Ct][xt]!==void 0&&(Ye(yt[Ct][xt].substring(0,4)),Ze(yt[Ct][xt].substring(5)))},[Ct]);let Dt=()=>{Ye(Xe),Ze(qe)},Ot=e=>{let t=e.target.value===`image`?`image`:`video`;He(t);let n=(t===`image`?Se:be).filter(e=>e.supportsUniversalReference!==!1);n.length>0&&At(n[0].id)};(0,S.useEffect)(()=>{j5().then(e=>{ae(Object.fromEntries(e.map(e=>[e.key,e.label]))),se(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Zie().then(e=>{let t=e.items||[];Ce(t);let n=t?.[0]?.supportedSizes||{};Et(n);let r=Object.keys(n);vt(r.map(e=>({value:e,label:e})));let i=r.includes(Ge)?Ge:r[0]||`2K`,a=Object.keys(n[i]||{});gt(a.map(e=>({value:e,label:e})));let o=a.includes(Ue)?Ue:a[0]||`1:1`;o!==Ue&&We(o);let s=n[i]?.[o];if(s){let[e,t]=s.split(/x/i).map(Number);Ye(e),Ze(t)}}).catch(()=>{}),Xie().then(e=>{if(xe(e.items||[]),e.items?.length){let t=e.items[0];Te(e=>e||t.id),Ne({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)(()=>{if(!_)return;let e=_.genType||Ve,t=e===`image`?Se:be,n=_.engineId||``,r=t.find(e=>e.id===n)||t[0];if(r)if(Te(r.id),e===`image`){let e=r.supportedSizes||{};Et(e);let t=Object.keys(e),n=t.includes(_.imageSize||``)?_.imageSize:t[0]||_.imageSize||`2K`;Ke(n);let i=Object.keys(e[n]||{}),a=i.includes(_.imageProportion||``)?_.imageProportion:i[0]||_.imageProportion||`1:1`;We(a);let o=e[n]?.[a]||_.imagePx||``;if(o){let[e,t]=String(o).split(/x/i).map(Number);e>0&&t>0&&(Ye(e),Ze(t))}}else Ne({ratios:r.supportedRatios?.length?r.supportedRatios:[`16:9`],resolutions:r.supportedResolutions?.length?r.supportedResolutions:[`720p`],durations:r.supportedDurations?.length?r.supportedDurations:[5]}),r.supportedRatios?.includes(ge)||_e(r.supportedRatios?.[0]||`16:9`),r.supportedResolutions?.includes(ve)||ye(r.supportedResolutions?.[0]||`720p`),r.supportedDurations?.includes(me)||he(r.supportedDurations?.[0]||_.duration||5);De(!!_.includeMediaReferences)},[_?.id,_?.engineId,be,Se]);let kt=e=>{let t=be.find(t=>t.id===e)||be[0];return{ratios:t?.supportedRatios?.length?t.supportedRatios:[`16:9`],resolutions:t?.supportedResolutions?.length?t.supportedResolutions:[`720p`],durations:t?.supportedDurations?.length?t.supportedDurations:[5]}},At=e=>{Te(e);let t=(Ve===`image`?Se:be).find(t=>t.id===e);if(!t)return;if(Ve===`image`){let e=t.supportedSizes||{};Et(e);let n=Object.keys(e);vt(n.map(e=>({value:e,label:e})));let r=n.includes(Ge)?Ge:n[0]||`2K`,i=Object.keys(e[r]||{});gt(i.map(e=>({value:e,label:e})));let a=i.includes(Ue)?Ue:i[0]||`1:1`;Ke(r),We(a);let o=e[r]?.[a]||``;if(o){let[e,t]=String(o).split(/x/i).map(Number);e>0&&t>0&&(Ye(e),Ze(t))}return}let n=kt(e);Ne(n),_e(n.ratios[0]),ye(n.resolutions[0]),he(n.durations[0])};(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let jt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{jt.current||u.length===0||(jt.current=!0,u.forEach(t=>{t.projectId===e&&t.status===`generating`&&(D(e=>({...e,[t.id]:`generating`})),nn(t.id)),t.projectId===e&&t.status===`optimizing`&&zt(t.id)}))},[u,e]);let Mt=(0,S.useRef)(new Set),Nt=(0,S.useRef)(null),Pt=(0,S.useRef)(null),Ft=e=>{Mt.current.add(e),Rt()},It=e=>{Mt.current.delete(e),Mt.current.size===0&&Lt()},Lt=()=>{Nt.current&&=(clearInterval(Nt.current),null),Pt.current&&=(Pt.current.abort(),null)},Rt=()=>{Nt.current||=setInterval(async()=>{try{Pt.current&&Pt.current.abort();let t=new AbortController;Pt.current=t;let n=await v5({projectId:e,page:1,pageSize:100,signal:t.signal});Pt.current=null;let r=Array.from(Mt.current),i=[];if(r.length>0){let e=h7.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});h7.setState({records:{...e,items:t}}),i.forEach(e=>{It(e)})}}catch(e){e.name}},3e3)},zt=e=>{Ft(e)},Bt=(0,S.useRef)(!1),Vt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Bt.current||u.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,engineId:o,genType:s,aspectRatio:c,resolution:l,imageSize:d,imageProportion:f,imagePx:p,includeMediaReferences:m,referenceIds:h,ts:_}=JSON.parse(t);if(Date.now()-_>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(Vt.current===n)return;let y=u.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.engineId===o&&String(e.genType||`video`)===String(s||`video`)&&String(e.aspectRatio||``)===String(c||``)&&String(e.resolution||``)===String(l||``)&&String(e.imageSize||``)===String(d||``)&&String(e.imageProportion||``)===String(f||``)&&String(e.imagePx||``)===String(p||``)&&!!e.includeMediaReferences==!!m&&JSON.stringify((e.references||[]).map(e=>e.upload_resource_id||e.url).filter(Boolean).sort())===JSON.stringify((h||[]).slice().sort())&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>_-1e4);y?(Bt.current=!0,localStorage.removeItem(`pending_optimize`),v(y),b(y.optimizedPrompt||``),Re(y.textCreditsCost),Be(y.textTokensUsed),g(!0),Q.success({content:`优化请求已恢复,消耗 ${y.textCreditsCost} 积分`,key:`recovery`})):Date.now()-_>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[u,e]);let Ht=r.find(t=>t.id===e),Ut=u.filter(t=>t.projectId===e),Wt=Ht?.name??`项目`,Gt=(0,S.useMemo)(()=>Ht&&oe[Ht.industry]||[],[Ht,oe]),Kt=d?.credits??0,qt=Kt>=dt(),Jt=async()=>{try{if(!e){Q.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Q.error(`请输入视频/图片描述`);return}if(!we){Q.error(`请选择生成引擎`);return}if(Ve===`video`&&(!ge||!ve)){Q.error(`请选择视频比例和分辨率`);return}m(!0);let r=Object.entries(ce).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=zoe();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:me,engineId:we,genType:Ve,aspectRatio:Ve===`video`?ge:``,resolution:Ve===`video`?ve:``,imageSize:Ve===`image`?Ge:``,imageProportion:Ve===`image`?Ue:``,imagePx:Ve===`image`?`${qe}x${Xe}`:``,includeMediaReferences:Ee,referenceIds:H.map(e=>e.upload_resource_id||e.url).filter(Boolean).sort(),ts:Date.now()})),Vt.current=a;let o=await s(e,{prompt:i,duration:Ve===`video`?me:void 0,genType:Ve,engineId:we,includeMediaReferences:Ee,aspectRatio:Ve===`video`?ge:void 0,resolution:Ve===`video`?ve:void 0,references:H.length>0?H:void 0,idempotencyKey:a,image_size:Ve===`image`?Ge:void 0,image_proportion:Ve===`image`?Ue:void 0,image_px:Ve===`image`?qe+`x`+Xe:void 0});localStorage.removeItem(`pending_optimize`),Vt.current=null,v(o.record),b(o.record.optimizedPrompt||``),Re(o.textCreditsCost),Be(o.textTokensUsed),g(!0),Q.success({content:`「${Wt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Q.error(t)}finally{m(!1),localStorage.removeItem(`pending_optimize`),Vt.current=null}},Yt=(0,S.useRef)(new Set),Xt=(0,S.useRef)(null),Zt=(0,S.useRef)(null),Qt=e=>{Yt.current.add(e),tn()},$t=e=>{Yt.current.delete(e),Yt.current.size===0&&en()},en=()=>{Xt.current&&=(clearInterval(Xt.current),null),Zt.current&&=(Zt.current.abort(),null)},tn=()=>{Xt.current||=setInterval(async()=>{try{Zt.current&&Zt.current.abort();let t=new AbortController;Zt.current=t;let n=await v5({projectId:e,page:1,pageSize:100,signal:t.signal});Zt.current=null;let r=Array.from(Yt.current),i=[];if(r.length>0){let e=h7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t){let n=E[e.id];return t.shouldPoll??t.status===`generating`?n!==`generating`&&D(t=>({...t,[e.id]:`generating`})):i.push(e.id),t}}return e});h7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);$t(e),t?.status===`completed`?(D(t=>({...t,[e]:`done`})),v(n=>n?.id===e?t:n),Q.success({content:`「${Wt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(D(t=>({...t,[e]:`failed`})),v(n=>n?.id===e?t:n),Q.error({content:`「${Wt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name}},5e3)},nn=e=>{Qt(e)};(0,S.useEffect)(()=>()=>{en(),Lt()},[]),(0,S.useEffect)(()=>{u.filter(e=>e.shouldPoll??e.status===`generating`).forEach(e=>{D(t=>({...t,[e.id]:`generating`})),nn(e.id)})},[u]);let rn=async e=>{T(t=>({...t,[e]:!0})),D(t=>({...t,[e]:`generating`})),Q.loading({content:`「${Wt}」正在提交视频生成...`,duration:0,key:e});try{let t=Ut.find(t=>t.id===e)||_;if(!t||t.canGenerate===!1)throw Error(t?.configFallbackHint||`该记录当前不可生成,请重新生成提词`);let n=t.id===_?.id?y:I[e];n&&n!==t.optimizedPrompt&&await w5(e,n),(await c(e)).status===`failed`?(D(t=>({...t,[e]:`failed`})),Q.error({content:`「${Wt}」提交失败`,key:e,duration:3})):(Q.success({content:`「${Wt}」已提交,正在生成中...`,key:e,duration:3}),nn(e))}catch(t){D(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),Q.error({content:`${n}`,key:e,duration:3})}finally{T(t=>({...t,[e]:!1}))}},an=e=>{let t=E[e.id];return F7({status:(t===`done`?`completed`:t)||e.status,pipelineStage:t?null:e.pipelineStage,clientStatus:t?null:e.clientStatus,shouldPoll:t?t===`generating`:e.shouldPoll,canGenerate:e.canGenerate,canRetry:e.canRetry})},on=e=>e.isActive?(0,$.jsx)(Ym,{style:{animation:`spinSlow 1s linear infinite`}}):e.isSuccess?(0,$.jsx)(u4,{}):e.isFailure?(0,$.jsx)(p4,{}):(0,$.jsx)(XB,{});return(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,padding:`24px`,background:`#fff`,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>t(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:Wt}),Ht&&(0,$.jsx)(qQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:6},children:J[Ht.industry]||Ht.industry})]}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsxs)(qQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,Kt,` 积分`]})]}),!h&&(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)(w1.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(eI.Group,{defaultValue:`video`,buttonStyle:`solid`,onChange:Ot,children:[(0,$.jsxs)(eI.Button,{value:`video`,children:[(0,$.jsx)(X8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]}),(0,$.jsxs)(eI.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(L6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]})]})]}),Ve===`video`&&[{icon:(0,$.jsx)(k$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(z8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(u8,{}),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)(w1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),Ve===`image`&&[{icon:(0,$.jsx)(k$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(z8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(u8,{}),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)(w1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(UH,{form:n,initialValues:{},children:[(0,$.jsx)(UH.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:[H.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`&&pe(`https://ceshi.apiforeign.minzhongzc.com${e.url}`)},children:e.type===`image`?(0,$.jsx)(UU,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(L7,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),C5(e.url).catch(()=>{}),U(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)(p4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(A7,{accept:`image/*,video/*`,mediaType:Ve,onLocalSelect:e=>{e.forEach(async e=>{await lt(e)})},onHistorySelect:e=>{e.forEach(e=>{U(t=>[...t,{url:e.resourceUrl||e.previewUrl||e.displayUrl||``,type:e.resourceType,name:e.fileName||``}])}),Q.success(`成功添加${e.length}个历史记录`)},onPortraitSelect:e=>{e.forEach(e=>{U(t=>[...t,{url:e.previewUrl||``,type:e.assetType===`Video`?`video`:`image`,name:e.name||`真人素材`,source:`private_portrait_asset`,private_asset_id:e.id,label:``,duration:e.assetType===`Video`?e.videoDuration||0:void 0}])}),Q.success(`已添加 ${e.length} 个真人素材参考`)},uploading:W,tooltipTitle:`图片${H.filter(e=>e.type===`image`).length}/5,视频${H.filter(e=>e.type===`video`).length}/2`,maxImageCount:5,maxVideoCount:2,usedImageCount:H.filter(e=>e.type===`image`).length,usedVideoCount:H.filter(e=>e.type===`video`).length,usedVideoDuration:H.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,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:W?(0,$.jsx)(Ym,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(JI,{style:{fontSize:18,color:`#94a3b8`}})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(wW.TextArea,{ref:ie,value:K,onChange:e=>{let t=e.target.value;ee(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` `)){te(!0),re(e);return}}te(!1)},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e=0;e0&&(e.preventDefault(),n.forEach(async e=>{await lt(e)}))},rows:3,placeholder:`上传参考素材后(手动开启是否参与最终生成,如不开启则只用做模型理解)、输入文字,自由组合图、文多元素。输入 @ 可引用参考内容...`,maxLength:500,variant:`borderless`,autoSize:{minRows:2,maxRows:6},style:{padding:`6px 2px`,fontSize:15,lineHeight:1.7,resize:`none`,caretColor:`#6366f1`}})}),q&&H.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:(()=>{let e=H.filter(e=>!ne||e.name.includes(ne));return(e.length>0?e:H).map((e,t)=>{let r=H.indexOf(e);return(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 i=ie.current?.resizableTextArea?.textArea||ie.current?.nativeElement?.querySelector(`textarea`)||ie.current;if(!i||!i.value)return;let a=i.value,o=a.lastIndexOf(`@`),s=e.name||(e.type===`image`?`图片${r+1}`:`视频${r+1}`),c=a.slice(0,o)+`@${s} `;ee(c),n.setFieldValue(`prompt`,c),te(!1),setTimeout(()=>{i.focus(),i.selectionStart=c.length,i.selectionEnd=c.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:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(K6,{style:{color:`#fff`,fontSize:14}})}),(0,$.jsx)(w1.Text,{style:{fontSize:13},children:e.name||(e.type===`image`?`图片${r+1}`:`视频${r+1}`)}),(0,$.jsx)(qQ,{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:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexWrap:`wrap`},children:[(0,$.jsx)(I7,{label:`引擎`,value:(Ve===`image`?Se:be).filter(e=>e.supportsUniversalReference!==!1).find(e=>e.id===we)?.name||`选择引擎`,options:(Ve===`image`?Se:be).filter(e=>e.supportsUniversalReference!==!1).map(e=>e.name),expanded:Oe===`engine`,onToggle:()=>ke(Oe===`engine`?null:`engine`),onSelect:e=>{let t=(Ve===`image`?Se:be).filter(e=>e.supportsUniversalReference!==!1).find(t=>t.name===e);t&&At(t.id),ke(null)},onClose:()=>ke(null)}),Ve!==`image`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{je(!Ae),ke(null)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[ge,` · `,me,`s · `,ve]})]}),Ae&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:Me.ratios.map(e=>{let[t,n]=e.split(`:`).map(Number),r=t>=n?18:Math.round(t/n*18),i=n>=t?18:Math.round(n/t*18);return(0,$.jsxs)(`button`,{onClick:()=>_e(e),style:{flex:`0 0 calc(12.5% - 4px)`,minWidth:44,height:52,borderRadius:6,border:ge===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ge===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:r,height:i,border:`2px solid ${ge===e?`#6366f1`:`#9ca3af`}`,borderRadius:3,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:ge===e?`#6366f1`:`#6b7280`,fontWeight:ge===e?600:400},children:e})]},e)})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(me-Math.min(...Me.durations))/(Math.max(...Me.durations)-Math.min(...Me.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...Me.durations),max:Math.max(...Me.durations),value:me,onChange:e=>he(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:me}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:Me.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ye(e),style:{flex:1,height:42,borderRadius:8,border:ve===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ve===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:ve===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]}),Gt.map((e,t)=>{let n=ue===e.name,r=ce[e.name];return(0,$.jsx)(qoe,{group:e,groupName:e.name,selected:r,expanded:n,onToggle:Pe,onSelect:Ie,onClose:Fe},`og-${t}`)})]}),Ve==`image`&&(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{et(!$e),ke(null)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[Ue===`auto`?`智能`:Ue,` · `,Ge,` · `,qe,`×`,Xe]})]}),$e&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8,fontSize:13,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:ht.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{We(e.value),pt(e.label)},style:{flex:`0 0 calc(11.11% - 5px)`,minWidth:48,height:52,borderRadius:6,border:Ue===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Ue===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return t>=n?20:Math.round(t/n*20)})(),height:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return n>=t?20:Math.round(n/t*20)})(),border:`2px solid ${Ue===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:Ue===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:10,color:Ue===e.value?`#6366f1`:`#6b7280`,fontWeight:Ue===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8,fontSize:13,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:_t.map(e=>(0,$.jsx)(`button`,{onClick:()=>{Ke(e.value),mt(e.label)},style:{flex:1,height:44,borderRadius:6,border:Ge===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Ge===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:Ge===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)(w1.Text,{style:{display:`block`,marginBottom:8,fontSize:13,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:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`W`}),(0,$.jsx)(wW,{value:qe,onChange:e=>Ye(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:36,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:13,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:Dt,style:{width:26,height:26,borderRadius:6,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(OU,{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)(wW,{value:Xe,onChange:e=>Ze(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:36,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:13,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12},children:`PX`})]})]})]})]}),H.length>0&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(Kq,{size:`small`,checked:Ee,onChange:De}),(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#64748b`},children:`生成时携带附件`})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[Ve===`image`&&(0,$.jsx)(`span`,{style:{color:`#7c7c7c`,fontSize:14},children:`(请在左侧选择图片比例和尺寸)`}),(0,$.jsx)(jw,{title:(d?.credits||0){if((d?.credits||0){let e=await x7(y);Q.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(jw,{title:`编辑`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(k$,{}),onClick:()=>C(!0),style:{color:`#6366f1`}})})]})]}),x?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(wW.TextArea,{value:y,onChange:e=>b(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)(Z,{size:`small`,onClick:()=>{b(_.optimizedPrompt||``),C(!1)},children:`取消`}),(0,$.jsx)(Z,{size:`small`,type:`primary`,onClick:()=>{C(!1),Q.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)(w1.Text,{style:{fontSize:14,color:`#1a1a2e`,lineHeight:1.7},children:y})})]})]}):(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)(w1.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)(w1.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.6},children:_.originalPrompt})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!x&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!x&&(0,$.jsxs)(YV,{size:4,children:[(0,$.jsx)(jw,{title:`复制`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(Q$,{}),onClick:async()=>{let e=await x7(y);Q.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(jw,{title:`编辑`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(k$,{}),onClick:()=>C(!0),style:{color:`#6366f1`}})})]})]}),x?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(wW.TextArea,{value:y,onChange:e=>b(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)(Z,{size:`small`,onClick:()=>{b(_.optimizedPrompt||``),C(!1)},children:`取消`}),(0,$.jsx)(Z,{size:`small`,type:`primary`,onClick:()=>{C(!1),Q.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)(w1.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.6},children:y})})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:280},children:[_.videoUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.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:`https://ceshi.apiforeign.minzhongzc.com${_.videoUrl}`,controls:!0,style:{width:`100%`,maxHeight:350,display:`block`}})})]}),_.imageUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成图片`}),(0,$.jsx)(UU,{src:`https://ceshi.apiforeign.minzhongzc.com${_.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`,flexWrap:`wrap`,gap:12,marginTop:20,padding:`14px 18px`,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`},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)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:`引擎`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:(Ve===`image`?Se:be).find(e=>e.id===_.engineId)?.name||`-`})]}),Ve!==`image`&&(0,$.jsx)(`div`,{style:{borderRadius:12,background:`#f8f9fc`,padding:`8px 12px`},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)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(w1.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[_.duration||me,`s`]})]}),(0,$.jsx)(I7,{label:`比例`,value:_.aspectRatio||ge,options:[String(_.aspectRatio||ge)],expanded:!1,onToggle:()=>void 0,onSelect:()=>void 0,onClose:()=>ke(null)}),(0,$.jsx)(I7,{label:`分辨率`,value:_.resolution||ve,options:[String(_.resolution||ve)],expanded:!1,onToggle:()=>void 0,onSelect:()=>void 0,onClose:()=>ke(null)})]})}),Ve==`image`&&_&&(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)(w1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`分辨率`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:_.imageSize||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(w1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面比例`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:_.imageProportion||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(w1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面尺寸`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:_.imagePx||`-`})]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 12px`,borderRadius:10,background:`rgba(255, 255, 255, 0.95)`,border:`1px solid rgba(231, 234, 240, 0.95)`,boxShadow:`0 2px 8px rgba(47, 52, 64, 0.03)`,flexShrink:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,borderRadius:6,background:`rgba(99, 102, 241, 0.08)`,flexShrink:0},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#6366f1`,fontWeight:500},children:`文字积分`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`,fontWeight:700},children:Le})]}),(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:12,fontWeight:500,flexShrink:0},children:`+`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,borderRadius:6,background:`rgba(16, 185, 129, 0.08)`,flexShrink:0},children:[(0,$.jsxs)(w1.Text,{style:{fontSize:12,color:`#10b981`,fontWeight:500},children:[`预估`,Ve===`image`?`图`:`视`,`积分`]}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:13,color:`#10b981`,fontWeight:700},children:dt()})]}),(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:12,fontWeight:500,flexShrink:0},children:`=`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 10px`,borderRadius:6,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%)`,border:`1px solid rgba(99, 102, 241, 0.2)`,flexShrink:0},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#6366f1`,fontWeight:600},children:`总计`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#6366f1`,fontWeight:800},children:(Le+dt()).toFixed(2)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginLeft:`auto`},children:[(0,$.jsxs)(Z,{size:`large`,onClick:()=>{g(!1),v(null),b(``),ee(``),U([]),le({}),de(null),ke(null),n.resetFields()},style:{borderRadius:12,minWidth:120,height:44,fontWeight:500},children:[`配置新`,Ve===`image`?`图片`:`视频`]}),(0,$.jsx)(jw,{title:qt?``:`积分不足`,children:(0,$.jsx)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(u8,{}),onClick:()=>rn(_.id),loading:E[_.id]===`generating`,disabled:!qt||_.canGenerate===!1||E[_.id]===`generating`||E[_.id]===`done`,style:{borderRadius:12,minWidth:180,height:44,fontWeight:600,background:E[_.id]===`done`?`#10b981`:qt?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#d1d5db`,border:`none`,boxShadow:qt?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:E[_.id]===`done`?`生成完成`:E[_.id]===`generating`?`生成中...`:`生成${Ve===`image`?`图片`:`视频`} (${dt()}积分)`})})]})]}),_.references&&_.references.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`参考内容`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:_.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`&&pe(`https://ceshi.apiforeign.minzhongzc.com${e.url}`)},children:[e.type===`image`?(0,$.jsx)(UU,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(L7,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,width:64,height:64}),(0,$.jsx)(qQ,{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))})]})]}),Ut.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:24},children:[(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:15,display:`block`,marginBottom:12},children:`本项目生成记录`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,background:`#fff`,borderRadius:12,padding:8,border:`1px solid #f0f0f5`},className:`stagger-children`,children:Ut.map((e,t)=>{let n=an(e),r=n.effectiveKey,i=I[e.id]??(e.optimizedPrompt||e.originalPrompt),a=B===e.id,o=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.05}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>V(a?null:e.id),style:{padding:`12px 16px`,borderRadius:a?`8px 8px 0 0`:8,background:`#fafafa`,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:o===`image`?`#fef3c7`:`#dbeafe`},children:o===`image`?(0,$.jsx)(L6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(X8,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(KZ,{style:{color:`#6366f1`,fontSize:11,flexShrink:0}}):(0,$.jsx)(s4,{style:{color:`#cbd5e1`,fontSize:11,flexShrink:0}}),(0,$.jsx)(qQ,{color:n.color,icon:on(n),style:{margin:0},children:n.label}),(0,$.jsx)(w1.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i}),r===`prompt_optimized`&&(0,$.jsx)(qQ,{color:`processing`,style:{padding:`3px 10px`,fontSize:12,margin:0,flexShrink:0},children:`待生成`}),o===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.imageSize||`-`,` ·`,` `,e.imageProportion||`-`,` ·`,` `,e.imagePx||`-`,` ·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:_7(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:_7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation()})]}),a&&(0,$.jsx)(`div`,{style:{background:`#fff`,borderRadius:`0 0 8px 8px`,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)(w1.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)(w1.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)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,(r===`prompt_optimized`||n.isFailure)&&R!==e.id&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),R!==e.id&&(0,$.jsxs)(YV,{size:4,children:[(0,$.jsx)(jw,{title:`复制`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(Q$,{}),onClick:async()=>{let e=await x7(i);Q.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(r===`prompt_optimized`||n.isFailure)&&(0,$.jsx)(jw,{title:`编辑`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(k$,{}),onClick:()=>{z(e.id),L(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt??``}))},style:{color:`#6366f1`}})})]})]}),R===e.id?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(wW.TextArea,{value:i,onChange:t=>L(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)(Z,{size:`small`,onClick:()=>z(null),children:`取消`}),(0,$.jsx)(Z,{size:`small`,type:`primary`,onClick:()=>{L(t=>({...t,[e.id]:i})),z(null),Q.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:r===`prompt_optimized`?`rgba(99,102,241,0.02)`:`#f8f9fc`,border:r===`prompt_optimized`?`1px solid rgba(99,102,241,0.1)`:`1px solid #f0f0f5`},children:(0,$.jsx)(w1.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:i})})]}),o===`image`?(0,$.jsx)(`div`,{style:{padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:(0,$.jsx)(`div`,{children:(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,flexWrap:`wrap`},children:[{label:`引擎`,value:`${e.engineName}`},{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`图片积分`,value:`${e.creditsCost||0}`},{label:`分辨率`,value:e.imageSize||`-`},{label:`比例`,value:e.imageProportion||`-`},{label:`尺寸`,value:e.imagePx||`-`},{label:`附件`,value:e.includeMediaReferences?`生成时携带`:`仅用于提词或不携带`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{width:`21%`,textAlign:`left`,marginBottom:10},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:12,color:`#1a1a2e`},children:e.value})]},t))})})}):(0,$.jsx)(`div`,{style:{padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:(0,$.jsx)(`div`,{children:(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,flexWrap:`wrap`},children:[{label:`引擎`,value:`${e.engineName}`},{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`视频积分`,value:`${e.creditsCost||0}`},{label:`时长`,value:e.duration?`${e.duration}秒`:`-`},{label:`比例`,value:e.aspectRatio||`-`},{label:`分辨率`,value:e.resolution||`-`},{label:`附件`,value:e.includeMediaReferences?`生成时携带`:`仅用于提词或不携带`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{width:`21%`,textAlign:`left`,marginBottom:10,marginRight:10},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:12,color:`#1a1a2e`},children:e.value})]},t))})})}),(e.references&&e.references.length>0||n.isFailure)&&(0,$.jsxs)(`div`,{style:{marginTop:14},children:[(0,$.jsxs)(w1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:[`参考素材`,` `,n.isFailure&&(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`&&pe(`https://ceshi.apiforeign.minzhongzc.com${t.url}`)},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`},children:t.type===`image`?(0,$.jsx)(UU,{src:`https://ceshi.apiforeign.minzhongzc.com${t.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(L7,{src:`https://ceshi.apiforeign.minzhongzc.com${t.url}`,width:64,height:64})}),(0,$.jsx)(qQ,{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.isFailure&&(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),C5(t.url).catch(()=>{});let i=e.references.filter((e,t)=>t!==r);h7.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)(p4,{style:{color:`#fff`,fontSize:10}})})]},r)),n.isFailure&&(0,$.jsx)(v0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`);return!n&&!r?(Q.error(`仅支持图片或视频文件`),!1):(n?b5(t).then(n=>{let r={url:n.url,type:`image`,name:t.name||`图片`},i=e.references||[];h7.getState().updateRecordReferences(e.id,[...i,r]),Q.success(`上传成功`)}).catch(()=>Q.error(`上传失败`)):new Promise(e=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{e(n.duration||0),n.remove()},n.onerror=()=>{e(0),n.remove()},n.src=URL.createObjectURL(t)}).then(n=>{x5(t,n).then(r=>{let i={url:r.url,type:`video`,name:t.name||`视频`,duration:n||void 0},a=e.references||[];h7.getState().updateRecordReferences(e.id,[...a,i]),Q.success(`上传成功`)}).catch(()=>Q.error(`上传失败`))}),!1)},children:(0,$.jsx)(jw,{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)(JI,{style:{fontSize:18,color:`#94a3b8`}})})})})]})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:220,position:`relative`},children:[r===`prompt_optimized`&&(0,$.jsxs)(`div`,{style:{position:`absolute`,inset:0,padding:16,borderRadius:12,background:`#f8f9fc`,border:`1px solid #e2e8f0`,display:`flex`,flexDirection:`column`,justifyContent:`space-between`},children:[(0,$.jsx)(`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,$.jsxs)(w1.Text,{style:{color:`#94a3b8`,fontSize:13},children:[o===`video`?`视频`:`图片`,`等待生成`]})}),(0,$.jsx)(jw,{title:(d?.credits||0){if((d?.credits||0){let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${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:180,overflow:`hidden`},children:o===`video`?(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,borderRadius:0}}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${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)(YV,{children:[o===`video`?(0,$.jsx)(X8,{style:{color:`#6366f1`,fontSize:13}}):(0,$.jsx)(L6,{style:{color:`#6366f1`,fontSize:13}}),(0,$.jsx)(w1.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:_7(e.generatedAt)})]})]}):n.isFailure?(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)(p4,{style:{color:`#ef4444`,fontSize:28}}),(0,$.jsxs)(w1.Text,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:[o===`video`?`视频`:`图片`,`生成失败`]}),e.errorMessage&&(0,$.jsx)(w1.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)(XB,{style:{color:`#94a3b8`,fontSize:28}}),(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:13},children:o===`image`?`待生成图片`:`待生成视频`})]})]})]})})]},e.id)})})]}),(0,$.jsx)(nK,{open:!!fe,onCancel:()=>pe(null),footer:null,width:480,centered:!0,destroyOnHidden:!0,closable:!1,title:null,styles:{body:{padding:0,background:`#000`,position:`relative`}},children:fe&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:fe,controls:!0,autoPlay:!0,style:{width:`100%`,display:`block`,maxHeight:`70vh`}}),(0,$.jsx)(`div`,{onClick:()=>pe(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)(yie,{style:{color:`#fff`,fontSize:16}})})]})})]})},Yoe=()=>{let e=Je(),{records:t,projects:n,fetchRecords:r,fetchProjects:i,generateVideo:a,retryGeneration:o}=h7(),s=t.items,[c,l]=(0,S.useState)(1),[u,d]=(0,S.useState)(10),[f,p]=(0,S.useState)({}),[m,h]=(0,S.useState)(void 0),[g,_]=(0,S.useState)(void 0),[v,y]=(0,S.useState)({}),[b,x]=(0,S.useState)(null),[C,w]=(0,S.useState)(null),T=async e=>{let t=e.genType||`image`,n=e.canRetry===!0;if(!n&&(e.canGenerate===!1||!e.configComplete)||n&&!e.configComplete){Q.error(`该记录生成配置不完整,请重新生成提词`);return}p(t=>({...t,[e.id]:!0})),Q.loading({content:`「${e.projectName}」正在提交${t===`video`?`视频`:`图片`}生成...`,duration:0,key:e.id});try{if(n)await o(e.id);else{let t=v[e.id];t&&t!==e.optimizedPrompt&&await w5(e.id,t),await a(e.id)}Q.success({content:`「${e.projectName}」已提交,正在生成中...`,key:e.id,duration:3})}catch(t){Q.error({content:t?.response?.data?.detail||t?.message||`提交生成失败`,key:e.id,duration:3})}finally{p(t=>({...t,[e.id]:!1}))}};(0,S.useEffect)(()=>{i()},[i]),(0,S.useEffect)(()=>{r({projectId:m,status:g,page:c,pageSize:u})},[r,m,g,c,u]);let E=s;return(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>e(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:2,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`项目记录`}),(0,$.jsx)(w1.Text,{style:{fontSize:13,color:`#64748b`},children:`查看所有视频生成记录,点击记录查看完整内容和视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),(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)(YV,{children:[(0,$.jsx)(t3,{style:{color:`#94a3b8`}}),(0,$.jsx)(HC,{placeholder:`全部项目`,allowClear:!0,style:{width:200},onChange:e=>{h(e),l(1)},children:n.map(e=>(0,$.jsx)(HC.Option,{value:e.id,children:e.name},e.id))}),(0,$.jsxs)(HC,{placeholder:`全部状态`,allowClear:!0,style:{width:140},onChange:e=>{_(e),l(1)},children:[(0,$.jsx)(HC.Option,{value:`prompt_optimized`,children:`待生成`}),(0,$.jsx)(HC.Option,{value:`generating`,children:`生成中`}),(0,$.jsx)(HC.Option,{value:`completed`,children:`已完成`}),(0,$.jsx)(HC.Option,{value:`failed`,children:`失败`})]})]}),(0,$.jsxs)(w1.Text,{style:{marginLeft:`auto`,lineHeight:`32px`,color:`#94a3b8`,fontSize:13},children:[`共 `,t.total,` 条记录`]})]}),E.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:60}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:E.map((e,t)=>{let n=b===e.id,r=v[e.id]??e.optimizedPrompt,i=f[e.id],a=C===e.id,o=e.genType||`image`,s=F7(e);return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.04}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>w(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)(L6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(X8,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(KZ,{style:{color:`#6366f1`,fontSize:12,flexShrink:0}}):(0,$.jsx)(s4,{style:{color:`#cbd5e1`,fontSize:12,flexShrink:0}}),(0,$.jsx)(qQ,{color:s.color,icon:s.isActive?(0,$.jsx)(Ym,{spin:!0}):s.isSuccess?(0,$.jsx)(u4,{}):s.isFailure?(0,$.jsx)(p4,{}):(0,$.jsx)(XB,{}),style:{margin:0},children:s.label}),(0,$.jsx)(qQ,{style:{background:`#f0f0ff`,border:`none`,color:`#6366f1`,margin:0},children:e.projectName}),(0,$.jsx)(w1.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.imageSize||`-`,` · `,e.imageProportion||`-`,` · `,e.imagePx||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:_7(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:_7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(YV,{children:[e.status===`prompt_optimized`&&(0,$.jsx)(Z,{type:`primary`,size:`small`,icon:(0,$.jsx)(K6,{}),loading:i,disabled:!e.configComplete||e.canGenerate===!1,onClick:()=>T(e),style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`生成`}),s.isActive&&(0,$.jsx)(qQ,{color:`processing`,icon:(0,$.jsx)(Ym,{spin:!0}),style:{padding:`4px 12px`,fontSize:12},children:`生成中...`}),s.isFailure&&(0,$.jsx)(Z,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(K6,{}),loading:i,disabled:!e.configComplete||e.canRetry===!1,onClick:()=>T(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)(w1.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)(w1.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)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词 `,e.status===`prompt_optimized`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!n&&(0,$.jsxs)(YV,{size:4,children:[(0,$.jsx)(jw,{title:`复制`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(Q$,{}),onClick:async()=>{let e=await x7(r);Q.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),e.status===`prompt_optimized`&&(0,$.jsx)(jw,{title:`编辑`,children:(0,$.jsx)(Z,{type:`text`,size:`small`,icon:(0,$.jsx)(k$,{}),onClick:()=>{x(e.id),y(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt}))},style:{color:`#6366f1`}})})]})]}),n?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(wW.TextArea,{value:r,onChange:t=>y(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)(Z,{size:`small`,onClick:()=>x(null),children:`取消`}),(0,$.jsx)(Z,{size:`small`,type:`primary`,onClick:()=>{y(t=>({...t,[e.id]:r})),x(null),Q.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)(w1.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.imagePx?`${e.imagePx} `:`-`},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost} `:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(w1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(w1.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)(w1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(w1.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)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(u8,{}),loading:i,disabled:!e.configComplete||e.canGenerate===!1,onClick:()=>T(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`?`生成视频`:`生成图片`})}),s.isFailure&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsxs)(Z,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(K6,{}),loading:i,disabled:!e.configComplete||e.canRetry===!1,onClick:()=>T(e),style:{borderRadius:12,fontWeight:600,height:44},children:[`重新生成`,o===`video`?`视频`:`图片`]})})]}),(0,$.jsx)(`div`,{style:{flex:`1 1 40%`,minWidth:240},children:s.isActive?(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)(Ym,{style:{color:`#6366f1`,fontSize:32},spin:!0}),(0,$.jsxs)(w1.Text,{style:{color:`#94a3b8`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成中...`]}),(0,$.jsx)(w1.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`请耐心等待,生成完成后将自动展示`})]}):s.isSuccess&&(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)(jw,{title:`下载${o===`video`?`视频`:`图片`}`,children:(0,$.jsx)(Z,{size:`small`,icon:(0,$.jsx)(f0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${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:`https://ceshi.apiforeign.minzhongzc.com${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,display:`block`}}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${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)(YV,{children:[o===`video`?(0,$.jsx)(X8,{style:{color:`#6366f1`}}):(0,$.jsx)(L6,{style:{color:`#6366f1`}}),(0,$.jsx)(w1.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:[`生成于 `,_7(e.generatedAt)]})]})]}):s.isFailure?(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)(p4,{style:{color:`#ef4444`,fontSize:32}}),(0,$.jsxs)(w1.Text,{style:{color:`#ef4444`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成失败`]}),(0,$.jsx)(w1.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)(XB,{style:{color:`#94a3b8`,fontSize:32}}),(0,$.jsxs)(w1.Text,{style:{color:`#94a3b8`,fontSize:14},children:[`待生成`,o===`video`?`视频`:`图片`]}),(0,$.jsx)(w1.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`点击左侧生成按钮开始生成`})]})})]})})]},e.id)})}),t.total>0&&(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:18},children:(0,$.jsx)(uG,{current:t.page||c,pageSize:t.pageSize||u,total:t.total,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{l(e),d(t)}})})]})},R7=({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()})},Xoe=()=>{let{user:e}=l7(),[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 T5(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)(Lq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(IR,{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)(YV,{style:{marginBottom:10},children:[(0,$.jsx)(Q8,{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)(R7,{value:e?.credits??0})})]})]})}),(0,$.jsx)(IR,{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)(YV,{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)(T2,{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)(R7,{value:f})})]})}),(0,$.jsx)(IR,{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)(YV,{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)(g2,{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)(R7,{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)(z8,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(PQ,{columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>(0,$.jsx)(qQ,{color:e===`recharge`?`green`:`orange`,icon:e===`recharge`?(0,$.jsx)(T2,{}):(0,$.jsx)(g2,{}),children:e===`recharge`?`充值`:`消费`})},{title:`积分变动`,dataIndex:`amount`,key:`amount`,width:120,render:e=>(0,$.jsxs)(w1.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:_7(e)})}],dataSource:t,rowKey:`id`,loading:r,pagination:{current:a,pageSize:s,total:l,onChange:d,showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},scroll:{x:500}})})]})]})},Zoe=()=>{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 T5(c,u);r(e.records||[]),a(e.credits||0),s(e.total||0)}catch{r([])}t(!1)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Lq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(IR,{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)(Q8,{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)(IR,{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)(Y6,{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)(IR,{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)(z8,{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)(z8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(jG,{spinning:e,children:n.length===0?(0,$.jsx)(fC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无积分变动记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(PQ,{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)`},team_internal:{color:`#0958d9`,label:`团队内部`,bg:`rgba(139,92,246,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(qQ,{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)(w1.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)(uG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})]})},Qoe=()=>{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 nae(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)(eH,{style:{color:`#0ea5e9`,fontSize:16}}),(0,$.jsx)(w1.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)(jG,{spinning:e,children:n.length===0?(0,$.jsx)(fC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无订单记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(PQ,{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)(s2,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(t5,{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)(w1.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)(w1.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)(qQ,{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)(uG,{current:o,pageSize:c,total:i,onChange:e=>{s(e)},size:`small`})})]})})})]})})},$oe=()=>{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 O5(c,u);r(e.items||[]),s(e.total||0)}catch{r([])}t(!1)},f=async()=>{try{a(await k5())}catch{a(0)}},p=async e=>{try{await A5(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)(B2,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(w1.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)(jG,{spinning:e,children:n.length===0?(0,$.jsx)(fC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无消息`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(PQ,{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)(x8,{style:{fontSize:14}})},credit:{color:`#f59e0b`,label:`积分`,bg:`rgba(245,158,11,0.1)`,icon:(0,$.jsx)(Q8,{style:{fontSize:14}})},promo:{color:`#8b5cf6`,label:`活动`,bg:`rgba(139,92,246,0.1)`,icon:(0,$.jsx)(p3,{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,render:e=>(0,$.jsx)(`div`,{style:{maxWidth:300},dangerouslySetInnerHTML:{__html:e}})},{title:`状态`,dataIndex:`isRead`,key:`isRead`,width:80,render:(e,t)=>e??t.is_read?(0,$.jsx)(qQ,{color:`gray`,style:{background:`rgba(148,163,184,0.1)`},children:`已读`}):(0,$.jsx)(qQ,{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)(Z,{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)(uG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})})},z7=()=>{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)(vL,{activeKey:t,onChange:n,items:[{key:`credits`,label:`积分明细`},{key:`orders`,label:`订单记录`}],style:{marginBottom:24},size:`large`}),t===`credits`&&(0,$.jsx)(Zoe,{}),t===`orders`&&(0,$.jsx)(Qoe,{})]})},ese=(e,t)=>e<=1?6:e===2||e===4||e===3?3:2,tse=e=>F7(e).label,nse=300,rse=.6,ise=e=>{let t=Math.sin(e*9999)*1e4;return t-Math.floor(t)},B7=(e,t=0)=>{if(!e)return 0;let n=new Date(e).getTime();if(isNaN(n))return 0;let r=Math.max(0,(Date.now()-n)/1e3);if(r>=nse)return 99;let i=Math.min(99,r*rse),a=t*3+ise(t+1)*8;return i=Math.max(0,i-a),i},ase=({item:e,isPending:t,isCompleted:n,onAnimationComplete:r,index:i=0})=>{let[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),l=(0,S.useRef)(null);return(0,S.useEffect)(()=>{s||o(B7(e.createdAt,i))},[e,i,s]),(0,S.useEffect)(()=>{if(n&&!s){c(!0);return}if(!t&&!s){l.current&&=(clearInterval(l.current),null);return}return l.current=window.setInterval(()=>{s||o(B7(e.createdAt,i))},1e3),()=>{l.current&&=(clearInterval(l.current),null)}},[e.createdAt,t,n,s,e.id,i]),(0,S.useEffect)(()=>{if(s){let e=a,t=Date.now(),n=()=>{let i=Date.now()-t,a=Math.min(i/800,1),s=1-(1-a)**3;o(e+(100-e)*s),a<1?requestAnimationFrame(n):setTimeout(()=>{r?.()},100)};requestAnimationFrame(n)}},[s,a,r]),!t&&!s?null:(0,$.jsx)(`div`,{style:{marginTop:4},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,fontSize:13,color:`#8b5cf6`,fontWeight:700,textShadow:`0 0 8px rgba(139, 92, 246, 0.3)`,transition:`all 0.3s ease-out`},children:[Math.round(a),`%`]})})},ose=({task:e,onPreview:t,resolveUrl:n=e=>e||``})=>{let r=Math.max(1,Math.min(5,Number(e.generationCount||e.childItems?.length||1))),i=[...e.childItems||[]].sort((e,t)=>Number(e.generationIndex||0)-Number(t.generationIndex||0)),a=i.length>0?i:r>1?Array.from({length:r},(t,n)=>({id:`${e.id||`task`}-placeholder-${n+1}`,genType:e.genType,status:e.status,displayStatus:e.displayStatus,pipelineStage:e.pipelineStage,generationIndex:n+1,errorMessage:e.errorMessage,createdAt:e.createdAt})):[e],[o,s]=(0,S.useState)(new Set),c=(0,S.useRef)(new Set);(0,S.useEffect)(()=>{let e=`gen-task-resource-grid-animations`;if(document.getElementById(e))return;let t=document.createElement(`style`);t.id=e,t.textContent=` .gen-task-loading-bg { position: relative; @@ -511,7 +511,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 75% { transform: translate(100px, -20px); } 100% { transform: translate(60px, -40px); } } - `,document.head.appendChild(t)},[]),(0,S.useEffect)(()=>{a.slice(0,5).forEach((e,t)=>{let n=F7(e),r=n.isActive,i=n.isSuccess,a=e.id||`${t}`;i&&!c.current.has(a)&&r===!1&&(c.current.add(a),s(e=>{let t=new Set(e);return t.add(a),t}))})},[a]);let l=e=>{s(t=>{let n=new Set(t);return n.delete(e),n})};return(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`repeat(6, minmax(0, 1fr))`,gridAutoRows:`minmax(0, 1fr)`,gap:r>1?6:0},children:a.slice(0,5).map((r,i)=>{let s=F7(r),c=s.effectiveKey,u=r.imageUrl?n(`/static${r.imageUrl}&w=300&q=50`):``,d=n(r.videoUrl),f=r.videoCoverUrl?n(`/static${r.videoCoverUrl}&w=300&q=50`):``,p=(r.genType||e.genType)===`video`,m=p?!!d:!!u,h=s.isActive,g=s.isSuccess,_=r.id||`${i}`,v=o.has(_),y=g&&!v,b=v?`加载中`:tse(r);return(0,$.jsxs)(`div`,{style:{gridColumn:`span ${ese(a.length,i)}`,minWidth:0,minHeight:0,position:`relative`,overflow:`hidden`,borderRadius:a.length===1?12:8,background:`#ffffff`,border:`1px solid #E7EAF0`},children:[m&&s.isSuccess&&y?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>t(p?d:u,p?`video`:`image`),style:{width:`100%`,height:`100%`,border:0,padding:0,background:`transparent`,cursor:`pointer`,position:`relative`},children:[p?f?(0,$.jsx)(`img`,{src:f,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:d,muted:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:u,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),p?(0,$.jsx)(U6,{style:{position:`absolute`,left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,fontSize:a.length>2?28:46,color:`rgba(255,255,255,.92)`,filter:`drop-shadow(0 4px 10px rgba(0,0,0,.28))`}}):null]}):(0,$.jsxs)(`div`,{className:h||v?`gen-task-loading-bg`:``,style:{width:`100%`,height:`100%`,minHeight:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:7,padding:8,textAlign:`center`},children:[h||v?(0,$.jsx)(`span`,{className:`gen-task-aurora-3`}):null,h||v?(0,$.jsx)(Ym,{spin:!0,style:{color:`#8b5cf6`,fontSize:a.length>2?20:34}}):(0,$.jsx)(gie,{style:{color:c===`deleted`?`#98A2B3`:`#A45B5B`,fontSize:a.length>2?20:34}}),(0,$.jsx)(`span`,{style:{fontSize:a.length>2?10:12,color:h||v?`#8b5cf6`:c===`deleted`?`#98A2B3`:`#A45B5B`,fontWeight:500},children:b}),(0,$.jsx)(ase,{item:r,isPending:h||v,isCompleted:g,onAnimationComplete:()=>l(_),index:r.generationIndex||i}),!h&&r.errorMessage&&a.length<=2?(0,$.jsx)(`span`,{style:{fontSize:10,color:`#A45B5B`,lineHeight:1.3,maxHeight:28,overflow:`hidden`},children:r.errorMessage}):null]}),a.length>1?(0,$.jsxs)(`span`,{style:{position:`absolute`,top:5,left:5,zIndex:2,padding:`1px 6px`,borderRadius:10,background:`rgba(17,24,39,.58)`,color:`#fff`,fontSize:10},children:[`#`,r.generationIndex||i+1]}):null]},r.id||`${i}`)})})},{Text:V7}=w1,sse=({items:e,selectedId:t,onSelect:n})=>e.length?(0,$.jsx)(YV,{orientation:`vertical`,style:{width:`100%`},size:10,children:e.map(e=>{let r=t===e.id;return(0,$.jsxs)(`div`,{onClick:()=>n(e),style:{padding:14,borderRadius:14,cursor:`pointer`,border:r?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:r?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(YV,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(V7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(V7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(qQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(qQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(qQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})}):(0,$.jsx)(fC,{description:`暂无项目组`}),cse={Active:`green`,Processing:`processing`,Failed:`red`,local_deleted:`default`,remote_deleted:`default`,delete_failed:`red`},lse={Active:`入库成功`,Processing:`入库处理中`,Failed:`入库失败`,local_deleted:`本地已删除`,remote_deleted:`远程已删除`,delete_failed:`删除失败`},H7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,U7=e=>e.assetType===`Video`?H7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):H7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),use=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},dse=({items:e,onDelete:t,onRefresh:n})=>{let r=(0,S.useRef)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`Image`);(0,S.useEffect)(()=>(e.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&n?r.current||=window.setInterval(()=>{n()},3e3):r.current&&=(clearInterval(r.current),null),()=>{r.current&&=(clearInterval(r.current),null)}),[e,n]);let u=e=>{let t=U7(e);t&&(s(t),l(e.assetType===`Video`?`Video`:`Image`),a(!0))};return e.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:e.map(e=>{let n=e.assetType===`Video`,r=U7(e);return(0,$.jsx)(bL,{hoverable:!0,bodyStyle:{padding:12},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[r?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:r,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:r,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:r,alt:e.name||``,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(X8,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(L6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(qQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),r&&(0,$.jsx)(Z,{size:`small`,shape:`circle`,icon:(0,$.jsx)(nW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>u(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:use(e.videoDuration)})]}),children:(0,$.jsxs)(YV,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(jw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(YV,{wrap:!0,size:4,children:[(0,$.jsx)(qQ,{color:cse[e.status]||`default`,children:lse[e.status]||e.status}),(0,$.jsx)(qQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(YV,{size:6,wrap:!0,children:(0,$.jsx)(oK,{title:`确认删除这个素材吗?`,onConfirm:()=>t(e.id),children:(0,$.jsx)(Z,{size:`small`,danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(nK,{title:`素材预览`,open:i,onCancel:()=>a(!1),footer:null,width:760,destroyOnClose:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:c===`Video`?(0,$.jsx)(`video`,{src:o,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:o,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]}):(0,$.jsx)(fC,{description:`暂无素材`})},W7=(0,S.createContext)(void 0),fse=({children:e,refreshConfig:t})=>(0,$.jsx)(W7.Provider,{value:{refreshConfig:t},children:e}),G7=()=>{let e=(0,S.useContext)(W7);if(!e)throw Error(`useLibrary must be used within a LibraryProvider`);return e},K7=2,q7=15,pse=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),mse=e=>e==null||!Number.isFinite(e)||e<=0?(Q.error(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eq7?(Q.error(`视频素材最长不能超过 ${q7} 秒`),!1):!0,hse=({projectId:e,open:t,onClose:n,onSuccess:r})=>{let{refreshConfig:i}=G7(),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)({}),[l,u]=(0,S.useState)({}),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)({}),[h,g]=(0,S.useState)(!1),_=()=>{o([]),c({}),u({}),f({}),m({})};return(0,$.jsx)(nK,{title:`上传真人素材`,open:t,onCancel:()=>{_(),n()},onOk:async()=>{let t=a.filter(e=>l[e.uid]===`uploaded`);if(t.length===0){Q.warning(`请等待文件上传完成后再提交入库`);return}g(!0);try{for(let n of t){let t=n.originFileObj;if(!t)continue;let r=d[n.uid];if(!r)continue;m(e=>({...e,[n.uid]:`importing`}));let i=t.type.startsWith(`image/`)?`Image`:`Video`;await eoe(e,{url:r.url,assetType:i,name:s[n.uid]?.trim()||t.name,videoDuration:r.duration_seconds,fileSize:r.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:r.resource_id||null}),m(e=>({...e,[n.uid]:`imported`}))}Q.success(`已成功提交 ${t.length} 个素材入库,处理中`),i(),setTimeout(()=>{_(),r(),n()},1500)}catch(e){Q.error(e?.message||`提交入库失败`)}finally{g(!1)}},confirmLoading:h,okText:`提交入库`,destroyOnHidden:!0,width:650,okButtonProps:{disabled:a.length===0||a.some(e=>l[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(v0,{accept:`image/*,video/*`,fileList:a,multiple:!0,beforeUpload:async e=>{let t=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=e.type.startsWith(`image/`),r=URL.createObjectURL(e),i={uid:t,name:e.name,status:`uploading`,originFileObj:e,thumbUrl:r,type:e.type};o(e=>[...e,i]),c(e=>({...e,[t]:``})),u(e=>({...e,[t]:`uploading`}));try{let r=n?`Image`:`Video`,i=r===`Video`?await pse(e):null;if(r===`Video`&&!mse(i))return u(e=>({...e,[t]:`error`})),!1;let a=r===`Video`?await Vie(e,i||void 0):await Bie(e);f(e=>({...e,[t]:{url:a.url,duration_seconds:a.duration_seconds,file_size_bytes:a.file_size_bytes,resource_id:a.resource_id}})),u(e=>({...e,[t]:`uploaded`}))}catch{u(e=>({...e,[t]:`error`})),Q.error(`文件 ${e.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=l[t.uid],a=p[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(X8,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(L6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(wW,{style:{width:200,flexShrink:0},value:s[t.uid]||``,onChange:e=>c({...s,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),o(e=>e.filter(e=>e.uid!==t.uid)),c(e=>{let n={...e};return delete n[t.uid],n}),u(e=>{let n={...e};return delete n[t.uid],n}),f(e=>{let n={...e};return delete n[t.uid],n}),m(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(Z,{icon:(0,$.jsx)(G8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,音频暂不接入。视频素材必须在 `,K7,`~`,q7,` 秒内;入库后会经过火山真人一致性校验,入库校验成功 后才可用于 AI 创作。`]})]})})})},gse=({project:e,onDeleted:t,onChanged:n})=>{let{refreshConfig:r}=G7(),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(),[m,h]=(0,S.useState)(),[g,_]=(0,S.useState)(1),[v,y]=(0,S.useState)(20),[b,x]=(0,S.useState)(0),C=async(t=g,n=v)=>{s(!0);try{let r=await toe(e.id,{page:t,pageSize:n,keyword:u,status:f,assetType:m});a(r.items),x(r.total||0),_(t),y(n)}catch(e){Q.error(e?.message||`加载素材失败`)}finally{s(!1)}};(0,S.useEffect)(()=>{C(1,v)},[e.id,u,f,m]);let w=async e=>{try{await noe(e),await C(g,v),n(),r(),Q.success(`素材已删除`)}catch(e){Q.error(e?.message||`删除素材失败`)}},T=async()=>{try{await Qae(e.id),Q.success(`项目组已删除`),t()}catch(e){Q.error(e?.message||`删除项目组失败`)}},E=e.status===`active`;return(0,$.jsxs)(bL,{title:(0,$.jsx)(YV,{children:(0,$.jsx)(`span`,{children:e.name})}),extra:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(G8,{}),disabled:!E,onClick:()=>l(!0),children:`上传素材`}),(0,$.jsx)(oK,{title:`确认删除这个真人素材项目组吗?`,onConfirm:T,children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除项目组`})})]}),style:{borderRadius:16},children:[!E&&(0,$.jsx)(w1.Paragraph,{style:{color:`#f97316`},children:`项目组未完成真人认证,暂不能上传素材。请重新创建项目组并完成手机扫码认证。`}),(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(wW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:u,onChange:e=>d(e.target.value),onSearch:()=>C(1,v),style:{width:240}}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材状态`,value:f,onChange:e=>p(e),style:{width:150},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材类型`,value:m,onChange:e=>h(e),style:{width:130},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{onClick:()=>C(1,v),children:`筛选`})]}),(0,$.jsx)(jG,{spinning:o,children:i.length===0?(0,$.jsx)(fC,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dse,{items:i,loading:o,onDelete:w,onRefresh:()=>C(g,v)}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(uG,{current:g,pageSize:v,total:b,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>C(e,t)})})]})}),(0,$.jsx)(hse,{projectId:e.id,open:c,onClose:()=>l(!1),onSuccess:()=>{C(1,v),n()}})]})},J7=`group_active`,Y7=2e3,_se=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),[g]=UH.useForm(),_=(0,S.useRef)(null),v=()=>{_.current&&=(window.clearInterval(_.current),null)},y=()=>{v(),s(!1),l(!1),h(!1),d(null),p(null),g.resetFields()},b=async()=>{a(!0);try{let e=await o7({pageSize:100,status:`active`});t(e.items),r(t=>t?e.items.find(e=>e.id===t.id)||e.items[0]||null:e.items[0]||null)}catch(e){Q.error(e?.message||`加载真人素材项目组失败`)}finally{a(!1)}};(0,S.useEffect)(()=>{b()},[]),(0,S.useEffect)(()=>()=>v(),[]);let x=async e=>{v(),h(!1),Q.success(`真人认证完成,项目组已创建成功`),s(!1),p(null),d(null),g.resetFields();let n=await o7({pageSize:100,status:`active`});t(n.items),r(n.items.find(t=>t.id===e)||n.items[0]||null)},C=(e,t,n)=>{v(),h(!0);let r=async()=>{try{let n=await $ae(e);if(p(n),n.status===J7){await x(t);return}[`callback_failed`,`failed`,`expired`].includes(n.status)&&(v(),h(!1),Q.error(n.errorMessage||`真人认证未完成,请重新创建项目组`))}catch(e){v(),h(!1),Q.error(e?.message||`轮询真人认证状态失败`)}};_.current=window.setInterval(r,Math.max(1e3,n||Y7)),r()},w=async()=>{let e=await g.validateFields();l(!0);try{let t=`${window.location.origin}/private-portrait-authorized`,n=await Zae({...e,callbackRedirectUrl:t});d(n.project),p(n.validateSession),Q.success(`请使用手机扫码完成人脸认证`),n.validateSession?.id&&C(n.validateSession.id,n.project.id,n.pollIntervalMs||Y7)}catch(e){Q.error(e?.message||`创建项目组认证二维码失败`)}finally{l(!1)}},T=f?.h5Link||``,E=f?.status===J7;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:`真人素材库`}),(0,$.jsx)(w1.Text,{type:`secondary`,children:`创建项目组时先完成真人认证,认证成功后项目组才会正式创建并可上传素材。`})]}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>s(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Lq,{gutter:16,children:[(0,$.jsx)(IR,{xs:24,lg:5,children:(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520},children:(0,$.jsx)(jG,{spinning:i,children:e.length===0?(0,$.jsx)(fC,{description:`暂无真人项目组`}):(0,$.jsx)(sse,{items:e,selectedId:n?.id,onSelect:r})})})}),(0,$.jsx)(IR,{xs:24,lg:19,children:n?(0,$.jsx)(gse,{project:n,onDeleted:()=>{r(null),b()},onChanged:b}):(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520,textAlign:`center`,color:`#94a3b8`},children:`请先创建或选择一个真人素材项目组`})})]}),(0,$.jsx)(nK,{title:`新建真人素材项目组`,open:o,onCancel:y,footer:f?[(0,$.jsx)(Z,{onClick:y,children:`关闭`},`close`)]:void 0,onOk:f?void 0:w,okText:`开始认证并创建`,confirmLoading:c,mask:{closable:!m},children:f?(0,$.jsxs)(YV,{direction:`vertical`,align:`center`,size:16,style:{width:`100%`},children:[E?(0,$.jsx)(u4,{style:{fontSize:54,color:`#22c55e`}}):T?(0,$.jsx)(_q,{value:T,size:220}):(0,$.jsx)(jG,{}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(w1.Title,{level:5,style:{marginBottom:8},children:u?.name||`真人素材项目组`}),(0,$.jsx)(w1.Text,{type:E?`success`:`secondary`,children:E?`认证成功,项目组正在刷新`:`请使用手机扫码完成人脸认证,成功后回到电脑端查看项目组。`})]})]}):(0,$.jsxs)(UH,{form:g,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{label:`项目组名称`,name:`name`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:达人A、客户B、张三人像`})}),(0,$.jsx)(UH.Item,{label:`描述`,name:`description`,children:(0,$.jsx)(wW.TextArea,{rows:3,placeholder:`可选`})}),(0,$.jsx)(w1.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`点击后会生成真人认证二维码。手机扫码认证成功后,项目组才会出现在项目列表中。`})]})})]})},{Text:X7}=w1,Z7=2,Q7=15,vse={creating:{label:`本地创建中`,color:`processing`},Processing:{label:`入库处理中`,color:`processing`},Active:{label:`入库成功`,color:`success`},Failed:{label:`入库失败`,color:`error`},local_deleted:{label:`本地已删`,color:`default`},remote_deleted:{label:`远端已删`,color:`default`},delete_failed:{label:`远端删除失败`,color:`error`}},yse=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},$7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,e9=e=>e.assetType===`Video`?$7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):$7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),bse=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),xse=(e,t)=>e==null||!Number.isFinite(e)||e<=0?(t(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eQ7?(t(`视频素材最长不能超过 ${Q7} 秒`),!1):!0,Sse=({status:e})=>{let t=e||`-`,n=vse[t];return(0,$.jsx)(qQ,{color:n?.color||`default`,children:n?.label||t})},Cse=()=>{let{message:e}=rx.useApp(),{refreshConfig:t}=G7(),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(1),[m,h]=(0,S.useState)(20),[g,_]=(0,S.useState)(0),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(),[C,w]=(0,S.useState)(),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)([]),[F,I]=(0,S.useState)({}),[L,R]=(0,S.useState)({}),[z,B]=(0,S.useState)({}),[V,H]=(0,S.useState)({}),[U,W]=(0,S.useState)(!1),[G,K]=(0,S.useState)(``),[ee,q]=(0,S.useState)(`Image`),[te]=UH.useForm(),ne=(0,S.useRef)(null),re=(0,S.useMemo)(()=>n.find(e=>e.id===i)||null,[n,i]),ie=async()=>{l(!0);try{let e=(await c7({page:1,pageSize:100,status:`active`})).items||[];r(e),a(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(t){e.error(t?.message||`加载虚拟人像项目组失败`)}finally{l(!1)}},J=async(t=f,n=m)=>{if(!i){s([]),_(0);return}d(!0);try{let e=await soe(i,{page:t,pageSize:n,keyword:v.trim()||void 0,status:b,assetType:C});s(e.items||[]),_(e.total||0),p(t),h(n)}catch(t){e.error(t?.message||`加载虚拟人像素材失败`)}finally{d(!1)}},ae=async()=>{await ie()};(0,S.useEffect)(()=>{ae()},[]),(0,S.useEffect)(()=>{i&&J(1,m)},[i]),(0,S.useEffect)(()=>(o.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&i?ne.current||=window.setInterval(()=>{J(f,m)},3e3):ne.current&&=(clearInterval(ne.current),null),()=>{ne.current&&=(clearInterval(ne.current),null)}),[o,i,f,m]);let oe=async()=>{let t=await te.validateFields();O(!0);try{let n=await ioe(t);e.success(`虚拟人像项目组已创建`),E(!1),te.resetFields(),await ie(),a(n.id)}catch(t){e.error(t?.message||`创建项目组失败`)}finally{O(!1)}},se=async()=>{if(!i){e.warning(`请先创建或选择项目组`);return}if(N.length===0){e.warning(`请先选择图片或视频素材`);return}let n=N.filter(e=>L[e.uid]===`uploaded`);if(n.length===0){e.warning(`请等待文件上传完成后再提交入库`);return}M(!0);try{for(let e of n){let t=e.originFileObj;if(!t)continue;let n=z[e.uid];if(!n)continue;H(t=>({...t,[e.uid]:`importing`}));let r=t.type.startsWith(`image/`)?`Image`:`Video`;await ooe(i,{url:n.url,assetType:r,name:F[e.uid]?.trim()||t.name,videoDuration:n.duration_seconds,fileSize:n.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:n.resource_id||null}),H(t=>({...t,[e.uid]:`imported`}))}e.success(`已成功提交 ${n.length} 个素材入库,处理中`),setTimeout(()=>{A(!1),P([]),I({}),R({}),B({}),H({})},1500),await Promise.all([ie(),J(1,m),t()])}catch(t){e.error(t?.message||`提交入库失败`)}finally{M(!1)}},ce=async n=>{try{await coe(n),e.success(`素材已删除,远端删除将异步执行`),await Promise.all([ie(),J(f,m),t()])}catch(t){e.error(t?.message||`删除素材失败`)}},le=async()=>{if(i)try{await aoe(i),e.success(`项目组已删除,远端资产组将异步删除`),a(void 0),await ae()}catch(t){e.error(t?.message||`删除项目组失败`)}},ue=t=>{let n=e9(t);if(!n){e.warning(`暂无可预览地址`);return}K(n),q(t.assetType===`Video`?`Video`:`Image`),W(!0)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:`虚拟素材库`}),(0,$.jsx)(w1.Text,{type:`secondary`,children:`可提前上传虚拟人像素材,后续生成视频时可直接使用。`})]}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>E(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Lq,{gutter:[10,10],children:[(0,$.jsx)(IR,{xs:24,lg:5,children:(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520,margin:`0 auto`,maxWidth:1200},children:(0,$.jsx)(jG,{spinning:c,children:n.length===0?(0,$.jsx)(fC,{description:`暂无虚拟人像项目组`}):(0,$.jsx)(YV,{orientation:`vertical`,style:{width:`100%`},size:10,children:n.map(e=>{let t=i===e.id;return(0,$.jsxs)(`div`,{onClick:()=>a(e.id),style:{padding:14,borderRadius:14,cursor:`pointer`,border:t?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:t?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(YV,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(X7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(X7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(qQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(qQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(qQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})})})})}),(0,$.jsx)(IR,{xs:24,lg:19,children:(0,$.jsxs)(bL,{title:re?re.name:`素材资产`,extra:(0,$.jsxs)(YV,{wrap:!0,children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(G8,{}),disabled:!i,onClick:()=>A(!0),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`上传图片/视频`}),i&&(0,$.jsx)(oK,{title:`确认删除当前虚拟人像项目组吗?`,onConfirm:le,children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),style:{borderRadius:8,fontWeight:600},children:`删除项目组`})})]}),style:{borderRadius:16,minHeight:520},children:[(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(wW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onSearch:()=>J(1,m),style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材状态`,value:b,onChange:e=>x(e),style:{width:140,borderRadius:8},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材类型`,value:C,onChange:e=>w(e),style:{width:120,borderRadius:8},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{type:`primary`,onClick:()=>J(1,m),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`筛选`})]}),(0,$.jsx)(jG,{spinning:u,children:i?o.length===0?(0,$.jsx)(fC,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:o.map(e=>{let t=e9(e),n=e.assetType===`Video`;return(0,$.jsx)(bL,{hoverable:!0,styles:{body:{padding:12}},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[t?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:t,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:t,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t,alt:e.name||`虚拟人像素材`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(X8,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(L6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(qQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),t&&(0,$.jsx)(Z,{size:`small`,shape:`circle`,icon:(0,$.jsx)(nW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>ue(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:yse(e.videoDuration)})]}),children:(0,$.jsxs)(YV,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(jw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(YV,{wrap:!0,size:4,children:[(0,$.jsx)(Sse,{status:e.status}),(0,$.jsx)(qQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(YV,{size:6,wrap:!0,children:(0,$.jsx)(oK,{title:`确认删除这个虚拟人像素材吗?`,onConfirm:()=>ce(e.id),children:(0,$.jsx)(Z,{size:`small`,danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(uG,{current:f,pageSize:m,total:g,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>J(e,t)})})]}):(0,$.jsx)(fC,{description:`请先创建或选择项目组`,style:{marginTop:80}})})]})})]}),(0,$.jsx)(nK,{title:`创建虚拟人像项目组`,open:T,onCancel:()=>E(!1),onOk:oe,confirmLoading:D,okText:`创建项目组`,children:(0,$.jsxs)(UH,{form:te,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`name`,label:`项目组名称`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:虚拟主播A / 品牌代言人B`,maxLength:128})}),(0,$.jsx)(UH.Item,{name:`description`,label:`描述`,children:(0,$.jsx)(wW.TextArea,{placeholder:`可填写人物设定、服装风格、素材要求等`,maxLength:2e3,rows:4})})]})}),(0,$.jsx)(nK,{title:`上传虚拟人像素材`,open:k,onCancel:()=>A(!1),onOk:se,confirmLoading:j,okText:`提交入库`,width:650,okButtonProps:{disabled:N.length===0||N.some(e=>L[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(v0,{accept:`image/*,video/*`,fileList:N,multiple:!0,beforeUpload:async t=>{let n=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,r=t.type.startsWith(`image/`),i=URL.createObjectURL(t),a={uid:n,name:t.name,status:`uploading`,originFileObj:t,thumbUrl:i,type:t.type};P(e=>[...e,a]),I(e=>({...e,[n]:``})),R(e=>({...e,[n]:`uploading`}));try{let i=r?`Image`:`Video`,a=i===`Video`?await bse(t):null;if(i===`Video`&&!xse(a,e.error))return R(e=>({...e,[n]:`error`})),!1;let o=i===`Video`?await Uie(t,a||void 0):await Hie(t);B(e=>({...e,[n]:{url:o.url,duration_seconds:o.duration_seconds,file_size_bytes:o.file_size_bytes,resource_id:o.resource_id}})),R(e=>({...e,[n]:`uploaded`}))}catch{R(e=>({...e,[n]:`error`})),e.error(`文件 ${t.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=L[t.uid],a=V[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(X8,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(L6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(wW,{style:{width:200,flexShrink:0},value:F[t.uid]||``,onChange:e=>I({...F,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),P(e=>e.filter(e=>e.uid!==t.uid)),I(e=>{let n={...e};return delete n[t.uid],n}),R(e=>{let n={...e};return delete n[t.uid],n}),B(e=>{let n={...e};return delete n[t.uid],n}),H(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(Z,{icon:(0,$.jsx)(G8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,视频素材必须在 `,Z7,`~`,Q7,` 秒内;提交后会调用火山 CreateAsset 异步处理,状态变为 入库校验成功 后才可用于 AI 创作。`]})]})})}),(0,$.jsx)(nK,{title:`素材预览`,open:U,onCancel:()=>W(!1),footer:null,width:760,destroyOnHidden:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:ee===`Video`?(0,$.jsx)(`video`,{src:G,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:G,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]})},{Title:wse,Text:Tse,Paragraph:Ese}=w1,t9=e=>e===`aigc_virtual`?`aigc_virtual`:`real_person`,Dse=()=>{let[e,t]=Dn(),[n,r]=(0,S.useState)(()=>t9(e.get(`portraitTab`))),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(),u=async()=>{try{a(n===`aigc_virtual`?await s7():await a7())}catch(e){Q.error(e?.message||`加载配置失败`)}};(0,S.useEffect)(()=>{(async()=>{try{if(n===`aigc_virtual`){let[e,t]=await Promise.all([s7(),c7({page:1,pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}else{let[e,t]=await Promise.all([a7(),o7({pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}}catch(e){Q.error(e?.message||`加载数据失败`)}})()},[n]),(0,S.useMemo)(()=>o.find(e=>e.id===c)||null,[o,c]);let d=(0,S.useMemo)(()=>i?`已用 ${i.usedAssetCount||0} / ${i.assetLimit||0} 个素材,剩余 ${i.remainingAssetCount||0}`:`额度加载中`,[i]),f=(0,S.useMemo)(()=>[{key:`real_person`,label:`真人素材库`,children:(0,$.jsx)(_se,{})},{key:`aigc_virtual`,label:`虚拟素材库`,children:(0,$.jsx)(Cse,{})}],[]);return(0,$.jsx)(fse,{refreshConfig:u,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(vL,{activeKey:n,onChange:n=>{let i=t9(n);r(i);let a=new URLSearchParams(e);a.set(`filterType`,`private_portrait`),a.set(`portraitTab`,i),t(a,{replace:!0})},items:f,destroyOnHidden:!1,tabBarExtraContent:(0,$.jsxs)(`div`,{style:{fontSize:14,fontWeight:700,color:`#4f46e5`,marginTop:8},children:[d,`。真人/虚拟共用,图片/视频共用。`]})})})})},{Header:Ose,Sider:kse,Content:Ase}=NW,{TextArea:jse}=wW,{Option:Mse}=HC,{Text:n9}=w1,Nse=`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/api\/?$/i,``).replace(/\/$/,``),Pse=e=>{if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${Nse}${t.startsWith(`/`)?t:`/${t}`}`:``},Fse=()=>{let{message:e}=rx.useApp(),t=Ge(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(`1`),[o,s]=(0,S.useState)([]),{mediaType:c,countType:l,generationCount:u,selectedRatio:d,selectedResolution:f,width:p,height:m,videoDuration:h,videoAspectRatio:g,videoResolution:_,engineOptions:v,enginesele:y,inputValue:b,setMediaType:x,setCountType:C,setGenerationCount:w,setSelectedRatio:T,setSelectedResolution:E,setWidth:D,setHeight:O,setVideoDuration:k,setVideoAspectRatio:A,setVideoResolution:j,setEngineOptions:M,setEnginesele:N,setInputValue:P,currentMedia:F,setCurrentMedia:I}=h7(),L=Array.isArray(y)?{}:y,R=(c===`image`?L.image:L.video)?.find(e=>e.id===l),z=R?.maxImageCount??4,B=R?.maxVideoCount??1,V=!!R?.multiGenerationEnabled,H=V?Math.max(1,Math.min(5,Number(R?.maxGenerationCount||1))):1,U=c===`image`?F.filter(e=>e.type===`image`).length:0,W=c===`image`?Math.max(1,Number(R?.multiImageMaxImages||15)-U):5,G=Math.max(1,Math.min(5,H,c===`image`?W:5)),[K,ee]=(0,S.useState)(!1),[q,te]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(!1),[ie,J]=(0,S.useState)(`universal`),[ae,oe]=(0,S.useState)(null),[se,ce]=(0,S.useState)(null),[le,ue]=(0,S.useState)(null),[de,fe]=(0,S.useState)(!1),[pe,me]=(0,S.useState)(!1),[he,ge]=(0,S.useState)(`real_person`),[_e,ve]=(0,S.useState)(!1),ye=(0,S.useRef)(null),be=(0,S.useCallback)(()=>{ye.current&&=(window.clearTimeout(ye.current),null),ve(!0)},[]),xe=(0,S.useCallback)(()=>{ye.current&&window.clearTimeout(ye.current),ye.current=window.setTimeout(()=>{ve(!1),ye.current=null},260)},[]),[Se,Ce]=(0,S.useState)(!1),we=(0,S.useRef)(null),Te=(0,S.useRef)(!1),[Ee,De]=(0,S.useState)({top:0,left:0}),Oe=e=>{let t=0,n=0,r=0;return e.map(e=>e.type===`image`?(t++,`图片${t}`):e.type===`video`?(n++,`视频${n}`):(r++,`音频${r}`))},[ke,Ae]=(0,S.useState)(!1),[je,Me]=(0,S.useState)(``),[Ne,Pe]=(0,S.useState)(`image`),Fe=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(ke&&Ne===`video`){let e=()=>{Fe.current&&Fe.current.play().catch(()=>{})};Fe.current&&(Fe.current.readyState>=2?e():Fe.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Fe.current&&(Fe.current.removeEventListener(`loadedmetadata`,e),Fe.current.pause())}}else Fe.current&&Fe.current.pause()},[ke,Ne]);let[Ie,Le]=(0,S.useState)(new Set),Re=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}}},ze=e=>{let t=Re(e);return t?Math.floor(Date.now()/1e3)>t:!1},[Be,Ve]=(0,S.useState)(!1),[He,Ue]=(0,S.useState)(``),[We,Ke]=(0,S.useState)(`image`),[qe,Je]=(0,S.useState)(``),Ye=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Be&&We===`video`&&Ye.current){let e=Ye.current;e.currentTime=0,e.muted=!1;let t=e.play();t&&typeof t.catch==`function`&&t.catch(()=>{e.muted=!0,e.play().catch(()=>{})})}else if(!Be&&Ye.current){let e=Ye.current;e.pause(),e.muted=!0,e.currentTime=0}},[Be,We,He]);let[Xe,Ze]=(0,S.useState)(null),[Qe,$e]=(0,S.useState)(0),[et,tt]=(0,S.useState)(!1),[nt,rt]=(0,S.useState)(null),[it,at]=(0,S.useState)({x:0,y:0}),[ot,st]=(0,S.useState)(!1),[ct,lt]=(0,S.useState)(!1),[ut,dt]=(0,S.useState)([]),[ft,pt]=(0,S.useState)([]),[mt,ht]=(0,S.useState)({}),[gt,_t]=(0,S.useState)(!1),[vt,yt]=(0,S.useState)(!1),[bt,xt]=(0,S.useState)([]),[St,Ct]=(0,S.useState)([]),[wt,Tt]=(0,S.useState)([]),Et=()=>{let e={};if(e=wt.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?_:f)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(_===`1080p`||_===`720p`||_===`480p`)&&(e.ratio=1.3)):(e={perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(f===`2K`||f===`4K`||f===`1K`)&&(e.ratio=3))),c===`video`){let t=(h*e.perSecondCredits+e.baseCredits)*e.ratio,n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=F.filter(e=>e.type===`image`).length;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}return Number((t*u).toFixed(2))}else{let t=e.baseCredits*e.ratio,n=F.filter(e=>e.type===`image`).length;if(n>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n)*(e.inputImageRatio||1);t+=r}return Number((t*u).toFixed(2))}},Dt=(0,S.useRef)(null),Ot=(0,S.useRef)(null),kt=(0,S.useRef)(null);(0,S.useRef)(!0);let At=(0,S.useRef)(!1),jt=(0,S.useRef)(0);o.find(e=>e.id===i);let[Mt,Nt]=(0,S.useState)([]),[Pt,Ft]=(0,S.useState)({page:1,pageSize:20}),[It,Lt]=(0,S.useState)(0),[Rt,zt]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=t.state;e&&(e.generationPrompt&&P(e.generationPrompt),e.mediaReferences&&Array.isArray(e.mediaReferences)&&e.mediaReferences.length>0&&I(e.mediaReferences.map(e=>{let t=e.url||e.resourceUrl||e.previewUrl||``,n=t.startsWith(`http`)?t:`https://ceshi.apiforeign.minzhongzc.com${t}`;return{...e,name:e.name||`参考${e.type}`,type:e.type===`video`?`video`:e.type===`audio`?`audio`:`image`,url:n,duration:e.duration||0,label:e.label||``}})),e.aspectRatio&&A(e.aspectRatio),window.history.replaceState({},``,window.location.pathname))},[t.state]),(0,S.useEffect)(()=>()=>{ye.current&&window.clearTimeout(ye.current)},[]);let Bt=(0,S.useCallback)((e=`instant`)=>{let t=Ot.current;t&&(jt.current=Date.now(),requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})}))},[]);(0,S.useEffect)(()=>{if(Mt.length>0&&!At.current){let e=setTimeout(()=>{Bt(`smooth`),At.current=!0},300);return()=>clearTimeout(e)}},[Mt.length,Bt]),(0,S.useEffect)(()=>{if(Te.current){Te.current=!1;return}if(!ne)return;let e=Array.isArray(y)?{}:y,t=c===`image`?e.image:e.video;t&&t.length>0&&(t.some(e=>e.id===l)||C(t[0].id))},[c,y,ne]),(0,S.useEffect)(()=>{ne&&w(1)},[c,l,ne,w]),(0,S.useEffect)(()=>{u>G&&(w(G),c===`image`&&e.info(`受当前引擎或参考图数量限制,本次最多生成 ${G} 份`))},[u,G,c,w,e]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;vt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&yt(!1),gt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&_t(!1),ot&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&st(!1),ct&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&<(!1),de&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&fe(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[vt,gt,ot,ct,de]),(0,S.useEffect)(()=>{if(Te.current){Te.current=!1;return}if(c!==`video`)return;let e=L.video?.find(e=>e.id===l);if(!e)return;let t=e.supportsFirstLastFrame??!1,n=e.supportsUniversalReference??!0;J(e=>n?`universal`:e===`universal`&&!n&&t?`first_last_frame`:e)},[l,c,y]),(0,S.useEffect)(()=>{P5().then(e=>{if(N(e.engine),re(!0),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;M({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(g)||A(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(_)||j(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(h)||k(n.supportedDurations?.[0]||5),l===`请选择`&&C(n.id)}if(e.engine.image&&e.engine.image.length>0){let t=e.engine.image.find(e=>e.id===l)||e.engine.image[0],n=t.supportedSizes||{},r=Object.keys(n).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),i=r[0]||`2K`,a=Object.keys(n[i]||{});if(dt(a.map(e=>({value:e,label:e}))),ht(n),pt(r.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),n[i]&&n[i][a[0]]){let[e,t]=n[i][a[0]].split(/[×x]/);D(Number(e)),O(Number(t)),T(a[0]),E(i)}l===`请选择`&&C(t.id)}}).catch(()=>{}),L5().then(e=>{Tt(e)}),F5(Pt).then(e=>{let t=e.total;Nt(e.items),Lt(t)})},[]),(0,S.useEffect)(()=>{if(kt.current&&=(clearInterval(kt.current),null),Mt.some(e=>e.status===`generating`))return kt.current=window.setInterval(()=>{F5(Pt).then(e=>{Nt(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),Lt(e.total)}).catch(e=>{})},1e4),()=>{kt.current&&=(clearInterval(kt.current),null)}},[Mt,Pt]),(0,S.useEffect)(()=>{if(!ot)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&st(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ot]),(0,S.useEffect)(()=>{if(!ct)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&<(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ct]);let Vt=e=>{let t=Object.keys(mt).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=mt[f]&&mt[f][e]?f:t.find(t=>mt[t]&&mt[t][e])||t[0];if(n&&mt[n]&&mt[n][e]){let[t,r]=mt[n][e].split(/[×x]/);D(Number(t)),O(Number(r)),T(e),E(n)}},Ht=e=>{mt[e]||(e=Object.keys(mt).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)})[0]||e);let t=mt[e]?Object.keys(mt[e]):[];dt(t.map(e=>({value:e,label:e})));let n=t.includes(d)?d:t[0]||``;if(n&&mt[e]&&mt[e][n]){let[t,r]=mt[e][n].split(/[×x]/);D(Number(t)),O(Number(r)),T(n),E(e)}},Ut=()=>{D(m),O(p)},Wt=y?.video?.find(e=>e.id===l),Gt=Wt?.supportsFirstLastFrame??!1,Kt=Wt?.supportsUniversalReference??!0,qt=e=>{e===`first_last_frame`&&!Gt||e===`universal`&&!Kt||(J(e),fe(!1),I([]),P(``))},Jt=()=>{let e=ae;oe(se),ce(e)},Yt=()=>{oe(null),ce(null)},Xt=()=>{ce(null)},Zt=async()=>{let t=c===`video`&&ie===`first_last_frame`;if(t){if(!b.trim()){e.warning(`请输入内容`);return}}else if(!b.trim()&&F.length===0){e.warning(`请输入内容或上传图片/视频`);return}let n=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),r=e=>!e||typeof e!=`object`?e:Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map(([e,t])=>[n(e),r(t)])),i;t?(i=[],ae&&i.push(r({...ae,role:`first_frame`})),se&&i.push(r({...se,role:`last_frame`})),i.length===0&&(i=void 0)):i=F.length>0?F.map(e=>{if(e.type===`image`){let{duration:t,...n}=e;return r(n)}return r(e)}):void 0;let a={id:``,gen_type:c,original_prompt:b.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),generation_count:u,media_references:i,...c===`image`&&{image_size:f,image_proportion:d,image_px:p+`x`+m},...c===`video`&&{duration:h,aspect_ratio:g,resolution:_}};console.log(a),te(!0),iae(a).then(()=>{P(``),I([]),oe(null),ce(null),w(1);let e={...Pt,page:1};Ft(e),F5(e).then(e=>{let t=e.items.map(e=>(e.media_references&&Array.isArray(e.media_references)&&(e.mediaReferences=e.media_references.map(e=>({...e,display_url:e.display_url||e.displayUrl,preview_url:e.preview_url||e.previewUrl,private_asset_id:e.private_asset_id||e.privateAssetId,provider_url:e.provider_url||e.providerUrl,remote_asset_id:e.remote_asset_id||e.remoteAssetId}))),e)),n=Array.isArray(t)&&t.length>0?t[t.length-1]:null;n&&Nt(e=>[...e,n]),Lt(e.total),setTimeout(()=>{Dt.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(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),e.error({content:n,duration:3})}).finally(()=>{te(!1)}),setTimeout(()=>{te(!1)},3e3)},Qt=async()=>{if(Mt.length>=It)return;let e=Ot.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;zt(!0);try{let r=Pt.page+1,i=await F5({...Pt,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&Lt(a.total),Ft(e=>({...e,page:r})),Nt(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)).reverse(),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{zt(!1)}},$t=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法获取视频时长`))},r.src=URL.createObjectURL(e)}),en=e=>new Promise((t,n)=>{let r=document.createElement(`audio`);r.preload=`metadata`,r.onloadedmetadata=()=>{URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{URL.revokeObjectURL(r.src),n(Error(`无法获取音频时长`))},r.src=URL.createObjectURL(e)}),tn=e=>{let t=e.startsWith(`http`)?e:`https://ceshi.apiforeign.minzhongzc.com${e}`;if(Xe===t){let e=document.getElementById(`audio-player`);e&&e.pause(),Ze(null)}else Ze(t)},nn=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{window.URL.revokeObjectURL(r.src),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取图片尺寸`))},r.src=URL.createObjectURL(e)}),rn=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t({width:r.videoWidth,height:r.videoHeight,duration:r.duration})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取视频尺寸`))},r.src=URL.createObjectURL(e)}),an=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},on=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},sn=async(t,n)=>{let r=t.type.startsWith(`image/`),i=t.type.startsWith(`video/`);if(c===`video`&&ie===`first_last_frame`){if(!r)return e.error(`首尾帧模式仅支持上传图片`),!1;if(t.size/1024/1024>10)return e.error(`图片大小不能超过10MB`),!1;try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let i=n||le;if(!i)return e.error(`请选择首帧或尾帧上传位置`),!1;ee(!0);try{let n=await b5(t),r={name:t.name,type:`image`,url:n.url,role:i===`first`?`first_frame`:`last_frame`};i===`first`?oe(r):ce(r),e.success(`图片上传成功`)}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{ee(!1),ue(null)}return!1}let a=t.type.startsWith(`audio/`);if(!r&&!i&&!a)return e.error(`仅支持图片、视频或音频文件`),!1;if(a){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(c===`image`&&(i||a))return e.error(`图片模式仅支持上传图片`),!1;if(a&&c!==`video`)return e.error(`仅视频模式支持上传音频`),!1;let o=i?100:a?50:10,s=i?`视频`:a?`音频`:`图片`;if(t.size/1024/1024>o)return e.error(`${s}大小不能超过${o}MB`),!1;if(r)try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let l=F.filter(e=>e.type===`image`).length;if(r&&l>=jn)return e.error(`该引擎最多上传${jn}张图片`),!1;let u=F.filter(e=>e.type===`video`).length;if(i&&u>=Mn)return e.error(`该引擎最多上传${Mn}个视频`),!1;let d=F.filter(e=>e.type===`audio`).length;if(a&&d>=Nn)return e.error(`该引擎最多上传${Nn}个音频`),!1;let f=0,p=0;if(i)try{if(f=await $t(t),f<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+f>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+f).toFixed(1)} 秒`),!1;let{width:r,height:i}=await rn(t),a=on(r,i);if(a)return e.error(a),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(a)try{if(p=await en(t),p<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+p>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+p).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}ee(!0);try{let e;e=r?await b5(t):a?await y5(t,p):await x5(t,f);let n=r?`image`:a?`audio`:`video`,o=[...F,{name:t.name,type:n,url:e.url,label:``,...i&&{duration:f},...a&&{duration:p}}],s=Oe(o);I(o.map((e,t)=>({...e,label:s[t]})))}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{ee(!1)}return!1},cn=async t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`),i=t.type.startsWith(`audio/`);if(!n&&!r&&!i)return e.error(`仅支持图片、视频或音频文件`),!1;let a=r?100:i?50:30;if(t.size/1024/1024>a)return e.error(`${r?`视频`:i?`音频`:`图片`}大小不能超过${a}MB`),!1;if(n||r){let n=h7.getState().currentMedia.filter(e=>e.type===`image`||e.type===`video`).reduce((e,t)=>e+(Number(t.fileSizeBytes)||0),0),r=(n+t.size)/1024/1024;if(r>64)return e.error(`所有图片和视频总大小不能超过64MB,当前已${(n/1024/1024).toFixed(1)}MB,加上此文件后${r.toFixed(1)}MB`),!1}if(i){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(n)try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let o=0,s=0;if(r)try{if(o=await $t(t),o<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=h7.getState().currentMedia.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+o>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+o).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(i)try{if(s=await en(t),s<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=h7.getState().currentMedia.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+s>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+s).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}let c=n?`image`:i?`audio`:`video`,l={name:t.name,type:c,url:``,label:``,...r&&{duration:o},...i&&{duration:s}},u=h7.getState().currentMedia;if(!dn(u,[l]))return!1;try{let e;return e=n?await b5(t):i?await y5(t,s):await x5(t,o),{name:l.name,type:l.type,url:e.url,label:l.label||``,fileSizeBytes:t.size,...l.duration!==void 0&&{duration:l.duration}}}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;return e.error(n),!1}},ln=async t=>{let n=0,r=0;ee(!0);for(let e of t){let t=await cn(e);if(t){let e=[...h7.getState().currentMedia,t],r=Oe(e);I(e.map((e,t)=>({...e,label:r[t]}))),n++}else r++}ee(!1),n>0&&e.success(`成功上传${n}个文件${r>0?`,${r}个文件上传失败`:``}`)},un=(e,t)=>e.filter(e=>e.type===t).reduce((e,t)=>e+(Number(t.duration)||0),0),dn=(t,n)=>{if(!n.length)return!1;if(c===`image`&&n.some(e=>e.type!==`image`))return e.error(`图片模式仅支持添加图片素材`),!1;if(n.some(e=>e.type===`audio`)&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),!1;let r=t.filter(e=>e.type===`image`).length,i=t.filter(e=>e.type===`video`).length,a=t.filter(e=>e.type===`audio`).length,o=n.filter(e=>e.type===`image`).length,s=n.filter(e=>e.type===`video`).length,l=n.filter(e=>e.type===`audio`).length;if(r+o>jn)return e.error(`该引擎最多上传${jn}张图片,当前还能添加 ${Math.max(0,jn-r)} 张`),!1;if(i+s>Mn)return e.error(`该引擎最多上传${Mn}个视频,当前还能添加 ${Math.max(0,Mn-i)} 个`),!1;if(a+l>Nn)return e.error(`该引擎最多上传${Nn}个音频,当前还能添加 ${Math.max(0,Nn-a)} 个`),!1;for(let t of n){if(t.type!==`video`)continue;let n=Number(t.duration);if(!Number.isFinite(n)||n<=0)return e.error(`${t.name||`视频素材`}缺少视频秒数,不能用于 AI 创作`),!1;if(n<2)return e.error(`${t.name||`视频素材`}最短不能少于 2 秒`),!1;if(n>15)return e.error(`${t.name||`视频素材`}最长不能超过 15 秒`),!1}let u=un(t,`video`)+un(n,`video`);if(u>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${u.toFixed(1)} 秒`),!1;let d=un(t,`audio`)+un(n,`audio`);return d>15?(e.error(`所有音频素材总时长不能超过 15 秒,当前 ${d.toFixed(1)} 秒`),!1):!0},fn=t=>{let n=t.mediaReference,r=n?.type||t.resourceType,i=n?.url||t.resourceUrl||t.displayUrl||t.previewUrl||``;if(!i)return e.error(`${t.fileName||t.id} 缺少素材地址,不能用于 AI 创作`),null;if(r===`audio`&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),null;let a=Number(n?.duration??t.durationSeconds);return{name:n?.name||t.fileName||t.id,type:r,url:i,source:`upload_resource`,upload_resource_id:t.id,label:``,...(r===`video`||r===`audio`)&&Number.isFinite(a)&&a>0?{duration:a}:{}}},pn=t=>{let n=t.map(fn).filter(Boolean);if(!n.length)return;let r=h7.getState().currentMedia;if(!dn(r,n))return;let i=[...r,...n],a=Oe(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个历史上传素材参考`)},mn=t=>{if(t.assetType===`Audio`)return e.error(`音频私域素材暂不支持用于 AI 创作`),null;let n=t.assetType===`Video`?`video`:`image`,r=he===`aigc_virtual`?`虚拟素材`:`真人素材`,i=n===`video`?t.videoCoverUrl||t.previewUrl||t.displayUrl||t.providerUrl||``:t.previewUrl||t.displayUrl||t.videoCoverUrl||t.providerUrl||``;return{name:t.name||r,type:n,url:i,source:`private_portrait_asset`,private_asset_id:t.id,label:``,...n===`video`&&{duration:Number(t.videoDuration)||void 0}}},hn=e=>{ge(e),me(!0)},gn=t=>{let n=t.map(mn).filter(Boolean),r=h7.getState().currentMedia;if(!dn(r,n))return;let i=[...r,...n],a=Oe(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个${he===`aigc_virtual`?`虚拟`:`真人`}素材参考`)},_n=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,vn=e=>{let t=F.filter((t,n)=>n!==e),n=Oe(t);I(t.map((e,t)=>({...e,label:n[t]})))},yn=(e,t)=>{let n=e.selectionStart;return t.slice(0,n).match(/@([^@\s]*)$/)&&F.length>0?(Ce(!0),!0):(Ce(!1),!1)},bn=e=>{let t=e.target.value;P(t);let n=e.target;yn(n,t)},xn=e=>{Se&&e.key===`Escape`&&Ce(!1)},Sn=e=>{let t=we.current?.resizableTextArea?.textArea;if(!t)return;let n=t.selectionStart,r=b.slice(0,n),i=b.slice(n),a=r.lastIndexOf(`@`);if(a===-1){Ce(!1);return}P(r.slice(0,a)+`@${e} `+i),Ce(!1),setTimeout(()=>{let n=a+e.length+2;t.focus(),t.setSelectionRange(n,n)},0)},Cn=()=>{Ae(!1),Me(``),Fe.current&&Fe.current.pause()},wn=e=>{if(e.preventDefault(),e.stopPropagation(),!je)return;let t=je.replace(`/static`,``).replace(/&w=\d+/i,``).replace(/&q=\d+/i,``);t.includes(`download=1`)||(t+=`&download=1`);let n=document.createElement(`a`);n.href=t,console.log(t),n.download=Ne===`image`?`image.png`:`video.mp4`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},Tn=e=>{let t=String(e?.type||``).toLowerCase(),n=String(e?.url||e?.name||``).toLowerCase();return t.includes(`video`)||/\.(mp4|mov|avi|webm|m4v)(\?|$)/.test(n)?`video`:t.includes(`audio`)||/\.(mp3|wav|ogg|aac|m4a)(\?|$)/.test(n)?`audio`:`image`},En=e=>e?/^https?:\/\//i.test(e)?e:`https://ceshi.apiforeign.minzhongzc.com${e}`:``,Dn=e=>{e?.url&&(Ue(e.url),Ke(Tn(e)),Je(e.name||`附件`),Ve(!0))},On=c===`video`&&ie===`first_last_frame`,kn=!K&&(On?!!(b.trim()||ae):!!(b.trim()||F.length>0)),An=c===`image`?`输入画面描述,或上传图片参考风格、构图、主体与光影。例:@图片1 参考色调,生成一张简洁高级的产品海报。`:On?`首帧尾帧可以不传,如需传入建议描述首帧到尾帧的主体动作、镜头运动、节奏与转场。例:从首帧自然推进到尾帧,产品居中突出,动作平滑连贯。`:`上传最多12个参考素材,输入文字或 @ 引用参考内容,自由组合图、文、视频。例:@图片1 模仿 @视频1 的动作。`,jn=z,Mn=B,Nn=R?.maxAudioCount??1;return(0,$.jsxs)(NW,{className:`ai-create-page`,style:{margin:`-24px -32px -32px`,borderRadius:22,height:`calc(100vh - 34px)`,background:`rgba(255, 255, 255, 0.52)`,overflow:`hidden`},children:[(0,$.jsx)(`audio`,{id:`audio-player`,src:Xe||null,autoPlay:!0,onEnded:()=>Ze(null),style:{display:`none`}}),(0,$.jsxs)(NW,{style:{display:`flex`,flex:1,background:`rgba(255, 255, 255, 0.52)`},children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(22px)`,border:`1px solid rgba(231, 234, 240, 0.82)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(117,106,136,0.18), rgba(232,227,236,0.48), transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,textAlign:`center`},children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`AI创作`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#667085`,margin:`4px 0 0 0`},children:`输入想法、剧本或上传参考,智能生成视频/图片`})]}),(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(232,227,236,0.48), rgba(117,106,136,0.18), transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(Ase,{style:{flex:1,margin:0,padding:`20px 24px 22px`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[Mt.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, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(s8,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#2f3440`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#98a2b3`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),Mt.length>0&&(0,$.jsxs)(`div`,{ref:Ot,className:`ai-create-scroll`,style:{flex:1,overflowY:`auto`,paddingRight:10,paddingBottom:18},onScroll:e=>{let t=e.currentTarget;!(Date.now()-jt.current<500)&&At.current&&t.scrollTop<=50&&!Rt&&Mt.length{let t=e;return Mt.map(e=>(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, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s8,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgb(255, 255, 255)`,backdropFilter:`blur(18px)`,borderRadius:`22px`,padding:`14px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 18px 50px rgba(47, 52, 64, 0.075)`,position:`relative`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#98a2b3`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:e.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:(e.genType,`rgba(139, 92, 246, 0.10)`),color:(e.genType,`#8b5cf6`),padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:e.genType===`image`?`图片生成`:`视频生成`})]}),e.mediaReferences&&e.mediaReferences.length>0&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#8b5cf6`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(139, 92, 246, 0.2)`,background:`rgba(139, 92, 246, 0.04)`},onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();at({x:n.left,y:n.top-10}),rt(e.id),tt(!0)},children:`附件详情`})}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:8,right:8,zIndex:100,display:`flex`,gap:6},children:[(0,$.jsxs)(`button`,{onClick:n=>{n.stopPropagation(),P(e.originalPrompt||``);let r=!0,i=e.engineId||e.engineSnapshot?.id||e.engine_id;if(i&&e.genType){let n=Array.isArray(y)?{}:y,a=(e.genType===`image`?n.image:n.video)?.find(e=>e.id===i);if(a){if(C(a.id),e.genType===`video`&&M({ratios:a.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:a.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.supportedDurations||[5,8,10,12,15]}),e.genType===`image`){let e=a.supportedSizes||{},t=Object.keys(e).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=t[0]||`2K`,r=Object.keys(e[n]||{});if(dt(r.map(e=>({value:e,label:e}))),ht(e),pt(t.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),e[n]&&e[n][r[0]]){let[t,i]=e[n][r[0]].split(/[×x]/);D(Number(t)),O(Number(i)),T(r[0]),E(n)}}}else t.error(`该引擎已删除,无法重新编辑`),r=!1}if(r){if(e.genType&&(Te.current=!0,x(e.genType)),e.mediaReferences&&e.mediaReferences.length>0)if(e.mediaReferences.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&e.genType===`video`){let t=e.mediaReferences.find(e=>e.role===`first_frame`),n=e.mediaReferences.find(e=>e.role===`last_frame`);oe(t?{...t,label:t.label||``,duration:t.duration}:null),ce(n?{...n,label:n.label||``,duration:n.duration}:null),I([]),J(`first_last_frame`)}else if(I(e.mediaReferences.map(e=>({...e,name:e.name,type:e.type,url:e.url,label:e.label||``,role:e.role,duration:e.duration}))),oe(null),ce(null),e.genType===`video`){let e=L.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;J(t?`universal`:n?`first_last_frame`:`universal`)}else J(`universal`)}else J(`universal`);else if(I([]),oe(null),ce(null),e.genType===`video`){let e=y?.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;J(t?`universal`:n?`first_last_frame`:`universal`)}}t.success(`已加载到编辑区`)}},style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`},children:[(0,$.jsx)(fq,{style:{fontSize:12}}),`重新编辑`]}),(0,$.jsx)(oK,{title:`确定要删除吗?`,onConfirm:async()=>{try{await oae(e.id),t.success(`删除成功`),Nt(t=>t.filter(t=>t.id!==e.id)),Lt(e=>e-1)}catch(e){let n=e?.response?.data?.message||e?.message||`删除失败`;t.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsxs)(`button`,{onClick:e=>e.stopPropagation(),style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(164, 91, 91, 0.1)`,e.currentTarget.style.color=`#A45B5B`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`,e.currentTarget.style.color=`#8b5cf6`},children:[(0,$.jsx)(s$,{style:{fontSize:12}}),`删除`]})})]}),(e.status===`generating`||e.status===`failed`||e.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 #E7EAF0`,boxShadow:`0 4px 12px rgba(139, 92, 246, 0.08)`,background:`linear-gradient(135deg, #ffffff 0%, #FAFBFC 100%)`},children:(0,$.jsx)(ose,{task:e,resolveUrl:Pse,onPreview:(e,t)=>{Me(e),Pe(t),Ae(!0)}})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`#FFFFFF`,borderRadius:12,padding:12,border:`1px solid #E7EAF0`,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:`#475467`,fontSize:13},children:e.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#667085`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#8b5cf6`,fontWeight:500},children:e.engineSnapshot?.name||`未知引擎`}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#667085`},children:e.genType===`image`?`${e.imageProportion||``} · ${e.imagePx||``} · ${e.imageSize||``}`:`${e.duration||``}秒 · ${e.aspectRatio||``} · ${e.resolution||``}`}),(0,$.jsxs)(`span`,{style:{fontSize:14,borderRadius:16,color:`#8b5cf6`},children:[`消耗积分:`,e.creditsCost]})]})]})]})]})})]})},e.id))})(),(0,$.jsx)(`div`,{ref:Dt})]}),et&&nt&&(()=>{let e=Mt.find(e=>e.id===nt)?.mediaReferences||[];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{tt(!1),rt(null)}}),(0,$.jsxs)(`div`,{className:`ai-reference-expanded-tray ai-attachment-popover`,style:{position:`fixed`,top:`max(84px, ${it.y-96}px)`,left:`max(24px, min(${it.x-250}px, calc(100vw - 456px)))`,width:424,padding:`12px 12px 10px`,borderRadius:18,background:`rgba(255,255,255,0.98)`,border:`1px solid #E7EAF0`,boxShadow:`0 24px 60px rgba(31, 41, 55, 0.12)`,backdropFilter:`blur(18px)`,zIndex:9999,pointerEvents:`auto`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#344054`,fontWeight:800},children:`参考附件`}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#98A2B3`,fontWeight:600},children:`点击素材查看,或直接下载原文件`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,$.jsx)(`button`,{onClick:()=>{tt(!1),rt(null)},style:{width:26,height:26,borderRadius:`50%`,border:`1px solid transparent`,background:`#F6F7FA`,cursor:`pointer`,color:`#98a2b3`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`,e.currentTarget.style.color=`#2f3440`},onMouseLeave:e=>{e.currentTarget.style.background=`#F6F7FA`,e.currentTarget.style.color=`#98a2b3`},children:(0,$.jsx)(Au,{style:{fontSize:12}})})})]}),(0,$.jsx)(`div`,{className:`ai-reference-tray-scroll`,style:{display:`flex`,gap:10,overflowX:`auto`,padding:`2px 2px 4px`},children:e.map((e,t)=>{let n=Tn(e),r=e.label||(e.role===`first_frame`?`首帧`:e.role===`last_frame`?`尾帧`:`${n===`image`?`图片`:n===`video`?`视频`:`音频`}${t+1}`);return(0,$.jsxs)(`div`,{style:{flex:`0 0 92px`,width:92,borderRadius:16,background:`#FFFFFF`,border:`1px solid #E7EAF0`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.06)`,padding:7,boxSizing:`border-box`},children:[(0,$.jsx)(`div`,{onClick:t=>{n===`audio`?(t.stopPropagation(),tn(e.url)):(Dn(e),tt(!1),rt(null))},style:{position:`relative`,width:`100%`,height:70,borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#F7F8FA`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:n===`image`?(0,$.jsx)(`img`,{src:En(e.url),alt:e.name||r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):n===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:En(e.url),muted:!0,playsInline:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(31, 41, 55, 0.08)`},children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(47, 52, 64, 0.72)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.22)`},children:(0,$.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`},children:Xe===(e.url.startsWith(`http`)?e.url:`https://ceshi.apiforeign.minzhongzc.com${e.url}`)?(0,$.jsx)(O6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(O2,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{title:e.name||r,style:{marginTop:6,color:`#667085`,fontSize:10,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,textAlign:`center`},children:e.name||r}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:5,marginTop:7},children:(0,$.jsx)(`button`,{onClick:()=>{Dn(e),tt(!1),rt(null)},style:{flex:1,height:24,borderRadius:9,border:`1px solid #E7EAF0`,background:`#F8FAFC`,color:`#8b5cf6`,fontSize:11,fontWeight:700,cursor:`pointer`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`},onMouseLeave:e=>{e.currentTarget.style.background=`#F8FAFC`},children:`查看`})})]},`${e.url||e.name||t}-${t}`)})})]})]})})(),(0,$.jsxs)(`div`,{style:{position:`relative`,background:`rgba(255, 255, 255, 0.52)`,borderRadius:24,padding:`18px 72px 16px 20px`,boxShadow:`0 22px 64px rgba(31, 41, 55, 0.08), 0 1px 0 rgba(255,255,255,0.98) inset`,transition:`all 0.25s ease`,border:`1px solid rgba(231, 234, 240, 0.78)`,backdropFilter:`blur(24px)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:18,alignItems:`flex-end`,marginBottom:14},children:[(0,$.jsx)(`div`,{style:{width:On?220:70,minWidth:On?220:70,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,paddingTop:2,gap:8},children:c===`video`&&ie===`first_last_frame`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,alignItems:`stretch`,gap:12,width:`100%`,height:100},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`首帧(可选)`})}),ae?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:_n(ae.url),alt:ae.name,onClick:()=>{Ue(ae.url),Ke(`image`),Je(ae.name),Ve(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Yt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(s$,{style:{fontSize:9}})})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,onLocalSelect:e=>{e.length>0&&sn(e[0],`first`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];oe({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`first_frame`,label:``}),e.success(`成功添加首帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;oe({name:n.name||`首帧图片`,type:`image`,url:r,role:`first_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加首帧`)}},uploading:K,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.28)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.28)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传首帧`})]})})]}),(0,$.jsx)(`button`,{onClick:Jt,disabled:!ae||!se,title:`调换首尾帧`,style:{width:32,height:32,alignSelf:`center`,borderRadius:50,border:`1px solid rgba(231, 234, 240, 0.95)`,background:ae&&se?`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`:`#F3F5F8`,cursor:ae&&se?`pointer`:`not-allowed`,color:ae&&se?`#fff`:`#98A2B3`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:ae&&se?`0 6px 14px rgba(139, 92, 246, 0.24)`:`none`,transition:`all 0.2s ease`,flexShrink:0},onMouseEnter:e=>{ae&&se&&(e.currentTarget.style.transform=`scale(1.06)`)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(OU,{style:{fontSize:14}})}),(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`,opacity:ae?1:.5},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`尾帧`})}),se?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:_n(se.url),alt:se.name,onClick:()=>{Ue(se.url),Ke(`image`),Je(se.name),Ve(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Xt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(s$,{style:{fontSize:9}})})]}):ae?(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,onLocalSelect:e=>{e.length>0&&sn(e[0],`last`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];ce({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`last_frame`,label:``}),e.success(`成功添加尾帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;ce({name:n.name||`尾帧图片`,type:`image`,url:r,role:`last_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加尾帧`)}},uploading:K,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.24)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.24)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传尾帧`})]})}):(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(226, 232, 240, 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`not-allowed`,backgroundColor:`rgba(241, 245, 249, 0.5)`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#cbd5e1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:500},children:`请先上传首帧`})]})]})]}):(0,$.jsx)($.Fragment,{children:!(c===`video`&&ie===`first_last_frame`)&&(0,$.jsxs)(`div`,{style:{position:`relative`,width:64,height:72,marginTop:`-10`},onMouseEnter:be,onMouseLeave:xe,children:[F.length===0&&(0,$.jsx)(A7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:ln,onHistorySelect:pn,onPortraitLibrarySelect:e=>{hn(e)},uploading:K,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, + `,document.head.appendChild(t)},[]),(0,S.useEffect)(()=>{a.slice(0,5).forEach((e,t)=>{let n=F7(e),r=n.isActive,i=n.isSuccess,a=e.id||`${t}`;i&&!c.current.has(a)&&r===!1&&(c.current.add(a),s(e=>{let t=new Set(e);return t.add(a),t}))})},[a]);let l=e=>{s(t=>{let n=new Set(t);return n.delete(e),n})};return(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`repeat(6, minmax(0, 1fr))`,gridAutoRows:`minmax(0, 1fr)`,gap:r>1?6:0},children:a.slice(0,5).map((r,i)=>{let s=F7(r),c=s.effectiveKey,u=r.imageUrl?n(`/static${r.imageUrl}&w=300&q=50`):``,d=n(r.videoUrl),f=r.videoCoverUrl?n(`/static${r.videoCoverUrl}&w=300&q=50`):``,p=(r.genType||e.genType)===`video`,m=p?!!d:!!u,h=s.isActive,g=s.isSuccess,_=r.id||`${i}`,v=o.has(_),y=g&&!v,b=v?`加载中`:tse(r);return(0,$.jsxs)(`div`,{style:{gridColumn:`span ${ese(a.length,i)}`,minWidth:0,minHeight:0,position:`relative`,overflow:`hidden`,borderRadius:a.length===1?12:8,background:`#ffffff`,border:`1px solid #E7EAF0`},children:[m&&s.isSuccess&&y?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>t(p?d:u,p?`video`:`image`),style:{width:`100%`,height:`100%`,border:0,padding:0,background:`transparent`,cursor:`pointer`,position:`relative`},children:[p?f?(0,$.jsx)(`img`,{src:f,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:d,muted:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:u,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),p?(0,$.jsx)(U6,{style:{position:`absolute`,left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,fontSize:a.length>2?28:46,color:`rgba(255,255,255,.92)`,filter:`drop-shadow(0 4px 10px rgba(0,0,0,.28))`}}):null]}):(0,$.jsxs)(`div`,{className:h||v?`gen-task-loading-bg`:``,style:{width:`100%`,height:`100%`,minHeight:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:7,padding:8,textAlign:`center`},children:[h||v?(0,$.jsx)(`span`,{className:`gen-task-aurora-3`}):null,h||v?(0,$.jsx)(Ym,{spin:!0,style:{color:`#8b5cf6`,fontSize:a.length>2?20:34}}):(0,$.jsx)(gie,{style:{color:c===`deleted`?`#98A2B3`:`#A45B5B`,fontSize:a.length>2?20:34}}),(0,$.jsx)(`span`,{style:{fontSize:a.length>2?10:12,color:h||v?`#8b5cf6`:c===`deleted`?`#98A2B3`:`#A45B5B`,fontWeight:500},children:b}),(0,$.jsx)(ase,{item:r,isPending:h||v,isCompleted:g,onAnimationComplete:()=>l(_),index:r.generationIndex||i}),!h&&r.errorMessage&&a.length<=2?(0,$.jsx)(`span`,{style:{fontSize:10,color:`#A45B5B`,lineHeight:1.3,maxHeight:28,overflow:`hidden`},children:r.errorMessage}):null]}),a.length>1?(0,$.jsxs)(`span`,{style:{position:`absolute`,top:5,left:5,zIndex:2,padding:`1px 6px`,borderRadius:10,background:`rgba(17,24,39,.58)`,color:`#fff`,fontSize:10},children:[`#`,r.generationIndex||i+1]}):null]},r.id||`${i}`)})})},{Text:V7}=w1,sse=({items:e,selectedId:t,onSelect:n})=>e.length?(0,$.jsx)(YV,{orientation:`vertical`,style:{width:`100%`},size:10,children:e.map(e=>{let r=t===e.id;return(0,$.jsxs)(`div`,{onClick:()=>n(e),style:{padding:14,borderRadius:14,cursor:`pointer`,border:r?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:r?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(YV,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(V7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(V7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(qQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(qQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(qQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})}):(0,$.jsx)(fC,{description:`暂无项目组`}),cse={Active:`green`,Processing:`processing`,Failed:`red`,local_deleted:`default`,remote_deleted:`default`,delete_failed:`red`},lse={Active:`入库成功`,Processing:`入库处理中`,Failed:`入库失败`,local_deleted:`本地已删除`,remote_deleted:`远程已删除`,delete_failed:`删除失败`},H7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,U7=e=>e.assetType===`Video`?H7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):H7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),use=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},dse=({items:e,onDelete:t,onRefresh:n})=>{let r=(0,S.useRef)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`Image`);(0,S.useEffect)(()=>(e.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&n?r.current||=window.setInterval(()=>{n()},3e3):r.current&&=(clearInterval(r.current),null),()=>{r.current&&=(clearInterval(r.current),null)}),[e,n]);let u=e=>{let t=U7(e);t&&(s(t),l(e.assetType===`Video`?`Video`:`Image`),a(!0))};return e.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:e.map(e=>{let n=e.assetType===`Video`,r=U7(e);return(0,$.jsx)(bL,{hoverable:!0,bodyStyle:{padding:12},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[r?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:r,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:r,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:r,alt:e.name||``,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(X8,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(L6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(qQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),r&&(0,$.jsx)(Z,{size:`small`,shape:`circle`,icon:(0,$.jsx)(nW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>u(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:use(e.videoDuration)})]}),children:(0,$.jsxs)(YV,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(jw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(YV,{wrap:!0,size:4,children:[(0,$.jsx)(qQ,{color:cse[e.status]||`default`,children:lse[e.status]||e.status}),(0,$.jsx)(qQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(YV,{size:6,wrap:!0,children:(0,$.jsx)(oK,{title:`确认删除这个素材吗?`,onConfirm:()=>t(e.id),children:(0,$.jsx)(Z,{size:`small`,danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(nK,{title:`素材预览`,open:i,onCancel:()=>a(!1),footer:null,width:760,destroyOnClose:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:c===`Video`?(0,$.jsx)(`video`,{src:o,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:o,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]}):(0,$.jsx)(fC,{description:`暂无素材`})},W7=(0,S.createContext)(void 0),fse=({children:e,refreshConfig:t})=>(0,$.jsx)(W7.Provider,{value:{refreshConfig:t},children:e}),G7=()=>{let e=(0,S.useContext)(W7);if(!e)throw Error(`useLibrary must be used within a LibraryProvider`);return e},K7=2,q7=15,pse=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),mse=e=>e==null||!Number.isFinite(e)||e<=0?(Q.error(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eq7?(Q.error(`视频素材最长不能超过 ${q7} 秒`),!1):!0,hse=({projectId:e,open:t,onClose:n,onSuccess:r})=>{let{refreshConfig:i}=G7(),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)({}),[l,u]=(0,S.useState)({}),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)({}),[h,g]=(0,S.useState)(!1),_=()=>{o([]),c({}),u({}),f({}),m({})};return(0,$.jsx)(nK,{title:`上传真人素材`,open:t,onCancel:()=>{_(),n()},onOk:async()=>{let t=a.filter(e=>l[e.uid]===`uploaded`);if(t.length===0){Q.warning(`请等待文件上传完成后再提交入库`);return}g(!0);try{for(let n of t){let t=n.originFileObj;if(!t)continue;let r=d[n.uid];if(!r)continue;m(e=>({...e,[n.uid]:`importing`}));let i=t.type.startsWith(`image/`)?`Image`:`Video`;await eoe(e,{url:r.url,assetType:i,name:s[n.uid]?.trim()||t.name,videoDuration:r.duration_seconds,fileSize:r.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:r.resource_id||null}),m(e=>({...e,[n.uid]:`imported`}))}Q.success(`已成功提交 ${t.length} 个素材入库,处理中`),i(),setTimeout(()=>{_(),r(),n()},1500)}catch(e){Q.error(e?.message||`提交入库失败`)}finally{g(!1)}},confirmLoading:h,okText:`提交入库`,destroyOnHidden:!0,width:650,okButtonProps:{disabled:a.length===0||a.some(e=>l[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(v0,{accept:`image/*,video/*`,fileList:a,multiple:!0,beforeUpload:async e=>{let t=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=e.type.startsWith(`image/`),r=URL.createObjectURL(e),i={uid:t,name:e.name,status:`uploading`,originFileObj:e,thumbUrl:r,type:e.type};o(e=>[...e,i]),c(e=>({...e,[t]:``})),u(e=>({...e,[t]:`uploading`}));try{let r=n?`Image`:`Video`,i=r===`Video`?await pse(e):null;if(r===`Video`&&!mse(i))return u(e=>({...e,[t]:`error`})),!1;let a=r===`Video`?await Vie(e,i||void 0):await Bie(e);f(e=>({...e,[t]:{url:a.url,duration_seconds:a.duration_seconds,file_size_bytes:a.file_size_bytes,resource_id:a.resource_id}})),u(e=>({...e,[t]:`uploaded`}))}catch{u(e=>({...e,[t]:`error`})),Q.error(`文件 ${e.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=l[t.uid],a=p[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(X8,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(L6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(wW,{style:{width:200,flexShrink:0},value:s[t.uid]||``,onChange:e=>c({...s,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),o(e=>e.filter(e=>e.uid!==t.uid)),c(e=>{let n={...e};return delete n[t.uid],n}),u(e=>{let n={...e};return delete n[t.uid],n}),f(e=>{let n={...e};return delete n[t.uid],n}),m(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(Z,{icon:(0,$.jsx)(G8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,音频暂不接入。视频素材必须在 `,K7,`~`,q7,` 秒内;入库后会经过火山真人一致性校验,入库校验成功 后才可用于 AI 创作。`]})]})})})},gse=({project:e,onDeleted:t,onChanged:n})=>{let{refreshConfig:r}=G7(),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(),[m,h]=(0,S.useState)(),[g,_]=(0,S.useState)(1),[v,y]=(0,S.useState)(20),[b,x]=(0,S.useState)(0),C=async(t=g,n=v)=>{s(!0);try{let r=await toe(e.id,{page:t,pageSize:n,keyword:u,status:f,assetType:m});a(r.items),x(r.total||0),_(t),y(n)}catch(e){Q.error(e?.message||`加载素材失败`)}finally{s(!1)}};(0,S.useEffect)(()=>{C(1,v)},[e.id,u,f,m]);let w=async e=>{try{await noe(e),await C(g,v),n(),r(),Q.success(`素材已删除`)}catch(e){Q.error(e?.message||`删除素材失败`)}},T=async()=>{try{await Qae(e.id),Q.success(`项目组已删除`),t()}catch(e){Q.error(e?.message||`删除项目组失败`)}},E=e.status===`active`;return(0,$.jsxs)(bL,{title:(0,$.jsx)(YV,{children:(0,$.jsx)(`span`,{children:e.name})}),extra:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(G8,{}),disabled:!E,onClick:()=>l(!0),children:`上传素材`}),(0,$.jsx)(oK,{title:`确认删除这个真人素材项目组吗?`,onConfirm:T,children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除项目组`})})]}),style:{borderRadius:16},children:[!E&&(0,$.jsx)(w1.Paragraph,{style:{color:`#f97316`},children:`项目组未完成真人认证,暂不能上传素材。请重新创建项目组并完成手机扫码认证。`}),(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(wW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:u,onChange:e=>d(e.target.value),onSearch:()=>C(1,v),style:{width:240}}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材状态`,value:f,onChange:e=>p(e),style:{width:150},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材类型`,value:m,onChange:e=>h(e),style:{width:130},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{onClick:()=>C(1,v),children:`筛选`})]}),(0,$.jsx)(jG,{spinning:o,children:i.length===0?(0,$.jsx)(fC,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dse,{items:i,loading:o,onDelete:w,onRefresh:()=>C(g,v)}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(uG,{current:g,pageSize:v,total:b,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>C(e,t)})})]})}),(0,$.jsx)(hse,{projectId:e.id,open:c,onClose:()=>l(!1),onSuccess:()=>{C(1,v),n()}})]})},J7=`group_active`,Y7=2e3,_se=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),[g]=UH.useForm(),_=(0,S.useRef)(null),v=()=>{_.current&&=(window.clearInterval(_.current),null)},y=()=>{v(),s(!1),l(!1),h(!1),d(null),p(null),g.resetFields()},b=async()=>{a(!0);try{let e=await o7({pageSize:100,status:`active`});t(e.items),r(t=>t?e.items.find(e=>e.id===t.id)||e.items[0]||null:e.items[0]||null)}catch(e){Q.error(e?.message||`加载真人素材项目组失败`)}finally{a(!1)}};(0,S.useEffect)(()=>{b()},[]),(0,S.useEffect)(()=>()=>v(),[]);let x=async e=>{v(),h(!1),Q.success(`真人认证完成,项目组已创建成功`),s(!1),p(null),d(null),g.resetFields();let n=await o7({pageSize:100,status:`active`});t(n.items),r(n.items.find(t=>t.id===e)||n.items[0]||null)},C=(e,t,n)=>{v(),h(!0);let r=async()=>{try{let n=await $ae(e);if(p(n),n.status===J7){await x(t);return}[`callback_failed`,`failed`,`expired`].includes(n.status)&&(v(),h(!1),Q.error(n.errorMessage||`真人认证未完成,请重新创建项目组`))}catch(e){v(),h(!1),Q.error(e?.message||`轮询真人认证状态失败`)}};_.current=window.setInterval(r,Math.max(1e3,n||Y7)),r()},w=async()=>{let e=await g.validateFields();l(!0);try{let t=`${window.location.origin}/private-portrait-authorized`,n=await Zae({...e,callbackRedirectUrl:t});d(n.project),p(n.validateSession),Q.success(`请使用手机扫码完成人脸认证`),n.validateSession?.id&&C(n.validateSession.id,n.project.id,n.pollIntervalMs||Y7)}catch(e){Q.error(e?.message||`创建项目组认证二维码失败`)}finally{l(!1)}},T=f?.h5Link||``,E=f?.status===J7;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:`真人素材库`}),(0,$.jsx)(w1.Text,{type:`secondary`,children:`创建项目组时先完成真人认证,认证成功后项目组才会正式创建并可上传素材。`})]}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>s(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Lq,{gutter:16,children:[(0,$.jsx)(IR,{xs:24,lg:5,children:(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520},children:(0,$.jsx)(jG,{spinning:i,children:e.length===0?(0,$.jsx)(fC,{description:`暂无真人项目组`}):(0,$.jsx)(sse,{items:e,selectedId:n?.id,onSelect:r})})})}),(0,$.jsx)(IR,{xs:24,lg:19,children:n?(0,$.jsx)(gse,{project:n,onDeleted:()=>{r(null),b()},onChanged:b}):(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520,textAlign:`center`,color:`#94a3b8`},children:`请先创建或选择一个真人素材项目组`})})]}),(0,$.jsx)(nK,{title:`新建真人素材项目组`,open:o,onCancel:y,footer:f?[(0,$.jsx)(Z,{onClick:y,children:`关闭`},`close`)]:void 0,onOk:f?void 0:w,okText:`开始认证并创建`,confirmLoading:c,mask:{closable:!m},children:f?(0,$.jsxs)(YV,{direction:`vertical`,align:`center`,size:16,style:{width:`100%`},children:[E?(0,$.jsx)(u4,{style:{fontSize:54,color:`#22c55e`}}):T?(0,$.jsx)(_q,{value:T,size:220}):(0,$.jsx)(jG,{}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(w1.Title,{level:5,style:{marginBottom:8},children:u?.name||`真人素材项目组`}),(0,$.jsx)(w1.Text,{type:E?`success`:`secondary`,children:E?`认证成功,项目组正在刷新`:`请使用手机扫码完成人脸认证,成功后回到电脑端查看项目组。`})]})]}):(0,$.jsxs)(UH,{form:g,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{label:`项目组名称`,name:`name`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:达人A、客户B、张三人像`})}),(0,$.jsx)(UH.Item,{label:`描述`,name:`description`,children:(0,$.jsx)(wW.TextArea,{rows:3,placeholder:`可选`})}),(0,$.jsx)(w1.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`点击后会生成真人认证二维码。手机扫码认证成功后,项目组才会出现在项目列表中。`})]})})]})},{Text:X7}=w1,Z7=2,Q7=15,vse={creating:{label:`本地创建中`,color:`processing`},Processing:{label:`入库处理中`,color:`processing`},Active:{label:`入库成功`,color:`success`},Failed:{label:`入库失败`,color:`error`},local_deleted:{label:`本地已删`,color:`default`},remote_deleted:{label:`远端已删`,color:`default`},delete_failed:{label:`远端删除失败`,color:`error`}},yse=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},$7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,e9=e=>e.assetType===`Video`?$7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):$7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),bse=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),xse=(e,t)=>e==null||!Number.isFinite(e)||e<=0?(t(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eQ7?(t(`视频素材最长不能超过 ${Q7} 秒`),!1):!0,Sse=({status:e})=>{let t=e||`-`,n=vse[t];return(0,$.jsx)(qQ,{color:n?.color||`default`,children:n?.label||t})},Cse=()=>{let{message:e}=rx.useApp(),{refreshConfig:t}=G7(),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(1),[m,h]=(0,S.useState)(20),[g,_]=(0,S.useState)(0),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(),[C,w]=(0,S.useState)(),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)([]),[F,I]=(0,S.useState)({}),[L,R]=(0,S.useState)({}),[z,B]=(0,S.useState)({}),[V,H]=(0,S.useState)({}),[U,W]=(0,S.useState)(!1),[G,K]=(0,S.useState)(``),[ee,q]=(0,S.useState)(`Image`),[te]=UH.useForm(),ne=(0,S.useRef)(null),re=(0,S.useMemo)(()=>n.find(e=>e.id===i)||null,[n,i]),ie=async()=>{l(!0);try{let e=(await c7({page:1,pageSize:100,status:`active`})).items||[];r(e),a(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(t){e.error(t?.message||`加载虚拟人像项目组失败`)}finally{l(!1)}},J=async(t=f,n=m)=>{if(!i){s([]),_(0);return}d(!0);try{let e=await soe(i,{page:t,pageSize:n,keyword:v.trim()||void 0,status:b,assetType:C});s(e.items||[]),_(e.total||0),p(t),h(n)}catch(t){e.error(t?.message||`加载虚拟人像素材失败`)}finally{d(!1)}},ae=async()=>{await ie()};(0,S.useEffect)(()=>{ae()},[]),(0,S.useEffect)(()=>{i&&J(1,m)},[i]),(0,S.useEffect)(()=>(o.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&i?ne.current||=window.setInterval(()=>{J(f,m)},3e3):ne.current&&=(clearInterval(ne.current),null),()=>{ne.current&&=(clearInterval(ne.current),null)}),[o,i,f,m]);let oe=async()=>{let t=await te.validateFields();O(!0);try{let n=await ioe(t);e.success(`虚拟人像项目组已创建`),E(!1),te.resetFields(),await ie(),a(n.id)}catch(t){e.error(t?.message||`创建项目组失败`)}finally{O(!1)}},se=async()=>{if(!i){e.warning(`请先创建或选择项目组`);return}if(N.length===0){e.warning(`请先选择图片或视频素材`);return}let n=N.filter(e=>L[e.uid]===`uploaded`);if(n.length===0){e.warning(`请等待文件上传完成后再提交入库`);return}M(!0);try{for(let e of n){let t=e.originFileObj;if(!t)continue;let n=z[e.uid];if(!n)continue;H(t=>({...t,[e.uid]:`importing`}));let r=t.type.startsWith(`image/`)?`Image`:`Video`;await ooe(i,{url:n.url,assetType:r,name:F[e.uid]?.trim()||t.name,videoDuration:n.duration_seconds,fileSize:n.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:n.resource_id||null}),H(t=>({...t,[e.uid]:`imported`}))}e.success(`已成功提交 ${n.length} 个素材入库,处理中`),setTimeout(()=>{A(!1),P([]),I({}),R({}),B({}),H({})},1500),await Promise.all([ie(),J(1,m),t()])}catch(t){e.error(t?.message||`提交入库失败`)}finally{M(!1)}},ce=async n=>{try{await coe(n),e.success(`素材已删除,远端删除将异步执行`),await Promise.all([ie(),J(f,m),t()])}catch(t){e.error(t?.message||`删除素材失败`)}},le=async()=>{if(i)try{await aoe(i),e.success(`项目组已删除,远端资产组将异步删除`),a(void 0),await ae()}catch(t){e.error(t?.message||`删除项目组失败`)}},ue=t=>{let n=e9(t);if(!n){e.warning(`暂无可预览地址`);return}K(n),q(t.assetType===`Video`?`Video`:`Image`),W(!0)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:`虚拟素材库`}),(0,$.jsx)(w1.Text,{type:`secondary`,children:`可提前上传虚拟人像素材,后续生成视频时可直接使用。`})]}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>E(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Lq,{gutter:[10,10],children:[(0,$.jsx)(IR,{xs:24,lg:5,children:(0,$.jsx)(bL,{style:{borderRadius:16,minHeight:520,margin:`0 auto`,maxWidth:1200},children:(0,$.jsx)(jG,{spinning:c,children:n.length===0?(0,$.jsx)(fC,{description:`暂无虚拟人像项目组`}):(0,$.jsx)(YV,{orientation:`vertical`,style:{width:`100%`},size:10,children:n.map(e=>{let t=i===e.id;return(0,$.jsxs)(`div`,{onClick:()=>a(e.id),style:{padding:14,borderRadius:14,cursor:`pointer`,border:t?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:t?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(YV,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(X7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(X7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(YV,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(qQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(qQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(qQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})})})})}),(0,$.jsx)(IR,{xs:24,lg:19,children:(0,$.jsxs)(bL,{title:re?re.name:`素材资产`,extra:(0,$.jsxs)(YV,{wrap:!0,children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(G8,{}),disabled:!i,onClick:()=>A(!0),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`上传图片/视频`}),i&&(0,$.jsx)(oK,{title:`确认删除当前虚拟人像项目组吗?`,onConfirm:le,children:(0,$.jsx)(Z,{danger:!0,icon:(0,$.jsx)(s$,{}),style:{borderRadius:8,fontWeight:600},children:`删除项目组`})})]}),style:{borderRadius:16,minHeight:520},children:[(0,$.jsxs)(YV,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(wW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onSearch:()=>J(1,m),style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材状态`,value:b,onChange:e=>x(e),style:{width:140,borderRadius:8},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(HC,{allowClear:!0,placeholder:`素材类型`,value:C,onChange:e=>w(e),style:{width:120,borderRadius:8},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(Z,{type:`primary`,onClick:()=>J(1,m),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`筛选`})]}),(0,$.jsx)(jG,{spinning:u,children:i?o.length===0?(0,$.jsx)(fC,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:o.map(e=>{let t=e9(e),n=e.assetType===`Video`;return(0,$.jsx)(bL,{hoverable:!0,styles:{body:{padding:12}},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[t?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:t,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:t,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t,alt:e.name||`虚拟人像素材`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(X8,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(L6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(qQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),t&&(0,$.jsx)(Z,{size:`small`,shape:`circle`,icon:(0,$.jsx)(nW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>ue(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:yse(e.videoDuration)})]}),children:(0,$.jsxs)(YV,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(jw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(YV,{wrap:!0,size:4,children:[(0,$.jsx)(Sse,{status:e.status}),(0,$.jsx)(qQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(YV,{size:6,wrap:!0,children:(0,$.jsx)(oK,{title:`确认删除这个虚拟人像素材吗?`,onConfirm:()=>ce(e.id),children:(0,$.jsx)(Z,{size:`small`,danger:!0,icon:(0,$.jsx)(s$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(uG,{current:f,pageSize:m,total:g,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>J(e,t)})})]}):(0,$.jsx)(fC,{description:`请先创建或选择项目组`,style:{marginTop:80}})})]})})]}),(0,$.jsx)(nK,{title:`创建虚拟人像项目组`,open:T,onCancel:()=>E(!1),onOk:oe,confirmLoading:D,okText:`创建项目组`,children:(0,$.jsxs)(UH,{form:te,layout:`vertical`,children:[(0,$.jsx)(UH.Item,{name:`name`,label:`项目组名称`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(wW,{placeholder:`例如:虚拟主播A / 品牌代言人B`,maxLength:128})}),(0,$.jsx)(UH.Item,{name:`description`,label:`描述`,children:(0,$.jsx)(wW.TextArea,{placeholder:`可填写人物设定、服装风格、素材要求等`,maxLength:2e3,rows:4})})]})}),(0,$.jsx)(nK,{title:`上传虚拟人像素材`,open:k,onCancel:()=>A(!1),onOk:se,confirmLoading:j,okText:`提交入库`,width:650,okButtonProps:{disabled:N.length===0||N.some(e=>L[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(v0,{accept:`image/*,video/*`,fileList:N,multiple:!0,beforeUpload:async t=>{let n=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,r=t.type.startsWith(`image/`),i=URL.createObjectURL(t),a={uid:n,name:t.name,status:`uploading`,originFileObj:t,thumbUrl:i,type:t.type};P(e=>[...e,a]),I(e=>({...e,[n]:``})),R(e=>({...e,[n]:`uploading`}));try{let i=r?`Image`:`Video`,a=i===`Video`?await bse(t):null;if(i===`Video`&&!xse(a,e.error))return R(e=>({...e,[n]:`error`})),!1;let o=i===`Video`?await Uie(t,a||void 0):await Hie(t);B(e=>({...e,[n]:{url:o.url,duration_seconds:o.duration_seconds,file_size_bytes:o.file_size_bytes,resource_id:o.resource_id}})),R(e=>({...e,[n]:`uploaded`}))}catch{R(e=>({...e,[n]:`error`})),e.error(`文件 ${t.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=L[t.uid],a=V[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(X8,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(L6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(wW,{style:{width:200,flexShrink:0},value:F[t.uid]||``,onChange:e=>I({...F,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),P(e=>e.filter(e=>e.uid!==t.uid)),I(e=>{let n={...e};return delete n[t.uid],n}),R(e=>{let n={...e};return delete n[t.uid],n}),B(e=>{let n={...e};return delete n[t.uid],n}),H(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(Z,{icon:(0,$.jsx)(G8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,视频素材必须在 `,Z7,`~`,Q7,` 秒内;提交后会调用火山 CreateAsset 异步处理,状态变为 入库校验成功 后才可用于 AI 创作。`]})]})})}),(0,$.jsx)(nK,{title:`素材预览`,open:U,onCancel:()=>W(!1),footer:null,width:760,destroyOnHidden:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:ee===`Video`?(0,$.jsx)(`video`,{src:G,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:G,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]})},{Title:wse,Text:Tse,Paragraph:Ese}=w1,t9=e=>e===`aigc_virtual`?`aigc_virtual`:`real_person`,Dse=()=>{let[e,t]=Dn(),[n,r]=(0,S.useState)(()=>t9(e.get(`portraitTab`))),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(),u=async()=>{try{a(n===`aigc_virtual`?await s7():await a7())}catch(e){Q.error(e?.message||`加载配置失败`)}};(0,S.useEffect)(()=>{(async()=>{try{if(n===`aigc_virtual`){let[e,t]=await Promise.all([s7(),c7({page:1,pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}else{let[e,t]=await Promise.all([a7(),o7({pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}}catch(e){Q.error(e?.message||`加载数据失败`)}})()},[n]),(0,S.useMemo)(()=>o.find(e=>e.id===c)||null,[o,c]);let d=(0,S.useMemo)(()=>i?`已用 ${i.usedAssetCount||0} / ${i.assetLimit||0} 个素材,剩余 ${i.remainingAssetCount||0}`:`额度加载中`,[i]),f=(0,S.useMemo)(()=>[{key:`real_person`,label:`真人素材库`,children:(0,$.jsx)(_se,{})},{key:`aigc_virtual`,label:`虚拟素材库`,children:(0,$.jsx)(Cse,{})}],[]);return(0,$.jsx)(fse,{refreshConfig:u,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(vL,{activeKey:n,onChange:n=>{let i=t9(n);r(i);let a=new URLSearchParams(e);a.set(`filterType`,`private_portrait`),a.set(`portraitTab`,i),t(a,{replace:!0})},items:f,destroyOnHidden:!1,tabBarExtraContent:(0,$.jsxs)(`div`,{style:{fontSize:14,fontWeight:700,color:`#4f46e5`,marginTop:8},children:[d,`。真人/虚拟共用,图片/视频共用。`]})})})})},{Header:Ose,Sider:kse,Content:Ase}=NW,{TextArea:jse}=wW,{Option:Mse}=HC,{Text:n9}=w1,Nse=`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/api\/?$/i,``).replace(/\/$/,``),Pse=e=>{if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${Nse}${t.startsWith(`/`)?t:`/${t}`}`:``},Fse=()=>{let{message:e}=rx.useApp(),t=Ge(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(`1`),[o,s]=(0,S.useState)([]),{mediaType:c,countType:l,generationCount:u,selectedRatio:d,selectedResolution:f,width:p,height:m,videoDuration:h,videoAspectRatio:g,videoResolution:_,engineOptions:v,enginesele:y,inputValue:b,setMediaType:x,setCountType:C,setGenerationCount:w,setSelectedRatio:T,setSelectedResolution:E,setWidth:D,setHeight:O,setVideoDuration:k,setVideoAspectRatio:A,setVideoResolution:j,setEngineOptions:M,setEnginesele:N,setInputValue:P,currentMedia:F,setCurrentMedia:I}=h7(),L=Array.isArray(y)?{}:y,R=(c===`image`?L.image:L.video)?.find(e=>e.id===l),z=R?.maxImageCount??4,B=R?.maxVideoCount??1,V=!!R?.multiGenerationEnabled,H=V?Math.max(1,Math.min(5,Number(R?.maxGenerationCount||1))):1,U=c===`image`?F.filter(e=>e.type===`image`).length:0,W=c===`image`?Math.max(1,Number(R?.multiImageMaxImages||15)-U):5,G=Math.max(1,Math.min(5,H,c===`image`?W:5)),[K,ee]=(0,S.useState)(!1),[q,te]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(!1),[ie,J]=(0,S.useState)(`universal`),[ae,oe]=(0,S.useState)(null),[se,ce]=(0,S.useState)(null),[le,ue]=(0,S.useState)(null),[de,fe]=(0,S.useState)(!1),[pe,me]=(0,S.useState)(!1),[he,ge]=(0,S.useState)(`real_person`),[_e,ve]=(0,S.useState)(!1),ye=(0,S.useRef)(null),be=(0,S.useCallback)(()=>{ye.current&&=(window.clearTimeout(ye.current),null),ve(!0)},[]),xe=(0,S.useCallback)(()=>{ye.current&&window.clearTimeout(ye.current),ye.current=window.setTimeout(()=>{ve(!1),ye.current=null},260)},[]),[Se,Ce]=(0,S.useState)(!1),we=(0,S.useRef)(null),Te=(0,S.useRef)(!1),[Ee,De]=(0,S.useState)({top:0,left:0}),Oe=e=>{let t=0,n=0,r=0;return e.map(e=>e.type===`image`?(t++,`图片${t}`):e.type===`video`?(n++,`视频${n}`):(r++,`音频${r}`))},[ke,Ae]=(0,S.useState)(!1),[je,Me]=(0,S.useState)(``),[Ne,Pe]=(0,S.useState)(`image`),Fe=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(ke&&Ne===`video`){let e=()=>{Fe.current&&Fe.current.play().catch(()=>{})};Fe.current&&(Fe.current.readyState>=2?e():Fe.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Fe.current&&(Fe.current.removeEventListener(`loadedmetadata`,e),Fe.current.pause())}}else Fe.current&&Fe.current.pause()},[ke,Ne]);let[Ie,Le]=(0,S.useState)(new Set),Re=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}}},ze=e=>{let t=Re(e);return t?Math.floor(Date.now()/1e3)>t:!1},[Be,Ve]=(0,S.useState)(!1),[He,Ue]=(0,S.useState)(``),[We,Ke]=(0,S.useState)(`image`),[qe,Je]=(0,S.useState)(``),Ye=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Be&&We===`video`&&Ye.current){let e=Ye.current;e.currentTime=0,e.muted=!1;let t=e.play();t&&typeof t.catch==`function`&&t.catch(()=>{e.muted=!0,e.play().catch(()=>{})})}else if(!Be&&Ye.current){let e=Ye.current;e.pause(),e.muted=!0,e.currentTime=0}},[Be,We,He]);let[Xe,Ze]=(0,S.useState)(null),[Qe,$e]=(0,S.useState)(0),[et,tt]=(0,S.useState)(!1),[nt,rt]=(0,S.useState)(null),[it,at]=(0,S.useState)({x:0,y:0}),[ot,st]=(0,S.useState)(!1),[ct,lt]=(0,S.useState)(!1),[ut,dt]=(0,S.useState)([]),[ft,pt]=(0,S.useState)([]),[mt,ht]=(0,S.useState)({}),[gt,_t]=(0,S.useState)(!1),[vt,yt]=(0,S.useState)(!1),[bt,xt]=(0,S.useState)([]),[St,Ct]=(0,S.useState)([]),[wt,Tt]=(0,S.useState)([]),Et=()=>{let e={};if(e=wt.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?_:f)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(_===`1080p`||_===`720p`||_===`480p`)&&(e.ratio=1.3)):(e={perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(f===`2K`||f===`4K`||f===`1K`)&&(e.ratio=3))),c===`video`){let t=(h*e.perSecondCredits+e.baseCredits)*e.ratio,n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=F.filter(e=>e.type===`image`).length;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}return Number((t*u).toFixed(2))}else{let t=e.baseCredits*e.ratio,n=F.filter(e=>e.type===`image`).length;if(n>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n)*(e.inputImageRatio||1);t+=r}return Number((t*u).toFixed(2))}},Dt=(0,S.useRef)(null),Ot=(0,S.useRef)(null),kt=(0,S.useRef)(null);(0,S.useRef)(!0);let At=(0,S.useRef)(!1),jt=(0,S.useRef)(0);o.find(e=>e.id===i);let[Mt,Nt]=(0,S.useState)([]),[Pt,Ft]=(0,S.useState)({page:1,pageSize:20}),[It,Lt]=(0,S.useState)(0),[Rt,zt]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=t.state;e&&(e.generationPrompt&&P(e.generationPrompt),e.mediaReferences&&Array.isArray(e.mediaReferences)&&e.mediaReferences.length>0&&I(e.mediaReferences.map(e=>{let t=e.url||e.resourceUrl||e.previewUrl||``,n=t.startsWith(`http`)?t:`https://ceshi.apiforeign.minzhongzc.com${t}`;return{...e,name:e.name||`参考${e.type}`,type:e.type===`video`?`video`:e.type===`audio`?`audio`:`image`,url:n,duration:e.duration||0,label:e.label||``}})),e.aspectRatio&&A(e.aspectRatio),window.history.replaceState({},``,window.location.pathname))},[t.state]),(0,S.useEffect)(()=>()=>{ye.current&&window.clearTimeout(ye.current)},[]);let Bt=(0,S.useCallback)((e=`instant`)=>{let t=Ot.current;t&&(jt.current=Date.now(),requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})}))},[]);(0,S.useEffect)(()=>{if(Mt.length>0&&!At.current){let e=setTimeout(()=>{Bt(`smooth`),At.current=!0},300);return()=>clearTimeout(e)}},[Mt.length,Bt]),(0,S.useEffect)(()=>{if(Te.current){Te.current=!1;return}if(!ne)return;let e=Array.isArray(y)?{}:y,t=c===`image`?e.image:e.video;t&&t.length>0&&(t.some(e=>e.id===l)||C(t[0].id))},[c,y,ne]),(0,S.useEffect)(()=>{ne&&w(1)},[c,l,ne,w]),(0,S.useEffect)(()=>{u>G&&(w(G),c===`image`&&e.info(`受当前引擎或参考图数量限制,本次最多生成 ${G} 份`))},[u,G,c,w,e]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;vt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&yt(!1),gt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&_t(!1),ot&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&st(!1),ct&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&<(!1),de&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&fe(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[vt,gt,ot,ct,de]),(0,S.useEffect)(()=>{if(Te.current){Te.current=!1;return}if(c!==`video`)return;let e=L.video?.find(e=>e.id===l);if(!e)return;let t=e.supportsFirstLastFrame??!1,n=e.supportsUniversalReference??!0;J(e=>n?`universal`:e===`universal`&&!n&&t?`first_last_frame`:e)},[l,c,y]),(0,S.useEffect)(()=>{P5().then(e=>{if(N(e.engine),re(!0),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;M({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(g)||A(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(_)||j(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(h)||k(n.supportedDurations?.[0]||5),l===`请选择`&&C(n.id)}if(e.engine.image&&e.engine.image.length>0){let t=e.engine.image.find(e=>e.id===l)||e.engine.image[0],n=t.supportedSizes||{},r=Object.keys(n).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),i=r[0]||`2K`,a=Object.keys(n[i]||{});if(dt(a.map(e=>({value:e,label:e}))),ht(n),pt(r.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),n[i]&&n[i][a[0]]){let[e,t]=n[i][a[0]].split(/[×x]/);D(Number(e)),O(Number(t)),T(a[0]),E(i)}l===`请选择`&&C(t.id)}}).catch(()=>{}),L5().then(e=>{Tt(e)}),F5(Pt).then(e=>{let t=e.total;Nt(e.items),Lt(t)})},[]),(0,S.useEffect)(()=>{if(kt.current&&=(clearInterval(kt.current),null),Mt.some(e=>e.status===`generating`))return kt.current=window.setInterval(()=>{F5(Pt).then(e=>{Nt(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),Lt(e.total)}).catch(e=>{})},1e4),()=>{kt.current&&=(clearInterval(kt.current),null)}},[Mt,Pt]),(0,S.useEffect)(()=>{if(!ot)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&st(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ot]),(0,S.useEffect)(()=>{if(!ct)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&<(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ct]);let Vt=e=>{let t=Object.keys(mt).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=mt[f]&&mt[f][e]?f:t.find(t=>mt[t]&&mt[t][e])||t[0];if(n&&mt[n]&&mt[n][e]){let[t,r]=mt[n][e].split(/[×x]/);D(Number(t)),O(Number(r)),T(e),E(n)}},Ht=e=>{mt[e]||(e=Object.keys(mt).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)})[0]||e);let t=mt[e]?Object.keys(mt[e]):[];dt(t.map(e=>({value:e,label:e})));let n=t.includes(d)?d:t[0]||``;if(n&&mt[e]&&mt[e][n]){let[t,r]=mt[e][n].split(/[×x]/);D(Number(t)),O(Number(r)),T(n),E(e)}},Ut=()=>{D(m),O(p)},Wt=y?.video?.find(e=>e.id===l),Gt=Wt?.supportsFirstLastFrame??!1,Kt=Wt?.supportsUniversalReference??!0,qt=e=>{e===`first_last_frame`&&!Gt||e===`universal`&&!Kt||(J(e),fe(!1),I([]),P(``))},Jt=()=>{let e=ae;oe(se),ce(e)},Yt=()=>{oe(null),ce(null)},Xt=()=>{ce(null)},Zt=async()=>{let t=c===`video`&&ie===`first_last_frame`;if(t){if(!b.trim()){e.warning(`请输入内容`);return}}else if(!b.trim()&&F.length===0){e.warning(`请输入内容或上传图片/视频`);return}let n=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),r=e=>!e||typeof e!=`object`?e:Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map(([e,t])=>[n(e),r(t)])),i;t?(i=[],ae&&i.push(r({...ae,role:`first_frame`})),se&&i.push(r({...se,role:`last_frame`})),i.length===0&&(i=void 0)):i=F.length>0?F.map(e=>{if(e.type===`image`){let{duration:t,...n}=e;return r(n)}return r(e)}):void 0;let a={id:``,gen_type:c,original_prompt:b.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),generation_count:u,media_references:i,...c===`image`&&{image_size:f,image_proportion:d,image_px:p+`x`+m},...c===`video`&&{duration:h,aspect_ratio:g,resolution:_}};te(!0),iae(a).then(()=>{P(``),I([]),oe(null),ce(null),w(1);let e={...Pt,page:1};Ft(e),F5(e).then(e=>{let t=e.items.map(e=>(e.media_references&&Array.isArray(e.media_references)&&(e.mediaReferences=e.media_references.map(e=>({...e,display_url:e.display_url||e.displayUrl,preview_url:e.preview_url||e.previewUrl,private_asset_id:e.private_asset_id||e.privateAssetId,provider_url:e.provider_url||e.providerUrl,remote_asset_id:e.remote_asset_id||e.remoteAssetId}))),e)),n=Array.isArray(t)&&t.length>0?t[t.length-1]:null;n&&Nt(e=>[...e,n]),Lt(e.total),setTimeout(()=>{Dt.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(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),e.error({content:n,duration:3})}).finally(()=>{te(!1)}),setTimeout(()=>{te(!1)},3e3)},Qt=async()=>{if(Mt.length>=It)return;let e=Ot.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;zt(!0);try{let r=Pt.page+1,i=await F5({...Pt,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&Lt(a.total),Ft(e=>({...e,page:r})),Nt(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)).reverse(),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{zt(!1)}},$t=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法获取视频时长`))},r.src=URL.createObjectURL(e)}),en=e=>new Promise((t,n)=>{let r=document.createElement(`audio`);r.preload=`metadata`,r.onloadedmetadata=()=>{URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{URL.revokeObjectURL(r.src),n(Error(`无法获取音频时长`))},r.src=URL.createObjectURL(e)}),tn=e=>{let t=e.startsWith(`http`)?e:`https://ceshi.apiforeign.minzhongzc.com${e}`;if(Xe===t){let e=document.getElementById(`audio-player`);e&&e.pause(),Ze(null)}else Ze(t)},nn=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{window.URL.revokeObjectURL(r.src),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取图片尺寸`))},r.src=URL.createObjectURL(e)}),rn=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t({width:r.videoWidth,height:r.videoHeight,duration:r.duration})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取视频尺寸`))},r.src=URL.createObjectURL(e)}),an=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},on=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},sn=async(t,n)=>{let r=t.type.startsWith(`image/`),i=t.type.startsWith(`video/`);if(c===`video`&&ie===`first_last_frame`){if(!r)return e.error(`首尾帧模式仅支持上传图片`),!1;if(t.size/1024/1024>10)return e.error(`图片大小不能超过10MB`),!1;try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let i=n||le;if(!i)return e.error(`请选择首帧或尾帧上传位置`),!1;ee(!0);try{let n=await b5(t),r={name:t.name,type:`image`,url:n.url,role:i===`first`?`first_frame`:`last_frame`};i===`first`?oe(r):ce(r),e.success(`图片上传成功`)}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{ee(!1),ue(null)}return!1}let a=t.type.startsWith(`audio/`);if(!r&&!i&&!a)return e.error(`仅支持图片、视频或音频文件`),!1;if(a){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(c===`image`&&(i||a))return e.error(`图片模式仅支持上传图片`),!1;if(a&&c!==`video`)return e.error(`仅视频模式支持上传音频`),!1;let o=i?100:a?50:10,s=i?`视频`:a?`音频`:`图片`;if(t.size/1024/1024>o)return e.error(`${s}大小不能超过${o}MB`),!1;if(r)try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let l=F.filter(e=>e.type===`image`).length;if(r&&l>=jn)return e.error(`该引擎最多上传${jn}张图片`),!1;let u=F.filter(e=>e.type===`video`).length;if(i&&u>=Mn)return e.error(`该引擎最多上传${Mn}个视频`),!1;let d=F.filter(e=>e.type===`audio`).length;if(a&&d>=Nn)return e.error(`该引擎最多上传${Nn}个音频`),!1;let f=0,p=0;if(i)try{if(f=await $t(t),f<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+f>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+f).toFixed(1)} 秒`),!1;let{width:r,height:i}=await rn(t),a=on(r,i);if(a)return e.error(a),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(a)try{if(p=await en(t),p<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+p>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+p).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}ee(!0);try{let e;e=r?await b5(t):a?await y5(t,p):await x5(t,f);let n=r?`image`:a?`audio`:`video`,o=[...F,{name:t.name,type:n,url:e.url,label:``,...i&&{duration:f},...a&&{duration:p}}],s=Oe(o);I(o.map((e,t)=>({...e,label:s[t]})))}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{ee(!1)}return!1},cn=async t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`),i=t.type.startsWith(`audio/`);if(!n&&!r&&!i)return e.error(`仅支持图片、视频或音频文件`),!1;let a=r?100:i?50:30;if(t.size/1024/1024>a)return e.error(`${r?`视频`:i?`音频`:`图片`}大小不能超过${a}MB`),!1;if(n||r){let n=h7.getState().currentMedia.filter(e=>e.type===`image`||e.type===`video`).reduce((e,t)=>e+(Number(t.fileSizeBytes)||0),0),r=(n+t.size)/1024/1024;if(r>64)return e.error(`所有图片和视频总大小不能超过64MB,当前已${(n/1024/1024).toFixed(1)}MB,加上此文件后${r.toFixed(1)}MB`),!1}if(i){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(n)try{let{width:n,height:r}=await nn(t),i=an(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let o=0,s=0;if(r)try{if(o=await $t(t),o<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=h7.getState().currentMedia.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+o>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+o).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(i)try{if(s=await en(t),s<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=h7.getState().currentMedia.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+s>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+s).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}let c=n?`image`:i?`audio`:`video`,l={name:t.name,type:c,url:``,label:``,...r&&{duration:o},...i&&{duration:s}},u=h7.getState().currentMedia;if(!dn(u,[l]))return!1;try{let e;return e=n?await b5(t):i?await y5(t,s):await x5(t,o),{name:l.name,type:l.type,url:e.url,label:l.label||``,fileSizeBytes:t.size,...l.duration!==void 0&&{duration:l.duration}}}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;return e.error(n),!1}},ln=async t=>{let n=0,r=0;ee(!0);for(let e of t){let t=await cn(e);if(t){let e=[...h7.getState().currentMedia,t],r=Oe(e);I(e.map((e,t)=>({...e,label:r[t]}))),n++}else r++}ee(!1),n>0&&e.success(`成功上传${n}个文件${r>0?`,${r}个文件上传失败`:``}`)},un=(e,t)=>e.filter(e=>e.type===t).reduce((e,t)=>e+(Number(t.duration)||0),0),dn=(t,n)=>{if(!n.length)return!1;if(c===`image`&&n.some(e=>e.type!==`image`))return e.error(`图片模式仅支持添加图片素材`),!1;if(n.some(e=>e.type===`audio`)&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),!1;let r=t.filter(e=>e.type===`image`).length,i=t.filter(e=>e.type===`video`).length,a=t.filter(e=>e.type===`audio`).length,o=n.filter(e=>e.type===`image`).length,s=n.filter(e=>e.type===`video`).length,l=n.filter(e=>e.type===`audio`).length;if(r+o>jn)return e.error(`该引擎最多上传${jn}张图片,当前还能添加 ${Math.max(0,jn-r)} 张`),!1;if(i+s>Mn)return e.error(`该引擎最多上传${Mn}个视频,当前还能添加 ${Math.max(0,Mn-i)} 个`),!1;if(a+l>Nn)return e.error(`该引擎最多上传${Nn}个音频,当前还能添加 ${Math.max(0,Nn-a)} 个`),!1;for(let t of n){if(t.type!==`video`)continue;let n=Number(t.duration);if(!Number.isFinite(n)||n<=0)return e.error(`${t.name||`视频素材`}缺少视频秒数,不能用于 AI 创作`),!1;if(n<2)return e.error(`${t.name||`视频素材`}最短不能少于 2 秒`),!1;if(n>15)return e.error(`${t.name||`视频素材`}最长不能超过 15 秒`),!1}let u=un(t,`video`)+un(n,`video`);if(u>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${u.toFixed(1)} 秒`),!1;let d=un(t,`audio`)+un(n,`audio`);return d>15?(e.error(`所有音频素材总时长不能超过 15 秒,当前 ${d.toFixed(1)} 秒`),!1):!0},fn=t=>{let n=t.mediaReference,r=n?.type||t.resourceType,i=n?.url||t.resourceUrl||t.displayUrl||t.previewUrl||``;if(!i)return e.error(`${t.fileName||t.id} 缺少素材地址,不能用于 AI 创作`),null;if(r===`audio`&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),null;let a=Number(n?.duration??t.durationSeconds);return{name:n?.name||t.fileName||t.id,type:r,url:i,source:`upload_resource`,upload_resource_id:t.id,label:``,...(r===`video`||r===`audio`)&&Number.isFinite(a)&&a>0?{duration:a}:{}}},pn=t=>{let n=t.map(fn).filter(Boolean);if(!n.length)return;let r=h7.getState().currentMedia;if(!dn(r,n))return;let i=[...r,...n],a=Oe(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个历史上传素材参考`)},mn=t=>{if(t.assetType===`Audio`)return e.error(`音频私域素材暂不支持用于 AI 创作`),null;let n=t.assetType===`Video`?`video`:`image`,r=he===`aigc_virtual`?`虚拟素材`:`真人素材`,i=n===`video`?t.videoCoverUrl||t.previewUrl||t.displayUrl||t.providerUrl||``:t.previewUrl||t.displayUrl||t.videoCoverUrl||t.providerUrl||``;return{name:t.name||r,type:n,url:i,source:`private_portrait_asset`,private_asset_id:t.id,label:``,...n===`video`&&{duration:Number(t.videoDuration)||void 0}}},hn=e=>{ge(e),me(!0)},gn=t=>{let n=t.map(mn).filter(Boolean),r=h7.getState().currentMedia;if(!dn(r,n))return;let i=[...r,...n],a=Oe(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个${he===`aigc_virtual`?`虚拟`:`真人`}素材参考`)},_n=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,vn=e=>{let t=F.filter((t,n)=>n!==e),n=Oe(t);I(t.map((e,t)=>({...e,label:n[t]})))},yn=(e,t)=>{let n=e.selectionStart;return t.slice(0,n).match(/@([^@\s]*)$/)&&F.length>0?(Ce(!0),!0):(Ce(!1),!1)},bn=e=>{let t=e.target.value;P(t);let n=e.target;yn(n,t)},xn=e=>{Se&&e.key===`Escape`&&Ce(!1)},Sn=e=>{let t=we.current?.resizableTextArea?.textArea;if(!t)return;let n=t.selectionStart,r=b.slice(0,n),i=b.slice(n),a=r.lastIndexOf(`@`);if(a===-1){Ce(!1);return}P(r.slice(0,a)+`@${e} `+i),Ce(!1),setTimeout(()=>{let n=a+e.length+2;t.focus(),t.setSelectionRange(n,n)},0)},Cn=()=>{Ae(!1),Me(``),Fe.current&&Fe.current.pause()},wn=e=>{if(e.preventDefault(),e.stopPropagation(),!je)return;let t=je.replace(`/static`,``).replace(/&w=\d+/i,``).replace(/&q=\d+/i,``);t.includes(`download=1`)||(t+=`&download=1`);let n=document.createElement(`a`);n.href=t,n.download=Ne===`image`?`image.png`:`video.mp4`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},Tn=e=>{let t=String(e?.type||``).toLowerCase(),n=String(e?.url||e?.name||``).toLowerCase();return t.includes(`video`)||/\.(mp4|mov|avi|webm|m4v)(\?|$)/.test(n)?`video`:t.includes(`audio`)||/\.(mp3|wav|ogg|aac|m4a)(\?|$)/.test(n)?`audio`:`image`},En=e=>e?/^https?:\/\//i.test(e)?e:`https://ceshi.apiforeign.minzhongzc.com${e}`:``,Dn=e=>{e?.url&&(Ue(e.url),Ke(Tn(e)),Je(e.name||`附件`),Ve(!0))},On=c===`video`&&ie===`first_last_frame`,kn=!K&&(On?!!(b.trim()||ae):!!(b.trim()||F.length>0)),An=c===`image`?`输入画面描述,或上传图片参考风格、构图、主体与光影。例:@图片1 参考色调,生成一张简洁高级的产品海报。`:On?`首帧尾帧可以不传,如需传入建议描述首帧到尾帧的主体动作、镜头运动、节奏与转场。例:从首帧自然推进到尾帧,产品居中突出,动作平滑连贯。`:`上传最多12个参考素材,输入文字或 @ 引用参考内容,自由组合图、文、视频。例:@图片1 模仿 @视频1 的动作。`,jn=z,Mn=B,Nn=R?.maxAudioCount??1;return(0,$.jsxs)(NW,{className:`ai-create-page`,style:{margin:`-24px -32px -32px`,borderRadius:22,height:`calc(100vh - 34px)`,background:`rgba(255, 255, 255, 0.52)`,overflow:`hidden`},children:[(0,$.jsx)(`audio`,{id:`audio-player`,src:Xe||null,autoPlay:!0,onEnded:()=>Ze(null),style:{display:`none`}}),(0,$.jsxs)(NW,{style:{display:`flex`,flex:1,background:`rgba(255, 255, 255, 0.52)`},children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(22px)`,border:`1px solid rgba(231, 234, 240, 0.82)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(117,106,136,0.18), rgba(232,227,236,0.48), transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,textAlign:`center`},children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`AI创作`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#667085`,margin:`4px 0 0 0`},children:`输入想法、剧本或上传参考,智能生成视频/图片`})]}),(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(232,227,236,0.48), rgba(117,106,136,0.18), transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(Ase,{style:{flex:1,margin:0,padding:`20px 24px 22px`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[Mt.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, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(s8,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#2f3440`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#98a2b3`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),Mt.length>0&&(0,$.jsxs)(`div`,{ref:Ot,className:`ai-create-scroll`,style:{flex:1,overflowY:`auto`,paddingRight:10,paddingBottom:18},onScroll:e=>{let t=e.currentTarget;!(Date.now()-jt.current<500)&&At.current&&t.scrollTop<=50&&!Rt&&Mt.length{let t=e;return Mt.map(e=>(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, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(s8,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgb(255, 255, 255)`,backdropFilter:`blur(18px)`,borderRadius:`22px`,padding:`14px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 18px 50px rgba(47, 52, 64, 0.075)`,position:`relative`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#98a2b3`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:e.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:(e.genType,`rgba(139, 92, 246, 0.10)`),color:(e.genType,`#8b5cf6`),padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:e.genType===`image`?`图片生成`:`视频生成`})]}),e.mediaReferences&&e.mediaReferences.length>0&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#8b5cf6`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(139, 92, 246, 0.2)`,background:`rgba(139, 92, 246, 0.04)`},onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();at({x:n.left,y:n.top-10}),rt(e.id),tt(!0)},children:`附件详情`})}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:8,right:8,zIndex:100,display:`flex`,gap:6},children:[(0,$.jsxs)(`button`,{onClick:n=>{n.stopPropagation(),P(e.originalPrompt||``);let r=!0,i=e.engineId||e.engineSnapshot?.id||e.engine_id;if(i&&e.genType){let n=Array.isArray(y)?{}:y,a=(e.genType===`image`?n.image:n.video)?.find(e=>e.id===i);if(a){if(C(a.id),e.genType===`video`&&M({ratios:a.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:a.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.supportedDurations||[5,8,10,12,15]}),e.genType===`image`){let e=a.supportedSizes||{},t=Object.keys(e).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=t[0]||`2K`,r=Object.keys(e[n]||{});if(dt(r.map(e=>({value:e,label:e}))),ht(e),pt(t.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),e[n]&&e[n][r[0]]){let[t,i]=e[n][r[0]].split(/[×x]/);D(Number(t)),O(Number(i)),T(r[0]),E(n)}}}else t.error(`该引擎已删除,无法重新编辑`),r=!1}if(r){if(e.genType&&(Te.current=!0,x(e.genType)),e.mediaReferences&&e.mediaReferences.length>0)if(e.mediaReferences.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&e.genType===`video`){let t=e.mediaReferences.find(e=>e.role===`first_frame`),n=e.mediaReferences.find(e=>e.role===`last_frame`);oe(t?{...t,label:t.label||``,duration:t.duration}:null),ce(n?{...n,label:n.label||``,duration:n.duration}:null),I([]),J(`first_last_frame`)}else if(I(e.mediaReferences.map(e=>({...e,name:e.name,type:e.type,url:e.url,label:e.label||``,role:e.role,duration:e.duration}))),oe(null),ce(null),e.genType===`video`){let e=L.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;J(t?`universal`:n?`first_last_frame`:`universal`)}else J(`universal`)}else J(`universal`);else if(I([]),oe(null),ce(null),e.genType===`video`){let e=y?.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;J(t?`universal`:n?`first_last_frame`:`universal`)}}t.success(`已加载到编辑区`)}},style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`},children:[(0,$.jsx)(fq,{style:{fontSize:12}}),`重新编辑`]}),(0,$.jsx)(oK,{title:`确定要删除吗?`,onConfirm:async()=>{try{await oae(e.id),t.success(`删除成功`),Nt(t=>t.filter(t=>t.id!==e.id)),Lt(e=>e-1)}catch(e){let n=e?.response?.data?.message||e?.message||`删除失败`;t.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsxs)(`button`,{onClick:e=>e.stopPropagation(),style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(164, 91, 91, 0.1)`,e.currentTarget.style.color=`#A45B5B`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`,e.currentTarget.style.color=`#8b5cf6`},children:[(0,$.jsx)(s$,{style:{fontSize:12}}),`删除`]})})]}),(e.status===`generating`||e.status===`failed`||e.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 #E7EAF0`,boxShadow:`0 4px 12px rgba(139, 92, 246, 0.08)`,background:`linear-gradient(135deg, #ffffff 0%, #FAFBFC 100%)`},children:(0,$.jsx)(ose,{task:e,resolveUrl:Pse,onPreview:(e,t)=>{Me(e),Pe(t),Ae(!0)}})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`#FFFFFF`,borderRadius:12,padding:12,border:`1px solid #E7EAF0`,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:`#475467`,fontSize:13},children:e.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#667085`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#8b5cf6`,fontWeight:500},children:e.engineSnapshot?.name||`未知引擎`}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#667085`},children:e.genType===`image`?`${e.imageProportion||``} · ${e.imagePx||``} · ${e.imageSize||``}`:`${e.duration||``}秒 · ${e.aspectRatio||``} · ${e.resolution||``}`}),(0,$.jsxs)(`span`,{style:{fontSize:14,borderRadius:16,color:`#8b5cf6`},children:[`消耗积分:`,e.creditsCost]})]})]})]})]})})]})},e.id))})(),(0,$.jsx)(`div`,{ref:Dt})]}),et&&nt&&(()=>{let e=Mt.find(e=>e.id===nt)?.mediaReferences||[];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{tt(!1),rt(null)}}),(0,$.jsxs)(`div`,{className:`ai-reference-expanded-tray ai-attachment-popover`,style:{position:`fixed`,top:`max(84px, ${it.y-96}px)`,left:`max(24px, min(${it.x-250}px, calc(100vw - 456px)))`,width:424,padding:`12px 12px 10px`,borderRadius:18,background:`rgba(255,255,255,0.98)`,border:`1px solid #E7EAF0`,boxShadow:`0 24px 60px rgba(31, 41, 55, 0.12)`,backdropFilter:`blur(18px)`,zIndex:9999,pointerEvents:`auto`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#344054`,fontWeight:800},children:`参考附件`}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#98A2B3`,fontWeight:600},children:`点击素材查看,或直接下载原文件`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,$.jsx)(`button`,{onClick:()=>{tt(!1),rt(null)},style:{width:26,height:26,borderRadius:`50%`,border:`1px solid transparent`,background:`#F6F7FA`,cursor:`pointer`,color:`#98a2b3`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`,e.currentTarget.style.color=`#2f3440`},onMouseLeave:e=>{e.currentTarget.style.background=`#F6F7FA`,e.currentTarget.style.color=`#98a2b3`},children:(0,$.jsx)(Au,{style:{fontSize:12}})})})]}),(0,$.jsx)(`div`,{className:`ai-reference-tray-scroll`,style:{display:`flex`,gap:10,overflowX:`auto`,padding:`2px 2px 4px`},children:e.map((e,t)=>{let n=Tn(e),r=e.label||(e.role===`first_frame`?`首帧`:e.role===`last_frame`?`尾帧`:`${n===`image`?`图片`:n===`video`?`视频`:`音频`}${t+1}`);return(0,$.jsxs)(`div`,{style:{flex:`0 0 92px`,width:92,borderRadius:16,background:`#FFFFFF`,border:`1px solid #E7EAF0`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.06)`,padding:7,boxSizing:`border-box`},children:[(0,$.jsx)(`div`,{onClick:t=>{n===`audio`?(t.stopPropagation(),tn(e.url)):(Dn(e),tt(!1),rt(null))},style:{position:`relative`,width:`100%`,height:70,borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#F7F8FA`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:n===`image`?(0,$.jsx)(`img`,{src:En(e.url),alt:e.name||r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):n===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:En(e.url),muted:!0,playsInline:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(31, 41, 55, 0.08)`},children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(47, 52, 64, 0.72)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.22)`},children:(0,$.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`},children:Xe===(e.url.startsWith(`http`)?e.url:`https://ceshi.apiforeign.minzhongzc.com${e.url}`)?(0,$.jsx)(O6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(O2,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{title:e.name||r,style:{marginTop:6,color:`#667085`,fontSize:10,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,textAlign:`center`},children:e.name||r}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:5,marginTop:7},children:(0,$.jsx)(`button`,{onClick:()=>{Dn(e),tt(!1),rt(null)},style:{flex:1,height:24,borderRadius:9,border:`1px solid #E7EAF0`,background:`#F8FAFC`,color:`#8b5cf6`,fontSize:11,fontWeight:700,cursor:`pointer`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`},onMouseLeave:e=>{e.currentTarget.style.background=`#F8FAFC`},children:`查看`})})]},`${e.url||e.name||t}-${t}`)})})]})]})})(),(0,$.jsxs)(`div`,{style:{position:`relative`,background:`rgba(255, 255, 255, 0.52)`,borderRadius:24,padding:`18px 72px 16px 20px`,boxShadow:`0 22px 64px rgba(31, 41, 55, 0.08), 0 1px 0 rgba(255,255,255,0.98) inset`,transition:`all 0.25s ease`,border:`1px solid rgba(231, 234, 240, 0.78)`,backdropFilter:`blur(24px)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:18,alignItems:`flex-end`,marginBottom:14},children:[(0,$.jsx)(`div`,{style:{width:On?220:70,minWidth:On?220:70,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,paddingTop:2,gap:8},children:c===`video`&&ie===`first_last_frame`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,alignItems:`stretch`,gap:12,width:`100%`,height:100},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`首帧(可选)`})}),ae?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:_n(ae.url),alt:ae.name,onClick:()=>{Ue(ae.url),Ke(`image`),Je(ae.name),Ve(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Yt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(s$,{style:{fontSize:9}})})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,onLocalSelect:e=>{e.length>0&&sn(e[0],`first`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];oe({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`first_frame`,label:``}),e.success(`成功添加首帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;oe({name:n.name||`首帧图片`,type:`image`,url:r,role:`first_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加首帧`)}},uploading:K,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.28)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.28)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传首帧`})]})})]}),(0,$.jsx)(`button`,{onClick:Jt,disabled:!ae||!se,title:`调换首尾帧`,style:{width:32,height:32,alignSelf:`center`,borderRadius:50,border:`1px solid rgba(231, 234, 240, 0.95)`,background:ae&&se?`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`:`#F3F5F8`,cursor:ae&&se?`pointer`:`not-allowed`,color:ae&&se?`#fff`:`#98A2B3`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:ae&&se?`0 6px 14px rgba(139, 92, 246, 0.24)`:`none`,transition:`all 0.2s ease`,flexShrink:0},onMouseEnter:e=>{ae&&se&&(e.currentTarget.style.transform=`scale(1.06)`)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(OU,{style:{fontSize:14}})}),(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`,opacity:ae?1:.5},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`尾帧`})}),se?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:_n(se.url),alt:se.name,onClick:()=>{Ue(se.url),Ke(`image`),Je(se.name),Ve(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Xt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(s$,{style:{fontSize:9}})})]}):ae?(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,onLocalSelect:e=>{e.length>0&&sn(e[0],`last`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];ce({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`last_frame`,label:``}),e.success(`成功添加尾帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;ce({name:n.name||`尾帧图片`,type:`image`,url:r,role:`last_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加尾帧`)}},uploading:K,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.24)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.24)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传尾帧`})]})}):(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(226, 232, 240, 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`not-allowed`,backgroundColor:`rgba(241, 245, 249, 0.5)`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#cbd5e1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:500},children:`请先上传首帧`})]})]})]}):(0,$.jsx)($.Fragment,{children:!(c===`video`&&ie===`first_last_frame`)&&(0,$.jsxs)(`div`,{style:{position:`relative`,width:64,height:72,marginTop:`-10`},onMouseEnter:be,onMouseLeave:xe,children:[F.length===0&&(0,$.jsx)(A7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:ln,onHistorySelect:pn,onPortraitLibrarySelect:e=>{hn(e)},uploading:K,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, 视频${F.filter(e=>e.type===`video`).length}/${B}${Nn>0?`, 音频${F.filter(e=>e.type===`audio`).length}/${Nn}`:``}`,maxImageCount:z,maxVideoCount:B,usedImageCount:F.filter(e=>e.type===`image`).length,usedVideoCount:F.filter(e=>e.type===`video`).length,usedVideoDuration:F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,maxAudioCount:Nn>0?Nn:void 0,usedAudioCount:F.filter(e=>e.type===`audio`).length,maxAudioDuration:15,usedAudioDuration:F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0),hideLimitHint:c===`image`,mediaType:c,children:(0,$.jsx)(`div`,{style:{width:54,height:74,borderRadius:7,border:`1px solid rgba(231, 234, 240, 0.95)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,background:`#f4f4f4`,flexDirection:`column`,gap:5,transform:`rotate(-7deg)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#D7DDE7`,e.currentTarget.style.background=`#f4f4f4`,e.currentTarget.style.transform=`rotate(0deg) translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(231, 234, 240, 0.95)`,e.currentTarget.style.background=`#f4f4f4`,e.currentTarget.style.transform=`rotate(-7deg)`},children:K?(0,$.jsx)(Ym,{style:{fontSize:17,color:`#667085`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(JI,{style:{fontSize:18,color:`#667085`,lineHeight:1}}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, 14px)`,columnGap:2,justifyContent:`center`,color:`#344054`,fontSize:12,fontWeight:700,lineHeight:1.05,letterSpacing:0},children:[(0,$.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1},children:[(0,$.jsx)(`span`,{children:`参`}),(0,$.jsx)(`span`,{children:`考`})]}),(0,$.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1},children:[(0,$.jsx)(`span`,{children:`内`}),(0,$.jsx)(`span`,{children:`容`})]})]})]})})}),F.length>0&&(0,$.jsx)($.Fragment,{children:F.map((e,t)=>{let n=Math.min(F.length,3)-1-t,r=_e?t*58:t<3?t*6:18,i=_e?!0:t<3;return(0,$.jsx)(`div`,{style:{position:`absolute`,left:r,bottom:0,zIndex:t+1,transition:`all 0.28s cubic-bezier(0.4, 0, 0.2, 1)`,transform:_e?`scale(1) rotate(0deg)`:`scale(${t<3?1-n*.08:0}) rotate(${t<3?-3+t*1.5:0}deg)`,opacity:i?_e?1:1-n*.15:0,pointerEvents:i?`auto`:`none`},children:(0,$.jsxs)(`div`,{style:{position:`relative`,width:52,height:60},children:[e.type===`image`?(0,$.jsx)(`img`,{src:_n(e.url),alt:e.name,onClick:()=>{Ue(e.url),Ke(`image`),Je(e.name),Ve(!0)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`}}):e.type===`video`?(0,$.jsx)(`video`,{src:_n(e.url),muted:!0,onClick:()=>{Ue(e.url),Ke(`video`),Je(e.name),Ve(!0)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`}}):(0,$.jsx)(`div`,{onClick:t=>{t.stopPropagation(),tn(e.url)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:Xe===_n(e.url)?(0,$.jsx)(O6,{style:{fontSize:20,color:`#fff`}}):(0,$.jsx)(O2,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`button`,{onClick:()=>vn(t),style:{position:`absolute`,top:-6,right:-6,width:20,height:20,borderRadius:50,background:`#1f2937`,border:`none`,color:`#fff`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 6px rgba(0,0,0,0.2)`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#dc2626`,e.currentTarget.style.transform=`scale(1.1)`},onMouseLeave:e=>{e.currentTarget.style.background=`#1f2937`,e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(s$,{style:{fontSize:10}})})]})},`stack-${t}`)})}),F.length>0&&(0,$.jsx)(A7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:ln,onHistorySelect:pn,onPortraitLibrarySelect:e=>{hn(e)},uploading:K,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, 视频${F.filter(e=>e.type===`video`).length}/${B}${Nn>0?`, @@ -585,8 +585,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 50% { opacity: 1; } 100% { opacity: 0; } } - `})]}):e===`failed`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#ef4444`},children:`失败`}):e===`completed`&&t.finalVideoUrl?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#10b981`},children:`任务完成`}):null})()]})]})]},t.id))}),(0,$.jsx)(`div`,{style:{paddingTop:20,paddingBottom:20,display:`flex`,justifyContent:`center`},children:(0,$.jsx)(uG,{current:h,pageSize:_,total:y,onChange:we,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:h===1?`#f9fafb`:`#fff`,cursor:h===1?`not-allowed`:`pointer`,color:h===1?`#d1d5db`:`#6b7280`,fontSize:14},disabled:h===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:h>=Math.ceil(y/_)?`#f9fafb`:`#fff`,cursor:h>=Math.ceil(y/_)?`not-allowed`:`pointer`,color:h>=Math.ceil(y/_)?`#d1d5db`:`#6b7280`,fontSize:14},disabled:h>=Math.ceil(y/_),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:6,background:e===h?`#6366f1`:`#fff`,color:e===h?`#fff`:`#374151`,fontWeight:e===h?500:400,cursor:`pointer`,fontSize:14},children:e}):n})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:`40px`},children:[(0,$.jsxs)(`div`,{style:{width:120,height:120,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:24,position:`relative`},children:[(0,$.jsx)(`div`,{style:{width:60,height:60,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:20,position:`absolute`,bottom:0,right:10}}),(0,$.jsx)(`div`,{style:{width:50,height:50,border:`2px solid rgba(99, 102, 241, 0.2)`,borderRadius:16,position:`absolute`,top:0,left:10}}),(0,$.jsx)(`div`,{style:{width:56,height:56,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:18,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.25)`},children:(0,$.jsx)(X8,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`,marginBottom:8},children:`暂无生成内容`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#64748b`,textAlign:`center`,padding:`0 40px`,lineHeight:1.6},children:`请完善素材与卖点,生成专属爆款复刻视频`})]})})]}),(0,$.jsx)(`div`,{className:`replication-form`,style:{overflow:`auto`,width:`30%`,background:`transparent`,backdropFilter:`blur(20px)`,borderRadius:20,position:`relative`,zIndex:10,scrollbarWidth:`none`},children:(0,$.jsxs)(`div`,{className:`replication-form-content`,style:{width:`100%`,height:`100%`,background:`rgba(258, 250, 252, 0.2)`,padding:24,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传复刻视频`}),A?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`video`,{src:r9(A),controls:!0,style:{width:`100%`,borderRadius:12,maxHeight:200,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:Ae,style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(X8,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:O?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,O?.size?(O.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(v0,{style:{width:`100%`},beforeUpload:Oe,showUploadList:!1,accept:`video/mp4,video/quicktime,.mp4,.mov`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:24,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:H?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:40,height:40,margin:`0 auto 12px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:48,height:48,margin:`0 auto 12px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(X8,{style:{fontSize:24,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`点击或拖拽上传视频`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传产品图片`}),R?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`img`,{src:r9(R),alt:`产品图片`,style:{width:`100%`,borderRadius:12,maxHeight:200,objectFit:`contain`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:je,style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(L6,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:I?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,I?.size?(I.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,uploading:W,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&ke(e[0])},onHistorySelect:e=>{let t=e[0];t&&(L(null),z(t.resourceUrl||t.previewUrl||t.displayUrl||``),V(t.id),Q.success(`历史图片已选择`))},children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:20,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:W?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:36,height:36,margin:`0 auto 10px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:44,height:44,margin:`0 auto 10px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:14,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(L6,{style:{fontSize:22,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`+ 点击上传`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`原产品名称`}),(0,$.jsx)(wW,{value:x,onChange:e=>C(e.target.value),placeholder:`请输入原产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[x.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`自有产品名称`}),(0,$.jsx)(wW,{value:w,onChange:e=>T(e.target.value),placeholder:`请输入自有产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[w.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`产品卖点`}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(Rse,{value:E,onChange:e=>D(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:10,fontSize:13,height:80,resize:`none`,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},rows:3,maxLength:30}),(0,$.jsxs)(`span`,{style:{position:`absolute`,right:10,bottom:8,color:`#94a3b8`,fontSize:12},children:[E.length,`/30`]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`grid`,gap:10},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:600,color:`#475569`},children:`视频生成参数(必选)`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{ce(!se),ue(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:K.find(e=>e.id===q)?.name||`选择引擎`})]}),se&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:300,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:300,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:K.filter(e=>e.supportsUniversalReference!==!1).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{te(e.id),fe({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(ie)||J(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(ae)||oe(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(ne)||re(e.supportedDurations?.[0]||5),ce(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:q===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e.id?600:500,color:q===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{ue(!le),ce(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[ie,` · `,ne,`s · `,ae]})]}),le&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:320,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:de.ratios.map(e=>{let[t,n]=e.split(`:`).map(Number),r=t>=n?18:Math.round(t/n*18),i=n>=t?18:Math.round(n/t*18);return(0,$.jsxs)(`button`,{onClick:()=>J(e),style:{flex:`0 0 calc(12.5% - 4px)`,minWidth:44,height:52,borderRadius:6,border:ie===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ie===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:r,height:i,border:`2px solid ${ie===e?`#6366f1`:`#9ca3af`}`,borderRadius:3,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:ie===e?`#6366f1`:`#6b7280`,fontWeight:ie===e?600:400},children:e})]},e)})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(ne-Math.min(...de.durations))/(Math.max(...de.durations)-Math.min(...de.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...de.durations),max:Math.max(...de.durations),value:ne,onChange:e=>re(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:ne}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:de.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>oe(e),style:{flex:1,height:42,borderRadius:8,border:ae===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ae===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:ae===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]})]}),(0,$.jsx)(jw,{title:(t?.credits||0){if((t?.credits||0)ge(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:d,onChange:e=>f(e.target.value),onPressEnter:De,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:De,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`,width:100,render:e=>(0,$.jsx)(`span`,{style:{fontSize:13,color:`#1e293b`,fontWeight:500},children:e||`-`})},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,width:220,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#64748b`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#64748b`}})();return(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,width:200,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,width:220,render:(t,n)=>(0,$.jsxs)(YV,{children:[(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo?flow_version=${n.flowVersion===`v2`?`v2`:`v1`}`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},children:`查看详情`}),(0,$.jsx)(oK,{title:`确认删除这个爆款开头复刻任务吗?`,onConfirm:async()=>{try{await Lae(n.id,n.flowVersion),Q.success(`删除成功`),Te(1,s,!1,d)}catch{Q.error(`删除失败`)}},children:(0,$.jsx)(`button`,{style:{color:`#ef4444`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(239, 68, 68, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.08)`},children:`删除`})})]})}],dataSource:r,rowKey:`id`,pagination:{current:a,pageSize:s,total:l,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Ee,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:a===1?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:a===1?`not-allowed`:`pointer`,color:a===1?`#94a3b8`:`#6366f1`,fontSize:14},disabled:a===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:a>=Math.ceil(l/s)?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:a>=Math.ceil(l/s)?`not-allowed`:`pointer`,color:a>=Math.ceil(l/s)?`#94a3b8`:`#6366f1`,fontSize:14},disabled:a>=Math.ceil(l/s),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:8,background:e===a?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#fff`,color:e===a?`#fff`:`#475569`,fontWeight:e===a?600:400,cursor:`pointer`,fontSize:14},children:e}):n},style:{fontSize:13},scroll:{y:350}})})})]})]})};function i9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function a9(e,...t){for(let n of t){let t=e[n];if(t!=null&&String(t).trim()!==``)return String(t)}return``}function o9(e,t,...n){for(let t of n){let n=e[t];if(n===!0||n===!1)return n;if(n===`true`)return!0;if(n===`false`)return!1}return t}function Hse(e,...t){for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e)&&e>0)return e}}}function s9(e){if(!i9(e))return null;let t=a9(e,`key`);return t?{key:t,label:a9(e,`label`)||t,type:a9(e,`type`)||void 0,enabled:o9(e,!0,`enabled`),editable:o9(e,!0,`editable`),maxLength:Hse(e,`maxLength`,`max_length`)}:null}function c9(e){if(!i9(e))return null;let t=e.data;return i9(t)?t:Array.isArray(e.sections)?e:null}function Use(e){return!!c9(e)}function l9(e){let t=c9(e);return(Array.isArray(t?.sections)?t.sections:[]).map(e=>{let t=s9(e);if(!t||!i9(e))return null;let n=Array.isArray(e.children)?e.children.map(s9).filter(Boolean):[],r=Array.isArray(e.itemFields)?e.itemFields.map(s9).filter(Boolean):Array.isArray(e.item_fields)?e.item_fields.map(s9).filter(Boolean):[];return{...t,contentKey:a9(e,`contentKey`,`content_key`)||void 0,children:n,itemFields:r}}).filter(e=>!!e&&e.enabled)}function u9(e){if(e==null)return``;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function d9(e){let t=u9(e);return t.length>40||t.includes(` -`)||t.includes(`,`)||t.includes(`。`)||t.includes(`;`)||t.includes(`;`)}function f9(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function p9(e,t,n,r){let i=f9(e||{});return i9(i[t])||(i[t]={}),i[t][n]=r,i}function m9(e,t,n,r,i){let a=f9(e||{});return Array.isArray(a[t])||(a[t]=[]),i9(a[t][n])||(a[t][n]={}),a[t][n][r]=i,a}function h9(e,t){if(!i9(e))return`视频提示词不能为空`;let n=l9(t);if(!n.length)return`视频提词配置缺失,无法保存`;for(let t of n){if(!t.editable)continue;let n=e[t.key];if(t.type===`object`){if(!i9(n))continue;for(let e of t.children)if(!(!e.enabled||!e.editable||!e.maxLength)&&u9(n[e.key]).length>e.maxLength)return`字段【${t.label}.${e.label}】长度不能超过 ${e.maxLength} 个字符`;continue}if(t.type===`flow`){if(!Array.isArray(n))continue;for(let e=0;en.maxLength)return`字段【${t.label} 第 ${e+1} 项.${n.label}】长度不能超过 ${n.maxLength} 个字符`}}continue}if(t.editable&&t.maxLength&&u9(n).length>t.maxLength)return`字段【${t.label}】长度不能超过 ${t.maxLength} 个字符`}return null}var{Text:g9}=w1,{TextArea:_9}=wW;function v9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function y9({value:e}){let t=e===`true`?`是`:e===`false`?`否`:u9(e);return d9(e)?(0,$.jsx)(_9,{value:t,rows:Math.min(6,Math.max(2,Math.ceil(t.length/42))),disabled:!0,style:{borderRadius:8,color:`#64748b`}}):(0,$.jsx)(wW,{value:t,disabled:!0,style:{borderRadius:8,color:`#64748b`}})}function b9({value:e,maxLength:t,onChange:n}){let r=u9(e),i={value:r,maxLength:t,showCount:!!t,onChange:e=>n(e.target.value),style:{borderRadius:8}};return d9(e)?(0,$.jsx)(_9,{...i,rows:Math.min(8,Math.max(3,Math.ceil(r.length/42)))}):(0,$.jsx)(wW,{...i})}function x9({value:e,onChange:t}){let n=e===!0||e===`true`;return(0,$.jsxs)(eI.Group,{value:n,onChange:e=>t(e.target.value),style:{display:`flex`,gap:24},children:[(0,$.jsx)(eI,{value:!0,style:{fontSize:14,color:`#475569`},children:`是`}),(0,$.jsx)(eI,{value:!1,style:{fontSize:14,color:`#475569`},children:`否`})]})}var S9=({value:e,schemaConfigSnapshot:t,onChange:n})=>{let r=v9(e)?e:{},i=l9(t);if(!Use(t))return(0,$.jsxs)(YV,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,$.jsx)(qf,{type:`warning`,showIcon:!0,message:`视频提词配置缺失,暂不能编辑`,description:`请刷新详情后重试;如果仍然缺失,请联系管理员排查第4步 schema_config_snapshot 返回。`}),Object.keys(r).length?(0,$.jsx)(`pre`,{style:{margin:0,padding:12,borderRadius:10,background:`#f8fafc`,maxHeight:420,overflow:`auto`,color:`#475569`},children:JSON.stringify(r,null,2)}):null]});if(!i.length)return(0,$.jsx)(qf,{type:`warning`,showIcon:!0,message:`视频提词配置为空`,description:`当前 Schema 配置没有可展示字段。`});let a=e=>{let t=v9(r[e.key])?r[e.key]:{},i=e.children.filter(e=>e.enabled);return i.length?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(YV,{style:{marginBottom:8},children:(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),(0,$.jsx)(`div`,{style:{borderLeft:`3px solid #6366f1`,paddingLeft:12,marginLeft:4},children:i.map(i=>(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(YV,{style:{marginBottom:4},children:(0,$.jsx)(g9,{style:{color:`#64748b`,fontSize:12},children:i.label})}),i.editable?i.type===`boolean`?(0,$.jsx)(x9,{value:t[i.key],onChange:t=>n(p9(r,e.key,i.key,t))}):(0,$.jsx)(b9,{value:t[i.key],maxLength:i.maxLength,onChange:t=>n(p9(r,e.key,i.key,t))}):(0,$.jsx)(y9,{value:t[i.key]})]},i.key))})]},e.key):null},o=e=>{let t=Array.isArray(r[e.key])?r[e.key]:[],i=[{key:`时间段`,label:`时间段`,enabled:!0,editable:!1},...e.itemFields.filter(e=>e.enabled)];return(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsxs)(YV,{style:{marginBottom:8},children:[(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label}),(0,$.jsx)(qQ,{color:`default`,children:`锁定条目和时间段`})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #e5e7eb`,borderRadius:10,padding:12,background:`#fff`},children:t.length===0?(0,$.jsx)(g9,{style:{color:`#94a3b8`,fontSize:12},children:`暂无内容`}):t.map((a,o)=>{let s=v9(a)?a:{};return(0,$.jsxs)(`div`,{style:{marginBottom:o===t.length-1?0:14,paddingBottom:o===t.length-1?0:14,borderBottom:o===t.length-1?`none`:`1px dashed #e2e8f0`},children:[(0,$.jsxs)(g9,{strong:!0,style:{display:`block`,marginBottom:8,color:`#475569`,fontSize:12},children:[`第 `,o+1,` 段`]}),i.map(t=>(0,$.jsxs)(`div`,{style:{marginBottom:10},children:[(0,$.jsx)(YV,{style:{marginBottom:4},children:(0,$.jsx)(g9,{style:{color:`#64748b`,fontSize:12},children:t.label})}),t.editable?t.type===`boolean`?(0,$.jsx)(x9,{value:s[t.key],onChange:i=>n(m9(r,e.key,o,t.key,i))}):(0,$.jsx)(b9,{value:s[t.key],maxLength:t.maxLength,onChange:i=>n(m9(r,e.key,o,t.key,i))}):(0,$.jsx)(y9,{value:s[t.key]})]},t.key))]},`${e.key}-${o}`)})})]},e.key)},s=e=>e.key in r?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(YV,{style:{marginBottom:8},children:(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),e.editable?(0,$.jsx)(b9,{value:r[e.key],maxLength:e.maxLength,onChange:t=>{let i=f9(r);i[e.key]=t,n(i)}}):(0,$.jsx)(y9,{value:r[e.key]})]},e.key):null;return(0,$.jsx)(`div`,{children:i.map(e=>e.key in r?e.type===`object`?a(e):e.type===`flow`?o(e):s(e):null)})},{Title:Wse,Text:C9}=w1,{TextArea:Gse}=wW;function Kse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var w9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function qse(){let e=Je(),{creatID:t}=Qe(),[n]=Dn(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(`image`),[m,h]=(0,S.useState)({}),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(!1),C=(0,S.useRef)(null),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)({}),[M,N]=(0,S.useState)(``),[P,F]=(0,S.useState)(``),[I,L]=(0,S.useState)(!1),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(5),[W,G]=(0,S.useState)(`16:9`),[K,ee]=(0,S.useState)(`480p`),[q,te]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[ne,re]=(0,S.useState)([]),[ie,J]=(0,S.useState)(0),[ae,oe]=(0,S.useState)([]),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(20),[de,fe]=(0,S.useState)(0),[pe,me]=(0,S.useState)(``),[he,ge]=(0,S.useState)({}),[_e,ve]=(0,S.useState)(!1),[ye,be]=(0,S.useState)([]),[xe,Se]=(0,S.useState)([]),[Ce,we]=(0,S.useState)(!1),[Te,Ee]=(0,S.useState)(``),[De,Oe]=(0,S.useState)(`image`),ke=S.useRef(null);(0,S.useEffect)(()=>{if(Ce&&De===`video`){let e=()=>{ke.current&&ke.current.play().catch(()=>{})};ke.current&&(ke.current.readyState>=2?e():ke.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ke.current&&(ke.current.removeEventListener(`loadedmetadata`,e),ke.current.pause())}}else ke.current&&ke.current.pause()},[Ce,De]);let Ae=(e,t)=>{Ee(e),Oe(t),we(!0)},je=()=>{we(!1),Ee(``),ke.current&&ke.current.pause()},Me=e=>{if(e.preventDefault(),e.stopPropagation(),!Te)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${Te}&download=1`,t.download=De===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Ne=r===`v2`,Pe=(0,S.useMemo)(()=>Ne?[{id:1,title:`素材与项目信息`,description:`固定素材和项目描述`,childId:1},{id:2,title:`生成视频提示词`,description:`生成并确认视频提示词`,childId:4},{id:3,title:`生成最终视频`,description:`使用当前视频提示词生成视频`,childId:5}]:[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}],[Ne]),Fe=(0,S.useMemo)(()=>Pe.map((e,t)=>({...e,status:ye[t]?.status||``,id:ye[t]?.id||t,output:ye[t]?.output||``,input:ye[t]?.input||{},engineId:ye[t]?.input?.payload?.videoConfig?.engineId||``})),[Pe,ye]),Ie=(0,S.useRef)(``);(0,S.useEffect)(()=>{let e=Fe.filter(e=>e.status===`processing`).map(e=>String(e.childId)),t=JSON.stringify(e);t!==Ie.current&&(Ie.current=t,Se(e))},[Fe]);let Le=(e,t,n)=>{R5(e,t,n).then(e=>{e.items&&oe(e.items),e.total!==void 0&&fe(e.total)}).catch(e=>{})},Re=(e,t)=>{ce(e),ue(t),Le(e,t,pe)},ze=()=>{ce(1),Le(1,le,pe)};(0,S.useEffect)(()=>{Le(se,le)},[]),(0,S.useEffect)(()=>{P5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(j({video:t,image:n}),t.length>0){N(t[0].id);let e=t[0];te({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]})}n.length>0&&F(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>{L5().then(e=>{re(e)}).catch(()=>{})},[]);let Be=()=>{let e={};e=ne.find(e=>e.modelConfigId===M&&e.genType===`video`&&e.resolution===K),e||(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(K===`1080p`||K===`720p`||K===`480p`)&&(e.ratio=1.3));let t=(H*e.perSecondCredits+e.baseCredits)*e.ratio,n=he?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=Ne?+!!he?.material?.materialImageUrl:he?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}J(Number(t.toFixed(2)))},Ve=()=>{let e=Fe[1]?.input?.payload?.videoConfig||Fe[1]?.input?.payload?.video_config;if(!e)return 0;let t=e?.engineId||e?.engine_id,n=e?.resolution,r=e?.duration||H,i={};i=ne.find(e=>e.modelConfigId===t&&e.genType===`video`&&e.resolution===n),i||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let a=(r*i.perSecondCredits+i.baseCredits)*i.ratio,o=he?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=Ne?+!!he?.material?.materialImageUrl:he?.videoGeneration?.inputMedia?.image?.length||0;if(s>0){let e=((i.inputImageBaseCredits||0)+(i.inputImagePerImageCredits||0)*s)*(i.inputImageRatio||1);a+=e}return Number(a.toFixed(2))};(0,S.useEffect)(()=>{ne.length>0&&M&&Be()},[ne,M,H,K,he]),(0,S.useEffect)(()=>()=>{C.current&&=(clearInterval(C.current),null)},[]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(L(!1),z(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&(ve(!0),z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{Q.error(e?.message||`加载任务详情失败`)}).finally(()=>{ve(!1)}))},[t,r]),(0,S.useEffect)(()=>{let e=he?.status===`processing`||ye.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(We,15e3):!e&&C.current&&(clearInterval(C.current),C.current=null)},[he?.status,ye,t,r]);let He=(e,t,n,r)=>{p(t||`image`),y(n?String(n):``),t===`video`?(_(r||null),h(e&&typeof e==`object`?Kse(e):{}),l(``)):(_(null),l(e||``),h({})),s(!0)},Ue=async()=>{if(f===`image`){if(!he?.id||!v){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!c||!c.trim()){Q.warning(`图片提示词不能为空`);return}x(!0);try{await dae(he.id,v,{prompt:c.trim()}),Q.success(`图片提示词已保存`),Ge(),s(!1),y(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{x(!1)}return}if(!he?.id||!v){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!m||typeof m!=`object`||Object.keys(m).length===0){Q.warning(`视频提示词不能为空`);return}if(!g){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=h9(m,g);if(e){Q.warning(e);return}x(!0);try{await(Ne?lae:vae)(he.id,v,{prompt_schema:m}),Q.success(`视频提示词已保存`),Ge(),s(!1),y(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{x(!1)}},We=()=>{t&&z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Ge=()=>{t&&z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{Q.error(e?.message||`刷新任务详情失败`)})},Ke=e=>{let t={engine_id:P,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(he.id,e.toString(),t).then(e=>{Q.info(`正在生成图片,请稍候...`),Ge()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},qe=()=>{let e={engine_id:P,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(he.id,Fe[1].id.toString(),e).then(e=>{Q.info(`正在生成图片,请稍候...`),Ge()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ye=e=>{let t={engine_id:M,duration:H,aspect_ratio:W,resolution:K,target_platform:`抖音`};fae(he.id,e.toString(),t).then(e=>{Ge(),Q.info(`正在生成视频提示词,请稍候...`)}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Xe=async(e,t)=>{try{Ne?await uae(he.id,String(e)):await pae(he.id,String(e),{engine_id:t||``}),Q.info(`正在生成视频,请稍候...`),Ge()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)}},Ze=async()=>{let e=Ne?Fe[1]:Fe[3];e?.id&&await Xe(e.id,e.engineId||``)},$e=async e=>{if(!(!Ne||!he?.id||!e||!M))try{await cae(he.id,e,{video_config:{engine_id:M,duration:H,aspect_ratio:W,resolution:K}}),Q.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Ge()}catch(e){Q.error(e?.message||`重新生成视频提示词失败`)}};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[_e&&(0,$.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`linear-gradient(135deg, rgba(250, 248, 255, 0.95) 0%, rgba(245, 243, 255, 0.95) 50%, rgba(240, 249, 255, 0.95) 100%)`,backdropFilter:`blur(12px)`,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:20,opacity:1,transition:`opacity 0.3s ease`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:60,height:60,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,border:`2px solid rgba(99, 102, 241, 0.08)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,border:`2px solid transparent`,borderTopColor:`#6366f1`,borderRightColor:`#8b5cf6`,borderRadius:`50%`,animation:`spinSlow 0.8s linear infinite`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:40,height:40,border:`2px solid transparent`,borderBottomColor:`#a855f7`,borderLeftColor:`#c084fc`,borderRadius:`50%`,animation:`spinSlow 1.2s linear infinite reverse`}}),(0,$.jsx)(`div`,{style:{width:8,height:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,borderRadius:`50%`,boxShadow:`0 0 12px rgba(99, 102, 241, 0.6)`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:16,color:`#4f46e5`,fontWeight:600,letterSpacing:.5},children:`加载中`}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:400},children:`正在获取任务详情...`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:4,marginTop:8},children:[0,1,2].map(e=>(0,$.jsx)(`div`,{style:{width:4,height:4,background:`#a5b4fc`,borderRadius:`50%`,animation:`spinSlow ${.8+e*.2}s ease-in-out infinite`,animationDelay:`${e*.15}s`}},e))})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>e(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>d(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:he?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>he?.material?.materialVideoUrl&&Ae(he.material.materialVideoUrl,`video`),children:he?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:w9(he.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:he?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>he?.material?.materialImageUrl&&Ae(he.material.materialImageUrl,`image`),children:he?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:w9(he.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),(0,$.jsx)(`div`,{style:{margin:`20px 0`,height:1,background:`linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent)`,borderRadius:.5}}),he?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Ae(he.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),he?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsxs)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`,position:`relative`},onClick:()=>Ae(he.finalVideoUrl,`video`),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(a_,{activeKey:xe,onChange:Se,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Fe.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(u4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(C9,{style:{color:`#475569`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:he?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:w9(he.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(C9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:10,background:`#f1f5f9`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:he?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:w9(he.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`原产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.sourceProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`自有产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.targetProjectName||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`产品卖点:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.coreContentPoint||`-`})]})]})]}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(C9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>He(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(Z,{onClick:()=>{Ke(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[he.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>qe(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),!Ne&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{L(!I),z(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(C9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:A.video?.find(e=>e.id===M)?.name||`选择引擎`})]}),I&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:A.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{N(e.id),te({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(W)||G(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(K)||ee(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(H)||U(e.supportedDurations?.[0]||5),L(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:M===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:M===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:M===e.id?600:500,color:M===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{z(!R),L(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(C9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[W,` · `,H,`s · `,K]})]}),R&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:q.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>G(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:W===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:W===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 ${W===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:W===e?`#6366f1`:`#6b7280`,fontWeight:W===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(C9,{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:`${(H-Math.min(...q.durations))/(Math.max(...q.durations)-Math.min(...q.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...q.durations),max:Math.max(...q.durations),value:H,onChange:e=>U(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:H}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:q.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ee(e),style:{flex:1,height:42,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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:K===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let e=Fe[1]?.input?.payload?.videoConfig||Fe[1]?.input?.payload?.video_config,t=e?.engineId||e?.engine_id,n=t?(A.video||[]).find(e=>String(e.id)===String(t))?.name:``;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`引擎:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:n||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`比例:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.aspectRatio||e?.aspect_ratio||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`分辨率:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.resolution||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`时长:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.duration||`-`})]})]})})()})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>He(he?.videoGeneration?.promptSchema,`video`,e.id,he?.videoGeneration?.schemaConfigSnapshot),style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!he?.videoGeneration?.promptSchema||!he?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),Ne&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let t=Ve();if((i?.credits||0){let e=Ve();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${he?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:f===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:o,onCancel:()=>{b||s(!1)},footer:[(0,$.jsx)(Z,{onClick:()=>s(!1),disabled:b,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(Z,{type:`primary`,onClick:Ue,loading:b,disabled:b,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:f===`image`?(0,$.jsx)(Gse,{value:c,onChange:e=>l(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(S9,{value:m,schemaConfigSnapshot:g,onChange:h})})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:u,onCancel:()=>d(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:pe,onChange:e=>me(e.target.value),onPressEnter:ze,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:ze,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,render:e=>{if(!e)return`-`;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}},{title:`操作`,key:`action`,align:`center`,render:(t,n)=>(0,$.jsx)(`button`,{onClick:()=>{d(!1),e(`/initial/${n.id}/initialinfo?flow_version=${n.flowVersion===`v2`?`v2`:`v1`}`)},style:{color:`#6366f1`,textDecoration:`none`,fontSize:12,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`,fontWeight:500},children:`查看详情`})}],dataSource:ae,rowKey:`id`,pagination:{current:se,pageSize:le,total:de,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Re},style:{fontSize:13},scroll:{y:350}})]}),(0,$.jsx)(nK,{open:Ce,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:je,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:Me,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:De===`image`?(0,$.jsx)(`img`,{src:Te.startsWith(`http`)?Te:`https://ceshi.apiforeign.minzhongzc.com${Te}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ke,src:Te.startsWith(`http`)?Te:`https://ceshi.apiforeign.minzhongzc.com${Te}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(nK,{open:w,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#6366f1`,letterSpacing:.4},children:`重新生成视频提词`})]}),onCancel:()=>T(!1),width:400,footer:null,centered:!0,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(HC,{value:M,onChange:e=>{let t=A.video?.find(t=>t.id===e);t&&(N(t.id),te({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]}),t.supportedRatios?.includes(W)||G(t.supportedRatios?.[0]||`16:9`),t.supportedResolutions?.includes(K)||ee(t.supportedResolutions?.[0]||`720p`),t.supportedDurations?.includes(H)||U(t.supportedDurations?.[0]||5))},style:{width:`100%`,borderRadius:8},options:A.video?.map(e=>({value:e.id,label:e.name})),placeholder:`请选择引擎`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:q.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>G(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:W===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:W===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 ${W===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:W===e?`#6366f1`:`#6b7280`,fontWeight:W===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(H-Math.min(...q.durations))/(Math.max(...q.durations)-Math.min(...q.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...q.durations),max:Math.max(...q.durations),value:H,onChange:e=>U(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:H}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:q.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ee(e),style:{flex:1,height:42,borderRadius:8,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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:K===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(Z,{onClick:()=>T(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(Z,{onClick:()=>{if(!M){Q.warning(`请选择视频引擎`);return}$e(E),T(!1)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:!M,children:`确认生成`})]})]})})]})}var Jse={not_required:{label:`无需单独分析`,color:`default`,active:!1,terminal:!0,failure:!1},pending:{label:`等待分析`,color:`default`,active:!0,terminal:!1,failure:!1},processing:{label:`分析中`,color:`processing`,active:!0,terminal:!1,failure:!1},completed:{label:`分析完成`,color:`success`,active:!1,terminal:!0,failure:!1},failed:{label:`分析失败`,color:`error`,active:!1,terminal:!0,failure:!0}},Yse={pending:{label:`等待切割`,color:`default`,active:!0,terminal:!1,failure:!1},processing:{label:`切割中`,color:`processing`,active:!0,terminal:!1,failure:!1},retry_waiting:{label:`等待切割重试`,color:`warning`,active:!0,terminal:!1,failure:!1},completed:{label:`切割完成`,color:`success`,active:!1,terminal:!0,failure:!1},failed:{label:`切割失败`,color:`error`,active:!1,terminal:!0,failure:!0}},Xse={pending_analysis:{label:`等待分析`,color:`default`,active:!0,terminal:!1,failure:!1},analyzing:{label:`分析中`,color:`processing`,active:!0,terminal:!1,failure:!1},analysis_completed:{label:`分析完成`,color:`blue`,active:!1,terminal:!1,failure:!1},analysis_failed:{label:`分析失败`,color:`error`,active:!1,terminal:!0,failure:!0},splitting:{label:`拆镜中`,color:`processing`,active:!0,terminal:!1,failure:!1},split_completed:{label:`拆镜完成`,color:`success`,active:!1,terminal:!0,failure:!1},partial_failed:{label:`部分失败`,color:`warning`,active:!1,terminal:!0,failure:!0},failed:{label:`失败`,color:`error`,active:!1,terminal:!0,failure:!0},deleted:{label:`已删除`,color:`default`,active:!1,terminal:!0,failure:!1}},Zse=new Set([`pending`,`waiting_user`,`processing`]),T9=e=>String(e||``).trim().toLowerCase(),E9=(e,t,n)=>({key:e,...t[e]||{label:e||n,color:`default`,active:!1,terminal:!1,failure:!1}}),D9=e=>E9(T9(e),Jse,`未知分析状态`),O9=e=>E9(T9(e),Yse,`未知切割状态`),k9=e=>E9(T9(e),Xse,`未知任务状态`),Qse=e=>{let t=T9(e.analysisStatus||e.analysis_status),n=T9(e.splitStatus||e.split_status),r=T9(e.moduleProjectStatus||e.module_project_status);return D9(t).active||O9(n).active||Zse.has(r)},$se=e=>{let t=k9(e);return(0,$.jsx)(qQ,{color:t.color,children:t.label})};function ece(){let{message:e}=rx.useApp(),t=Je(),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)([]),[v,y]=(0,S.useState)(1),[b,x]=(0,S.useState)(10),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(``),D=(0,S.useRef)(null),O=(0,S.useRef)(null),k=(0,S.useCallback)(()=>{n&&n.startsWith(`blob:`)&&URL.revokeObjectURL(n),r(``),a(``),s(``),p(0),d(``)},[n]),A=async t=>{if(!t.type.startsWith(`video/`))return s(`请选择视频文件`),!1;if(t.size>100*1024*1024)return s(`视频文件大小不能超过 100MB`),!1;let n=await new Promise(e=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{e(n.duration),URL.revokeObjectURL(n.src)},n.onerror=()=>{e(0)},n.src=URL.createObjectURL(t)});if(n>190)return s(`视频时长不能超过 3分钟`),!1;k(),h(!0);try{let i=await qie(t,n);r(i.url),a(i.resource_id||``),s(``),e.success(`视频上传成功`)}catch{s(`视频上传失败,请重试`),e.error(`视频上传失败`)}finally{h(!1)}return!1},j=(0,S.useCallback)(()=>{D.current&&p(D.current.duration)},[]),M=async()=>{if(!n||!u.trim()){e.warning(`请先上传视频并输入产品名称`);return}h(!0);try{await yae({video_url:n,video_duration_seconds:f,video_resource_id:i||void 0,title:u.trim(),idempotency_key:`shot_${Date.now()}`});let r=await K5(1,20,T);e.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${r.items[0].id}/removeinfo`)},3e3),k()}catch(t){let n=``;t instanceof Error?n=t.message:typeof t==`string`&&(n=t),e.error(n||`任务创建失败,请重试`)}finally{h(!1)}},N=(0,S.useCallback)(async(t,n,r)=>{try{let e=await K5(t,n,r);_(e.items||[]),w(e.total||0),y(t),x(n)}catch{e.error(`获取列表失败`)}},[]),P=(e,t)=>{N(e,t,T)},F=()=>{N(1,10,T)},I=()=>{l(!0),N(1,10,T)},L=g.some(e=>k9(e.status).active);return(0,S.useEffect)(()=>{if(!c||!L)return;let e=()=>{document.visibilityState===`visible`&&N(v,b,T)},t=window.setInterval(e,3e4);return document.addEventListener(`visibilitychange`,e),()=>{window.clearInterval(t),document.removeEventListener(`visibilitychange`,e)}},[v,N,L,c,b,T]),(0,$.jsx)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,overflow:`auto`,background:`transparent`,position:`relative`,padding:`20px 32px`},children:(0,$.jsxs)(`div`,{style:{maxWidth:1200,margin:`0 auto`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`})]})}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,icon:(0,$.jsx)(eH,{}),onClick:I,style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`创作记录`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:720,margin:`0 auto`},children:[o&&(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(239, 68, 68, 0.2)`,borderRadius:12,padding:`14px 20px`,marginBottom:24,color:`#ef4444`,fontSize:14,textAlign:`center`,fontWeight:500},children:o}),!n&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(v0.Dragger,{accept:`video/*`,beforeUpload:A,showUploadList:!1,disabled:m,style:{background:m?`rgba(243, 244, 246, 0.3)`:`transparent`,border:`2px dashed ${m?`rgba(209, 213, 219, 0.5)`:`rgba(99, 102, 241, 0.3)`}`,borderRadius:24,padding:`56px 20px`,cursor:m?`not-allowed`:`pointer`,margin:0},children:m?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,border:`4px solid #6366f1`,borderTopColor:`transparent`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#6366f1`,margin:`0 0 8px 0`,fontWeight:600},children:`上传中...`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`请稍候,视频正在上传`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(S4,{style:{fontSize:40,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#1e293b`,margin:`0 0 8px 0`,fontWeight:600},children:`点击或拖拽到此上传视频文件`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`支持 MP4、MOV 格式视频,最大支持 100MB 的文件,支持上传 3 分钟内的视频`})]})})]}),n&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,overflow:`hidden`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{borderRadius:22,background:`#ffffff`,padding:`24px`,position:`relative`,zIndex:1},children:[(0,$.jsx)(oK,{title:`确定要删除吗?`,okText:`确定`,cancelText:`取消`,onConfirm:k,children:(0,$.jsx)(`button`,{style:{position:`absolute`,top:20,right:20,width:36,height:36,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.05)`,borderRadius:10,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16,color:`#6366f1`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.borderColor=`rgba(239, 68, 68, 0.3)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.color=`#6366f1`},children:`🗑️`})}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginBottom:20},children:(0,$.jsx)(`video`,{ref:D,src:`https://ceshi.apiforeign.minzhongzc.com${n}`,controls:!0,onLoadedMetadata:j,style:{maxWidth:`100%`,maxHeight:320,borderRadius:12,background:`#000`,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`}})}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsxs)(`label`,{style:{display:`block`,fontSize:14,fontWeight:500,color:`#334155`,marginBottom:8},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(wW,{placeholder:`请输入产品名称`,value:u,onChange:e=>d(e.target.value),style:{width:`100%`,height:44,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`}})]}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginTop:16},children:(0,$.jsx)(`button`,{onClick:M,disabled:!n||!u.trim()||m,style:{padding:`14px 56px`,background:n&&u.trim()&&!m?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`:`#e2e8f0`,color:`white`,border:`none`,borderRadius:12,fontSize:15,fontWeight:600,cursor:n&&u.trim()&&!m?`pointer`:`not-allowed`,boxShadow:n&&u.trim()&&!m?`0 6px 20px rgba(99, 102, 241, 0.3)`:`none`,display:`inline-flex`,alignItems:`center`,gap:10,transition:`all 0.3s ease`},onMouseEnter:e=>{n&&u.trim()&&!m&&(e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 8px 25px rgba(99, 102, 241, 0.4)`)},onMouseLeave:e=>{n&&u.trim()&&!m&&(e.currentTarget.style.transform=`traslnateY(0)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.3)`)},children:(0,$.jsx)(`span`,{children:m?`创建中...`:`创建`})})})]})]}),(0,$.jsx)(`canvas`,{ref:O,style:{display:`none`}}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:c,onCancel:()=>l(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:T,onChange:e=>E(e.target.value),onPressEnter:F,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:F,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`状态`,dataIndex:`status`,key:`status`,render:e=>$se(e)},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:n=>(0,$.jsxs)(YV,{children:[(0,$.jsx)(Z,{type:`text`,onClick:()=>t(`/removelens/${n.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`}),(0,$.jsx)(oK,{title:`确认删除这个拆镜项目吗?`,onConfirm:async()=>{try{await Iae(n.id),e.success(`删除成功`),N(v,b,T)}catch{e.error(`删除失败`)}},children:(0,$.jsx)(Z,{type:`text`,danger:!0,style:{color:`#ef4444`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(239, 68, 68, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`},children:`删除`})})]})}],dataSource:g,rowKey:`id`,pagination:{current:v,pageSize:b,total:C,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:P,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:300},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})})]})]})]})})}var tce=c(o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` + `})]}):e===`failed`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#ef4444`},children:`失败`}):e===`completed`&&t.finalVideoUrl?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#10b981`},children:`任务完成`}):null})()]})]})]},t.id))}),(0,$.jsx)(`div`,{style:{paddingTop:20,paddingBottom:20,display:`flex`,justifyContent:`center`},children:(0,$.jsx)(uG,{current:h,pageSize:_,total:y,onChange:we,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:h===1?`#f9fafb`:`#fff`,cursor:h===1?`not-allowed`:`pointer`,color:h===1?`#d1d5db`:`#6b7280`,fontSize:14},disabled:h===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:h>=Math.ceil(y/_)?`#f9fafb`:`#fff`,cursor:h>=Math.ceil(y/_)?`not-allowed`:`pointer`,color:h>=Math.ceil(y/_)?`#d1d5db`:`#6b7280`,fontSize:14},disabled:h>=Math.ceil(y/_),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:6,background:e===h?`#6366f1`:`#fff`,color:e===h?`#fff`:`#374151`,fontWeight:e===h?500:400,cursor:`pointer`,fontSize:14},children:e}):n})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:`40px`},children:[(0,$.jsxs)(`div`,{style:{width:120,height:120,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:24,position:`relative`},children:[(0,$.jsx)(`div`,{style:{width:60,height:60,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:20,position:`absolute`,bottom:0,right:10}}),(0,$.jsx)(`div`,{style:{width:50,height:50,border:`2px solid rgba(99, 102, 241, 0.2)`,borderRadius:16,position:`absolute`,top:0,left:10}}),(0,$.jsx)(`div`,{style:{width:56,height:56,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:18,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.25)`},children:(0,$.jsx)(X8,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`,marginBottom:8},children:`暂无生成内容`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#64748b`,textAlign:`center`,padding:`0 40px`,lineHeight:1.6},children:`请完善素材与卖点,生成专属爆款复刻视频`})]})})]}),(0,$.jsx)(`div`,{className:`replication-form`,style:{overflow:`auto`,width:`30%`,background:`transparent`,backdropFilter:`blur(20px)`,borderRadius:20,position:`relative`,zIndex:10,scrollbarWidth:`none`},children:(0,$.jsxs)(`div`,{className:`replication-form-content`,style:{width:`100%`,height:`100%`,background:`rgba(258, 250, 252, 0.2)`,padding:24,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:[`上传复刻视频`,(0,$.jsx)(`span`,{style:{color:`#f94444`},children:`(必选)`})]}),A?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`video`,{src:r9(A),controls:!0,style:{width:`100%`,borderRadius:12,maxHeight:200,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:Ae,style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(X8,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:O?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,O?.size?(O.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(v0,{style:{width:`100%`},beforeUpload:Oe,showUploadList:!1,accept:`video/mp4,video/quicktime,.mp4,.mov`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:24,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:H?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:40,height:40,margin:`0 auto 12px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:48,height:48,margin:`0 auto 12px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(X8,{style:{fontSize:24,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`点击或拖拽上传视频`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:[`上传产品图片`,(0,$.jsx)(`span`,{children:`(可选)`})]}),R?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`img`,{src:r9(R),alt:`产品图片`,style:{width:`100%`,borderRadius:12,maxHeight:200,objectFit:`contain`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:je,style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(L6,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:I?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,I?.size?(I.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,uploading:W,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&ke(e[0])},onHistorySelect:e=>{let t=e[0];t&&(L(null),z(t.resourceUrl||t.previewUrl||t.displayUrl||``),V(t.id),Q.success(`历史图片已选择`))},children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:20,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:W?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:36,height:36,margin:`0 auto 10px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:44,height:44,margin:`0 auto 10px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:14,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(L6,{style:{fontSize:22,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`+ 点击上传`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:[`原产品名称`,(0,$.jsx)(`span`,{children:`(可选)`})]}),(0,$.jsx)(wW,{value:x,onChange:e=>C(e.target.value),placeholder:`请输入原产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[x.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:[`自有产品名称`,(0,$.jsx)(`span`,{children:`(可选)`})]}),(0,$.jsx)(wW,{value:w,onChange:e=>T(e.target.value),placeholder:`请输入自有产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[w.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:[`产品卖点`,(0,$.jsx)(`span`,{children:`(可选)`})]}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(Rse,{value:E,onChange:e=>D(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:10,fontSize:13,height:80,resize:`none`,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},rows:3,maxLength:30}),(0,$.jsxs)(`span`,{style:{position:`absolute`,right:10,bottom:8,color:`#94a3b8`,fontSize:12},children:[E.length,`/30`]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`grid`,gap:10},children:[(0,$.jsxs)(`p`,{style:{margin:0,fontSize:13,fontWeight:600,color:`#475569`},children:[`视频生成参数`,(0,$.jsx)(`span`,{style:{color:`#f94444`},children:`(必选)`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{ce(!se),ue(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:K.find(e=>e.id===q)?.name||`选择引擎`})]}),se&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:300,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:300,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:K.filter(e=>e.supportsUniversalReference!==!1).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{te(e.id),fe({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(ie)||J(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(ae)||oe(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(ne)||re(e.supportedDurations?.[0]||5),ce(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:q===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e.id?600:500,color:q===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{ue(!le),ce(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[ie,` · `,ne,`s · `,ae]})]}),le&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:320,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:de.ratios.map(e=>{let[t,n]=e.split(`:`).map(Number),r=t>=n?18:Math.round(t/n*18),i=n>=t?18:Math.round(n/t*18);return(0,$.jsxs)(`button`,{onClick:()=>J(e),style:{flex:`0 0 calc(12.5% - 4px)`,minWidth:44,height:52,borderRadius:6,border:ie===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ie===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:r,height:i,border:`2px solid ${ie===e?`#6366f1`:`#9ca3af`}`,borderRadius:3,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:ie===e?`#6366f1`:`#6b7280`,fontWeight:ie===e?600:400},children:e})]},e)})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(ne-Math.min(...de.durations))/(Math.max(...de.durations)-Math.min(...de.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...de.durations),max:Math.max(...de.durations),value:ne,onChange:e=>re(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:ne}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:de.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>oe(e),style:{flex:1,height:42,borderRadius:8,border:ae===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:ae===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:ae===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]})]}),(0,$.jsx)(jw,{title:(t?.credits||0){if((t?.credits||0)ge(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:d,onChange:e=>f(e.target.value),onPressEnter:De,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:De,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`,width:100,render:e=>(0,$.jsx)(`span`,{style:{fontSize:13,color:`#1e293b`,fontWeight:500},children:e||`-`})},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,width:220,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#64748b`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#64748b`}})();return(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,width:200,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,width:220,render:(t,n)=>(0,$.jsxs)(YV,{children:[(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo?flow_version=${n.flowVersion===`v2`?`v2`:`v1`}`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},children:`查看详情`}),(0,$.jsx)(oK,{title:`确认删除这个爆款开头复刻任务吗?`,onConfirm:async()=>{try{await Lae(n.id,n.flowVersion),Q.success(`删除成功`),Te(1,s,!1,d)}catch{Q.error(`删除失败`)}},children:(0,$.jsx)(`button`,{style:{color:`#ef4444`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(239, 68, 68, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.08)`},children:`删除`})})]})}],dataSource:r,rowKey:`id`,pagination:{current:a,pageSize:s,total:l,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Ee,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:a===1?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:a===1?`not-allowed`:`pointer`,color:a===1?`#94a3b8`:`#6366f1`,fontSize:14},disabled:a===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:a>=Math.ceil(l/s)?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:a>=Math.ceil(l/s)?`not-allowed`:`pointer`,color:a>=Math.ceil(l/s)?`#94a3b8`:`#6366f1`,fontSize:14},disabled:a>=Math.ceil(l/s),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:8,background:e===a?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#fff`,color:e===a?`#fff`:`#475569`,fontWeight:e===a?600:400,cursor:`pointer`,fontSize:14},children:e}):n},style:{fontSize:13},scroll:{y:350}})})})]})]})};function i9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function a9(e,...t){for(let n of t){let t=e[n];if(t!=null&&String(t).trim()!==``)return String(t)}return``}function o9(e,t,...n){for(let t of n){let n=e[t];if(n===!0||n===!1)return n;if(n===`true`)return!0;if(n===`false`)return!1}return t}function Hse(e,...t){for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e)&&e>0)return e}}}function s9(e){if(!i9(e))return null;let t=a9(e,`key`);return t?{key:t,label:a9(e,`label`)||t,type:a9(e,`type`)||void 0,enabled:o9(e,!0,`enabled`),editable:o9(e,!0,`editable`),maxLength:Hse(e,`maxLength`,`max_length`)}:null}function c9(e){if(!i9(e))return null;let t=e.data;return i9(t)?t:Array.isArray(e.sections)?e:null}function Use(e){return!!c9(e)}function l9(e){let t=c9(e);return(Array.isArray(t?.sections)?t.sections:[]).map(e=>{let t=s9(e);if(!t||!i9(e))return null;let n=Array.isArray(e.children)?e.children.map(s9).filter(Boolean):[],r=Array.isArray(e.itemFields)?e.itemFields.map(s9).filter(Boolean):Array.isArray(e.item_fields)?e.item_fields.map(s9).filter(Boolean):[];return{...t,contentKey:a9(e,`contentKey`,`content_key`)||void 0,children:n,itemFields:r}}).filter(e=>!!e&&e.enabled)}function u9(e){if(e==null)return``;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function d9(e){let t=u9(e);return t.length>40||t.includes(` +`)||t.includes(`,`)||t.includes(`。`)||t.includes(`;`)||t.includes(`;`)}function f9(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function p9(e,t,n,r){let i=f9(e||{});return i9(i[t])||(i[t]={}),i[t][n]=r,i}function m9(e,t,n,r,i){let a=f9(e||{});return Array.isArray(a[t])||(a[t]=[]),i9(a[t][n])||(a[t][n]={}),a[t][n][r]=i,a}function h9(e,t){if(!i9(e))return`视频提示词不能为空`;let n=l9(t);if(!n.length)return`视频提词配置缺失,无法保存`;for(let t of n){if(!t.editable)continue;let n=e[t.key];if(t.type===`object`){if(!i9(n))continue;for(let e of t.children)if(!(!e.enabled||!e.editable||!e.maxLength)&&u9(n[e.key]).length>e.maxLength)return`字段【${t.label}.${e.label}】长度不能超过 ${e.maxLength} 个字符`;continue}if(t.type===`flow`){if(!Array.isArray(n))continue;for(let e=0;en.maxLength)return`字段【${t.label} 第 ${e+1} 项.${n.label}】长度不能超过 ${n.maxLength} 个字符`}}continue}if(t.editable&&t.maxLength&&u9(n).length>t.maxLength)return`字段【${t.label}】长度不能超过 ${t.maxLength} 个字符`}return null}var{Text:g9}=w1,{TextArea:_9}=wW;function v9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function y9({value:e}){let t=e===`true`?`是`:e===`false`?`否`:u9(e);return d9(e)?(0,$.jsx)(_9,{value:t,rows:Math.min(6,Math.max(2,Math.ceil(t.length/42))),disabled:!0,style:{borderRadius:10,color:`#64748b`,border:`1px solid #e2e8f0`,background:`#f8fafc`}}):(0,$.jsx)(wW,{value:t,disabled:!0,style:{borderRadius:10,color:`#64748b`,border:`1px solid #e2e8f0`,background:`#f8fafc`}})}function b9({value:e,maxLength:t,onChange:n}){let r=u9(e),i={value:r,maxLength:t,showCount:!!t,onChange:e=>n(e.target.value),style:{borderRadius:10,border:`1px solid #e2e8f0`,transition:`all 0.2s ease`}};return d9(e)?(0,$.jsx)(_9,{...i,rows:Math.min(8,Math.max(3,Math.ceil(r.length/42)))}):(0,$.jsx)(wW,{...i})}function x9({value:e,onChange:t}){let n=e===!0||e===`true`;return(0,$.jsxs)(eI.Group,{value:n,onChange:e=>t(e.target.value),style:{display:`flex`,gap:24},children:[(0,$.jsx)(eI,{value:!0,style:{fontSize:14,color:`#475569`},children:`是`}),(0,$.jsx)(eI,{value:!1,style:{fontSize:14,color:`#475569`},children:`否`})]})}var S9=({value:e,schemaConfigSnapshot:t,onChange:n})=>{let r=v9(e)?e:{},i=l9(t),[a,o]=(0,S.useState)(``),s=(0,S.useRef)(null),c=e=>{o(e.key);let t=document.getElementById(`section-${e.key}`);if(t&&s.current){let e=s.current.getBoundingClientRect(),n=t.getBoundingClientRect().top-e.top+s.current.scrollTop;s.current.scrollTo({top:n,behavior:`smooth`})}};if((0,S.useEffect)(()=>{let e=i.filter(e=>e.key in r);e.length>0&&!a&&o(e[0].key)},[i,r,a]),(0,S.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=t.height/2,s=``,c=1/0;for(let e of i){if(!(e.key in r))continue;let i=document.getElementById(`section-${e.key}`);if(!i)continue;let a=i.getBoundingClientRect(),o=a.top,l=a.bottom;if(l>t.top&&o{e.removeEventListener(`scroll`,t)}},[i,r]),!Use(t))return(0,$.jsxs)(YV,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,$.jsx)(qf,{type:`warning`,showIcon:!0,message:`视频提词配置缺失,暂不能编辑`,description:`请刷新详情后重试;如果仍然缺失,请联系管理员排查第4步 schema_config_snapshot 返回。`}),Object.keys(r).length?(0,$.jsx)(`pre`,{style:{margin:0,padding:12,borderRadius:10,background:`#f8fafc`,maxHeight:420,overflow:`auto`,color:`#475569`},children:JSON.stringify(r,null,2)}):null]});if(!i.length)return(0,$.jsx)(qf,{type:`warning`,showIcon:!0,message:`视频提词配置为空`,description:`当前 Schema 配置没有可展示字段。`});let l=e=>{let t=v9(r[e.key])?r[e.key]:{},i=e.children.filter(e=>e.enabled);return i.length?(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:3,height:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:14,fontWeight:600},children:e.label})]}),(0,$.jsx)(`div`,{style:{padding:`16px`,backgroundColor:`#fff`,borderRadius:12,border:`1px solid #e2e8f0`,boxShadow:`0 2px 8px rgba(0,0,0,0.04)`},children:i.map(i=>(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{marginBottom:6},children:(0,$.jsx)(g9,{style:{color:`#64748b`,fontSize:12},children:i.label})}),i.editable?i.type===`boolean`?(0,$.jsx)(x9,{value:t[i.key],onChange:t=>n(p9(r,e.key,i.key,t))}):(0,$.jsx)(b9,{value:t[i.key],maxLength:i.maxLength,onChange:t=>n(p9(r,e.key,i.key,t))}):(0,$.jsx)(y9,{value:t[i.key]})]},i.key))})]},e.key):null},u=e=>{let t=Array.isArray(r[e.key])?r[e.key]:[],i=[{key:`时间段`,label:`时间段`,enabled:!0,editable:!1},...e.itemFields.filter(e=>e.enabled)];return(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:3,height:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:14,fontWeight:600},children:e.label}),(0,$.jsx)(qQ,{style:{borderRadius:4,fontSize:11,padding:`2px 8px`,background:`#f1f5f9`,color:`#64748b`,border:`none`},children:`锁定条目和时间段`})]}),(0,$.jsx)(`div`,{style:{padding:`16px`,backgroundColor:`#fff`,borderRadius:12,border:`1px solid #e2e8f0`,boxShadow:`0 2px 8px rgba(0,0,0,0.04)`},children:t.length===0?(0,$.jsx)(g9,{style:{color:`#94a3b8`,fontSize:12},children:`暂无内容`}):t.map((a,o)=>{let s=v9(a)?a:{};return(0,$.jsxs)(`div`,{style:{marginBottom:o===t.length-1?0:16,paddingBottom:o===t.length-1?0:16,borderBottom:o===t.length-1?`none`:`1px dashed #e2e8f0`},children:[(0,$.jsxs)(g9,{strong:!0,style:{display:`block`,marginBottom:10,color:`#475569`,fontSize:13},children:[`第 `,o+1,` 段`]}),i.map(t=>(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsx)(`div`,{style:{marginBottom:6},children:(0,$.jsx)(g9,{style:{color:`#64748b`,fontSize:12},children:t.label})}),t.editable?t.type===`boolean`?(0,$.jsx)(x9,{value:s[t.key],onChange:i=>n(m9(r,e.key,o,t.key,i))}):(0,$.jsx)(b9,{value:s[t.key],maxLength:t.maxLength,onChange:i=>n(m9(r,e.key,o,t.key,i))}):(0,$.jsx)(y9,{value:s[t.key]})]},t.key))]},`${e.key}-${o}`)})})]},e.key)},d=e=>e.key in r?(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:3,height:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(g9,{strong:!0,style:{color:`#334155`,fontSize:14,fontWeight:600},children:e.label})]}),(0,$.jsx)(`div`,{style:{padding:`16px`,backgroundColor:`#fff`,borderRadius:12,border:`1px solid #e2e8f0`,boxShadow:`0 2px 8px rgba(0,0,0,0.04)`},children:e.editable?(0,$.jsx)(b9,{value:r[e.key],maxLength:e.maxLength,onChange:t=>{let i=f9(r);i[e.key]=t,n(i)}}):(0,$.jsx)(y9,{value:r[e.key]})})]},e.key):null,f=i.filter(e=>e.key in r).map(e=>({key:e.key,label:e.label})),p=e=>e.key in r?e.type===`object`?l(e):e.type===`flow`?u(e):d(e):null;return(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,maxHeight:500},children:[(0,$.jsx)(`div`,{style:{width:180,flexShrink:0,background:`#fff`,borderRight:`1px solid #e2e8f0`,overflowY:`auto`},children:(0,$.jsx)(zE,{mode:`inline`,selectedKeys:[a],onClick:c,style:{height:`100%`,borderRight:0},theme:`light`,items:f.map(e=>({...e,style:{borderRadius:8,margin:`4px 8px`,padding:`8px 12px`,color:`#64748b`,fontSize:13,transition:`all 0.2s ease`,maxHeight:500}}))})}),(0,$.jsx)(`div`,{ref:s,style:{flex:1,padding:`20px`,overflowY:`auto`,background:`#f8fafc`},children:i.map(e=>(0,$.jsx)(`div`,{id:`section-${e.key}`,children:p(e)},e.key))})]})},{Title:Wse,Text:C9}=w1,{TextArea:Gse}=wW;function Kse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var w9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function qse(){let e=Je(),{creatID:t}=Qe(),[n]=Dn(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(`image`),[m,h]=(0,S.useState)({}),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(!1),C=(0,S.useRef)(null),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)({}),[M,N]=(0,S.useState)(``),[P,F]=(0,S.useState)(``),[I,L]=(0,S.useState)(!1),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(5),[W,G]=(0,S.useState)(`16:9`),[K,ee]=(0,S.useState)(`480p`),[q,te]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[ne,re]=(0,S.useState)([]),[ie,J]=(0,S.useState)(0),[ae,oe]=(0,S.useState)([]),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(20),[de,fe]=(0,S.useState)(0),[pe,me]=(0,S.useState)(``),[he,ge]=(0,S.useState)({}),[_e,ve]=(0,S.useState)(!1),[ye,be]=(0,S.useState)([]),[xe,Se]=(0,S.useState)([]),[Ce,we]=(0,S.useState)(!1),[Te,Ee]=(0,S.useState)(``),[De,Oe]=(0,S.useState)(`image`),ke=S.useRef(null);(0,S.useEffect)(()=>{if(Ce&&De===`video`){let e=()=>{ke.current&&ke.current.play().catch(()=>{})};ke.current&&(ke.current.readyState>=2?e():ke.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ke.current&&(ke.current.removeEventListener(`loadedmetadata`,e),ke.current.pause())}}else ke.current&&ke.current.pause()},[Ce,De]);let Ae=(e,t)=>{Ee(e),Oe(t),we(!0)},je=()=>{we(!1),Ee(``),ke.current&&ke.current.pause()},Me=e=>{if(e.preventDefault(),e.stopPropagation(),!Te)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${Te}&download=1`,t.download=De===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Ne=r===`v2`,Pe=(0,S.useMemo)(()=>Ne?[{id:1,title:`素材与项目信息`,description:`固定素材和项目描述`,childId:1},{id:2,title:`生成视频提示词`,description:`生成并确认视频提示词`,childId:4},{id:3,title:`生成最终视频`,description:`使用当前视频提示词生成视频`,childId:5}]:[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}],[Ne]),Fe=(0,S.useMemo)(()=>Pe.map((e,t)=>({...e,status:ye[t]?.status||``,id:ye[t]?.id||t,output:ye[t]?.output||``,input:ye[t]?.input||{},engineId:ye[t]?.input?.payload?.videoConfig?.engineId||``,errorMessage:ye[t]?.errorMessage||``})),[Pe,ye]),Ie=(0,S.useRef)(``);(0,S.useEffect)(()=>{let e=Fe.filter(e=>e.status===`processing`).map(e=>String(e.childId)),t=JSON.stringify(e);t!==Ie.current&&(Ie.current=t,Se(e))},[Fe]);let Le=(e,t,n)=>{R5(e,t,n).then(e=>{e.items&&oe(e.items),e.total!==void 0&&fe(e.total)}).catch(e=>{})},Re=(e,t)=>{ce(e),ue(t),Le(e,t,pe)},ze=()=>{ce(1),Le(1,le,pe)};(0,S.useEffect)(()=>{Le(se,le)},[]),(0,S.useEffect)(()=>{P5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(j({video:t,image:n}),t.length>0){N(t[0].id);let e=t[0];te({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]})}n.length>0&&F(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>{L5().then(e=>{re(e)}).catch(()=>{})},[]);let Be=()=>{let e={};e=ne.find(e=>e.modelConfigId===M&&e.genType===`video`&&e.resolution===K),e||(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(K===`1080p`||K===`720p`||K===`480p`)&&(e.ratio=1.3));let t=(H*e.perSecondCredits+e.baseCredits)*e.ratio,n=he?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=Ne?+!!he?.material?.materialImageUrl:he?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}J(Number(t.toFixed(2)))},Ve=()=>{let e=Fe[1]?.input?.payload?.videoConfig||Fe[1]?.input?.payload?.video_config;if(!e)return 0;let t=e?.engineId||e?.engine_id,n=e?.resolution,r=e?.duration||H,i={};i=ne.find(e=>e.modelConfigId===t&&e.genType===`video`&&e.resolution===n),i||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let a=(r*i.perSecondCredits+i.baseCredits)*i.ratio,o=he?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=Ne?+!!he?.material?.materialImageUrl:he?.videoGeneration?.inputMedia?.image?.length||0;if(s>0){let e=((i.inputImageBaseCredits||0)+(i.inputImagePerImageCredits||0)*s)*(i.inputImageRatio||1);a+=e}return Number(a.toFixed(2))};(0,S.useEffect)(()=>{ne.length>0&&M&&Be()},[ne,M,H,K,he]),(0,S.useEffect)(()=>()=>{C.current&&=(clearInterval(C.current),null)},[]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(L(!1),z(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&(ve(!0),z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{Q.error(e?.message||`加载任务详情失败`)}).finally(()=>{ve(!1)}))},[t,r]),(0,S.useEffect)(()=>{let e=he?.status===`processing`||ye.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(We,15e3):!e&&C.current&&(clearInterval(C.current),C.current=null)},[he?.status,ye,t,r]);let He=(e,t,n,r)=>{p(t||`image`),y(n?String(n):``),t===`video`?(_(r||null),h(e&&typeof e==`object`?Kse(e):{}),l(``)):(_(null),l(e||``),h({})),s(!0)},Ue=async()=>{if(f===`image`){if(!he?.id||!v){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!c||!c.trim()){Q.warning(`图片提示词不能为空`);return}x(!0);try{await dae(he.id,v,{prompt:c.trim()}),Q.success(`图片提示词已保存`),Ge(),s(!1),y(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{x(!1)}return}if(!he?.id||!v){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!m||typeof m!=`object`||Object.keys(m).length===0){Q.warning(`视频提示词不能为空`);return}if(!g){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=h9(m,g);if(e){Q.warning(e);return}x(!0);try{await(Ne?lae:vae)(he.id,v,{prompt_schema:m}),Q.success(`视频提示词已保存`),Ge(),s(!1),y(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{x(!1)}},We=()=>{t&&z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Ge=()=>{t&&z5(t,r).then(e=>{ge(e),e.steps&&be(e.steps)}).catch(e=>{Q.error(e?.message||`刷新任务详情失败`)})},Ke=e=>{let t={engine_id:P,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(he.id,e.toString(),t).then(e=>{Q.info(`正在生成图片,请稍候...`),Ge()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},qe=()=>{let e={engine_id:P,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(he.id,Fe[1].id.toString(),e).then(e=>{Q.info(`正在生成图片,请稍候...`),Ge()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ye=e=>{let t={engine_id:M,duration:H,aspect_ratio:W,resolution:K,target_platform:`抖音`};fae(he.id,e.toString(),t).then(e=>{Ge(),Q.info(`正在生成视频提示词,请稍候...`)}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Xe=async(e,t)=>{try{Ne?await uae(he.id,String(e)):await pae(he.id,String(e),{engine_id:t||``}),Q.info(`正在生成视频,请稍候...`),Ge()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)}},Ze=async()=>{let e=Ne?Fe[1]:Fe[3];e?.id&&await Xe(e.id,e.engineId||``)},$e=async e=>{if(!(!Ne||!he?.id||!e||!M))try{await cae(he.id,e,{video_config:{engine_id:M,duration:H,aspect_ratio:W,resolution:K}}),Q.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Ge()}catch(e){Q.error(e?.message||`重新生成视频提示词失败`)}};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[_e&&(0,$.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`linear-gradient(135deg, rgba(250, 248, 255, 0.95) 0%, rgba(245, 243, 255, 0.95) 50%, rgba(240, 249, 255, 0.95) 100%)`,backdropFilter:`blur(12px)`,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:20,opacity:1,transition:`opacity 0.3s ease`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:60,height:60,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,border:`2px solid rgba(99, 102, 241, 0.08)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,border:`2px solid transparent`,borderTopColor:`#6366f1`,borderRightColor:`#8b5cf6`,borderRadius:`50%`,animation:`spinSlow 0.8s linear infinite`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:40,height:40,border:`2px solid transparent`,borderBottomColor:`#a855f7`,borderLeftColor:`#c084fc`,borderRadius:`50%`,animation:`spinSlow 1.2s linear infinite reverse`}}),(0,$.jsx)(`div`,{style:{width:8,height:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,borderRadius:`50%`,boxShadow:`0 0 12px rgba(99, 102, 241, 0.6)`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:16,color:`#4f46e5`,fontWeight:600,letterSpacing:.5},children:`加载中`}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:400},children:`正在获取任务详情...`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:4,marginTop:8},children:[0,1,2].map(e=>(0,$.jsx)(`div`,{style:{width:4,height:4,background:`#a5b4fc`,borderRadius:`50%`,animation:`spinSlow ${.8+e*.2}s ease-in-out infinite`,animationDelay:`${e*.15}s`}},e))})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>e(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>d(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:he?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>he?.material?.materialVideoUrl&&Ae(he.material.materialVideoUrl,`video`),children:he?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:w9(he.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:he?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>he?.material?.materialImageUrl&&Ae(he.material.materialImageUrl,`image`),children:he?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:w9(he.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),(0,$.jsx)(`div`,{style:{margin:`20px 0`,height:1,background:`linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent)`,borderRadius:.5}}),he?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Ae(he.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),he?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsxs)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`,position:`relative`},onClick:()=>Ae(he.finalVideoUrl,`video`),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(a_,{activeKey:xe,onChange:Se,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Fe.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(u4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(C9,{style:{color:`#475569`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:he?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:w9(he.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(C9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:10,background:`#f1f5f9`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:he?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:w9(he.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`原产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.sourceProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`自有产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.targetProjectName||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`产品卖点:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Fe[0]?.input?.payload?.coreContentPoint||`-`})]})]})]}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(C9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>He(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(Z,{onClick:()=>{Ke(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[he.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${he.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>qe(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),!Ne&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{L(!I),z(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(C9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:A.video?.find(e=>e.id===M)?.name||`选择引擎`})]}),I&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:A.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{N(e.id),te({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(W)||G(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(K)||ee(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(H)||U(e.supportedDurations?.[0]||5),L(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:M===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:M===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:M===e.id?600:500,color:M===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{z(!R),L(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(C9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[W,` · `,H,`s · `,K]})]}),R&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:q.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>G(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:W===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:W===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 ${W===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:W===e?`#6366f1`:`#6b7280`,fontWeight:W===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(C9,{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:`${(H-Math.min(...q.durations))/(Math.max(...q.durations)-Math.min(...q.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...q.durations),max:Math.max(...q.durations),value:H,onChange:e=>U(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:H}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(C9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:q.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ee(e),style:{flex:1,height:42,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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:K===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let e=Fe[1]?.input?.payload?.videoConfig||Fe[1]?.input?.payload?.video_config,t=e?.engineId||e?.engine_id,n=t?(A.video||[]).find(e=>String(e.id)===String(t))?.name:``;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`引擎:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:n||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`比例:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.aspectRatio||e?.aspect_ratio||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`分辨率:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.resolution||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`时长:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.duration||`-`})]})]})})()})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>He(he?.videoGeneration?.promptSchema,`video`,e.id,he?.videoGeneration?.schemaConfigSnapshot),style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!he?.videoGeneration?.promptSchema||!he?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),Ne&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let t=Ve();if((i?.credits||0){let e=Ve();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${he?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:f===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:o,onCancel:()=>{b||s(!1)},footer:[(0,$.jsx)(Z,{onClick:()=>s(!1),disabled:b,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(Z,{type:`primary`,onClick:Ue,loading:b,disabled:b,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:f===`image`?(0,$.jsx)(Gse,{value:c,onChange:e=>l(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(S9,{value:m,schemaConfigSnapshot:g,onChange:h})})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:u,onCancel:()=>d(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:pe,onChange:e=>me(e.target.value),onPressEnter:ze,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:ze,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,render:e=>{if(!e)return`-`;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}},{title:`操作`,key:`action`,align:`center`,render:(t,n)=>(0,$.jsx)(`button`,{onClick:()=>{d(!1),e(`/initial/${n.id}/initialinfo?flow_version=${n.flowVersion===`v2`?`v2`:`v1`}`)},style:{color:`#6366f1`,textDecoration:`none`,fontSize:12,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`,fontWeight:500},children:`查看详情`})}],dataSource:ae,rowKey:`id`,pagination:{current:se,pageSize:le,total:de,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Re},style:{fontSize:13},scroll:{y:350}})]}),(0,$.jsx)(nK,{open:Ce,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:je,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:Me,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:De===`image`?(0,$.jsx)(`img`,{src:Te.startsWith(`http`)?Te:`https://ceshi.apiforeign.minzhongzc.com${Te}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ke,src:Te.startsWith(`http`)?Te:`https://ceshi.apiforeign.minzhongzc.com${Te}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(nK,{open:w,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#6366f1`,letterSpacing:.4},children:`重新生成视频提词`})]}),onCancel:()=>T(!1),width:400,footer:null,centered:!0,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(HC,{value:M,onChange:e=>{let t=A.video?.find(t=>t.id===e);t&&(N(t.id),te({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]}),t.supportedRatios?.includes(W)||G(t.supportedRatios?.[0]||`16:9`),t.supportedResolutions?.includes(K)||ee(t.supportedResolutions?.[0]||`720p`),t.supportedDurations?.includes(H)||U(t.supportedDurations?.[0]||5))},style:{width:`100%`,borderRadius:8},options:A.video?.map(e=>({value:e.id,label:e.name})),placeholder:`请选择引擎`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:q.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>G(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:W===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:W===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 ${W===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:W===e?`#6366f1`:`#6b7280`,fontWeight:W===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(H-Math.min(...q.durations))/(Math.max(...q.durations)-Math.min(...q.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...q.durations),max:Math.max(...q.durations),value:H,onChange:e=>U(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:H}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:q.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ee(e),style:{flex:1,height:42,borderRadius:8,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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:K===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(Z,{onClick:()=>T(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(Z,{onClick:()=>{if(!M){Q.warning(`请选择视频引擎`);return}$e(E),T(!1)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:!M,children:`确认生成`})]})]})})]})}var Jse={not_required:{label:`无需单独分析`,color:`default`,active:!1,terminal:!0,failure:!1},pending:{label:`等待分析`,color:`default`,active:!0,terminal:!1,failure:!1},processing:{label:`分析中`,color:`processing`,active:!0,terminal:!1,failure:!1},completed:{label:`分析完成`,color:`success`,active:!1,terminal:!0,failure:!1},failed:{label:`分析失败`,color:`error`,active:!1,terminal:!0,failure:!0}},Yse={pending:{label:`等待切割`,color:`default`,active:!0,terminal:!1,failure:!1},processing:{label:`切割中`,color:`processing`,active:!0,terminal:!1,failure:!1},retry_waiting:{label:`等待切割重试`,color:`warning`,active:!0,terminal:!1,failure:!1},completed:{label:`切割完成`,color:`success`,active:!1,terminal:!0,failure:!1},failed:{label:`切割失败`,color:`error`,active:!1,terminal:!0,failure:!0}},Xse={pending_analysis:{label:`等待分析`,color:`default`,active:!0,terminal:!1,failure:!1},analyzing:{label:`分析中`,color:`processing`,active:!0,terminal:!1,failure:!1},analysis_completed:{label:`分析完成`,color:`blue`,active:!1,terminal:!1,failure:!1},analysis_failed:{label:`分析失败`,color:`error`,active:!1,terminal:!0,failure:!0},splitting:{label:`拆镜中`,color:`processing`,active:!0,terminal:!1,failure:!1},split_completed:{label:`拆镜完成`,color:`success`,active:!1,terminal:!0,failure:!1},partial_failed:{label:`部分失败`,color:`warning`,active:!1,terminal:!0,failure:!0},failed:{label:`失败`,color:`error`,active:!1,terminal:!0,failure:!0},deleted:{label:`已删除`,color:`default`,active:!1,terminal:!0,failure:!1}},Zse=new Set([`pending`,`waiting_user`,`processing`]),T9=e=>String(e||``).trim().toLowerCase(),E9=(e,t,n)=>({key:e,...t[e]||{label:e||n,color:`default`,active:!1,terminal:!1,failure:!1}}),D9=e=>E9(T9(e),Jse,`未知分析状态`),O9=e=>E9(T9(e),Yse,`未知切割状态`),k9=e=>E9(T9(e),Xse,`未知任务状态`),Qse=e=>{let t=T9(e.analysisStatus||e.analysis_status),n=T9(e.splitStatus||e.split_status),r=T9(e.moduleProjectStatus||e.module_project_status);return D9(t).active||O9(n).active||Zse.has(r)},$se=e=>{let t=k9(e);return(0,$.jsx)(qQ,{color:t.color,children:t.label})};function ece(){let{message:e}=rx.useApp(),t=Je(),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)([]),[v,y]=(0,S.useState)(1),[b,x]=(0,S.useState)(10),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(``),D=(0,S.useRef)(null),O=(0,S.useRef)(null),k=(0,S.useCallback)(()=>{n&&n.startsWith(`blob:`)&&URL.revokeObjectURL(n),r(``),a(``),s(``),p(0),d(``)},[n]),A=async t=>{if(!t.type.startsWith(`video/`))return s(`请选择视频文件`),!1;if(t.size>100*1024*1024)return s(`视频文件大小不能超过 100MB`),!1;let n=await new Promise(e=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{e(n.duration),URL.revokeObjectURL(n.src)},n.onerror=()=>{e(0)},n.src=URL.createObjectURL(t)});if(n>190)return s(`视频时长不能超过 3分钟`),!1;k(),h(!0);try{let i=await qie(t,n);r(i.url),a(i.resource_id||``),s(``),e.success(`视频上传成功`)}catch{s(`视频上传失败,请重试`),e.error(`视频上传失败`)}finally{h(!1)}return!1},j=(0,S.useCallback)(()=>{D.current&&p(D.current.duration)},[]),M=async()=>{if(!n||!u.trim()){e.warning(`请先上传视频并输入产品名称`);return}h(!0);try{await yae({video_url:n,video_duration_seconds:f,video_resource_id:i||void 0,title:u.trim(),idempotency_key:`shot_${Date.now()}`});let r=await K5(1,20,T);e.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${r.items[0].id}/removeinfo`)},3e3),k()}catch(t){let n=``;t instanceof Error?n=t.message:typeof t==`string`&&(n=t),e.error(n||`任务创建失败,请重试`)}finally{h(!1)}},N=(0,S.useCallback)(async(t,n,r)=>{try{let e=await K5(t,n,r);_(e.items||[]),w(e.total||0),y(t),x(n)}catch{e.error(`获取列表失败`)}},[]),P=(e,t)=>{N(e,t,T)},F=()=>{N(1,10,T)},I=()=>{l(!0),N(1,10,T)},L=g.some(e=>k9(e.status).active);return(0,S.useEffect)(()=>{if(!c||!L)return;let e=()=>{document.visibilityState===`visible`&&N(v,b,T)},t=window.setInterval(e,3e4);return document.addEventListener(`visibilitychange`,e),()=>{window.clearInterval(t),document.removeEventListener(`visibilitychange`,e)}},[v,N,L,c,b,T]),(0,$.jsx)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,overflow:`auto`,background:`transparent`,position:`relative`,padding:`20px 32px`},children:(0,$.jsxs)(`div`,{style:{maxWidth:1200,margin:`0 auto`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`})]})}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,icon:(0,$.jsx)(eH,{}),onClick:I,style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`创作记录`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:720,margin:`0 auto`},children:[o&&(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(239, 68, 68, 0.2)`,borderRadius:12,padding:`14px 20px`,marginBottom:24,color:`#ef4444`,fontSize:14,textAlign:`center`,fontWeight:500},children:o}),!n&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(v0.Dragger,{accept:`video/*`,beforeUpload:A,showUploadList:!1,disabled:m,style:{background:m?`rgba(243, 244, 246, 0.3)`:`transparent`,border:`2px dashed ${m?`rgba(209, 213, 219, 0.5)`:`rgba(99, 102, 241, 0.3)`}`,borderRadius:24,padding:`56px 20px`,cursor:m?`not-allowed`:`pointer`,margin:0},children:m?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,border:`4px solid #6366f1`,borderTopColor:`transparent`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#6366f1`,margin:`0 0 8px 0`,fontWeight:600},children:`上传中...`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`请稍候,视频正在上传`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(S4,{style:{fontSize:40,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#1e293b`,margin:`0 0 8px 0`,fontWeight:600},children:`点击或拖拽到此上传视频文件`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`支持 MP4、MOV 格式视频,最大支持 100MB 的文件,支持上传 3 分钟内的视频`})]})})]}),n&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,overflow:`hidden`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{borderRadius:22,background:`#ffffff`,padding:`24px`,position:`relative`,zIndex:1},children:[(0,$.jsx)(oK,{title:`确定要删除吗?`,okText:`确定`,cancelText:`取消`,onConfirm:k,children:(0,$.jsx)(`button`,{style:{position:`absolute`,top:20,right:20,width:36,height:36,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.05)`,borderRadius:10,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16,color:`#6366f1`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.borderColor=`rgba(239, 68, 68, 0.3)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.color=`#6366f1`},children:`🗑️`})}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginBottom:20},children:(0,$.jsx)(`video`,{ref:D,src:`https://ceshi.apiforeign.minzhongzc.com${n}`,controls:!0,onLoadedMetadata:j,style:{maxWidth:`100%`,maxHeight:320,borderRadius:12,background:`#000`,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`}})}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsxs)(`label`,{style:{display:`block`,fontSize:14,fontWeight:500,color:`#334155`,marginBottom:8},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(wW,{placeholder:`请输入产品名称`,value:u,onChange:e=>d(e.target.value),style:{width:`100%`,height:44,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`}})]}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginTop:16},children:(0,$.jsx)(`button`,{onClick:M,disabled:!n||!u.trim()||m,style:{padding:`14px 56px`,background:n&&u.trim()&&!m?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`:`#e2e8f0`,color:`white`,border:`none`,borderRadius:12,fontSize:15,fontWeight:600,cursor:n&&u.trim()&&!m?`pointer`:`not-allowed`,boxShadow:n&&u.trim()&&!m?`0 6px 20px rgba(99, 102, 241, 0.3)`:`none`,display:`inline-flex`,alignItems:`center`,gap:10,transition:`all 0.3s ease`},onMouseEnter:e=>{n&&u.trim()&&!m&&(e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 8px 25px rgba(99, 102, 241, 0.4)`)},onMouseLeave:e=>{n&&u.trim()&&!m&&(e.currentTarget.style.transform=`traslnateY(0)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.3)`)},children:(0,$.jsx)(`span`,{children:m?`创建中...`:`创建`})})})]})]}),(0,$.jsx)(`canvas`,{ref:O,style:{display:`none`}}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:c,onCancel:()=>l(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:T,onChange:e=>E(e.target.value),onPressEnter:F,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(Z,{type:`primary`,onClick:F,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`状态`,dataIndex:`status`,key:`status`,render:e=>$se(e)},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:n=>(0,$.jsxs)(YV,{children:[(0,$.jsx)(Z,{type:`text`,onClick:()=>t(`/removelens/${n.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`}),(0,$.jsx)(oK,{title:`确认删除这个拆镜项目吗?`,onConfirm:async()=>{try{await Iae(n.id),e.success(`删除成功`),N(v,b,T)}catch{e.error(`删除失败`)}},children:(0,$.jsx)(Z,{type:`text`,danger:!0,style:{color:`#ef4444`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(239, 68, 68, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`},children:`删除`})})]})}],dataSource:g,rowKey:`id`,pagination:{current:v,pageSize:b,total:C,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:P,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:300},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})})]})]})]})})}var tce=c(o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` \0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function B(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new U(4,4,8,4,V),new U(4,5,16,8,V),new U(4,6,32,32,V),new U(4,4,16,16,H),new U(8,16,32,32,H),new U(8,16,128,128,H),new U(8,32,128,256,H),new U(32,128,258,1024,H),new U(32,258,258,4096,H)],n.deflateInit=function(e,t){return ee(e,t,g,15,8,0)},n.deflateInit2=ee,n.deflateReset=K,n.deflateResetKeep=G,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(B(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(B(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,B(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,B,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,B,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x>>=k)),b>>>=3,x-=3}else{for(R=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(z=n.lencode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=L[R+d[w]],N[P+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function V(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=B(a[s]++,s))}}function H(e){var t;for(t=0;t>1;1<=n;n--)G(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,G(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?re(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),K(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1),{Text:nce}=w1,A9=e=>e?/^(https?:|data:|blob:)/i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,rce=e=>e===`video`?(0,$.jsx)(X8,{}):e===`audio`?(0,$.jsx)(O2,{}):(0,$.jsx)(L6,{}),ice=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,j9=e=>{let t=Number(e||0);return t>=1024*1024?`${(t/1024/1024).toFixed(1)} MB`:t>=1024?`${(t/1024).toFixed(1)} KB`:`${t} B`},ace=()=>{let[e,t]=(0,S.useState)(``),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(1),[o,s]=(0,S.useState)(10),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)([]),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(new Set),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(!1),b=(0,S.useMemo)(()=>u.flatMap(e=>e.items||[]),[u]),x=(0,S.useCallback)(async()=>{l(!0);try{let t=await r7({resourceType:e||void 0,keyword:n||void 0,page:i,pageSize:o,scene:`record`});d(t.groups||[]),p(t.totalDays||0),h(new Set)}catch(e){Q.error(e?.message||`加载历史上传素材失败`),d([]),p(0)}finally{l(!1)}},[n,i,o,e]);(0,S.useEffect)(()=>{x()},[x]);let C=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},w=()=>{let e=b.map(e=>e.id);h(t=>t.size===e.length?new Set:new Set(e))},T=async t=>{let r=(t.page||1)+1;try{let i=await i7(t.generatedDate,{resourceType:e||void 0,keyword:n||void 0,page:r,pageSize:10,scene:`record`});d(e=>e.map(e=>e.generatedDate===t.generatedDate?{...e,page:r,items:[...e.items,...i.items||[]]}:e))}catch(e){Q.error(e?.message||`加载更多失败`)}},E=e=>{nK.confirm({title:`确认删除历史上传素材`,content:`确定删除 ${e.fileName||e.id} 吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{await C5(e.resourceUrl),Q.success(`删除成功`),x()}catch(e){Q.error(e?.message||`删除失败`)}}})},D=()=>{if(m.size===0){Q.warning(`请先选择要删除的上传素材`);return}if(m.size>30){Q.warning(`一次最多删除 30 条上传素材`);return}let e=Array.from(m);nK.confirm({title:`确认批量删除历史上传素材`,content:`确定删除选中的 ${e.length} 条上传素材吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{let t=await Xae(e);Q.success(`删除成功,释放 ${j9(t?.releasedSizeBytes||0)}`),x()}catch(e){Q.error(e?.message||`批量删除失败`)}}})},O=e=>{let t=document.createElement(`a`);t.href=A9(e.resourceUrl),t.download=e.fileName||e.id,document.body.appendChild(t),t.click(),document.body.removeChild(t)},k=(e,t=`card`)=>{let n=A9(e.previewUrl||e.displayUrl||e.resourceUrl),r=t===`card`?{width:`100%`,height:130,objectFit:`cover`}:{width:`100%`,maxHeight:620,objectFit:`contain`};return e.resourceType===`image`?(0,$.jsx)(`img`,{src:n,alt:e.fileName||e.id,style:r}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:n,controls:t===`preview`,muted:t===`card`,style:r}):(0,$.jsx)(T7,{src:n,size:t===`card`?`small`:`normal`})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(YV,{size:8,wrap:!0,children:[(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(Z,{type:e===``?`primary`:`default`,onClick:()=>{t(``),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===``?`transparent`:`#e2e8f0`,color:e===``?`#fff`:`#64748b`},children:`全部`}),(0,$.jsx)(Z,{type:e===`image`?`primary`:`default`,onClick:()=>{t(`image`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`image`?`transparent`:`#e2e8f0`,color:e===`image`?`#fff`:`#64748b`},children:`图片`}),(0,$.jsx)(Z,{type:e===`video`?`primary`:`default`,onClick:()=>{t(`video`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`video`?`transparent`:`#e2e8f0`,color:e===`video`?`#fff`:`#64748b`},children:`视频`}),(0,$.jsx)(Z,{type:e===`audio`?`primary`:`default`,onClick:()=>{t(`audio`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`audio`?`transparent`:`#e2e8f0`,color:e===`audio`?`#fff`:`#64748b`},children:`音频`})]}),(0,$.jsxs)(YV,{size:8,wrap:!0,children:[(0,$.jsx)(wW.Search,{allowClear:!0,value:n,placeholder:`搜索文件名或URL`,onChange:e=>r(e.target.value),onSearch:()=>{a(1),x()},style:{width:240,borderRadius:8},enterButton:!0}),v?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{onClick:w,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:m.size&&m.size===b.length?`取消全选`:`全选`}),(0,$.jsxs)(Z,{danger:!0,onClick:D,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`批量删除 `,m.size>0&&`(${m.size})`]}),(0,$.jsx)(Z,{onClick:()=>{y(!1),h(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`})]}):(0,$.jsx)(Z,{type:`primary`,onClick:()=>y(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),(0,$.jsx)(jG,{spinning:c,children:u.length===0?(0,$.jsx)(fC,{description:`暂无可展示的历史上传素材`,style:{padding:`60px 0`}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:28},children:u.map(e=>(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{fontSize:18,fontWeight:700,color:`#1e293b`},children:e.generatedDate}),(0,$.jsxs)(nce,{type:`secondary`,children:[`共 `,e.total,` 个素材`]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`flex-start`},children:e.items.map(e=>{let t=m.has(e.id);return(0,$.jsxs)(`div`,{style:{width:`17%`,minWidth:240,margin:16,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,borderRadius:16,overflow:`hidden`,background:`#fff`,boxShadow:`0 10px 24px rgba(15,23,42,0.06)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,background:`#f1f5f9`,cursor:v?`pointer`:`default`},onClick:()=>v&&C(e.id),children:[k(e),v&&(0,$.jsx)(kR,{checked:t,onChange:()=>C(e.id),style:{position:`absolute`,top:10,left:10,background:`#fff`,borderRadius:6,padding:4}}),(0,$.jsx)(qQ,{color:`purple`,icon:rce(e.resourceType),style:{position:`absolute`,top:10,right:10,margin:0},children:ice(e.resourceType)})]}),(0,$.jsxs)(`div`,{style:{padding:12,paddingTop:0},children:[(0,$.jsxs)(YV,{size:4,wrap:!0,style:{marginTop:8},children:[(0,$.jsx)(qQ,{style:{margin:0},children:e.moduleLabel}),(0,$.jsx)(qQ,{style:{margin:0},children:j9(e.fileSizeBytes)}),e.durationSeconds?(0,$.jsxs)(qQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null]}),(0,$.jsxs)(YV,{style:{marginTop:12},children:[(0,$.jsx)(Z,{size:`small`,icon:(0,$.jsx)(nW,{}),onClick:()=>_(e),children:`预览`}),(0,$.jsx)(Z,{size:`small`,icon:(0,$.jsx)(f0,{}),onClick:()=>O(e),children:`下载`}),(0,$.jsx)(Z,{size:`small`,danger:!0,icon:(0,$.jsx)(s$,{}),onClick:()=>E(e),children:`删除`})]})]})]},e.id)})}),e.items.lengthT(e),children:`加载更多`})})]},e.generatedDate))})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:24},children:(0,$.jsx)(uG,{current:i,pageSize:o,total:f,showSizeChanger:!0,pageSizeOptions:[5,10],onChange:(e,t)=>{a(e),s(t)}})}),(0,$.jsx)(nK,{open:!!g,title:`预览`,footer:null,width:900,centered:!0,destroyOnHidden:!0,onCancel:()=>_(null),children:g?k(g,`preview`):null})]})},{Search:oce}=wW,{Text:sce}=w1,cce=e=>{let t=S.useRef(!1);(0,S.useEffect)(()=>{if(t.current)return;let n=()=>{t.current||(t.current=!0,e?.())};return document.readyState===`complete`?n():window.addEventListener(`load`,n),()=>{window.removeEventListener(`load`,n)}},[e])},lce=()=>{let[e,t]=(0,S.useState)(!1);cce(()=>{t(!0)});let[n]=Dn(),[r,i]=(0,S.useState)(n.get(`filterType`)===`private_portrait`?`private_portrait`:n.get(`filterType`)===`upload_resource`?`upload_resource`:`project`),[a,o]=(0,S.useState)(`video`),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)({page:1,pageSize:10}),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(new Set),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(null),x=S.createRef(),[C,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(``),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)([[]]),[N,P]=(0,S.useState)([``]),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(0),[V,H]=(0,S.useState)([void 0]),[U,W]=(0,S.useState)(new Map),[G,K]=(0,S.useState)(``),[ee,q]=(0,S.useState)(new Map),te=(0,S.useRef)(new Map);(0,S.useEffect)(()=>()=>{te.current.forEach(e=>clearTimeout(e)),te.current.clear()},[]);let[ne,re]=(0,S.useState)(1),[ie,J]=(0,S.useState)(10),[ae,oe]=(0,S.useState)([!1]),[se,ce]=(0,S.useState)(`new`),[le,ue]=(0,S.useState)([]),[de,fe]=(0,S.useState)(!1),[pe,me]=(0,S.useState)([]),[he,ge]=(0,S.useState)({}),[_e,ve]=(0,S.useState)(`2`),[ye,be]=(0,S.useState)(``),[xe,Se]=(0,S.useState)([]),[Ce,we]=(0,S.useState)(!1),[Te,Ee]=(0,S.useState)(!1),[De,Oe]=(0,S.useState)([]),[ke,Ae]=(0,S.useState)(0),[je,Me]=(0,S.useState)(1),[Ne,Pe]=(0,S.useState)(10),[Fe,Ie]=(0,S.useState)(!1),[Le,Re]=(0,S.useState)(``),[ze,Be]=(0,S.useState)(!1),[Ve,He]=(0,S.useState)(new Set),Ue=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}}},We=e=>{let t=Ue(e);return t?Math.floor(Date.now()/1e3)>t:!1},Ge=(e,t=!1)=>{let n=`https://ceshi.apiforeign.minzhongzc.com`,r=e.startsWith(`/`)?e.slice(1):e,i=n.endsWith(`/`)?n.slice(0,-1):n;return t?`${i}/static/${r}&w=300&q=50`:`${i}/${r}`},Ke=async e=>{if(b(e),v(!0),window.dispatchEvent(new Event(`previewOpen`)),e.videoUrl&&e.videoUrl.trim()&&!e.imagePx)try{let t=await mt(e.videoUrl);t&&b(e=>e&&{...e,imagePx:t})}catch{}},qe=()=>{x.current&&(x.current.pause(),x.current.currentTime=0),document.querySelectorAll(`video`).forEach(e=>{e.pause(),e.currentTime=0}),v(!1)},Je=e=>e.generatedResourceId||e.id,Ye=e=>!!e.generatedResourceId,Xe=e=>{if(!e)return!0;let t=e.match(/^(\d+)x(\d+)$/);if(!t)return!0;let n=parseInt(t[1],10),r=parseInt(t[2],10),i=n/r;return n>=r?n>=480&&n<=2560&&r>=270&&r<=1440&&i>=1.775&&i<=1.784:n>=270&&n<=1440&&r>=480&&r<=2560&&i>=.555&&i<=.564},Ze=e=>{He(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Qe=()=>{let e=s.flatMap(e=>e.items.map(e=>Je(e)));Ve.size===e.length?He(new Set):He(new Set(e))},$e=async()=>{if(Ve.size===0){Q.warning(`请先选择要下载的媒体`);return}if(Ve.size>30){Q.warning(`最多只能单次下载30个文件`);return}let e=[];s.forEach(t=>{t.items.forEach(t=>{Ve.has(Je(t))&&e.push(t)})});let t=new tce.default,n=`https://ceshi.apiforeign.minzhongzc.com`,r=t.folder(`downloads`),i=!1,a=0;Q.loading({content:`下载中,请稍候...`,key:`downloadProgress`});for(let t of e){let e=`${n}${t.videoUrl||t.imageUrl}`,o=((t.videoUrl||t.imageUrl).split(`/`).pop()||`file_${Date.now()}`).split(`?`)[0];try{let t=await fetch(e);if(!t.ok)throw Error(`Network response was not ok`);let n=await t.blob();r?.file(o,n),a++}catch{i=!0;break}}if(i){Q.destroy(`downloadProgress`),Q.info(`由于跨域限制,将逐个下载文件`),e.forEach((e,t)=>{setTimeout(()=>{let t=`${n}${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=t,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},t*500)});return}let o=await t.generateAsync({type:`blob`}),c=document.createElement(`a`);c.href=URL.createObjectURL(o),c.download=`downloads_${Date.now()}.zip`,c.click(),URL.revokeObjectURL(c.href),Q.destroy(`downloadProgress`),Q.success(`下载完成,共 ${a} 个文件`),Be(!1),He(new Set)},et=async()=>{if(Ve.size===0){Q.warning(`请先选择要删除的媒体`);return}if(Ve.size>30){Q.warning(`最多只能单次删除30个文件`);return}let e=s.flatMap(e=>e.items.filter(e=>Ve.has(Je(e)))),t=``;t=r===`shot_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[e.shotReplicateProjectTitle,`— —`,e.shotSegmentLabel]},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):r===`hot_opening_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:e.moduleProjectTitle},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):`确定删除选中的 ${Ve.size} 条记录吗?`,nK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let e=``;r===`project`?e=`generation_record`:r===`creation`?e=`chat_task`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=[];s.forEach(e=>{e.items.forEach(e=>{Ve.has(Je(e))&&t.push(e)})});let n=[];e===`generation_record`||e===`chat_task`?n=t.map(e=>e.id):e===`hot_opening_replicate`?n=t.map(e=>e.moduleProjectId):e===`shot_replicate`&&(n=t.map(e=>e.shotSegmentId));let i={history_source:e,ids:n};try{await t7(i),Q.success(`删除成功`),Be(!1),He(new Set),u(e=>({...e,page:1})),ht()}catch{Q.error(`删除失败,请重试`)}}})},tt=async()=>{we(!0);try{let e=await U5({page:1,pageSize:100});Se(e.data?.data||e.data||[])}catch{}finally{we(!1)}},nt=()=>{if(Ve.size===0){Q.warning(`请先选择要推送的媒体`);return}M([[]]),P([``]),H([void 0]),ve(`2`),be(``),tt(),A(!0)},rt=()=>{if(!y)return;let e=Je(y);He(new Set([e])),M([[]]),P([``]),H([void 0]),W(new Map),K(``),ve(`2`),be(``),tt(),A(!0)},it=async(e,t)=>{R(!0);try{let n=await H5({page:e,page_size:t});I(n?.data||n||[]),B(n.pagination.total||0)}catch{I([]),B(0)}finally{R(!1)}},at=async()=>{fe(!0);try{let[e,t]=await Promise.all([qae(),$5()]);ue(e?.data||[]);let n=t?.data||[],r={};n.forEach(e=>{r[e.openType]=e.typeName}),ge(r)}catch{ue([]),ge({})}finally{fe(!1)}},ot=async()=>{Ie(!0);try{let e=await zae({status:Le||void 0,page:je,pageSize:Ne});Oe(e?.data||e||[]),Ae(e.pagination?.total||e.total||0)}catch{Oe([]),Ae(0)}finally{Ie(!1)}},st=()=>{Ee(!0),Me(1),Re(``),ot()},ct=()=>{Me(1),ot()},lt=(e,t)=>{Me(e),Pe(t),ot()},ut=async()=>{if(Ve.size===0){Q.warning(`请先选择要推送的媒体`);return}let e=new Map;s.forEach(t=>{t.items.forEach(t=>{let n=Je(t);e.set(n,t)})});let t=[];if(se===`new`){let n=V.filter(e=>e!==void 0);if(n.length===0){Q.warning(`请先选择授权账户`);return}for(let r=0;re.accountId)||[];if(a.length===0){Q.warning(`第 ${r+1} 组授权账户未设置账户ID,已跳过`);continue}let o=new Map;for(let t of Ve){let n=e.get(t),r;n&&Ye(n)&&(r=`generated_resources`),o.has(r)||o.set(r,[]),o.get(r).push(t)}o.forEach((e,n)=>{t.push({advertiser_ids:a,resource_ids:e,oauth_id:i.value,source_model:n,is_pre_test:_e,pre_test_template:ye})})}}else{if(pe.length===0){Q.warning(`请先选择历史账户`);return}for(let n of pe){let i=new Map;for(let t of Ve){let n=e.get(t),a;a=n&&Ye(n)?`generated_resources`:r===`project`?`generation_records`:`chat_generation_tasks`,i.has(a)||i.set(a,[]),i.get(a).push(t)}i.forEach((e,r)=>{t.push({advertiser_ids:[n.advertiserId],resource_ids:e,oauth_id:String(n.oauthId),source_model:r,is_pre_test:_e,pre_test_template:ye})})}}O(!0);try{let e=await Rae({tasks:t});e.errors?.length>0?Q.warning(e.message):e.code===0?Q.success(e.message):Q.error(e.message),Be(!1),He(new Set),A(!1),M([[]]),P([``]),H([void 0]),me([]),W(new Map),K(``),ve(`2`),be(``)}catch(e){Q.error(e.message||`批量推送失败`)}finally{O(!1)}},dt=async(e,t)=>{if(t.trim())try{let n=(await Z5({filenames:[{source_id:e,file_name:t}]}))?.results?.find(t=>t.source_id===e)?.new_file_name||t;c(t=>t.map(t=>({...t,items:t.items.map(t=>Je(t)===e?{...t,fileName:n}:t)}))),Q.success(`文件名更新成功`)}catch(e){Q.error(e.message||`文件名更新失败`)}},ft=async(e,t)=>{if(!(!t.trim()||e.length===0))try{let n=await Z5({filenames:e.map(e=>({source_id:e,file_name:t}))}),r=new Map;n?.results?.forEach(e=>{e.success&&e.newFileName&&r.set(e.sourceId,e.newFileName)}),c(n=>{let i=new Set(e);return n.map(e=>({...e,items:e.items.map(e=>{let n=Je(e);if(i.has(n)){let i=r.get(n)||t;return{...e,fileName:i}}return e})}))});let i=n?.successCount||0;Q.success(`已更新 ${i} 个文件名`)}catch(e){Q.error(e.message||`文件名更新失败`)}},pt=e=>{w(e)},mt=e=>new Promise(t=>{let n=document.createElement(`video`),r=`https://ceshi.apiforeign.minzhongzc.com`,i=e.startsWith(`/`)?e.slice(1):e;n.src=`${r.endsWith(`/`)?r.slice(0,-1):r}/${i}`,n.crossOrigin=`anonymous`,n.onloadedmetadata=()=>{let e=n.videoWidth,r=n.videoHeight;n.remove(),t(`${e}x${r}`)},n.onerror=()=>{n.remove(),t(``)},n.onabort=()=>{n.remove(),t(``)},setTimeout(()=>{n.remove(),t(``)},5e3)}),ht=()=>{if(r===`private_portrait`||r===`upload_resource`){m(!1),c([]);return}m(!0);let e=``;r===`project`?e=`generation_record`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=`?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;if(e&&(t=`?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),C){let t=`${C}?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;e&&(t=`${C}?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),I5(t).then(e=>{let t=Array.isArray(e)?e:e?.items||[],n=[{generatedDate:e.generatedDate,items:t,total:e.total,page:e.page}];n&&n[0].items.length>0?c(n):c([])}).catch(e=>{}).finally(()=>{m(!1)})}else aae(t).then(e=>{let t=Array.isArray(e)?e:e?.groups||[];t.forEach(e=>{e.page=1}),l.page===1?c(t):c(e=>[...e,...t]),f(e?.totalDays||0)}).catch(e=>{l.page===1&&c([])}).finally(()=>{m(!1)})};(0,S.useEffect)(()=>{ht()},[r,a,l.page,C]);let gt=()=>{p||u(e=>({...e,page:e.page+1}))},_t=async(e,t,n)=>{if(h.has(t))return;g(e=>new Set([...e,t]));let i=n+1,o=``;r===`project`?o=`generation_record`:r===`hot_opening_replicate`?o=`hot_opening_replicate`:r===`shot_replicate`&&(o=`shot_replicate`);let s=`${e}?gen_type=${a}&page=${i}&page_size=${l.pageSize}`;o&&(s=`${e}?gen_type=${a}&history_source=${o}&page=${i}&page_size=${l.pageSize}`),T&&T.trim()&&(s+=`&keyword=${encodeURIComponent(T.trim())}`);try{let t=(await I5(s)).items||[];t&&t.length>0&&c(n=>n.map(n=>n.generatedDate===e?{...n,items:[...n.items,...t],page:i}:n))}catch{}finally{g(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,S.useEffect)(()=>{u(e=>({...e,page:1})),E(``)},[r,a]),(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsx)(vL,{activeKey:r,onChange:e=>{i(e),Be(!1),He(new Set)},items:[{key:`project`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(UX,{}),` 项目记录`]})},{key:`creation`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(eH,{}),` 创作记录`]})},{key:`hot_opening_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(N8,{}),` 爆款复刻`]})},{key:`shot_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(K6,{}),` 拆镜复刻`]})},{key:`private_portrait`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(J8,{}),` 私域素材库`]})},{key:`upload_resource`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(G8,{}),` 历史素材`]})}],size:`middle`,style:{marginBottom:12}}),r===`private_portrait`?(0,$.jsx)(Dse,{}):r===`upload_resource`?(0,$.jsx)(ace,{}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(w1.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(Z,{type:a===`video`?`primary`:`default`,onClick:()=>{o(`video`),Be(!1),He(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`video`?`transparent`:`#e2e8f0`,color:a===`video`?`#fff`:`#64748b`},icon:(0,$.jsx)(X8,{}),children:`视频`}),(0,$.jsx)(Z,{type:a===`image`?`primary`:`default`,onClick:()=>{o(`image`),Be(!1),He(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`image`?`transparent`:`#e2e8f0`,color:a===`image`?`#fff`:`#64748b`},icon:(0,$.jsx)(L6,{}),children:`图片`})]}),(0,$.jsxs)(YV,{size:8,wrap:!0,children:[(0,$.jsx)(rV,{picker:`date`,value:C?(0,HE.default)(C):void 0,onChange:(e,t)=>pt(t||``),format:`YYYY-MM-DD`,style:{width:160,borderRadius:8,border:`1px solid #e2e8f0`},placeholder:`选择日期`,allowClear:!0}),(0,$.jsx)(wW.Search,{placeholder:`搜索提示词`,allowClear:!0,value:T,onChange:e=>{let t=e.target.value;E(t),t||(u(e=>({...e,page:1})),ht())},onSearch:()=>{u(e=>({...e,page:1})),ht()},style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(Z,{icon:(0,$.jsx)(XB,{}),onClick:st,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`},children:`推送任务历史`}),ze?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{onClick:Ve.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?()=>{He(new Set)}:Qe,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:Ve.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?`取消全选`:`全选`}),(0,$.jsx)(Z,{onClick:()=>{Be(!1),He(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`}),(0,$.jsxs)(Z,{danger:!0,onClick:et,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`删除 `,Ve.size>0&&`(${Ve.size})`]}),(0,$.jsxs)(Z,{onClick:$e,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:[`下载 `,Ve.size>0&&`(${Ve.size})`]}),(0,$.jsx)(Z,{type:`primary`,onClick:nt,loading:D,disabled:D||Ve.size===0,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:D?`推送中...`:`推送至账户 ${Ve.size>0?`(${Ve.size})`:``}`})]}):(0,$.jsx)(Z,{type:`primary`,onClick:()=>Be(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),p?(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},children:(0,$.jsx)(jG,{indicator:(0,$.jsx)(Ym,{style:{fontSize:24,color:`#64748b`},spin:!0}),description:`加载中...`,size:`large`})}):s.length===0?(0,$.jsx)(fC,{image:fC.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:`60px 0`}}):(0,$.jsxs)(`div`,{style:{padding:`0 4px`},children:[s.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:32},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#64748b`,marginBottom:12,paddingLeft:8},children:e.generatedDate}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:e.items.map(e=>{let t=a===`video`&&e.videoCoverUrl?Ge(e.videoCoverUrl,!0):Ge(a===`video`?e.videoUrl:e.imageUrl,!0),n=a===`video`&&e.videoCoverUrl||a===`image`,r=Ve.has(Je(e));return(0,$.jsxs)(`div`,{className:`media-card`,style:{width:160,height:120,position:`relative`,borderRadius:4,cursor:`pointer`,overflow:`hidden`,boxShadow:`0 2px 8px rgba(0,0,0,0.1)`,transition:`transform 0.2s, box-shadow 0.2s`},onClick:()=>ze?Ze(Je(e)):Ke(e),onMouseEnter:e=>{ze||(e.currentTarget.style.transform=`scale(1.05)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0,0,0,0.2)`)},onMouseLeave:e=>{ze||(e.currentTarget.style.transform=`scale(1)`,e.currentTarget.style.boxShadow=`0 2px 8px rgba(0,0,0,0.1)`)},children:[n?(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,$.jsx)(`img`,{src:t,alt:`预览`,loading:`lazy`,style:{width:`100%`,height:`100%`,objectFit:`cover`,opacity:+(ee.get(Je(e))===`loaded`),transition:`opacity 0.3s`},onLoad:()=>{q(t=>{let n=new Map(t);return n.set(Je(e),`loaded`),n})},onError:()=>{q(t=>{let n=new Map(t);return n.set(Je(e),`error`),n})}}),ee.get(Je(e))!==`loaded`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,backgroundColor:`#cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,animation:ee.get(Je(e))===`loading`?`pulse 1.5s infinite`:`none`},children:e.mediaType===`video`?(0,$.jsx)(X8,{style:{color:`#64748b`,fontSize:16}}):(0,$.jsx)(L6,{style:{color:`#64748b`,fontSize:16}})})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#1e293b`},children:[(0,$.jsx)(X8,{style:{color:`#64748b`,fontSize:24}}),(0,$.jsx)(sce,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:`暂无封面`})]}),ze&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,width:22,height:22,borderRadius:`50%`,backgroundColor:r?`#6366f1`:`rgba(255,255,255,0.92)`,border:r?`2px solid #6366f1`:`2px solid #cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,boxShadow:r?`0 2px 8px rgba(99,102,241,0.4)`:`0 1px 3px rgba(0,0,0,0.1)`,transition:`all 0.15s ease`},onClick:t=>{t.stopPropagation(),Ze(Je(e))},children:r&&(0,$.jsx)(`svg`,{width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,children:(0,$.jsx)(`path`,{d:`M10 3L4.5 8.5L2 6`,stroke:`white`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})})}),r&&a===`video`&&e.imagePx&&!Xe(e.imagePx)&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:36,left:8,right:8,padding:`4px 8px`,backgroundColor:`rgba(239, 68, 68, 0.9)`,color:`#fff`,fontSize:12,borderRadius:4,zIndex:10},children:`视频实际尺寸可能不符合平台推送要求`})]}),!ze&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`linear-gradient(transparent, rgba(0,0,0,0.5))`,padding:`8px`,color:`#fff`,fontSize:12,opacity:0,transition:`opacity 0.2s`},onMouseEnter:e=>{e.currentTarget.style.opacity=`1`},onMouseLeave:e=>{e.currentTarget.style.opacity=`0`},children:`点击预览`}),(0,$.jsx)(`div`,{className:`media-download-btn`,children:(0,$.jsx)(jw,{title:`下载`,children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,backdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`background 0.15s`},onClick:t=>{t.stopPropagation();let n=`https://ceshi.apiforeign.minzhongzc.com${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=n,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},children:(0,$.jsx)(f0,{style:{color:`#fff`,fontSize:14}})})})})]}),ze&&r&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,border:`3px solid #6366f1`,borderRadius:4,pointerEvents:`none`,zIndex:5,boxShadow:`inset 0 0 0 1px rgba(99,102,241,0.2)`}})]},Je(e))})}),e.total&&e.total>e.items.length&&(0,$.jsx)(`div`,{style:{padding:`12px 0`,textAlign:`left`},children:(0,$.jsx)(Z,{onClick:()=>_t(e.generatedDate,e.items,e.page),loading:h.has(e.generatedDate),disabled:h.has(e.generatedDate),size:`small`,style:{borderRadius:6,background:`transparent`,border:`1px dashed #cbd5e1`,color:`#64748b`,fontSize:12},children:h.has(e.date)?`加载中...`:`查看全部 (${e.total})`})})]},t)),s.length>0&&d>s.length&&(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:`20px 0`},children:(0,$.jsx)(Z,{onClick:gt,loading:p,disabled:p,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:500},children:p?`加载中...`:`加载更多`})})]})]}),(0,$.jsxs)(nK,{title:`推送任务历史`,open:Te,onCancel:()=>Ee(!1),footer:null,width:800,style:{borderRadius:8},mask:{closable:!1},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,gap:4},children:[(0,$.jsx)(HC,{value:Le,onChange:e=>Re(e),placeholder:`选择状态`,style:{width:200,marginRight:12},options:[{value:`1`,label:`待推送`},{value:`2`,label:`推送中`},{value:`3`,label:`推送成功`},{value:`4`,label:`推送失败`}],allowClear:!0}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,$.jsx)(Z,{type:`primary`,onClick:ct,style:{borderRadius:8},children:`查询`}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:ct,style:{borderRadius:8},children:`刷新`})]})]}),(0,$.jsx)(PQ,{dataSource:De,columns:[{title:`素材名称`,dataIndex:`fileName`,key:`fileName`,width:200},{title:`账户ID`,dataIndex:`advertiserId`,key:`advertiserId`,width:180},{title:`状态`,dataIndex:`status`,key:`status`,width:100,render:e=>(0,$.jsx)(qQ,{color:{1:`#f59e0b`,2:`#6366f1`,3:`#10b981`,4:`#ef4444`}[e]||`#64748b`,style:{borderRadius:4},children:{1:`待推送`,2:`推送中`,3:`推送成功`,4:`推送失败`}[e]||e})},{title:`备注`,dataIndex:`note`,key:`note`,width:160,ellipsis:!0,render:e=>(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:e||`-`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>N9(e)},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>N9(e)}],loading:Fe,scroll:{x:`max-content`},pagination:{current:je,pageSize:Ne,total:ke,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:lt},rowKey:(e,t)=>e.task_id||e.resource_id||t,size:`small`})]}),_&&y&&(0,$.jsx)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y.title||`预览`})]}),open:_,onCancel:qe,width:1200,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`#fff`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:()=>{x.current&&x.current.pause();let e=`https://ceshi.apiforeign.minzhongzc.com${y.videoUrl||y.imageUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=``,document.body.appendChild(t),t.click(),document.body.removeChild(t)},style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,fontWeight:600,padding:`8px 24px`},disabled:We(y.videoUrl||y.imageUrl),children:We(y.videoUrl||y.imageUrl)?`资源已过期`:`下载`}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(s$,{}),onClick:()=>{let e=``,t=``;if(r===`shot_replicate`?(e=y.shotSegmentId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):r===`hot_opening_replicate`?(e=y.moduleProjectId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:y.moduleProjectTitle})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):(e=y.id,t=`确定删除该记录吗?`),!e){Q.warning(`无法获取删除ID`);return}nK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let t=``;r===`project`?t=`generation_record`:r===`creation`?t=`chat_task`:r===`hot_opening_replicate`?t=`hot_opening_replicate`:r===`shot_replicate`&&(t=`shot_replicate`);let n={history_source:t,ids:[e]};try{await t7(n),Q.success(`删除成功`),qe(),u(e=>({...e,page:1})),ht()}catch{Q.error(`删除失败,请重试`)}}})},style:{borderRadius:8,background:`linear-gradient(135deg, #bf0b0a 0%, #ff8165 100%)`,fontWeight:600,padding:`8px 24px`},disabled:We(y.videoUrl||y.imageUrl),children:`删除`}),(0,$.jsx)(Z,{onClick:rt,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:600,padding:`8px 24px`},disabled:We(y.videoUrl||y.imageUrl),children:`推送媒体后台`})]}),style:{borderRadius:16,overflow:`hidden`},styles:{body:{height:500,display:`flex`,flexDirection:`column`,padding:0},header:{background:`#fff`,borderBottom:`1px solid #f1f5f9`,padding:`16px 24px`},mask:{backgroundColor:`rgba(0, 0, 0, 0.5)`}},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,height:`100%`,background:`#f8fafc`},children:[(0,$.jsx)(`div`,{style:{width:`70%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`,padding:20},children:We(y.videoUrl||y.imageUrl)?(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px`,backgroundColor:`#fff`,borderRadius:12},children:[(0,$.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`⚠️`}),(0,$.jsx)(`p`,{style:{fontSize:15,color:`#ef4444`,fontWeight:500,marginBottom:8},children:`资源已过期`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#94a3b8`},children:`请刷新页面重新加载`})]}):a===`video`?(0,$.jsx)(`video`,{ref:x,src:`https://ceshi.apiforeign.minzhongzc.com${y.videoUrl}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:`100%`,borderRadius:12,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com/static${y.imageUrl}&w=300&q=50`,alt:`预览`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:12}})}),(0,$.jsxs)(`div`,{style:{width:`30%`,height:`100%`,overflowY:`auto`,scrollbarWidth:`none`,backgroundColor:`#fff`,padding:24,borderLeft:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:20},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:1}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`文件信息`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类型`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:a===`video`?`视频`:`图片`})]}),r===`hot_opening_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[`爆款复刻——`,y.moduleProjectTitle]})]}),r===`shot_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`请求`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:y.originalPrompt})]}),a===`image`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageProportion})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageSize})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`尺寸`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imagePx})]})]}),a===`video`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.aspectRatio})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.resolution})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`时长`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:`${y.duration}秒`||`-`})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`创建时间`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:N9(y.createdAt||y.generatedDate)})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`生成引擎`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.engine||y.engineName||`-`})]})]}),(0,$.jsx)(`div`,{style:{borderTop:`1px solid #f1f5f9`,margin:`20px 0`}}),y.mediaReferences&&y.mediaReferences.length>0&&![`hot_opening_replicate`,`shot_replicate`].includes(r)&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%)`,borderRadius:1}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`依靠附件`})]}),y.mediaReferences.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>{x.current&&x.current.pause();let t=`https://ceshi.apiforeign.minzhongzc.com${e.url}`;window.open(t,`_blank`)},style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderRadius:8,cursor:`pointer`,backgroundColor:`#f8fafc`,marginBottom:8,transition:`all 0.25s ease`,border:`1px solid transparent`},onMouseEnter:e=>{let t=e.currentTarget;t.style.backgroundColor=`#e0f2fe`,t.style.borderColor=`#bae6fd`},onMouseLeave:e=>{let t=e.currentTarget;t.style.backgroundColor=`#f8fafc`,t.style.borderColor=`transparent`},children:[e.type===`image`?(0,$.jsx)(L6,{style:{color:`#3b82f6`,fontSize:16}}):(0,$.jsx)(X8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500},children:e.name||`媒体${t+1}`})]},e.url))]})]})]})}),(0,$.jsx)(nK,{title:Ve.size===1?`推送配置`:`批量推送配置`,open:k,onCancel:()=>{A(!1),M([[]]),P([``]),H([void 0]),W(new Map),K(``)},footer:null,width:900,mask:{closable:!1},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(w1.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:[`选中素材 (`,Ve.size,`个)`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,alignItems:`center`},children:[(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#64748b`},children:`统一修改名称:`}),(0,$.jsx)(wW,{value:G,onChange:e=>K(e.target.value),placeholder:`输入名称后点击应用`,style:{flex:1,borderRadius:8},size:`small`}),(0,$.jsx)(Z,{type:`primary`,size:`small`,onClick:()=>{G.trim()&&Ve.size>0&&ft(Array.from(Ve),G)},disabled:!G.trim()||Ve.size===0,style:{borderRadius:8},children:`应用`})]}),(0,$.jsx)(`div`,{style:{maxHeight:300,overflow:`auto`,border:`1px solid #f0f0f0`,borderRadius:8,padding:12},children:(()=>{let e=new Map;return s.forEach(t=>{t.items.forEach(t=>{let n=Je(t);e.set(n,t)})}),Array.from(Ve).map(t=>{let n=e.get(t);return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 0`,borderBottom:`1px solid #f5f5f5`},children:[(0,$.jsx)(`div`,{style:{width:60,height:40,borderRadius:4,backgroundColor:`#f5f5f5`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,flexShrink:0},children:(()=>{let e=a===`video`?n?.videoCoverUrl:n?.imageUrl;if(!e)return(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#94a3b8`},children:`预览`});let t=`https://ceshi.apiforeign.minzhongzc.com`,r=e.startsWith(`/`)?e.slice(1):e;return(0,$.jsx)(`img`,{src:`${t.endsWith(`/`)?t.slice(0,-1):t}/static/${r}&w=300&q=50`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})()}),(0,$.jsx)(`div`,{style:{flex:1,minWidth:0},children:(0,$.jsx)(w1.Text,{style:{fontSize:12,color:`#1e293b`},children:n?.fileName||`素材 ${n.id}`})}),(0,$.jsx)(wW,{value:U.has(t)?U.get(t):n?.fileName||``,onChange:e=>{let n=e.target.value,r=new Map(U);r.set(t,n),W(r)},onBlur:()=>{let e=U.get(t)||n?.fileName||``;e.trim()&&dt(t,e)},onKeyDown:e=>{if(e.key===`Enter`){let e=U.get(t)||n?.fileName||``;e.trim()&&dt(t,e)}},placeholder:`输入新名称`,style:{width:200,borderRadius:4},size:`small`})]},t)})})()})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(w1.Text,{style:{fontSize:14,color:`#475569`},children:`是否开启前测:`}),(0,$.jsx)(HC,{value:_e,onChange:e=>{ve(e),e===`1`?G5().then(e=>{be(e?.data?.id||``)}).catch(()=>{}):be(``)},style:{width:120},options:[{value:`1`,label:`是`},{value:`2`,label:`否`}]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(w1.Text,{style:{fontSize:14,color:`#475569`},children:`前测模板:`}),(0,$.jsx)(HC,{value:ye,onChange:e=>be(e),style:{width:200},disabled:_e!==`1`,loading:Ce,placeholder:_e===`1`?`选择前测模板`:`请先开启前测`,options:xe.map(e=>({value:e.id,label:e.name}))})]})]}),(0,$.jsx)(vL,{size:`small`,activeKey:se,onChange:e=>{ce(e),e===`history`&&at()},items:[{key:`new`,label:`新增账户`},{key:`history`,label:`历史账户`}]}),se===`new`&&(0,$.jsxs)(`div`,{children:[V.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:12,border:`1px solid #e2e8f0`,borderRadius:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(w1.Text,{strong:!0,style:{fontSize:14,color:`#475569`},children:[`授权账户 `,t+1]}),V.length>1&&(0,$.jsx)(Z,{type:`text`,danger:!0,onClick:()=>{let e=[...V],n=[...N],r=[...j],i=[...ae];e.splice(t,1),n.splice(t,1),r.splice(t,1),i.splice(t,1),H(e),P(n),M(r),oe(i)},children:`删除`})]}),(0,$.jsx)(HC,{value:e,onChange:e=>{let n=[...V];n[t]=e,H(n)},placeholder:`点击选择授权账户`,style:{width:`100%`,marginBottom:12,borderRadius:8},popupRender:()=>(0,$.jsx)(`div`,{style:{padding:8,width:800,maxHeight:500,overflow:`auto`},children:(0,$.jsx)(PQ,{dataSource:F,columns:[{title:`授权账户ID`,dataIndex:`accountId`,key:`accountId`,width:120},{title:`授权账户名称`,dataIndex:`accountName`,key:`accountName`,width:120},{title:`授权账户角色`,dataIndex:`accountRole`,key:`accountRole`,width:160,render:e=>({ADVERTISER:`客户`,CUSTOMER_ADMIN:`普通版工作台-管理员`,CUSTOMER_OPERATOR:`普通版工作台-协作者`,AGENT:`代理商`,CHILD_AGENT:`二级代理商`,PLATFORM_ROLE_STAR:`星图账户`,PLATFORM_ROLE_SHOP_ACCOUNT:`抖音店铺账户`,PLATFORM_ROLE_QIANCHUAN_AGENT:`千川代理商`,PLATFORM_ROLE_STAR_AGENT:`星图代理商`,PLATFORM_ROLE_AWEME:`抖音号`,PLATFORM_ROLE_STAR_MCN:`星图MCN机构`,PLATFORM_ROLE_STAR_ISV:`星图服务商`,AGENT_SYSTEM_ACCOUNT:`代理商系统账户`,PLATFORM_ROLE_LOCAL_AGENT:`本地推代理商`,PLATFORM_ROLE_YUNTU_BRAND_ISV_ADMIN:`云图品牌服务商管理员`,PLATFORM_ROLE_LIFE:`抖音来客账户`,PLATFORM_ROLE_ENTERPRISE_BP_ADMIN:`升级版工作台管理员`,PLATFORM_ROLE_ENTERPRISE_BP_OPERATOR:`升级版工作台协作者`})[e]||e},{title:`授权账户用户名`,dataIndex:`accountUsername`,key:`accountUsername`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:e?`#1e293b`:`#94a3b8`},children:e||`-`})},{title:`授权用户ID`,dataIndex:`accountUserid`,key:`accountUserid`,width:120}],loading:L,pagination:{current:ne,pageSize:ie,total:z,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{re(e),J(t),it(e,t)}},rowKey:`id`,size:`small`,scroll:{x:`max-content`},onRow:n=>({onClick:()=>{let e=String(n.id),r=[...V];r[t]={value:e,label:String(n.accountId)+`-`+(n.accountName||`-`)},H(r);let i=[...ae];i[t]=!1,oe(i)},style:{cursor:`pointer`,backgroundColor:e?.value===String(n.id)?`#e6f7ff`:void 0}})})}),open:ae[t],onOpenChange:e=>{let n=[...ae];n[t]=e,oe(n),e&&it(1,ie)},labelInValue:!0,fieldNames:{label:`accountUserid`,value:`id`}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:`粘贴账户ID(每行一个或用逗号分隔)`}),(0,$.jsx)(wW.TextArea,{value:N[t],onChange:e=>{let n=e.target.value,r=[...N];r[t]=n,P(r);let i=n.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0),a=[...new Set(i)].map(e=>({accountId:e})),o=new Set,s=a.filter(e=>o.has(e.accountId)?!1:(o.add(e.accountId),!0)),c=[...j];c[t]=s,M(c)},placeholder:`粘贴账户ID,每行一个或用逗号分隔,例如: 10001,10002,10003 10004`,rows:3,style:{borderRadius:8}})]},t)),(0,$.jsx)(Z,{type:`dashed`,block:!0,onClick:()=>{H([...V,void 0]),P([...N,``]),M([...j,[]]),oe([...ae,!1])},style:{borderRadius:8,marginBottom:16},children:`+ 新增授权账户组`})]}),se===`history`&&(0,$.jsx)(`div`,{style:{padding:8},children:de?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:40},children:`加载中...`}):le.length===0?(0,$.jsx)(fC,{description:`暂无可选账户`}):(0,$.jsx)(E$,{style:{width:`100%`},dataSource:le.filter(e=>e.advertiserId).map((e,t)=>({key:String(e.advertiserId)||`item-${t}`,title:String(e.advertiserId),description:e.advertiserName||``,...e})),targetKeys:pe.filter(e=>e.advertiserId).map(e=>String(e.advertiserId)),onChange:e=>{me(le.filter(t=>t.advertiserId&&e.includes(String(t.advertiserId))))},titles:[`可选账户列表`,`已选账户列表`],showSearch:!0,filterOption:(e,t)=>String(t.advertiserId).toLowerCase().includes(e.toLowerCase())||t.advertiserName&&t.advertiserName.toLowerCase().includes(e.toLowerCase()),children:({direction:e,filteredItems:t,onItemSelect:n,onItemSelectAll:r,selectedKeys:i,disabled:a})=>(0,$.jsx)(PQ,{rowSelection:{getCheckboxProps:()=>({disabled:a}),onChange:e=>{r(e,`replace`)},selectedRowKeys:i,selections:[PQ.SELECTION_ALL,PQ.SELECTION_INVERT,PQ.SELECTION_NONE]},columns:[{title:`账户ID`,dataIndex:`advertiserId`,key:`advertiserId`,width:120},{title:`账户名称`,dataIndex:`advertiserName`,key:`advertiserName`,width:150}],dataSource:t,size:`small`,style:{pointerEvents:a?`none`:void 0},pagination:!1,scroll:{x:`max-content`,y:400},onRow:({key:e,disabled:t})=>({onClick:()=>{t||a||n(e,!i.includes(e))}})})})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`flex-end`},children:[(0,$.jsx)(Z,{onClick:()=>{A(!1),M([[]]),P([``]),H([void 0]),W(new Map),K(``)},style:{borderRadius:8},children:`取消`}),(0,$.jsx)(Z,{type:`primary`,onClick:ut,loading:D,disabled:D||(se===`new`?j.every(e=>e.length===0):pe.length===0),style:{borderRadius:8},children:D?`推送中...`:`开始推送`})]})]})})]})},M9=document.createElement(`style`);M9.textContent=` @@ -610,4 +610,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho div::-webkit-scrollbar { display: none; } - `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(Sce,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jG,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(DB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${V9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:jce}=wW,Mce=`https://ceshi.apiforeign.minzhongzc.com`,K9=2,q9=15,Nce=e=>{if(!e)return!1;let t=e.supportsUniversalReference??e.supports_universal_reference,n=e.maxImageCount??e.max_image_count;return t!==!1&&(n==null||Number(n)>=1)};function J9(e){return e?/^https?:\/\//i.test(e)?e:`${Mce}${e}`:``}var Pce=S.memo(({record:e,onPreview:t})=>{let n=e.segmentVideoUrl;if(n)return(0,$.jsxs)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>t(J9(n)),children:[(0,$.jsx)(`video`,{src:J9(n),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]});let r=O9(e.splitStatus||e.split_status);return(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,fontSize:12},children:[r.active?(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}):null,(0,$.jsx)(`span`,{style:{color:r.failure?`#ef4444`:r.active?`#f59e0b`:`#94a3b8`},children:r.label})]})})});function Fce(){let{creatID:e}=Qe(),t=Je(),{user:n,optimizeHoldCredits:r}=l7(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),g=(0,S.useRef)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(5),[M,N]=(0,S.useState)(`9:16`),[P,F]=(0,S.useState)(`480p`),[I,L]=(0,S.useState)(!1),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[H,U]=(0,S.useState)([]),[W,G]=(0,S.useState)(null),[K,ee]=(0,S.useState)([]),[q,te]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,J]=(0,S.useState)(0),[ae,oe]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(!1),[le,ue]=(0,S.useState)(!1),de=(0,S.useRef)(null),fe=(0,S.useRef)(null),pe=(0,S.useRef)(null),me=(0,S.useMemo)(()=>J9(W?.videoUrl),[W?.videoUrl]);(0,S.useEffect)(()=>{P5().then(e=>{let t=e?.engine?.video||[];if(D(t),t.length>0){let e=t[0];k(e.id),N(e.supportedRatios?.includes(`9:16`)?`9:16`:e.supportedRatios?.[0]||`9:16`),F(e.supportedResolutions?.[0]||`480p`),j(e.supportedDurations?.[0]||5)}}).catch(()=>Q.error(`视频引擎加载失败`)),L5().then(e=>U(Array.isArray(e)?e:[])).catch(()=>U([]))},[]);let he=(0,S.useRef)(null),ge=E.find(e=>e.id===O),_e=!x||Nce(ge),ve=(0,S.useMemo)(()=>{let e=H.find(e=>e.modelConfigId===O&&e.genType===`video`&&e.resolution===P);if(!e)return 0;let t=(Number(e.baseCredits||0)+Number(e.perSecondCredits||0)*A)*Number(e.ratio||1);return x&&(t+=(Number(e.inputImageBaseCredits||0)+Number(e.inputImagePerImageCredits||0))*Number(e.inputImageRatio||1)),Number(t.toFixed(2))},[H,O,x,A,P]),ye=Number(n?.credits||0)K.length===0?`AI自动拆分`:K.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[K]),xe=(0,S.useCallback)(async()=>{if(e)try{G(await q5(e))}catch{Q.error(`获取任务详情失败`)}},[e]),Se=(0,S.useCallback)(async()=>{if(e)try{let t=await Sae(e,q,ne);ee(t.items||[]),J(t.total||0)}catch{Q.error(`获取拆镜列表失败`)}},[e,q,ne]),Ce=(0,S.useCallback)(e=>{p(e),h(!0)},[]),we=(0,S.useCallback)(async()=>{if(e)try{await Mae(e),Q.success(`重新分析已提交`),pe.current=Date.now(),await xe()}catch(e){Q.error(e?.message||`重新分析失败`)}},[e,xe]),Te=(0,S.useCallback)(async e=>{try{await Pae(e),Q.success(`重新分析已提交`),Se()}catch(e){Q.error(e?.message||`重新分析失败`)}},[Se]),Ee=(0,S.useCallback)(async e=>{try{await Fae(e),Q.success(`重新切割已提交`),await Se()}catch(e){Q.error(e?.message||`重新切割失败`)}},[Se]),De=(0,S.useCallback)(async e=>{try{await Nae(e),Q.success(`删除成功`),Se()}catch(e){Q.error(e?.message||`删除失败`)}},[Se]),Oe=(0,S.useCallback)(async()=>{await Promise.all([xe(),Se()])},[xe,Se]);(0,S.useEffect)(()=>(Oe(),()=>{de.current&&window.clearTimeout(de.current),fe.current&&window.clearTimeout(fe.current)}),[Oe]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&(L(!1),z(!1))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[]),(0,S.useEffect)(()=>{if(W?.analysisStatus!==`processing`||!e){pe.current=null,fe.current&&=(window.clearTimeout(fe.current),null);return}pe.current||=Date.now();let t=async()=>{if(document.visibilityState===`visible`)try{G(await q5(e))}catch{}},n=()=>{if(!fe.current)return;let e=Date.now()-(pe.current||Date.now()),r=e<6e4?3e3:e<6e5?1e4:3e4;fe.current=window.setTimeout(async()=>{await t(),n()},r)};fe.current=window.setTimeout(async()=>{await t(),n()},3e3);let r=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{fe.current&&=(window.clearTimeout(fe.current),null),document.removeEventListener(`visibilitychange`,r)}},[W?.analysisStatus,e]);let ke=K.some(e=>Qse(e));(0,S.useEffect)(()=>{if(!ke||!e){de.current&&=(window.clearTimeout(de.current),null);return}let t=async()=>{document.visibilityState===`visible`&&await Se()};de.current=window.setTimeout(()=>void t(),3e4);let n=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,n),()=>{de.current&&=(window.clearTimeout(de.current),null),document.removeEventListener(`visibilitychange`,n)}},[e,Se,ke]);let Ae=(e,t)=>{l(e),d(t),a(!0)},je=()=>{a(!1),l(null),v(``),d(``),b(``),C(``),T(``)},Me=async e=>{try{let t=await Kie(e);C(t.url),T(t.resource_id||``),Q.success(`图片上传成功`)}catch{Q.error(`图片上传失败,请重试`)}return!1},Ne=async()=>{if(!c){Q.warning(`请先选择拆镜片段`);return}if(!O){Q.warning(`请选择视频引擎`);return}if(!_e){Q.warning(`当前视频引擎不支持参考图片,请移除素材图片或切换引擎`);return}if(ye){Q.warning(`积分不足,请充值后再创建复刻项目`);return}let e=he.current,n=e?.segmentId===c?e.key:`shot_v2_${c}_${Date.now()}_${Math.random().toString(16).slice(2)}`;he.current={segmentId:c,key:n};let r={target_project_name:_.trim(),core_content_point:y.trim(),project_description:y.trim()||void 0,material_image_url:x||void 0,material_image_resource_id:w||void 0,video_config:{engine_id:O,duration:A,aspect_ratio:M,resolution:P},idempotency_key:n};oe(!0);try{let e=await Cae(c,r),n=e?.projectId||e?.id||e?.detail?.id;he.current=null,Q.success(`项目已创建,视频提词正在生成`),je(),await Se(),n&&t(`/removelens/${n}/removefenbu?flow_version=v2`)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Q.error(t||`创建失败,请重试`)}finally{oe(!1)}},Pe=async()=>{if(e){ue(!0);try{let t=K.some(e=>e.sourceMode===`ai_suggestion`);await bae(e,{selected_indices:[],replace_existing:t}),Q.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await Oe()}catch(e){Q.error(e?.message||`拆镜失败`)}finally{ue(!1)}}},Fe=()=>{if(!me){Q.warning(`原视频地址不存在`);return}s(!0)},Ie=async t=>{if(e){if(t.durationSecondq9){Q.warning(`拆镜片段不能超过 ${q9} 秒`);return}ce(!0);try{await xae(e,{start_second:t.startSecond,end_second:t.endSecond}),Q.success(`手动拆镜任务已提交`),s(!1),await Oe()}catch(e){Q.error(e?.message||`手动拆镜失败`)}finally{ce(!1)}}},Le=e=>(e?.splitStatus||e?.split_status)===`completed`&&!!(e?.segmentVideoUrl||e?.segment_video_url),Re=(0,S.useMemo)(()=>[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(qQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(qQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(Pce,{record:t,onPreview:Ce})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=O9(t.split_status||t.splitStatus);if(n.active)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:n.label})]});if(n.failure)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:n.label});if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let r=D9(t.analysis_status||t.analysisStatus);return r.active?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:r.label})]}):r.failure?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:r.label}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:r.key&&r.key!==`completed`?r.label:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:200,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[n.moduleProjectId?(0,$.jsx)(Z,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu?flow_version=${n.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(Z,{type:`text`,onClick:()=>Ae(String(n.id),n.segmentName),disabled:!Le(n),style:{color:Le(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:Le(n)?`视频生成`:`待切割完成`}),D9(n.analysisStatus||n.analysis_status).failure&&(0,$.jsx)(Z,{type:`text`,onClick:()=>Te(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),O9(n.splitStatus||n.split_status).failure&&(0,$.jsx)(Z,{type:`text`,onClick:()=>Ee(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(oK,{title:`确定删除此片段?`,onConfirm:()=>De(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(Z,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],[]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>t(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{style:{fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`一键拆解画面分镜,助力仿拍或创作`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),W?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`,cursor:`pointer`},onClick:()=>{p(me),h(!0)},onMouseEnter:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`1`)},onMouseLeave:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`0`)},children:[(0,$.jsx)(`video`,{src:me,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:0,transition:`opacity 0.2s`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#6366f1`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})})})]}),W.analysisStatus===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(Z,{onClick:we,style:{width:`100%`,padding:`6px 16px`,borderRadius:8,fontSize:12,border:`1px solid #ef4444`,color:`#ef4444`,background:`rgba(239, 68, 68, 0.05)`,cursor:W.analysisStatus===`processing`?`not-allowed`:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{W.analysisStatus!==`processing`&&(e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`)},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.05)`},children:W.analysisStatus===`processing`?`分析中...`:`重新分析`})})]}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,W.createdAt?new Date(W.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:W.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),W.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):W.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(W.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(qQ,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):W.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),W.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):W.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6,height:100,overflowY:`auto`},children:W.originalVideoContent}):W.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(Z,{type:`default`,onClick:Fe,disabled:!me||se||W?.analysisStatus===`processing`,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(oK,{title:be===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:Pe,children:(0,$.jsxs)(Z,{type:`primary`,loading:le,disabled:le||W?.analysisStatus===`processing`,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:be}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),W?.aiSuggestions&&W.aiSuggestions.length>0&&(0,$.jsx)(jw,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(W?.ai_suggestions||W?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,styles:{container:{backgroundColor:`#fff`,height:300,overflowY:`auto`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`}},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,K.length,` 个片段`]})]}),(0,$.jsx)(PQ,{columns:Re,dataSource:K,pagination:{current:q,pageSize:ne,total:ie,onChange:(e,t)=>{te(e),re(t)},showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`,height:80,overflow:`auto`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(255, 255, 255, 1)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Ace,{open:o,videoUrl:me,title:`手动视频切片`,loading:se,minDuration:K9,maxDuration:q9,onCancel:()=>s(!1),onConfirm:Ie}),(0,$.jsx)(BV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),u&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,u]})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),je()},style:{width:24,height:24,border:`none`,background:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:20},children:`×`})]}),placement:`right`,closable:!1,onClose:je,open:i,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`素材图片(可选)`}),x?(0,$.jsxs)(`div`,{style:{width:120,height:120,borderRadius:8,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`img`,{src:J9(x),alt:`素材图`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`button`,{onClick:()=>{C(``),T(``)},style:{position:`absolute`,bottom:4,right:4,width:24,height:24,borderRadius:`50%`,backgroundColor:`rgba(0,0,0,.5)`,border:`none`,cursor:`pointer`},children:(0,$.jsx)(s$,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&Me(e[0])},onHistorySelect:e=>{let t=e[0];t&&(C(t.resourceUrl||t.previewUrl||t.displayUrl||``),T(t.id),Q.success(`历史图片已选择`))},children:(0,$.jsxs)(`div`,{style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99,102,241,.3)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,gap:6},children:[(0,$.jsx)(JI,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传或选择历史图片`})]})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`项目名称(可选)`}),(0,$.jsx)(wW,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入项目名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`项目描述(可选)`}),(0,$.jsx)(jce,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入项目描述`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`视频参数`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{L(!I),z(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:E.find(e=>e.id===O)?.name||`选择引擎`})]}),I&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:E.filter(e=>e.supportsUniversalReference!==!1).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{k(e.id),V({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(M)||N(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(P)||F(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(A)||j(e.supportedDurations?.[0]||5),L(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:O===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:O===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:O===e.id?600:500,color:O===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{z(!R),L(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[M,` · `,A,`s · `,P]})]}),R&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:B.ratios.map(e=>{let[t,n]=e.split(`:`).map(Number),r=t>=n?18:Math.round(t/n*18),i=n>=t?18:Math.round(n/t*18);return(0,$.jsxs)(`button`,{onClick:()=>N(e),style:{flex:`0 0 calc(12.5% - 4px)`,minWidth:44,height:52,borderRadius:6,border:M===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:M===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:r,height:i,border:`2px solid ${M===e?`#6366f1`:`#9ca3af`}`,borderRadius:3,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:M===e?`#6366f1`:`#6b7280`,fontWeight:M===e?600:400},children:e})]},e)})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(A-Math.min(...B.durations))/(Math.max(...B.durations)-Math.min(...B.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...B.durations),max:Math.max(...B.durations),value:A,onChange:e=>j(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:A}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:B.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>F(e),style:{flex:1,height:42,borderRadius:8,border:P===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:P===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:P===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(`div`,{style:{color:_e?`#6366f1`:`#ef4444`,fontSize:13},children:_e?``:`当前引擎不支持参考图片,请移除素材图片或切换引擎。`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(jw,{title:(n?.credits||0){if((n?.credits||0)h(!1),afterClose:()=>{g.current&&(g.current.pause(),g.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:g,controls:!0,src:f||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":`true`,autoPlay:!0})})})]})}var{Title:Ice,Text:Y9}=w1,{TextArea:Lce}=wW;function Rce(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var X9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function zce(){let e=Je(),{creatID:t}=Qe(),[n]=Dn(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)([]),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(``),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`image`),[v,y]=(0,S.useState)({}),[b,x]=(0,S.useState)(null),C=(0,S.useRef)(null),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)({}),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(!1),[W,G]=(0,S.useState)(5),[K,ee]=(0,S.useState)(`16:9`),[q,te]=(0,S.useState)(`480p`),[ne,re]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[ie,J]=(0,S.useState)([]),[ae,oe]=(0,S.useState)(1),[se,ce]=(0,S.useState)(20),[le,ue]=(0,S.useState)(0),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)({}),[he,ge]=(0,S.useState)([]),[_e,ve]=(0,S.useState)([]),[ye,be]=(0,S.useState)(!1),[xe,Se]=(0,S.useState)(``),[Ce,we]=(0,S.useState)(`image`),Te=S.useRef(null);(0,S.useEffect)(()=>{if(ye&&Ce===`video`){let e=()=>{Te.current&&Te.current.play().catch(()=>{})};Te.current&&(Te.current.readyState>=2?e():Te.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Te.current&&(Te.current.removeEventListener(`loadedmetadata`,e),Te.current.pause())}}else Te.current&&Te.current.pause()},[ye,Ce]);let Ee=r===`v2`,De=(0,S.useMemo)(()=>Ee?[{id:1,title:`素材与项目信息`,description:`固定片段素材和项目描述`,childId:1},{id:2,title:`生成视频提示词`,description:`生成并确认视频提示词`,childId:4},{id:3,title:`生成最终视频`,description:`使用当前视频提示词生成视频`,childId:5}]:[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}],[Ee]),Oe=(0,S.useMemo)(()=>De.map((e,t)=>({...e,status:he[t]?.status||``,id:he[t]?.id||t,output:he[t]?.output||``,input:he[t]?.input||{},engineId:he[t]?.input?.payload?.videoConfig?.engineId||``})),[De,he]),ke=(0,S.useRef)(``);(0,S.useEffect)(()=>{let e=Oe.filter(e=>e.status===`processing`).map(e=>String(e.childId)),t=JSON.stringify(e);t!==ke.current&&(ke.current=t,ve(e))},[Oe]);let Ae=(e,t,n)=>{K5(e,t,n).then(e=>{e.items&&J(e.items),e.total!==void 0&&ue(e.total)}).catch(e=>{})},je=(e,t)=>{oe(e),ce(t),Ae(e,t,de)},Me=()=>{Ae(1,20,de)};(0,S.useEffect)(()=>{Ae(ae,se,de)},[]),(0,S.useEffect)(()=>{P5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(F({video:t,image:n}),t.length>0){L(t[0].id);let e=t[0];re({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]})}n.length>0&&z(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{C.current&&=(clearInterval(C.current),null)},[]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(V(!1),U(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{Q.error(e?.message||`加载任务详情失败`)})},[t,r]),(0,S.useEffect)(()=>{let e=pe?.status===`processing`||he.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(Le,3e4):!e&&C.current&&(clearInterval(C.current),C.current=null)},[pe?.status,he,t,r]),(0,S.useEffect)(()=>{L5().then(e=>{l(e)}).catch(()=>{})},[]);let Ne=()=>{let e={};e=c.find(e=>e.modelConfigId===I&&e.genType===`video`&&e.resolution===q),e||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let t=(W*e.perSecondCredits+e.baseCredits)*e.ratio,n=pe?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=Ee?+!!pe?.material?.materialImageUrl:pe?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}d(Number(t.toFixed(2)))},Pe=()=>{let e=Oe[1]?.input?.payload?.videoConfig||Oe[1]?.input?.payload?.video_config;if(!e)return 0;let t=e?.engineId||e?.engine_id,n=e?.resolution,r=e?.duration||W,i={};i=c.find(e=>e.modelConfigId===t&&e.genType===`video`&&e.resolution===n),i||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let a=(r*i.perSecondCredits+i.baseCredits)*i.ratio,o=pe?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=Ee?+!!pe?.material?.materialImageUrl:pe?.videoGeneration?.inputMedia?.image?.length||0;if(s>0){let e=((i.inputImageBaseCredits||0)+(i.inputImagePerImageCredits||0)*s)*(i.inputImageRatio||1);a+=e}return Number(a.toFixed(2))};(0,S.useEffect)(()=>{c.length>0&&I&&Ne()},[c,I,W,q,pe]);let Fe=(e,t,n,r)=>{_(t||`image`),T(n?String(n):``),t===`video`?(x(r||null),y(e&&typeof e==`object`?Rce(e):{}),p(``)):(x(null),p(e||``),y({})),s(!0)},Ie=async()=>{if(g===`image`){if(!pe?.id||!w){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!f||!f.trim()){Q.warning(`图片提示词不能为空`);return}D(!0);try{await Oae(pe.id,w,{prompt:f.trim()}),Q.success(`图片提示词已保存`),Re(),s(!1),T(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{D(!1)}return}if(!pe?.id||!w){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!v||typeof v!=`object`||Object.keys(v).length===0){Q.warning(`视频提示词不能为空`);return}if(!b){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=h9(v,b);if(e){Q.warning(e);return}D(!0);try{await(Ee?Tae:kae)(pe.id,w,{prompt_schema:v}),Q.success(`视频提示词已保存`),Re(),s(!1),T(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{D(!1)}},Le=()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Re=()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{Q.error(e?.message||`刷新任务详情失败`)})},ze=(e,t)=>{Se(e),we(t),be(!0)},Be=()=>{be(!1),Se(``),Te.current&&Te.current.pause()},Ve=e=>{if(e.preventDefault(),e.stopPropagation(),!xe)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${xe}&download=1`,t.download=Ce===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},He=e=>{Dae(pe.id,e.toString()).then(e=>{Q.info(`正在生成图片提示词,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ue=e=>{let t={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};Y5(pe.id,e.toString(),t).then(e=>{Q.info(`正在生成图片,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},We=()=>{let e={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};Y5(pe.id,Oe[1].id.toString(),e).then(e=>{Q.info(`正在生成图片,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ge=e=>{let t={engine_id:I,duration:W,aspect_ratio:K,resolution:q,target_platform:`抖音`};Aae(pe.id,e.toString(),t).then(e=>{Q.info(`正在生成视频提示词,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ke=async(e,t)=>{try{Ee?await Eae(pe.id,String(e)):await jae(pe.id,String(e),{engine_id:t||``}),Q.info(`正在生成视频,请稍候...`),Re()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)}},qe=async()=>{let e=Ee?Oe[1]:Oe[3];e?.id&&await Ke(e.id,e.engineId||``)},Ye=async e=>{if(!(!Ee||!pe?.id||!e||!I)){N(!0);try{await wae(pe.id,e,{video_config:{engine_id:I,duration:W,aspect_ratio:K,resolution:q}}),Q.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Re()}catch(e){Q.error(e?.message||`重新生成视频提示词失败`)}finally{N(!1)}}};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>window.history.back(),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>h(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:pe?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>pe?.material?.materialVideoUrl&&ze(pe.material.materialVideoUrl,`video`),children:pe?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:X9(pe.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:pe?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>pe?.material?.materialImageUrl&&ze(pe.material.materialImageUrl,`image`),children:pe?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:X9(pe.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),pe?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ze(pe.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),pe?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsxs)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`,position:`relative`},onClick:()=>ze(pe.finalVideoUrl,`video`),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(a_,{activeKey:_e,onChange:ve,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Oe.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(u4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Y9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:pe?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:X9(pe.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Y9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:pe?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:X9(pe.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`原产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.sourceProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`自有产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.targetProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`产品卖点:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.coreContentPoint||`-`})]})]}),!Ee&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0)Fe(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(Z,{onClick:()=>{Ue(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[pe.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>We(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{V(!B),U(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(Y9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:P.video?.find(e=>e.id===I)?.name||`选择引擎`})]}),B&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:P.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{L(e.id),re({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(K)||ee(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(q)||te(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(W)||G(e.supportedDurations?.[0]||5),V(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:I===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:I===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:I===e.id?600:500,color:I===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{U(!H),V(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(Y9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[K,` · `,W,`s · `,q]})]}),H&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:ne.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>ee(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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 ${K===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:K===e?`#6366f1`:`#6b7280`,fontWeight:K===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Y9,{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:`${(W-Math.min(...ne.durations))/(Math.max(...ne.durations)-Math.min(...ne.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...ne.durations),max:Math.max(...ne.durations),value:W,onChange:e=>G(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:W}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ne.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>te(e),style:{flex:1,height:42,borderRadius:6,border:q===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let e=Oe[1]?.input?.payload?.videoConfig||Oe[1]?.input?.payload?.video_config,t=e?.engineId||e?.engine_id,n=t?(P.video||[]).find(e=>String(e.id)===String(t))?.name:``;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`引擎:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:n||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`比例:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.aspectRatio||e?.aspect_ratio||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`分辨率:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.resolution||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`时长:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.duration||`-`})]})]})})()})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>Fe(pe?.videoGeneration?.promptSchema,`video`,e.id,pe?.videoGeneration?.schemaConfigSnapshot),style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!pe?.videoGeneration?.promptSchema||!pe?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),Ee&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let t=Pe();if((i?.credits||0){let e=Pe();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${pe?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(nK,{open:O,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#6366f1`,letterSpacing:.4},children:`重新生成视频提词`})]}),onCancel:()=>k(!1),width:400,footer:null,centered:!0,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(HC,{value:I,onChange:e=>{let t=P.video?.find(t=>t.id===e);t&&(L(t.id),re({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]}),t.supportedRatios?.includes(K)||ee(t.supportedRatios?.[0]||`16:9`),t.supportedResolutions?.includes(q)||te(t.supportedResolutions?.[0]||`720p`),t.supportedDurations?.includes(W)||G(t.supportedDurations?.[0]||5))},style:{width:`100%`,borderRadius:8},options:P.video?.map(e=>({value:e.id,label:e.name})),placeholder:`请选择引擎`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:ne.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>ee(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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 ${K===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:K===e?`#6366f1`:`#6b7280`,fontWeight:K===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(W-Math.min(...ne.durations))/(Math.max(...ne.durations)-Math.min(...ne.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...ne.durations),max:Math.max(...ne.durations),value:W,onChange:e=>G(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:W}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ne.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>te(e),style:{flex:1,height:42,borderRadius:8,border:q===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(Z,{onClick:()=>k(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(Z,{onClick:()=>{if(!I){Q.warning(`请选择视频引擎`);return}Ye(A),k(!1)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:!I,children:`确认生成`})]})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:g===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:o,onCancel:()=>{E||s(!1)},footer:[(0,$.jsx)(Z,{onClick:()=>s(!1),disabled:E,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(Z,{type:`primary`,onClick:Ie,loading:E,disabled:E,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:g===`image`?(0,$.jsx)(Lce,{value:f,onChange:e=>p(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(S9,{value:v,schemaConfigSnapshot:b,onChange:y})})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:m,onCancel:()=>h(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:de,onChange:e=>fe(e.target.value),onPressEnter:Me,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(Z,{type:`primary`,onClick:Me,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(Z,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:ie,rowKey:`id`,pagination:{current:ae,pageSize:se,total:le,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:je,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]}),(0,$.jsx)(nK,{open:ye,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:Be,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:Ve,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Ce===`image`?(0,$.jsx)(`img`,{src:xe.startsWith(`http`)?xe:`https://ceshi.apiforeign.minzhongzc.com${xe}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Te,src:xe.startsWith(`http`)?xe:`https://ceshi.apiforeign.minzhongzc.com${xe}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var Bce=({asset:e,index:t,onPreview:n})=>{let[r,i]=(0,S.useState)(!1);return(0,$.jsx)(`div`,{className:`project-card`,onClick:()=>n(e),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,flexShrink:0,width:`18%`,position:`relative`},children:(0,$.jsx)(`div`,{style:{position:`relative`,aspectRatio:`9/16`},children:e.mediaType===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},muted:!0,playsInline:!0}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(K6,{style:{fontSize:24,color:`#fff`}})})})]}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,alt:e.title||`素材 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})})};function Vce(e){if(!e)return`-`;let t=String(e).trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``);let[r=``,i=``]=t.split(`T`),[,a=``,o=``]=r.split(`-`),s=i.slice(0,5);return!a||!o?`-`:`${a}-${o} ${s}`}var Hce=()=>{let e=Je(),[t,n]=(0,S.useState)(`project`),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),_=(0,S.useRef)(null),v=(0,S.useRef)(``),[y,b]=(0,S.useState)(`cases`),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(null);(0,S.useEffect)(()=>{Yae().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),e7(t).then(e=>{e?.categories?.[0]?.assets&&f(e.categories[0].assets)})}})},[]),(0,S.useEffect)(()=>()=>{E.current&&=(E.current.pause(),null),T(null),C(null),document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()})},[]),(0,S.useEffect)(()=>{if(!p){E.current&&=(E.current.pause(),null),T(null),C(null),g(``),v.current=``,document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()});return}let e=p.id||p.url;v.current=e;let t=(e,n)=>n===0?e:t(n,e%n),n=p.width||p.videoWidth||p.imageWidth||0,r=p.height||p.videoHeight||p.imageHeight||0;if(n&&r){let e=t(n,r);g(`${n/e}:${r/e}`);return}if(g(``),p.mediaType===`video`){let n=_.current,r=()=>{if(v.current!==e)return;let r=n.videoWidth,i=n.videoHeight;if(!r||!i)return;let a=t(r,i);g(`${r/a}:${i/a}`)};if(n?.removeEventListener(`loadedmetadata`,r),n&&n.videoWidth&&n.videoHeight){let e=t(n.videoWidth,n.videoHeight);g(`${n.videoWidth/e}:${n.videoHeight/e}`)}else n?.addEventListener(`loadedmetadata`,r);return()=>{n?.removeEventListener(`loadedmetadata`,r)}}else{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(v.current!==e)return;let r=n.width,i=n.height;if(!r||!i){g(`未知`);return}let a=t(r,i);g(`${r/a}:${i/a}`)},n.onerror=()=>{v.current===e&&g(`未知`)},n.src=`https://ceshi.apiforeign.minzhongzc.com${p.url}`}},[p]),(0,S.useEffect)(()=>{(async()=>{try{Wae(10).then(e=>{for(let t in e)e[t].forEach(e=>{e.type=t,o(t=>[...t,e])});o(e=>e)})}catch{}})()},[]);let D=e=>{n(e)},O=[{icon:(0,$.jsx)(eH,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)(s8,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(eH,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(g8,{style:{fontSize:24}}),title:`拆镜复刻`,description:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`,action:`开始拆镜`,path:`/removelens`}],k=[{key:`all`,label:`全部`},{key:`project`,label:`项目媒体`},{key:`chatAi`,label:`AI成片`},{key:`hotOpeningReplicate`,label:`爆款复刻`},{key:`shotReplicate`,label:`拆镜复刻`}],A=t===`all`?a:a.filter(e=>e.type===t);return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,borderRadius:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsx)(`h3`,{children:`首页工作台 `}),(0,$.jsxs)(`p`,{style:{cursor:`pointer`,fontSize:12,letterSpacing:.3,padding:`10px 16px`,backgroundColor:`#ffffffff`,borderRadius:30,boxShadow:`0px 4px 12px 0px rgba(0, 0, 0, 0.1)`},children:[`如需进行账户素材推送:`,(0,$.jsxs)(`span`,{style:{color:`#1a50bbff`},onClick:()=>{e(`/authorization`)},children:[`一键推送`,(0,$.jsx)(S2,{style:{marginLeft:8,transform:`rotate(0deg)`}})]})]})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,borderRadius:2,background:`linear-gradient(180deg, #6366f1, #a855f7)`}}),(0,$.jsx)(`div`,{style:{fontSize:17,fontWeight:700,color:`#1f2937`,letterSpacing:.3},children:`AI 创作入口`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`一键开启智能创作`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:12},children:O.map((t,n)=>{let r=[{color:`#3b82f6`,light:`rgba(59,130,246,0.12)`,tag:`项目`},{color:`#6366f1`,light:`rgba(99,102,241,0.12)`,tag:`复刻`},{color:`#f97316`,light:`rgba(249,115,22,0.12)`,tag:`拆镜`},{color:`#10b981`,light:`rgba(16,185,129,0.12)`,tag:`云创`}],i=r[n]||r[0];return(0,$.jsxs)(`div`,{onClick:()=>e(t.path),className:`project-card`,style:{flex:`1 1 280px`,minWidth:280,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`,transition:`all 0.3s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,display:`flex`,alignItems:`center`,gap:14,minHeight:96},onMouseEnter:e=>{e.currentTarget.style.borderColor=i.color,e.currentTarget.style.boxShadow=`0 8px 24px ${i.light}`,e.currentTarget.style.background=i.light,e.currentTarget.style.transform=`translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.boxShadow=`none`,e.currentTarget.style.background=`#fff`,e.currentTarget.style.transform=`translateY(0)`},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:i.light,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:`all 0.3s ease`,color:i.color},onMouseEnter:e=>{e.currentTarget.style.background=i.color,e.currentTarget.style.color=`#fff`},onMouseLeave:e=>{e.currentTarget.style.background=i.light,e.currentTarget.style.color=i.color},children:(0,$.jsx)(`span`,{style:{fontSize:20,display:`flex`,transition:`all 0.3s ease`},children:t.icon})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,flex:1,minWidth:0},children:t.title}),(0,$.jsx)(`span`,{style:{fontSize:10,color:i.color,padding:`2px 7px`,borderRadius:4,background:i.light,fontWeight:600,flexShrink:0},children:i.tag})]}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,lineHeight:1.5,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:t.description})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,color:i.color,fontSize:13,fontWeight:600,flexShrink:0},children:[t.action,(0,$.jsx)(S2,{style:{fontSize:12}})]})]},n)})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:[{key:`cases`,label:`素材案例`},{key:`works`,label:`近期作品`}].map(e=>(0,$.jsx)(`button`,{onClick:()=>b(e.key),style:{padding:`6px 16px`,borderRadius:8,fontSize:13,fontWeight:500,border:`none`,cursor:`pointer`,transition:`all 0.25s ease`,background:y===e.key?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#f1f5f9`,color:y===e.key?`#fff`:`#64748b`},children:e.label},e.key))})}),y===`works`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(vL,{activeKey:t,onChange:D,items:k.map(e=>({key:e.key,label:e.label})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(5, 1fr)`,gap:16},children:A.length===0?(0,$.jsxs)(`div`,{style:{gridColumn:`1 / -1`,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(L6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无作品`})]}):A.map(t=>(0,$.jsxs)(`div`,{className:`project-card`,onClick:()=>{let n=t.moduleProjectId;t.type===`hotOpeningReplicate`&&n!=null?e(`/initial/${n}/initialinfo?flow_version=${t.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`):t.type===`shotReplicate`&&n!=null?e(`/removelens/${n}/removefenbu?flow_version=${t.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`):t.type===`chatAi`?e(`/conversation`):t.type===`project`&&e(`/project`)},style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`},children:[(()=>{let e=t.type!==`hotOpeningReplicate`&&(String(t.resourceType??``).toLowerCase()===`image`||t.resourceType===1||String(t.resourceType??``)===`1`),n=``;return n=e?`/static`+t.resultUrl+`&w=300&p=50`||``:(t.type,t.coverUrl||t.resultUrl||t.resultUrl||``),(0,$.jsx)(`img`,{src:n?n.startsWith(`http`)?n:`https://ceshi.apiforeign.minzhongzc.com`+n:``,alt:t.title||t.name||`作品`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})(),String(t.resourceType??``).toLowerCase()===`image`?null:(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.2)`},children:(0,$.jsx)(X8,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,background:`#f8fafc`,paddingTop:0},children:(0,$.jsxs)(`div`,{style:{marginTop:6,display:`flex`,alignItems:`center`,gap:6,fontSize:12,color:`#64748b`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,padding:`1px 6px`,border:`1px solid #3b82f6`,borderRadius:4,color:`#3b82f6`,fontSize:11,fontWeight:500,background:`#fff`,lineHeight:1.4,whiteSpace:`nowrap`},children:{project:`项目媒体`,chatAi:`AI成片`,hotOpeningReplicate:`爆款复刻`,shotReplicate:`拆镜复刻`}[t.type]||`其他`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`·`}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:Vce(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(vL,{activeKey:l,onChange:e=>{u(e),e7(e).then(e=>{e?.categories?.[0]?.assets?f(e.categories[0].assets):f([])})},items:s.map(e=>({key:e.id,label:e.name})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`flex`,flexWrap:`wrap`,gap:16,justifyContent:`flex-start`,overflowX:`auto`,paddingBottom:8},children:d.length===0?(0,$.jsxs)(`div`,{style:{flex:1,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(L6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无素材`})]}):d.map((e,t)=>(0,$.jsx)(Bce,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(nK,{open:!!p,onCancel:()=>{_.current?.pause(),m(null),g(``),v.current=``},footer:null,width:900,centered:!0,className:`preview-modal`,style:{borderRadius:16,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,height:580,paddingTop:30},children:[(0,$.jsx)(`div`,{style:{flex:1,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24},children:(0,$.jsxs)(`div`,{style:{maxWidth:`100%`,maxHeight:500,borderRadius:12,overflow:`hidden`,background:`#0f172a`},children:[p?.mediaType===`video`?(0,$.jsx)(`video`,{ref:_,src:`https://ceshi.apiforeign.minzhongzc.com${p.url}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`},"webkit-playsinline":`true`}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${p?.url}`,alt:p?.title,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`}}),p?.mediaType===`video`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:32,right:32,fontSize:11,color:`#fff`,background:`rgba(0,0,0,0.6)`,padding:`3px 8px`,borderRadius:4},children:`AI生成`})]})}),(0,$.jsxs)(`div`,{style:{flex:1,padding:24,overflowY:`auto`},children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#fff`,marginBottom:16},children:`创意详情`}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:16},children:[(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`比例:`}),h||`计算中...`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#000000ff`,marginBottom:8},children:`视频提示词`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#000000ff`,lineHeight:1.6},children:p?.generationPrompt})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:`视频参考图`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:p?.mediaReferences&&p.mediaReferences.length>0?p.mediaReferences.map((e,t)=>{let n=e.url||e.resourceUrl||e.previewUrl||``,r=n.startsWith(`http`)?n:`https://ceshi.apiforeign.minzhongzc.com${n}`;return e.type===`video`?(0,$.jsxs)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(`video`,{src:r,muted:!0,onClick:e=>{e.stopPropagation();let n=e.currentTarget;x===t?(n.pause(),C(null)):(document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()}),n.play(),C(t))},className:`preview-video-item`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),x!==t&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(X8,{style:{fontSize:18,color:`#fff`}})})]},t):e.type===`audio`?(0,$.jsx)(`div`,{onClick:e=>{if(e.stopPropagation(),w===r)E.current&&E.current.pause(),T(null);else{E.current&&E.current.pause();let e=new Audio(r);E.current=e,e.onended=()=>{T(null)},e.play(),T(r)}},style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:w===r?(0,$.jsx)(O6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(O2,{style:{fontSize:24,color:`#fff`}})},t):(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`},children:(0,$.jsx)(`img`,{src:r,alt:`参考图 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})},t)}):(0,$.jsx)($.Fragment,{})})]})]})]}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,borderTop:`1px solid #334155`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(Z,{onClick:()=>{e(`/conversation`,{state:{generationPrompt:p?.generationPrompt,mediaReferences:p?.mediaReferences,aspectRatio:h}})},style:{padding:`8px 24px`,borderRadius:8,background:`#3b82f6`,border:`none`,color:`#fff`,fontSize:13,fontWeight:500},children:`去AI创作`})})})]})]})},{RangePicker:Uce}=rV,Z9={borderRadius:8,fontWeight:600},Q9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Wce=()=>{let e=Je(),[t]=Dn(),{message:n}=rx.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`advertiserId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,HE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10,r,a)=>{c(!0);try{let n=await Bae({advertiser_id:a??w,consume_date:r??E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await Q5()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{document.referrer.includes(window.location.origin)?e(-1):e(`/materials`)},I=()=>{b(1),M(1,x)},L=()=>{nK.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(rV,{value:(0,HE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,HE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(wW,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await Vae({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},R=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[t.get(`advertiserId`)&&(0,$.jsx)(Z,{type:`text`,icon:(0,$.jsx)(y2,{}),onClick:F}),(0,$.jsx)(Y4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,$.jsx)(wW,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180,borderRadius:8},allowClear:!0,onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(Uce,{value:E?[(0,HE.default)(E[0]),(0,HE.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)},style:{borderRadius:8}}),(0,$.jsx)(Z,{type:`primary`,onClick:I,style:{...Z9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)($re,{}),onClick:L,loading:l,style:Z9,children:`拉取消耗`}),(0,$.jsx)(Z,{icon:(0,$.jsx)(x8,{}),onClick:()=>f(!0),style:{...Z9,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(PQ,{dataSource:P,columns:R,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(uG,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(nK,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(wW,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(kR,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(kR,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(Z,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(Z,{size:`small`,onClick:async()=>{try{let e=((await Q5()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(w1.Text,{children:n?.description||e}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Gce=()=>{let e=Je(),[t]=Dn(),{message:n}=rx.useApp(),[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)(!0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);(0,S.useEffect)(()=>{let r=t.get(`auth_code`),a=t.get(`state`);if(!r||!a){o(!1),i(10);return}let s={auth_code:r,state:a,app_id:t.get(`app_id`)||void 0,material_auth_status:t.get(`material_auth_status`)||void 0,scope:t.get(`scope`)||void 0,uid:t.get(`uid`)||void 0};(async()=>{try{let t=await mae(s);c(!0),o(!1),n.success(t?.message||`授权成功`),setTimeout(()=>{e(`/authorization`)},1500)}catch(e){let t=e?.message||`授权失败`;u(t),o(!1),n.error(t)}})();let l=setInterval(()=>{i(e=>e>=11?(o(!1),e):e+1)},1e3);return()=>{clearInterval(l)}},[e,t,n]);let d=()=>{i(0),o(!0),c(!1),u(``),window.location.href=`/authorization`};return s?(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`#dcfce7`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:(0,$.jsx)(w1.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`},children:`正在跳转至授权管理页面...`})]})}):(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:a&&r<10?(0,$.jsx)(jG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(XB,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(fq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):r>=10?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(fq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(XB,{style:{color:`#6366f1`}}),(0,$.jsxs)(w1.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},Kce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fed7aa 100%)`,border:`1px solid rgba(245, 158, 11, 0.18)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #f59e0b 0%, #d97706 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(245, 158, 11, 0.3)`},children:(0,$.jsx)(L2,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700,backgroundImage:`linear-gradient(90deg, #f59e0b 0%, #d97706 30%, #ea580c 50%, #d97706 70%, #f59e0b 100%)`},children:`行业爆款大盘`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#b45309`},children:[(0,$.jsx)(i8,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(w1.Text,{style:{color:`#78716c`,fontSize:14,lineHeight:1.7},children:`实时追踪各行业爆款素材,把握创作风向,打造热门内容`})]}),(0,$.jsx)(`div`,{style:{position:`relative`},children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(H8,{style:{marginRight:8,color:`#6366f1`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`爆款素材榜单`}),(0,$.jsx)(`span`,{style:{marginLeft:10,fontSize:12,fontWeight:400,color:`#94a3b8`}})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,zIndex:1,inset:0,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:2,color:`#fff`,borderRadius:6},children:(0,$.jsxs)(Z,{type:`primary`,size:`middle`,onClick:()=>{Q.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(Y3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(S2,{style:{marginLeft:4,fontSize:12}})]})}),[{rank:1,title:`夏日美妆教程:3 步打造奶油肌`,author:`美妆博主·小雅`,views:`128.4w`,likes:`12.6w`,comments:`8,234`,tag:`NO.1`,tagColor:`#f59e0b`},{rank:2,title:`平价穿搭 | 学生党一周不重样`,author:`穿搭达人·Miki`,views:`96.2w`,likes:`9.8w`,comments:`6,128`,tag:`NO.2`,tagColor:`#a78bfa`},{rank:3,title:`探店 vlog | 网红咖啡馆测评`,author:`美食探店·阿伦`,views:`78.5w`,likes:`7.4w`,comments:`4,892`,tag:`NO.3`,tagColor:`#6366f1`},{rank:4,title:`iPhone 16 Pro 一周深度体验`,author:`数码评测·老王`,views:`65.7w`,likes:`6.1w`,comments:`3,847`,tag:`NO.4`,tagColor:`#94a3b8`}].map(e=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{display:`flex`,gap:14,padding:14,borderRadius:14,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:140,height:80,flexShrink:0,borderRadius:10,overflow:`hidden`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(K6,{style:{fontSize:28,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:600},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:e.author}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,fontSize:12,color:`#64748b`},children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(nW,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(U3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(j4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),qce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #fce7f3 100%)`,border:`1px solid rgba(139, 92, 246, 0.12)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(139, 92, 246, 0.3)`},children:(0,$.jsx)(p3,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700},children:`创意素材案例`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#7c3aed`},children:[(0,$.jsx)(B4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:14,lineHeight:1.7},children:`精选 AI 生成的优秀素材案例,展示 AI 创作的无限潜力与创意灵感`})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(N8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:16,marginBottom:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,borderRadius:14,gap:4,color:`#fff`},children:(0,$.jsxs)(Z,{type:`primary`,size:`middle`,onClick:()=>{Q.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(Y3,{style:{marginRight:6}}),`解锁全部案例`,(0,$.jsx)(S2,{style:{marginLeft:4,fontSize:12}})]})}),[{title:`美妆直播切片`,tag:`热门`,tagColor:`#ef4444`},{title:`3C 数码测评`,tag:`推荐`,tagColor:`#6366f1`},{title:`美食探店 vlog`,tag:`推荐`,tagColor:`#6366f1`},{title:`服饰穿搭合集`,tag:`热门`,tagColor:`#ef4444`},{title:`家居场景展示`,tag:`推荐`,tagColor:`#6366f1`},{title:`母婴亲子内容`,tag:`热门`,tagColor:`#ef4444`}].map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{position:`relative`,borderRadius:14,overflow:`hidden`,cursor:`pointer`,border:`1px solid #e2e8f0`,background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(K6,{style:{fontSize:36,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,left:10,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:500},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#334155`,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(nW,{style:{fontSize:13,color:`#94a3b8`}})]})]},t))]})]})]}),{RangePicker:Jce}=rV;function $9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var Yce={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},Xce=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await uoe())}catch(e){Q.error(e?.message||`获取团队信息失败`)}finally{r(!1)}},[]);(0,S.useEffect)(()=>{i()},[i]);let[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(1),p=(0,S.useCallback)(async()=>{if(e){u(!0);try{let e=await doe(d);o(e.items||[]),c(e.total||0)}catch(e){Q.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=UH.useForm(),[_,v]=(0,S.useState)(!1),y=async()=>{if(m.member)try{let e=await g.validateFields(),t=Number(e.amount);if(!t||t<=0||t>9999999){Q.error(`请输入有效的正数积分数量`);return}v(!0),await foe(m.member.id,t,e.direction||`increase`,e.description),Q.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),me()}catch(e){if(e?.errorFields)return;Q.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=UH.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await poe()||[])}catch(e){Q.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await moe(e.maxUses||null,null),Q.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Q.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await hoe(e),Q.success(`已撤销`),A()}catch(e){Q.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Q.success(`邀请链接已复制`)}).catch(()=>{P(e)}):P(e)},P=e=>{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`-9999px`,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand(`copy`),Q.success(`邀请链接已复制`)}catch{Q.warning(`复制失败,请手动复制`)}document.body.removeChild(t)},[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(`pending`),[V,H]=(0,S.useState)(`members`),U=(0,S.useRef)(!1),W=(0,S.useRef)(0),G=(0,S.useCallback)(async(e,t=!1)=>{R(!0);try{let n=await goe(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,nK.confirm({title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(B2,{style:{color:`#f59e0b`}}),`待处理的加入申请`]}),content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`p`,{children:[`您有 `,(0,$.jsx)(`strong`,{style:{color:`#ef4444`},children:r}),` 条待处理的团队加入申请。`]}),(0,$.jsx)(`p`,{style:{color:`#64748b`,fontSize:13,marginBottom:0},children:`请及时处理新成员的加入申请。`})]}),okText:`立即处理`,cancelText:`稍后处理`,onOk:()=>{H(`requests`)}})):!t&&r>W.current&&Q.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Q.error(e?.message||`加载申请失败`)}finally{R(!1)}},[]);(0,S.useEffect)(()=>{G(`pending`,!0)},[G]),(0,S.useEffect)(()=>{if(!e)return;let t=setInterval(()=>{G(`pending`,!1)},6e4);return()=>clearInterval(t)},[e,G]);let K=async(e,t,n)=>{try{await _oe(e,t,n),Q.success(t===`approve`?`已通过`:`已拒绝`),G(z),p()}catch(e){Q.error(e?.message||`操作失败`)}},[ee,q]=(0,S.useState)([]),[te,ne]=(0,S.useState)(0),[re,ie]=(0,S.useState)(null),[J,ae]=(0,S.useState)(!1),[oe,se]=(0,S.useState)(1),[ce,le]=(0,S.useState)(``),[ue,de]=(0,S.useState)(``),[fe,pe]=(0,S.useState)(()=>{let e=(0,HE.default)().format(`YYYY-MM-DD`);return[e,e]}),me=(0,S.useCallback)(async()=>{ae(!0);try{let e=await xoe({page:oe,pageSize:10,phone:ue||void 0,recordType:ce||void 0,startDate:fe?.[0]||void 0,endDate:fe?.[1]||void 0});q(e.items||[]),ne(e.total||0),ie(e.summary||null)}catch(e){Q.error(e?.message||`加载积分记录失败`)}finally{ae(!1)}},[oe,ce,ue,fe]);(0,S.useEffect)(()=>{me()},[me]);let he=()=>{le(``),de(``);let e=(0,HE.default)().format(`YYYY-MM-DD`);pe([e,e]),se(1)},ge=()=>{let e=Soe({phone:ue||void 0,recordType:ce||void 0,startDate:fe?.[0]||void 0,endDate:fe?.[1]||void 0}),t=localStorage.getItem(`auth_token`),n=t?{Authorization:`Bearer ${t}`}:{};fetch(e,{headers:n}).then(e=>e.blob()).then(e=>{let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`团队积分_${(0,HE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Q.error(`导出失败`))},_e=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(w1.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(qQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>$9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=l7.getState().user?.id;return t.id===n?(0,$.jsx)(jw,{title:`不能给自己调整积分`,children:(0,$.jsx)(Z,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(Z,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ve=e=>`${window.location.origin}/join-team?code=${e}`,ye=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(w1.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ve(e);return(0,$.jsxs)(YV,{style:{width:`100%`},children:[(0,$.jsx)(w1.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(jw,{title:`复制链接`,children:(0,$.jsx)(Z,{size:`small`,type:`text`,icon:(0,$.jsx)(Q$,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(qQ,{color:e===`active`?`green`:`default`,children:e===`active`?`有效`:`已撤销`})},{title:`使用次数`,key:`uses`,width:100,render:(e,t)=>`${t.useCount}${t.maxUses?`/${t.maxUses}`:``}`},{title:`过期时间`,dataIndex:`expiresAt`,width:170,render:e=>e?$9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(Z,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],be=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(qQ,{color:t.color,children:t.text})},xe=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>be(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?$9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(YV,{size:4,children:[(0,$.jsx)(Z,{size:`small`,type:`link`,icon:(0,$.jsx)(jC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>K(t.id,`approve`),children:`通过`}),(0,$.jsx)(Z,{size:`small`,type:`link`,icon:(0,$.jsx)(Au,{}),danger:!0,style:{padding:0},onClick:()=>{nK.confirm({title:`拒绝申请`,content:(0,$.jsx)(UH,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(UH.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)(wW.TextArea,{rows:2,placeholder:`选填`,id:`reject-note-input`})})}),onOk:()=>{let e=document.getElementById(`reject-note-input`)?.value||void 0;K(t.id,`reject`,e)}})},children:`拒绝`})]}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:`已处理`})}],Se=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=Yce[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(qQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(w1.Text,{strong:!0,style:{color:t.amount>=0?`#10b981`:`#ef4444`,fontSize:14},children:[t.amount>=0?`+`:``,(t.amount??0).toFixed(2)]})},{title:`余额`,dataIndex:`balanceAfter`,width:100,align:`right`,render:e=>(e??0).toFixed(2)},{title:`说明`,dataIndex:`description`,ellipsis:!0,minWidth:160,render:e=>e||`-`},{title:`时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)}],Ce={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},we={padding:`16px`,textAlign:`right`},Te=[{key:`members`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(J8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(PQ,{columns:_e,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(fC,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(uG,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q8,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(HC,{value:ce||void 0,onChange:e=>{le(e||``),se(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)(wW,{placeholder:`搜索手机号`,value:ue,onChange:e=>{de(e.target.value),se(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(Jce,{value:fe?[(0,HE.default)(fe[0]),(0,HE.default)(fe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?pe([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):pe(null),se(1)}}),(0,$.jsx)(Z,{onClick:he,children:`重置`}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:ge,children:`导出 Excel`})]}),(0,$.jsx)(`div`,{style:{marginBottom:12,padding:`8px 16px`,background:`#f8f9fc`,borderRadius:8,display:`flex`,gap:24,flexWrap:`wrap`,fontSize:13},children:(0,$.jsxs)(`span`,{children:[`总消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:15},children:re?.totalConsume??0})]})}),(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(PQ,{rowKey:`id`,loading:J,dataSource:ee,pagination:!1,bordered:!1,scroll:{x:950},columns:Se,locale:{emptyText:(0,$.jsx)(fC,{description:`暂无积分记录`})}}),te>0&&(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(uG,{current:oe,pageSize:10,total:te,onChange:e=>se(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q$,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(PQ,{columns:ye,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(fC,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(T3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(qQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(XR,{value:z,onChange:e=>{B(e),G(e)},options:[{label:`待处理`,value:`pending`},{label:`已通过`,value:`approved`},{label:`已拒绝`,value:`rejected`},{label:`全部`,value:``}],style:{borderRadius:12,border:`1px solid #e2e8f0`,padding:3,background:`#f8fafc`,boxShadow:`0 2px 8px rgba(0,0,0,0.06)`,"--ant-segmented-item-selected-bg":`#6366f1`,"--ant-segmented-item-selected-color":`#ffffff`},size:`middle`})}),(0,$.jsx)(`div`,{style:Ce,children:(0,$.jsx)(PQ,{columns:xe,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(fC,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(w1.Text,{type:`secondary`,children:`加载中...`}):e?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:12},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(w1.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:()=>{i(),p(),A(),G(z),me()},children:`刷新`})]}):(0,$.jsx)(w1.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(vL,{items:Te,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(J8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(UH,{form:g,layout:`vertical`,style:{marginTop:16},initialValues:{direction:`increase`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:`10px 16px`,background:`#f0f4ff`,borderRadius:8,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(w1.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:l7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(UH.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(eI.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(eI.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(eI.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(UH.Item,{name:`amount`,label:`积分数量`,required:!0,rules:[{required:!0,message:`请输入积分数量`},{type:`number`,min:.01,message:`必须大于 0`},{type:`number`,max:9999999,message:`单次不能超过 9999999`}],validateTrigger:[`onChange`,`onBlur`],children:(0,$.jsx)(Lz,{style:{width:`100%`},step:1,min:.01,max:9999999,precision:2,placeholder:`请输入正数积分数量`,size:`large`,formatter:e=>{if(!e)return``;let t=`${e}`.replace(/[^0-9.]/g,``);return t=t.replace(/^0+(?=\d)/,``),t},parser:e=>{if(!e||e===`.`)return``;let t=parseFloat(e);return isNaN(t)||t<=0?``:Math.min(t,9999999)},onKeyDown:e=>{(e.key===`-`||e.key===`e`||e.key===`E`)&&e.preventDefault()},onChange:e=>{e??g.validateFields([`amount`])}})}),(0,$.jsx)(UH.Item,{name:`description`,label:`备注`,children:(0,$.jsx)(wW.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q$,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(UH,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(UH.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(Lz,{style:{width:`100%`},min:1,placeholder:`留空表示不限`,size:`large`})}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`#eef2ff`,borderRadius:8,fontSize:13,color:`#4f46e5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(XB,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},Zce=()=>{let[e]=Dn(),t=Je(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=l7(),[o,s]=(0,S.useState)(!0),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`VideoGen.AI`),[v,y]=(0,S.useState)(``);return(0,S.useEffect)(()=>{a(),E5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?voe(n):yoe(n)).then(e=>{l(e),e?.valid&&r&&!e.alreadyInTeam&&!e.hasPendingRequest&&h(!0)}).catch(()=>l(null)).finally(()=>s(!1)))},[n,r,i]),i||o?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:`60vh`},children:(0,$.jsx)(jG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`success`,icon:(0,$.jsx)(u4,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`40px 20px`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:480},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,marginBottom:32},children:[v?(0,$.jsx)(`img`,{src:v,alt:`logo`,style:{width:40,height:40,borderRadius:10}}):(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(z8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(bL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(L8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(w1.Title,{level:3,children:`加入团队`}),(0,$.jsx)(w1.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(w1.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(Z,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(Z,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)(Q3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(Z,{size:`large`,block:!0,icon:(0,$.jsx)(die,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(L8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await boe(n),p(!0),h(!1),Q.success(`申请已提交`)}catch(e){Q.error(e?.message||`申请失败`)}finally{d(!1)}},onCancel:()=>h(!1),okText:`确认加入`,cancelText:`取消`,confirmLoading:u,width:420,children:[(0,$.jsxs)(`p`,{style:{marginBottom:0},children:[`您确定要加入团队 `,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`},children:[`「`,c.teamName,`」`]}),` 吗?`]}),(0,$.jsx)(`p`,{style:{marginTop:8,color:`#64748b`,fontSize:13},children:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},Qce=new Set([`group_active`,`callback_success`]),$ce=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=Qce.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(bL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(Iq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(Z,{type:`primary`,onClick:()=>{let e=/MicroMessenger/i.test(navigator.userAgent),t=/AlipayClient/i.test(navigator.userAgent),n=/Android|iPhone|iPad/i.test(navigator.userAgent);if(e)try{window.opener=null,window.open(``,`_self`),window.close()}catch{Q.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Q.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(w1.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})};HE.default.locale(`zh-cn`);var ele=({children:e})=>{let{user:t,loading:n,checkAuth:r}=l7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(jG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=l7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(jm,{locale:j0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(rx,{children:(0,$.jsx)(gn,{children:(0,$.jsxs)(Et,{children:[(0,$.jsx)(wt,{path:`/login`,element:(0,$.jsx)(Doe,{})}),(0,$.jsx)(wt,{path:`/join-team`,element:(0,$.jsx)(Zce,{})}),(0,$.jsx)(wt,{path:`/private-portrait-authorized`,element:(0,$.jsx)($ce,{})}),(0,$.jsxs)(wt,{path:`/`,element:(0,$.jsx)(ele,{children:(0,$.jsx)(Toe,{})}),children:[(0,$.jsx)(wt,{index:!0,element:(0,$.jsx)(St,{to:`/projects`,replace:!0})}),(0,$.jsx)(wt,{path:`projects`,element:(0,$.jsx)(Aoe,{})}),(0,$.jsx)(wt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(Joe,{})}),(0,$.jsx)(wt,{path:`records`,element:(0,$.jsx)(Yoe,{})}),(0,$.jsx)(wt,{path:`credits`,element:(0,$.jsx)(Xoe,{})}),(0,$.jsx)(wt,{path:`credit-records`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`order-records`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`user-center`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`messages`,element:(0,$.jsx)($oe,{})}),(0,$.jsx)(wt,{path:`home`,element:(0,$.jsx)(Hce,{})}),(0,$.jsx)(wt,{path:`conversation`,element:(0,$.jsx)(Fse,{})}),(0,$.jsx)(wt,{path:`initial`,element:(0,$.jsx)(Vse,{})}),(0,$.jsx)(wt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(qse,{})}),(0,$.jsx)(wt,{path:`removelens`,element:(0,$.jsx)(ece,{})}),(0,$.jsx)(wt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Fce,{})}),(0,$.jsx)(wt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(zce,{})}),(0,$.jsx)(wt,{path:`generated`,element:(0,$.jsx)(lce,{})}),(0,$.jsx)(wt,{path:`pretest`,element:(0,$.jsx)(dce,{})}),(0,$.jsx)(wt,{path:`authorization`,element:(0,$.jsx)(pce,{})}),(0,$.jsx)(wt,{path:`authoriza-waiting`,element:(0,$.jsx)(Gce,{})}),(0,$.jsx)(wt,{path:`materials`,element:(0,$.jsx)(xce,{})}),(0,$.jsx)(wt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(St,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(wt,{path:`consume`,element:(0,$.jsx)(Wce,{})}),(0,$.jsx)(wt,{path:`popular`,element:(0,$.jsx)(Kce,{})}),(0,$.jsx)(wt,{path:`authacc`,element:(0,$.jsx)(hce,{})}),(0,$.jsx)(wt,{path:`creativeplaza`,element:(0,$.jsx)(qce,{})}),(0,$.jsx)(wt,{path:`team-management`,element:(0,$.jsx)(Xce,{})})]}),(0,$.jsx)(wt,{path:`*`,element:(0,$.jsx)(St,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file + `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(Sce,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(jG,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(DB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${V9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:jce}=wW,Mce=`https://ceshi.apiforeign.minzhongzc.com`,K9=2,q9=15,Nce=e=>{if(!e)return!1;let t=e.supportsUniversalReference??e.supports_universal_reference,n=e.maxImageCount??e.max_image_count;return t!==!1&&(n==null||Number(n)>=1)};function J9(e){return e?/^https?:\/\//i.test(e)?e:`${Mce}${e}`:``}var Pce=S.memo(({record:e,onPreview:t})=>{let n=e.segmentVideoUrl;if(n)return(0,$.jsxs)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>t(J9(n)),children:[(0,$.jsx)(`video`,{src:J9(n),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]});let r=O9(e.splitStatus||e.split_status);return(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,fontSize:12},children:[r.active?(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}):null,(0,$.jsx)(`span`,{style:{color:r.failure?`#ef4444`:r.active?`#f59e0b`:`#94a3b8`},children:r.label})]})})});function Fce(){let{creatID:e}=Qe(),t=Je(),{user:n,optimizeHoldCredits:r}=l7(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),g=(0,S.useRef)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(5),[M,N]=(0,S.useState)(`9:16`),[P,F]=(0,S.useState)(`480p`),[I,L]=(0,S.useState)(!1),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[H,U]=(0,S.useState)([]),[W,G]=(0,S.useState)(null),[K,ee]=(0,S.useState)([]),[q,te]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,J]=(0,S.useState)(0),[ae,oe]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(!1),[le,ue]=(0,S.useState)(!1),de=(0,S.useRef)(null),fe=(0,S.useRef)(null),pe=(0,S.useRef)(null),me=(0,S.useMemo)(()=>J9(W?.videoUrl),[W?.videoUrl]);(0,S.useEffect)(()=>{P5().then(e=>{let t=e?.engine?.video||[];if(D(t),t.length>0){let e=t[0];k(e.id),N(e.supportedRatios?.includes(`9:16`)?`9:16`:e.supportedRatios?.[0]||`9:16`),F(e.supportedResolutions?.[0]||`480p`),j(e.supportedDurations?.[0]||5)}}).catch(()=>Q.error(`视频引擎加载失败`)),L5().then(e=>U(Array.isArray(e)?e:[])).catch(()=>U([]))},[]);let he=(0,S.useRef)(null),ge=E.find(e=>e.id===O),_e=!x||Nce(ge),ve=(0,S.useMemo)(()=>{let e=H.find(e=>e.modelConfigId===O&&e.genType===`video`&&e.resolution===P);if(!e)return 0;let t=(Number(e.baseCredits||0)+Number(e.perSecondCredits||0)*A)*Number(e.ratio||1);return x&&(t+=(Number(e.inputImageBaseCredits||0)+Number(e.inputImagePerImageCredits||0))*Number(e.inputImageRatio||1)),Number(t.toFixed(2))},[H,O,x,A,P]),ye=Number(n?.credits||0)K.length===0?`AI自动拆分`:K.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[K]),xe=(0,S.useCallback)(async()=>{if(e)try{G(await q5(e))}catch{Q.error(`获取任务详情失败`)}},[e]),Se=(0,S.useCallback)(async()=>{if(e)try{let t=await Sae(e,q,ne);ee(t.items||[]),J(t.total||0)}catch{Q.error(`获取拆镜列表失败`)}},[e,q,ne]),Ce=(0,S.useCallback)(e=>{p(e),h(!0)},[]),we=(0,S.useCallback)(async()=>{if(e)try{await Mae(e),Q.success(`重新分析已提交`),pe.current=Date.now(),await xe()}catch(e){Q.error(e?.message||`重新分析失败`)}},[e,xe]),Te=(0,S.useCallback)(async e=>{try{await Pae(e),Q.success(`重新分析已提交`),Se()}catch(e){Q.error(e?.message||`重新分析失败`)}},[Se]),Ee=(0,S.useCallback)(async e=>{try{await Fae(e),Q.success(`重新切割已提交`),await Se()}catch(e){Q.error(e?.message||`重新切割失败`)}},[Se]),De=(0,S.useCallback)(async e=>{try{await Nae(e),Q.success(`删除成功`),Se()}catch(e){Q.error(e?.message||`删除失败`)}},[Se]),Oe=(0,S.useCallback)(async()=>{await Promise.all([xe(),Se()])},[xe,Se]);(0,S.useEffect)(()=>(Oe(),()=>{de.current&&window.clearTimeout(de.current),fe.current&&window.clearTimeout(fe.current)}),[Oe]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&(L(!1),z(!1))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[]),(0,S.useEffect)(()=>{if(W?.analysisStatus!==`processing`||!e){pe.current=null,fe.current&&=(window.clearTimeout(fe.current),null);return}pe.current||=Date.now();let t=async()=>{if(document.visibilityState===`visible`)try{G(await q5(e))}catch{}},n=()=>{if(!fe.current)return;let e=Date.now()-(pe.current||Date.now()),r=e<6e4?3e3:e<6e5?1e4:3e4;fe.current=window.setTimeout(async()=>{await t(),n()},r)};fe.current=window.setTimeout(async()=>{await t(),n()},3e3);let r=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{fe.current&&=(window.clearTimeout(fe.current),null),document.removeEventListener(`visibilitychange`,r)}},[W?.analysisStatus,e]);let ke=K.some(e=>Qse(e));(0,S.useEffect)(()=>{if(!ke||!e){de.current&&=(window.clearTimeout(de.current),null);return}let t=async()=>{document.visibilityState===`visible`&&await Se()};de.current=window.setTimeout(()=>void t(),3e4);let n=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,n),()=>{de.current&&=(window.clearTimeout(de.current),null),document.removeEventListener(`visibilitychange`,n)}},[e,Se,ke]);let Ae=(e,t)=>{l(e),d(t),a(!0)},je=()=>{a(!1),l(null),v(``),d(``),b(``),C(``),T(``)},Me=async e=>{try{let t=await Kie(e);C(t.url),T(t.resource_id||``),Q.success(`图片上传成功`)}catch{Q.error(`图片上传失败,请重试`)}return!1},Ne=async()=>{if(!c){Q.warning(`请先选择拆镜片段`);return}if(!O){Q.warning(`请选择视频引擎`);return}if(!_e){Q.warning(`当前视频引擎不支持参考图片,请移除素材图片或切换引擎`);return}if(ye){Q.warning(`积分不足,请充值后再创建复刻项目`);return}let e=he.current,n=e?.segmentId===c?e.key:`shot_v2_${c}_${Date.now()}_${Math.random().toString(16).slice(2)}`;he.current={segmentId:c,key:n};let r={target_project_name:_.trim(),core_content_point:y.trim(),project_description:y.trim()||void 0,material_image_url:x||void 0,material_image_resource_id:w||void 0,video_config:{engine_id:O,duration:A,aspect_ratio:M,resolution:P},idempotency_key:n};oe(!0);try{let e=await Cae(c,r),n=e?.projectId||e?.id||e?.detail?.id;he.current=null,Q.success(`项目已创建,视频提词正在生成`),je(),await Se(),n&&t(`/removelens/${n}/removefenbu?flow_version=v2`)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Q.error(t||`创建失败,请重试`)}finally{oe(!1)}},Pe=async()=>{if(e){ue(!0);try{let t=K.some(e=>e.sourceMode===`ai_suggestion`);await bae(e,{selected_indices:[],replace_existing:t}),Q.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await Oe()}catch(e){Q.error(e?.message||`拆镜失败`)}finally{ue(!1)}}},Fe=()=>{if(!me){Q.warning(`原视频地址不存在`);return}s(!0)},Ie=async t=>{if(e){if(t.durationSecondq9){Q.warning(`拆镜片段不能超过 ${q9} 秒`);return}ce(!0);try{await xae(e,{start_second:t.startSecond,end_second:t.endSecond}),Q.success(`手动拆镜任务已提交`),s(!1),await Oe()}catch(e){Q.error(e?.message||`手动拆镜失败`)}finally{ce(!1)}}},Le=e=>(e?.splitStatus||e?.split_status)===`completed`&&!!(e?.segmentVideoUrl||e?.segment_video_url),Re=(0,S.useMemo)(()=>[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(qQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(qQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(Pce,{record:t,onPreview:Ce})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=O9(t.split_status||t.splitStatus);if(n.active)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:n.label})]});if(n.failure)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:n.label});if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let r=D9(t.analysis_status||t.analysisStatus);return r.active?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:r.label})]}):r.failure?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:r.label}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:r.key&&r.key!==`completed`?r.label:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:200,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[n.moduleProjectId?(0,$.jsx)(Z,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu?flow_version=${n.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(Z,{type:`text`,onClick:()=>Ae(String(n.id),n.segmentName),disabled:!Le(n),style:{color:Le(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:Le(n)?`视频生成`:`待切割完成`}),D9(n.analysisStatus||n.analysis_status).failure&&(0,$.jsx)(Z,{type:`text`,onClick:()=>Te(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),O9(n.splitStatus||n.split_status).failure&&(0,$.jsx)(Z,{type:`text`,onClick:()=>Ee(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(oK,{title:`确定删除此片段?`,onConfirm:()=>De(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(Z,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],[]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>t(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{style:{fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`一键拆解画面分镜,助力仿拍或创作`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),W?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`,cursor:`pointer`},onClick:()=>{p(me),h(!0)},onMouseEnter:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`1`)},onMouseLeave:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`0`)},children:[(0,$.jsx)(`video`,{src:me,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:0,transition:`opacity 0.2s`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#6366f1`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})})})]}),W.analysisStatus===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(Z,{onClick:we,style:{width:`100%`,padding:`6px 16px`,borderRadius:8,fontSize:12,border:`1px solid #ef4444`,color:`#ef4444`,background:`rgba(239, 68, 68, 0.05)`,cursor:W.analysisStatus===`processing`?`not-allowed`:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{W.analysisStatus!==`processing`&&(e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`)},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.05)`},children:W.analysisStatus===`processing`?`分析中...`:`重新分析`})})]}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,W.createdAt?new Date(W.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:W.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),W.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):W.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(W.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(qQ,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):W.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),W.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):W.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6,height:100,overflowY:`auto`},children:W.originalVideoContent}):W.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(Z,{type:`default`,onClick:Fe,disabled:!me||se||W?.analysisStatus===`processing`,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(oK,{title:be===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:Pe,children:(0,$.jsxs)(Z,{type:`primary`,loading:le,disabled:le||W?.analysisStatus===`processing`,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:be}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),W?.aiSuggestions&&W.aiSuggestions.length>0&&(0,$.jsx)(jw,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(W?.ai_suggestions||W?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,styles:{container:{backgroundColor:`#fff`,height:300,overflowY:`auto`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`}},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,K.length,` 个片段`]})]}),(0,$.jsx)(PQ,{columns:Re,dataSource:K,pagination:{current:q,pageSize:ne,total:ie,onChange:(e,t)=>{te(e),re(t)},showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`,height:80,overflow:`auto`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(255, 255, 255, 1)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Ace,{open:o,videoUrl:me,title:`手动视频切片`,loading:se,minDuration:K9,maxDuration:q9,onCancel:()=>s(!1),onConfirm:Ie}),(0,$.jsx)(BV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),u&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,u]})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),je()},style:{width:24,height:24,border:`none`,background:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:20},children:`×`})]}),placement:`right`,closable:!1,onClose:je,open:i,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`素材图片(可选)`}),x?(0,$.jsxs)(`div`,{style:{width:120,height:120,borderRadius:8,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`img`,{src:J9(x),alt:`素材图`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`button`,{onClick:()=>{C(``),T(``)},style:{position:`absolute`,bottom:4,right:4,width:24,height:24,borderRadius:`50%`,backgroundColor:`rgba(0,0,0,.5)`,border:`none`,cursor:`pointer`},children:(0,$.jsx)(s$,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(A7,{accept:`image/*`,multiple:!1,mediaType:`image`,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&Me(e[0])},onHistorySelect:e=>{let t=e[0];t&&(C(t.resourceUrl||t.previewUrl||t.displayUrl||``),T(t.id),Q.success(`历史图片已选择`))},children:(0,$.jsxs)(`div`,{style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99,102,241,.3)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,gap:6},children:[(0,$.jsx)(JI,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传或选择历史图片`})]})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`项目名称(可选)`}),(0,$.jsx)(wW,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入项目名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:`项目描述(可选)`}),(0,$.jsx)(jce,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入项目描述`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`视频参数`,(0,$.jsx)(`span`,{style:{color:`#f94444`},children:`(必选)`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{L(!I),z(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:E.find(e=>e.id===O)?.name||`选择引擎`})]}),I&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:E.filter(e=>e.supportsUniversalReference!==!1).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{k(e.id),V({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(M)||N(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(P)||F(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(A)||j(e.supportedDurations?.[0]||5),L(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:O===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:O===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:O===e.id?600:500,color:O===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{z(!R),L(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[M,` · `,A,`s · `,P]})]}),R&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:B.ratios.map(e=>{let[t,n]=e.split(`:`).map(Number),r=t>=n?18:Math.round(t/n*18),i=n>=t?18:Math.round(n/t*18);return(0,$.jsxs)(`button`,{onClick:()=>N(e),style:{flex:`0 0 calc(12.5% - 4px)`,minWidth:44,height:52,borderRadius:6,border:M===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:M===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:r,height:i,border:`2px solid ${M===e?`#6366f1`:`#9ca3af`}`,borderRadius:3,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:M===e?`#6366f1`:`#6b7280`,fontWeight:M===e?600:400},children:e})]},e)})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(A-Math.min(...B.durations))/(Math.max(...B.durations)-Math.min(...B.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...B.durations),max:Math.max(...B.durations),value:A,onChange:e=>j(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:A}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:B.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>F(e),style:{flex:1,height:42,borderRadius:8,border:P===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:P===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:P===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(`div`,{style:{color:_e?`#6366f1`:`#ef4444`,fontSize:13},children:_e?``:`当前引擎不支持参考图片,请移除素材图片或切换引擎。`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(jw,{title:(n?.credits||0){if((n?.credits||0)h(!1),afterClose:()=>{g.current&&(g.current.pause(),g.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:g,controls:!0,src:f||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":`true`,autoPlay:!0})})})]})}var{Title:Ice,Text:Y9}=w1,{TextArea:Lce}=wW;function Rce(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var X9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function zce(){let e=Je(),{creatID:t}=Qe(),[n]=Dn(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=l7(),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)([]),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(``),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`image`),[v,y]=(0,S.useState)({}),[b,x]=(0,S.useState)(null),C=(0,S.useRef)(null),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)({}),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(!1),[W,G]=(0,S.useState)(5),[K,ee]=(0,S.useState)(`16:9`),[q,te]=(0,S.useState)(`480p`),[ne,re]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[ie,J]=(0,S.useState)([]),[ae,oe]=(0,S.useState)(1),[se,ce]=(0,S.useState)(20),[le,ue]=(0,S.useState)(0),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)({}),[he,ge]=(0,S.useState)([]),[_e,ve]=(0,S.useState)([]),[ye,be]=(0,S.useState)(!1),[xe,Se]=(0,S.useState)(``),[Ce,we]=(0,S.useState)(`image`),Te=S.useRef(null);(0,S.useEffect)(()=>{if(ye&&Ce===`video`){let e=()=>{Te.current&&Te.current.play().catch(()=>{})};Te.current&&(Te.current.readyState>=2?e():Te.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Te.current&&(Te.current.removeEventListener(`loadedmetadata`,e),Te.current.pause())}}else Te.current&&Te.current.pause()},[ye,Ce]);let Ee=r===`v2`,De=(0,S.useMemo)(()=>Ee?[{id:1,title:`素材与项目信息`,description:`固定片段素材和项目描述`,childId:1},{id:2,title:`生成视频提示词`,description:`生成并确认视频提示词`,childId:4},{id:3,title:`生成最终视频`,description:`使用当前视频提示词生成视频`,childId:5}]:[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}],[Ee]),Oe=(0,S.useMemo)(()=>De.map((e,t)=>({...e,status:he[t]?.status||``,id:he[t]?.id||t,output:he[t]?.output||``,input:he[t]?.input||{},engineId:he[t]?.input?.payload?.videoConfig?.engineId||``,errorMessage:he[t]?.errorMessage||``})),[De,he]),ke=(0,S.useRef)(``);(0,S.useEffect)(()=>{let e=Oe.filter(e=>e.status===`processing`).map(e=>String(e.childId)),t=JSON.stringify(e);t!==ke.current&&(ke.current=t,ve(e))},[Oe]);let Ae=(e,t,n)=>{K5(e,t,n).then(e=>{e.items&&J(e.items),e.total!==void 0&&ue(e.total)}).catch(e=>{})},je=(e,t)=>{oe(e),ce(t),Ae(e,t,de)},Me=()=>{Ae(1,20,de)};(0,S.useEffect)(()=>{Ae(ae,se,de)},[]),(0,S.useEffect)(()=>{P5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(F({video:t,image:n}),t.length>0){L(t[0].id);let e=t[0];re({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]})}n.length>0&&z(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{C.current&&=(clearInterval(C.current),null)},[]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(V(!1),U(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{Q.error(e?.message||`加载任务详情失败`)})},[t,r]),(0,S.useEffect)(()=>{let e=pe?.status===`processing`||he.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(Le,3e4):!e&&C.current&&(clearInterval(C.current),C.current=null)},[pe?.status,he,t,r]),(0,S.useEffect)(()=>{L5().then(e=>{l(e)}).catch(()=>{})},[]);let Ne=()=>{let e={};e=c.find(e=>e.modelConfigId===I&&e.genType===`video`&&e.resolution===q),e||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let t=(W*e.perSecondCredits+e.baseCredits)*e.ratio,n=pe?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=Ee?+!!pe?.material?.materialImageUrl:pe?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}d(Number(t.toFixed(2)))},Pe=()=>{let e=Oe[1]?.input?.payload?.videoConfig||Oe[1]?.input?.payload?.video_config;if(!e)return 0;let t=e?.engineId||e?.engine_id,n=e?.resolution,r=e?.duration||W,i={};i=c.find(e=>e.modelConfigId===t&&e.genType===`video`&&e.resolution===n),i||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let a=(r*i.perSecondCredits+i.baseCredits)*i.ratio,o=pe?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=Ee?+!!pe?.material?.materialImageUrl:pe?.videoGeneration?.inputMedia?.image?.length||0;if(s>0){let e=((i.inputImageBaseCredits||0)+(i.inputImagePerImageCredits||0)*s)*(i.inputImageRatio||1);a+=e}return Number(a.toFixed(2))};(0,S.useEffect)(()=>{c.length>0&&I&&Ne()},[c,I,W,q,pe]);let Fe=(e,t,n,r)=>{_(t||`image`),T(n?String(n):``),t===`video`?(x(r||null),y(e&&typeof e==`object`?Rce(e):{}),p(``)):(x(null),p(e||``),y({})),s(!0)},Ie=async()=>{if(g===`image`){if(!pe?.id||!w){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!f||!f.trim()){Q.warning(`图片提示词不能为空`);return}D(!0);try{await Oae(pe.id,w,{prompt:f.trim()}),Q.success(`图片提示词已保存`),Re(),s(!1),T(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{D(!1)}return}if(!pe?.id||!w){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!v||typeof v!=`object`||Object.keys(v).length===0){Q.warning(`视频提示词不能为空`);return}if(!b){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=h9(v,b);if(e){Q.warning(e);return}D(!0);try{await(Ee?Tae:kae)(pe.id,w,{prompt_schema:v}),Q.success(`视频提示词已保存`),Re(),s(!1),T(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{D(!1)}},Le=()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Re=()=>{t&&J5(t,r).then(e=>{me(e),e.steps&&ge(e.steps)}).catch(e=>{Q.error(e?.message||`刷新任务详情失败`)})},ze=(e,t)=>{Se(e),we(t),be(!0)},Be=()=>{be(!1),Se(``),Te.current&&Te.current.pause()},Ve=e=>{if(e.preventDefault(),e.stopPropagation(),!xe)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${xe}&download=1`,t.download=Ce===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},He=e=>{Dae(pe.id,e.toString()).then(e=>{Q.info(`正在生成图片提示词,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ue=e=>{let t={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};Y5(pe.id,e.toString(),t).then(e=>{Q.info(`正在生成图片,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},We=()=>{let e={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};Y5(pe.id,Oe[1].id.toString(),e).then(e=>{Q.info(`正在生成图片,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ge=e=>{let t={engine_id:I,duration:W,aspect_ratio:K,resolution:q,target_platform:`抖音`};Aae(pe.id,e.toString(),t).then(e=>{Q.info(`正在生成视频提示词,请稍候...`),Re()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)})},Ke=async(e,t)=>{try{Ee?await Eae(pe.id,String(e)):await jae(pe.id,String(e),{engine_id:t||``}),Q.info(`正在生成视频,请稍候...`),Re()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Q.error(t)}},qe=async()=>{let e=Ee?Oe[1]:Oe[3];e?.id&&await Ke(e.id,e.engineId||``)},Ye=async e=>{if(!(!Ee||!pe?.id||!e||!I)){N(!0);try{await wae(pe.id,e,{video_config:{engine_id:I,duration:W,aspect_ratio:K,resolution:q}}),Q.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Re()}catch(e){Q.error(e?.message||`重新生成视频提示词失败`)}finally{N(!1)}}};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(y2,{}),onClick:()=>window.history.back(),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(Z,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>h(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:pe?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>pe?.material?.materialVideoUrl&&ze(pe.material.materialVideoUrl,`video`),children:pe?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:X9(pe.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:pe?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>pe?.material?.materialImageUrl&&ze(pe.material.materialImageUrl,`image`),children:pe?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:X9(pe.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),pe?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ze(pe.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),pe?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsxs)(`div`,{className:`medio_box video-container`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`,position:`relative`},onClick:()=>ze(pe.finalVideoUrl,`video`),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),(0,$.jsx)(`div`,{className:`video-overlay`,children:(0,$.jsx)(K6,{style:{fontSize:48,color:`#fff`,opacity:.9}})})]})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(a_,{activeKey:_e,onChange:ve,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Oe.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(u4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Y9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:pe?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:X9(pe.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Y9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:pe?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:X9(pe.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`原产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.sourceProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`自有产品名称:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.targetProjectName||`-`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:8},children:`产品卖点:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:Oe[0]?.input?.payload?.coreContentPoint||`-`})]})]}),!Ee&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0)Fe(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(Z,{onClick:()=>{Ue(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[pe.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${pe.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>We(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{V(!B),U(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(x8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(Y9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:P.video?.find(e=>e.id===I)?.name||`选择引擎`})]}),B&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:P.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{L(e.id),re({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(K)||ee(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(q)||te(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(W)||G(e.supportedDurations?.[0]||5),V(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:I===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:I===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:I===e.id?600:500,color:I===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{U(!H),V(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(B3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(Y9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[K,` · `,W,`s · `,q]})]}),H&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:ne.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>ee(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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 ${K===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:K===e?`#6366f1`:`#6b7280`,fontWeight:K===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Y9,{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:`${(W-Math.min(...ne.durations))/(Math.max(...ne.durations)-Math.min(...ne.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...ne.durations),max:Math.max(...ne.durations),value:W,onChange:e=>G(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:W}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Y9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ne.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>te(e),style:{flex:1,height:42,borderRadius:6,border:q===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let e=Oe[1]?.input?.payload?.videoConfig||Oe[1]?.input?.payload?.video_config,t=e?.engineId||e?.engine_id,n=t?(P.video||[]).find(e=>String(e.id)===String(t))?.name:``;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`引擎:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:n||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`比例:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.aspectRatio||e?.aspect_ratio||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`分辨率:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.resolution||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:`#666666`,marginRight:4},children:`时长:`}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#4b5563`},children:e?.duration||`-`})]})]})})()})}),(0,$.jsxs)(YV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(Z,{type:`default`,icon:(0,$.jsx)(k$,{}),onClick:()=>Fe(pe?.videoGeneration?.promptSchema,`video`,e.id,pe?.videoGeneration?.schemaConfigSnapshot),style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!pe?.videoGeneration?.promptSchema||!pe?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),Ee&&(0,$.jsx)(jw,{title:(i?.credits||0){if((i?.credits||0){let t=Pe();if((i?.credits||0){let e=Pe();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${pe?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(nK,{open:O,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#6366f1`,letterSpacing:.4},children:`重新生成视频提词`})]}),onCancel:()=>k(!1),width:400,footer:null,centered:!0,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(HC,{value:I,onChange:e=>{let t=P.video?.find(t=>t.id===e);t&&(L(t.id),re({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]}),t.supportedRatios?.includes(K)||ee(t.supportedRatios?.[0]||`16:9`),t.supportedResolutions?.includes(q)||te(t.supportedResolutions?.[0]||`720p`),t.supportedDurations?.includes(W)||G(t.supportedDurations?.[0]||5))},style:{width:`100%`,borderRadius:8},options:P.video?.map(e=>({value:e.id,label:e.name})),placeholder:`请选择引擎`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:ne.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>ee(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:K===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:K===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 ${K===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:K===e?`#6366f1`:`#6b7280`,fontWeight:K===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{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:`${(W-Math.min(...ne.durations))/(Math.max(...ne.durations)-Math.min(...ne.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...ne.durations),max:Math.max(...ne.durations),value:W,onChange:e=>G(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:W}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`span`,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ne.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>te(e),style:{flex:1,height:42,borderRadius:8,border:q===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:q===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:q===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(Z,{onClick:()=>k(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(Z,{onClick:()=>{if(!I){Q.warning(`请选择视频引擎`);return}Ye(A),k(!1)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:!I,children:`确认生成`})]})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:g===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:o,onCancel:()=>{E||s(!1)},footer:[(0,$.jsx)(Z,{onClick:()=>s(!1),disabled:E,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(Z,{type:`primary`,onClick:Ie,loading:E,disabled:E,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:g===`image`?(0,$.jsx)(Lce,{value:f,onChange:e=>p(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(S9,{value:v,schemaConfigSnapshot:b,onChange:y})})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:m,onCancel:()=>h(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(wW,{placeholder:`搜索产品名称`,value:de,onChange:e=>fe(e.target.value),onPressEnter:Me,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(Z,{type:`primary`,onClick:Me,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(PQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(Z,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:ie,rowKey:`id`,pagination:{current:ae,pageSize:se,total:le,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:je,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]}),(0,$.jsx)(nK,{open:ye,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:Be,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:Ve,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Ce===`image`?(0,$.jsx)(`img`,{src:xe.startsWith(`http`)?xe:`https://ceshi.apiforeign.minzhongzc.com${xe}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Te,src:xe.startsWith(`http`)?xe:`https://ceshi.apiforeign.minzhongzc.com${xe}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var Bce=({asset:e,index:t,onPreview:n})=>{let[r,i]=(0,S.useState)(!1);return(0,$.jsx)(`div`,{className:`project-card`,onClick:()=>n(e),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,flexShrink:0,width:`18%`,position:`relative`},children:(0,$.jsx)(`div`,{style:{position:`relative`,aspectRatio:`9/16`},children:e.mediaType===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},muted:!0,playsInline:!0}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(K6,{style:{fontSize:24,color:`#fff`}})})})]}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${e.url}`,alt:e.title||`素材 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})})};function Vce(e){if(!e)return`-`;let t=String(e).trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``);let[r=``,i=``]=t.split(`T`),[,a=``,o=``]=r.split(`-`),s=i.slice(0,5);return!a||!o?`-`:`${a}-${o} ${s}`}var Hce=()=>{let e=Je(),[t,n]=(0,S.useState)(`project`),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),_=(0,S.useRef)(null),v=(0,S.useRef)(``),[y,b]=(0,S.useState)(`cases`),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(null);(0,S.useEffect)(()=>{Yae().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),e7(t).then(e=>{e?.categories?.[0]?.assets&&f(e.categories[0].assets)})}})},[]),(0,S.useEffect)(()=>()=>{E.current&&=(E.current.pause(),null),T(null),C(null),document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()})},[]),(0,S.useEffect)(()=>{if(!p){E.current&&=(E.current.pause(),null),T(null),C(null),g(``),v.current=``,document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()});return}let e=p.id||p.url;v.current=e;let t=(e,n)=>n===0?e:t(n,e%n),n=p.width||p.videoWidth||p.imageWidth||0,r=p.height||p.videoHeight||p.imageHeight||0;if(n&&r){let e=t(n,r);g(`${n/e}:${r/e}`);return}if(g(``),p.mediaType===`video`){let n=_.current,r=()=>{if(v.current!==e)return;let r=n.videoWidth,i=n.videoHeight;if(!r||!i)return;let a=t(r,i);g(`${r/a}:${i/a}`)};if(n?.removeEventListener(`loadedmetadata`,r),n&&n.videoWidth&&n.videoHeight){let e=t(n.videoWidth,n.videoHeight);g(`${n.videoWidth/e}:${n.videoHeight/e}`)}else n?.addEventListener(`loadedmetadata`,r);return()=>{n?.removeEventListener(`loadedmetadata`,r)}}else{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(v.current!==e)return;let r=n.width,i=n.height;if(!r||!i){g(`未知`);return}let a=t(r,i);g(`${r/a}:${i/a}`)},n.onerror=()=>{v.current===e&&g(`未知`)},n.src=`https://ceshi.apiforeign.minzhongzc.com${p.url}`}},[p]),(0,S.useEffect)(()=>{(async()=>{try{Wae(10).then(e=>{for(let t in e)e[t].forEach(e=>{e.type=t,o(t=>[...t,e])});o(e=>e)})}catch{}})()},[]);let D=e=>{n(e)},O=[{icon:(0,$.jsx)(eH,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)(s8,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(eH,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(g8,{style:{fontSize:24}}),title:`拆镜复刻`,description:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`,action:`开始拆镜`,path:`/removelens`}],k=[{key:`all`,label:`全部`},{key:`project`,label:`项目媒体`},{key:`chatAi`,label:`AI成片`},{key:`hotOpeningReplicate`,label:`爆款复刻`},{key:`shotReplicate`,label:`拆镜复刻`}],A=t===`all`?a:a.filter(e=>e.type===t);return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,borderRadius:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsx)(`h3`,{children:`首页工作台 `}),(0,$.jsxs)(`p`,{style:{cursor:`pointer`,fontSize:12,letterSpacing:.3,padding:`10px 16px`,backgroundColor:`#ffffffff`,borderRadius:30,boxShadow:`0px 4px 12px 0px rgba(0, 0, 0, 0.1)`},children:[`如需进行账户素材推送:`,(0,$.jsxs)(`span`,{style:{color:`#1a50bbff`},onClick:()=>{e(`/authorization`)},children:[`一键推送`,(0,$.jsx)(S2,{style:{marginLeft:8,transform:`rotate(0deg)`}})]})]})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,borderRadius:2,background:`linear-gradient(180deg, #6366f1, #a855f7)`}}),(0,$.jsx)(`div`,{style:{fontSize:17,fontWeight:700,color:`#1f2937`,letterSpacing:.3},children:`AI 创作入口`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`一键开启智能创作`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:12},children:O.map((t,n)=>{let r=[{color:`#3b82f6`,light:`rgba(59,130,246,0.12)`,tag:`项目`},{color:`#6366f1`,light:`rgba(99,102,241,0.12)`,tag:`复刻`},{color:`#f97316`,light:`rgba(249,115,22,0.12)`,tag:`拆镜`},{color:`#10b981`,light:`rgba(16,185,129,0.12)`,tag:`云创`}],i=r[n]||r[0];return(0,$.jsxs)(`div`,{onClick:()=>e(t.path),className:`project-card`,style:{flex:`1 1 280px`,minWidth:280,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`,transition:`all 0.3s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,display:`flex`,alignItems:`center`,gap:14,minHeight:96},onMouseEnter:e=>{e.currentTarget.style.borderColor=i.color,e.currentTarget.style.boxShadow=`0 8px 24px ${i.light}`,e.currentTarget.style.background=i.light,e.currentTarget.style.transform=`translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.boxShadow=`none`,e.currentTarget.style.background=`#fff`,e.currentTarget.style.transform=`translateY(0)`},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:i.light,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:`all 0.3s ease`,color:i.color},onMouseEnter:e=>{e.currentTarget.style.background=i.color,e.currentTarget.style.color=`#fff`},onMouseLeave:e=>{e.currentTarget.style.background=i.light,e.currentTarget.style.color=i.color},children:(0,$.jsx)(`span`,{style:{fontSize:20,display:`flex`,transition:`all 0.3s ease`},children:t.icon})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,flex:1,minWidth:0},children:t.title}),(0,$.jsx)(`span`,{style:{fontSize:10,color:i.color,padding:`2px 7px`,borderRadius:4,background:i.light,fontWeight:600,flexShrink:0},children:i.tag})]}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,lineHeight:1.5,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:t.description})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,color:i.color,fontSize:13,fontWeight:600,flexShrink:0},children:[t.action,(0,$.jsx)(S2,{style:{fontSize:12}})]})]},n)})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:[{key:`cases`,label:`素材案例`},{key:`works`,label:`近期作品`}].map(e=>(0,$.jsx)(`button`,{onClick:()=>b(e.key),style:{padding:`6px 16px`,borderRadius:8,fontSize:13,fontWeight:500,border:`none`,cursor:`pointer`,transition:`all 0.25s ease`,background:y===e.key?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#f1f5f9`,color:y===e.key?`#fff`:`#64748b`},children:e.label},e.key))})}),y===`works`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(vL,{activeKey:t,onChange:D,items:k.map(e=>({key:e.key,label:e.label})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(5, 1fr)`,gap:16},children:A.length===0?(0,$.jsxs)(`div`,{style:{gridColumn:`1 / -1`,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(L6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无作品`})]}):A.map(t=>(0,$.jsxs)(`div`,{className:`project-card`,onClick:()=>{let n=t.moduleProjectId;t.type===`hotOpeningReplicate`&&n!=null?e(`/initial/${n}/initialinfo?flow_version=${t.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`):t.type===`shotReplicate`&&n!=null?e(`/removelens/${n}/removefenbu?flow_version=${t.moduleProjectFlowVersion===`v2`?`v2`:`v1`}`):t.type===`chatAi`?e(`/conversation`):t.type===`project`&&e(`/project`)},style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`},children:[(()=>{let e=t.type!==`hotOpeningReplicate`&&(String(t.resourceType??``).toLowerCase()===`image`||t.resourceType===1||String(t.resourceType??``)===`1`),n=``;return n=e?`/static`+t.resultUrl+`&w=300&p=50`||``:(t.type,t.coverUrl||t.resultUrl||t.resultUrl||``),(0,$.jsx)(`img`,{src:n?n.startsWith(`http`)?n:`https://ceshi.apiforeign.minzhongzc.com`+n:``,alt:t.title||t.name||`作品`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})(),String(t.resourceType??``).toLowerCase()===`image`?null:(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.2)`},children:(0,$.jsx)(X8,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,background:`#f8fafc`,paddingTop:0},children:(0,$.jsxs)(`div`,{style:{marginTop:6,display:`flex`,alignItems:`center`,gap:6,fontSize:12,color:`#64748b`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,padding:`1px 6px`,border:`1px solid #3b82f6`,borderRadius:4,color:`#3b82f6`,fontSize:11,fontWeight:500,background:`#fff`,lineHeight:1.4,whiteSpace:`nowrap`},children:{project:`项目媒体`,chatAi:`AI成片`,hotOpeningReplicate:`爆款复刻`,shotReplicate:`拆镜复刻`}[t.type]||`其他`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`·`}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:Vce(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(vL,{activeKey:l,onChange:e=>{u(e),e7(e).then(e=>{e?.categories?.[0]?.assets?f(e.categories[0].assets):f([])})},items:s.map(e=>({key:e.id,label:e.name})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`flex`,flexWrap:`wrap`,gap:16,justifyContent:`flex-start`,overflowX:`auto`,paddingBottom:8},children:d.length===0?(0,$.jsxs)(`div`,{style:{flex:1,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(L6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无素材`})]}):d.map((e,t)=>(0,$.jsx)(Bce,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(nK,{open:!!p,onCancel:()=>{_.current?.pause(),m(null),g(``),v.current=``},footer:null,width:900,centered:!0,className:`preview-modal`,style:{borderRadius:16,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,height:580,paddingTop:30},children:[(0,$.jsx)(`div`,{style:{flex:1,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24},children:(0,$.jsxs)(`div`,{style:{maxWidth:`100%`,maxHeight:500,borderRadius:12,overflow:`hidden`,background:`#0f172a`},children:[p?.mediaType===`video`?(0,$.jsx)(`video`,{ref:_,src:`https://ceshi.apiforeign.minzhongzc.com${p.url}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`},"webkit-playsinline":`true`}):(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${p?.url}`,alt:p?.title,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`}}),p?.mediaType===`video`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:32,right:32,fontSize:11,color:`#fff`,background:`rgba(0,0,0,0.6)`,padding:`3px 8px`,borderRadius:4},children:`AI生成`})]})}),(0,$.jsxs)(`div`,{style:{flex:1,padding:24,overflowY:`auto`},children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#fff`,marginBottom:16},children:`创意详情`}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:16},children:[(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`比例:`}),h||`计算中...`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#000000ff`,marginBottom:8},children:`视频提示词`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#000000ff`,lineHeight:1.6},children:p?.generationPrompt})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:`视频参考图`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:p?.mediaReferences&&p.mediaReferences.length>0?p.mediaReferences.map((e,t)=>{let n=e.url||e.resourceUrl||e.previewUrl||``,r=n.startsWith(`http`)?n:`https://ceshi.apiforeign.minzhongzc.com${n}`;return e.type===`video`?(0,$.jsxs)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(`video`,{src:r,muted:!0,onClick:e=>{e.stopPropagation();let n=e.currentTarget;x===t?(n.pause(),C(null)):(document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()}),n.play(),C(t))},className:`preview-video-item`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),x!==t&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(X8,{style:{fontSize:18,color:`#fff`}})})]},t):e.type===`audio`?(0,$.jsx)(`div`,{onClick:e=>{if(e.stopPropagation(),w===r)E.current&&E.current.pause(),T(null);else{E.current&&E.current.pause();let e=new Audio(r);E.current=e,e.onended=()=>{T(null)},e.play(),T(r)}},style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:w===r?(0,$.jsx)(O6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(O2,{style:{fontSize:24,color:`#fff`}})},t):(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`},children:(0,$.jsx)(`img`,{src:r,alt:`参考图 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})},t)}):(0,$.jsx)($.Fragment,{})})]})]})]}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,borderTop:`1px solid #334155`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(Z,{onClick:()=>{e(`/conversation`,{state:{generationPrompt:p?.generationPrompt,mediaReferences:p?.mediaReferences,aspectRatio:h}})},style:{padding:`8px 24px`,borderRadius:8,background:`#3b82f6`,border:`none`,color:`#fff`,fontSize:13,fontWeight:500},children:`去AI创作`})})})]})]})},{RangePicker:Uce}=rV,Z9={borderRadius:8,fontWeight:600},Q9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Wce=()=>{let e=Je(),[t]=Dn(),{message:n}=rx.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`advertiserId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,HE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10,r,a)=>{c(!0);try{let n=await Bae({advertiser_id:a??w,consume_date:r??E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await Q5()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{document.referrer.includes(window.location.origin)?e(-1):e(`/materials`)},I=()=>{b(1),M(1,x)},L=()=>{nK.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(rV,{value:(0,HE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,HE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(wW,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await Vae({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},R=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[t.get(`advertiserId`)&&(0,$.jsx)(Z,{type:`text`,icon:(0,$.jsx)(y2,{}),onClick:F}),(0,$.jsx)(Y4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,$.jsx)(wW,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180,borderRadius:8},allowClear:!0,onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(Uce,{value:E?[(0,HE.default)(E[0]),(0,HE.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)},style:{borderRadius:8}}),(0,$.jsx)(Z,{type:`primary`,onClick:I,style:{...Z9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(Z,{icon:(0,$.jsx)($re,{}),onClick:L,loading:l,style:Z9,children:`拉取消耗`}),(0,$.jsx)(Z,{icon:(0,$.jsx)(x8,{}),onClick:()=>f(!0),style:{...Z9,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(PQ,{dataSource:P,columns:R,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(uG,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(nK,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(wW,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(kR,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(kR,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(w1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(Z,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(Z,{size:`small`,onClick:async()=>{try{let e=((await Q5()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(w1.Text,{children:n?.description||e}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Gce=()=>{let e=Je(),[t]=Dn(),{message:n}=rx.useApp(),[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)(!0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);(0,S.useEffect)(()=>{let r=t.get(`auth_code`),a=t.get(`state`);if(!r||!a){o(!1),i(10);return}let s={auth_code:r,state:a,app_id:t.get(`app_id`)||void 0,material_auth_status:t.get(`material_auth_status`)||void 0,scope:t.get(`scope`)||void 0,uid:t.get(`uid`)||void 0};(async()=>{try{let t=await mae(s);c(!0),o(!1),n.success(t?.message||`授权成功`),setTimeout(()=>{e(`/authorization`)},1500)}catch(e){let t=e?.message||`授权失败`;u(t),o(!1),n.error(t)}})();let l=setInterval(()=>{i(e=>e>=11?(o(!1),e):e+1)},1e3);return()=>{clearInterval(l)}},[e,t,n]);let d=()=>{i(0),o(!0),c(!1),u(``),window.location.href=`/authorization`};return s?(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`#dcfce7`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:(0,$.jsx)(w1.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`},children:`正在跳转至授权管理页面...`})]})}):(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:a&&r<10?(0,$.jsx)(jG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(XB,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(fq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):r>=10?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(Z,{type:`primary`,size:`large`,icon:(0,$.jsx)(fq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w1.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(XB,{style:{color:`#6366f1`}}),(0,$.jsxs)(w1.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},Kce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fed7aa 100%)`,border:`1px solid rgba(245, 158, 11, 0.18)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #f59e0b 0%, #d97706 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(245, 158, 11, 0.3)`},children:(0,$.jsx)(L2,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700,backgroundImage:`linear-gradient(90deg, #f59e0b 0%, #d97706 30%, #ea580c 50%, #d97706 70%, #f59e0b 100%)`},children:`行业爆款大盘`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#b45309`},children:[(0,$.jsx)(i8,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(w1.Text,{style:{color:`#78716c`,fontSize:14,lineHeight:1.7},children:`实时追踪各行业爆款素材,把握创作风向,打造热门内容`})]}),(0,$.jsx)(`div`,{style:{position:`relative`},children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(H8,{style:{marginRight:8,color:`#6366f1`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`爆款素材榜单`}),(0,$.jsx)(`span`,{style:{marginLeft:10,fontSize:12,fontWeight:400,color:`#94a3b8`}})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,zIndex:1,inset:0,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:2,color:`#fff`,borderRadius:6},children:(0,$.jsxs)(Z,{type:`primary`,size:`middle`,onClick:()=>{Q.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(Y3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(S2,{style:{marginLeft:4,fontSize:12}})]})}),[{rank:1,title:`夏日美妆教程:3 步打造奶油肌`,author:`美妆博主·小雅`,views:`128.4w`,likes:`12.6w`,comments:`8,234`,tag:`NO.1`,tagColor:`#f59e0b`},{rank:2,title:`平价穿搭 | 学生党一周不重样`,author:`穿搭达人·Miki`,views:`96.2w`,likes:`9.8w`,comments:`6,128`,tag:`NO.2`,tagColor:`#a78bfa`},{rank:3,title:`探店 vlog | 网红咖啡馆测评`,author:`美食探店·阿伦`,views:`78.5w`,likes:`7.4w`,comments:`4,892`,tag:`NO.3`,tagColor:`#6366f1`},{rank:4,title:`iPhone 16 Pro 一周深度体验`,author:`数码评测·老王`,views:`65.7w`,likes:`6.1w`,comments:`3,847`,tag:`NO.4`,tagColor:`#94a3b8`}].map(e=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{display:`flex`,gap:14,padding:14,borderRadius:14,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:140,height:80,flexShrink:0,borderRadius:10,overflow:`hidden`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(K6,{style:{fontSize:28,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:600},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:e.author}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,fontSize:12,color:`#64748b`},children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(nW,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(U3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(j4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),qce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #fce7f3 100%)`,border:`1px solid rgba(139, 92, 246, 0.12)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(139, 92, 246, 0.3)`},children:(0,$.jsx)(p3,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700},children:`创意素材案例`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#7c3aed`},children:[(0,$.jsx)(B4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(w1.Text,{style:{color:`#64748b`,fontSize:14,lineHeight:1.7},children:`精选 AI 生成的优秀素材案例,展示 AI 创作的无限潜力与创意灵感`})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(N8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:16,marginBottom:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,borderRadius:14,gap:4,color:`#fff`},children:(0,$.jsxs)(Z,{type:`primary`,size:`middle`,onClick:()=>{Q.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(Y3,{style:{marginRight:6}}),`解锁全部案例`,(0,$.jsx)(S2,{style:{marginLeft:4,fontSize:12}})]})}),[{title:`美妆直播切片`,tag:`热门`,tagColor:`#ef4444`},{title:`3C 数码测评`,tag:`推荐`,tagColor:`#6366f1`},{title:`美食探店 vlog`,tag:`推荐`,tagColor:`#6366f1`},{title:`服饰穿搭合集`,tag:`热门`,tagColor:`#ef4444`},{title:`家居场景展示`,tag:`推荐`,tagColor:`#6366f1`},{title:`母婴亲子内容`,tag:`热门`,tagColor:`#ef4444`}].map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{position:`relative`,borderRadius:14,overflow:`hidden`,cursor:`pointer`,border:`1px solid #e2e8f0`,background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(K6,{style:{fontSize:36,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,left:10,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:500},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#334155`,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(nW,{style:{fontSize:13,color:`#94a3b8`}})]})]},t))]})]})]}),{RangePicker:Jce}=rV;function $9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var Yce={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},Xce=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await uoe())}catch(e){Q.error(e?.message||`获取团队信息失败`)}finally{r(!1)}},[]);(0,S.useEffect)(()=>{i()},[i]);let[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(1),p=(0,S.useCallback)(async()=>{if(e){u(!0);try{let e=await doe(d);o(e.items||[]),c(e.total||0)}catch(e){Q.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=UH.useForm(),[_,v]=(0,S.useState)(!1),y=async()=>{if(m.member)try{let e=await g.validateFields(),t=Number(e.amount);if(!t||t<=0||t>9999999){Q.error(`请输入有效的正数积分数量`);return}v(!0),await foe(m.member.id,t,e.direction||`increase`,e.description),Q.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),me()}catch(e){if(e?.errorFields)return;Q.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=UH.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await poe()||[])}catch(e){Q.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await moe(e.maxUses||null,null),Q.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Q.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await hoe(e),Q.success(`已撤销`),A()}catch(e){Q.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Q.success(`邀请链接已复制`)}).catch(()=>{P(e)}):P(e)},P=e=>{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`-9999px`,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand(`copy`),Q.success(`邀请链接已复制`)}catch{Q.warning(`复制失败,请手动复制`)}document.body.removeChild(t)},[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(`pending`),[V,H]=(0,S.useState)(`members`),U=(0,S.useRef)(!1),W=(0,S.useRef)(0),G=(0,S.useCallback)(async(e,t=!1)=>{R(!0);try{let n=await goe(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,nK.confirm({title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(B2,{style:{color:`#f59e0b`}}),`待处理的加入申请`]}),content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`p`,{children:[`您有 `,(0,$.jsx)(`strong`,{style:{color:`#ef4444`},children:r}),` 条待处理的团队加入申请。`]}),(0,$.jsx)(`p`,{style:{color:`#64748b`,fontSize:13,marginBottom:0},children:`请及时处理新成员的加入申请。`})]}),okText:`立即处理`,cancelText:`稍后处理`,onOk:()=>{H(`requests`)}})):!t&&r>W.current&&Q.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Q.error(e?.message||`加载申请失败`)}finally{R(!1)}},[]);(0,S.useEffect)(()=>{G(`pending`,!0)},[G]),(0,S.useEffect)(()=>{if(!e)return;let t=setInterval(()=>{G(`pending`,!1)},6e4);return()=>clearInterval(t)},[e,G]);let K=async(e,t,n)=>{try{await _oe(e,t,n),Q.success(t===`approve`?`已通过`:`已拒绝`),G(z),p()}catch(e){Q.error(e?.message||`操作失败`)}},[ee,q]=(0,S.useState)([]),[te,ne]=(0,S.useState)(0),[re,ie]=(0,S.useState)(null),[J,ae]=(0,S.useState)(!1),[oe,se]=(0,S.useState)(1),[ce,le]=(0,S.useState)(``),[ue,de]=(0,S.useState)(``),[fe,pe]=(0,S.useState)(()=>{let e=(0,HE.default)().format(`YYYY-MM-DD`);return[e,e]}),me=(0,S.useCallback)(async()=>{ae(!0);try{let e=await xoe({page:oe,pageSize:10,phone:ue||void 0,recordType:ce||void 0,startDate:fe?.[0]||void 0,endDate:fe?.[1]||void 0});q(e.items||[]),ne(e.total||0),ie(e.summary||null)}catch(e){Q.error(e?.message||`加载积分记录失败`)}finally{ae(!1)}},[oe,ce,ue,fe]);(0,S.useEffect)(()=>{me()},[me]);let he=()=>{le(``),de(``);let e=(0,HE.default)().format(`YYYY-MM-DD`);pe([e,e]),se(1)},ge=()=>{let e=Soe({phone:ue||void 0,recordType:ce||void 0,startDate:fe?.[0]||void 0,endDate:fe?.[1]||void 0}),t=localStorage.getItem(`auth_token`),n=t?{Authorization:`Bearer ${t}`}:{};fetch(e,{headers:n}).then(e=>e.blob()).then(e=>{let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`团队积分_${(0,HE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Q.error(`导出失败`))},_e=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(w1.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(qQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>$9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=l7.getState().user?.id;return t.id===n?(0,$.jsx)(jw,{title:`不能给自己调整积分`,children:(0,$.jsx)(Z,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(Z,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ve=e=>`${window.location.origin}/join-team?code=${e}`,ye=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(w1.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ve(e);return(0,$.jsxs)(YV,{style:{width:`100%`},children:[(0,$.jsx)(w1.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(jw,{title:`复制链接`,children:(0,$.jsx)(Z,{size:`small`,type:`text`,icon:(0,$.jsx)(Q$,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(qQ,{color:e===`active`?`green`:`default`,children:e===`active`?`有效`:`已撤销`})},{title:`使用次数`,key:`uses`,width:100,render:(e,t)=>`${t.useCount}${t.maxUses?`/${t.maxUses}`:``}`},{title:`过期时间`,dataIndex:`expiresAt`,width:170,render:e=>e?$9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(Z,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],be=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(qQ,{color:t.color,children:t.text})},xe=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>be(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?$9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(YV,{size:4,children:[(0,$.jsx)(Z,{size:`small`,type:`link`,icon:(0,$.jsx)(jC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>K(t.id,`approve`),children:`通过`}),(0,$.jsx)(Z,{size:`small`,type:`link`,icon:(0,$.jsx)(Au,{}),danger:!0,style:{padding:0},onClick:()=>{nK.confirm({title:`拒绝申请`,content:(0,$.jsx)(UH,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(UH.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)(wW.TextArea,{rows:2,placeholder:`选填`,id:`reject-note-input`})})}),onOk:()=>{let e=document.getElementById(`reject-note-input`)?.value||void 0;K(t.id,`reject`,e)}})},children:`拒绝`})]}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:`已处理`})}],Se=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(w1.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=Yce[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(qQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(w1.Text,{strong:!0,style:{color:t.amount>=0?`#10b981`:`#ef4444`,fontSize:14},children:[t.amount>=0?`+`:``,(t.amount??0).toFixed(2)]})},{title:`余额`,dataIndex:`balanceAfter`,width:100,align:`right`,render:e=>(e??0).toFixed(2)},{title:`说明`,dataIndex:`description`,ellipsis:!0,minWidth:160,render:e=>e||`-`},{title:`时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)}],Ce={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},we={padding:`16px`,textAlign:`right`},Te=[{key:`members`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(J8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(PQ,{columns:_e,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(fC,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(uG,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q8,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(HC,{value:ce||void 0,onChange:e=>{le(e||``),se(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)(wW,{placeholder:`搜索手机号`,value:ue,onChange:e=>{de(e.target.value),se(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(Jce,{value:fe?[(0,HE.default)(fe[0]),(0,HE.default)(fe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?pe([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):pe(null),se(1)}}),(0,$.jsx)(Z,{onClick:he,children:`重置`}),(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(f0,{}),onClick:ge,children:`导出 Excel`})]}),(0,$.jsx)(`div`,{style:{marginBottom:12,padding:`8px 16px`,background:`#f8f9fc`,borderRadius:8,display:`flex`,gap:24,flexWrap:`wrap`,fontSize:13},children:(0,$.jsxs)(`span`,{children:[`总消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:15},children:re?.totalConsume??0})]})}),(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(PQ,{rowKey:`id`,loading:J,dataSource:ee,pagination:!1,bordered:!1,scroll:{x:950},columns:Se,locale:{emptyText:(0,$.jsx)(fC,{description:`暂无积分记录`})}}),te>0&&(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(uG,{current:oe,pageSize:10,total:te,onChange:e=>se(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q$,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:Ce,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(Z,{type:`primary`,icon:(0,$.jsx)(JI,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(PQ,{columns:ye,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(fC,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(YV,{children:[(0,$.jsx)(T3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(qQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(XR,{value:z,onChange:e=>{B(e),G(e)},options:[{label:`待处理`,value:`pending`},{label:`已通过`,value:`approved`},{label:`已拒绝`,value:`rejected`},{label:`全部`,value:``}],style:{borderRadius:12,border:`1px solid #e2e8f0`,padding:3,background:`#f8fafc`,boxShadow:`0 2px 8px rgba(0,0,0,0.06)`,"--ant-segmented-item-selected-bg":`#6366f1`,"--ant-segmented-item-selected-color":`#ffffff`},size:`middle`})}),(0,$.jsx)(`div`,{style:Ce,children:(0,$.jsx)(PQ,{columns:xe,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(fC,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(w1.Text,{type:`secondary`,children:`加载中...`}):e?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:12},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(w1.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(w1.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(Z,{icon:(0,$.jsx)(fq,{}),onClick:()=>{i(),p(),A(),G(z),me()},children:`刷新`})]}):(0,$.jsx)(w1.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(vL,{items:Te,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(J8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(UH,{form:g,layout:`vertical`,style:{marginTop:16},initialValues:{direction:`increase`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:`10px 16px`,background:`#f0f4ff`,borderRadius:8,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(w1.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(w1.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:l7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(UH.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(eI.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(eI.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(eI.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(UH.Item,{name:`amount`,label:`积分数量`,required:!0,rules:[{required:!0,message:`请输入积分数量`},{type:`number`,min:.01,message:`必须大于 0`},{type:`number`,max:9999999,message:`单次不能超过 9999999`}],validateTrigger:[`onChange`,`onBlur`],children:(0,$.jsx)(Lz,{style:{width:`100%`},step:1,min:.01,max:9999999,precision:2,placeholder:`请输入正数积分数量`,size:`large`,formatter:e=>{if(!e)return``;let t=`${e}`.replace(/[^0-9.]/g,``);return t=t.replace(/^0+(?=\d)/,``),t},parser:e=>{if(!e||e===`.`)return``;let t=parseFloat(e);return isNaN(t)||t<=0?``:Math.min(t,9999999)},onKeyDown:e=>{(e.key===`-`||e.key===`e`||e.key===`E`)&&e.preventDefault()},onChange:e=>{e??g.validateFields([`amount`])}})}),(0,$.jsx)(UH.Item,{name:`description`,label:`备注`,children:(0,$.jsx)(wW.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(Q$,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(UH,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(UH.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(Lz,{style:{width:`100%`},min:1,placeholder:`留空表示不限`,size:`large`})}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`#eef2ff`,borderRadius:8,fontSize:13,color:`#4f46e5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(XB,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},Zce=()=>{let[e]=Dn(),t=Je(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=l7(),[o,s]=(0,S.useState)(!0),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`VideoGen.AI`),[v,y]=(0,S.useState)(``);return(0,S.useEffect)(()=>{a(),E5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?voe(n):yoe(n)).then(e=>{l(e),e?.valid&&r&&!e.alreadyInTeam&&!e.hasPendingRequest&&h(!0)}).catch(()=>l(null)).finally(()=>s(!1)))},[n,r,i]),i||o?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:`60vh`},children:(0,$.jsx)(jG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`success`,icon:(0,$.jsx)(u4,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Iq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(YV,{children:(0,$.jsx)(Z,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`40px 20px`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:480},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,marginBottom:32},children:[v?(0,$.jsx)(`img`,{src:v,alt:`logo`,style:{width:40,height:40,borderRadius:10}}):(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(z8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(bL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(L8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(w1.Title,{level:3,children:`加入团队`}),(0,$.jsx)(w1.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(w1.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(Z,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(YV,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(Z,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)(Q3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(Z,{size:`large`,block:!0,icon:(0,$.jsx)(die,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(w1.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(nK,{title:(0,$.jsxs)(YV,{children:[(0,$.jsx)(L8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await boe(n),p(!0),h(!1),Q.success(`申请已提交`)}catch(e){Q.error(e?.message||`申请失败`)}finally{d(!1)}},onCancel:()=>h(!1),okText:`确认加入`,cancelText:`取消`,confirmLoading:u,width:420,children:[(0,$.jsxs)(`p`,{style:{marginBottom:0},children:[`您确定要加入团队 `,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`},children:[`「`,c.teamName,`」`]}),` 吗?`]}),(0,$.jsx)(`p`,{style:{marginTop:8,color:`#64748b`,fontSize:13},children:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},Qce=new Set([`group_active`,`callback_success`]),$ce=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=Qce.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(bL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(Iq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(Z,{type:`primary`,onClick:()=>{let e=/MicroMessenger/i.test(navigator.userAgent),t=/AlipayClient/i.test(navigator.userAgent),n=/Android|iPhone|iPad/i.test(navigator.userAgent);if(e)try{window.opener=null,window.open(``,`_self`),window.close()}catch{Q.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Q.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(w1.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})};HE.default.locale(`zh-cn`);var ele=({children:e})=>{let{user:t,loading:n,checkAuth:r}=l7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(jG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=l7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(jm,{locale:j0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(rx,{children:(0,$.jsx)(gn,{children:(0,$.jsxs)(Et,{children:[(0,$.jsx)(wt,{path:`/login`,element:(0,$.jsx)(Doe,{})}),(0,$.jsx)(wt,{path:`/join-team`,element:(0,$.jsx)(Zce,{})}),(0,$.jsx)(wt,{path:`/private-portrait-authorized`,element:(0,$.jsx)($ce,{})}),(0,$.jsxs)(wt,{path:`/`,element:(0,$.jsx)(ele,{children:(0,$.jsx)(Toe,{})}),children:[(0,$.jsx)(wt,{index:!0,element:(0,$.jsx)(St,{to:`/projects`,replace:!0})}),(0,$.jsx)(wt,{path:`projects`,element:(0,$.jsx)(Aoe,{})}),(0,$.jsx)(wt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(Joe,{})}),(0,$.jsx)(wt,{path:`records`,element:(0,$.jsx)(Yoe,{})}),(0,$.jsx)(wt,{path:`credits`,element:(0,$.jsx)(Xoe,{})}),(0,$.jsx)(wt,{path:`credit-records`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`order-records`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`user-center`,element:(0,$.jsx)(z7,{})}),(0,$.jsx)(wt,{path:`messages`,element:(0,$.jsx)($oe,{})}),(0,$.jsx)(wt,{path:`home`,element:(0,$.jsx)(Hce,{})}),(0,$.jsx)(wt,{path:`conversation`,element:(0,$.jsx)(Fse,{})}),(0,$.jsx)(wt,{path:`initial`,element:(0,$.jsx)(Vse,{})}),(0,$.jsx)(wt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(qse,{})}),(0,$.jsx)(wt,{path:`removelens`,element:(0,$.jsx)(ece,{})}),(0,$.jsx)(wt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Fce,{})}),(0,$.jsx)(wt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(zce,{})}),(0,$.jsx)(wt,{path:`generated`,element:(0,$.jsx)(lce,{})}),(0,$.jsx)(wt,{path:`pretest`,element:(0,$.jsx)(dce,{})}),(0,$.jsx)(wt,{path:`authorization`,element:(0,$.jsx)(pce,{})}),(0,$.jsx)(wt,{path:`authoriza-waiting`,element:(0,$.jsx)(Gce,{})}),(0,$.jsx)(wt,{path:`materials`,element:(0,$.jsx)(xce,{})}),(0,$.jsx)(wt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(St,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(wt,{path:`consume`,element:(0,$.jsx)(Wce,{})}),(0,$.jsx)(wt,{path:`popular`,element:(0,$.jsx)(Kce,{})}),(0,$.jsx)(wt,{path:`authacc`,element:(0,$.jsx)(hce,{})}),(0,$.jsx)(wt,{path:`creativeplaza`,element:(0,$.jsx)(qce,{})}),(0,$.jsx)(wt,{path:`team-management`,element:(0,$.jsx)(Xce,{})})]}),(0,$.jsx)(wt,{path:`*`,element:(0,$.jsx)(St,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file diff --git a/video-gen-app/dist/index.html b/video-gen-app/dist/index.html index 1c7b2153..a422c459 100644 --- a/video-gen-app/dist/index.html +++ b/video-gen-app/dist/index.html @@ -28,7 +28,7 @@ } })(); - +