From 5bcc7888c2928cc321ce2cbd397c4c1add7b1581 Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Mon, 10 Aug 2026 19:05:07 +0800 Subject: [PATCH] 1 --- video-gen-api/app/main.py | 6 +++++- video-gen-api/app/middleware/request_encrypt.py | 8 -------- video-gen-api/app/services/invoice.py | 5 ++++- .../dist/assets/{index-CFnMIoCK.js => index-D088jE8K.js} | 2 +- video-gen-app/dist/index.html | 2 +- video-gen-app/src/pages/InvoicePage.tsx | 6 +++--- 6 files changed, 14 insertions(+), 15 deletions(-) rename video-gen-app/dist/assets/{index-CFnMIoCK.js => index-D088jE8K.js} (97%) diff --git a/video-gen-api/app/main.py b/video-gen-api/app/main.py index 8cf4c1f0..17fb94f4 100644 --- a/video-gen-api/app/main.py +++ b/video-gen-api/app/main.py @@ -635,7 +635,11 @@ def create_app() -> FastAPI: async def v3_http_exception_handler(request: Request, exc: HTTPException): """仅对 /api/v3/ 路径返回统一格式,HTTP 状态码固定 200。""" if not str(request.url.path).startswith("/api/v3"): - raise exc # 交给其他处理器 + # 非 v3 路径返回标准 HTTPException 响应,保持原始状态码 + return JSONResponse( + status_code=exc.status_code, + content={"detail": exc.detail}, + ) detail = exc.detail message = detail.get("message", str(detail)) if isinstance(detail, dict) else str(detail) code_map = {400: 40000, 401: 40100, 403: 40300, 404: 40400, 429: 42900, 422: 42200, 500: 50000, 504: 50400} diff --git a/video-gen-api/app/middleware/request_encrypt.py b/video-gen-api/app/middleware/request_encrypt.py index 06e6a6ac..071eb83d 100644 --- a/video-gen-api/app/middleware/request_encrypt.py +++ b/video-gen-api/app/middleware/request_encrypt.py @@ -98,14 +98,6 @@ class RequestEncryptMiddleware(BaseHTTPMiddleware): status_code=response.status_code, headers={"X-Encrypted": "true", "Content-Type": "application/json"}, ) - except HTTPException as http_exc: - # BaseHTTPMiddleware 中 call_next 抛出的 HTTPException 会直接传播, - # 这里捕获后返回对应状态码的响应,避免被外层 except Exception 吞掉 - return Response( - content=json.dumps({"detail": http_exc.detail}, ensure_ascii=False), - status_code=http_exc.status_code, - headers={"Content-Type": "application/json"}, - ) except Exception: logger.exception("Request decryption failed") return Response( diff --git a/video-gen-api/app/services/invoice.py b/video-gen-api/app/services/invoice.py index 8c88abb7..8164519c 100644 --- a/video-gen-api/app/services/invoice.py +++ b/video-gen-api/app/services/invoice.py @@ -88,7 +88,10 @@ async def create_invoice( # 2. 检查订单唯一性 occupied = await check_orders_available(db, data.order_ids) if occupied: - details = f"订单 {order.order_no} 未支付,无法开票", + details = "; ".join( + f"订单 {o['order_no']} 已被发票 {o['invoice_no']} 占用" + for o in occupied + ) raise HTTPException( status_code=status.HTTP_409_CONFLICT, detail=details, diff --git a/video-gen-app/dist/assets/index-CFnMIoCK.js b/video-gen-app/dist/assets/index-D088jE8K.js similarity index 97% rename from video-gen-app/dist/assets/index-CFnMIoCK.js rename to video-gen-app/dist/assets/index-D088jE8K.js index 1cdc6c24..6ca9515c 100644 --- a/video-gen-app/dist/assets/index-CFnMIoCK.js +++ b/video-gen-app/dist/assets/index-D088jE8K.js @@ -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)(oG,{size:`small`}),(0,$.jsx)(ble,{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)(oG,{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)(nB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${L9(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:kle}=$U,Ale=`https://ceshi.apiforeign.minzhongzc.com`,H9=2,U9=15,jle=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 W9(e){return e?/^https?:\/\//i.test(e)?e:`${Ale}${e}`:``}var Mle=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(W9(n)),children:[(0,$.jsx)(`video`,{src:W9(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=w9(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)(oG,{size:`small`,style:{color:`#f59e0b`}}):null,(0,$.jsx)(`span`,{style:{color:r.failure?`#ef4444`:r.active?`#f59e0b`:`#94a3b8`},children:r.label})]})})});function Nle(){let{creatID:e}=$e(),t=Ye(),{user:n,optimizeHoldCredits:r}=e7(),[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)([]),[te,ne]=(0,S.useState)(1),[re,ie]=(0,S.useState)(20),[ae,q]=(0,S.useState)(0),[oe,se]=(0,S.useState)(!1),[ce,le]=(0,S.useState)(!1),[ue,de]=(0,S.useState)(!1),fe=(0,S.useRef)(null),pe=(0,S.useRef)(null),me=(0,S.useRef)(null),he=(0,S.useMemo)(()=>W9(W?.videoUrl),[W?.videoUrl]);(0,S.useEffect)(()=>{T5().then(e=>{let t=e?.engine?.video||[];if(D(t),t.length>0){let e=t[0],n=(()=>{let t=e.maxDuration??e.max_duration;if(t!=null)return Number(t);let n=e.supportedDurations;return Array.isArray(n)&&n.length>0?Math.max(...n):15})(),r=e.supportedDurations,i=Array.from({length:Math.max(n-4,1)},(e,t)=>t+5),a=Array.from(new Set([...r||[],...i].sort((e,t)=>e-t)));k(e.id),N(e.supportedRatios?.includes(`9:16`)?`9:16`:e.supportedRatios?.[0]||`9:16`),F(e.supportedResolutions?.[0]||`480p`),j((r||[]).find(e=>e<=n)??i[0]??5),V({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.length>0?a:i})}}).catch(()=>Z.error(`视频引擎加载失败`)),O5().then(e=>U(Array.isArray(e)?e:[])).catch(()=>U([]))},[]),(0,S.useEffect)(()=>{if(!_e)return;let e=(()=>{let e=_e.maxDuration??_e.max_duration;if(e!=null)return Number(e);let t=_e.supportedDurations;return Array.isArray(t)&&t.length>0?Math.max(...t):15})(),t=_e.supportedDurations,n=Array.from({length:Math.max(e-4,1)},(e,t)=>t+5),r=Array.from(new Set([...t||[],...n].sort((e,t)=>e-t)));V(t=>{let i=t.durations;return(i.length>0?Math.max(...i):0)===e?t:{ratios:_e.supportedRatios||t.ratios,resolutions:_e.supportedResolutions||t.resolutions,durations:r.length>0?r:n}}),j(r=>r<=e?r:(t||[]).find(t=>t<=e)??n[0]??5)},[O]);let ge=(0,S.useRef)(null),_e=E.find(e=>e.id===O),ve=(()=>{if(!_e)return 15;let e=_e.maxDuration??_e.max_duration;if(e!=null)return Number(e);let t=_e.supportedDurations;return Array.isArray(t)&&t.length>0?Math.max(...t):15})(),ye=!x||jle(_e),be=(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]),xe=Number(n?.credits||0)K.length===0?`AI自动拆分`:K.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[K]),Ce=(0,S.useCallback)(async()=>{if(e)try{G(await R5(e))}catch{Z.error(`获取任务详情失败`)}},[e]),we=(0,S.useCallback)(async()=>{if(e)try{let t=await yoe(e,te,re);ee(t.items||[]),q(t.total||0)}catch{Z.error(`获取拆镜列表失败`)}},[e,te,re]),Te=(0,S.useCallback)(e=>{p(e),h(!0)},[]),Ee=(0,S.useCallback)(async()=>{if(e)try{await koe(e),Z.success(`重新分析已提交`),me.current=Date.now(),await Ce()}catch(e){Z.error(e?.message||`重新分析失败`)}},[e,Ce]),De=(0,S.useCallback)(async e=>{try{await joe(e),Z.success(`重新分析已提交`),we()}catch(e){Z.error(e?.message||`重新分析失败`)}},[we]),Oe=(0,S.useCallback)(async e=>{try{await Moe(e),Z.success(`重新切割已提交`),await we()}catch(e){Z.error(e?.message||`重新切割失败`)}},[we]),ke=(0,S.useCallback)(async e=>{try{await Aoe(e),Z.success(`删除成功`),we()}catch(e){Z.error(e?.message||`删除失败`)}},[we]),Ae=(0,S.useCallback)(async()=>{await Promise.all([Ce(),we()])},[Ce,we]);(0,S.useEffect)(()=>(Ae(),()=>{fe.current&&window.clearTimeout(fe.current),pe.current&&window.clearTimeout(pe.current)}),[Ae]),(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){me.current=null,pe.current&&=(window.clearTimeout(pe.current),null);return}me.current||=Date.now();let t=async()=>{if(document.visibilityState===`visible`)try{G(await R5(e))}catch{}},n=()=>{if(!pe.current)return;let e=Date.now()-(me.current||Date.now()),r=e<6e4?3e3:e<6e5?1e4:3e4;pe.current=window.setTimeout(async()=>{await t(),n()},r)};pe.current=window.setTimeout(async()=>{await t(),n()},3e3);let r=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{pe.current&&=(window.clearTimeout(pe.current),null),document.removeEventListener(`visibilitychange`,r)}},[W?.analysisStatus,e]);let je=K.some(e=>Xce(e));(0,S.useEffect)(()=>{if(!je||!e){fe.current&&=(window.clearTimeout(fe.current),null);return}let t=async()=>{document.visibilityState===`visible`&&await we()};fe.current=window.setTimeout(()=>void t(),3e4);let n=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,n),()=>{fe.current&&=(window.clearTimeout(fe.current),null),document.removeEventListener(`visibilitychange`,n)}},[e,we,je]);let Me=(e,t)=>{l(e),d(t),a(!0)},Ne=()=>{a(!1),l(null),v(``),d(``),b(``),C(``),T(``)},Pe=async e=>{try{let t=await zae(e);C(t.url),T(t.resource_id||``),Z.success(`图片上传成功`)}catch{Z.error(`图片上传失败,请重试`)}return!1},Fe=async()=>{if(!c){Z.warning(`请先选择拆镜片段`);return}if(!O){Z.warning(`请选择视频引擎`);return}if(!ye){Z.warning(`当前视频引擎不支持参考图片,请移除素材图片或切换引擎`);return}if(xe){Z.warning(`积分不足,请充值后再创建复刻项目`);return}let e=ge.current,n=e?.segmentId===c?e.key:`shot_v2_${c}_${Date.now()}_${Math.random().toString(16).slice(2)}`;ge.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};se(!0);try{let e=await boe(c,r),n=e?.projectId||e?.id||e?.detail?.id;ge.current=null,Z.success(`项目已创建,视频提词正在生成`),Ne(),await we(),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}Z.error(t||`创建失败,请重试`)}finally{se(!1)}},Ie=async()=>{if(e){de(!0);try{let t=K.some(e=>e.sourceMode===`ai_suggestion`);await _oe(e,{selected_indices:[],replace_existing:t}),Z.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await Ae()}catch(e){Z.error(e?.message||`拆镜失败`)}finally{de(!1)}}},Le=()=>{if(!he){Z.warning(`原视频地址不存在`);return}s(!0)},Re=async t=>{if(e){if(t.durationSecondU9){Z.warning(`拆镜片段不能超过 ${U9} 秒`);return}le(!0);try{await voe(e,{start_second:t.startSecond,end_second:t.endSecond}),Z.success(`手动拆镜任务已提交`),s(!1),await Ae()}catch(e){Z.error(e?.message||`手动拆镜失败`)}finally{le(!1)}}},ze=e=>(e?.splitStatus||e?.split_status)===`completed`&&!!(e?.segmentVideoUrl||e?.segment_video_url),Be=(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)(SQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(SQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(Mle,{record:t,onPreview:Te})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=w9(t.split_status||t.splitStatus);if(n.active)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(oG,{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=C9(t.analysis_status||t.analysisStatus);return r.active?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(oG,{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)(X,{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)(X,{type:`text`,onClick:()=>Me(String(n.id),n.segmentName),disabled:!ze(n),style:{color:ze(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:ze(n)?`视频生成`:`待切割完成`}),C9(n.analysisStatus||n.analysis_status).failure&&(0,$.jsx)(X,{type:`text`,onClick:()=>De(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),w9(n.splitStatus||n.split_status).failure&&(0,$.jsx)(X,{type:`text`,onClick:()=>Oe(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(FG,{title:`确定删除此片段?`,onConfirm:()=>ke(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(X,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],[]),Ve=(0,S.useMemo)(()=>(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,background:`#fff`,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,$.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)(lQ,{columns:Be,dataSource:K,pagination:{current:te,pageSize:re,total:ae,onChange:(e,t)=>{ne(e),ie(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`}})}}})]}),[K,Be,te,re,ae]);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)(X,{icon:(0,$.jsx)(q0,{}),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(he),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:he,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)(X,{onClick:Ee,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)(oG,{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)(SQ,{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)(oG,{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)(X,{type:`default`,onClick:Le,disabled:!he||ce||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)(FG,{title:Se===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:Ie,children:(0,$.jsxs)(X,{type:`primary`,loading:ue,disabled:ue||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:Se}),(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)(kw,{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 镜头拆分方案)`})})]})})]}),Ve]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Ole,{open:o,videoUrl:he,title:`手动视频切片`,loading:ce,minDuration:H9,maxDuration:U9,onCancel:()=>s(!1),onConfirm:Re}),(0,$.jsx)(hV,{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(),Ne()},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:Ne,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:W9(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)(IQ,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(T7,{accept:`image/*`,multiple:!1,mediaType:`image`,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&Pe(e[0])},onHistorySelect:e=>{let t=e[0];t&&(C(t.resourceUrl||t.previewUrl||t.displayUrl||``),T(t.id),Z.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)($U,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入项目名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:50,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)(kle,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入项目描述`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:200,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)(l8,{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);let t=(()=>{let t=e.maxDuration??e.max_duration;if(t!=null)return Number(t);let n=e.supportedDurations;return Array.isArray(n)&&n.length>0?Math.max(...n):15})(),n=e.supportedDurations,r=Array.from({length:Math.max(t-4,1)},(e,t)=>t+5),i=Array.from(new Set([...n||[],...r].sort((e,t)=>e-t)));V({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:i}),e.supportedRatios?.includes(M)||N(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(P)||F(e.supportedResolutions?.[0]||`720p`),(!i.includes(A)||A>t)&&j(i.find(e=>e<=t)??i[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)(P3,{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))/(ve-Math.min(...B.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...B.durations),max:ve,value:A,onChange:e=>j(Math.min(Number(e.target.value),ve)),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:ye?`#6366f1`:`#ef4444`,fontSize:13},children:ye?``:`当前引擎不支持参考图片,请移除素材图片或切换引擎。`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(kw,{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:Ple,Text:G9}=Q,{TextArea:Fle}=$U;function Ile(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var K9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function Lle(){let e=Ye(),{creatID:t}=$e(),[n]=On(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=e7(),[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`),[te,ne]=(0,S.useState)(`480p`),[re,ie]=(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]}),[ae,q]=(0,S.useState)([]),[oe,se]=(0,S.useState)(1),[ce,le]=(0,S.useState)(20),[ue,de]=(0,S.useState)(0),[fe,pe]=(0,S.useState)(``),[me,he]=(0,S.useState)({}),[ge,_e]=(0,S.useState)([]),[ve,ye]=(0,S.useState)([]),[be,xe]=(0,S.useState)(!1),[Se,Ce]=(0,S.useState)(``),[we,Te]=(0,S.useState)(`image`),[Ee,De]=(0,S.useState)(!1),Oe=S.useRef(null);(0,S.useEffect)(()=>{if(be&&we===`video`){let e=()=>{Oe.current&&Oe.current.play().catch(()=>{})};Oe.current&&(Oe.current.readyState>=2?e():Oe.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Oe.current&&(Oe.current.removeEventListener(`loadedmetadata`,e),Oe.current.pause())}}else Oe.current&&Oe.current.pause()},[be,we]);let ke=r===`v2`,Ae=(0,S.useMemo)(()=>ke?[{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}],[ke]),je=(0,S.useMemo)(()=>Ae.map((e,t)=>({...e,status:ge[t]?.status||``,id:ge[t]?.id||t,output:ge[t]?.output||``,input:ge[t]?.input||{},engineId:ge[t]?.input?.payload?.videoConfig?.engineId||``,errorMessage:ge[t]?.errorMessage||``})),[Ae,ge]),Me=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!je.some(e=>e.status))return;let e=[...je].reverse().find(e=>e.status===`processing`);if(e){ye([String(e.childId)]),Me.current=!1;return}if(Me.current){Me.current=!1;return}let t=[...je].reverse().find(e=>e.status===`completed`&&e.childId!==1);if(t){ye([String(t.childId)]);return}ye([])},[je]);let Ne=(e,t,n)=>{L5(e,t,n).then(e=>{e.items&&q(e.items),e.total!==void 0&&de(e.total)}).catch(e=>{})},Pe=(e,t)=>{se(e),le(t),Ne(e,t,fe)},Fe=()=>{Ne(1,20,fe)};(0,S.useEffect)(()=>{Ne(oe,ce,fe)},[]),(0,S.useEffect)(()=>{T5().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];ie({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&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{Z.error(e?.message||`加载任务详情失败`)})},[t,r]),(0,S.useEffect)(()=>{let e=me?.status===`processing`||ge.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(Be,3e4):!e&&C.current&&(clearInterval(C.current),C.current=null)},[me?.status,ge,t,r]),(0,S.useEffect)(()=>{O5().then(e=>{l(e)}).catch(()=>{})},[]);let Ie=()=>{let e={};e=c.find(e=>e.modelConfigId===I&&e.genType===`video`&&e.resolution===te),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=me?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=ke?+!!me?.material?.materialImageUrl:me?.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)))},Le=()=>{let e=je[1]?.input?.payload?.videoConfig||je[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=me?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=ke?+!!me?.material?.materialImageUrl:me?.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&&Ie()},[c,I,W,te,me]);let Re=(e,t,n,r)=>{_(t||`image`),T(n?String(n):``),t===`video`?(x(r||null),y(e&&typeof e==`object`?Ile(e):{}),p(``)):(x(null),p(e||``),y({})),s(!0)},ze=async()=>{if(g===`image`){if(!me?.id||!w){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!f||!f.trim()){Z.warning(`图片提示词不能为空`);return}D(!0);try{await Toe(me.id,w,{prompt:f.trim()}),Z.success(`图片提示词已保存`),Ve(),s(!1),T(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{D(!1)}return}if(!me?.id||!w){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!v||typeof v!=`object`||Object.keys(v).length===0){Z.warning(`视频提示词不能为空`);return}if(!b){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=d9(v,b);if(e){Z.warning(e);return}D(!0);try{await(ke?Soe:Eoe)(me.id,w,{prompt_schema:v}),Z.success(`视频提示词已保存`),Ve(),s(!1),T(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{D(!1)}},Be=()=>{t&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Ve=()=>{t&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{Z.error(e?.message||`刷新任务详情失败`)})},He=(e,t,n=!1)=>{Ce(e),Te(t),De(n),xe(!0)},Ue=()=>{xe(!1),Ce(``),Oe.current&&Oe.current.pause()},We=e=>{if(e.preventDefault(),e.stopPropagation(),!Se)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${Se}&download=1`,t.download=we===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Ge=e=>{woe(me.id,e.toString()).then(e=>{Z.info(`正在生成图片提示词,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ke=e=>{let t={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(me.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},qe=()=>{let e={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(me.id,je[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Je=e=>{let t={engine_id:I,duration:W,aspect_ratio:K,resolution:te,target_platform:`抖音`};Doe(me.id,e.toString(),t).then(e=>{Z.info(`正在生成视频提示词,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Xe=async(e,t)=>{try{ke?await Coe(me.id,String(e)):await Ooe(me.id,String(e),{engine_id:t||``}),Z.info(`正在生成视频,请稍候...`),Ve()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)}},Ze=async()=>{let e=ke?je[1]:je[3];e?.id&&await Xe(e.id,e.engineId||``)},Qe=async e=>{if(!(!ke||!me?.id||!e||!I)){N(!0);try{await xoe(me.id,e,{video_config:{engine_id:I,duration:W,aspect_ratio:K,resolution:te}}),Z.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Ve()}catch(e){Z.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)(X,{icon:(0,$.jsx)(q0,{}),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)(X,{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:me?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>me?.material?.materialVideoUrl&&He(me.material.materialVideoUrl,`video`),children:me?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:K9(me.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:me?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>me?.material?.materialImageUrl&&He(me.material.materialImageUrl,`image`),children:me?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:K9(me.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:`暂无图片`})})]})]}),me?.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:()=>He(me.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),me?.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:()=>He(me.finalVideoUrl,`video`,!0),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.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)(o_,{activeKey:ve,onChange:ye,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:je.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)(B2,{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)(G9,{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:me?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:K9(me.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)(G9,{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:me?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:K9(me.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:je[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:je[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:je[0]?.input?.payload?.coreContentPoint||`-`})]})]}),!ke&&(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)Re(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)(X,{onClick:()=>{Me.current=!0,ye(t=>t.filter(t=>t!==String(e.childId))),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:[me.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.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)(X,{type:`default`,icon:(0,$.jsx)(i$,{}),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:`重新生成`})]}),(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)(l8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(G9,{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)(G9,{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),ie({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(te)||ne(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:()=>{let e=je[1]?.input?.payload?.videoConfig||je[1]?.input?.payload?.video_config;if(e){let t=e?.engineId||e?.engine_id,n=P.video?.find(e=>String(e.id)===String(t));n&&(L(n.id),ie({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]})),ee(e?.aspectRatio||e?.aspect_ratio||`16:9`),ne(e?.resolution||`480p`),G(e?.duration||5)}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)(P3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(G9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[K,` · `,W,`s · `,te]})]}),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)(G9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:re.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)(G9,{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(...re.durations))/(Math.max(...re.durations)-Math.min(...re.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...re.durations),max:Math.max(...re.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)(G9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:re.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ne(e),style:{flex:1,height:42,borderRadius:6,border:te===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:te===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:te===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)t.filter(t=>t!==String(e.childId))),Je(e.id)},disabled:e.status!==`completed`||(i?.credits||0){let e=je[1]?.input?.payload?.videoConfig||je[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)(wV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(i$,{}),onClick:()=>Re(me?.videoGeneration?.promptSchema,`video`,e.id,me?.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`||!me?.videoGeneration?.promptSchema||!me?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),ke&&(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)String(t.id)===String(e));n&&(L(n.id),ie({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]})),ee(t?.aspectRatio||t?.aspect_ratio||`16:9`),ne(t?.resolution||`480p`),G(t?.duration||5)}j(String(e.id)),k(!0)},style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},disabled:e.status===`processing`||je[2]?.status===`processing`||(i?.credits||0){let t=Le();if((i?.credits||0)t.filter(t=>t!==String(e.childId))),Xe(e.id,e.engineId)},type:`primary`,style:{flex:`1 0 auto`,minWidth:140,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`||(i?.credits||0){let e=Le();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${me?.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)(jG,{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)(zC,{value:I,onChange:e=>{let t=P.video?.find(t=>t.id===e);t&&(L(t.id),ie({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(te)||ne(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:re.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(...re.durations))/(Math.max(...re.durations)-Math.min(...re.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...re.durations),max:Math.max(...re.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:re.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ne(e),style:{flex:1,height:42,borderRadius:8,border:te===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:te===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:te===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(X,{onClick:()=>k(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(X,{onClick:()=>{if(!I){Z.warning(`请选择视频引擎`);return}Qe(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)(jG,{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)(X,{onClick:()=>s(!1),disabled:E,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:ze,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)(Fle,{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)(v9,{value:v,schemaConfigSnapshot:b,onChange:y})})}),(0,$.jsxs)(jG,{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)($U,{placeholder:`搜索产品名称`,value:fe,onChange:e=>pe(e.target.value),onPressEnter:Fe,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(X,{type:`primary`,onClick:Fe,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)(lQ,{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)(X,{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:ae,rowKey:`id`,pagination:{current:oe,pageSize:ce,total:ue,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Pe,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)(jG,{open:be,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:Ue,width:800,footer:Ee?(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)(X,{type:`primary`,icon:(0,$.jsx)(B1,{}),onClick:We,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}):null,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:we===`image`?(0,$.jsx)(`img`,{src:Se.startsWith(`http`)?Se:`https://ceshi.apiforeign.minzhongzc.com${Se}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Oe,src:Se.startsWith(`http`)?Se:`https://ceshi.apiforeign.minzhongzc.com${Se}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var Rle=({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 zle(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 Ble=()=>{let e=Ye(),[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)(()=>{Koe().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),G5(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{Voe(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)(kV,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)($6,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(kV,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(o8,{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)(X0,{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)(X0,{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)(sL,{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)(z8,{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:zle(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(sL,{activeKey:l,onChange:e=>{u(e),G5(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)(Rle,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(jG,{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)(z8,{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)(T6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(n2,{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)(X,{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:Vle}=MB,q9={borderRadius:8,fontWeight:600},J9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Hle=()=>{let e=Ye(),[t]=On(),{message:n}=ex.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,VE.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 Loe({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 U5()).data||[]).map(e=>({name:J9(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=()=>{jG.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(MB,{value:(0,VE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,VE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)($U,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await Roe({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)(X,{type:`text`,icon:(0,$.jsx)(q0,{}),onClick:F}),(0,$.jsx)(T4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.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)($U,{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)(Vle,{value:E?[(0,VE.default)(E[0]),(0,VE.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)(X,{type:`primary`,onClick:I,style:{...q9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(Wie,{}),onClick:L,loading:l,style:q9,children:`拉取消耗`}),(0,$.jsx)(X,{icon:(0,$.jsx)(l8,{}),onClick:()=>f(!0),style:{...q9,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)(lQ,{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)(zW,{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)(jG,{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)($U,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(Q.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)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(aR,{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)(aR,{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)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(X,{size:`small`,onClick:async()=>{try{let e=((await U5()).data||[]).map(e=>({name:J9(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)(Q.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)(Q.Text,{children:n?.description||e}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Ule=()=>{let e=Ye(),[t]=On(),{message:n}=ex.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 doe(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)(Q.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(Q.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)(oG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(TB,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(VK,{}),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)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(VK,{}),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)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(TB,{style:{color:`#6366f1`}}),(0,$.jsxs)(Q.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},Wle=()=>(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)(p2,{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)(xie,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(Q.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)(j8,{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)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.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)(U3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(X0,{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)(jU,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(L3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(s4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),Gle=()=>{let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(`image`),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`all`),u=(e,n)=>{r(e),a(n),t(!0)},d=(e,t)=>{let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},f=[{value:`all`,label:`全部行业`},{value:`fashion`,label:`时尚穿搭`},{value:`food`,label:`美食探店`},{value:`travel`,label:`旅行风景`},{value:`tech`,label:`数码科技`},{value:`beauty`,label:`美妆护肤`},{value:`home`,label:`家居生活`},{value:`母婴`,label:`母婴亲子`}],p=[{id:1,type:`image`,url:`https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?w=400&q=80`,title:`时尚街拍`,tag:`热门`,industry:`fashion`,aspectRatio:1.3},{id:2,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?w=400&q=80`,title:`自然风景`,tag:`推荐`,industry:`travel`,aspectRatio:1.5},{id:3,type:`image`,url:`https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=400&q=80`,title:`湖光山色`,tag:`热门`,industry:`travel`,aspectRatio:.75},{id:4,type:`image`,url:`https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&q=80`,title:`山脉风光`,tag:`新品`,industry:`travel`,aspectRatio:1.4},{id:5,type:`video`,url:`https://www.w3schools.com/html/movie.mp4`,poster:`https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=400&q=80`,title:`森林探索`,tag:`推荐`,industry:`travel`,aspectRatio:.67},{id:6,type:`image`,url:`https://images.unsplash.com/photo-1470770841072-f978cf4d019e?w=400&q=80`,title:`山间湖泊`,tag:`热门`,industry:`travel`,aspectRatio:1.7},{id:7,type:`image`,url:`https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=400&q=80`,title:`海岸风光`,tag:`推荐`,industry:`travel`,aspectRatio:.8},{id:8,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=400&q=80`,title:`城市夜景`,tag:`新品`,industry:`travel`,aspectRatio:1.33},{id:9,type:`image`,url:`https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=400&q=80`,title:`森林小径`,tag:`热门`,industry:`travel`,aspectRatio:1.5},{id:10,type:`image`,url:`https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=400&q=80`,title:`美食摆盘`,tag:`热门`,industry:`food`,aspectRatio:1.2},{id:11,type:`image`,url:`https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?w=400&q=80`,title:`时尚穿搭`,tag:`推荐`,industry:`fashion`,aspectRatio:1},{id:12,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=400&q=80`,title:`数码产品`,tag:`新品`,industry:`tech`,aspectRatio:1.4}],m=(0,S.useMemo)(()=>p.filter(e=>{let t=o?e.title.toLowerCase().includes(o.toLowerCase()):!0,n=c===`all`?!0:e.industry===c;return t&&n}),[o,c]),h=e=>{u((e.type,e.url),e.type)};return(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)(i3,{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)(g4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(Q.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,$.jsxs)(`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)(x8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(zC,{value:c,onChange:e=>l(e),style:{width:140},options:f}),(0,$.jsx)($U.Search,{placeholder:`搜索行业案例`,allowClear:!0,enterButton:(0,$.jsx)(PC,{}),size:`middle`,value:o,onChange:e=>s(e.target.value),onSearch:e=>s(e),style:{width:240}})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16,color:`#64748b`,fontSize:13},children:[`共找到 `,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:m.length}),` 个案例`]}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{columnCount:5,columnGap:12,marginBottom:16},children:m.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{breakInside:`avoid`,marginBottom:12,borderRadius:10,overflow:`hidden`,cursor:`pointer`,position:`relative`,boxShadow:`0 4px 12px rgba(0, 0, 0, 0.08)`,transition:`transform 0.3s ease, box-shadow 0.3s ease`,animation:`fadeInUp 0.5s ease ${t*.1}s both`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-4px)`,e.currentTarget.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 12px rgba(0, 0, 0, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,paddingBottom:`${1/e.aspectRatio*100}%`,backgroundColor:`#f3f4f6`},children:[e.type===`image`?(0,$.jsx)(`img`,{src:e.url,alt:e.title,style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:e.poster,alt:e.title,style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:48,height:48,borderRadius:`50%`,background:`rgba(0, 0, 0, 0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(K6,{style:{fontSize:32,color:`#fff`}})})]}),(0,$.jsxs)(`div`,{style:{position:`absolute`,top:12,left:12,padding:`4px 8px`,borderRadius:6,background:`rgba(0, 0, 0, 0.6)`,backdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,gap:4},children:[e.type===`image`?(0,$.jsx)(L6,{style:{fontSize:12,color:`#fff`}}):(0,$.jsx)(z8,{style:{fontSize:12,color:`#fff`}}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#fff`,fontWeight:500},children:e.type===`image`?`图片`:`视频`})]})]}),(0,$.jsx)(`div`,{style:{padding:12,background:`#fff`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#1f2937`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,marginRight:8},children:e.title}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#fff`,padding:`2px 8px`,borderRadius:4,background:e.tag===`热门`?`#ef4444`:e.tag===`推荐`?`#6366f1`:`#f59e0b`,whiteSpace:`nowrap`},children:e.tag})]})})]},e.id))}),m.length===0&&(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 20px`,color:`#94a3b8`},children:[(0,$.jsx)(PC,{style:{fontSize:48,marginBottom:16,opacity:.5}}),(0,$.jsx)(`div`,{style:{fontSize:15},children:`暂无符合条件的案例`}),(0,$.jsx)(`div`,{style:{fontSize:13,marginTop:8},children:`请尝试调整搜索关键词或行业筛选`}),(0,$.jsx)(X,{style:{marginTop:16,borderRadius:8},onClick:()=>{s(``),l(`all`)},children:`重置筛选`})]})]}),(0,$.jsx)(jG,{open:e,onCancel:()=>t(!1),footer:[(0,$.jsx)(X,{icon:(0,$.jsx)(B1,{}),onClick:()=>d(n,i===`image`?`image.jpg`:`video.mp4`),type:`primary`,style:{borderRadius:8},children:`下载`},`download`)],width:800,centered:!0,styles:{body:{padding:0}},children:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:400,borderRadius:8,overflow:`hidden`},children:i===`image`?(0,$.jsx)(`img`,{src:n,alt:`预览`,style:{maxWidth:`100%`,maxHeight:`60vh`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:n,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:`60vh`,objectFit:`contain`}})})})]})},{RangePicker:Kle}=MB;function Y9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var qle={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},Jle=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await sse())}catch(e){Z.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 cse(d);o(e.items||[]),c(e.total||0)}catch(e){Z.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=vH.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){Z.error(`请输入有效的正数积分数量`);return}v(!0),await lse(m.member.id,t,e.direction||`increase`,e.description),Z.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),he()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=vH.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await use()||[])}catch(e){Z.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await dse(e.maxUses||null,null),Z.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await fse(e),Z.success(`已撤销`),A()}catch(e){Z.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Z.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`),Z.success(`邀请链接已复制`)}catch{Z.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 pse(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,jG.confirm({title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(g2,{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&&Z.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Z.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 mse(e,t,n),Z.success(t===`approve`?`已通过`:`已拒绝`),G(z),p()}catch(e){Z.error(e?.message||`操作失败`)}},[ee,te]=(0,S.useState)([]),[ne,re]=(0,S.useState)(0),[ie,ae]=(0,S.useState)(null),[q,oe]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(``),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)(()=>{let e=(0,VE.default)().format(`YYYY-MM-DD`);return[e,e]}),he=(0,S.useCallback)(async()=>{oe(!0);try{let e=await vse({page:se,pageSize:10,phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0});te(e.items||[]),re(e.total||0),ae(e.summary||null)}catch(e){Z.error(e?.message||`加载积分记录失败`)}finally{oe(!1)}},[se,le,de,pe]);(0,S.useEffect)(()=>{he()},[he]);let ge=()=>{ue(``),fe(``);let e=(0,VE.default)().format(`YYYY-MM-DD`);me([e,e]),ce(1)},_e=()=>{let e=yse({phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[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,VE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Z.error(`导出失败`))},ve=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(Q.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(SQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>Y9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=e7.getState().user?.id;return t.id===n?(0,$.jsx)(kw,{title:`不能给自己调整积分`,children:(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ye=e=>`${window.location.origin}/join-team?code=${e}`,be=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(Q.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ye(e);return(0,$.jsxs)(wV,{style:{width:`100%`},children:[(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(kw,{title:`复制链接`,children:(0,$.jsx)(X,{size:`small`,type:`text`,icon:(0,$.jsx)(D$,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(SQ,{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?Y9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(X,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],xe=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(SQ,{color:t.color,children:t.text})},Se=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>xe(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>Y9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?Y9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(wV,{size:4,children:[(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(OC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>K(t.id,`approve`),children:`通过`}),(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(ju,{}),danger:!0,style:{padding:0},onClick:()=>{jG.confirm({title:`拒绝申请`,content:(0,$.jsx)(vH,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(vH.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)($U.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:`已处理`})}],Ce=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=qle[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(SQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(Q.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=>Y9(e)}],we={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},Te={padding:`16px`,textAlign:`right`},Ee=[{key:`members`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(L8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(lQ,{columns:ve,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(lC,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(zW,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(V8,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(zC,{value:le||void 0,onChange:e=>{ue(e||``),ce(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)($U,{placeholder:`搜索手机号`,value:de,onChange:e=>{fe(e.target.value),ce(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(Kle,{value:pe?[(0,VE.default)(pe[0]),(0,VE.default)(pe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?me([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):me(null),ce(1)}}),(0,$.jsx)(X,{onClick:ge,children:`重置`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(B1,{}),onClick:_e,children:`导出 Excel`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:12,padding:`12px 18px`,background:`#f8f9fc`,borderRadius:10,display:`flex`,gap:28,flexWrap:`wrap`,fontSize:13,alignItems:`center`},children:[(0,$.jsxs)(`span`,{children:[`总净消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:16,marginLeft:4},children:ie?.netConsume??0})]}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`|`}),(0,$.jsxs)(`span`,{children:[`消费合计:`,(0,$.jsx)(`strong`,{style:{color:`#f97316`,marginLeft:4},children:ie?.totalConsume??0})]}),(0,$.jsxs)(`span`,{children:[`退款合计:`,(0,$.jsxs)(`strong`,{style:{color:`#10b981`,marginLeft:4},children:[`− `,ie?.totalRefund??0]})]}),(0,$.jsxs)(`span`,{children:[`充值合计:`,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`,marginLeft:4},children:[`+ `,ie?.totalRecharge??0]})]})]}),(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(lQ,{rowKey:`id`,loading:q,dataSource:ee,pagination:!1,bordered:!1,scroll:{x:950},columns:Ce,locale:{emptyText:(0,$.jsx)(lC,{description:`暂无积分记录`})}}),ne>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(zW,{current:se,pageSize:10,total:ne,onChange:e=>ce(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(D$,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(lQ,{columns:be,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(lC,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(g3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(SQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(TR,{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:we,children:(0,$.jsx)(lQ,{columns:Se,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(lC,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(Q.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)(Q.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(Q.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(X,{icon:(0,$.jsx)(VK,{}),onClick:()=>{i(),p(),A(),G(z),he()},children:`刷新`})]}):(0,$.jsx)(Q.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(sL,{items:Ee,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(L8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(vH,{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)(Q.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:e7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(vH.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(LF.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(LF.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(LF.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(vH.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)(fz,{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)(vH.Item,{name:`description`,label:`备注`,children:(0,$.jsx)($U.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(D$,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(vH,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(vH.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(fz,{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)(TB,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},Yle=()=>{let[e]=On(),t=Ye(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=e7(),[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(),h5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?hse(n):gse(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)(oG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`success`,icon:(0,$.jsx)(B2,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{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)(D8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(lL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(T8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(Q.Title,{level:3,children:`加入团队`}),(0,$.jsx)(Q.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(Q.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(wV,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)(K3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(X,{size:`large`,block:!0,icon:(0,$.jsx)(iae,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(T8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await _se(n),p(!0),h(!1),Z.success(`申请已提交`)}catch(e){Z.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:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},Xle=new Set([`group_active`,`callback_success`]),Zle=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=Xle.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(lL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(dq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(X,{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{Z.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Z.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})},Qle=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u]=vH.useForm(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(new Map),[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)(!1),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(0),[A,j]=(0,S.useState)(1),[M]=(0,S.useState)(10),[N,P]=(0,S.useState)([null,null]),[F,I]=(0,S.useState)([null,null]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(!1),[V,H]=(0,S.useState)(!1),[U,W]=(0,S.useState)(null),G=async(e=A)=>{T(!0);try{let t=await S5(e,M,{invoiceMode:!0,startDate:N[0]||void 0,endDate:N[1]||void 0});D((t.items||[]).map(e=>({...e,_occupied:!!e.is_occupied,_occupiedBy:e.occupied_by}))),k(t.total||0)}catch{D([]),k(0)}T(!1)},[K,ee]=(0,S.useState)(1),[te]=(0,S.useState)(10),[ne,re]=(0,S.useState)(0),ie=async()=>{r(!0);try{let e=await Yae({page:K,pageSize:te});t((e.items||[]).map(e=>({id:e.id,orderNo:e.invoiceNo,orderType:e.headerType===`company`?`企业`:`个人`,amount:e.totalAmount,createdAt:e.createdAt,status:e.status===`success`?`issued`:e.status===`failed`?`rejected`:`processing`,headerName:e.headerName,headerType:e.headerType,headerTaxNo:e.headerTaxNo,selectedOrders:e.orders||[],email:e.email,failureReason:e.failureReason}))),re(e.total||0)}catch{}r(!1)};(0,S.useEffect)(()=>{ie(),ce()},[]),(0,S.useEffect)(()=>{K>1&&ie()},[K]),(0,S.useEffect)(()=>{d&&(j(1),G(1))},[d]);let ae=[{title:`发票编号`,dataIndex:`orderNo`,key:`orderNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:e})},{title:`发票类型`,dataIndex:`orderType`,key:`orderType`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:`#374151`},children:e})},{title:`总金额`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,e.toFixed(2)]})},{title:`开具时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>e?(0,$.jsx)(`span`,{style:{color:`#64748b`},children:new Date(e).toLocaleString(`zh-CN`)}):`-`},{title:`发票状态`,dataIndex:`status`,key:`status`,width:120,render:e=>{let t={pending:{color:`#f59e0b`,label:`待开具`,bg:`rgba(245,158,11,0.1)`},processing:{color:`#0ea5e9`,label:`开具中`,bg:`rgba(14,165,233,0.1)`},issued:{color:`#10b981`,label:`已开具`,bg:`rgba(16,185,129,0.1)`},rejected:{color:`#ef4444`,label:`已驳回`,bg:`rgba(239,68,68,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(SQ,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`操作`,key:`action`,width:120,render:(e,t)=>(0,$.jsx)(X,{type:`link`,size:`small`,onClick:()=>{W(t),H(!0)},children:`详情`})}],q=[{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)(F0,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(W8,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,typeof n==`number`?n.toFixed(2):n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(Q.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:120,render:(e,t)=>{if(t._occupied)return(0,$.jsx)(SQ,{color:`orange`,style:{fontWeight:500,padding:`4px 12px`},title:t._occupiedBy?`发票号:${t._occupiedBy}`:void 0,children:`已申请开票`});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)(SQ,{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`):`-`}}],oe=[{title:`发票抬头`,dataIndex:`name`,key:`name`,render:e=>(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:e})},{title:`发票抬头类型`,dataIndex:`type`,key:`type`,width:140,render:e=>(0,$.jsx)(`span`,{style:{color:`#475569`},children:e===`company`?`企业`:`个人`})},{title:`纳税号`,dataIndex:`taxNo`,key:`taxNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{color:`#64748b`},children:e||`-`})},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>e?(0,$.jsx)(SQ,{color:`#f59e0b`,style:{background:`rgba(245,158,11,0.1)`,color:`#d97706`},children:`默认`}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`-`})},{title:`操作`,key:`action`,width:120,render:(e,t)=>(0,$.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[!t.isDefault&&(0,$.jsx)(X,{type:`link`,size:`small`,onClick:()=>de(t.id),children:`设为默认`}),(0,$.jsx)(X,{type:`link`,size:`small`,danger:!0,onClick:()=>ue(t.id),children:`删除`})]})}],se=i,ce=async()=>{try{a(((await Xae()).items||[]).map(e=>({id:e.id,name:e.name,type:e.type,taxNo:e.taxNo,registerAddress:e.registerAddress,bankName:e.bankName,registerPhone:e.registerPhone,bankAccount:e.bankAccount,email:e.email,isDefault:e.isDefault})))}catch{}},le=async()=>{try{let e=await u.validateFields(),t=e.type===`company`,n=e.isDefault===`yes`||i.length===0&&!i.some(e=>e.isDefault);await Zae({type:e.type,name:e.name,taxNo:t?e.taxNo:void 0,registerAddress:t?e.registerAddress:void 0,bankName:t?e.bankName:void 0,registerPhone:t?e.registerPhone:void 0,bankAccount:t?e.bankAccount:void 0,email:e.email,isDefault:n}),u.resetFields(),l(!1),Z.success(`发票抬头添加成功`),ce()}catch(e){if(e?.errorFields)Z.warning(`请完善表单信息`);else{let t=e?.message||e?.response?.data?.detail||`添加失败`;Z.error(t)}}},ue=e=>{jG.confirm({title:`删除发票抬头`,content:`确定要删除该发票抬头吗?`,okText:`确定`,cancelText:`取消`,onOk:async()=>{try{await Qae(e),Z.success(`删除成功`),ce()}catch(e){Z.error(e?.message||`删除失败`)}}})},de=async e=>{try{await $ae(e),Z.success(`已设为默认`),ce()}catch(e){Z.error(e?.message||`设置失败`)}},fe=()=>{if(p.size===0){Z.warning(`请至少选择一个订单`);return}f(!1);let e=se.find(e=>e.isDefault);v(e?.id||se[0]?.id||null),b(e?.email||se[0]?.email||``),g(!0)},pe=async()=>{if(!_){Z.warning(`请选择一个发票抬头`);return}let e=se.find(e=>e.id===_),t=(e?.email||``).trim();if(!t){Z.warning(`该发票抬头未填写邮箱,请先在抬头管理中设置邮箱`);return}let n=Array.from(p.values()).map(e=>e.id||e.orderNo||e.order_no).filter(Boolean);if(n.length===0){Z.warning(`请至少选择一个订单`);return}C(!0);try{await Jae({headerType:e?.type,headerName:e?.name||``,headerTaxNo:e?.taxNo,headerRegisterAddress:e?.registerAddress,headerRegisterPhone:e?.registerPhone,headerBankName:e?.bankName,headerBankAccount:e?.bankAccount,email:t,orderIds:n}),Z.success(`开票申请已提交,请等待审核`),g(!1),m(new Map),v(null),b(``),ie()}catch(e){let t=e?.message||e?.response?.data?.detail||`提交失败,请稍后重试`;Z.error(t)}C(!1)},me={selectedRowKeys:Array.from(p.keys()),onChange:(e,t)=>{let n=new Map(p);E.map(e=>e.order_no||e.orderNo||e.id).forEach(e=>n.delete(e)),e.forEach(e=>{let r=t.find(t=>(t.order_no||t.orderNo||t.id)===e);r&&!r._occupied&&n.set(e,r)}),m(n)},preserveSelectedRowKeys:!0,getCheckboxProps:e=>({name:e.order_no||e.orderNo||e.id,disabled:!!e._occupied})},he=Array.from(p.values()).reduce((e,t)=>e+(t.amount||t.total_amount||0),0),ge=p.size;return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,borderRadius:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(kV,{style:{color:`#6366f1`,fontSize:20}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#1e293b`},children:`申请开票`})]}),(0,$.jsxs)(wV,{children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>f(!0),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:10,fontWeight:500},children:`开票`}),(0,$.jsx)(X,{icon:(0,$.jsx)(jI,{}),onClick:()=>s(!0),style:{borderColor:`#e2e8f0`,borderRadius:10,fontWeight:500},children:`管理发票抬头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#f8fafc`,borderRadius:12,padding:`16px 20px`,marginBottom:24,border:`1px solid #f1f5f9`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#475569`,display:`block`,marginBottom:8},children:`特别说明:`}),(0,$.jsxs)(`div`,{style:{color:`#64748b`,fontSize:13,lineHeight:2},children:[(0,$.jsxs)(`div`,{children:[`◎ 为落实中办、国办印发的《关于进一步深化税收征管改革的意见》要求,继续加大全面数字化的电子发票(以下简称数电发票)推广使用力度,我们将提供数电发票开具。详细情况可阅读`,(0,$.jsx)(`a`,{onClick:e=>{e.preventDefault(),B(!0)},style:{color:`#6366f1`,cursor:`pointer`},children:`《全面数字化电子发票说明》`}),`。`]}),(0,$.jsx)(`div`,{children:`◎ 下单1小时后方可申请开票!`}),(0,$.jsxs)(`div`,{children:[`◎ 为提高开票效率,请仔细阅读`,(0,$.jsx)(`a`,{onClick:e=>{e.preventDefault(),R(!0)},style:{color:`#6366f1`,cursor:`pointer`},children:`《开票须知》`}),`。`]})]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:n?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:60},children:`加载中...`}):e.length===0?(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无申请开票记录`}),style:{padding:`60px 0`}}):(0,$.jsx)(lQ,{dataSource:e,columns:ae,rowKey:`id`,pagination:{current:K,pageSize:te,total:ne,onChange:e=>{ee(e)}},bordered:!1})}),(0,$.jsx)(jG,{title:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`发票详情`}),open:V,onCancel:()=>{H(!1),W(null)},width:720,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>{H(!1),W(null)},children:`关闭`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:U&&(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:`发票信息`}),(0,$.jsx)(`div`,{style:{background:`#f8fafc`,borderRadius:10,padding:`16px 20px`},children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr 100px 1fr`,gap:`12px 16px`,fontSize:13},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票编号:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontFamily:`monospace`},children:U.orderNo}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`开票时间:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.createTime}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票金额:`}),(0,$.jsxs)(`span`,{style:{color:`#ef4444`,fontWeight:600},children:[`¥`,U.amount.toFixed(2)]}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票状态:`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(SQ,{color:U.status===`pending`?`#f59e0b`:U.status===`processing`?`#0ea5e9`:U.status===`issued`?`#10b981`:`#ef4444`,style:{background:U.status===`pending`?`rgba(245,158,11,0.1)`:U.status===`processing`?`rgba(14,165,233,0.1)`:U.status===`issued`?`rgba(16,185,129,0.1)`:`rgba(239,68,68,0.1)`,color:U.status===`pending`?`#d97706`:U.status===`processing`?`#0284c7`:U.status===`issued`?`#059669`:`#dc2626`,fontWeight:500,padding:`4px 12px`},children:U.status===`pending`?`待开具`:U.status===`processing`?`开具中`:U.status===`issued`?`已开具`:`已驳回`})}),U.email&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`接收邮箱:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.email})]}),U.failureReason&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`失败原因:`}),(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:U.failureReason})]})]})})]}),U.headerName&&(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:`发票抬头`}),(0,$.jsx)(`div`,{style:{background:`#f8fafc`,borderRadius:10,padding:`16px 20px`},children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr`,gap:`12px 16px`,fontSize:13},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`抬头类型:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.headerType===`company`?`企业`:`个人`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`抬头名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.headerName}),U.headerTaxNo&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`纳税人识别号:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontFamily:`monospace`},children:U.headerTaxNo})]})]})})]}),U.selectedOrders&&U.selectedOrders.length>0&&(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:[`订单明细(共 `,U.selectedOrders.length,` 笔)`]}),(0,$.jsx)(lQ,{dataSource:U.selectedOrders,columns:[{title:`订单号`,key:`orderNo`,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:12,color:`#64748b`},children:t.order_no||t.orderNo||t.orderNo||t.id})},{title:`金额`,key:`amount`,align:`right`,render:(e,t)=>(0,$.jsxs)(`span`,{style:{fontWeight:600,color:`#1e293b`},children:[`¥`,(t.amount||t.total_amount||0).toFixed(2)]})}],rowKey:e=>e.order_no||e.orderNo||e.id,pagination:!1,bordered:!1,size:`small`})]})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,paddingRight:30},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`选择订单`}),(0,$.jsxs)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:[`已选 `,ge,` 项,合计 ¥`,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:he.toFixed(2)})]})]}),open:d,onCancel:()=>{f(!1),m(new Map)},width:`70%`,footer:[(0,$.jsx)(X,{onClick:()=>{f(!1),m(new Map)},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:fe,children:`确定`},`confirm`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`0 24px 24px`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`12px 0`,borderBottom:`1px solid #f1f5f9`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`支付时间:`}),(0,$.jsx)(MB.RangePicker,{size:`small`,value:F,onChange:e=>{I(e),e&&e[0]&&e[1]?P([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):P([null,null]),j(1),setTimeout(()=>G(1),0)},allowClear:!0,placeholder:[`开始日期`,`结束日期`],style:{width:280}})]}),(0,$.jsx)(oG,{spinning:w,children:E.length===0?(0,$.jsx)(lC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无符合条件的订单`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(lQ,{dataSource:E,columns:q,scroll:{y:500},rowKey:e=>e.order_no||e.orderNo||e.id,rowSelection:me,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(zW,{current:A,pageSize:M,total:O,onChange:e=>{j(e),G(e)},size:`small`})})]})})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,paddingRight:30},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`选择发票抬头`}),(0,$.jsxs)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:[`开票金额:¥`,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:he.toFixed(2)})]})]}),open:h,onCancel:()=>{g(!1),v(null),m(new Map),b(``)},width:820,footer:[(0,$.jsx)(X,{onClick:()=>{g(!1),v(null),m(new Map),b(``)},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,loading:x,onClick:pe,children:`确定`},`confirm`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`0 24px 24px`},children:(0,$.jsx)(lQ,{dataSource:se,columns:[{title:`选择`,key:`select`,width:60,render:(e,t)=>(0,$.jsx)(LF,{checked:_===t.id,onChange:()=>{v(t.id),t.email&&!y&&b(t.email)}})},{title:`发票抬头`,dataIndex:`name`,key:`name`,render:e=>(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:e})},{title:`抬头类型`,dataIndex:`type`,key:`type`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:`#475569`},children:e===`company`?`企业`:`个人`})},{title:`纳税人识别号`,dataIndex:`taxNo`,key:`taxNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{color:`#64748b`},children:e||`-`})},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>e?(0,$.jsx)(SQ,{color:`#f59e0b`,style:{background:`rgba(245,158,11,0.1)`,color:`#d97706`},children:`默认`}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`-`})}],rowKey:`id`,pagination:!1,bordered:!1})})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{padding:`16px 20px`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`我的发票抬头`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>l(!0),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:8,fontWeight:500},children:`添加常用发票抬头`})]}),open:o,onCancel:()=>s(!1),width:900,footer:null,centered:!0,styles:{body:{}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`0 24px 24px`,height:`500px`,marginTop:8},children:i.length===0?(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无发票抬头,请点击「添加常用发票抬头」添加`}),style:{padding:`60px 0`}}):(0,$.jsx)(lQ,{dataSource:i,columns:oe,rowKey:`id`,pagination:!1,bordered:!1})})}),(0,$.jsx)(jG,{title:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`我的发票抬头`}),open:c,onCancel:()=>{l(!1),u.resetFields()},width:640,footer:null,centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`20px 24px 24px`},children:(0,$.jsxs)(vH,{form:u,layout:`horizontal`,initialValues:{type:`company`,isDefault:`no`},labelCol:{style:{width:90,textAlign:`right`,marginRight:12,whiteSpace:`nowrap`}},wrapperCol:{style:{flex:1}},children:[(0,$.jsx)(vH.Item,{name:`type`,label:`抬头类型:`,rules:[{required:!0,message:`请选择抬头类型`}],children:(0,$.jsxs)(LF.Group,{children:[(0,$.jsx)(LF,{value:`company`,children:`企业`}),(0,$.jsx)(LF,{value:`personal`,children:`个人`})]})}),(0,$.jsx)(vH.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:()=>{let e=u.getFieldValue(`type`)===`company`;return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`0 16px`},children:[(0,$.jsx)(vH.Item,{name:`name`,label:e?`公司名称:`:`个人姓名:`,rules:[{required:!0,message:e?`请输入公司名称`:`请输入个人姓名`}],children:(0,$.jsx)($U,{placeholder:e?`请输入公司名称`:`请输入个人姓名`})}),e&&(0,$.jsx)(vH.Item,{name:`taxNo`,label:`公司税号:`,rules:[{required:!0,message:`请输入公司税号`}],children:(0,$.jsx)($U,{placeholder:`请输入公司税号`})}),e&&(0,$.jsx)(vH.Item,{name:`registerAddress`,label:`注册地址:`,children:(0,$.jsx)($U,{placeholder:`请输入注册地址`})}),e&&(0,$.jsx)(vH.Item,{name:`bankName`,label:`开户银行:`,children:(0,$.jsx)($U,{placeholder:`请输入开户银行`})}),e&&(0,$.jsx)(vH.Item,{name:`registerPhone`,label:`注册电话:`,children:(0,$.jsx)($U,{placeholder:`请输入注册电话`})}),e&&(0,$.jsx)(vH.Item,{name:`bankAccount`,label:`银行账号:`,children:(0,$.jsx)($U,{placeholder:`请输入银行账号`})}),(0,$.jsx)(vH.Item,{name:`email`,label:`接收邮箱:`,rules:[{required:!0,message:`请输入接收邮箱`},{pattern:/^[\w.\-]+@[\w.\-]+\.\w+$/,message:`请输入正确的邮箱格式`}],children:(0,$.jsx)($U,{placeholder:`发票将发送至该邮箱`})})]})})}}),(0,$.jsx)(vH.Item,{name:`isDefault`,label:`设为默认:`,rules:[{required:!0,message:`请选择是否设为默认`}],children:(0,$.jsxs)(LF.Group,{children:[(0,$.jsx)(LF,{value:`yes`,children:`是`}),(0,$.jsx)(LF,{value:`no`,children:`否`})]})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:24,marginLeft:102},children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:le,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:10,paddingLeft:40,paddingRight:40,fontWeight:500},children:`提交`})})]})})}),(0,$.jsx)(jG,{title:null,open:L,onCancel:()=>R(!1),width:640,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>R(!1),children:`我知道了`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:18,color:`#1e293b`,display:`block`,marginBottom:20},children:`开票须知`}),(0,$.jsxs)(`div`,{style:{color:`#475569`,fontSize:14,lineHeight:2},children:[(0,$.jsx)(`p`,{style:{margin:0},children:`尊敬的用户您好!`}),(0,$.jsx)(`p`,{style:{margin:`4px 0 16px`},children:`感谢您的支持,请仔细阅读以下内容:`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`1. 平台开具的发票均为增值税发票;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`2. 为落实中办、国办印发的《关于进一步深化税收征管改革的意见》要求,云图网积极推广开具全面数字化电子发票(简称全电发票或数电发票);发票信息填写无误后,会于5个工作日内开具,并发送至您提交的交付邮箱;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`3. 开票金额与您实际支付金额一致;`}),(0,$.jsx)(`p`,{style:{margin:0},children:`4. 发票申请过程中有任何问题,可填写用户反馈沟通。`})]})]})}),(0,$.jsx)(jG,{title:null,open:z,onCancel:()=>B(!1),width:720,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>B(!1),children:`我知道了`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:18,color:`#1e293b`,display:`block`,marginBottom:20},children:`全面数字化电子发票说明`}),(0,$.jsxs)(`div`,{style:{color:`#475569`,fontSize:14,lineHeight:2},children:[(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`1. 什么是数电发票?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`是指全面数字化的电子发票,即发票信息全面数字化(依托可信身份体系和电子发票服务平台,以去介质、去版式、标签化、要素化、授信制、赋码制为基本特征,覆盖全领域、全环节、全要素的全新发票,与纸质发票具有同等法律效力)。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`2. 数电发票可以开什么票种?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`数电发票可以开增值税普通票及增值税专票(均是电子发票)。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`3. 数电发票与电子发票的不同`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.1 数电发票无联次;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.2 数电发票无发票代码,只有发票号码(20位);`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.3 数电发票仅显示纳税人识别号和纳税人名称;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.4 数电发票只有开票人,无收款人和复核人,无销售方(章)信息;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`3.5 新增了动态二维码。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`4. 数电发票怎么开,怎么交付?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`现有开具方式需要您选择电子发票填写信息申请,默认以PDF文件形式送至您提供的邮箱,如果您有特殊需求,可备注PDF格式及XML格式,如忘记备注可联系在线客服申请另选格式重复交付不受影响。`}),(0,$.jsx)(`p`,{style:{margin:0},children:`5. 请您认真核对信息无误后提交`})]})]})})]})},{TextArea:X9}=$U,Z9={video:{bg:`rgba(99,102,241,0.15)`,bgActive:`rgba(99,102,241,0.45)`,border:`rgba(99,102,241,0.25)`,borderActive:`rgba(99,102,241,0.5)`,icon:(0,$.jsx)(z8,{style:{color:`#6366f1`,fontSize:14}})},audio:{bg:`rgba(16,185,129,0.15)`,bgActive:`rgba(16,185,129,0.45)`,border:`rgba(16,185,129,0.25)`,borderActive:`rgba(16,185,129,0.5)`,icon:(0,$.jsx)(y8,{style:{color:`#10b981`,fontSize:14}})},image:{bg:`rgba(245,158,11,0.15)`,bgActive:`rgba(245,158,11,0.45)`,border:`rgba(245,158,11,0.25)`,borderActive:`rgba(245,158,11,0.5)`,icon:(0,$.jsx)(L6,{style:{color:`#f59e0b`,fontSize:14}})},text:{bg:`rgba(59,130,246,0.15)`,bgActive:`rgba(59,130,246,0.45)`,border:`rgba(59,130,246,0.25)`,borderActive:`rgba(59,130,246,0.5)`,icon:(0,$.jsx)(K4,{style:{color:`#3b82f6`,fontSize:14}})},watermark:{bg:`rgba(100,116,139,0.15)`,bgActive:`rgba(100,116,139,0.45)`,border:`rgba(100,116,139,0.25)`,borderActive:`rgba(100,116,139,0.5)`,icon:(0,$.jsx)(kV,{style:{color:`#64748b`,fontSize:14}})}},$le=()=>{let e=Ye(),[t,n]=(0,S.useState)(`video`),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(1),[h,g]=(0,S.useState)(80),[_,v]=(0,S.useState)(50),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(``),[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)(`text`),P=(0,S.useRef)(null),F=(0,S.useRef)(null),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),z=(0,S.useRef)(null),B=(0,S.useRef)(null),V=(0,S.useRef)(null),H=(0,S.useRef)(null),U=(0,S.useRef)(null),W=(0,S.useRef)(0),G=(0,S.useRef)(!1),K=(0,S.useRef)(null),ee=(0,S.useRef)(null),te=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},ne=e=>{switch(e){case`video`:return`video/*`;case`audio`:return`audio/*`;case`image`:return`image/*`;case`watermark`:return`image/*`;default:return``}},re=e=>{let n=e.target.files;if(!n||n.length===0)return;if(t===`text`){N(`text`),j(``),k(!0);return}let r=t===`watermark`?`watermark`:t,a=[];Array.from(n).forEach(e=>{let t=URL.createObjectURL(e);a.push({id:`${Date.now()}-${Math.random()}`,type:r,name:e.name,url:t})}),i(e=>[...e,...a]),Z.success(`已导入 ${a.length} 个${Ee.find(e=>e.key===t)?.label}素材`),R.current&&(R.current.value=``)},ie=e=>{N(e),j(``),k(!0)},ae=()=>{let e=A.trim();if(!e){Z.warning(`请输入内容`);return}let t={id:`${Date.now()}-${Math.random()}`,type:M,name:e.slice(0,20),text:e};i(e=>[...e,t]),k(!1),Z.success(M===`watermark`?`已添加水印`:`已添加文本`)},q=()=>{t===`text`?ie(`text`):t===`watermark`?ie(`watermark`):R.current?.click()},oe=e=>e.length>0?Math.max(...e.map(e=>e.start+e.duration)):0,se=e=>e.length>0?Math.max(...e.map(e=>e.start+e.duration)):0,ce=(0,S.useCallback)(()=>{if(!y){Z.warning(`请先选择要分割的片段`);return}let e=a.find(e=>e.id===y);if(!e)return;let t=s-e.start;if(t<=0||t>=e.duration){Z.warning(`播放头不在选中片段内`);return}let n={...e,duration:t,originalDuration:e.originalDuration,trimStart:e.trimStart},r={...e,id:`${Date.now()}-${Math.random()}`,start:e.start+t,duration:e.duration-t,trimStart:e.trimStart+t};o(t=>[...t.filter(t=>t.id!==e.id),n,r]),b(r.id),Z.success(`已分割片段`)},[y,a,s]),le=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>n.id===e?{...n,start:Math.max(0,t)}:n))},[]),ue=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>{if(n.id!==e)return n;let r=n.type===`video`||n.type===`audio`?n.originalDuration-.1:999,i=Math.max(0,Math.min(t,r)),a=i-n.trimStart;return{...n,trimStart:i,start:n.start+a,duration:Math.max(.1,n.duration-a)}}))},[]),de=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>{if(n.id!==e)return n;let r=n.type===`video`||n.type===`audio`?n.originalDuration-n.trimStart:999,i=Math.max(.1,Math.min(t,r));return{...n,duration:i}}))},[]),fe=(0,S.useCallback)((e,t,n)=>{o(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))},[]),pe=(0,S.useCallback)(e=>{let t=e=>e===`image`?{x:50,y:50,width:25,height:20,opacity:1,zIndex:4}:e===`text`?{x:50,y:85,width:60,height:10,opacity:1,zIndex:5}:e===`watermark`?{x:85,y:85,width:15,height:8,opacity:.4,zIndex:6}:e===`video`?{zIndex:2}:e===`audio`?{zIndex:1}:{zIndex:0},n=n=>({id:`${Date.now()}-${Math.random()}`,mediaId:e.id,type:e.type,start:0,duration:n,originalDuration:n,trimStart:0,url:e.url,name:e.text||e.name,text:e.text,...t(e.type)});if(e.type===`video`){let t=document.createElement(`video`);t.src=e.url,t.onloadedmetadata=()=>{let r=t.duration||5;o(e=>{let t=n(r);t.start=oe(e);let i=[...e,t];return u(se(i)),i}),Z.success(`已添加视频:${e.name}`)}}else if(e.type===`audio`){let t=document.createElement(`audio`);t.src=e.url,t.onloadedmetadata=()=>{let r=t.duration||5;o(e=>{let t=n(r);t.start=oe(e);let i=[...e,t];return u(se(i)),i}),Z.success(`已添加音频:${e.name}`)}}else e.type===`image`?(o(e=>{let t=n(5);t.start=oe(e);let r=[...e,t];return u(se(r)),r}),Z.success(`已添加图片:${e.name}`)):e.type===`text`?(o(e=>{let t=n(3);t.start=oe(e);let r=[...e,t];return u(se(r)),r}),Z.success(`已添加文本:${e.text}`)):e.type===`watermark`&&(o(e=>{let t=n(e.length>0?Math.max(...e.map(e=>e.start+e.duration)):10);t.start=0;let r=[...e,t];return u(se(r)),r}),Z.success(`已添加水印:${e.text||e.name}`))},[]),me=e=>l>0?e/l*100:0,he=(0,S.useCallback)(e=>{if(!B.current)return;let t=B.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width;if(r<=0)return;let i=Math.max(0,Math.min(1,n/r))*l;c(i),P.current&&(P.current.currentTime=i),F.current&&(F.current.currentTime=i)},[l]),ge=(0,S.useCallback)(e=>{if(e.stopPropagation(),e.preventDefault(),!B.current)return;let t=B.current.getBoundingClientRect(),n=e=>{let n=e.clientX-t.left;c(Math.max(0,Math.min(1,n/t.width))*l)},r=()=>{document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,r);let i=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width))*l;P.current&&(P.current.currentTime=i),F.current&&(F.current.currentTime=i)};document.addEventListener(`mousemove`,n),document.addEventListener(`mouseup`,r)},[l]),_e=(0,S.useCallback)((e,t,n)=>{e.stopPropagation(),e.preventDefault(),b(t.id);let r=B.current?.getBoundingClientRect(),i=(r?r.width:1)/Math.max(l,.01);K.current={segmentId:t.id,mode:n,startX:e.clientX,startTime:s,originalStart:t.start,originalDuration:t.duration,originalTrimStart:t.trimStart};let a=e=>{let t=K.current;if(!t||!B.current)return;let n=(e.clientX-t.startX)/i;t.mode===`move`?le(t.segmentId,Math.max(0,t.originalStart+n)):t.mode===`trimLeft`?ue(t.segmentId,t.originalTrimStart+n):t.mode===`trimRight`&&de(t.segmentId,Math.max(.1,t.originalDuration+n))},o=()=>{K.current=null,document.removeEventListener(`mousemove`,a),document.removeEventListener(`mouseup`,o)};document.addEventListener(`mousemove`,a),document.addEventListener(`mouseup`,o)},[s,l,le,ue,de]),ve=(0,S.useCallback)((e,t,n,r)=>{e.stopPropagation(),e.preventDefault(),b(t.id);let i=t.width??25,a=t.height??20,o=t.x??50,s=t.y??50;ee.current={segmentId:t.id,mode:n,startX:e.clientX,startY:e.clientY,origX:o,origY:s,origW:i,origH:a,handle:r};let c=V.current?.getBoundingClientRect();if(!c)return;let l=c.width,u=c.height,d=e=>{let t=ee.current;if(!t)return;let n=(e.clientX-t.startX)/l*100,r=(e.clientY-t.startY)/u*100;if(t.mode===`move`)fe(t.segmentId,`x`,Math.max(0,Math.min(100,t.origX+n))),fe(t.segmentId,`y`,Math.max(0,Math.min(100,t.origY+r)));else if(t.mode===`resize`){let e=t.origW,i=t.origH,a=t.origX,o=t.origY,s=t.handle||`se`;if(s.includes(`e`)&&(e=Math.max(3,t.origW+n)),s.includes(`s`)&&(i=Math.max(3,t.origH+r)),s.includes(`w`)){let r=t.origX+t.origW-n;e=Math.max(3,r-t.origX),a=t.origX+(t.origW-e)}if(s.includes(`n`)){let e=t.origY+t.origH-r;i=Math.max(3,e-t.origY),o=t.origY+(t.origH-i)}(s===`e`||s===`w`)&&(i=t.origH,o=t.origY),fe(t.segmentId,`width`,Math.min(100,e)),fe(t.segmentId,`height`,Math.min(100,i)),s.includes(`w`)&&fe(t.segmentId,`x`,Math.max(0,a)),s.includes(`n`)&&fe(t.segmentId,`y`,Math.max(0,o))}},f=()=>{ee.current=null,document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f)};document.addEventListener(`mousemove`,d),document.addEventListener(`mouseup`,f)},[fe]),ye=(0,S.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e)),b(null)},[]),be=(0,S.useCallback)(e=>{o(t=>t.map(t=>t.id===e?{...t,zIndex:(t.zIndex??0)+1}:t))},[]),xe=(0,S.useCallback)(e=>{o(t=>t.map(t=>t.id===e?{...t,zIndex:Math.max(0,(t.zIndex??0)-1)}:t))},[]),Se=()=>{if(G.current){if(P.current&&je){let e=P.current.currentTime;c(je.start+e-je.trimStart);return}if(F.current&&Ne){let e=F.current.currentTime;c(Ne.start+e-Ne.trimStart)}}},Ce=e=>{if(!I.current)return;let t=I.current.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*l;c(n),P.current&&(P.current.currentTime=n),F.current&&(F.current.currentTime=n)},we=e=>{let t=Math.max(0,Math.min(l,s+e));c(t),P.current&&(P.current.currentTime=t),F.current&&(F.current.currentTime=t)},Te=()=>{if(a.length===0){Z.warning(`请先添加视频片段`);return}Z.success(`导出任务已提交,请稍候...`)},Ee=[{key:`video`,icon:(0,$.jsx)(z8,{}),label:`视频`},{key:`audio`,icon:(0,$.jsx)(y8,{}),label:`音频`},{key:`image`,icon:(0,$.jsx)(L6,{}),label:`图片`},{key:`text`,icon:(0,$.jsx)(K4,{}),label:`文本`},{key:`watermark`,icon:(0,$.jsx)(kV,{}),label:`水印`}],De=e=>Z9[e].icon,Oe=a.find(e=>e.id===y),ke=a.filter(e=>e.type===`video`&&s>=e.start&&s(e.zIndex??0)-(t.zIndex??0)),Ae=ke.length>0?ke[ke.length-1]:null,je=a.find(e=>e.type===`video`&&s>=e.start&&se.type!==`text`&&e.type!==`watermark`&&e.type!==`image`?!1:s>=e.start&&s(e.zIndex??0)-(t.zIndex??0)),Ne=a.find(e=>e.type===`audio`&&s>=e.start&&s{let e=!d;if(G.current=e,f(e),U.current!==null&&(cancelAnimationFrame(U.current),U.current=null),e){let e=ke.some(e=>e.type===`video`&&e.url),t=Ne&&F.current,n=e||t;if(e&&P.current&&je){let e=Math.max(0,s-je.start+je.trimStart);P.current.currentTime=e,P.current.play().catch(()=>{})}if(t&&(F.current.currentTime=Math.max(0,s-Ne.start+Ne.trimStart),F.current.play().catch(()=>{})),!n){W.current=performance.now();let e=t=>{if(!G.current)return;let n=(t-W.current)/1e3;W.current=t,c(e=>{let t=e+n;return t>=l?(G.current=!1,f(!1),l):t}),G.current&&(U.current=requestAnimationFrame(e))};U.current=requestAnimationFrame(e)}}else P.current&&P.current.pause(),F.current&&F.current.pause()},[d,ke,je,Ne,s,l]),Fe=r.filter(e=>t===`watermark`?e.type===`watermark`:e.type===t);(0,S.useEffect)(()=>{P.current&&(P.current.volume=h/100),F.current&&(F.current.volume=h/100)},[h]),(0,S.useEffect)(()=>{P.current&&(P.current.playbackRate=p),F.current&&(F.current.playbackRate=p)},[p]),(0,S.useEffect)(()=>{if(Ae?.type===`video`&&P.current){let e=s-Ae.start+Ae.trimStart;Math.abs(P.current.currentTime-e)>.1&&(P.current.currentTime=Math.max(0,e))}if(Ne&&F.current){let e=s-Ne.start+Ne.trimStart;Math.abs(F.current.currentTime-e)>.1&&(F.current.currentTime=Math.max(0,e))}},[s,Ae,Ne]);let Ie=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!Ae){Ie.current=null;return}let e=`${Ae.id}-${Ae.type}`;Ie.current!==e&&d&&setTimeout(()=>{Ae.type===`video`&&P.current&&(P.current.currentTime=Ae.trimStart,P.current.play().catch(()=>{}))},30),Ie.current=e},[Ae,d]);let Le=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!Ne){Le.current=null;return}let e=Ne.id;Le.current!==e&&d&&Ne.url&&setTimeout(()=>{F.current&&(F.current.currentTime=Ne.trimStart,F.current.play().catch(()=>{}))},30),Le.current=e},[Ne,d]),(0,S.useEffect)(()=>()=>{U.current!==null&&(cancelAnimationFrame(U.current),U.current=null),r.forEach(e=>{e.url&&URL.revokeObjectURL(e.url)})},[]);let Re=e=>{if(!e)return null;let t=e.start+e.duration;return a.filter(n=>(n.type===`video`||n.type===`image`)&&n.id!==e.id&&n.start>t-.01).sort((e,t)=>e.start-t.start)[0]||null},ze=(0,S.useCallback)(()=>{if(!Ae)return;let e=Re(Ae);if(e){if(c(e.start),e.type===`video`&&P.current){let t=()=>{P.current&&G.current&&(P.current.currentTime=e.trimStart,P.current.play().catch(()=>{}))};P.current.readyState>=1?t():P.current.addEventListener(`loadedmetadata`,t,{once:!0})}}else G.current=!1,f(!1),c(Ae.start+Ae.duration),U.current!==null&&(cancelAnimationFrame(U.current),U.current=null)},[Ae,a]),Be=(0,S.useCallback)(()=>{G.current&&P.current&&je&&(P.current.currentTime=je.trimStart,P.current.play().catch(()=>{}))},[je]),Ve=(0,S.useCallback)(()=>{if(Ne&&G.current){let e=a.filter(e=>e.type===`audio`&&e.id!==Ne.id&&e.start>=Ne.start+Ne.duration-.01).sort((e,t)=>e.start-t.start)[0];if(e)setTimeout(()=>{F.current&&G.current&&(F.current.currentTime=e.trimStart,F.current.play().catch(()=>{}))},50);else{W.current=performance.now();let e=t=>{if(!G.current)return;let n=(t-W.current)/1e3;W.current=t,c(e=>{let t=e+n;return t>=l?(G.current=!1,f(!1),l):t}),G.current&&(U.current=requestAnimationFrame(e))};U.current=requestAnimationFrame(e)}}},[Ne,a,l]),He=[],Ue=Math.ceil(l||10),We=Math.max(1,Math.floor(Ue/10));for(let e=0;e<=Ue;e+=We)He.push(e);return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,width:`100vw`,height:`100vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`,margin:0},children:[(0,$.jsxs)(`div`,{style:{height:56,background:`#ffffff`,borderBottom:`1px solid #e8ecf2`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 20px`,flexShrink:0,boxShadow:`0 1px 2px rgba(15, 23, 42, 0.03)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(Uw,{}),onClick:()=>e(`/videoprojects`),children:`返回`}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`},children:`视频剪辑工作台`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:[a.length,` 个片段 · 总时长 `,te(l)]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(Eie,{}),children:`保存草稿`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(j4,{}),onClick:Te,children:`导出视频`})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,overflow:`hidden`,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{width:220,minWidth:180,maxWidth:220,background:`#ffffff`,borderRight:`1px solid #e8ecf2`,display:`flex`,flexDirection:`column`,flexShrink:0,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,padding:`10px 8px 8px`,gap:4,borderBottom:`1px solid #eef2f7`,flexShrink:0},children:Ee.map(e=>(0,$.jsx)(kw,{title:e.label,placement:`bottom`,children:(0,$.jsx)(`div`,{onClick:()=>n(e.key),style:{width:34,height:34,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,background:t===e.key?`rgba(99,102,241,0.1)`:`transparent`,color:t===e.key?`#6366f1`:`#64748b`,transition:`all 0.2s`,fontSize:15},children:e.icon})},e.key))}),(0,$.jsxs)(`div`,{style:{padding:`12px`,flexShrink:0},children:[(0,$.jsx)(X,{block:!0,icon:(0,$.jsx)(T3,{}),onClick:q,children:t===`text`?`添加文本`:t===`watermark`?`添加水印`:`导入${Ee.find(e=>e.key===t)?.label}`}),(0,$.jsx)(`input`,{ref:R,type:`file`,accept:ne(t),multiple:!0,style:{display:`none`},onChange:re})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`0 12px`,minHeight:0},children:Fe.length===0?(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px 12px`,color:`#94a3b8`},children:[(0,$.jsx)(T3,{style:{fontSize:32,marginBottom:12,opacity:.5}}),(0,$.jsx)(`div`,{style:{fontSize:13},children:t===`text`?`点击上方按钮添加文本`:t===`watermark`?`点击上方按钮添加水印`:`点击上方按钮导入素材`})]}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:8},children:Fe.map(e=>(0,$.jsxs)(`div`,{onClick:()=>pe(e),style:{background:`#f8fafc`,border:`1px solid #e2e8f0`,borderRadius:8,padding:10,cursor:`pointer`,transition:`all 0.2s`,textAlign:`center`,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#c7d2fe`,e.currentTarget.style.background=`#eef2ff`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.background=`#f8fafc`},children:[(e.type===`image`||e.type===`watermark`)&&e.url?(0,$.jsx)(`div`,{style:{width:`100%`,height:48,borderRadius:6,overflow:`hidden`,background:`#e2e8f0`,marginBottom:6,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`img`,{src:e.url,alt:e.name,draggable:!1,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}})}):(0,$.jsx)(`div`,{style:{fontSize:22,marginBottom:6},children:De(e.type)}),(0,$.jsx)(`div`,{style:{color:`#334155`,fontSize:11,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.text||e.name,children:e.text||e.name})]},e.id))})}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,borderTop:`1px solid #eef2f7`,color:`#94a3b8`,fontSize:11,textAlign:`center`,flexShrink:0},children:`选择素材添加到时间线`})]}),(0,$.jsxs)(`div`,{ref:H,style:{flex:1,minWidth:0,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,padding:16,minHeight:0,background:`#ffffff`},children:a.length>0?(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,minWidth:400,minHeight:300,borderRadius:12,overflow:`hidden`,boxShadow:`0 8px 32px rgba(15, 23, 42, 0.2)`,background:`#000`},children:[ke.map((e,t)=>{let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:e.zIndex??t};if(e.type===`video`&&e.url){let r=t===ke.findIndex(e=>e.type===`video`);return(0,$.jsx)(`video`,{ref:r?P:void 0,src:e.url,onTimeUpdate:r?Se:void 0,onPlay:r?()=>f(!0):void 0,onPause:r?()=>f(!1):void 0,onEnded:r?ze:void 0,onLoadedMetadata:r?Be:void 0,style:{...n,objectFit:`contain`,background:`#000`}},e.id)}return e.type===`image`&&e.url?(0,$.jsx)(`img`,{src:e.url,alt:e.name,style:{...n,objectFit:`contain`}},e.id):null}),ke.length===0&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`#000`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(P6,{style:{fontSize:48,marginBottom:8,opacity:.4}}),(0,$.jsx)(`div`,{style:{fontSize:13}})]})}),(0,$.jsx)(`div`,{ref:V,style:{position:`absolute`,inset:0,pointerEvents:`none`}}),Me.filter(e=>e.type===`image`&&e.url).map(e=>{let t=y===e.id,n=e.x??50,r=e.y??50,i=e.width??25,a=e.height??20,o=e.opacity??1;return(0,$.jsxs)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,width:`${i}%`,height:`${a}%`,transform:`translate(-50%, -50%)`,cursor:`move`,zIndex:e.zIndex??4,pointerEvents:`auto`,opacity:o},children:[(0,$.jsx)(`img`,{src:e.url,alt:e.name,draggable:!1,style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,border:t?`2px solid #6366f1`:`2px solid rgba(255,255,255,0.8)`,boxShadow:t?`0 0 0 2px rgba(99,102,241,0.3), 0 4px 12px rgba(0,0,0,0.3)`:`0 4px 12px rgba(0,0,0,0.3)`,pointerEvents:`none`}}),t&&(0,$.jsx)($.Fragment,{children:[`nw`,`n`,`ne`,`e`,`se`,`s`,`sw`,`w`].map(t=>{let n=t.length===2,r={};return t.includes(`n`)&&(r.top=-6),t.includes(`s`)&&(r.bottom=-6),t.includes(`w`)&&(r.left=-6),t.includes(`e`)&&(r.right=-6),!t.includes(`n`)&&!t.includes(`s`)&&(r.top=`50%`),!t.includes(`w`)&&!t.includes(`e`)&&(r.left=`50%`),!t.includes(`n`)&&!t.includes(`s`)&&(r.transform=`translateY(-50%)`),!t.includes(`w`)&&!t.includes(`e`)&&(r.transform=`translateX(-50%)`),(0,$.jsx)(`div`,{onMouseDown:n=>ve(n,e,`resize`,t),style:{position:`absolute`,width:n?10:8,height:n?10:8,background:`#fff`,border:`1.5px solid #6366f1`,borderRadius:2,cursor:`${t}-resize`,zIndex:10,...r}},t)})})]},e.id)}),Me.filter(e=>e.type===`text`).map(e=>{let t=y===e.id,n=e.x??50,r=e.y??85,i=e.opacity??1;return(0,$.jsx)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,transform:`translate(-50%, -50%)`,fontSize:28,fontWeight:700,color:`#fff`,textShadow:`0 2px 12px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.5)`,cursor:`move`,zIndex:e.zIndex??5,whiteSpace:`nowrap`,maxWidth:`90%`,overflow:`hidden`,textOverflow:`ellipsis`,opacity:i,padding:`4px 8px`,outline:t?`2px dashed #6366f1`:`none`,outlineOffset:2,pointerEvents:`auto`},children:e.text||e.name},e.id)}),Me.filter(e=>e.type===`watermark`).map(e=>{let t=y===e.id,n=e.x??85,r=e.y??85,i=e.opacity??.4;return(0,$.jsx)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,transform:`translate(-50%, -50%)`,fontSize:14,color:`rgba(255,255,255,${i})`,fontWeight:500,cursor:`move`,zIndex:e.zIndex??6,padding:t?`2px 4px`:void 0,outline:t?`2px dashed #6366f1`:`none`,outlineOffset:2,pointerEvents:`auto`},children:e.text||e.name},e.id)}),Ne?.url&&(0,$.jsx)(`audio`,{ref:F,src:Ne.url,onTimeUpdate:Se,onPlay:()=>f(!0),onPause:()=>f(!1),onEnded:Ve,style:{display:`none`}},Ne.id)]}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsx)(P6,{style:{fontSize:64,marginBottom:16,opacity:.35}}),(0,$.jsx)(`div`,{style:{fontSize:14,color:`#64748b`},children:`选择素材开始创作`}),(0,$.jsx)(`div`,{style:{fontSize:12,marginTop:4},children:`从左侧导入视频、音频或图片`})]})}),(0,$.jsxs)(`div`,{style:{height:48,background:`#ffffff`,borderTop:`1px solid #e8ecf2`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,padding:`0 16px`,flexShrink:0,color:`#1e293b`,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{color:`#64748b`,fontSize:13,fontFamily:`monospace`},children:[te(s),` / `,te(l)]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(a2,{}),onClick:()=>we(-5),disabled:a.length===0}),(0,$.jsx)(X,{type:`text`,icon:d?(0,$.jsx)(S6,{}):(0,$.jsx)(K6,{}),onClick:Pe,disabled:a.length===0,style:{color:`#6366f1`,fontSize:22,width:44,height:44}}),(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(Y4,{}),onClick:()=>we(5),disabled:a.length===0})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(y8,{style:{color:`#64748b`}}),(0,$.jsx)(nB,{value:h,onChange:g,style:{width:80},tooltip:{formatter:e=>`${e}%`}})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[.5,1,1.5,2].map(e=>(0,$.jsxs)(X,{size:`small`,type:p===e?`primary`:`default`,onClick:()=>m(e),style:{width:40,height:24,fontSize:11},children:[e,`x`]},e))}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(kw,{title:`在播放头处分割`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(o8,{}),onClick:ce,disabled:!y,children:`分割`})}),(0,$.jsx)(lU,{style:{color:`#64748b`,cursor:`pointer`},onClick:()=>v(e=>Math.max(10,e-10))}),(0,$.jsxs)(`span`,{style:{color:`#64748b`,fontSize:12,minWidth:32,textAlign:`center`},children:[_,`%`]}),(0,$.jsx)(oU,{style:{color:`#64748b`,cursor:`pointer`},onClick:()=>v(e=>Math.min(100,e+10))}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsx)(kw,{title:E?`退出全屏`:`全屏预览`,children:E?(0,$.jsx)(Q4,{style:{color:`#6366f1`,cursor:`pointer`,fontSize:18},onClick:()=>D(!1)}):(0,$.jsx)(t3,{style:{color:`#64748b`,cursor:`pointer`,fontSize:18},onClick:()=>D(!0)})})]})]}),(0,$.jsxs)(`div`,{ref:I,onClick:Ce,style:{height:4,background:`#e2e8f0`,cursor:`pointer`,position:`relative`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,top:0,height:`100%`,width:`${l>0?s/l*100:0}%`,background:`#6366f1`,borderRadius:`0 2px 2px 0`,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${l>0?s/l*100:0}%`,top:-4,width:8,height:12,background:`#6366f1`,borderRadius:2,transform:`translateX(-50%)`,boxShadow:`0 0 8px rgba(99,102,241,0.3)`}})]})]}),(0,$.jsxs)(`div`,{style:{width:200,minWidth:160,maxWidth:200,background:`#ffffff`,borderLeft:`1px solid #e8ecf2`,display:`flex`,flexDirection:`column`,flexShrink:0,overflow:`hidden`,color:`#1e293b`},children:[(0,$.jsxs)(`div`,{style:{padding:`10px 12px`,borderBottom:`1px solid #eef2f7`,display:`flex`,alignItems:`center`,gap:4,flexShrink:0,flexWrap:`wrap`},children:[(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(Qie,{}),children:`翻译`}),(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(o8,{}),children:`剪辑`}),(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(s3,{}),children:`语言`})]}),(0,$.jsxs)(`div`,{style:{padding:`12px`,borderBottom:`1px solid #eef2f7`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,marginBottom:8},children:`目标语言`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[`中文`,`英文`,`日文`,`韩文`].map(e=>(0,$.jsx)(`div`,{onClick:()=>T(e),style:{padding:`6px 12px`,borderRadius:6,cursor:`pointer`,background:w===e?`rgba(99,102,241,0.1)`:`transparent`,color:w===e?`#6366f1`:`#64748b`,fontSize:13,transition:`all 0.2s`,border:w===e?`1px solid rgba(99,102,241,0.3)`:`1px solid transparent`},children:e},e))})]}),(0,$.jsxs)(`div`,{style:{padding:`12px`,flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,marginBottom:8},children:`剪辑描述`}),(0,$.jsx)(X9,{value:x,onChange:e=>C(e.target.value),placeholder:`选择一个视频片段,开始你的创作...`,style:{flex:1,minHeight:100,borderRadius:8,resize:`none`}})]}),Oe&&(0,$.jsxs)(`div`,{style:{padding:`10px 12px`,borderTop:`1px solid #eef2f7`,background:`#f8fafc`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:6},children:`当前选中`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#6366f1`,marginBottom:6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Oe.name}),(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2},children:[`时长 `,Oe.duration.toFixed(1),`s / 原始 `,Oe.originalDuration.toFixed(1),`s`]}),(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:8},children:[`起始 `,Oe.start.toFixed(1),`s · 裁剪 `,Oe.trimStart.toFixed(1),`s`]}),(Oe.type===`image`||Oe.type===`text`||Oe.type===`watermark`)&&(0,$.jsxs)(`div`,{style:{borderTop:`1px solid #e2e8f0`,paddingTop:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`透明度`}),(0,$.jsxs)(`span`,{children:[Math.round((Oe.opacity??1)*100),`%`]})]}),(0,$.jsx)(nB,{min:0,max:1,step:.05,value:Oe.opacity??1,onChange:e=>fe(Oe.id,`opacity`,e)})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`X位置`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.x??50),`%`]})]}),(0,$.jsx)(nB,{min:0,max:100,value:Oe.x??50,onChange:e=>fe(Oe.id,`x`,e)})]}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`Y位置`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.y??50),`%`]})]}),(0,$.jsx)(nB,{min:0,max:100,value:Oe.y??50,onChange:e=>fe(Oe.id,`y`,e)})]})]}),Oe.type===`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`宽度`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.width??25),`%`]})]}),(0,$.jsx)(nB,{min:3,max:100,value:Oe.width??25,onChange:e=>fe(Oe.id,`width`,e)})]}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`高度`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.height??20),`%`]})]}),(0,$.jsx)(nB,{min:3,max:100,value:Oe.height??20,onChange:e=>fe(Oe.id,`height`,e)})]})]}),(0,$.jsx)(`div`,{style:{fontSize:11,color:`#94a3b8`},children:`在预览区拖拽移动,拖拽边缘缩放`})]}),(0,$.jsxs)(`div`,{style:{marginTop:12,padding:10,background:`#f8fafc`,borderRadius:8,border:`1px solid #e8ecf2`},children:[(0,$.jsxs)(`div`,{style:{fontSize:12,fontWeight:500,color:`#334155`,marginBottom:8,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`图层顺序`}),(0,$.jsxs)(SQ,{color:`blue`,style:{margin:0},children:[`层级 `,Oe.zIndex??0]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)($0,{}),onClick:()=>be(Oe.id),disabled:(Oe.zIndex??0)>=10,style:{flex:1},children:`上移`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(W0,{}),onClick:()=>xe(Oe.id),disabled:(Oe.zIndex??0)<=0,style:{flex:1},children:`下移`})]}),(0,$.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:6},children:`数值越大越靠上`})]}),(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(IQ,{}),onClick:()=>ye(Oe.id),style:{width:`100%`,marginTop:12},children:`删除片段`})]})]})]}),(0,$.jsxs)(`div`,{style:{height:180,background:`#ffffff`,borderTop:`1px solid #e8ecf2`,flexShrink:0},children:[(0,$.jsxs)(`div`,{style:{height:36,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 16px`,background:`#f8fafc`,borderBottom:`1px solid #e8ecf2`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(i$,{}),children:`轨道`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`},children:[a.length,` 个片段 · `,te(l)]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`},children:(0,$.jsx)(nB,{value:_,onChange:v,style:{width:100},tooltip:{formatter:e=>`缩放 ${e}%`}})})]}),(0,$.jsx)(`div`,{style:{position:`relative`,height:20,padding:`0 16px 0 72px`,overflow:`hidden`,background:`#f8fafc`},children:(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,bottom:0},children:He.map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${me(e)}%`,top:0,width:1,height:e%(We*5)==0?20:10,background:e%(We*5)==0?`#94a3b8`:`#cbd5e1`},children:e%(We*5)==0&&(0,$.jsx)(`span`,{style:{position:`absolute`,top:2,left:-16,fontSize:10,color:`#64748b`},children:te(e).slice(3)})},e))})}),(0,$.jsxs)(`div`,{ref:z,style:{position:`relative`,height:120,padding:`0 16px 0 72px`,display:`flex`,flexDirection:`column`},children:[a.length===0&&(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`从左侧选择素材,添加到时间线开始创作。`}),(0,$.jsxs)(`div`,{ref:B,onClick:he,style:{position:`relative`,flex:1,cursor:`crosshair`},children:[[`video`,`audio`,`image`,`text`,`watermark`].map(e=>{let t=a.filter(t=>t.type===e);if(t.length===0)return null;let n=Z9[e];return(0,$.jsxs)(`div`,{style:{display:`flex`,height:28,marginBottom:2,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{position:`absolute`,left:-64,top:2,width:60,height:24,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,fontSize:10,color:`#475569`,background:n.bg,border:`1px solid ${n.border}`,borderRadius:6,padding:`0 6px`},children:[n.icon,(0,$.jsx)(`span`,{style:{fontWeight:500},children:Ee.find(t=>t.key===e)?.label})]}),(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:28},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,bottom:0,height:1,background:`#f1f5f9`}}),t.map(e=>{let t=y===e.id,r=me(e.start),i=me(e.duration);return(0,$.jsxs)(`div`,{onClick:t=>{t.stopPropagation(),b(e.id)},onMouseDown:t=>_e(t,e,`move`),style:{position:`absolute`,left:`${r}%`,width:`${i}%`,height:22,top:2,background:t?n.bgActive:n.bg,border:`1px solid ${t?n.borderActive:n.border}`,borderRadius:6,cursor:`grab`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0 10px`,overflow:`hidden`,transition:`background 0.15s, border-color 0.15s`,userSelect:`none`,boxShadow:t?`0 2px 8px rgba(99,102,241,0.25)`:`0 1px 2px rgba(0,0,0,0.04)`},title:`${e.name} · ${e.duration.toFixed(1)}s`,children:[(0,$.jsx)(`span`,{style:{fontSize:11,color:`#334155`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontWeight:500},children:e.name}),(0,$.jsx)(`div`,{onMouseDown:t=>_e(t,e,`trimLeft`),style:{position:`absolute`,left:-3,top:`50%`,transform:`translateY(-50%)`,width:6,height:16,background:t?`#6366f1`:`#94a3b8`,borderRadius:2,cursor:`ew-resize`,zIndex:2,flexShrink:0}}),(0,$.jsx)(`div`,{onMouseDown:t=>_e(t,e,`trimRight`),style:{position:`absolute`,right:-3,top:`50%`,transform:`translateY(-50%)`,width:6,height:16,background:t?`#6366f1`:`#94a3b8`,borderRadius:2,cursor:`ew-resize`,zIndex:2,flexShrink:0}})]},e.id)})]})]},e)}),a.length>0&&(0,$.jsx)(`div`,{ref:L,onMouseDown:ge,style:{position:`absolute`,left:`${me(s)}%`,top:0,bottom:0,width:2,marginLeft:-1,background:`#ef4444`,cursor:`ew-resize`,zIndex:10,transition:`left 0.05s linear`},children:(0,$.jsx)(`div`,{style:{position:`absolute`,top:-2,left:-4,width:10,height:10,background:`#ef4444`,borderRadius:`50%`,boxShadow:`0 0 8px rgba(239,68,68,0.5)`,cursor:`grab`}})})]})]})]}),E&&(0,$.jsxs)(`div`,{style:{position:`fixed`,inset:0,background:`#000`,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},onClick:()=>D(!1),children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:16,right:16,zIndex:10},children:(0,$.jsx)(X,{icon:(0,$.jsx)(Q4,{}),onClick:()=>D(!1),style:{background:`rgba(255,255,255,0.1)`,color:`#fff`,border:`none`},children:`退出全屏`})}),a.length>0&&(0,$.jsxs)(`div`,{style:{position:`relative`,maxWidth:`90vw`,maxHeight:`85vh`,borderRadius:12,overflow:`hidden`},onClick:e=>e.stopPropagation(),children:[Ae?.type===`video`&&Ae.url&&(0,$.jsx)(`video`,{src:Ae.url,autoPlay:!0,onTimeUpdate:Se,onLoadedMetadata:e=>u(e.target.duration),style:{maxWidth:`90vw`,maxHeight:`85vh`,objectFit:`contain`}}),Ae?.type===`image`&&Ae.url&&(0,$.jsx)(`img`,{src:Ae.url,alt:Ae.name,style:{maxWidth:`90vw`,maxHeight:`85vh`,objectFit:`contain`}}),Me.filter(e=>e.type===`text`).map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:48,left:`50%`,transform:`translateX(-50%)`,fontSize:36,fontWeight:700,color:`#fff`,textShadow:`0 2px 12px rgba(0,0,0,0.8)`},children:e.text||e.name},e.id)),Me.filter(e=>e.type===`watermark`).map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:20,right:20,fontSize:18,color:`rgba(255,255,255,${e.opacity??.4})`,fontWeight:500},children:e.text||e.name},e.id))]}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:24,display:`flex`,alignItems:`center`,gap:16,color:`#fff`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`span`,{style:{fontFamily:`monospace`},children:[te(s),` / `,te(l)]}),(0,$.jsx)(X,{type:`text`,icon:d?(0,$.jsx)(S6,{style:{color:`#fff`,fontSize:32}}):(0,$.jsx)(K6,{style:{color:`#fff`,fontSize:32}}),onClick:Pe})]})]}),(0,$.jsxs)(jG,{title:M===`watermark`?`添加水印`:`添加文本`,open:O,onOk:ae,onCancel:()=>k(!1),okText:`确定`,cancelText:`取消`,width:440,children:[(0,$.jsx)(`div`,{style:{marginBottom:8,fontSize:13,color:`#64748b`},children:M===`watermark`?`输入水印文字,将作为半透明叠加层显示在视频右下角`:`输入文本内容,将作为字幕或标题叠加在视频上`}),(0,$.jsx)(X9,{value:A,onChange:e=>j(e.target.value),placeholder:M===`watermark`?`请输入水印文字...`:`请输入文本内容...`,autoSize:{minRows:2,maxRows:5},autoFocus:!0,onPressEnter:ae})]})]})},{TextArea:Q9}=$U,eue=()=>{let e=Ye(),[t,n]=(0,S.useState)([{id:`demo-1`,name:`示例项目`,description:`这是一个视频剪辑示例项目`,createdAt:(0,VE.default)().subtract(2,`day`).format(`YYYY-MM-DD HH:mm`),updatedAt:(0,VE.default)().subtract(1,`day`).format(`YYYY-MM-DD HH:mm`)}]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)({name:``,description:``}),d=()=>{if(!l.name.trim()){Z.warning(`请输入项目名称`);return}let t={id:`proj-${Date.now()}`,name:l.name.trim(),description:l.description.trim(),createdAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`),updatedAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`)};n(e=>[t,...e]),i(!1),u({name:``,description:``}),Z.success(`项目创建成功`),e(`/videoediting?id=${t.id}`)},f=e=>{c(e),u({name:e.name,description:e.description}),o(!0)},p=()=>{if(s){if(!l.name.trim()){Z.warning(`请输入项目名称`);return}n(e=>e.map(e=>e.id===s.id?{...e,name:l.name.trim(),description:l.description.trim(),updatedAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`)}:e)),o(!1),c(null),u({name:``,description:``}),Z.success(`项目已更新`)}},m=e=>{n(t=>t.filter(t=>t.id!==e)),Z.success(`项目已删除`)},h=t=>{e(`/videoediting?id=${t.id}`)},g=e=>({items:[{key:`rename`,icon:(0,$.jsx)(i$,{}),label:`重命名`,onClick:()=>f(e)},{key:`delete`,icon:(0,$.jsx)(IQ,{}),label:`删除`,danger:!0,onClick:()=>{jG.confirm({title:`确认删除`,content:`确定要删除项目「${e.name}」吗?`,okText:`删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:()=>m(e.id)})}}]});return(0,$.jsxs)(`div`,{className:`content_box`,style:{background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:22,fontWeight:600,color:`#1e293b`},children:`视频剪辑项目`}),(0,$.jsx)(`p`,{style:{margin:`4px 0 0`,fontSize:13,color:`#64748b`},children:`创建和管理你的视频剪辑项目`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),size:`large`,onClick:()=>{u({name:``,description:``}),i(!0)},children:`创建项目`})]}),t.length===0?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:400},children:(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#64748b`},children:`暂无项目,点击「创建项目」开始剪辑`}),children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>{u({name:``,description:``}),i(!0)},children:`创建项目`})})}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(280px, 1fr))`,gap:16},children:t.map(e=>(0,$.jsxs)(lL,{hoverable:!0,style:{borderRadius:12,overflow:`hidden`,transition:`all 0.2s ease`,border:`1px solid #e8ecf2`},bodyStyle:{padding:0},children:[(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{height:160,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(z8,{style:{fontSize:48,color:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(EV,{menu:g(e),trigger:[`click`],placement:`bottomRight`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(TE,{style:{color:`#fff`,fontSize:18}}),style:{background:`rgba(0,0,0,0.3)`,borderRadius:6},onClick:e=>e.stopPropagation()})})})]}),(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{padding:`14px 16px`,cursor:`pointer`},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,marginBottom:4},children:e.name}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,marginBottom:8},children:e.description||`暂无描述`}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,fontSize:12,color:`#94a3b8`},children:(0,$.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(TB,{}),e.updatedAt]})})]})]},e.id))}),(0,$.jsx)(jG,{title:`创建视频剪辑项目`,open:r,onOk:d,onCancel:()=>i(!1),okText:`创建并开始剪辑`,cancelText:`取消`,width:480,children:(0,$.jsxs)(`div`,{style:{paddingTop:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目名称`}),(0,$.jsx)($U,{placeholder:`请输入项目名称`,value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),maxLength:30})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目描述(可选)`}),(0,$.jsx)(Q9,{placeholder:`请输入项目描述`,value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),rows:3,maxLength:100})]})]})}),(0,$.jsx)(jG,{title:`编辑项目`,open:a,onOk:p,onCancel:()=>{o(!1),c(null)},okText:`保存`,cancelText:`取消`,width:480,children:(0,$.jsxs)(`div`,{style:{paddingTop:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目名称`}),(0,$.jsx)($U,{placeholder:`请输入项目名称`,value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),maxLength:30})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目描述(可选)`}),(0,$.jsx)(Q9,{placeholder:`请输入项目描述`,value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),rows:3,maxLength:100})]})]})})]})};VE.default.locale(`zh-cn`);var $9=({children:e})=>{let{user:t,loading:n,checkAuth:r}=e7();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)(oG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=e7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(Mm,{locale:a0.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)(ex,{children:(0,$.jsx)(_n,{children:(0,$.jsxs)(Dt,{children:[(0,$.jsx)(Tt,{path:`/login`,element:(0,$.jsx)(Tse,{})}),(0,$.jsx)(Tt,{path:`/join-team`,element:(0,$.jsx)(Yle,{})}),(0,$.jsx)(Tt,{path:`/private-portrait-authorized`,element:(0,$.jsx)(Zle,{})}),(0,$.jsxs)(Tt,{path:`/`,element:(0,$.jsx)($9,{children:(0,$.jsx)(Cse,{})}),children:[(0,$.jsx)(Tt,{index:!0,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})}),(0,$.jsx)(Tt,{path:`projects`,element:(0,$.jsx)(Ose,{})}),(0,$.jsx)(Tt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(Kse,{})}),(0,$.jsx)(Tt,{path:`records`,element:(0,$.jsx)(qse,{})}),(0,$.jsx)(Tt,{path:`credits`,element:(0,$.jsx)(Jse,{})}),(0,$.jsx)(Tt,{path:`credit-records`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`order-records`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`user-center`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`messages`,element:(0,$.jsx)(Zse,{})}),(0,$.jsx)(Tt,{path:`home`,element:(0,$.jsx)(Ble,{})}),(0,$.jsx)(Tt,{path:`conversation`,element:(0,$.jsx)(Nce,{})}),(0,$.jsx)(Tt,{path:`initial`,element:(0,$.jsx)(zce,{})}),(0,$.jsx)(Tt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(Gce,{})}),(0,$.jsx)(Tt,{path:`removelens`,element:(0,$.jsx)(Qce,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Nle,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(Lle,{})}),(0,$.jsx)(Tt,{path:`generated`,element:(0,$.jsx)(sle,{})}),(0,$.jsx)(Tt,{path:`pretest`,element:(0,$.jsx)(lle,{})}),(0,$.jsx)(Tt,{path:`authorization`,element:(0,$.jsx)(dle,{})}),(0,$.jsx)(Tt,{path:`authoriza-waiting`,element:(0,$.jsx)(Ule,{})}),(0,$.jsx)(Tt,{path:`materials`,element:(0,$.jsx)(yle,{})}),(0,$.jsx)(Tt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(Ct,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(Tt,{path:`consume`,element:(0,$.jsx)(Hle,{})}),(0,$.jsx)(Tt,{path:`popular`,element:(0,$.jsx)(Wle,{})}),(0,$.jsx)(Tt,{path:`authacc`,element:(0,$.jsx)(ple,{})}),(0,$.jsx)(Tt,{path:`creativeplaza`,element:(0,$.jsx)(Gle,{})}),(0,$.jsx)(Tt,{path:`team-management`,element:(0,$.jsx)(Jle,{})}),(0,$.jsx)(Tt,{path:`invoice`,element:(0,$.jsx)(Qle,{})}),(0,$.jsx)(Tt,{path:`videoprojects`,element:(0,$.jsx)(eue,{})})]}),(0,$.jsx)(Tt,{path:`/videoediting`,element:(0,$.jsx)($9,{children:(0,$.jsx)($le,{})})}),(0,$.jsx)(Tt,{path:`*`,element:(0,$.jsx)(Ct,{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)(oG,{size:`small`}),(0,$.jsx)(ble,{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)(oG,{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)(nB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${L9(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:kle}=$U,Ale=`https://ceshi.apiforeign.minzhongzc.com`,H9=2,U9=15,jle=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 W9(e){return e?/^https?:\/\//i.test(e)?e:`${Ale}${e}`:``}var Mle=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(W9(n)),children:[(0,$.jsx)(`video`,{src:W9(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=w9(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)(oG,{size:`small`,style:{color:`#f59e0b`}}):null,(0,$.jsx)(`span`,{style:{color:r.failure?`#ef4444`:r.active?`#f59e0b`:`#94a3b8`},children:r.label})]})})});function Nle(){let{creatID:e}=$e(),t=Ye(),{user:n,optimizeHoldCredits:r}=e7(),[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)([]),[te,ne]=(0,S.useState)(1),[re,ie]=(0,S.useState)(20),[ae,q]=(0,S.useState)(0),[oe,se]=(0,S.useState)(!1),[ce,le]=(0,S.useState)(!1),[ue,de]=(0,S.useState)(!1),fe=(0,S.useRef)(null),pe=(0,S.useRef)(null),me=(0,S.useRef)(null),he=(0,S.useMemo)(()=>W9(W?.videoUrl),[W?.videoUrl]);(0,S.useEffect)(()=>{T5().then(e=>{let t=e?.engine?.video||[];if(D(t),t.length>0){let e=t[0],n=(()=>{let t=e.maxDuration??e.max_duration;if(t!=null)return Number(t);let n=e.supportedDurations;return Array.isArray(n)&&n.length>0?Math.max(...n):15})(),r=e.supportedDurations,i=Array.from({length:Math.max(n-4,1)},(e,t)=>t+5),a=Array.from(new Set([...r||[],...i].sort((e,t)=>e-t)));k(e.id),N(e.supportedRatios?.includes(`9:16`)?`9:16`:e.supportedRatios?.[0]||`9:16`),F(e.supportedResolutions?.[0]||`480p`),j((r||[]).find(e=>e<=n)??i[0]??5),V({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.length>0?a:i})}}).catch(()=>Z.error(`视频引擎加载失败`)),O5().then(e=>U(Array.isArray(e)?e:[])).catch(()=>U([]))},[]),(0,S.useEffect)(()=>{if(!_e)return;let e=(()=>{let e=_e.maxDuration??_e.max_duration;if(e!=null)return Number(e);let t=_e.supportedDurations;return Array.isArray(t)&&t.length>0?Math.max(...t):15})(),t=_e.supportedDurations,n=Array.from({length:Math.max(e-4,1)},(e,t)=>t+5),r=Array.from(new Set([...t||[],...n].sort((e,t)=>e-t)));V(t=>{let i=t.durations;return(i.length>0?Math.max(...i):0)===e?t:{ratios:_e.supportedRatios||t.ratios,resolutions:_e.supportedResolutions||t.resolutions,durations:r.length>0?r:n}}),j(r=>r<=e?r:(t||[]).find(t=>t<=e)??n[0]??5)},[O]);let ge=(0,S.useRef)(null),_e=E.find(e=>e.id===O),ve=(()=>{if(!_e)return 15;let e=_e.maxDuration??_e.max_duration;if(e!=null)return Number(e);let t=_e.supportedDurations;return Array.isArray(t)&&t.length>0?Math.max(...t):15})(),ye=!x||jle(_e),be=(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]),xe=Number(n?.credits||0)K.length===0?`AI自动拆分`:K.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[K]),Ce=(0,S.useCallback)(async()=>{if(e)try{G(await R5(e))}catch{Z.error(`获取任务详情失败`)}},[e]),we=(0,S.useCallback)(async()=>{if(e)try{let t=await yoe(e,te,re);ee(t.items||[]),q(t.total||0)}catch{Z.error(`获取拆镜列表失败`)}},[e,te,re]),Te=(0,S.useCallback)(e=>{p(e),h(!0)},[]),Ee=(0,S.useCallback)(async()=>{if(e)try{await koe(e),Z.success(`重新分析已提交`),me.current=Date.now(),await Ce()}catch(e){Z.error(e?.message||`重新分析失败`)}},[e,Ce]),De=(0,S.useCallback)(async e=>{try{await joe(e),Z.success(`重新分析已提交`),we()}catch(e){Z.error(e?.message||`重新分析失败`)}},[we]),Oe=(0,S.useCallback)(async e=>{try{await Moe(e),Z.success(`重新切割已提交`),await we()}catch(e){Z.error(e?.message||`重新切割失败`)}},[we]),ke=(0,S.useCallback)(async e=>{try{await Aoe(e),Z.success(`删除成功`),we()}catch(e){Z.error(e?.message||`删除失败`)}},[we]),Ae=(0,S.useCallback)(async()=>{await Promise.all([Ce(),we()])},[Ce,we]);(0,S.useEffect)(()=>(Ae(),()=>{fe.current&&window.clearTimeout(fe.current),pe.current&&window.clearTimeout(pe.current)}),[Ae]),(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){me.current=null,pe.current&&=(window.clearTimeout(pe.current),null);return}me.current||=Date.now();let t=async()=>{if(document.visibilityState===`visible`)try{G(await R5(e))}catch{}},n=()=>{if(!pe.current)return;let e=Date.now()-(me.current||Date.now()),r=e<6e4?3e3:e<6e5?1e4:3e4;pe.current=window.setTimeout(async()=>{await t(),n()},r)};pe.current=window.setTimeout(async()=>{await t(),n()},3e3);let r=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{pe.current&&=(window.clearTimeout(pe.current),null),document.removeEventListener(`visibilitychange`,r)}},[W?.analysisStatus,e]);let je=K.some(e=>Xce(e));(0,S.useEffect)(()=>{if(!je||!e){fe.current&&=(window.clearTimeout(fe.current),null);return}let t=async()=>{document.visibilityState===`visible`&&await we()};fe.current=window.setTimeout(()=>void t(),3e4);let n=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,n),()=>{fe.current&&=(window.clearTimeout(fe.current),null),document.removeEventListener(`visibilitychange`,n)}},[e,we,je]);let Me=(e,t)=>{l(e),d(t),a(!0)},Ne=()=>{a(!1),l(null),v(``),d(``),b(``),C(``),T(``)},Pe=async e=>{try{let t=await zae(e);C(t.url),T(t.resource_id||``),Z.success(`图片上传成功`)}catch{Z.error(`图片上传失败,请重试`)}return!1},Fe=async()=>{if(!c){Z.warning(`请先选择拆镜片段`);return}if(!O){Z.warning(`请选择视频引擎`);return}if(!ye){Z.warning(`当前视频引擎不支持参考图片,请移除素材图片或切换引擎`);return}if(xe){Z.warning(`积分不足,请充值后再创建复刻项目`);return}let e=ge.current,n=e?.segmentId===c?e.key:`shot_v2_${c}_${Date.now()}_${Math.random().toString(16).slice(2)}`;ge.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};se(!0);try{let e=await boe(c,r),n=e?.projectId||e?.id||e?.detail?.id;ge.current=null,Z.success(`项目已创建,视频提词正在生成`),Ne(),await we(),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}Z.error(t||`创建失败,请重试`)}finally{se(!1)}},Ie=async()=>{if(e){de(!0);try{let t=K.some(e=>e.sourceMode===`ai_suggestion`);await _oe(e,{selected_indices:[],replace_existing:t}),Z.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await Ae()}catch(e){Z.error(e?.message||`拆镜失败`)}finally{de(!1)}}},Le=()=>{if(!he){Z.warning(`原视频地址不存在`);return}s(!0)},Re=async t=>{if(e){if(t.durationSecondU9){Z.warning(`拆镜片段不能超过 ${U9} 秒`);return}le(!0);try{await voe(e,{start_second:t.startSecond,end_second:t.endSecond}),Z.success(`手动拆镜任务已提交`),s(!1),await Ae()}catch(e){Z.error(e?.message||`手动拆镜失败`)}finally{le(!1)}}},ze=e=>(e?.splitStatus||e?.split_status)===`completed`&&!!(e?.segmentVideoUrl||e?.segment_video_url),Be=(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)(SQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(SQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(Mle,{record:t,onPreview:Te})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=w9(t.split_status||t.splitStatus);if(n.active)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(oG,{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=C9(t.analysis_status||t.analysisStatus);return r.active?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(oG,{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)(X,{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)(X,{type:`text`,onClick:()=>Me(String(n.id),n.segmentName),disabled:!ze(n),style:{color:ze(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:ze(n)?`视频生成`:`待切割完成`}),C9(n.analysisStatus||n.analysis_status).failure&&(0,$.jsx)(X,{type:`text`,onClick:()=>De(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),w9(n.splitStatus||n.split_status).failure&&(0,$.jsx)(X,{type:`text`,onClick:()=>Oe(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(FG,{title:`确定删除此片段?`,onConfirm:()=>ke(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(X,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],[]),Ve=(0,S.useMemo)(()=>(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,background:`#fff`,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,$.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)(lQ,{columns:Be,dataSource:K,pagination:{current:te,pageSize:re,total:ae,onChange:(e,t)=>{ne(e),ie(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`}})}}})]}),[K,Be,te,re,ae]);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)(X,{icon:(0,$.jsx)(q0,{}),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(he),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:he,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)(X,{onClick:Ee,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)(oG,{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)(SQ,{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)(oG,{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)(X,{type:`default`,onClick:Le,disabled:!he||ce||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)(FG,{title:Se===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:Ie,children:(0,$.jsxs)(X,{type:`primary`,loading:ue,disabled:ue||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:Se}),(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)(kw,{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 镜头拆分方案)`})})]})})]}),Ve]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Ole,{open:o,videoUrl:he,title:`手动视频切片`,loading:ce,minDuration:H9,maxDuration:U9,onCancel:()=>s(!1),onConfirm:Re}),(0,$.jsx)(hV,{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(),Ne()},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:Ne,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:W9(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)(IQ,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(T7,{accept:`image/*`,multiple:!1,mediaType:`image`,maxImageCount:1,usedImageCount:0,onLocalSelect:e=>{e[0]&&Pe(e[0])},onHistorySelect:e=>{let t=e[0];t&&(C(t.resourceUrl||t.previewUrl||t.displayUrl||``),T(t.id),Z.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)($U,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入项目名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:50,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)(kle,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入项目描述`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:200,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)(l8,{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);let t=(()=>{let t=e.maxDuration??e.max_duration;if(t!=null)return Number(t);let n=e.supportedDurations;return Array.isArray(n)&&n.length>0?Math.max(...n):15})(),n=e.supportedDurations,r=Array.from({length:Math.max(t-4,1)},(e,t)=>t+5),i=Array.from(new Set([...n||[],...r].sort((e,t)=>e-t)));V({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:i}),e.supportedRatios?.includes(M)||N(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(P)||F(e.supportedResolutions?.[0]||`720p`),(!i.includes(A)||A>t)&&j(i.find(e=>e<=t)??i[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)(P3,{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))/(ve-Math.min(...B.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...B.durations),max:ve,value:A,onChange:e=>j(Math.min(Number(e.target.value),ve)),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:ye?`#6366f1`:`#ef4444`,fontSize:13},children:ye?``:`当前引擎不支持参考图片,请移除素材图片或切换引擎。`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(kw,{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:Ple,Text:G9}=Q,{TextArea:Fle}=$U;function Ile(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var K9=e=>e?/^https?:\/\//i.test(e)?e:`${`https://ceshi.apiforeign.minzhongzc.com`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function Lle(){let e=Ye(),{creatID:t}=$e(),[n]=On(),r=n.get(`flow_version`)===`v2`?`v2`:`v1`,{user:i,optimizeHoldCredits:a}=e7(),[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`),[te,ne]=(0,S.useState)(`480p`),[re,ie]=(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]}),[ae,q]=(0,S.useState)([]),[oe,se]=(0,S.useState)(1),[ce,le]=(0,S.useState)(20),[ue,de]=(0,S.useState)(0),[fe,pe]=(0,S.useState)(``),[me,he]=(0,S.useState)({}),[ge,_e]=(0,S.useState)([]),[ve,ye]=(0,S.useState)([]),[be,xe]=(0,S.useState)(!1),[Se,Ce]=(0,S.useState)(``),[we,Te]=(0,S.useState)(`image`),[Ee,De]=(0,S.useState)(!1),Oe=S.useRef(null);(0,S.useEffect)(()=>{if(be&&we===`video`){let e=()=>{Oe.current&&Oe.current.play().catch(()=>{})};Oe.current&&(Oe.current.readyState>=2?e():Oe.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Oe.current&&(Oe.current.removeEventListener(`loadedmetadata`,e),Oe.current.pause())}}else Oe.current&&Oe.current.pause()},[be,we]);let ke=r===`v2`,Ae=(0,S.useMemo)(()=>ke?[{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}],[ke]),je=(0,S.useMemo)(()=>Ae.map((e,t)=>({...e,status:ge[t]?.status||``,id:ge[t]?.id||t,output:ge[t]?.output||``,input:ge[t]?.input||{},engineId:ge[t]?.input?.payload?.videoConfig?.engineId||``,errorMessage:ge[t]?.errorMessage||``})),[Ae,ge]),Me=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!je.some(e=>e.status))return;let e=[...je].reverse().find(e=>e.status===`processing`);if(e){ye([String(e.childId)]),Me.current=!1;return}if(Me.current){Me.current=!1;return}let t=[...je].reverse().find(e=>e.status===`completed`&&e.childId!==1);if(t){ye([String(t.childId)]);return}ye([])},[je]);let Ne=(e,t,n)=>{L5(e,t,n).then(e=>{e.items&&q(e.items),e.total!==void 0&&de(e.total)}).catch(e=>{})},Pe=(e,t)=>{se(e),le(t),Ne(e,t,fe)},Fe=()=>{Ne(1,20,fe)};(0,S.useEffect)(()=>{Ne(oe,ce,fe)},[]),(0,S.useEffect)(()=>{T5().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];ie({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&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{Z.error(e?.message||`加载任务详情失败`)})},[t,r]),(0,S.useEffect)(()=>{let e=me?.status===`processing`||ge.some(e=>e?.status===`processing`);e&&!C.current?C.current=setInterval(Be,3e4):!e&&C.current&&(clearInterval(C.current),C.current=null)},[me?.status,ge,t,r]),(0,S.useEffect)(()=>{O5().then(e=>{l(e)}).catch(()=>{})},[]);let Ie=()=>{let e={};e=c.find(e=>e.modelConfigId===I&&e.genType===`video`&&e.resolution===te),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=me?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=ke?+!!me?.material?.materialImageUrl:me?.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)))},Le=()=>{let e=je[1]?.input?.payload?.videoConfig||je[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=me?.videoGeneration?.inputMedia?.video?.duration||0;if(o>0){let e=((i.inputVideoBaseCredits||0)+(i.inputVideoPerSecondCredits||0)*o)*(i.inputVideoRatio||1);a+=e}let s=ke?+!!me?.material?.materialImageUrl:me?.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&&Ie()},[c,I,W,te,me]);let Re=(e,t,n,r)=>{_(t||`image`),T(n?String(n):``),t===`video`?(x(r||null),y(e&&typeof e==`object`?Ile(e):{}),p(``)):(x(null),p(e||``),y({})),s(!0)},ze=async()=>{if(g===`image`){if(!me?.id||!w){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!f||!f.trim()){Z.warning(`图片提示词不能为空`);return}D(!0);try{await Toe(me.id,w,{prompt:f.trim()}),Z.success(`图片提示词已保存`),Ve(),s(!1),T(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{D(!1)}return}if(!me?.id||!w){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!v||typeof v!=`object`||Object.keys(v).length===0){Z.warning(`视频提示词不能为空`);return}if(!b){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=d9(v,b);if(e){Z.warning(e);return}D(!0);try{await(ke?Soe:Eoe)(me.id,w,{prompt_schema:v}),Z.success(`视频提示词已保存`),Ve(),s(!1),T(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{D(!1)}},Be=()=>{t&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{console.error(`轮询任务详情失败`,e)})},Ve=()=>{t&&z5(t,r).then(e=>{he(e),e.steps&&_e(e.steps)}).catch(e=>{Z.error(e?.message||`刷新任务详情失败`)})},He=(e,t,n=!1)=>{Ce(e),Te(t),De(n),xe(!0)},Ue=()=>{xe(!1),Ce(``),Oe.current&&Oe.current.pause()},We=e=>{if(e.preventDefault(),e.stopPropagation(),!Se)return;let t=document.createElement(`a`);t.href=`https://ceshi.apiforeign.minzhongzc.com${Se}&download=1`,t.download=we===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Ge=e=>{woe(me.id,e.toString()).then(e=>{Z.info(`正在生成图片提示词,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ke=e=>{let t={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(me.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},qe=()=>{let e={engine_id:R,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};B5(me.id,je[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Je=e=>{let t={engine_id:I,duration:W,aspect_ratio:K,resolution:te,target_platform:`抖音`};Doe(me.id,e.toString(),t).then(e=>{Z.info(`正在生成视频提示词,请稍候...`),Ve()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Xe=async(e,t)=>{try{ke?await Coe(me.id,String(e)):await Ooe(me.id,String(e),{engine_id:t||``}),Z.info(`正在生成视频,请稍候...`),Ve()}catch(e){let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)}},Ze=async()=>{let e=ke?je[1]:je[3];e?.id&&await Xe(e.id,e.engineId||``)},Qe=async e=>{if(!(!ke||!me?.id||!e||!I)){N(!0);try{await xoe(me.id,e,{video_config:{engine_id:I,duration:W,aspect_ratio:K,resolution:te}}),Z.info(`正在按新视频参数重新生成视频提示词,请稍候...`),Ve()}catch(e){Z.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)(X,{icon:(0,$.jsx)(q0,{}),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)(X,{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:me?.material?.materialVideoUrl?`pointer`:`default`,position:`relative`},onClick:()=>me?.material?.materialVideoUrl&&He(me.material.materialVideoUrl,`video`),children:me?.material?.materialVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:K9(me.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:me?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>me?.material?.materialImageUrl&&He(me.material.materialImageUrl,`image`),children:me?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:K9(me.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:`暂无图片`})})]})]}),me?.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:()=>He(me.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),me?.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:()=>He(me.finalVideoUrl,`video`,!0),children:[(0,$.jsx)(`video`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.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)(o_,{activeKey:ve,onChange:ye,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:je.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)(B2,{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)(G9,{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:me?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:K9(me.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)(G9,{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:me?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:K9(me.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:je[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:je[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:je[0]?.input?.payload?.coreContentPoint||`-`})]})]}),!ke&&(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)Re(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)(X,{onClick:()=>{Me.current=!0,ye(t=>t.filter(t=>t!==String(e.childId))),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:[me.finalImageUrl?(0,$.jsx)(`img`,{src:`https://ceshi.apiforeign.minzhongzc.com${me.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)(X,{type:`default`,icon:(0,$.jsx)(i$,{}),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:`重新生成`})]}),(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)(l8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(G9,{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)(G9,{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),ie({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(te)||ne(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:()=>{let e=je[1]?.input?.payload?.videoConfig||je[1]?.input?.payload?.video_config;if(e){let t=e?.engineId||e?.engine_id,n=P.video?.find(e=>String(e.id)===String(t));n&&(L(n.id),ie({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]})),ee(e?.aspectRatio||e?.aspect_ratio||`16:9`),ne(e?.resolution||`480p`),G(e?.duration||5)}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)(P3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(G9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[K,` · `,W,`s · `,te]})]}),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)(G9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:re.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)(G9,{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(...re.durations))/(Math.max(...re.durations)-Math.min(...re.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...re.durations),max:Math.max(...re.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)(G9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:re.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ne(e),style:{flex:1,height:42,borderRadius:6,border:te===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:te===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:te===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)t.filter(t=>t!==String(e.childId))),Je(e.id)},disabled:e.status!==`completed`||(i?.credits||0){let e=je[1]?.input?.payload?.videoConfig||je[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)(wV,{style:{marginTop:16,gap:12,width:`100%`,flexWrap:`wrap`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(i$,{}),onClick:()=>Re(me?.videoGeneration?.promptSchema,`video`,e.id,me?.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`||!me?.videoGeneration?.promptSchema||!me?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),ke&&(0,$.jsx)(kw,{title:(i?.credits||0){if((i?.credits||0)String(t.id)===String(e));n&&(L(n.id),ie({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]})),ee(t?.aspectRatio||t?.aspect_ratio||`16:9`),ne(t?.resolution||`480p`),G(t?.duration||5)}j(String(e.id)),k(!0)},style:{flex:`0 0 auto`,minWidth:160,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},disabled:e.status===`processing`||je[2]?.status===`processing`||(i?.credits||0){let t=Le();if((i?.credits||0)t.filter(t=>t!==String(e.childId))),Xe(e.id,e.engineId)},type:`primary`,style:{flex:`1 0 auto`,minWidth:140,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`||(i?.credits||0){let e=Le();if((i?.credits||0){let e=`https://ceshi.apiforeign.minzhongzc.com${me?.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)(jG,{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)(zC,{value:I,onChange:e=>{let t=P.video?.find(t=>t.id===e);t&&(L(t.id),ie({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(te)||ne(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:re.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(...re.durations))/(Math.max(...re.durations)-Math.min(...re.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...re.durations),max:Math.max(...re.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:re.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>ne(e),style:{flex:1,height:42,borderRadius:8,border:te===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:te===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:te===e?`#fff`:`#4b5563`},children:e})},e))})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:16},children:[(0,$.jsx)(X,{onClick:()=>k(!1),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500},children:`取消`}),(0,$.jsx)(X,{onClick:()=>{if(!I){Z.warning(`请选择视频引擎`);return}Qe(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)(jG,{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)(X,{onClick:()=>s(!1),disabled:E,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:ze,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)(Fle,{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)(v9,{value:v,schemaConfigSnapshot:b,onChange:y})})}),(0,$.jsxs)(jG,{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)($U,{placeholder:`搜索产品名称`,value:fe,onChange:e=>pe(e.target.value),onPressEnter:Fe,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(X,{type:`primary`,onClick:Fe,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)(lQ,{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)(X,{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:ae,rowKey:`id`,pagination:{current:oe,pageSize:ce,total:ue,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:Pe,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)(jG,{open:be,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:Ue,width:800,footer:Ee?(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)(X,{type:`primary`,icon:(0,$.jsx)(B1,{}),onClick:We,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}):null,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:we===`image`?(0,$.jsx)(`img`,{src:Se.startsWith(`http`)?Se:`https://ceshi.apiforeign.minzhongzc.com${Se}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Oe,src:Se.startsWith(`http`)?Se:`https://ceshi.apiforeign.minzhongzc.com${Se}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var Rle=({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 zle(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 Ble=()=>{let e=Ye(),[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)(()=>{Koe().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),G5(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{Voe(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)(kV,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)($6,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(kV,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(o8,{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)(X0,{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)(X0,{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)(sL,{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)(z8,{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:zle(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(sL,{activeKey:l,onChange:e=>{u(e),G5(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)(Rle,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(jG,{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)(z8,{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)(T6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(n2,{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)(X,{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:Vle}=MB,q9={borderRadius:8,fontWeight:600},J9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Hle=()=>{let e=Ye(),[t]=On(),{message:n}=ex.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,VE.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 Loe({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 U5()).data||[]).map(e=>({name:J9(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=()=>{jG.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(MB,{value:(0,VE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,VE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)($U,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await Roe({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)(X,{type:`text`,icon:(0,$.jsx)(q0,{}),onClick:F}),(0,$.jsx)(T4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.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)($U,{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)(Vle,{value:E?[(0,VE.default)(E[0]),(0,VE.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)(X,{type:`primary`,onClick:I,style:{...q9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(Wie,{}),onClick:L,loading:l,style:q9,children:`拉取消耗`}),(0,$.jsx)(X,{icon:(0,$.jsx)(l8,{}),onClick:()=>f(!0),style:{...q9,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)(lQ,{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)(zW,{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)(jG,{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)($U,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(Q.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)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(aR,{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)(aR,{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)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(X,{size:`small`,onClick:async()=>{try{let e=((await U5()).data||[]).map(e=>({name:J9(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)(Q.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)(Q.Text,{children:n?.description||e}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Ule=()=>{let e=Ye(),[t]=On(),{message:n}=ex.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 doe(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)(Q.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(Q.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)(oG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(TB,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(VK,{}),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)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(VK,{}),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)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(TB,{style:{color:`#6366f1`}}),(0,$.jsxs)(Q.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},Wle=()=>(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)(p2,{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)(xie,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(Q.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)(j8,{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)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.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)(U3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(X0,{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)(jU,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(L3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(s4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),Gle=()=>{let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(`image`),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`all`),u=(e,n)=>{r(e),a(n),t(!0)},d=(e,t)=>{let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},f=[{value:`all`,label:`全部行业`},{value:`fashion`,label:`时尚穿搭`},{value:`food`,label:`美食探店`},{value:`travel`,label:`旅行风景`},{value:`tech`,label:`数码科技`},{value:`beauty`,label:`美妆护肤`},{value:`home`,label:`家居生活`},{value:`母婴`,label:`母婴亲子`}],p=[{id:1,type:`image`,url:`https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?w=400&q=80`,title:`时尚街拍`,tag:`热门`,industry:`fashion`,aspectRatio:1.3},{id:2,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?w=400&q=80`,title:`自然风景`,tag:`推荐`,industry:`travel`,aspectRatio:1.5},{id:3,type:`image`,url:`https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=400&q=80`,title:`湖光山色`,tag:`热门`,industry:`travel`,aspectRatio:.75},{id:4,type:`image`,url:`https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&q=80`,title:`山脉风光`,tag:`新品`,industry:`travel`,aspectRatio:1.4},{id:5,type:`video`,url:`https://www.w3schools.com/html/movie.mp4`,poster:`https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=400&q=80`,title:`森林探索`,tag:`推荐`,industry:`travel`,aspectRatio:.67},{id:6,type:`image`,url:`https://images.unsplash.com/photo-1470770841072-f978cf4d019e?w=400&q=80`,title:`山间湖泊`,tag:`热门`,industry:`travel`,aspectRatio:1.7},{id:7,type:`image`,url:`https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=400&q=80`,title:`海岸风光`,tag:`推荐`,industry:`travel`,aspectRatio:.8},{id:8,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=400&q=80`,title:`城市夜景`,tag:`新品`,industry:`travel`,aspectRatio:1.33},{id:9,type:`image`,url:`https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=400&q=80`,title:`森林小径`,tag:`热门`,industry:`travel`,aspectRatio:1.5},{id:10,type:`image`,url:`https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=400&q=80`,title:`美食摆盘`,tag:`热门`,industry:`food`,aspectRatio:1.2},{id:11,type:`image`,url:`https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?w=400&q=80`,title:`时尚穿搭`,tag:`推荐`,industry:`fashion`,aspectRatio:1},{id:12,type:`video`,url:`https://www.w3schools.com/html/mov_bbb.mp4`,poster:`https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=400&q=80`,title:`数码产品`,tag:`新品`,industry:`tech`,aspectRatio:1.4}],m=(0,S.useMemo)(()=>p.filter(e=>{let t=o?e.title.toLowerCase().includes(o.toLowerCase()):!0,n=c===`all`?!0:e.industry===c;return t&&n}),[o,c]),h=e=>{u((e.type,e.url),e.type)};return(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)(i3,{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)(g4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(Q.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,$.jsxs)(`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)(x8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(zC,{value:c,onChange:e=>l(e),style:{width:140},options:f}),(0,$.jsx)($U.Search,{placeholder:`搜索行业案例`,allowClear:!0,enterButton:(0,$.jsx)(PC,{}),size:`middle`,value:o,onChange:e=>s(e.target.value),onSearch:e=>s(e),style:{width:240}})]})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16,color:`#64748b`,fontSize:13},children:[`共找到 `,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:m.length}),` 个案例`]}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{columnCount:5,columnGap:12,marginBottom:16},children:m.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{breakInside:`avoid`,marginBottom:12,borderRadius:10,overflow:`hidden`,cursor:`pointer`,position:`relative`,boxShadow:`0 4px 12px rgba(0, 0, 0, 0.08)`,transition:`transform 0.3s ease, box-shadow 0.3s ease`,animation:`fadeInUp 0.5s ease ${t*.1}s both`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-4px)`,e.currentTarget.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 12px rgba(0, 0, 0, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,paddingBottom:`${1/e.aspectRatio*100}%`,backgroundColor:`#f3f4f6`},children:[e.type===`image`?(0,$.jsx)(`img`,{src:e.url,alt:e.title,style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:e.poster,alt:e.title,style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:48,height:48,borderRadius:`50%`,background:`rgba(0, 0, 0, 0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(K6,{style:{fontSize:32,color:`#fff`}})})]}),(0,$.jsxs)(`div`,{style:{position:`absolute`,top:12,left:12,padding:`4px 8px`,borderRadius:6,background:`rgba(0, 0, 0, 0.6)`,backdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,gap:4},children:[e.type===`image`?(0,$.jsx)(L6,{style:{fontSize:12,color:`#fff`}}):(0,$.jsx)(z8,{style:{fontSize:12,color:`#fff`}}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#fff`,fontWeight:500},children:e.type===`image`?`图片`:`视频`})]})]}),(0,$.jsx)(`div`,{style:{padding:12,background:`#fff`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#1f2937`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,marginRight:8},children:e.title}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#fff`,padding:`2px 8px`,borderRadius:4,background:e.tag===`热门`?`#ef4444`:e.tag===`推荐`?`#6366f1`:`#f59e0b`,whiteSpace:`nowrap`},children:e.tag})]})})]},e.id))}),m.length===0&&(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 20px`,color:`#94a3b8`},children:[(0,$.jsx)(PC,{style:{fontSize:48,marginBottom:16,opacity:.5}}),(0,$.jsx)(`div`,{style:{fontSize:15},children:`暂无符合条件的案例`}),(0,$.jsx)(`div`,{style:{fontSize:13,marginTop:8},children:`请尝试调整搜索关键词或行业筛选`}),(0,$.jsx)(X,{style:{marginTop:16,borderRadius:8},onClick:()=>{s(``),l(`all`)},children:`重置筛选`})]})]}),(0,$.jsx)(jG,{open:e,onCancel:()=>t(!1),footer:[(0,$.jsx)(X,{icon:(0,$.jsx)(B1,{}),onClick:()=>d(n,i===`image`?`image.jpg`:`video.mp4`),type:`primary`,style:{borderRadius:8},children:`下载`},`download`)],width:800,centered:!0,styles:{body:{padding:0}},children:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:400,borderRadius:8,overflow:`hidden`},children:i===`image`?(0,$.jsx)(`img`,{src:n,alt:`预览`,style:{maxWidth:`100%`,maxHeight:`60vh`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:n,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:`60vh`,objectFit:`contain`}})})})]})},{RangePicker:Kle}=MB;function Y9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var qle={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},Jle=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await sse())}catch(e){Z.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 cse(d);o(e.items||[]),c(e.total||0)}catch(e){Z.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=vH.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){Z.error(`请输入有效的正数积分数量`);return}v(!0),await lse(m.member.id,t,e.direction||`increase`,e.description),Z.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),he()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=vH.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await use()||[])}catch(e){Z.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await dse(e.maxUses||null,null),Z.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await fse(e),Z.success(`已撤销`),A()}catch(e){Z.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Z.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`),Z.success(`邀请链接已复制`)}catch{Z.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 pse(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,jG.confirm({title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(g2,{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&&Z.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Z.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 mse(e,t,n),Z.success(t===`approve`?`已通过`:`已拒绝`),G(z),p()}catch(e){Z.error(e?.message||`操作失败`)}},[ee,te]=(0,S.useState)([]),[ne,re]=(0,S.useState)(0),[ie,ae]=(0,S.useState)(null),[q,oe]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(``),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)(()=>{let e=(0,VE.default)().format(`YYYY-MM-DD`);return[e,e]}),he=(0,S.useCallback)(async()=>{oe(!0);try{let e=await vse({page:se,pageSize:10,phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0});te(e.items||[]),re(e.total||0),ae(e.summary||null)}catch(e){Z.error(e?.message||`加载积分记录失败`)}finally{oe(!1)}},[se,le,de,pe]);(0,S.useEffect)(()=>{he()},[he]);let ge=()=>{ue(``),fe(``);let e=(0,VE.default)().format(`YYYY-MM-DD`);me([e,e]),ce(1)},_e=()=>{let e=yse({phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[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,VE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Z.error(`导出失败`))},ve=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(Q.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(SQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>Y9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=e7.getState().user?.id;return t.id===n?(0,$.jsx)(kw,{title:`不能给自己调整积分`,children:(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ye=e=>`${window.location.origin}/join-team?code=${e}`,be=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(Q.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ye(e);return(0,$.jsxs)(wV,{style:{width:`100%`},children:[(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(kw,{title:`复制链接`,children:(0,$.jsx)(X,{size:`small`,type:`text`,icon:(0,$.jsx)(D$,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(SQ,{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?Y9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(X,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],xe=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(SQ,{color:t.color,children:t.text})},Se=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>xe(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>Y9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?Y9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(wV,{size:4,children:[(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(OC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>K(t.id,`approve`),children:`通过`}),(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(ju,{}),danger:!0,style:{padding:0},onClick:()=>{jG.confirm({title:`拒绝申请`,content:(0,$.jsx)(vH,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(vH.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)($U.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:`已处理`})}],Ce=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=qle[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(SQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(Q.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=>Y9(e)}],we={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},Te={padding:`16px`,textAlign:`right`},Ee=[{key:`members`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(L8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(lQ,{columns:ve,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(lC,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(zW,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(V8,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(zC,{value:le||void 0,onChange:e=>{ue(e||``),ce(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)($U,{placeholder:`搜索手机号`,value:de,onChange:e=>{fe(e.target.value),ce(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(Kle,{value:pe?[(0,VE.default)(pe[0]),(0,VE.default)(pe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?me([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):me(null),ce(1)}}),(0,$.jsx)(X,{onClick:ge,children:`重置`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(B1,{}),onClick:_e,children:`导出 Excel`})]}),(0,$.jsxs)(`div`,{style:{marginBottom:12,padding:`12px 18px`,background:`#f8f9fc`,borderRadius:10,display:`flex`,gap:28,flexWrap:`wrap`,fontSize:13,alignItems:`center`},children:[(0,$.jsxs)(`span`,{children:[`总净消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:16,marginLeft:4},children:ie?.netConsume??0})]}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`|`}),(0,$.jsxs)(`span`,{children:[`消费合计:`,(0,$.jsx)(`strong`,{style:{color:`#f97316`,marginLeft:4},children:ie?.totalConsume??0})]}),(0,$.jsxs)(`span`,{children:[`退款合计:`,(0,$.jsxs)(`strong`,{style:{color:`#10b981`,marginLeft:4},children:[`− `,ie?.totalRefund??0]})]}),(0,$.jsxs)(`span`,{children:[`充值合计:`,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`,marginLeft:4},children:[`+ `,ie?.totalRecharge??0]})]})]}),(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(lQ,{rowKey:`id`,loading:q,dataSource:ee,pagination:!1,bordered:!1,scroll:{x:950},columns:Ce,locale:{emptyText:(0,$.jsx)(lC,{description:`暂无积分记录`})}}),ne>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(zW,{current:se,pageSize:10,total:ne,onChange:e=>ce(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(D$,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(lQ,{columns:be,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(lC,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(wV,{children:[(0,$.jsx)(g3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(SQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(TR,{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:we,children:(0,$.jsx)(lQ,{columns:Se,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(lC,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(Q.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)(Q.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(Q.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(X,{icon:(0,$.jsx)(VK,{}),onClick:()=>{i(),p(),A(),G(z),he()},children:`刷新`})]}):(0,$.jsx)(Q.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(sL,{items:Ee,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(L8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(vH,{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)(Q.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:e7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(vH.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(LF.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(LF.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(LF.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(vH.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)(fz,{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)(vH.Item,{name:`description`,label:`备注`,children:(0,$.jsx)($U.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(D$,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(vH,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(vH.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(fz,{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)(TB,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},Yle=()=>{let[e]=On(),t=Ye(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=e7(),[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(),h5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?hse(n):gse(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)(oG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`success`,icon:(0,$.jsx)(B2,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(dq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(wV,{children:(0,$.jsx)(X,{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)(D8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(lL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(T8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(Q.Title,{level:3,children:`加入团队`}),(0,$.jsx)(Q.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(Q.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(wV,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)(K3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(X,{size:`large`,block:!0,icon:(0,$.jsx)(iae,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(jG,{title:(0,$.jsxs)(wV,{children:[(0,$.jsx)(T8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await _se(n),p(!0),h(!1),Z.success(`申请已提交`)}catch(e){Z.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:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},Xle=new Set([`group_active`,`callback_success`]),Zle=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=Xle.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(lL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(dq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(X,{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{Z.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Z.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})},Qle=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u]=vH.useForm(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(new Map),[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)(!1),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(0),[A,j]=(0,S.useState)(1),[M]=(0,S.useState)(10),[N,P]=(0,S.useState)([null,null]),[F,I]=(0,S.useState)([null,null]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(!1),[V,H]=(0,S.useState)(!1),[U,W]=(0,S.useState)(null),G=async(e=A)=>{T(!0);try{let t=await S5(e,M,{invoiceMode:!0,startDate:N[0]||void 0,endDate:N[1]||void 0});D((t.items||[]).map(e=>({...e,_occupied:!!e.isOccupied,_occupiedBy:e.occupiedBy}))),k(t.total||0)}catch{D([]),k(0)}T(!1)},[K,ee]=(0,S.useState)(1),[te]=(0,S.useState)(10),[ne,re]=(0,S.useState)(0),ie=async()=>{r(!0);try{let e=await Yae({page:K,pageSize:te});t((e.items||[]).map(e=>({id:e.id,orderNo:e.invoiceNo,orderType:e.headerType===`company`?`企业`:`个人`,amount:e.totalAmount,createdAt:e.createdAt,status:e.status===`success`?`issued`:e.status===`failed`?`rejected`:`processing`,headerName:e.headerName,headerType:e.headerType,headerTaxNo:e.headerTaxNo,selectedOrders:e.orders||[],email:e.email,failureReason:e.failureReason}))),re(e.total||0)}catch{}r(!1)};(0,S.useEffect)(()=>{ie(),ce()},[]),(0,S.useEffect)(()=>{K>1&&ie()},[K]),(0,S.useEffect)(()=>{d&&(j(1),G(1))},[d]);let ae=[{title:`发票编号`,dataIndex:`orderNo`,key:`orderNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:e})},{title:`发票类型`,dataIndex:`orderType`,key:`orderType`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:`#374151`},children:e})},{title:`总金额`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,e.toFixed(2)]})},{title:`开具时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>e?(0,$.jsx)(`span`,{style:{color:`#64748b`},children:new Date(e).toLocaleString(`zh-CN`)}):`-`},{title:`发票状态`,dataIndex:`status`,key:`status`,width:120,render:e=>{let t={pending:{color:`#f59e0b`,label:`待开具`,bg:`rgba(245,158,11,0.1)`},processing:{color:`#0ea5e9`,label:`开具中`,bg:`rgba(14,165,233,0.1)`},issued:{color:`#10b981`,label:`已开具`,bg:`rgba(16,185,129,0.1)`},rejected:{color:`#ef4444`,label:`已驳回`,bg:`rgba(239,68,68,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(SQ,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`操作`,key:`action`,width:120,render:(e,t)=>(0,$.jsx)(X,{type:`link`,size:`small`,onClick:()=>{W(t),H(!0)},children:`详情`})}],q=[{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)(F0,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(W8,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,typeof n==`number`?n.toFixed(2):n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(Q.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:120,render:(e,t)=>{if(t._occupied)return(0,$.jsx)(SQ,{color:`orange`,style:{fontWeight:500,padding:`4px 12px`},title:t._occupiedBy?`发票号:${t._occupiedBy}`:void 0,children:`已申请开票`});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)(SQ,{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`):`-`}}],oe=[{title:`发票抬头`,dataIndex:`name`,key:`name`,render:e=>(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:e})},{title:`发票抬头类型`,dataIndex:`type`,key:`type`,width:140,render:e=>(0,$.jsx)(`span`,{style:{color:`#475569`},children:e===`company`?`企业`:`个人`})},{title:`纳税号`,dataIndex:`taxNo`,key:`taxNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{color:`#64748b`},children:e||`-`})},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>e?(0,$.jsx)(SQ,{color:`#f59e0b`,style:{background:`rgba(245,158,11,0.1)`,color:`#d97706`},children:`默认`}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`-`})},{title:`操作`,key:`action`,width:120,render:(e,t)=>(0,$.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[!t.isDefault&&(0,$.jsx)(X,{type:`link`,size:`small`,onClick:()=>de(t.id),children:`设为默认`}),(0,$.jsx)(X,{type:`link`,size:`small`,danger:!0,onClick:()=>ue(t.id),children:`删除`})]})}],se=i,ce=async()=>{try{a(((await Xae()).items||[]).map(e=>({id:e.id,name:e.name,type:e.type,taxNo:e.taxNo,registerAddress:e.registerAddress,bankName:e.bankName,registerPhone:e.registerPhone,bankAccount:e.bankAccount,email:e.email,isDefault:e.isDefault})))}catch{}},le=async()=>{try{let e=await u.validateFields(),t=e.type===`company`,n=e.isDefault===`yes`||i.length===0&&!i.some(e=>e.isDefault);await Zae({type:e.type,name:e.name,taxNo:t?e.taxNo:void 0,registerAddress:t?e.registerAddress:void 0,bankName:t?e.bankName:void 0,registerPhone:t?e.registerPhone:void 0,bankAccount:t?e.bankAccount:void 0,email:e.email,isDefault:n}),u.resetFields(),l(!1),Z.success(`发票抬头添加成功`),ce()}catch(e){if(e?.errorFields)Z.warning(`请完善表单信息`);else{let t=e?.message||e?.response?.data?.detail||`添加失败`;Z.error(t)}}},ue=e=>{jG.confirm({title:`删除发票抬头`,content:`确定要删除该发票抬头吗?`,okText:`确定`,cancelText:`取消`,onOk:async()=>{try{await Qae(e),Z.success(`删除成功`),ce()}catch(e){Z.error(e?.message||`删除失败`)}}})},de=async e=>{try{await $ae(e),Z.success(`已设为默认`),ce()}catch(e){Z.error(e?.message||`设置失败`)}},fe=()=>{if(p.size===0){Z.warning(`请至少选择一个订单`);return}f(!1);let e=se.find(e=>e.isDefault);v(e?.id||se[0]?.id||null),b(e?.email||se[0]?.email||``),g(!0)},pe=async()=>{if(!_){Z.warning(`请选择一个发票抬头`);return}let e=se.find(e=>e.id===_),t=(e?.email||``).trim();if(!t){Z.warning(`该发票抬头未填写邮箱,请先在抬头管理中设置邮箱`);return}let n=Array.from(p.values()).map(e=>e.id||e.orderNo||e.order_no).filter(Boolean);if(n.length===0){Z.warning(`请至少选择一个订单`);return}C(!0);try{await Jae({headerType:e?.type,headerName:e?.name||``,headerTaxNo:e?.taxNo,headerRegisterAddress:e?.registerAddress,headerRegisterPhone:e?.registerPhone,headerBankName:e?.bankName,headerBankAccount:e?.bankAccount,email:t,orderIds:n}),Z.success(`开票申请已提交,请等待审核`),g(!1),m(new Map),v(null),b(``),ie()}catch(e){let t=e?.message||e?.response?.data?.detail||`提交失败,请稍后重试`;Z.error(t)}C(!1)},me={selectedRowKeys:Array.from(p.keys()),onChange:(e,t)=>{let n=new Map(p);E.map(e=>e.order_no||e.orderNo||e.id).forEach(e=>n.delete(e)),e.forEach(e=>{let r=t.find(t=>(t.order_no||t.orderNo||t.id)===e);r&&!r._occupied&&n.set(e,r)}),m(n)},preserveSelectedRowKeys:!0,getCheckboxProps:e=>({name:e.order_no||e.orderNo||e.id,disabled:!!e._occupied})},he=Array.from(p.values()).reduce((e,t)=>e+(t.amount||t.total_amount||0),0),ge=p.size;return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,borderRadius:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(kV,{style:{color:`#6366f1`,fontSize:20}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#1e293b`},children:`申请开票`})]}),(0,$.jsxs)(wV,{children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>f(!0),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:10,fontWeight:500},children:`开票`}),(0,$.jsx)(X,{icon:(0,$.jsx)(jI,{}),onClick:()=>s(!0),style:{borderColor:`#e2e8f0`,borderRadius:10,fontWeight:500},children:`管理发票抬头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#f8fafc`,borderRadius:12,padding:`16px 20px`,marginBottom:24,border:`1px solid #f1f5f9`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#475569`,display:`block`,marginBottom:8},children:`特别说明:`}),(0,$.jsxs)(`div`,{style:{color:`#64748b`,fontSize:13,lineHeight:2},children:[(0,$.jsxs)(`div`,{children:[`◎ 为落实中办、国办印发的《关于进一步深化税收征管改革的意见》要求,继续加大全面数字化的电子发票(以下简称数电发票)推广使用力度,我们将提供数电发票开具。详细情况可阅读`,(0,$.jsx)(`a`,{onClick:e=>{e.preventDefault(),B(!0)},style:{color:`#6366f1`,cursor:`pointer`},children:`《全面数字化电子发票说明》`}),`。`]}),(0,$.jsx)(`div`,{children:`◎ 下单1小时后方可申请开票!`}),(0,$.jsxs)(`div`,{children:[`◎ 为提高开票效率,请仔细阅读`,(0,$.jsx)(`a`,{onClick:e=>{e.preventDefault(),R(!0)},style:{color:`#6366f1`,cursor:`pointer`},children:`《开票须知》`}),`。`]})]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:n?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:60},children:`加载中...`}):e.length===0?(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无申请开票记录`}),style:{padding:`60px 0`}}):(0,$.jsx)(lQ,{dataSource:e,columns:ae,rowKey:`id`,pagination:{current:K,pageSize:te,total:ne,onChange:e=>{ee(e)}},bordered:!1})}),(0,$.jsx)(jG,{title:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`发票详情`}),open:V,onCancel:()=>{H(!1),W(null)},width:720,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>{H(!1),W(null)},children:`关闭`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:U&&(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:`发票信息`}),(0,$.jsx)(`div`,{style:{background:`#f8fafc`,borderRadius:10,padding:`16px 20px`},children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr 100px 1fr`,gap:`12px 16px`,fontSize:13},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票编号:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontFamily:`monospace`},children:U.orderNo}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`开票时间:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.createTime}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票金额:`}),(0,$.jsxs)(`span`,{style:{color:`#ef4444`,fontWeight:600},children:[`¥`,U.amount.toFixed(2)]}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`发票状态:`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(SQ,{color:U.status===`pending`?`#f59e0b`:U.status===`processing`?`#0ea5e9`:U.status===`issued`?`#10b981`:`#ef4444`,style:{background:U.status===`pending`?`rgba(245,158,11,0.1)`:U.status===`processing`?`rgba(14,165,233,0.1)`:U.status===`issued`?`rgba(16,185,129,0.1)`:`rgba(239,68,68,0.1)`,color:U.status===`pending`?`#d97706`:U.status===`processing`?`#0284c7`:U.status===`issued`?`#059669`:`#dc2626`,fontWeight:500,padding:`4px 12px`},children:U.status===`pending`?`待开具`:U.status===`processing`?`开具中`:U.status===`issued`?`已开具`:`已驳回`})}),U.email&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`接收邮箱:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.email})]}),U.failureReason&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`失败原因:`}),(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:U.failureReason})]})]})})]}),U.headerName&&(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:`发票抬头`}),(0,$.jsx)(`div`,{style:{background:`#f8fafc`,borderRadius:10,padding:`16px 20px`},children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr`,gap:`12px 16px`,fontSize:13},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`抬头类型:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.headerType===`company`?`企业`:`个人`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`抬头名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`},children:U.headerName}),U.headerTaxNo&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`纳税人识别号:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontFamily:`monospace`},children:U.headerTaxNo})]})]})})]}),U.selectedOrders&&U.selectedOrders.length>0&&(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,display:`block`,marginBottom:12},children:[`订单明细(共 `,U.selectedOrders.length,` 笔)`]}),(0,$.jsx)(lQ,{dataSource:U.selectedOrders,columns:[{title:`订单号`,key:`orderNo`,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:12,color:`#64748b`},children:t.order_no||t.orderNo||t.orderNo||t.id})},{title:`金额`,key:`amount`,align:`right`,render:(e,t)=>(0,$.jsxs)(`span`,{style:{fontWeight:600,color:`#1e293b`},children:[`¥`,(t.amount||t.total_amount||0).toFixed(2)]})}],rowKey:e=>e.order_no||e.orderNo||e.id,pagination:!1,bordered:!1,size:`small`})]})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,paddingRight:30},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`选择订单`}),(0,$.jsxs)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:[`已选 `,ge,` 项,合计 ¥`,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:he.toFixed(2)})]})]}),open:d,onCancel:()=>{f(!1),m(new Map)},width:`70%`,footer:[(0,$.jsx)(X,{onClick:()=>{f(!1),m(new Map)},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:fe,children:`确定`},`confirm`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`0 24px 24px`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`12px 0`,borderBottom:`1px solid #f1f5f9`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`支付时间:`}),(0,$.jsx)(MB.RangePicker,{size:`small`,value:F,onChange:e=>{I(e),e&&e[0]&&e[1]?P([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):P([null,null]),j(1),setTimeout(()=>G(1),0)},allowClear:!0,placeholder:[`开始日期`,`结束日期`],style:{width:280}})]}),(0,$.jsx)(oG,{spinning:w,children:E.length===0?(0,$.jsx)(lC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无符合条件的订单`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(lQ,{dataSource:E,columns:q,scroll:{y:500},rowKey:e=>e.order_no||e.orderNo||e.id,rowSelection:me,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(zW,{current:A,pageSize:M,total:O,onChange:e=>{j(e),G(e)},size:`small`})})]})})]})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,paddingRight:30},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`选择发票抬头`}),(0,$.jsxs)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:[`开票金额:¥`,(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontWeight:600},children:he.toFixed(2)})]})]}),open:h,onCancel:()=>{g(!1),v(null),m(new Map),b(``)},width:820,footer:[(0,$.jsx)(X,{onClick:()=>{g(!1),v(null),m(new Map),b(``)},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,loading:x,onClick:pe,children:`确定`},`confirm`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`0 24px 24px`},children:(0,$.jsx)(lQ,{dataSource:se,columns:[{title:`选择`,key:`select`,width:60,render:(e,t)=>(0,$.jsx)(LF,{checked:_===t.id,onChange:()=>{v(t.id),t.email&&!y&&b(t.email)}})},{title:`发票抬头`,dataIndex:`name`,key:`name`,render:e=>(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:e})},{title:`抬头类型`,dataIndex:`type`,key:`type`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:`#475569`},children:e===`company`?`企业`:`个人`})},{title:`纳税人识别号`,dataIndex:`taxNo`,key:`taxNo`,width:200,render:e=>(0,$.jsx)(`span`,{style:{color:`#64748b`},children:e||`-`})},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>e?(0,$.jsx)(SQ,{color:`#f59e0b`,style:{background:`rgba(245,158,11,0.1)`,color:`#d97706`},children:`默认`}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`-`})}],rowKey:`id`,pagination:!1,bordered:!1})})}),(0,$.jsx)(jG,{title:(0,$.jsxs)(`div`,{style:{padding:`16px 20px`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`我的发票抬头`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>l(!0),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:8,fontWeight:500},children:`添加常用发票抬头`})]}),open:o,onCancel:()=>s(!1),width:900,footer:null,centered:!0,styles:{body:{}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`0 24px 24px`,height:`500px`,marginTop:8},children:i.length===0?(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无发票抬头,请点击「添加常用发票抬头」添加`}),style:{padding:`60px 0`}}):(0,$.jsx)(lQ,{dataSource:i,columns:oe,rowKey:`id`,pagination:!1,bordered:!1})})}),(0,$.jsx)(jG,{title:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1e293b`},children:`我的发票抬头`}),open:c,onCancel:()=>{l(!1),u.resetFields()},width:640,footer:null,centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsx)(`div`,{style:{padding:`20px 24px 24px`},children:(0,$.jsxs)(vH,{form:u,layout:`horizontal`,initialValues:{type:`company`,isDefault:`no`},labelCol:{style:{width:90,textAlign:`right`,marginRight:12,whiteSpace:`nowrap`}},wrapperCol:{style:{flex:1}},children:[(0,$.jsx)(vH.Item,{name:`type`,label:`抬头类型:`,rules:[{required:!0,message:`请选择抬头类型`}],children:(0,$.jsxs)(LF.Group,{children:[(0,$.jsx)(LF,{value:`company`,children:`企业`}),(0,$.jsx)(LF,{value:`personal`,children:`个人`})]})}),(0,$.jsx)(vH.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.type!==t.type,children:()=>{let e=u.getFieldValue(`type`)===`company`;return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`0 16px`},children:[(0,$.jsx)(vH.Item,{name:`name`,label:e?`公司名称:`:`个人姓名:`,rules:[{required:!0,message:e?`请输入公司名称`:`请输入个人姓名`}],children:(0,$.jsx)($U,{placeholder:e?`请输入公司名称`:`请输入个人姓名`})}),e&&(0,$.jsx)(vH.Item,{name:`taxNo`,label:`公司税号:`,rules:[{required:!0,message:`请输入公司税号`}],children:(0,$.jsx)($U,{placeholder:`请输入公司税号`})}),e&&(0,$.jsx)(vH.Item,{name:`registerAddress`,label:`注册地址:`,children:(0,$.jsx)($U,{placeholder:`请输入注册地址`})}),e&&(0,$.jsx)(vH.Item,{name:`bankName`,label:`开户银行:`,children:(0,$.jsx)($U,{placeholder:`请输入开户银行`})}),e&&(0,$.jsx)(vH.Item,{name:`registerPhone`,label:`注册电话:`,children:(0,$.jsx)($U,{placeholder:`请输入注册电话`})}),e&&(0,$.jsx)(vH.Item,{name:`bankAccount`,label:`银行账号:`,children:(0,$.jsx)($U,{placeholder:`请输入银行账号`})}),(0,$.jsx)(vH.Item,{name:`email`,label:`接收邮箱:`,rules:[{required:!0,message:`请输入接收邮箱`},{pattern:/^[\w.\-]+@[\w.\-]+\.\w+$/,message:`请输入正确的邮箱格式`}],children:(0,$.jsx)($U,{placeholder:`发票将发送至该邮箱`})})]})})}}),(0,$.jsx)(vH.Item,{name:`isDefault`,label:`设为默认:`,rules:[{required:!0,message:`请选择是否设为默认`}],children:(0,$.jsxs)(LF.Group,{children:[(0,$.jsx)(LF,{value:`yes`,children:`是`}),(0,$.jsx)(LF,{value:`no`,children:`否`})]})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:24,marginLeft:102},children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:le,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,borderRadius:10,paddingLeft:40,paddingRight:40,fontWeight:500},children:`提交`})})]})})}),(0,$.jsx)(jG,{title:null,open:L,onCancel:()=>R(!1),width:640,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>R(!1),children:`我知道了`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:18,color:`#1e293b`,display:`block`,marginBottom:20},children:`开票须知`}),(0,$.jsxs)(`div`,{style:{color:`#475569`,fontSize:14,lineHeight:2},children:[(0,$.jsx)(`p`,{style:{margin:0},children:`尊敬的用户您好!`}),(0,$.jsx)(`p`,{style:{margin:`4px 0 16px`},children:`感谢您的支持,请仔细阅读以下内容:`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`1. 平台开具的发票均为增值税发票;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`2. 为落实中办、国办印发的《关于进一步深化税收征管改革的意见》要求,云图网积极推广开具全面数字化电子发票(简称全电发票或数电发票);发票信息填写无误后,会于5个工作日内开具,并发送至您提交的交付邮箱;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`},children:`3. 开票金额与您实际支付金额一致;`}),(0,$.jsx)(`p`,{style:{margin:0},children:`4. 发票申请过程中有任何问题,可填写用户反馈沟通。`})]})]})}),(0,$.jsx)(jG,{title:null,open:z,onCancel:()=>B(!1),width:720,footer:[(0,$.jsx)(X,{type:`primary`,onClick:()=>B(!1),children:`我知道了`},`close`)],centered:!0,styles:{body:{padding:0}},closeIcon:(0,$.jsx)(ju,{style:{fontSize:16,color:`#94a3b8`}}),children:(0,$.jsxs)(`div`,{style:{padding:`24px 28px`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:18,color:`#1e293b`,display:`block`,marginBottom:20},children:`全面数字化电子发票说明`}),(0,$.jsxs)(`div`,{style:{color:`#475569`,fontSize:14,lineHeight:2},children:[(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`1. 什么是数电发票?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`是指全面数字化的电子发票,即发票信息全面数字化(依托可信身份体系和电子发票服务平台,以去介质、去版式、标签化、要素化、授信制、赋码制为基本特征,覆盖全领域、全环节、全要素的全新发票,与纸质发票具有同等法律效力)。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`2. 数电发票可以开什么票种?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`数电发票可以开增值税普通票及增值税专票(均是电子发票)。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`3. 数电发票与电子发票的不同`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.1 数电发票无联次;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.2 数电发票无发票代码,只有发票号码(20位);`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.3 数电发票仅显示纳税人识别号和纳税人名称;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 4px`},children:`3.4 数电发票只有开票人,无收款人和复核人,无销售方(章)信息;`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`3.5 新增了动态二维码。`}),(0,$.jsx)(`p`,{style:{margin:`0 0 8px`,fontWeight:500,color:`#1e293b`},children:`4. 数电发票怎么开,怎么交付?`}),(0,$.jsx)(`p`,{style:{margin:`0 0 16px`},children:`现有开具方式需要您选择电子发票填写信息申请,默认以PDF文件形式送至您提供的邮箱,如果您有特殊需求,可备注PDF格式及XML格式,如忘记备注可联系在线客服申请另选格式重复交付不受影响。`}),(0,$.jsx)(`p`,{style:{margin:0},children:`5. 请您认真核对信息无误后提交`})]})]})})]})},{TextArea:X9}=$U,Z9={video:{bg:`rgba(99,102,241,0.15)`,bgActive:`rgba(99,102,241,0.45)`,border:`rgba(99,102,241,0.25)`,borderActive:`rgba(99,102,241,0.5)`,icon:(0,$.jsx)(z8,{style:{color:`#6366f1`,fontSize:14}})},audio:{bg:`rgba(16,185,129,0.15)`,bgActive:`rgba(16,185,129,0.45)`,border:`rgba(16,185,129,0.25)`,borderActive:`rgba(16,185,129,0.5)`,icon:(0,$.jsx)(y8,{style:{color:`#10b981`,fontSize:14}})},image:{bg:`rgba(245,158,11,0.15)`,bgActive:`rgba(245,158,11,0.45)`,border:`rgba(245,158,11,0.25)`,borderActive:`rgba(245,158,11,0.5)`,icon:(0,$.jsx)(L6,{style:{color:`#f59e0b`,fontSize:14}})},text:{bg:`rgba(59,130,246,0.15)`,bgActive:`rgba(59,130,246,0.45)`,border:`rgba(59,130,246,0.25)`,borderActive:`rgba(59,130,246,0.5)`,icon:(0,$.jsx)(K4,{style:{color:`#3b82f6`,fontSize:14}})},watermark:{bg:`rgba(100,116,139,0.15)`,bgActive:`rgba(100,116,139,0.45)`,border:`rgba(100,116,139,0.25)`,borderActive:`rgba(100,116,139,0.5)`,icon:(0,$.jsx)(kV,{style:{color:`#64748b`,fontSize:14}})}},$le=()=>{let e=Ye(),[t,n]=(0,S.useState)(`video`),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(1),[h,g]=(0,S.useState)(80),[_,v]=(0,S.useState)(50),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(``),[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)(`text`),P=(0,S.useRef)(null),F=(0,S.useRef)(null),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),z=(0,S.useRef)(null),B=(0,S.useRef)(null),V=(0,S.useRef)(null),H=(0,S.useRef)(null),U=(0,S.useRef)(null),W=(0,S.useRef)(0),G=(0,S.useRef)(!1),K=(0,S.useRef)(null),ee=(0,S.useRef)(null),te=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},ne=e=>{switch(e){case`video`:return`video/*`;case`audio`:return`audio/*`;case`image`:return`image/*`;case`watermark`:return`image/*`;default:return``}},re=e=>{let n=e.target.files;if(!n||n.length===0)return;if(t===`text`){N(`text`),j(``),k(!0);return}let r=t===`watermark`?`watermark`:t,a=[];Array.from(n).forEach(e=>{let t=URL.createObjectURL(e);a.push({id:`${Date.now()}-${Math.random()}`,type:r,name:e.name,url:t})}),i(e=>[...e,...a]),Z.success(`已导入 ${a.length} 个${Ee.find(e=>e.key===t)?.label}素材`),R.current&&(R.current.value=``)},ie=e=>{N(e),j(``),k(!0)},ae=()=>{let e=A.trim();if(!e){Z.warning(`请输入内容`);return}let t={id:`${Date.now()}-${Math.random()}`,type:M,name:e.slice(0,20),text:e};i(e=>[...e,t]),k(!1),Z.success(M===`watermark`?`已添加水印`:`已添加文本`)},q=()=>{t===`text`?ie(`text`):t===`watermark`?ie(`watermark`):R.current?.click()},oe=e=>e.length>0?Math.max(...e.map(e=>e.start+e.duration)):0,se=e=>e.length>0?Math.max(...e.map(e=>e.start+e.duration)):0,ce=(0,S.useCallback)(()=>{if(!y){Z.warning(`请先选择要分割的片段`);return}let e=a.find(e=>e.id===y);if(!e)return;let t=s-e.start;if(t<=0||t>=e.duration){Z.warning(`播放头不在选中片段内`);return}let n={...e,duration:t,originalDuration:e.originalDuration,trimStart:e.trimStart},r={...e,id:`${Date.now()}-${Math.random()}`,start:e.start+t,duration:e.duration-t,trimStart:e.trimStart+t};o(t=>[...t.filter(t=>t.id!==e.id),n,r]),b(r.id),Z.success(`已分割片段`)},[y,a,s]),le=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>n.id===e?{...n,start:Math.max(0,t)}:n))},[]),ue=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>{if(n.id!==e)return n;let r=n.type===`video`||n.type===`audio`?n.originalDuration-.1:999,i=Math.max(0,Math.min(t,r)),a=i-n.trimStart;return{...n,trimStart:i,start:n.start+a,duration:Math.max(.1,n.duration-a)}}))},[]),de=(0,S.useCallback)((e,t)=>{o(n=>n.map(n=>{if(n.id!==e)return n;let r=n.type===`video`||n.type===`audio`?n.originalDuration-n.trimStart:999,i=Math.max(.1,Math.min(t,r));return{...n,duration:i}}))},[]),fe=(0,S.useCallback)((e,t,n)=>{o(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))},[]),pe=(0,S.useCallback)(e=>{let t=e=>e===`image`?{x:50,y:50,width:25,height:20,opacity:1,zIndex:4}:e===`text`?{x:50,y:85,width:60,height:10,opacity:1,zIndex:5}:e===`watermark`?{x:85,y:85,width:15,height:8,opacity:.4,zIndex:6}:e===`video`?{zIndex:2}:e===`audio`?{zIndex:1}:{zIndex:0},n=n=>({id:`${Date.now()}-${Math.random()}`,mediaId:e.id,type:e.type,start:0,duration:n,originalDuration:n,trimStart:0,url:e.url,name:e.text||e.name,text:e.text,...t(e.type)});if(e.type===`video`){let t=document.createElement(`video`);t.src=e.url,t.onloadedmetadata=()=>{let r=t.duration||5;o(e=>{let t=n(r);t.start=oe(e);let i=[...e,t];return u(se(i)),i}),Z.success(`已添加视频:${e.name}`)}}else if(e.type===`audio`){let t=document.createElement(`audio`);t.src=e.url,t.onloadedmetadata=()=>{let r=t.duration||5;o(e=>{let t=n(r);t.start=oe(e);let i=[...e,t];return u(se(i)),i}),Z.success(`已添加音频:${e.name}`)}}else e.type===`image`?(o(e=>{let t=n(5);t.start=oe(e);let r=[...e,t];return u(se(r)),r}),Z.success(`已添加图片:${e.name}`)):e.type===`text`?(o(e=>{let t=n(3);t.start=oe(e);let r=[...e,t];return u(se(r)),r}),Z.success(`已添加文本:${e.text}`)):e.type===`watermark`&&(o(e=>{let t=n(e.length>0?Math.max(...e.map(e=>e.start+e.duration)):10);t.start=0;let r=[...e,t];return u(se(r)),r}),Z.success(`已添加水印:${e.text||e.name}`))},[]),me=e=>l>0?e/l*100:0,he=(0,S.useCallback)(e=>{if(!B.current)return;let t=B.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width;if(r<=0)return;let i=Math.max(0,Math.min(1,n/r))*l;c(i),P.current&&(P.current.currentTime=i),F.current&&(F.current.currentTime=i)},[l]),ge=(0,S.useCallback)(e=>{if(e.stopPropagation(),e.preventDefault(),!B.current)return;let t=B.current.getBoundingClientRect(),n=e=>{let n=e.clientX-t.left;c(Math.max(0,Math.min(1,n/t.width))*l)},r=()=>{document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,r);let i=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width))*l;P.current&&(P.current.currentTime=i),F.current&&(F.current.currentTime=i)};document.addEventListener(`mousemove`,n),document.addEventListener(`mouseup`,r)},[l]),_e=(0,S.useCallback)((e,t,n)=>{e.stopPropagation(),e.preventDefault(),b(t.id);let r=B.current?.getBoundingClientRect(),i=(r?r.width:1)/Math.max(l,.01);K.current={segmentId:t.id,mode:n,startX:e.clientX,startTime:s,originalStart:t.start,originalDuration:t.duration,originalTrimStart:t.trimStart};let a=e=>{let t=K.current;if(!t||!B.current)return;let n=(e.clientX-t.startX)/i;t.mode===`move`?le(t.segmentId,Math.max(0,t.originalStart+n)):t.mode===`trimLeft`?ue(t.segmentId,t.originalTrimStart+n):t.mode===`trimRight`&&de(t.segmentId,Math.max(.1,t.originalDuration+n))},o=()=>{K.current=null,document.removeEventListener(`mousemove`,a),document.removeEventListener(`mouseup`,o)};document.addEventListener(`mousemove`,a),document.addEventListener(`mouseup`,o)},[s,l,le,ue,de]),ve=(0,S.useCallback)((e,t,n,r)=>{e.stopPropagation(),e.preventDefault(),b(t.id);let i=t.width??25,a=t.height??20,o=t.x??50,s=t.y??50;ee.current={segmentId:t.id,mode:n,startX:e.clientX,startY:e.clientY,origX:o,origY:s,origW:i,origH:a,handle:r};let c=V.current?.getBoundingClientRect();if(!c)return;let l=c.width,u=c.height,d=e=>{let t=ee.current;if(!t)return;let n=(e.clientX-t.startX)/l*100,r=(e.clientY-t.startY)/u*100;if(t.mode===`move`)fe(t.segmentId,`x`,Math.max(0,Math.min(100,t.origX+n))),fe(t.segmentId,`y`,Math.max(0,Math.min(100,t.origY+r)));else if(t.mode===`resize`){let e=t.origW,i=t.origH,a=t.origX,o=t.origY,s=t.handle||`se`;if(s.includes(`e`)&&(e=Math.max(3,t.origW+n)),s.includes(`s`)&&(i=Math.max(3,t.origH+r)),s.includes(`w`)){let r=t.origX+t.origW-n;e=Math.max(3,r-t.origX),a=t.origX+(t.origW-e)}if(s.includes(`n`)){let e=t.origY+t.origH-r;i=Math.max(3,e-t.origY),o=t.origY+(t.origH-i)}(s===`e`||s===`w`)&&(i=t.origH,o=t.origY),fe(t.segmentId,`width`,Math.min(100,e)),fe(t.segmentId,`height`,Math.min(100,i)),s.includes(`w`)&&fe(t.segmentId,`x`,Math.max(0,a)),s.includes(`n`)&&fe(t.segmentId,`y`,Math.max(0,o))}},f=()=>{ee.current=null,document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f)};document.addEventListener(`mousemove`,d),document.addEventListener(`mouseup`,f)},[fe]),ye=(0,S.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e)),b(null)},[]),be=(0,S.useCallback)(e=>{o(t=>t.map(t=>t.id===e?{...t,zIndex:(t.zIndex??0)+1}:t))},[]),xe=(0,S.useCallback)(e=>{o(t=>t.map(t=>t.id===e?{...t,zIndex:Math.max(0,(t.zIndex??0)-1)}:t))},[]),Se=()=>{if(G.current){if(P.current&&je){let e=P.current.currentTime;c(je.start+e-je.trimStart);return}if(F.current&&Ne){let e=F.current.currentTime;c(Ne.start+e-Ne.trimStart)}}},Ce=e=>{if(!I.current)return;let t=I.current.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*l;c(n),P.current&&(P.current.currentTime=n),F.current&&(F.current.currentTime=n)},we=e=>{let t=Math.max(0,Math.min(l,s+e));c(t),P.current&&(P.current.currentTime=t),F.current&&(F.current.currentTime=t)},Te=()=>{if(a.length===0){Z.warning(`请先添加视频片段`);return}Z.success(`导出任务已提交,请稍候...`)},Ee=[{key:`video`,icon:(0,$.jsx)(z8,{}),label:`视频`},{key:`audio`,icon:(0,$.jsx)(y8,{}),label:`音频`},{key:`image`,icon:(0,$.jsx)(L6,{}),label:`图片`},{key:`text`,icon:(0,$.jsx)(K4,{}),label:`文本`},{key:`watermark`,icon:(0,$.jsx)(kV,{}),label:`水印`}],De=e=>Z9[e].icon,Oe=a.find(e=>e.id===y),ke=a.filter(e=>e.type===`video`&&s>=e.start&&s(e.zIndex??0)-(t.zIndex??0)),Ae=ke.length>0?ke[ke.length-1]:null,je=a.find(e=>e.type===`video`&&s>=e.start&&se.type!==`text`&&e.type!==`watermark`&&e.type!==`image`?!1:s>=e.start&&s(e.zIndex??0)-(t.zIndex??0)),Ne=a.find(e=>e.type===`audio`&&s>=e.start&&s{let e=!d;if(G.current=e,f(e),U.current!==null&&(cancelAnimationFrame(U.current),U.current=null),e){let e=ke.some(e=>e.type===`video`&&e.url),t=Ne&&F.current,n=e||t;if(e&&P.current&&je){let e=Math.max(0,s-je.start+je.trimStart);P.current.currentTime=e,P.current.play().catch(()=>{})}if(t&&(F.current.currentTime=Math.max(0,s-Ne.start+Ne.trimStart),F.current.play().catch(()=>{})),!n){W.current=performance.now();let e=t=>{if(!G.current)return;let n=(t-W.current)/1e3;W.current=t,c(e=>{let t=e+n;return t>=l?(G.current=!1,f(!1),l):t}),G.current&&(U.current=requestAnimationFrame(e))};U.current=requestAnimationFrame(e)}}else P.current&&P.current.pause(),F.current&&F.current.pause()},[d,ke,je,Ne,s,l]),Fe=r.filter(e=>t===`watermark`?e.type===`watermark`:e.type===t);(0,S.useEffect)(()=>{P.current&&(P.current.volume=h/100),F.current&&(F.current.volume=h/100)},[h]),(0,S.useEffect)(()=>{P.current&&(P.current.playbackRate=p),F.current&&(F.current.playbackRate=p)},[p]),(0,S.useEffect)(()=>{if(Ae?.type===`video`&&P.current){let e=s-Ae.start+Ae.trimStart;Math.abs(P.current.currentTime-e)>.1&&(P.current.currentTime=Math.max(0,e))}if(Ne&&F.current){let e=s-Ne.start+Ne.trimStart;Math.abs(F.current.currentTime-e)>.1&&(F.current.currentTime=Math.max(0,e))}},[s,Ae,Ne]);let Ie=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!Ae){Ie.current=null;return}let e=`${Ae.id}-${Ae.type}`;Ie.current!==e&&d&&setTimeout(()=>{Ae.type===`video`&&P.current&&(P.current.currentTime=Ae.trimStart,P.current.play().catch(()=>{}))},30),Ie.current=e},[Ae,d]);let Le=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!Ne){Le.current=null;return}let e=Ne.id;Le.current!==e&&d&&Ne.url&&setTimeout(()=>{F.current&&(F.current.currentTime=Ne.trimStart,F.current.play().catch(()=>{}))},30),Le.current=e},[Ne,d]),(0,S.useEffect)(()=>()=>{U.current!==null&&(cancelAnimationFrame(U.current),U.current=null),r.forEach(e=>{e.url&&URL.revokeObjectURL(e.url)})},[]);let Re=e=>{if(!e)return null;let t=e.start+e.duration;return a.filter(n=>(n.type===`video`||n.type===`image`)&&n.id!==e.id&&n.start>t-.01).sort((e,t)=>e.start-t.start)[0]||null},ze=(0,S.useCallback)(()=>{if(!Ae)return;let e=Re(Ae);if(e){if(c(e.start),e.type===`video`&&P.current){let t=()=>{P.current&&G.current&&(P.current.currentTime=e.trimStart,P.current.play().catch(()=>{}))};P.current.readyState>=1?t():P.current.addEventListener(`loadedmetadata`,t,{once:!0})}}else G.current=!1,f(!1),c(Ae.start+Ae.duration),U.current!==null&&(cancelAnimationFrame(U.current),U.current=null)},[Ae,a]),Be=(0,S.useCallback)(()=>{G.current&&P.current&&je&&(P.current.currentTime=je.trimStart,P.current.play().catch(()=>{}))},[je]),Ve=(0,S.useCallback)(()=>{if(Ne&&G.current){let e=a.filter(e=>e.type===`audio`&&e.id!==Ne.id&&e.start>=Ne.start+Ne.duration-.01).sort((e,t)=>e.start-t.start)[0];if(e)setTimeout(()=>{F.current&&G.current&&(F.current.currentTime=e.trimStart,F.current.play().catch(()=>{}))},50);else{W.current=performance.now();let e=t=>{if(!G.current)return;let n=(t-W.current)/1e3;W.current=t,c(e=>{let t=e+n;return t>=l?(G.current=!1,f(!1),l):t}),G.current&&(U.current=requestAnimationFrame(e))};U.current=requestAnimationFrame(e)}}},[Ne,a,l]),He=[],Ue=Math.ceil(l||10),We=Math.max(1,Math.floor(Ue/10));for(let e=0;e<=Ue;e+=We)He.push(e);return(0,$.jsxs)(`div`,{className:`content_box`,style:{backgroundColor:`#fff`,width:`100vw`,height:`100vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`,margin:0},children:[(0,$.jsxs)(`div`,{style:{height:56,background:`#ffffff`,borderBottom:`1px solid #e8ecf2`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 20px`,flexShrink:0,boxShadow:`0 1px 2px rgba(15, 23, 42, 0.03)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(Uw,{}),onClick:()=>e(`/videoprojects`),children:`返回`}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`},children:`视频剪辑工作台`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:[a.length,` 个片段 · 总时长 `,te(l)]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(Eie,{}),children:`保存草稿`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(j4,{}),onClick:Te,children:`导出视频`})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,overflow:`hidden`,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{width:220,minWidth:180,maxWidth:220,background:`#ffffff`,borderRight:`1px solid #e8ecf2`,display:`flex`,flexDirection:`column`,flexShrink:0,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,padding:`10px 8px 8px`,gap:4,borderBottom:`1px solid #eef2f7`,flexShrink:0},children:Ee.map(e=>(0,$.jsx)(kw,{title:e.label,placement:`bottom`,children:(0,$.jsx)(`div`,{onClick:()=>n(e.key),style:{width:34,height:34,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,background:t===e.key?`rgba(99,102,241,0.1)`:`transparent`,color:t===e.key?`#6366f1`:`#64748b`,transition:`all 0.2s`,fontSize:15},children:e.icon})},e.key))}),(0,$.jsxs)(`div`,{style:{padding:`12px`,flexShrink:0},children:[(0,$.jsx)(X,{block:!0,icon:(0,$.jsx)(T3,{}),onClick:q,children:t===`text`?`添加文本`:t===`watermark`?`添加水印`:`导入${Ee.find(e=>e.key===t)?.label}`}),(0,$.jsx)(`input`,{ref:R,type:`file`,accept:ne(t),multiple:!0,style:{display:`none`},onChange:re})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`0 12px`,minHeight:0},children:Fe.length===0?(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px 12px`,color:`#94a3b8`},children:[(0,$.jsx)(T3,{style:{fontSize:32,marginBottom:12,opacity:.5}}),(0,$.jsx)(`div`,{style:{fontSize:13},children:t===`text`?`点击上方按钮添加文本`:t===`watermark`?`点击上方按钮添加水印`:`点击上方按钮导入素材`})]}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:8},children:Fe.map(e=>(0,$.jsxs)(`div`,{onClick:()=>pe(e),style:{background:`#f8fafc`,border:`1px solid #e2e8f0`,borderRadius:8,padding:10,cursor:`pointer`,transition:`all 0.2s`,textAlign:`center`,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#c7d2fe`,e.currentTarget.style.background=`#eef2ff`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.background=`#f8fafc`},children:[(e.type===`image`||e.type===`watermark`)&&e.url?(0,$.jsx)(`div`,{style:{width:`100%`,height:48,borderRadius:6,overflow:`hidden`,background:`#e2e8f0`,marginBottom:6,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`img`,{src:e.url,alt:e.name,draggable:!1,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}})}):(0,$.jsx)(`div`,{style:{fontSize:22,marginBottom:6},children:De(e.type)}),(0,$.jsx)(`div`,{style:{color:`#334155`,fontSize:11,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.text||e.name,children:e.text||e.name})]},e.id))})}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,borderTop:`1px solid #eef2f7`,color:`#94a3b8`,fontSize:11,textAlign:`center`,flexShrink:0},children:`选择素材添加到时间线`})]}),(0,$.jsxs)(`div`,{ref:H,style:{flex:1,minWidth:0,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,padding:16,minHeight:0,background:`#ffffff`},children:a.length>0?(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,minWidth:400,minHeight:300,borderRadius:12,overflow:`hidden`,boxShadow:`0 8px 32px rgba(15, 23, 42, 0.2)`,background:`#000`},children:[ke.map((e,t)=>{let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:e.zIndex??t};if(e.type===`video`&&e.url){let r=t===ke.findIndex(e=>e.type===`video`);return(0,$.jsx)(`video`,{ref:r?P:void 0,src:e.url,onTimeUpdate:r?Se:void 0,onPlay:r?()=>f(!0):void 0,onPause:r?()=>f(!1):void 0,onEnded:r?ze:void 0,onLoadedMetadata:r?Be:void 0,style:{...n,objectFit:`contain`,background:`#000`}},e.id)}return e.type===`image`&&e.url?(0,$.jsx)(`img`,{src:e.url,alt:e.name,style:{...n,objectFit:`contain`}},e.id):null}),ke.length===0&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`#000`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(P6,{style:{fontSize:48,marginBottom:8,opacity:.4}}),(0,$.jsx)(`div`,{style:{fontSize:13}})]})}),(0,$.jsx)(`div`,{ref:V,style:{position:`absolute`,inset:0,pointerEvents:`none`}}),Me.filter(e=>e.type===`image`&&e.url).map(e=>{let t=y===e.id,n=e.x??50,r=e.y??50,i=e.width??25,a=e.height??20,o=e.opacity??1;return(0,$.jsxs)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,width:`${i}%`,height:`${a}%`,transform:`translate(-50%, -50%)`,cursor:`move`,zIndex:e.zIndex??4,pointerEvents:`auto`,opacity:o},children:[(0,$.jsx)(`img`,{src:e.url,alt:e.name,draggable:!1,style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,border:t?`2px solid #6366f1`:`2px solid rgba(255,255,255,0.8)`,boxShadow:t?`0 0 0 2px rgba(99,102,241,0.3), 0 4px 12px rgba(0,0,0,0.3)`:`0 4px 12px rgba(0,0,0,0.3)`,pointerEvents:`none`}}),t&&(0,$.jsx)($.Fragment,{children:[`nw`,`n`,`ne`,`e`,`se`,`s`,`sw`,`w`].map(t=>{let n=t.length===2,r={};return t.includes(`n`)&&(r.top=-6),t.includes(`s`)&&(r.bottom=-6),t.includes(`w`)&&(r.left=-6),t.includes(`e`)&&(r.right=-6),!t.includes(`n`)&&!t.includes(`s`)&&(r.top=`50%`),!t.includes(`w`)&&!t.includes(`e`)&&(r.left=`50%`),!t.includes(`n`)&&!t.includes(`s`)&&(r.transform=`translateY(-50%)`),!t.includes(`w`)&&!t.includes(`e`)&&(r.transform=`translateX(-50%)`),(0,$.jsx)(`div`,{onMouseDown:n=>ve(n,e,`resize`,t),style:{position:`absolute`,width:n?10:8,height:n?10:8,background:`#fff`,border:`1.5px solid #6366f1`,borderRadius:2,cursor:`${t}-resize`,zIndex:10,...r}},t)})})]},e.id)}),Me.filter(e=>e.type===`text`).map(e=>{let t=y===e.id,n=e.x??50,r=e.y??85,i=e.opacity??1;return(0,$.jsx)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,transform:`translate(-50%, -50%)`,fontSize:28,fontWeight:700,color:`#fff`,textShadow:`0 2px 12px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.5)`,cursor:`move`,zIndex:e.zIndex??5,whiteSpace:`nowrap`,maxWidth:`90%`,overflow:`hidden`,textOverflow:`ellipsis`,opacity:i,padding:`4px 8px`,outline:t?`2px dashed #6366f1`:`none`,outlineOffset:2,pointerEvents:`auto`},children:e.text||e.name},e.id)}),Me.filter(e=>e.type===`watermark`).map(e=>{let t=y===e.id,n=e.x??85,r=e.y??85,i=e.opacity??.4;return(0,$.jsx)(`div`,{onMouseDown:t=>ve(t,e,`move`),onClick:t=>{t.stopPropagation(),b(e.id)},style:{position:`absolute`,left:`${n}%`,top:`${r}%`,transform:`translate(-50%, -50%)`,fontSize:14,color:`rgba(255,255,255,${i})`,fontWeight:500,cursor:`move`,zIndex:e.zIndex??6,padding:t?`2px 4px`:void 0,outline:t?`2px dashed #6366f1`:`none`,outlineOffset:2,pointerEvents:`auto`},children:e.text||e.name},e.id)}),Ne?.url&&(0,$.jsx)(`audio`,{ref:F,src:Ne.url,onTimeUpdate:Se,onPlay:()=>f(!0),onPause:()=>f(!1),onEnded:Ve,style:{display:`none`}},Ne.id)]}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsx)(P6,{style:{fontSize:64,marginBottom:16,opacity:.35}}),(0,$.jsx)(`div`,{style:{fontSize:14,color:`#64748b`},children:`选择素材开始创作`}),(0,$.jsx)(`div`,{style:{fontSize:12,marginTop:4},children:`从左侧导入视频、音频或图片`})]})}),(0,$.jsxs)(`div`,{style:{height:48,background:`#ffffff`,borderTop:`1px solid #e8ecf2`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,padding:`0 16px`,flexShrink:0,color:`#1e293b`,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{color:`#64748b`,fontSize:13,fontFamily:`monospace`},children:[te(s),` / `,te(l)]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(a2,{}),onClick:()=>we(-5),disabled:a.length===0}),(0,$.jsx)(X,{type:`text`,icon:d?(0,$.jsx)(S6,{}):(0,$.jsx)(K6,{}),onClick:Pe,disabled:a.length===0,style:{color:`#6366f1`,fontSize:22,width:44,height:44}}),(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(Y4,{}),onClick:()=>we(5),disabled:a.length===0})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(y8,{style:{color:`#64748b`}}),(0,$.jsx)(nB,{value:h,onChange:g,style:{width:80},tooltip:{formatter:e=>`${e}%`}})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[.5,1,1.5,2].map(e=>(0,$.jsxs)(X,{size:`small`,type:p===e?`primary`:`default`,onClick:()=>m(e),style:{width:40,height:24,fontSize:11},children:[e,`x`]},e))}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(kw,{title:`在播放头处分割`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(o8,{}),onClick:ce,disabled:!y,children:`分割`})}),(0,$.jsx)(lU,{style:{color:`#64748b`,cursor:`pointer`},onClick:()=>v(e=>Math.max(10,e-10))}),(0,$.jsxs)(`span`,{style:{color:`#64748b`,fontSize:12,minWidth:32,textAlign:`center`},children:[_,`%`]}),(0,$.jsx)(oU,{style:{color:`#64748b`,cursor:`pointer`},onClick:()=>v(e=>Math.min(100,e+10))}),(0,$.jsx)(`div`,{style:{width:1,height:20,background:`#e2e8f0`}}),(0,$.jsx)(kw,{title:E?`退出全屏`:`全屏预览`,children:E?(0,$.jsx)(Q4,{style:{color:`#6366f1`,cursor:`pointer`,fontSize:18},onClick:()=>D(!1)}):(0,$.jsx)(t3,{style:{color:`#64748b`,cursor:`pointer`,fontSize:18},onClick:()=>D(!0)})})]})]}),(0,$.jsxs)(`div`,{ref:I,onClick:Ce,style:{height:4,background:`#e2e8f0`,cursor:`pointer`,position:`relative`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,top:0,height:`100%`,width:`${l>0?s/l*100:0}%`,background:`#6366f1`,borderRadius:`0 2px 2px 0`,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${l>0?s/l*100:0}%`,top:-4,width:8,height:12,background:`#6366f1`,borderRadius:2,transform:`translateX(-50%)`,boxShadow:`0 0 8px rgba(99,102,241,0.3)`}})]})]}),(0,$.jsxs)(`div`,{style:{width:200,minWidth:160,maxWidth:200,background:`#ffffff`,borderLeft:`1px solid #e8ecf2`,display:`flex`,flexDirection:`column`,flexShrink:0,overflow:`hidden`,color:`#1e293b`},children:[(0,$.jsxs)(`div`,{style:{padding:`10px 12px`,borderBottom:`1px solid #eef2f7`,display:`flex`,alignItems:`center`,gap:4,flexShrink:0,flexWrap:`wrap`},children:[(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(Qie,{}),children:`翻译`}),(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(o8,{}),children:`剪辑`}),(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(s3,{}),children:`语言`})]}),(0,$.jsxs)(`div`,{style:{padding:`12px`,borderBottom:`1px solid #eef2f7`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,marginBottom:8},children:`目标语言`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[`中文`,`英文`,`日文`,`韩文`].map(e=>(0,$.jsx)(`div`,{onClick:()=>T(e),style:{padding:`6px 12px`,borderRadius:6,cursor:`pointer`,background:w===e?`rgba(99,102,241,0.1)`:`transparent`,color:w===e?`#6366f1`:`#64748b`,fontSize:13,transition:`all 0.2s`,border:w===e?`1px solid rgba(99,102,241,0.3)`:`1px solid transparent`},children:e},e))})]}),(0,$.jsxs)(`div`,{style:{padding:`12px`,flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,marginBottom:8},children:`剪辑描述`}),(0,$.jsx)(X9,{value:x,onChange:e=>C(e.target.value),placeholder:`选择一个视频片段,开始你的创作...`,style:{flex:1,minHeight:100,borderRadius:8,resize:`none`}})]}),Oe&&(0,$.jsxs)(`div`,{style:{padding:`10px 12px`,borderTop:`1px solid #eef2f7`,background:`#f8fafc`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:6},children:`当前选中`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#6366f1`,marginBottom:6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Oe.name}),(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2},children:[`时长 `,Oe.duration.toFixed(1),`s / 原始 `,Oe.originalDuration.toFixed(1),`s`]}),(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:8},children:[`起始 `,Oe.start.toFixed(1),`s · 裁剪 `,Oe.trimStart.toFixed(1),`s`]}),(Oe.type===`image`||Oe.type===`text`||Oe.type===`watermark`)&&(0,$.jsxs)(`div`,{style:{borderTop:`1px solid #e2e8f0`,paddingTop:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`透明度`}),(0,$.jsxs)(`span`,{children:[Math.round((Oe.opacity??1)*100),`%`]})]}),(0,$.jsx)(nB,{min:0,max:1,step:.05,value:Oe.opacity??1,onChange:e=>fe(Oe.id,`opacity`,e)})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`X位置`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.x??50),`%`]})]}),(0,$.jsx)(nB,{min:0,max:100,value:Oe.x??50,onChange:e=>fe(Oe.id,`x`,e)})]}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`Y位置`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.y??50),`%`]})]}),(0,$.jsx)(nB,{min:0,max:100,value:Oe.y??50,onChange:e=>fe(Oe.id,`y`,e)})]})]}),Oe.type===`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`宽度`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.width??25),`%`]})]}),(0,$.jsx)(nB,{min:3,max:100,value:Oe.width??25,onChange:e=>fe(Oe.id,`width`,e)})]}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{fontSize:11,color:`#64748b`,marginBottom:2,display:`flex`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`高度`}),(0,$.jsxs)(`span`,{children:[Math.round(Oe.height??20),`%`]})]}),(0,$.jsx)(nB,{min:3,max:100,value:Oe.height??20,onChange:e=>fe(Oe.id,`height`,e)})]})]}),(0,$.jsx)(`div`,{style:{fontSize:11,color:`#94a3b8`},children:`在预览区拖拽移动,拖拽边缘缩放`})]}),(0,$.jsxs)(`div`,{style:{marginTop:12,padding:10,background:`#f8fafc`,borderRadius:8,border:`1px solid #e8ecf2`},children:[(0,$.jsxs)(`div`,{style:{fontSize:12,fontWeight:500,color:`#334155`,marginBottom:8,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{children:`图层顺序`}),(0,$.jsxs)(SQ,{color:`blue`,style:{margin:0},children:[`层级 `,Oe.zIndex??0]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)($0,{}),onClick:()=>be(Oe.id),disabled:(Oe.zIndex??0)>=10,style:{flex:1},children:`上移`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(W0,{}),onClick:()=>xe(Oe.id),disabled:(Oe.zIndex??0)<=0,style:{flex:1},children:`下移`})]}),(0,$.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:6},children:`数值越大越靠上`})]}),(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(IQ,{}),onClick:()=>ye(Oe.id),style:{width:`100%`,marginTop:12},children:`删除片段`})]})]})]}),(0,$.jsxs)(`div`,{style:{height:180,background:`#ffffff`,borderTop:`1px solid #e8ecf2`,flexShrink:0},children:[(0,$.jsxs)(`div`,{style:{height:36,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 16px`,background:`#f8fafc`,borderBottom:`1px solid #e8ecf2`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(i$,{}),children:`轨道`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`},children:[a.length,` 个片段 · `,te(l)]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`},children:(0,$.jsx)(nB,{value:_,onChange:v,style:{width:100},tooltip:{formatter:e=>`缩放 ${e}%`}})})]}),(0,$.jsx)(`div`,{style:{position:`relative`,height:20,padding:`0 16px 0 72px`,overflow:`hidden`,background:`#f8fafc`},children:(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,bottom:0},children:He.map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${me(e)}%`,top:0,width:1,height:e%(We*5)==0?20:10,background:e%(We*5)==0?`#94a3b8`:`#cbd5e1`},children:e%(We*5)==0&&(0,$.jsx)(`span`,{style:{position:`absolute`,top:2,left:-16,fontSize:10,color:`#64748b`},children:te(e).slice(3)})},e))})}),(0,$.jsxs)(`div`,{ref:z,style:{position:`relative`,height:120,padding:`0 16px 0 72px`,display:`flex`,flexDirection:`column`},children:[a.length===0&&(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`从左侧选择素材,添加到时间线开始创作。`}),(0,$.jsxs)(`div`,{ref:B,onClick:he,style:{position:`relative`,flex:1,cursor:`crosshair`},children:[[`video`,`audio`,`image`,`text`,`watermark`].map(e=>{let t=a.filter(t=>t.type===e);if(t.length===0)return null;let n=Z9[e];return(0,$.jsxs)(`div`,{style:{display:`flex`,height:28,marginBottom:2,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{position:`absolute`,left:-64,top:2,width:60,height:24,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,fontSize:10,color:`#475569`,background:n.bg,border:`1px solid ${n.border}`,borderRadius:6,padding:`0 6px`},children:[n.icon,(0,$.jsx)(`span`,{style:{fontWeight:500},children:Ee.find(t=>t.key===e)?.label})]}),(0,$.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:28},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,bottom:0,height:1,background:`#f1f5f9`}}),t.map(e=>{let t=y===e.id,r=me(e.start),i=me(e.duration);return(0,$.jsxs)(`div`,{onClick:t=>{t.stopPropagation(),b(e.id)},onMouseDown:t=>_e(t,e,`move`),style:{position:`absolute`,left:`${r}%`,width:`${i}%`,height:22,top:2,background:t?n.bgActive:n.bg,border:`1px solid ${t?n.borderActive:n.border}`,borderRadius:6,cursor:`grab`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0 10px`,overflow:`hidden`,transition:`background 0.15s, border-color 0.15s`,userSelect:`none`,boxShadow:t?`0 2px 8px rgba(99,102,241,0.25)`:`0 1px 2px rgba(0,0,0,0.04)`},title:`${e.name} · ${e.duration.toFixed(1)}s`,children:[(0,$.jsx)(`span`,{style:{fontSize:11,color:`#334155`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontWeight:500},children:e.name}),(0,$.jsx)(`div`,{onMouseDown:t=>_e(t,e,`trimLeft`),style:{position:`absolute`,left:-3,top:`50%`,transform:`translateY(-50%)`,width:6,height:16,background:t?`#6366f1`:`#94a3b8`,borderRadius:2,cursor:`ew-resize`,zIndex:2,flexShrink:0}}),(0,$.jsx)(`div`,{onMouseDown:t=>_e(t,e,`trimRight`),style:{position:`absolute`,right:-3,top:`50%`,transform:`translateY(-50%)`,width:6,height:16,background:t?`#6366f1`:`#94a3b8`,borderRadius:2,cursor:`ew-resize`,zIndex:2,flexShrink:0}})]},e.id)})]})]},e)}),a.length>0&&(0,$.jsx)(`div`,{ref:L,onMouseDown:ge,style:{position:`absolute`,left:`${me(s)}%`,top:0,bottom:0,width:2,marginLeft:-1,background:`#ef4444`,cursor:`ew-resize`,zIndex:10,transition:`left 0.05s linear`},children:(0,$.jsx)(`div`,{style:{position:`absolute`,top:-2,left:-4,width:10,height:10,background:`#ef4444`,borderRadius:`50%`,boxShadow:`0 0 8px rgba(239,68,68,0.5)`,cursor:`grab`}})})]})]})]}),E&&(0,$.jsxs)(`div`,{style:{position:`fixed`,inset:0,background:`#000`,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},onClick:()=>D(!1),children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:16,right:16,zIndex:10},children:(0,$.jsx)(X,{icon:(0,$.jsx)(Q4,{}),onClick:()=>D(!1),style:{background:`rgba(255,255,255,0.1)`,color:`#fff`,border:`none`},children:`退出全屏`})}),a.length>0&&(0,$.jsxs)(`div`,{style:{position:`relative`,maxWidth:`90vw`,maxHeight:`85vh`,borderRadius:12,overflow:`hidden`},onClick:e=>e.stopPropagation(),children:[Ae?.type===`video`&&Ae.url&&(0,$.jsx)(`video`,{src:Ae.url,autoPlay:!0,onTimeUpdate:Se,onLoadedMetadata:e=>u(e.target.duration),style:{maxWidth:`90vw`,maxHeight:`85vh`,objectFit:`contain`}}),Ae?.type===`image`&&Ae.url&&(0,$.jsx)(`img`,{src:Ae.url,alt:Ae.name,style:{maxWidth:`90vw`,maxHeight:`85vh`,objectFit:`contain`}}),Me.filter(e=>e.type===`text`).map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:48,left:`50%`,transform:`translateX(-50%)`,fontSize:36,fontWeight:700,color:`#fff`,textShadow:`0 2px 12px rgba(0,0,0,0.8)`},children:e.text||e.name},e.id)),Me.filter(e=>e.type===`watermark`).map(e=>(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:20,right:20,fontSize:18,color:`rgba(255,255,255,${e.opacity??.4})`,fontWeight:500},children:e.text||e.name},e.id))]}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:24,display:`flex`,alignItems:`center`,gap:16,color:`#fff`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`span`,{style:{fontFamily:`monospace`},children:[te(s),` / `,te(l)]}),(0,$.jsx)(X,{type:`text`,icon:d?(0,$.jsx)(S6,{style:{color:`#fff`,fontSize:32}}):(0,$.jsx)(K6,{style:{color:`#fff`,fontSize:32}}),onClick:Pe})]})]}),(0,$.jsxs)(jG,{title:M===`watermark`?`添加水印`:`添加文本`,open:O,onOk:ae,onCancel:()=>k(!1),okText:`确定`,cancelText:`取消`,width:440,children:[(0,$.jsx)(`div`,{style:{marginBottom:8,fontSize:13,color:`#64748b`},children:M===`watermark`?`输入水印文字,将作为半透明叠加层显示在视频右下角`:`输入文本内容,将作为字幕或标题叠加在视频上`}),(0,$.jsx)(X9,{value:A,onChange:e=>j(e.target.value),placeholder:M===`watermark`?`请输入水印文字...`:`请输入文本内容...`,autoSize:{minRows:2,maxRows:5},autoFocus:!0,onPressEnter:ae})]})]})},{TextArea:Q9}=$U,eue=()=>{let e=Ye(),[t,n]=(0,S.useState)([{id:`demo-1`,name:`示例项目`,description:`这是一个视频剪辑示例项目`,createdAt:(0,VE.default)().subtract(2,`day`).format(`YYYY-MM-DD HH:mm`),updatedAt:(0,VE.default)().subtract(1,`day`).format(`YYYY-MM-DD HH:mm`)}]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)({name:``,description:``}),d=()=>{if(!l.name.trim()){Z.warning(`请输入项目名称`);return}let t={id:`proj-${Date.now()}`,name:l.name.trim(),description:l.description.trim(),createdAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`),updatedAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`)};n(e=>[t,...e]),i(!1),u({name:``,description:``}),Z.success(`项目创建成功`),e(`/videoediting?id=${t.id}`)},f=e=>{c(e),u({name:e.name,description:e.description}),o(!0)},p=()=>{if(s){if(!l.name.trim()){Z.warning(`请输入项目名称`);return}n(e=>e.map(e=>e.id===s.id?{...e,name:l.name.trim(),description:l.description.trim(),updatedAt:(0,VE.default)().format(`YYYY-MM-DD HH:mm`)}:e)),o(!1),c(null),u({name:``,description:``}),Z.success(`项目已更新`)}},m=e=>{n(t=>t.filter(t=>t.id!==e)),Z.success(`项目已删除`)},h=t=>{e(`/videoediting?id=${t.id}`)},g=e=>({items:[{key:`rename`,icon:(0,$.jsx)(i$,{}),label:`重命名`,onClick:()=>f(e)},{key:`delete`,icon:(0,$.jsx)(IQ,{}),label:`删除`,danger:!0,onClick:()=>{jG.confirm({title:`确认删除`,content:`确定要删除项目「${e.name}」吗?`,okText:`删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:()=>m(e.id)})}}]});return(0,$.jsxs)(`div`,{className:`content_box`,style:{background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:22,fontWeight:600,color:`#1e293b`},children:`视频剪辑项目`}),(0,$.jsx)(`p`,{style:{margin:`4px 0 0`,fontSize:13,color:`#64748b`},children:`创建和管理你的视频剪辑项目`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),size:`large`,onClick:()=>{u({name:``,description:``}),i(!0)},children:`创建项目`})]}),t.length===0?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:400},children:(0,$.jsx)(lC,{image:lC.PRESENTED_IMAGE_SIMPLE,description:(0,$.jsx)(`span`,{style:{color:`#64748b`},children:`暂无项目,点击「创建项目」开始剪辑`}),children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(jI,{}),onClick:()=>{u({name:``,description:``}),i(!0)},children:`创建项目`})})}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(280px, 1fr))`,gap:16},children:t.map(e=>(0,$.jsxs)(lL,{hoverable:!0,style:{borderRadius:12,overflow:`hidden`,transition:`all 0.2s ease`,border:`1px solid #e8ecf2`},bodyStyle:{padding:0},children:[(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{height:160,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(z8,{style:{fontSize:48,color:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(EV,{menu:g(e),trigger:[`click`],placement:`bottomRight`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(TE,{style:{color:`#fff`,fontSize:18}}),style:{background:`rgba(0,0,0,0.3)`,borderRadius:6},onClick:e=>e.stopPropagation()})})})]}),(0,$.jsxs)(`div`,{onClick:()=>h(e),style:{padding:`14px 16px`,cursor:`pointer`},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,marginBottom:4},children:e.name}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,marginBottom:8},children:e.description||`暂无描述`}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,fontSize:12,color:`#94a3b8`},children:(0,$.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(TB,{}),e.updatedAt]})})]})]},e.id))}),(0,$.jsx)(jG,{title:`创建视频剪辑项目`,open:r,onOk:d,onCancel:()=>i(!1),okText:`创建并开始剪辑`,cancelText:`取消`,width:480,children:(0,$.jsxs)(`div`,{style:{paddingTop:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目名称`}),(0,$.jsx)($U,{placeholder:`请输入项目名称`,value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),maxLength:30})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目描述(可选)`}),(0,$.jsx)(Q9,{placeholder:`请输入项目描述`,value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),rows:3,maxLength:100})]})]})}),(0,$.jsx)(jG,{title:`编辑项目`,open:a,onOk:p,onCancel:()=>{o(!1),c(null)},okText:`保存`,cancelText:`取消`,width:480,children:(0,$.jsxs)(`div`,{style:{paddingTop:8},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目名称`}),(0,$.jsx)($U,{placeholder:`请输入项目名称`,value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),maxLength:30})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{style:{display:`block`,marginBottom:6,fontSize:13,fontWeight:500,color:`#475569`},children:`项目描述(可选)`}),(0,$.jsx)(Q9,{placeholder:`请输入项目描述`,value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),rows:3,maxLength:100})]})]})})]})};VE.default.locale(`zh-cn`);var $9=({children:e})=>{let{user:t,loading:n,checkAuth:r}=e7();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)(oG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=e7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(Mm,{locale:a0.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)(ex,{children:(0,$.jsx)(_n,{children:(0,$.jsxs)(Dt,{children:[(0,$.jsx)(Tt,{path:`/login`,element:(0,$.jsx)(Tse,{})}),(0,$.jsx)(Tt,{path:`/join-team`,element:(0,$.jsx)(Yle,{})}),(0,$.jsx)(Tt,{path:`/private-portrait-authorized`,element:(0,$.jsx)(Zle,{})}),(0,$.jsxs)(Tt,{path:`/`,element:(0,$.jsx)($9,{children:(0,$.jsx)(Cse,{})}),children:[(0,$.jsx)(Tt,{index:!0,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})}),(0,$.jsx)(Tt,{path:`projects`,element:(0,$.jsx)(Ose,{})}),(0,$.jsx)(Tt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(Kse,{})}),(0,$.jsx)(Tt,{path:`records`,element:(0,$.jsx)(qse,{})}),(0,$.jsx)(Tt,{path:`credits`,element:(0,$.jsx)(Jse,{})}),(0,$.jsx)(Tt,{path:`credit-records`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`order-records`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`user-center`,element:(0,$.jsx)(P7,{})}),(0,$.jsx)(Tt,{path:`messages`,element:(0,$.jsx)(Zse,{})}),(0,$.jsx)(Tt,{path:`home`,element:(0,$.jsx)(Ble,{})}),(0,$.jsx)(Tt,{path:`conversation`,element:(0,$.jsx)(Nce,{})}),(0,$.jsx)(Tt,{path:`initial`,element:(0,$.jsx)(zce,{})}),(0,$.jsx)(Tt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(Gce,{})}),(0,$.jsx)(Tt,{path:`removelens`,element:(0,$.jsx)(Qce,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Nle,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(Lle,{})}),(0,$.jsx)(Tt,{path:`generated`,element:(0,$.jsx)(sle,{})}),(0,$.jsx)(Tt,{path:`pretest`,element:(0,$.jsx)(lle,{})}),(0,$.jsx)(Tt,{path:`authorization`,element:(0,$.jsx)(dle,{})}),(0,$.jsx)(Tt,{path:`authoriza-waiting`,element:(0,$.jsx)(Ule,{})}),(0,$.jsx)(Tt,{path:`materials`,element:(0,$.jsx)(yle,{})}),(0,$.jsx)(Tt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(Ct,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(Tt,{path:`consume`,element:(0,$.jsx)(Hle,{})}),(0,$.jsx)(Tt,{path:`popular`,element:(0,$.jsx)(Wle,{})}),(0,$.jsx)(Tt,{path:`authacc`,element:(0,$.jsx)(ple,{})}),(0,$.jsx)(Tt,{path:`creativeplaza`,element:(0,$.jsx)(Gle,{})}),(0,$.jsx)(Tt,{path:`team-management`,element:(0,$.jsx)(Jle,{})}),(0,$.jsx)(Tt,{path:`invoice`,element:(0,$.jsx)(Qle,{})}),(0,$.jsx)(Tt,{path:`videoprojects`,element:(0,$.jsx)(eue,{})})]}),(0,$.jsx)(Tt,{path:`/videoediting`,element:(0,$.jsx)($9,{children:(0,$.jsx)($le,{})})}),(0,$.jsx)(Tt,{path:`*`,element:(0,$.jsx)(Ct,{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 4ba4dece..79b0a08d 100644 --- a/video-gen-app/dist/index.html +++ b/video-gen-app/dist/index.html @@ -27,7 +27,7 @@ 民众智创 - + diff --git a/video-gen-app/src/pages/InvoicePage.tsx b/video-gen-app/src/pages/InvoicePage.tsx index 3f8f0daa..2fa62800 100644 --- a/video-gen-app/src/pages/InvoicePage.tsx +++ b/video-gen-app/src/pages/InvoicePage.tsx @@ -90,11 +90,11 @@ const InvoicePage: React.FC = () => { endDate: orderDateFilter[1] || undefined, }); const items = data.items || []; - // 后端已返回 is_occupied 和 occupied_by,直接使用 + // 后端返回 is_occupied / occupied_by,API 客户端转为 camelCase const markedItems = items.map((o: any) => ({ ...o, - _occupied: !!o.is_occupied, - _occupiedBy: o.occupied_by, + _occupied: !!o.isOccupied, + _occupiedBy: o.occupiedBy, })); setOrderData(markedItems); setOrderTotal(data.total || 0);