1import{b as mt,f as bt,ho as Yn,a7 as Ft,t as kt,cd as Nl,aN as Sm,P as $m,dL as $l,ez as $c,_ as It,hp as Tm,dM as Am,aS as Tl,aK as Al,K as oa,cI as Ms,a as la,R as wa,fC as hs,fD as Ea,hq as ls,hr as Um,hs as Lm,fK as Fa,ht as Em,hu as qm,aB as Rl,hv as Dm,bc as Ca,az as ga,ce as Fl,aI as Va,f5 as Om,bi as Nm,bk as Rm,q as Fm,bm as Gm,r as Vm,bJ as xo,hw as zm,N as Bm,hx as ko,hy as wo,hz as Po,hA as _n,hB as Tc,hC as Km,hD as Kn,hE as Ac,hF as Uc,hG as yo,hH as Wm,fJ as Gn,hI as Lc,hJ as jm,fW as $r,hK as Hm,hL as Jm,a4 as Ym,dX as Wn,hM as Qm,hN as Xm,hO as Zm,hP as eg,hQ as Ec,hR as tg,hS as ag,es as ng,cb as qc,T as Dc,ay as nn,hT as _s,hU as ys,cE as bn,hV as Oc,hW as og,hX as sg,hY as lg,hZ as ig,h_ as Gl,cc as Nc,h$ as za,et as Rc,i0 as Fc,eh as rg,ax as cg,aw as ug,i1 as dg,i2 as pg,i3 as mg,bz as gg,ej as fg,i4 as Gc,i5 as Vc,ff as vg,i6 as hg,h as _g,i7 as Tr,i8 as Ar,i9 as yg,ia as xg,ib as is,ic as bg,cH as Ig,ep as Cg,aa as kg,id as wg,ie as yl,ig as Pg,ih as Mg,ii as En,fI as Ur,ij as Sg,ik as $g,fG as Tg,il as Lr,im as Er,fF as Ag,bK as Ug}from"./index-B8RyHLsu.js";import{bG as Lg,bH as Eg,bI as qg,bJ as Dg,bK as Og,bL as Ng,bM as Rg,bN as qr,bO as Fg,bP as Gg,bQ as Vg,bR as zg,bS as Bg,bT as Kg,bU as Wg,bV as jg,bW as Hg,bX as zc,bY as Jg,bZ as Bc,b_ as Kc,b$ as Wc,c0 as jc,c1 as Hc,c2 as Jc,c3 as Yc,c4 as Ss,c5 as Qc,c6 as Xc,c7 as Zc,c8 as eu,c9 as Yg,ca as Qg,cb as Xg,cc as Zg,cd as on,ce as e1,cf as t1,cg as a1,ch as n1,ci as o1,cj as s1,g as Vl,ck as l1,cl as i1,cm as r1,cn as c1,co as u1,cp as d1,cq as tu,cr as p1,cs as au,ct as Hn,cu as nu,cv as zl,cw as Jn,cx as m1,cy as g1,cz as ou,cA as su,cB as lu,cC as iu,cD as ru,cE as f1,cF as v1,cG as h1,cH as _1,cI as y1,cJ as x1,cK as b1,cL as I1,cM as C1,cN as k1,cO as w1,cP as P1,cQ as M1,cR as S1,cS as Ul,cT as $1,cU as T1,cV as A1,cW as U1,cX as L1,cY as E1,cZ as q1,c_ as D1,c$ as O1,d0 as N1,d1 as R1,d2 as F1,d3 as G1,d4 as V1,d5 as Bl,d6 as xs,d7 as z1,d8 as B1,d9 as K1,da as W1,db as j1,dc as H1,dd as Dr,de as J1,df as Or,dg as Y1,dh as Nr,di as Q1,dj as X1,dk as Z1,dl as e0,dm as t0,dn as a0,dp as n0,dq as o0,dr as s0,ds as l0,dt as i0,du as r0,dv as c0,dw as u0,dx as d0,dy as p0,dz as m0,dA as g0,dB as f0,dC as Rr,dD as v0,dE as h0,dF as Fr,dG as _0,dH as Gr,dI as y0,dJ as x0,dK as b0,dL as Vr,dM as I0,dN as C0,dO as k0,dP as w0,dQ as P0,dR as M0,dS as S0}from"./task-publish-search-KFtxS5lw.js";import{u as Pa,k as h,h as Rt,x as fa,e as f,o as l,a as t,F as we,r as Je,c as ve,a0 as In,dP as Qn,q as rn,f as he,t as r,l as e,a8 as Kl,d as Dt,A as Kt,G as Ne,g as F,H as tt,Z as Bt,w as P,n as Nt,b as y,af as ba,aA as cu,aC as $s,ch as $0,aD as Ts,aY as Mo,N as Be,W as qe,a3 as bs,Y as Fe,i as De,M as Zt,b4 as ra,B as Lt,p as Qe,aq as xn,a2 as ca,at as pa,v as va,bQ as uu,ar as ma,S as Wt,dQ as Wl,aj as Ya,ak as Qa,X as Co,bu as T0,K as Is,bY as zr,bM as Xn,aF as A0,aG as U0,aQ as Oa,bU as L0,cB as E0,ai as Vn,P as Ta,dd as du,bj as q0,aE as As,cN as jl,aS as Hl,bm as Ll,bh as D0,cL as O0,dR as N0,bT as R0,bb as qa,cj as F0,aZ as an,dg as G0,cO as V0,cJ as z0,cI as B0,a1 as So,d1 as K0,_ as W0,a_ as Ga,R as St,bO as pu,c7 as Jl,aJ as Yl,aK as Ql,O as Us,aV as j0,bn as ua,br as da,a9 as Ba,bv as yn,bt as H0,a6 as Xl,b8 as sn,cb as J0,bB as Y0,dS as Zl,aN as mu,b0 as Q0,ax as ei,b3 as gu,b9 as X0,b5 as Z0,aI as ef,cn as go,cm as tf,dT as xl,dU as af,$ as nf,cr as of,dV as rs,co as sf,cp as lf,cq as rf,dW as cf,cF as Br,cD as uf}from"./vendor-DYo3sCLj.js";import{C as Qt,a as Sa,_ as $a,S as df,b as pf,c as mf}from"./history-image.vue_vue_type_script_setup_true_lang-DQkttvkS.js";import{v as ti,l as Cs,D as fu,_ as Ls,c as gf,s as ff,d as vf,b as Kr,F as hf,e as _f,a as yf}from"./file-image-CmauYe5n.js";import{P as vu}from"./icon_2-DpUcDTKl.js";import{d as ks}from"./strategy_101_global-BC8NVmLv.js";import{a as hu,p as _u}from"./strategy_103_global-C-dplBu0.js";import{a as xf,t as bf,b as If,c as Cf,d as kf,P as ai,C as yu}from"./ProductLibrarySelector-B5q1kZSm.js";import{a as xa,b as ka,V as wf,_ as Pf,E as Mf}from"./claw-buy-Cjhroh0L.js";import{x as Wr,w as jr,k as xu,_ as Hr}from"./strategy_100_global-CHdHO8cY.js";import{p as Sf}from"./strategy_113_global-B_Uh3f3Y.js";import{c as $f}from"./strategy_98-VEXQsb4Y.js";import{S as Tf,a as Af,_ as Uf}from"./index.vue_vue_type_style_index_0_lang-C3Dr2uzA.js";import{a as Lf,_ as Ef}from"./reload-BUhV-x7q.js";import{C as Jr}from"./linkpix-tWh6WYJ6.js";import{r as qf,i as Df,g as Of,h as Nf,L as Rf,u as Ff,a as Gf,p as Vf,b as zf,c as Bf,d as Kf,e as bu}from"./useLinkPixGenerateMode-BRiwEqDZ.js";import{_ as ni}from"./strategy_101-ghzBPmoR.js";import{p as tn,L as ya,O as Wf}from"./active_agent-DzOLEHIL.js";import{b as Yr}from"./strategy_99-DWbsAbFJ.js";import{C as jf}from"./copy-BovEAmlV.js";const Hf={class:"w-full section-grid overflow-x-auto",ref:"linkpixFcBlockRef"},Jf={class:"flex items-center max-w-max"},Yf={key:1},Qf=["onClick"],Xf={class:"h-full px-14px py-24px relative group"},Zf={class:"flex items-center h-12px"},ev=["src"],tv={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},av={key:0,class:"ml-6px bg-#ff4d4f color-white text-10px px-6px h-18px line-height-18px rounded-9px"},nv={class:"mt-8px text-12px truncate relative z-10",style:{"line-height":"1"}},ov=["src"],sv=["onClick"],lv={class:"flex items-center"},iv=["src"],rv={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},cv={key:0,class:"ml-6px bg-#ff4d4f color-white text-10px px-6px h-18px line-height-18px rounded-9px"},uv={__name:"pod-material",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=bt(),c=Pa(),o={STAMP_EXTRACT:"click_pod_print_extract",STAMP_APPLY:"click_pod_print_fit",STAMP_FISSION:"click_pod_print_variation"},x={page:"é¦é¡µ",module:"PODç´ æ",moduleCategory1:"PODç´ æ",moduleCategory2:"POD ç´ æå·¥å
·åº"},_={STAMP_EXTRACT:"ç¹å»ãå°è±æåãå·¥å
·",STAMP_APPLY:"ç¹å»ãå°è±è´´åãå·¥å
·",STAMP_FISSION:"ç¹å»ãå°è±è£åãå·¥å
·"},m=a=>{var q;const E=o[a.key];E&&kt(E,{...x,eventDesc:_[a.key],buttonName:a.label,label:a.label,mode:a.key,source:c.path});const z=(q=i.podMaterialOptions)==null?void 0:q.find(S=>S.value===a.key);i.podMaterialParams.podMaterialMode=a.key,i.podMaterialParams.modelSkuId=(z==null?void 0:z.id)||""},p=[{key:"STAMP_EXTRACT",label:g("components-qinghu-ai.pod-material-params.930519
1-86"),description:g("components-qinghu-ai.pod-material.930519-99"),icon:Eg,highlightImage:Lg,singleFree:!0,onClick:a=>{m(a)}},{key:"STAMP_APPLY",label:g("components-qinghu-ai.pod-material-params.930519-89"),description:g("components-qinghu-ai.pod-material.930519-100"),icon:Dg,highlightImage:qg,singleFree:!0,onClick:a=>{m(a)}},{key:"STAMP_FISSION",label:g("components-qinghu-ai.pod-material-params.930519-92"),description:g("components-qinghu-ai.pod-material.930519-101"),icon:Ng,highlightImage:Og,onClick:a=>{m(a)}}],d=a=>Yn(a,{type:i.LINKPIN_POD_MATERIAL_USAGE_TYPE}),R=h(d(p)),U=()=>{R.value=d(p)},G=a=>{a!=null&&a.type&&a.type!==i.LINKPIN_POD_MATERIAL_USAGE_TYPE||U()};return Rt(()=>{U(),Ft.on("usage-updated",G)}),fa(()=>{Ft.off("usage-updated",G)}),(a,E)=>(l(),f("div",Hf,[t("div",Jf,[(l(!0),f(we,null,Je(e(R),z=>(l(),f("div",{key:z.key,class:"linkpix-fn-item"},[z.type==="component"?(l(),ve(rn(z.component),In({key:0,ref_for:!0},z.componentProps,Qn(z.componentEvents)),null,16)):(l(),f("div",Yf,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:q=>z.onClick(z)},[t("div",lv,[t("img",{src:z.icon,class:"w-14px h-14px",alt:""},null,8,iv),t("span",rv,r(z.label),1),z.singleFree?(l(),f("span",cv,r(e(g)("components-qinghu-ai.pod-material-params.930519-109")),1)):he("",!0)])],8,sv)):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card relative",onClick:q=>z.onClick(z)},[t("div",Xf,[t("div",Zf,[t("img",{src:z.icon,class:"w-14px h-14px",alt:""},null,8,ev),t("span",tv,r(z.label),1),z.singleFree?(l(),f("span",av,r(e(g)("components-qinghu-ai.pod-material-params.930519-109")),1)):he("",!0)]),t("div",nv,r(z.description),1),t("img",{src:z.highlightImage,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,ov)])],8,Qf))]))]))),128))])],512))}},dv={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"18",height:"18",viewBox:"0 0 18 18",fill:"currentColor"};function pv(u,g){return l(),f("svg",dv,[...g[0]||(g[0]=[Kl('<defs><clipPath id="master_svg0_568_56639"><rect x="0" y="0" width="18" height="18" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_568_56639)"><g><g><g><g><path d="M9.0003125,16.5596765625C8.7753125,16.5596765625,8.5503125,16.5071765625,8.3628225,16.4021765625C6.9603225,15.6371765625,4.5003025,14.8271765625,2.9553025,14.6246765625C2.9553025,14.6246765625,2.7378225,14.5946765625,2.7378225,14.5946765625C1.7553204999999998,14.4746765625,0.9453125,13.5520765625,0.9453125,12.5545765625C0.9453125,12.5545765625,0.9453125,3.4946265625,0.9453125,3.4946265625C0.9453125,2.9021265625,1.1778165,2.3621465625,1.6053165,1.9721475625C2.0328125,1.5821485625,2.5877925,1.3946392625,3.1727925,1.4471392525C4.8152925,1.5821395625,7.3053025,2.4071465625,8.7153125,3.2846465625C8.7153125,3.2846465625,8.8953125,3.3896665625,8.8953125,3.3896665625C8.9478125,3.4121665625,9.0603125,3.4196665625,9.1053125,3.3896665625C9.1053125,3.3896665625,9.2253125,3.3146265625,9.2253125,3.3146265625C9.7278125,2.9996365625,10.3578125,2.6921265625,11.0478125,2.4146245625000002C11.2203125,2.3471245625,11.4153125,2.3696395624999997,11.5728125,2.4746365624999997C11.7303125,2.5796365625,11.8203125,2.7521365625,11.8203125,2.9396265625C11.8203125,2.9396265625,11.8203125,4.949626562500001,11.8203125,4.949626562500001C11.8203125,4.949626562500001,12.4428125,4.537136562500001,12.4428125,4.537136562500001C12.6303125,4.409636562499999,12.8778125,4.409636562499999,13.0653125,4.537136562500001C13.0653125,4.537136562500001,13.6878125,4.949626562500001,13.6878125,4.949626562500001C13.6878125,4.949626562500001,13.6878125,2.0846665625,13.6878125,2.0846665625C13.6878125,1.8146665625,13.8828125,1.5821285625,14.1453125,1.5296285625C14.3628125,1.4921282625,14.5803125,1.4621392625,14.7753125,1.4471392525C14.7903125,1.4471392525,14.8503125,1.4471392525,14.8653125,1.4471392525C15.4128125,1.4021392625,15.9753125,1.5896555625,16.3953125,1.9796555625C16.822812499999998,2.3696535625,17.0553125,2.9096365625000002,17.0553125,3.5021265625C17.0553125,3.5021265625,17.0553125,12.5545765625,17.0553125,12.5545765625C17.0553125,13.5595765625,16.2453125,14.4746765625,15.2553125,14.5946765625C15.2553125,14.5946765625,15.0078125,14.6246765625,15.0078125,14.6246765625C13.4628125,14.8271765625,10.9878125,15.6446765625,9.6153125,16.4021765625C9.4503125,16.5071765625,9.2253125,16.5596765625,9.0003125,16.5596765625C9.0003125,16.5596765625,9.0003125,16.5596765625,9.0003125,16.5596765625ZM2.9852925,2.5571265624999997C2.7452924999999997,2.5571265624999997,2.5278125,2.6396365625,2.3553125,2.7971265625C2.1678125,2.9696365625,2.0628025,3.2171265625,2.0628025,3.4946265625C2.0628025,3.4946265625,2.0628025,12.5545765625,2.0628025,12.5545765625C2.0628025,12.9970765625,2.4453225,13.4245765625,2.8728225,13.4845765625C2.8728225,13.4845765625,3.0978125,13.5146765625,3.0978125,13.5146765625C4.7853125,13.7396765625,7.3728225,14.5870765625,8.8728125,15.4120765625C8.940312500000001,15.4420765625,9.0378125,15.4496765625,9.0753125,15.4346765625C10.5828125,14.6021765625,13.1778125,13.7471765625,14.8728125,13.5221765625C14.8728125,13.5221765625,15.1278125,13.4920765625,15.1278125,13.4920765625C15.5553125,13.4395765625,15.9378125,13.0046765625,15.9378125,12.5621765625C15.9378125,12.5621765625,15.9378125,3.5096365625,15.9378125,3.5096365625C15.9378125,3.2321365625,15.8328125,2.9921465625000003,15.6453125,2.8121465624999997C15.4578125,2.6396465625000003,15.1953125,2.5571365625,14.9253125,2.5721365625C14.9028125,2.5721365625,14.8353125,2.5721365625,14.8203125,2.5721365625C14.8203125,2.5721365625,14.8203125,5.9996465625,14.8203125,5.9996465625C14.8203125,6.2096465625,14.7078125,6.3971265625,14.5203125,6.4946265625C14.3328125,6.5921265625,14.1153125,6.5846365625,13.9428125,6.4646365625C13.9428125,6.4646365625,12.7578125,5.6771565625,12.7578125,5.6771565625C12.7578125,5.6771565625,11.5728125,6.4646365625,11.5728125,6.4646365625C11.4003125,6.5771365625,11.1828125,6.5921265625,10.9953125,6.4946265625C10.8153125,6.3971265625,10.6953125,6.2096465625,10.6953125,5.9996465625C10.6953125,5.9996465625,10.6953125,3.8021465625,10.6953125,3.8021465625C10.3728125,3.9596465625,10.0803125,4.1171465625,9.8253125,4.2671465625C9.8253125,4.2671465625,9.7053125,4.3421365625,9.7053125,4.3421365625C9.2928125,4.597136562499999,8.7078125,4.597136562499999,8.3103225,4.349636562500001C8.3103225,4.349636562500001,8.1303325,4.237166562500001,8.1303325,4.237166562500001C6.8628325,3.4421565625,4.5528025,2.6771265625,3.0828025,2.5571265624999997C3.0453025,2.5571265624999997,3.0152925,2.5571265624999997,2.9852925,2.5571265624999997C2.9852925,2.5571265624999997,2.9852925,2.5571265624999997,2.9852925,2.5571265624999997Z" fill-opacity="1"></path></g><g><path d="M9,15.9296875C8.6925,15.9296875,8.4375,15.6746875,8.4375,15.3671875C8.4375,15.3671875,8.4375,4.1171875,8.4375,4.1171875C8.4375,3.8096875,8.6925,3.5546875,9,3.5546875C9.3075,3.5546875,9.5625,3.8096875,9.5625,4.1171875C9.5625,4.1171875,9.5625,15.3671875,9.5625,15.3671875C9.5625,15.6821875,9.3075,15.9296875,9,15.9296875C9,15.9296875,9,15.9296875,9,15.9296875Z" fill-opacity="1"></path></g><g><path d="M14.25,6.562364375C14.1375,6.562364375,14.03252,6.532374375,13.93501,6.464874375C13.93501,6.464874375,12.75,5.677374375,12.75,5.677374375C12.75,5.677374375,11.564985,6.464874375,11.564985,6.464874375C11.392487,6.577364375,11.175018,6.592344375,10.987518,6.494844375C10.807518,6.397344375,10.6875,6.209874375,10.6875,5.999864375C10.6875,5.999864375,10.6875,2.939854375,10.6875,2.939854375C10.6875,2.707354375,10.829978,2.504846375,11.039978,2.4148463749999998C12.07498,2.002347375,13.2075,1.679852375,14.16,1.529853035C14.325,1.499853075,14.48999,1.552385975,14.61749,1.657386375C14.74499,1.762385375,14.8125,1.919891375,14.8125,2.0848913749999998C14.8125,2.0848913749999998,14.8125,5.999864375,14.8125,5.999864375C14.8125,6.209874375,14.69999,6.397344375,14.51249,6.494844375C14.42999,6.539844375,14.34,6.562364375,14.25,6.562364375C14.25,6.562364375,14.25,6.562364375,14.25,6.562364375ZM12.75,4.4398543749999995C12.855,4.4398543749999995,12.96748,4.469864375,13.06499,4.537364375C13.06499,4.537364375,13.6875,4.949854375,13.6875,4.949854375C13.6875,4.949854375,13.6875,2.767374375,13.6875,2.767374375C13.0875,2.902374375,12.435,3.0973743750000002,11.8125,3.329874375C11.8125,3.329874375,11.8125,4.949854375,11.8125,4.949854375C11.8125,4.949854375,12.43501,4.537364375,12.43501,4.537364375C12.53252,4.469864375,12.645,4.4398543749999995,12.75,4.4398543749999995C12.75,4.4398543749999995,12.75,4.4398543749999995,12.75,4.4398543749999995Z" fill-opacity="1"></path></g><g style="opacity:0;"><path d="" fill-opacity="1"></path></g></g></g></g></g>',2)])])}const mv={render:pv},gv={class:"knowledge-base-selector"},fv={class:"menu-container"},vv={class:"expand-icon"},hv={class:"group-label"},_v={class:"menu-item-content"},yv={class:"flex items-center"},xv=["src"],bv={class:"item-name"},Iv={class:"expand-icon"},Cv={class:"group-label"},kv={class:"menu-item-content"},wv={class:"flex items-center"},Pv=["src"],Mv={class:"item-name"},Sv={key:0,class:"text-12px"},$v=["onClick"],Tv=["onClick"],Av={key:2,class:"text-[#B3B4B8]"},Uv=Dt({__name:"KnowledgeBaseSelector",props:{modelValue:{}},emits:["select"],setup(u,{emit:g}){const{t:i}=mt(),c=Nl(),o=u,x=Kt(),_=h(!1),m=h(""),p=h([]),d=h([]),R=h([{type:"created",label:i("components.KnowledgeBaseSelector.730116-4"),children:[]},{type:"joined",label:i("components.KnowledgeBaseSelector.730116-5"),children:[]},{type:"market",label:i("components.KnowledgeBaseSelector.730116-6"),
1children:[]}]);Ne(()=>o.modelValue,S=>{S?p.value=[S]:p.value=[]},{immediate:!0}),Ne(p,S=>{const O=S.length>0?S[0]:null;c.updateSourcePlatform(O)}),Ne(_,S=>{if(S){U("created"),U("joined"),G();const O=c.logSourcePlatform;O?p.value=[O]:p.value=[]}});const U=async S=>{try{const O={keyword:m.value||void 0,listType:S,pageNum:1,pageSize:100},N=await Sm(O);if(N.code==200){const ae=R.value.find(L=>L.type===S);ae&&(ae.children=(N.payload||[]).filter(L=>!([i("components.KnowledgeBaseSelector.730116-7"),i("components.KnowledgeBaseSelector.730116-8")].includes(L.name)&&L.isDefault)).map(L=>({id:L.id,name:L.name,icon:L.coverImage})))}}catch{}},G=async()=>{var N;const S={keyword:m.value,pageNum:1,pageSize:10},O=await $m(S);if(O.code===200){const ae=R.value.find(L=>L.type==="market");ae&&(ae.children=(((N=O==null?void 0:O.payload)==null?void 0:N.records)||[]).map(L=>({id:L.kbId,name:L.kbName,icon:L.coverImage,isFree:L.isFree,isJoined:L.isJoined})))}},a=F(()=>{if(!m.value.trim())return R.value;const S=m.value.toLowerCase(),O=[];return R.value.forEach(N=>{var ae;if(N.type==="created")N.label.toLowerCase().includes(S)&&O.push(N);else{const L=(ae=N.children)==null?void 0:ae.filter(K=>K.name.toLowerCase().includes(S));L&&L.length>0&&O.push({...N,children:L})}}),O}),E=(S,O)=>{if(O.type!="market")if(p.value[0]===S)p.value=[],c.exampleList=[];else{p.value=[S];let N=null;for(const ae of R.value){if(ae.id===S){c.exampleList=[];break}if(ae.children){const L=ae.children.find(K=>K.id===S);if(L){N=L,c.fetchKnowledgeBaseDetail(N.id);break}}}}},z=S=>{x.push({path:"/ai-knowledge-base/knowledge-base-detail",query:{id:S.id}})},q=async S=>{const O={kbId:S.id},N=await $c(O);N.code===200?(qe.success(i("components.KnowledgeBaseSelector.730116-11")),await U("created"),await U("joined"),await G()):qe.error(N.message||i("components.KnowledgeBaseSelector.730116-12"))};return Rt(()=>{tt(()=>{const S=c.logSourcePlatform;S=="agent"?c.exampleList=[]:c.fetchKnowledgeBaseDetail(S)})}),(S,O)=>{const N=ba,ae=Mo,L=Ts,K=$0,de=$s,W=Bt;return l(),ve(W,{placement:"top",arrow:!1,overlayInnerStyle:{padding:"12px"},open:_.value,"onUpdate:open":O[2]||(O[2]=$=>_.value=$)},{content:P(()=>[t("div",gv,[y(N,{value:m.value,"onUpdate:value":O[0]||(O[0]=$=>m.value=$),placeholder:e(i)("components.KnowledgeBaseSelector.730116-0"),class:"search-input"},{suffix:P(()=>[y(e(cu))]),_:1},8,["value","placeholder"]),t("div",fv,[y(de,{selectedKeys:p.value,openKeys:d.value,"onUpdate:openKeys":O[1]||(O[1]=$=>d.value=$),mode:"inline",style:{"border-right":"none"}},{default:P(()=>[(l(!0),f(we,null,Je(a.value,$=>(l(),f(we,{key:$.type},[$.type==="created"?(l(),ve(K,{key:$.type},{title:P(()=>[t("div",vv,r(d.value.includes($.type)?"-":"+"),1),t("div",hv,r($.label),1)]),default:P(()=>[(l(!0),f(we,null,Je($.children,Y=>(l(),ve(L,{key:Y.id,onClick:j=>E(Y.id,$)},{default:P(()=>[t("div",_v,[t("div",yv,[y(ae,{checked:p.value.includes(Y.id),style:{"margin-right":"8px"}},null,8,["checked"]),t("img",{src:Y.icon?Y.icon:e($l),class:"item-icon mr-8px",alt:"kb"},null,8,xv),t("span",bv,r(Y.name),1)])])]),_:2},1032,["onClick"]))),128))]),_:2},1024)):(l(),ve(K,{key:$.type},{title:P(()=>[t("div",Iv,r(d.value.includes($.type)?"-":"+"),1),t("div",Cv,r($.label),1)]),default:P(()=>[(l(!0),f(we,null,Je($.children,Y=>(l(),ve(L,{key:Y.id,onClick:j=>E(Y.id,$)},{default:P(()=>[t("div",kv,[t("div",wv,[$.type!="market"?(l(),ve(ae,{key:0,checked:p.value.includes(Y.id),style:{"margin-right":"8px"}},null,8,["checked"])):he("",!0),t("img",{src:Y.icon?Y.icon:e($l),class:"item-icon mr-8px",alt:"kb"},null,8,Pv),t("span",Mv,r(Y.name),1)]),$.type=="market"?(l(),f("div",Sv,[Y.isFree&&!Y.isJoined?(l(),f("span",{key:0,class:"text-[#1677ff]",onClick:Be(j=>q(Y),["stop"])},r(e(i)("components.KnowledgeBaseSelector.730116-1")),9,$v)):!Y.isFree&&!Y.isJoined?(l(),f("span",{key:1,class:"text-[#1677ff]",onClick:Be(j=>z(Y),["stop"])},r(e(i)("components.KnowledgeBaseSelector.730116-2")),9,Tv)):Y.isJoined?(l(),f("span",Av,r(e(i)("components.KnowledgeBaseSelector.730116-3")),1)):he("",!0)])):he("",!0)])]),_:2},1032,["onClick"]))),128))]),_:2},1024))],64))),128))]),_:1},8,["selectedKeys","openKeys"])])])]),default:P(()=>[t("div",{class:"text-[#333333] hover:text-[#08C18A] w-18px h-18px curs
1or-pointer",style:Nt({color:e(c).logSourcePlatform?"var(--primary-color)":"#333333"})},[y(e(mv))],4)]),_:1},8,["open"])}}}),Lv=It(Uv,[["__scopeId","data-v-bc4acc80"]]),Ev={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"18",height:"18",viewBox:"0 0 18 18",fill:"currentColor"};function qv(u,g){return l(),f("svg",Ev,[...g[0]||(g[0]=[Kl('<g><g><g><g><path d="M12.375,6.4727303125C12.067499999999999,6.4727303125,11.8125,6.2177303125,11.8125,5.9102303125C11.8125,5.9102303125,11.8125,4.875230312499999,11.8125,4.875230312499999C11.8125,4.0877303125,11.475,3.3227303125,10.89,2.7902303125000003C10.2975,2.2502303125000003,9.532499999999999,2.0027303124999998,8.7225,2.0777303125C7.3725000000000005,2.2052303125,6.1875,3.5852203125,6.1875,5.0252303125C6.1875,5.0252303125,6.1875,5.7527303125,6.1875,5.7527303125C6.1875,6.0602303125,5.9325,6.3152303125,5.625,6.3152303125C5.3175,6.3152303125,5.0625,6.0602303125,5.0625,5.7527303125C5.0625,5.7527303125,5.0625,5.0177303125,5.0625,5.0177303125C5.0625,3.0002303125,6.6899999999999995,1.1402243125,8.6175,0.9527242125C9.7425,0.8477241125,10.8225,1.2002243125,11.6475,1.9577303125C12.465,2.7002303125,12.9375,3.7652303125,12.9375,4.875230312499999C12.9375,4.875230312499999,12.9375,5.9102303125,12.9375,5.9102303125C12.9375,6.2177303125,12.682500000000001,6.4727303125,12.375,6.4727303125C12.375,6.4727303125,12.375,6.4727303125,12.375,6.4727303125Z" fill-opacity="1"></path></g><g><path d="M11.2498503125,17.0625C11.2498503125,17.0625,6.7498603125,17.0625,6.7498603125,17.0625C3.2848603125,17.0625,2.6398603124999998,15.45,2.4748633125,13.8825C2.4748633125,13.8825,1.9123636125,9.39,1.9123636125,9.39C1.8298636125,8.58,1.7998637125,7.4175,2.5873643125,6.5475C3.2623603125000002,5.7975,4.3798603125,5.4375,5.9998603125,5.4375C5.9998603125,5.4375,11.9998703125,5.4375,11.9998703125,5.4375C13.6273703125,5.4375,14.7448703125,5.805,15.4123703125,6.5475C16.1923703125,7.4175,16.169870312500002,8.58,16.0873703125,9.375C16.0873703125,9.375,15.5248703125,13.8825,15.5248703125,13.8825C15.3598703125,15.45,14.7148703125,17.0625,11.2498503125,17.0625C11.2498503125,17.0625,11.2498503125,17.0625,11.2498503125,17.0625ZM5.9998603125,6.5625C4.7323603125,6.5625,3.8623603125,6.8100000000000005,3.4198603125,7.305C3.0523603125000003,7.71,2.9323603125,8.3325,3.0298603125000003,9.2625C3.0298603125000003,9.2625,3.5923603125000003,13.755,3.5923603125000003,13.755C3.7198603125,14.955,4.0498603125,15.945,6.7498603125,15.945C6.7498603125,15.945,11.2498503125,15.945,11.2498503125,15.945C13.9498703125,15.945,14.2798703125,14.9625,14.4073703125,13.77C14.4073703125,13.77,14.9698703125,9.2625,14.9698703125,9.2625C15.0673703125,8.3475,14.9473703125,7.725,14.5798703125,7.3125C14.1373703125,6.8100000000000005,13.2673703125,6.5625,11.9998703125,6.5625C11.9998703125,6.5625,5.9998603125,6.5625,5.9998603125,6.5625C5.9998603125,6.5625,5.9998603125,6.5625,5.9998603125,6.5625Z" fill-opacity="1"></path></g><g><path d="M11.5651171875,9.86328125C11.1451171875,9.86328125,10.8076171875,9.52578125,10.8076171875,9.11328125C10.8076171875,8.70078125,11.1451171875,8.36328125,11.5576171875,8.36328125C11.9701171875,8.36328125,12.3076171875,8.70078125,12.3076171875,9.11328125C12.3076171875,9.52578125,11.9776171875,9.86328125,11.5651171875,9.86328125C11.5651171875,9.86328125,11.5651171875,9.86328125,11.5651171875,9.86328125Z" fill-opacity="1"></path></g><g><path d="M6.3151171875,9.86328125C5.8951171875,9.86328125,5.5576171875,9.52578125,5.5576171875,9.11328125C5.5576171875,8.70078125,5.8951171875,8.36328125,6.3076171875,8.36328125C6.7201171875,8.36328125,7.0576171875,8.70078125,7.0576171875,9.11328125C7.0576171875,9.52578125,6.7276171875,9.86328125,6.3151171875,9.86328125C6.3151171875,9.86328125,6.3151171875,9.86328125,6.3151171875,9.86328125Z" fill-opacity="1"></path></g><g style="opacity:0;"></g></g></g></g>',1)])])}const Dv={render:qv},Ov={class:"knowledge-base-selector"},Nv={key:0,class:"menu-container"},Rv={class:"menu-item-content"},Fv={class:"flex items-center"},Gv=["src"],Vv={class:"item-name"},zv={class:"text-12px"},Bv=["onClick"],Kv=["onClick"],Wv=["onClick"],jv={key:3,class:"text-[#B3B4B8]"},Hv=Dt({__name:"SelectionKnowledgeBaseSelector",props:{modelValue:{}},emits:["select"],setup(u,{expose:g,emit:i}){const{t:c}=mt();bt();const o=bs.PRESENTED_IMAGE_SIMPLE,x=Nl();let _={};const m=u,p=Kt(),d=h(!1),R=h(""),U=h([]),G=h([]),a=h([]);Ne(()=>m.modelValue,W=>{W?U.value=[W]:U.value=[]},{immediate:!0}),Ne(U,W=>{const $=W.length>0?W[0]:null;x.updateSourcePlatform($)}),Ne(d,W=>{W&&de()});const E=async()=>{const W=await Tm("SEARCH_WORDS");W.code===200&&(a.value=W==null?void 0:W.payload.map($=>({id:$.id,name:$.name,icon:$.coverImage,isFree:$.isPaid,extendJson:$.extendJson,...$})))},z=F(()=>
1{if(!R.value.trim())return a.value;const W=R.value.toLowerCase(),$=[];return a.value.forEach(Y=>{Y.name.toLowerCase().includes(W)&&$.push(Y)}),$}),q=F(()=>z.value.some(W=>W.id===x.logSourcePlatform)),S=async W=>{if(W.price>0&&!W.expireTime){L(W);return}if(W.requireShopAuth&&W.authStatus!=="success"){await O(W);return}if(!W.isJoined){await K(W);return}N(W)};async function O(W){if(W.requireShopAuth&&W.authStatus!=="success"){Zt.confirm({title:c("components.SelectionKnowledgeBaseSelector.738228-7"),icon:y(ra),zIndex:3e3,okText:c("components.SelectionKnowledgeBaseSelector.738228-1"),cancelText:c("components.SelectionKnowledgeBaseSelector.738228-8"),async onOk(){let $=JSON.parse((W==null?void 0:W.extendJson)||"{}");if(!_[W.id]&&$.selectProductType==="xiaofeng1688auth"){let j=(await ae($)).auth;_[W.id]=j,j||Am(async()=>{let V=await ae($);V.auth&&N(W),_[W.id]=V.auth},{authUrl:$.authUrl})}}});return}}function N(W){U.value[0]===W.id?(U.value=[],x.exampleList=[]):(U.value=[W.id],x.fetchKnowledgeBaseDetail(W.id))}async function ae(W){var $;if(($=W==null?void 0:W.remoteConfig)!=null&&$.url)try{const{url:Y,method:j="GET",params:V={}}=W.remoteConfig,{success:w,payload:I}=j==="POST"?await Tl(Y,V):await Al(Y,V);return w?I:""}catch{}}const L=W=>{Zt.confirm({title:c("components.SelectionKnowledgeBaseSelector.738228-9"),icon:y(ra),zIndex:3e3,okText:c("components.SelectionKnowledgeBaseSelector.738228-2"),cancelText:c("components.SelectionKnowledgeBaseSelector.738228-8"),onOk(){p.push({path:"/ai-knowledge-base/knowledge-base-detail",query:{id:W.id}})}})},K=async W=>{Zt.confirm({title:c("components.SelectionKnowledgeBaseSelector.738228-10"),icon:y(ra),zIndex:3e3,okText:c("components.SelectionKnowledgeBaseSelector.738228-3"),cancelText:c("components.SelectionKnowledgeBaseSelector.738228-8"),async onOk(){const $={kbId:W.id},Y=await $c($);Y.code===200?(qe.success(c("components.SelectionKnowledgeBaseSelector.738228-11")),x.logSourcePlatform=W.id,await E(),N(W)):qe.error(Y.message||c("components.SelectionKnowledgeBaseSelector.738228-12"))}})},de=()=>{E();const W=x.logSourcePlatform;W?U.value=[W]:U.value=[]};return g({popoverVisible:d}),Rt(()=>{tt(()=>{const W=x.logSourcePlatform;W=="agent"?x.exampleList=[]:x.fetchKnowledgeBaseDetail(W),de()})}),(W,$)=>{const Y=ba,j=Mo,V=Ts,w=$s,I=bs,k=Bt;return l(),ve(k,{placement:"top",arrow:!1,overlayInnerStyle:{padding:"12px"},open:e(d),"onUpdate:open":$[2]||($[2]=B=>Fe(d)?d.value=B:null)},{content:P(()=>[t("div",Ov,[y(Y,{value:e(R),"onUpdate:value":$[0]||($[0]=B=>Fe(R)?R.value=B:null),placeholder:e(c)("components.SelectionKnowledgeBaseSelector.738228-0"),class:"search-input"},{suffix:P(()=>[y(e(cu))]),_:1},8,["value","placeholder"]),e(z).length?(l(),f("div",Nv,[y(w,{selectedKeys:e(U),openKeys:e(G),"onUpdate:openKeys":$[1]||($[1]=B=>Fe(G)?G.value=B:null),mode:"inline",style:{"border-right":"none"}},{default:P(()=>[(l(!0),f(we,null,Je(e(z),B=>(l(),ve(V,{key:B.id,onClick:be=>S(B)},{default:P(()=>[t("div",Rv,[t("div",Fv,[y(j,{checked:e(U).includes(B.id),style:{"margin-right":"8px"}},null,8,["checked"]),t("img",{src:B.icon?B.icon:e($l),class:"item-icon mr-8px",alt:"kb"},null,8,Gv),t("span",Vv,r(B.name),1)]),t("div",zv,[B.requireShopAuth&&B.authStatus!=="success"?(l(),f("span",{key:0,class:"text-[#1677ff]",onClick:Be(be=>O(B),["stop"])},r(e(c)("components.SelectionKnowledgeBaseSelector.738228-1")),9,Bv)):B.price>0&&!B.expireTime?(l(),f("span",{key:1,class:"text-[#1677ff]",onClick:Be(be=>L(B),["stop"])},r(e(c)("components.SelectionKnowledgeBaseSelector.738228-2")),9,Kv)):B.isJoined?(l(),f("span",jv,r(e(c)("components.SelectionKnowledgeBaseSelector.738228-4")),1)):(l(),f("span",{key:2,class:"text-[#1677ff]",onClick:Be(be=>K(B),["stop"])},r(e(c)("components.SelectionKnowledgeBaseSelector.738228-3")),9,Wv))])])]),_:2},1032,["onClick"]))),128))]),_:1},8,["selectedKeys","openKeys"])])):(l(),ve(I,{key:1,image:e(o)},null,8,["image"]))])]),default:P(()=>[t("div",{class:"text-[#333333] hover:text-[var(--primary-color)] h-18px cursor-pointer flex items-center",style:Nt({color:e(q)?"var(--primary-color)":"#333333"})},[y(e(Dv),{class:"w-18px h-18px mr-4px"}),De(r(e(c)("components.SelectionKnowledgeBaseSelector.738228-5")),1)],4)]),_:1},8,["open"])}}}),Jv=It(Hv,[["__scopeId","data-v-b3e2050f"]]),Yv={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"14",height:"14",viewBox:"0 0 14 14",fill:"
1currentColor"};function Qv(u,g){return l(),f("svg",Yv,[...g[0]||(g[0]=[Kl('<defs><clipPath id="master_svg1_635_53828"><rect x="0" y="0" width="14" height="14" rx="0"></rect></clipPath></defs><g mask="url(#master_svg0_588_62186)"><g clip-path="url(#master_svg1_635_53828)"><path d="M4.500002353125,9.2245655L4.439002553125,9.2245655C4.155781253125,9.2232227,3.873394253125,9.1937456,3.596002353125,9.1365662C3.362937953125,9.0890703,3.212505553125,8.8616304,3.260002153125,8.6285658C3.307498653125,8.3955016,3.534937853125,8.2450695,3.768002253125,8.2925658C4.001370453125,8.339856600000001,4.238890153125,8.363642200000001,4.477002153125,8.363565399999999C4.717095853125,8.362959400000001,4.913558453125,8.5545321,4.919002053125,8.7945652C4.924035553125,9.0298023,4.735290053125,9.2235031,4.500002353125,9.2245655ZM6.100002253125,8.8755655C5.897302653125,8.8756895,5.722042053125,8.7342396,5.679373253125,8.5360813C5.636703953125,8.3379245,5.738215453125,8.1368771,5.923002253125,8.053565500000001C6.146090053125,7.9521837,6.358198153125,7.8282027,6.556002153125,7.6835656C6.747644853125,7.5427332,7.017168553125,7.5839229,7.158001453125,7.7755661C7.298833853125,7.9672084,7.257644653125,8.236732499999999,7.066001853125,8.3775654C6.820150853125,8.5583229,6.556043653125,8.7128325,6.278001753125,8.8385658C6.222170353125,8.8628168,6.161870953125,8.875082,6.101001753125,8.8745651L6.100002253125,8.8755655ZM2.181002153125,8.4885654C2.0910469531249998,8.4886818,2.0032989531250003,8.4607143,1.930002253125,8.408565C1.682911253125,8.230334299999999,1.454422253125,8.0276423,1.248002153125,7.803565C1.087011043125,7.628767,1.098203833125,7.3565559,1.273001953125,7.1955647C1.447800153125,7.0345736,1.720011153125,7.0457664,1.881002153125,7.2205648C2.047514053125,7.4016294,2.232145553125,7.5651503,2.432002353125,7.7085648C2.584358253125,7.8173013,2.648871153125,8.0121055,2.591533453125,8.1902866C2.534195853125,8.3684669,2.368180753125,8.4890881,2.181002153125,8.4885654ZM7.900002453125,7.2395654C7.824879153125,7.2398591,7.751026153125,7.2201881,7.686002253125,7.1825652C7.479510353125,7.064755,7.408199353125,6.8014879,7.527001853125,6.5955658C7.649415953125,6.3826089,7.749929953125,6.157793,7.827002053125,5.9245653C7.899712553125,5.6985183,8.141855253125,5.5741649,8.367938053125,5.6467652C8.594019853125,5.7193656,8.718491553125,5.9614472,8.646001853125,6.1875653C8.552957553125,6.4783535,8.429614053125,6.7585583,8.278001753125,7.0235653C8.200372653125,7.1580448,8.056270153125,7.2402244,7.901001953125,7.238565L7.900002453125,7.2395654ZM0.733002483125,6.5315652C0.547899033125,6.5315967,0.383547093125,6.4131665,0.32500244312500004,6.2375655C0.226946773125,5.9481511,0.159904167125,5.6491408,0.125002448725,5.3455653C0.098674418125,5.1092401,0.268715903125,4.8962407,0.505002443125,4.869565C0.740140203125,4.8466172,0.950774963125,5.0151253,0.980002463125,5.2495651C1.0075242531250002,5.4927669,1.060480653125,5.7324114,1.138002553125,5.9645653C1.213068053125,6.1901903,1.0907622531249999,6.4339056,0.865002453125,6.5085654C0.823122623125,6.5227962,0.779232803125,6.5302238,0.735002513125,6.5305653L0.733002483125,6.5315652ZM8.396002753125,4.8575654C8.175979653125,4.8572907,7.991485553125,4.6913323,7.968002353125,4.472565400000001C7.942243053125,4.2288682,7.890961653125,3.9885502,7.815001953125,3.7555652C7.741271953125,3.5296807,7.864617853125,3.2867949,8.090502253124999,3.2130649C8.316387153125,3.1393352,8.559272753125,3.2626808,8.633002253125,3.4885652C8.727602953125,3.7787654,8.791617353125,4.0780575,8.824002253125,4.3815650999999995C8.849061053125,4.6180043,8.677482653125,4.8299012,8.441001853125,4.8545651L8.396002753125,4.8575654ZM0.712002163125,4.0975652C0.421243783125,4.098110699999999,0.213774189125,3.8159316,0.301002173125,3.5385654C0.392620953125,3.2475631,0.514626983125,2.9670162,0.665002163125,2.7015655C0.779452203125,2.4894953,1.045813863125,2.4128689000000003,1.255458253125,2.5317047C1.465102453125,2.6505406,1.536172553125,2.9184382,1.413002253125,3.1255655C1.292852753125,3.3385952,1.195001353125,3.563452,1.121002193125,3.7965653C1.0644961631249998,3.9757903,0.897921983125,4.0973773,0.710002183125,4.096565200000001L0.712002163125,4.0975652ZM7.401002453125,2.6365654C7.279317853125,2.6367314,7.163314853125,2.5850937,7.082002153125,2.4945652C6.917806653125,2.3124188,6.734786953125,2.1481699,6.536002153125,2.0045653999999997C6.349496353125,1.8625678,6.310262253125,1.5977434,6.447585553125,1.40777004C6.584909453125,1.2177968,6.848677653125,1.17200017,7.042001753125,1.30456531C
17.288558953125,1.4834428,7.515788553125,1.6875468,7.720001653125,1.9135654C7.834425953125,2.0396291,7.863698053125,2.2213316,7.794653453125,2.3769519C7.725608853125,2.5325723,7.571250953125,2.6328032,7.401001953125,2.6325653L7.401002453125,2.6365654ZM2.122002353125,2.1145654C1.936731553125,2.1142808,1.772473053125,1.9953589,1.714362053125,1.819437C1.656250953125,1.6435151,1.717354453125,1.45015103,1.866002453125,1.33956546C2.110678453125,1.1567117,2.374170553125,1.00049376,2.652002553125,0.87356541C2.867945953125,0.77470648,3.123143453125,0.86962205,3.222002253125,1.08556539C3.320861353125,1.30150872,3.225945753125,1.5567064,3.010002353125,1.6555655C2.787602153125,1.7580492,2.576465853125,1.8833905,2.380002453125,2.0295655C2.306244853125,2.0842541,2.216823053125,2.1137108,2.125002353125,2.1135656000000003L2.122002353125,2.1145654ZM5.294002553125,1.42156541C5.264106753125,1.4215898500000002,5.234287253125,1.41857433,5.205002353125,1.41256553C4.964303053125,1.36188358,4.718979353125,1.33641279,4.473002453125,1.33656549C4.230738653125,1.33843923,4.030276553125001,1.14857429,4.019002453125,0.90656549C4.008232553125,0.6741531000000001,4.192355153125,0.4791466047,4.425002053125,0.4765655040742L4.463002253125,0.4765655040742C4.771422853125,0.47620882033,5.079055353125,0.507709274,5.381002453125,0.570565484C5.596930553125,0.61545096,5.743892653125,0.81642112,5.721207153125,1.0357952099999999C5.698522053125,1.25516939,5.513546453125,1.42181456,5.293002653125,1.4215655900000002L5.294002553125,1.42156541Z" fill-opacity="1" style="mix-blend-mode:passthrough;"></path><path d="M9.5009999,13.5252666C7.0857242,13.5291376,5.12554847717,11.5725446,5.125,9.1572657C5.12596237182,8.9611077,5.141001435,8.7652707,5.170000229,8.5712657L6.0219999600000005,8.6942656C5.99864614,8.8475056,5.98661333,9.002257799999999,5.98600024,9.1572657C5.98710251,11.096797500000001,7.5614707,12.6675825,9.5009999,12.664266099999999C10.4339032,12.6644135,11.3287339,12.2943244,11.9890003,11.6352663C12.648710699999999,10.9796891,13.0185523,10.0873165,13.0160003,9.1572657C13.016335999999999,6.8135977,10.7652669,5.12679702,8.5160005,5.7852656L8.2670004,4.96126534C8.6689284,4.840785142,9.0864043,4.7801354218,9.506000499999999,4.781265487671C11.9205904,4.781265487671,13.8780012,6.7386769,13.8780012,9.1532655C13.8780012,11.5678544,11.9205904,13.5252657,9.506000499999999,13.5252657L9.5009999,13.5252666Z" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g>',2)])])}const Xv={render:Qv},Zv={xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"14",height:"14",viewBox:"0 0 14 14",fill:"currentColor"};function eh(u,g){return l(),f("svg",Zv,[...g[0]||(g[0]=[t("rect",{x:"2.5",y:"1.5",width:"9",height:"11",rx:"1.5","stroke-width":"1",style:{fill:"transparent",stroke:"#3D3D3D"}},null,-1)])])}const Qr={render:eh},th={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"14",height:"14",viewBox:"0 0 14 14",fill:"currentColor"};function ah(u,g){return l(),f("svg",th,[...g[0]||(g[0]=[t("path",{d:"M3.9375,4.4745986C3.9375,4.7162213,4.13337517,4.9120989,4.375,4.9120989C4.61662483,4.9120989,4.8125,4.7162213,4.8125,4.4745986C4.8125,4.4745986,3.9375,4.4745986,3.9375,4.4745986C3.9375,4.4745986,3.9375,4.4745986,3.9375,4.4745986ZM6.7433331,1.18459776C6.7433331,1.18459776,6.7839916,1.62020713,6.7839916,1.62020713C6.7839916,1.62020713,6.7855783,1.62005311,6.7855783,1.62005311C6.7855783,1.62005311,6.7433331,1.18459776,6.7433331,1.18459776C6.7433331,1.18459776,6.7433331,1.18459776,6.7433331,1.18459776ZM9.1875,4.6029322C9.1875,4.8445544,9.3833771,5.040432,9.625,5.040432C9.8666224,5.040432,10.0625,4.8445544,10.0625,4.6029322C10.0625,4.6029322,9.1875,4.6029322,9.1875,4.6029322C9.1875,4.6029322,9.1875,4.6029322,9.1875,4.6029322ZM4.8125,4.4745986C4.8125,4.4745986,4.8125,3.9087656,4.8125,3.9087656C4.8125,3.9087656,3.9375,3.9087656,3.9375,3.9087656C3.9375,3.9087656,3.9375,4.4745986,3.9375,4.4745986C3.9375,4.4745986,4.8125,4.4745986,4.8125,4.4745986C4.8125,4.4745986,4.8125,4.4745986,4.8125,4.4745986ZM4.8125,3.9087656C4.8125,2.7960222,5.7214732,1.7193726900000001,6.7839916,1.62020421C6.7839916,1.62020421,6.7026751,0.748990691,6.7026751,0.748990691C5.1401932,0.89482285,3.9375,2.396503,3.9375,3.9087656C3.9375,3.9087656,4.8125,3.9087656,4.8125,3.9087656C4.8125,3.9087656,4.8125,3.9087656,4.8125,3.9087656ZM6.7855783,1.62005311C8.0882196,1.4936775,9.1875,2.5184721999999997,9.1875,3.7979321C9.1875,3.7979321,10.
10625,3.7979321,10.0625,3.7979321C10.0625,2.0090531,8.5251131,0.57218646,6.7010882,0.749142357C6.7010882,0.749142357,6.7855783,1.62005311,6.7855783,1.62005311C6.7855783,1.62005311,6.7855783,1.62005311,6.7855783,1.62005311ZM9.1875,3.7979321C9.1875,3.7979321,9.1875,4.6029322,9.1875,4.6029322C9.1875,4.6029322,10.0625,4.6029322,10.0625,4.6029322C10.0625,4.6029322,10.0625,3.7979321,10.0625,3.7979321C10.0625,3.7979321,9.1875,3.7979321,9.1875,3.7979321C9.1875,3.7979321,9.1875,3.7979321,9.1875,3.7979321Z","fill-opacity":"1"},null,-1),t("path",{d:"M11.637373671875,10.75213525C11.637373671875,10.75213525,11.203198471875,10.69788505,11.203198471875,10.69788505C11.203198471875,10.69788505,11.202382071875,10.70552685,11.202382071875,10.70552685C11.202382071875,10.70552685,11.637373671875,10.75213525,11.637373671875,10.75213525C11.637373671875,10.75213525,11.637373671875,10.75213525,11.637373671875,10.75213525ZM12.074873671875,7.25213525C12.074873671875,7.25213525,12.509048671875,7.30640865,12.509048671875,7.30640865C12.509048671875,7.30640865,12.509748671875,7.3002543499999994,12.509748671875,7.3002543499999994C12.509748671875,7.3002543499999994,12.074873671875,7.25213525,12.074873671875,7.25213525C12.074873671875,7.25213525,12.074873671875,7.25213525,12.074873671875,7.25213525ZM1.924876241875,7.25213525C1.924876241875,7.25213525,1.489987145875,7.30026035,1.489987145875,7.30026035C1.489987145875,7.30026035,1.4907548128750001,7.30640265,1.4907548128750001,7.30640265C1.4907548128750001,7.30640265,1.924876241875,7.25213525,1.924876241875,7.25213525C1.924876241875,7.25213525,1.924876241875,7.25213525,1.924876241875,7.25213525ZM2.362376091875,10.75213525C2.362376091875,10.75213525,2.7974535718749998,10.70552685,2.7974535718749998,10.70552685C2.7974535718749998,10.70552685,2.796496871875,10.69788505,2.796496871875,10.69788505C2.796496871875,10.69788505,2.362376091875,10.75213525,2.362376091875,10.75213525C2.362376091875,10.75213525,2.362376091875,10.75213525,2.362376091875,10.75213525ZM5.249874071875,13.27213475C5.249874071875,13.27213475,8.749874071875,13.27213475,8.749874071875,13.27213475C8.749874071875,13.27213475,8.749874071875,12.39713475,8.749874071875,12.39713475C8.749874071875,12.39713475,5.249874071875,12.39713475,5.249874071875,12.39713475C5.249874071875,12.39713475,5.249874071875,13.27213475,5.249874071875,13.27213475C5.249874071875,13.27213475,5.249874071875,13.27213475,5.249874071875,13.27213475ZM8.749874071875,13.27213475C9.967231771875,13.27213475,10.790665671875,13.03069305,11.322139771875,12.54512695C11.857641671875,12.055943450000001,12.008140671875,11.39846845,12.072365671875,10.79874375C12.072365671875,10.79874375,11.202382071875,10.70552685,11.202382071875,10.70552685C11.144107771875,11.24913505,11.023416471875,11.63291025,10.731982271875,11.89914365C10.436582571875,12.16899345,9.877573971875,12.39713475,8.749874071875,12.39713475C8.749874071875,12.39713475,8.749874071875,13.27213475,8.749874071875,13.27213475C8.749874071875,13.27213475,8.749874071875,13.27213475,8.749874071875,13.27213475ZM12.071491671875,10.80638505C12.071491671875,10.80638505,12.508991671875,7.30640265,12.508991671875,7.30640265C12.508991671875,7.30640265,11.640757671875,7.19786765,11.640757671875,7.19786765C11.640757671875,7.19786765,11.203257571875,10.69788505,11.203257571875,10.69788505C11.203257571875,10.69788505,12.071491671875,10.80638505,12.071491671875,10.80638505C12.071491671875,10.80638505,12.071491671875,10.80638505,12.071491671875,10.80638505ZM12.509748671875,7.3002543499999994C12.592290671875,6.55429955,12.544281671875,5.75378525,12.031999671875,5.14468563C11.515515671875,4.53063631,10.629957171875,4.23046875,9.333207171875,4.23046875C9.333207171875,4.23046875,9.333207171875,5.10546875,9.333207171875,5.10546875C10.527290371875,5.10546875,11.091373471875,5.38571955,11.362332371875,5.70791785C11.637549671875,6.03506875,11.715015671875,6.52663775,11.640056671875,7.2040159500000005C11.640056671875,7.2040159500000005,12.509748671875,7.3002543499999994,12.509748671875,7.3002543499999994C12.509748671875,7.3002543499999994,12.509748671875,7.3002543499999994,12.509748671875,7.3002543499999994ZM9.333207171875,4.23046875C9.333207171875,4.23046875,4.666540871875,4.23046875,4.666540871875,4.23046875C4.666540871875,4.23046875,4.666540871875,5.10546875,4.666540871875,5.10546875C4.666540871875,5.10546875,9.333207171875,5.10546875,9.333207171875,5.10546875C9.333207171875,5.10546875,9.333207171875,4.23046875,9.333207171875,4.23046875C9.333207171875,4.23046875,9.333207171875,4.23046875,9.333207171875,4.23046875ZM4.666540871875,4.23046875C3.369773471875,4.23046875,2.484261871875,4.53063631,1.967773851875,5.14468563C1.455447980475,5.75378525,1.407486315875,6.55429955,1.490030310875,7.3002543499999994C1.490030310875,7.3002543499999994,2.359721961875,7.2040159500000005,2.359721961875,7.2040159500000005C2.2847659618750003,6.52663775,2.362220941875,6.03506875,2.637392771875,5.70791785C2.9084034718750003,5.38571955,3.472480971875,5.10546875,4.666540871875,5.10546875C4.666540871875,5.10546875,4.666540871875,4.23046875,4.666540871875,4.23046875C4.666540871875,4.23046875,4.666540871875,4.23046875,4.666540871875,4.23046875ZM1.4907548128750001,7.30640265C1.4907548128750001,7.30640265,1.928254841875,10.80638505,1.928254841875,10.80638505C1.928254841875,10.80638505,2.796496871875,10.69788505,2.796496871875,10.69788505C2.796496871875,10.69788505,2.358998061875,7.19786765,2.358998061875,7.19786765C2.358998061875,7.19786765,1.4907548128750001,7.30640265,1.4907548128750001,7.30640265C1.4907548128750001,7.30640265,1.4907548128750001,7.30640265,1.4907548128750001,7.30640265ZM1.9273661418749999,10.79874375C1.9916211318750001,11.39846845,2.142139791875,12.055943450000001,2.677601771875,12.54512695C3.209100171875,13.03069305,4.032545071875,13.27213475,5.249874071875,13.27213475C5.249874071875,13.27213475,5.249874071875,12.39713475,5.249874071875,12.39713475C4.122203371875,12.39713475,3.563148471875,12.16899345,3.267777671875,11.89914365C2.976361871875,11.63291025,2.855629471875,11.24913505,2.7973892718749997,10.70552685C2.7973892718749997,10.70552685,1.9273661418749999,10.79874375,1.9273661418749999,10.79874375C1.9273661418749999,10.79874375,1.9273661418749999,10.79874375,1.9273661418749999,10.79874375Z","fill-opacity":"1"},null,-1),t("path",{d:"M9.0390625,6.5625C8.79743767,6.5625,8.6015625,6.75837517,8.6015625,7C8.6015625,7.24162483,8.79743767,7.4375,9.0390625,7.4375C9.0390625,7.4375,9.0390625,6.5625,9.0390625,6.5625C9.0390625,6.5625,9.0390625,6.5625,9.0390625,6.5625ZM9.04430196,7.4375C9.28592676,7.4375,9.48180193,7.24162483,9.48180193,7C9.48180193,6.75837517,9.28592676,6.5625,9.04430196,6.5625C9.04430196,6.5625,9.04430196,7.4375,9.04430196,7.4375C9.04430196,7.4375,9.04430196,7.4375,9.04430196,7.4375ZM9.0390625,7.4375C9.0390625,7.4375,9.04430196,7.4375,9.04430196,7.4375C9.04430196,7.4375,9.04430196,6.5625,9.04430196,6.5625C9.04430196,6.5625,9.0390625,6.5625,9.0390625,6.5625C9.0390625,6.5625,9.0390625,7.4375,9.0390625,7.4375C9.0390625,7.4375,9.0390625,7.4375,9.0390625,7.4375Z","fill-opacity":"1"},null,-1),t("path",{d:"M4.955078125,6.5625C4.713453295,6.5625,4.517578125,6.75837517,4.517578125,7C4.517578125,7.24162483,4.713453295,7.4375,4.955078125,7.4375C4.9550
178125,7.4375,4.955078125,6.5625,4.955078125,6.5625C4.955078125,6.5625,4.955078125,6.5625,4.955078125,6.5625ZM4.960317585,7.4375C5.201942385,7.4375,5.397817555,7.24162483,5.397817555,7C5.397817555,6.75837517,5.201942385,6.5625,4.960317585,6.5625C4.960317585,6.5625,4.960317585,7.4375,4.960317585,7.4375C4.960317585,7.4375,4.960317585,7.4375,4.960317585,7.4375ZM4.955078125,7.4375C4.955078125,7.4375,4.960317585,7.4375,4.960317585,7.4375C4.960317585,7.4375,4.960317585,6.5625,4.960317585,6.5625C4.960317585,6.5625,4.955078125,6.5625,4.955078125,6.5625C4.955078125,6.5625,4.955078125,7.4375,4.955078125,7.4375C4.955078125,7.4375,4.955078125,7.4375,4.955078125,7.4375Z","fill-opacity":"1"},null,-1)])])}const Xr={render:ah},nh={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor"};function oh(u,g){return l(),f("svg",nh,[...g[0]||(g[0]=[t("defs",null,[t("clipPath",{id:"master_svg0_943_86169"},[t("rect",{x:"12",y:"0",width:"12",height:"12",rx:"0"})])],-1),t("g",{transform:"matrix(0,1,-1,0,12,-12)","clip-path":"url(#master_svg0_943_86169)"},[t("g",null,[t("path",{d:"M16.14651731,3.35348269Q16.07620522,3.28317061,16.03815264,3.19130346Q16.00009999,3.099436291,16.00009999,3Q16.00010002,2.950764146,16.00970545,2.902474351Q16.01931089,2.85418455,16.03815264,2.80869657Q16.05699438,2.76320857,16.08434835,2.72227046Q16.11170232,2.68133235,16.14651734,2.64651734Q16.18133235,2.61170232,16.22227046,2.58434838Q16.26320857,2.55699441,16.30869657,2.53815266Q16.35418455,2.51931089,16.402474351,2.5097054500000002Q16.450764146,2.50010002,16.5,2.50009999Q16.599436291,2.50009999,16.69130346,2.53815264Q16.78317061,2.57620522,16.85348269,2.64651731L16.85355338,2.64644662L19.8535533,5.6464467Q19.9238794,5.7167726000000005,19.9619396,5.808658100000001Q19.9999998,5.9005437,19.9999998,5.999999799999999Q19.9999998,6.099455799999999,19.9619396,6.191341400000001Q19.9238794,6.2832272,19.8535533,6.3535533L16.85355338,9.3535528L16.85348293,9.3534822Q16.78317082,9.4237938,16.6913036,9.4618468Q16.599436373,9.4998994,16.5,9.499899899999999Q16.450764146,9.499899899999999,16.402474351,9.490294500000001Q16.35418455,9.480689,16.30869657,9.4618468Q16.26320857,9.4430056,16.22227046,9.4156513Q16.18133235,9.388297099999999,16.14651734,9.3534822Q16.11170232,9.3186669,16.08434838,9.277729Q16.05699441,9.2367907,16.03815266,9.191302799999999Q16.01931089,9.145814900000001,16.00970545,9.0975251Q16.00010002,9.0492353,16.00009999,9Q16.00009999,8.9005642,16.03815264,8.808696699999999Q16.07620522,8.7168293,16.14651731,8.6465173L16.14644662,8.6464467L18.7928934,6L16.14644662,3.35355338L16.14651731,3.35348269Z","fill-rule":"evenodd","fill-opacity":"1"})])],-1)])])}const cs={render:oh},sh={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor"};function lh(u,g){return l(),f("svg",sh,[...g[0]||(g[0]=[t("defs",null,[t("clipPath",{id:"master_svg0_1008_97590"},[t("rect",{x:"12",y:"0",width:"12",height:"12",rx:"0"})])],-1),t("g",{transform:"matrix(-1,0,0,1,24,0)","clip-path":"url(#master_svg0_1008_97590)"},[t("g",null,[t("path",{d:"M22.1709642125,6.7338781L22.1709642125,3.0218623C22.1709633125,2.6927944,21.904201512500002,2.4260330999999997,21.5751352125,2.4260330999999997L14.4251839125,2.4260330999999997C14.0961163125,2.4260333999999997,13.8293546125,2.6927952,13.8293546125,3.0218625L13.8293546125,8.878863800000001L18.8700695125,5.8580098C19.4365826125,5.5176497,20.1446676125,5.5176497,20.7111816125,5.8580098L22.1709642125,6.7338781ZM22.1709642125,8.1221604L20.0915198125,6.8768773C19.9071698125,6.770443,19.6800408125,6.770443,19.4956903125,6.8768773L14.9793045125,9.5759821L21.575134312499998,9.5759821C21.904201512500002,9.5759821,22.1709633125,9.3092213,22.1709633125,8.980153600000001L22.1709642125,8.1221604ZM14.425183412500001,1.234375L21.575134312499998,1.234375C22.562336012499998,1.23437477111817,23.3626203125,2.0346601,23.3626213125,3.0218625L23.3626213125,8.980153600000001C23.3626203125,9.9673557,22.562336012499998,10.767642,21.575134312499998,10.767642L14.4251829125,10.767642C13.4379807725,10.767642,12.637695369720461,9.9673557,12.6376953125,8.980153600000001L12.6376953125,3.0218625C12.63769514083862,2.03466034,13.4379805925,1.23437477111817,14.425183412500001,1.234375ZM15.9147565125,5.405179C15.4211554125,5.4051785,15.0210128125,5.0050361,15.0210128125,4.5114350000000005C15.0210128125,4.017833899999999,15.4211554125,3.6176913,15.9147565125,3.6176913C16.4083576125,3.6176913,16.8085003125,4.017833899999999,16.8085003125,4.5114355C16.8085003125,5.0050366,16.4083576125,5.4051785,15.9147565125,5.405179Z","fill-opacity":"1",style:{"mix-blend-mode":"passthrough"}})])],-1)])])}const ih={render:lh},rh={class:"popover-title"},ch={key:0,class:"popover-desc"},uh={class:"image-num-list mt-16px"},dh=["onClick"],ph={class:"popover-item-label"},mh={key:0,src:Rg,alt:""},gh={class:"line-height-1 ml-4px"},fh={__name:"count-select-popover",props:{open:{type:Boolean,default:!1},title:{type:String,default:""},description:{type:String,default:""},options:{type:Array,default:()=>[]},value:{type:[Number,String],default:1},buttonLabel:{type:String,default:""},isChatPinned:{type:Boolean,default:!1},popoverWidth:{type:Number,default:404},isOptionDisabled:{type:Function,default:()=>!1}},emits:["update:open","select"],setup(u,{emit:g}){const i=u,c=g,o=F({get:()=>
1i.open,set:_=>c("update:open",_)}),x=_=>{i.isOptionDisabled(_)||c("select",_)};return(_,m)=>{const p=Lt,d=Bt;return l(),ve(d,{open:e(o),"onUpdate:open":m[0]||(m[0]=R=>Fe(o)?o.value=R:null),placement:"top",arrow:!1,trigger:"click",getPopupContainer:R=>R.parentNode},{content:P(()=>[t("div",{class:"popover-content count-select-popover",style:Nt({width:`${u.popoverWidth}px`})},[t("div",rh,r(u.title),1),u.description?(l(),f("div",ch,r(u.description),1)):he("",!0),t("div",uh,[(l(!0),f(we,null,Je(u.options,R=>(l(),f("div",{key:R,class:Qe(["image-num-item hover:bg-#F6F6F6",{active:u.value==R}])},[t("div",{class:Qe(["content",{disable:u.isOptionDisabled(R)}]),onClick:U=>x(R)},[t("div",ph,r(R),1),u.value==R?(l(),f("img",mh)):he("",!0)],10,dh),xn(_.$slots,"item-extra",{option:R},void 0,!0)],2))),128))])],4)]),default:P(()=>[y(p,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[xn(_.$slots,"button-icon",{},()=>[y(e(ih))],!0),t("span",gh,r(u.buttonLabel),1),y(e(Qt),{class:"ml-10px!"})]),_:3},8,["class"])]),_:3},8,["open","getPopupContainer"])}}},Es=It(fh,[["__scopeId","data-v-7ff4fb2a"]]),vh={class:"aspect-ratio-setting"},hh={class:"popover-content"},_h={class:"popover-title pl-10px! mb-15px!"},yh={key:0,class:"px-10px mb-10px"},xh={class:"text-14px color-[rgba(0,0,0,0,1)] mb-8px"},bh={class:"sku-quality-toggle"},Ih=["onClick"],Ch={class:"text-14px color-[rgba(0,0,0,0,1)] mt-12px"},kh=["onClick"],wh={class:"flex flex-col w-165px"},Ph={key:0,class:"customer-radio flex gap-x-5px"},Mh={key:1,class:"popover-item-label"},Sh={key:1,class:"flex flex-col gap-y-5px rounded-4px"},$h={class:"py-6px px-10px"},Th=["onClick"],Ah={class:"flex flex-center gap-x-8px"},Uh=["src"],Lh={class:"group-hover:text-[var(--primary-color)]"},Eh={class:"group-hover:text-[var(--primary-color)]"},qh={class:"flex items-center h-12px"},Dh={class:"line-height-1 ml-4px"},Oh={__name:"aspect-ratio-setting",props:{size:{type:String,default:""},quality:{type:String,default:""},aspectRatio:{type:[String,Number],default:""},supportedAspectRatios:{type:[String,Array],default:()=>[]},isChatPinned:{type:Boolean,default:!1},defaultQuality:{type:String,default:"2K"},defaultAspectRatio:{type:String,default:"3:4"}},emits:["update:size","update:quality","update:aspectRatio"],setup(u,{emit:g}){const i=u,c=g,{t:o}=mt(),x=oa(),_=h(!1),m=h(""),p=h(""),d=h(null),R=h(null),U=["1K","2K"],G=F(()=>{if(Array.isArray(i.supportedAspectRatios))return i.supportedAspectRatios;if(!i.supportedAspectRatios)return[];try{return JSON.parse(i.supportedAspectRatios)}catch{return[]}}),a=F(()=>G.value.some(J=>J==null?void 0:J.quality)),E=F({get:()=>i.quality||i.defaultQuality,set:J=>{c("update:quality",J)}}),z=F(()=>{const J=G.value||[];if(!a.value)return J;const oe=E.value;return J.filter(te=>(te==null?void 0:te.type)!=="single"||!(te!=null&&te.quality)?!0:te.quality===oe)}),q=(J=E.value)=>{const oe=G.value||[],te=Q=>[Q==null?void 0:Q.aspectRatio,Q==null?void 0:Q.key,Q==null?void 0:Q.value,Q==null?void 0:Q.label,Q==null?void 0:Q.size].some(ie=>String(ie||"")===i.defaultAspectRatio);return oe.find(Q=>(Q==null?void 0:Q.type)==="single"&&te(Q)&&(Q==null?void 0:Q.quality)===J)||oe.find(Q=>(Q==null?void 0:Q.type)==="single"&&te(Q)&&!(Q!=null&&Q.quality))||oe.f
1ind(Q=>(Q==null?void 0:Q.type)==="single"&&(Q==null?void 0:Q.key)==="default"&&(Q==null?void 0:Q.quality)===J)||oe.find(Q=>(Q==null?void 0:Q.type)==="single"&&(Q==null?void 0:Q.key)==="default"&&!(Q!=null&&Q.quality))||oe.find(Q=>(Q==null?void 0:Q.type)==="single"&&(!(Q!=null&&Q.quality)||Q.quality===J))},S=(J,oe={})=>{var te;c("update:size",J||""),c("update:aspectRatio",(te=oe.aspectRatio)!=null?te:i.defaultAspectRatio),oe.quality&&c("update:quality",oe.quality)},O=(J=E.value)=>{const oe=q(J);oe!=null&&oe.size&&S(oe.size,oe)};Ne(G,()=>{a.value&&!i.quality&&c("update:quality",i.defaultQuality),O()},{immediate:!0});const N=J=>{if(E.value===J)return;E.value=J;const oe=i.size;if(!oe||oe.includes("custom_")||oe.includes("_")){oe||O(J);return}const te=G.value.find(ie=>(ie==null?void 0:ie.type)==="single"&&(ie==null?void 0:ie.size)===oe);if(!(te!=null&&te.key))return;const Q=G.value.find(ie=>(ie==null?void 0:ie.type)==="single"&&(ie==null?void 0:ie.key)===te.key&&(ie==null?void 0:ie.quality)===J);if(Q!=null&&Q.size){S(Q.size,Q);return}O(J)},ae=(J=[])=>{const oe=E.value;return J.filter(te=>{const Q=!te.quality||te.quality===oe,ie=te.visible!==!1;return Q&&ie})},L=(J="")=>J==null?void 0:J.startsWith("custom_"),K=(J={})=>!(J!=null&&J.key)||!(J!=null&&J.size)?"":`${J.key}_custom_${J.size}`,de=(J="",oe={})=>!(oe!=null&&oe.key)||!(oe!=null&&oe.size)?!1:J===K(oe)||J===`${oe.key}_${oe.size}`||oe.key.includes("default")&&J===oe.size||J===oe.size,W=J=>{const oe=i.size;return!oe||!J.size?!1:(J==null?void 0:J.type)==="custom"?L(oe):(J==null?void 0:J.type)==="single"?J.size===oe:J!=null&&J.key&&(J!=null&&J.size)?de(oe,J):!1},$=J=>{if(J.type==="custom"){V();return}J.type!=="group"&&J.type==="single"&&(S(i.size===J.size?"":J.size,J),_.value=!1)},Y=J=>{const oe=K(J);S(i.size===oe?"":oe,J),_.value=!1},j=J=>{var te;const oe=Array.isArray(J.value)?J.value[0]:J.value;(te=oe==null?void 0:oe.focus)==null||te.call(oe)},V=()=>m.value?p.value?!0:(j(R),!1):(j(d),!1);function w(){if(!V())return;const{valid:J,message:oe}=ti(m.value,p.value,I.value);if(!J){x.warning(oe);return}const te=`custom_${m.value}x${p.value}`,Q=Number(m.value)/Number(p.value);c("update:size",te),c("update:aspectRatio",Q),_.value=!1}const I=F(()=>{const J=G.value.find(oe=>(oe==null?void 0:oe.type)==="custom");return(J==null?void 0:J.config)||{}}),k=J=>{const oe=Math.round(1/J);return J>0&&J<1&&Math.abs(1/J-oe)<1e-6?`1/${oe}`:Number.isInteger(J)?`${J}`:`${J}`},B=F(()=>{if(!Array.isArray(I.value.scope)||I.value.scope.length!==2)return"";const[J,oe]=I.value.scope;return`[${J}, ${oe}]`}),be=F(()=>{if(!Array.isArray(I.value.aspectRatioScope)||I.value.aspectRatioScope.length!==2)return"";const[J,oe]=I.value.aspectRatioScope;return`[${k(J)}, ${k(oe)}]`}),ne=F(()=>{var J,oe;if(!i.size)return o("qinghu-ai.link-pix-params.709204-0");for(const te of G.value)if(te.type==="single"&&te.size===i.size)return`${te.label}ï¼${te.showSize||te.size}ï¼`;for(const te of G.value)if(te.type==="group"){const Q=(J=te.children)==null?void 0:J.find(ie=>de(i.size,ie));if(Q)return`${Q.label}ï¼${Q.showSize||Q.size}ï¼`}return(oe=i.size)!=null&&oe.includes("custom")?`èªå®ä¹å°ºå¯¸ï¼${i.size.replace("custom_","")}ï¼`:i.size}),le=F(()=>a.value?`${E.value} ${ne.value}`:ne.value),ce=J=>(J==null?void 0:J.parentNode)||document.body;return(J,oe)=>{const te=ca,Q=ba,ie=Lt,_e=Bt;return l(),f("span",vh,[y(_e,{open:e(_),"onUpdate:open":oe[2]||(oe[2]=Re=>Fe(_)?_.value=Re:null),placement:"top",overlayClassName:"ratio-size-popover",trigger:"click",getPopupContainer:ce,arrow:!1},{content:P(()=>[t("div",hh,[t("div",_h,r(e(o)("qinghu-ai.link-pix-params.709204-0")),1),e(a)?(l(),f("div",yh,[t("div",xh,r(e(o)("qinghu-ai.link-pix-params.709204-17")),1),t("div",bh,[(l(),f(we,null,Je(U,Re=>t("div",{key:Re,class:Qe(["sku-quality-item",{active:e(E)===Re}]),onClick:ye=>N(Re)},r(Re),11,Ih)),64))]),t("div",Ch,r(e(o)("qinghu-ai.link-pix-params.709204-18")),1)])):he("",!0),t("div",{class:Qe(["flex flex-col overflow-y-scroll custom-scrollbar",e(a)?"h-280px":"h-340px"])},[(l(!0),f(we,null,Je(e(z),Re=>(l(),f("div",{key:Re.key,class:Qe(["cursor-pointer",{active:W(Re)}])},[Re.type!=="group"?(l(),f("div",{key:0,class:"flex justify-between items-center radio-content",onClick:ye=>$(Re)},[t("div",{class:Qe(["popover-item-label",{active:Re.type==="custom"&&L(i.size)}])},[De(r(Re.label)+" ",1),Re.type==="custom"?(l(),ve(te,{key:0},{title:P(()=>[t("div",wh,[e(B)?(l(),f(we,{key:0},[t("span",null,r(e(o)("components-qinghu-ai.link-pix-params.738063-113")),1),t("span",null,r(e(B)),1)],64)):he("",!0),e(be)?(l(),f(we,{key:1},[t("span",null,r(e(o)("components-qinghu-ai.link-pix-params.738063-114")),1),t("span",null,r(e(be)),1)],64)):he("",!0)])]),default:P(()=>[y(e(pa))]),_:1})):he("",!0)],2),Re.type==="custom"?(l(),f("div",Ph,[y(Q,{value:e(m),"onUpdate:value":oe[0]||(oe[0]=ye=>Fe(m)?m.value=ye:null),onPressEnter:w,onBlur:w,ref_for:!0,ref_key:"widthInputRef",ref:d,bordered:!1,"addon-after":e(o)("components-qinghu-ai.link-pix-params.738063-115")},null,8,["value","addon-after"]),y(Q,{value:e(p),"onUpdate:value":oe[1]||(oe[1]=ye=>Fe(p)?p.value=ye:null),onPressEnter:w,onBlur:w,ref_for:!0,ref_key:"heightInputRef",ref:R,bordered:!1,"addon-after":e(o)("components-qinghu-ai.link-pix-params.738063-116")},null,8,["value","addon-after"])])):he("",!0),Re.type==="single"?(l(),f("div",Mh,r(Re.showSize||Re.size),1)):he("",!0)],8,kh)):(l(),f("div",Sh,[t("div",$h,r(Re.label),1),(l(!0),f(we,null,Je(ae(Re.children),ye=>(l(),f("div",{key:ye.key,onClick:Be(me=>Y(ye),["stop"]),class:Qe(["flex justify-between items-center mx-10px p-12px h-30px rounded-4px cursor-pointer popover-group-label hover:bg-#F6F6F6! group",{active:W(ye)}])},[t("div",Ah,[t("img",{src:e(Ms)(ye.icon),class:"w-16px h-16px",alt:""},null,8,Uh),t("span",Lh,r(ye.label),1)]),t("span",Eh,r(ye.showSize||ye.size),1)],10,Th))),128))]))],2))),128))],2)])]),default:P(()=>[y(ie,{class:Qe(["ant-no-wave",[i.isChatPinned?" border-none!":""]])},{default:P(()=>
1[t("div",qh,[xn(J.$slots,"prefix",{},void 0,!0),t("span",Dh,r(e(le)),1),y(e(Qt),{class:"ml-10px!"})])]),_:3},8,["class"])]),_:3},8,["open"])])}}},Nh=It(Oh,[["__scopeId","data-v-923751c1"]]),Rh={class:"pod-material-params"},Fh={class:"pod-function-modal"},Gh={class:"pod-function-modal__header"},Vh=["src"],zh={class:"pod-function-modal__title"},Bh={class:"pod-function-modal__desc"},Kh={class:"pod-function-modal__grid"},Wh={class:"pod-example-panel"},jh={class:"pod-example-panel__title"},Hh={class:"pod-example-panel__row"},Jh=["src"],Yh=["src"],Qh=["onClick"],Xh={class:"pod-function-card__radio"},Zh={class:"pod-function-card__top"},e2=["src"],t2={class:"pod-function-card__main"},a2={class:"pod-function-card__name"},n2={key:0,class:"pod-function-card__free-tag"},o2={class:"pod-function-card__tag"},s2={class:"pod-function-card__desc"},l2={class:"flex items-center h-12px"},i2={class:"line-height-1 ml-4px"},r2={class:"pod-apply-mode-panel"},c2={class:"flex items-center h-12px"},u2={class:"line-height-1 ml-4px"},d2={class:"pod-size-panel"},p2={class:"pod-size-panel__title"},m2={class:"pod-size-panel__section-title"},g2={class:"pod-size-panel__resolution"},f2={class:"pod-size-panel__section-title is-size"},v2={class:"pod-size-panel__ratio-grid"},h2={class:"pod-ratio-option__icon-wrap"},_2={class:"pod-ratio-option__label"},y2={class:"flex items-center h-12px"},x2={class:"line-height-1 ml-4px"},b2={class:"pod-product-panel"},I2={class:"pod-product-panel__header"},C2={class:"pod-product-panel__title"},k2={class:"pod-product-panel__tabs"},w2={class:"pod-product-panel__grid-scroll custom-scrollbar"},P2={class:"pod-product-panel__grid"},M2=["src"],S2={class:"flex items-center h-12px"},$2={class:"line-height-1 ml-4px"},Zr="LinkPixPodMaterialParams",T2=Dt({__name:"pod-material-params",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=bt(),c=la(),{userInfo:o}=va(c),x=Pa(),_=Kt(),m=oa(),p=wa(),d=h(!1),R=h(!1),U=h(!1),G=h(!1),a=h(!1),E=h(""),z=h(!1);let q=null;const S=[{value:"STAMP_EXTRACT",label:g("components-qinghu-ai.pod-material-params.930519-86"),tag:g("components-qinghu-ai.pod-material-params.930519-87"),desc:g("components-qinghu-ai.pod-material-params.930519-88"),thumb:Gg,examples:[{type:"image",src:qr},{type:"arrow"},{type:"image",src:Fg}]},{value:"STAMP_APPLY",label:g("components-qinghu-ai.pod-material-params.930519-89"),tag:g("components-qinghu-ai.pod-material-params.930519-90"),desc:g("components-qinghu-ai.pod-material-params.930519-91"),thumb:zg,examples:[{type:"image",src:qr},{type:"arrow"},{type:"image",src:Vg}]},{value:"STAMP_FISSION",label:g("components-qinghu-ai.pod-material-params.930519-92"),tag:g("components-qinghu-ai.pod-material-params.930519-93"),desc:g("components-qinghu-ai.pod-material-params.930519-94"),thumb:Hg,examples:[{type:"image",src:Bg,size:"tall"},{type:"image",src:Kg,size:"tall"},{type:"image",src:Wg,size:"tall"},{type:"image",src:jg,size:"tall"}]}],O=F(()=>{var Te;const se=new Map(S.map(Xe=>[Xe.value,{...Xe}]));return(Te=i.podMaterialOptions)==null||Te.forEach(Xe=>{se.has(Xe.value)&&se.set(Xe.value,{...se.get(Xe.value),...Xe})}),Array.from(se.values())}),N=["1K","2K"],ae=[{key:"1:1",value:"1:1",label:"1:1"},{key:"2:3",value:"2:3",label:"2:3"},{key:"3:2",value:"3:2",label:"3:2"},{key:"3:4",value:"3:4",label:"3:4"},{key:"4:3",value:"4:3",label:"4:3"},{key:"4:5",value:"4:5",label:"4:5"},{key:"5:4",value:"5:4",label:"5:4"},{key:"9:16",value:"9:16",label:"9:16"},{key:"16:9",value:"16:9",label:"16:9"}],L=h([]),K=h([]),de=[{value:Ea.MULTI_PATTERN_TO_ONE_PRODUCT,label:"å¤å¼ å°è±å¾ â è´´åå° 1 å¼ äº§åå¾"},{value:Ea.ONE_PATTERN_TO_MULTI_PRODUCT,label:"åå¼ å°è±å¾ â è´´åå°å¤å¼ 产åå¾"}],W={page:"é¦é¡µ",module:"PODç´ æ",moduleCategory1:"PODç´ æ",moduleCategory2:"POD ç´ ææ¨¡å"},$=h([1,2,4,6,8,10]),Y=se=>o.value.defaultVip&&se!=1,j=se=>{Y(se)||(i.podMaterialParams.imageCount=se,d.value=!1,kt("select_pod_count",{...W,eventDesc:"éæ©çææ°é",buttonName:`${se}`,count:se,source:x.path}))},V=F(()=>i.podMaterialParams.aspectRatio||"1:1"),w=F(()=>i.podMaterialParams.quality||"1K"),I=F(()=>i.podMaterialParams.aspectRatio||"1:1"),k=F(()=>`${w.value} ${I.value}`),B=(se=i.podMaterialParams.podMaterialMode||"STAMP_EXTRACT")=>O.value.find(Te=>Te.value===se)||O.value[0],be=F(()=>B()),ne=F(()=>{var se;return((se=be.value)==null?void 0:se.label)||g("components-qinghu-ai.pod-material-params.930519
1-86")}),le=se=>(i.podMaterialParams.podMaterialMode||"STAMP_EXTRACT")===se,ce=F(()=>(i.podMaterialParams.podMaterialMode||"STAMP_EXTRACT")==="STAMP_FISSION"),J=F(()=>(i.podMaterialParams.podMaterialMode||"STAMP_EXTRACT")==="STAMP_APPLY"),oe=se=>["STAMP_EXTRACT","STAMP_APPLY"].includes(se),te=F(()=>hs(i.podMaterialParams)),Q=F(()=>J.value&&te.value===Ea.ONE_PATTERN_TO_MULTI_PRODUCT),ie=F(()=>{var se;return((se=de.find(Te=>Te.value===te.value))==null?void 0:se.label)||de[0].label}),_e=F(()=>o.value?!o.value.defaultVip:!1),Re=F(()=>Q.value&&_e.value?10:1),ye=()=>{if(!J.value){i.podMaterialParams.podMaterialApplyBatchType=Ea.MULTI_PATTERN_TO_ONE_PRODUCT,i.podMaterialParams.applyMode=ls[Ea.MULTI_PATTERN_TO_ONE_PRODUCT];return}if(i.podMaterialParams.podMaterialApplyBatchType||(i.podMaterialParams.podMaterialApplyBatchType=te.value,i.podMaterialParams.applyMode=ls[te.value]),Q.value){i.podMaterialParams.images=(i.podMaterialParams.images||[]).slice(0,1);return}i.podMaterialParams.productImages=(i.podMaterialParams.productImages||[]).slice(0,1)},me=()=>{if(_e.value){m.error(`æå¤éæ©${Re.value}å¼ äº§åå¾`);return}q||(q=p.confirm({title:g("composables.createTaskValidate.609182-1"),width:466,class:"pod-upload-vip-limit-confirm",maskClosable:!1,keyboard:!1,cancelText:g("create-task.index.9326441-12"),okText:g("auth-mask.index.837851-1"),content:g("components-qinghu-ai.pod-upload-material.930519-108"),afterClose:()=>{q=null},onOk:()=>{window.open(_.resolve({path:"/upgrade"}).href,"_blank")}}))},re=se=>{i.podMaterialParams.podMaterialMode=se.value,i.podMaterialParams.modelSkuId=se.id||"",R.value=!1,kt("select_pod_material_type",{...W,eventDesc:"éæ© POD ç´ æç±»å",buttonName:se.label,mode:se.value,label:se.label,source:x.path})},fe=se=>{i.podMaterialParams.podMaterialApplyBatchType=se,i.podMaterialParams.applyMode=ls[se],a.value=!1,ye(),kt("select_pod_material_type",{...W,eventDesc:"éæ©å°è±è´´åç±»å",buttonName:ie.value,podMaterialApplyBatchType:se,source:x.path})},Oe=se=>{i.podMaterialParams.quality=se,kt("select_pod_print_type",{...W,eventDesc:"éæ©å°è±æåç±»å",buttonName:se,quality:se,source:x.path})},Ve=se=>{i.podMaterialParams.aspectRatio=se.value,U.value=!1,kt("select_pod_size",{...W,eventDesc:"éæ©æ¯ä¾å°ºå¯¸",buttonName:se.label,ratio:se.value,source:x.path})},H=se=>Array.isArray(se)?se:Array.isArray(se==null?void 0:se.data)?se.data:Array.isArray(se==null?void 0:se.payload)?se.payload:[],st=async()=>{z.value=!0;try{const se=await Um(),Te=H(se).filter(pt=>typeof pt=="string"&&pt);L.value=Te;const Xe=Te.includes(E.value)?E.value:Te[0]||"";E.value=Xe,Xe?await ge(Xe):K.value=[]}finally{z.value=!1}},ge=async(se=E.value)=>{if(se){z.value=!0;try{const Te=await Lm(se);K.value=H(Te).filter(Xe=>Xe==null?void 0:Xe.url)}finally{z.value=!1}}},Ce=se=>{E.value=se,ge(se)},$e=se=>{if(Q.value){const Te=i.podMaterialParams.productImages||[];if(Te.includes(se.url)){G.value=!1;return}if(Te.length>=Re.value){G.value=!1,me();return}i.podMaterialParams.productImages=[...Te,se.url]}else i.podMaterialParams.productImages=[se.url];G.value=!1,kt("select_pod_product",{...W,eventDesc:"éæ©äº§å",buttonName:E.value||"产å",productCategory:E.value,source:x.path})},at=se=>{const[Te,Xe]=se.split(":").map(Number);if(!Te||!Xe)return{};const pt=16;return Te>=Xe?{width:`${pt}px`,height:`${Math.max(7,Math.round(Xe/Te*pt))}px`}:{width:`${Math.max(7,Math.round(Te/Xe*pt))}px`,height:`${pt}px`}},nt=()=>document.body;return(()=>{try{const se=JSON.parse(localStorage.getItem(Zr)||"{}")||{};i.podMaterialParams.quality=se.quality||i.podMaterialParams.quality||"1K",i.podMaterialParams.aspectRatio=se.aspectRatio||i.podMaterialParams.aspectRatio||"1:1",i.podMaterialParams.size=se.size||i.podMaterialParams.size||""}catch{}})(),Ne(()=>i.podMaterialParams.podMaterialMode,se=>{if(se!=="STAMP_APPLY"){i.podMaterialParams.podMaterialApplyBatchType=Ea.MULTI_PATTERN_TO_ONE_PRODUCT,i.podMaterialParams.applyMode=ls[Ea.MULTI_PATTERN_TO_ONE_PRODUCT],i.podMaterialParams.size="",i.podMaterialParams.aspectRatio||(i.podMaterialParams.aspectRatio="1:1");return}i.podMaterialParams.size||(i.podMaterialParams.size="1:1"),i.podMaterialParams.aspectRatio||(i.podMaterialParams.aspectRatio="1:1"),ye()},{immediate:!0}),Ne(()=>i.podMaterialParams.podMaterialApplyBatchType,ye),Ne(()=>[i.podMaterialParams.quality,i.podMaterialParams.aspectRatio,i.podMaterialParams.size],()=>{localStorage.setItem(Zr,JSON.stringify({quality:i.podMaterialParams.quality||"1K",aspectRatio:i.podMaterialParams.aspectRatio||"1:1",size:i.podMaterialParams.size||""}))},{deep:!0}),Ne(G,se=>{se&&st()}),(se,Te)=>{var T;const Xe=Bt,pt=Lt,gt=Wt,Ge=ca;return l(),f("div",Rh,[y(Xe,{open:e(R),"onUpdate:open":Te[0]||(Te[0]=X=>Fe(R)?R.value=X:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"pod-function-popover",getPopupContainer:nt},{content:P(()=>[t("div",Fh,[t("div",Gh,[t("img",{src:e(zc),alt:"",class:"pod-function-modal__icon"},null,8,Vh),t("div",null,[t("div",zh,r(e(g)("components-qinghu-ai.pod-material-params.930519
1-84")),1),t("div",Bh,r(e(g)("components-qinghu-ai.pod-material-params.930519-85")),1)])]),t("div",Kh,[(l(!0),f(we,null,Je(e(O),X=>(l(),ve(Xe,{key:X.value,placement:"rightTop",trigger:"hover",arrow:!1,overlayClassName:"pod-function-example-popover",getPopupContainer:nt},{content:P(()=>[t("div",Wh,[t("div",jh,r(e(g)("components-OperationGenerate-components.Topic-Copywriting.304388-39")),1),t("div",Hh,[(l(!0),f(we,null,Je(X.examples,(Ee,Ye)=>(l(),f(we,{key:Ye},[Ee.type==="arrow"?(l(),f("img",{key:0,src:e(Jg),alt:"",class:"pod-example-panel__arrow"},null,8,Jh)):(l(),f("img",{key:1,src:Ee.src,alt:"",class:Qe(["pod-example-panel__image",Ee.size==="tall"?"pod-example-panel__image--tall":"pod-example-panel__image--square"])},null,10,Yh))],64))),128))])])]),default:P(()=>[t("div",{class:Qe(["pod-function-card",{"is-active":le(X.value)}]),onClick:Ee=>re(X)},[t("div",Xh,[le(X.value)?(l(),ve(e(uu),{key:0})):he("",!0)]),t("div",Zh,[t("img",{src:X.thumb,alt:"",class:"pod-function-card__thumb"},null,8,e2),t("div",t2,[t("div",a2,[De(r(X.label)+" ",1),oe(X.value)?(l(),f("span",n2,r(e(g)("components-qinghu-ai.pod-material-params.930519-109")),1)):he("",!0)]),t("div",o2,r(X.tag),1)])]),t("div",s2,r(X.desc),1)],10,Qh)]),_:2},1024))),128))])])]),default:P(()=>[y(pt,{class:Qe(["mr-6px group ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",l2,[y(e(Xv)),t("span",i2,r(e(ne)),1),y(e(cs),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open"]),e(J)?(l(),ve(Xe,{key:0,open:e(a),"onUpdate:open":Te[1]||(Te[1]=X=>Fe(a)?a.value=X:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"pod-apply-mode-popover",getPopupContainer:nt},{content:P(()=>[t("div",r2,[Te[9]||(Te[9]=t("div",{class:"pod-apply-mode-panel__title"},"å°è±è´´åç±»å",-1)),(l(),f(we,null,Je(de,X=>y(pt,{key:X.value,"html-type":"button",class:Qe(["pod-apply-mode-option ant-no-wave",{"is-active":e(te)===X.value}]),onClick:Ee=>fe(X.value)},{default:P(()=>[t("span",null,r(X.label),1)]),_:2},1032,["class","onClick"])),64))])]),default:P(()=>[y(pt,{class:Qe(["mr-6px group ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",c2,[y(e(Xr)),t("span",u2,r(e(ie)),1),y(e(cs),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open"])):he("",!0),e(J)?he("",!0):(l(),ve(Xe,{key:1,open:e(U),"onUpdate:open":Te[2]||(Te[2]=X=>Fe(U)?U.value=X:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"pod-size-popover",getPopupContainer:nt},{content:P(()=>[t("div",d2,[t("div",p2,r(e(g)("qinghu-ai.link-pix-params.709204-0")),1),t("div",m2,r(e(g)("cloud-desktop-connect.index.535336-137")),1),t("div",g2,[(l(),f(we,null,Je(N,X=>y(pt,{key:X,"html-type":"button",class:Qe(["pod-size-panel__resolution-item ant-no-wave",{"is-active":e(w)===X}]),onClick:Ee=>Oe(X)},{default:P(()=>[De(r(X),1)]),_:2},1032,["class","onClick"])),64))]),t("div",f2,r(e(g)("qinghu-ai.link-pix-params.709204-18")),1),t("div",v2,[(l(),f(we,null,Je(ae,X=>y(pt,{key:X.key,"html-type":"button",class:Qe(["pod-ratio-option ant-no-wave",{"is-active":e(V)===X.key}]),onClick:Ee=>Ve(X)},{default:P(()=>[t("span",h2,[t("span",{class:"pod-ratio-option__icon",style:Nt(at(X.value))},null,4)]),t("span",_2,r(X.label),1)]),_:2},1032,["class","onClick"])),64))])])]),default:P(()=>[y(pt,{class:Qe(["mr-6px group ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",y2,[y(e(Qr)),t("span",x2,r(e(k)),1),y(e(cs),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open"])),e(J)?(l(),ve(Nh,{key:2,size:e(i).podMaterialParams.size,"onUpdate:size":Te[3]||(Te[3]=X=>e(i).podMaterialParams.size=X),quality:e(i).podMaterialParams.quality,"onUpdate:quality":Te[4]||(Te[4]=X=>e(i).podMaterialParams.quality=X),"aspect-ratio":e(i).podMaterialParams.aspectRatio,"onUpdate:aspectRatio":Te[5]||(Te[5]=X=>e(i).podMaterialParams.aspectRatio=X),"supported-aspect-ratios":(T=e(be))==null?void 0:T.supportedAspectRatios,"is-chat-pinned":u.isChatPinned,"default-quality":"1K","default-aspect-ratio":"1:1",class:"mr-6px"},{prefix:P(()=>[y(e(Qr))]),_:1},8,["size","quality","aspect-ratio","supported-aspect-ratios","is-chat-pinned"])):he("",!0),e(J)?(l(),ve(Xe,{key:3,open:e(G),"onUpdate:open":Te[7]||(Te[7]=X=>Fe(G)?G.value=X:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"pod-product-popover",getPopupContainer:nt},{content:P(()=>[t("div",b2,[t("div",I2,[t("div",C2,r(e(g)("qinghu-ai.long-image-material.139562-26")),1),y(pt,{type:"text","html-type":"button",class:"pod-product-panel__close ant-no-wave",onClick:Te[6]||(Te[6]=X=>G.value=!1)},{default:P(()=>[y(e(ma))]),_:1})]),t("div",k2,[(l(!0),f(we,null,Je(e(L),X=>(l(),ve(pt,{key:X,class:Qe(["pod-product-panel__tab ant-no-wave",{"is-active":e(E)===X}]),onClick:Ee=>Ce(X)},{default:P(()=>[De(r(X),1)]),_:2},1032,["class","onClick"]))),128))]),y(gt,{spinning:e(z),class:"pod-product-panel__spin"},{default:P(()=>[t("div",w2,[t("div",P2,[(l(!0),f(we,null,Je(e(K),(X,Ee)=>(l(),ve(pt,{key:X.url||Ee,"html-type":"button",class:"pod-product-item ant-no-wave",onClick:Ye=>$e(X)},{default:P(()=>[t("img",{src:X.url,alt:"",class:"pod-product-item__image"},null,8,M2)]),_:2},1032,["onClick"]))),128))])])]),_:1},8,["spinning"])])]),default:P(()=>[y(pt,{class:Qe(["mr-6px group ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",S2,[y(e(Xr)),t("span",$2,r(e(g)("qinghu-ai.long-image-material.139562-26")),1),y(e(cs),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open"])):he("",!0),e(ce)?(l(),ve(Es,{key:4,open:e(d),"onUpdate:open":Te[8]||(Te[8]=X=>Fe(d)?d.value=X:null),title:e(g)("qinghu-ai.link-pix-params.477557-0"),description:e(g)("qinghu-ai.link-pix-params.477557-1"),options:e($),value:e(i).podMaterialParams.imageCount,buttonLabel:`${e(g)("qinghu-ai.link-pix-params.477557-3")}ï¼${e(i).podMaterialParams.imageCount}ï¼`,isChatPinned:u.isChatPinned,isOptionDisabled:Y,onSelect:j},{"item-extra":P(({option:X})=>[e(o).defaultVip&&X!=1?(l(),ve(Ge,{key:0},{title:P(()=>[De(r(e(g)("components-qinghu-ai.link-pix-params.738063-117")),1)]),default:P(()=>[Te[10]||(Te[10]=t("div",{class:"mask"},null,-1))]),_:1})):he("",!0)]),_:1},8,["open","title","description","options","value","buttonLabel","isChatPinned"])):he("",!0)])}}}),A2=It(T2,[["__scopeId","data-v-bc7fb33d"]]),U2={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"12",height:"12",viewBox:"0 0 12 12",fill:"
1currentColor"};function L2(u,g){return l(),f("svg",U2,[...g[0]||(g[0]=[t("defs",null,[t("clipPath",{id:"master_svg0_784_91836"},[t("rect",{x:"0",y:"0",width:"12",height:"12",rx:"0"})])],-1),t("g",{"clip-path":"url(#master_svg0_784_91836)"},[t("g",null,[t("path",{d:"M2.3190154,10.3365002C2.3190154,10.3365002,2.0920204,10.7820005,2.0920204,10.7820005C2.0920204,10.7820005,2.3190154,10.3365002,2.3190154,10.3365002C2.3190154,10.3365002,2.3190154,10.3365002,2.3190154,10.3365002ZM1.66349041,9.6810007C1.66349041,9.6810007,1.21798743,9.908,1.21798743,9.908C1.21798743,9.908,1.66349041,9.6810007,1.66349041,9.6810007C1.66349041,9.6810007,1.66349041,9.6810007,1.66349041,9.6810007ZM10.3365002,9.6810007C10.3365002,9.6810007,10.7820005,9.908,10.7820005,9.908C10.7820005,9.908,10.3365002,9.6810007,10.3365002,9.6810007C10.3365002,9.6810007,10.3365002,9.6810007,10.3365002,9.6810007ZM9.6810007,10.3365002C9.6810007,10.3365002,9.908,10.7820005,9.908,10.7820005C9.908,10.7820005,9.6810007,10.3365002,9.6810007,10.3365002C9.6810007,10.3365002,9.6810007,10.3365002,9.6810007,10.3365002ZM9.6810007,1.66349041C9.6810007,1.66349041,9.908,1.21798743,9.908,1.21798743C9.908,1.21798743,9.6810007,1.66349041,9.6810007,1.66349041C9.6810007,1.66349041,9.6810007,1.66349041,9.6810007,1.66349041ZM10.3365002,2.3190154C10.3365002,2.3190154,10.7820005,2.0920204,10.7820005,2.0920204C10.7820005,2.0920204,10.3365002,2.3190154,10.3365002,2.3190154C10.3365002,2.3190154,10.3365002,2.3190154,10.3365002,2.3190154ZM2.3190154,1.66349041C2.3190154,1.66349041,2.0920204,1.21798743,2.0920204,1.21798743C2.0920204,1.21798743,2.3190154,1.66349041,2.3190154,1.66349041C2.3190154,1.66349041,2.3190154,1.66349041,2.3190154,1.66349041ZM1.66349041,2.3190154C1.66349041,2.3190154,1.21798743,2.0920204,1.21798743,2.0920204C1.21798743,2.0920204,1.66349041,2.3190154,1.66349041,2.3190154C1.66349041,2.3190154,1.66349041,2.3190154,1.66349041,2.3190154ZM3.9000003,2.0000005C3.9000003,2.0000005,8.100000399999999,2.0000005,8.100000399999999,2.0000005C8.100000399999999,2.0000005,8.100000399999999,1.00000043830158,8.100000399999999,1.00000043830158C8.100000399999999,1.00000043830158,3.9000003,1.00000043830158,3.9000003,1.00000043830158C3.9000003,1.00000043830158,3.9000003,2.0000005,3.9000003,2.0000005C3.9000003,2.0000005,3.9000003,2.0000005,3.9000003,2.0000005ZM10,3.9000003C10,3.9000003,10,8.100000399999999,10,8.100000399999999C10,8.100000399999999,11,8.100000399999999,11,8.100000399999999C11,8.100000399999999,11,3.9000003,11,3.9000003C11,3.9000003,10,3.9000003,10,3.9000003C10,3.9000003,10,3.9000003,10,3.9000003ZM8.100000399999999,10C8.100000399999999,10,3.9000003,10,3.9000003,10C3.9000003,10,3.9000003,11,3.9000003,11C3.9000003,11,8.100000399999999,11,8.100000399999999,11C8.100000399999999,11,8.100000399999999,10,8.100000399999999,10C8.100000399999999,10,8.100000399999999,10,8.100000399999999,10ZM2.0000005,8.100000399999999C2.0000005,8.100000399999999,2.0000005,3.9000003,2.0000005,3.9000003C2.0000005,3.9000003,1.00000043830158,3.9000003,1.00000043830158,3.9000003C1.00000043830158,3.9000003,1.00000043830158,8.100000399999999,1.00000043830158,8.100000399999999C1.00000043830158,8.100000399999999,2.0000005,8.100000399999999,2.0000005,8.100000399999999C2.0000005,8.100000399999999,2.0000005,8.100000399999999,2.0000005,8.100000399999999ZM3.9000003,10C3.4717104,10,3.1805654,9.9996004,2.9555204,9.9812002C2.7363105,9.9633007,2.6242105000000002,9.93085,2.5460105,9.8910007C2.5460105,9.8910007,2.0920204,10.7820005,2.0920204,10.7820005C2.3346853999999997,10.9056501,2.5930405,10.9549503,2.8740854000000002,10.9779005C3.1493003,11.000401,3.4882104,11,3.9000003,11C3.9000003,11,3.9000003,10,3.9000003,10C3.9000003,10,3.9000003,10,3.9000003,10ZM1.00000043830158,8.100000399999999C1.00000043830158,8.5118003,0.9996104383,8.850700400000001,1.022097439,9.1259003C1.045059938,9.40695,1.094341941,9.6653004,1.21798743,9.908C1.21798743,9.908,2.1089954,9.4540005,2.1089954,9.4540005C2.0691504,9.3758001,2.0366855,9.2637005,2.0187755000000003,9.0445004C2.0003903999999997,8.819450400000001,2.0000005,8.5283003,2.0000005,8.100000399999999C2.0000005,8.100000399999999,1.00000043830158,8.100000399999999,1.00000043830158,8.100000399999999C1.00000043830158,8.100000399999999,1.00000043830158,8.100000399999999,1.00000043830158,8.100000399999999ZM2.5460105,9.8910007C2.3578504000000002,9.7951508,2.2048655,9.6421509,2.1089954,9.4540005C2.1089954,9.4540005,1.21798743,9.908,1.21798743,9.908C1.4097339500000001,10.2843008,1.71569496,10.59025,2.0920204,10.7820005C2.0920204,10.7820005,2.5460105,9.8910007,2.5460105,9.8910007C2.5460105,9.8910007,2.5460105,9.8910007,2.5460105,9.8910007ZM10,8.100000399999999C10,8.5283003,9.9996004,8.819450400000001,9.9812002,9.0445004C9.9633007,9.2637005,9.93085,9.3758001,9.8910007,9.4540005C9.8910007,9.4540005,10.7820005,9.908,10.7820005,9.908C10.9056501,9.6653004,10.9549503,9.40695,10.9779005,9.1259003C11.000401,8.850700400000001,11,8.5118003,11,8.100000399999999C11,8.100000399999999,10,8.100000399999999,10,8.100000399999999C10,8.100000399999999,10,8.100000399999999,10,8.100000399999999ZM8.100000399999999,11C8.5118003,11,8.850700400000001,11.000401,9.1259003,10.9779005C9.40695,10.9549503,9.6653004,10.9056501,9.908,10.7820005C9.908,10.7820005,9.4540005,9.8910007,9.4540005,9.8910007C9.3758001,9.93085,9.2637005,9.9633007,9.0445004,9.9812002C8.819450400000001,9.9996004,8.5283003,10,8.100000399999999,10C8.100000399999999,10,8.100000399999999,11,8.100000399999999,11C8.100000399999999,11,8.100000399999999,11,8.100000399999999,11ZM9.8910007,9.4540005C9.7951508,9.6421509,9.6421509,9.7951508,9.4540005,9.8910007C9.4540005,9.8910007,9.908,10.7820005,9.908,10.7820005C10.2843008,10.59025,10.59025,10.2843008,10.7820005,9.908C10.7820005,9.908,9.8910007,9.4540005,9.8910007,9.4540005C9.8910007,9.4540005,9.8910007,9.4540005,9.8910007,9.4540005ZM8.100000399999999,2.0000005C8.5283003,2.0000005,8.819450400000001,2.0003903999999997,9.0445004,2.0187755000000003C9.2637005,2.0366855,9.3758001,2.0691504,9.4540005,2.1089954C9.4540005,2.1089954,9.908,1.21798743,9.908,1.21798743C9.6653004,1.094341941,9.40695,1.045059938,9.1259003,1.022097439C8.850700400000001,0.9996104383,8.5118003,1.00000043830158,8.100000399999999,1.00000043830158C8.100000399999999,1.00000043830158,8.100000399999999,2.0000005,8.100000399999999,2.0000005C8.100000399999999,2.0000005,8.100000399999999,2.0000005,8.100000399999999,2.0000005ZM11,3.9000003C11,3.4882104,11.000401,3.1493003,10.9779005,2.8740854000000002C10.9549503,2.5930405,10.9056501,2.3346853999999997,10.7820005,2.0920204C10.7820005,2.0920204,9.8910007,2.5460105,9.8910007,2.5460105C9.93085,2.6242105000000002,9.9633007,2.7363105,9.9812002,2.9555204C9.9996004,3.1805654,10,3.4717104,10,3.9000003C10,3.9000003,11,3.9000003,11,3.9000003C11,3.9000003,11,3.9000003,11,3.9000003ZM9.4540005,2.1089954C9.6421509,2.2048655,9.7951508,2.3578504000000002,9.8910007,2.5460105C9.8910007,2.5460105,10.7820005,2.0920204,10.7820005,2.0920204C10.59025,1.71569496,10.2843008,1.4097339500000001,9.908,1.21798743C9.908,1.21798743,9.4540005,2.1089954,9.4540005,2.1089954C9.4540005,2.1089954,9.4540005,2.1089954,9.4540005,2.1089954ZM3.9000003,1.00000043830158C3.4882104,1.00000043830158,3.1493003,0.9996104383,2.8740854000000002,1.022097439C2.5930405,1.045059938,2.3346853999999997,1.094341941,2.0920204,1.21798743C2.0920204,1.21798743,2.5460105,2.1089954,2.5460105,2.1089954C2.6242105000000002,2.0691504,2.7363105,2.0366855,2.9555204,2.0187755000000003C3.1805654,2.0003903999999997,3.4717104,2.0000005,3.9000003,2.0000005C3.9000003,2.0000005,3.9000003,1.00000043830158,3.9000003,1.00000043830158C3.9000003,1.00000043830158,3.9000003,1.00000043830158,3.9000003,1.00000043830158ZM2.0000005,3.9000003C2.0000005,3.4717104,2.0003903999999997,3.1805654,2.0187755000000003,2.9555204C2.0366855,2.7363105,2.0691504,2.6242105000000002,2.1089954,2.5460105C2.1089954,2.5460105,1.21798743,2.0920204,1.21798743,2.0920204C1.094341941,2.3346853999999997,1.045059938,2.5930405,1.022097439,2.8740854000000002C0.9996104383,3.1493003,1.00000043830158,3.4882104,1.00000043830158,3.9000003C1.00000043830158,3.9000003,2.0000005,3.9000003,2.0000005,3.9000003C2.0000005,3.9000003,2.0000005,3.9000003,2.0000005,3.9000003ZM2.0920204,1.21798743C1.71569544,1.4097339500000001,1.4097339500000001,1.71569544,1.21798743,2.0920204C1.21798743,2.0920204,2.1089954,2.5460105,2.1089954,2.5460105C2.2048655,2.3578454,2.35
178454,2.2048655,2.5460105,2.1089954C2.5460105,2.1089954,2.0920204,1.21798743,2.0920204,1.21798743C2.0920204,1.21798743,2.0920204,1.21798743,2.0920204,1.21798743Z","fill-opacity":"1"})])],-1)])])}const E2={render:L2},q2={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor"};function D2(u,g){return l(),f("svg",q2,[...g[0]||(g[0]=[t("defs",null,[t("clipPath",{id:"master_svg0_948_85853"},[t("rect",{x:"0",y:"0",width:"12",height:"12",rx:"0"})])],-1),t("g",{"clip-path":"url(#master_svg0_948_85853)"},[t("g",null,[t("path",{d:"M6,1C8.7614584,1,11,3.2385416,11,6C11,8.7614584,8.7614584,11,6,11C3.2385414,11,1,8.7614584,1,6C1,3.2385414,3.2385416,1,6,1ZM7.6577082,6.4166665L4.342291400000001,6.4166665C4.4343746,8.543541399999999,5.2193747,10.166666,6,10.166666C6.7804165,10.166666,7.5656247,8.5435424,7.6577082,6.4166665ZM3.5081253,6.4166665L1.85395873,6.4168749C2.0068754,7.9556251,2.9968754,9.2481241,4.3622920999999995,9.8324986C3.8712504,8.9952078,3.5608337,7.7783332,3.5081253,6.4168744L3.5081253,6.4166665ZM10.1460419,6.4168749L8.491875199999999,6.4168749C8.439166499999999,7.7785411,8.1287503,8.9952087,7.6377087,9.8322916C9.0031252,9.2483339,9.9931259,7.955626,10.1460419,6.4168749ZM4.3624997,2.1677082L4.3162498,2.1877082999999997C2.9743748,2.7810416,2.005,4.061874899999999,1.85416663,5.583333L3.508333,5.583333C3.5610414,4.2216666,3.8714581,3.0047915,4.3624997,2.1677082ZM6,1.83333325L5.96875,1.8341665900000002C5.1987495,1.87666661,4.4333332,3.4849997,4.342291400000001,5.583333L7.6577082,5.583333C7.5656247,3.4566665,6.7806249,1.83333325,6,1.83333325ZM7.6377077,2.1674999L7.6683331,2.2206249C8.1416664,3.055625,8.4402084,4.249999799999999,8.4916663,5.583333L10.145833,5.583333C9.993124,4.0443747000000005,9.0029154,2.7518748,7.6374989,2.1674999L7.6377077,2.1674999Z","fill-opacity":"1",style:{"mix-blend-mode":"passthrough"}})])],-1)])])}const ec={render:D2},O2={class:"flex"},N2={class:"image-model-panel"},R2=["onClick"],F2={class:"image-mode-card__icon"},G2=["src"],V2={class:"image-mode-card__content"},z2={class:"image-mode-card__title"},B2={class:"image-mode-card__desc"},K2={class:"flex items-center h-12px"},W2={class:"line-height-1 ml-4px"},j2={class:"flex items-center px-20px pt-20px pb-15px"},H2={class:"ml-10px"},J2={key:0,class:"text-#6E6C84"},Y2={key:1,class:"text-#6E6C84"},Q2={class:"overflow-y-scroll scrollbar max-h-454px pb-20px pl-20px"},X2={class:"pr-12px"},Z2={key:0,class:"popover-content mt-16px"},e5={class:"popover-title mb-14px!"},t5={class:"popover-list detail-size-list mt-10px"},a5=["onClick"],n5={class:"detail-size-item__label"},o5={class:"detail-size-item__desc"},s5={key:1,class:"popover-content"},l5={class:"popover-title"},i5={class:"popover-list flex items-center"},r5={class:"platform-popover-list"},c5={class:"cursor-pointer bg-#F7F7F7 hover:bg-[#F6F6F6]! rounded-4px relative"},u5={class:"w-40px h-40px flex items-center justify-center"},d5={key:0,src:Ss,alt:"",class:"w-14px h-14px check-icon"},p5=["onClick"],m5=["src"],g5={class:"text-12px text-center mt-4px"},f5={key:0,src:Ss,alt:"",class:"w-14px h-14px check-icon"},v5={class:"popover-content mt-16px"},h5={class:"popover-title"},_5={class:"popover-list scrollbar min-w-100px mt-10px"},y5={class:"popover-content w-300px py-12px pl-12px"},x5={class:"popover-list scrollbar"},b5=["onClick"],I5={class:"flex items-center gap-3"},C5={class:"flex gap-1"},k5={class:"flex flex-col flex-1"},w5={class:"text-sm font-medium text-gray-800"},P5={class:"text-xs text-gray-500 mt-0.5 line-clamp-1"},M5={class:"popover-content mt-16px max-w-max"},S5={class:"flex items-center justify-between h-12px"},$5={class:"flex items-center"},T5={class:"line-height-1 ml-4px"},A5={class:"flex items-center h-12px"},U5={class:"line-height-1 ml-4px"},L5={class:"popover-content"},E5={class:"popover-title"},q5={class:"popover-list scrollbar"},D5=["onClick"],O5={class:"px-16px flex items-center justify-between h-full w-full"},N5={class:"flex items-center justify-between"},R5={class:"popover-item-label"},F5={class:"w-82px text-center"},G5={class:"line-height-1 ml-4px"},V5={__name:"long-image-params",props:{isChatPinned:{type:Boolean,default:!1},isSystemQuotaExhausted:{type:Boolean,default:!1},longImageOptionsList:{type:Array,default:()=>[]},modeLoading:{type:Boolean,default:!1}},emits:["selectNum","change-long-image-mode"],setup(u,{emit:g}){var ye;const i=u,c=g,{t:o}=mt(),x=bt(),_=la();oa();const{userInfo:m}=va(_);h([]),h(null);const p=h(!1),d=[Qc,Xc,Zc,eu],R=F(()=>x.isDetailImg&&i.longImageOptionsList.length>0),U=F(()=>i.longImageOptionsList),G=F(()=>{const me=i.longImageOptionsList.find(re=>re.value===x.longImageChatMode);return(me==null?void 0:me.label)||"é¿å¾æ¨¡å"}),a=(me={},re=0)=>
1me!=null&&me.icon?me.icon:d[re%d.length],E=(me,re={})=>{!me||i.modeLoading||(re.close!==!1&&(p.value=!1),c("change-long-image-mode",me))},z=me=>{E(me)},q=h([{value:"default",label:o("qinghu-ai.long-image-params.227781-12"),description:o("qinghu-ai.long-image-params.227781-13"),colors:["#000000","#FFFFFF","#666666","#F5F5F5"],primaryColor:"#000000",secondaryColor:"#FFFFFF"},{value:"black",label:o("qinghu-ai.long-image-params.227781-14"),description:o("qinghu-ai.long-image-params.227781-15"),colors:["#000000","#FFFFFF","#666666","#F5F5F5"],primaryColor:"#000000",secondaryColor:"#FFFFFF"},{value:"ocean",label:o("qinghu-ai.long-image-params.227781-16"),description:o("qinghu-ai.long-image-params.227781-17"),colors:["#0EA5E9","#0284C7","#0369A1","#E0F2FE"],primaryColor:"#0EA5E9",secondaryColor:"#E0F2FE"},{value:"sunset",label:o("qinghu-ai.long-image-params.227781-18"),description:o("qinghu-ai.long-image-params.227781-19"),colors:["#F97316","#EA580C","#DC2626","#FEF3C7"],primaryColor:"#F97316",secondaryColor:"#FEF3C7"},{value:"forest",label:o("qinghu-ai.long-image-params.227781-20"),description:o("qinghu-ai.long-image-params.227781-21"),colors:["#059669","#047857","#065F46","#ECFDF5"],primaryColor:"#059669",secondaryColor:"#ECFDF5"},{value:"lavender",label:o("qinghu-ai.long-image-params.227781-22"),description:o("qinghu-ai.long-image-params.227781-23"),colors:["#8B5CF6","#7C3AED","#6D28D9","#F3E8FF"],primaryColor:"#8B5CF6",secondaryColor:"#F3E8FF"},{value:"rose",label:o("qinghu-ai.long-image-params.227781-24"),description:o("qinghu-ai.long-image-params.227781-25"),colors:["#EC4899","#DB2777","#BE185D","#FDF2F8"],primaryColor:"#EC4899",secondaryColor:"#FDF2F8"},{value:"golden",label:o("qinghu-ai.long-image-params.227781-26"),description:o("qinghu-ai.long-image-params.227781-27"),colors:["#F59E0B","#D97706","#B45309","#FFFBEB"],primaryColor:"#F59E0B",secondaryColor:"#FFFBEB"},{value:"midnight",label:o("qinghu-ai.long-image-params.227781-28"),description:o("qinghu-ai.long-image-params.227781-29"),colors:["#1E293B","#0F172A","#020617","#F1F5F9"],primaryColor:"#1E293B",secondaryColor:"#F1F5F9"}]),S=h([o("qinghu-ai.long-image-params.227781-30"),o("qinghu-ai.long-image-params.227781-31"),o("qinghu-ai.long-image-params.227781-32"),o("qinghu-ai.long-image-params.227781-33"),o("qinghu-ai.long-image-params.227781-34"),o("qinghu-ai.long-image-params.227781-35"),o("qinghu-ai.long-image-params.227781-36"),o("qinghu-ai.long-image-params.227781-37"),o("qinghu-ai.long-image-params.227781-38"),o("qinghu-ai.long-image-params.227781-60"),o("qinghu-ai.long-image-params.227781-61"),o("qinghu-ai.long-image-params.227781-58"),o("qinghu-ai.long-image-params.227781-59"),o("qinghu-ai.long-image-params.227781-62"),o("qinghu-ai.long-image-params.227781-64"),o("qinghu-ai.long-image-params.227781-63"),o("qinghu-ai.long-image-params.255520-2")]),O=F(()=>x.longImageChatMode==="SKU_GENERATION"?[1,6,7,8,9,10]:[1,2,4,6,8,10]),N=h([{value:"1080x1440",label:o("qinghu-ai.long-image-params.227781-39"),class:"ratio_1_1"},{value:"1080x1080",label:"instagram",class:"ratio_2_3"},{value:"1200x630",label:"Facebook",class:"ratio_4_3"},{value:"1200x675",label:"x (Twitter)",class:"ratio_9_16"},{value:"1200x1200",label:o("qinghu-ai.long-image-params.227781-40"),class:"ratio_16_9"},{value:"1200x627",label:"LinkedIn ADs",class:"ratio_16_9"},{value:"1000x1500",label:"Pinterest",class:"ratio_16_9"},{value:"1280x720",label:o("qinghu-ai.long-image-params.227781-41"),class:"ratio_16_9"},{value:"900x383",label:o("qinghu-ai.long-image-params.227781-42"),class:"ratio_16_9"}]);h("2"),h(!1);const ae=h(!1),L=h(!1),K=h(!1),de=h(!1),W=h(!1),$=h(((ye=x.detailSizeOptions.find(me=>
1me.value===x.longImageParams.size))==null?void 0:ye.key)||x.detailSizeOptions[0].key);Ne(()=>x.longImageParams.size,me=>{const re=x.detailSizeOptions.find(Oe=>Oe.key===$.value);if((re==null?void 0:re.value)===me)return;const fe=x.detailSizeOptions.find(Oe=>Oe.value===me);fe&&($.value=fe.key)}),Ne(W,me=>{me||(de.value=!1)});const j=h((()=>{try{const me=JSON.parse(localStorage.getItem(x.DETAIL_IMG_PLATFORM_USAGE_COUNT_KEY)||"{}")||{};return Object.keys(me).reduce((re,fe)=>{const Oe=Number(me[fe]);return Number.isFinite(Oe)&&Oe>0&&(re[fe]=Oe),re},{})}catch{return{}}})()),V=me=>me.map((re,fe)=>({...re,index:fe})).sort((re,fe)=>(j.value[fe.value]||0)-(j.value[re.value]||0)||re.index-fe.index).map(({index:re,...fe})=>fe),w=F(()=>V([{label:o("components-qinghu-ai.link-pix-params.738063-129"),value:o("components-qinghu-ai.link-pix-params.738063-129"),src:Bc},{label:o("components-qinghu-ai.link-pix-params.738063-130"),value:o("components-qinghu-ai.link-pix-params.738063-130"),src:ks},{label:o("components-qinghu-ai.link-pix-params.738063-131"),value:o("components-qinghu-ai.link-pix-params.738063-131"),src:Kc},{label:o("components-qinghu-ai.link-pix-params.738063-132"),value:o("components-qinghu-ai.link-pix-params.738063-132"),src:Wc},{label:o("components-qinghu-ai.link-pix-params.738063-133"),value:o("components-qinghu-ai.link-pix-params.738063-133"),src:jc},{label:o("components-qinghu-ai.link-pix-params.738063-121"),value:o("components-qinghu-ai.link-pix-params.738063-134"),src:Hc},{label:o("components-qinghu-ai.link-pix-params.738063-135"),value:o("components-qinghu-ai.link-pix-params.738063-135"),src:hu},{label:"TK Shop",value:o("components-qinghu-ai.link-pix-params.738063-136"),src:ks},{label:o("components-qinghu-ai.link-pix-params.738063-138"),value:o("components-qinghu-ai.link-pix-params.738063-138"),src:Jc},{label:o("components-qinghu-ai.link-pix-params.738063-140"),value:o("components-qinghu-ai.link-pix-params.738063-140"),src:_u}])),I=[o("components-qinghu-ai.link-pix-params.738063-129"),o("components-qinghu-ai.link-pix-params.738063-130"),o("components-qinghu-ai.link-pix-params.738063-131"),o("components-qinghu-ai.link-pix-params.738063-132"),o("components-qinghu-ai.link-pix-params.738063-133")],k=[o("components-qinghu-ai.link-pix-params.738063-134"),o("components-qinghu-ai.link-pix-params.738063-135"),o("components-qinghu-ai.link-pix-params.738063-136"),o("components-qinghu-ai.link-pix-params.738063-138")],B=o("components-qinghu-ai.link-pix-params.738063-140"),be=me=>{if(I.some(re=>o(re)===me)){x.longImageParams.language=o("qinghu-ai.long-image-params.227781-30");return}if(k.some(re=>o(re)===me)){x.longImageParams.language=o("qinghu-ai.long-image-params.227781-32");return}o(B)===me&&(x.longImageParams.language=o("qinghu-ai.long-image-params.227781-34"))},ne=me=>{x.longImageParams.imageSetPlatform=me,be(me)};Ne(()=>O.value,me=>{me.includes(x.longImageParams.imageCount)||(x.longImageParams.imageCount=1)},{immediate:!0});const le=me=>{x.longImageParams.size=me.value,L.value=!1,kt("select_ec_size",{page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
徿ä½åº",eventDesc:"éæ©æ¯ä¾å°ºå¯¸",buttonName:me.label,size:me.value,label:me.label})},ce=me=>{$.value=me.key,x.longImageParams.size=me.value,kt("select_ec_size",{page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
徿ä½åº",eventDesc:"éæ©æ¯ä¾å°ºå¯¸",buttonName:me.label,size:me.value,label:me.label})},J=F(()=>{const me=x.longImageParams.seedeTheme,re=q.value.find(fe=>fe.value===(me==null?void 0:me.value));return re?re.label:o("qinghu-ai.long-image-params.227781-11")}),oe=me=>{x.longImageParams.seedeTheme=me,de.value=!1,kt("select_ec_color",{page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
徿ä½åº",eventDesc:"éæ©é
è²",buttonName:me==null?void 0:me.label,theme:me==null?void 0:me.value,label:me==null?void 0:me.label})},te=me=>{x.longImageParams.language=me||"",ae.value=!1,kt("select_ec_language",{page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
徿ä½åº",eventDesc:"éæ©è¯¦æ
å¾è¯è¨",buttonName:me,language:me})},Q=F(()=>{const me=x.longImageParams.size,re=N.value.find(fe=>fe.value===me);return re?re.label:o("qinghu-ai.long-image-params.227781-10")});F(()=>(x.longImageParams.language,x.longImageParams.language?x.longImageParams.language:o("qinghu-ai.long-image-params.227781-9")));const ie=F(()=>{var fe;const me=[],re=x.longImageParams;if(x.longImageChatMode=="EDIT_GENERATION"){const Oe=x.detailSizeOptions.find(Ve=>Ve.value===re.size);me.push(Oe?Oe.label:re.size||"é»è®¤å°ºå¯¸")}else me.push(re.imageSetPlatform||"æ å¹³å°");return re.language&&me.push(re.language),me.push(((fe=re==null?void 0:re.seedeTheme)==null?void 0:fe.label)||"æ é
è²"),me.filter(Boolean).join(" - ")}),_e=me=>{(!m.value.defaultVip||m.value.defaultVip&&me==1)&&(x.longImageParams.imageCount=me,K.value=!1,c("selectNum"),kt("select_ec_count",{page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
徿ä½åº",eventDesc:"éæ©è¯¦æ
å¾çææ°é",buttonName:`${me}`,count:me}))},Re=me=>m.value.defaultVip&&me!=1;return Ne(()=>x.longImageParams,me=>{if(me){const re={language:me.language,size:me.size,seedeTheme:me.seedeTheme,materialImg:me.materialImg,imageCount:me.imageCount,imageSetPlatform:me.imageSetPlatform};localStorage.setItem("longImageParams",JSON.stringify(re))}},{deep:!0}),(me,re)=>{const fe=Lt,Oe=Bt,Ve=ca,H=Qa,st=Ya;return l(),f("div",O2,[e(R)?(l(),ve(Oe,{key:0,open:e(p),"onUpdate:open":re[0]||(re[0]=ge=>Fe(p)?p.value=ge:null),placement:"top",trigger:"click",getPopupContainer:ge=>ge.parentNode,arrow:!1,overlayClassName:"long-image-model-popover"},{content:P(()=>[t("div",N2,[re[8]||(re[8]=t("div",{class:"image-model-panel__title"},"ç徿¹å¼",-1)),(l(!0),f(we,null,Je(e(U),(ge,Ce)=>(l(),f("div",{key:ge.id||ge.value,class:Qe(["image-mode-card",{active:e(x).longImageChatMode===ge.value}]),onClick:$e=>z(ge)},[t("div",F2,[t("img",{src:a(ge,Ce),alt:""},null,8,G2)]),t("div",V2,[t("div",z2,r(ge.label),1),t("div",B2,r(ge.description),1)]),re[7]||(re[7]=t("div",{class:"image-mode-check"},null,-1))],10,R2))),128))])]),default:P(()=>[y(fe,{class:Qe(["ant-no-wave mr-6px",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",K2,[t("span",W2,r(e(G)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])):he("",!0),y(Oe,{open:e(W),"onUpdate:open":re[4]||(re[4]=ge=>Fe(W)?W.value=ge:null),placement:"top",trigger:"click",getPopupContainer:ge=>ge.parentNode,arrow:!1,overlayClassName:"detail-img-popover"},{content:P(()=>[t("div",null,[t("div",j2,[re[10]||(re[10]=t("img",{src:Yc,alt:"",class:"w-36px h-36px"},null,-1)),t("div",H2,[re[9]||(re[9]=t("div",{class:"text-16px text-#000000"},"çæè®¾ç½®",-1)),e(x).longImageChatMode=="EDIT_GENERATION"?(l(),f("div",J2,"éæ©æ¯ä¾å°ºå¯¸ãè¯è¨ãé
è²ï¼çææ´ç¬¦åéæ±çå¾å")):(l(),f("div",Y2,"鿩平å°ãè¯è¨ãé
è²ï¼çææ´ç¬¦åéæ±çå¾å"))])]),t("div",Q2,[t("div",X2,[e(x).longImageChatMode=="EDIT_GENERATION"?(l(),f("div",Z2,[t("div",e5,r(e(o)("qinghu-ai.link-pix-params.709204-0")),1),t("div",t5,[(l(!0),f(we,null,Je(e(x).detailSizeOptions,ge=>(l(),f("button",{key:ge.key,type:"button",class:Qe(["detail-size-item",{active:e($)===ge.key}]),onClick:Ce=>ce(ge)},[t("span",n5,r(ge.label),1),t("span",o5,r(ge.desc),1)],10,a5))),128))])])):(l(),f("div",s5,[t("div",l5,r(me.PLATFORM_LABEL),1),t("div",i5,[t("div",r5,[t("div",{class:"h-68px curs
1or-pointer color-[#3D3D3D] hover:bg-[#F6F6F6]! pb-6px",onClick:re[1]||(re[1]=ge=>ne(""))},[t("div",c5,[t("div",u5,[y(e(Wl),{class:"w-20px h-20px justify-center!"})]),e(x).longImageParams.imageSetPlatform?he("",!0):(l(),f("img",d5))]),re[11]||(re[11]=t("div",{class:"text-12px text-center mt-4px"},"æ ",-1))]),(l(!0),f(we,null,Je(e(w),ge=>(l(),f("div",{key:ge.value,class:"h-68px flex items-center cursor-pointer color-[#3D3D3D] hover:bg-[#F6F6F6]! pb-6px relative",onClick:Ce=>ne(ge.value)},[y(Ve,null,{title:P(()=>[De(r(ge.label),1)]),default:P(()=>[t("img",{src:ge.src,class:"w-40px h-40px"},null,8,m5),t("div",g5,r(ge.label),1)]),_:2},1024),e(x).longImageParams.imageSetPlatform===ge.value?(l(),f("img",f5)):he("",!0)],8,p5))),128))])])])),t("div",v5,[t("div",h5,r(e(o)("qinghu-ai.long-image-params.227781-9")),1),t("div",_5,[y(st,{class:"w-200px!",value:e(x).longImageParams.language,"onUpdate:value":re[2]||(re[2]=ge=>e(x).longImageParams.language=ge),"allow-clear":"",onChange:te},{default:P(()=>[(l(!0),f(we,null,Je(e(S),(ge,Ce)=>(l(),ve(H,{value:ge,key:Ce},{default:P(()=>[De(r(ge),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])]),y(Oe,{open:e(de),"onUpdate:open":re[3]||(re[3]=ge=>Fe(de)?de.value=ge:null),placement:"top",trigger:"click",getPopupContainer:ge=>ge.parentNode,arrow:!1,overlayClassName:"long-theme-popover"},{content:P(()=>[t("div",y5,[t("div",x5,[t("div",null,[(l(!0),f(we,null,Je(e(q),(ge,Ce)=>(l(),f("div",{key:Ce,onClick:$e=>oe(ge),class:"flex select-none items-center rounded-sm text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 w-full relative hover:bg-[#F6F6F6] transition-colors duration-200 px-4 py-3 cursor-pointer group"},[t("div",I5,[t("div",C5,[(l(!0),f(we,null,Je(ge.colors,($e,at)=>(l(),f("div",{key:at,class:"w-4 h-4 rounded-full border border-gray-200 shadow-sm",style:Nt(`background-color: ${$e}`)},null,4))),128))]),t("div",k5,[t("span",w5,r(ge.label),1),t("span",P5,r(ge.description),1)])])],8,b5))),128))])])])]),default:P(()=>[t("div",M5,[re[12]||(re[12]=t("div",{class:"popover-title"},"é
è²",-1)),y(fe,{class:"mr-6px ant-no-wave w-200px! px-11px!"},{default:P(()=>[t("div",S5,[t("div",$5,[t("span",T5,r(e(J)),1)]),y(e(Co),{class:"w-12px h-12px text-[rgba(0,0,0,0.25)]"})])]),_:1})])]),_:1},8,["open","getPopupContainer"])])])])]),default:P(()=>[y(fe,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",A5,[y(e(vu)),t("span",U5,r(e(ie)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"]),e(x).aiMessageType=="SOCIALMEDIA"?(l(),ve(Oe,{key:1,open:e(L),"onUpdate:open":re[5]||(re[5]=ge=>Fe(L)?L.value=ge:null),placement:"top",arrow:!1,trigger:"click",getPopupContainer:ge=>ge.parentNode},{content:P(()=>[t("div",L5,[t("div",E5,r(e(o)("qinghu-ai.long-image-params.227781-10")),1),t("div",q5,[(l(!0),f(we,null,Je(e(N),ge=>(l(),f("div",{key:ge.value,class:Qe(["popover-item",{active:e(x).longImageParams.size===ge.value}]),style:{width:"300px"},onClick:Ce=>le(ge)},[t("div",O5,[t("div",N5,[t("div",R5,r(ge.label),1)]),t("div",F5,r(ge.value.replace("x"," x ")),1)])],10,D5))),128))])])]),default:P(()=>[y(fe,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[y(e(E2)),t("span",G5,r(e(Q)),1),y(e(Qt),{class:"ml-10px!"})]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])):he("",!0),(l(),ve(Es,{key:`count-${e(x).longImageChatMode}`,open:e(K),"onUpdate:open":re[6]||(re[6]=ge=>Fe(K)?K.value=ge:null),title:e(o)("qinghu-ai.link-pix-params.477557-5"),description:e(o)("qinghu-ai.link-pix-params.477557-7"),options:e(O),value:e(x).longImageParams.imageCount,buttonLabel:`${e(o)("qinghu-ai.link-pix-params.477557-3")}ï¼${e(x).longImageParams.imageCount||1}ï¼`,isChatPinned:u.isChatPinned,isOptionDisabled:Re,onSelect:_e},{"item-extra":P(({option:ge})=>[e(m).defaultVip&&ge!=1?(l(),ve(Ve,{key:0},{title:P(()=>[De(r(e(o)("components-qinghu-ai.link-pix-params.738063-117")),1)]),default:P(()=>[re[13]||(re[13]=t("div",{class:"mask"},null,-1))]),_:1})):he("",!0)]),_:1},8,["open","title","description","options","value","buttonLabel","isChatPinned"]))])}}},z5=It(V5,[["__scopeId","data-v-7845e51e"]]),B5={class:"flex justify-between items-center border-b border-b-solid border-#EFEFEF h-47px p-12px"},K5={class:"flex gap-6px flex-wrap w-720px pb-15px px-20px"},W5=["onClick"],j5=["src"],H5=["textContent"],J5={key:0,class:"absolute top-[-6px] right-[-16px] bg-red px-8px py-2px rounded-[12px_0px_12px_0px] text-10px color-white"},Y5={class:"px-10px mt-10px"},Q5={class:"flex items-center"},X5=["title"],Z5=["src"],e3={class:"scene-selected-chip__text"},t3=["aria-label"],a3={class:"scene-trigger-content"},n3={class:"scene-trigger-text"},o3={class:"scene-mode-panel"},s3={class:"scene-mode-panel__head"},l3=["src"],i3={class:"scene-mode-panel__head-content"},r3={class:"scene-mode-panel__title"},c3={class:"scene-mode-panel__desc"},u3=["onClick"],d3={class:"scene-mode-card__icon"},p3=["src"],m3={class:"scene-mode-card__content"},g3={class:"scene-mode-card__title"},f3={class:"scene-mode-card__desc"},v3={class:"scene-trigger-content"},h3={class:"scene-trigger-text"},_3={class:"scene-ratio-panel"},y3={class:"scene-ratio-panel__title"},x3={class:"scene-ratio-grid"},b3={class:"scene-ratio-option__icon-wrap"},I3={class:"scene-ratio-option__label"},C3={class:"scene-trigger-content"},k3={class:"scene-trigger-text"},tc="1:1",w3=Dt({__name:"image-use-way",props:{isChatPinned:{type:Boolean,default:!1}},emits:["chooseUseWay","clear"],setup(u,{emit:g}){const{t:i}=mt(),c=bt(),o=Pa(),x=["1:1","2:3","3:2","3:4","4:3","9:16","16:9"],_=h([]),m=h(null),p=h(!1),d=h(!1),R=h(!1),U=g,G=F(()=>{var w;return((w=c.imageGenerateUseWay)==null?void 0:w.useWayData)||null}),a=F(()=>{var w;return Fa(G.value)&&Array.isArray((w=G.value)==null?void 0:w.modeList)?G.value.modeList:[]}),E=F(()=>a.value.length>0),z=F(()=>{var k;const w=a.value,I=(k=G.value)==null?void 0:k.modelSkuId;return w.find(B=>{var be;return String((be=B==null?void 0:B.modelSkuId)!=null?be:"")===String(I!=null?I:"")})||w.find(B=>B.isDefault)||w[0]||null}),q=F(()=>{var w;return E.value&&((w=z.value)==null?void 0:w.supportAspectRatio)===!0}),S=F(()=>c.imageGenerateParams.aspectRatio||tc),O=F(()=>{var I;const w=(I=G.value)==null?void 0:I.specialType;return w===Em?Yg:w===qm?Qg:""}),N=F(()=>{var I;const w=G.value;return w?`${w.name}|${w.specialType}|${(I=w.originModelSkuId)!=null?I:w.modelSkuId}`:""}),ae=()=>{c.imageGenerateParams.aspectRatio=q.value?tc:""},L=w=>{var B,be,ne,le;d.value=!1;const I=(B=c.imageGenerateUseWay)==null?void 0:B.useWayData;if(!I||String(w==null?void 0:w.modelSkuId)===String(I.modelSkuId))return;const k=(be=I.originIsFree)!=null?be:I.isFree===!0;c.imageGenerateUseWay={...c.imageGenerateUseWay,useWayData:{...I,originModelSkuId:(ne=I.originModelSkuId)!=null?ne:I.modelSkuId,originIsFree:k,modelSkuId:w.modelSkuId,isFree:(le=w.isFree)!=null?le:k,skipAction:w.skipAction===!0,supportAspectRatio:w.supportAspectRatio===!0}},ae(),c.getEstimatedPoints()},K=w=>{R.value=!1,w!==S.value&&(c.imageGenerateParams.aspectRatio=w)},de=w=>{const[I,k]=w.split(":").map(Number);if(!I||!k)return{};const B=16;return I>=k?{width:`${B}px`,height:`${Math.max(7,Math.round(k/I*B))}px`}:{width:`${Math.max(7,Math.round(I/k*B))}px`,height:`${B}px`}},W=w=>(w==null?void 0:w.isDefault)===!0?Xg:Zg;Ne(N,()=>{d.value=!1,R.value=!1,a.value.length&&ae()}),Ne(d,w=>{w&&(R.value=!1)}),Ne(R,w=>{w&&(d.value=!1)}),T0(m,w=>{w.target.closest(".ant-popover-title")||(c.imageUseWayVisible=!1)});const $=w=>{U("chooseUseWay",w),c.imageUseWayVisible=!1},Y=()=>{c.imageUseWayVisible=!1,U("clear")},j=w=>{var k,B,be,ne;if(!G.value)return!1;const I=(be=(k=G.value)==null?void 0:k.originModelSkuId)!=null?be:(B=G.value)==null?void 0:B.modelSkuId;return(w==null?void 0:w.name)===((ne=G.value)==null?void 0:ne.name)&&String((w==null?void 0:w.modelSkuId)||"")===String(I||"")},V=async()=>{p.value=!0;try{const{code:w,success:I,payload:k}=await Rl("IMAGE_USE_WAY");if(w===200&&I&&(_.value=k,o.query.id&&!G.value)){const B=k.find(be=>be.modelSkuId==o.query.id);B&&(U("chooseUseWay",B),c.imageUseWayVisible=!1)}}catch{}finally{p.value=!1}};return Rt(()=>{V()}),(w,I)=>{const k=ca,B=Xn,be=Lt,ne=Bt;return l(),f(we,null,[y(ne,{open:e(c).imageUseWayVisible,"onUpdate:open":I[3]||(I[3]=le=>e(c).imageUseWayVisible=le),arrow:!1,"z-index":1200,trigger:"click",placement:"topLeft",ref_key:"imageUseWayRef",ref:m,overlayClassName:"linkpix-scene-popover",overlayInnerStyle:{padding:0}},{title:P(()=>[t("div",B5,[t("span",null,r(e(i)("components-qinghu-ai.image-use-way.738063-111")),1),y(e(ma),{class:"cursor-pointer",onClick:I[0]||(I[0]=le=>e(c).imageUseWayVisible=!1)})])]),content:P(()=>[t("div",K5,[(l(!0),f(we,null,Je(e(_),le=>(l(),f("div",{key:le.name,onClick:ce=>
1$(le),class:Qe(["b b-solid b-transparent rounded-8px cursor-pointer w-108px h-136px text-#3D3D3D flex flex-center flex-col! gap-y-10px hover:bg-#F6F6F6 hover:text-#000! relative",{"scene-option-active":j(le)}])},[t("img",{src:le.imageUrl,alt:"",class:"w-88px h-88px"},null,8,j5),t("span",{textContent:r(le.name),class:"text-14px"},null,8,H5),le.isFree?(l(),f("span",J5,r(le.tag||e(i)("components-qinghu-ai.video-params.738063-234")),1)):he("",!0)],10,W5))),128)),t("div",Y5,[t("div",Q5,[t("div",null,r(e(i)("components-qinghu-ai.batch-upload-img.738063-71")),1),y(k,null,{title:P(()=>[De(r(e(i)("components-qinghu-ai.batch-upload-img.738063-72")),1)]),default:P(()=>[y(e(pa),{class:"ml-6px mr-10px color-[rgba(61,61,61,0.60)]"})]),_:1}),y(B,{checked:e(c).imageUseWay,"onUpdate:checked":I[1]||(I[1]=le=>e(c).imageUseWay=le)},null,8,["checked"])])])])]),default:P(()=>[e(G)?(l(),f("div",{key:0,class:"scene-selected-chip mr-6px",title:e(G).name,role:"button",tabindex:"0",onKeydown:I[2]||(I[2]=Is(le=>e(c).imageUseWayVisible=!0,["enter"]))},[e(G).imageUrl?(l(),f("img",{key:0,src:e(G).imageUrl,alt:"",class:"scene-selected-chip__icon"},null,8,Z5)):(l(),ve(e(zr),{key:1,class:"scene-selected-chip__icon"})),t("span",e3,r(e(G).name),1),y(k,{title:e(i)("components-qinghu-ai.image-use-way.clear-scene")},{default:P(()=>[t("button",{type:"button",class:"scene-selected-chip__close","aria-label":e(i)("components-qinghu-ai.image-use-way.clear-scene"),onClick:Be(Y,["stop","prevent"])},[y(e(ma))],8,t3)]),_:1},8,["title"])],40,X5)):(l(),ve(be,{key:1,class:"ant-no-wave mr-6px scene-trigger-button"},{default:P(()=>[t("div",a3,[y(e(zr),{class:"flex-shrink-0"}),t("span",n3,r(e(i)("components-qinghu-ai.batch-upload-img.738063-71")),1),y(e(Qt),{class:"scene-trigger-chevron"})])]),_:1}))]),_:1},8,["open"]),e(E)?(l(),ve(ne,{key:0,open:e(d),"onUpdate:open":I[4]||(I[4]=le=>Fe(d)?d.value=le:null),arrow:!1,"z-index":1200,trigger:"click",placement:"topLeft",overlayClassName:"scene-select-popover",overlayInnerStyle:{padding:0}},{content:P(()=>{var le,ce;return[t("div",o3,[t("div",s3,[e(O)?(l(),f("img",{key:0,src:e(O),alt:"",class:"scene-mode-panel__icon"},null,8,l3)):he("",!0),t("div",i3,[t("div",r3,r((le=e(G))==null?void 0:le.modePanelTitle),1),t("div",c3,r((ce=e(G))==null?void 0:ce.modePanelDesc),1)])]),(l(!0),f(we,null,Je(e(a),J=>{var oe;return l(),f("div",{key:J.modeKey,class:Qe(["scene-mode-card",{active:J.modeKey===((oe=e(z))==null?void 0:oe.modeKey)}]),onClick:te=>L(J)},[t("div",d3,[t("img",{src:W(J),alt:""},null,8,p3)]),t("div",m3,[t("div",g3,r(J.modeName),1),t("div",f3,r(J.modeDesc),1)]),I[6]||(I[6]=t("div",{class:"scene-mode-check"},null,-1))],10,u3)}),128))])]}),default:P(()=>[y(be,{class:"ant-no-wave mr-6px scene-select-trigger"},{default:P(()=>{var le;return[t("div",v3,[t("span",h3,r((le=e(z))==null?void 0:le.modeName),1),y(e(Qt),{class:"scene-trigger-chevron"})])]}),_:1})]),_:1},8,["open"])):he("",!0),e(q)?(l(),ve(ne,{key:1,open:e(R),"onUpdate:open":I[5]||(I[5]=le=>Fe(R)?R.value=le:null),arrow:!1,"z-index":1200,trigger:"click",placement:"topLeft",overlayClassName:"scene-select-popover",overlayInnerStyle:{padding:0}},{content:P(()=>[t("div",_3,[t("div",y3,r(e(i)("components-qinghu-ai.video-params.aspect-ratio")),1),t("div",x3,[(l(),f(we,null,Je(x,le=>y(be,{key:le,"html-type":"button",class:Qe(["scene-ratio-option ant-no-wave",{"is-active":le===e(S)}]),onClick:ce=>K(le)},{default:P(()=>[t("span",b3,[t("span",{class:"scene-ratio-option__icon",style:Nt(de(le))},null,4)]),t("span",I3,r(le),1)]),_:2},1032,["class","onClick"])),64))])])]),default:P(()=>[y(be,{class:"ant-no-wave mr-6px scene-select-trigger"},{default:P(()=>[t("div",C3,[t("span",{class:"scene-ratio-option__icon",style:Nt(de(e(S)))},null,4),t("span",k3,r(e(S)),1),y(e(Qt),{class:"scene-trigger-chevron"})])]),_:1})]),_:1},8,["open"])):he("",!0)],64)}}}),P3=It(w3,[["__scopeId","data-v-ffd1a952"]]),M3={class:"type-options-content"},S3=["onClick"],$3={class:"flex items-center h-12px"},T3={class:"line-height-1 ml-4px active-text"},A3={__name:"LinkPixTypeSelect",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=h(!1),c=bt();Kt();const o=[{label:g("qinghu-ai.link-pix-tab.031551-1"),value:"LINKPIX",path:"",icon:xf},{label:g("qinghu-ai.link-pix-tab.031551-0"),value:"IMAGETOVIDEO",path:"",icon:bf},{label:g("qinghu-ai.link-pix-tab.031551-2"),value:"LONGIMAGE",path:"",icon:If},{label:g("asset-library.prompt.category.adMaterial"),value:"AD_MATERIAL",path:"",icon:Cf},{label:g("asset-library.prompt.category.podMaterial"),value:"POD_MATERIAL",path:"",icon:Dm},{label:g("qinghu-ai.link-pix-tab.031551-5"),value:"VIDEO_TRANSLATION",path:"",icon:kf}],x=_=>{kt("click_image_generate_btn",{page:"é¦é¡µ",module:"æ ¸å¿åè½Tabåº",moduleCategory1:"æ ¸å¿åè½Tabåº",moduleCategory2:"è¾å
¥æ¡æä½åº",eventDesc:"ç¹å»ãåè½åæ¢ãæé®",buttonName:_.label,from:c.aiMessageType,to:_.value,label:_.label}),c.aiMessageType=_.value,i.value=!1};return(_,m)=>{const p=Lt,d=Bt;return l(),ve(d,{open:e(i),"onUpdate:open":m[1]||(m[1]=R=>Fe(i)?i.value=R:null),placement:"top",arrow:!1,trigger:"click"},{content:P(()=>[t("div",M3,[(l(),f(we,null,Je(o,(R,U)=>t("div",{class:Qe(["item",`${e(c).aiMessageType===R.value&&"active"}`]),key:U,onClick:G=>x(R)},r(R.label),11,S3)),64))])]),default:P(()=>[y(p,{class:Qe(["mr-6px ant-no-wave color-primary! border-primary!",[u.isChatPinned?" border-none!":""]]),onClick:m[0]||(m[0]=R=>i.value=!0)},{default:P(()=>{var R,U;return[t("div",$3,[(l(),ve(rn((R=o.find(G=>G.value===e(c).aiMessageType))==null?void 0:R.icon),{class:"w-14px! h-14px! active-text"})),t("span",T3,r((U=o.find(G=>G.value===e(c).aiMessageType))==null?void 0:U.label),1),y(e(Qt),{class:"ml-10px! active-text"})])]}),_:1},8,["class"])]),_:1},8,["open"])}}},U3=It(A3,[["__scopeId","data-v-03113c30"]]),L3="application/x-qinghu-result-image",Cn=u=>{var o;if(!u)return"";const g=u.getData(L3);if(g)return g;
1const i=u.getData("text/uri-list");if(i)return i.split(/\r?\n/).map(x=>x.trim()).find(x=>x&&!x.startsWith("#"))||"";const c=((o=u.getData("text/plain"))==null?void 0:o.trim())||"";return/^https?:\/\/.+/i.test(c)?c:""},kn=u=>Array.from((u==null?void 0:u.files)||[]).filter(g=>g.type.startsWith("image/")),E3={class:"flex pl-12px"},q3={class:"flex pt-8px flex-nowrap overflow-x-auto"},D3={class:"pod-position-panel"},O3={class:"pod-position-panel__title"},N3={class:"pod-position-panel__grid"},R3={class:"pod-position-panel__custom"},F3={class:"pod-material-fit-card"},G3={class:"pod-material-thumb"},V3=["src"],z3={class:"pod-material-fit-card__label"},B3=["onClick"],K3={key:1,class:"pod-material-thumb"},W3=["src"],j3=["onClick"],H3={class:"w-full h-full flex flex-col items-center justify-center"},J3={class:"text-14px color-[#3D3D3D] my-6px"},Y3={class:"text-12px"},Q3={class:"text-12px"},X3={class:"text-12px"},Z3={class:"pod-upload-material-btn__text"},e_={key:1,class:"text-center"},t_={class:"text-10px"},a_=["src"],n_=["onClick"],o_={class:"w-full h-full flex flex-col items-center justify-center"},s_={class:"text-14px color-[#3D3D3D] my-6px"},l_={class:"text-12px"},i_={class:"text-12px"},r_={class:"text-12px"},c_={class:"pod-upload-material-btn__text"},u_={key:1,class:"text-center"},d_={class:"text-10px"},ac=10,nc=1,p_=1,m_={__name:"pod-upload-material",emits:["success"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=bt(),x=i,_=la(),m=oa(),p=wa(),{userInfo:d}=va(_),R=Kt(),U=h([]),G=h([]),a=h(null),E=h(null),z=h(null),q=h(null),S=h(!1),O=h(!1),N=h(!1),ae=h(!1),L=h(""),K=h(null);let de=null;const W=F(()=>["产åå
¨èº«æ»¡ç","è¡£æè©é¨","è¡£æä¸é´","è¡£æè
°é¨","è¡£æå·¦è¸å£","ä¾§ç¼çº¿å¤"]),$=F(()=>d.value?!d.value.defaultVip:!1),Y=F(()=>o.podMaterialParams.podMaterialMode==="STAMP_FISSION"),j=F(()=>o.podMaterialParams.podMaterialMode==="STAMP_APPLY"&&hs(o.podMaterialParams)===Ea.ONE_PATTERN_TO_MULTI_PRODUCT),V=F(()=>j.value?1:Y.value?p_:$.value?ac:nc),w=F(()=>o.podMaterialParams.podMaterialMode==="STAMP_APPLY"),I=F(()=>(o.podMaterialParams.images||[]).filter(Ge=>Ge==null?void 0:Ge.url)),k=F(()=>j.value?I.value.length<V.value:!0),B=F(()=>(o.podMaterialParams.productImages||[]).filter(Boolean)),be=F(()=>j.value?$.value?ac:nc:1),ne=F(()=>w.value?j.value?B.value.length<be.value:B.value.length===0:!1),le=()=>!$.value&&!Y.value&&!j.value,ce=()=>!$.value&&j.value,J=()=>{m.error(c("qinghu-ai.long-upload-material.697730-6",[V.value]))},oe=()=>{m.error(`æå¤ä¸ä¼ ${be.value}å¼ äº§åå¾`)},te=()=>(o.podMaterialParams.images||[]).map(Ge=>Ge.url).filter(Boolean),Q=()=>{U.value=te(),x("success",U.value)},ie=()=>{if(!Y.value&&!j.value)return;const Ge=o.podMaterialParams.images||[];Ge.length<=1||(o.podMaterialParams.images=Ge.slice(0,1),Q())},_e=()=>{if(!w.value)return;const Ge=o.podMaterialParams.productImages||[],T=be.value;Ge.length<=T||(o.podMaterialParams.productImages=Ge.slice(0,T),G.value=o.podMaterialParams.productImages)},Re=Ge=>{const X=(Array.isArray(Ge)?Ge:[Ge]).map(Ee=>typeof Ee=="string"?Ee:(Ee==null?void 0:Ee.url)||(Ee==null?void 0:Ee.imageUrl)||"").filter(Boolean);return Array.from(new Set(X))},ye=Ge=>{o.podMaterialParams.images.splice(Ge,1),o.podMaterialParams.images.length===0&&(o.podMaterialParams.images=[]),Q()},me=(Ge,T)=>{var Ee;const X=(Ee=o.podMaterialParams.images)==null?void 0:Ee[Ge];X&&(X.position=X.position===T?"":T,K.value=null)},re=Ge=>{var Ee;const T=L.value.trim();if(!T)return;const X=(Ee=o.podMaterialParams.images)==null?void 0:Ee[Ge];X&&(X.position=T,L.value="",K.value=null)},fe=(Ge,T)=>{K.value=Ge?T:null},Oe=Ge=>{N.value=!1;const T=Re(Ge);if(!T.length)return;const X=o.podMaterialParams.images||[];if(X.length>=V.value){le()?Te():J();return}const Ee=new Set(X.map(Me=>Me==null?void 0:Me.url).filter(Boolean)),Ye=T.filter(Me=>!Ee.has(Me)).slice(0,V.value-X.length);Ye.length&&(o.podMaterialParams.images=[...X,...Ye.map(Me=>({url:Me,position:"",fnType:"material"}))],Q())},Ve=Ge=>{ae.value=!1;const T=Re(Ge);if(!T.length)return;if(!j.value){const Me=T[0];o.podMaterialParams.productImages=[Me],G.value=[Me];return}const X=o.podMaterialParams.productImages||[];if(X.length>=be.value){ce()?Te():oe();return}const Ee=new Set(X),Ye=T.filter(Me=>!Ee.has(Me)).slice(0,be.value-X.length);Ye.length&&(o.podMaterialParams.productImages=[...X,...Ye],G.value=o.podMaterialParams.productImages)},H=Ge=>{if((o.podMaterialParams.images||[]).length>=V.value){le()?Te():J();return}N.value=!1,Oe({url:Ge.imageUrl})},st=Ge=>{Ve({url:Ge.imageUrl})},ge=(Ge,T)=>{if(T){if(Ge==="product"){Ve({url:T});return}Oe({url:T})}},Ce=async(Ge,T)=>{var X,Ee,Ye,Me;if(T){if(Ge==="product"){if(O.value)return;if(B.value.length>=be.value){Se();return}ae.value=!0,await tt(),await((Ee=(X=E.value)==null?void 0:X.handleCustomUploads)==null?void 0:Ee.call(X,{file:T}));return}if(!S.value){if((o.podMaterialParams.images||[]).length>=V.value){nt();return}N.value=!0,await tt(),await((Me=(Ye=a.value)==null?void 0:Ye.handleCustomUploads)==null?void 0:Me.call(Ye,{file:T}))}}},$e=(Ge,T)=>{T&&ge(Ge,T)},at=async(Ge,T)=>{const X=T==="product"?be.value:V.value,Ee=T==="product"?B.value.length:(o.podMaterialParams.images||[]).length,Ye=kn(Ge.dataTransfer).slice(0,Math.max(0,X-Ee));if(Ye.length){for(const D of Ye)await Ce(T,D);return}const Me=Cn(Ge.dataTransfer);Me&&await $e(T,Me)},nt=()=>{if(le()){Te();return}J()},Se=()=>{if(ce()){Te();return}oe()},se=(Ge=0)=>{o.podMaterialParams.productImages.splice(Ge,1),o.podMaterialParams.productImages.length===0&&(o.podMaterialParams.productImages=[]),G.value=o.podMaterialParams.productImages},Te=()=>{de||(de=p.confirm({title:c("composables.createTaskValidate.609182-1"),width:466,class:"pod-upload-vip-limit-confirm",maskClosable:!1,keyboard:!1,cancelText:c("create-task.index.9326441-12"),okText:c("auth-mask.index.837851-1"),content:c("components-qinghu-ai.pod-upload-material.930519-108"),afterClose:()=>{de=null},onOk:()=>{window.open(R.resolve({path:"/upgrade"}).href,"_blank")}}))};Rt(()=>{U.value=te(),G.value=o.podMaterialParams.productImages||[]}),Ne(()=>o.podMaterialParams.productImages,Ge=>{G.value=Ge||[]}),Ne(()=>{var Ge;return[o.podMaterialParams.podMaterialMode,o.podMaterialParams.podMaterialApplyBatchType,(Ge=o.podMaterialParams.images)==null?void 0:Ge.length]},ie,{immediate:!0}),Ne(()=>{var Ge;return[o.podMaterialParams.podMaterialMode,o.podMaterialParams.podMaterialApplyBatchType,(Ge=o.podMaterialParams.productImages)==null?void 0:Ge.length,$.value]},_e,{immediate:!0});const Xe=Ge=>{Ge&&tt(()=>{var T;(T=z==null?void 0:z.value)==null||T.fetchHistoryImages()})},pt=Ge=>{Ge&&tt(()=>{var T;(T=q==null?void 0:q.value)==null||T.fetchHistoryImages()})};return g({uploadImg:async Ge=>{if(!Ge)return;const T=await Fl(Ge,15*1024*1024,!1);if(!(T!=null&&T.success))return;const X=new FormData;X.append("file",Ge),X.append("uploadBizType","COMMON_IMAGE");try{S.value=!0;const Ee=await Va(X);(Ee!=null&&Ee.success||(Ee==null?void 0:Ee.code)===200)&&(Ee!=null&&Ee.payload)?Oe(Ee.payload):m.error((Ee==null?void 0:Ee.message)||c("qinghu-ai.batch-upload-img.462068-2"))}catch{m.error(c("qinghu-ai.batch-upload-img.462068-2"))}finally{S.value=!1}}}),(Ge,T)=>{const X=Lt,Ee=ba,Ye=Bt,Me=Wt,D=ga,Ae=Sa;return l(),f("div",E3,[t("div",q3,[(l(!0),f(we,null,Je(e(o).podMaterialParams.images,(We,ot)=>(l(),f("div",{key:We.url||ot,class:"pod-material-fit-item mr-8px mb-8px"},[e(w)?(l(),ve(Ye,{key:0,placement:"top",trigger:"click",overlayClassName:"pod-position-popover",open:e(K)===ot,onOpenChange:it=>fe(it,ot)},{content:P(()=>[t("div",D3,[t("div",O3,[De(r(e(c)("components-qinghu-ai.pod-upload-material.930519-109"))+" ",1),t("span",null,r(e(c)("components-qinghu-ai.pod-upload-material.930519-110")),1)]),t("div",N3,[(l(!0),f(we,null,Je(e(W),it=>(l(),ve(X,{key:it,class:Qe(["pod-position-option ant-no-wave",{"is-active":We.position===it}]),onClick:qt=>me(ot,it)},{default:P(()=>[T[17]||(T[17]=t("span",{class:"pod-position-option__dot"},null,-1)),t("span",null,r(it),1)]),_:2},1032,["class","onClick"]))),128))]),T[18]||(T[18]=t("div",{class:"pod-position-panel__divider"},null,-1)),t("div",R3,[y(Ee,{value:e(L),"onUpdate:value":T[0]||(T[0]=it=>Fe(L)?L.value=it:null),placeholder:e(c)("components-qinghu-ai.pod-upload-material.930519-111"),onPressEnter:it=>re(ot)},null,8,["value","placeholder","onPressEnter"]),y(X,{class:"ant-no-wave",disabled:!e(L),onClick:it=>
1re(ot)},{default:P(()=>[De(r(e(c)("qinghu-ai.long-image-material.139562-6")),1)]),_:1},8,["disabled","onClick"])])])]),default:P(()=>[t("div",F3,[t("div",G3,[t("img",{src:We.url,alt:"",class:"pod-material-thumb__img"},null,8,V3)]),t("div",z3,[t("span",null,r(We.position||e(c)("components-qinghu-ai.pod-upload-material.930519-109")),1),y(e(Qt),{class:"w-12px h-12px ml-4px"})]),t("img",{src:Ca,alt:"",class:"pod-material-thumb__close",onClick:Be(it=>ye(ot),["stop"])},null,8,B3)])]),_:2},1032,["open","onOpenChange"])):(l(),f("div",K3,[t("img",{src:We.url,alt:"",class:"pod-material-thumb__img"},null,8,W3),t("img",{src:Ca,alt:"",class:"pod-material-thumb__close",onClick:Be(it=>ye(ot),["stop"])},null,8,j3)]))]))),128)),e(k)?(l(),ve(Ye,{key:0,placement:"top",open:e(N),"onUpdate:open":T[8]||(T[8]=We=>Fe(N)?N.value=We:null),trigger:"click",onOpenChange:Xe},{content:P(()=>[t("div",{class:"w-344px",onDragover:T[4]||(T[4]=Be(()=>{},["stop","prevent"])),onDrop:T[5]||(T[5]=Be(We=>at(We,"material"),["stop","prevent"]))},[y(D,{ref_key:"uploadRef",ref:a,value:e(U),"onUpdate:value":T[1]||(T[1]=We=>Fe(U)?U.value=We:null),name:"coverImage",temp:!1,multiple:!0,showUploadList:!1,maxCount:e(V),size:15*1024*1024,activeTabKey:"2",uploadBizType:"COMMON_IMAGE",showLimitMessage:!1,onStartUploading:T[2]||(T[2]=We=>S.value=!0),onEndUploading:T[3]||(T[3]=We=>S.value=!1),onLimitExceed:nt,onSuccess:Oe,class:"pod-upload-material-area",validateWH:!1},{default:P(()=>[t("div",H3,[e(S)?(l(),ve(Me,{key:0})):(l(),f(we,{key:1},[T[19]||(T[19]=t("img",{src:on,alt:"",class:"w-28px h-28px"},null,-1)),t("div",J3,r(e(c)("components-qinghu-ai.pod-upload-material.930519-102")),1),t("div",Y3,r(e(c)("qinghu-ai.long-upload-material.697730-4")),1),t("div",Q3,r(e(c)("qinghu-ai.batch-upload-img.998187-6")),1),t("div",X3,r(e(c)("qinghu-ai.long-image-params.227781-6"))+r(e(V))+r(e(c)("dashboard.home-head.325764-3")),1)],64))])]),_:1},8,["value","maxCount"])],32),e(N)?(l(),ve(Ae,{key:0,ref_key:"historyImageRef",ref:z,onClickItem:H},null,512)):he("",!0)]),default:P(()=>[t("div",{class:"pod-upload-material-btn mr-8px mb-8px",onDragover:T[6]||(T[6]=Be(()=>{},["stop","prevent"])),onDrop:T[7]||(T[7]=Be(We=>at(We,"material"),["stop","prevent"]))},[e(S)?(l(),f("div",e_,[y(Me,{size:"small"}),t("div",t_,r(e(c)("qinghu-ai.batch-upload-img.708047-0")),1)])):(l(),f(we,{key:0},[T[20]||(T[20]=t("img",{src:xa,alt:"",class:"w-16px h-16px"},null,-1)),t("div",Z3,r(e(c)("components-qinghu-ai.pod-upload-material.930519-103")),1)],64))],32)]),_:1},8,["open"])):he("",!0),e(w)?(l(),f(we,{key:1},[(l(!0),f(we,null,Je(e(B),(We,ot)=>(l(),f("div",{key:We||ot,class:"pod-material-thumb pod-material-thumb--product mr-8px mb-8px"},[t("img",{src:We,alt:"",class:"pod-material-thumb__img"},null,8,a_),t("img",{src:Ca,alt:"",class:"pod-material-thumb__close",onClick:Be(it=>se(ot),["stop"])},null,8,n_)]))),128)),e(ne)?(l(),ve(Ye,{key:0,placement:"top",open:e(ae),"onUpdate:open":T[16]||(T[16]=We=>Fe(ae)?ae.value=We:null),trigger:"click",onOpenChange:pt},{content:P(()=>[t("div",{class:"w-344px",onDragover:T[12]||(T[12]=Be(()=>{},["stop","prevent"])),onDrop:T[13]||(T[13]=Be(We=>at(We,"product"),["stop","prevent"]))},[y(D,{ref_key:"productUploadRef",ref:E,value:e(G),"onUpdate:value":T[9]||(T[9]=We=>Fe(G)?G.value=We:null),name:"coverImage",temp:!1,multiple:e(j),showUploadList:!1,maxCount:e(be),size:15*1024*1024,activeTabKey:"2",uploadBizType:"COMMON_IMAGE",showLimitMessage:!1,onStartUploading:T[10]||(T[10]=We=>O.value=!0),onEndUploading:T[11]||(T[11]=We=>O.value=!1),onLimitExceed:Se,onSuccess:Ve,class:"pod-upload-material-area",validateWH:!1},{default:P(()=>[t("div",o_,[e(O)?(l(),ve(Me,{key:0})):(l(),f(we,{key:1},[T[21]||(T[21]=t("img",{src:on,alt:"",class:"w-28px h-28px"},null,-1)),t("div",s_,r(e(c)("components-qinghu-ai.pod-upload-material.930519-104")),1),t("div",l_,r(e(c)("qinghu-ai.long-upload-material.697730-4")),1),t("div",i_,r(e(c)("qinghu-ai.batch-upload-img.998187-6")),1),t("div",r_,"æå¤ä¸ä¼ "+r(e(be))+"å¼ äº§åå¾",1)],64))])]),_:1},8,["value","multiple","maxCount"])],32),e(ae)?(l(),ve(Ae,{key:0,ref_key:"productHistoryImageRef",ref:q,onClickItem:st},null,512)):he("",!0)]),default:P(()=>[t("div",{class:"pod-upload-material-btn mr-8px mb-8px",onDragover:T[14]||(T[14]=Be(()=>{},["stop","prevent"])),onDrop:T[15]||(T[15]=Be(We=>at(We,"product"),["stop","prevent"]))},[e(O)?(l(),f("div",u_,[y(Me,{size:"small"}),t("div",d_,r(e(c)("qinghu-ai.batch-upload-img.708047-0")),1)])):(l(),f(we,{key:0},[T[22]||(T[22]=t("img",{src:xa,alt:"",class:"w-16px h-16px"},null,-1)),t("div",c_,r(e(c)("components-qinghu-ai.batch-image-replication.407726-55")),1)],64))],32)]),_:1},8,["open"])):he("",!0)],64)):he("",!0)])])}}},g_=It(m_,[["__scopeId","data-v-6a558255"]]),f_={class:"absolute top-[-320px] left-0 w-full bg-#ffffff",style:{"z-index":"10000"}},v_={class:"w-full intelligent-agent-selection-modal"},h_={class:"px-20px pt-8px"},__={class:"px-20px"},y_={class:"mt-8px pl-20px agent-list-scroll"},x_={class:"pr-20px"},b_=["onClick"],I_={class:"w-40px h-40px"},C_=["src"],k_={class:"flex flex-1 flex-col justify-between ml-10px"},w_={class:"line-height-20px text-14px color-[#1D2129] line-clamp-1 overflow-hidden text-ellipsis"},P_={class:"text-12px color-[rgba(0, 0, 0, 0.50)] line-height-16px line-clamp-1 overflow-hidden text-ellipsis"},M_=Dt({__name:"intelligent-agent-selection-modal",emits:["selectAgent","close"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=h(!1),x=h("all"),_=h([]),m=h([]),p=h(""),d=async $=>{await $f($)&&i("selectAgent",$)},R=()=>{i("close")},U=async()=>{const{success:$,payload:Y}=await Nm();$&&(_.value=Y)},G=h({pageNum:1,pageSize:12,agentName:"",platform:"",type:"AGENT",categoryId:void 0,groupId:void 0,isHot:0,isNew:0,isPaid:0,isRecommend:0}),a=h(0);let E=null;const z=()=>{G.value.agentName="",K.value=!1,q()},q=()=>{switch(x.value){case"all":G.value.groupId="",G.value.pageNum=1,N();return;case"isNew":G.value.groupId="",G.value.pageNum=1,L();return;case"isPaid":G.value.groupId="",G.value.pageNum=1,ae();return;default:G.value.groupId=x.value,G.value.pageNum=1;break}G.value.agentName=G.value.agentName.trim(),O()},S=()=>{switch(G.value.agentName=G.value.agentName.trim(),x.value){case"all":return N();case"isNew":return L();case"isPaid":return ae();default:return O()}}
1,O=async()=>{o.value=!0;try{const{success:$,pageInfo:Y,payload:j}=await Rm(G.value);$&&(G.value.pageNum===1?m.value=j:m.value=[...m.value,...j],a.value=Y.pages)}catch{}finally{o.value=!1}},N=async()=>{o.value=!0;try{const{success:$,pageInfo:Y,payload:j}=await Fm(G.value);$&&(G.value.pageNum===1?m.value=j:m.value=[...m.value,...j],a.value=Y.pages)}catch{}finally{o.value=!1}},ae=async()=>{o.value=!0;try{const{success:$,pageInfo:Y,payload:j}=await Gm(G.value);$&&(G.value.pageNum===1?m.value=j:m.value=[...m.value,...j],a.value=Y.pages)}catch{}finally{o.value=!1}},L=async()=>{o.value=!0;try{const{success:$,pageInfo:Y,payload:j}=await Vm(G.value);$&&(G.value.pageNum===1?m.value=j:m.value=[...m.value,...j],a.value=Y.pages)}catch{}finally{o.value=!1}},K=h(!1);function de(){if(!E||o.value||K.value)return;const{scrollTop:$,scrollHeight:Y,clientHeight:j}=E;G.value.pageNum<a.value&&$+j>=Y-20&&(K.value=!0,G.value.pageNum+=1,S().finally(()=>{K.value=!1}))}const W=Om(()=>{G.value.agentName=p.value,q()},300);return Ne(p,()=>{W()}),Rt(()=>{setTimeout(()=>{E=document.querySelector(".agent-list-scroll"),E&&E.addEventListener("scroll",de)},500),U(),q()}),($,Y)=>{const j=U0,V=A0,w=ba,I=Wt;return l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"9999"},onClick:R}),t("div",f_,[t("div",v_,[t("div",null,[t("div",h_,[y(V,{activeKey:e(x),"onUpdate:activeKey":Y[0]||(Y[0]=k=>Fe(x)?x.value=k:null),onChange:z},{default:P(()=>[y(j,{key:"all",tab:e(c)("ai-chat.intelligent-agent-selection-modal.224635-0")},null,8,["tab"]),y(j,{key:"isNew",tab:e(c)("ai-chat.intelligent-agent-selection-modal.224635-1")},null,8,["tab"]),y(j,{key:"isPaid",tab:e(c)("ai-chat.intelligent-agent-selection-modal.224635-2")},null,8,["tab"]),(l(!0),f(we,null,Je(e(_),k=>(l(),ve(j,{key:k.id,tab:k.name},null,8,["tab"]))),128))]),_:1},8,["activeKey"])]),y(I,{spinning:e(o)},{default:P(()=>[t("div",__,[y(w,{value:e(p),"onUpdate:value":Y[1]||(Y[1]=k=>Fe(p)?p.value=k:null),placeholder:e(c)("ai-chat.intelligent-agent-selection-modal.224635-3"),onKeyup:Is(q,["enter"])},null,8,["value","placeholder"])]),t("div",y_,[t("div",x_,[(l(!0),f(we,null,Je(e(m),k=>(l(),f("div",{class:"flex py-8px hover:bg-[#f2f3f5] cursor-pointer",onClick:B=>d(k),key:k.id},[t("div",I_,[t("img",{src:k.icon,alt:"",srcset:"",class:"w-full h-full"},null,8,C_)]),t("div",k_,[t("div",w_,r(k.name),1),t("div",P_,r(k.briefIntroduce),1)])],8,b_))),128))])])]),_:1},8,["spinning"])])])])])}}}),S_=It(M_,[["__scopeId","data-v-0b1d01cf"]]),$_={class:"absolute top-[-380px] left-0 w-full bg-#ffffff",style:{"z-index":"10000"}},T_={class:"w-full device-selection-modal"},A_={class:"p-20px"},U_={class:"mt-12px h-247px"},L_={key:0,class:"flex justify-end py-10px"},E_={__name:"device-selection-modal",props:{currentDeviceItem:{type:Object,default:()=>({})},isBlurSave:{type:Boolean,default:!1}},emits:["selectDevice","close"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=u,x=bt(),_=h(null),m=(R=!0)=>
1{if(R&&!_.value){qe.error(c("ai-chat.device-selection-modal.428800-2"));return}!_.value||x.paramFormat.some(G=>G.key==="shop_name"&&G.required&&_.value.find(E=>(!Array.isArray(E.checkedShopList)||E.checkedShopList.length===0)&&(!Array.isArray(E.checkAll)||E.checkAll.length===0))?(qe.error(c("ai-chat.device-selection-modal.428800-3")),!0):!1)||i("selectDevice",_.value)},p=()=>{o.isBlurSave&&m(!1),i("close")},d=()=>{var R;return!!((R=x.paramFormat)!=null&&R.some(U=>U.key==="shop_name"))};return Rt(()=>{o.currentDeviceItem&&Object.keys(o.currentDeviceItem).length?_.value=o.currentDeviceItem:_.value=null}),(R,U)=>{const G=Lt;return l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"9999"},onClick:p}),t("div",$_,[t("div",T_,[t("div",A_,[t("div",null,[U[1]||(U[1]=t("span",{class:"mr-4px color-[red]"},"*",-1)),De(r(e(c)("ai-chat.device-selection-modal.428800-0")),1)]),t("div",U_,[y(Tf,{tableSize:"small",scrollY:160,value:e(_),"onUpdate:value":U[0]||(U[0]=a=>Fe(_)?_.value=a:null),"show-shop":d()},null,8,["value","show-shop"])]),u.isBlurSave?he("",!0):(l(),f("div",L_,[y(G,{type:"primary",onClick:m},{default:P(()=>[De(r(e(c)("ai-chat.device-selection-modal.428800-1")),1)]),_:1})]))])])])])}}},q_=It(E_,[["__scopeId","data-v-62c8f4cd"]]),D_={class:"w-full shadow-[0_4px_20px_0_rgba(0,0,0,0.06)]"},O_={class:"pt-20px list-scroll"},N_={class:"px-20px"},R_={key:0,class:"flex justify-end py-10px pr-20px"},F_=Dt({__name:"exec-time-modal",props:{execValue:{},isBlurSave:{type:Boolean},selectDevice:{}},emits:["close","update:execValue"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=u,x=h(null),_=h("-350px"),m=h(o.execValue),p=oa(),d=()=>{try{if(!G())return;R(),i("update:execValue",m.value)}catch{return}},R=()=>{i("close")},U=()=>{o.isBlurSave?d():R()},G=()=>{if(m.value.runType===xo.ONCE&&m.value.scheduleType==="timing"&&!m.value.startTime)return p.error(c("ai-chat.exec-time-modal.059069-1")),!1;if(m.value.runType===xo.CYCLE)if(m.value.cycleMode==="hourly"){if(!m.value.cycleHourInterval)return p.error(c("ai-chat.exec-time-modal.059069-2")),!1;if(!m.value.dateTime)return p.error(c("ai-chat.exec-time-modal.059069-3")),!1}else{if(!m.value.cycleTime)return p.error(c("ai-chat.exec-time-modal.059069-4")),!1;if(m.value.cycleMode!=="daily"){if(m.value.cycleMode==="weekly"){if(!m.value.cycleDayOfWeek)return p.error(c("ai-chat.exec-time-modal.059069-5")),!1}else if(m.value.cycleMode==="monthly"&&!m.value.cycleDayOfMonth)return p.error(c("ai-chat.exec-time-modal.059069-5")),!1}}return!0},a=()=>{tt(()=>{if(x.value){const E=x.value.offsetHeight||0;_.value=`-${E+20}px`}})};return Rt(()=>{a()}),(E,z)=>{const q=Lt;return l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"98"},onClick:U}),t("div",{class:"absolute top-[-350px] left-0 w-full bg-#ffffff",style:Nt([{"border-radius":"8px","z-index":"99","box-shadow":"0px 4px 20px 0px rgba(0,0,0,0.16)"},{top:e(_)}]),ref_key:"modalRef",ref:x},[t("div",D_,[t("div",O_,[t("div",N_,[y(Lf,{value:e(m),"onUpdate:value":z[0]||(z[0]=S=>Fe(m)?m.value=S:null),isShowHourly:!0,selectDevice:u.selectDevice},null,8,["value","selectDevice"])])]),u.isBlurSave?he("",!0):(l(),f("div",R_,[y(q,{type:"primary",onClick:d},{default:P(()=>[De(r(e(c)("ai-chat.exec-time-modal.059069-0")),1)]),_:1})]))])],4)])}}}),G_=It(F_,[["__scopeId","data-v-fa0b07d0"]]),V_={class:"absolute top-[-216px] left-0 w-full bg-#ffffff",style:{"border-radius":"8px","z-index":"10000","box-shadow":"0px 4px 20px 0px rgba(0,0,0,0.16)"}},z_={class:"w-full add-good-modal shadow-[0_4px_20px_0_rgba(0,0,0,0.06)]"},B_={class:"px-20px pt-20px"},K_={class:"flex justify-between items-center"},W_={class:"px-20px mt-12px pb-20px min-h-146px"},j_={__name:"add-good-modal",props:{modelValue:{type:String,default:""}},emits:["addGoods","close"],setup(u,{emit:g}){const{t:i}=mt(),c=h(""),o=g,x=u,_=()=>{try{if(!c.value){qe.error(i("ai-chat.add-good-modal.465452-3"));return}let d="";if(c.value&&Array.isArray(c.value))d=c.value;else{if(c.value.split(` 2`).map(E=>E.trim()).filter(E=>E).find(E=>!/^(https?:\/\/|www\.)[^\s]+$/i.test(E))){qe.error(i("ai-chat.add-good-modal.465452-4"));return}const G=c.value.split(` 3`).map(E=>E.trim()).filter(E=>E);d=Array.from(new Set(G)).join(` 4`)}o("update:modelValue",d),o("ok")}catch{qe.error(i("ai-chat.add-good-modal.465452-5"));return}},m=()=>{o("close"),_()};Ne(()=>x.modelValue,d=>{c.value=d});const p=()=>{x.modelValue&&(c.value=x.modelValue)};return Rt(()=>{p()}),(d,R)=>(l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"9999"},onClick:m}),t("div",V_,[t("div",z_,[t("div",null,[t("div",B_,[t("div",K_,[t("div",null,[R[1]||(R[1]=t("span",{class:"mr-4px color-[red]"},"*",-1)),De(r(e(i)("ai-chat.add-good-modal.465452-0")),1)])])]),t("div",W_,[y(Af,{value:e(c),"onUpdate:value":R[
40]||(R[0]=U=>Fe(c)?c.value=U:null),isInit:!1},null,8,["value"])])])])])]))}},H_=It(j_,[["__scopeId","data-v-b5b3c15b"]]),J_={class:"mr-14px w-full px-20px mt-12px"},Y_={class:"mt-12px shop-list-scroll"},Q_={class:"px-20px"},X_={key:0,class:"mask"},Z_={class:"w-500px h-200px bg-white rounded-8px flex justify-center items-center",style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)","z-index":"10000"}},e6={class:"text-center"},t6={key:0,class:"mt-20px"},a6={__name:"add-shop-form",props:{value:{type:Array,default:()=>[]},currentShopList:{type:Array,default:()=>[]},shopList:{type:Array,default:()=>[]}},emits:["update:shopData","update:value","update:shopInput","task-message"],setup(u,{expose:g,emit:i}){const c=Kt(),o=i,{t:x}=mt(),_=u,m=h(),p=h([]),d=h([]),R=oa(),U=h(!1),G=h(x("ai-chat.add-shop-form.344588-3")),a=h(""),E=h({});Ne(()=>_.shopList,O=>{if(Array.isArray(O)&&O.length>0){const N=d.value.map(K=>K.shopName),ae=[],L=[];O.forEach(K=>{const de=typeof K=="string"?K:K.shopName;N.includes(de)?ae.push(de):L.push(de)}),p.value=ae,m.value=L.join(` 5`)}},{immediate:!0});const z=()=>{const O=(m.value||"").split(` 6`).map(N=>N.trim()).filter(N=>N);return Array.from(new Set([...O,...p.value||[]])).map(N=>({shopName:N,platform:"DOUDIAN"}))};Ne(()=>m.value,O=>{let N=z();o("update:shopData",N),o("update:value",N.map(ae=>ae.shopName)),o("update:shopInput",m.value)},{immediate:!0}),Ne(()=>p.value,()=>{let O=z();o("update:shopData",O),o("update:value",O.map(N=>N.shopName))},{immediate:!0});const q=async O=>{let ae=await zm({pageNum:1,pageSize:1e3});ae.code===200?d.value=ae.payload:R.error(ae.message||x("ai-chat.add-shop-form.344588-4"))},S=()=>{c.push({path:"/ai-agents/task-monitor/artificial",query:{id:E.value.id}})};return Rt(()=>{q(),_.shopList&&_.shopList.length>0&&(p.value=_.shopList.map(O=>O.shopName)),_.value&&(p.value=_.value)}),g({getShopList:q}),(O,N)=>{const ae=Oa,L=Mo,K=L0,de=E0,W=Wt,$=Lt;return l(),f("div",null,[y(de,null,{default:P(()=>[t("div",J_,[y(ae,{placeholder:e(x)("ai-chat.add-shop-form.344588-0"),style:{width:"100%"},"auto-size":{minRows:5,maxRows:5},value:e(m),"onUpdate:value":N[0]||(N[0]=Y=>Fe(m)?m.value=Y:null)},null,8,["placeholder","value"])]),t("div",Y_,[t("div",Q_,[t("div",null,r(e(x)("ai-chat.add-shop-form.344588-1")),1),y(K,{value:e(p),"onUpdate:value":N[1]||(N[1]=Y=>Fe(p)?p.value=Y:null),style:{width:"100%"}},{default:P(()=>[(l(!0),f(we,null,Je(e(d),(Y,j)=>(l(),ve(L,{value:Y.shopName,key:j},{default:P(()=>[De(r(Y.shopName),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])])]),_:1}),e(U)?(l(),f("div",X_,[t("div",Z_,[t("div",e6,[t("div",null,[y(W,{tip:e(G)},null,8,["tip"])]),e(a)=="MANUAL_INTERVENTION"?(l(),f("div",t6,[y($,{type:"primary",onClick:S},{default:P(()=>[De(r(e(x)("ai-chat.add-shop-form.344588-2")),1)]),_:1})])):he("",!0)])])])):he("",!0)])}}},n6=It(a6,[["__scopeId","data-v-56016d51"]]),o6={class:"absolute top-[-380px] left-0 w-full bg-#ffffff rounded-8px",style:{"z-index":"10000"}},s6={class:"w-full shadow-[0_4px_20px_0_rgba(0,0,0,0.06)]"},l6={class:"flex justify-end py-10px pr-20px"},i6={__name:"add-shop-modal",props:{modelValue:{type:Array,default:()=>[]},currentDeviceItem:{type:[Object,null],default:null}},emits:["ok","close","update:status","update:modelValue"],setup(u,{emit:g}){Kt();const{t:i}=mt(),c=g,o=u,x=h([]),_=h([]),m=h(),p=h(null),d=h(!1),R=()=>{try{c("update:modelValue",x.value),c("ok");let z=U();G(z)}catch{qe.error(i("ai-chat.add-shop-modal.629823-2"));return}},U=()=>(m.value||"").split(` 7`).map(q=>q.trim()).filter(q=>q).map(q=>({shopName:q,platform:"DOUDIAN"})),G=async z=>{if(z.length===0)return;let q=await Bm({shopList:z});q.code===200?qe.success(i("ai-chat.add-shop-modal.629823-3")):qe.error(q.message||i("ai-chat.add-shop-modal.629823-4"))},a=()=>{d.value||c("close")},E=z=>{z.status==="RUNNING"&&(d.value=!0),z.status==="FAIL"&&qe.error(i("ai-chat.add-shop-modal.629823-5"))};return Ne(()=>o.modelValue,z=>{_.value=Array.isArray(z)?JSON.parse(JSON.stringify(z)):[]},{immediate:!0}),Rt(()=>{o.modelValue&&(_.value=Array.isArray(o.modelValue)?JSON.parse(JSON.stringify(o.modelValue)):[])}),(z,q)=>{const S=Lt;return l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"9999"},onClick:a}),t("div",o6,[t("div",s6,[t("div",null,[t("div",null,[y(n6,{ref_key:"addShopFormRef",ref:p,shopList:e(_),currentDeviceItem:u.currentDeviceItem,value:e(x),"onUpdate:value":q[0]||(q[0]=O=>Fe(x)?x.value=O:null),shopInput:e(m),"onUpdate:shopInput":q[1]||(q[1]=O=>Fe(m)?m.value=O:null),onTaskMessage:E},null,8,["shopList","currentDeviceItem","value","shopInput"])]),t("div",l6,[y(S,{type:"primary",onClick:R},{default:P(()=>[De(r(e(i)("ai-chat.add-shop-modal.629823-0")),1)]),_:1})])])])])])}}},r6={class:"w-full shadow-[0_4px_20px_0_rgba(0,0,0,0.06)]"},c6={class:"px-20px"},u6={key:0,class:"flex justify-end py-10px pr-20px"},d6={__name:"run-param-modal",props:{paramFormat:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}},modelValue:[String,Array,Object],isBlurSave:{type:Boolean,default:!1}},emits:["addGoods","close","update:modelValue","update:formData","ok"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=u,x=h(null),_=h("-350px"),m=o.paramFormat.reduce((a,E)=>(a[E.key]=E.value,a),{}),p=h(m),d=()=>{try{o.paramFormat.length==1&&o.paramFormat[0].required?(i("update:modelValue",p.value[o.paramFormat[0].key]),i("ok")):i("update:modelValue",p.value[o.paramFormat[0].key]),R()}catch{return}},R=()=>{i("close")},U=()=>{o.isBlurSave?d():R()};Ne(p,a=>{i("update:formData",a)},{deep:!0});const G=()=>{tt(()=>{if(x.value){const a=x.value.offsetHeight||0;_.value=`-${a+20}px`}})};return Rt(()=>{G(),o.formData&&JSON.stringify(o.formData)!=="{}"&&(p.value=o.formData)}),(a,E)=>{const z=Uf,q=Lt;return l(),f("div",null,[t("div",{class:"fixed inset-0",style:{width:"100vw",height:"100vh","z-index":"98"},onClick:U}),t("div",{class:"absolute top-[-350px] left-0 w-full bg-#ffffff",style:Nt([{"border-radius":"8px","z-index":"99","box-shadow":"0px 4px 20px 0px rgba(0,0,0,0.16)"},{top:e(_)}]),ref_key:"modalRef",ref:x},[t("div",r6,[t("div",{class:Qe(["pt-20px",u.paramFormat.length>2?"list-scroll":""])},[t("div",c6,[y(z,{ref:"formBuilderRef",isVisible:!0,"form-items":u.paramFormat,modelValue:e(p),"onUpdate:modelValue":E[0]||(E[0]=S=>Fe(p)?p.value=S:null)},null,8,["form-items","modelValue"])])],2),u.isBlurSave?he("",!0):(l(),f("div",u6,[y(q,{type:"primary",onClick:d},{default:P(()=>[De(r(e(c)("ai-chat.add-shop-modal.629823-0")),1)]),_:1})]))])],4)])}}},oc=It(d6,[["__scopeId","data-v-bc0a5903"]]),p6={class:"flex pl-8px py-8px items-center model-upload-img gap-8px"},m6=["onDrop"],g6={key:0},f6={class:"text-12px"},v6={key:1,class:"w-full h-full flex-col flex-center"},h6={class:"mt-4px text-12px",style:{"line-height":"1"}},_6=["onDrop"],y6={key:0},x6={class:"text-12px"},b6={class:"mt-4px text-12px",style:{"line-height":"1"}},I6=Dt({__name:"model-upload-img",props:{placeholderList:{},referenceRules:{}},emits:["prompt-change","state-change"],setup(u,{expose:g}){const{t:i}=mt(),c=bt(),o=u,x=F(()=>ko(o.referenceRules)?{...wo(o.referenceRules),maxFileSizeMb:Po(o.referenceRules)}:null),_=j=>{j&&(j.code==="format"?qe.error(i("image-reference.rules.formats",[j.formats.join(", ")
7])):j.code==="metadata"?qe.error(i("image-reference.rules.metadata-failed")):j.code==="file-size"?qe.error(i("image-reference.rules.file-size",[j.maxFileSizeMb])):j.code==="min-dimension"?qe.error(i("image-reference.rules.min-dimension",[j.minDimension])):j.code==="aspect-ratio"&&qe.error(i("image-reference.rules.aspect-ratio-range",j.range)))},m=async(j,V)=>{if(!x.value)return!0;const w=await _n(j,x.value,V);return w?(_(w),!1):!0},p=h([]),d=h([]),R=()=>(p.value=o.placeholderList.map(()=>h(null)),d.value=[],o.placeholderList.map((j,V)=>{const{name:w,images:I}=j;return{name:w,maxCount:1,images:I!=null?I:[],ref:p.value[V],loading:!1,popoverVisible:!1}})),U=Vn(R()),G=F(()=>U.flatMap(j=>j.images).filter(j=>j!==null));Ne(()=>G.value,j=>{c.batchUploadImgUrls=j});const a=(j,V=[])=>{const w=V.map(k=>{var B;return((B=k==null?void 0:k.response)==null?void 0:B.payload)||null}).filter(k=>k!==null),I=Array.isArray(j)?j:j?[j]:[];return w.length?w:I},E=(j,V,w=[])=>{U[j].images=a(V,w),U[j].popoverVisible=!1},z=(j,V)=>{U[j].loading=V},q=(j,V)=>{d.value[j]=V},S=j=>(j==null?void 0:j.imageUrl)||(j==null?void 0:j.url)||(j==null?void 0:j.fileUrl)||"",O=async(j,V)=>{const w=S(V);!w||!await m(V,V==null?void 0:V.imageDimensions)||(U[j].images=[w],U[j].popoverVisible=!1)},N=(j,V)=>{V&&tt(()=>{var w,I;(I=(w=d.value[j])==null?void 0:w.fetchHistoryImages)==null||I.call(w)})},ae=(j,V)=>{var B;const w=U[j].images,I=w[V];w.splice(V,1);const k=U[j].ref;(B=k==null?void 0:k.value)==null||B.remove(I)},L=()=>{U.forEach(j=>{var V,w;j.images=[],(w=(V=j.ref)==null?void 0:V.value)==null||w.clearImg()})},K=async(j,V=0)=>{Ta({options:{toolbar:!0,initialViewIndex:V},images:j})},de=async(j,V)=>{const w=U[j];!w||!V||w.images.length>=w.maxCount||await m(V)&&(w.images=[...new Set([...w.images,...a(V)])].slice(0,w.maxCount),w.popoverVisible=!1)},W=async(j,V)=>{var I,k,B;const w=U[j];!w||!V||w.loading||w.images.length>=w.maxCount||await m(V)&&(w.popoverVisible=!0,await tt(),await((B=(k=(I=w.ref)==null?void 0:I.value)==null?void 0:k.handleCustomUploads)==null?void 0:B.call(k,{file:V})))},$=async(j,V)=>{V&&await de(j,V)},Y=async(j,V)=>{const w=U[V];if(!w)return;const I=w.maxCount-w.images.length,k=kn(j.dataTransfer).slice(0,I);if(k.length){for(const be of k)await W(V,be);return}const B=Cn(j.dataTransfer);B&&await $(V,B)};return g({cleanImg:L}),Ne(()=>o.placeholderList,()=>{U.splice(0,U.length,...R())},{deep:!0}),(j,V)=>{const w=Wt,I=Bt;return l(),f("div",p6,[(l(!0),f(we,null,Je(e(U),(k,B)=>(l(),f(we,{key:k.name},[(l(!0),f(we,null,Je(k.images,(be,ne)=>(l(),f("div",{key:`${B}-${ne}`},[y($a,{url:be,onOnPreview:le=>K(e(U)[B].images,ne),onOnDelete:le=>ae(B,ne)},null,8,["url","onOnPreview","onOnDelete"])]))),128)),k.images.length<k.maxCount?(l(),ve(I,{key:0,open:k.popoverVisible,"onUpdate:open":be=>k.popoverVisible=be,placement:"top",trigger:"click",overlayClassName:"model-upload-img-popover",onOpenChange:be=>N(B,be)},{content:P(()=>[t("div",{class:"model-upload-img-popover-content",onClick:V[0]||(V[0]=Be(()=>{},["stop"])),onDragover:V[1]||(V[1]=Be(()=>{},["stop","prevent"])),onDrop:Be(be=>Y(be,B),["stop","prevent"])},[y(ga,{ref_for:!0,ref:k.ref,name:`avatar_${B}`,temp:!0,multiple:k.maxCount>1,value:k.images,showUploadList:!1,maxCount:k.maxCount,"reference-rules":e(x),activeTabKey:"2",onLoading:be=>z(B,be),uploadBizType:"AI_OPTIMIZED_IMAGE",size:5*1024*1024,validateWH:!1,ignoreImageHead:!1,isUpdate:!1,onSuccess:(be,ne)=>E(B,be,ne)},{default:P(()=>[k.loading?(l(),f("div",g6,[y(w),t("div",f6,r(e(i)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",v6,[V[3]||(V[3]=t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1)),t("div",h6,r(k.name),1)]))]),_:2},1032,["name","multiple","value","maxCount","reference-rules","onLoading","onSuccess"]),y(Sa,{ref_for:!0,ref:be=>q(B,be),onClickItem:be=>O(B,be)},null,8,["onClickItem"])],40,m6)]),default:P(()=>[t("div",{class:"model-upload-img-trigger",onDragover:V[2]||(V[2]=Be(()=>{},["stop","prevent"])),onDrop:Be(be=>Y(be,B),["stop","prevent"])},[k.loading?(l(),f("div",y6,[y(w),t("div",x6,r(e(i)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f(we,{key:1},[V[4]||(V[4]=t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1)),t("div",b6,r(k.name),1)],64))],40,_6)]),_:2},1032,["open","onUpdate:open","onOpenChange"])):he("",!0)],64))),128))])}}}),C6={class:"flex pl-8px py-8px items-center dress-up-upload-img gap-8px"},k6={class:"material-thumb-label min-w-100px p-x-4px"},w6={class:"material-thumb-trigger flex items-center justify-center cursor-pointer"},P6={class:"p-2"},M6={class:"grid grid-cols-3 gap-2 mb-4"},S6={class:"text-xs font-medium transition-colors duration-200 block text-slate-600 group-hover/tag:text-slate-700"},$6={class:"space-y-3"},T6={class:"flex items-center gap-2"},A6={class:"material-thumb-trigger-text text-14px"},U6=["onClick"],L6={key:0},E6={class:"text-12px"},q6={key:1,class:"w-full h-full flex-col flex-center"},D6={key:0},O6={class:"text-12px"},N6={key:0},R6={class:"text-12px"},F6={key:1,class:"w-full h-full flex-col flex-center"},G6={key:0},V6={class:"text-12px"},qn=9,us=1,sc="模ç¹ç身ä¸",lc="å
¨èº«ç©¿æ",z6=Dt({__name:"dress-up-upload-img",props:{placeholderList:{},referenceRules:{}},emits:["prompt-change","state-change"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=u,x=F(()=>ko(o.referenceRules)?{...wo(o.referenceRules),maxFileSizeMb:Po(o.referenceRules)}:null),_=Se=>{Se&&(Se.code==="format"?qe.error(c("image-reference.rules.formats",[Se.formats.join(", ")
7])):Se.code==="metadata"?qe.error(c("image-reference.rules.metadata-failed")):Se.code==="file-size"?qe.error(c("image-reference.rules.file-size",[Se.maxFileSizeMb])):Se.code==="min-dimension"?qe.error(c("image-reference.rules.min-dimension",[Se.minDimension])):Se.code==="aspect-ratio"&&qe.error(c("image-reference.rules.aspect-ratio-range",Se.range)))},m=async(Se,se)=>{if(!x.value)return!0;const Te=await _n(Se,x.value,se);return Te?(_(Te),!1):!0},p=i,d=bt(),R=h(""),U=h([]),G=h(null),a=h(null),E=h(null),z=h(null),q=h(!1),S=h(!1),O=h(0),N=h(0),ae=h(!1),L=h(!1),K=h([]),de=h([]),W=Se=>{var se,Te;return((Te=(se=o.placeholderList)==null?void 0:se[Se])==null?void 0:Te.images)||[]};(()=>{K.value=[...W(0)],de.value=[...W(1)]})();const Y=F(()=>[...K.value,...de.value].filter(Boolean)),j=F(()=>K.value.length>0&&de.value.length>0),V=F(()=>Math.max(qn-K.value.length,0)),w=[{label:"å
¨èº«ç©¿æ"},{label:"ä¸è£
"},{label:"ä¸è£
"},{label:"è¿è¡£è£"},{label:"éå"},{label:"é
饰"}],I=()=>{if(!K.value.length)return"";const Se=K.value.map((Te,Xe)=>{var gt,Ge;const pt=((Ge=(gt=d.imageMapping)==null?void 0:gt[Te])==null?void 0:Ge.tag)||lc;return`å¾ç${Xe+1}çã${pt}ã`}),se=j.value?`å¾ç${Se.length+1}ä¸ã${sc}ã`:`模ç¹å¾ä¸ã${sc}ã`;return`å°${Se.join("ï¼")}ï¼æ¢å°${se}`},k=()=>{const Se=[{name:"æè£
å¾",images:[...K.value]},{name:"模ç¹å¾",images:[...de.value]}];return{clothingImages:[...K.value],modelImages:[...de.value],placeholderList:Se}},B=()=>{p("state-change",k()),p("prompt-change",I())},be=Se=>{d.imageMapping||(d.imageMapping={});const se=new Set(Se),Te=new Set(K.value);Se.forEach(Xe=>{d.imageMapping[Xe]||(d.imageMapping[Xe]={url:Xe,tag:Te.has(Xe)?lc:""})}),U.value.forEach(Xe=>{se.has(Xe)||delete d.imageMapping[Xe]}),U.value=[...se]};Ne(()=>Y.value,Se=>{be(Se),B()});const ne=(Se,se=[])=>{const Te=se.map(pt=>{var gt;return((gt=pt==null?void 0:pt.response)==null?void 0:gt.payload)||null}).filter(pt=>pt!==null),Xe=Array.isArray(Se)?Se:Se?[Se]:[];return Te.length?Te:Xe},le=(Se=[],se=[])=>[...new Set([...Se,...se])],ce=(Se,se=[])=>{const Te=ne(Se,se);K.value=le(K.value,Te).slice(0,qn)},J=(Se,se=[])=>{const Te=ne(Se,se);de.value=Te.slice(-1)},oe=Se=>(Se==null?void 0:Se.imageUrl)||(Se==null?void 0:Se.url)||(Se==null?void 0:Se.fileUrl)||"",te=async Se=>{const se=oe(Se);!se||!await m(Se,Se==null?void 0:Se.imageDimensions)||(ae.value=!1,K.value=le(K.value,[se]).slice(0,qn))},Q=async Se=>{const se=oe(Se);!se||!await m(Se,Se==null?void 0:Se.imageDimensions)||(L.value=!1,de.value=[se])},ie=Se=>{Se&&tt(()=>{var se,Te;(Te=(se=E.value)==null?void 0:se.fetchHistoryImages)==null||Te.call(se)})},_e=Se=>{Se&&tt(()=>{var se,Te;(Te=(se=z.value)==null?void 0:se.fetchHistoryImages)==null||Te.call(se)})},Re=()=>{O.value+=1,ae.value=!1},ye=()=>{N.value+=1,L.value=!1},me=Se=>{var Te,Xe;const se=K.value[Se];K.value.splice(Se,1),(Te=d.imageMapping)==null||delete Te[se],(Xe=G.value)==null||Xe.remove(se)},re=Se=>{var Te,Xe;const se=de.value[Se];de.value.splice(Se,1),(Te=d.imageMapping)==null||delete Te[se],(Xe=a.value)==null||Xe.remove(se)},fe=()=>{K.value=[],de.value=[],O.value+=1,N.value+=1,be([]),B()},Oe=(Se=[])=>{var se,Te;K.value=[...((se=Se==null?void 0:Se[0])==null?void 0:se.images)||[]],de.value=[...((Te=Se==null?void 0:Se[1])==null?void 0:Te.images)||[]],be(Y.value),B()},Ve=async(Se,se=0)=>{Ta({options:{toolbar:!0,initialViewIndex:se},images:Se})},H=async(Se,se)=>{if(!(!se||!await m(se))){if(Se==="model"){J(se),L.value=!1;return}ce(se),ae.value=!1}},st=async(Se,se)=>{var Te,Xe,pt,gt;if(!(!se||!await m(se))){if(Se==="model"){if(S.value||de.value.length>=us)return;L.value=!0,await tt(),await((Xe=(Te=a.value)==null?void 0:Te.handleCustomUploads)==null?void 0:Xe.call(Te,{file:se}));return}q.value||K.value.length>=qn||(ae.value=!0,await tt(),await((gt=(pt=G.value)==null?void 0:pt.handleCustomUploads)==null?void 0:gt.call(pt,{file:se})))}},ge=async(Se,se)=>{se&&await H(Se,se)},Ce=async(Se,se)=>{const Te=se==="model"?us:qn,Xe=se==="model"?de.value.length:K.value.length,pt=kn(Se.dataTransfer).slice(0,Math.max(0,Te-Xe));if(pt.length){for(const Ge of pt)await st(se,Ge);return}const gt=Cn(Se.dataTransfer);gt&&await ge(se,gt)},$e=(Se,se)=>{d.imageMapping[se]||(d.imageMapping[se]={url:se,tag:""}),d.imageMapping[se].tag===Se.label?d.imageMapping[se].tag="":d.imageMapping[se].tag=Se.label,B()},at=Se=>{const se=R.value.trim();se&&(d.imageMapping[Se]||(d.imageMapping[Se]={url:Se,tag:""}),d.imageMapping[Se].tag=se,R.value="",B())},nt=Se=>!d.imageMapping||!Se?{}:d.imageMapping[Se]||{};return Rt(()=>{be(Y.value),B()}),g({cleanImg:fe,setImagesFromPlaceholder:Oe}),(Se,se)=>{const Te=Lt,Xe=ba,pt=Bt,gt=Wt;return l(),f("div",C6,[(l(!0),f(we,null,Je(e(K),(Ge,T)=>(l(),f("div",{key:`clothing-${T}`,class:"bg-[#F7F7F7] relative rounded-6px flex justify-center items-center material-thumb"},[y($a,{class:"material-thumb-img",url:Ge,"show-delete":!1,onOnPreview:X=>Ve(e(K),T),onOnDelete:X=>me(T)},null,8,["url","onOnPreview","onOnDelete"]),t("div",k6,[t("div",w6,[y(pt,{placement:"top",trigger:"click"},{content:P(()=>[t("div",null,[t("div",P6,[se[15]||(se[15]=t("div",{class:"flex gap-1 mb-8px"},[t("h3",{class:"text-slate-800 text-sm font-semibold tracking-tight"}," åèæé¥° "),t("p",{class:"text-slate-500 text-xs leading-relaxed"}
7,"ï¼å¤æè£
å¾ï¼è¯·æ 注æ¯å¼ å¾çåèæé¥°ï¼")],-1)),t("div",M6,[(l(),f(we,null,Je(w,X=>y(Te,{key:X.label,class:"clothing-reference-option",style:{display:"flex","align-items":"center","justify-content":"center"},onClick:Ee=>$e(X,Ge)},{default:P(()=>{var Ee;return[t("div",{class:"w-2 h-2 rounded-full transition-all duration-200 bg-slate-200 group-hover/tag:bg-slate-300 mr-8px",style:Nt({background:((Ee=nt(Ge))==null?void 0:Ee.tag)===X.label?"#2E4FFF":"#D8D8D8"})},null,4),t("span",S6,r(X.label),1)]}),_:2},1032,["onClick"])),64))]),t("div",$6,[se[14]||(se[14]=t("div",{class:"flex items-center gap-2 text-xs text-slate-500"},[t("div",{class:"h-px bg-slate-200 flex-1"}),t("span",{class:"px-2"}),t("div",{class:"h-px bg-slate-200 flex-1"})],-1)),t("div",T6,[y(Xe,{value:e(R),"onUpdate:value":se[0]||(se[0]=X=>Fe(R)?R.value=X:null),type:"text",placeholder:"èªå®ä¹åèæé¥°å",class:"flex-1 text-sm px-3 py-2.5 border border-slate-200/80 rounded-xl bg-white/60 focus:outline-none focus:border-[#20f6da]/40 focus:bg-white transition-all duration-200 placeholder:text-slate-400"},null,8,["value"]),y(Te,{disabled:!e(R).trim(),class:"px-4 py-2.5 bg-gradient-to-r from-[#20f6da] to-[#86EEBA] text-white text-sm font-medium rounded-xl hover:shadow-lg hover:shadow-[#20f6da]/20 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed hover:scale-105",onClick:X=>at(Ge)},{default:P(()=>[...se[13]||(se[13]=[De(" æ·»å ",-1)])]),_:1},8,["disabled","onClick"])])])])])]),default:P(()=>{var X;return[t("span",A6,r(((X=nt(Ge))==null?void 0:X.tag)||"åèæé¥°"),1),y(e(Qt),{class:"w-12px h-12px ml-4px"})]}),_:2},1024)])]),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:Be(X=>me(T),["stop","prevent"])},null,8,U6)]))),128)),e(K).length<qn?(l(),ve(pt,{key:0,placement:"top",open:e(ae),"onUpdate:open":se[6]||(se[6]=Ge=>Fe(ae)?ae.value=Ge:null),trigger:"click",overlayClassName:"dress-up-upload-popover",onOpenChange:ie},{content:P(()=>[t("div",{class:"dress-up-upload-popover-content",onDragover:se[2]||(se[2]=Be(()=>{},["stop","prevent"])),onDrop:se[3]||(se[3]=Be(Ge=>Ce(Ge,"clothing"),["stop","prevent"]))},[(l(),ve(ga,{key:e(O),ref_key:"clothingUploadRef",ref:G,name:"dress_up_clothing",temp:!0,multiple:e(V)>1,value:[],showUploadList:!1,maxCount:e(V),"reference-rules":e(x),activeTabKey:"2",onLoading:se[1]||(se[1]=Ge=>q.value=Ge),onEndUploading:Re,uploadBizType:"AI_OPTIMIZED_IMAGE",size:5*1024*1024,validateWH:!1,ignoreImageHead:!1,isUpdate:!1,showLimitMessage:!1,showSuccessMessage:!1,onSuccess:ce},{default:P(()=>[e(q)?(l(),f("div",L6,[y(gt),t("div",E6,r(e(c)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",q6,[...se[16]||(se[16]=[t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1),t("div",{class:"mt-4px text-12px",style:{"line-height":"1"}},"æè£
å¾",-1)])]))]),_:1},8,["multiple","maxCount","reference-rules"])),y(Sa,{ref_key:"clothingHistoryImageRef",ref:E,onClickItem:te},null,512)],32)]),default:P(()=>[t("div",{class:"dress-up-upload-trigger",onDragover:se[4]||(se[4]=Be(()=>{},["stop","prevent"])),onDrop:se[5]||(se[5]=Be(Ge=>Ce(Ge,"clothing"),["stop","prevent"]))},[e(q)?(l(),f("div",D6,[y(gt),t("div",O6,r(e(c)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f(we,{key:1},[se[17]||(se[17]=t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1)),se[18]||(se[18]=t("div",{class:"mt-4px text-12px",style:{"line-height":"1"}},"æè£
å¾",-1))],64))],32)]),_:1},8,["open"])):he("",!0),(l(!0),f(we,null,Je(e(de),(Ge,T)=>(l(),ve($a,{key:`model-${T}`,url:Ge,onOnPreview:X=>Ve(e(de),T),onOnDelete:X=>re(T)},null,8,["url","onOnPreview","onOnDelete"]))),128)),e(de).length<us?(l(),ve(pt,{key:1,placement:"top",open:e(L),"onUpdate:open":se[12]||(se[12]=Ge=>Fe(L)?L.value=Ge:null),trigger:"click",overlayClassName:"dress-up-upload-popover",onOpenChange:_e},{content:P(()=>[t("div",{class:"dress-up-upload-popover-content",onDragover:se[8]||(se[8]=Be(()=>{},["stop","prevent"])),onDrop:se[9]||(se[9]=Be(Ge=>Ce(Ge,"model"),["stop","prevent"]))}
7,[(l(),ve(ga,{key:e(N),ref_key:"modelUploadRef",ref:a,name:"dress_up_model",temp:!0,multiple:!1,value:[],showUploadList:!1,maxCount:us,"reference-rules":e(x),activeTabKey:"2",onLoading:se[7]||(se[7]=Ge=>S.value=Ge),onEndUploading:ye,uploadBizType:"AI_OPTIMIZED_IMAGE",size:5*1024*1024,validateWH:!1,ignoreImageHead:!1,isUpdate:!1,showSuccessMessage:!1,onSuccess:J},{default:P(()=>[e(S)?(l(),f("div",N6,[y(gt),t("div",R6,r(e(c)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",F6,[...se[19]||(se[19]=[t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1),t("div",{class:"mt-4px text-12px",style:{"line-height":"1"}},"模ç¹å¾",-1)])]))]),_:1},8,["reference-rules"])),y(Sa,{ref_key:"modelHistoryImageRef",ref:z,onClickItem:Q},null,512)],32)]),default:P(()=>[t("div",{class:"dress-up-upload-trigger",onDragover:se[10]||(se[10]=Be(()=>{},["stop","prevent"])),onDrop:se[11]||(se[11]=Be(Ge=>Ce(Ge,"model"),["stop","prevent"]))},[e(S)?(l(),f("div",G6,[y(gt),t("div",V6,r(e(c)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f(we,{key:1},[se[20]||(se[20]=t("img",{src:xa,alt:"",class:"w-20px h-20px"},null,-1)),se[21]||(se[21]=t("div",{class:"mt-4px text-12px",style:{"line-height":"1"}},"模ç¹å¾",-1))],64))],32)]),_:1},8,["open"])):he("",!0)])}}}),B6=(u="")=>{const g=[];let i=0,c=-1,o=0;const x=_=>{_>i&&g.push({type:"text",text:u.slice(i,_)})};for(let _=0;_<u.length;_+=1){const m=u[_];m==="ã"?(o===0&&(x(_),c=_),o+=1):m==="ã"&&o>0&&(o-=1,o===0&&c>=0&&(g.push({type:"variable",text:u.slice(c+1,_)}),i=_+1,c=-1))}if(o>0&&c>=0){const _=g[g.length-1];(_==null?void 0:_.type)==="text"&&_.text===u.slice(i,c)&&g.pop(),g.push({type:"text",text:u.slice(c===0?0:i)})}else x(u.length);return g},K6=(u="")=>{const g=String(u||"").trim(),i=g.match(/^\{\{\s*([\s\S]*?)\s*\}\}$/);return i?String(i[1]||"").trim():g},W6=(u="",g="suiteTemplateVariable",i="请è¾å ¥")=>({type:"doc",content:String(u||"").replace(/\r\n/g,` 8`).split(` 9`).map(o=>{const x=B6(o).map(_=>{if(_.type==="text")return{type:"text",text:_.text};const m=K6(_.text);return{type:g,attrs:{placeholder:i},content:m?[{type:"text",text:m}]:[]}});return x.length?{type:"paragraph",content:x}:{type:"paragraph"}})});let fo=null;const ic="benefit-limit-confirm-style",j6=()=>{if(typeof document>"u"||document.getElementById(ic))return;const u=document.createElement("style");u.id=ic,u.innerHTML=` 10 .benefit-limit-confirm .ant-modal-body, 11 .pod-upload-vip-limit-confirm .ant-modal-body { 12 padding: 20px 18px 18px; 13 } 14 `,document.head.appendChild(u)},Iu=()=>{const{t:u}=mt(),g=Kt(),i=wa();return{showBenefitLimitConfirm:o=>fo||(j6(),fo=i.confirm({title:o.title||u("qinghu-ai.link-pix-params.266304-4"),width:o.width||466,class:o.className||"benefit-limit-confirm",maskClosable:!1,keyboard:!1,cancelText:o.cancelText||u("qinghu-ai.link-pix-params.266304-5"),okText:o.okText||u("qinghu-ai.link-pix-params.266304-6"),content:o.content,afterClose:()=>{fo=null},onOk:()=>{if(o.onOk){o.onOk();return}window.open(g.resolve({path:o.upgradePath||"/upgrade"}).href,"_blank")}}),fo)}};function Cu(u={}){var x;const g=!!u.isFree&&u.quality==="1K"&&Number(u.imageCount||1)===1,i=Number(u.maxCount),c=Number.isFinite(i)&&i>0?i:g?Tc:Km,o=Number((x=u.rules)==null?void 0:x.maxImageCount);return Number.isFinite(o)&&o>0?Math.min(c,o):c}const H6={class:"customize-upload-img-box flex items-center"},J6={class:"flex"},Y6={key:0,class:"mt-8px"},Q6={class:"popover-content"},X6={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center"},Z6={class:"h-32px rounded-4px text-center line-height-32px cursor-pointer flex items-center justify-center"},e9={class:"mt-12px"},t9={class:"w-500px"},a9={key:1},n9={class:"text-[#000]"},o9={class:"text-12px"},s9={class:"long-upload-material"},l9={key:0,class:"text-center"},i9={class:"text-10px"},r9={key:1,src:xa,alt:"",class:"w-16px h-16px"},c9={__name:"batch-upload-img",props:{maxCount:{type:Number,default:0},limitTip:{type:String,default:""},referenceRules:{type:[Object,String],default:null}},emits:["success","startUploading"],setup(u,{expose:g,emit:i}){const c=bt(),o=u,x=i,{t:_}=mt(),{showBenefitLimitConfirm:m}=Iu(),p=F(()=>ko(o.referenceRules)?{...wo(o.referenceRules),maxFileSizeMb:Po(o.referenceRules)}:null),d=ce=>{ce&&(ce.code==="format"?qe.error(_("image-reference.rules.formats",[ce.formats.join(", ")
14])):ce.code==="metadata"?qe.error(_("image-reference.rules.metadata-failed")):ce.code==="file-size"?qe.error(_("image-reference.rules.file-size",[ce.maxFileSizeMb])):ce.code==="min-dimension"?qe.error(_("image-reference.rules.min-dimension",[ce.minDimension])):ce.code==="aspect-ratio"?qe.error(_("image-reference.rules.aspect-ratio-range",ce.range)):ce.code==="max-count"&&qe.error(_("image-reference.rules.max-count",[ce.maxCount])))},R=async(ce,J)=>{if(p.value){const te=await _n(ce,p.value,J);return te?(d(te),!1):!0}const oe=await Ac(J||ce,Kn);return oe||qe.error(_("public-img-upload.index.101106-8",[Kn])),oe},U=h(),G=h(null),a=h(!1),E=h(!1),z=h([]),q=F(()=>{var ce,J,oe;return Cu({maxCount:o.maxCount,rules:p.value,isFree:(ce=c.imageGenerateParams)==null?void 0:ce.isFree,quality:(J=c.imageGenerateParams)==null?void 0:J.quality,imageCount:(oe=c.imageGenerateParams)==null?void 0:oe.imageCount})}),S=F(()=>(c.batchUploadImgUrls||[]).length>=q.value),O=F(()=>!S.value||!!o.limitTip),N=()=>{if(o.limitTip){m({content:o.limitTip});return}qe.error(_("public-img-upload.index.101106-2",[q.value]))};Ne(q,ce=>{const J=c.batchUploadImgUrls||[];if(J.length<=ce)return;const oe=J.slice(0,ce);c.batchUploadImgUrls=oe,z.value=oe,N()});const ae=()=>{a.value=!0,x("startUploading")},L=()=>{a.value=!1,x("endUploading")},K=(ce,J)=>{var oe;E.value=!1,z.value=J,c.batchUploadImgUrls=J,((oe=c.batchUploadImgUrls)==null?void 0:oe.length)===1&&c.imageUseWay&&(c.imageUseWayVisible=!0),x("success",ce,J)},de=ce=>{const J=(Array.isArray(ce)?ce:[ce]).filter(Boolean),oe=[...new Set((c.batchUploadImgUrls||[]).filter(Boolean))],te=[...new Set([...oe,...J])];if(!J.length){z.value=oe;return}if(te.length>q.value){z.value=oe,N();return}if(te.length===oe.length){K(J,oe);return}K(J,te)},W=async(ce,J,oe=ce)=>{if(ce)if((c.batchUploadImgUrls||[]).length<q.value){if(!await R(oe,J))return;de([ce]),L()}else N()},$=async(ce,J)=>{ce&&await W(ce,J)},Y=async ce=>{E.value=!1,ce!=null&&ce.imageUrl&&await W(ce.imageUrl,ce.imageDimensions,ce)},j=ce=>{ce&&tt(()=>{var J;(J=G==null?void 0:G.value)==null||J.fetchHistoryImages()})},V=()=>{N()},w=ce=>{a.value=ce};Ne(()=>c.batchUploadImgUrls,(ce,J)=>{ce&&Array.isArray(ce)&&!ce.length&&tt(()=>{var oe;z.value=[],(oe=U.value)==null||oe.clearImg()})},{deep:!0});const I=ce=>{z.value=ce||[],tt(()=>{var J;(J=U.value)==null||J.updateImg()})},k=async ce=>{var te;if((c.batchUploadImgUrls||[]).length>=q.value){N();return}if(!await R(ce))return;z.value.length>=q.value&&(z.value=[],(te=U.value)==null||te.clearImg());const J=new FormData;J.append("file",ce),J.append("temp","true"),["LONGIMAGE","POSTERIMAGE","SOCIALMEDIA"].includes(c.aiMessageType)&&J.append("uploadBizType","COMMON_IMAGE");try{w(!0);const{success:Q,payload:ie}=await Va(J);w(!1),Q&&ie&&W(ie)}catch{qe.error(_("qinghu-ai.batch-upload-img.462068-2"))}},B=async ce=>{const J=kn(ce.dataTransfer);if(J.length){for(const te of J)await k(te);return}const oe=Cn(ce.dataTransfer);oe&&await $(oe)},be=F(()=>{let ce="COMMON_IMAGE";return["LONGIMAGE","POSTERIMAGE","SOCIALMEDIA"].includes(c.aiMessageType)&&(ce="COMMON_IMAGE"),ce}),ne=async(ce,J=0)=>{Ta({options:{toolbar:!0,initialViewIndex:J},images:ce})},le=ce=>{c.batchUploadImgUrls.splice(ce,1)};return g({updateImageList:I,addUrl:W,setLoading:w,uploadImg:k,getImages:()=>z.value}),(ce,J)=>{const oe=Wt,te=Sa,Q=Bt;return l(),f("div",{class:"flex justify-start pl-12px",onDragover:J[3]||(J[3]=Be(()=>{},["stop","prevent"])),onDrop:Be(B,["stop","prevent"])},[t("div",H6,[t("div",J6,[y(e(du),{modelValue:e(c).batchUploadImgUrls,"onUpdate:modelValue":J[0]||(J[0]=ie=>e(c).batchUploadImgUrls=ie),itemKey:"id",animation:"200",class:"flex cursor-grab active:cursor-grabbing"},{item:P(({element:ie,index:_e})=>[y($a,{url:ie,onOnPreview:Re=>ne(e(c).batchUploadImgUrls,_e),onOnDelete:Re=>le(_e),styleStr:"padding:0;margin-top:4px;margin-right:8px"},null,8,["url","onOnPreview","onOnDelete"])]),_:1},8,["modelValue"])]),e(O)?(l(),f("div",Y6,[y(Q,{placement:"top",open:e(E),"onUpdate:open":J[2]||(J[2]=ie=>Fe(E)?E.value=ie:null),trigger:"click",onOpenChange:j,overlayClassName:"long-upload-material-popover"},{content:P(()=>[t("div",Q6,[t("div",X6,[t("div",Z6,[J[4]||(J[4]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(_)("qinghu-ai.video-script.120875-24")),1)])]),t("div",e9,[y(ga,{ref_key:"uploadRef",ref:U,value:e(z),"onUpdate:value":J[1]||(J[1]=ie=>Fe(z)?z.value=ie:null),name:"coverImage",class:"long-image-material-upload",activeTabKey:"2",temp:!1,multiple:!0,showUploadList:!1,maxCount:e(q),uploadBizType:e(be),showLimitMessage:!1,"min-image-side":e(p)?0:e(Kn),"reference-rules":e(p),onStartUploading:ae,onEndUploading:L,onLimitExceed:V,onSuccess:de},{default:P(()=>
14[t("div",t9,[e(a)?(l(),ve(oe,{key:0})):(l(),f("div",a9,[J[5]||(J[5]=t("div",{class:"w-full h-full flex justify-center items-center"},[t("img",{src:ka,alt:"",class:"w-28px h-28px"})],-1)),t("div",n9,[t("div",null,r(e(_)("qinghu-ai.batch-upload-img.998187-0"))+"("+r(e(_)("qinghu-ai.batch-upload-img.998187-1"))+")"+r(e(_)("qinghu-ai.batch-upload-img.998187-2")),1),t("div",null,r(e(_)("qinghu-ai.batch-upload-img.998187-5")),1),t("div",null,r(e(_)("qinghu-ai.batch-upload-img.998187-6")),1),t("div",o9,r(e(_)("qinghu-ai.long-upload-material.697730-6",[e(q)])),1)])]))])]),_:1},8,["value","maxCount","uploadBizType","min-image-side","reference-rules"])]),e(E)?(l(),ve(te,{key:0,ref_key:"historyImageRef",ref:G,onClickItem:Y},null,512)):he("",!0)])]),default:P(()=>[t("div",s9,[e(a)?(l(),f("div",l9,[y(oe,{size:"small"}),t("div",i9,r(e(_)("qinghu-ai.long-upload-material.697730-8")),1)])):(l(),f("img",r9))])]),_:1},8,["open"])])):he("",!0)])],32)}}},u9={class:"flex"},d9={class:"image-model-panel"},p9={class:"image-model-panel__title"},m9={class:"image-mode-card__icon image-mode-card__icon--suite"},g9=["src"],f9={class:"image-mode-card__content"},v9={class:"image-mode-card__title"},h9={class:"image-mode-card__desc"},_9={class:"image-mode-card__header"},y9={class:"image-mode-card__icon image-mode-card__icon--custom"},x9=["src"],b9={class:"image-mode-card__content"},I9={class:"image-mode-card__title"},C9={class:"image-mode-card__desc"},k9={class:"image-model-section-title"},w9=["onClick"],P9={class:"image-model-option__icon"},M9=["src"],S9={class:"image-model-option__content"},$9={class:"image-model-option__title"},T9={class:"image-model-option__desc"},A9={key:0,class:"absolute top-[-10px] right-[0px] bg-red px-8px py-2px rounded-[12px_0px_12px_0px] text-10px color-white"},U9={key:1,class:"absolute top-[-8px] right-[0px] bg-red px-8px py-2px rounded-[12px_0px_12px_0px] text-10px color-white"},L9={class:"flex items-center h-12px"},E9={class:"line-height-1 ml-4px"},q9={class:"flex items-center px-20px pt-20px pb-15px"},D9={class:"ml-10px"},O9={class:"text-16px text-#000000"},N9={class:"text-#6E6C84"},R9={class:"overflow-y-scroll scrollbar max-h-454px pb-20px pl-20px"},F9={class:"pr-12px"},G9={key:0,class:"popover-content"},V9={class:"popover-title"},z9={class:"popover-list flex"},B9={class:"cursor-pointer bg-#F7F7F7 hover:bg-[#F6F6F6]! rounded-4px relative"},K9={class:"w-40px h-40px flex items-center justify-center"},W9={key:0,src:Ss,alt:"",class:"w-14px h-14px check-icon"},j9={class:"text-12px text-center mt-4px"},H9=["onClick"],J9=["src"],Y9={class:"text-12px text-center mt-4px"},Q9={key:0,src:Ss,alt:"",class:"w-14px h-14px check-icon"},X9={class:"w-40px h-68px mt-8px"},Z9={class:"text-12px text-center mt-4px"},ey={key:1,class:"popover-content mt-16px"},ty={class:"popover-title mb-14px!"},ay={key:0,class:"mb-10px"},ny={class:"sku-quality-toggle"},oy=["onClick"],sy={class:"flex image-size-list"},ly=["onClick"],iy={class:"popover-item-label-text"},ry={class:"flex flex-col w-165px"},cy={key:0,class:"customer-radio flex gap-x-5px mt-4px"},uy={key:1,class:"popover-item-label text-[rgba(61,61,61,0.8)]! text-12px! mt-4px"},dy=["onClick"],py={class:""},my={class:"flex justify-between items-center mx-10px h-30px rounded-4px cursor-pointer min-w-208px"},gy={class:"flex flex-center gap-x-8px"},fy=["src"],vy={class:"group-hover:text-[var(--primary-color)]"},hy={class:"group-hover:text-[var(--primary-color)]"},_y={class:"popover-content mt-16px"},yy={class:"popover-title"},xy={class:"popover-list scrollbar min-w-100px mt-10px"},by={class:"flex items-center h-12px"},Iy={class:"line-height-1 ml-4px"},rc="LinkPixWisdomImageConfig",cc="__paidWisdomConfig",uc="LinkPixWisdomPaidFirstInitApplied",bl="1:1",ds="custom",dc="non_custom",vo="SKU_GENERATION",Il="SHEIN",Cy={__name:"link-pix-params",props:{isChatPinned:{type:Boolean,default:!1},isSystemQuotaExhausted:{type:Boolean,default:!1}},emits:["selectNum","change-main-image-mode"],setup(u,{emit:g}){const i=g,c=h(""),o=h(""),x=h(null),_=h(null),{t:m}=mt(),p=bt(),d=la();Pa();const R=oa(),{showBenefitLimitConfirm:U}=Iu(),{userInfo:G}=va(d),{vipInfo:a}=G.value,E=Lc("WISDOM_GENERATION",!1),z=h(!1),q=[Qc,Xc,Zc,eu],O=h((()=>{try{const b=JSON.parse(localStorage.getItem("userInfo")||"{}")||{};return typeof b.defaultVip=="boolean"?b.defaultVip:void 0}catch{return}})()),N=F(()=>!!p.imageGenerateParams.isFree),ae=F(()=>typeof O.value=="boolean"),L=F(()=>O.value===!0),K=F(()=>O.value===!1),de=F(()=>N.value&&L.value),W=F(()=>!p.imageGenerateParams.otherFreeSkuId),$=F(()=>J.value.some(b=>b==null?void 0:b.quality)),Y=["1K","2K"],j=m("components-qinghu-ai.link-pix-params.738063-128"),V=()=>{try{const b=JSON.parse(localStorage.getItem(p.LINK_PIX_PLATFORM_USAGE_COUNT_KEY)||"{}")||{};return Object.keys(b).reduce((Z,Ie)=>{const Pe=Number(b[Ie]);return Number.isFinite(Pe)&&Pe>0&&(Z[Ie]=Pe),Z},{})}catch{return{}}},w=F(()=>{var b;return Uc((b=p.imageGenerateUseWay)==null?void 0:b.useWayData)}),I=F(()=>w.value.generationSettings),k=F(()=>{var b;return yo((b=p.imageGenerateUseWay)==null?void 0:b.useWayData)}),B=F(()=>{var b,Z;return((Z=(b=p.imageGenerateUseWay)==null?void 0:b.useWayData)==null?void 0:Z.supportMultiImage)===!1}),be=h(V()),ne=b=>b.map((Z,Ie)=>({...Z,index:Ie})).sort((Z,Ie)=>
14(be.value[Ie.value]||0)-(be.value[Z.value]||0)||Z.index-Ie.index).map(({index:Z,...Ie})=>Ie),le=F(()=>ne([{label:m("components-qinghu-ai.link-pix-params.738063-129"),value:m("components-qinghu-ai.link-pix-params.738063-129"),src:Bc},{label:m("components-qinghu-ai.link-pix-params.738063-130"),value:m("components-qinghu-ai.link-pix-params.738063-130"),src:ks},{label:m("components-qinghu-ai.link-pix-params.738063-131"),value:m("components-qinghu-ai.link-pix-params.738063-131"),src:Kc},{label:m("components-qinghu-ai.link-pix-params.738063-132"),value:m("components-qinghu-ai.link-pix-params.738063-132"),src:Wc},{label:m("components-qinghu-ai.link-pix-params.738063-133"),value:m("components-qinghu-ai.link-pix-params.738063-133"),src:jc},{label:m("components-qinghu-ai.link-pix-params.738063-121"),value:m("components-qinghu-ai.link-pix-params.738063-134"),src:Hc},{label:m("components-qinghu-ai.link-pix-params.738063-135"),value:m("components-qinghu-ai.link-pix-params.738063-135"),src:hu},{label:"TK Shop",value:m("components-qinghu-ai.link-pix-params.738063-136"),src:ks},{label:m("components-qinghu-ai.link-pix-params.738063-138"),value:m("components-qinghu-ai.link-pix-params.738063-138"),src:Jc},{label:m("components-qinghu-ai.link-pix-params.738063-139"),value:m("components-qinghu-ai.link-pix-params.738063-139"),src:e1},{label:m("components-qinghu-ai.link-pix-params.738063-140"),value:m("components-qinghu-ai.link-pix-params.738063-140"),src:_u},{label:m("qinghu-ai.link-pix-params.502824-11"),value:m("components-qinghu-ai.link-pix-params.738063-141"),src:t1},{label:Il,value:Il,src:a1}])),ce=F({get:()=>p.imageGenerateParams.quality||"2K",set:b=>{p.imageGenerateParams.quality=b}}),J=F(()=>{const b=p.imageOptions.find(Z=>Z.value===p.mainImageChatMode);return b?b!=null&&b.supportedAspectRatios?JSON.parse(b.supportedAspectRatios):[]:[]}),oe=F(()=>(p.imageOptions||[]).filter(b=>(b==null?void 0:b.frontHide)!=1)),te=F(()=>oe.value.find(b=>(b==null?void 0:b.value)===vo)),Q=F(()=>oe.value.filter(b=>(b==null?void 0:b.value)!==vo)),ie=F(()=>oe.value.find(b=>(b==null?void 0:b.value)===p.mainImageChatMode)),_e=F(()=>p.mainImageChatMode===vo),Re=F(()=>!!p.mainImageChatMode&&!_e.value),ye=F(()=>{var b,Z;return _e.value?((b=te.value)==null?void 0:b.label)||m("qinghu-ai.link-pix-params.502824-12"):((Z=ie.value)==null?void 0:Z.label)||m("qinghu-ai.link-pix-params.502824-13")}),me=F(()=>{const b=J.value||[];if(!$.value)return b;const Z=ce.value;return b.filter(Ie=>(Ie==null?void 0:Ie.type)!=="single"||!(Ie!=null&&Ie.quality)?!0:Ie.quality===Z)}),re=F(()=>[...Wm(p.mainImageChatMode)]),fe=h(!1),Oe=h(!1);h(!1),h(!1);const Ve=h(!1),H=h(!1),st=h(!1),ge=h(!1);Ne(W,b=>{b||(fe.value=!1)}),Ne(H,b=>{b?X(p.imageGenerateParams.size):st.value=!1});const Ce=(b=[])=>{const Z=ce.value;return b.filter(Ie=>{const Pe=!Ie.quality||Ie.quality===Z,yt=!Ie.visible||Ie.visible===jm();return Pe&&yt})},$e=(b="")=>b==null?void 0:b.startsWith("custom_"),at=(b={})=>!(b!=null&&b.key)||!(b!=null&&b.size)?"":`${b.key}_custom_${b.size}`,nt=(b="")=>b===m("components-qinghu-ai.link-pix-params.738063-129"),Se=(b={})=>[b.size,b.showSize,b.key].some(Z=>String(Z||"").includes("1440")),se=(b="")=>{if(!b)return null;const Z=J.value.filter(Ie=>(Ie==null?void 0:Ie.type)==="group"&&Array.isArray(Ie.children)).flatMap(Ie=>Ie.children).filter(Ie=>(Ie==null?void 0:Ie.label)===b);return Z.length?nt(b)&&Z.find(Se)||Z[0]:null},Te=(b="",Z={})=>!(Z!=null&&Z.key)||!(Z!=null&&Z.size)?!1:b===at(Z)||b===`${Z.key}_${Z.size}`||Z.key.includes("default")&&b==Z.size||b==Z.size,Xe=(b={})=>!!(b!=null&&b.key)&&!!(b!=null&&b.size)&&!(b!=null&&b.type),pt=b=>{const Z=Math.round(1/b);return b>0&&b<1&&Math.abs(1/b-Z)<1e-6?`1/${Z}`:Number.isInteger(b)?`${b}`:`${b}`},gt=F(()=>{const b=J.value.find(Z=>(Z==null?void 0:Z.type)==="custom");return(b==null?void 0:b.config)||{}}),Ge=F(()=>{if(!Array.isArray(gt.value.scope)||gt.value.scope.length!==2)return"";const[b,Z]=gt.value.scope;return`[${b}, ${Z}]`}),T=F(()=>{if(!Array.isArray(gt.value.aspectRatioScope)||gt.value.aspectRatioScope.length!==2)return"";const[b,Z]=gt.value.aspectRatioScope;return`[${pt(b)}, ${pt(Z)}]`}),X=(b="")=>{var Pe;if(!$e(b)){c.value="",o.value="";return}
14const[Z="",Ie=""]=((Pe=b.split("_").pop())==null?void 0:Pe.split("x"))||[];c.value=Z,o.value=Ie},Ee=(b={})=>[b==null?void 0:b.aspectRatio,b==null?void 0:b.key,b==null?void 0:b.value,b==null?void 0:b.label,b==null?void 0:b.size].some(Z=>String(Z||"")===bl),Ye=(b={})=>b.children.find(Ie=>Ie.quality==ce.value&&Ie.key.includes("default")||!Ie.quality&&Ie.key.includes("default")),Me=(b=ce.value)=>{const Z=J.value||[];let Ie=Z.find(Pe=>(Pe==null?void 0:Pe.type)==="group"&&Pe.children&&Ye(Pe))||Z.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&Ee(Pe)&&(Pe==null?void 0:Pe.quality)===b)||Z.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&Ee(Pe)&&!(Pe!=null&&Pe.quality))||Z.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&(Pe==null?void 0:Pe.key)==="default"&&(Pe==null?void 0:Pe.quality)===b)||Z.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&(Pe==null?void 0:Pe.key)==="default"&&!(Pe!=null&&Pe.quality))||Z.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&(!(Pe!=null&&Pe.quality)||Pe.quality===b));return Ie!=null&&Ie.children&&(Ie=Ye(Ie)),Ie},D=(b=ce.value,Z={})=>{var yt;const Ie=Z.target||p.imageGenerateParams;if(!Z.force&&Ie.size)return;const Pe=Me(b);if(!(Pe!=null&&Pe.size)){Ie.aspectRatio||(Ie.aspectRatio=bl,Ie===p.imageGenerateParams&&ot());return}Ie.size=Pe.size,Ie.aspectRatio=(yt=Pe.aspectRatio)!=null?yt:bl,X(Pe.size),Ie===p.imageGenerateParams&&ot()},Ae=(b="")=>{if(!b)return!0;let Z=!1;return J.value.forEach(Ie=>{var Pe;if((Ie==null?void 0:Ie.type)==="custom"){$e(b)&&(Z=!0);return}if((Ie==null?void 0:Ie.type)==="single"){Ie.size.includes(b)&&(Z=!0);return}(Ie==null?void 0:Ie.type)==="group"&&(Pe=Ie.children)!=null&&Pe.some(yt=>Te(b,yt))&&(Z=!0)}),Z};let We=!1;const ot=()=>{if(We)try{const b={...p.imageGenerateParams};if(k.value){const Ie=it("LinkPixImageConfig"),Pe=Number(Ie.imageCount);Number.isFinite(Pe)&&Pe>0&&(b.imageCount=Ie.imageCount)}const Z=JSON.stringify(b);localStorage.setItem("LinkPixImageConfig",Z),N.value&&z.value&&!L.value&&localStorage.setItem(rc,JSON.stringify({...b,[cc]:!0}))}catch{}},it=b=>{try{return JSON.parse(localStorage.getItem(b)||"{}")||{}}catch{return{}}},qt=()=>{const b=it(rc);return Object.keys(b).length?b[cc]?b:p.isRegenerate?(p.isRegenerate=!1,b):Number(b.imageCount||1)===1&&(b.quality||"1K")==="1K"?{}:b:{}},Gt=()=>{U({content:m("qinghu-ai.link-pix-params.266304-7")})},jt=(b=p.imageGenerateParams,Z={})=>{const Ie=!!b.size,Pe=!!b.aspectRatio,yt=!!c.value||!!o.value;!Ie&&!Pe&&!yt||(b.size="",b.aspectRatio="",c.value="",o.value="",Z.persist!==!1&&b===p.imageGenerateParams&&ot())},$t=(b,Z=p.imageGenerateParams)=>{var Yt,aa;const Ie=Z.size;if(!Ie||Ie.includes("custom_")||Ie.includes("_"))return;const Pe=J.value.find(Jt=>(Jt==null?void 0:Jt.type)==="single"&&(Jt==null?void 0:Jt.size.includes(Ie)));if(!(Pe!=null&&Pe.key))return;const yt=J.value.find(Jt=>(Jt==null?void 0:Jt.type)==="single"&&(Jt==null?void 0:Jt.key)===Pe.key&&(Jt==null?void 0:Jt.quality)===b);
14yt!=null&&yt.size&&(Z.size=yt.size,Z.aspectRatio=(aa=(Yt=yt.aspectRatio)!=null?Yt:Z.aspectRatio)!=null?aa:"1:1")},Ht=b=>{if(de.value&&b==="2K"){Gt();return}ce.value!==b&&(ce.value=b,p.imageGenerateParams.size="",D(b),ot())},ta=b=>{const Z=p.imageGenerateParams.size;return Z?(b==null?void 0:b.type)==="custom"?$e(Z):(b==null?void 0:b.type)==="single"?!!b.size&&b.size.includes(Z):(b==null?void 0:b.type)==="group"?!!b.children.find(Pe=>Z.includes(Pe.key)&&Z.includes(Pe.size)||Z.includes(Pe.size)):b!=null&&b.key&&(b!=null&&b.size)?Te(Z,b):!1:!1},ea=b=>{if(b.type==="custom"){Vt();return}b.type!=="group"&&b.type==="single"&&wt(b.size,b)},ft=b=>{wt(at(b),b),ge.value=!1},wt=(b,Z)=>{var Ie;b&&(p.imageGenerateParams.size!=b&&(p.imageGenerateParams.size=b,p.imageGenerateParams.aspectRatio=(Ie=Z.aspectRatio)!=null?Ie:"1:1",$.value&&(Xe(Z)?p.imageGenerateParams.quality=Z.quality||p.imageGenerateParams.quality:(Z==null?void 0:Z.type)==="single"&&(Z!=null&&Z.quality)&&(p.imageGenerateParams.quality=Z.quality)),X(b),ot(),kt("select_image_size",{page:m("qinghu-ai.link-pix-params.266304-8"),module:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory1:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory2:m("qinghu-ai.link-pix-params.266304-10"),eventDesc:m("qinghu-ai.link-pix-params.266304-12"),buttonName:(Z==null?void 0:Z.label)||b,size:b,aspectRatio:p.imageGenerateParams.aspectRatio,quality:p.imageGenerateParams.quality})),fe.value=!1)},Vt=()=>{var b,Z,Ie,Pe;if(!c.value){(Z=(b=x.value)==null?void 0:b[0])==null||Z.focus();return}o.value||(Pe=(Ie=_.value)==null?void 0:Ie[0])==null||Pe.focus()};function He(){const{valid:b,message:Z}=ti(c.value,o.value,gt.value);if(!b){R.warning(Z);return}const Ie=`custom_${c.value}x${o.value}`,Pe=c.value/o.value;p.imageGenerateParams.size=Ie,p.imageGenerateParams.aspectRatio=Pe,ot(),kt("select_image_size",{page:m("qinghu-ai.link-pix-params.266304-8"),module:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory1:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory2:m("qinghu-ai.link-pix-params.266304-10"),eventDesc:m("qinghu-ai.link-pix-params.266304-12"),buttonName:m("qinghu-ai.link-pix-params.266304-13"),size:Ie,aspectRatio:Pe,custom:!0}),fe.value=!1}const Ue=F(()=>{var Pe;const b=p.imageGenerateParams.size,Z=(yt="")=>String(yt).trim().split(/\s+/)[0]||yt,Ie=yt=>$.value?`${ce.value} ${yt}`:yt;if(!b)return Ie(m("qinghu-ai.link-pix-params.709204-0"));for(const yt of J.value)if(yt.type==="single"&&yt.size.includes(b)){const Yt=Z(yt.label);return Ie(`${Yt}`)}for(const yt of J.value)if(yt.type==="group"){const Yt=(Pe=yt.children)==null?void 0:Pe.find(aa=>Te(b,aa));if(Yt){const aa=Z(Yt.label);return Ie(`${aa}`)}}if($e(b))return Ie(m("qinghu-ai.link-pix-params.502824-14",[b==null?void 0:b.replace("custom_","")]))}),ut=b=>{ke(b)||(p.imageGenerateParams.imageCount=b,ot(),Oe.value=!1,i("selectNum"),kt("select_image_count",{page:m("qinghu-ai.link-pix-params.266304-8"),module:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory1:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory2:m("qinghu-ai.link-pix-params.266304-10"),eventDesc:m("qinghu-ai.link-pix-params.266304-14"),buttonName:`${b}`,count:b}))},At=(b=p.mainImageChatMode)=>b===vo?dc:ds,Ut=(b=p.mainImageChatMode)=>{if(p.imageGenerateParams){if(!b){p.imageGenerateParams.type="";return}p.imageGenerateParams.type=At(b)}},Et=(b,Z,Ie={})=>{if(!b)return;const Pe=Z||At(b.value);p.imageGenerateParams.type=Pe,Ie.close!==!1&&(Ve.value=!1),i("change-main-image-mode",{...b,type:Pe})},Ot=()=>{Et(te.value,dc)},zt=()=>{if(Re.value){Ut();return}const b=Q.value[0];if(b){Et(b,ds,{close:!1});return}p.imageGenerateParams.type=ds},sa=b=>{Et(b,ds)},ue=(b={},Z=0)=>(b==null?void 0:b.icon)||q[Z%q.length],ke=b=>b!=1&&(B.value||L.value||p.imageGenerateParams.otherFreeSkuId),et=()=>B.value?m("components-qinghu-ai.link-pix-params.912708-6"):L.value?m("components-qinghu-ai.link-pix-params.738063-117"):m("components-qinghu-ai.link-pix-params.912708-5"),lt=()=>{if(!p.mainImageChatMode||k.value)return!1;const b=Gn(p.imageGenerateParams.imageCount,p.mainImageChatMode,L.value);return Number(p.imageGenerateParams.imageCount)===b?!1:(p.imageGenerateParams.imageCount=b,!0)},je=()=>{ot()},_t=b=>{var Z;if(p.imageGenerateParams.imageSetPlatform=b,b){const Ie=b===Il?J.value.find(Pe=>(Pe==null?void 0:Pe.type)==="single"&&(Pe==null?void 0:Pe.quality)==="2K"&&(Pe==null?void 0:Pe.as
14pectRatio)==="3:4"):null;if(Ie!=null&&Ie.size)p.imageGenerateParams.size=Ie.size,p.imageGenerateParams.aspectRatio=Ie.aspectRatio,p.imageGenerateParams.quality=Ie.quality;else{const Pe=se(b);p.imageGenerateParams.size=Pe?at(Pe):nt(b)?"1440x1440":"1024x1024",p.imageGenerateParams.aspectRatio=(Z=Pe==null?void 0:Pe.aspectRatio)!=null?Z:"1:1",Pe!=null&&Pe.quality&&(p.imageGenerateParams.quality=nt(b)?"2K":Pe.quality)}X(p.imageGenerateParams.size)}else{const Ie=Me(p.imageGenerateParams.quality);Ie!=null&&Ie.size&&(p.imageGenerateParams.size=Ie==null?void 0:Ie.size)}ot(),kt("select_image_platform",{page:m("qinghu-ai.link-pix-params.266304-8"),module:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory1:m("qinghu-ai.link-pix-params.266304-9"),moduleCategory2:m("qinghu-ai.link-pix-params.266304-10"),eventDesc:m("qinghu-ai.link-pix-params.266304-16"),buttonName:p.imageGenerateParams.imageSetPlatform,platform:p.imageGenerateParams.imageSetPlatform})},vt=F(()=>{const b=p.imageGenerateParams.language;if(!b)return m("qinghu-ai.long-image-params.227781-9");const Z=Cs.value.find(Ie=>Ie.code===b);return Z?Z.name:m("qinghu-ai.long-image-params.227781-9")}),rt=F(()=>p.imageGenerateParams.imageSetPlatform||j),ct=F(()=>{const b=[];return p.mainImageChatMode==="SKU_GENERATION"&&b.push(rt.value),I.value&&b.push(Ue.value),b.push(vt.value),b.filter(Boolean).join(" - ")});Rt(()=>{let b=it("LinkPixImageConfig");const{size:Z,aspectRatio:Ie,imageCount:Pe,quality:yt,imageSetPlatform:Yt,otherFreeSkuId:aa,language:Jt}=b;if(yt&&(p.imageGenerateParams.quality=yt),Z&&(p.imageGenerateParams.size=Z,X(Z)),Ie&&(p.imageGenerateParams.aspectRatio=Ie),k.value)p.imageGenerateParams.imageCount=1;else if(Number.isFinite(Number(Pe))&&Number(Pe)>0){const Ua=Number(Pe);p.imageGenerateParams.imageCount=p.mainImageChatMode||L.value?Gn(Ua,p.mainImageChatMode,L.value):Ua}Yt&&(p.imageGenerateParams.imageSetPlatform=Yt),aa&&(p.imageGenerateParams.otherFreeSkuId=aa),Jt&&(p.imageGenerateParams.language=Jt),We=!0});const Tt=()=>{if(!N.value||z.value||!ae.value)return;if(z.value=!0,L.value){p.imageGenerateParams.imageCount=1,p.imageGenerateParams.quality="1K",D("1K",{force:!0}),ot();return}if(!K.value)return;if(!(localStorage.getItem(uc)==="1")){p.imageGenerateParams.imageCount=E,p.imageGenerateParams.quality="2K",D("2K",{force:!0}),localStorage.setItem(uc,"1"),ot();return}const Z=qt();if(Object.keys(Z).length){const{size:Ie,aspectRatio:Pe,imageCount:yt,quality:Yt,imageSetPlatform:aa}=Z;p.imageGenerateParams.imageCount=yt||E,p.imageGenerateParams.quality=Yt||"2K",p.imageGenerateParams.imageSetPlatform=aa||"",Ie&&(p.imageGenerateParams.size=Ie,X(Ie)),Pe&&(p.imageGenerateParams.aspectRatio=Pe),Ie||D(p.imageGenerateParams.quality,{force:!0})}else p.imageGenerateParams.imageCount=E,p.imageGenerateParams.quality="2K",p.imageGenerateParams.size||D("2K",{force:!0});ot()},_a=()=>{if(!de.value)return;let b=!1;p.imageGenerateParams.imageCount!==1&&(p.imageGenerateParams.imageCount=1,b=!0),p.imageGenerateParams.quality!=="1K"&&(p.imageGenerateParams.quality="1K",$t("1K"),b=!0),b&&ot()};Ne(()=>N.value,b=>{if(!b){z.value=!1;return}Tt(),_a()},{immediate:!0}),Ne(()=>[N.value,p.imageGenerateParams.quality,p.imageGenerateParams.imageCount],()=>{_a()}),Ne(()=>[p.mainImageChatMode,p.imageGenerateParams.imageCount,L.value],lt,{immediate:!0,flush:"sync"}),Ne(()=>p.mainImageChatMode,(b,Z)=>{Ut(b),Z&&Z!==b&&jt(),b&&b!==vo&&ot()},{immediate:!0,flush:"sync"}),Ne(()=>J.value,b=>{b!=null&&b.length&&tt(()=>{const Z=p.imageGenerateParams.size;Z&&!Ae(Z)?(jt(),D(p.imageGenerateParams.quality||"2K")):Z||xe()})},{deep:!0}),Ne(()=>p.imageGenerateParams.size,b=>{if(!$.value||!b||b.includes("custom_")||b.includes("_"))return;const Z=J.value.find(Ie=>(Ie==null?void 0:Ie.type)==="single"&&(Ie==null?void 0:Ie.size.includes(b))&&(Ie==null?void 0:Ie.quality));Z!=null&&Z.quality&&Z.quality!==p.imageGenerateParams.quality&&(p.imageGenerateParams.quality=Z.quality),ot()},{immediate:!0,deep:!0}),Ne(()=>[p.imageGenerateParams.imageSetPlatform],b=>{b&&(["Amazon","Shopee","TikTok Shop","Lazada","Temu","SHEIN"].includes(p.imageGenerateParams.imageSetPlatform)?p.imageGenerateParams.language="english":["Ozon","Wildberries"].includes(p.imageGenerateParams.imageSetPlatform)?p.imageGenerateParams.language="russian":p.imageGenerateParams.language="simplified-chinese")},{immediate:!0,deep:!0});const ha=b=>{const Z=p.imageGenerateParams.size||"",Ie=b.children.find(yt=>Z.includes(yt.key)&&Z.includes(yt.size)||Z.includes(yt.size));if(Ie)return Ie.size;const Pe=b.children.find(yt=>$.value&&yt.key.includes("default")&&(yt.quality==p.imageGenerateParams.quality||ce.value==yt.quality)||!$.value&&yt.key.includes("default"));return Pe?(Z||(p.imageGenerateParams.quality=Pe.quality,p.imageGenerateParams.size=Pe.size),Pe.size):"1024x1024"},Aa=b=>{const Z=b.children.find(Ie=>$.value&&Ie.key.includes("default")&&Ie.quality==p.imageGenerateParams.quality||!$.value&&Ie.key.includes("default"));Z&&wt(Z.size,Z),ge.value=!0},xe=()=>{if(!(p.imageGenerateParams.size||"")){const Z=Me();Z&&(p.imageGenerateParams.size=Z.size,p.imageGenerateParams.quality=Z.quality,p.imageGenerateParams.aspectRatio=Z.aspectRatio)}};return(b,Z)=>{const Ie=Lt,Pe=Bt,yt=ca,Yt=ba,aa=Ts,Jt=$s,Ua=As,eo=Qa,Ka=Ya;return l(),f("div",u9,[e(w).model?(l(),ve(Pe,{key:0,open:e(Ve),"onUpdate:open":Z[1]||(Z[1]=xt=>Fe(Ve)?Ve.value=xt:null),placement:"top",trigger:"click",getPopupContainer:xt=>xt.parentNode,arrow:!1,overlayClassName:"image-model-popover"},{content:P(()=>{var xt;return[t("div",d9,[t("div",p9,r(e(m)("qinghu-ai.link-pix-params.502824-0")),1
14),e(te)?(l(),f("div",{key:0,class:Qe(["image-mode-card",{active:e(_e)}]),onClick:Ot},[t("div",m9,[t("img",{src:((xt=e(te))==null?void 0:xt.icon)||e(n1),alt:""},null,8,g9)]),t("div",f9,[t("div",v9,r(e(te).label),1),t("div",h9,r(e(te).description),1)]),Z[11]||(Z[11]=t("div",{class:"image-mode-check"},null,-1))],2)):he("",!0),t("div",{class:Qe(["image-mode-card image-mode-card--custom",{active:e(Re)}]),onClick:zt},[t("div",_9,[t("div",y9,[t("img",{src:e(o1),alt:""},null,8,x9)]),t("div",b9,[t("div",I9,r(e(m)("qinghu-ai.link-pix-params.502824-1")),1),t("div",C9,r(e(m)("qinghu-ai.link-pix-params.502824-2")),1)]),Z[12]||(Z[12]=t("div",{class:"image-mode-check"},null,-1))]),Z[14]||(Z[14]=t("div",{class:"image-model-divider"},null,-1)),t("div",k9,r(e(m)("qinghu-ai.link-pix-params.502824-3")),1),t("div",{class:"image-model-grid",onClick:Z[0]||(Z[0]=Be(()=>{},["stop"]))},[(l(!0),f(we,null,Je(e(Q),(Ke,Ct)=>(l(),f("div",{key:Ke.id||Ke.value,class:Qe(["image-model-option",{active:e(p).mainImageChatMode===Ke.value}]),onClick:na=>sa(Ke)},[t("div",P9,[t("img",{src:Ke.icon||ue(Ke,Ct),alt:""},null,8,M9)]),t("div",S9,[t("div",$9,r(Ke.label),1),t("div",T9,r(Ke.description),1)]),Z[13]||(Z[13]=t("div",{class:"image-model-radio"},null,-1)),Ke.isFree?(l(),f("div",A9,r(e(m)("components-qinghu-ai.video-params.738063-233")),1)):Ke.defaultModel?(l(),f("div",U9,r(e(m)("components-qinghu-ai.channel-card.738063-73")),1)):he("",!0)],10,w9))),128))])],2)])]}),default:P(()=>[y(Ie,{class:Qe(["ant-no-wave mr-6px",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",L9,[t("span",E9,r(e(ye)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])):he("",!0),e(w).generationSettings?(l(),ve(Pe,{key:1,open:e(H),"onUpdate:open":Z[9]||(Z[9]=xt=>Fe(H)?H.value=xt:null),placement:"top",trigger:"click",getPopupContainer:xt=>xt.parentNode,arrow:!1,overlayClassName:"theme-popover"},{content:P(()=>[t("div",null,[t("div",q9,[Z[15]||(Z[15]=t("img",{src:Yc,alt:"",class:"w-36px h-36px"},null,-1)),t("div",D9,[t("div",O9,r(e(m)("qinghu-ai.link-pix-params.266304-0")),1),t("div",N9,r(e(m)("qinghu-ai.link-pix-params.266304-1")),1)])]),t("div",R9,[t("div",F9,[e(p).mainImageChatMode=="SKU_GENERATION"?(l(),f("div",G9,[t("div",V9,r(e(j)),1),t("div",z9,[t("div",{class:Qe(["platform-popover-list",{expanded:e(st)}])},[t("div",{class:"h-68px cursor-pointer color-[#3D3D3D] hover:bg-[#F6F6F6]! pb-6px",onClick:Z[2]||(Z[2]=xt=>_t(""))},[t("div",B9,[t("div",K9,[y(e(Wl),{class:"w-20px h-20px justify-center!"})]),e(p).imageGenerateParams.imageSetPlatform?he("",!0):(l(),f("img",W9))]),t("div",j9,r(e(m)("qinghu-ai.link-pix-params.502824-10")),1)]),(l(!0),f(we,null,Je(e(le),xt=>(l(),f("div",{key:xt.value,class:"h-68px flex items-center cursor-pointer color-[#3D3D3D] hover:bg-[#F6F6F6]! pb-6px relative",onClick:Ke=>_t(xt.value)},[y(yt,null,{title:P(()=>[De(r(xt.label),1)]),default:P(()=>[t("img",{src:xt.src,class:"w-40px h-40px"},null,8,J9),t("div",Y9,r(xt.label),1)]),_:2},1024),e(p).imageGenerateParams.imageSetPlatform===xt.value?(l(),f("img",Q9)):he("",!0)],8,H9))),128))],2),t("div",X9,[t("div",{class:"w-40px h-40px self-start flex items-center justify-center cursor-pointer bg-#F7F7F7 color-[#B8B8B8] hover:bg-[#F6F6F6]! rounded-4px border border-1px border-#B8B8B8 border-dashed",onClick:Z[3]||(Z[3]=Be(xt=>st.value=!e(st),["stop"]))},[y(e(q0),{class:"text-24px! text-#999999!"})]),t("div",Z9,r(e(st)?e(m)("qinghu-ai.link-pix-params.266304-2"):e(m)("qinghu-ai.link-pix-params.266304-3")),1)])])])):he("",!0),e(I)?(l(),f("div",ey,[t("div",ty,r(e(m)("qinghu-ai.link-pix-params.709204-0")),1),e($)?(l(),f("div",ay,[t("div",ny,[(l(),f(we,null,Je(Y,xt=>t("div",{key:xt,class:Qe(["sku-quality-item",{active:e(ce)===xt}]),onClick:Ke=>Ht(xt)},r(xt),11,oy)),64))])])):he("",!0),t("div",sy,[(l(!0),f(we,null,Je(e(me),xt=>(l(),f("div",{key:xt.key,class:Qe(["image-size-item cursor-pointer",{"image-size-active":ta(xt)}])},[xt.type!=="group"?(l(),f("div",{key:0,class:"h-full w-full flex flex-col justify-center items-center",onClick:Ke=>ea(xt)},[t("div",{class:Qe(["popover-item-label text-#000000!",{active:xt.type==="custom"&&$e(e(p).imageGenerateParams.size)}])},[y(yt,null,{title:P(()=>[De(r(xt.label),1)]),default:P(()=>[t("span",iy,r(xt.label),1)]),_:2},1024),xt.type==="custom"?(l(),ve(yt,{key:0},{title:P(()=>[t("div",ry,[e(Ge)?(l(),f(we,{key:0},[t("span",null,r(e(m)("components-qinghu-ai.link-pix-params.738063-113")),1),t("span",null,r(e(Ge)),1)],64)):he("",!0),e(T)?(l(),f(we,{key:1},[t("span",null,r(e(m)("components-qinghu-ai.link-pix-params.738063-114")),1),t("span",null,r(e(T)),1)],64)):he("",!0)])]),default:P(()=>[y(e(pa))]),_:1})):he("",!0)],2),xt.type==="custom"?(l(),f("div",cy,[y(Yt,{value:e(c),"onUpdate:value":Z[4]||(Z[4]=Ke=>Fe(c)?c.value=Ke:null),onPressEnter:He,onBlur:He,ref_for:!0,ref_key:"widthInputRef",ref:x,bordered:!1,"addon-after":e(m)("components-qinghu-ai.link-pix-params.738063-115")},null,8,["value","addon-after"]),y(Yt,{value:e(o),"onUpdate:value":Z[5]||(Z[5]=Ke=>Fe(o)?o.value=Ke:null),onPressEnter:He,onBlur:He,ref_for:!0,ref_key:"heightInputRef",ref:_,bordered:!1,"addon-after":e(m)("components-qinghu-ai.link-pix-params.738063-116")},null,8,["value","addon-after"])])):he("",!0),xt.type==="single"?(l(),f("div",uy,r(xt.showSize||xt.size),1)):he("",!0)],8,ly)):(l(),f("div",{key:1,class:"h-full w-full flex flex-col justify-center items-center",onClick:Be(Ke=>Aa(xt),["stop"])},[t("div",py,r(xt.label),1),y(Ua,{placement:"top",class:"image-size-dropdown",open:e(ge),"onUpdate:open":Z[7]||(Z[7]=Ke=>Fe(ge)?ge.value=Ke:null),trigger:"click"},{overlay:P(()=>
14[y(Jt,{class:"overflow-auto! max-h-300px! scrollbar"},{default:P(()=>[(l(!0),f(we,null,Je(Ce(xt.children),Ke=>(l(),ve(aa,{key:Ke.key,onClick:Be(Ct=>ft(Ke),["stop"])},{default:P(()=>[t("div",my,[t("div",gy,[Ke.icon?(l(),f("img",{key:0,src:e(Ms)(Ke.icon),class:"w-16px h-16px",alt:""},null,8,fy)):(l(),ve(e(fu),{key:1,class:"w-16px h-16px"})),t("span",vy,r(Ke.label),1)]),t("span",hy,r(Ke.showSize||Ke.size),1)])]),_:2},1032,["onClick"]))),128))]),_:2},1024)]),default:P(()=>[t("div",{class:"image-size-dropdown-btn mt-4px",onClick:Z[6]||(Z[6]=Be(()=>{},["prevent"]))},[De(r(ha(xt))+" ",1),y(e(Co),{class:"ml-2px text-10px! text-#6051F8"})])]),_:2},1032,["open"])],8,dy))],2))),128))])])):he("",!0),t("div",_y,[t("div",yy,r(e(m)("qinghu-ai.long-image-params.227781-9")),1),t("div",xy,[y(Ka,{class:"w-200px!",value:e(p).imageGenerateParams.language,"onUpdate:value":Z[8]||(Z[8]=xt=>e(p).imageGenerateParams.language=xt),onChange:je},{default:P(()=>[(l(!0),f(we,null,Je(e(Cs),(xt,Ke)=>(l(),ve(eo,{value:xt.code,key:Ke},{default:P(()=>[De(r(xt.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])])])])])]),default:P(()=>[y(Ie,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",by,[y(e(vu)),t("span",Iy,r(e(ct)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])):he("",!0),e(w).count?(l(),ve(Es,{key:2,open:e(Oe),"onUpdate:open":Z[10]||(Z[10]=xt=>Fe(Oe)?Oe.value=xt:null),title:e(m)("qinghu-ai.link-pix-params.477557-0"),description:e(m)("qinghu-ai.link-pix-params.477557-1"),options:e(re),value:e(p).imageGenerateParams.imageCount,buttonLabel:`${e(m)("qinghu-ai.link-pix-params.477557-3")}ï¼${e(p).imageGenerateParams.imageCount}ï¼`,isChatPinned:u.isChatPinned,isOptionDisabled:ke,onSelect:ut},{"item-extra":P(({option:xt})=>[ke(xt)?(l(),ve(yt,{key:0},{title:P(()=>[De(r(et()),1)]),default:P(()=>[Z[16]||(Z[16]=t("div",{class:"mask"},null,-1))]),_:1})):he("",!0)]),_:1},8,["open","title","description","options","value","buttonLabel","isChatPinned"])):he("",!0)])}}},ky=It(Cy,[["__scopeId","data-v-3e8e2f85"]]),ws=u=>{if(typeof u!="string")return u;try{return JSON.parse(u)}catch{return u}},Ja=u=>{const g=Number(u);return Number.isFinite(g)&&g>0?g:void 0},bo=u=>{var g,i,c;return(c=(i=(g=u.modelSkuId)!=null?g:u.skuId)!=null?i:u.id)!=null?c:""},ku=u=>u.name||u.label||u.modelName||u.modelCode||"",wy=u=>{var g,i,c,o;return String((o=(c=(i=(g=u.modelId)!=null?g:u.modelGroupId)!=null?i:u.groupId)!=null?c:u.modelKey)!=null?o:ku(u)||bo(u))},Py=u=>{const g=String(u||"").toLowerCase();return["recommend","recommended","default"].includes(g)?"recommended":["point","points","cost"].includes(g)?"points":["activity","promotion"].includes(g)?"activity":"custom"},My=u=>{const g=[],i=ws(u.badges);Array.isArray(i)&&i.forEach(o=>{typeof o=="string"?g.push({type:"custom",label:o}):o!=null&&o.label&&g.push({type:Py(o.type),label:o.label})}),u.defaultModel&&!g.some(o=>o.type==="recommended")&&g.unshift({type:"recommended",label:"__recommended__"});const c=ws(u.subTags);return Array.isArray(c)&&c.forEach(o=>{const x=typeof o=="string"?o:o==null?void 0:o.label;x&&!g.some(_=>_.label===x)&&g.push({type:"custom",label:x})}),u.activityBadge&&!g.some(o=>o.label===u.activityBadge)&&g.push({type:"activity",label:u.activityBadge}),g},Sy=u=>{var o,x,_,m,p,d,R,U,G;const g=ws(u.durationConfig),i=u.durationMode||u.durationType,c=String((g==null?void 0:g.mode)||i||"").toLowerCase();if(c==="range"){const a=Ja((o=g==null?void 0:g.min)!=null?o:u.durationMin),E=Ja((x=g==null?void 0:g.max)!=null?x:u.durationMax);if(!a||!E||a>E)return;const z=Ja((_=g==null?void 0:g.step)!=null?_:u.durationStep)||1,q=Ja((p=(m=g==null?void 0:g.defaultValue)!=null?m:u.defaultDuration)!=null?p:u.duration)||a;return{mode:c,min:a,max:E,step:z,defaultValue:Math.min(E,Math.max(a,q))}}if(c==="options"){const a=(g==null?void 0:g.options)||(g==null?void 0:g.values)||u.durationOptions,E=ws(a);if(!Array.isArray(E))return;const z=E.map(S=>{var N,ae;const O=Ja(typeof S=="object"?(N=S.value)!=null?N:S.duration:S);return O?{value:O,modelSkuId:typeof S=="object"?(ae=S.modelSkuId)!=null?ae:S.skuId:void 0,disabled:typeof S=="object"?S.disabled===!0:!1,raw:typeof S=="object"?{...u,...S,duration:O}:{...u,duration:O}}:null}
14).filter(Boolean);if(!z.length)return;const q=Ja((R=(d=g==null?void 0:g.defaultValue)!=null?d:u.defaultDuration)!=null?R:u.duration)||z[0].value;return{mode:c,options:z,defaultValue:q}}if(c==="fixed"){const a=Ja((G=(U=g==null?void 0:g.value)!=null?U:g==null?void 0:g.defaultValue)!=null?G:u.duration);return a?{mode:c,value:a,defaultValue:a}:void 0}},$y=u=>{var _;const g=u[0],i=Sy(g);if(i){const m=i.mode==="options"?i.options:[{value:i.defaultValue,modelSkuId:bo(g),raw:g}];return{config:i,variants:m}}const o=u.map(m=>{var d;const p=Ja((d=m.duration)!=null?d:m.value);return p?{value:p,modelSkuId:bo(m),disabled:m.disabled===!0,raw:m}:null}).filter(Boolean).sort((m,p)=>m.value-p.value).filter((m,p,d)=>d.findIndex(R=>R.value===m.value)===p);if(o.length>1){const m=o.find(p=>{var d;return(d=p.raw)==null?void 0:d.defaultModel})||o[0];return{config:{mode:"options",options:o,defaultValue:m.value},variants:o}}const x=((_=o[0])==null?void 0:_.value)||Ja(g.duration)||5;return{config:{mode:"fixed",value:x,defaultValue:x},variants:o.length?o:[{value:x,modelSkuId:bo(g),raw:g}]}},wu=u=>{const g=Array.isArray(u)?u:u==null?void 0:u.models;if(!Array.isArray(g))return[];const i=new Map;return g.forEach(c=>{const o=wy(c);i.set(o,[...i.get(o)||[],c])}),Array.from(i.entries()).map(([c,o])=>{var p;const x=o.find(d=>d.defaultModel)||o[0],{config:_,variants:m}=$y(o);return{modelId:c,modelCode:x.modelCode||"",modelSkuId:bo(x),name:ku(x),iconUrl:x.iconUrl||x.icon||"",sort:Number((p=x.sort)!=null?p:0),secondCost:Number(x.secondCost)||0,durationConfig:_,badges:My(x),variants:m,raw:x}}).sort((c,o)=>+!!c.raw.maintenance-+!!o.raw.maintenance||c.sort-o.sort)},zn=u=>u.durationConfig.defaultValue,Io=(u,g)=>{const i=u.durationConfig;if(i.mode==="fixed")return i.value<=g?i.value:null;if(i.mode==="range"){if(i.min>g)return null;const o=i.step>0?i.step:1,x=Math.min(i.max,g),_=Math.floor((x-i.min)/o);return Number((i.min+_*o).toFixed(3))}const c=i.options.filter(o=>o.disabled!==!0&&o.value<=g);return c.length?Math.max(...c.map(o=>o.value)):null},Ps=(u,g=zn(u))=>{var x,_,m;const i=u.variants.find(p=>p.value===Number(g))||u.variants[0],c=(i==null?void 0:i.raw)||u.raw,o=(m=(_=(x=i==null?void 0:i.modelSkuId)!=null?x:c.modelSkuId)!=null?_:c.id)!=null?m:u.modelSkuId;return{...u.raw,...c,id:o,modelSkuId:o,modelId:u.modelId,label:u.name,duration:Number(g),durationConfig:u.durationConfig}},El=(u,g)=>{var o;const i=(o=g==null?void 0:g.currentTimeActiveId)!=null?o:g==null?void 0:g.modelSkuId,c=g==null?void 0:g.selectedModelId;if(c){const x=u.find(_=>String(_.modelId)===String(c));if(x&&(!i||String(x.modelSkuId)===String(i)||x.variants.some(_=>String(_.modelSkuId)===String(i))))return x}return u.find(x=>String(x.modelSkuId)===String(i)||x.variants.some(_=>String(_.modelSkuId)===String(i)))},Pu=u=>u.flatMap(g=>g.durationConfig.mode==="options"?g.durationConfig.options.map(i=>Ps(g,i.value)):[Ps(g)]),Mu="LinkPixVideoDurationMemory",Ty=(u,g)=>Number.isFinite(g)?u.mode==="range"?g>=u.min&&g<=u.max:u.mode==="options"?u.options.some(i=>i.value===g):g===u.value:!1,Su=()=>{try{const u=localStorage.getItem(Mu),g=u?JSON.parse(u):{};return g&&typeof g=="object"?g:{}}catch{return{}}},$u=u=>{const g=Number(Su()[String(u.modelId)]);return Ty(u.durationConfig,g)?g:void 0},Tu=(u,g)=>{const i=Number(g);if(!Number.isFinite(i))return;const c=Su();c[String(u.modelId)]=i;try{localStorage.setItem(Mu,JSON.stringify(c))}catch{}},Ay={class:"video-duration-select"},Uy={key:0,class:"video-duration-select__empty"},Ly={key:0,class:"video-duration-range"},Ey={class:"video-duration-range__unit"},qy={key:1,class:"video-duration-options"},Dy=["disabled","onClick"],Oy={key:2,class:"video-duration-fixed"},Ny={key:3,class:"video-duration-select__limit-caption"},Ry=Dt({__name:"video-duration-select",props:{model:{default:null},selectedDuration:{default:0},count:{default:1},maxAllowedDuration:{default:null},limitCaption:{default:""}},emits:["durationChange"],setup(u,{emit:g}){const i=u,c=g,{t:o}=mt(),x=h(Number(i.selectedDuration)||0),_=F(()=>i.model.durationConfig),m=F(()=>typeof i.maxAllowedDuration=="number"&&Number.isFinite(i.maxAllowedDuration)),p=a=>m.value&&a.value>i.maxAllowedDuration,d=F(()=>{var z;const a=(z=i.model)==null?void 0:z.durationConfig;if(!a||a.mode!=="range")return 0;if(!m.value)return a.max;const E=Io(i.model,i.maxAllowedDuration);return E!=null?E:a.max}),R=F(()=>{var E;const a=(E=i.model)==null?void 0:E.durationConfig;return!a||a.mode!=="range"||!m.value?!1:Io(i.model,i.maxAllowedDuration)===null});Ne(()=>i.selectedDuration,a=>x.value=Number(a)||0,{immediate:!0});const U=a=>
14{a!==null&&Number.isFinite(Number(a))&&(x.value=Number(a))},G=a=>{if(a===null||!Number.isFinite(Number(a)))return;const E=_.value;if(E.mode!=="range")return;const z=Math.min(d.value,Math.max(E.min,Number(a)));x.value=z,c("durationChange",z)};return(a,E)=>{const z=jl,q=Hl;return l(),f("div",Ay,[u.model?(l(),f(we,{key:1},[e(_).mode==="range"?(l(),f("div",Ly,[y(z,{class:"video-duration-range__slider",value:e(x),min:e(_).min,max:e(d),step:e(_).step,disabled:e(R),"tooltip-open":!1,onChange:U,onAfterChange:G},null,8,["value","min","max","step","disabled"]),y(q,{class:"video-duration-range__input",value:e(x),min:e(_).min,max:e(d),step:e(_).step,disabled:e(R),controls:!1,onChange:U,onBlur:E[0]||(E[0]=S=>G(e(x))),onPressEnter:E[1]||(E[1]=S=>G(e(x)))},null,8,["value","min","max","step","disabled"]),t("span",Ey,r(e(o)("sms-code.index.489090-5")),1)])):e(_).mode==="options"?(l(),f("div",qy,[(l(!0),f(we,null,Je(e(_).options,S=>(l(),f("button",{key:S.value,type:"button",class:Qe(["video-duration-option",{"video-duration-option--selected":Number(u.selectedDuration)===S.value}]),disabled:S.disabled||p(S),onClick:O=>c("durationChange",S.value)},r(S.value)+r(e(o)("sms-code.index.489090-5")),11,Dy))),128))])):(l(),f("div",Oy,r(e(_).value)+r(e(o)("sms-code.index.489090-5")),1)),u.limitCaption?(l(),f("div",Ny,r(u.limitCaption),1)):he("",!0)],64)):(l(),f("div",Uy,r(e(o)("components-qinghu-ai.video-params.no-models")),1))])}}}),Au=It(Ry,[["__scopeId","data-v-1c0dc158"]]),Fy={class:"video-setting-config"},Gy={class:"video-settings-title"},Vy={key:0,class:"video-settings-tip"},zy={class:"video-settings-tip__strong"},By={key:1,class:"video-setting-config__empty"},Ky={class:"video-setting-field"},Wy={class:"video-setting-label"},jy={class:"video-setting-field video-setting-field--ratio"},Hy={class:"video-setting-label"},Jy={class:"video-ratio-options"},Yy=["onClick"],Qy={class:"video-ratio-option__icon-box"},Xy={class:"video-ratio-option__label"},Zy={class:"video-setting-field video-setting-field--language"},e8={class:"video-setting-label"},t8=Dt({__name:"video-setting-popover",props:{model:{default:null},selectedDuration:{default:0},count:{default:1},orientation:{default:""},directionOptions:{default:()=>[]},language:{default:""},languageOptions:{default:()=>[]},showReferenceTip:{type:Boolean,default:!1},maxAllowedDuration:{default:null},limitCaption:{default:""}},emits:["durationChange","orientationChange","languageChange"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=_=>{i("languageChange",_?String(_):"")},x=_=>{const m=_.aspectRatio||_.label||"1:1",[p=1,d=1]=m.split(":").map(Number),R=20,U=Number.isFinite(p)&&p>0?p:1,G=Number.isFinite(d)&&d>0?d:1,a=Math.min(R/U,R/G);return{width:`${Math.max(6,U*a)}px`,height:`${Math.max(6,G*a)}px`}};return(_,m)=>{const p=Qa,d=Ya;return l(),f("div",Fy,[t("div",Gy,r(e(c)("components-qinghu-ai.video-params.settings-title")),1),u.showReferenceTip?(l(),f("div",Vy,[y(e(Ll),{class:"video-settings-tip__icon"}),t("div",null,[t("span",zy,r(e(c)("components-qinghu-ai.video-params.reference-tip-title")),1),De(" "+r(e(c)("components-qinghu-ai.video-params.reference-tip-content")),1)])])):he("",!0),u.model?(l(),f(we,{key:2},[t("div",Ky,[t("div",Wy,r(e(c)("qinghu-ai.video-params.587254-18")),1),y(Au,{model:u.model,selectedDuration:u.selectedDuration,count:u.count,maxAllowedDuration:u.maxAllowedDuration,limitCaption:u.limitCaption,onDurationChange:m[0]||(m[0]=R=>i("durationChange",R))},null,8,["model","selectedDuration","count","maxAllowedDuration","limitCaption"])]),t("div",jy,[t("div",Hy,r(e(c)("components-qinghu-ai.video-params.aspect-ratio")),1),t("div",Jy,[(l(!0),f(we,null,Je(u.directionOptions,R=>(l(),f("button",{key:R.code,type:"button",class:Qe(["video-ratio-option",{"video-ratio-option--selected":u.orientation===R.code}]),onClick:U=>i("orientationChange",R)},[t("span",Qy,[t("span",{class:"video-ratio-option__icon",style:Nt(x(R))},null,4)]),t("span",Xy,r(R.aspectRatio||R.label),1)],10,Yy))),128))])]),t("div",Zy,[t("div",e8,r(e(c)("qinghu-ai.long-image-params.227781-9")),1),y(d,{class:"video-language-select",value:u.language||void 0,placeholder:e(c)("qinghu-ai.long-image-params.227781-9"),onChange:o},{default:P(()=>[(l(!0),f(we,null,Je(u.languageOptions,R=>(l(),ve(p,{key:R.code,value:R.code},{default:P(()=>[De(r(R.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","placeholder"])])],64)):(l(),f("div",By,r(e(c)("components-qinghu-ai.video-params.no-models")),1))])}}}),a8=It(t8,[["__scopeId","data-v-6ff7f418"]]),n8={class:"video-model-config"}
14,o8=["aria-label"],s8={class:"video-model-config__models-title"},l8={key:0,class:"video-model-config__state"},i8={key:1,class:"video-model-config__state"},r8={key:2,class:"video-model-list"},c8=["disabled","title","onClick"],u8={class:"video-model-item__icon-wrap"},d8=["src"],p8={class:"video-model-item__body"},m8={class:"video-model-item__name"},g8={class:"video-model-item__badges"},f8=Dt({__name:"video-time-popover",props:{models:{default:()=>[]},selectedModelId:{default:""},loading:{type:Boolean,default:!1}},emits:["selectModel"],setup(u,{emit:g}){const i=u,c=g,{t:o}=mt(),x=F(()=>i.models.filter(R=>R.raw.frontHide!=1)),_=R=>String(R.modelId)===String(i.selectedModelId),m=R=>R.raw.maintenance||R.raw.enterprise&&!R.raw.enterpriseEntitled||R.raw.unpaid,p=R=>R.raw.maintenance?o("components-qinghu-ai.video-params.738063-237"):R.raw.enterprise&&!R.raw.enterpriseEntitled?o("qinghu-ai.video-params.608671-0"):R.raw.unpaid?o("components-qinghu-ai.video-params.738063-236"):"",d=R=>R.label==="__recommended__"?o("components-qinghu-ai.duration-card.738063-93"):R.label;return(R,U)=>{const G=Wt;return l(),f("div",n8,[t("section",{class:"video-model-config__models","aria-label":e(o)("components-qinghu-ai.video-params.model-list-title")},[t("div",s8,r(e(o)("components-qinghu-ai.video-params.model-list-title")),1),u.loading?(l(),f("div",l8,[y(G,{size:"small"})])):u.models.length?(l(),f("div",r8,[(l(!0),f(we,null,Je(e(x),a=>(l(),f("button",{key:a.modelId,type:"button",class:Qe(["video-model-item",{"video-model-item--selected":_(a),"video-model-item--disabled":m(a)}]),disabled:m(a),title:p(a),onClick:E=>c("selectModel",a)},[t("span",u8,[a.iconUrl?(l(),f("img",{key:0,src:a.iconUrl,alt:"",class:"video-model-item__icon"},null,8,d8)):(l(),ve(e(D0),{key:1,class:"video-model-item__fallback-icon"}))]),t("span",p8,[t("span",m8,r(a.name),1),t("span",g8,[(l(!0),f(we,null,Je(a.badges,E=>(l(),f("span",{key:`${E.type}-${E.label}`,class:Qe(["video-model-badge",`video-model-badge--${E.type}`])},r(d(E)),3))),128))])]),_(a)?(l(),ve(e(uu),{key:0,class:"video-model-item__check"})):he("",!0)],10,c8))),128))])):(l(),f("div",i8,r(e(o)("components-qinghu-ai.video-params.no-models")),1))],8,o8)])}}}),Uu=It(f8,[["__scopeId","data-v-79797806"]]),Cl=(u,g)=>`LinkPixVideoModelLaunchReminder:${u}:${g}`,v8=u=>{const g=h(null),i=h(!1),c=h(!1),o=h(!1),x=h(!1);let _=null,m=!1;const p=F(()=>g.value?qf(u.models.value,g.value.targetModel):null),d=()=>!!(g.value&&u.userId.value&&u.aiMessageType.value==="IMAGETOVIDEO"&&!$r.value&&Df(g.value)&&p.value),R=(L,K)=>{typeof localStorage>"u"||(localStorage.setItem(Cl(L,K),"1"),localStorage.removeItem(zf))},U=(L,K)=>{typeof localStorage>"u"||localStorage.removeItem(Cl(L,K))},G=(L,K)=>typeof localStorage<"u"&&localStorage.getItem(Cl(L,K))==="1",a=L=>Ff(K=>{const de=K[Bf];return{nextConfig:Kf(K,{campaignId:L,shownAt:(de==null?void 0:de.campaignId)===L&&(de!=null&&de.shownAt)?de.shownAt:new Date().toISOString()}),result:void 0}}),E=async()=>{var Y;if(!d()||o.value||i.value)return;const L=g.value,K=u.userId.value;if(!L||!K)return;o.value=!0;const de=G(K,L.campaignId);let W={},$=!1;try{try{W=await Of(),$=!0}catch{}if(!$||m)return;if(Nf(W,L.campaignId)){if(R(K,L.campaignId),Object.prototype.hasOwnProperty.call(W,Rf))try{await a(L.campaignId)}catch{}return}if(de){try{await a(L.campaignId)}catch{U(K,L.campaignId)}return}if(!d()||m||((Y=g.value)==null?void 0:Y.campaignId)!==L.campaignId||u.userId.value!==K)return;if(G(K,L.campaignId)){try{await a(L.campaignId)}catch{U(K,L.campaignId)}return}if(i.value=!0,await tt(),m||!i.value||!d())return;R(K,L.campaignId);try{await a(L.campaignId)}catch{U(K,L.campaignId)}}finally{o.value=!1}},z=()=>{_&&(clearTimeout(_),_=null)},q=()=>{if(z(),!g.value)return;const L=Date.now(),K=Date.parse(g.value.startAt),de=Date.parse(g.value.endAt),W=L<K?K:L<=de?de+1e3:null;W!==null&&(_=setTimeout(()=>{d()?E():i.value=!1,q()},Math.min(W-L,2147483647)))},S=async()=>{if(!(c.value||x.value)){c.value=!0;try{const L=await Rl(Gf);g.value=(L==null?void 0:L.code)===200||(L==null?void 0:L.success)===!0?Vf(L.payload):null}catch{g.value=null}finally{x.value=!0,c.value=!1}q(),await E()}},O=()=>{i.value=!1},N=()=>{const L=p.value;L&&(u.selectModel(L),O())},ae=Ne(()=>[u.userId.value,u.aiMessageType.value,$r.value,u.models.value.map(L=>[L.id,L.duration,L.maintenance,L.frontHide,L.unpaid,L.enterpriseEntitled].join(":")).join("|")],()=>{if(!d()){i.value=!1;return}x.value&&E()},{flush:"post"});return O0(()=>{m=!0,ae(),z()}),{config:g,open:i,targetModel:p,loadConfig:S,close:O,experience:N}},Lu=50,h8=["mp3","wav","m4a","aac","flac","ogg"],Bn={formats:[...h8],maxFileSizeMb:Lu,maxAudioCount:null,totalDurationLimit:null,singleDurationRange:null},_8=8e3,ln=u=>!!u&&typeof u=="object"&&!Array.isArray(u),y8=u=>{if(typeof u!="string")return ln(u)?u:null;try{const g=JSON.parse(u.trim());return ln(g)?g:null}catch{return null}},Eu=u=>{const g=y8(u);return g?ln(g.audio)?g.audio:"maxAudioCount"in g?g:null:null},oi=u=>{let g=String(u||"").trim().toLowerCase().replace(/^\./,"");return g.includes("/")&&(g=g.split("/").pop()||""),g},qu=(u,g)=>{if(!Array.isArray(u))return[...g];
14const i=[...new Set(u.map(oi).filter(Boolean))];return i.length?i:[...g]},Du=u=>{if(!Array.isArray(u)||u.length<2)return null;const g=Number(u[0]),i=Number(u[1]);return!Number.isFinite(g)||!Number.isFinite(i)||g<0||i<g?null:[g,i]},x8=(u,g)=>{const i=Number(u);return!Number.isFinite(i)||i<=0?g:i},Ou=u=>{const g=Number(u);return!Number.isFinite(g)||g<=0?null:Math.max(1,Math.floor(g))},ql=u=>{const g=Number(u);return!Number.isFinite(g)||g<=0?null:g},ps=u=>{const g=String(u||"").split("?")[0].split("#")[0],i=g.split(".").pop()||"";return i!==g?i.toLowerCase():""},Nu=u=>ln(u)?String(u.fileName||u.name||u.filename||""):"",cn=u=>{const g=Eu(u);return g?{formats:qu(g.formats,Bn.formats),maxFileSizeMb:x8(g.maxFileSizeMb,Bn.maxFileSizeMb),maxAudioCount:Ou(g.maxAudioCount),totalDurationLimit:ql(g.totalDurationLimit),singleDurationRange:Du(g.singleDurationRange)}:{...Bn,formats:[...Bn.formats]}},b8=u=>Math.min(cn(u).maxFileSizeMb,Lu),I8=u=>cn(u).formats.map(g=>`.${g}`).join(","),pc=u=>{const g=cn(u);return JSON.stringify({...g,formats:[...g.formats].sort()})},C8=u=>{const g=Eu(u);return g?{formats:Array.isArray(g.formats)?qu(g.formats,[]):null,maxFileSizeMb:ql(g.maxFileSizeMb),maxAudioCount:Ou(g.maxAudioCount),totalDurationLimit:ql(g.totalDurationLimit),singleDurationRange:Du(g.singleDurationRange)}:null},jn=u=>{if(typeof u=="string")try{return ps(new URL(u,"https://placeholder.invalid").pathname)}catch{return ps(u)}if(typeof Blob<"u"&&u instanceof Blob){const g=u;return ps(g.name||"")||oi(g.type||"")}if(ln(u)){const g=Nu(u);if(g)return ps(g);const i=String(u.url||"");return i?jn(i):""}return""},k8=u=>{if(typeof u=="number")return Number.isFinite(u)?u:null;if(typeof u!="string"||!u.trim())return null;if(u.includes(":")){const i=u.split(":").map(Number);return i.every(Number.isFinite)?i.reduce((c,o)=>c*60+o,0):null}const g=Number.parseFloat(u);return Number.isFinite(g)?g:null},w8=u=>{var g,i;return ln(u)?k8((i=(g=u.durationSeconds)!=null?g:u.duration)!=null?i:u.audioDuration):null},Ru=u=>{var g,i,c;if(typeof Blob<"u"&&u instanceof Blob){const o=u;return{size:o.size,format:jn(o),fileName:o.name||""}}if(ln(u)){const o=Number((c=(g=u.size)!=null?g:u.fileSize)!=null?c:(i=u.file)==null?void 0:i.size),x="durationSeconds"in u||"duration"in u||"audioDuration"in u;return{size:Number.isFinite(o)&&o>=0?o:void 0,duration:x?w8(u):void 0,format:jn(u),fileName:Nu(u)}}return typeof u=="string"?{format:jn(u)}:{}},Dl=(u,g,i={})=>{const c=cn(g),o=oi(u.format),x=!!o&&!c.formats.includes(o);if(c.formats.length&&(i.requireFormat&&!o||x))return{code:"format",format:o,formats:c.formats};if(typeof u.size=="number"&&Number.isFinite(u.size)){const p=b8(c);if(u.size>p*1024*1024)return{code:"file-size",sizeMb:u.size/1024/1024,maxFileSizeMb:p}}const _=c.singleDurationRange;if(!!_||c.totalDurationLimit!==null){if(u.duration===void 0||u.duration===null||typeof u.duration=="number"&&!Number.isFinite(u.duration)||typeof u.duration=="number"&&u.duration<0)return{code:"metadata",fileName:u.fileName};if(_&&typeof u.duration=="number"&&(u.duration<_[0]||u.duration>_[1]))return{code:"single-duration",index:0,duration:u.duration,range:_}}return null},Fu=(u,g)=>{if(!Array.isArray(u)||!u.length)return null;const i=cn(g);if(i.totalDurationLimit===null)return null;const c=u.map(Ru);let o=0;for(const x of c){if(typeof x.duration!="number"||!Number.isFinite(x.duration)||x.duration<0)return{code:"metadata",fileName:x.fileName};o+=x.duration}return o>i.totalDurationLimit?{code:"total-duration",duration:o,limit:i.totalDurationLimit}:null},mc=(u,g)=>{if(!Array.isArray(u)||!u.length)return null;const i=cn(g);if(i.maxAudioCount!==null&&u.length>i.maxAudioCount)return{code:"max-count",maxCount:i.maxAudioCount};const c=u.map(Ru);for(let o=0;o<c.length;o+=1){const x=Dl(c[o],i);if(x)return x.code==="single-duration"?{...x,index:o}:x}return Fu(u,i)},hn=(u,g)=>{if(!u)return"";switch(u.code){case"max-count":return g("audio-reference.rules.max-count",[u.maxCount]);case"format":return g("audio-reference.rules.formats",[u.formats.join(", ")]);case"file-size":return g("audio-reference.rules.file-size",[u.maxFileSizeMb]);case"total-duration":return g("audio-reference.rules.total-duration",[u.limit]);case"single-duration":return g("audio-reference.rules.duration-range",[...u.range]);case"metadata":return g("audio-reference.rules.metadata-failed");default:return""}},P8=(u,g)=>{var c;if(!u)return"";const i=[];return(c=u.formats)!=null&&c.length&&i.push(g("audio-reference.rules.tip-formats",[u.formats.join(",")])),u.maxFileSizeMb!==null&&i.push(g("audio-reference.rules.tip-file-size",[u.maxFileSizeMb])),u.maxAudioCount!==null&&i.push(g("audio-reference.rules.tip-max-count",[u.maxAudioCount])),u.singleDurationRange&&i.push(g("audio-reference.rules.tip-duration",[...u.singleDurationRange])),u.totalDurationLimit!==null&&i.push(g("audio-reference.rules.tip-total-duration",[u.totalDurationLimit])),i.join(" · ")},gc=u=>{if(typeof Audio>"u"||typeof document>"u")return Promise.resolve(null);const g=typeof Blob<"u"&&u instanceof Blob,i=g?URL.createObjectURL(u):typeof u=="string"?u:ln(u)&&typeof u.url=="string"?u.url:"";return i?new Promise(c=>{const o=new Audio;let x=!1;const _=()=>{clearTimeout(p),o.onloadedmetadata=null,o.onerror=null,o.removeAttribute("src"),g&&URL.revokeObjectURL(i)},m=d=>{x||(x=!0,_(),c(d))},p=setTimeout(()=>m(null),_8);o.preload="metadata",o.onloadedmetadata=()=>{const d=o.duration;m(Number.isFinite(d)&&d>0?d:null)},o.onerror=()=>m(null),o.src=i}):Promise.resolve(null)},M8={class:"popover-content"},S8={class:"video-model-trigger__content"},$8={class:"video-model-trigger__label"},T8={class:"linkpix-video-model-launch-reminder__title"},A8={class:"linkpix-video-model-launch-reminder__description"},U8={class:"linkpix-video-model-launch-reminder__promotion"},L8={key:0,class:"absolute top-[-8px] right-[-10px] bg-#F55628 color-#fff py-2px px-6px text-8px rounded-[8px_8px_8px_0px]"},E8={class:"popover-content"},q8={class:"flex items-center h-12px min-w-0"},D8={class:"line-height-1 ml-4px video-param-btn__text"},O8={class:"audio-popover"},N8={class:"audio-popover__header"},R8={class:"audio-popover__title"},F8={class:"audio-tip"},G8={class:"audio-tip__copy"},V8={class:"audio-tip__strong"},z8={key:0,class:"audio-tip__rules"},B8={class:"audio-list"},K8=["onClick"],W8={class:"audio-file__icon"},j8=["src"],H8={class:"audio-file__body"},J8={class:"audio-file__main"},Y8={class:"audio-file__name"},Q8={key:0,class:"audio-file__date"}
14,X8={class:"audio-file__meta"},Z8={class:"audio-file__meta-item"},ex=["src"],tx={class:"audio-file__meta-item"},ax=["src"],nx={class:"audio-file__actions"},ox=["onClick"],sx=["title","aria-label","onClick"],lx={class:"audio-file__progress-ring",viewBox:"0 0 24 24","aria-hidden":"true"},ix=["stroke-dasharray"],rx=["src"],cx=["src"],ux=["onClick"],dx=["src"],px=["src"],mx={key:0,class:"audio-list__loading"},gx={key:1,class:"audio-list__empty"},fx={class:"flex items-center h-12px"},vx=["src"],hx={class:"line-height-1 ml-4px"},_x={class:"beginner-prompt-panel"},yx={class:"beginner-prompt-panel__header"},xx={class:"beginner-prompt-panel__title"},bx={class:"beginner-prompt-panel__desc"},Ix={class:"flex items-center h-12px"},Cx=["src"],kx={class:"line-height-1 ml-4px"},fc="LinkPixVideoAnalyseDefaultModel",wx={__name:"video-params",props:{checkTypeIsDisabled:{type:Function,default:(u,g)=>!1},isChatPinned:{type:Boolean,default:!1},showCountSelect:{type:Boolean,default:!0},modeLoading:{type:Boolean,default:!1}},emits:["clear","selectAudio","mode-change"],setup(u,{expose:g,emit:i}){const c=Pa(),o=wa(),x=i,_=oa(),m=la(),p=bt(),{t:d}=mt(),{userInfo:R}=va(m),{vipInfo:U}=R.value,G=bs.PRESENTED_IMAGE_SIMPLE,a=u,E=h([]),z=h(!1),q=h([1,2,3,4,5,6,7,8]),S=h([{code:"portrait",label:d("qinghu-ai.video-params.587254-15"),five_option:!1},{code:"landscape",label:d("qinghu-ai.video-params.587254-16"),five_option:!1}]),O=h([{code:"simplified-chinese",name:d("utils.video-translate.simplified-chinese")},{code:"traditional-chinese",name:d("utils.video-translate.traditional-chinese")},{code:"english",name:d("utils.video-translate.english")},{code:"spanish",name:d("utils.video-translate.spanish")},{code:"french",name:d("utils.video-translate.french")},{code:"german",name:d("utils.video-translate.german")},{code:"japanese",name:d("utils.video-translate.japanese")},{code:"korean",name:d("utils.video-translate.korean")},{code:"portuguese",name:d("utils.video-translate.portuguese")},{code:"italian",name:d("utils.video-translate.italian")},{code:"arabic",name:d("utils.video-translate.arabic")},{code:"russian",name:d("utils.video-translate.russian")},{code:"thai",name:d("utils.video-translate.thai")},{code:"malay",name:d("utils.video-translate.malay")},{code:"indonesian",name:d("utils.video-translate.indonesian")},{code:"filipino",name:d("qinghu-ai.long-image-params.255520-2")},{code:"vietnamese",name:d("qinghu-ai.video-script.120875-5")}]),N=ue=>{try{const ke=typeof ue=="string"?JSON.parse(ue):ue;return Array.isArray(ke)?ke:[]}catch{return[]}},ae=h(!1),L=h(!1),K=h(!1),de=h(!1),W=h(!1),$=h(!1),Y=h(!1),j=h(""),V=h([]),w=h(""),I=h(0),k=h(0);let B=null,be=0;const ne=ue=>{const ke=E.value.find(et=>String(et.modelId)===String(ue.modelId)||et.variants.some(lt=>String(lt.modelSkuId)===String(ue.id)));ke&&qt(ke)},{config:le,open:ce,loadConfig:J,close:oe,experience:te}=v8({models:F(()=>p.videoTimeData),userId:F(()=>{var ue;return(ue=R.value)==null?void 0:ue.userId}),aiMessageType:F(()=>p.aiMessageType),selectModel:ne}),Q=F(()=>p.videoTimeData.find(ue=>String(ue.id)===String(p.videoGenerateParams.currentTimeActiveId))),ie=F(()=>{var ue;return(ue=Q.value)==null?void 0:ue.referenceRules}),_e=F(()=>cn(ie.value)),Re=I8(Bn),ye=F(()=>P8(C8(ie.value),d)),me=F(()=>{var ke;const ue=_e.value.maxAudioCount;return ue!==null&&(((ke=p.batchUploadAudioUrls)==null?void 0:ke.length)||0)>=ue}),re=F(()=>El(E.value,p.videoGenerateParams)),fe=F(()=>{var ue;return((ue=re.value)==null?void 0:ue.modelId)||""}),Oe=ue=>{let ke=ue;if(typeof ke=="string")try{ke=JSON.parse(ke)}catch{return[]}return Array.isArray(ke)?ke.map(et=>{var je,_t,vt;if(typeof et=="string")return O.value.find(ct=>ct.code===et||ct.name===et)||{code:et,name:et};const lt=(je=et==null?void 0:et.code)!=null?je:et==null?void 0:et.value;return lt?{code:lt,name:(vt=(_t=et.name)!=null?_t:et.label)!=null?vt:lt}:null}).filter(Boolean):[]},Ve=F(()=>{var ke,et,lt;const ue=Oe((lt=(ke=Q.value)==null?void 0:ke.languages)!=null?lt:(et=Q.value)==null?void 0:et.supportedLanguages);return ue.length?ue:O.value}),H=F(()=>{var ue;return((ue=Q.value)==null?void 0:ue.audioSupported)===!0}),st=F(()=>{var ue;return((ue=Q.value)==null?void 0:ue.videoSupported)===!0}),ge=ue=>{if(!ue)return"0M";
14const ke=ue/1024/1024;return ke>=1?`${Number(ke.toFixed(1))}M`:`${Math.max(1,Math.round(ue/1024))}K`},Ce=ue=>!Number.isFinite(ue)||ue<=0?"0.5s":`${Number(ue.toFixed(1))}s`,$e=ue=>{if(!Number.isFinite(ue)||ue<0)return"--";const ke=Math.floor(ue),et=Math.floor(ke/60),lt=String(ke%60).padStart(2,"0");return`${et}:${lt}`},at=ue=>String(w.value)===String(ue.id),nt=ue=>{if(!at(ue))return ue.duration;const ke=k.value||Number.parseFloat(ue.duration);return`${$e(I.value)} / ${$e(ke)}`},Se=ue=>!at(ue)||!k.value?0:Math.min(100,Math.max(0,I.value/k.value*100)),se=(ue=B)=>{ue&&B!==ue||(B=null,w.value="",I.value=0,k.value=0)},Te=()=>{be+=1;const ue=B;ue&&(ue.pause(),ue.currentTime=0),se(ue)},Xe=ue=>(ue==null?void 0:ue.materialUrl)||"",pt=ue=>ue.fileName,gt=ue=>{const ke=Number(ue.fileSize||0);return{id:ue.id,url:Xe(ue),fileName:pt(ue),fileSize:ke,fileSizeText:ge(ke),duration:"--",durationSeconds:null,dataType:"audio",createTime:ue.createTime?an(ue.createTime).format("YYYY/MM/DD"):""}},Ge=ue=>Array.isArray(ue==null?void 0:ue.payload)?ue.payload:[],T=ue=>{ue.forEach(ke=>{if(!ke.url)return;const et=document.createElement("audio");et.preload="metadata",et.onloadedmetadata=()=>{const lt=et.duration,je=Number.isFinite(lt)&<>0;V.value=V.value.map(_t=>_t.id===ke.id?{..._t,durationSeconds:je?lt:null,duration:je?Ce(lt):"--"}:_t)},et.onerror=()=>{V.value=V.value.map(lt=>lt.id===ke.id?{...lt,durationSeconds:null,duration:"--"}:lt)},et.src=ke.url})},X=async()=>{if(!Y.value)try{Y.value=!0;const ue=await Xm({materialType:"AUDIO",pageNum:1,pageSize:20}),ke=Ge(ue).map(gt);V.value=ke,T(ke)}catch{_.error(d("components-qinghu-ai.video-params.446330-63"))}finally{Y.value=!1}},Ee=ue=>{const ke=Dl({format:jn(ue),size:ue.size,fileName:ue.name},Bn,{requireFormat:!0});return ke?(_.error(hn(ke,d)),qa.LIST_IGNORE):!0},Ye=async({file:ue,onSuccess:ke,onError:et})=>{var _t,vt;const lt=await gc(ue);if(lt===null){_.error(hn({code:"metadata",fileName:ue.name},d)),et==null||et(new Error("Audio reference validation failed"));return}const je=new FormData;je.append("file",ue),je.append("uploadBizType","USER_MATERIAL");try{$.value=!0;const rt=await Va(je);if((rt==null?void 0:rt.code)===200||rt!=null&&rt.success){const ct=rt.payload||rt.data||"",Tt={id:(rt==null?void 0:rt.id)||((_t=rt==null?void 0:rt.payload)==null?void 0:_t.id)||((vt=rt==null?void 0:rt.data)==null?void 0:vt.id)||`audio-${Date.now()}`,url:typeof ct=="string"?ct:Xe(ct),fileName:ue.name,fileSize:ue.size,fileSizeText:ge(ue.size),duration:Ce(lt),dataType:"audio",createTime:an().format("YYYY/MM/DD")};V.value=[Tt,...V.value],ke==null||ke(rt,ue),_.success(d("components-qinghu-ai.video-generate-upload.446330-57")),X()}else et==null||et(rt),_.error((rt==null?void 0:rt.message)||d("my-knowledge-base.publish-knowledge-base.9326327-19"))}catch(rt){et==null||et(rt),_.error(d("my-knowledge-base.publish-knowledge-base.9326327-19"))}finally{$.value=!1}},Me=async ue=>{if(me.value){_.warning(hn({code:"max-count",maxCount:_e.value.maxAudioCount},d));return}let ke=ue.durationSeconds;if((!!_e.value.singleDurationRange||_e.value.totalDurationLimit!==null)&&!Number.isFinite(ke)){if(ke=await gc(ue.url),!H.value)return;ke!==null&&(V.value=V.value.map(ct=>ct.id===ue.id?{...ct,durationSeconds:ke,duration:Ce(ke)}:ct))}const lt=Dl({format:jn(ue),size:ue.fileSize,duration:ke,fileName:ue.fileName},_e.value);if(lt){_.error(hn(lt,d));return}const je=Number.isFinite(ke)?{...ue,durationSeconds:ke,duration:Ce(ke)}:ue,_t=Array.isArray(p.batchUploadAudioUrls)?p.batchUploadAudioUrls:[],vt=_t.some(ct=>ct.id===je.id||ct.url===je.url),rt=Fu(vt?_t:[..._t,je],_e.value);if(rt){_.error(hn(rt,d));return}Te(),j.value=ue.id,x("selectAudio",je),de.value=!1},D=ue=>{if(at(ue)){Te();return}if(Te(),!ue.url){j.value=ue.id;return}const ke=new Audio(ue.url),et=++be;B=ke,w.value=ue.id,I.value=0,k.value=0,ke.preload="metadata",ke.onloadedmetadata=()=>{B===ke&&(k.value=Number.isFinite(ke.duration)?ke.duration:0)},ke.ontimeupdate=()=>{B===ke&&(I.value=ke.currentTime,!k.value&&Number.isFinite(ke.duration)&&(k.value=ke.duration))},ke.onended=()=>se(ke),ke.onerror=()=>se(ke),ke.play().then(()=>{et===be&&B===ke||(ke.pause(),ke.currentTime=0)}).catch(lt=>{const je=et===be&&B===ke;je&&se(ke),je&&(lt==null||lt.name)}
14)},Ae=ue=>{o.confirm({title:d("components-qinghu-ai.video-params.446330-66"),content:d("components-qinghu-ai.video-params.446330-67"),icon:y(ra),okText:d("agent-collection.index.198242-5"),cancelText:d("account.change-account-copy.890079-2"),async onOk(){try{const ke=await Zm(ue.id);(ke==null?void 0:ke.code)===200||ke!=null&&ke.success?(at(ue)&&Te(),V.value=V.value.filter(et=>et.id!==ue.id),j.value===ue.id&&(j.value=""),_.success(d("agent-collection.index.198242-7"))):_.error((ke==null?void 0:ke.message)||(ke==null?void 0:ke.msg)||d("asset-library.prompt.deleteFailed"))}catch{_.error(d("asset-library.prompt.deleteFailed"))}}})},We=(ue="")=>["cn_v3_"].some(ke=>ue==null?void 0:ue.includes(ke))?"viduq":["cn_v1_","cn_v2_"].some(ke=>ue==null?void 0:ue.includes(ke))?"seedance_wan":"other",ot=(ue,ke)=>{const et=ue.durationConfig,lt=Number(ke);return et.mode==="range"?Number.isFinite(lt)?Math.min(et.max,Math.max(et.min,lt)):et.defaultValue:et.mode==="options"?et.options.some(je=>je.value===lt)?lt:et.defaultValue:et.value},it=(ue,ke,et={})=>{var _a;if(!ue)return!1;const lt=ue.raw;if(lt.maintenance)return _.warning(d("components-qinghu-ai.video-params.795388-8")),!1;if(lt.enterprise&&!lt.enterpriseEntitled||lt.unpaid)return!1;const je=JSON.parse(JSON.stringify(p.videoGenerateParams)),_t=ot(ue,ke),vt=Ps(ue,_t),rt=String(je.selectedModelId||"")!==String(ue.modelId);p.videoGenerateParams.selectedModelId=ue.modelId,p.videoGenerateParams.modelSkuId=vt.modelSkuId,p.videoGenerateParams.modelCode=vt.modelCode||ue.modelCode,p.videoGenerateParams.currentTimeActiveId=vt.modelSkuId,p.videoGenerateParams.duration=_t,p.videoGenerateParams.size=vt.size,p.videoGenerateParams.imageInputMode=vt.imageInputMode,p.videoGenerateParams.isFree=vt.isFree||null;const ct=N(vt.supportedAspectRatios);ct.length&&(S.value=ct,ct.some(ha=>ha.code===p.videoGenerateParams.orientation)||(p.videoGenerateParams.orientation=ct[0].code));const Tt=Oe((_a=vt.languages)!=null?_a:vt.supportedLanguages);if(Tt.length&&!Tt.some(ha=>ha.code===p.videoGenerateParams.language)&&(p.videoGenerateParams.language=Tt[0].code),p.setFirstFrameInfo(vt,je),rt&&et.clearContent!==!1){const ha=We(je.modelCode),Aa=We(vt.modelCode),xe=We(p.currentGeneratePromptModel);ha!==Aa&&(!p.currentGeneratePromptModel||xe!==Aa)&&p.videoChatMode==="NOOB"&&x("clear",vt)}return!0};function qt(ue){var lt;const et=String(fe.value)===String(ue.modelId)?p.videoGenerateParams.duration:(lt=$u(ue))!=null?lt:zn(ue);it(ue,et),ae.value=!1}function Gt(ue){const ke=re.value;if(!ke||Number(p.videoGenerateParams.duration)===Number(ue))return;const et=p.videoGenerateParams.currentTimeActiveId;it(ke,ue,{clearContent:!1})&&(Tu(ke,p.videoGenerateParams.duration),String(et)===String(p.videoGenerateParams.currentTimeActiveId)&&p.getEstimatedPoints())}const jt=F(()=>{var ue;return(ue=Q.value)==null?void 0:ue.referenceRules}),$t=F(()=>Hm(jt.value,p.batchUploadVideoUrls)),Ht=F(()=>{var je;const ue=$t.value,ke=re.value;if(ue===null||!ke)return"";const et=Io(ke,ue);if(et===null)return d("video-reference.rules.input-output-duration-no-option");const lt=Io(ke,Number.POSITIVE_INFINITY);return lt!==null&&et<lt?d("video-reference.rules.input-output-duration",[(je=Jm(jt.value))!=null?je:""]):""}),ta=()=>{if(p.aiMessageType!=="IMAGETOVIDEO")return;const ue=re.value,ke=$t.value;if(!ue||ke===null)return;const et=Number(p.videoGenerateParams.duration);if(!Number.isFinite(et)||et<=ke)return;const lt=Io(ue,ke);if(lt===null){_.warning(d("video-reference.rules.input-output-duration-no-option"));return}const je=p.videoGenerateParams.currentTimeActiveId;it(ue,lt,{clearContent:!1})&&(String(je)===String(p.videoGenerateParams.currentTimeActiveId)&&p.getEstimatedPoints(),_.info(d("video-reference.rules.input-output-duration-adjusted",[lt])))};Ne(()=>[p.videoGenerateParams.currentTimeActiveId,p.videoGenerateParams.duration,p.batchUploadVideoUrls],()=>ta());function ea(ue){ue&&p.videoGenerateParams.orientation!==ue.code&&(p.videoGenerateParams.orientation=ue.code,p.getEstimatedPoints())}function ft(ue){if(p.videoGenerateParams.count===ue){K.value=!1;return}p.videoGenerateParams.count=ue,K.value=!1}function wt(ue){p.videoGenerateParams.language=ue||"",p.getEstimatedPoints()}const Vt=F(()=>{var ue;return((ue=re.value)==null?void 0:ue.name)||d("components-qinghu-ai.video-params.model-list-title")}),He=F(()=>{const ue=Number(p.videoGenerateParams.duration);return Number.isFinite(ue)&&ue>0?`${ue}${d("sms-code.index.489090-5")}`:d("qinghu-ai.video-params.587254-18")}),Ue=F(()=>{const ue=S.value.find(ke=>ke.code===p.videoGenerateParams.orientation);return ue?ue.aspectRatio||ue.label:d("components-qinghu-ai.video-params.aspect-ratio")}),ut=F(()=>
14{if(!p.videoGenerateParams.language)return d("qinghu-ai.long-image-params.227781-9");const ue=Ve.value.find(ke=>ke.code===p.videoGenerateParams.language);return ue?ue.name:p.videoGenerateParams.language}),At=()=>{Et()},Ut=ue=>{const ke=ue==null?void 0:ue.raw;return!!ke&&!ke.maintenance&&(!ke.enterprise||ke.enterpriseEntitled)&&!ke.unpaid},Et=(ue=E.value)=>{const ke=W.value?ue.find(_t=>_t.raw.isFree&&Ut(_t)):null,et=ue.find(_t=>_t.raw.defaultModel&&Ut(_t)),lt=ue.find(Ut),je=ke||et||lt;je&&(p.videoGenerateParams.count=Number(p.videoGenerateParams.count)||1,it(je,zn(je),{clearContent:!1}))},Ot=(ue=E.value)=>{const ke=localStorage.getItem(fc);if(!ke)return!1;const et=ue.find(lt=>String((lt==null?void 0:lt.modelCode)||"").startsWith(ke));return localStorage.removeItem(fc),!et||!Ut(et)?!1:(p.videoGenerateParams.count=Number(p.videoGenerateParams.count)||1,it(et,zn(et),{clearContent:!1}))},zt=ue=>{if(typeof ue!="string")return ue;try{return JSON.parse(ue)}catch{return ue}},sa=async(ue=!1)=>{var ke;if(!ue&&E.value.length)return E.value;z.value=!0;try{const et=await Wn({businessType:"video",durationSelectable:!0});if(et&&et.data){const lt=et.data,je=Array.isArray(lt)?lt:lt.models;if(!Array.isArray(je))return[];je.forEach(rt=>{var ct;if(rt.activityBadge=Qm(rt.activityBadge)||void 0,rt.propertyTags=zt(rt.propertyTags),rt.subTags=zt(rt.subTags),rt.maintenance&&(rt.description=d("components-qinghu-ai.video-params.738063-238")),(ct=U==null?void 0:U.packagePropertyList)!=null&&ct.length){const Tt=an();U.packagePropertyList.some(ha=>ha.icon==="AI_FLAGSHIP_CREATE_COUNT"&&an(ha.expireTime).isAfter(Tt)&&ha.totalNumber-ha.usageNumber>0)&&rt.enterprise&&!rt.maintenance&&(rt.enterpriseEntitled=!0)}R.value&&!rt.maintenance&&R.value.defaultVip&&rt.paidMemberOnly&&(rt.unpaid=!0,rt.description=(rt.description||"")+d("components-qinghu-ai.video-params.738063-239"))});const _t=wu(je);if(E.value=_t,p.videoModels=_t,p.videoTimeData=Pu(_t),ue)return _t;if(c.query.id||c.query.taskId){const rt=c.query.id||c.query.taskId,ct=_t.find(Tt=>String(Tt.modelId)===String(rt)||Tt.variants.some(_a=>String(_a.modelSkuId)===String(rt)));if(ct){const Tt=ct.variants.find(_a=>String(_a.modelSkuId)===String(rt));return p.videoGenerateParams.count=1,it(ct,(ke=Tt==null?void 0:Tt.value)!=null?ke:zn(ct),{clearContent:!1}),_t}}if(Ot(_t))return _t;const vt=localStorage.getItem("videoGenerateParams");if(vt){let rt=null;try{rt=JSON.parse(vt)}catch{}rt&&(p.videoGenerateParams={...p.videoGenerateParams,...rt,count:Number(rt.count)||1,language:rt.language||O.value[0].code});const ct=El(_t,p.videoGenerateParams);!ct||!Ut(ct)?Et():it(ct,p.videoGenerateParams.duration,{clearContent:!1})}else Et();return _t}}catch{return[]}finally{z.value=!1}};return Ne(()=>ae.value,ue=>{ue&&sa(!0)}),Ne(()=>de.value,ue=>{ue?X():Te()}),Ne(()=>H.value,ue=>{ue||(de.value=!1,j.value="",Te())}),fa(Te),Ne(()=>p.videoGenerateParams.currentTimeActiveId,ue=>{if(ue&&Q.value){const ke=N(Q.value.supportedAspectRatios);ke.length&&(S.value=ke,ke.some(et=>et.code===p.videoGenerateParams.orientation)||(p.videoGenerateParams.orientation=ke[0].code))}},{immediate:!0}),Ne(()=>a.showCountSelect,ue=>{ue||(p.videoGenerateParams.count=1,K.value=!1)},{immediate:!0}),Rt(()=>{Promise.all([sa(),J()])}),g({cleanParams:At,getVideoTimeConfig:sa}),(ue,ke)=>{const et=Bt,lt=Lt,je=qa,_t=Wt,vt=bs,rt=Xn;return l(),f(we,null,[y(et,{open:e(ae),"onUpdate:open":ke[4]||(ke[4]=ct=>Fe(ae)?ae.value=ct:null),arrow:!1,trigger:"click",overlayClassName:"video-duration-popover"},{content:P(()=>[t("div",M8,[y(Uu,{models:e(E),selectedModelId:e(fe),loading:e(z),onSelectModel:qt},null,8,["models","selectedModelId","loading"])])]),default:P(()=>[y(lt,{class:Qe(["mr-6px ant-no-wave relative video-model-trigger",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",S8,[t("span",$8,r(e(Vt)),1),e(le)?(l(),ve(et,{key:0,open:e(ce),placement:"right",trigger:[],arrow:!1,"overlay-class-name":"linkpix-video-model-launch-popover"},{content:P(()=>[t("div",{class:"linkpix-video-model-launch-reminder",onClick:ke[2]||(ke[2]=Be(()=>{},["stop"]))},[t("button",{type:"button",class:"linkpix-video-model-launch-reminder__close","aria-label":"å
³é",title:"å
³é",onClick:ke[0]||(ke[0]=Be((...ct)=>e(oe)&&e(oe)(...ct),["stop"]))},[y(e(ma))]),t("div",T8,r(e(le).title),1),t("div",A8,r(e(le).description),1),t("div",U8,[y(e(N0)),t("span",null,r(e(le).promotionText),1)]),t("button",{type:"button",class:"linkpix-video-model-launch-reminder__action",onClick:ke[1]||(ke[1]=Be((...ct)=>e(te)&&e(te)(...ct),["stop"]))},r(e(le).buttonText),1)])]),default:P(()=>[t("span",{class:"linkpix-video-model-launch-reminder__anchor",onClick:ke[3]||(ke[3]=Be(()=>{},["stop"]))})]),_:1},8,["open"])):he("",!0),y(e(Qt),{class:"ml-10px!"})]),e(p).videoGenerateParams.isFree?(l(),f("div",L8,r(e(d)("components-qinghu-ai.video-params.738063-234")),1)):he("",!0)]),_:1},8,["class"])]),_:1},8,["open"]),y(et,{open:e(L),"onUpdate:open":ke[5]||(ke[5]=ct=>Fe(L)?L.value=ct:null),placement:"top",arrow:!1,trigger:"click",getPopupContainer:ct=>ct.parentNode,overlayClassName:"video-setting-popover"},{content:P(()=>[t("div",E8,[y(a8,{model:e(re),selectedDuration:e(p).videoGenerateParams.duration,count:e(p).videoGenerateParams.count,orientation:e(p).videoGenerateParams.orientation,directionOptions:e(S),language:e(p).videoGenerateParams.language,languageOptions:e(Ve),showReferenceTip:e(st),maxAllowedDuration:e($t),limitCaption:e(Ht),onDurationChange:Gt,onOrientationChange:ea,onLanguageChange:wt},null,8,["model","selectedDuration","count","orientation","directionOptions","language","languageOptions","showReferenceTip","maxAllowedDuration","limitCaption"])])]),default:P(()=>[y(lt,{class:Qe(["mr-6px group ant-no-wave video-param-btn video-param-btn--wide",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",q8,[y(e(Ym)),t("span",D8,r(e(He))+" · "+r(e(Ue))+" · "+r(e(ut)),1),y(e(Qt),{class:"ml-10px! flex-shrink-0"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"]),u.showCountSelect?(l(),ve(Es,{key:0,open:e(K),"onUpdate:open":ke[6]||(ke[6]=ct=>Fe(K)?K.value=ct:null),title:e(d)("qinghu-ai.link-pix-params.477557-4"),description:e(d)("qinghu-ai.link-pix-params.477557-6"),options:e(q),value:e(p).videoGenerateParams.count||1,buttonLabel:`${e(d)("qinghu-ai.link-pix-params.477557-3")}ï¼${e(p).videoGenerateParams.count||1}ï¼`,isChatPinned:u.isChatPinned,popoverWidth:544,onSelect:ft},null,8,["open","title","description","options","value","buttonLabel","isChatPinned"])):he("",!0),e(H)?(l(),ve(et,{key:1,open:e(de),"onUpdate:open":ke[8]||(ke[8]=ct=>Fe(de)?de.value=ct:null),placement:"topRight",arrow:!1,trigger:"click",getPopupContainer:ct=>ct.parentNode,overlayClassName:"video-audio-popover"},{content:P(()=>[t("div",O8,[t("div",N8,[t("div",R8,r(e(d)("components-qinghu-ai.media-reference-item.446330-50")),1
14),y(e(ma),{class:"audio-popover__close",onClick:ke[7]||(ke[7]=ct=>de.value=!1)})]),t("div",F8,[y(e(R0),{class:"audio-tip__icon"}),t("div",G8,[t("div",null,[t("span",V8,r(e(d)("components-qinghu-ai.video-params.446330-58")),1),De(r(e(d)("components-qinghu-ai.video-params.446330-59")),1)]),t("div",null,r(e(d)("components-qinghu-ai.video-params.446330-60")),1),e(ye)?(l(),f("div",z8,r(e(ye)),1)):he("",!0)]),y(je,{class:"audio-upload",accept:e(Re),showUploadList:!1,beforeUpload:Ee,customRequest:Ye},{default:P(()=>[y(lt,{class:"audio-upload__button",loading:e($)},{default:P(()=>[y(e(F0)),t("span",null,r(e(d)("components-qinghu-ai.video-params.446330-61")),1)]),_:1},8,["loading"])]),_:1},8,["accept"])]),t("div",B8,[(l(!0),f(we,null,Je(e(V),ct=>(l(),f("div",{key:ct.id,class:Qe(["audio-file",{"audio-file--active":e(j)===ct.id,"audio-file--previewing":at(ct)}]),onClick:Tt=>j.value=ct.id},[t("div",W8,[t("img",{src:e(Vl),class:"audio-file__icon-img",alt:""},null,8,j8)]),t("div",H8,[t("div",J8,[t("div",Y8,r(ct.fileName),1),ct.createTime?(l(),f("div",Q8,r(ct.createTime),1)):he("",!0)]),t("div",X8,[t("span",Z8,[t("img",{src:e(l1),class:"audio-file__meta-icon",alt:""},null,8,ex),De(" "+r(nt(ct)),1)]),t("span",tx,[t("img",{src:e(i1),class:"audio-file__meta-icon",alt:""},null,8,ax),De(" "+r(ct.fileSizeText),1)])])]),t("div",nx,[t("button",{class:"audio-file__use",onClick:Be(Tt=>Me(ct),["stop"])},r(e(d)("pages-workflow-components.buy-modal.286663-88")),9,ox),t("button",{class:Qe(["audio-file__icon-btn",{"audio-file__icon-btn--stop":at(ct)}]),title:at(ct)?e(d)("components-qinghu-ai.video-params.446330-70"):e(d)("components-qinghu-ai.video-params.446330-71"),"aria-label":at(ct)?e(d)("components-qinghu-ai.video-params.446330-70"):e(d)("components-qinghu-ai.video-params.446330-71"),onClick:Be(Tt=>D(ct),["stop"])},[at(ct)?(l(),f(we,{key:0},[(l(),f("svg",lx,[ke[10]||(ke[10]=t("circle",{class:"audio-file__progress-track",cx:"12",cy:"12",r:"10"},null,-1)),t("circle",{class:"audio-file__progress-value",cx:"12",cy:"12",r:"10",pathLength:"100","stroke-dasharray":`${Se(ct)} 100`},null,8,ix)])),y(e(Wl),{class:"audio-file__stop-icon"})],64)):(l(),f(we,{key:1},[t("img",{src:e(r1),class:"audio-file__action-img audio-file__action-img--normal",alt:""},null,8,rx),t("img",{src:e(c1),class:"audio-file__action-img audio-file__action-img--active",alt:""},null,8,cx)],64))],10,sx),t("button",{class:"audio-file__icon-btn",onClick:Be(Tt=>Ae(ct),["stop"])},[t("img",{src:e(u1),class:"audio-file__action-img audio-file__action-img--normal",alt:""},null,8,dx),t("img",{src:e(d1),class:"audio-file__action-img audio-file__action-img--active",alt:""},null,8,px)],8,ux)])],10,K8))),128)),e(Y)?(l(),f("div",mx,[y(_t,{size:"small"})])):e(V).length?he("",!0):(l(),f("div",gx,[y(vt,{image:e(G),description:e(d)("components-qinghu-ai.video-params.446330-62")},null,8,["image","description"])]))])])]),default:P(()=>[y(lt,{class:Qe(["mr-6px group ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",fx,[t("img",{src:e(s1),class:"audio-param-icon",alt:""},null,8,vx),t("span",hx,r(e(d)("components-qinghu-ai.media-reference-item.446330-50")),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])):he("",!0),y(et,{placement:"bottom",trigger:"click",arrow:!1,getPopupContainer:ct=>ct.parentNode,overlayClassName:"beginner-prompt-popover"},{content:P(()=>[t("div",_x,[t("div",yx,[t("span",xx,r(e(d)("components-qinghu-ai.video-params.446330-68")),1),y(rt,{loading:u.modeLoading,checked:e(p).videoChatMode==="NOOB",size:"small",onChange:ke[9]||(ke[9]=ct=>x("mode-change",ct))},null,8,["loading","checked"])]),t("div",bx,r(e(d)("components-qinghu-ai.video-params.446330-69")),1)])]),default:P(()=>[y(lt,{class:Qe(["mr-6px group ant-no-wave beginner-prompt-entry order-[100]",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",Ix,[t("img",{src:e(tu),class:"beginner-prompt-entry__icon",alt:""},null,8,Cx),t("span",kx,r(e(d)("components-qinghu-ai.video-params.446330-68")),1)])]),_:1},8,["class"])]),_:1},8,["getPopupContainer"])],64)}}},Px=It(wx,[["__scopeId","data-v-d843a332"]]),Mx={class:"excel-uploader"},Sx={__name:"index",emits:["parsed","error"],setup(u,{emit:g}){const{t:i}=mt(),c=g,o=h(!1),x=h([]),_=h([]);F(()=>x.value.slice(0,20));const m=async p=>{const d=p&&p.name?p.name:"",R=p&&p.size?p.size:0,U=d.split(".").pop().toLowerCase();
14if(!["xls","xlsx","csv"].includes(U))return qe.error(i("components-public-excel-upload.index.795388-0")),c("error",{message:"invalid_ext",file:p}),Upload.LIST_IGNORE;o.value=!0;try{const a=await p.arrayBuffer(),E=G0(a,{type:"array"});if(!E.SheetNames||E.SheetNames.length===0)throw new Error(i("public-excel-upload.index.184371-2"));const z=E.Sheets[E.SheetNames[0]],q=V0.sheet_to_json(z,{defval:""});x.value=q||[],_.value=x.value.length?Object.keys(x.value[0]):[],c("parsed",{fileName:d,fileSize:R,data:x.value,file:p})}catch(a){qe.error(i("public-excel-upload.index.184371-3")),c("error",{message:(a==null?void 0:a.message)||"parse_error",error:a})}finally{return o.value=!1,Upload.LIST_IGNORE}};return(p,d)=>{const R=Lt,U=qa;return l(),f("div",Mx,[y(U,{"before-upload":m,"show-upload-list":!1,accept:".xls,.xlsx,.csv",multiple:!1},{default:P(()=>[xn(p.$slots,"default",{},()=>[y(R,{icon:"UploadOutlined"},{default:P(()=>[De(r(e(i)("public-excel-upload.index.184371-0")),1)]),_:1})],!0)]),_:3})])}}},$x=It(Sx,[["__scopeId","data-v-939d4646"]]),Tx={class:"crop-image-modal"},Ax={class:"crop-image-modal__tip"},Ux={class:"crop-image-modal__preview"},Lx={class:"crop-image-modal__preview-inner"},Ex={class:"crop-image-modal__frame"},qx=["src"],Dx={class:"crop-image-modal__zoom-tools"},Ox={class:"crop-image-modal__toolbar"},Nx=["onClick"],Rx={class:"crop-image-modal__ratio-text"},Fx=["aria-label"],Gx={class:"crop-image-modal__ai-text"},vc=.1,Vx=1,zx=3,Bx=Dt({__name:"cropImage",setup(u,{expose:g}){const{t:i}=mt(),c=bt(),o=oa(),x=h(!1),_=h(i("components-qinghu-ai.cropImage.407726-89")),m=h(""),p=h([]),d=h(null),R=Vn({width:0,height:0}),U=h(1),G=Vn({x:0,y:0,width:0,height:0}),a=Vn({x:0,y:0,width:0,height:0}),E=Vn({active:!1,startX:0,startY:0,originX:0,originY:0}),z={width:628,height:328},q=re=>{const[fe,Oe]=re.split(":").map(Number);return!fe||!Oe?1:fe/Oe},S=F(()=>({width:`${G.width}px`,height:`${G.height}px`,left:`${G.x}px`,top:`${G.y}px`})),O=F(()=>!!d.value&&a.width>0&&a.height>0),N=F(()=>({width:`${a.width}px`,height:`${a.height}px`,left:`${G.x+a.x}px`,top:`${G.y+a.y}px`})),ae=F(()=>{if(!R.width||!R.height)return{x:0,y:0,width:0,height:0};if(!O.value)return{x:0,y:0,width:R.width,height:R.height};const re=R.width/G.width,fe=R.height/G.height;return{x:Math.round(a.x*re),y:Math.round(a.y*fe),width:Math.round(a.width*re),height:Math.round(a.height*fe)}}),L=re=>new Promise((fe,Oe)=>{const Ve=new Image;Ve.crossOrigin="anonymous",Ve.onload=()=>{R.width=Ve.naturalWidth,R.height=Ve.naturalHeight,fe()},Ve.onerror=Oe,Ve.src=re}),K=()=>{if(!R.width||!R.height)return;const re=Math.min(z.width/R.width,z.height/R.height);G.width=Math.round(R.width*re*U.value),G.height=Math.round(R.height*re*U.value),G.x=Math.round((z.width-G.width)/2),G.y=Math.round((z.height-G.height)/2)},de=()=>{a.x=0,a.y=0,a.width=0,a.height=0},W=re=>{const fe=q(re);G.width/G.height>fe?(a.height=G.height,a.width=Math.round(G.height*fe)):(a.width=G.width,a.height=Math.round(G.width/fe)),a.x=Math.round((G.width-a.width)/2),a.y=Math.round((G.height-a.height)/2)},$=()=>{if(!O.value)return;const re=Math.max(G.width-a.width,0),fe=Math.max(G.height-a.height,0);a.x=Math.min(Math.max(a.x,0),re),a.y=Math.min(Math.max(a.y,0),fe)};Ne(()=>c.cropImageMode.visible,re=>{re&&Y(c.cropImageMode.url,c.cropImageMode.radioList,c.cropImageMode.aspectRatio)});const Y=async(re,fe=[],Oe)=>{m.value=re||"",p.value=(fe||[]).filter(Ve=>Ve==null?void 0:Ve.aspectRatio),d.value=Oe,U.value=1,de();try{await L(m.value),K(),d.value&&W(d.value)}catch{R.width=0,R.height=0,o.error(i("components-qinghu-ai.cropImage.270934-8"))}},j=()=>{x.value||(c.cropImageMode={url:"",aspectRatio:"",visible:!1,radioList:[]})},V=re=>{d.value=re,W(re)},w=re=>{const fe=re==="in"?Math.min(U.value+vc,zx):Math.max(U.value-vc,Vx);if(fe===U.value)return;const Oe=O.value?{left:G.x+a.x,top:G.y+a.y}:null;U.value=Number(fe.toFixed(2)),K(),d.value&&(O.value?(Oe&&(a.x=Oe.left-G.x,a.y=Oe.top-G.y),$()):W(d.value))},I=re=>`ratio_${re.replace(":","_")}`,k=async(re,fe)=>{const Ve=await(await fetch(re)).blob();return{blob:Ve,file:new File([Ve],fe,{type:Ve.type||"image/png"})}},B=()=>{c.cropImageMode={url:"",aspectRatio:"",visible:!1,radioList:[]}},be=re=>new Promise(fe=>setTimeout(fe,re)),ne=re=>{var Ve,H;const fe=m.value;if(!fe||!re)return;const Oe=c.batchUploadImgUrls.findIndex(st=>st===fe);if(Oe>-1){const st=[...c.batchUploadImgUrls];st.splice(Oe,1,re),c.batchUploadImgUrls=st}Array.isArray((Ve=c.longImageParams)==null?void 0:Ve.materialImg)&&(c.longImageParams.materialImg=c.longImageParams.materialImg.map(st=>(st==null?void 0:st.url)===fe?{...st,url:re}:st)),(H=c.imageMapping)!=null&&H[fe]&&(c.imageMapping={...c.imageMapping,[re]:{...c.imageMapping[fe],url:re}},delete c.imageMapping[fe]),c.cropImageMode.url===fe&&(c.cropImageMode.url=re)},le=async re=>{const fe=new FormData;fe.append("file",re.file),fe.append("temp","true");const Oe=await Va(fe);if(!(Oe!=null&&Oe.success)||!(Oe!=null&&Oe.payload))throw new Error((Oe==null?void 0:Oe.message)||"upload cropped image failed");return{url:Oe.payload}},ce=re=>{var fe,Oe;return(re==null?void 0:re.imageUrl)||((Oe=(fe=re==null?void 0:re.images)==null?void 0:fe[0])==null?void 0:Oe.url)||""},J=async re=>{for(let Oe=0;Oe<60;Oe++){const Ve=await Ec({taskId:re});if((Ve==null?void 0:Ve.code)!==0||!(Ve!=null&&Ve.data))throw new Error((Ve==null?void 0:Ve.msg)||"get gemini generate status failed");const H=Ve.data,st=H.status;if(["completed","complete","SUCCESS"].includes(st)){const ge=ce(H);if(!ge)throw new Error("gemini result image url missing");return ge}if(["failed","FAILED","no_resource","TIMEOUT"].includes(st))throw new Error((H==null?void 0:H.errorMsg)||"gemini generate failed");await be(5e3)}
14throw new Error("gemini generate timeout")},oe=async()=>{const re=ae.value,fe=new Image;fe.crossOrigin="anonymous",await new Promise((Ce,$e)=>{fe.onload=()=>Ce(),fe.onerror=$e,fe.src=m.value});const Oe=document.createElement("canvas");Oe.width=Math.round(re.width),Oe.height=Math.round(re.height);const Ve=Oe.getContext("2d");if(!Ve)throw new Error("Canvas context unavailable");Ve.drawImage(fe,re.x,re.y,re.width,re.height,0,0,Oe.width,Oe.height);const H=Oe.toDataURL("image/png"),{blob:st,file:ge}=await k(H,`aspect-ratio-${d.value.replace(":","-")}.png`);return{blob:st,file:ge,dataUrl:H,cropRect:re}},te=async()=>{if(!m.value){o.warning(i("components-qinghu-ai.cropImage.270934-9"));return}if(!d.value){o.warning(i("components-qinghu-ai.cropImage.270934-10"));return}x.value=!0,_.value=i("components-qinghu-ai.cropImage.407726-89");try{const re=await oe(),fe=await le(re);ne(fe.url),o.success(i("components-qinghu-ai.cropImage.270934-11")),B()}catch{o.error(i("components-qinghu-ai.cropImage.270934-12"))}finally{x.value=!1}},Q=()=>{if(!m.value){o.warning(i("components-qinghu-ai.cropImage.270934-9"));return}if(!d.value){o.warning(i("components-qinghu-ai.cropImage.270934-10"));return}ie()},ie=async()=>{var re,fe;x.value=!0,_.value=i("components-qinghu-ai.cropImage.407726-89");try{const Oe=(re=c.imageOptions.find(st=>st.value==="INTELLIGENT_GENERATION"))==null?void 0:re.id,Ve=await eg({prompt:i("components-qinghu-ai.cropImage.407726-91",[d.value]),images:[m.value],aspectRatio:d.value,imageCount:1,modelSkuId:Oe});if((Ve==null?void 0:Ve.code)!==0||!((fe=Ve==null?void 0:Ve.data)!=null&&fe.taskId))throw new Error((Ve==null?void 0:Ve.msg)||"create gemini generate failed");const H=await J(Ve.data.taskId);ne(H),o.success(i("components-qinghu-ai.cropImage.270934-13")),B()}catch{o.error(i("components-qinghu-ai.cropImage.270934-14"))}finally{x.value=!1}},_e=()=>{if(!m.value){o.warning(i("components-qinghu-ai.cropImage.270934-9"));return}Q()};g({});const Re=re=>{O.value&&(E.active=!0,E.startX=re.clientX,E.startY=re.clientY,E.originX=a.x,E.originY=a.y)},ye=re=>{if(!E.active)return;const fe=re.clientX-E.startX,Oe=re.clientY-E.startY,Ve=G.width-a.width,H=G.height-a.height;a.x=Math.min(Math.max(E.originX+fe,0),Ve),a.y=Math.min(Math.max(E.originY+Oe,0),H)},me=()=>{E.active=!1};return(re,fe)=>{const Oe=So,Ve=Wt,H=Zt;return l(),ve(H,{open:e(c).cropImageMode.visible,"onUpdate:open":fe[2]||(fe[2]=st=>e(c).cropImageMode.visible=st),title:e(i)("agent-collection.index.198242-3"),width:620,maskClosable:!1,keyboard:!1,closable:!e(x),"cancel-button-props":{disabled:e(x)},"confirm-loading":e(x),centered:"",destroyOnClose:"","wrap-class-name":"crop-image-modal-wrapper",onOk:te,onCancel:j},{default:P(()=>[y(Ve,{spinning:e(x),tip:e(_)},{default:P(()=>[t("div",Tx,[t("div",Ax,r(e(i)("components-qinghu-ai.cropImage.407726-93")),1),t("div",Ux,[t("div",Lx,[t("div",{class:"crop-image-modal__stage",onPointermove:ye,onPointerup:me,onPointerleave:me},[t("div",Ex,[t("img",{src:e(m),alt:"",class:"crop-image-modal__image",style:Nt(e(S))},null,12,qx),e(O)?(l(),f(we,{key:0},[t("div",{class:"crop-image-modal__mask crop-image-modal__mask--top",style:Nt({left:`${e(G).x}px`,top:`${e(G).y}px`,width:`${e(G).width}px`,height:`${e(a).y}px`})},null,4),t("div",{class:"crop-image-modal__mask crop-image-modal__mask--left",style:Nt({left:`${e(G).x}px`,top:`${e(G).y+e(a).y}px`,width:`${e(a).x}px`,height:`${e(a).height}px`})},null,4),t("div",{class:"crop-image-modal__mask crop-image-modal__mask--right",style:Nt({left:`${e(G).x+e(a).x+e(a).width}px`,top:`${e(G).y+e(a).y}px`,width:`${e(G).width-e(a).x-e(a).width}px`,height:`${e(a).height}px`})},null,4),t("div",{class:"crop-image-modal__mask crop-image-modal__mask--bottom",style:Nt({left:`${e(G).x}px`,top:`${e(G).y+e(a).y+e(a).height}px`,width:`${e(G).width}px`,height:`${e(G).height-e(a).y-e(a).height}px`})},null,4),t("div",{class:"crop-image-modal__crop-box",style:Nt(e(N)),onPointerdown:Be(Re,["stop"])},null,36)],64)):he("",!0),t("div",Dx,[t("div",{class:"crop-image-modal__zoom-btn",onClick:fe[0]||(fe[0]=st=>w("out"))},[y(e(z0))]),t("div",{class:"crop-image-modal__zoom-btn",onClick:fe[1]||(fe[1]=st=>w("in"))},[y(e(B0))])])])],32)])]),t("div",Ox,[(l(!0),f(we,null,Je(e(p),st=>(l(),f("div",{key:st.code,class:Qe(["crop-image-modal__ratio",{"crop-image-modal__ratio--active":e(d)===st.aspectRatio}]),onClick:ge=>V(st.aspectRatio)},[t("span",{class:Qe(["crop-image-modal__ratio-icon",I(st.aspectRatio)])},null,2),t("span",Rx,r(st.aspectRatio),1)],10,Nx))),128)),y(Oe,{placement:"top","ok-text":e(i)("qinghu-ai.video-batch-generate.797009-31"),"cancel-text":e(i)("account.change-account-copy.890079-2"),onConfirm:_e},{title:P(()=>[t("div",null,r(e(i)("components-qinghu-ai.cropImage.407726-96"))+r(e(d)),1),t("div",null,[De(r(e(i)("components-qinghu-ai.cropImage.407726-97")),1),fe[3]||(fe[3]=t("img",{src:p1,class:"w-14px h-14px",alt:""},null,-1)),De(r(e(i)("components-qinghu-ai.cropImage.407726-98")),1)])]),default:P(()=>[t("div",{class:"crop-image-modal__ai-btn","aria-label":e(i)("components-qinghu-ai.cropImage.407726-99")},[fe[4]||(fe[4]=t("span",{class:"crop-image-modal__ai-icon"},null,-1)),t("span",Gx,r(e(i)("components-qinghu-ai.cropImage.407726-99")),1)],8,Fx)]),_:1},8,["ok-text","cancel-text"])])])]),_:1}
14,8,["spinning","tip"])]),_:1},8,["open","title","closable","cancel-button-props","confirm-loading"])}}}),Kx=It(Bx,[["__scopeId","data-v-cd259c3c"]]),Wx={class:"min-w-100px p-x-4px"},jx={class:"p-5"},Hx={class:"flex gap-1 mb-8px"},Jx={class:"text-slate-800 text-sm font-semibold tracking-tight"},Yx={class:"text-slate-500 text-xs leading-relaxed"},Qx={class:"grid grid-cols-3 gap-2 mb-4"},Xx={class:"text-xs font-medium transition-colors duration-200 block text-slate-600 group-hover/tag:text-slate-700"},Zx={class:"space-y-3"},e4={key:0,class:"flex items-center gap-2"},t4={class:"text-14px"},a4={key:1,class:"flex h-20px"},n4={key:0,class:"w-16px mr-4px"},o4={class:"material-ref-tip",style:{width:"260px"}},s4={class:"text-14px font-500 text-#333 mb-6px"},l4={class:"text-13px text-#666 leading-20px mb-8px"},i4={class:"flex items-center gap-6px text-13px text-#666"},r4=["src"],c4={key:1,class:"material-ref-btn"},u4=Dt({__name:"ImageItemWrapper",props:{element:{},index:{},isVisibleSameStyle:{type:Boolean},customPurpose:{},imageMapping:{},styleStr:{},showClose:{type:Boolean,default:!0},purposeStyle:{},isGeneratePromptForm:{type:Boolean,default:!1},drawerVisible:{type:Boolean,default:!1},showOperationBtn:{type:Boolean,default:!0},showCropBtn:{type:Boolean,default:!0}},emits:["update:isVisibleSameStyle","select","open-change","update:custom-purpose","add-custom","material-click","onDelete","material-reference","selling-points","crop-save","crop-ai-edit"],setup(u,{emit:g}){const i=bt(),{t:c}=mt();oa();const o=u,x=g,_=F(()=>!o.imageMapping||!o.element?{}:o.imageMapping[o.element]||{}),m=F(()=>{var B,be,ne;const w=((B=i.ali1688SameStyleImgList)==null?void 0:B.originalImage)&&o.element===i.ali1688SameStyleImgList.originalImage,I=((ne=(be=i.ali1688SameStyleImgList)==null?void 0:be.list)==null?void 0:ne.length)>0,k=i.imageRecognitionChecked;return w&&I&&k}),p=F(()=>{var w;return i.isFirstFrame&&(((w=i.firstFrameInfo)==null?void 0:w.needFirstFrameList)||[]).length===1}),d=F(()=>{const w=[{label:c("qinghu-ai.long-image-material.139562-33")},{label:c("qinghu-ai.long-image-material.139562-34")},{label:c("qinghu-ai.long-image-material.139562-35")},{label:c("qinghu-ai.long-image-material.139562-36")},{label:c("qinghu-ai.long-image-material.139562-37")},{label:c("qinghu-ai.long-image-material.139562-38")}],I=i.firstFrameInfo.needFirstFrameList.map(k=>({label:k.label}));return i.isFirstFrame?I:w}),R=F({get:()=>o.drawerVisible?!1:o.isVisibleSameStyle,set:w=>{x("update:isVisibleSameStyle",w)}}),U=F({get:()=>o.customPurpose,set:w=>{x("update:custom-purpose",w)}}),G=h(null),a=h([]),E=h(""),z=h(!1),q=w=>{try{const I=typeof w=="string"?JSON.parse(w):w;return Array.isArray(I)?I:[]}catch{return[]}},S=()=>Array.isArray(a.value)?a.value:[],O=()=>{var w;return((w=S().find(I=>I.code===i.videoGenerateParams.orientation))==null?void 0:w.aspectRatio)||""},N=w=>{x("select",w),R.value=!1},ae=w=>{x("open-change",w)},L=(w,I)=>{x("material-click",w,I),z.value=!1},K=w=>{x("add-custom",w),x("update:custom-purpose",""),z.value=!1},de=w=>{x("onDelete",w)},W=()=>{const w=i.materialRefMap[o.element],I=(w==null?void 0:w.materialId)||i.generateMaterialId();i.materialRefMap[o.element]||(i.materialRefMap[o.element]={materialId:I,url:o.element}),x("material-reference",{url:o.element,materialId:I,characterInfo:(w==null?void 0:w.characterInfo)||null})},$=()=>{E.value=O(),i.cropImageMode={visible:!0,url:o.element,aspectRatio:E.value,radioList:S()}},Y=w=>{x("crop-save",{...w,index:o.index,element:o.element,imageData:_.value})},j=w=>{x("crop-ai-edit",{...w,index:o.index,element:o.element,imageData:_.value})},V=w=>{const I=i.videoTimeData.find(k=>k.id===w);I&&(a.value=q(I.supportedAspectRatios),E.value=O())};return Ne(()=>i.videoGenerateParams.currentTimeActiveId,w=>{w&&V(w)},{immediate:!0,deep:!0}),Rt(()=>{tt(()=>{var w;o.element==i.ali1688SameStyleImgList.originalImage&&((w=i.ali1688SameStyleImgList)!=null&&w.list)&&i.ali1688SameStyleImgList.list.length>0&&(R.value=!0)})}),(w,I)=>{const k=Lt,B=ba,be=Bt;return l(),f("div",{class:"bg-[#F7F7F7] relative rounded-6px mr-8px mt-8px flex justify-center items-center material-thumb",style:Nt(u.styleStr)},[xn(w.$slots,"img-item",{url:u.element,index:u.index},void 0,!0),u.showClose?(l(),f("img",{key:0,src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:I[0]||(I[0]=Be(ne=>de(u.index),["stop"]))})):he("",!0),t("div",Wx,[e(p)?he("",!0):(l(),f("div",{key:0,class:"flex items-center justify-center mr-4px cursor-pointer",style:Nt(u.purposeStyle)}
14,[y(be,{placement:"top",trigger:"click",open:e(z),"onUpdate:open":I[3]||(I[3]=ne=>Fe(z)?z.value=ne:null),onOpenChange:ae},{content:P(()=>[t("div",null,[t("div",jx,[t("div",Hx,[t("h3",Jx,r(e(c)("qinghu-ai.long-image-material.139562-3")),1),t("p",Yx,r(e(c)("qinghu-ai.long-image-material.139562-4")),1)]),t("div",Qx,[(l(!0),f(we,null,Je(e(d),(ne,le)=>(l(),ve(k,{style:{display:"flex","align-items":"center","justify-content":"center"},key:le,onClick:ce=>L(ne,u.element)},{default:P(()=>{var ce;return[t("div",{class:"w-2 h-2 rounded-full transition-all duration-200 bg-slate-200 group-hover/tag:bg-slate-300 mr-8px",style:Nt({background:((ce=e(_))==null?void 0:ce.tag)==ne.label?"#2E4FFF":"#D8D8D8"})},null,4),t("span",Xx,r(ne.label),1)]}),_:2},1032,["onClick"]))),128))]),t("div",Zx,[I[6]||(I[6]=t("div",{class:"flex items-center gap-2 text-xs text-slate-500"},[t("div",{class:"h-px bg-slate-200 flex-1"}),t("span",{class:"px-2"}),t("div",{class:"h-px bg-slate-200 flex-1"})],-1)),e(i).isFirstFrame?he("",!0):(l(),f("div",e4,[y(B,{value:e(U),"onUpdate:value":I[1]||(I[1]=ne=>Fe(U)?U.value=ne:null),type:"text",placeholder:e(c)("qinghu-ai.long-image-material.139562-5"),class:"flex-1 text-sm px-3 py-2.5 border border-slate-200/80 rounded-xl bg-white/60 focus:outline-none focus:border-[#20f6da]/40 focus:bg-white transition-all duration-200 placeholder:text-slate-400"},null,8,["value","placeholder"]),y(k,{disabled:!e(U),class:"px-4 py-2.5 bg-gradient-to-r from-[#20f6da] to-[#86EEBA] text-white text-sm font-medium rounded-xl hover:shadow-lg hover:shadow-[#20f6da]/20 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed hover:scale-105",onClick:I[2]||(I[2]=ne=>K(u.element))},{default:P(()=>[De(r(e(c)("qinghu-ai.long-image-material.139562-6")),1)]),_:1},8,["disabled"])]))])])])]),default:P(()=>{var ne;return[t("span",t4,r(((ne=e(_))==null?void 0:ne.tag)||e(c)("qinghu-ai.long-image-material.139562-39")),1),y(e(Qt),{class:"w-12px h-12px ml-4px"})]}),_:1},8,["open"])],4)),u.showOperationBtn?(l(),f("div",a4,[e(m)?(l(),f("div",n4,[y(df,{open:e(R),"onUpdate:open":I[5]||(I[5]=ne=>Fe(R)?R.value=ne:null),images:e(i).ali1688SameStyleImgList.list,onSelect:N,trigger:"click"},{default:P(()=>[y(e(pf),{class:"text-[#1E90FF] text-14px cursor-pointer ml-4px",onClick:I[4]||(I[4]=Be(ne=>R.value=!e(R),["stop"]))})]),_:1},8,["open","images"])])):he("",!0),y(be,{placement:"top",overlayClassName:"material-ref-popover"},{content:P(()=>[t("div",o4,[t("div",s4,r(e(c)("components-qinghu-ai.ImageItemWrapper.747658-1")),1),t("div",l4,r(e(c)("components-qinghu-ai.ImageItemWrapper.747658-2")),1),t("div",i4,[t("span",null,r(e(c)("components-qinghu-ai.ImageItemWrapper.747658-3")),1),t("img",{src:u.element,alt:"",style:{width:"32px",height:"32px","border-radius":"4px","object-fit":"cover"}},null,8,r4),t("span",null,r(e(c)("components-qinghu-ai.ImageItemWrapper.747658-4")),1)])])]),default:P(()=>[t("div",{class:"material-ref-btn",onClick:Be(W,["stop"])},[...I[7]||(I[7]=[t("span",{class:"at-icon"},"@",-1)])])]),_:1}),u.showCropBtn?(l(),f("div",c4,[y(e(K0),{class:"text-#1E90FF text-14px! fw-bold",onClick:Be($,["stop"])})])):he("",!0)])):he("",!0)]),y(Kx,{ref_key:"cropImageRef",ref:G,onSave:Y,onAiEdit:j},null,512)],4)}}}),si=It(u4,[["__scopeId","data-v-2949fa05"]]),d4={class:"compliance-popover-content"},p4={class:"compliance-popover-text"},m4={class:"w-full h-full relative"},g4=["src"],f4={class:"w-full h-full absolute top-[0px] rounded-6px left-[0px] bg-[rgba(0,0,0,0.76)] flex flex-col justify-center items-center"},v4=["onClick"],h4={class:"w-full h-full relative"},_4=["src"],y4={class:"w-full h-full absolute top-[0px] rounded-6px left-[0px] bg-[rgba(0,0,0,0.76)] flex flex-col justify-center items-center"},x4=["onClick"],b4={__name:"portrait_check_fail_images",props:{images:{type:Array,default:()=>[]},showClose:{type:Boolean,default:!0},styleStr:{type:String,default:""},size:{type:String,default:""}},emits:["delete"],setup(u,{emit:g}){const i=g,c=la(),{t:o}=mt(),x=u,_=h(""),m=a=>!!(a!=null&&a.requiresFaceComplianceSign)||Number(a==null?void 0:a.code)===tg,p=(a,E)=>`${(a==null?void 0:a.url)||""}-${(a==null?void 0:a.code)||""}-${E}`,d=F(()=>{const a=x.images.findIndex(E=>m(E));return a>=0?p(x.images[a],a):""});Ne(()=>x.images,()=>{_.value=d.value},{immediate:!0,deep:!0});const R=(a,E,z)=>{_.value=a?p(E,z):""},U=()=>{_.value="",c.openLinkPixFaceComplianceModal("identifyImageHead")},G=a=>{i("delete",a)};return(a,E)=>{const z=Lt,q=Bt,S=ca;return l(!0),f(we,null,Je(u.images,(O,N)=>(l(),f("div",{class:"bg-[#F7F7F7] relative rounded-6px mr-8px mt-8px flex justify-center items-center material-thumb w-60px h-60px",style:Nt(`${u.styleStr}`),key:N},[m(O)?(l(),ve(q,{key:0,placement:"top",trigger:"hover",overlayClassName:"portrait-compliance-popover",open:e(_)===p(O,N),onOpenChange:ae=>R(ae,O,N)},{content:P(()=>[t("div",d4,[t("div",p4,r(e(o)("components-qinghu-ai.portrait_check_fail_images.44633
140-51")),1),y(z,{type:"primary",class:"compliance-popover-button",onClick:Be(U,["stop"])},{default:P(()=>[De(r(e(o)("components-qinghu-ai.portrait_check_fail_images.446330-52")),1)]),_:1})])]),default:P(()=>[t("div",m4,[t("img",{src:O.url,alt:"",class:"w-full h-full rounded-6px"},null,8,g4),t("div",f4,[y(e(Ll),{class:Qe(["color-[red]!",[u.size=="large"?"text-18px!":""]])},null,8,["class"]),t("div",{class:Qe(["text-11px color-[#fff] mt-4px",[u.size=="large"?"text-12px!":""]])},r(e(o)("my-knowledge-base.publish-knowledge-base.9326327-19")),3)]),t("img",{src:Ca,alt:"",class:Qe(["w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",[u.size=="large"?"w-18px h-18px":""]]),onClick:Be(ae=>G(N),["stop"])},null,10,v4)])]),_:2},1032,["open","onOpenChange"])):(l(),ve(S,{key:1,placement:"top"},{title:P(()=>[De(r(e(o)("components-qinghu-ai.portrait_check_fail_images.738063-176")),1)]),default:P(()=>[t("div",h4,[t("img",{src:O.url,alt:"",class:"w-full h-full rounded-6px"},null,8,_4),t("div",y4,[y(e(Ll),{class:Qe(["color-[red]!",[u.size=="large"?"text-18px!":""]])},null,8,["class"]),t("div",{class:Qe(["text-11px color-[#fff] mt-4px",[u.size=="large"?"text-12px!":""]])},r(e(o)("my-knowledge-base.publish-knowledge-base.9326327-19")),3)]),t("img",{src:Ca,alt:"",class:Qe(["w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",[u.size=="large"?"w-18px h-18px":""]]),onClick:Be(ae=>G(N),["stop"])},null,10,x4)])]),_:2},1024))],4))),128)}}},Gu=It(b4,[["__scopeId","data-v-e62cc76b"]]),I4={key:0,class:"flex"},C4={key:1,class:"flex pt-12px"},k4={class:"material-thumb bg-[#F1F1F1] rounded-6px relative px-10px py-4px"},w4={class:"flex items-center"},P4={class:"text-12px"},M4={class:"text-12px color-[rgba(61,61,61,0.50)]"},S4={class:"popover-content"},$4={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center"},T4={key:0,class:"mt-12px"},A4={class:"w-500px"},U4={key:0},L4={key:1},E4={class:"w-full h-full flex justify-center items-center"},q4={key:0,src:ka,alt:"",class:"w-28px h-28px"},D4={key:1,src:on,alt:"",class:"w-28px h-28px"},O4={key:0,class:"text-14px color-[#3D3D3D] my-6px"},N4={key:1,class:"text-14px color-[#3D3D3D] my-6px"},R4={class:"text-12px"},F4={class:"text-12px"},G4={key:2,class:"text-12px"},V4={key:3,class:"text-12px"},z4={key:1,class:"mt-12px"},B4={key:0,class:"text-center"},K4={class:"text-14px pt-3px max-w-344px"},W4={class:"text-14px text-[rgba(8,193,138,1)] my-6px"},j4=["src"],H4={class:"flex items-center justify-between"},J4=["href"],Y4={class:"qh-upload mt-12px h-119px max-w-344px"},Q4={key:1,class:"text-14px color-[#3D3D3D] flex-center gap-y-5px flex-col text-center"},X4={class:"max-w-280px text-center"},Z4={class:"flex items-center mt-12px"},e7={key:0,class:"text-12px text-center",style:{"line-height":"1"}},t7={key:1,class:"text-12px text-center",style:{"line-height":"1"}},a7={key:1,class:"text-center"},n7={class:"text-12px"},o7={__name:"video-batch-generate",props:{isSendDisabled:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showDelete:{type:Boolean,default:!1},isBeginnerPrompt:{type:Boolean,default:!0},showBatch:{type:Boolean,default:!0},maxCount:{type:Number,default:5},styleStr:{type:String,default:""},purposeStyle:{type:String,default:""},imgStyle:{type:String,default:""},uploadStyle:{type:String,default:"width:60px;height:60px;margin-top: 8px;"},isGeneratePromptForm:{type:Boolean,default:!1},drawerVisible:{type:Boolean,default:!1},showSameStyle:{type:Boolean,default:!1},showOperationBtn:{type:Boolean,default:!0},isGetSameStyle:{type:Boolean,default:!0},mimeType:{type:String,default:""},returnOriginalWhenLarger:{type:Boolean,default:!0},referenceRules:{type:[Object,String],default:null}},emits:["success","updateScript","clear-file","material-reference","image-deleted","selling-points","loading"],setup(u,{expose:g,emit:i}){const c=Dc(),o=bt(),x=la(),{t:_,locale:m}=mt(),p=u,d=i,R=Kt(),U=F(()=>ko(p.referenceRules)?{...wo(p.referenceRules),maxFileSizeMb:Po(p.referenceRules)}:null),G=T=>{T&&(T.code==="format"?qe.error(_("image-reference.rules.formats",[T.formats.join(", ")
14])):T.code==="metadata"?qe.error(_("image-reference.rules.metadata-failed")):T.code==="file-size"?qe.error(_("image-reference.rules.file-size",[T.maxFileSizeMb])):T.code==="min-dimension"?qe.error(_("image-reference.rules.min-dimension",[T.minDimension])):T.code==="aspect-ratio"?qe.error(_("image-reference.rules.aspect-ratio-range",T.range)):T.code==="max-count"&&qe.error(_("image-reference.rules.max-count",[T.maxCount])))},a=async(T,X)=>{if(U.value){const Ye=await _n(T,U.value,X);return Ye?(G(Ye),!1):!0}const Ee=await Ac(X||T,Kn);return Ee||qe.error(_("public-img-upload.index.101106-8",[Kn])),Ee},{userInfo:E}=va(x),{vipInfo:z}=E.value,q=h([]),S=h(!1),O=h("1"),N=h(!1),ae=h(null),L=h(null);h(null);const K=h(!1),de=h(null),W=h(""),$=F(()=>{var T;return Math.min(p.maxCount,((T=U.value)==null?void 0:T.maxImageCount)||Number.MAX_SAFE_INTEGER)}),Y=T=>Number.isInteger(T)?String(T):String(Number(T.toFixed(2))),j=F(()=>{const T=U.value;if(!T)return{maxFileSize:_("qinghu-ai.video-batch-generate.797009-5"),formats:_("qinghu-ai.video-batch-generate.797009-6"),maxCount:`${_("qinghu-ai.video-batch-generate.797009-7")}${$.value}${_("qinghu-ai.video-batch-generate.797009-8")}`};const X=String(m.value||"").toLowerCase().startsWith("zh")?"ã":", ";return{maxFileSize:_("image-reference.rules.size-tip",[Y(T.maxFileSizeMb)]),formats:_("image-reference.rules.formats-tip",[T.formats.join(X)]),maxCount:_("image-reference.rules.count-tip",[$.value])}}),V=h(!1),w=h(""),I=h(!1);Ne(()=>{var T;return[p.maxCount,(T=U.value)==null?void 0:T.maxImageCount]},()=>{var X;(((X=o.batchUploadImgUrls)==null?void 0:X.length)||0)>$.value&&(o.batchUploadImgUrls=o.batchUploadImgUrls.slice(0,$.value),qe.warning(_("image-reference.rules.max-count",[$.value])))},{deep:!0}),Ne(()=>p.drawerVisible,T=>{T||(V.value=!1)},{deep:!0}),Ne(()=>V.value,T=>{if(!T){if(!T&&!o.videoGenerateParams.sameStyleImageUrl&&o.ali1688SameStyleImgList.originalImage&&!I.value){const X={images:[o.ali1688SameStyleImgList.originalImage]};Se(X)}else if(!T&&o.videoGenerateParams.sameStyleImageUrl&&!I.value){const X={images:[o.videoGenerateParams.sameStyleImageUrl]};Se(X)}}},{deep:!0});const k=F(()=>(o.batchUploadImgUrls||[]).some(T=>{var X,Ee;return((Ee=(X=o.imageMapping)==null?void 0:X[T])==null?void 0:Ee.tag)===_("qinghu-ai.long-image-material.139562-33")})),B=F(()=>{var Ee;const T=(Ee=o.videoGenerateParams)==null?void 0:Ee.currentTimeActiveId,X=(o.videoTimeData||[]).find(Ye=>(Ye==null?void 0:Ye.id)==T);return X==null?void 0:X.faceSupported});Ne(()=>o.batchUploadImgUrls,T=>{if(!T||!Array.isArray(T))return;o.imageMapping||(o.imageMapping={}),T.forEach(Ee=>{o.imageMapping[Ee]||(o.imageMapping[Ee]={tag:""})});const X=new Set(T);if(Object.keys(o.imageMapping).forEach(Ee=>{X.has(Ee)||delete o.imageMapping[Ee]}),T&&T.length&&o.imageRecognitionChecked){if(N.value)return;const Ee=T[0];o.materialRefMap[Ee]||(o.ali1688SameStyleImgList.originalImage=T[0])}},{immediate:!0,deep:!0}),Ne(()=>K.value,T=>{if(!T){const X=document.querySelector(".qinghu-link-pix-content");if(!X)return;X.style.overflowY="auto"}T&&localStorage.getItem("imageRecognitionChecked")&&(o.imageRecognitionChecked=localStorage.getItem("imageRecognitionChecked")=="true")},{deep:!0});const be=(T,X)=>{if(o.isFirstFrame){let Ee=[];for(let Ye in o.imageMapping)Ee.push(o.imageMapping[Ye].tag);if(Ee.includes(T.label)){qe.error(_("components-qinghu-ai.video-batch-generate.738063-224")+T.label);return}}if(o.imageMapping[X]&&o.imageMapping[X].tag&&o.imageMapping[X].tag==T.label){o.imageMapping[X].tag="";return}o.imageMapping[X]||(o.imageMapping[X]={tag:""}),o.imageMapping[X].tag=T.label},ne=T=>{o.imageMapping[T].tag=w.value},le=F(()=>E.value.defaultVip),ce=F(()=>`https://static-001.iqinghu.com/front_template_file/ai_template_file/%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90%E8%A7%86%E9%A2%91.xlsx?t=${Date.now()}`),J=T=>{O.value=T},oe=T=>{T&&tt(()=>{var X;(X=L==null?void 0:L.value)==null||X.fetchHistoryImages()});try{if(typeof window>"u")return;const X=document.querySelector(".qinghu-link-pix-content");if(!X)return;X.style.overflowY=T?"hidden":"auto"}catch{}},te=async T=>
14{if(K.value=!1,!!await a(T,T.imageDimensions)){try{S.value=!0;let X="";o.aiMessageType=="IMAGETOVIDEO"&&(X=o.videoGenerateParams.currentTimeActiveId);const Ee=await _s({url:T.imageUrl,type:"IDENTIFY_IMAGE_HEAD",modelSkuId:X});if(Ee.code!==0){qe.error(`${_("public-img-upload.index.101106-4",[T.fileName||""])}ï¼${Ee.msg}`),pt(ys(T.imageUrl,Ee));return}}finally{S.value=!1}T.otherAttributes&&!o.videoGenerateParams.offerId&&(o.videoGenerateParams.prompt1688DetailGlobal=T.otherAttributes,o.videoGenerateParams.prompt1688DetailImageUrl=T.imageUrl),await Re([T.imageUrl])}},Q=()=>{S.value=!0},ie=()=>{S.value=!1},_e=()=>{const T=o.firstFrameInfo.needFirstFrameList.map(X=>X.label);return T.includes(_("qinghu-ai.long-image-material.139562-33"))&&T.includes(_("components-qinghu-ai.video-batch-generate.738063-223"))?_("components-qinghu-ai.video-batch-generate.738063-225"):T.includes(_("qinghu-ai.long-image-material.139562-33"))?_("components-qinghu-ai.video-batch-generate.738063-226"):T.includes(_("components-qinghu-ai.video-batch-generate.738063-223"))?_("components-qinghu-ai.video-batch-generate.738063-227"):_("components-qinghu-ai.video-batch-generate.738063-225")},Re=async T=>{var X;if(O.value=="1"&&T){let Ee=[];typeof T=="string"?Ee.push(T):Ee=T;let Ye=[...o.batchUploadImgUrls,...Ee];if(Ye=[...new Set(Ye)],Ye.length>$.value&&(Ye=Ye.slice(0,$.value),qe.warning(_("image-reference.rules.max-count",[$.value]))),o.batchUploadImgUrls=Ye,o.setDefaultPurpose(),ae.value.clearImg(),K.value=!1,o.videoChatMode=="NOOB"&&o.batchUploadImgUrls.length&&p.isBeginnerPrompt)if(p.isSendDisabled)Ce();else{if(o.isObtain)return;Zt.confirm({title:_("agent.index.174028-0"),icon:St(ra),content:St("div",[St("div",[_("components-qinghu-ai.video-batch-generate.738063-228")]),St("div",[_("components-qinghu-ai.video-batch-generate.738063-229")])]),cancelText:_("agent.index.174028-3"),okText:_("agent.index.174028-2"),keyboard:!1,maskClosable:!1,onOk(){Ce()}})}O.value=="1"&&o.batchUploadImgUrls.length+((X=o==null?void 0:o.portraitCheckFailImages)==null?void 0:X.length)>=$.value&&(S.value=!1)}},ye=async T=>{const X={[_("qinghu-ai.video-batch-generate.797009-16")]:"referenceImage",[_("qinghu-ai.video-batch-generate.797009-17")]:"prompt",[_("qinghu-ai.video-batch-generate.797009-18")]:"videoDuration",[_("qinghu-ai.video-batch-generate.797009-19")]:"videoOrientation",[_("qinghu-ai.video-batch-generate.797009-20")]:"videoType",[_("qinghu-ai.video-batch-generate.797009-21")]:"language"},Ye=(ot=>Array.isArray(ot)?ot.map(it=>{const qt={};for(const Gt in it){if(!Object.prototype.hasOwnProperty.call(it,Gt))continue;const jt=(""+Gt).trim(),$t=X[jt]||jt;qt[$t]=it[Gt]}return qt}):[])(T.data||[]),Me=["prompt","videoDuration","videoOrientation","videoType","language"];if(Ye.length==0){qe.error(_("qinghu-ai.video-batch-generate.797009-22"));return}const D=[];if(Ye.forEach((ot,it)=>{const qt=Me.filter(Gt=>{const jt=ot[Gt];return jt==null||typeof jt=="string"&&jt.trim()===""});qt.length&&D.push({row:it+1,missing:qt})}),D.length){qe.error(_("qinghu-ai.video-batch-generate.797009-22"));return}const Ae=new FormData;Ae.append("file",T.file),S.value=!0;const We=await Va(Ae);S.value=!1,We.code==200&&(K.value=!1,await me(We.payload),tt(()=>{T.url=We.payload,o.videoFileInfo=T,o.batchUploadImgUrls=[]}),d("success"))},me=async T=>{const X=await bn({excelUrl:T,type:"VIDEO"});X.code==0?o.estimatedPoints=X.data:o.estimatedPoints={}},re=async(T,X=0)=>{Ta({options:{toolbar:!0,initialViewIndex:X},images:T})},fe=T=>{let X=o.batchUploadImgUrls[T];X==o.ali1688SameStyleImgList.originalImage&&(o.ali1688SameStyleImgList={}),o.batchUploadImgUrls.splice(T,1),d("image-deleted",X)},Oe=T=>{S.value=T},Ve=async T=>{if(o.batchUploadImgUrls.length>=$.value){qe.warning(_("image-reference.rules.max-count",[$.value]));return}if(!await a(T))return;const X=new FormData;X.append("file",T),X.append("temp","true"),["LONGIMAGE","POSTERIMAGE","AD_MATERIAL","SOCIALMEDIA"].includes(o.aiMessageType)&&X.append("uploadBizType","COMMON_IMAGE");try{Oe(!0);const{success:Ye,payload:Me}=await Va(X);if(Oe(!1),Ye&&Me){if(o.aiMessageType=="IMAGETOVIDEO"){Oe(!0);let D="";o.aiMessageType=="IMAGETOVIDEO"&&(D=o.videoGenerateParams.currentTimeActiveId);const Ae=await _s({url:Me,type:"IDENTIFY_IMAGE_HEAD",modelSkuId:D});if(Oe(!1),Ae.code!=0){qe.error(`${T.name} ${_("qinghu-ai.batch-upload-img.708047-1")}${Ae.msg}`),o==null||o.portraitCheckFailImages.push(ys(Me,Ae)),K.value=!1;return}}if(o.batchUploadImgUrls.push(Me),o.videoChatMode=="NOOB"&&o.batchUploadImgUrls.length)if(p.isSendDisabled)Ce();else{if(o.isObtain)return;Zt.confirm({title:_("agent.index.174028-0"),icon:St(ra),content:St("div",[St("div",[_("components-qinghu-ai.video-batch-generate.738063-228")]),St("div",[_("components-qinghu-ai.video-batch-generate.738063-229")])]),cancelText:_("agent.index.174028-3"),okText:_("agent.index.174028-2"),keyboard:!1,maskClosable:!1,onOk(){Ce()}})}}}catch{qe.error(_("qinghu-ai.video-batch-generate.797009-36"))}},H=async(T,X)=>{var Ye;!T||(O.value="1",o.batchUploadImgUrls.length+(((Ye=o==null?void 0:o.portraitCheckFailImages)==null?void 0:Ye.length)||0)>=$.value)||await a(T,X)&&await Re([T])},st=async(T,X)=>{T&&await H(T,X)},ge=async T=>{const X=kn(T.dataTransfer);if(X.length){O.value="1";
14for(const Ye of X)await Ve(Ye);return}const Ee=Cn(T.dataTransfer);Ee&&await st(Ee)},Ce=async()=>{var T,X,Ee;o.isObtain||(o.isObtain=!0,W.value="",de.value=new AbortController,d("updateScript",{script:W.value,status:"start",imgList:[]}),o.currentGeneratePromptModel=(T=o==null?void 0:o.videoGenerateParams)==null?void 0:T.model,await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":m.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({imageList:[o.batchUploadImgUrls[0]],images:[o.batchUploadImgUrls[0]],promptType:"VIDEO_DEFAULT",modelSkuId:((X=o==null?void 0:o.videoGenerateParams)==null?void 0:X.currentTimeActiveId)||"",duration:((Ee=o==null?void 0:o.videoGenerateParams)==null?void 0:Ee.duration)||5,language:_("components.VideoTranslationParams.738063-22")}),signal:de.value.signal,openWhenHidden:!0,onmessage(Ye){try{const Me=JSON.parse(Ye.data),{role:D,type:Ae,data:We}=Me||{};if(Ae==="chat_number_over")return de.value.abort(),de.value=null,Zt.confirm({title:_("qinghu-ai.video-batch-generate.797009-37"),icon:St(ra),content:We,cancelText:_("qinghu-ai.video-batch-generate.797009-32"),okText:_("qinghu-ai.video-batch-generate.797009-38"),keyboard:!1,maskClosable:!1,onOk(){R.push("/product?product=vip")}});D==="assistant"&&Ae==="answer"&&typeof We=="string"&&(W.value+=We,d("updateScript",{script:W.value,status:"updating"}))}catch{}},async onopen(Ye){if(Ye.status&&["401","500","600"].includes(String(Ye.status)))if(Ye.status==401){qe.error(_("qinghu-ai.video-batch-generate.797009-41"));let Me=setTimeout(()=>{clearTimeout(Me),window.location.reload()},600)}else Ye.status==500?qe.error(_("qinghu-ai.video-batch-generate.797009-42")):Ye.status==600&&qe.error(_("qinghu-ai.video-batch-generate.797009-42"));return Promise.resolve()},onerror(Ye){qe.error(_("qinghu-ai.video-batch-generate.797009-44")),de.value.abort(),de.value=null},async onclose(Ye){d("updateScript",{script:W.value,status:"finish"})}}))},$e=T=>T?T<1024?T+"B":T<1024*1024?(T/1024).toFixed(2)+"KB":(T/(1024*1024)).toFixed(2)+"MB":"",at=()=>{o.videoFileInfo=null,d("clear-file")},nt=F(()=>{var D;const T=((D=o==null?void 0:o.videoFileInfo)==null?void 0:D.fileName)||"";if(!T)return"";const X=T.lastIndexOf("."),Ee=X>0?T.slice(X):"",Ye=X>0?T.slice(0,X):T,Me=10;return Ye.length>Me?`${Ye.slice(0,Me)}...${Ee}`:`${Ye}${Ee}`}),Se=async T=>{var X,Ee;if(p.isGeneratePromptForm&&!I.value)try{I.value=!0,d("loading",!0);const Ye=await ag(T);if(d("loading",!1),Ye.code==0&&Ye.data){const Me={productSellingPoint:((X=Ye==null?void 0:Ye.data)==null?void 0:X.productSellingPoint)||"",productName:((Ee=Ye==null?void 0:Ye.data)==null?void 0:Ee.productName)||T.productTitle};Ge(Me)}else d("loading",!1)}catch{d("loading",!1)}},se=async T=>{N.value=!0;let X=await qc({url:T});if(N.value=!1,X.code==0)o.ali1688SameStyleImgList.list=X.data,V.value=!0;else{const Ee={images:[o.ali1688SameStyleImgList.originalImage]};Se(Ee)}};Ne(()=>o.ali1688SameStyleImgList.originalImage,T=>{if(I.value=!1,o.ali1688SameStyleImgList.list=[],T){if(N.value)return;p.isGetSameStyle&&(p.isGeneratePromptForm&&p.drawerVisible||!p.isGeneratePromptForm&&!p.drawerVisible)&&se(T)}else o.videoGenerateParams.offerId="",o.videoGenerateParams.imageUrl="",o.videoGenerateParams.sameStyleProductName="",o.videoGenerateParams.sameStyleImageUrl=""},{deep:!0});const Te=async()=>{await tt(),localStorage.setItem("imageRecognitionChecked",o.imageRecognitionChecked)},Xe=T=>{V.value=!1},pt=T=>{o==null||o.portraitCheckFailImages.push(typeof T=="string"?{url:T}:T),K.value=!1},gt=T=>{o==null||o.portraitCheckFailImages.splice(T,1)},Ge=T=>{d("selling-points",T)};return g({uploadImg:Ve,addUrl:H,uploadLoading:S,beginnerPrompt:Ce}),(T,X)=>{var Gt,jt,$t,Ht,ta,ea,ft,wt,Vt,He,Ue,ut;const Ee=Wt,Ye=ga,Me=W0,D=Lt,Ae=$x,We=Sa,ot=ca,it=Xn,qt=Bt;return l(),f("div",{class:"flex pl-5px",onDragover:X[13]||(X[13]=Be(()=>{},["stop","prevent"])),onDrop:Be(ge,["stop","prevent"])},[e(O)=="1"&&(e(o).batchUploadImgUrls.length||(jt=(Gt=e(o))==null?void 0:Gt.portraitCheckFailImages)!=null&&jt.length)?(l(),f("div",I4,[y(e(du),{"item-key":"index",modelValue:e(o).batchUploadImgUrls,"onUpdate:modelValue":X[6]||(X[6]=At=>e(o).batchUploadImgUrls=At),animation:"200",class:"flex cursor-grab active:cursor-grabbing"},{item:P(({element:At,index:Ut})=>[(l(),f("div",{class:"draggable-item",key:Ut},[y(si,{element:At,index:Ut,"custom-purpose":e(w),isVisibleSameStyle:e(V),"onUpdate:isVisibleSameStyle":X[3]||(X[3]=Et=>Fe(V)?V.value=Et:null),"image-mapping":e(o).imageMapping,onSelect:Xe,"onUpdate:customPurpose":X[4]||(X[4]=Et=>w.value=Et),onOpenChange:oe,onMaterialClick:be,onAddCustom:ne,onOnDelete:Et=>fe(Ut),styleStr:u.styleStr,purposeStyle:u.purposeStyle,showClose:u.showClose,onMaterialReference:X[5
14]||(X[5]=Et=>d("material-reference",Et)),isGeneratePromptForm:u.isGeneratePromptForm,drawerVisible:u.drawerVisible,showOperationBtn:u.showOperationBtn},{"img-item":P(({url:Et,index:Ot})=>{var zt,sa,ue,ke,et;return[y($a,{url:Et,showDelete:u.showDelete,showSameStyle:!!(u.showSameStyle&&Et==((sa=(zt=e(o))==null?void 0:zt.ali1688SameStyleImgList)==null?void 0:sa.originalImage)&&((et=(ke=(ue=e(o))==null?void 0:ue.ali1688SameStyleImgList)==null?void 0:ke.list)!=null&&et.length)),onOnPreview:lt=>re(e(o).batchUploadImgUrls,Ot),onOnDelete:lt=>fe(Ot),onOnSameStyle:X[0]||(X[0]=lt=>V.value=!0),isVisibleSameStyle:e(V),"onUpdate:isVisibleSameStyle":X[1]||(X[1]=lt=>Fe(V)?V.value=lt:null),onSellingPoints:Ge,onLoading:X[2]||(X[2]=lt=>d("loading",lt)),style:Nt(u.imgStyle),isGeneratePromptForm:u.isGeneratePromptForm,onGetProductSellingPoints:Se,drawerVisible:u.drawerVisible},null,8,["url","showDelete","showSameStyle","onOnPreview","onOnDelete","isVisibleSameStyle","style","isGeneratePromptForm","drawerVisible"])]}),_:2},1032,["element","index","custom-purpose","isVisibleSameStyle","image-mapping","onOnDelete","styleStr","purposeStyle","showClose","isGeneratePromptForm","drawerVisible","showOperationBtn"])]))]),_:1},8,["modelValue"]),(Ht=($t=e(o))==null?void 0:$t.portraitCheckFailImages)!=null&&Ht.length?(l(),ve(Gu,{key:0,images:(ta=e(o))==null?void 0:ta.portraitCheckFailImages,onDelete:gt},null,8,["images"])):he("",!0)])):he("",!0),e(O)=="2"&&((ea=e(o))!=null&&ea.videoFileInfo)?(l(),f("div",C4,[t("div",null,[t("div",k4,[t("div",w4,[X[14]||(X[14]=t("div",{class:"mr-8px"},[t("img",{src:ng,alt:""})],-1)),t("div",null,[t("div",P4,r(e(nt)),1),t("div",M4,"Excel-"+r($e((wt=(ft=e(o))==null?void 0:ft.videoFileInfo)==null?void 0:wt.fileSize)),1)])]),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:Be(at,["stop"])})])])])):he("",!0),e(O)=="1"&&(e(o).batchUploadImgUrls.length+((He=(Vt=e(o))==null?void 0:Vt.portraitCheckFailImages)==null?void 0:He.length)<e($)||e(S))||e(O)=="2"&&!((Ue=e(o))!=null&&Ue.videoFileInfo)?(l(),f(we,{key:2},[!e(o).isFirstFrame||((ut=e(o).batchUploadImgUrls)==null?void 0:ut.length)<e(o).firstFrameInfo.needFirstFrameList.length||e(S)?(l(),ve(qt,{key:0,placement:"top",open:e(K),"onUpdate:open":X[12]||(X[12]=At=>Fe(K)?K.value=At:null),trigger:"click",onOpenChange:oe,overlayClassName:"video-batch-generate-popover"},{content:P(()=>{var At,Ut,Et;return[t("div",S4,[t("div",$4,[t("div",{class:Qe([{active:u.showBatch&&e(O)=="1"," w-170px":u.showBatch," w-340px":!u.showBatch},"h-32px rounded-4px text-center line-height-32px cursor-pointer flex items-center justify-center"]),onClick:X[7]||(X[7]=Ot=>J("1"))},[X[15]||(X[15]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(_)("qinghu-ai.video-batch-generate.797009-0")),1)],2),u.showBatch?(l(),f("div",{key:0,class:Qe([{active:e(O)=="2"},"w-170px h-32px rounded-4px text-center line-height-32px cursor-pointer flex items-center justify-center"]),onClick:X[8]||(X[8]=Ot=>J("2"))},[X[16]||(X[16]=t("img",{src:on,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(_)("qinghu-ai.video-batch-generate.797009-1")),1)],2)):he("",!0)]),e(O)=="1"?(l(),f("div",T4,[y(Ye,{ref_key:"uploadRef",ref:ae,value:e(q),"onUpdate:value":X[9]||(X[9]=Ot=>Fe(q)?q.value=Ot:null),name:"coverImage",temp:!1,multiple:e($)>1,showUploadList:!1,maxCount:e($),enforceMaxCount:!0,size:10*1024*1024,"min-image-side":e(U)?0:e(Kn),"reference-rules":e(U),uploadBizType:"COMMON_IMAGE",onStartUploading:Q,onEndUploading:ie,onSuccess:Re,onCheckError:pt,onLoading:X[10]||(X[10]=Ot=>S.value=Ot),class:"video-batch-generate-upload",activeTabKey:e(O),validateWH:!1,mimeType:u.mimeType,returnOriginalWhenLarger:u.returnOriginalWhenLarger},{default:P(()=>[t("div",A4,[e(S)?(l(),f("div",U4,[y(Ee),t("div",null,r(e(_)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",L4,[t("div",E4,[e(O)=="1"?(l(),f("img",q4)):(l(),f("img",D4))]),e(o).isFirstFrame?(l(),f("div",N4,r(_e()),1)):(l(),f("div",O4,r(e(O)=="1"?e(_)("qinghu-ai.video-batch-generate.797009-3"):e(_)("qinghu-ai.video-batch-generate.797009-4")),1)),t("div",R4,r(e(j).maxFileSize),
141),t("div",F4,r(e(j).formats),1),e(o).isFirstFrame?he("",!0):(l(),f("div",G4,r(e(j).maxCount),1)),e(B)?he("",!0):(l(),f("div",V4,r(e(_)("qinghu-ai.video-batch-generate.797009-9")),1))]))])]),_:1},8,["value","multiple","maxCount","min-image-side","reference-rules","activeTabKey","mimeType","returnOriginalWhenLarger"])])):he("",!0),e(O)=="2"?(l(),f("div",z4,[e(le)?(l(),f("div",B4,[t("div",K4,r(e(_)("components-qinghu-ai.video-batch-generate.930519-109")),1),t("div",W4,r(e(_)("qinghu-ai.video-batch-generate.797009-11")),1),t("div",null,[t("img",{src:(At=e(E))!=null&&At.beforeWeChatQrUrl?(Ut=e(E))==null?void 0:Ut.beforeWeChatQrUrl:(Et=e(E))==null?void 0:Et.weChatQrUrl,alt:"",class:"w-108px h-108px"},null,8,j4)])])):(l(),f(we,{key:1},[t("div",H4,[y(Me,{message:e(_)("qinghu-ai.video-batch-generate.875708-0"),type:"warning","show-icon":"",class:Qe([e(m)=="en"?"text-[12px]!":"text-[14px]!"]),style:{"font-size":"12px","margin-right":"6px"}},null,8,["message","class"]),t("a",{href:e(ce),target:"_blank",rel:"noopener noreferrer"},[y(D,{type:"primary",class:Qe([e(m)=="en"?"text-[12px]!":"text-[14px]!"])},{default:P(()=>[De(r(e(_)("qinghu-ai.video-batch-generate.797009-13")),1)]),_:1},8,["class"])],8,J4)]),t("div",Y4,[y(Ae,{class:"excel-upload-box",onParsed:ye},{default:P(()=>[e(S)?(l(),ve(Ee,{key:0})):(l(),f("div",Q4,[X[17]||(X[17]=t("img",{src:on,alt:"",class:"w-28px h-28px"},null,-1)),t("div",X4,r(e(_)("components-qinghu-ai.video-batch-generate.930519-110")),1)]))]),_:1})])],64))])):he("",!0),e(K)?(l(),ve(We,{key:2,ref_key:"historyImageRef",ref:L,onClickItem:te},null,512)):he("",!0),t("div",Z4,[t("div",null,r(e(_)("components-qinghu-ai.video-batch-generate.738063-221")),1),y(ot,null,{title:P(()=>[De(r(e(_)("components-qinghu-ai.video-batch-generate.738063-222")),1)]),default:P(()=>[y(e(pa),{class:"ml-6px mr-10px color-[rgba(61,61,61,0.60)]"})]),_:1}),y(it,{onChange:Te,checked:e(o).imageRecognitionChecked,"onUpdate:checked":X[11]||(X[11]=Ot=>e(o).imageRecognitionChecked=Ot)},null,8,["checked"])])])]}),default:P(()=>[t("div",{class:"video-batch-generate",style:Nt(u.uploadStyle)},[e(S)?(l(),f("div",a7,[y(Ee,{size:"small"}),t("div",n7,r(e(_)("qinghu-ai.video-batch-generate.797009-14")),1)])):(l(),f(we,{key:0},[X[18]||(X[18]=t("img",{src:xa,alt:"",class:"w-16px h-16px"},null,-1)),e(o).isFirstFrame?(l(),f(we,{key:0},[e(k)?(l(),f("div",t7,r(e(_)("components-qinghu-ai.video-batch-generate.738063-223")),1)):(l(),f("div",e7,r(e(_)("qinghu-ai.long-image-material.139562-33")),1))],64)):he("",!0)],64))],4)]),_:1},8,["open"])):he("",!0)],64)):he("",!0)],32)}}},Vu=It(o7,[["__scopeId","data-v-a896bb45"]]),s7={class:"media-reference-item material-thumb"},l7=["src"],i7={key:1,class:"media-reference-play"},r7=["src"],c7={class:"media-reference-body"},u7=["title"],d7=["title"],p7={class:"media-reference-actions"},m7={class:"media-reference-tip"},g7={class:"media-reference-tip-title"},f7={class:"media-reference-tip-desc"},v7=["src"],h7=Dt({__name:"media-reference-item",props:{item:{},index:{},mediaType:{default:"audio"}},emits:["reference","delete"],setup(u,{emit:g}){const{t:i}=mt(),c=u,o=g,x=F(()=>c.mediaType==="video"),_=h(!1),m=h(null),p=F(()=>c.item.url),d=F(()=>c.item.fileName),R=F(()=>[c.item.duration,c.item.fileSizeText].filter(Boolean).join(" ")),U=()=>{o("reference",c.item)},G=()=>{o("delete",c.index,c.item)},a=()=>{!x.value||!p.value||(_.value=!0)},E=()=>{m.value&&(m.value.pause(),m.value.currentTime=0)};return(z,q)=>{const S=Bt,O=Zt;return l(),f("div",s7,[t("div",{class:Qe(["media-reference-preview",{"media-reference-preview--video":e(x)}]),onClick:Be(a,["stop"])},[e(x)?(l(),f("video",{key:0,src:e(p),class:"media-reference-video",muted:"",preload:"metadata"},null,8,l7)):he("",!0),e(x)?(l(),f("div",i7,[y(e(pu),{class:"media-reference-play-icon"})])):(l(),f("img",{key:2,src:e(Vl),class:"media-reference-audio-icon",alt:""},null,8,r7))],2),t("div",c7,[t("div",{class:"media-reference-name",title:e(d)},r(e(d)),9,u7),t("div",{class:"media-reference-meta",title:e(R)},r(e(R)),9,d7),t("div",p7,[y(S,{placement:"top",overlayClassName:"material-ref-popover"},{content:P(()=>[t("div",m7,[t("div",g7,r(e(i)("components-qinghu-ai.media-reference-item.446330-48")),1),t("div",f7,r(e(i)("components-qinghu-ai.media-reference-item.446330-49"))+r(e(x)?e(i)("task-monitor.uploadVideo.059106-5"):e(i)("components-qinghu-ai.media-reference-item.446330-50"))+"ã",1)])]),default:P(()=>[t("div",{class:"material-ref-btn",onClick:Be(U,["stop"])},[...q[1]||(q[1]=[t("span",{class:"at-icon"},"@",-1)])])]),_:1})])]),t("img",{src:Ca,alt:"",class:"media-reference-close close-btn",onClick:Be(G,["stop"])}),e(x)?(l(),ve(O,{key:0,open:e(_),"onUpdate:open":q[0]||(q[0]=N=>Fe(_)?_.value=N:null),title:e(d),width:860,footer:null,centered:"",destroyOnClose:"",onCancel:E},{default:P(()=>
14[t("video",{ref_key:"previewVideoRef",ref:m,src:e(p),controls:"",autoplay:"",class:"media-reference-modal-video"},null,8,v7)]),_:1},8,["open","title"])):he("",!0)])}}}),zu=It(h7,[["__scopeId","data-v-20dbccb5"]]),_7={class:"video-generate-upload-wrap"},y7={key:0,class:"video-generate-list"},x7={key:0,src:au,alt:"",class:"w-16px h-16px"},b7={key:1,class:"text-center"},I7={class:"text-10px line-height-14px"},C7=2e3,k7=60,w7={__name:"video-generate-upload",props:{rules:{type:Object,default:()=>({})},uploadStyle:{type:String,default:"width:60px;height:60px;margin-top: 8px;"}},emits:["success","startUploading","endUploading","video-reference","video-deleted"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=u,x=i,_=oa(),m=bt(),p=F(()=>Oc(o.rules)),d=F(()=>og(p.value)),R=F(()=>p.value.formats.map(te=>`.${te}`).join(",")),U=h(!1);let G=!1,a=0,E=0,z=Promise.resolve();const q=F(()=>m.batchUploadVideoUrls||[]),S=(te="")=>{const Q=te.split(".").pop();return Q&&Q!==te?Q.toLowerCase():""},O=te=>te?te<1024?`${te}B`:te<1024*1024?`${(te/1024).toFixed(2)}KB`:`${(te/1024/1024).toFixed(2)}MB`:"",N=te=>{const Q=Number(te||0);return!Number.isFinite(Q)||Q<=0?"":`${Number(Q.toFixed(1))}s`},ae=te=>new Promise((Q,ie)=>{const _e=document.createElement("video"),Re=URL.createObjectURL(te);let ye=null,me=null;const re=()=>{var fe;ye&&clearTimeout(ye),_e.onloadedmetadata=null,_e.onerror=null,_e.removeAttribute("src"),(fe=me==null?void 0:me.getTracks)==null||fe.call(me).forEach(Oe=>Oe.stop()),URL.revokeObjectURL(Re)};_e.preload="metadata",_e.onloadedmetadata=()=>{var Ve,H,st,ge;me=(Ve=_e.captureStream)==null?void 0:Ve.call(_e);const fe=(ge=(st=(H=me==null?void 0:me.getVideoTracks)==null?void 0:H.call(me)[0])==null?void 0:st.getSettings)==null?void 0:ge.call(st).frameRate,Oe={duration:_e.duration,width:_e.videoWidth||0,height:_e.videoHeight||0,aspectRatio:_e.videoWidth&&_e.videoHeight?_e.videoWidth/_e.videoHeight:0,fps:Number.isFinite(fe)?fe:null};re(),Number.isFinite(Oe.duration)&&Oe.duration>0?Q(Oe):ie(new Error("Invalid video metadata"))},_e.onerror=()=>{re(),ie(new Error("Failed to load video metadata"))},ye=setTimeout(()=>{re(),ie(new Error("Video metadata load timeout"))},1e4),_e.src=Re}),L=te=>{const Q=p.value,ie=S(te.name);return Q.formats.includes(ie)?te.size>d.value*1024*1024?(_.error(c("components-qinghu-ai.video-generate-upload.446330-56",[d.value])),qa.LIST_IGNORE):!0:(_.error(c("video-reference.rules.formats",[Q.formats.join(", ")])),qa.LIST_IGNORE)},K=te=>{U.value=te,x(te?"startUploading":"endUploading")},de=(te,Q,ie)=>{const _e={id:Q,url:Q,fileName:te.name,fileSize:te.size,fileSizeText:O(te.size),duration:N(ie.duration),durationSeconds:ie.duration,width:ie.width,height:ie.height,aspectRatio:ie.aspectRatio,fps:ie.fps,pixelCount:ie.width*ie.height,dataType:"video"},Re=[...q.value,_e].slice(0,p.value.maxVideoCount);m.batchUploadVideoUrls=Re,x("success",Re)},W=te=>{var Q;return(Q=te==null?void 0:te.payload)!=null?Q:te==null?void 0:te.data},$=te=>{const Q=W(te);return typeof Q=="string"?Q:(Q==null?void 0:Q.task_id)||(Q==null?void 0:Q.taskId)||(te==null?void 0:te.task_id)||(te==null?void 0:te.taskId)||""},Y=te=>{var _e,Re;const Q=W(te);if(typeof Q=="string"&&/^https?:\/\//i.test(Q))return Q;const ie=(Re=(_e=Q==null?void 0:Q.result)!=null?_e:Q==null?void 0:Q.data)!=null?Re:Q;return typeof ie=="string"&&/^https?:\/\//i.test(ie)?ie:(ie==null?void 0:ie.url)||(ie==null?void 0:ie.video_url)||(ie==null?void 0:ie.videoUrl)||(ie==null?void 0:ie.result_url)||(ie==null?void 0:ie.resultUrl)||(ie==null?void 0:ie.output_url)||(ie==null?void 0:ie.outputUrl)||""},j=te=>{const Q=W(te);return String((Q==null?void 0:Q.status)||(Q==null?void 0:Q.task_status)||(Q==null?void 0:Q.taskStatus)||(Q==null?void 0:Q.state)||(te==null?void 0:te.status)||"").toLowerCase()},V=te=>new Promise(Q=>setTimeout(Q,te)),w=te=>G||te!==a,I=async(te,Q)=>{for(let ie=0;ie<k7;ie+=1){if(w(Q))return"";const _e=await ig({task_id:te});if((_e==null?void 0:_e.code)!==void 0&&_e.code!==200&&!(_e!=null&&_e.success))throw new Error((_e==null?void 0:_e.message)||(_e==null?void 0:_e.msg)||"Video cropping query failed");const Re=Y(_e);if(Re)return Re;const ye=j(_e);if(["failed","failure","error","cancelled","canceled"].includes(ye))throw new Error((_e==null?void 0:_e.message)||(_e==null?void 0:_e.msg)||"Video cropping failed");
14await V(C7)}throw new Error("Video cropping timed out")},k=async(te,Q,ie)=>{const _e=await lg({task_type:"limit_duration",url:te,params:{duration:Number(Q)-.1,cos_path:"ai_workflow"}});if((_e==null?void 0:_e.code)!==void 0&&_e.code!==200&&!(_e!=null&&_e.success))throw new Error((_e==null?void 0:_e.message)||(_e==null?void 0:_e.msg)||"Video cropping task creation failed");const Re=$(_e);if(!Re)throw new Error("Video cropping task ID is missing");return I(Re,ie)},B=te=>{const Q=p.value,[ie,_e]=Q.singleDurationRange,Re=te.duration>_e&&te.duration<=_e+1;if(te.duration<ie||te.duration>_e+1)return _.error(c("video-reference.rules.duration-range",[ie,_e])),null;if(Q.dimensionRange){const[Ve,H]=Q.dimensionRange;if(te.width<Ve||te.width>H||te.height<Ve||te.height>H)return _.error(c("video-reference.rules.dimension-range",[Ve,H])),null}const ye=te.width*te.height;if(Q.pixelRange&&(ye<Q.pixelRange[0]||ye>Q.pixelRange[1]))return _.error(c("video-reference.rules.pixel-range",Q.pixelRange)),null;const me=Q.resolutions.map(Ve=>Number.parseInt(Ve,10)).filter(Number.isFinite),re=Math.min(te.width,te.height);if(me.length&&!me.includes(re))return _.error(c("video-reference.rules.resolutions",[Q.resolutions.join(", ")])),null;if(Q.aspectRatioRange&&(te.aspectRatio<Q.aspectRatioRange[0]||te.aspectRatio>Q.aspectRatioRange[1]))return _.error(c("video-reference.rules.aspect-ratio-range",Q.aspectRatioRange)),null;if(Q.fpsRange&&Number.isFinite(te.fps)&&(te.fps<Q.fpsRange[0]||te.fps>Q.fpsRange[1]))return _.error(c("video-reference.rules.fps-range",Q.fpsRange)),null;const fe=Re?_e:te.duration;return sg(q.value)+fe>Q.totalDurationLimit?(_.error(c("video-reference.rules.total-duration",[Q.totalDurationLimit])),null):{shouldCrop:Re,finalVideoInfo:Re?{...te,duration:_e}:te}},be=async({file:te,onSuccess:Q,onError:ie},_e)=>{if(w(_e))return;if(q.value.length>=p.value.maxVideoCount){_.warning(c("video-reference.rules.max-count",[p.value.maxVideoCount])),ie==null||ie(new Error("Video reference count exceeded"));return}let Re="metadata";try{const ye=await ae(te);if(w(_e))return;const me=B(ye);if(!me){ie==null||ie(new Error("Video reference validation failed"));return}const re=new FormData;re.append("file",te),re.append("uploadBizType","COMMON_VIDEO"),Re="upload";const fe=await Va(re);if(w(_e))return;if((fe==null?void 0:fe.code)===200||fe!=null&&fe.success){const Oe=fe.payload||fe.data||"";if(typeof Oe=="string"&&Oe){const Ve=me.shouldCrop?await k(Oe,me.finalVideoInfo.duration,_e):Oe;if(!Ve||w(_e))return;const H=B(me.finalVideoInfo);if(!H||q.value.length>=p.value.maxVideoCount){ie==null||ie(new Error("Video reference list changed during upload"));return}de(te,Ve,H.finalVideoInfo),Q==null||Q(fe,te),_.success(c("components-qinghu-ai.video-generate-upload.446330-57"))}else ie==null||ie(fe),_.error((fe==null?void 0:fe.message)||c("my-knowledge-base.publish-knowledge-base.9326327-19"))}else ie==null||ie(fe),_.error((fe==null?void 0:fe.message)||(fe==null?void 0:fe.msg)||c("my-knowledge-base.publish-knowledge-base.9326327-19"))}catch(ye){if(w(_e))return;ie==null||ie(ye),_.error(c(Re==="metadata"?"components-qinghu-ai.video-generate-upload.930519-113":"my-knowledge-base.publish-knowledge-base.9326327-19"))}},ne=te=>{const Q=a;E+=1,E===1&&K(!0),z=z.then(()=>be(te,Q)).catch(ie=>{w(Q)}).finally(()=>{E=Math.max(0,E-1),E===0&&K(!1)})},le=async te=>{q.value.length+E>=p.value.maxVideoCount||L(te)===!0&&ne({file:te})},ce=te=>{x("video-reference",te)},J=(te,Q)=>{const ie=Q||q.value[te],_e=q.value.filter((Re,ye)=>ye!==te);m.batchUploadVideoUrls=_e,x("video-deleted",ie),x("success",_e)},oe=()=>{a+=1,m.batchUploadVideoUrls=[]};return fa(()=>{G=!0,a+=1,U.value&&K(!1)}),g({uploadLoading:U,uploadVideo:le,clearVideo:oe}),(te,Q)=>{const ie=Wt,_e=qa;return l(),f("div",_7,[e(q).length?(l(),f("div",y7,[(l(!0),f(we,null,Je(e(q),(Re,ye)=>(l(),ve(zu,{key:Re.url||ye,item:Re,index:ye,"media-type":"video",onReference:ce,onDelete:J},null,8,["item","index"]))),128))])):he("",!0),e(q).length<e(p).maxVideoCount?(l(),ve(_e,{key:1,name:"video",accept:e(R),multiple:e(p).maxVideoCount>1,showUploadList:!1,beforeUpload:L,customRequest:ne},{default:P(()=>[t("div",{class:"video-generate-upload-btn",style:Nt(u.uploadStyle)},[e(U)?(l(),f("div",b7,[y(ie,{size:"small"}),t("div",I7,r(e(c)("qinghu-ai.batch-upload-img.708047-0")),1)])):(l(),f("img",x7))],4)]),_:1},8,["accept","multiple"])):he("",!0)])}}},P7=It(w7,[["__scopeId","data-v-f296382b"]]),qs=u=>["SKU_GENERATION","LONG_IMAGE_GENERATION","FREE_GENERATION"].includes(u),M7=(u=[])=>{const g=u.filter(i=>i&&i.frontHide!==1&&!qs(i.value));return g.find(i=>i.value==="EXPERTS_GENERATION")||g.find(i=>i.defaultModel)||g[0]},Ol=async u=>{const g=M7(u.imageOptions||[]);if(!g||!qs(u.mainImageChatMode))return;u.mainImageChatMode=g.value,u.imageGenerateParams.currentImageActiveId=g.id,u.imageGenerateParams.isFree=g.isFree||!1;const{setGenerateMode:i}=bu();await i({mainImageChatMode:u.mainImageChatMode})},S7=(u=[])=>{const g=u.filter(i=>i&&i.frontHide!==1&&!qs(i.value));return g.find(i=>i.tabSelectModel)||g.find(i=>i.defaultModel)||g[0]},Bu=u=>{const g=S7(u.posterImageOptions||[]);!g||!qs(u.longImageChatMode)||(u.longImageChatMode=g.value)},$7={style:{width:"700px"}},T7={class:"flex items-center"},A7={class:"flex justify-end mb-10px"},U7={class:"prompt-generation-popover"},L7={class:"text-[#000]"},E7={key:1,class:"w-full h-full flex justify-center items-center"},q7={class:"flex gap-8px justify-center"},D7={class:"h-full px-14px py-24px relative group"},O7={class:"flex items-center h-12px"},N7={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},R7={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10"},F7={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},G7=Dt({__name:"prompt-generation",props:{isChatPinned:{type:Boolean,default:!1}},emits:["updatePrompt","submit"],setup(u,{expose:g,emit:i}){const c=i,{t:o,locale:x}=mt(),_=Kt(),m=wa(),p=oa(),d=bt(),R=h(!1),U=h(!1),G=h(),a=h(),E=h({images:[],imageList:[],pointDescription:"",productName:"",promptType:"",language:""}),z=h(null),q=h("");Ne(()=>U.value,V=>{var w,I;if(V&&(E.value={images:[],imageList:[],pointDescription:"",productName:"",promptType:""},(I=(w=d.longImageParams)==null?void 0:w.materialImg)!=null&&I.length)){const k=d.longImageParams.materialImg.filter(B=>B.fnType==="material").map(B=>B.url);E.value.imageList=k,E.value.images=[],setTimeout(()=>{tt(()=>{var B;(B=a==null?void 0:a.value)==null||B.updateImg(),de(),W()})},100)}});const S=V=>{var w;V&&document.querySelector(".qinghu-link-pix-content")&&((w=document.querySelector(".qinghu-link-pix-content"))==null||w.scrollTo({top:0,behavior:"smooth"})),tt(()=>{U.value=V}
14)},O=h(!1),N=async()=>{var V;O.value=!0;try{await G.value.validate(),E.value.images=(V=$())!=null&&V.file?[$().file]:[],d.aiMessageType==="LONGIMAGE"?E.value.promptType="DETAILS_DEFAULT":d.aiMessageType==="POSTERIMAGE"?E.value.promptType="POSTER_DEFAULT":d.aiMessageType==="SOCIALMEDIA"&&(E.value.promptType="MEDIA_DEFAULT"),S(!1),c("submit"),await L()}catch{}finally{O.value=!1}},ae=V=>{if(V&&typeof V=="object"&&V.url){const w={url:V.url,filename:V.filename||"",tag:V.tag||"",width:V.width||0,height:V.height||0,aspectRatio:V.aspectRatio||0};d.longImageParams.materialImg.findIndex(k=>k.fnType==="material"&&k.url===V.url)===-1&&d.longImageParams.materialImg.push({...w,fnType:"material"}),E.value.imageList=d.longImageParams.materialImg.filter(k=>k.fnType==="material").map(k=>k.url)}else if(Array.isArray(V)){let w=d.longImageParams.materialImg.filter(k=>k.fnType==="material"&&V.includes(k.url)),I=d.longImageParams.materialImg.filter(k=>k.fnType!="material");d.longImageParams.materialImg=[...I,...w]}tt(()=>{de(),W()})},L=async()=>{z.value=new AbortController,q.value="",d.aiMessageType==="LONGIMAGE"&&Bu(d),c("updatePrompt",{prompt:q.value,status:"start"}),await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":x.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({...E.value,language:o("components.VideoTranslationParams.738063-22")}),signal:z.value.signal,openWhenHidden:!0,onmessage(V){try{const w=JSON.parse(V.data),{role:I,type:k,data:B}=w||{};if(k==="chat_number_over")return z.value.abort(),z.value=null,m.confirm({title:o("qinghu-ai.prompt-generation.616079-3"),icon:St(ra),content:B,cancelText:o("qinghu-ai.prompt-generation.616079-4"),okText:o("qinghu-ai.prompt-generation.616079-5"),keyboard:!1,maskClosable:!1,onOk(){_.push("/product?product=vip")}});I==="assistant"&&k==="answer"&&typeof B=="string"&&(q.value+=B,c("updatePrompt",{prompt:q.value,status:"updating"}))}catch{}},async onopen(V){if(V.status&&["401","500","600"].includes(String(V.status)))if(V.status==401){p.error(o("qinghu-ai.prompt-generation.616079-8"));let w=setTimeout(()=>{clearTimeout(w),window.location.reload()},600)}else(V.status==500||V.status==600)&&p.error(o("qinghu-ai.prompt-generation.616079-9"));return Promise.resolve()},onerror(V){p.error(o("qinghu-ai.prompt-generation.616079-11")),z.value.abort(),z.value=null},async onclose(){O.value=!1,c("updatePrompt",{prompt:q.value,status:"finish"})}})};Ne(()=>E.value.imageList,async()=>{await tt(),de(),W()},{deep:!0,immediate:!0});function K(V){document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item").forEach(w=>{w.classList.remove("selected")}),V.target.classList.add("selected")}function de(){document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item-container .ant-upload-list-item").forEach((w,I)=>{w.addEventListener("click",K)})}function W(){const V=document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item");E.value.imageList.length>0&&V[0]&&(document.querySelector(".prompt-generation-popover .ant-upload-list-item.selected")||V[0].classList.add("selected"))}function $(){const V=document.querySelector(".prompt-generation-popover .ant-upload-list-item.selected");if(!V)return null;const w=document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item-container"),I=V.closest(".prompt-generation-popover .ant-upload-list-item-container");if(!I)return null;const k=Array.from(w).indexOf(I);return{file:E.value.imageList[k],index:k}}const Y=Jl(async()=>{O.value=!0;try{await G.value.validate();let V=await Gl({imageList:E.value.imageList,pointDescription:E.value.pointDescription,productName:E.value.productName});V.success?p.success(o("strategy-generator.index.033017-14")):p.error(V.message||o("utils.request.932181-2"))}catch{}finally{O.value=!1}},1e3),j=V=>{E.value.productName=V.productName||"",E.value.pointDescription=V.pointDescription||"",E.value.imageList=V.imageList||[],tt(()=>{var w;(w=a.value)==null||w.updateImg(),de(),W()})};return Rt(()=>{de()}),g({ChangePopover:S}),(V,w)=>{const I=ni,k=Wt,B=ca,be=Ql,ne=ba,le=Oa,ce=Yl,J=Lt,oe=Zt;return l(),f("div",null,[y(oe,{title:e(o)("qinghu-ai.prompt-generation.873104-0"),class:"prompt-generation-modal",width:764,footer
14:null,getPopupContainer:te=>te.parentNode,open:e(U),"onUpdate:open":w[4]||(w[4]=te=>Fe(U)?U.value=te:null)},{default:P(()=>[t("div",$7,[t("div",T7,[y(I,{hideIcon:!1,class:"px-0! mb-10px","no-bg":"",hideUpdateBtn:"",tip:`${e(o)("qinghu-ai.video-script.120875-22")}${e(o)("qinghu-ai.video-script.120875-23")}`},null,8,["tip"]),t("div",A7,[y(ai,{onSelect:j})])]),y(ce,{model:e(E),ref_key:"formRef",ref:G,layout:"vertical","label-align":"left",class:"w-full"},{default:P(()=>[y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-17")+e(o)("qinghu-ai.prompt-generation.616079-18"),name:"productName",class:"mb-12px!"},{default:P(()=>[t("div",U7,[y(ga,{ref_key:"uploadRef",ref:a,value:e(E).imageList,"onUpdate:value":w[0]||(w[0]=te=>e(E).imageList=te),name:"coverImage",temp:!1,multiple:!0,showUploadList:!0,maxCount:10,isSeedeUpload:!0,isNotRemoveFileList:!0,activeTabKey:"2",size:5*1024*1024,onLoading:w[1]||(w[1]=te=>{R.value=te}),onSuccess:ae},{default:P(()=>[y(B,{color:"rgba(255,255,255)"},{title:P(()=>[t("div",L7,[t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-19"))+"("+r(e(o)("qinghu-ai.prompt-generation.616079-20"))+")"+r(e(o)("qinghu-ai.prompt-generation.616079-21")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-22"))+"(px)>14px",1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-23")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-24")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-25")),1)])]),default:P(()=>[e(R)?(l(),ve(k,{key:0})):(l(),f("div",E7,[...w[7]||(w[7]=[t("img",{src:xa,alt:"",class:"w-16px h-16px"},null,-1)])]))]),_:1})]),_:1},8,["value"])])]),_:1},8,["label"]),y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-26"),name:"productName",required:"",class:"mb-12px!",rules:[{required:!0,message:e(o)("qinghu-ai.prompt-generation.616079-27")}]},{default:P(()=>[y(ne,{value:e(E).productName,"onUpdate:value":w[2]||(w[2]=te=>e(E).productName=te),placeholder:e(o)("qinghu-ai.prompt-generation.616079-28")},null,8,["value","placeholder"])]),_:1},8,["label","rules"]),y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-29"),name:"pointDescription",class:"mb-12px!"},{default:P(()=>[y(le,{value:e(E).pointDescription,"onUpdate:value":w[3]||(w[3]=te=>e(E).pointDescription=te),rows:3},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"]),t("div",q7,[y(J,{class:"w-120px",type:"primary",loading:e(O),onClick:e(Y),ghost:""},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script-form.964932-0")),1)]),_:1},8,["loading","onClick"]),y(J,{class:"w-120px",type:"primary",loading:e(O),onClick:N},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script.120875-23")),1)]),_:1},8,["loading"])])])]),_:1},8,["title","getPopupContainer","open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:w[6]||(w[6]=Be(te=>S(!0),["stop"]))},[w[10]||(w[10]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",F7,r(e(o)("qinghu-ai.video-script.712132-0")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:w[5]||(w[5]=te=>S(!0))},[t("div",D7,[t("div",O7,[w[8]||(w[8]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",N7,r(e(o)("qinghu-ai.prompt-generation.873104-0")),1)]),t("div",R7,r(e(o)("qinghu-ai.prompt-generation.873104-1")),1),w[9]||(w[9]=t("img",{src:nu,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),li=It(G7,[["__scopeId","data-v-d0d5000f"]]),V7={class:"p-5"},z7={class:"flex gap-1 mb-8px"},B7={class:"text-slate-800 text-sm font-semibold tracking-tight"},K7={class:"text-slate-500 text-xs leading-relaxed"},W7={class:"grid grid-cols-3 gap-2 mb-4"},j7={class:"text-xs font-medium transition-colors duration-200 block text-slate-600 group-hover/tag:text-slate-700"},H7={class:"space-y-3"},J7={class:"flex items-center gap-2"},Y7={class:"max-w-content h-60px bg-[#F7F7F7] rounded-6px relative cursor-pointer p-6px flex items-center material-thumb group"},Q7={class:"text-14px ml-8px"},X7={__name:"MaterialPopover",props:{item:{type:Object,required:!0},index:{type:Number,required:!0},materialOptions:{type:Array,default:()=>[]},customPurpose:{type:String,default:""}},emits:["material-click","add-custom","delete","preview-image","open-change","update:custom-purpose"],setup(u,{expose:g,emit:i}){const c=u,o=i,x=oa(),{t:_}=mt(),m=bt(),p=h(!1),d=F({get:()=>c.customPurpose,set:q=>{o("update:custom-purpose",q)}}),R=(q,S)=>{o("material-click",q,S)},U=q=>{o("add-custom",q),o("update:custom-purpose","")},G=q=>{o("delete",q)},a=(q,S,O)=>
14{o("preview-image",q,S,O)},E=q=>{o("open-change",q)},z=async q=>{var O,N;if(((O=m.longImageParams)==null?void 0:O.offerId)==q.offerId){m.longImageParams.offerId="",m.longImageParams.imageUrl="",m.longImageParams.sameStyleProductName="",m.longImageParams.sameStyleImageUrl="",x.success(_("qinghu-ai.SameStyleSelector.049509-0"));return}m.longImageParams.offerId=q.offerId,m.longImageParams.sameStyleProductName=q.product_name,m.longImageParams.sameStyleImageUrl=q.imageUrl,m.longImageParams.imageUrl=m.longImageParams.originalImage,x.success(_("qinghu-ai.SameStyleSelector.049509-1")),p.value=!1;const S=await Nc({offerId:q.offerId});if(S.code==0&&S.data&&S.data.length){let ae=((N=S.data[0].productImage)==null?void 0:N.images)||[],L=[];const K=ae.length;K>=4?L=ae.slice(1,4):K===3?L=ae.slice(1,3):K===2?L=[ae[1]]:K===1?L=[ae[0]]:L=[q.imageUrl],m.longImageParams.from1688Images=L}};return g({isVisibleStyle:p}),(q,S)=>{const O=Lt,N=ba,ae=mf,L=Bt;return l(),ve(L,{placement:"top",trigger:"click",onOpenChange:E},{content:P(()=>[t("div",null,[t("div",V7,[t("div",z7,[t("h3",B7,r(e(_)("qinghu-ai.long-image-material.139562-3")),1),t("p",K7,r(e(_)("qinghu-ai.long-image-material.139562-4")),1)]),t("div",W7,[(l(!0),f(we,null,Je(u.materialOptions,(K,de)=>(l(),ve(O,{style:{display:"flex","align-items":"center","justify-content":"center"},key:de,onClick:W=>R(K,u.index)},{default:P(()=>[t("div",{class:"w-2 h-2 rounded-full transition-all duration-200 bg-slate-200 group-hover/tag:bg-slate-300 mr-8px",style:Nt({background:u.item.tag==K.label?"#2E4FFF":"#D8D8D8"})},null,4),t("span",j7,r(K.label),1)]),_:2},1032,["onClick"]))),128))]),t("div",H7,[S[6]||(S[6]=t("div",{class:"flex items-center gap-2 text-xs text-slate-500"},[t("div",{class:"h-px bg-slate-200 flex-1"}),t("span",{class:"px-2"}),t("div",{class:"h-px bg-slate-200 flex-1"})],-1)),t("div",J7,[y(N,{value:e(d),"onUpdate:value":S[0]||(S[0]=K=>Fe(d)?d.value=K:null),type:"text",placeholder:e(_)("qinghu-ai.long-image-material.139562-5"),class:"flex-1 text-sm px-3 py-2.5 border border-slate-200/80 rounded-xl bg-white/60 focus:outline-none focus:border-[#20f6da]/40 focus:bg-white transition-all duration-200 placeholder:text-slate-400"},null,8,["value","placeholder"]),y(O,{disabled:!e(d),class:"px-4 py-2.5 bg-gradient-to-r from-[#20f6da] to-[#86EEBA] text-white text-sm font-medium rounded-xl hover:shadow-lg hover:shadow-[#20f6da]/20 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed hover:scale-105",onClick:S[1]||(S[1]=K=>U(u.index))},{default:P(()=>[De(r(e(_)("qinghu-ai.long-image-material.139562-6")),1)]),_:1},8,["disabled"])])])])])]),default:P(()=>{var K;return[t("div",Y7,[(K=e(m).longImageParams)!=null&&K.originalImage&&u.item.url===e(m).longImageParams.originalImage&&e(m).longImageParams.ali1688SameStyleImgList&&e(m).longImageParams.ali1688SameStyleImgList.length?(l(),ve(L,{key:0,open:e(p),"onUpdate:open":S[3]||(S[3]=de=>Fe(p)?p.value=de:null),overlayClassName:"same_style_popover"},{content:P(()=>[y(ae,{ref:"sameStyleSelectorRef",images:e(m).longImageParams.ali1688SameStyleImgList,onSelect:z},null,8,["images"])]),default:P(()=>[t("div",null,[y($a,{url:u.item.url,showDelete:!1,onOnPreview:S[2]||(S[2]=de=>a(u.item,u.index))},null,8,["url"])])]),_:1},8,["open"])):(l(),ve($a,{key:1,url:u.item.url,showDelete:!1,onOnPreview:S[4]||(S[4]=de=>a(u.item,u.index))},null,8,["url"])),t("span",Q7,r(e(_)("qinghu-ai.long-image-material.139562-7"))+r(u.item.tag||e(_)("qinghu-ai.long-image-material.139562-8")),1),y(e(Qt),{class:"w-12px h-12px ml-4px"}),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:S[5]||(S[5]=Be(de=>G(u.index),["stop"]))})])]}),_:1})}}},Z7=It(X7,[["__scopeId","data-v-00661fa6"]]),eb={class:"p-5"},tb={class:"flex gap-1 mb-8px"},ab={class:"text-slate-800 text-sm font-semibold tracking-tight"},nb={class:"text-slate-500 text-xs leading-relaxed"},ob={class:"grid grid-cols-3 gap-2 mb-4"},sb={class:"text-xs font-medium transition-colors duration-200 block text-slate-600 group-hover/tag:text-slate-700"},lb={class:"max-w-content h-60px bg-[#F7F7F7] rounded-6px relative cursor-pointer p-6px flex items-center material-thumb group"},ib={class:"w-48px h-48px relative"},rb=["src"],cb=["onClick"],ub={class:"text-14px ml-8px"},db=["onClick"],pb={__name:"long-image-material",emits:["delete"],setup(u,{emit:g}){const i=bt(),{t:c}=mt(),o=g,x=[{label:c("qinghu-ai.long-image-material.139562-9"),value:"all"},{label:c("qinghu-ai.long-image-material.139562-10"),value:"layout"},{label:c("qinghu-ai.long-image-material.139562-11"),value:"style"},{label:c("qinghu-ai.long-image-material.139562-12"),value:"color"},{label:c("qinghu-ai.long-image-material.139562-13"),value:"texture"},{label:c("qinghu-ai.long-image-material.139562-14"),value:"copy"},{label:c("qinghu-ai.long-image-material.139562-15"),value:"font"}],_=[{label:c("qinghu-ai.long-image-material.139562-16")},{label:c("qinghu-ai.long-image-material.139562-17")},{label:c("qinghu-ai.long-image-material.139562-18")},{label:c("qinghu-ai.long-image-material.139562-19")},{label:c("qinghu-ai.long-image-material.139562-20")},{label:c("qinghu-ai.long-image-material.139562-21")},{label:c("qinghu-ai.long-image-material.139562-22")},{label:c("qinghu-ai.long-image-material.139562-23")},{label:c("qinghu-ai.long-image-material.139562-24")},{label:c("qinghu-ai.long-image-material.139562-25")},{label:c("qinghu-ai.long-image-material.139562-26")},{label:c("qinghu-ai.long-image-material.139562-27")},{label:"Logo"},{label:c("qinghu-ai.long-image-material.139562-28")},{label:c("qinghu-ai.long-image-material.139562-29")},{label:c("qinghu-ai.long-image-material.139562-30")},{label:c("qinghu-ai.long-image-material.139562-31")},{label:c("qinghu-ai.long-image-material.139562-32")}],m=h(""),p=h(null);Ne(()=>i.longImageParams.referenceImg,q=>{},{immediate:!0,deep:!0});const d=async q=>{let S=await qc({url:q});S.code==0&&(i.longImageParams.ali1688SameStyleImgList=S.data,i.longImageParams.ali1688SameStyleImgList&&i.longImageParams.ali1688SameStyleImgList.length&&tt(()=>{const O=i.longImageParams.materialImg;if(O&&O.length){const N=O.findIndex(ae=>ae.url===q);if(N!==-1&&p.value){const ae=Array.isArray(p.value)?p.value[N]:p.value;ae&&(ae.isVisibleStyle=!0)}}}))};Ne(()=>i.longImageParams.originalImage,q=>{q&&i.longImageParams.imageRecognitionChecked&&i.aiMessageType=="LONGIMAGE"&&d(q)},{immediate:!0,deep:!0});const R=(q,S)=>{if(i.longImageParams.materialImg[S].tag==q.label){i.longImageParams.materialImg[S].tag="";return}i.longImageParams.materialImg[S].tag=q.label},U=(q,S)=>{var de;const O=(de=i.longImageParams.materialImg)==null?void 0:de[S];if(!O)return;Array.isArray(O.tags)||(O.tags=[]);const N=q==null?void 0:q.value,ae=x.map(W=>W.value).filter(W=>W!=="all");
14if(N==="all"){ae.every($=>O.tags.includes($))?O.tags=[]:O.tags=[...new Set([...(O.tags||[]).filter($=>$!=="all"),...ae,"all"])];return}const L=O.tags.indexOf(N);if(L>=0?O.tags.splice(L,1):O.tags.push(N),ae.every(W=>O.tags.includes(W)))O.tags.includes("all")||O.tags.push("all");else{const W=O.tags.indexOf("all");W>=0&&O.tags.splice(W,1)}},G=q=>{i.longImageParams.materialImg[q].tag=m.value},a=q=>{const S=i.longImageParams.materialImg[q];S&&(S.url==i.longImageParams.originalImage&&(i.longImageParams.originalImage=""),i.longImageParams.materialImg.splice(q,1),i.longImageParams.materialImg.length===0&&(i.longImageParams.materialImg=[]),o("delete",S.url))},E=async(q,S=0,O)=>{const N=(i.longImageParams.referenceImg||[]).map(K=>K.url||""),ae=(i.longImageParams.materialImg||[]).map(K=>K.url||""),L=[...N,...ae];N&&N.length&&O=="material"&&(S=N.length+S),Ta({options:{toolbar:!0,initialViewIndex:S},images:L})},z=q=>{try{if(typeof window>"u")return;const S=document.querySelector(".qinghu-link-pix-content");if(!S)return;S.style.overflowY=q?"hidden":"auto"}catch{}};return(q,S)=>{var ae,L;const O=Lt,N=Bt;return l(!0),f(we,null,Je((L=(ae=e(i))==null?void 0:ae.longImageParams)==null?void 0:L.materialImg,(K,de)=>(l(),f("div",{key:de,class:"mr-8px mb-8px"},[K.fnType=="reference"?(l(),ve(N,{key:0,placement:"top",trigger:"click",onOpenChange:z},{content:P(()=>[t("div",null,[t("div",eb,[t("div",tb,[t("h3",ab,r(e(c)("qinghu-ai.long-image-material.139562-0")),1),t("p",nb,r(e(c)("qinghu-ai.long-image-material.139562-1")),1)]),t("div",ob,[(l(),f(we,null,Je(x,(W,$)=>y(O,{style:{display:"flex","align-items":"center","justify-content":"center"},key:$,onClick:Y=>U(W,de)},{default:P(()=>[t("div",{class:"w-2 h-2 rounded-full transition-all duration-200 bg-slate-200 group-hover/tag:bg-slate-300 mr-8px",style:Nt({background:K.tags&&K.tags.length&&K.tags.includes(W.value)?"#2E4FFF":"#D8D8D8"})},null,4),t("span",sb,r(W.label),1)]),_:2},1032,["onClick"])),64))])])])]),default:P(()=>[t("div",lb,[t("div",ib,[t("img",{src:K.url,alt:"",class:"w-48px h-48px rounded-6px",style:{"vertical-align":"initial"}},null,8,rb),t("div",{class:"pointer-events-auto w-full h-full max-w-48px max-h-48px bg-[rgba(0,0,0,0.2)] absolute top-0px left-0px cursor-pointer flex justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:Be(W=>E(K,de,"reference"),["stop"])},[y(e(Us),{class:"text-[#ffffff] text-14px"})],8,cb)]),t("span",ub,r(e(c)("qinghu-ai.long-image-material.139562-2")),1),y(e(Qt),{class:"w-12px h-12px ml-4px"}),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:Be(W=>a(de),["stop"])},null,8,db)])]),_:2},1024)):(l(),ve(Z7,{key:1,ref_for:!0,ref_key:"materialPopoverRef",ref:p,item:K,index:de,"material-options":_,"custom-purpose":e(m),onMaterialClick:R,onAddCustom:G,onDelete:a,onPreviewImage:E,onOpenChange:z,"onUpdate:customPurpose":S[0]||(S[0]=W=>m.value=W)},null,8,["item","index","custom-purpose"]))]))),128)}}},mb=It(pb,[["__scopeId","data-v-5ce85f1d"]]);function hc(u){return typeof u=="function"||Object.prototype.toString.call(u)==="[object Object]"&&!j0(u)}const _c="image_upload_count_tips_hidden",yc="image-upload-count-tips-style";let Dn=null;const gb=()=>{if(typeof document>"u"||document.getElementById(yc))return;const u=document.createElement("style");u.id=yc,u.innerHTML=` 15 .image-upload-count-tips-modal .ant-modal-content { 16 padding: 0; 17 border-radius: 4px; 18 box-shadow: 0 10px 30px rgba(17, 24, 39, 0.10); 19 } 20 .image-upload-count-tips-modal .ant-modal-body { 21 padding: 0; 22 } 23 .image-upload-count-tips-modal .ant-modal-confirm-body-wrapper { 24 padding: 0; 25 } 26 .image-upload-count-tips-modal .ant-modal-confirm-body { 27 display: block; 28 } 29 .image-upload-count-tips-modal .ant-modal-confirm-content { 30 max-width: none; 31 margin: 0; 32 } 33 .image-upload-count-tips-modal .ant-modal-confirm-btns { 34 display: none; 35 } 36 .image-upload-count-tips-modal .ant-modal-close { 37 top: 25px; 38 right: 24px; 39 color: #C6C6C6; 40 } 41 .image-upload-count-tips { 42 width: 450px; 43 padding: 15px 25px; 44 position: relative; 45 box-sizing: border-box; 46 border-radius: 4px; 47 } 48 .image-upload-count-tips__header { 49 display: flex; 50 align-items: center; 51 padding-right: 44px; 52 } 53 .image-upload-count-tips__icon { 54 width: 22px; 55 height: 22px; 56 margin-right: 22px; 57 color: #FFB800; 58 font-size: 22px; 59 line-height: 22px; 60 flex: 0 0 auto; 61 } 62 .image-upload-count-tips__title { 63 color: #2F3338; 64 font-size: 16px; 65 font-weight: 500; 66 line-height: 24px; 67 } 68 .image-upload-count-tips__content { 69 margin: 24px 0 0 44px; 70 color: #5D6470; 71 font-size: 14px; 72 line-height: 22px; 73 padding-right: 8px; 74 } 75 .image-upload-count-tips__intro { 76 margin-bottom: 10px; 77 } 78 .image-upload-count-tips__scope { 79 display: flex; 80 flex-wrap: wrap; 81 gap: 6px; 82 margin-bottom: 14px; 83 } 84 .image-upload-count-tips__tag { 85 height: 24px; 86 padding: 0 8px; 87 border-radius: 4px; 88 background: #F5F6FA; 89 color: #4E5969; 90 font-size: 13px; 91 line-height: 24px; 92 white-space: nowrap; 93 } 94 .image-upload-count-tips__price { 95 line-height: 24px; 96 } 97 .image-upload-count-tips__highlight { 98 color: #6252F3; 99 } 100 .image-upload-count-tips__actions { 101 102 display: flex; 103 align-items: center; 104 justify-content: flex-end; 105 margin-top: 22px; 106 gap: 20px; 107 } 108 .image-upload-count-tips__checkbox { 109 color: #3D3D3D; 110 font-size: 14px; 111 line-height: 22px; 112 } 113 .image-upload-count-tips__button.ant-btn { 114 height: 32px; 115 padding: 0 16px; 116 border-radius: 4px; 117 background: #6252F3; 118 border-color: #6252F3; 119 font-size: 14px; 120 line-height: 30px; 121 box-shadow: none; 122 } 123 .image-upload-count-tips__button.ant-btn:hover, 124 .image-upload-count-tips__button.ant-btn:focus { 125 background: #5748E8; 126 border-color: #5748E8; 127 } 128 `,document.head.appendChild(u)},$o=()=>{const{t:u}=mt();return{showImageUploadCountTips:(i={})=>{var _;if(!i.force&&typeof localStorage<"u"&&localStorage.getItem(_c)==="1")return(_=i.onOk)==null||_.call(i),null;if(Dn)return Dn;gb();const c=h(!1);let o;const x=()=>{var m;c.value&&localStorage.setItem(_c,"1"),Dn=null,o.destroy(),(m=i.onOk)==null||m.call(i)};return o=Zt.confirm({icon:null,title:null,width:450,closable:!0,maskClosable:!1,keyboard:!1,class:"image-upload-count-tips-modal",afterClose:()=>{Dn===o&&(Dn=null)},content:()=>{let m,p;return y("div",{class:"image-upload-count-tips"}
128,[y("div",{class:"image-upload-count-tips__header"},[y(ra,{class:"image-upload-count-tips__icon"},null),y("span",{class:"image-upload-count-tips__title"},[u("hooks.useImageUploadCountTips.952343-0")])]),y("div",{class:"image-upload-count-tips__content"},[y("div",{class:"image-upload-count-tips__intro"},[u("hooks.useImageUploadCountTips.952343-1")]),y("div",{class:"image-upload-count-tips__scope"},[y("span",{class:"image-upload-count-tips__tag"},[u("hooks.useImageUploadCountTips.952343-2")]),y("span",{class:"image-upload-count-tips__tag"},[u("hooks.useImageUploadCountTips.952343-3")]),y("span",{class:"image-upload-count-tips__tag"},[u("hooks.useImageUploadCountTips.952343-4")]),y("span",{class:"image-upload-count-tips__tag"},[u("hooks.useImageUploadCountTips.952343-5")]),y("span",{class:"image-upload-count-tips__tag"},[u("hooks.useImageUploadCountTips.952343-6")])]),y("div",{class:"image-upload-count-tips__price"},[y("span",null,[u("hooks.useImageUploadCountTips.952343-7")]),y("span",{class:"image-upload-count-tips__highlight"},[u("hooks.useImageUploadCountTips.952343-8")]),y("span",null,[u("hooks.useImageUploadCountTips.952343-9"),De(" ")]),y("span",{class:"image-upload-count-tips__highlight"},[u("hooks.useImageUploadCountTips.952343-10")])])]),y("div",{class:"image-upload-count-tips__actions"},[y(Mo,{checked:c.value,onChange:d=>{c.value=d.target.checked},class:"image-upload-count-tips__checkbox"},hc(m=u("hooks.useImageUploadCountTips.952343-11"))?m:{default:()=>[m]}),y(Lt,{type:"primary",onClick:x,class:"image-upload-count-tips__button"},hc(p=u("hooks.useImageUploadCountTips.952343-12"))?p:{default:()=>[p]})])])},footer:()=>null}),Dn=o,o}}},fb={class:"flex pt-8px flex-wrap"},vb={class:"popover-content w-full"},hb={class:"w-full h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center"},_b={class:"mt-12px"},yb={class:"w-500px"},xb={key:1},bb={class:"w-full h-full flex justify-center items-center"},Ib={key:0,src:ka,alt:"",class:"w-28px h-28px"},Cb={key:1,src:on,alt:"",class:"w-28px h-28px"},kb={class:"text-14px color-[#3D3D3D] my-6px"},wb={class:"text-12px"},Pb={class:"text-12px"},Mb={class:"text-12px"},Sb={key:1,class:"flex items-center mt-12px"},$b={class:"long-upload-material"},Tb={key:0,src:xa,alt:"",class:"w-16px h-16px"},Ab={key:1,class:"text-center"},Ub={class:"text-10px"},Lb=3,ho=10,_o=10,Eb={__name:"long-upload-material",emits:["success","updateScript"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=bt();la();const{showImageUploadCountTips:x}=$o(),_=i,m=h([]),p=h(!1);h(!1);const d=h(null),R=h(null),U=h(!1),G=async()=>(d.value||(U.value||(U.value=!0),await tt()),d.value),a=F(()=>o.isDetailImg&&["SKU_GENERATION","LONG_IMAGE_GENERATION"].includes(o.longImageChatMode)),E=F(()=>(o.longImageParams.materialImg||[]).filter(I=>(I==null?void 0:I.fnType)!=="reference").length),z=(I=d.value)=>{var k;(k=I==null?void 0:I.clearImg)==null||k.call(I)},q=async I=>{var J,oe;if(I.ossUrl){const te=JSON.parse(I.ossUrl);await V(te);return}const B=await(await fetch(I.imageUrl)).blob(),be=I.fileName&&I.fileName.includes(".")?I.fileName:((oe=(J=I.imageUrl)==null?void 0:J.split("/"))==null?void 0:oe.pop())||"unknown",ne=new File([B],be,{type:B.type.includes("jpg")?"image/jpeg":B.type}),le={name:ne.name,originFileObj:ne},ce=await G();return z(ce),ce==null?void 0:ce.handleCustomUploads({file:le.originFileObj})},S=async I=>{if(!p.value)return q(I)},O=async I=>{if(p.value||!(I!=null&&I.length))return;o.activeTabKey="2",U.value=!0,await tt();const k=(o.longImageParams.materialImg||[]).filter(le=>
128(le==null?void 0:le.fnType)!=="reference").length,B=Math.max(0,(a.value?ho:_o)-k),be=I.slice(0,B),ne=3;for(let le=0;le<be.length;le+=ne){const ce=be.slice(le,le+ne).map(J=>q({imageUrl:J}));await Promise.allSettled(ce)}},N=async I=>{if(p.value)return;o.activeTabKey="2";const k=await G();return z(k),k==null?void 0:k.handleCustomUploads({file:I})},ae=async I=>{I&&(o.activeTabKey="2",await V(I))},L=async I=>{const k=kn(I.dataTransfer);if(k.length){for(const be of k)await N(be);return}const B=Cn(I.dataTransfer);B&&await ae(B)},K=I=>{var k,B;I&&(m.value=(m.value||[]).filter(be=>be!==I),(B=(k=d.value)==null?void 0:k.remove)==null||B.call(k,I))},de=I=>{I&&tt(()=>{var k;(k=R==null?void 0:R.value)==null||k.fetchHistoryImages()});try{if(typeof window>"u")return;const k=document.querySelector(".qinghu-link-pix-content");if(!k)return;k.style.overflowY=I?"hidden":"auto"}catch{}},W=()=>{p.value=!0},$=()=>{p.value=!1},Y=(I,k=0)=>{const B=Array.isArray(I)?I[k]:I;return typeof B=="string"?B:(B==null?void 0:B.url)||""},j=I=>(Array.isArray(I)?I:[I]).map(B=>{if(typeof B=="string")return{url:B};const be=(B==null?void 0:B.url)||(B==null?void 0:B.imageUrl)||"";return be?{url:be,filename:(B==null?void 0:B.filename)||(B==null?void 0:B.fileName)||"",tag:(B==null?void 0:B.tag)||"",width:(B==null?void 0:B.width)||0,height:(B==null?void 0:B.height)||0,aspectRatio:(B==null?void 0:B.aspectRatio)||0}:null}).filter(Boolean),V=async I=>{if(U.value=!1,o.activeTabKey=="1"&&I){let k={};o.aiMessageType!="LONGIMAGE"||o.longImageChatMode=="EDIT_GENERATION"?k={url:I==null?void 0:I.url,filename:(I==null?void 0:I.filename)||"",tag:(I==null?void 0:I.tag)||"",width:(I==null?void 0:I.width)||0,height:(I==null?void 0:I.height)||0,aspectRatio:(I==null?void 0:I.aspectRatio)||0,fnType:"reference"}:k={url:Y(I),tag:"",fnType:"reference"};const B=o.longImageParams.materialImg||[],be=B.findIndex(ne=>ne&&ne.fnType==="reference");be>=0?o.longImageParams.materialImg=B.map((ne,le)=>le===be?{...ne,...k}:ne):o.longImageParams.materialImg=[k,...B]}if(o.activeTabKey=="2"&&I){const k=o.longImageParams.materialImg||[],B=k.filter(oe=>(oe==null?void 0:oe.fnType)!=="reference").length,be=a.value?ho:_o,ne=Math.max(0,be-B),le=new Set(k.map(oe=>oe==null?void 0:oe.url).filter(Boolean));let ce=[];if(o.aiMessageType!="LONGIMAGE"||o.longImageChatMode=="EDIT_GENERATION"?ce=j(I).filter(oe=>!le.has(oe.url)).slice(0,ne).map(oe=>({url:oe.url,filename:oe.filename||"",tag:oe.tag||"",width:oe.width,height:oe.height,aspectRatio:oe.aspectRatio,fnType:"material"})):ce=j(I).filter(oe=>!le.has(oe.url)).slice(0,ne).map(oe=>({url:oe.url,tag:"",fnType:"material"})),!ce.length)return;const J=B+ce.length;a.value&&J>B&&J>Lb&&x(),o.longImageParams.materialImg=[...k,...ce]}I&&_("success",(o.longImageParams.materialImg||[]).map(k=>k.url))};Ne(()=>U.value,I=>{if(!I){const B=document.querySelector(".qinghu-link-pix-content");if(!B)return;B.style.overflowY="auto"}const k=localStorage.getItem("LongImageRecognitionChecked");o.longImageParams.imageRecognitionChecked=k!==null?k!=="false":!0},{deep:!0}),Ne(()=>o.longImageParams.materialImg,I=>{I&&I.length&&!o.longImageParams.originalImage?o.longImageParams.originalImage=I[0].url:I.length||(o.longImageParams.originalImage="",o.longImageParams.from1688Images=[],o.longImageParams.offerId="",o.longImageParams.sameStyleProductName="",o.longImageParams.sameStyleImageUrl="",o.longImageParams.imageUrl="")},{immediate:!0,deep:!0});const w=async()=>{await tt(),localStorage.setItem("LongImageRecognitionChecked",o.longImageParams.imageRecognitionChecked)};return g({uploadLoading:p,setImageByList:O,uploadImg:N,addUrl:ae}),(I,k)=>{const B=Wt,be=ga,ne=Sa,le=ca,ce=Xn,J=Bt;return l(),f("div",{class:"flex pl-12px",onDragover:k[5]||(k[5]=Be(()=>{},["stop","prevent"])),onDrop:Be(L,["stop","prevent"])},[t("div",fb,[e(o).longImageParams.materialImg.length?(l(),ve(mb,{key:0,onDelete:K})):he("",!0),e(E)<(e(a)?ho:_o)?(l(),ve(J,{key:1,placement:"top",open:e(U),"onUpdate:open":k[4]||(k[4]=oe=>Fe(U)?U.value=oe:null),trigger:"click",onOpenChange:de,overlayClassName:"long-upload-material-popover"},{content:P(()=>[t("div",vb,[t("div",hb,[t("div",{class:Qe([{active:e(o).activeTabKey==="2"}
128,"w-[49%] h-32px rounded-4px text-center line-height-32px cursor-pointer flex items-center justify-center"]),onClick:k[0]||(k[0]=oe=>e(o).activeTabKey="2")},[k[6]||(k[6]=t("img",{src:on,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(c)("qinghu-ai.long-upload-material.697730-0")),1)],2),t("div",{class:Qe([{active:e(o).activeTabKey==="1"},"w-[49%] h-32px rounded-4px text-center line-height-32px cursor-pointer flex items-center justify-center"]),onClick:k[1]||(k[1]=oe=>e(o).activeTabKey="1")},[k[7]||(k[7]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(c)("qinghu-ai.long-upload-material.697730-10")),1)],2)]),t("div",_b,[y(be,{ref_key:"uploadRef",ref:d,value:e(m),"onUpdate:value":k[2]||(k[2]=oe=>Fe(m)?m.value=oe:null),name:"coverImage",temp:!1,multiple:e(o).activeTabKey!=="1",showUploadList:!1,maxCount:e(a)?ho:_o,size:15*1024*1024,enableCompress:!0,"compress-quality":.7,uploadBizType:"COMMON_IMAGE",onStartUploading:W,onEndUploading:$,onSuccess:V,class:"long-image-material-upload",isSeedeUpload:e(o).aiMessageType!="LONGIMAGE"||e(o).longImageChatMode=="EDIT_GENERATION",activeTabKey:e(o).activeTabKey,validateWH:!1},{default:P(()=>[t("div",yb,[e(p)?(l(),ve(B,{key:0})):(l(),f("div",xb,[t("div",bb,[e(o).activeTabKey=="1"?(l(),f("img",Ib)):(l(),f("img",Cb))]),t("div",kb,r(e(o).activeTabKey=="1"?e(c)("qinghu-ai.long-upload-material.697730-11"):e(c)("qinghu-ai.long-upload-material.697730-2")),1),t("div",wb,r(e(c)("qinghu-ai.long-upload-material.697730-4")),1),t("div",Pb,r(e(c)("qinghu-ai.long-upload-material.697730-5")),1),t("div",Mb,r(e(c)("qinghu-ai.long-upload-material.697730-6",[e(o).activeTabKey=="1"?"1":e(a)?ho:_o])),1)]))])]),_:1},8,["value","multiple","maxCount","isSeedeUpload","activeTabKey"])]),e(U)?(l(),ve(ne,{key:0,ref_key:"historyImageRef",ref:R,onClickItem:S},null,512)):he("",!0),e(o).aiMessageType=="LONGIMAGE"?(l(),f("div",Sb,[t("div",null,r(e(c)("components-qinghu-ai.video-batch-generate.738063-221")),1),y(le,null,{title:P(()=>[De(r(e(c)("components-qinghu-ai.long-upload-material.407726-108")),1)]),default:P(()=>[y(e(pa),{class:"ml-6px mr-10px color-[rgba(61,61,61,0.60)]"})]),_:1}),y(ce,{onChange:w,checked:e(o).longImageParams.imageRecognitionChecked,"onUpdate:checked":k[3]||(k[3]=oe=>e(o).longImageParams.imageRecognitionChecked=oe)},null,8,["checked"])])):he("",!0)])]),default:P(()=>[t("div",$b,[e(p)?(l(),f("div",Ab,[y(B,{size:"small"}),t("div",Ub,r(e(c)("qinghu-ai.long-upload-material.697730-8")),1)])):(l(),f("img",Tb))])]),_:1},8,["open"])):he("",!0)])],32)}}},qb=It(Eb,[["__scopeId","data-v-cb00b1fd"]]),Db={class:"flex pt-8px flex-wrap"},Ob=["src"],Nb={key:1,class:"ad-material-thumb mr-8px mb-8px"},Rb=["src"],Fb=["onClick"],Gb={class:"w-344px"},Vb={class:"w-full h-full flex flex-col items-center justify-center"},zb={class:"text-14px color-[#3D3D3D] my-6px"},Bb={class:"text-12px"},Kb={class:"text-12px"},Wb={class:"text-12px"},jb={class:"ad-upload-material-btn"},Hb={key:0,src:xa,alt:"",class:"w-16px h-16px"},Jb={key:1,class:"text-center"},Yb={class:"text-10px"},Qb=10,Xb=5,xc=3,Zb={__name:"ad-upload-material",emits:["success","material-reference","image-deleted"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=bt(),x=i,{showImageUploadCountTips:_}=$o(),m=h([]),p=h(null),d=h(null),R=h(!1),U=h(!1),G=h(""),a=F(()=>o.adMaterialParams.materialType==="video"?Xb:Qb),E=F(()=>o.adMaterialParams.materialType==="video"),z=F(()=>(o.adMaterialParams.materialImg||[]).length<a.value),q=F(()=>(o.adMaterialParams.materialImg||[]).reduce((w,I)=>(I!=null&&I.url&&(w[I.url]=I),w),{})),S=w=>(Array.isArray(w)?w:[w]).map(k=>{if(typeof k=="string")return{url:k,filename:"",tag:"",width:0,height:0,aspectRatio:0,fnType:"material"};const B=(k==null?void 0:k.url)||(k==null?void 0:k.imageUrl)||"";return B?{url:B,filename:(k==null?void 0:k.filename)||(k==null?void 0:k.fileName)||"",tag:(k==null?void 0:k.tag)||"",width:(k==null?void 0:k.width)||0,height:(k==null?void 0:k.height)||0,aspectRatio:(k==null?void 0:k.aspectRatio)||0,fnType:"material"}:null}).filter(Boolean),O=w=>{var k;const I=(k=o.adMaterialParams.materialImg[w])==null?void 0:k.url;o.adMaterialParams.materialImg.splice(w,1),o.adMaterialParams.materialImg.length===0&&(o.adMaterialParams.materialImg=[]),I&&x("image-deleted",I),x("success",{urls:(o.adMaterialParams.materialImg||[]).map(B=>B.url),triggerPrompt:!1})},N=(w,I)=>{const k=(o.adMaterialParams.materialImg||[]).find(B=>B.url===I);k&&(k.tag=k.tag===w.label?"":w.label)},ae=w=>{const I=(o.adMaterialParams.materialImg||[]).find(B=>B.url===w),k=G.value.trim();!I||!k||(I.tag=k)},L=()=>{var w,I;R.value=!1,U.value=!1,(I=(w=p.value)==null?void 0:w.clearFiles)==null||I.call(w)},K=w=>{if(U.value=!1,!w)return;const I=(o.adMaterialParams.materialImg||[]).length===0,k=o.adMaterialParams.materialImg||[],B=S(w);if(!B.length)return;const be=B.slice(0,Math.max(0,a.value-k.length)),ne=[...k,...be];ne.length>k.length&&k.length<=xc&&ne.length>xc&&_(),o.adMaterialParams.materialImg=ne,ne.length>=a.value&&L(),x("success",{urls:(o.adMaterialParams.materialImg||[]).map(le=>le.url),triggerPrompt:I})},de=w=>{U.value=!1,K({url:w.imageUrl})},W=w=>{!w||!z.value||K(w)},$=async w=>{if(!w||!z.value||R.value)return;
128const I=await Fl(w,15*1024*1024,!1);if(!(I!=null&&I.success))return;const k=new FormData;k.append("file",w),k.append("uploadBizType","COMMON_IMAGE");try{R.value=!0;const B=await Va(k);(B!=null&&B.success||(B==null?void 0:B.code)===200)&&(B!=null&&B.payload)?K(B.payload):qe.error((B==null?void 0:B.message)||c("qinghu-ai.batch-upload-img.462068-2"))}catch{qe.error(c("qinghu-ai.batch-upload-img.462068-2"))}finally{R.value=!1}},Y=w=>{w&&W(w)},j=async w=>{const I=kn(w.dataTransfer);if(I.length){for(const B of I)await $(B);return}const k=Cn(w.dataTransfer);k&&await Y(k)},V=w=>{w&&tt(()=>{var I;(I=d==null?void 0:d.value)==null||I.fetchHistoryImages()})};return Ne(()=>o.adMaterialParams.materialType,()=>{L();const w=o.adMaterialParams.materialImg||[];w.length<=a.value||(o.adMaterialParams.materialImg=w.slice(0,a.value),x("success",{urls:(o.adMaterialParams.materialImg||[]).map(I=>I.url),triggerPrompt:!1}))}),Ne(z,w=>{w||L()}),g({addUrl:W,uploadImg:$}),(w,I)=>{const k=Wt,B=ga,be=Sa,ne=Bt;return l(),f("div",{class:"flex pl-12px",onDragover:I[6]||(I[6]=Be(()=>{},["stop","prevent"])),onDrop:Be(j,["stop","prevent"])},[t("div",Db,[(l(!0),f(we,null,Je(e(o).adMaterialParams.materialImg,(le,ce)=>(l(),f(we,{key:le.url||ce},[e(E)?(l(),ve(si,{key:0,element:le.url,index:ce,"custom-purpose":e(G),"image-mapping":e(q),isVisibleSameStyle:!1,styleStr:"width: 168px; height: 60px; margin-top: 0; margin-bottom: 8px;",purposeStyle:"height: 32px; background: #F7F7F7; margin-right: 0; border-radius: 0 6px 0 0;",showCropBtn:!1,"onUpdate:customPurpose":I[0]||(I[0]=J=>G.value=J),onMaterialClick:N,onAddCustom:ae,onMaterialReference:I[1]||(I[1]=J=>x("material-reference",J)),onOnDelete:O},{"img-item":P(({url:J})=>[t("img",{src:J,alt:"",class:"ad-material-video-thumb__img"},null,8,Ob)]),_:1},8,["element","index","custom-purpose","image-mapping"])):(l(),f("div",Nb,[t("img",{src:le.url,alt:"",class:"ad-material-thumb__img"},null,8,Rb),t("img",{src:Ca,alt:"",class:"ad-material-thumb__close",onClick:Be(J=>O(ce),["stop"])},null,8,Fb)]))],64))),128)),e(z)?(l(),ve(ne,{key:0,placement:"top",open:e(U),"onUpdate:open":I[5]||(I[5]=le=>Fe(U)?U.value=le:null),trigger:"click",overlayClassName:"ad-upload-material-popover",onOpenChange:V},{content:P(()=>[t("div",Gb,[y(B,{ref_key:"uploadRef",ref:p,value:e(m),"onUpdate:value":I[2]||(I[2]=le=>Fe(m)?m.value=le:null),name:"coverImage",temp:!1,multiple:!0,showUploadList:!1,maxCount:e(a),size:15*1024*1024,uploadBizType:"COMMON_IMAGE",onStartUploading:I[3]||(I[3]=le=>R.value=!0),onEndUploading:I[4]||(I[4]=le=>R.value=!1),onSuccess:K,class:"ad-upload-material-area",isSeedeUpload:!1,validateWH:!1},{default:P(()=>[t("div",Vb,[e(R)?(l(),ve(k,{key:0})):(l(),f(we,{key:1},[I[7]||(I[7]=t("img",{src:on,alt:"",class:"w-28px h-28px"},null,-1)),t("div",zb,r(e(c)("components-qinghu-ai.ad-upload-material.930519-78")),1),t("div",Bb,r(e(c)("qinghu-ai.long-upload-material.697730-4")),1),t("div",Kb,r(e(c)("qinghu-ai.batch-upload-img.998187-6")),1),t("div",Wb,r(e(c)("qinghu-ai.long-image-params.227781-6"))+r(e(a))+r(e(c)("dashboard.home-head.325764-3")),1)],64))])]),_:1},8,["value","maxCount"])]),e(U)?(l(),ve(be,{key:0,ref_key:"historyImageRef",ref:d,onClickItem:de},null,512)):he("",!0)]),default:P(()=>[t("div",jb,[e(R)?(l(),f("div",Jb,[y(k,{size:"small"}),t("div",Yb,r(e(c)("qinghu-ai.batch-upload-img.708047-0")),1)])):(l(),f("img",Hb))])]),_:1},8,["open"])):he("",!0)])],32)}}},eI=It(Zb,[["__scopeId","data-v-cbb4124b"]]),tI={class:"text-center"},aI={class:"text-22px mt-3px"},nI={class:"text-14px color-[rgba(61,61,61,0.8)] mt-9px"},oI={class:"w-485px h-148px bg-#fff rounded-12px m-auto mt-20px flex items-center justify-center"},sI={class:"w-252px text-center"},lI={class:"rounded-120px! text-12px! py-4px px-8px color-[#fff]",style:{background:"linear-gradient( 146deg, #66BFFF 0%, #32A9FF 100%)"}},iI={class:"text-13px mt-10px"},rI={class:"flex gap-4px mt-10px"},cI=["src"],uI={class:"flex flex-wrap gap-4px",style:{width:"124px"}},dI=["src"],pI={class:"batch-modify-image-form"},mI={class:"form-item"},gI={class:"form-label"},fI={class:"form-note"},vI={class:"mt-12px flex items-center flex-wrap gap-12px"},hI={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center mb-10px p-2px"},_I={class:"w-full h-32px rounded-4px bg-[#FFFFFF] text-center line-height-32px flex items-center justify-center"},yI={key:0},xI={key:1},bI={class:"text-12px"},II={class:"text-12px"},CI={class:"batch-modify-image-upload"},kI={key:1,class:"w-full h-full bg-#fff flex-center"},wI={class:"text-center"},PI={class:"form-item"},MI={class:"form-label"},SI={class:"mt-12px"},$I={class:"form-item"},TI={class:"form-label"},AI={class:"mt-12px"},UI={class:"text-center w-full px-20px!"}
128,kl=10,LI=Dt({__name:"batch-modify-image",props:{},emits:["send"],setup(u,{expose:g,emit:i}){const c=h(["https://res.menglar.com/crm/561775097551138.webp","https://res.menglar.com/crm/111775097571571.webp","https://res.menglar.com/crm/89491775097585919.webp","https://res.menglar.com/crm/83781775097603190.webp"]),o=h(["https://res.menglar.com/crm/20681775097702163.webp","https://res.menglar.com/crm/68181775097716730.webp","https://res.menglar.com/crm/46541775097730192.webp","https://res.menglar.com/crm/19021775097743722.webp"]),x=i,_=bt(),m=h(!1),p=h(!1),d=h([]),R=h(null),{t:U,locale:G}=mt(),a=h(""),E=la(),{userInfo:z}=va(E),q=F(()=>{var I;return(I=z==null?void 0:z.value)==null?void 0:I.defaultVip}),S=Kt(),O=h({}),N=h({size:"",quality:"",aspectRatio:"",modelSkuId:""}),ae=I=>{m.value=I},L=async(I,k)=>{const B=k.map(ne=>{var le;return((le=ne==null?void 0:ne.response)==null?void 0:le.payload)||null}).filter(ne=>ne!==null),be=Array.from(new Set(B));d.value=be},K=I=>{var B;let k=d.value[I];d.value.splice(I,1),R!=null&&R.value&&((B=R==null?void 0:R.value)==null||B.remove(k))},de=async(I,k=0)=>{Ta({options:{toolbar:!0,initialViewIndex:k},images:I})},W=()=>{m.value=!0},$=()=>{m.value=!1},Y=()=>{if(q.value){Zt.confirm({title:U("strategy-generator.index.033017-10"),icon:St(pa),content:U("qinghu-ai.batch-generate-image.423573-1"),maskClosable:!1,keyboard:!1,cancelText:U("agent-collection.index.198242-5"),okText:U("auth-mask.index.837851-1"),onOk(){S.push({path:"/upgrade",query:{type:"vip"}})},onCancel(){}});return}if(!d.value.length){qe.error(U("components-qinghu-ai.batch-generate-image.407726-49"));return}if(!a.value.trim()){qe.error(U("components-qinghu-ai.batch-generate-image.407726-48"));return}const I={images:d.value,currentImageActiveId:N.value.modelSkuId,type:_.aiMessageType,...N.value,consumptionCountText:U("components-common.VideoDownloadButton.658492-23",[O.value.score*d.value.length]),subType:"image_batch_edit",prompt:a.value.trim()};x("send",I,"batchModifyImage")},j=async(I,k)=>{const B={modelSkuId:I,type:"IMAGE"};k&&(B.quality=k);const be=await bn(B);be.code==0?O.value=be.data:O.value={}};Ne(()=>{var I,k;return[(I=N==null?void 0:N.value)==null?void 0:I.modelSkuId,(k=N==null?void 0:N.value)==null?void 0:k.quality]},([I,k])=>{I&&j(I,k)});const V=F(()=>O.value&&O.value.score?U("components-qinghu-ai.batch-generate-image.407726-52",[O.value.score*d.value.length]):""),w=async I=>{d.value.length>=kl||(d.value.push(I.imageUrl),R.value&&R.value.updateImg())};return g({open:W,close:$}),(I,k)=>{const B=Wt,be=ga,ne=Bt,le=Oa,ce=Lt,J=Ba;return l(),ve(J,{open:e(m),"onUpdate:open":k[7]||(k[7]=oe=>Fe(m)?m.value=oe:null),width:668,closable:!1,maskClosable:!1,class:"batch-modify-image-drawer"},{footer:P(()=>[t("div",UI,[y(ce,{type:"primary",size:"large",class:"w-full!",disabled:!e(d).length||!e(a),onClick:Y},{default:P(()=>[De(r(e(U)("components.VideoEditModal.123456-5")),1),t("span",null,r(e(V)),1)]),_:1},8,["disabled"])])]),default:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:k[0]||(k[0]=oe=>ae(!1))}),t("div",null,[t("div",null,[t("div",tI,[t("div",aI,r(e(U)("components-qinghu-ai.batch-modify-image.407726-70")),1),t("div",nI,r(e(U)("components-qinghu-ai.batch-modify-image.407726-71")),1)]),t("div",oI,[t("div",sI,[t("span",lI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-41")),1),t("div",iI,r(e(U)("components-qinghu-ai.batch-modify-image.407726-72")),1),t("div",rI,[(l(!0),f(we,null,Je(e(c),oe=>(l(),f("img",{key:oe,src:oe,alt:"",class:"w-60px h-60px"},null,8,cI))),128))])]),k[8]||(k[8]=t("div",null,[t("img",{src:zl,alt:"",class:"w-65px h-62px",style:{transform:"rotateZ(-10deg)"}})],-1)),t("div",uI,[(l(!0),f(we,null,Je(e(o),oe=>(l(),f("img",{key:oe,src:oe,alt:"",class:"w-60px h-60px"},null,8,dI))),128))])]),t("div",pI,[t("div",mI,[t("div",gI,[t("span",null,[k[9]||(k[9]=t("em",null,"*",-1)),De(r(e(U)("qinghu-ai.video-script.120875-24")),1)]),t("span",fI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-38")),1)]),t("div",vI,[ua(t("div",null,[y(ne,null,{content:P(()=>[t("div",null,[t("div",hI,[t("div",_I,[k[10]||(k[10]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(U)("qinghu-ai.video-batch-generate.797009-0")),1
128)])]),y(be,{ref_key:"uploadRef",ref:R,name:"coverImage",temp:!1,multiple:!0,showUploadList:!1,maxCount:kl,uploadBizType:"COMMON_IMAGE",onStartUploading:k[1]||(k[1]=oe=>p.value=!0),onEndUploading:k[2]||(k[2]=oe=>p.value=!1),onSuccess:L,onLoading:k[3]||(k[3]=oe=>p.value=oe),validateWH:!1,class:"batch-modify-image-upload",value:e(d),"onUpdate:value":k[4]||(k[4]=oe=>Fe(d)?d.value=oe:null)},{default:P(()=>[t("div",null,[e(p)?(l(),f("div",yI,[y(B),t("div",null,r(e(U)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",xI,[k[11]||(k[11]=t("div",{class:"w-full h-full flex justify-center items-center"},[t("img",{src:ka,alt:"",class:"w-28px h-28px"})],-1)),t("div",bI,r(e(U)("qinghu-ai.long-upload-material.697730-6",[10])),1),t("div",II,r(e(U)("qinghu-ai.video-batch-generate.797009-6")),1)]))])]),_:1},8,["value"]),y(Sa,{ref:"historyImageRef",onClickItem:w},null,512)])]),default:P(()=>[t("div",CI,[e(p)?(l(),ve(B,{key:0})):(l(),f("div",kI,[t("div",wI,[k[12]||(k[12]=t("img",{src:Jn,alt:"",class:"w-16px h-16px mb-4px"},null,-1)),t("div",null,r(e(U)("form-builder.ImgUrl.225105-1")),1)])]))])]),_:1})],512),[[da,e(d).length<kl]]),(l(!0),f(we,null,Je(e(d),(oe,te)=>(l(),ve($a,{key:te,url:oe,onOnPreview:Q=>de(e(d),te),styleStr:"width: 88px; height: 88px;",onOnDelete:Q=>K(te)},null,8,["url","onOnPreview","onOnDelete"]))),128))])]),t("div",PI,[t("div",MI,[t("span",null,[k[13]||(k[13]=t("em",null,"*",-1)),De(r(e(U)("asset-library.video.prompt")),1)])]),t("div",SI,[y(le,{value:e(a),"onUpdate:value":k[5]||(k[5]=oe=>Fe(a)?a.value=oe:null),placeholder:e(U)("components-qinghu-ai.batch-generate-image.407726-48"),"auto-size":{minRows:5,maxRows:5}},null,8,["value","placeholder"])])]),t("div",$I,[t("div",TI,[t("span",null,r(e(U)("ai-chat.agent-params-modal.617214-0")),1)]),t("div",AI,[y(Ls,{type:"image_batch_edit",params:e(N),"onUpdate:params":k[6]||(k[6]=oe=>Fe(N)?N.value=oe:null)},null,8,["params"])])])])])])]),_:1},8,["open"])}}}),EI={class:"text-center"},qI={class:"text-22px mt-3px"},DI={class:"text-14px color-[rgba(61,61,61,0.8)] mt-9px"},OI={class:"w-485px h-148px bg-#fff rounded-12px m-auto mt-20px flex items-center justify-center"},NI={class:"w-278px text-center"},RI={class:"rounded-120px! text-12px! py-4px px-8px color-[#fff]",style:{background:"linear-gradient( 146deg, #66BFFF 0%, #32A9FF 100%)"}},FI={class:"flex gap-4px mt-14px"},GI=["src"],VI={class:"text-9px color-#3D3D3D text-left ml-8px leading-14px"},zI={class:"flex flex-wrap gap-4px",style:{width:"124px"}},BI=["src"],KI={class:"batch-modify-image-form"},WI={class:"form-item"},jI={class:"form-label"},HI={class:"form-note"},JI={class:"mt-12px flex items-center flex-wrap gap-12px"},YI={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center mb-10px p-2px"},QI={class:"w-full h-32px rounded-4px bg-[#FFFFFF] text-center line-height-32px flex items-center justify-center"},XI={key:0},ZI={key:1},eC={class:"text-12px"},tC={class:"text-12px"},aC={class:"batch-modify-image-upload"},nC={key:1,class:"w-full h-full bg-#fff flex-center"},oC={class:"text-center"},sC={class:"form-item"},lC={class:"form-label"},iC={class:"form-note"},rC={class:"mt-12px"},cC={class:"flex flex-col gap-8px"},uC={class:"min-w-44px"},dC={class:"w-full mt-10px flex items-center justify-between"},pC={class:"form-item"},mC={class:"form-label"},gC={class:"mt-12px"},fC={class:"text-center w-full px-20px!"},vC=3,ms=10,hC=200,_C=Dt({__name:"batch-generate-image",emits:["send"],setup(u,{expose:g,emit:i}){const c=h(["https://res.menglar.com/crm/21521775099510264.webp"]),o=h(["https://res.menglar.com/crm/25051775099539917.webp","https://res.menglar.com/crm/56811775099570861.webp","https://res.menglar.com/crm/60231775099581844.webp","https://res.menglar.com/crm/42821775099592444.webp"]),x=i,_=bt(),m=h(!1),p=h(!1),d=h([]),R=h(null),{t:U}=mt(),{showImageUploadCountTips:G}=$o(),a=h([""]),E=la(),{userInfo:z}=va(E),q=F(()=>{var ne;return(ne=z==null?void 0:z.value)==null?void 0:ne.defaultVip}),S=Kt(),O=h({}),N=h(""),ae=h({size:"",quality:"",aspectRatio:"",modelSkuId:"",language:""}),L=ne=>{m.value=ne},K=()=>{a.value.length>=10||a.value.push("")},de=async(ne,le=[])=>{const ce=le.map(te=>{var Q;return((Q=te==null?void 0:te.response)==null?void 0:Q.payload)||null}).filter(te=>te!==null);
128let oe=[...d.value||[],...ce].filter(Boolean);oe=Array.from(new Set(oe)).slice(0,ms),oe.length>vC&&G(),d.value=oe},W=ne=>{ne<=0||a.value.splice(ne,1)},$=ne=>{var ce;let le=d.value[ne];d.value.splice(ne,1),R!=null&&R.value&&((ce=R==null?void 0:R.value)==null||ce.remove(le))},Y=async(ne,le=0)=>{Ta({options:{toolbar:!0,initialViewIndex:le},images:ne})},j=()=>{m.value=!0},V=()=>{m.value=!1},w=()=>{if(q.value){Zt.confirm({title:U("strategy-generator.index.033017-10"),icon:St(pa),content:U("qinghu-ai.batch-generate-image.423573-1"),maskClosable:!1,keyboard:!1,cancelText:U("qinghu-ai.batch-generate-image.423573-2"),okText:U("qinghu-ai.batch-generate-image.423573-3"),onOk(){S.push({path:"/upgrade",query:{type:"vip"}})},onCancel(){}});return}if(!d.value.length){qe.error(U("components-qinghu-ai.batch-generate-image.407726-49"));return}if(!a.value.some(le=>le.trim())){qe.error(U("components-qinghu-ai.batch-generate-image.407726-48"));return}const ne={images:d.value,currentImageActiveId:ae.value.modelSkuId,type:_.aiMessageType,...ae.value,consumptionCountText:U("components-common.VideoDownloadButton.658492-23",[O.value.score]),subType:"image_batch_generate",prompt:U("components-qinghu-ai.batch-generate-image.407726-39"),prompts:a.value.filter(le=>le.trim())};x("send",ne,"batchGenerateImage")},I=async(ne,le)=>{const ce={modelSkuId:ne,type:"IMAGE",count:a.value.length,inputImageCount:d.value.length};le&&(ce.quality=le);const J=JSON.stringify(ce);if(J===N.value)return;N.value=J;const oe=await bn(ce);oe.code==0?O.value=oe.data:O.value={}},k=yn((ne,le)=>{I(ne,le)},hC);Ne(()=>{var ne,le;return[(ne=ae==null?void 0:ae.value)==null?void 0:ne.modelSkuId,(le=ae==null?void 0:ae.value)==null?void 0:le.quality,a.value.length,d.value.length]},([ne,le,ce])=>{ne&&k(ne,le)}),fa(()=>{k.cancel()});const B=F(()=>O.value&&O.value.score?(a.value.filter(ne=>ne==null?void 0:ne.trim()).length,U("components-qinghu-ai.batch-generate-image.407726-52",[O.value.score])):""),be=async ne=>{d.value.length>=ms||(d.value.push(ne.imageUrl),R.value&&R.value.updateImg())};return g({open:j,close:V}),(ne,le)=>{const ce=Wt,J=ga,oe=Bt,te=ba,Q=Lt,ie=Ba;return l(),ve(ie,{open:e(m),"onUpdate:open":le[6]||(le[6]=_e=>Fe(m)?m.value=_e:null),width:668,closable:!1,maskClosable:!1,class:"batch-modify-image-drawer"},{footer:P(()=>[t("div",fC,[y(Q,{type:"primary",size:"large",class:"w-full!",disabled:!e(d).length||!e(a).some(_e=>_e.trim()),onClick:w},{default:P(()=>[De(r(e(U)("components.VideoEditModal.123456-5")),1),t("span",null,r(e(B)),1)]),_:1},8,["disabled"])])]),default:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:le[0]||(le[0]=_e=>L(!1))}),t("div",null,[t("div",null,[t("div",EI,[t("div",qI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-39")),1),t("div",DI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-40")),1)]),t("div",OI,[t("div",NI,[t("span",RI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-41")),1),t("div",FI,[(l(!0),f(we,null,Je(e(c),_e=>(l(),f("img",{key:_e,src:_e,alt:"",class:"w-60px h-60px"},null,8,GI))),128)),t("div",VI,[t("div",null,r(e(U)("components-qinghu-ai.batch-generate-image.407726-42")),1),t("div",null,r(e(U)("components-qinghu-ai.batch-generate-image.407726-43")),1),t("div",null,r(e(U)("components-qinghu-ai.batch-generate-image.407726-44")),1),t("div",null,r(e(U)("components-qinghu-ai.batch-generate-image.407726-45")),1)])])]),le[7]||(le[7]=t("div",null,[t("img",{src:zl,alt:"",class:"w-49px h-37px",style:{transform:"translate(-16px,-16px)"}})],-1)),t("div",zI,[(l(!0),f(we,null,Je(e(o),_e=>(l(),f("img",{key:_e,src:_e,alt:"",class:"w-60px h-60px"},null,8,BI))),128))])]),t("div",KI,[t("div",WI,[t("div",jI,[t("span",null,[le[8]||(le[8]=t("em",null,"*",-1)),De(r(e(U)("qinghu-ai.video-script.120875-24")),1)]),t("span",HI,r(e(U)("components-qinghu-ai.batch-generate-image.407726-38")),1)]),t("div",JI,[ua(t("div",null,[y(oe,null,{content:P(()=>[t("div",null,[t("div",YI,[t("div",QI,[le[9]||(le[9]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(U)("qinghu-ai.video-batch-generate.797009-0")),1
128)])]),y(J,{ref_key:"uploadRef",ref:R,name:"coverImage",temp:!1,multiple:!0,showUploadList:!1,maxCount:ms,uploadBizType:"COMMON_IMAGE",onStartUploading:le[1]||(le[1]=_e=>p.value=!0),onEndUploading:le[2]||(le[2]=_e=>p.value=!1),onSuccess:de,onLoading:le[3]||(le[3]=_e=>p.value=_e),validateWH:!1,class:"batch-modify-image-upload",value:e(d),"onUpdate:value":le[4]||(le[4]=_e=>Fe(d)?d.value=_e:null)},{default:P(()=>[t("div",null,[e(p)?(l(),f("div",XI,[y(ce),t("div",null,r(e(U)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",ZI,[le[10]||(le[10]=t("div",{class:"w-full h-full flex justify-center items-center"},[t("img",{src:ka,alt:"",class:"w-28px h-28px"})],-1)),t("div",eC,r(e(U)("qinghu-ai.long-upload-material.697730-6",[10])),1),t("div",tC,r(e(U)("qinghu-ai.video-batch-generate.797009-6")),1)]))])]),_:1},8,["value"]),y(Sa,{ref:"historyImageRef",onClickItem:be},null,512)])]),default:P(()=>[t("div",aC,[e(p)?(l(),ve(ce,{key:0})):(l(),f("div",nC,[t("div",oC,[le[11]||(le[11]=t("img",{src:Jn,alt:"",class:"w-16px h-16px mb-4px"},null,-1)),t("div",null,r(e(U)("form-builder.ImgUrl.225105-1")),1)])]))])]),_:1})],512),[[da,e(d).length<ms]]),(l(!0),f(we,null,Je(e(d),(_e,Re)=>(l(),ve($a,{key:Re,url:_e,onOnPreview:ye=>Y(e(d),Re),styleStr:"width: 88px; height: 88px;",onOnDelete:ye=>$(Re)},null,8,["url","onOnPreview","onOnDelete"]))),128))])]),t("div",sC,[t("div",lC,[t("span",null,[le[12]||(le[12]=t("em",null,"*",-1)),De(r(e(U)("asset-library.video.prompt")),1)]),t("span",iC,r(e(U)("components-qinghu-ai.batch-generate-image.407726-47")),1)]),t("div",rC,[t("div",cC,[(l(!0),f(we,null,Je(e(a),(_e,Re)=>(l(),f("div",{key:Re,class:"flex items-center gap-8px"},[y(te,{value:e(a)[Re],"onUpdate:value":ye=>e(a)[Re]=ye,placeholder:e(U)("components-qinghu-ai.batch-generate-image.407726-48"),allowClear:!0,class:"flex-1"},null,8,["value","onUpdate:value","placeholder"]),t("div",uC,[Re>0?(l(),ve(Q,{key:0,type:"link",size:"small",onClick:ye=>W(Re)},{default:P(()=>[De(r(e(U)("account.change-account.260246-2")),1)]),_:1},8,["onClick"])):he("",!0)])]))),128))]),t("div",dC,[y(Q,{onClick:K,disabled:e(a).length>=10,class:"w-full!"},{default:P(()=>[De(r(e(U)("agent-collection.change-collection.664825-6")),1)]),_:1},8,["disabled"]),le[13]||(le[13]=t("div",{class:"min-w-44px ml-8px"},null,-1))])])]),t("div",pC,[t("div",mC,[t("span",null,r(e(U)("ai-chat.agent-params-modal.617214-0")),1)]),t("div",gC,[y(Ls,{params:e(ae),"onUpdate:params":le[5]||(le[5]=_e=>Fe(ae)?ae.value=_e:null)},null,8,["params"])])])])])])]),_:1},8,["open"])}}}),yC={class:"text-center"},xC={class:"text-22px mt-3px"},bC={class:"text-14px color-[rgba(61,61,61,0.8)] mt-9px"},IC={class:"replace-mode-list"},CC=["onClick"],kC={class:"replace-mode-card__info"},wC={class:"replace-mode-card__head"},PC={class:"replace-mode-card__title"},MC={class:"replace-mode-card__desc"},SC={class:"replace-mode-card__desc"},$C=["src"],TC={class:"batch-modify-image-form"},AC={class:"form-item"},UC={class:"form-label reference-form-label"},LC={class:"form-note"},EC={class:"batch-custom-prompt-title"},qC={class:"batch-custom-prompt-actions"},DC=["onMouseenter"],OC=["src"],NC=["onMouseenter","onClick"],RC=["src"],FC={class:"mt-12px reference-card-list"},GC={class:"reference-upload-slot"},VC={class:"reference-upload-placeholder"},zC={class:"upload-title"},BC={class:"upload-desc"},KC={class:"original-upload-actions"},WC=["onClick"],jC=["src","onClick"],HC=["onMouseenter"],JC=["src"],YC={key:0,class:"reference-prompt-textarea-wrap"},QC={class:"reference-prompt-count"},XC={key:1,class:"reference-prompt-desc"},ZC={class:"form-item"},ek={class:"form-label"},tk={class:"form-note"},ak={class:"product-upload-box"},nk={key:1,class:"w-full h-full bg-#fff"},ok={class:"product-item-list"},sk=["onClick"],lk=["onClick"],ik=["src"],rk={class:"product-item-eye"},ck={class:"product-item-info"},uk={class:"product-item-label"},dk={class:"form-item"},pk={class:"form-label"},mk={class:"mt-12px"},gk={class:"text-center w-full px-20px!"},fk={class:"rounded-4px border border-solid border-#EDEDED flex items-center justify-between p-7px"},vk={class:"h-22px text-12px color-red mt-6px"},bc="5",wl=100,hk=Dt({__name:"batch-replace-image",emits:["send"],setup(u,{expose:g,emit:i}){const c={same:{originalMax:10,productMax:1},multi:{originalMax:1,productMax:10}},o=h("same"),x=F(()=>c[o.value].originalMax),_=F(()=>c[o.value].productMax),m=i,p=la(),{userInfo:d}=va(p),R=F(()=>{var He;return(He=d==null?void 0:d.value)==null?void 0:He.defaultVip}),U=Kt(),G=bt(),a=h(!1),E=h(!1),z=h(!1),q=h(!1),S=h(!1),O=h(0),N=h([]),ae=h([]),L=h([]),K=h([]),de=h(null),W=h(null),{t:$}=mt(),Y=h(!1),j=h(bc),V=h(""),w=h(!1),I=h(""),k=h(""),B=h(""),be=h(!1),ne=h(""),le=h({}),ce=h(""),J=h(""),oe=h(!1),te=h({size:"",quality:"",aspectRatio:"",modelSkuId:""}),Q=He=>
128{E.value=He},ie=He=>{z.value=He},_e=He=>{var Ue;return Array.from(((Ue=He.dataTransfer)==null?void 0:Ue.types)||[]).includes("Files")},Re=()=>{O.value=0,S.value=!1},ye=He=>{!_e(He)||E.value||(O.value+=1,S.value=!0)},me=He=>{!_e(He)||E.value||(He.dataTransfer&&(He.dataTransfer.dropEffect="copy"),S.value=!0)},re=He=>{_e(He)&&(O.value=Math.max(0,O.value-1),O.value===0&&(S.value=!1))},fe=He=>{q.value=!0;const Ue=He.target;(!(Ue instanceof Element)||!Ue.closest(".original-upload-action-upload-trigger"))&&He.stopPropagation()},Oe=He=>He.parentElement||document.body,Ve=[{value:"4",label:"æ æ³¨æ¿æ¢äº§å",description:"è¾å
¥åå¾ä¸éè¦æ¿æ¢ç产åä½ç½®æç¹å¾ï¼éåå¤äº§åæä¸»ä½ä¸ææ¾çå¾çã",placeholder:"请è¾å
¥éè¦æ¿æ¢ç产åä½ç½®æç¹å¾ï¼ä¾å¦ï¼å·¦ä¾§èè²æ°´æ¯ãç»é¢ä¸é´ç馿°´ç¶"},{value:"5",label:"AIèªå¨è¯å«äº§å",description:"AIèªå¨è¯å«åå¾ä¸ç产å主ä½ï¼éåå主ä½å¾çå¿«éæ¿æ¢ã",placeholder:""}],H=F(()=>[{value:"same",label:$("components-qinghu-ai.batch-replace-image.407726-89"),desc:$("components-qinghu-ai.batch-replace-image.407726-90"),descExtra:$("components-qinghu-ai.batch-replace-image.407726-91"),icon:m1},{value:"multi",label:$("components-qinghu-ai.batch-replace-image.407726-92"),desc:$("components-qinghu-ai.batch-replace-image.407726-93"),descExtra:$("components-qinghu-ai.batch-replace-image.407726-94"),icon:g1}]),st={4:{default:ru,active:iu},5:{default:lu,active:su}},ge=He=>({imageUrl:He,type:j.value,content:Se(j.value)?V.value:""}),Ce=He=>{const Ue=new Map(ae.value.map(ut=>[ut.imageUrl,ut]));ae.value=He.map(ut=>Ue.get(ut)||ge(ut))},$e=(He,Ue=!1)=>Ue?st[He].active:st[He].default,at=He=>{var Ue;return((Ue=Ve.find(ut=>ut.value===He))==null?void 0:Ue.description)||""},nt=He=>{var Ue;return((Ue=Ve.find(ut=>ut.value===He))==null?void 0:Ue.placeholder)||""},Se=He=>He==="4",se=()=>{var He;return((He=ae.value.find(Ue=>Se(Ue.type)&&Ue.content.trim()))==null?void 0:He.content)||V.value},Te=He=>{w.value=He,He&&(I.value=se())},Xe=He=>{j.value="4",V.value=He,ae.value.forEach(Ue=>{Ue.type="4",Ue.content=He})},pt=()=>{w.value=!1},gt=()=>{const He=I.value.trim();if(!He){qe.warning(nt("4"));return}Xe(He),w.value=!1,Y.value=!1},Ge=He=>{j.value=He,ae.value.forEach(Ue=>{Ue.type=He,Se(He)||(Ue.content="")}),Y.value=!1},T=He=>{a.value=He},X=(He=[])=>He.map(Ue=>{var ut;return((ut=Ue==null?void 0:Ue.response)==null?void 0:ut.payload)||null}).filter(Ue=>!!Ue),Ee=He=>Array.isArray(He)?He.filter(Boolean):He?[He]:[],Ye=async(He,Ue=[])=>{const ut=X(Ue),At=[...Ee(N.value),...ut],Ut=Array.from(new Set(At)).slice(0,x.value);N.value=Ut,Ce(N.value),q.value=!1},Me=async(He,Ue=[])=>{const ut=X(Ue),At=[...Ee(L.value),...ut],Ut=Array.from(new Set(At)).slice(0,_.value);L.value=Ut},D=He=>{var ut,At;const Ue=((ut=ae.value[He])==null?void 0:ut.imageUrl)||N.value[He];N.value=N.value.filter(Ut=>Ut!==Ue),ae.value.splice(He,1),de!=null&&de.value&&((At=de==null?void 0:de.value)==null||At.remove(Ue))},Ae=He=>{var ut;let Ue=L.value[He];L.value.splice(He,1),W!=null&&W.value&&((ut=W==null?void 0:W.value)==null||ut.remove(Ue))};Ne(L,He=>{const Ue=new Map(K.value.map(ut=>[ut.imageUrl,ut]));K.value=Ee(He).map(ut=>Ue.get(ut)||{imageUrl:ut,productName:""})},{deep:!0});const We=(He,Ue)=>{o.value==="multi"?He.productName=Ue:ce.value=Ue},ot=F(()=>o.value==="multi"?L.value.length:N.value.length),it=F(()=>o.value==="multi"?K.value.map(He=>He.productName.trim()).filter(Boolean).join("ã"):ce.value),qt=He=>{if(o.value===He)return;o.value=He,Re();const{originalMax:Ue,productMax:ut}=c[He];N.value.length>Ue&&(N.value.slice(Ue).forEach(At=>{var Ut;return(Ut=de==null?void 0:de.value)==null?void 0:Ut.remove(At)}),N.value=N.value.slice(0,Ue)),Ce(N.value),L.value.length>ut&&(L.value.slice(ut).forEach(At=>{var Ut;return(Ut=W==null?void 0:W.value)==null?void 0:Ut.remove(At)}),L.value=L.value.slice(0,ut))},Gt=()=>{be.value=!0,q.value=!1},jt=async(He,Ue=0)=>{Ta({options:{toolbar:!0,initialViewIndex:Ue},images:He})},$t=()=>{a.value=!0,Re(),j.value=bc,V.value="",w.value=!1,I.value="",Ce(N.value)},Ht=()=>{Re(),a.value=!1},ta=()=>
128{if(R.value){Zt.confirm({title:$("strategy-generator.index.033017-10"),icon:St(pa),content:$("qinghu-ai.batch-generate-image.423573-1"),maskClosable:!1,keyboard:!1,cancelText:$("qinghu-ai.batch-generate-image.423573-2"),okText:$("qinghu-ai.batch-generate-image.423573-3"),onOk(){U.push({path:"/upgrade",query:{type:"vip"}})},onCancel(){}});return}if(!N.value.length){qe.error($("components-qinghu-ai.batch-replace-image.407726-84"));return}if(!L.value.length){qe.error($("components-qinghu-ai.batch-image-replication.407726-68"));return}const He=ae.value.map(ut=>({imageUrl:ut.imageUrl,type:ut.type,content:Se(ut.type)?ut.content.trim():""})),Ue={images:[...N.value,...L.value],imageList:He,productName:ce.value||null,modelSkuName:$("components-qinghu-ai.batch-replace-image.407726-76"),isBatchProductReplace:!0,currentImageActiveId:te.value.modelSkuId,type:G.aiMessageType,...te.value,...o.value==="multi"?{productItemList:K.value.map(ut=>({productName:ut.productName.trim(),imageUrl:ut.imageUrl}))}:{},consumptionCountText:$("components-common.VideoDownloadButton.658492-23",[le.value.score*ot.value]),subType:o.value==="multi"?"image_multi_product_replace":"image_batch_replace",prompt:$("components-qinghu-ai.batch-replace-image.407726-87",[it.value])};m("send",Ue,"batchReplaceImage")},ea=async(He,Ue)=>{const ut={modelSkuId:He,type:"IMAGE"};Ue&&(ut.quality=Ue);const At=await bn(ut);At.code==0?le.value=At.data:le.value={}};Ne(()=>{var He,Ue;return[(He=te==null?void 0:te.value)==null?void 0:He.modelSkuId,(Ue=te==null?void 0:te.value)==null?void 0:Ue.quality]},([He,Ue])=>{He&&ea(He,Ue)});const ft=F(()=>le.value&&le.value.score?$("components-qinghu-ai.batch-generate-image.407726-52",[le.value.score*ot.value]):""),wt=He=>{if(!He)return null;try{const Ue=new URL(He);if(Ue.hostname!=="detail.1688.com")return null;const ut=Ue.pathname.match(/^\/offer\/(\d+)\.html$/);return ut?ut[1]:null}catch{const Ue=He.match(/https?:\/\/detail\.1688\.com\/offer\/(\d+)\.html(?:[?#].*)?$/);return Ue?Ue[1]:null}},Vt=async()=>{var At;J.value="";const He=ne.value.trim();if(!He){J.value=$("components-qinghu-ai.batch-replace-image.270934-0");return}const Ue=wt(He);if(!Ue){J.value=$("components-qinghu-ai.batch-replace-image.270934-1");return}oe.value=!0;const ut=await Nc({offerId:Ue});if(oe.value=!1,ut.code==0&&ut.data.length){const Ut=ut.data[0],Et=((At=Ut==null?void 0:Ut.productImage)==null?void 0:At.images)||[],Ot=x.value-N.value.length;if(Ot<=0){J.value=$("components-qinghu-ai.batch-replace-image.407726-88");return}qe.success($("components-qinghu-ai.batch-replace-image.270934-2"));const zt=o.value==="multi"?Et.slice(0,1):Et.slice(0,Ot);N.value=[...N.value,...zt],Ce(N.value),be.value=!1}else oe.value=!1,J.value=$("components-qinghu-ai.batch-replace-image.270934-3")};return g({open:$t,close:Ht}),(He,Ue)=>{const ut=Lt,At=Oa,Ut=Bt,Et=As,Ot=Wt,zt=ga,sa=Qa,ue=Ya,ke=ba,et=Ba,lt=Zt;return l(),f(we,null,[y(et,{open:e(a),"onUpdate:open":Ue[18]||(Ue[18]=je=>Fe(a)?a.value=je:null),width:960,closable:!1,maskClosable:!1,class:"batch-modify-image-drawer"},{footer:P(()=>[t("div",gk,[y(ut,{type:"primary",size:"large",class:"w-full!",disabled:!e(ot),onClick:ta},{default:P(()=>[De(r(e($)("components.VideoEditModal.123456-5")),1),t("span",null,r(e(ft)),1)]),_:1},8,["disabled"])])]),default:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:Ue[0]||(Ue[0]=je=>T(!1))}),t("div",null,[t("div",null,[t("div",yC,[t("div",xC,r(e($)("components-qinghu-ai.batch-replace-image.407726-76")),1),t("div",bC,r(e($)("components-qinghu-ai.batch-replace-image.407726-77")),1)]),t("div",IC,[(l(!0),f(we,null,Je(e(H),je=>(l(),f("div",{key:je.value,class:Qe(["replace-mode-card",{active:e(o)===je.value}]),onClick:_t=>qt(je.value)},[t("div",kC,[t("div",wC,[Ue[22]||(Ue[22]=t("span",{class:"replace-mode-check"},null,-1)),t("span",PC,r(je.label),1)]),t("div",MC,r(je.desc),1),t("div",SC,r(je.descExtra),1)]),t("img",{src:je.icon,alt:"",class:"replace-mode-card__img"},null,8,$C)],10,CC))),128))]),t("div",TC,[t("div",AC,[t("div",UC,[t("div",null,[t("span",null,[Ue[23]||(Ue[23]=t("em",null,"*",-1)),De(r(e($)("c
128omponents-qinghu-ai.batch-replace-image.407726-79")),1)]),t("span",LC,r(e($)("components-qinghu-ai.batch-replace-image.407726-80",[e(x)])),1)]),y(Et,{open:e(Y),"onUpdate:open":Ue[7]||(Ue[7]=je=>Fe(Y)?Y.value=je:null),trigger:["click"],placement:"bottomRight",overlayClassName:"batch-reference-prompt-dropdown"},{overlay:P(()=>[t("div",{class:"batch-reference-prompt-menu",onClick:Ue[6]||(Ue[6]=Be(()=>{},["stop"]))},[Ue[24]||(Ue[24]=t("div",{class:"menu-title"},"åºç¨å°å
¨é¨åå¾",-1)),(l(),f(we,null,Je(Ve,je=>(l(),f(we,{key:je.value},[Se(je.value)?(l(),ve(Ut,{key:0,open:e(w),"onUpdate:open":Ue[4]||(Ue[4]=_t=>Fe(w)?w.value=_t:null),trigger:"click",placement:"rightTop",arrow:!1,overlayClassName:"batch-custom-prompt-popover",getPopupContainer:Oe,onOpenChange:Te},{content:P(()=>[t("div",{class:"batch-custom-prompt-panel",onClick:Ue[2]||(Ue[2]=Be(()=>{},["stop"]))},[t("div",EC,r(je.label),1),y(At,{value:e(I),"onUpdate:value":Ue[1]||(Ue[1]=_t=>Fe(I)?I.value=_t:null),class:"batch-custom-prompt-input",maxlength:wl,"show-count":"",placeholder:nt(je.value),"auto-size":{minRows:4,maxRows:4}},null,8,["value","placeholder"]),t("div",qC,[y(ut,{size:"small",type:"primary",onClick:gt},{default:P(()=>[De(r(e($)("agent-collection.index.198242-5")),1)]),_:1}),y(ut,{size:"small",onClick:pt},{default:P(()=>[De(r(e($)("account.change-account-copy.890079-2")),1)]),_:1})])])]),default:P(()=>[t("div",{class:Qe(["menu-item",{active:e(j)===je.value}]),onMouseenter:_t=>k.value=je.value,onMouseleave:Ue[3]||(Ue[3]=_t=>k.value="")},[t("img",{src:$e(je.value,e(j)===je.value||e(k)===je.value),alt:"",class:"menu-icon"},null,8,OC),t("span",null,r(je.label),1)],42,DC)]),_:2},1032,["open"])):(l(),f("div",{key:1,class:Qe(["menu-item",{active:e(j)===je.value}]),onMouseenter:_t=>k.value=je.value,onMouseleave:Ue[5]||(Ue[5]=_t=>k.value=""),onClick:_t=>Ge(je.value)},[t("img",{src:$e(je.value,e(j)===je.value||e(k)===je.value),alt:"",class:"menu-icon"},null,8,RC),t("span",null,r(je.label),1)],42,NC))],64))),64))])]),default:P(()=>[y(ut,{class:"batch-reference-setting-btn"},{default:P(()=>[De(r(e($)("components-qinghu-ai.batch-main-image-replication.407726-70"))+" ",1),y(e(Co),{class:"text-10px"})]),_:1})]),_:1},8,["open"])]),t("div",FC,[ua(y(zt,{ref_key:"originalUploadRef",ref:de,name:"file",temp:!1,multiple:e(x)>1,showUploadList:!1,maxCount:e(x),uploadBizType:"COMMON_IMAGE",listType:null,onStartUploading:Ue[10]||(Ue[10]=je=>E.value=!0),onEndUploading:Ue[11]||(Ue[11]=je=>E.value=!1),onSuccess:Ye,onLoading:Q,validateWH:!1,class:"original-upload-card-upload",value:e(N),"onUpdate:value":Ue[12]||(Ue[12]=je=>Fe(N)?N.value=je:null)},{default:P(()=>[t("div",{class:Qe(["original-upload-menu-host",{"is-dragging":e(S)}]),onMouseenter:Ue[8]||(Ue[8]=je=>q.value=!0),onMouseleave:Ue[9]||(Ue[9]=je=>q.value=!1),onClick:fe,onDragenter:Be(ye,["prevent"]),onDragover:Be(me,["prevent"]),onDragleave:Be(re,["prevent"]),onDrop:Re},[t("div",GC,[e(E)?(l(),ve(Ot,{key:0,class:"original-upload-loading"})):he("",!0),ua(t("div",VC,[Ue[25]||(Ue[25]=t("img",{src:ou,alt:"",class:"w-20px h-20px"},null,-1)),t("div",zC,r(e($)("form-builder.ImgUrl.225105-1")),1),t("div",BC,[t("div",null,r(e($)("components-qinghu-ai.batch-main-image-replication.407726-75")),1)])],512),[[da,!e(E)&&!e(q)]]),ua(t("div",KC,[y(ut,{type:"primary",class:"original-upload-action-btn original-upload-action-upload-trigger"},{default:P(()=>[De(r(e($)("public-img-upload.index.101106-0")),1)]),_:1}),y(ut,{class:"original-upload-action-btn",onClick:Be(Gt,["stop"])},{default:P(()=>[De(r(e($)("goods-drawer.index.855056-17")),1)]),_:1})],512),[[da,!e(E)&&e(q)]])])],34)]),_:1},8,["multiple","maxCount","value"]),[[da,e(N).length<e(x)]]),(l(!0),f(we,null,Je(e(ae),(je,_t)=>(l(),f("div",{key:je.imageUrl,class:"reference-prompt-card"},[t("button",{class:"reference-delete-btn",type:"button",onClick:Be(vt=>D(_t),["stop"])},[y(e(ma))],8,WC),t("img",{src:je.imageUrl,alt:"",class:"reference-card-img",referrerPolicy:"no-referrer",onClick:vt=>jt(e(N),_t)},null,8,jC),y(ue,{value:je.type,"onUpdate:value":vt=>je.type=vt,class:"reference-prompt-select",popupClassName:"reference-prompt-select-dropdown",bordered:!1},{default:P(()=>[(l(),f(we,null,Je(Ve,vt=>y(sa,{key:vt.value,value:vt.value},{default:P(()=>[t("span",{class:"reference-select-option",onMouseenter:rt=>B.value=vt.value,onMouseleave:Ue[13]||(Ue[13]=rt=>B.value="")},[t("img",{src:$e(vt.value,je.type===vt.value||e(B)===vt.value),alt:"",class:"w-14px h-14px"},null,8,JC),t("span",null,r(vt.label),1)],40,HC)]),_:2},1032,["value"])),64))]),_:2},1032,["value","onUpdate:value"]),Se(je.type)?(l(),f("div",YC,[y(At,{value:je.content,"onUpdate:value":vt=>je.content=vt,class:"reference-prompt-textarea",maxlength:wl,placeholder:nt(je.type),"auto-size":{minRows:5,maxRows:5}},null,8,["value","onUpdate:value","placeholder"]),t("div",QC,r(je.content.length)+"/"+r(wl),1)])):(l(),f("div",XC,r(at(je.type)),1))]))),128))])]),t("div",ZC,[t("div",ek,[t("span",null,[Ue[26]||(Ue[26]=t("em",null,"*",-1)),De(r(e($)("c
128omponents-qinghu-ai.batch-image-replication.407726-55")),1)]),t("span",tk,r(e($)("components-qinghu-ai.batch-replace-image.407726-95",[e(_)])),1)]),t("div",{class:Qe(["product-upload-area",{"has-upload":e(L).length<e(_)}])},[ua(t("div",ak,[y(zt,{ref_key:"productImgUploadRef",ref:W,name:"coverImage",temp:!1,multiple:e(_)>1,showUploadList:!1,maxCount:e(_),uploadBizType:"COMMON_IMAGE",onStartUploading:Ue[14]||(Ue[14]=je=>z.value=!0),onEndUploading:Ue[15]||(Ue[15]=je=>z.value=!1),onSuccess:Me,onLoading:ie,validateWH:!1,class:"batch-modify-image-upload",value:e(L),"onUpdate:value":Ue[16]||(Ue[16]=je=>Fe(L)?L.value=je:null)},{default:P(()=>[t("div",null,[e(z)?(l(),ve(Ot,{key:0})):(l(),f("div",nk,[Ue[27]||(Ue[27]=t("img",{src:Jn,alt:"",class:"w-16px h-16px"},null,-1)),t("div",null,r(e($)("form-builder.ImgUrl.225105-1")),1)]))])]),_:1},8,["multiple","maxCount","value"])],512),[[da,e(L).length<e(_)]]),t("div",ok,[(l(!0),f(we,null,Je(e(K),(je,_t)=>(l(),f("div",{key:je.imageUrl,class:"product-item-card"},[t("button",{class:"product-item-remove",type:"button",onClick:Be(vt=>Ae(_t),["stop"])},[y(e(ma))],8,sk),t("div",{class:"product-item-thumb",onClick:vt=>jt(e(L),_t)},[t("img",{src:je.imageUrl,alt:"",referrerPolicy:"no-referrer"},null,8,ik),t("span",rk,[y(e(Us))])],8,lk),t("div",ck,[t("div",uk,r(e($)("components-qinghu-ai.batch-replace-image.407726-96")),1),y(ke,{value:e(o)==="multi"?je.productName:e(ce),placeholder:e($)("components-qinghu-ai.batch-replace-image.407726-97"),"onUpdate:value":vt=>We(je,vt)},null,8,["value","placeholder","onUpdate:value"])])]))),128))])],2)]),t("div",dk,[t("div",pk,[t("span",null,r(e($)("ai-chat.agent-params-modal.617214-0")),1)]),t("div",mk,[y(Ls,{type:"image_batch_replace",params:e(te),"onUpdate:params":Ue[17]||(Ue[17]=je=>Fe(te)?te.value=je:null)},null,8,["params"])])])])])])]),_:1},8,["open"]),y(lt,{open:e(be),"onUpdate:open":Ue[20]||(Ue[20]=je=>Fe(be)?be.value=je:null),title:e($)("components-qinghu-ai.batch-replace-image.407726-81"),onCancel:Ue[21]||(Ue[21]=je=>be.value=!1),footer:null,bodyStyle:{padding:"20px"}},{default:P(()=>[t("div",fk,[y(ke,{value:e(ne),"onUpdate:value":Ue[19]||(Ue[19]=je=>Fe(ne)?ne.value=je:null),placeholder:e($)("components-qinghu-ai.batch-replace-image.407726-82"),bordered:!1},null,8,["value","placeholder"]),y(ut,{type:"primary",disabled:!e(ne),loading:e(oe),onClick:Vt},{default:P(()=>[De(r(e($)("components-qinghu-ai.batch-replace-image.407726-83")),1)]),_:1},8,["disabled","loading"])]),t("div",vk,r(e(J)),1)]),_:1},8,["open","title"])],64)}}}),_k={class:"text-center"},yk={class:"text-22px mt-3px"},xk={class:"text-14px color-[rgba(61,61,61,0.8)] mt-9px"},bk={class:"w-485px h-148px bg-#fff rounded-12px m-auto mt-20px flex items-center justify-center"},Ik={class:"text-center"},Ck={class:"rounded-120px! text-12px! py-4px px-8px color-[#fff]",style:{background:"linear-gradient( 146deg, #66BFFF 0%, #32A9FF 100%)"}},kk={class:"flex items-center"},wk={class:"flex flex-col flex-wrap gap-4px mt-10px w-46px"},Pk=["src"],Mk={class:"flex flex-wrap gap-4px w-124px"},Sk=["src"],$k={class:"batch-modify-image-form"},Tk={class:"form-item"},Ak={class:"form-label reference-form-label"},Uk={class:"form-note"},Lk={class:"menu-title"},Ek={class:"batch-custom-prompt-title"},qk={class:"batch-custom-prompt-actions"},Dk=["onMouseenter"],Ok=["src"],Nk=["onMouseenter","onClick"],Rk=["src"],Fk={class:"mt-12px reference-card-list"},Gk={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center mb-10px p-2px"},Vk={class:"w-full h-32px rounded-4px bg-[#FFFFFF] text-center line-height-32px flex items-center justify-center"},zk={class:"batch-reference-image-upload"},Bk={key:0},Kk={class:"text-12px"},Wk={class:"text-12px"},jk={key:1,class:"reference-upload-placeholder"},Hk={class:"upload-title"},Jk={class:"upload-desc"},Yk=["onClick"],Qk=["src","onClick"],Xk=["onMouseenter"],Zk=["src"],ew={key:0,class:"reference-prompt-textarea-wrap"},tw={class:"reference-prompt-count"},aw={key:1,class:"reference-prompt-desc"},nw={class:"form-item"},ow={class:"form-label"},sw={class:"form-note"},lw={class:"mt-12px flex items-center flex-wrap gap-12px"},iw={class:"w-345px h-36px bg-[#EAEAEA] rounded-6px flex items-center justify-center mb-10px p-2px"},rw={class:"w-full h-32px rounded-4px bg-[#FFFFFF] text-center line-height-32px flex items-center justify-center"},cw={key:0},uw={key:1},dw={class:"text-12px"},pw={class:"text-12px"},mw={class:"batch-modify-image-upload"},gw={key:1,class:"w-full h-full bg-#fff flex-center"},fw={class:"text-center"},vw={class:"form-item"},hw={class:"form-label"},_w={class:"mt-12px"},yw={class:"mb-6px color-#4E5969"},xw={class:"batch-main-ratio-selector"},bw={class:"mode-trigger-text"},Iw={class:"popover-content w-250px"},Cw={class:"popover-title pl-10px! pt-10px mb-15px!"},kw={class:"flex flex-col overflow-y-scroll custom-scrollbar h-340px"},ww=["onClick"],Pw={class:"flex flex-col w-165px"},Mw={key:0,class:"customer-radio flex gap-x-5px"},Sw={key:1,class:"popover-item-label"},$w={key:1,class:"flex flex-col gap-y-5px rounded-4px"},Tw={class:"py-6px px-10px"},Aw=["onClick"],Uw={class:"flex flex-center gap-x-8px"},Lw=["src"],Ew={class:"group-hover:text-[var(--primary-color)]"},qw={class:"group-hover:text-[var(--primary-color)]"},Dw={class:"mt-12px"},Ow={class:"mb-6px color-#4E5969"},Nw={class:"text-center w-full px-20px!"},Pl=100,Ic="3",Cc=3,On=6,Rw=200,gs=10,Ku=Dt({__name:"batch-image-replication-drawer",props:{subType:{}},emits:["send"],setup(u,{expose:g,emit:i}){const c=u,o=i,{t:x}=mt(),_=bt(),{showImageUploadCountTips:m}=$o(),p=la(),{userInfo:d}=va(p),R=F(()=>{var xe;return(xe=d==null?void 0:d.value)==null?void 0:xe.defaultVip}),U=Kt(),G=x("qinghu-ai.batch-image-replication-drawer.394342-0"),a=h(["https://res.menglar.com/crm/67581775542531287.jpg","https://res.menglar.com/crm/22111775542551366.jpg"]),E=h(["https://res.menglar.com/crm/24101775542577113.jpg","https://res.menglar.com/crm/10371775542600527.jpg"]),z=h([{value:"1:1",label:x("components-qinghu-ai.batch-image-replication.407726-58")},{value:"2:3",label:x("components-qinghu-ai.batch-image-replication.407726-59")},{value:"3:2",label:x("components-qinghu-ai.batch-image-replication.407726-60")},{value:"3:4",label:x("components-qinghu-ai.batch-image-replication.407726-61")},{value:"4:3",label:x("components-qinghu-ai.batch-image-replication.407726-62")},{value:"4:5",label:x("components-qinghu-ai.batch-image-replication.407726-63")},{value:"5:4",label:x("components-qinghu-ai.batch-image-replication.407726-64")},{value:"9:16",label:x("components-qinghu-ai.batch-image-replication.407726-65")},{value:"16:9",label:x("components-qinghu-ai.batch-image-replication.407726-66")},{value:"21:9",label:x("components-qinghu-ai.batch-image-replication.407726-67")}]),q=[{code:"original",name:x("qinghu-ai.batch-image-replication-drawer.394342-0")},...Cs.value],S=h(!1),O=h(!1),N=h(!1),ae=h([]),L=h([]),K=h([]),de=h(),W=h(!1),$=h(0),Y=h(),j=h(!1),V=h(Ic),w=h(""),I=h(!1),k=h(""),B=h(""),be=h(""),ne=h({}),le=h(""),ce=h([]),J=xe=>{var b;return Array.from(((b=xe.dataTransfer)==null?void 0:b.types)||[]).includes("Files")},oe=()=>{$.value=0,W.value=!1},te=xe=>{!J(xe)||O.value||($.value+=1,W.value=!0)},Q=xe=>{!J(xe)||O.value||(xe.dataTransfer&&(xe.dataTransfer.dropEffect="copy"),W.value=!0)},ie=xe=>{J(xe)&&($.value=Math.max(0,$.value-1),$.value===0&&(W.value=!1))},_e=h(""),Re=h(""),ye=h(),me=h(),re=h(!1),fe=h({size:"",quality:"",aspectRatio:c.subType==="image_set_replication"?"3:4":"1:1",modelSkuId:53,language:G}),Oe=F(()=>c.subType==="image_main_batch_replace"),Ve=F(()=>Oe.value?x("components-qinghu-ai.batch-main-image-replication.407726-69"):x("components-qinghu-ai.batch-image-replication.407726-53")),H=F(()=>Oe.value?"mainImageReplication":"batchImageReplication"),st=F(()=>(_.adMaterialOptionsGroup.AD_IMAGE||[])[0]||null),ge=xe=>{if(!xe)return[];if(Array.isArray(xe))return se(xe);try{const b=JSON.parse(xe),Z=Array.isArray(b)?b:b==null?void 0:b.list;return Array.isArray(Z)?se(Z):[]}catch{return[]}},Ce=F(()=>{var xe;return ge((xe=st.value)==null?void 0:xe.imageParameterOptions)}),$e=xe=>{const b=String(xe!=null?xe:"").match(/(\d+)\s*x\s*(\d+)/i);if(!b)return null;const Z=Number(b[1]),Ie=Number(b[2]);return!Z||!Ie?null:{width:Z,height:Ie}}
128,at=xe=>{if(typeof xe=="number")return Math.abs(xe-1)<1e-6;const b=String(xe!=null?xe:"").trim();if(!b)return!1;if(b==="1"||b==="1:1")return!0;const Z=b.split(":").map(Number);if(Z.length===2&&Z.every(Boolean))return Math.abs(Z[0]/Z[1]-1)<1e-6;const Ie=$e(b);return Ie?Ie.width===Ie.height:!1},nt=(xe,b)=>{if(!at(xe))return"1K";const Z=$e(b);return Z&&Math.max(Z.width,Z.height)>1024?"2K":"1K"},Se=xe=>{var Pe,yt,Yt;const b=Array.isArray(xe.children)?xe.children.map(Se):xe.children,Z=Array.isArray(b)?(Pe=b.find(aa=>aa.quality))==null?void 0:Pe.quality:"",Ie=Array.isArray(b)?Z||nt((yt=xe.aspectRatio)!=null?yt:xe.size,xe.size):nt((Yt=xe.aspectRatio)!=null?Yt:xe.size,xe.size);return{...xe,children:b,quality:Ie}},se=xe=>xe.map(Se),Te=F(()=>ce.value||[]),Xe=xe=>!!xe&&xe.type!=="group"&&xe.type!=="custom",pt=()=>{const xe=ce.value||[];return xe.find(b=>Xe(b)&&(b==null?void 0:b.key)==="default")||xe.find(b=>Xe(b))},gt=xe=>xe==null?"1:1":String(xe),Ge=xe=>{var b;return gt((b=xe==null?void 0:xe.aspectRatio)!=null?b:xe==null?void 0:xe.value)},T=()=>{const xe=pt();xe&&(fe.value.size=xe.size||"",fe.value.aspectRatio=Ge(xe),fe.value.quality=xe.quality||"")},X=(xe=[])=>xe.filter(b=>b.visible!==!1),Ee=xe=>{if(xe.size)return fe.value.size===xe.size;const b=Ge(xe);return!fe.value.size&&!!b&&fe.value.aspectRatio===b},Ye=F(()=>{var Z;const xe=fe.value.size,b=fe.value.aspectRatio;if(xe){for(const Ie of ce.value)if(Xe(Ie)&&Ie.size===xe)return`${Ie.label} (${Ie.showSize||Ie.size})`;for(const Ie of ce.value)if(Ie.type==="group"){const Pe=(Z=Ie.children)==null?void 0:Z.find(yt=>yt.size===xe);if(Pe)return`${Pe.label} (${Pe.showSize||Pe.size})`}if(xe.includes("custom"))return`${x("qinghu-ai.link-pix-params.709204-0")} (${xe.replace("custom_","")})`}if(b){const Ie=ce.value.find(Pe=>Xe(Pe)&&!Pe.size&&Ge(Pe)===b);if(Ie)return Ie.label||Ge(Ie)}return x("qinghu-ai.link-pix-params.709204-0")}),Me=F(()=>[{value:"3",label:x("components-qinghu-ai.batch-main-image-replication.407726-74")},{value:"1",label:x("components-qinghu-ai.batch-main-image-replication.407726-72")},{value:"2",label:x("components-qinghu-ai.batch-main-image-replication.407726-73")},{value:"6",label:x("qinghu-ai.batch-image-replication-drawer.394342-1")}]),D={3:{default:ru,active:iu},1:{default:lu,active:su},2:{default:_1,active:h1},6:{default:v1,active:f1}},Ae=xe=>({imageUrl:xe,type:V.value,content:V.value==="2"?w.value:""}),We=xe=>{const b=new Map(L.value.map(Z=>[Z.imageUrl,Z]));L.value=xe.map(Z=>b.get(Z)||Ae(Z))},ot=(xe,b=!1)=>{var Z,Ie;return b?(Z=D[xe])==null?void 0:Z.active:((Ie=D[xe])==null?void 0:Ie.default)||""},it=xe=>xe==="2",qt=xe=>xe==="1"?x("components-qinghu-ai.batch-main-image-replication.407726-77"):xe==="3"?x("components-qinghu-ai.batch-main-image-replication.407726-79"):xe==="6"?"ãå»é¤æåã:ä»
å¤å»å¾çæå¾æ¹å¼ãå¾çå
ç´ çãå»é¤æææå,ååèå
æåé¨åå°çç½,å¯èªè¡åæå¤ç":"",Gt=()=>{var xe;return((xe=L.value.find(b=>b.type==="2"&&b.content.trim()))==null?void 0:xe.content)||w.value},jt=(xe,b)=>{if(!b)return;const Z=Ge(b);xe&&fe.value.size===xe?fe.value.size="":(fe.value.size=xe||"",fe.value.aspectRatio=Z,fe.value.quality=b.quality||""),re.value=!1},$t=xe=>{if(xe.type==="custom"){ta();return}xe.type!=="group"&&Xe(xe)&&jt(xe.size,xe)},Ht=xe=>{jt(xe.size,xe)},ta=()=>{var xe,b,Z,Ie;return _e.value?Re.value?!0:((Ie=(Z=me.value)==null?void 0:Z.focus)==null||Ie.call(Z),!1):((b=(xe=ye.value)==null?void 0:xe.focu
128s)==null||b.call(xe),!1)},ea=()=>{if(!ta())return;const{valid:xe,message:b}=ti(_e.value,Re.value,rt.value);if(!xe){qe.warning(b);return}const Z=`custom_${_e.value}x${Re.value}`,Ie=Number(_e.value)/Number(Re.value)||"1:1";fe.value.size=Z,fe.value.aspectRatio=String(Ie),fe.value.quality=nt(Ie,Z),re.value=!1},ft=xe=>{I.value=xe,xe&&(k.value=Gt())},wt=xe=>{if(xe==="2"){I.value=!0,k.value=Gt();return}I.value=!1,V.value=xe,L.value.forEach(b=>{b.type=xe}),j.value=!1},Vt=xe=>{V.value="2",w.value=xe,L.value.forEach(b=>{b.type="2",b.content=xe})},He=()=>{I.value=!1},Ue=()=>{const xe=k.value.trim();if(!xe){qe.warning(x("components-qinghu-ai.batch-image-replication-drawer.446330-46"));return}Vt(xe),I.value=!1,j.value=!1},ut=xe=>{de.value&&de.value.clearImg(),S.value=xe},At=(xe=[])=>xe.map(b=>{var Z;return((Z=b==null?void 0:b.response)==null?void 0:Z.payload)||null}).filter(Boolean),Ut=async xe=>{if(ae.value.length>10)return;const b=[...ae.value,...At(xe)];ae.value=Array.from(new Set(b)).slice(0,10),We(ae.value)},Et=async xe=>{const b=K.value||[];if(b.length>=On)return;const Z=[...b,...At(xe)],Ie=Array.from(new Set(Z)).slice(0,On);Ie.length>Cc&&m(),K.value=Ie},Ot=xe=>{var Z,Ie;const b=((Z=L.value[xe])==null?void 0:Z.imageUrl)||ae.value[xe];ae.value=ae.value.filter(Pe=>Pe!==b),L.value.splice(xe,1),(Ie=de.value)==null||Ie.remove(b)},zt=xe=>{var Z;const b=K.value[xe];K.value.splice(xe,1),(Z=Y.value)==null||Z.remove(b)},sa=async(xe,b=0)=>{Ta({options:{toolbar:!0,initialViewIndex:b},images:xe})},ue=async()=>{var b;const xe=await Wn({businessType:"image_set_replication"});xe.code===0&&((b=xe.data)!=null&&b.length)&&(fe.value.modelSkuId=xe.data[0].id)},ke=async xe=>{S.value=!0,await _.fetchAdMaterialOptions(),await ue(),fe.value.language=G,V.value=Ic,w.value="",I.value=!1,k.value="",L.value=[],ae.value=xe||[],We(ae.value)},et=()=>{de.value&&de.value.clearImg(),Y.value&&Y.value.clearImg(),L.value=[],K.value=[],S.value=!1},lt=()=>{if(R.value){Zt.confirm({title:x("strategy-generator.index.033017-10"),icon:St(pa),content:x("qinghu-ai.batch-generate-image.423573-1"),maskClosable:!1,keyboard:!1,cancelText:x("qinghu-ai.batch-generate-image.423573-2"),okText:x("qinghu-ai.batch-generate-image.423573-3"),onOk(){U.push({path:"/upgrade",query:{type:"vip"}})},onCancel(){}});return}if(!ae.value.length){qe.error(x("components-qinghu-ai.batch-generate-image.407726-49"));return}if(!K.value.length){qe.error(x("components-qinghu-ai.batch-image-replication.407726-68"));return}const b={images:L.value.map(Z=>({imageUrl:Z.imageUrl,type:Z.type,content:Z.type==="2"?Z.content.trim():""})),productImages:K.value,type:_.aiMessageType,...fe.value,language:fe.value.language,consumptionCountText:x("components-common.VideoDownloadButton.658492-23",[ne.value.score]),subType:c.subType,prompt:Ve.value};o("send",b,H.value)},je=async()=>{const xe={modelSkuId:53,type:"IMAGE",inputImageCount:K.value.length,count:ae.value.length},b=JSON.stringify(xe);if(b===le.value)return;le.value=b;const Z=await bn(xe);ne.value=Z.code===0?Z.data:{}},_t=yn(()=>{je()},Rw),vt=F(()=>{var xe;return(xe=ne.value)!=null&&xe.score?x("components-qinghu-ai.batch-generate-image.407726-52",[ne.value.score]):""}),rt=F(()=>{const xe=ce.value.find(b=>(b==null?void 0:b.type)==="custom");return(xe==null?void 0:xe.config)||{}}),ct=xe=>{const b=Math.round(1/xe);return xe>0&&xe<1&&Math.abs(1/xe-b)<1e-6?`1/${b}`:Number.isInteger(xe)?`${xe}`:`${xe}`},Tt=F(()=>{if(!Array.isArray(rt.value.scope)||rt.value.scope.length!==2)return"";const[xe,b]=rt.value.scope;return`[${xe}, ${b}]`}),_a=F(()=>{if(!Array.isArray(rt.value.aspectRatioScope)||rt.value.aspectRatioScope.length!==2)return"";const[xe,b]=rt.value.aspectRatioScope;return`[${ct(xe)}, ${ct(b)}]`});Ne(()=>[K.value.length,ae.value.length],()=>{_t()}),Ne(Ce,()=>{ce.value=Ce.value,ce.value.length&&(fe.value.size="",fe.value.aspectRatio="",fe.value.quality="",T())},{immediate:!0,deep:!0});const ha=async xe=>{ae.value.length>=gs||(ae.value.push(xe.imageUrl),de.value&&de.value.updateImg())},Aa=async xe=>{K.value.length>=On||(K.value.push(xe.imageUrl),K.value.length>Cc&&m(),Y.value&&Y.value.updateImg())};return fa(()=>{_t.cancel()}),g({open:ke,close:et}),(xe,b)=>{const Z=Lt,Ie=Oa,Pe=Bt,yt=As,Yt=Wt,aa=ga,Jt=Qa,Ua=Ya,eo=ca,Ka=ba,xt=Ba;return l(),ve(xt,{open:e(S),"onUpdate:open":b[25]||(b[25]=Ke=>Fe(S)?S.value=Ke:null),width:860,closable:!1,maskClosable:!1,class:"batch-modify-image-drawer"},{footer:P(()=>[t("div",Nw,[y(Z,{type:"primary",size:"large",class:"w-full!",disabled:!e(ae).length,onClick:lt},{default:P(()=>[De(r(e(x)("components.VideoEditModal.123456-5")),1),t("span",null,r(e(vt)),1)]),_:1},8,["disabled"])])]),default:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:b[0]||(b[0]=Ke=>ut(!1))}),t("div",null,[t("div",null,[t("div",_k,[t("div",yk,r(e(Ve)),1),t("div",xk,r(e(x)("components-qinghu-ai.batch-image-replication.407726-54")),1)]),t("div",bk,[t("div",Ik,[t("span",Ck,r(e(x)("components-qinghu-ai.batch-generate-image.407726-41")),1),t("div",kk,[t("div",wk,[(l(!0),f(we,null,Je(e(a),Ke=>(l(),f("div",{key:Ke},[t("img",{src:Ke,alt:"",class:"w-46px h-46px rounded-5px!"},null,8,Pk)]))),128))]),b[26]||(b[26]=t("div",{class:"text-48px color-#F1F1F1 px-10px"},"+",-1)),b[27]||(b[27]=t("div",null,[t("img",{src:"https://res.menglar.com/crm/56471775542714872.png",alt:"",class:"w-60px h-60px rounded-5px!"})],-1)),b[28]||(b[28]=t("div",{class:"px-10px"},[t("img",{src:zl,alt:"",class:"w-64px h-54px",style:{transform:"rotateZ(-10deg)"}})],-1)),t("div",Mk,[(l(!0),f(we,null,Je(e(E),Ke=>(l(),f("img",{key:Ke,src:Ke,alt:"",class:"w-60px h-60px rounded-5px!"},null,8,Sk))),128))])])])]),t("div",$k,[t("div",Tk,[t("div",Ak,[t("div",null,[t("span",null,[b[29]||(b[29]=t("em",null,"*",-1)),De(r(e(x)("qinghu-ai.video-script.120875-24")),1)]),t("span",Uk,r(e(x)("components-qinghu-ai.batch-generate-image.407726-38")),1)]),y(yt,{open:e(j),"onUpdate:open":b[7]||(b[7]=Ke=>Fe(j)?j.value=Ke:null),trigger:["click"],placement:"bottomRight",overlayClassName:"batch-reference-prompt-dropdown"},{overlay:P(()=>[t("div",{class:"batch-reference-prompt-menu",onClick:b[6]||(b[6]=Be(()=>{},["stop"]))},[t("div",Lk,r(e(x)("components-qinghu-ai.batch-main-image-replication.407726-71")),1
128),(l(!0),f(we,null,Je(e(Me),Ke=>(l(),f(we,{key:Ke.value},[Ke.value==="2"?(l(),ve(Pe,{key:0,open:e(I),"onUpdate:open":b[4]||(b[4]=Ct=>Fe(I)?I.value=Ct:null),trigger:"click",placement:"rightTop",arrow:!1,overlayClassName:"batch-custom-prompt-popover",getPopupContainer:Ct=>Ct.parentElement||xe.document.body,onOpenChange:ft},{content:P(()=>[t("div",{class:"batch-custom-prompt-panel",onClick:b[2]||(b[2]=Be(()=>{},["stop"]))},[t("div",Ek,r(e(x)("components-qinghu-ai.batch-main-image-replication.407726-73")),1),y(Ie,{value:e(k),"onUpdate:value":b[1]||(b[1]=Ct=>Fe(k)?k.value=Ct:null),class:"batch-custom-prompt-input",maxlength:Pl,"show-count":"",placeholder:e(x)("components-qinghu-ai.batch-image-replication-drawer.446330-46"),"auto-size":{minRows:4,maxRows:4}},null,8,["value","placeholder"]),t("div",qk,[y(Z,{size:"small",type:"primary",onClick:Ue},{default:P(()=>[De(r(e(x)("agent-collection.index.198242-5")),1)]),_:1}),y(Z,{size:"small",onClick:He},{default:P(()=>[De(r(e(x)("account.change-account-copy.890079-2")),1)]),_:1})])])]),default:P(()=>[t("div",{class:Qe(["menu-item",{active:e(V)===Ke.value}]),onMouseenter:Ct=>B.value=Ke.value,onMouseleave:b[3]||(b[3]=Ct=>B.value="")},[t("img",{src:ot(Ke.value,e(V)===Ke.value||e(B)===Ke.value),alt:"",class:"menu-icon"},null,8,Ok),t("span",null,r(Ke.label),1)],42,Dk)]),_:2},1032,["open","getPopupContainer"])):(l(),f("div",{key:1,class:Qe(["menu-item",{active:e(V)===Ke.value}]),onMouseenter:Ct=>B.value=Ke.value,onMouseleave:b[5]||(b[5]=Ct=>B.value=""),onClick:Ct=>wt(Ke.value)},[t("img",{src:ot(Ke.value,e(V)===Ke.value||e(B)===Ke.value),alt:"",class:"menu-icon"},null,8,Rk),t("span",null,r(Ke.label),1)],42,Nk))],64))),128))])]),default:P(()=>[y(Z,{class:"batch-reference-setting-btn"},{default:P(()=>[De(r(e(x)("components-qinghu-ai.batch-main-image-replication.407726-70"))+" ",1),y(e(Co),{class:"text-10px"})]),_:1})]),_:1},8,["open"])]),t("div",Fk,[ua(t("div",null,[y(aa,{ref_key:"referenceUploadRef",ref:de,name:"file",temp:!1,multiple:!0,showUploadList:!1,maxCount:gs,uploadBizType:"COMMON_IMAGE",openFileDialogOnClick:!1,onStartUploading:b[9]||(b[9]=Ke=>O.value=!0),onEndUploading:b[10]||(b[10]=Ke=>O.value=!1),onSuccess:b[11]||(b[11]=(Ke,Ct)=>Ut(Ct)),onLoading:b[12]||(b[12]=Ke=>O.value=Ke),validateWH:!1,class:"batch-reference-drop-upload",value:e(ae),"onUpdate:value":b[13]||(b[13]=Ke=>Fe(ae)?ae.value=Ke:null)},{default:P(()=>[y(Pe,null,{content:P(()=>[t("div",null,[t("div",Gk,[t("div",Vk,[b[30]||(b[30]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(x)("qinghu-ai.video-batch-generate.797009-0")),1)])]),t("div",zk,[e(O)?(l(),f("div",Bk,[y(Yt),t("div",null,r(e(x)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",{key:1,class:"w-full h-full cursor-pointer flex flex-col items-center justify-center",onClick:b[8]||(b[8]=Be(Ke=>{var Ct;return(Ct=e(de))==null?void 0:Ct.openFileDialog()},["stop"]))},[b[31]||(b[31]=t("div",{class:""},[t("img",{src:ka,alt:"",class:"w-28px h-28px"})],-1)),t("div",Kk,r(e(x)("qinghu-ai.long-upload-material.697730-6",[gs])),1),t("div",Wk,r(e(x)("qinghu-ai.video-batch-generate.797009-6")),1)]))]),y(Sa,{ref:"historyImageRef",onClickItem:ha},null,512)])]),default:P(()=>[t("div",{class:Qe(["reference-upload-slot",{"is-dragging":e(W)}]),onDragenter:Be(te,["prevent"]),onDragover:Be(Q,["prevent"]),onDragleave:Be(ie,["prevent"]),onDrop:oe},[e(O)?(l(),ve(Yt,{key:0})):(l(),f("div",jk,[b[32]||(b[32]=t("img",{src:ou,alt:"",class:"w-20px h-20px"},null,-1)),t("div",Hk,r(e(x)("form-builder.ImgUrl.225105-1")),1),t("div",Jk,[t("div",null,r(e(x)("components-qinghu-ai.batch-main-image-replication.407726-75")),1)])]))],34)]),_:1})]),_:1},8,["value"])],512),[[da,e(ae).length<gs]]),(l(!0),f(we,null,Je(e(L),(Ke,Ct)=>(l(),f("div",{key:Ke.imageUrl,class:"reference-prompt-card"},[t("button",{class:"reference-delete-btn",type:"button",onClick:Be(na=>Ot(Ct),["stop"])},[y(e(ma))],8,Yk),t("img",{src:Ke.imageUrl,alt:"",class:"reference-card-img",referrerPolicy:"no-referrer",onClick:na=>sa(e(ae),Ct)},null,8,Qk),y(Ua,{value:Ke.type,"onUpdate:value":na=>Ke.type=na,class:"reference-prompt-select",popupClassName:"reference-prompt-select-dropdown",bordered:!1},{default:P(()=>[(l(!0),f(we,null,Je(e(Me),na=>(l(),ve(Jt,{key:na.value,value:na.value},{default:P(()=>[t("span",{class:"reference-select-option",onMouseenter:Ds=>be.value=na.value,onMouseleave:b[14]||(b[14]=Ds=>be.value="")},[t("img",{src:ot(na.value,Ke.type===na.value||e(be)===na.value),alt:"",class:"w-14px h-14px"},null,8,Zk),t("span",null,r(na.label),1)],40,Xk)]),_:2},1032,["value"]))),128))]),_:2},1032,["value","onUpdate:value"]),it(Ke.type)?(l(),f("div",ew,[y(Ie,{value:Ke.content,"onUpdate:value":na=>Ke.content=na,class:"reference-prompt-textarea",maxlength:Pl,placeholder:e(x)("components-qinghu-ai.batch-main-image-replication.407726-78"),"auto-size":{minRows:5,maxRows:5}},null,8,["value","onUpdate:value","placeholder"]),t("div",tw,r(Ke.content.length)+"/"+r(Pl),1)])):(l(),f("div",aw,r(qt(Ke.type)),1))]))),128))])]),t("div",nw,[t("div",ow,[t("span",null,[b[33]||(b[33]=t("em",null,"*",-1)),De(r(e(x)("components-qinghu-ai.batch-image-replication.407726-55")),1)]),t("span",sw,r(e(x)("components-qinghu-ai.batch-image-replication.407726-56")),1
128)]),t("div",lw,[ua(t("div",null,[y(Pe,null,{content:P(()=>[t("div",null,[t("div",iw,[t("div",rw,[b[34]||(b[34]=t("img",{src:ka,alt:"",class:"w-14px h-14px mr-4px"},null,-1)),t("span",null,r(e(x)("components-qinghu-ai.batch-image-replication.407726-55")),1)])]),y(aa,{ref_key:"productImgUploadRef",ref:Y,name:"coverImage",temp:!1,multiple:!0,showUploadList:!1,maxCount:On,uploadBizType:"COMMON_IMAGE",onStartUploading:b[15]||(b[15]=Ke=>N.value=!0),onEndUploading:b[16]||(b[16]=Ke=>N.value=!1),onSuccess:b[17]||(b[17]=(Ke,Ct)=>Et(Ct)),onLoading:b[18]||(b[18]=Ke=>N.value=Ke),validateWH:!1,class:"batch-reference-image-upload",value:e(K),"onUpdate:value":b[19]||(b[19]=Ke=>Fe(K)?K.value=Ke:null)},{default:P(()=>[t("div",null,[e(O)?(l(),f("div",cw,[y(Yt),t("div",null,r(e(x)("qinghu-ai.video-batch-generate.797009-2")),1)])):(l(),f("div",uw,[b[35]||(b[35]=t("div",{class:"w-full h-full flex justify-center items-center"},[t("img",{src:ka,alt:"",class:"w-28px h-28px"})],-1)),t("div",dw,r(e(x)("qinghu-ai.long-upload-material.697730-6",[On])),1),t("div",pw,r(e(x)("qinghu-ai.video-batch-generate.797009-6")),1)]))])]),_:1},8,["value"]),y(Sa,{ref:"historyImageRef",onClickItem:Aa},null,512)])]),default:P(()=>[t("div",mw,[e(N)?(l(),ve(Yt,{key:0})):(l(),f("div",gw,[t("div",fw,[b[36]||(b[36]=t("img",{src:Jn,alt:"",class:"w-16px h-16px mb-4px"},null,-1)),t("div",null,r(e(x)("form-builder.ImgUrl.225105-1")),1)])]))])]),_:1})],512),[[da,e(K).length<On]]),(l(!0),f(we,null,Je(e(K),(Ke,Ct)=>(l(),ve($a,{key:Ct,url:Ke,onOnPreview:na=>sa(e(K),Ct),styleStr:"width: 88px; height: 88px;",onOnDelete:na=>zt(Ct)},null,8,["url","onOnPreview","onOnDelete"]))),128))])]),t("div",vw,[t("div",hw,[t("span",null,r(e(x)("ai-chat.agent-params-modal.617214-0")),1)]),t("div",_w,[t("div",null,[t("div",yw,r(e(x)("components-qinghu-ai.batch-image-replication.407726-57")),1),e(Te).length?(l(),ve(Pe,{key:0,open:e(re),"onUpdate:open":b[22]||(b[22]=Ke=>Fe(re)?re.value=Ke:null),trigger:"click",placement:"bottomLeft",overlayClassName:"batch-main-ratio-popover",arrow:!1},{content:P(()=>[t("div",Iw,[t("div",Cw,r(e(x)("qinghu-ai.link-pix-params.709204-0")),1),t("div",kw,[(l(!0),f(we,null,Je(e(Te),Ke=>(l(),f("div",{key:`${Ke.key}_${Ke.quality||""}_${Ke.size||""}`,class:Qe(["cursor-pointer",{active:Ee(Ke)}])},[Ke.type!=="group"?(l(),f("div",{key:0,class:"flex justify-between items-center radio-content",onClick:Ct=>$t(Ke)},[t("div",{class:Qe(["popover-item-label",{active:Ke.type==="custom"&&e(fe).size.includes("custom_")}])},[De(r(Ke.label)+" ",1),Ke.type==="custom"?(l(),ve(eo,{key:0},{title:P(()=>[t("div",Pw,[e(Tt)?(l(),f(we,{key:0},[t("span",null,r(e(x)("components-qinghu-ai.link-pix-params.738063-113")),1),t("span",null,r(e(Tt)),1)],64)):he("",!0),e(_a)?(l(),f(we,{key:1},[t("span",null,r(e(x)("components-qinghu-ai.link-pix-params.738063-114")),1),t("span",null,r(e(_a)),1)],64)):he("",!0)])]),default:P(()=>[y(e(pa))]),_:1})):he("",!0)],2),Ke.type==="custom"?(l(),f("div",Mw,[y(Ka,{value:e(_e),"onUpdate:value":b[20]||(b[20]=Ct=>Fe(_e)?_e.value=Ct:null),ref_for:!0,ref_key:"mainWidthInputRef",ref:ye,bordered:!1,"addon-after":e(x)("components-qinghu-ai.link-pix-params.738063-115"),onPressEnter:ea,onBlur:ea},null,8,["value","addon-after"]),y(Ka,{value:e(Re),"onUpdate:value":b[21]||(b[21]=Ct=>Fe(Re)?Re.value=Ct:null),ref_for:!0,ref_key:"mainHeightInputRef",ref:me,bordered:!1,"addon-after":e(x)("components-qinghu-ai.link-pix-params.738063-116"),onPressEnter:ea,onBlur:ea},null,8,["value","addon-after"])])):he("",!0),Ke.type==="single"?(l(),f("div",Sw,r(Ke.showSize||Ke.size),1)):he("",!0)],8,ww)):(l(),f("div",$w,[t("div",Tw,r(Ke.label),1),(l(!0),f(we,null,Je(X(Ke.children),Ct=>(l(),f("div",{key:`${Ct.key}_${Ct.quality||""}_${Ct.size||""}`,class:Qe(["flex justify-between items-center mx-10px p-12px h-30px rounded-4px cursor-pointer popover-group-label hover:bg-#F6F6F6! group",{active:Ee(Ct)}]),onClick:Be(na=>Ht(Ct),["stop"])},[t("div",Uw,[Ct.icon?(l(),f("img",{key:0,src:e(Ms)(Ct.icon),class:"w-16px h-16px",alt:""},null,8,Lw)):(l(),ve(e(fu),{key:1,class:"w-16px h-16px"})),t("span",Ew,r(Ct.label),1)]),t("span",qw,r(Ct.showSize||Ct.size),1)],10,Aw))),128))]))],2))),128))])])]),default:P(()=>[t("div",xw,[t("span",bw,r(e(Ye)),1),y(e(Co),{class:"mode-trigger-arrow"})])]),_:1},8,["open"])):(l(),ve(Ua,{key:1,ref:"select",value:e(fe).aspectRatio,"onUpdate:value":b[23]||(b[23]=Ke=>e(fe).aspectRatio=Ke),style:{width:"290px"}},{default:P(()=>[(l(!0),f(we,null,Je(e(z),(Ke,Ct)=>(l(),ve(Jt,{value:Ke.value,key:Ct},{default:P(()=>[De(r(Ke.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]))]),t("div",Dw,[t("div",Ow,r(e(x)("qinghu-ai.long-image-params.227781-9")),1),y(Ua,{value:e(fe).language,"onUpdate:value":b[24]||(b[24]=Ke=>e(fe).language=Ke),style:{width:"290px"}},{default:P(()=>[(l(),f(we,null,Je(q,Ke=>y(Jt,{key:Ke.name,value:Ke.name},{default:P(()=>[De(r(Ke.name),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])])])])])])])]),_:1},8,["open"])}}}),Fw=Dt({__name:"batch-main-image-replication",emits:["send"],setup(u,{expose:g,emit:i}){const c=i,o=h(null),x=(p,d)=>{c("send",p,d)};return g({open:p=>{var d;(d=o.value)==null||d.open(p)},close:()=>{var p;(p=o.value)==null||p.close()}}),(p,d)=>(l(),ve(Ku,{ref_key:"drawerRef",ref:o,"sub-type":"image_main_batch_replace",onSend:x},null,512))}}),Gw={style:{width:"700px"}},Vw={class:"flex items-center"},zw={class:"flex justify-end mb-10px"},Bw={class:"prompt-generation-popover"},Kw={class:"text-[#000]"},Ww={key:1,class:"w-full h-full flex justify-center items-center"},jw={class:"flex gap-8px justify-center"},Hw={class:"h-full px-14px py-24px relative group"},Jw={class:"flex items-center h-12px"},Yw={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},Qw={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},Xw={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},Zw=Dt({__name:"image-prompt-generation",props:{isChatPinned:{type:Boolean,default:!1}},emits:["updatePrompt","submit"],setup(u,{expose:g,emit:i}){const c=i,{t:o,locale:x}=mt(),_=Kt(),m=wa(),p=oa(),d=bt(),R=h(!1),U=h(!1),G=h(),a=h(),E=h({images:[],imageList:[],pointDescription:"",productName:"",promptType:"",language:""}),z=h(null),q=h("");Ne(()=>U.value,V=>{var w;V&&(E.value={pointDescription:"",productName:"",promptType:"",images:[],imageList:[]},(w=d.batchUploadImgUrls)!=null&&w.length&&(E.value.imageList=d.batchUploadImgUrls,E.value.images=[],setTimeout(()=>{tt(()=>{var I;(I=a==null?void 0:a.value)==null||I.updateImg(),de(),W()})},100)))});const S=V=>{tt(()=>{U.value=V}
128)},O=h(!1),N=async()=>{var V;O.value=!0;try{await G.value.validate(),E.value.images=(V=$())!=null&&V.file?[$().file]:[],E.value.promptType="IMAGE_DEFAULT",S(!1),d.batchUploadImgUrls=E.value.images,c("submit"),await L()}catch{}finally{O.value=!1}},ae=V=>{E.value.imageList=typeof V=="string"?[V]:V,tt(()=>{de(),W()})},L=async()=>{z.value=new AbortController,q.value="",Ol(d),c("updatePrompt",{prompt:q.value,status:"start"}),await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":x.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({...E.value,language:o("components.VideoTranslationParams.738063-22")}),signal:z.value.signal,openWhenHidden:!0,onmessage(V){try{const w=JSON.parse(V.data),{role:I,type:k,data:B}=w||{};if(k==="chat_number_over")return z.value.abort(),z.value=null,m.confirm({title:o("qinghu-ai.prompt-generation.616079-3"),icon:St(ra),content:B,cancelText:o("qinghu-ai.prompt-generation.616079-4"),okText:o("qinghu-ai.prompt-generation.616079-5"),keyboard:!1,maskClosable:!1,onOk(){_.push("/product?product=vip")}});I==="assistant"&&k==="answer"&&typeof B=="string"&&(q.value+=B,c("updatePrompt",{prompt:q.value,status:"updating"}))}catch{}},async onopen(V){if(V.status&&["401","500","600"].includes(String(V.status)))if(V.status==401){p.error(o("qinghu-ai.prompt-generation.616079-8"));let w=setTimeout(()=>{clearTimeout(w),window.location.reload()},600)}else(V.status==500||V.status==600)&&p.error(o("qinghu-ai.prompt-generation.616079-9"));return Promise.resolve()},onerror(V){p.error(o("qinghu-ai.prompt-generation.616079-11")),z.value.abort(),z.value=null},async onclose(){O.value=!1,c("updatePrompt",{prompt:q.value,status:"finish"})}})};Ne(()=>E.value.imageList,async()=>{await tt(),de(),W()},{deep:!0,immediate:!0});function K(V){document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item").forEach(w=>{w.classList.remove("selected")}),V.target.classList.add("selected")}function de(){document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item-container .ant-upload-list-item").forEach((w,I)=>{w.addEventListener("click",K)})}function W(){const V=document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item");E.value.imageList.length>0&&V[0]&&(document.querySelector(".prompt-generation-popover .ant-upload-list-item.selected")||V[0].classList.add("selected"))}function $(){const V=document.querySelector(".prompt-generation-popover .ant-upload-list-item.selected");if(!V)return null;const w=document.querySelectorAll(".prompt-generation-popover .ant-upload-list-item-container"),I=V.closest(".prompt-generation-popover .ant-upload-list-item-container");if(!I)return null;const k=Array.from(w).indexOf(I);return{file:E.value.imageList[k],index:k}}const Y=Jl(async()=>{O.value=!0;try{await G.value.validate();let V=await Gl({imageList:E.value.imageList,pointDescription:E.value.pointDescription,productName:E.value.productName});V.success?p.success(o("strategy-generator.index.033017-14")):p.error(V.message||o("utils.request.932181-2"))}catch{}finally{O.value=!1}},1e3),j=V=>{E.value.productName=V.productName||"",E.value.pointDescription=V.pointDescription||"",E.value.imageList=V.imageList||[],tt(()=>{var w;(w=a.value)==null||w.updateImg(),de(),W()})};return Rt(()=>{de()}),g({ChangePopover:S}),(V,w)=>{const I=ni,k=Wt,B=ca,be=Ql,ne=ba,le=Oa,ce=Yl,J=Lt,oe=Zt;return l(),f("div",null,[y(oe,{title:e(o)("qinghu-ai.prompt-generation.873104-0"),class:"prompt-generation-modal",width:764,footer:null,getPopupContainer:te=>te.parentNode,open:e(U),"onUpdate:open":w[4]||(w[4]=te=>Fe(U)?U.value=te:null)},{default:P(()=>[t("div",Gw,[t("div",Vw,[y(I,{hideIcon:!1,class:"px-0! mb-10px","no-bg":"",hideUpdateBtn:"",tip:`${e(o)("qinghu-ai.video-script.120875-22")}${e(o)("qinghu-ai.video-script.120875-23")}`},null,8,["tip"]),t("div",zw,[y(ai,{onSelect:j})])]),y(ce,{model:e(E),ref_key:"formRef",ref:G,layout:"vertical","label-align":"left",class:"w-full"},{default:P(()=>[y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-17")+e(o)("qinghu-ai.prompt-generation.616079-18"),name:"productName",class:"mb-12px!"},{default:P(()=>
128[t("div",Bw,[y(ga,{ref_key:"uploadRef",ref:a,value:e(E).imageList,"onUpdate:value":w[0]||(w[0]=te=>e(E).imageList=te),name:"coverImage",temp:!1,multiple:!0,showUploadList:!0,maxCount:10,isSeedeUpload:!1,isNotRemoveFileList:!0,activeTabKey:"2",size:5*1024*1024,onLoading:w[1]||(w[1]=te=>{R.value=te}),onSuccess:ae},{default:P(()=>[y(B,{color:"rgba(255,255,255)"},{title:P(()=>[t("div",Kw,[t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-19"))+"("+r(e(o)("qinghu-ai.prompt-generation.616079-20"))+")"+r(e(o)("qinghu-ai.prompt-generation.616079-21")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-22"))+"(px)>14px",1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-23")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-24")),1),t("div",null,r(e(o)("qinghu-ai.prompt-generation.616079-25")),1)])]),default:P(()=>[e(R)?(l(),ve(k,{key:0})):(l(),f("div",Ww,[...w[7]||(w[7]=[t("img",{src:xa,alt:"",class:"w-16px h-16px"},null,-1)])]))]),_:1})]),_:1},8,["value"])])]),_:1},8,["label"]),y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-26"),name:"productName",required:"",class:"mb-12px!",rules:[{required:!0,message:e(o)("qinghu-ai.prompt-generation.616079-27")}]},{default:P(()=>[y(ne,{value:e(E).productName,"onUpdate:value":w[2]||(w[2]=te=>e(E).productName=te),placeholder:e(o)("qinghu-ai.prompt-generation.616079-28")},null,8,["value","placeholder"])]),_:1},8,["label","rules"]),y(be,{label:e(o)("qinghu-ai.prompt-generation.616079-29"),name:"pointDescription",class:"mb-12px!"},{default:P(()=>[y(le,{value:e(E).pointDescription,"onUpdate:value":w[3]||(w[3]=te=>e(E).pointDescription=te),rows:3},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"]),t("div",jw,[y(J,{class:"w-120px",type:"primary",loading:e(O),onClick:e(Y),ghost:""},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script-form.964932-0")),1)]),_:1},8,["loading","onClick"]),y(J,{class:"w-120px",type:"primary",loading:e(O),onClick:N},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script.120875-23")),1)]),_:1},8,["loading"])])])]),_:1},8,["title","getPopupContainer","open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:w[6]||(w[6]=Be(te=>S(!0),["stop"]))},[w[10]||(w[10]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",Xw,r(e(o)("qinghu-ai.video-script.712132-0")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:w[5]||(w[5]=te=>S(!0))},[t("div",Hw,[t("div",Jw,[w[8]||(w[8]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",Yw,r(e(o)("qinghu-ai.prompt-generation.873104-0")),1)]),t("div",Qw,r(e(o)("qinghu-ai.prompt-generation.873104-1")),1),w[9]||(w[9]=t("img",{src:y1,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),eP={class:"pose-suite"},tP={class:"pose-suite-example"},aP={class:"pose-suite-example__card"},nP={class:"pose-suite-example__btn"},oP={class:"flex"},sP={class:"pose-suite-example__product"},lP=["src"],iP={class:"pose-suite-example__arrow"},rP=["src"],cP={class:"pose-suite-example__results"},uP=["src","alt"],dP={class:"pose-suite-form"},pP={class:"pose-suite-form__item"},mP={class:"pose-suite-upload-list"},gP={class:"pose-suite-upload__inner"},fP=["src"],vP={class:"pose-suite-form__item"},hP={class:"pose-suite-form__label pose-suite-form__label--between"},_P=["src"],yP={class:"pose-suite-action-list"},xP=["onClick"],bP=["disabled"],IP={class:"pose-suite-form__item"},CP={class:"pose-suite-param-panel"},kP={class:"pose-suite-help"},wP={class:"pose-suite-help__header"},PP={class:"pose-suite-help__control"},MP={class:"pose-suite-help__actions"},SP={class:"pose-suite-footer"},$P={key:0,class:"pose-suite-submit__estimate"},TP=["src"],Nn=10,kc=300,AP=200,wc="fashion_pose_image_set",UP="fashion_pose_action_prompt",fs="<ACTION_START:",Ml="<ACTION_END:",Rn=">",LP={__name:"pose-suite-drawer",props:{open:{type:Boolean,default:!1}},emits:["update:open","send"],setup(u,{emit:g}){const i=["ä¸","äº","ä¸","å","äº","å
","ä¸","å
«","ä¹","å"],c=[I1,C1,k1],o=u,x=g,{t:_,locale:m}=mt(),p=bt(),d=la(),{userInfo:R}=va(d),U=F(()=>{var Me;return(Me=R==null?void 0:R.value)==null?void 0:Me.defaultVip}),G=oa(),a=wa(),E=Kt(),z=h(null),q=h([]),S=h([""]),O=h(!1),N=h(!1),ae=h(4),L=h(!1),K=h(!1),de=h({}),W=h(""),$=h(0),Y=h(""),j=h(-1),V=h(""),w=h(!1),I=h({size:"",quality:"",aspectRatio:"",modelSkuId:""}),k=F({get:()=>
128o.open,set:Me=>{x("update:open",Me)}}),B=F(()=>p.imageOptions.find(Me=>Me.value===p.mainImageChatMode)),be=Me=>(p.imageOptions||[]).find(D=>D.id===Me)||B.value||{},ne=Me=>{var Ae;const D=(Ae=be(Me))==null?void 0:Ae.supportedAspectRatios;if(Array.isArray(D))return D;if(!D)return[];try{return JSON.parse(D)}catch{return[]}},le=(Me="",D="",Ae="")=>{if(!Me||Me.includes("_"))return Me;for(const We of ne(D)){if((We==null?void 0:We.type)!=="group"||!Array.isArray(We.children))continue;const ot=We.children.find(it=>(it==null?void 0:it.size)===Me&&(it==null?void 0:it.key)&&(!Ae||!it.quality||it.quality===Ae)&&it.visible!==!1);if(ot)return`${ot.key}_${ot.size}`}return Me},ce=(Me="")=>!Me||Me.startsWith("custom_")||!Me.includes("_")?Me:Me.split("_").pop()||Me,J=F(()=>{var ot;const Me=p.imageGenerateParams||{};if(!!!(Me.size||Me.aspectRatio))return null;const Ae=Me.currentImageActiveId||((ot=B.value)==null?void 0:ot.id)||"",We=Me.quality||"";return{modelSkuId:Ae,size:le(Me.size||"",Ae,We),quality:We,aspectRatio:Me.aspectRatio||""}}),oe=F(()=>S.value.map(Me=>Me.trim()).filter(Boolean)),te=F(()=>{var D;const Me=((D=I.value)==null?void 0:D.quality)==="1K"?2:2.5;return Number((oe.value.length*Me).toFixed(2))}),Q=F(()=>{var D;return Number(((D=de.value)==null?void 0:D.score)||0)||te.value}),ie=F(()=>oe.value.length?`${Q.value} 积å`:""),_e=F(()=>q.value.length===1&&oe.value.length>0),Re=()=>{S.value=[""],N.value=!1,L.value=!1},ye=()=>{k.value=!1,Re()},me=()=>{if(!q.value.length){G.warning("请å
ä¸ä¼ ååå¾");return}N.value=!0},re=()=>{N.value=!1};Ne(()=>o.open,Me=>{Me?$.value+=1:Re()});const fe=(Me=[])=>Me.map(D=>{var Ae;return((Ae=D==null?void 0:D.response)==null?void 0:Ae.payload)||null}).filter(Boolean),Oe=(Me,D=[])=>{const Ae=fe(D);Ae.length&&(q.value=[Ae[Ae.length-1]])},Ve=Me=>{var Ae;const D=q.value[Me];q.value.splice(Me,1),(Ae=z.value)==null||Ae.remove(D)},H=(Me,D=0)=>{Ta({options:{toolbar:!0,initialViewIndex:D},images:Me})},st=Me=>`å¨ä½${i[Me]||Me+1}`,ge=()=>{S.value.length>=Nn||S.value.push("")},Ce=Me=>{if(S.value.length<=1){S.value=[""];return}S.value.splice(Me,1)},$e=()=>{Y.value="",j.value=-1,V.value="",w.value=!1},at=Me=>{const D=Number(Me);return!Number.isInteger(D)||D<0?-1:D>0?D-1:0},nt=Me=>{if(Me<0||Me>=Nn)return!1;for(;S.value.length<=Me;)S.value.push("");return!0},Se=()=>{const Me=Math.min(Math.max(Number(ae.value)||1,1),Nn);S.value=Array.from({length:Me},()=>"")},se=(Me,D)=>{!D||!nt(Me)||(S.value[Me]=`${S.value[Me]||""}${D}`.slice(0,kc))},Te=()=>{const Me=Y.value.indexOf(fs);if(Me<0)return null;const D=Me+fs.length,Ae=Y.value.indexOf(Rn,D);if(Ae<0)return null;const We=Y.value.slice(D,Ae).trim();return{index:at(We),rawIndex:We,nextBufferStart:Ae+Rn.length,startIndex:Me}},Xe=(Me="")=>{if(Me)for(Y.value+=Me;Y.value;){if(j.value<0){const We=Te();if(!We)return;if(Y.value=Y.value.slice(We.nextBufferStart),!nt(We.index))continue;w.value=!0,j.value=We.index,V.value=We.rawIndex,S.value[We.index]=""}const D=`${Ml}${V.value}${Rn}`,Ae=Y.value.indexOf(D);if(Ae<0){const We=Math.max(0,Y.value.length-D.length+1),ot=Y.value.slice(0,We);se(j.value,ot),Y.value=Y.value.slice(We);return}se(j.value,Y.value.slice(0,Ae)),Y.value=Y.value.slice(Ae+D.length),j.value=-1,V.value=""}},pt=(Me="",D=ae.value)=>{const Ae=Me.split(/\r?\n|ï¼|;/).map(ot=>ot.replace(/^\s*(?:\d+[\.ã)]|[-*])\s*/,"").trim()).filter(Boolean);if(Ae.length>=D)return Ae.slice(0,D);const We=Me.split(/[ã.!ï¼?ï¼]/).map(ot=>ot.replace(/^\s*(?:\d+[\.\ã\)]|[-*])\s*/,"").trim()).filter(Boolean);return(Ae.length?Ae:We).slice(0,D)},gt=Me=>{const D=pt(Me);if(!D.length){G.warning("æªçæææå¨ä½æä»¤ï¼è¯·ç¨åéè¯");return}S.value=D,N.value=!1},Ge=async()=>{if(!q.value.length){G.warning("请å
ä¸ä¼ ååå¾");return}L.value=!0,$e(),Se();let Me="";const D=new AbortController,Ae=`${fs}1${Rn}å¨ä½ææ¡${Ml}1${Rn}`;try{await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":m.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({images:q.value,imageList:q.value,promptType:UP,actionGroupStartMark:fs,actionGroupEndMark:Ml,actionGroupMarkClose:Rn,actionGroupOutputRule:Ae,groupCount:ae.value,language:"䏿",productName:"æè£
å§¿å¿å¥å¾",pointDescription:`è¯·æ ¹æ®ååå¾çæ${ae.value}ç»æè£
ææå¨ä½æä»¤ãæ¯ç»åªåä¸ä¸ªå¨ä½ï¼éåçµåæè£
主å¾ï¼çªåºæ¨¡ç¹å§¿æãæé¨å¨ä½ãè§çº¿åèº«ä½æåãè¯·ä¸¥æ ¼æåç
128»æ è®°è¾åºï¼æ¯ç»æ ¼å¼ï¼${Ae}ãå¤ç» index 便¬¡éå¢ï¼ä¸è¦è¾åºæ è®°å¤çè§£éã`}),signal:D.signal,openWhenHidden:!0,onmessage(We){try{const ot=JSON.parse(We.data),{role:it,type:qt,data:Gt}=ot||{};if(qt==="chat_number_over")return D.abort(),a.confirm({title:"æç¤ºè¯çææ¬¡æ°ä¸è¶³",icon:St(ra),content:Gt,cancelText:_("qinghu-ai.prompt-generation.616079-4"),okText:_("qinghu-ai.prompt-generation.616079-5"),keyboard:!1,maskClosable:!1,onOk(){Kt().push("/product?product=vip")}});it==="assistant"&&qt==="answer"&&typeof Gt=="string"&&(Me+=Gt,Xe(Gt))}catch{}},onerror(We){G.error("å¨ä½æä»¤çæå¤±è´¥ï¼è¯·ç¨åéè¯"),D.abort()},onclose(){if(w.value){j.value>=0&&Y.value&&se(j.value,Y.value),oe.value.length?N.value=!1:G.warning("æªçæææå¨ä½æä»¤ï¼è¯·ç¨åéè¯"),$e();return}gt(Me),$e()}})}catch{D.signal.aborted||G.error("å¨ä½æä»¤çæå¤±è´¥ï¼è¯·ç¨åéè¯")}finally{L.value=!1}},T=async()=>{var Ae;if(!((Ae=I.value)!=null&&Ae.modelSkuId)||!oe.value.length){de.value={};return}const Me={modelSkuId:I.value.modelSkuId,type:"IMAGE",subType:wc,count:oe.value.length,quality:I.value.quality},D=JSON.stringify(Me);if(D!==W.value){W.value=D;try{const We=await bn(Me);de.value=We.code===0?We.data:{}}catch{de.value={}}}},X=yn(()=>{T()},AP),Ee=()=>{const Me=ce(I.value.size||""),D={...p.imageGenerateParams,size:Me,quality:I.value.quality||"",aspectRatio:I.value.aspectRatio||"",currentImageActiveId:I.value.modelSkuId||""};p.imageGenerateParams=D;try{localStorage.setItem("LinkPixImageConfig",JSON.stringify(D))}catch{}};Ne(()=>{var Me,D;return[(Me=I.value)==null?void 0:Me.modelSkuId,(D=I.value)==null?void 0:D.quality,oe.value.length,q.value.length]},()=>X()),fa(()=>{X.cancel()});const Ye=async()=>{var Me;if(U.value&&((Me=I.value)==null?void 0:Me.quality)==="2K"){a.confirm({title:_("strategy-generator.index.033017-10"),icon:St(pa),content:_("qinghu-ai.batch-generate-image.423573-1"),maskClosable:!1,keyboard:!1,cancelText:_("agent-collection.index.198242-5"),okText:_("auth-mask.index.837851-1"),onOk(){E.push({path:"/upgrade",query:{type:"vip"}})}});return}if(!q.value.length){G.warning("请ä¸ä¼ ååå¾");return}if(!oe.value.length){G.warning("请填åå¨ä½æä»¤");return}K.value=!0;try{const D=oe.value,Ae=D.map((it,qt)=>`æç¤ºè¯${qt+1}ï¼${it}`).join(` 129`),We=_("components-common.VideoDownloadButton.658492-23",[Q.value]),ot={...I.value,size:ce(I.value.size||"")};Ee(),x("send",{images:q.value,productImages:q.value,type:p.aiMessageType,...ot,imageCount:D.length,currentImageActiveId:ot.modelSkuId,consumptionCountText:We,subType:wc,prompt:Ae,poseActions:D},"poseSuite"),k.value=!1,Re()}finally{K.value=!1}};return(Me,D)=>{const Ae=Wt,We=Oa,ot=jl,it=Hl,qt=Lt,Gt=Zt,jt=Ba;return l(),ve(jt,{open:e(k),"onUpdate:open":D[8]||(D[8]=$t=>Fe(k)?k.value=$t:null),width:668,closable:!1,maskClosable:!1,class:"pose-suite-drawer"},{footer:P(()=>[t("div",SP,[y(qt,{type:"primary",size:"large",class:"pose-suite-submit",disabled:!e(_e),loading:e(K),onClick:Ye},{default:P(()=>[D[23]||(D[23]=De(" åå»ºä»»å¡ ",-1)),e(ie)?(l(),f("span",$P,[D[22]||(D[22]=De(" ï¼é¢è®¡æ¶è ",-1)),t("img",{src:e(M1),alt:"",class:"pose-suite-submit__score"},null,8,TP),De(" "+r(e(ie))+"ï¼ ",1)])):he("",!0)]),_:1},8,["disabled","loading"])])]),default:P(()=>[y(e(ma),{class:"pose-suite-drawer__close",onClick:ye}),t("div",eP,[D[17]||(D[17]=t("div",{class:"pose-suite__header"},[t("div",{class:"pose-suite__title"},"å§¿å¿å¥å¾"),t("div",{class:"pose-suite__subtitle"},"æ ¹æ®ååå¾ï¼çæä¸åå¨ä½å§¿å¿ç主å¾å¥å¾")],-1)),t("div",tP,[t("div",aP,[t("div",nP,[D[10]||(D[10]=t("div",{class:"pose-suite-example__badge"},"使ç¨ç¤ºä¾",-1)),t("div",oP,[t("div",sP,[t("img",{src:e(x1),alt:"",class:"pose-suite-example__image"},null,8,lP)]),D[9]||(D[9]=t("div",{class:"pose-suite-example__copy"},[t("div",null,"è·¨æ¥ç©æï¼æ¬å¤´æåæçª"),t("div",null,"æèº«æåï¼å·éç´è§é头"),t("div",null,"å身æ¾å ï¼å è¡¬å°½æ¾æ µæ")],-1))])]),t("div",iP,[t("img",{src:e(b1),alt:"",class:"pose-suite-example__arrow-img"},null,8,rP)]),t("div",cP,[(l(),f(we,null,Je(c,($t,Ht)=>t("div",{key:$t,class:"pose-suite-example__result"},[t("img",{src:$t,alt:`示ä¾ç»æ${Ht+1}`,class:"pose-suite-example__image"},null,8,uP)])),64))])])]),t("div",dP,[t("div",pP,[D[12]||(D[12]=t("div",{class:"pose-suite-form__label"},[t("em",null,"*"),t("span",null,"ååå¾"),t("span",{class:"pose-suite-form__note"},"ï¼æ ¹æ®ä¸ä¼ çååå¾ï¼çæä¸åææå¨ä½ç主å¾å¥å¾ï¼")],-1)),t("div",mP,[ua(t("div",null,[y(ga,{ref_key:"productUploadRef",ref:z,name:"coverImage",temp:!1,multiple:!1,showUploadList:!1,maxCount:1,uploadBizType:"COMMON_IMAGE",validateWH:!1,class:"pose-suite-upload",value:e(q),"onUpdate:value":D[0]||(D[0]=$t=>Fe(q)?q.value=$t:null),onStartUploading:D[1]||(D[1]=$t=>O.value=!0),onEndUploading:D[2]||(D[2]=$t=>O.value=!1),onLoading:D[3]||(D[3]=$t=>O.value=$t),onSuccess:Oe},{default:P(()=>[t("div",gP,[e(O)?(l(),ve(Ae,{key:0})):(l(),f(we,{key:1},[t("img",{src:e(w1),alt:"",class:"pose-suite-upload__icon"},null,8,fP),D[11]||(D[11]=t("div",null,"ä¸ä¼ å¾ç",-1))],64))])]),_:1},8,["value"])],512),[[da,e(q).length<1]]),(l(!0),f(we,null,Je(e(q),($t,Ht)=>(l(),ve($a,{key:$t,url:$t,styleStr:"width: 60px; height: 60px;",onOnPreview:ta=>H(e(q),Ht),onOnDelete:ta=>Ve(Ht)},null,8,["url","onOnPreview","onOnDelete"]))),128))])]),t("div",vP,[t("div",hP,[D[14]||(D[14]=t("div",null,[t("em",null,"*"),t("span",null,"å¨ä½æä»¤"),t("span",{class:"pose-suite-form__note"},"ï¼ä¸ä¸ªå¨ä½æä»¤ä¸ºä¸å¼ å¾ï¼")],-1)),t("button",{type:"button",class:"pose-suite-help-trigger",onClick:me},[t("img",{src:e(P1),alt:"",class:"pose-suite-help-trigger__icon"},null,8,_P),D[13]||(D[13]=t("span",null,"帮æå",-1))])]),t("div",yP,[(l(!0),f(we,null,Je(e(S),($t,Ht)=>(l(),f("div",{key:Ht,class:"pose-suite-action-row"},[y(We,{value:e(S)[Ht],"onUpdate:value":ta=>e(S)[Ht]=ta,placeholder:st(Ht),"auto-size":{minRows:Ht===0?2:1},maxlength:kc,"allow-clear":"",class:"pose-suite-action-input"},null,8,["value","onUpdate:value","placeholder","auto-size"]),e(S).length>
1291?(l(),f("button",{key:0,type:"button",class:"pose-suite-action-delete","aria-label":"å é¤å¨ä½",title:"å é¤å¨ä½",onClick:ta=>Ce(Ht)},[y(e(H0))],8,xP)):he("",!0)]))),128)),t("button",{type:"button",class:"pose-suite-action-add",disabled:e(S).length>=Nn,onClick:ge},[y(e(Xl)),D[15]||(D[15]=t("span",null,"æ·»å ",-1))],8,bP)])]),t("div",IP,[D[16]||(D[16]=t("div",{class:"pose-suite-form__label"},"åæ°è®¾ç½®",-1)),t("div",CP,[(l(),ve(Ls,{key:e($),type:"image_batch_replace",initialParams:e(J),params:e(I),"onUpdate:params":D[4]||(D[4]=$t=>Fe(I)?I.value=$t:null)},null,8,["initialParams","params"]))])])])]),y(Gt,{open:e(N),"onUpdate:open":D[7]||(D[7]=$t=>Fe(N)?N.value=$t:null),centered:"",width:374,footer:null,closable:!1,wrapClassName:"pose-suite-help-modal"},{default:P(()=>[t("div",kP,[t("div",wP,[D[18]||(D[18]=t("div",{class:"pose-suite-help__title"},"帮æå",-1)),t("button",{type:"button",class:"pose-suite-help__close","aria-label":"å
³é",title:"å
³é",onClick:re},[y(e(ma))])]),D[21]||(D[21]=t("div",{class:"pose-suite-help__desc"},"ä¸ç¥éæä¹åå¨ä½æä»¤ï¼å¨ä¸æ¹éæ©æ°éåï¼ç¹å»âå¼å§çæâ",-1)),t("div",PP,[y(ot,{value:e(ae),"onUpdate:value":D[5]||(D[5]=$t=>Fe(ae)?ae.value=$t:null),min:1,max:Nn,class:"pose-suite-help__slider"},null,8,["value"]),y(it,{value:e(ae),"onUpdate:value":D[6]||(D[6]=$t=>Fe(ae)?ae.value=$t:null),min:1,max:Nn,size:"small"},null,8,["value"]),D[19]||(D[19]=t("span",null,"ç»",-1))]),t("div",MP,[y(qt,{type:"primary",loading:e(L),onClick:Ge},{default:P(()=>[...D[20]||(D[20]=[De("å¼å§çæ",-1)])]),_:1},8,["loading"])])])]),_:1},8,["open"])]),_:1},8,["open"])}}},EP={class:"flex items-center max-w-max"},qP={key:1},DP=["onClick"],OP={class:"h-full px-14px py-24px relative group"},NP={class:"flex items-center h-12px"},RP=["src"],FP={class:"ml-4px text-14px color-[rgba(0,0,0,1)]"},GP={key:0,class:"ml-6px bg-#ff4d4f color-white text-10px px-6px h-18px line-height-18px rounded-9px"},VP={key:1,class:"bg-[#FFEEEC] flex items-center px-2px py-2px ml-6px"},zP=["src"],BP={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},KP=["src"],WP=["onClick"],jP={class:"flex items-center"},HP=["src"],JP={class:"ml-4px text-14px color-[rgba(0,0,0,1)]"},YP={key:0,class:"ml-6px bg-#ff4d4f color-white text-10px px-6px h-18px line-height-18px rounded-9px"},QP=["src"],XP={class:"section-grid-mask section-grid-mask-left"},ZP={class:"section-grid-mask section-grid-mask-right"},eM={__name:"image-fission",props:{isChatPinned:{type:Boolean,default:!1},switchMainImageModel:{type:Function,default:null}},emits:["onClick","updatePrompt"],setup(u,{emit:g}){const i=u,c=Pa(),o=Kt(),x=la(),{userInfo:_}=va(x),m=bt(),p=g,{t:d}=mt();F(()=>m.mainImageChatMode==="FREE_GENERATION"),F(()=>m.mainImageChatMode==="SKU_GENERATION");const R=F(()=>{var ye;return(ye=_==null?void 0:_.value)==null?void 0:ye.defaultVip}),U=h(null),G=h(null),a=h(null),E=h(null),z=h(!1),q=h(null),S=h(!1),O=h(!1),N={page:"é¦é¡µ",module:"å¾åçæ",moduleCategory1:"å¾åçæ",moduleCategory2:"å¾åçæå·¥å
·åº"},ae={mainImageReplication:"click_main_image_copy",batchModifyImage:"click_batch_modify",batchReplaceImage:"click_batch_replace",batchGenerateImage:"click_batch_image",poseSuite:"click_pose_suite",productSuite:"click_batch_replace",imageTranslate:"click_batch_replace",mainImageGenerate:"click_batch_replace"},L={mainImageReplication:"ç¹å»ã主å¾å¤å»ã",batchModifyImage:"ç¹å»ãæ¹éæ¹å¾ã",batchReplaceImage:"ç¹å»ãæ¹éæ¿æ¢ã",batchGenerateImage:"ç¹å»ãæ¹éçå¾ã",poseSuite:"ç¹å»ãå§¿å¿å¥å¾ï¼æè£
ä¸ç¨ï¼ã",productSuite:"ç¹å»ã主å¾å¥å¾ã",imageTranslate:"ç¹å»ãæ¹éè¯å¾ã",mainImageGenerate:"ç¹å»ã主å¾çæã"},K={mainImageReplication:"click_main_image_copy_create",batchModifyImage:"click_batch_modify_create",batchReplaceImage:"click_batch_replace_create",batchGenerateImage:"click_batch_generate_create",poseSuite:"click_pose_suite_create"},de={mainImageReplication:"ã主å¾å¤å»ãï¼å建任å¡",batchModifyImage:"ãæ¹éæ¹å¾ãï¼å建任å¡",batchReplaceImage:"ãæ¹éæ¿æ¢ãï¼å建任å¡",batchGenerateImage:"ãæ¹éçå¾ãï¼å建任å¡",poseSuite:"ãå§¿å¿å¥å¾ï¼æè£
ä¸ç¨ï¼ãï¼å建任å¡"},W=ye=>{var re;const me=ae[ye.key];me&&kt(me,{...N,eventDesc:L[ye.key],buttonName:ye.label,label:ye.label,cardKey:ye.key,source:c.path}),(re=ye.onClick)==null||re.call(ye,ye)},$=()=>{const ye=q.value;if(!ye)return;const me=ye.scrollLeft,re=ye.scrollWidth,fe=ye.clientWidth;S.value=me>0,O.value=me+fe<re-1},Y=(ye,me)=>{Ol(m);let re="";ye===d("components.AIChatInput.738063-7")&&(re=d("qinghu-ai.image-fission.515468-1")),p("onClick",{img:"",label:ye,description:me,paramsImgs:[],name:ye,prompt:me,specComps:re})},j=()=>{Ol(m);const ye={imageUrl:"https://res.menglar.com/crm/88121765870593442.webp",name:d("link-pix.index.9326320-2"),prompt:d("components-qinghu-ai.image-fission.266484-5"),modelSkuId:28,is
129Free:!0,recommendMode:"INTELLIGENT_GENERATION",specialType:"IMAGE_TRANSLATION",supportMultiImage:!1};p("useWay",ye)},V=()=>{U.value.open()},w=()=>{G.value.open()},I=()=>{a.value.open()},k=()=>{E.value.open()},B=()=>{z.value=!0},be=async(ye,me)=>{var H,st,ge;const re=K[me];re&&kt(re,{...N,eventDesc:de[me],buttonName:"å建任å¡",cardKey:me,promptLength:((H=ye==null?void 0:ye.prompt)==null?void 0:H.length)||0,imageCount:((st=ye==null?void 0:ye.images)==null?void 0:st.length)||((ge=ye==null?void 0:ye.materialImg)==null?void 0:ge.length)||0,source:c.path}),await za(me,{type:m.LINKPIN_MAIN_IMAGE_USAGE_TYPE}),te();const fe=JSON.parse(JSON.stringify(ye)),Oe={...ye,mainImageParams:fe};o.push({path:"/linkpix/generation"}),a.value&&a.value.close(),U.value&&U.value.close(),G.value&&G.value.close(),E.value&&E.value.close();const Ve=ye.prompt;setTimeout(()=>{m.createAsyncTask(Ve,Oe),m.scrollToBottomNum=m.scrollToBottomNum+1},3e3)},ne=async ye=>{p("updatePrompt",ye)},le=async()=>{kt("click_prompt_polish_img",{...N,eventDesc:"ç¹å»ãæç¤ºè¯æ¶¦è²ã",buttonName:"æç¤ºè¯æ¶¦è²",source:c.path}),await za("imagePromptGeneration",{type:m.LINKPIN_MAIN_IMAGE_USAGE_TYPE}),te()},ce=F(()=>[{key:"imagePromptGeneration",type:"component",component:Zw,componentProps:{isChatPinned:i.isChatPinned},componentEvents:{updatePrompt:ne,submit:le}},{key:"poseSuite",type:"card",label:"å§¿å¿å¥å¾ï¼æè£
ä¸ç¨ï¼",description:"æ ¹æ®åèå¾ï¼çæå®æ´æè£
å¥å¾",icon:Ul,highlightImage:S1,showNew:!0,onClick:()=>{m.mainImageCardClickKey="",B()}},{key:"mainImageReplication",type:"card",label:d("qinghu-ai.image-fission.main-image-replication"),description:d("qinghu-ai.image-fission.main-image-replication-desc"),icon:T1,highlightImage:$1,disabled:R.value,tooltipTitle:d("components-qinghu-ai.detail-image-copy.407726-101"),showNew:!0,onClick:ye=>{k()}},{key:"batchModifyImage",type:"card",label:d("qinghu-ai.image-fission.batch-modify"),description:d("qinghu-ai.image-fission.batch-modify-desc"),icon:U1,highlightImage:A1,disabled:R.value,tooltipTitle:d("components-qinghu-ai.detail-image-copy.407726-101"),showNew:!0,onClick:ye=>{m.mainImageCardClickKey="",V()}},{key:"batchReplaceImage",type:"card",label:d("qinghu-ai.image-fission.batch-replace"),description:d("qinghu-ai.image-fission.batch-replace-desc"),icon:E1,highlightImage:L1,disabled:R.value,tooltipTitle:d("components-qinghu-ai.detail-image-copy.407726-101"),showNew:!0,onClick:ye=>{m.mainImageCardClickKey="",I()}},{key:"batchGenerateImage",type:"card",label:d("qinghu-ai.image-fission.batch-generate"),description:d("qinghu-ai.image-fission.batch-generate-desc"),icon:D1,highlightImage:q1,disabled:R.value,tooltipTitle:d("components-qinghu-ai.detail-image-copy.407726-101"),showNew:!0,onClick:ye=>{m.mainImageCardClickKey="",w()}},{key:"productSuite",type:"card",label:d("ai-guide-popup.index.product-suite"),description:d("ai-guide-popup.index.product-suite-desc"),icon:N1,highlightImage:O1,onClick:ye=>{m.mainImageCardClickKey=ye.key,Y(d("ai-guide-popup.index.product-suite"))}},{key:"imageTranslate",type:"card",label:d("link-pix.index.9326320-2"),description:d("components-qinghu-ai.image-fission.266484-4"),icon:F1,highlightImage:R1,singleFree:!0,onClick:async ye=>{m.mainImageCardClickKey=ye.key,j()}},{key:"mainImageGenerate",type:"card",label:d("components-qinghu-ai.image-fission.738063-103"),description:d("components-qinghu-ai.image-fission.738063-105"),icon:V1,highlightImage:G1,onClick:async ye=>{m.mainImageCardClickKey=ye.key,i.switchMainImageModel&&await i.switchMainImageModel("WISDOM_GENERATION"),Y(d("components-qinghu-ai.image-fission.738063-103"),d("components-qinghu-ai.image-fission.738063-104"))}}]),J=ye=>Yn(ye,{type:m.LINKPIN_MAIN_IMAGE_USAGE_TYPE}),oe=h(J(ce.value)),te=()=>{oe.value=J(ce.value)};Ne(ce,te,{immediate:!0,deep:!0});const Q=async()=>{const ye={...c.query};delete ye.actionKey,delete ye[ya],await o.replace({path:c.path,query:ye})},ie=async ye=>{const me=tn(c.query[ya]),re=(me==null?void 0:me.type)==="mainImageCard"?me.value:Array.isArray(ye)?ye[0]:ye;if(!re)return;const fe=ce.value.find(Oe=>(Oe==null?void 0:Oe.type)==="card"&&(Oe==null?void 0:Oe.key)===re&&typeof(Oe==null?void 0:Oe.onClick)=="function");fe&&(fe.onClick(fe),await Q())},_e=ye=>{ye!=null&&ye.type&&ye.type!==m.LINKPIN_MAIN_IMAGE_USAGE_TYPE||te()};h({});const Re=ye=>{const me=q.value;if(!me)return;const re=Math.max(me.clientWidth*.72,240);me.scrollBy({left:ye==="right"?re:-re,behavior:"smooth"}),window.setTimeout($,250)};return Rt(()=>{var ye,me;if(te(),Ft.on("usage-updated",_e),q.value&&(q.value.addEventListener("scroll",$),$()),(ye=c.query)!=null&&ye.action){const fe=(c.query.url||"").split(";
129").filter(Boolean).map(Oe=>decodeURIComponent(Oe));(me=E.value)==null||me.open(fe)}tt(()=>{ie(c.query.actionKey)})}),fa(()=>{Ft.off("usage-updated",_e),q.value&&q.value.removeEventListener("scroll",$)}),Ne(()=>c.query.actionKey,(ye,me)=>{ye===me||!ye||ie(ye)}),(ye,me)=>(l(),f("div",{class:"w-full section-grid overflow-x-auto",ref_key:"linkpixFcBlockRef",ref:q},[t("div",EP,[(l(!0),f(we,null,Je(e(oe),re=>(l(),f("div",{key:re.key,class:"linkpix-fn-item"},[re.type==="component"?(l(),ve(rn(re.component),In({key:0,ref_for:!0},re.componentProps,Qn(re.componentEvents)),null,16)):(l(),f("div",qP,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] border-1px border-#F0F0F0 border-solid cursor-pointer relative",onClick:fe=>W(re)},[t("div",jP,[t("img",{src:re.icon,class:"w-14px h-14px",alt:""},null,8,HP),t("span",JP,r(re.label),1),re.singleFree?(l(),f("span",YP,r(e(d)("components-qinghu-ai.pod-material-params.930519-109")),1)):he("",!0),re.showHot?(l(),f("img",{key:1,src:e(xs),class:"ml-6px h-14px w-auto",alt:"hot"},null,8,QP)):he("",!0)])],8,WP)):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card relative",onClick:fe=>W(re)},[t("div",OP,[t("div",NP,[t("img",{src:re.icon,class:"w-14px h-14px",alt:""},null,8,RP),t("span",FP,r(re.label),1),re.singleFree?(l(),f("span",GP,r(e(d)("components-qinghu-ai.pod-material-params.930519-109")),1)):he("",!0),re.showNew?(l(),f("span",VP,[...me[3]||(me[3]=[t("img",{src:Bl,alt:""},null,-1),t("span",{class:"text-8px color-[#FF381E]"}
129,"NEW",-1)])])):he("",!0),re.showHot?(l(),f("img",{key:2,src:e(xs),class:"ml-6px h-14px w-auto",alt:"hot"},null,8,zP)):he("",!0)]),t("div",BP,r(re.description),1),t("img",{src:re.highlightImage,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,KP)])],8,DP))]))]))),128))]),ua(t("div",XP,[t("button",{type:"button",class:"section-grid-mask-button section-grid-mask-button-left","aria-label":"Scroll left",onClick:me[0]||(me[0]=re=>Re("left"))},[y(e(sn),{class:"font-600"})])],512),[[da,e(S)]]),ua(t("div",ZP,[t("button",{type:"button",class:"section-grid-mask-button","aria-label":"Scroll right",onClick:me[1]||(me[1]=re=>Re("right"))},[y(e(sn))])],512),[[da,e(O)]]),y(_C,{ref_key:"batchGenerateImageRef",ref:G,onSend:be},null,512),y(LI,{ref_key:"batchModifyImageRef",ref:U,onSend:be},null,512),y(hk,{ref_key:"batchReplaceImageRef",ref:a,onSend:be},null,512),y(Fw,{ref_key:"batchMainImageReplicationRef",ref:E,onSend:be},null,512),y(LP,{open:e(z),"onUpdate:open":me[2]||(me[2]=re=>Fe(z)?z.value=re:null),onSend:be},null,8,["open"])],512))}},tM=It(eM,[["__scopeId","data-v-677166ff"]]),aM=Dt({__name:"batch-image-replication",emits:["send"],setup(u,{expose:g,emit:i}){const c=i,o=h(null),x=(p,d)=>{c("send",p,d)};return g({open:p=>{var d;(d=o.value)==null||d.open(p)},close:()=>{var p;(p=o.value)==null||p.close()}}),(p,d)=>(l(),ve(Ku,{ref_key:"drawerRef",ref:o,"sub-type":"image_set_replication",onSend:x},null,512))}}),nM={class:"flex items-center max-w-max"},oM={key:1},sM=["onClick"],lM={class:"h-full px-14px py-24px relative group"},iM={class:"flex items-center h-12px"},rM=["src"],cM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},uM={key:0,class:"bg-[#FFEEEC] flex items-center px-2px py-2px ml-6px"},dM={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},pM=["src"],mM={key:0,class:"absolute top-[0px] right-[0px] bg-red px-8px py-2px rounded-[12px_0px_12px_0px] text-10px color-white"},gM=["onClick"],fM={class:"flex items-center"},vM=["src"],hM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},_M={class:"section-grid-mask section-grid-mask-left"},yM={class:"section-grid-mask section-grid-mask-right"},xM={__name:"detail-image",props:{isChatPinned:{type:Boolean,default:!1}},emits:["onClick","updatePrompt"],setup(u,{emit:g}){const i=u,c=Pa(),o=Kt(),x=la(),{userInfo:_}=va(x),m=bt(),p=g,{t:d}=mt();F(()=>m.longImageChatMode==="SKU_GENERATION"),F(()=>m.longImageChatMode==="LONG_IMAGE_GENERATION"),F(()=>["SKU_GENERATION","LONG_IMAGE_GENERATION"].includes(m.longImageChatMode)),F(()=>m.longImageChatMode==="LONG_IMAGE_GENERATION"?d("components-qinghu-ai.detail-image-copy.407726-102"):d("qinghu-ai.image-fission.378057-0"));const R=F(()=>{var ne;return(ne=_==null?void 0:_.value)==null?void 0:ne.defaultVip}),U=h(null),G={page:"é¦é¡µ",module:"çµå详æ
å¾",moduleCategory1:"çµå详æ
å¾",moduleCategory2:"çµå详æ
å¾å·¥å
·åº"},a={batchImageReplication:"click_ec_detail_copy",detailedImageSet:"click_ec_detail_match",newProductLaunch:"click_ec_detail_match"},E={batchImageReplication:"ç¹å»ã详æ
å¾å¤å»ã",detailedImageSet:"ç¹å»ã详æ
å¾å¥å¾ã",newProductLaunch:"ç¹å»ã详æ
å¾å¥å¾ã"},z={batchImageReplication:"click_ec_detail_copy_create"},q=ne=>{var ce;const le=a[ne.key];le&&kt(le,{...G,eventDesc:E[ne.key],buttonName:ne.label,label:ne.label,cardKey:ne.key,source:c.path}),(ce=ne.onClick)==null||ce.call(ne,ne)},S=()=>{U.value.open()},O=(ne,le)=>{[d("ai-guide-popup.index.product-suite"),d("ai-guide-popup.index.product-detail-long")].includes(ne)||Bu(m);let ce="";ne===d("components.AIChatInput.738063-7")&&(ce=d("qinghu-ai.image-fission.515468-1")),p("onClick",{img:"",label:ne,description:le,paramsImgs:[],name:ne,prompt:le,specComps:ce})},N=async(ne,le)=>{var Q,ie,_e;const ce=z[le];ce&&kt(ce,{...G,eventDesc:"ã详æ
å¾å¤å»ãï¼å建任å¡",buttonName:"å建任å¡",cardKey:le,promptLength:((Q=ne==null?void 0:ne.prompt)==null?void 0:Q.length)||0,imageCount:((ie=ne==null?void 0:ne.images)==null?void 0:ie.length)||((_e=ne==null?void 0:ne.materialImg)==null?void 0:_e.length)||0,source:c.path}),await za(le,{type:m.LINKPIN_DETAIL_IMAGE_USAGE_TYPE}),$();const J=JSON.parse(JSON.stringify(ne)),oe={...ne,longImageParams:J};o.push({path:"/linkpix/generation"}),U.value&&U.value.close();const te=ne.prompt;setTimeout(()=>{m.createAsyncTask(te,oe,!0),m.scrollToBottomNum=m.scrollToBottomNum+1},3e3)},ae=async ne=>{p("updatePrompt",ne)},L=async()=>{kt("click_prompt_polish_ec",{...G,eventDesc:"ç¹å»ãæç¤ºè¯æ¶¦è²ã",buttonName:"æç¤ºè¯æ¶¦è²",source:c.path}),await za("imagePromptGeneration",{type:m.LINKPIN_DETAIL_IMAGE_USAGE_TYPE}),$()},K=[{key:"imagePromptGeneration",type:"component",component:li,componentProps:{isChatPinned:i.isChatPinned},componentEvents:{updatePrompt:ae,submit:L}},{key:"batchImageReplication",type:"card",label:d("qinghu-ai.detail-image.detail-image-replication"),description:d("qinghu-ai.detail-image.detail-image-replication-desc"),icon:B1,highlightImage:z1,disabled:R.value,tooltipTitle:d("components-qinghu-ai.detail-image-copy.407726-101"),showNew:!0,onClick:ne=>{S()}},{key:"detailedImageSet",type:"card",label:d("ai-guide-popup.index.product-detail-suite"),description:d("qinghu-ai.detail-image.detail-image-set-desc"),icon:W1,highlightImage:K1,onClick:ne=>{m.detailImageCardClickKey=ne.key,O(d("ai-guide-popup.index.product-detail-suite"),d("ai-guide-popup.index.product-detail-suite-desc"))}},{key:"newProductLaunch",type:"card",label:d("long-image.index.917085-2"),description:d("components-qinghu-ai.detail-image.738063-89"),icon:H1,highlightImage:j1,onClick:ne=>{m.detailImageCardClickKey=ne.key,O(d("long-image.index.917085-2"),d("components-qinghu-ai.detail-image.738063-89"))}}],de=ne=>Yn(ne,{type:m.LINKPIN_DETAIL_IMAGE_USAGE_TYPE}),W=h(de(K)),$=()=>{W.value=de(K)},Y=async()=>{const ne={...c.query};delete ne.actionKey,delete ne[ya],await o.replace({path:c.path,query:ne})},j=async ne=>{const le=tn(c.query[ya]),ce=(le==null?void 0:le.type)==="detailImageCard"?le.value:Array.isArray(ne)?ne[0]:ne;if(!ce)return;const J=K.find(oe=>(oe==null?void 0:oe.type)==="card"&&(oe==null?void 0:oe.key)===ce&&typeof(oe==null?void 0:oe.onClick)=="function");J&&(J.onClick(J),Y())},V=ne=>{ne!=null&&ne.type&&ne.type!==m.LINKPIN_DETAIL_IMAGE_USAGE_TYPE||$()};h({});const w=h(null),I=h(!1),k=h(!1),B=()=>{const ne=w.value;if(!ne)return;const le=ne.scrollLeft,ce=ne.scrollWidth,J=ne.clientWidth;I.value=le>0,k.value=le+J<ce-1},be=ne=>{const le=w.value;if(!le)return;const ce=Math.max(le.clientWidth*.72,240);le.scrollBy({left:ne==="right"?ce:-ce,behavior:"smooth"}),window.setTimeout(B,250)};return Rt(()=>{var ne,le;if($(),Ft.on("usage-updated",V),w.value&&(w.value.addEventListener("scroll",B),B()),(ne=c.query)!=null&&ne.action){const J=(c.query.url||"").split(";
129").filter(Boolean).map(oe=>decodeURIComponent(oe));(le=U.value)==null||le.open(J)}tt(()=>{j(c.query.actionKey)})}),fa(()=>{Ft.off("usage-updated",V),w.value&&w.value.removeEventListener("scroll",B)}),Ne(()=>c.query.actionKey,(ne,le)=>{ne===le||!ne||j(ne)}),(ne,le)=>(l(),f("div",{class:"w-full section-grid overflow-x-auto",ref_key:"linkpixFcBlockRef",ref:w},[t("div",nM,[(l(!0),f(we,null,Je(e(W),ce=>(l(),f("div",{key:ce.key,class:"linkpix-fn-item"},[ce.type==="component"?(l(),ve(rn(ce.component),In({key:0,ref_for:!0},ce.componentProps,Qn(ce.componentEvents),{isChatPinned:u.isChatPinned}),null,16,["isChatPinned"])):(l(),f("div",oM,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] border-1px border-#F0F0F0 border-solid cursor-pointer relative",onClick:J=>q(ce)},[t("div",fM,[t("img",{src:ce.icon,class:"w-14px h-14px",alt:""},null,8,vM),t("span",hM,r(ce.label),1)])],8,gM)):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card relative",onClick:J=>q(ce)},[t("div",lM,[t("div",iM,[t("img",{src:ce.icon,class:"w-14px h-14px",alt:""},null,8,rM),t("span",cM,r(ce.label),1),ce.showNew?(l(),f("span",uM,[...le[2]||(le[2]=[t("img",{src:Bl,alt:""},null,-1),t("span",{class:"text-8px color-[#FF381E]"},"NEW",-1)])])):he("",!0)]),t("div",dM,r(ce.description),1),t("img",{src:ce.highlightImage,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,pM),ce.badgeText?(l(),f("span",mM,r(ce.badgeText),1)):he("",!0)])],8,sM))]))]))),128))]),ua(t("div",_M,[t("button",{type:"button",class:"section-grid-mask-button section-grid-mask-button-left","aria-label":"Scroll left",onClick:le[0]||(le[0]=ce=>be("left"))},[y(e(sn),{class:"font-600"})])],512),[[da,e(I)]]),ua(t("div",yM,[t("button",{type:"button",class:"section-grid-mask-button","aria-label":"Scroll right",onClick:le[1]||(le[1]=ce=>be("right"))},[y(e(sn))])],512),[[da,e(k)]]),y(aM,{ref_key:"batchImageReplicationRef",ref:U,onSend:N},null,512)],512))}},bM=It(xM,[["__scopeId","data-v-02c8aff9"]]),IM={class:"h-full px-14px py-24px relative group"},CM={class:"flex items-center h-12px"},kM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},wM={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},PM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},MM={class:"h-full px-14px py-24px relative group"},SM={class:"flex items-center h-12px"},$M={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},TM={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},AM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},UM={class:"h-full px-14px py-24px relative group"},LM={class:"flex items-center h-12px"},EM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},qM={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},DM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},OM={__name:"video-translation",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const g=bt(),{t:i}=mt(),c={1:"click_voice_translate",2:"click_subtitle_translate",3:"click_mouth_translate"},o={1:"ç¹å»ãè§é¢è¯é³ç¿»è¯ãå¡ç",2:"ç¹å»ãè§é¢åå¹ç¿»è¯ãå¡ç",3:"ç¹å»ãè§é¢é¢å®¹ç¿»è¯ãå¡ç"},x=_=>{var p;const m=c[_];m&&kt(m,{page:"é¦é¡µ",module:"è§é¢ç¿»è¯",moduleCategory1:"è§é¢ç¿»è¯",moduleCategory2:"è§é¢ç¿»è¯å·¥å
·åº",eventDesc:o[_],buttonName:(p=o[_])==null?void 0:p.replace(/^ç¹å»ã|ãå¡ç$/g,""),packageType:_}),g.longVideoParams.translationPackage=_};return(_,m)=>(l(),f(we,null,[t("div",null,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:m[1]||(m[1]=p=>x(2,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-255")))},[m[8]||(m[8]=t("img",{src:Dr,class:"w-14px h-14px",alt:""},null,-1)),t("span",PM,r(e(i)("components-qinghu-ai.video-translation.738063-256")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:m[0]||(m[0]=p=>x(2,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-255")))},[t("div",IM,[t("div",CM,[m[6]||(m[6]=t("img",{src:Dr,class:"w-14px h-14px",alt:""},null,-1)),t("span",kM,r(e(i)("components-qinghu-ai.video-translation.738063-256")),1)]),t("div",wM,r(e(i)("components-qinghu-ai.video-translation.738063-257")),1),m[7]||(m[7]=t("img",{src:J1,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))]),t("div",null,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:m[3]||(m[3]=p=>x(1,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-255")))}
129,[m[11]||(m[11]=t("img",{src:Or,class:"w-14px h-14px",alt:""},null,-1)),t("span",AM,r(e(i)("components-qinghu-ai.video-translation.738063-259")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:m[2]||(m[2]=p=>x(1,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-258")))},[t("div",MM,[t("div",SM,[m[9]||(m[9]=t("img",{src:Or,class:"w-14px h-14px",alt:""},null,-1)),t("span",$M,r(e(i)("components-qinghu-ai.video-translation.738063-259")),1)]),t("div",TM,r(e(i)("components-qinghu-ai.video-translation.738063-260")),1),m[10]||(m[10]=t("img",{src:Y1,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))]),t("div",null,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:m[5]||(m[5]=p=>x(3,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-261")))},[m[14]||(m[14]=t("img",{src:Nr,class:"w-14px h-14px",alt:""},null,-1)),t("span",DM,r(e(i)("components-qinghu-ai.video-translation.738063-262")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:m[4]||(m[4]=p=>x(3,e(i)("long-image.index.917085-2"),e(i)("components-qinghu-ai.video-translation.738063-261")))},[t("div",UM,[t("div",LM,[m[12]||(m[12]=t("img",{src:Nr,class:"w-14px h-14px",alt:""},null,-1)),t("span",EM,r(e(i)("components-qinghu-ai.video-translation.738063-262")),1)]),t("div",qM,r(e(i)("components-qinghu-ai.video-translation.738063-263")),1),m[13]||(m[13]=t("img",{src:Q1,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])],64))}},NM={class:"flex items-center max-w-max"},RM={key:1},FM=["onClick"],GM={class:"flex items-center h-12px"},VM=["src"],zM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},BM={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},KM=["src"],WM={key:0,class:"absolute top-[0px] right-[0px] bg-red px-8px py-2px rounded-[12px_0px_12px_0px] text-10px color-white"},jM=["onClick"],HM=["src"],JM={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},YM={class:"section-grid-mask section-grid-mask-left"},QM={class:"section-grid-mask section-grid-mask-right"},XM={__name:"poster-image",props:{isChatPinned:{type:Boolean,default:!1}},emits:["onClick","updatePrompt"],setup(u,{emit:g}){const i=u,c=bt(),o=g,{t:x}=mt(),_=(N,ae)=>{o("onClick",{img:"",label:N,description:ae,paramsImgs:[]})},m=async N=>{o("updatePrompt",N)},p=async()=>{await za("imagePromptGeneration",{type:c.LINKPIN_POSTER_IMAGE_USAGE_TYPE}),G()},d=[{key:"imagePromptGeneration",type:"component",component:li,componentProps:{isChatPinned:i.isChatPinned,submit:p},componentEvents:{updatePrompt:m,submit:p}},{key:"privateDomainOperation",type:"card",label:x("components-qinghu-ai.poster-image.738063-177"),description:x("components-qinghu-ai.poster-image.738063-179"),icon:Z1,highlightImage:X1,onClick:N=>{c.posterImageCardClickKey=N.key,_(x("components-qinghu-ai.poster-image.738063-177"),`${x("components-qinghu-ai.poster-image.861208-3")}+ 130 ${x("components-qinghu-ai.poster-image.861208-4")}+ 131 ${x("components-qinghu-ai.poster-image.861208-6")}+ 132 ${x("components-qinghu-ai.poster-image.738063-178")}`)}},{key:"productMarketing",type:"card",label:x("components-qinghu-ai.poster-image.738063-180"),description:x("components-qinghu-ai.poster-image.738063-182"),icon:t0,highlightImage:e0,onClick:N=>{c.posterImageCardClickKey=N.key,_(x("components-qinghu-ai.poster-image.738063-180"),`${x("components-qinghu-ai.poster-image.861208-8")}+ 133 ${x("components-qinghu-ai.poster-image.861208-9")}+ 134 ${x("components-qinghu-ai.poster-image.738063-181")}`)}},{key:"festivalPoster",type:"card",label:x("components-qinghu-ai.poster-image.738063-183"),description:x("components-qinghu-ai.poster-image.738063-185"),icon:n0,highlightImage:a0,onClick:N=>{c.posterImageCardClickKey=N.key,_(x("components-qinghu-ai.poster-image.738063-183"),x("components-qinghu-ai.poster-image.738063-184"))}},{key:"eventPromotion",type:"card",label:x("social-media.index.553738-3"),description:x("components-qinghu-ai.poster-image.738063-186"),icon:s0,highlightImage:o0,onClick:N=>{c.posterImageCardClickKey=N.key,_(x("social-media.index.553738-3"),x("components-qinghu-ai.poster-image.861208-10")+x("components-qinghu-ai.poster-image.861208-11"))}}],R=N=>
134Yn(N,{type:c.LINKPIN_POSTER_IMAGE_USAGE_TYPE}),U=h(R(d)),G=()=>{U.value=R(d)},a=N=>{N!=null&&N.type&&N.type!==c.LINKPIN_POSTER_IMAGE_USAGE_TYPE||G()};h({});const E=h(null),z=h(!1),q=h(!1),S=()=>{const N=E.value;if(!N)return;const ae=N.scrollLeft,L=N.scrollWidth,K=N.clientWidth;z.value=ae>0,q.value=ae+K<L-1},O=N=>{const ae=E.value;if(!ae)return;const L=Math.max(ae.clientWidth*.72,240);ae.scrollBy({left:N==="right"?L:-L,behavior:"smooth"}),window.setTimeout(S,250)};return Rt(()=>{G(),Ft.on("usage-updated",a),E.value&&(E.value.addEventListener("scroll",S),S())}),fa(()=>{Ft.off("usage-updated",a),E.value&&E.value.removeEventListener("scroll",S)}),(N,ae)=>{const L=ca;return l(),f("div",{class:"w-full section-grid overflow-x-auto",ref_key:"linkpixFcBlockRef",ref:E},[t("div",NM,[(l(!0),f(we,null,Je(e(U),K=>(l(),f("div",{key:K.key,class:"linkpix-fn-item"},[K.type==="component"?(l(),ve(rn(K.component),In({key:0,ref_for:!0},K.componentProps,Qn(K.componentEvents)),null,16)):(l(),f("div",RM,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] border-1px border-#F0F0F0 border-solid cursor-pointer relative",onClick:de=>K.onClick(K)},[t("div",{class:Qe(["flex items-center",{"opacity-40":K.disabled}])},[t("img",{src:K.icon,class:"w-14px h-14px",alt:""},null,8,HM),t("span",JM,r(K.label),1)],2),y(L,null,{title:P(()=>[De(r(K.tooltipTitle),1)]),default:P(()=>[K.disabled?(l(),f("div",{key:0,class:"absolute inset-0 bg-black/2 cursor-not-allowed z-10 rounded-[inherit]",onClick:ae[1]||(ae[1]=Be(()=>{},["stop"]))})):he("",!0)]),_:2},1024)],8,jM)):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card relative",onClick:de=>K.onClick(K)},[t("div",{class:Qe(["h-full px-14px py-24px relative group",{"opacity-60":K.disabled}])},[t("div",GM,[t("img",{src:K.icon,class:"w-14px h-14px",alt:""},null,8,VM),t("span",zM,r(K.label),1)]),t("div",BM,r(K.description),1),t("img",{src:K.highlightImage,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,KM),K.badgeText?(l(),f("span",WM,r(K.badgeText),1)):he("",!0)],2),y(L,null,{title:P(()=>[De(r(K.tooltipTitle),1)]),default:P(()=>[K.disabled?(l(),f("div",{key:0,class:"absolute inset-0 bg-black/2 cursor-not-allowed z-10 rounded-[inherit]",onClick:ae[0]||(ae[0]=Be(()=>{},["stop"]))})):he("",!0)]),_:2},1024)],8,FM))]))]))),128))]),ua(t("div",YM,[t("button",{type:"button",class:"section-grid-mask-button section-grid-mask-button-left","aria-label":"Scroll left",onClick:ae[2]||(ae[2]=K=>O("left"))},[y(e(sn),{class:"font-600"})])],512),[[da,e(z)]]),ua(t("div",QM,[t("button",{type:"button",class:"section-grid-mask-button","aria-label":"Scroll right",onClick:ae[3]||(ae[3]=K=>O("right"))},[y(e(sn))])],512),[[da,e(q)]])],512)}}},ZM=It(XM,[["__scopeId","data-v-4cb6fbf0"]]),eS={class:"w-full section-grid overflow-x-auto",ref:"linkpixFcBlockRef"},tS={class:"flex items-center max-w-max"},aS={key:1},nS=["onClick"],oS={class:"h-full px-14px py-24px relative group"},sS={class:"flex items-center h-12px"},lS=["src"],iS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},rS={class:"mt-8px text-12px truncate relative z-10",style:{"line-height":"1"}},cS=["src"],uS=["onClick"],dS={class:"flex items-center"},pS=["src"],mS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},gS={__name:"ad-material",props:{isChatPinned:{type:Boolean,default:!1}},emits:["onClick","updatePrompt"],setup(u,{emit:g}){const{t:i}=mt(),c=bt(),o=Pa(),x=g,_={page:"é¦é¡µ",module:"广åç´ æ",moduleCategory1:"广åç´ æ",moduleCategory2:"广åç´ æå·¥å
·åº"},m={foodVideo:"click_ad_food_template",beautyVideo:"click_ad_beauty_template",homeVideo:"click_ad_home_template",beautyImage:"click_ad_beauty_img_template"},p={foodVideo:"ç¹å»ãé£åç±»è§é¢ã模æ¿",beautyVideo:"ç¹å»ãç¾å¦åç±»è§é¢ã模æ¿",homeVideo:"ç¹å»ãå®¶å±
ç¾è´§ç±»è§é¢ã模æ¿",beautyImage:"ç¹å»ãç¾å¦åç±»å¾æãæ¨¡æ¿"},d=S=>{var N;const O=m[S.key];O&&kt(O,{..._,eventDesc:p[S.key],buttonName:S.label,label:S.label,cardKey:S.key,materialType:S.materialType,source:o.path}),(N=S.onClick)==null||N.call(S,S)},R=(S=[])=>{var L;const O=((L=c.adMaterialOptionsGroup)==null?void 0:L.AD_VIDEO)||[];if(!O.length||!S.length)return"";const N=S.map(K=>String(K).toLowerCase()),ae=O.find(K=>{const de=[K==null?void 0:K.name,K==null?void 0:K.label,K==null?void 0:K.value,K==null?void 0:K.description].filter(
134Boolean).join(" ").toLowerCase();return N.some(W=>de.includes(W))});return(ae==null?void 0:ae.id)||""},U=(S,O,N,ae=[])=>{if(N&&c.setAdMaterialMaterialType(N),N==="video"){const L=R(ae);L&&c.setAdMaterialVideoScene(L)}x("onClick",{img:"",label:S,description:O,paramsImgs:[]})},G=[{key:"foodVideo",materialType:"video",label:i("components-qinghu-ai.ad-material.930519-62"),description:i("qinghu-ai.prompt-generation.873104-1"),icon:i0,highlightImage:l0,onClick:S=>{c.adMaterialCardClickKey=S.key,U(i("components-qinghu-ai.ad-material.930519-62"),i("components-qinghu-ai.ad-material.930519-63"),S.materialType,[i("image-to-video.index.132445-6"),"promotion",i("components-qinghu-ai.ad-material.930519-64"),i("components-qinghu-ai.ad-material.930519-65"),i("components-OperationGenerate-components.ReleaseRules.738063-477"),"short-video"])}},{key:"beautyVideo",materialType:"video",label:i("components-qinghu-ai.ad-material.930519-66"),description:i("qinghu-ai.video-copy.542792-5"),icon:c0,highlightImage:r0,onClick:S=>{c.adMaterialCardClickKey=S.key,U(i("components-qinghu-ai.ad-material.930519-66"),i("components-qinghu-ai.ad-material.930519-67"),S.materialType,[i("components-qinghu-ai.ad-material.930519-68"),"spoken",i("components-qinghu-ai.ad-material.930519-69"),"feed",i("components-qinghu-ai.ad-material.930519-70")])}},{key:"homeVideo",materialType:"video",label:i("components-qinghu-ai.ad-material.930519-71"),description:i("components-qinghu-ai.ad-material.930519-72"),icon:d0,highlightImage:u0,onClick:S=>{c.adMaterialCardClickKey=S.key,U(i("components-qinghu-ai.ad-material.930519-71"),i("components-qinghu-ai.ad-material.930519-73"),S.materialType,[i("components-qinghu-ai.ad-material.930519-69"),"feed",i("components-qinghu-ai.ad-material.930519-74"),i("components-qinghu-ai.ad-material.930519-75"),"short-video"])}},{key:"beautyImage",materialType:"image",label:i("components-qinghu-ai.ad-material.930519-76"),description:i("qinghu-ai.video-copy.542792-5"),icon:m0,highlightImage:p0,onClick:S=>{c.adMaterialCardClickKey=S.key,U(i("components-qinghu-ai.ad-material.930519-76"),i("components-qinghu-ai.ad-material.930519-77"),S.materialType)}}],a=S=>Yn(S,{type:c.LINKPIN_AD_MATERIAL_USAGE_TYPE}),E=h(a(G)),z=()=>{E.value=a(G)},q=S=>{S!=null&&S.type&&S.type!==c.LINKPIN_AD_MATERIAL_USAGE_TYPE||z()};return Rt(()=>{z(),Ft.on("usage-updated",q)}),fa(()=>{Ft.off("usage-updated",q)}),(S,O)=>(l(),f("div",eS,[t("div",tS,[(l(!0),f(we,null,Je(e(E),N=>(l(),f("div",{key:N.key,class:"linkpix-fn-item"},[N.type==="component"?(l(),ve(rn(N.component),In({key:0,ref_for:!0},N.componentProps,Qn(N.componentEvents)),null,16)):(l(),f("div",aS,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:ae=>d(N)},[t("div",dS,[t("img",{src:N.icon,class:"w-14px h-14px",alt:""},null,8,pS),t("span",mS,r(N.label),1)])],8,uS)):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card relative",onClick:ae=>d(N)},[t("div",oS,[t("div",sS,[t("img",{src:N.icon,class:"w-14px h-14px",alt:""},null,8,lS),t("span",iS,r(N.label),1)]),t("div",rS,r(N.description),1),t("img",{src:N.highlightImage,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,cS)])],8,nS))]))]))),128))])],512))}},fS={class:"h-full px-14px py-24px relative group"},vS={class:"flex items-center h-12px"},hS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},_S={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},yS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},xS={class:"h-full px-14px py-24px relative group"},bS={class:"flex items-center h-12px"},IS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},CS={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate"},kS={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},wS={__name:"media-image",props:{isChatPinned:{type:Boolean,default:!1}},emits:["changeSize","onClick"],setup(u,{emit:g}){const i=bt(),{t:c}=mt(),o=x=>{i.longImageParams.size=x};return(x,_)=>(l(),f(we,null,[t("div",null,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:_[1]||(_[1]=m=>o("1080x1440"))},[_[6]||(_[6]=t("img",{src:Wr,class:"w-14px h-14px",alt:""},null,-1)),t("span",yS,r(e(c)("components-qinghu-ai.media-image.738063-135")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:_[0]||(_[0]=m=>o("1080x1440"))},[t("div",fS,[t("div",vS,[_[4]||(_[4]=t("img",{src:Wr,class:"w-14px h-14px",alt:""},null,-1)),t("span",hS,r(e(c)("components-qinghu-ai.media-image.738063-135")),1)]),t("div",_S,r(e(c)("components-qinghu-ai.media-image.738063-136")),1),_[5]||(_[5]=t("img",{src:g0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))]),t("div",null,[u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:_[3]||(_[3]=m=>o("900x383"))},[_[9]||(_[9]=t("img",{src:jr,class:"w-14px h-14px",alt:""},null,-1)),t("span",kS,r(e(c)("qinghu-ai.long-image-params.227781-42")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:_[2]||(_[2]=m=>o("900x383"))},[t("div",xS,[t("div",bS,[_[7]||(_[7]=t("img",{src:jr,class:"w-14px h-14px",alt:""},null,-1)),t("span",IS,r(e(c)("qinghu-ai.long-image-params.227781-42")),1)]),t("div",CS,r(e(c)("components-qinghu-ai.media-image.738063-137")),1),_[8]||(_[8]=t("img",{src:f0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])],64))}},PS={class:"flex pl-12px pt-10px flex-wrap"},MS={class:"mr-8px mb-8px"},SS={class:"max-w-content h-36px bg-[#F7F7F7] rounded-3px relative cursor-pointer p-6px flex items-center material-thumb"},$S=["src"],TS=["onClick"],AS={__name:"quote-image-list",setup(u){const g=bt(),i=F(()=>g.aiMessageType=="IMAGETOVIDEO"||g.aiMessageType=="LINKPIX"?g.batchUploadImgUrls||[]:g.longImageParams.materialImg.map(x=>x.url));Pa();const c=async(x,_=0)=>{Ta({options:{toolbar:!0,initialViewIndex:_},images:x})},o=x=>{g.aiMessageType=="IMAGETOVIDEO"||g.aiMessageType=="LINKPIX"?(g.batchUploadImgUrls=[],g.batchUploadImgUrls.length==0&&(g.isImageQuote=!1)):(g.longImageParams.materialImg=[],g.longImageParams.materialImg.length==0&&(g.isImageQuote=!1))};return(x,_)=>(l(),f("div",PS,[t("div",MS,[t("div",SS,[_[1]||(_[1]=t("img",{src:Rc,alt:"",class:"w-16px h-15px mr-8px"},null,-1)),(l(!0),f(we,null,Je(e(i),(m,p)=>(l(),f("div",{class:"w-24px h-24px relative mr-4px group",key:p},[t("img",{src:m,alt:"",class:"w-24px h-24px rounded-3px",style:{"vertical-align":"initial"}},null,8,$S),t("div",{class:"pointer-events-auto w-full h-full max-w-38px max-h-38px bg-[rgba(0,0,0,0.2)] absolute top-0px left-0px cursor-pointer flex justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:Be(d=>c(e(i),p),["stop"])},[y(e(Us),{class:"text-[#ffffff] text-14px"})],8,TS)]))),128)),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:_[0]||(_[0]=Be(m=>o(x.index),["stop"]))})])])]))}},US=It(AS,[["__scopeId","data-v-f8b8d3c7"]]),LS=["src"],ES={__name:"video-preview-modal",setup(u,{expose:g}){const i=h(!1),c=h(null),o=h(""),x=()=>{c.value&&(c.value.pause(),c.value.currentTime=0,c.value.removeAttribute("src"),c.value.load()),i.value=!1,o.value=""};return g({open:m=>{o.value=m,i.value=!0}}),(m,p)=>{const d=Zt;return l(),ve(d,{open:e(i),"onUpdate:open":p[0]||(p[0]=R=>Fe(i)?i.value=R:null),footer:null,width:1200,onCancel:x,class:"video-modal",destroyOnClose:!0},{default:P(()=>[t("video",{ref_key:"videoRef",ref:c,src:e(o),controls:"",autoplay:"",class:"max-h-600px m-auto"},null,8,LS)]),_:1},8,["open"])}}},qS={class:"flex pl-12px pt-10px flex-wrap"},DS={class:"mr-8px mb-8px"},OS={class:"max-w-content h-36px bg-[#F7F7F7] rounded-3px relative cursor-pointer p-6px flex items-center material-thumb"},NS=["src"],RS=["onClick"],FS=Dt({__name:"quote-video-list",setup(u){const g=bt(),i=F(()=>g.longVideoParams.materialVideo||[]),c=h(null),o=_=>{var m;_&&((m=c.value)==null||m.open(_))},x=_=>{g.longVideoParams.materialVideo=[],g.longVideoParams.materialVideo.length==0&&(g.isVideoQuote=!1)};return(_,m)=>(l(),f(we,null,[t("div",qS,[t("div",DS,[t("div",OS,[m[1]||(m[1]=t("img",{src:Rc,alt:"",class:"w-16px h-15px mr-8px"},null,-1)),(l(!0),f(we,null,Je(e(i),(p,d)=>(l(),f("div",{class:"w-24px h-24px relative mr-4px group",key:d},[t("video",{src:p==null?void 0:p.url,class:"w-24px h-24px rounded-3px object-cover",style:{"vertical-align":"initial"},muted:"",loop:"",playsinline:""},null,8,NS),t("div",{class:"pointer-events-auto w-full h-full max-w-38px max-h-38px bg-[rgba(0,0,0,0.2)] absolute top-0px left-0px cursor-pointer flex justify-center items-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:Be(R=>o(p==null?void 0:p.url),["stop"])}
134,[y(e(J0),{class:"text-[#ffffff] text-14px"})],8,RS)]))),128)),t("img",{src:Ca,alt:"",class:"w-14px h-14px absolute top-[-6px] right-[-6px] cursor-pointer close-btn",onClick:m[0]||(m[0]=Be(p=>x(_.index),["stop"]))})])])]),y(ES,{ref_key:"videoPreviewModalRef",ref:c},null,512)],64))}}),GS=It(FS,[["__scopeId","data-v-b66f663b"]]),VS={class:"popover-content w-200px"},zS={class:"popover-title"},BS={class:"popover-list"},KS=["onClick"],WS={class:"flex items-center h-12px"},jS={class:"line-height-1 ml-4px"},HS={class:"popover-content w-200px"},JS={class:"popover-title"},YS={class:"popover-list"},QS=["onClick"],XS={class:"flex items-center h-12px"},ZS={class:"line-height-1 ml-4px"},e$={class:"popover-content"},t$={class:"popover-title"},a$={class:"popover-list"},n$=["onClick"],o$={class:"flex items-center gap-3"},s$={class:"flex flex-col flex-1"},l$={class:"text-sm font-medium text-gray-800"},i$={class:"flex items-center h-12px"},r$={class:"line-height-1 ml-4px"},c$={__name:"VideoTranslationParams",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=bt(),c=h(gf),o=h(ff),x=h(vf),_=h(!1),m=h(!1),p=h(!1),d=z=>{i.longVideoParams.translationPackage=z.value,_.value=!1,kt("select_translate_package",{page:"é¦é¡µ",module:"è§é¢ç¿»è¯",moduleCategory1:"è§é¢ç¿»è¯",moduleCategory2:"è§é¢ç¿»è¯æ¨¡å",eventDesc:"éæ©è§é¢ç¿»è¯ç±»å",buttonName:z.label,packageType:z.value,label:z.label})},R=z=>{i.longVideoParams.language=z.value,m.value=!1,kt("select_translate_target_lang",{page:"é¦é¡µ",module:"è§é¢ç¿»è¯",moduleCategory1:"è§é¢ç¿»è¯",moduleCategory2:"è§é¢ç¿»è¯æ¨¡å",eventDesc:"éæ©ç®æ è¯è¨",buttonName:z.label,language:z.value,label:z.label})},U=z=>{i.longVideoParams.sourceLanguage=z.value,p.value=!1,kt("select_translate_source_lang",{page:"é¦é¡µ",module:"è§é¢ç¿»è¯",moduleCategory1:"è§é¢ç¿»è¯",moduleCategory2:"è§é¢ç¿»è¯æ¨¡å",eventDesc:"éæ©æºè¯è¨",buttonName:z.label,language:z.value,label:z.label})},G=F(()=>{const z=i.longVideoParams.translationPackage,q=c.value.find(S=>S.value===z);return q?q.label:g("components.VideoTranslationParams.738063-21")}),a=F(()=>{const z=i.longVideoParams.language;if(!z)return g("qinghu-ai.long-image-params.227781-30")||g("components.VideoTranslationParams.738063-22");const q=x.value.find(S=>S.value===z);return q?q.label:z}),E=F(()=>{const z=i.longVideoParams.sourceLanguage;if(!z)return g("qinghu-ai.long-image-params.227781-30")||g("components.VideoTranslationParams.738063-22");const q=x.value.find(S=>S.value===z);return q?q.label:z});return(z,q)=>{const S=Lt,O=Bt;return l(),f("div",null,[y(O,{open:e(p),"onUpdate:open":q[0]||(q[0]=N=>Fe(p)?p.value=N:null),placement:"top",trigger:"click",getPopupContainer:N=>N.parentNode,arrow:!1},{content:P(()=>[t("div",VS,[t("div",zS,r(e(g)("components.VideoTranslationParams.738063-19")),1),t("div",BS,[(l(!0),f(we,null,Je(e(o),(N,ae)=>(l(),f("div",{key:ae,class:"px-12px py-4px cursor-pointer hover:bg-[#F6F6F6]!",style:Nt({background:e(i).longVideoParams.sourceLanguage==N.value?"#F6F6F6":"#fff"}),onClick:L=>U(N)},r(N.label),13,KS))),128))])])]),default:P(()=>[y(S,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",WS,[y(e(ec)),t("span",jS,r(e(E)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"]),y(O,{open:e(m),"onUpdate:open":q[1]||(q[1]=N=>Fe(m)?m.value=N:null),placement:"top",trigger:"click",getPopupContainer:N=>N.parentNode,arrow:!1},{content:P(()=>[t("div",HS,[t("div",JS,r(e(g)("components.VideoTranslationParams.738063-20")),1),t("div",YS,[(l(!0),f(we,null,Je(e(x),(N,ae)=>(l(),f("div",{key:ae,class:"px-12px py-4px cursor-pointer hover:bg-[#F6F6F6]!",style:Nt({background:e(i).longVideoParams.language==N.value?"#F6F6F6":"#fff"}),onClick:L=>R(N)},r(N.label),13,QS))),128))])])]),default:P(()=>[y(S,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",XS,[y(e(ec)),t("span",ZS,r(e(a)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"]),y(O,{open:e(_),"onUpdate:open":q[2]||(q[2]=N=>Fe(_)?_.value=N:null),placement:"top",trigger:"click",getPopupContainer:N=>N.parentNode,arrow:!1,overlayClassName:"theme-popover"},{content:P(()=>[t("div",e$,[t("div",t$,r(e(g)("components.VideoTranslationParams.738063-2
1341")),1),t("div",a$,[t("div",null,[(l(!0),f(we,null,Je(e(c),(N,ae)=>{var L;return l(),f("div",{class:Qe([{active:((L=e(i).longVideoParams)==null?void 0:L.translationPackage)===N.value},"duration-200 px-4 py-3 cursor-pointer font-size-[12px]"]),key:N,onClick:K=>d(N)},[t("div",o$,[t("div",s$,[t("span",l$,r(N.label),1)])])],10,n$)}),128))])])])]),default:P(()=>[y(S,{class:Qe(["mr-6px ant-no-wave",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",i$,[t("span",r$,r(e(G)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open","getPopupContainer"])])}}},u$=It(c$,[["__scopeId","data-v-cb0cdab4"]]),d$={class:"flex items-center"},p$=["onClick"],m$={class:"video-thumb w-60px h-60px rounded-8px overflow-hidden relative cursor-pointer"},g$=["src"],f$={class:"video-play-icon absolute inset-0 flex items-center justify-center"},v$={class:"w-24px h-24px rounded-full bg-black/50 border-2px border-solid border-white flex items-center justify-center transition-transform"},h$=["onClick"],_$={class:"video-preview-container"},y$=["src"],x$={__name:"VideoTranslationMaterial",setup(u){const{t:g}=mt(),i=bt(),c=h(!1),o=h(""),x=h(""),_=h(null),m=G=>{i.longVideoParams.materialVideo.splice(G,1),i.longVideoParams.materialVideo.length===0&&(i.longVideoParams.materialVideo=[])},p=G=>{o.value=G.url,x.value=G.filename||"è§é¢é¢è§",c.value=!0},d=()=>{_.value&&(_.value.pause(),_.value.currentTime=0)},R=()=>{d(),c.value=!1},U=()=>{d(),c.value=!1};return(G,a)=>{const E=Zt;return l(),f(we,null,[t("div",d$,[(l(!0),f(we,null,Je(e(i).longVideoParams.materialVideo,(z,q)=>(l(),f("div",{key:q,class:"video-material-item mr-8px mb-8px relative",onClick:Be(S=>p(z),["stop"])},[t("div",m$,[t("video",{src:z.url,class:"w-full h-full object-cover",muted:"",preload:"metadata"},null,8,g$),t("div",f$,[t("div",v$,[y(e(pu),{class:"text-14px text-white ml-2px"})])])]),t("div",{class:"close-btn",onClick:Be(S=>m(q),["stop"])},null,8,h$)],8,p$))),128))]),y(E,{open:c.value,"onUpdate:open":a[0]||(a[0]=z=>c.value=z),title:x.value,width:900,footer:null,centered:"",onOk:R,onCancel:U},{default:P(()=>[t("div",_$,[t("video",{ref_key:"previewVideoRef",ref:_,src:o.value,controls:"",class:"w-full",style:{maxHeight:"70vh"}},null,8,y$)])]),_:1},8,["open","title"])],64)}}},b$=It(x$,[["__scopeId","data-v-a791e52d"]]),I$={class:"public-video-upload"},C$=["src"],k$={key:1},w$={class:"text-[rgba(61,61,61,0.8)]"},P$={__name:"index",props:{value:{type:[String,Array],default:""},name:{type:String,default:"video"},listType:{type:String,default:"picture-card"},customClass:{type:String,default:"video-uploader"},accept:{type:String,default:"video/mp4,video/webm,video/ogg"},temp:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showUploadList:{type:Boolean,default:!1},maxCount:{type:Number,default:1},uploadBizType:{type:String,default:""},size:{type:Number,default:100*1024*1024},isSeedeUpload:{type:Boolean,default:!1},activeTabKey:{type:String,default:""}},emits:["update:value","success","loading","startUploading","endUploading"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=u,x=bt(),_=h([]),m=i,p=h(!1),d=h([]),R=W=>Array.isArray(W)?W.filter(Boolean).length:W?1:0,U=async W=>{var I;const $=o.accept.split(",").map(k=>k.trim()).filter(k=>k);if(W.name.split(".").pop().toLowerCase(),!$.includes(W.type))return qe.error(c("public-video-upload.index.101106-1")),qa.LIST_IGNORE;if(W.size>o.size)return qe.error(c("public-video-upload.index.101106-2",[o.size/(1024*1024)])),qa.LIST_IGNORE;let j=R(o.value);x.aiMessageType=="VIDEOTRANSLATION"?j=(x.longVideoParams.materialVideo||[]).length:j=(x.longVideoParams.materialVideo||[]).filter(k=>k&&k.fnType==="material").length;const V=((I=d.value)==null?void 0:I.length)||0;return o.maxCount-j-V<=0&&o.activeTabKey=="2"?(qe.error(c("public-video-upload.index.101106-3",[o.maxCount])),qa.LIST_IGNORE):(d.value.push(W),!0)},G=h(0),a=W=>{o.isSeedeUpload?q(W):S(W)},E=W=>{try{const $=d.value.findIndex(Y=>Y.uid&&W.uid&&Y.uid===W.uid||Y.name&&W.name&&Y.name===W.name);$>-1&&d.value.splice($,1)}catch{}},z=W=>{try{_.value=_.value.filter($=>$.uid!==W.uid)}catch{}},q=async W=>{if((x.longVideoParams.materialVideo||[]).filter(w=>w.fnType==="material").length>=o.maxCount&&o.activeTabKey=="2"){qe.error(c("public-video-upload.index.101106-3",[o.maxCount]));return}const{file:Y,onSuccess:j,onError:V}=W;G.value++;try{p.value=!0,m("loading",!0),m("startUploading");const I=await(be=>new Promise(ne=>{const le=document.createElement("video");le.preload="metadata",le.onloadedmetadata=()=>{ne({duration:le.duration,width:le.videoWidth,height:le.videoHeight,aspectRatio:le.videoWidth/le.videoHeight})},le.onerror=()=>{ne({duration:0,width:0,height:0,aspectRatio:0})},le.src=URL.createObjectURL(be)}))(Y),k=new FormData;k.append("file",Y);const B=await Fc(k);if(B&&B.code===0){const be=B.data;be.duration=I.duration,be.width=I.width,be.height=I.height,be.aspectRatio=I.aspectRatio,j&&j(B,Y),m("success",be)}else V&&V(B||new Error("upload failed")),E(Y),z(Y),qe.error((B==null?void 0:B.message)||c("public-video-upload.index.101106-5",[Y.name]))}catch(w){V&&V(w),E(Y),z(Y),qe.error(c("public-video-upload.index.101106-5",[Y.name]))}finally{E(Y),G.value--,G.value===0&&(o.isNotRemoveFileList||(_.value=[]),p.value=!1,m("loading",!1),m("endUploading"))}},S=async W=>{const{file:$,onSuccess:Y,onError:j}=W;G.value++;const V=new FormData;V.append("file",$),o.temp&&V.append("temp","true"),o.uploadBizType&&V.append("uploadBizType",o.uploadBizType);try{p.value=!0,m("loading",!0),m("startUploading");const w=await Va(V);if(w.code===200){Y&&Y(w,$);let I=w.payload;m("success",{src:I,filename:$.name,tag:""}),o.isUpdate&&m("update:value",I),qe.success(c("public-video-upload.index.101106-6"))}else z($),qe.error(w.message||c("public-video-upload.index.101106-5",[$.name]))}catch(w){j&&j(w),z($),qe.error(c("public-video-upload.index.101106-5",[$.name]))}finally{E($),G.value--,G.value===0&&(_.value.map(w=>{var I;return(I=w==null?void 0:w.response)==null?void 0:I.payload}),p.value=!1,m("loading",!1),m("endUploading"))}},O=async W=>{var Y;const $=(Y=W.response)==null?void 0:Y.payload;if($){const j=document.createElement("div");j.style.position="fixed",j.style.top="0",j.style.left="0",j.style.width="100%",j.style.height="100%",
134j.style.backgroundColor="rgba(0, 0, 0, 0.8)",j.style.display="flex",j.style.justifyContent="center",j.style.alignItems="center",j.style.zIndex="10000";const V=document.createElement("video");V.src=$,V.controls=!0,V.style.maxWidth="90%",V.style.maxHeight="90%";const w=document.createElement("button");w.innerHTML=c("status-tag.index.9326454-1"),w.style.position="absolute",w.style.top="20px",w.style.right="20px",w.style.padding="10px 20px",w.style.backgroundColor="#fff",w.style.border="none",w.style.borderRadius="4px",w.style.cursor="pointer",w.onclick=()=>{document.body.removeChild(j)},j.appendChild(V),j.appendChild(w),document.body.appendChild(j)}},N=W=>{const $=_.value.indexOf(W);if($>-1)if(_.value.splice($,1),o.multiple){const Y=_.value.map(j=>{var V;return(V=j==null?void 0:j.response)==null?void 0:V.payload});m("update:value",Y),m("success",Y,_.value)}else m("update:value",""),m("success","")};return g({updateVideo:()=>{let W=[];Array.isArray(o.value)?W=o.value:typeof o.value=="string"&&o.value&&(W=[o.value]),_.value=W.map((Y,j)=>({uid:j+"",name:c("public-video-upload.index.101106-7",[j+1]),status:"done",url:Y,response:{payload:Y}}));const $=_.value.map(Y=>{var j;return(j=Y==null?void 0:Y.response)==null?void 0:j.payload});m("update:value",$),m("success",$,_.value),m("endUploading")},clearVideo:()=>{_.value=[]},clearFiles:()=>{d.value=[]},remove:W=>{try{const $=_.value.findIndex(Y=>{var j;return W===((j=Y.response)==null?void 0:j.payload)});$>-1&&_.value.splice($,1)}catch{}},fileList:_,handleCustomUploads:a}),Rt(()=>{}),fa(()=>{}),(W,$)=>{const Y=qa;return l(),f("div",I$,[y(Y,{name:u.name,"list-type":u.listType,class:Qe(u.customClass),"show-upload-list":u.showUploadList,beforeUpload:U,customRequest:a,accept:u.accept,multiple:u.multiple,"file-list":_.value,"onUpdate:fileList":$[0]||($[0]=j=>_.value=j),onPreview:O,onRemove:N,maxCount:u.maxCount},{default:P(()=>[xn(W.$slots,"default",{},()=>[_.value.length<o.maxCount&&u.multiple||!u.multiple?(l(),f(we,{key:0},[u.value?(l(),f("video",{key:0,src:u.value,alt:"video",class:"w-60px h-60px",controls:""},null,8,C$)):(l(),f("div",k$,[p.value?(l(),ve(e(Y0),{key:0,class:"text-[rgba(61,61,61,0.8)]"})):(l(),ve(e(Xl),{key:1,class:"text-[rgba(61,61,61,0.8)]"})),t("div",w$,r(e(c)("public-video-upload.index.101106-0")),1)]))],64)):he("",!0)])]),_:3},8,["name","list-type","class","show-upload-list","accept","multiple","file-list","maxCount"])])}}},M$={class:"flex pl-12px"},S$={class:"flex pt-6px"},$$={key:0,class:"video-translation-upload-btn mr-8px mb-8px"},T$={key:0,src:au,alt:"",class:"w-16px h-16px"},A$={key:1,class:"text-center"},U$={class:"text-10px"},L$={key:1},E$={__name:"VideoTranslationUpload",emits:["success","updateScript"],setup(u,{expose:g,emit:i}){const{t:c}=mt(),o=bt(),x=i,_=h([]),m=h(!1),p=h(!1),d=h(null);h(null);const R=h(!1),U=z=>new Promise((q,S)=>{const O=document.createElement("video");O.preload="metadata",O.onloadedmetadata=()=>{window.URL.revokeObjectURL(O.src),q(O.duration)},O.onerror=()=>{window.URL.revokeObjectURL(O.src),S(new Error(c("components-qinghu-ai.VideoTranslationUpload.738063-63")))},O.src=z}),G=()=>{p.value=!0},a=()=>{p.value=!1},E=async z=>{if(R.value=!1,z){const q=z.src||"";let S=z.duration||0;if(!S&&q)try{S=await U(q)}catch{S=0}const O={url:q,filename:z.filename||"",tag:z.tag||"",duration:S,width:z.width||0,height:z.height||0,aspectRatio:z.aspectRatio||0};m.value?o.longVideoParams.materialVideo.push(O):o.longVideoParams.materialVideo=[O],x("success",o.longVideoParams.materialVideo)}};return Ne(()=>R.value,z=>{if(!z){const q=document.querySelector(".qinghu-link-pix-content");if(!q)return;q.style.overflowY="auto"}},{deep:!0}),g({uploadLoading:p}),(z,q)=>{const S=Wt;return l(),f("div",M$,[t("div",S$,[e(o).longVideoParams.materialVideo.length?(l(),ve(b$,{key:0})):he("",!0),y(P$,{ref_key:"uploadRef",ref:d,value:e(_),"onUpdate:value":q[0]||(q[0]=O=>Fe(_)?_.value=O:null),name:"coverVideo",temp:!1,multiple:e(m),showUploadList:!1,maxCount:1,size:100*1024*1024,uploadBizType:"COMMON_VIDEO",onStartUploading:G,onEndUploading:a,onSuccess:E,class:"video-translation-upload",isSeedeUpload:!1,activeTabKey:"1"},{default:P(()=>[!e(m)&&!e(o).longVideoParams.materialVideo.length?(l(),f("div",$$,[e(p)?(l(),f("div",A$,[y(S,{size:"small"}),t("div",U$,r(e(c)("qinghu-ai.video-translation-upload.000000-4")),1)])):(l(),f("img",T$))])):(l(),f("div",L$))]),_:1},8,["value","multiple"])])])}}},q$=It(E$,[["__scopeId","data-v-53d4737f"]]),D$={style:{display:"inline-flex","align-items":"center"}},O$={class:"customize-editor-label"},N$={key:0,class:"customize-editor-placeholder"},R$={__name:"custom-tooltip-label",props:{node:Object,updateAttributes:Function,editor:Object},setup(u){var d,R,U;const{t:g}=mt(),i=u,c=h(((U=(R=(d=i==null?void 0:i.node)==null?void 0:d.attrs)==null?void 0:R.props)==null?void 0:U.tooltip)||""),o=F(()=>{var G,a,E;return((E=(a=(G=i==null?void 0:i.node)==null?void 0:G.attrs)==null?void 0:a.props)==null?void 0:E.needDelete)!==!1}),x=F(()=>{var G,a,E;return((E=(a=(G=i==null?void 0:i.node)==null?void 0:G.attrs)==null?void 0:a.props)==null?void 0:E.placeholder)||""}),_=F(()=>{var G,a,E;return!!((E=(a=(G=i==null?void 0:i.node)==null?void 0:G.attrs)==null?void 0:a.props)!=null&&E.promptLocked)}),m=F(()=>_.value?"":o.value?g("components-editor-components.custom-tooltip-label.738063-33"):"");function p(G){var a,E,z,q;o.value&&((q=(a=i.editor)==null?void 0:a.emit)==null||q.call(a,"custom-tooltip-label-click",{props:(z=(E=i==null?void 0:i.node)==null?void 0:E.attrs)==null?void 0:z.props}))}return(G,a)=>{const E=ca;return l(),ve(e(Zl),{style:{display:"inline-block"}},{default:P(()=>[t("span",D$,[y(E,{title:m.value},{default:P(()=>[t("div",{class:"customize-editor-label-container",onClick:Be(p,["stop"])},[t("div",O$,[t("span",null,r(c.value),1),o.value?(l(),f("img",{key:0,src:Ca,alt:"",class:"customize-editor-close",onClick:Be(p,["stop"])})):he("",!0)])])]),_:1},8,["title"]),x.value?(l(),f("span",N$,r(x.value),1)):he("",!0)])]),_:1})}}},F$=It(R$,[["__scopeId","data-v-9b8c0fd0"]]),G$={__name:"prompt-lock-icon",props:{editor:Object},setup(u){const g=u;function i(){var c,o;(o=(c=g.editor)==null?void 0:c.emit)==null||o.call(c,"prompt-lock-icon-click")}return(c,o)=>(l(),ve(e(Zl),{as:"span",class:"prompt-lock-icon-wrapper"},{default:P(()=>[t("span",{class:"prompt-lock-icon cursor-pointer",contenteditable:"false",onClick:Be(i,["stop","prevent"])},[y(e(mu))])]),_:1}))}},V$=It(G$,[["__scopeId","data-v-c874f0f3"]]),z$=["onKeydown"],B$={class:"prompt-lock-placeholder"},K$={class:"prompt-lock-icon","aria-hidden":"true"},W$={__name:"prompt-lock-placeholder",props:{node:Object,editor:Object},setup(u){const g=u,i=F(()=>{var o,x;return((x=(o=g.node)==null?void 0:o.attrs)==null?void 0:x.text)||""});function c(){var o,x;(x=(o=g.editor)==null?void 0:o.emit)==null||x.call(o,"prompt-lock-icon-click")}return(o,x)=>{const _=ca;return l(),ve(e(Zl),{as:"span",class:"prompt-lock-placeholder-wrapper",contenteditable:"false"},{default:P(()=>[y(_,null,{title:P(()=>
134[...x[0]||(x[0]=[t("div",null,"已设置好æç¤ºè¯æ¨¡æ¿ã",-1),t("div",null,"å¦éä¿®æ¹ï¼ç¹å»å³å¯è§£éç¼è¾æç¤ºè¯",-1)])]),default:P(()=>[t("span",{class:"prompt-lock-trigger",contenteditable:"false",role:"button",tabindex:"0",onClick:Be(c,["stop","prevent"]),onKeydown:[Is(Be(c,["stop","prevent"]),["enter"]),Is(Be(c,["stop","prevent"]),["space"])]},[t("span",B$,r(i.value),1),t("span",K$,[y(e(mu))])],40,z$)]),_:1})]),_:1})}}},j$=It(W$,[["__scopeId","data-v-a3a7a338"]]),H$={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor"};function J$(u,g){return l(),f("svg",H$,[...g[0]||(g[0]=[t("defs",null,[t("clipPath",{id:"master_svg0_219_40462"},[t("rect",{x:"0",y:"0",width:"12",height:"12",rx:"0"})])],-1),t("g",{"clip-path":"url(#master_svg0_219_40462)"},[t("path",{d:"M9.256484075,2.74333135C8.386483675000001,1.87333122,7.230884075,1.39453125,6.000884075,1.39453125C4.770884275,1.39453125,3.615284475,1.87333122,2.745284475,2.74333105C1.875284465,3.61333085,1.396484375,4.76893115,1.396484375,5.99893095C1.396484375,7.22893095,1.875284345,8.384530550000001,2.745284175,9.25453095C3.615283975,10.12453075,4.770884275,10.60333155,6.000884075,10.60333155C7.230884075,10.60333155,8.386483675000001,10.12453175,9.256484075,9.25453185C10.126483875,8.38453145,10.605284675,7.22893095,10.605284675,5.99893095C10.605284675,4.76893115,10.126484875,3.61333135,9.256484075,2.74333135ZM8.457284475,5.58373115L7.535684075,6.48253105L7.752883875,7.75093075C7.780484175,7.91413065,7.715684375,8.07493015,7.581284075,8.17213105C7.505683875,8.227331150000001,7.416883975,8.25493145,7.328083975,8.25493145C7.259684075,8.25493145,7.191283675,8.23813155,7.127684075,8.20453165L5.987684275,7.60573195L4.8476841749999995,8.20453165C4.701283975,8.28133155,4.527284375,8.26933145,4.394084175,8.17213205C4.260884275,8.074932050000001,4.194884275,7.91293145,4.222484075000001,7.75093175L4.440884075,6.48133085L3.519284275,5.58253095C3.400484275,5.46733095,3.358484175,5.29813095,3.410084275,5.14093085C3.461684275,4.983730749999999,3.594884375,4.87093095,3.758084275,4.84813095L5.031283875,4.66333105L5.601284075,3.50893115C5.674483775,3.36013135,5.822083975,3.2689311500000002,5.987684275,3.2689311500000002C6.153284075,3.2689311500000002,6.300884275,3.36133115,6.374083975,3.50893115L6.944084175,4.66333105L8.217284175,4.84813095C8.380484075,4.8721311499999995,8.514884474999999,4.98373125,8.565284275,5.14213105C8.618084875000001,5.29813095,8.576084175,5.46733095,8.457284475,5.58373115Z","fill-opacity":"1",style:{"mix-blend-mode":"passthrough"}})],-1)])])}const Y$={render:J$},Q$=.02,X$=u=>{if(!u||typeof u!="string")return 0;const[g,i]=u.split(":").map(Number);return!g||!i?0:g/i},Z$=u=>new Promise((g,i)=>{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{g({width:c.naturalWidth||c.width||0,height:c.naturalHeight||c.height||0})},c.onerror=i,c.src=u});function eT(){const u=bt(),g=oa(),i=wa();let c=[];const o=()=>{const _=u.videoTimeData.find(m=>m.id===u.videoGenerateParams.currentTimeActiveId);if(!(_!=null&&_.supportedAspectRatios))return"";try{c=JSON.parse(_.supportedAspectRatios);const m=Array.isArray(c)?c.find(p=>(p==null?void 0:p.code)===u.videoGenerateParams.orientation):null;return(m==null?void 0:m.aspectRatio)||""}catch{return c=[],""}};return{validateFirstFrameAspectRatio:async _=>{var d;if(u.aiMessageType!=="IMAGETOVIDEO"){_.onContinue();return}if(!((d=u.batchUploadImgUrls)!=null&&d.length&&u.videoGenerateParams.imageInputMode==="first_frame")){_.onContinue();return}const m=u.batchUploadImgUrls[0],p=o();if(!m||!p){_.onContinue();return}try{const{width:R,height:U}=await Z$(m),G=R/U,a=X$(p);if(a>0&&Math.abs(a-G)<=Q$){_.onContinue();return}i.confirm({icon:St(pa),title:"æç¤º",content:"æ¨ä¸ä¼ çé¦å¼ 徿¯ä¾ä¸éä¸çè§é¢çææ¯ä¾ä¸ç¸ç¬¦ï¼æ¯å¦è¿è¡è£åª",okText:"è£åª",cancelText:"ç»§ç»çæ",onOk(){u.cropImageMode={visible:!0,url:m,aspectRatio:p,radioList:c}},onCancel(){_.onContinue()}})}catch{g.warning("è·åé¦å¸§å¾çæ¯ä¾å¤±è´¥ï¼è¯·ç¨åéè¯")}}}}const tT={class:"flex items-center"},aT={class:"flex justify-end mb-10px"},nT={class:"video-time-select-trigger"},oT={class:"selected-text"},sT={class:"flex gap-8px justify-between mt-30px"},Wu=Dt({__name:"video-script-form",props:{showVideoType:{type:Boolean,default:!0},maxCount:{type:Number,default:5},showUploadList:{type:Boolean,default:!0},productImage:{type:Array,default:()=>[]},promptTemplateId:{type:[Number,null],default:null},isSyncImage:{type:Boolean,default:!0},showCount:{type:Boolean,default:!1},isBatch:{type:Boolean,default:!1},drawerVisible:{type:Boolean,default:!1},styleStr:{type:String,default:"width: 700px"}},emits:["updateScript","script_loading","onSubmit"],setup(u,{expose:g,emit:i}){const c=i,{t:o,locale:x}=mt(),_=Kt(),m=wa(),p=oa(),d=bt(),R=la(),{avatar:U,nickname:G,userInfo:a}=va(R),{vipInfo:E}=a.value;h("");const z=u,q=h(z.maxCount);h(!1);const S=h(!1),O=h(),N=h(),ae=h([]),L=Vn({images:[],imageList:[],language:o("qinghu-ai.video-script.120875-0"),pointDescription:"",productName:"",promptTemplateId:null,count:1,isStyleTitles:z.isBatch}),K=h(5),de=h([{code:"simplified-chinese",name:o("utils.video-translate.simplified-chinese")},{code:"traditional-chinese",name:o("utils.video-translate.traditional-chinese")},{code:"english",name:o("utils.video-translate.english")},{code:"spanish",name:o("utils.video-translate.spanish")},{code:"french",name:o("utils.video-translate.french")},{code:"german",name:o("utils.video-translate.german")},{code:"japanese",name:o("utils.video-translate.japanese")},{code:"korean",name:o("utils.video-translate.korean")},{code:"portuguese",name:o("utils.video-translate.portuguese")},{code:"italian",name:o("utils.video-translate.italian")},{code:"arabic",name:o("utils.video-translate.arabic")},{code:"russian",name:o("utils.video-translate.russian")}
134,{code:"thai",name:o("utils.video-translate.thai")},{code:"malay",name:o("utils.video-translate.malay")},{code:"indonesian",name:o("utils.video-translate.indonesian")},{code:"filipino",name:o("qinghu-ai.long-image-params.255520-2")},{code:"vietnamese",name:o("qinghu-ai.video-script.120875-5")}]),W=h(null),$=h(""),Y=h([]);h(-1),h([]);const j=h(!1),V=h(!1),w=F(()=>d.videoModels||[]),I=F(()=>El(w.value,d.videoGenerateParams)),k=F(()=>{var ge;return((ge=I.value)==null?void 0:ge.modelId)||""}),B=F(()=>{var ge;return((ge=I.value)==null?void 0:ge.name)||o("components-qinghu-ai.video-params.model-list-title")}),be=h(!1),ne=()=>{var ge;(ge=d.batchUploadImgUrls)!=null&&ge.length&&(L.images=[],L.imageList=[],L.imageList=d.batchUploadImgUrls),z.productImage.length&&(L.images=[],L.imageList=[],L.imageList=z.productImage),z.promptTemplateId&&(L.promptTemplateId=z.promptTemplateId),ce(),setTimeout(()=>{tt(()=>{var Ce;(Ce=N==null?void 0:N.value)==null||Ce.updateImg()})},1)},le=ge=>{ge&&ge.imageInputMode=="first_last_frame"?(q.value=2,L.imageList.length>2&&(L.imageList=L.imageList.slice(0,2)),d.imageMapping.length>2&&(L.imageList=L.imageList.slice(0,2))):q.value=5;const Ce=JSON.parse(JSON.stringify(d.videoGenerateParams));d.setFirstFrameInfo(ge,Ce),tt(()=>{d.setDefaultPurpose({defaultlist:L.imageList})})},ce=()=>{var Ce,$e,at;K.value=((Ce=d==null?void 0:d.videoGenerateParams)==null?void 0:Ce.currentTimeActiveId)||2,z.isBatch&&(($e=d==null?void 0:d.videoGenerateParams)!=null&&$e.sameStyleProductName)&&(L.productName=(at=d==null?void 0:d.videoGenerateParams)==null?void 0:at.sameStyleProductName);let ge=d.videoTimeData.find(nt=>nt.id==K.value);ge&&le(ge)};Ne(()=>d.videoGenerateParams,ge=>{ge&&ce()},{immediate:!0,deep:!0});const J=async()=>{const{code:ge,data:Ce}=await rg();ge===0&&Ce&&Array.isArray(Ce)&&Ce.length>0&&(ae.value=Ce,L.promptTemplateId=Ce[0].id)},oe=Jl(async()=>{try{await O.value.validate();let ge=await Gl({imageList:L.imageList,pointDescription:L.pointDescription,productName:L.productName});ge.success?p.success(o("strategy-generator.index.033017-14")):p.error(ge.message||o("utils.request.932181-2"))}catch{}},1e3),te=async()=>{try{await O.value.validate(),L.images=L.imageList.length?L.imageList:[],d.isFirstFrame&&d.imageMapping&&(L.images=Object.values(d.imageMapping).sort((ge,Ce)=>ge.tag===o("qinghu-ai.long-image-material.139562-33")&&Ce.tag===o("components-qinghu-ai.video-batch-generate.738063-223")?-1:ge.tag===o("components-qinghu-ai.video-batch-generate.738063-223")&&Ce.tag===o("qinghu-ai.long-image-material.139562-33")?1:0).map(ge=>ge.url)),z.isSyncImage&&(d.batchUploadImgUrls=L.imageList),L.modelSkuId=K.value||"",c("onSubmit"),Y.value=[],$.value="",await ie()}catch{}},Q=()=>`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,9)}`,ie=async()=>{L.duration=d.videoGenerateParams.duration||5,W.value=new AbortController,$.value="",c("updateScript",{script:$.value,status:"start",taskForm:L}),S.value=!0,c("script_loading",!0),c("updateTaskForm",L),await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":x.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify(L),signal:W.value.signal,openWhenHidden:!0,onmessage(ge){var Ce,$e;try{S.value=!1;const at=JSON.parse(ge.data),{role:nt,type:Se,data:se,index:Te,title:Xe}=at||{};if(Se==="chat_number_over")return W.value.abort(),W.value=null,m.confirm({title:o("qinghu-ai.video-script.120875-9"),icon:St(ra),content:se,cancelText:o("qinghu-ai.video-script.120875-10"),okText:o("qinghu-ai.video-script.120875-11"),keyboard:!1,maskClosable:!1,onOk(){_.push("/product?product=vip")}});if(nt==="assistant"&&Se==="answer"&&typeof se=="string")if(!z.isBatch)$.value+=se,c("updateScript",{script:$.value,status:"updating",taskForm:L});else{const pt=Y.value.find(Ge=>Ge.index===Te);pt?pt.messageList[0].content+=se:Y.value.push({id:Q(),title:Xe,index:Te,messageList:[{type:Se,content:se}]});let gt=JSON.parse(JSON.stringify(L));gt.currentChatSecond=((Ce=d.videoTimeData.find(Ge=>Ge.id===K.value))==null?void 0:Ce.duration)||5,gt.size=($e=d.videoTimeData.find(Ge=>Ge.id===K.value))==null?void 0:$e.size,c("updateScript",{batchGenerateResults:Y.value,status:"updating",taskForm:gt})}}catch{}},async onopen(ge){if(ge.status&&["401","500","600"].includes(String(ge.status)))if(ge.status==401){p.error(o("qinghu-ai.video-script.120875-14"));let Ce=setTimeout(()=>{clearTimeout(Ce),window.location.reload()},600)}else(ge.status==500||ge.status==600)&&p.error(o("qinghu-ai.video-script.120875-15"));return Promise.resolve()}
134,onerror(ge){S.value=!1,p.error(o("qinghu-ai.video-script.120875-17")),W.value.abort(),W.value=null,c("script_loading",!1),c("updateScript",{status:"error"})},async onclose(){var Ce,$e;S.value=!1;let ge=JSON.parse(JSON.stringify(L));ge.currentChatSecond=((Ce=d.videoTimeData.find(at=>at.id===K.value))==null?void 0:Ce.duration)||5,ge.size=($e=d.videoTimeData.find(at=>at.id===K.value))==null?void 0:$e.size,c("updateScript",{script:$.value,status:"finish",taskForm:ge,batchGenerateResults:Y.value}),c("script_loading",!1)}})};Ne(()=>z.drawerVisible,async ge=>{await tt()},{deep:!0,immediate:!0}),Ne(()=>d.batchUploadImgUrls,ge=>{if(!ge||!Array.isArray(ge)||!ge.length){be.value=!1;return}L.imageList=ge,d.setDefaultPurpose({defaultlist:L.imageList}),tt(()=>{setTimeout(async()=>{await O.value.validateFields(["imageList"])},200)})},{immediate:!0,deep:!0}),Ne(()=>d.ali1688SameStyleImgList.originalImage,async ge=>{ge||(L.productName="",L.pointDescription="")},{deep:!0});const _e=(ge,Ce)=>{L.imageList=ge,d.setDefaultPurpose({defaultlist:L.imageList}),tt(()=>{setTimeout(async()=>{await O.value.validateFields(["imageList"])},200)})},Re=ge=>{L.productName=ge.productName||"",L.pointDescription=ge.pointDescription||"",L.imageList=ge.imageList||[],d.batchUploadImgUrls=ge.imageList,d.isFirstFrame&&ce(),tt(()=>{var Ce;(Ce=N.value)==null||Ce.updateImg()})},ye=ge=>{const Ce=typeof ge=="string"?ge:ge==null?void 0:ge.url;L.imageList=L.imageList.filter($e=>(typeof $e=="string"?$e:$e==null?void 0:$e.url)!==Ce),Ce&&d.imageMapping&&delete d.imageMapping[Ce],tt(()=>{var $e;($e=N.value)==null||$e.updateImg()})};Rt(()=>{z.showVideoType&&J(),ce()});const me=(ge,Ce)=>{const $e=Ps(ge,Ce);return $e?(Ce!=5&&["three-four","four-three","square"].includes(d.videoGenerateParams.orientation)&&(d.videoGenerateParams.orientation="portrait"),d.videoGenerateParams.selectedModelId=ge.modelId,d.videoGenerateParams.modelSkuId=$e.modelSkuId,d.videoGenerateParams.modelCode=$e.modelCode||ge.modelCode,d.videoGenerateParams.currentTimeActiveId=$e.modelSkuId,d.videoGenerateParams.duration=Ce,d.videoGenerateParams.size=$e.size,d.videoGenerateParams.imageInputMode=$e.imageInputMode,d.videoGenerateParams.isFree=$e.isFree||null,K.value=$e.modelSkuId,le($e),!0):!1},re=ge=>{var at;const $e=String(k.value)===String(ge.modelId)?d.videoGenerateParams.duration:(at=$u(ge))!=null?at:zn(ge);me(ge,$e)&&(j.value=!1)},fe=ge=>{const Ce=I.value;!Ce||Number(d.videoGenerateParams.duration)===Number(ge)||me(Ce,ge)&&Tu(Ce,ge)},Oe=async()=>{var ge;if(!((ge=d.videoModels)!=null&&ge.length||V.value)){V.value=!0;try{const Ce=await Wn({businessType:"video",durationSelectable:!0}),$e=Ce==null?void 0:Ce.data,at=Array.isArray($e)?$e:$e==null?void 0:$e.models;if(!Array.isArray(at))return;const nt=wu(at);d.videoModels=nt,d.videoTimeData=Pu(nt)}catch{}finally{V.value=!1}}},Ve=ge=>{L.productName=ge.productName||"",L.pointDescription=ge.productSellingPoint||""},H=ge=>{be.value=ge},st=ge=>{L.language=ge,d.videoGenerateParams.language=ge};return Rt(()=>{Oe()}),Ne(()=>d.videoGenerateParams.language,ge=>{L.language=ge},{immediate:!0,deep:!0}),g({init:ne,taskForm:L}),(ge,Ce)=>{const $e=ni,at=Bt,nt=Ql,Se=ba,se=Oa,Te=Qa,Xe=Ya,pt=Yl,gt=Lt,Ge=Wt;return l(),ve(Ge,{spinning:e(be),tip:e(o)("components-qinghu-ai.video-script-form.407726-110"),wrapperClassName:"script-form-spin"},{default:P(()=>[t("div",{class:"script-content",style:Nt([{"margin-top":"20px"},u.styleStr])},[t("div",tT,[y($e,{hideIcon:!1,class:"px-0! mb-10px","no-bg":"",hideUpdateBtn:"",tip:`${e(o)("qinghu-ai.video-script.120875-22")}${e(o)("qinghu-ai.video-script.120875-23")}`},null,8,["tip"]),t("div",aT,[y(ai,{onSelect:Re})])]),y(pt,{model:e(L),ref_key:"formRef",ref:O,layout:"vertical","label-align":"left",class:"w-full"},{default:P(()=>[y(nt,{label:e(o)("components-qinghu-ai.video-params.model-list-title"),name:"selectedModelId",class:"mb-12px!"},{default:P(()=>[y(at,{open:e(j),"onUpdate:open":Ce[0]||(Ce[0]=T=>Fe(j)?j.value=T:null),trigger:"click",placement:"bottomLeft",overlayClassName:"video-time-select-popover",getPopupContainer:T=>T.parentNode},{content:P(()=>[y(Uu,{models:e(w),selectedModelId:e(k),loading:e(V),onSelectModel:re},null,8,["models","selectedModelId","loading"])]),default:P(()=>[t("div",nT,[t("span",oT,r(e(B)),1),t("span",{class:Qe(["dropdown-arrow",{open:e(j)}])},[...Ce[7]||(Ce[7]=[t("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[t("path",{d:"M512 714.667c-17.067 0-29.867-4.267-42.667-17.067l-341.333-341.333c-25.6-25.6-25.6-64 0-89.6s64-25.6 89.6 0L512 558.933l294.4-294.4c25.6-25.6 64-25.6 89.6 0s25.6 64 0 89.6l-341.333 341.333c-12.8 14.933-25.6 19.2-42.667 19.2z",fill:"
134currentColor"})],-1)])],2)])]),_:1},8,["open","getPopupContainer"])]),_:1},8,["label"]),y(nt,{label:e(o)("qinghu-ai.video-params.587254-0"),name:"currentTimeId",class:"mb-12px!"},{default:P(()=>[y(Au,{model:e(I),selectedDuration:e(d).videoGenerateParams.duration,count:e(L).count,onDurationChange:fe},null,8,["model","selectedDuration","count"])]),_:1},8,["label"]),y(nt,{rules:[{type:"array",required:!0,message:e(o)("qinghu-ai.video-storyboard.212512-2")}],label:`${e(o)("qinghu-ai.video-script.810436-1")}(${e(o)("qinghu-ai.video-script.810436-2")})`,name:"imageList",class:"mb-12px!"},{default:P(()=>[t("div",null,[y(Vu,{onClick:Ce[1]||(Ce[1]=Be(()=>{},["stop"])),ref:"videoBatcGenerateRef",maxCount:e(q),isSendDisabled:!1,showDelete:!1,showClose:!0,showSameStyle:!0,isBeginnerPrompt:!1,showOperationBtn:!1,drawerVisible:u.drawerVisible,onSuccess:_e,styleStr:"margin-top:0px;width: 88px;display: block",purposeStyle:"height:27px;background: #F7F7F7;margin-right:0px;border-radius: 0px 0px 6px 6px;",imgStyle:"width:100%;height:88px",uploadStyle:"width:88px;height:88px",style:{"padding-left":"0"},showBatch:!1,isGeneratePromptForm:!0,onSellingPoints:Ve,onLoading:H,onImageDeleted:ye},null,8,["maxCount","drawerVisible"])])]),_:1},8,["rules","label"]),y(nt,{label:e(o)("qinghu-ai.video-script.120875-33"),name:"productName",required:"",class:"mb-12px!",rules:[{required:!0,message:e(o)("qinghu-ai.video-script.120875-34")}]},{default:P(()=>[y(Se,{value:e(L).productName,"onUpdate:value":Ce[2]||(Ce[2]=T=>e(L).productName=T),placeholder:e(o)("qinghu-ai.video-script.120875-35")},null,8,["value","placeholder"])]),_:1},8,["label","rules"]),y(nt,{label:e(o)("qinghu-ai.video-script.120875-36"),name:"pointDescription",class:"mb-12px!"},{default:P(()=>[y(se,{value:e(L).pointDescription,"onUpdate:value":Ce[3]||(Ce[3]=T=>e(L).pointDescription=T),rows:3},null,8,["value"])]),_:1},8,["label"]),u.showVideoType?(l(),ve(nt,{key:0,label:e(o)("qinghu-ai.video-script.120875-37"),name:"promptTemplateId",class:"mb-12px!"},{default:P(()=>[y(Xe,{value:e(L).promptTemplateId,"onUpdate:value":Ce[4]||(Ce[4]=T=>e(L).promptTemplateId=T)},{default:P(()=>[(l(!0),f(we,null,Je(e(ae),T=>(l(),ve(Te,{key:T.id,value:T.id},{default:P(()=>[De(r(T.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"])):he("",!0),y(nt,{label:e(o)("qinghu-ai.video-script.120875-38"),name:"language",class:"mb-12px!"},{default:P(()=>[y(Xe,{value:e(L).language,"onUpdate:value":Ce[5]||(Ce[5]=T=>e(L).language=T),onChange:st},{default:P(()=>[(l(!0),f(we,null,Je(e(de),T=>(l(),ve(Te,{key:T.code,value:T.code},{default:P(()=>[De(r(T.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),u.showCount?(l(),ve(nt,{key:1,label:e(o)("components-qinghu-ai.video-script-form.738063-241"),name:"language",class:"mb-12px!"},{default:P(()=>[y(Xe,{value:e(L).count,"onUpdate:value":Ce[6]||(Ce[6]=T=>e(L).count=T)},{default:P(()=>[(l(),f(we,null,Je(10,T=>y(Te,{key:T,value:T},{default:P(()=>[De(r(T),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),_:1},8,["label"])):he("",!0)]),_:1},8,["model"]),t("div",sT,[y(gt,{class:"w-full",type:"primary",loading:e(S),onClick:e(oe),ghost:""},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script-form.964932-0")),1)]),_:1},8,["loading","onClick"]),y(gt,{class:"w-full",type:"primary",loading:e(S),onClick:te},{default:P(()=>[De(r(e(o)("qinghu-ai.video-script.120875-23")),1)]),_:1},8,["loading"])])],4)]),_:1},8,["spinning","tip"])}}}),lT={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor"};function iT(u,g){return l(),f("svg",lT,[...g[0]||(g[0]=[t("g",null,[t("g",null,[t("g",null,[t("g",null,[t("path",{d:"M8.3963751625,1.80093914L10.2052831625,5.4661865L14.2501240625,6.053936C14.6192240625,6.1075692,14.7615080625,6.545476,14.4944250625,6.8058171L11.5675500625,9.6588135L12.2584910625,13.68731C12.3215420625,14.054918,11.9490370625,14.32556,11.6189050625,14.151999L8.0010881625,12.25L4.3832726625,14.151998C4.053140362500001,14.32556,3.6806349625,14.054918,3.7436847625,13.68731L4.4346260625,9.6588135L1.5077518825,6.8058167C1.2406691925,6.545476,
1341.3829534625,6.1075692,1.7520526625000001,6.053936L5.7968931625,5.4661865L7.6058010625,1.8009389599999999C7.7708673625,1.46647838,8.2313094625,1.46647838,8.3963751625,1.80093914ZM7.7957262625,3.6756601L8.0010881625,3.259552L8.206449062499999,3.6756592L9.5412168625,6.3801942L12.5258500625,6.8138871L12.9850510625,6.8806129L12.6527700625,7.2045069L10.4930686625,9.3096943L11.0029060625,12.282267L11.0813460625,12.739613L10.6706256625,12.523684L8.0010890625,11.120227L5.3315524625,12.523682L4.9208292625,12.739612L4.9992704625,12.282266L5.5091066625,9.3096943L3.3494078625,7.2045074L3.0171260625,6.8806129L3.4763269625,6.8138871L6.4609589625,6.3801942L7.7957262625,3.6756601Z","fill-rule":"evenodd","fill-opacity":"1"})])])])],-1)])])}const rT={render:iT},cT={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor"};function uT(u,g){return l(),f("svg",cT,[...g[0]||(g[0]=[t("g",null,[t("g",null,[t("g",null,[t("g",null,[t("path",{d:"M8.3963751625,1.80093914C9.0306672625,3.0861559,10.2052831625,5.4661865,10.2052831625,5.4661865C10.2052831625,5.4661865,12.8318030625,5.8478422,14.2501240625,6.053936C14.6192240625,6.1075692,14.7615080625,6.545476,14.4944250625,6.8058171C13.4681180625,7.8062181,11.5675500625,9.6588135,11.5675500625,9.6588135C11.5675500625,9.6588135,12.0162130625,12.27472,12.2584910625,13.68731C12.3215420625,14.054918,11.9490370625,14.32556,11.6189050625,14.151999C10.3503188625,13.485064,8.0010881625,12.25,8.0010881625,12.25C8.0010881625,12.25,5.6518573625,13.485064,4.3832726625,14.151998C4.053140362500001,14.32556,3.6806349625,14.054918,3.7436847625,13.68731C3.9859628625,12.27472,4.4346260625,9.6588135,4.4346260625,9.6588135C4.4346260625,9.6588135,2.5340583624999997,7.8062181,1.5077518825,6.8058167C1.2406691925,6.545476,1.3829534625,6.1075692,1.7520526625000001,6.053936C3.1703734625,5.8478422,5.7968931625,5.4661865,5.7968931625,5.4661865C5.7968931625,5.4661865,6.9715084625,3.0861557,7.6058010625,1.8009389599999999C7.7708673625,1.46647838,8.2313094625,1.46647838,8.396375662499999,1.8009389599999999","fill-opacity":"1"})])])])],-1)])])}const dT={render:uT},pT={__name:"collect-button",props:{item:{type:Object,default:()=>{}},index:{type:Number,default:()=>0}},emits:["updateMessage"],setup(u,{emit:g}){const{t:i}=mt(),c=u,o=g,x=(m,p)=>{m.isCollect||_(m,p)},_=async(m,p)=>{var U;const d={type:"VIDEO",text:m.content||m.streamResult,duration:((U=c==null?void 0:c.scriptForm)==null?void 0:U.second)||""};m.isCollect=!0;const R=await cg(d);R.code==200&&(m.collectId=R.payload,qe.success(i("qinghu-ai.video-script-drawer.995810-15")),o("updateMessage",m,p))};return(m,p)=>{const d=ca;return l(),ve(d,null,{title:P(()=>[De(r(e(i)("components-qinghu-ai.collect-button.738063-84")),1)]),default:P(()=>[t("span",{class:"bg-[#F2F3F5] flex items-center justify-center p-5px rounded-[4px] cursor-pointer mr-6px",onClick:p[0]||(p[0]=R=>x(u.item,u.index))},[u.item.isCollect?(l(),ve(e(dT),{key:1,class:"color-primary"})):(l(),ve(e(rT),{key:0,class:"color-primary"}))])]),_:1})}}},mT={class:"h-full"},gT={class:"h-full pl-32px"},fT={class:"message-container"},vT={key:0},hT={class:"w-full h-full flex justify-start align-start"},_T={class:"message user"},yT={class:"flex w-full"},xT={class:"mr-16px flex justify-end flex-1"},bT=["src"],IT=["innerHTML"],CT={key:1},kT={class:"w-full h-full flex justify-start align-start"},wT={class:"message answer"},PT={class:"flex"},MT={key:0},ST={class:"flex"},$T=["innerHTML"],TT={key:0,class:"flex items-centermt-10px mt-10px"},AT=["onClick"],UT={key:1,class:"h-32px flex items-center"},LT={class:"ml-10px color-primary"},ET={class:"w-full h-138px px-20px py-12px absolute bottom-0 left-0 shadow-[0px_-3px_14px_0px_rgba(0,0,0,0.05)]"},qT={class:"flex flex-col items-end justify-end border-1px border-solid border-#E8E8E8 rounded-[8px] h-full"},DT=Dt({__name:"drawer-chat-form",props:{messageList:{type:Array,default:()=>[]},promptGroup:{type:Array,default:()=>[]},spinLoading:{type:Boolean,default:!1},className:{type:String,default:""},tipsText:{type:String,default:""},currentGroupId:{type:String,default:""},scriptForm:{type:Object,default:()=>{}}},emits:["send","generate-video","copy","collect","updateMessage","updateScript","update:messageList","update:group"],setup(u,{expose:g,emit:i}){const{locale:c,t:o}=mt(),x=u,_=i,m=h(""),p=h(null),d=h(null),R=h(""),U=(S=!0)=>{tt(()=>{const O=p.value;if(O)try{O.scrollTo({top:O.scrollHeight,behavior:S?"smooth":"auto"})}catch{O.scrollTop=O.scrollHeight}})},G=()=>{if(!m.value)return qe.error(o("components-qinghu-ai.drawer-chat-form.738063-92"));const S=x.messageList&&x.messageList.length?x.messageList[x.messageList.length-1]:null,O=m.value.replace(/\n/g,"<br/>");_("updateMessage",O);const N={originalPrompt:(S==null?void 0:S.content)||"",promptType:"EDIT_PROMPT_TEMPLE",userSuggestion:m.value,isStyleTitles:!1,language:o("components.VideoTranslationParams.738063-22")};U(),R.value="",a(N)},a=async S=>{m.value="",d.value=new AbortController,_("updateScript",{script:"",status:"start"}),await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":c.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify(S),signal:d.value.signal,openWhenHidden:!0,onmessage(O){try{const N=JSON.parse(O.data),{role:ae,type:L,data:K,index:de,title:W}=N||{};if(L==="chat_number_over")return d.value.abort(),d.value=null,x.messageList.value[x.messageList.value.length-1].loading=!1,Zt.confirm({title:o("qinghu-ai.video-script.120875-9"),icon:St(ra),content:K,cancelText:o("qinghu-ai.video-script.120875-10"),okText:o("qinghu-ai.video-script.120875-11"),keyboard:!1,maskClosable:!1,onOk(){router.push("/product?product=vip")}});ae==="assistant"&&L==="answer"&&typeof K=="string"&&(R.value+=K,_("updateScript",{script:R.value,status:"updating"}),U())}catch{}},async onopen(O){if(O.status&&["401","500","600"].includes(String(O.status)))if(O.status==401){qe.error(o("qinghu-ai.video-script.120875-14"));let N=setTimeout(()=>{clearTimeout(N),window.location.reload()},600)}else O.status==500?qe.error(o("qinghu-ai.video-script.120875-15")):O.status==600&&qe.error(o("qinghu-ai.video-script.120875-15"));return Promise.resolve()}
134,onerror(O){qe.error(o("qinghu-ai.video-script.120875-17")),d.value.abort(),d.value=null,_("updateScript",{script:R.value,status:"finish"})},async onclose(){d.value.abort(),d.value=null,_("updateScript",{script:R.value,status:"finish"})}})},E=S=>{_("generate-video",q(S))},z=(S,O)=>{const ae=(Array.isArray(x.messageList)?x.messageList:[]).map((L,K)=>K!==O?L:{...L,isCollect:S.isCollect||!1,collectId:S.collectId||""});_("update:messageList",ae)},q=S=>JSON.parse(JSON.stringify(S)).replace(/\n/g,"<br>");return g({scrollToBottom:U}),(S,O)=>{const N=Q0,ae=ei,L=ca,K=Lt,de=Wt,W=Oa;return l(),f("div",{class:Qe(["drawer-chat-form h-[calc(100%-248px)]",[u.className]])},[t("div",mT,[t("div",gT,[t("div",{class:"h-full overflow-y-auto text-scroll pr-32px",ref_key:"messageContainerRef",ref:p},[t("div",fT,[(l(!0),f(we,null,Je(u.messageList,($,Y)=>(l(),f(we,{key:Y},[$.type==="user"?(l(),f("div",vT,[t("div",hT,[t("div",_T,[t("div",yT,[t("div",xT,[$.imgUrl?(l(),f("img",{key:0,src:$.imgUrl,alt:"",class:"w-50px h-50px"},null,8,bT)):(l(),f("div",{key:1,style:{"max-width":"90%"},innerHTML:q($.content)},null,8,IT))]),y(N,{src:e(Yr),style:{"flex-shrink":"0","margin-left":"8px"}},null,8,["src"])])])]),y(ae,{style:{margin:"20px 0"}})])):(l(),f("div",CT,[t("div",kT,[t("div",wT,[t("div",PT,[y(N,{src:e(Yr),class:"avatar"},null,8,["src"]),$.content?(l(),f("div",MT,[t("div",ST,[t("div",{style:{"max-width":"90%"},innerHTML:q($.content)},null,8,$T)]),!u.spinLoading&&!$.loading?(l(),f("div",TT,[y(L,null,{title:P(()=>[De(r(e(o)("asset-library.prompt.copy")),1)]),default:P(()=>[t("span",{class:"bg-[#F2F3F5] flex items-center justify-center p-5px rounded-[4px] cursor-pointer mr-6px",onClick:j=>e(ug)($.content)},[y(e(jf),{class:"color-primary"})],8,AT)]),_:2},1024),y(pT,{item:$,onUpdateMessage:O[0]||(O[0]=(j,V)=>z(j,V))},null,8,["item"]),y(K,{type:"primary",size:"small",class:"text-12px! color-[#FFF] flex! items-center! mr-6px",onClick:j=>E($.content)},{default:P(()=>[y(e(wf),{class:"color-[#FFF] w-16px h-16px mr-6px"}),De(" "+r(e(o)("components.MessageBlock.572345-11")),1)]),_:1},8,["onClick"])])):he("",!0)])):(l(),f("div",UT,[y(de,{class:"h-20px",size:"small"}),t("span",LT,r(u.tipsText||e(o)("components-qinghu-ai.drawer-chat-form.304388-6")),1)]))])])]),y(ae,{style:{margin:"20px 0"}})]))],64))),128))])],512)])]),t("div",ET,[t("div",qT,[y(W,{bordered:!1,placeholder:e(o)("components-qinghu-ai.drawer-chat-form.738063-92"),"auto-size":{minRows:3,maxRows:3},value:m.value,"onUpdate:value":O[1]||(O[1]=$=>m.value=$)},null,8,["placeholder","value"]),t("div",{class:Qe(["actions-icon-button primary mr-10px mb-10px",{disabled:!m.value}]),onClick:G},[y(e(gu))],2)])])],2)}}}),ju=It(DT,[["__scopeId","data-v-8b1ef9f6"]]),Da="linkpix-video-open-action",Zn={VIDEO_SCRIPT:"videoScript",VIDEO_STORYBOARD:"videoStoryboard",VIDEO_ONE_CLICK_FILM:"videoOneClickFilm",MODEL_FACE_REPLACEMENT:"ModelFaceReplacement"},OT=u=>typeof u=="string"&&Object.values(Zn).includes(u),NT={class:"flex h-full"},RT={class:"flex-1 ml-32px h-full shadow-[-4px_4px_10px_0px_rgba(0,0,0,0.08)]"},FT={class:"py-20px h-full relative"},GT={class:"px-32px mb-12px"},VT={class:"color-primary"},zT={class:"px-32px"},BT={class:"prompt-word-label"},KT={class:"label-container"},WT=["onClick"],jT={key:1,class:"w-full h-[176px] rounded-12px text-center flex flex-col items-center justify-center mt-88px"},HT={class:"flex items-center justify-center text-16px mt-10px"},JT={class:"ml-10px"},YT={key:2,class:"w-full h-full flex items-center justify-center"},QT={class:"text-center"},XT={class:"mt-22px color-[#3D3D3D]"},ZT={class:"h-full px-14px py-24px relative group"},eA={class:"flex items-center h-12px"},tA={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},aA={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10"},nA={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},oA=Dt({__name:"video-script-drawer",props:{isChatPinned:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},emits:["on-generate-video","update:visible"],setup(u,{emit:g}){const i=u,c=g,{t:o}=mt();Kt();const x=wa(),_=bt(),m=h(!1);h([]);const p=h(null);h(!1),h("");const d=h({}),R=h(!1);h(!1);const U=h([]),G=h(""),a=h(""),E=h();h(null),h(""),h(null);const z=h(null);Ne(()=>i.visible,$=>{m.value=$}),Ne(()=>m.value,$=>{var Y;c("update:visible",$),$&&(Y=_.batchUploadImgUrls)!=null&&Y.length&&tt(()=>
134{p.value.init()})}),Ne(()=>_.batchUploadImgUrls,$=>{var Y;(Y=_.batchUploadImgUrls)!=null&&Y.length||(d.value={},_.ali1688SameStyleImgList.originalImage="",_.ali1688SameStyleImgList.list=[])});const q=$=>{$&&kt("click_prompt_polish",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ç¹å»ãæç¤ºè¯æ¶¦è²ã",buttonName:"æç¤ºè¯æ¶¦è²"}),tt(()=>{if(!$&&U.value.length){x.confirm({title:o("components-qinghu-ai.video-copy.738063-230"),icon:St(ra),content:St("div",[St("div",[o("components-qinghu-ai.video-copy.738063-231")])]),cancelText:o("agent.index.174028-3"),okText:o("agent.index.174028-2"),keyboard:!1,maskClosable:!1,onOk(){m.value=$},class:"confirm-close-modal"});return}m.value=$})},S=($={})=>{($==null?void 0:$.actionKey)===Zn.VIDEO_SCRIPT&&q(!0)},O=$=>{kt("click_prompt_polish_video_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"è§é¢çææä½åº",eventDesc:"ãæç¤ºè¯æ¶¦è²ãï¼çæè§é¢",buttonName:"çæè§é¢",promptLength:($==null?void 0:$.length)||0}),c("on-generate-video",de($)),_.setDefaultPurpose(),m.value=!1},N=($,Y)=>{G.value=$.id,E.value=$.messageList},ae=$=>{a.value=JSON.parse(JSON.stringify(G.value)),E.value.push({type:"user",content:$}),E.value.push({type:"answer",content:"",loading:!0})},L=({batchGenerateResults:$,status:Y,taskForm:j})=>{d.value=j,R.value=!0,Y=="finish"&&(R.value=!1),U.value=$||[],G.value=U.value&&U.value[0]?U.value[0].id:"",E.value=U.value&&U.value[0]?U.value[0].messageList:[]},K=({script:$,status:Y})=>{U.value.map((j,V)=>{j.id==a.value&&(j.messageList[j.messageList.length-1].content=$||"",j.messageList[j.messageList.length-1].loading=Y!="finish")})},de=$=>JSON.parse(JSON.stringify($)).replace(/\n/g,"<br>"),W=async()=>{kt("click_prompt_polish_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ãæç¤ºè¯æ¶¦è²ãï¼å建任å¡",buttonName:"å建任å¡"}),U.value=[],E.value=[],await za("videoScript",{type:_.LINKPIN_VIDEO_USAGE_TYPE}),Ft.emit("usage-updated",{type:_.LINKPIN_VIDEO_USAGE_TYPE,key:"videoScript"})};return Rt(()=>{Ft.on(Da,S)}),fa(()=>{Ft.off(Da,S)}),($,Y)=>{const j=ei,V=Wt,w=Ba;return l(),f("div",null,[y(w,{title:e(o)("qinghu-ai.video-script.712132-0"),class:"video-script-drawer",closable:!1,maskClosable:!1,width:1153,footer:null,open:e(m),"onUpdate:open":Y[3]||(Y[3]=I=>Fe(m)?m.value=I:null)},{extra:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:Y[0]||(Y[0]=I=>q(!1))})]),default:P(()=>[t("div",NT,[y(Wu,{ref_key:"videoScriptFormRef",ref:p,styleStr:"width:516px",showUploadList:!1,isBatch:!0,showCount:!0,isSyncImage:!1,drawerVisible:e(m),onUpdateScript:L,onOnSubmit:W},null,8,["drawerVisible"]),t("div",RT,[t("div",FT,[e(U).length?(l(),f(we,{key:0},[t("div",GT,[De(r(e(o)("qinghu-ai.video-script-drawer.995810-12"))+" ",1),t("span",VT,r(e(U).length),1),De(" "+r(e(o)("qinghu-ai.video-script-drawer.995810-13")),1)]),t("div",zT,[t("div",BT,[t("div",KT,[(l(!0),f(we,null,Je(e(U),(I,k)=>(l(),f("div",{class:Qe(["bg-#F2F3F5 py-5px px-16px rounded-[200px] border-1px border-solid border-#F2F3F5 mr-12px cursor-pointer",{active:I.id==e(G)}]),key:k,onClick:B=>N(I,k)},r(I.title),11,WT))),128))])]),y(j,{style:{margin:"14px 0"}})]),y(ju,{ref_key:"drawerChatRef",ref:z,messageList:e(E),"onUpdate:messageList":Y[1]||(Y[1]=I=>Fe(E)?E.value=I:null),group:e(U),"onUpdate:group":Y[2]||(Y[2]=I=>Fe(U)?U.value=I:null),spinLoading:e(R),currentGroupId:e(G),scriptForm:e(d),onUpdateMessage:ae,onUpdateScript:K,onSend:$.handleSend,onCollect:$.handleCollect,onGenerateVideo:O},null,8,["messageList","group","spinLoading","currentGroupId","scriptForm","onSend","onCollect"])],64)):e(R)?(l(),f("div",jT,[Y[6]||(Y[6]=t("img",{src:xu,alt:"thumb",class:"w-132px"},null,-1)),t("div",HT,[y(V,{size:"small"}),t("span",JT,r(e(o)("components-qinghu-ai.video-script-drawer.738063-240")),1)])])):(l(),f("div",YT,[t("div",QT,[Y[7]||(Y[7]=t("img",{src:Pf,alt:"",class:"w-214px h-124px"},null,-1)),t("div",XT,r(e(o)("qinghu-ai.video-script-drawer.995810-18")),1)])]))])])])]),_:1},8,["title","open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:Y[5]||(Y[5]=Be(I=>q(!0),["stop"]))},[Y[11]||(Y[11]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",nA,r(e(o)("qinghu-ai.video-script.712132-0")),1
134)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#ffffff] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:Y[4]||(Y[4]=Be(I=>q(!0),["stop"]))},[t("div",ZT,[t("div",eA,[Y[8]||(Y[8]=t("img",{src:Hn,class:"w-14px h-14px",alt:""},null,-1)),t("span",tA,r(e(o)("qinghu-ai.video-script.712132-0")),1),Y[9]||(Y[9]=t("span",{class:"bg-[#FFEEEC] flex items-center px-2px py-2px ml-6px"},[t("img",{src:Bl,alt:""}),t("span",{class:"text-8px color-[#FF381E]"},"NEW")],-1))]),t("div",aA,r(e(o)("qinghu-ai.video-script.712132-1")),1),Y[10]||(Y[10]=t("img",{src:nu,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),sA={key:0,class:"text-center"},lA={class:"border-[#DBDBDB] border-solid border rounded-8px w-full h-300px mb-20px flex-center m-auto"},iA={class:"w-full flex-center"},rA={key:0},cA={key:1,class:"mt-20px h-[calc(100%-22px)]"},uA={class:"px-14px py-24px h-full relative group"},dA={class:"flex items-center h-12px"},pA={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},mA={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},gA={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},fA=Dt({__name:"video-copy",props:{isChatPinned:{type:Boolean,default:!1}},emits:["updateScript"],setup(u,{emit:g}){const{t:i,locale:c}=mt(),o=g,x=bt(),_=Kt(),m=wa(),p=oa();h(!1);const d=h(!1),R=h([]),U=h({videoUrl:""}),G=h(null),a=h([]),E=h(!1),z=h(1),q=h(null),S=h(""),O=h({}),N={page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº"},ae={page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"è§é¢çææä½åº"},L=I=>{I&&kt("click_copy_hot_video",{...N,eventDesc:"ç¹å»ãçæ¬¾å¤å»ã",buttonName:"çæ¬¾å¤å»"}),_.push({path:"/linkpix/video-analyse"})},K=(I={})=>{(I==null?void 0:I.actionKey)===Zn.VIDEO_COPY&&L(!0)},de=I=>{U.value.videoUrl=I},W=async()=>{try{if(!U.value.videoUrl)return p.error(i("qinghu-ai.video-copy.876265-2"));if(O.value&&Object.keys(O.value).length&&!O.value.enough){m.confirm({title:i("qinghu-ai.video-copy.876265-3"),icon:St(ra),content:i("components-qinghu-ai.video-copy.738063-232"),cancelText:i("qinghu-ai.video-copy.876265-4"),okText:i("qinghu-ai.video-copy.876265-5"),keyboard:!1,maskClosable:!1,onOk(){_.push("/product?product=vip")}});return}a.value.push({type:"user",content:i("components-qinghu-ai.video-copy.738063-233")}),a.value.push({type:"answer",content:"",loading:!0}),z.value=2,kt("click_video_hot_copy_create",{...N,eventDesc:"ãçæ¬¾å¤å»ãï¼å建任å¡",buttonName:"å建任å¡"}),await $(),await za("videoCopy",{type:x.LINKPIN_VIDEO_USAGE_TYPE}),Ft.emit("usage-updated",{type:x.LINKPIN_VIDEO_USAGE_TYPE,key:"videoCopy"})}catch{}},$=async()=>{q.value=new AbortController,S.value="",E.value=!0,await Ga(dg+`?fileUrl=${U.value.videoUrl}`,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":c.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({}),signal:q.value.signal,openWhenHidden:!0,onmessage(I){try{const k=JSON.parse(I.data),{role:B,type:be,data:ne}=k||{};if(be==="chat_number_over")return q.value.abort(),q.value=null,a.value[a.value.length-1].loading=!1,E.value=!1,m.confirm({title:i("qinghu-ai.video-copy.876265-3"),icon:St(ra),content:ne,cancelText:i("qinghu-ai.video-copy.876265-4"),okText:i("qinghu-ai.video-copy.876265-5"),keyboard:!1,maskClosable:!1,onOk(){_.push("/product?product=vip")}});B==="assistant"&&be==="prompt"&&typeof ne=="string"&&(S.value+=ne,a.value[a.value.length-1].content=S.value)}catch{}},async onopen(I){if(I.status&&["401","500","600"].includes(String(I.status)))if(I.status==401){p.error(i("qinghu-ai.video-copy.876265-8"));let k=setTimeout(()=>{clearTimeout(k),window.location.reload()},600)}else(I.status==500||I.status==600)&&p.error(i("qinghu-ai.video-copy.876265-9"));return Promise.resolve()},onerror(I){p.error(i("qinghu-ai.video-copy.876265-11")),q.value.abort(),q.value=null},async onclose(){U.value.videoUrl="",R.value=[],a.value[a.value.length-1].content=S.value,a.value[a.value.length-1].loading=!1,E.value=!1}})},Y=({script:I,status:k})=>{a.value[a.value.length-1].content=I,a.value[a.value.length-1].loading=k!="finish"},j=I=>{a.value.push({type:"user",content:I}),a.value.push({type:"answer",content:"",loading:!0})},V=I=>{kt("click_video_hot_copy_video_create",{...ae,eventDesc:"ãçæ¬¾å¤å»ãï¼çæè§é¢",buttonName:"çæè§é¢",promptLength:(I==null?void 0:I.length)||0}),o("on-generate-video",w(I)),d.value=!1},w=I=>JSON.parse(JSON.stringify(I)).replace(/\n/g,"<br>");return Rt(()=>{Ft.on(Da,K)}),fa(()=>{Ft.off(Da,K)}),(I,k)=>{const B=Lt,be=So,ne=Ba;return l(),f("div",null,[y(ne,{title:e(i)("qinghu-ai.video-copy.542792-0"),class:"video-copy-modal",width:576,destroyOnClose:!1,maskClosable:!1,closable:!1,open:e(d),"onUpdate:open":k[1]||(k[1]=le=>Fe(d)?d.value=le:null)},{extra:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:k[0]||(k[0]=le=>L(!1))})]),default:P(()=>[e(z)==1?(l(),f("div",sA,[t("div",lA,[y(Ef,{onSuccess:de})]),t("div",iA,[y(be,{title:e(i)("components-qinghu-ai.one-click-film.658492-43",[e(O).score]),"ok-text":e(i)("login-form.login-container-global.submit"),"cancel-text":e(i)("agent.index.174028-3"),onConfirm:W},{default:P(()=>[y(B,{class:"w-full! h-56px! text-20px!",type:"primary"},{default:P(()=>[De(r(e(i)("qinghu-ai.video-copy.542792-2"))+" ",1),e(O)&&Object.keys(e(O)).length?(l(),f("span",rA,r(e(i)("components-qinghu-ai.video-copy.658492-65",[e(O).score])),1)):he("",!0)]),_:1})]),_:1},8,["title","ok-text","cancel-text"])])])):he("",!0),e(z)==2?(l(),f("div",cA,[y(ju,{ref_key:"drawerChatRef",ref:G,messageList:e(a),spinLoading:e(E),className:"h-[calc(100%-168px)]!",tipsText:e(i)("components-qinghu-ai.video-copy.658492-66"),onGenerateVideo:V,onUpdateScript:Y,onUpdateMessage:j},null,8,["messageList","spinLoading","tipsText"])])):he("",!0)]),_:1},8,["title","open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:k[3]||(k[3]=Be(le=>L(!0),["stop"]))},[k[7]||(k[7]=t("img",{src:Rr,class:"w-14px h-14px",alt:""},null,-1)),t("span",gA,r(e(i)("qinghu-ai.video-copy.542792-0")),1
134)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] bg-[#ffffff] cursor-pointer shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:k[2]||(k[2]=le=>L(!0))},[t("div",uA,[t("div",dA,[k[4]||(k[4]=t("img",{src:Rr,class:"w-14px h-14px",alt:""},null,-1)),t("span",pA,r(e(i)("qinghu-ai.video-copy.542792-0")),1),k[5]||(k[5]=t("span",{class:"video-copy-tag"},[t("img",{src:v0,alt:""}),De(" å¤äººæ¨è ")],-1))]),t("div",mA,r(e(i)("qinghu-ai.video-copy.542792-5")),1),k[6]||(k[6]=t("img",{src:h0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),vA=It(fA,[["__scopeId","data-v-f409b7d9"]]),hA=Dt({__name:"video-script-modal",props:{showVideoType:{type:Boolean,default:!0},maxCount:{type:Number,default:5},showUploadList:{type:Boolean,default:!0},productImage:{type:Array,default:()=>[]}},emits:["updateScript","script_loading"],setup(u,{expose:g,emit:i}){const c=i,{t:o}=mt();Kt(),wa(),oa(),bt();const x=h(!1),_=h(null);Ne(()=>x.value,U=>{U&&tt(()=>{_.value.init()})});const m=U=>{tt(()=>{x.value=U})},p=U=>{m(!1),c("updateScript",U)},d=U=>{c("script_loading",U)},R=()=>{x.value=!0};return Rt(()=>{}),g({init:R}),(U,G)=>{const a=Zt;return l(),f("div",null,[y(a,{title:e(o)("qinghu-ai.video-script.712132-0"),class:"video-script-modal",width:764,footer:null,open:e(x),"onUpdate:open":G[0]||(G[0]=E=>Fe(x)?x.value=E:null),onCancel:G[1]||(G[1]=E=>m(!1))},{default:P(()=>[y(Wu,{ref_key:"videoScriptFormRef",ref:_,promptTemplateId:13,isSyncImage:!1,productImage:u.productImage,onScript_loading:d,maxCount:u.maxCount,showUploadList:u.showUploadList,showVideoType:u.showVideoType,onUpdateScript:p},null,8,["productImage","maxCount","showUploadList","showVideoType"])]),_:1},8,["title","open"])])}}}),_A={class:"relative h-full"},yA={class:"storyboard-scroll p-20px"},xA={class:"bg-[rgba(161,161,161,0.1)] px-12px py-12px rounded-[6px]"},bA={class:"text-14px color-[#000000]"},IA={class:"w-full"},CA={class:""},kA={class:"flex-1"},wA={class:"h-32px flex items-center text-16px color-[#333333]"},PA={class:"storyboard_upload mt-10px"},MA={key:1},SA={key:2},$A={key:0},TA={class:"text-12px"},AA={key:1,class:"w-108px h-108px flex justify-center items-center"},UA={class:"text-12px mt-6px"},LA={class:"mt-36px"},EA={class:"h-32px flex items-center text-16px color-[#333333]"},qA={class:"mt-10px"},DA={class:"flex-1 mt-20px"},OA={class:"flex items-center justify-between"},NA={class:"flex items-center"},RA={class:"h-32px flex items-center text-16px color-[#333333] mr-6px"},FA={class:"h-603px mt-10px border-1px border-solid border-[#E5E6EB] rounded-[4px]"},GA={class:"py-14px pl-14px h-full script-textarea relative"},VA={class:"bg-[#ffffff] h-72px flex items-center justify-center w-full absolute bottom-0px shadow-[0px_0px_20px_0px_rgba(0,0,0,0.08)]"},zA={key:0},BA={class:"p-20px"},KA={class:"text-center mt-10px"},WA={class:"ml-10px text-16px"},jA={class:"my-32px"},HA={class:"storyboard-content"},JA={class:"relative flex-shrink-0 w-full h-[500px] rounded-12px overflow-hidden bg-gray-100 group"},YA=["src"],QA=["onClick"],XA={key:1,class:"flex border-1px border-solid border-[#D6D6D6] rounded-12px"},ZA={class:"w-full h-[176px] rounded-12px text-center flex flex-col items-center justify-center"},eU={class:"flex items-center justify-center text-16px mt-10px"},tU={class:"ml-10px"},aU={class:"bg-[#ffffff] h-72px flex items-center justify-center w-full absolute bottom-0px shadow-[0px_0px_20px_0px_rgba(0,0,0,0.08)]"},nU={class:"px-14px py-24px h-full relative group"},oU={class:"flex items-center h-12px"},sU={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},lU={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10"},iU={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},rU=Dt({__name:"video-storyboard",props:{isChatPinned:{type:Boolean,default:!1}},emits:["updateScript","onGenerateVideo"],setup(u,{emit:g}){const i=g,{t:c}=mt(),o=Kt(),x=wa(),_=oa(),m=bt(),p=la(),{userInfo:d}=va(p),{vipInfo:R}=d.value,U=h(!1),G=h(null),a=h(""),E=h(!1),z=h(!1),q=h([]),S=h("landscape"),O=h(!1);h(null);const N=h(!1),ae=h(!1),L=h([]),K=h([]),de=h(!1),W=h(""),$=h([]),Y=h(5),j=h(null),V=h({}),w=h(null),I=h({}),k=h(1),B=Ce=>{Ce&&kt("click_video_storyboard",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ç¹å»ãè§é¢åéçæå¨ã",buttonName:"è§é¢åéçæå¨"}),tt(()=>{if(!Ce&&(N.value||E.value)){x.confirm({title:c("qinghu-ai.video-storyboard.212512-1"),icon:y(ra),onOk(){U.value=!1},onCancel(){},class:"test"});return}U.value=Ce,U.value&&ne()})},be=(Ce={})=>
134{(Ce==null?void 0:Ce.actionKey)===Zn.VIDEO_STORYBOARD&&B(!0)},ne=async()=>{const Ce=await bn({type:"SEQUENCE_VIDEO"});Ce.code==0?V.value=Ce.data:V.value={}},le=Ce=>{var $e,at,nt;a.value=Ce.script,q.value=($e=Ce==null?void 0:Ce.taskForm)!=null&&$e.imageList&&((at=Ce==null?void 0:Ce.taskForm)!=null&&at.imageList.length)?(nt=Ce==null?void 0:Ce.taskForm)==null?void 0:nt.imageList:"",I.value=(Ce==null?void 0:Ce.taskForm)||{}},ce=()=>{m.batchUploadImgUrls=q.value,G.value.init()},J=async(Ce,$e=0)=>{Ta({options:{toolbar:!0,initialViewIndex:$e},images:[Ce]})},oe=async()=>{var nt,Se;if(!q.value||!q.value.length)return _.warning(c("qinghu-ai.video-storyboard.212512-2"));if(E.value)return _.warning(c("qinghu-ai.video-storyboard.536573-0"));if(!a.value)return _.warning(c("请è¾å
¥æçæè§é¢èæ¬"));kt("click_video_storyboard_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ãè§é¢åéçæå¨ãï¼å建åéå¾",buttonName:"å建åéå¾",imageCount:((nt=q.value)==null?void 0:nt.length)||0,promptLength:((Se=a.value)==null?void 0:Se.length)||0}),k.value=2;const Ce=(q.value||[]).map(se=>{var Xe,pt;const Te=(pt=(Xe=m.imageMapping)==null?void 0:Xe[se])==null?void 0:pt.tag;return Te?{url:se,text:Te}:null}).filter(Boolean),$e={prompt:a.value,imagesWithStyle:Ce&&Ce.length?Ce:void 0,images:q.value,viewDirection:S.value,timestamp:Date.now()};L.value=[],N.value=!0,Q(),await za("videoStoryboard",{type:m.LINKPIN_VIDEO_USAGE_TYPE}),Ft.emit("usage-updated",{type:m.LINKPIN_VIDEO_USAGE_TYPE,key:"videoStoryboard"});const at=await pg($e);at.code==0&&at.data&&at.data.taskId?w.value=setInterval(()=>{te(at.data.taskId)},5e3):(N.value=!1,at.code==10001?x.confirm({title:c("qinghu-ai.video-script.120875-9"),icon:St(ra),content:at.msg,cancelText:c("qinghu-ai.video-script.120875-10"),okText:c("qinghu-ai.video-script.120875-11"),keyboard:!1,maskClosable:!1,onOk(){R.vipInfo.vipId==1?o.push("/product?product=vip"):o.push("/upgrade")}}):_.error(at.msg))},te=async Ce=>{const $e=await Ec({taskId:Ce});if(($e==null?void 0:$e.code)===0&&($e!=null&&$e.data)){const at=$e.data,nt=at.status;nt==="completed"||nt==="complete"||nt==="SUCCESS"?(clearInterval(w.value),N.value=!1,L.value.push({url:at.images&&at.images.length?at.images[0].url:""}),Q()):(nt==="failed"||nt==="FAILED"||nt==="no_resource"||nt==="TIMEOUT")&&(clearInterval(w.value),N.value=!1,_.error(c("components-qinghu-ai.video-storyboard.795388-9")))}else clearInterval(w.value),N.value=!1,_.error(c("components-qinghu-ai.video-storyboard.795388-9"))},Q=()=>{tt(()=>{const Ce=de.value;if(Ce)try{Ce.scrollTo({top:Ce.scrollHeight,behavior:"smooth"})}catch{Ce.scrollTop=Ce.scrollHeight}})},ie=async()=>{const Ce=mg(),$e=L.value.map(at=>at.url).filter(Boolean);if($e&&$e.length)if($e.length===1)gg($e[0],"image_1.png");else{ae.value=!0;try{await fg($e,`${Ce}.zip`)}catch{}finally{ae.value=!1}}},_e=()=>{var $e,at;if(N.value)return _.warning(c("qinghu-ai.video-storyboard.536573-1"));kt("click_video_storyboard_video_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"è§é¢çææä½åº",eventDesc:"ãè§é¢åéçæå¨ãï¼çæè§é¢",buttonName:"çæè§é¢",imageCount:L.value.length,promptLength:(($e=a.value)==null?void 0:$e.length)||0});const Ce={prompt:a.value,productImage:q.value,storyboardImages:L.value.map(nt=>nt.url).filter(Boolean)};m.batchUploadImgUrls=[],S.value&&(m.videoGenerateParams.orientation=S.value),(at=I==null?void 0:I.value)!=null&&at.language&&(m.videoGenerateParams.language=I.value.language),m.videoGenerateParams.count=1,i("onGenerateVideo",Ce),U.value=!1},Re=Ce=>{};Ne(()=>U.value,Ce=>{var $e,at;if(Ce){const nt=localStorage.getItem("videoStoryboardParams")?JSON.parse(localStorage.getItem("videoStoryboardParams")):null;K.value=Object.keys(m.ali1688SameStyleImgList).length?(($e=m==null?void 0:m.ali1688SameStyleImgList)==null?void 0:$e.list)||[]:[],a.value=(nt==null?void 0:nt.scriptValue)||"",S.value=(nt==null?void 0:nt.direction)||"landscape";const Se=gt=>(Array.isArray(gt)?gt:gt?[gt]:[]).map(T=>typeof T=="string"?T:T==null?void 0:T.url).filter(T=>typeof T=="string"&&!!T),se=Se(m.batchUploadImgUrls),Te=new Set(Se(L.value)),Xe=Se((at=m.videoGenerateParams)==null?void 0:at.prompt1688DetailImageUrl),pt=se.length?se.filter(gt=>!Te.has(gt)):Xe.length?Xe:Se(nt==null?void 0:nt.productImage);q.value=pt,tt(()=>{j.value&&j.value.updateImg()}),q.value&&X0(q.value)&&q.value.forEach(gt=>{m.imageMapping[gt]||(m.imageMapping[gt]={tag:""})})}else{let nt={scriptValue:a.value,productImage:q.value,direction:S.value};localStorage.setItem("videoStoryboardParams",JSON.stringify(nt))}},{immediate:!0,deep:!0}),Ne(()=>q.value,Ce=>
134{Ce&&(Ce!=null&&Ce.length)&&!K.value.length&&m.imageRecognitionChecked},{immediate:!0,deep:!0});const ye=Ce=>{O.value=!1},me=()=>{x.confirm({title:c("components-qinghu-ai.video-storyboard.304388-8"),icon:y(ra),content:y("div",{style:"color:red;"},c("components-qinghu-ai.video-storyboard.738063-242")),onOk(){k.value=1,L.value=[]},onCancel(){}})},re=(Ce,$e)=>{const at=$e.map(Te=>{var Xe;return((Xe=Te==null?void 0:Te.response)==null?void 0:Xe.payload)||null}).filter(Te=>Te!==null);let nt=[...q.value,...at];nt=[...new Set(nt)];const Se=new Set((L.value||[]).map(Te=>typeof Te=="string"?Te:Te==null?void 0:Te.url).filter(Boolean)),se=Se.size?nt.filter(Te=>!Se.has(Te)):nt;q.value=se,q.value.forEach(Te=>{m.imageMapping[Te]||(m.imageMapping[Te]={tag:""})})},fe=(Ce,$e)=>{var at;if(((at=m==null?void 0:m.imageMapping[$e])==null?void 0:at.tag)==Ce.label){m.imageMapping[$e].tag="";return}m.imageMapping[$e]||(m.imageMapping[$e]={tag:""}),m.imageMapping[$e].tag=Ce.label},Oe=Ce=>{m.imageMapping[Ce].tag=W.value},Ve=Ce=>{$.value.push(typeof Ce=="string"?{url:Ce}:Ce)},H=Ce=>{$.value.splice(Ce,1)},st=(Ce,$e)=>{j.value.remove(Ce),q.value.splice($e,1)};Rt(()=>{Ft.on(Da,be)}),fa(()=>{Ft.off(Da,be)});const ge=h(c("qinghu-ai.video-storyboard.818905-0"));return(Ce,$e)=>{const at=$a,nt=si,Se=Wt,se=Qa,Te=Ya,Xe=ca,pt=Oa,gt=Lt,Ge=So,T=Ba;return l(),f("div",null,[y(T,{rootClassName:"video-storyboard-modal",title:e(c)("qinghu-ai.video-storyboard.212512-3"),destroyOnClose:!1,maskClosable:!1,closable:!1,width:643,open:e(U),"onUpdate:open":$e[7]||($e[7]=X=>Fe(U)?U.value=X:null)},{extra:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:$e[0]||($e[0]=X=>B(!1))})]),default:P(()=>{var X,Ee;return[t("div",_A,[e(k)==1?(l(),f(we,{key:0},[t("div",yA,[t("div",xA,[t("div",bA,r(e(c)("qinghu-ai.video-storyboard.212512-4")),1)]),t("div",{class:"mt-12px",ref_key:"storyboardRef",ref:de},[t("div",IA,[t("div",CA,[t("div",kA,[t("div",wA,[$e[11]||($e[11]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),De(" "+r(e(c)("qinghu-ai.video-storyboard.212512-12")),1)]),t("div",PA,[e(q).length?(l(!0),f(we,{key:0},Je(e(q),(Ye,Me)=>(l(),ve(nt,{key:Me,element:Ye,index:Me,"custom-purpose":e(W),ali1688SameStyleImgList:e(m).ali1688SameStyleImgList,isVisibleSameStyle:e(O),"image-mapping":e(m).imageMapping,"onUpdate:isVisibleSameStyle":$e[1]||($e[1]=D=>O.value=D),onSelect:ye,"onUpdate:customPurpose":$e[2]||($e[2]=D=>W.value=D),onMaterialClick:fe,onAddCustom:Oe,styleStr:"margin-top:0px;width: 108px;height: 108px;display: block",purposeStyle:"height:27px;background: #F7F7F7;margin-right:0px;border-radius: 0px 0px 6px 6px;",showClose:!1,showOperationBtn:!1},{"img-item":P(({url:D,index:Ae})=>[y(at,{url:D,onOnPreview:We=>J(D,Ae),onOnDelete:We=>st(D,Ae),style:{width:"100%",height:"100%"}},null,8,["url","onOnPreview","onOnDelete"])]),_:2},1032,["element","index","custom-purpose","ali1688SameStyleImgList","isVisibleSameStyle","image-mapping"]))),128)):he("",!0),(X=e($))!=null&&X.length?(l(),f("div",MA,[y(Gu,{styleStr:"margin-top:0px;width:108px;height:108px",showClose:!1,images:e($),onDelete:H},null,8,["images"])])):he("",!0),e(q).length+((Ee=e($))==null?void 0:Ee.length)<e(Y)?(l(),f("div",SA,[y(ga,{ref_key:"uploadRef",ref:j,name:"avatar",value:e(q),"onUpdate:value":$e[3]||($e[3]=Ye=>Fe(q)?q.value=Ye:null),temp:!1,multiple:!0,showUploadList:!1,isUpdate:!1,maxCount:5,onLoading:$e[4]||($e[4]=Ye=>{z.value=Ye}),uploadBizType:"AI_OPTIMIZED_IMAGE",size:5*1024*1024,validateWH:!1,onSuccess:re,onCheckError:Ve},{default:P(()=>[e(z)?(l(),f("div",$A,[y(Se),t("div",TA,r(e(c)("qinghu-ai.video-storyboard.212512-14")),1)])):(l(),f("div",AA,[t("div",null,[$e[12]||($e[12]=t("img",{src:xa,alt:"",class:"w-18px h-18px"},null,-1)),t("div",UA,r(e(c)("public-img-upload.index.101106-0")),1)])]))]),_:1},8,["value"])])):he("",!0)]),t("div",LA,[t("div",EA,[$e[13]||($e[13]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),De(" "+r(e(c)("qinghu-ai.video-storyboard.212512-16")),1)]),t("div",qA,[y(Te,{ref:"select",style:{width:"100%"},value:e(S),"onUpdate:value":$e[5]||($e[5]=Ye=>Fe(S)?S.value=Ye:null),onChange:Re},{default:P(()=>[y(se,{value:"portrait"},{default:P(()=>[De(r(e(c)("qinghu-ai.video-params.587254-15")),1)]),_:1}),y(se,{value:"landscape"},{default:P(()=>[De(r(e(c)("qinghu-ai.video-params.587254-16")),1)]),_:1})]),_:1},8,["value"])])])]),t("div",DA,[t("div",OA,[t("div",NA,[t("div",RA,[$e[14]||($e[14]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),De(" "+r(e(c)("qinghu-ai.video-storyboard.212512-5")),1)]),y(Xe,null,{title:P(()=>[t("div",null,[t("div",null,r(e(c)("qinghu-ai.video-storyboard.212512-6")),1),t("div",null,r(e(c)("qinghu-ai.video-storyboard.212512-7")),1),t("div",null,r(e(c)("qinghu-ai.video-storyboard.212512-8")),1),t("div",null,r(e(c)("qinghu-ai.video-storyboard.212512-9")),1)])]),default:P(()=>[y(e(pa))]),_:1})])]),t("div",FA,[t("div",GA,[y(Se,{wrapperClassName:"script_loading",tip:e(c)("qinghu-ai.video-storyboard.212512-11"),spinning:e(E)},{default:P(()=>[y(pt,{placeholder:e(ge),value:e(a),"onUpdate:value":$e[6]||($e[6]=Ye=>Fe(a)?a.value=Ye:null),bordered:!1,"auto-size":"",style:{height:"100%"}},null,8,["placeholder","value"])]),_:1},8,["tip","spinning"])])])])])])],512)]),t("div",VA,[y(gt,{class:"w-260px! h-42px! mr-10px",onClick:ce},{default:P(()=>[De(r(e(c)("qinghu-ai.video-storyboard.212512-10")),1)]),_:1}),y(Ge,{title:e(c)("components-qinghu-ai.one-click-film.658492-43",[e(V).score]),"ok-text":e(c)("login-form.login-container-global.submit"),"cancel-text":e(c)("agent.index.174028-3"),onConfirm:oe},{default:P(()=>[y(gt,{class:"h-42px! w-260px!",type:"primary"},{default:P(()=>[De(r(e(c)("qinghu-ai.video-storyboard.212512-18"))+" ",1),e(V)&&Object.keys(e(V)).length?(l(),f("span",zA,r(e(c)("components-qinghu-ai.video-copy.658492-65",[e(V).score])),1)):he("",!0)]),_:1})]),_:1},8,["title","ok-text","cancel-text"])])],64)):he("",!0),e(k)==2?(l(),f(we,{key:1},[t("div",BA,[t("div",KA,[t("span",{class:"flex items-center cursor-pointer max-w-max",onClick:me},[y(e(Mf)),t("span",WA,r(e(c)("components-qinghu-ai.video-storyboard.738063-244")),1)])]),t("div",jA,[t("div",HA,[e(L).length?(l(!0),f(we,{key:0},Je(e(L),(Ye,Me)=>
134(l(),f("div",{key:Me,class:"flex bg-white border-1px border-solid border-[#D6D6D6] rounded-12px"},[t("div",JA,[t("img",{src:Ye.url,alt:"thumb",class:"w-full h-full object-cover"},null,8,YA),t("div",{class:"absolute left-0 top-0 right-0 bottom-0 m-auto w-32px h-32px rounded-6px bg-[rgba(0,0,0,0.5)] flex justify-center items-center cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",onClick:D=>J(Ye.url)},[y(e(Us),{style:{"font-size":"20px",color:"#fff"}})],8,QA)])]))),128)):he("",!0),e(N)?(l(),f("div",XA,[t("div",ZA,[$e[15]||($e[15]=t("img",{src:xu,alt:"thumb",class:"w-132px"},null,-1)),t("div",eU,[y(Se,{size:"small"}),t("span",tU,r(e(c)("components-qinghu-ai.video-storyboard.738063-245")),1)])])])):he("",!0)])])]),t("div",aU,[y(gt,{class:"w-284px mr-12px",loading:e(ae),disabled:e(N),onClick:ie},{default:P(()=>[De(r(e(c)("qinghu-ai.video-storyboard.212512-21")),1)]),_:1},8,["loading","disabled"]),y(gt,{type:"primary",class:"w-284px",disabled:e(N),onClick:_e},{default:P(()=>[De(r(e(c)("qinghu-ai.video-storyboard.212512-22")),1)]),_:1},8,["disabled"])])],64)):he("",!0)])]}),_:1},8,["title","open"]),y(hA,{ref_key:"videoScriptFormRef",ref:G,showUploadList:!1,productImage:e(q),onScript_loading:$e[8]||($e[8]=X=>E.value=X),maxCount:5,showVideoType:!1,onUpdateScript:le},null,8,["productImage"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:$e[10]||($e[10]=Be(X=>B(!0),["stop"]))},[$e[18]||($e[18]=t("img",{src:Fr,class:"w-14px h-14px",alt:""},null,-1)),t("span",iU,r(e(c)("qinghu-ai.video-storyboard.212512-3")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] cursor-pointer bg-[#FEFDFF] shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:$e[9]||($e[9]=X=>B(!0))},[t("div",nU,[t("div",oU,[$e[16]||($e[16]=t("img",{src:Fr,class:"w-14px h-14px",alt:""},null,-1)),t("span",sU,r(e(c)("qinghu-ai.video-storyboard.212512-3")),1)]),t("div",lU,r(e(c)("qinghu-ai.video-storyboard.212512-23")),1),$e[17]||($e[17]=t("img",{src:_0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),cU={class:"real-name-auth-wrapper"},uU={key:0,class:"real-name-auth-popover-content"},dU={class:"real-name-auth-popover-text"},pU=Dt({__name:"real-name-auth-popover",props:{open:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=la(),c=()=>{i.openLinkPixFaceComplianceModal("identifyImageHead")};return(o,x)=>{const _=Lt;return l(),f("div",cU,[u.open?(l(),f("div",uU,[t("div",dU,r(e(g)("components-qinghu-ai.real-name-auth-popover.446330-53")),1),y(_,{type:"primary",class:"real-name-auth-popover-button",onClick:Be(c,["stop"])},{default:P(()=>[De(r(e(g)("components-qinghu-ai.portrait_check_fail_images.446330-52")),1)]),_:1})])):he("",!0),xn(o.$slots,"default",{},void 0,!0)])}}}),Hu=It(pU,[["__scopeId","data-v-a6672ac3"]]),mU={class:"relative h-full"},gU={class:"p-20px h-[calc(100vh-130px)] overflow-y-auto"},fU={class:"bg-[rgba(161,161,161,0.1)] px-12px py-12px rounded-[6px] text-14px color-[#000000]"},vU={class:"h-32px mt-12px flex items-center text-16px color-[#333333] font-500"},hU={class:"h-30px py-5px color-[#333333]"},_U={class:"flex gap-12px flex-wrap items-center w-full"},yU=["src"],xU=["onClick"],bU={key:0},IU={key:1,class:"w-108px h-108px flex-col flex-center"},CU={class:"mt-10px"},kU={class:"h-32px mt-5px flex items-center text-16px color-[#333333] font-500"},wU={class:"filter-container"},PU={class:"flex gap-x-20px mt-12px w-full"},MU={class:"w-50% flex flex-col gap-y-8px"},SU={class:"text-[rgba(0,0,0,0.6)]"},$U={class:"flex gap-x-4px items-center"},TU={class:"w-50% flex flex-col gap-y-8px"},AU={class:"text-[rgba(0,0,0,0.6)]"},UU={class:"flex gap-x-20px mt-12px w-full"},LU={class:"w-50% flex flex-col gap-y-8px"},EU={class:"text-[rgba(0,0,0,0.6)]"},qU={class:"w-50% flex flex-col gap-y-8px"},DU={class:"text-[rgba(0,0,0,0.6)]"},OU={class:"h-32px mt-12px flex items-center text-16px color-[#333333] font-500"},NU={class:"relative"},RU={class:"absolute right-10px bottom-10px text-[rgba(61,61,61,0.5)] text-12px"},FU={class:"bg-[#ffffff] h-72px flex items-center justify-center w-full absolute bottom-0px shadow-[0px_0px_20px_0px_rgba(0,0,0,0.08)]"},GU={class:"px-14px py-24px h-full relative group"},VU={class:"flex items-center h-12px"},zU={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},BU={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},KU={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},Sl=!1,WU=Dt({__name:"one-click-film",props:{isChatPinned:{type:Boolean,default:!1}},emits:["updateScript"],setup(u,{emit:g}){const{t:i}=mt(),c=oa(),o=Pa(),x=Kt(),_=bt(),m=la(),{userInfo:p}=va(m),d=h(!1),R=h(!1),U=h(),G=F(()=>{var I;return!!((I=p.value)!=null&&I.isRealName)}),a=F(()=>R.value&&!G.value),E=()=>G.value?!0:(m.openLinkPixFaceComplianceModal("identifyImageHead"),!1),z=h({prompt:"",duration:8,creative:"1",orientation:"landscape",language:"zh",model:"VIDEO_QUICK",projectId:"VIDEO_QUICK"}),q=F(()=>j.value.flatMap(I=>I.images).filter(I=>I!==null)),S=F(()=>({...z.value,images:q.value})),O=I=>{I.target.value||(I.target.value=8);let k=Number(I.target.value);k<8&&(k=8),k>60&&(k=60),z.value.duration=k,I.target.value=k},N=(I,k,B)=>{j.value[I].images=B.map(be=>{var ne;return((ne=be==null?void 0:be.response)==null?void 0:ne.payload)||null}).filter(be=>be!==null)},ae=(I,k)=>{j.value[I].loading=k},L=(I,k)=>{var le;const B=j.value[I].images,be=B[k];B.splice(k,1);const ne=j.value[I].ref;(le=ne==null?void 0:ne.value)==null||le.remove(be)},K=async()=>
134{if(E()){if(!q.value.length)return c.error(i("components-qinghu-ai.one-click-film.658492-40"));kt("click_ad_one_key_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ãåå广åä¸é®æçãï¼å建任å¡",buttonName:"å建任å¡",imageCount:q.value.length,duration:S.value.duration,orientation:S.value.orientation}),d.value=!0;try{localStorage.setItem("quickVideoTaskForm",JSON.stringify({creative:S.value.creative,duration:S.value.duration,language:S.value.language,orientation:S.value.orientation}));const{code:I,data:k,msg:B}=await Gc(S.value);if(I===0&&k.qingHuTaskId){o.path!=="/linkpix/generation"&&await x.push({path:"/linkpix/generation"}),V(!1),await _.fetchTaskCardList("init");return}c.error(B)}finally{d.value=!1}await za("videoOneClickFilm",{type:_.LINKPIN_VIDEO_USAGE_TYPE}),Ft.emit("usage-updated",{type:_.LINKPIN_VIDEO_USAGE_TYPE,key:"videoOneClickFilm"})}},de=()=>{z.value.prompt.length>2e3&&(z.value.prompt=z.value.prompt.slice(0,2e3))},W=async()=>{try{d.value=!0;const{code:I,data:k,msg:B}=await Vc({type:1,times:z.value.duration});if(I===0&&k){U.value=k;return}c.error(B)}finally{d.value=!1}},$=yn(W,300);Ne(()=>z.value.duration,$);const Y=[h(null),h(null),h(null)],j=h([{name:i("components-qinghu-ai.one-click-film.738063-163"),maxCount:1,images:[],ref:Y[0],loading:!1},{name:i("components-qinghu-ai.one-click-film.738063-164"),maxCount:1,images:[],ref:Y[1],loading:!1},{name:i("qinghu-ai.video-storyboard.212512-15"),maxCount:5,images:[],ref:Y[2],loading:!1}]),V=I=>{I&&kt("click_ad_one_key",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ç¹å»ãåå广åä¸é®æçã",buttonName:"åå广åä¸é®æç"}),tt(()=>{if(R.value=I,I){let k=localStorage.getItem("quickVideoTaskForm")?JSON.parse(localStorage.getItem("quickVideoTaskForm")):null;k&&(z.value={...z.value,...k}),W()}})},w=(I={})=>{(I==null?void 0:I.actionKey)===Zn.VIDEO_ONE_CLICK_FILM&&V(!0)};return Rt(()=>{Ft.on(Da,w)}),fa(()=>{Ft.off(Da,w)}),(I,k)=>{const B=ca,be=Wt,ne=Lt,le=ba,ce=Qa,J=Ya,oe=Oa,te=So,Q=Ba;return l(),f("div",null,[y(Q,{rootClassName:"one-click-film-drawer",title:e(i)("components-qinghu-ai.one-click-film.738063-165"),maskClosable:!1,closable:!1,width:645,open:e(R),"onUpdate:open":k[8]||(k[8]=ie=>Fe(R)?R.value=ie:null),onCancel:k[9]||(k[9]=ie=>V(!1))},{extra:P(()=>[y(e(ma),{class:"absolute right-30px top-20px cursor-pointer",onClick:k[0]||(k[0]=ie=>V(!1))})]),default:P(()=>[t("div",mU,[t("div",gU,[t("div",fU,r(e(i)("components-qinghu-ai.one-click-film.912708-11")),1),t("div",vU,[k[12]||(k[12]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),De(r(e(i)("components-qinghu-ai.one-click-film.237013-2"))+"  ",1),y(B,null,{title:P(()=>[t("div",null,[t("div",null,r(e(i)("components-qinghu-ai.one-click-film.738063-166")),1),t("div",null,r(e(i)("components-qinghu-ai.one-click-film.658492-41")),1),t("div",null,r(e(i)("components-qinghu-ai.model-face-replacement.738063-152")),1),t("div",null,r(e(i)("components-qinghu-ai.model-face-replacement.738063-153")),1),t("div",null,r(e(i)("components-qinghu-ai.one-click-film.738063-167")),1)])]),default:P(()=>[y(e(pa))]),_:1})]),t("div",hU,r(e(i)("qinghu-ai.one-click-film.536535-0"))+r(e(q).length)+"/7 ",1),t("div",_U,[(l(!0),f(we,null,Je(e(j),(ie,_e)=>(l(),f(we,{key:ie.name},[(l(!0),f(we,null,Je(ie.images,(Re,ye)=>(l(),f("div",{key:`${_e}-${ye}`,class:"w-108px h-108px flex items-center relative rounded-[6px] overflow-hidden group"},[t("img",{src:Re,alt:"",style:{"max-width":"100%","max-height":"100%",margin:"auto"}},null,8,yU),t("div",{class:"absolute bottom-0px left-0px h-32px bg-[rgba(0,0,0,0.8)] color-[#fff] w-full flex items-center justify-center cursor-pointer opacity-0 group-hover:opacity-100",onClick:me=>L(_e,ye)},r(e(i)("qinghu-ai.video-storyboard.212512-13")),9,xU)]))),128)),ie.images.length<ie.maxCount?(l(),ve(ga,{key:0,ref_for:!0,ref:ie.ref,name:`avatar_${_e}`,temp:!0,multiple:ie.maxCount>1,showUploadList:!1,maxCount:ie.maxCount,onLoading:Re=>ae(_e,Re),uploadBizType:"AI_OPTIMIZED_IMAGE",size:50*1024*1024,validateWH:!1,ignoreImageHead:!1,isUpdate:!1,onSuccess:(Re,ye)=>N(_e,Re,ye)},{default:P(()=>[ie.loading?(l(),f("div",bU,[y(be),t("div",null,r(e(i)("qinghu-ai.video-storyboard.212512-14")),1)])):(l(),f("div",IU,[k[13]||(k[13]=t("img",{src:xa,alt:"",class:"w-32px h-32px"},null,-1)),t("div",CU,r(ie.name),1)]))]),_:2},1032,["name","multiple","maxCount","onLoading","onSuccess"])):he("",!0)],64))),128))]),t("div",kU,r(e(i)("components-qinghu-ai.one-click-film.912708-12")),1),t("div",wU,[t("div",PU,[t("div",MU,[t("div",SU,r(e(i)("qinghu-ai.video-params.587254-0")),1),t("div",$U,[y(ne,{onClick:k[1]||(k[1]=ie=>e(z).duration--),disabled:e(z).duration<=8,class:"rounded bg-#F2F3F5! b-none!",type:"default"},{icon:P(()=>[y(e(Z0),{class:"text-[rgba(0,0,0,0.26)]"})]),_:1},8,["disabled"]),y(le,{type:"number",value:e(z).duration,"onUpdate:value":k[2]||(k[2]=ie=>e(z).duration=ie),min:8,max:60,class:"rounded-none flex-1 h-32px text-center",onBlur:O},null,8,["value"]),y(ne,{onClick:k[3]||(k[3]=ie=>e(z).duration++),disabled:e(z).duration>=60,class:"rounded bg-#F2F3F5! b-none!",type:"default"},{icon:P(()=>[y(e(Xl),{class:"text-[rgba(0,0,0,0.26)]"})]),_:1},8,["disabled"])])]),t("div",TU,[t("div",AU,r(e(i)("components-qinghu-ai.one-click-film.738063-168")),1),y(J,{value:e(z).orientation,"onUpdate:value":k[4]||(k[4]=ie=>e(z).orientation=ie)},{default:P(()=>[y(ce,{value:"landscape"},{default:P(()=>[De(r(e(i)("components-qinghu-ai.one-click-film.738063-169")),1)]),_:1}),y(ce,{value:"portrait"},{default:P(()=>
134[De(r(e(i)("components-qinghu-ai.one-click-film.738063-170")),1)]),_:1}),y(ce,{value:"square"},{default:P(()=>[De(r(e(i)("components-qinghu-ai.one-click-film.738063-171")),1)]),_:1})]),_:1},8,["value"])])]),t("div",UU,[t("div",LU,[t("div",EU,r(e(i)("qinghu-ai.long-image-params.227781-9")),1),y(J,{value:e(z).language,"onUpdate:value":k[5]||(k[5]=ie=>e(z).language=ie)},{default:P(()=>[y(ce,{value:"zh"},{default:P(()=>[De(r(e(i)("components.VideoTranslationParams.738063-22")),1)]),_:1}),y(ce,{value:"en"},{default:P(()=>[De(r(e(i)("components-qinghu-ai.one-click-film.738063-172")),1)]),_:1})]),_:1},8,["value"])]),t("div",qU,[t("div",DU,r(e(i)("components-qinghu-ai.one-click-film.738063-173")),1),y(J,{value:e(z).creative,"onUpdate:value":k[6]||(k[6]=ie=>e(z).creative=ie)},{default:P(()=>[y(ce,{value:"1"},{default:P(()=>[De(r(e(i)("components-qinghu-ai.one-click-film.738063-174")),1)]),_:1}),y(ce,{value:"2"},{default:P(()=>[De(r(e(i)("components-qinghu-ai.one-click-film.738063-175")),1)]),_:1})]),_:1},8,["value"])])])]),t("div",OU,r(e(i)("components-qinghu-ai.full-screen-image-modal.738063-95")),1),t("div",NU,[y(oe,{value:e(z).prompt,"onUpdate:value":k[7]||(k[7]=ie=>e(z).prompt=ie),"auto-size":{minRows:6,maxRows:8},placeholder:e(i)("components-qinghu-ai.model-face-replacement.738063-155"),onInput:de,maxlength:666},null,8,["value","placeholder"]),t("div",RU,r(e(z).prompt.length)+"/666 ",1)])]),t("div",FU,[e(G)?(l(),ve(te,{key:1,title:e(i)("components-qinghu-ai.one-click-film.658492-43",[e(U)]),"ok-text":e(i)("login-form.login-container-global.submit"),"cancel-text":e(i)("agent.index.174028-3"),onConfirm:K},{default:P(()=>[y(ne,{type:"primary",class:"w-500px h-42px!",loading:e(d),disabled:Sl},{default:P(()=>[De(r(Sl?e(i)("components-qinghu-ai.model-face-replacement.738063-142"):e(i)("components-qinghu-ai.one-click-film.658492-45",[e(U)])),1)]),_:1},8,["loading"])]),_:1},8,["title","ok-text","cancel-text"])):(l(),ve(Hu,{key:0,open:e(a)},{default:P(()=>[y(ne,{type:"primary",class:"w-500px h-42px!",loading:e(d),disabled:""},{default:P(()=>[De(r(Sl?e(i)("components-qinghu-ai.model-face-replacement.738063-142"):e(i)("components-qinghu-ai.one-click-film.658492-45",[e(U)])),1)]),_:1},8,["loading"])]),_:1},8,["open"]))])])]),_:1},8,["title","open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:k[11]||(k[11]=Be(ie=>V(!0),["stop"]))},[k[16]||(k[16]=t("img",{src:Gr,class:"w-14px h-14px",alt:""},null,-1)),t("span",KU,r(e(i)("components-qinghu-ai.one-click-film.738063-165")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] bg-[#ffffff] cursor-pointer shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:k[10]||(k[10]=ie=>V(!0))},[t("div",GU,[t("div",VU,[k[14]||(k[14]=t("img",{src:Gr,class:"w-14px h-14px",alt:""},null,-1)),t("span",zU,r(e(i)("components-qinghu-ai.one-click-film.738063-165")),1)]),t("div",BU,r(e(i)("components-qinghu-ai.one-click-film.237013-3")),1),k[15]||(k[15]=t("img",{src:y0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])]))])}}}),jU={class:"risk-disclosure"},HU={class:"important-notice"},JU={class:"section"},YU={class:"section-title"},QU={class:"section-number"},XU={class:"section-intro"},ZU={class:"subsection"},eL={class:"subsection-title"},tL={class:"risk-list"},aL={class:"subsection"},nL={class:"subsection-title"},oL={class:"risk-list"},sL={class:"subsection"},lL={class:"subsection-title"},iL={class:"risk-list"},rL={class:"section"},cL={class:"section-title"},uL={class:"section-number"},dL={class:"notice-list"},pL={class:"notice-item"},mL={class:"notice-label"},gL={class:"notice-item"},fL={class:"notice-label"},vL={class:"notice-item"},hL={class:"notice-label"},_L={class:"notice-item"},yL={class:"notice-label"},xL={class:"section"},bL={class:"section-title"},IL={class:"section-number"},CL={class:"disclaimer-box"},kL={class:"footer-notice"},wL={class:"agree-notice"},PL={class:"contact-info"},ML={class:"update-date"},SL={__name:"risk-disclosure",setup(u,{expose:g}){const{t:i}=mt(),c=h(!1);return g({open:()=>{c.value=!0}}),(x,_)=>{const m=Zt;return l(),ve(m,{open:c.value,"onUpdate:open":_[0]||(_[0]=p=>c.value=p),title:e(i)("components-qinghu-ai.risk-disclosure.738063-196"),width:"880px",centered:!0,onCancel:_[1]||(_[1]=p=>c.value=!1),footer:null,class:"risk-disclosure-modal",zIndex:3e3},{default:P(()=>[t("div",jU,[t("div",HU,[_[2]||(_[2]=t("div",{class:"notice-icon"},"â ï¸",-1)),t("p",null,[De(r(e(i)("components-qinghu-ai.risk-disclosure.738063-197")),1),t("strong",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-198")),1)])]),t("section",JU,[t("h3",YU,[t("span",QU,r(e(i)("form-builder.Range.897676-0")),1),De(" "+r(e(i)("components-qinghu-ai.risk-disclosure.331629-9")),1)]),t("p",XU,r(e(i)("components-qinghu-ai.risk-disclosure.738063-199")),1),t("div",ZU,[t("h4",eL,r(e(i)("components-qinghu-ai.risk-disclosure.861208-12")),1),t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-200")),1
134),t("ul",tL,[t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-201")),1),t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-202")),1),t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-203")),1)])]),t("div",aL,[t("h4",nL,r(e(i)("components-qinghu-ai.risk-disclosure.861208-13")),1),t("ul",oL,[t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.861208-14")),1),t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-204")),1),t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-205")),1)])]),t("div",sL,[t("h4",lL,r(e(i)("components-qinghu-ai.risk-disclosure.861208-15")),1),t("ul",iL,[t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-206")),1),t("li",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-207")),1)])])]),t("section",rL,[t("h3",cL,[t("span",uL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-208")),1),De(" "+r(e(i)("components-qinghu-ai.risk-disclosure.331629-10")),1)]),t("div",dL,[t("div",pL,[t("span",mL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-209")),1),t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-210")),1)]),t("div",gL,[t("span",fL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-211")),1),t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-212")),1)]),t("div",vL,[t("span",hL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-213")),1),t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.861208-16")),1)]),t("div",_L,[t("span",yL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-214")),1),t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-215")),1)])])]),t("section",xL,[t("h3",bL,[t("span",IL,r(e(i)("components-qinghu-ai.risk-disclosure.738063-216")),1),De(" "+r(e(i)("components-qinghu-ai.risk-disclosure.331629-11")),1)]),t("div",CL,[t("p",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-217")),1)])]),t("div",kL,[t("p",wL,r(e(i)("components-qinghu-ai.risk-disclosure.861208-17")),1),t("div",PL,[t("p",null,[t("strong",null,r(e(i)("components-qinghu-ai.risk-disclosure.738063-218")),1),De(r(e(i)("components-qinghu-ai.risk-disclosure.738063-219")),1)]),t("p",ML,r(e(i)("components-qinghu-ai.risk-disclosure.738063-220")),1)])])])]),_:1},8,["open","title"])}}},$L=It(SL,[["__scopeId","data-v-0a362a1a"]]),TL={class:"relative h-full container"},AL={class:"p-20px h-[calc(100vh-80px)] overflow-y-auto"},UL={class:"flex justify-between items-start"},LL={class:"flex flex-col gap-y-10px mt-25px"},EL={class:"text-#3D3D3D text-20px"},qL={class:"text-[rgba(61,61,61,0.8)] text-14px"},DL={class:"h-32px mt-12px flex items-center text-14px color-[#333333] font-500"},OL={class:"mr-3px"},NL={key:0,class:"video-card"},RL={class:"video-thumbnail"},FL=["src"],GL={class:"duration-badge"},VL={key:0},zL={key:1,class:"flex justify-center items-center"},BL={class:"text-[rgba(0,0,0,0.5)] font-350 text-13px"},KL={class:"mt-10px"},WL={class:"flex-center"},jL={class:"flex-center"},HL={class:"h-32px mt-12px flex items-center text-14px color-[#333333] font-500"},JL={class:"mr-3px"},YL={class:"flex gap-12px flex-wrap items-center w-full"},QL=["src"],XL={key:0},ZL={class:"text-[rgba(0,0,0,0.5)] font-350 text-13px"},eE={class:"flex-center mt-10px gap-x-40px"},tE={class:"recommend-tips"},aE={class:"mt-10px"},nE={class:"flex-center"},oE={class:"flex-center"},sE={key:0,class:"risk-check-box mt-20px"},lE={class:"ml-10px"},iE={class:"h-72px flex items-center justify-center w-full absolute bottom-0px shadow-[0px_0px_20px_0px_rgba(0,0,0,0.08)]"},rE={key:0},cE={key:0},uE={class:"px-14px py-24px h-full relative group"},dE={class:"flex items-center h-12px"},pE={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},mE={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},gE={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},fE=Dt({__name:"model-face-replacement",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g,locale:i}=mt(),c=oa(),o=Pa(),x=Kt(),_=bt(),m=la(),{userInfo:p}=va(m),d=h(!1),R=h(!1),U=h(!1),G=h(!1),a=h(!1),E=h(!1),z=h(null),q=h(null),S=h([]),O=h(void 0),N=vg(),ae=h(),L=h(!1),K=h(null),de=h({images:[],originalVideoUrl:"",duration:void 0,model:"VIDEO_REPLACE",projectId:"VIDEO_REPLACE"}),W=F(()=>de.value.images.length>0&&de.value.originalVideoUrl&&L.value),$=F(()=>{var Q;return!!((Q=p.value)!=null&&Q.isRealName)}),Y=F(()=>E.value&&!$.value),j=()=>$.value?!0:(m.openLinkPixFaceComplianceModal("identifyImageHead"),!1),V=Q=>{de.value.images=[Q]},w=()=>{de.value.originalVideoUrl="",S.value=[]},I=()=>{var Q;de.value.images=[],(Q=q==null?void 0:q.value)==null||Q.remove()};async function k({file:Q,onSuccess:ie,onError:_e}){a.value=!0;let Re="duration";try{const ye=await N.getVideoDuration(Q);if(O.value=ye.toFixed(0),de.value.duration=O.value,O.value<2||O.value>30){c.error(g("components-qinghu-ai.model-face-replacement.738063-140")),a.value=!1,S.value=[];return}Re="resolution";const{height:me,width:re}=await N.getVideoResolution(Q),fe=Math.min(re,me),Oe=Math.max(re,me);if(fe<200||Oe>2048){c.error(g("components-qinghu-ai.model-face-replacement.738063-139")),a.value=!1,S.value=[];return}const Ve=new FormData;Ve.append("file",Q),Re="upload";const H=await Va(Ve);if(H.success&&H.payload)de.value.originalVideoUrl=H.payload,await ce(),c.success(g("my-knowledge-base.index.454755-55")),ie(H);else throw new Error(H.message||g("qinghu-ai.video-copy.876265-1"))}catch(ye){try{localStorage.setItem("video-upload-error",JSON.stringify({stage:Re,name:ye instanceof Error?ye.n
134ame:"",message:ye instanceof Error?ye.message:String(ye),stack:ye instanceof Error?ye.stack:"",fileType:Q==null?void 0:Q.type,fileSize:Q==null?void 0:Q.size,browser:navigator.userAgent,time:new Date().toISOString()}))}catch{}c.error(g("qinghu-ai.video-copy.876265-1")),_e(ye)}finally{a.value=!1}}const B=()=>{var Q,ie;(ie=(Q=q.value)==null?void 0:Q.$el.querySelector("input"))==null||ie.click()},be=Q=>{de.value.images=[Q.icon]},ne=Q=>{if(!Q){d.value=!1;return}if(!j()){d.value=!1;return}W.value?d.value=!0:le()},le=async()=>{var Q;if(j()){if(!de.value.images.length)return c.error(g("components-qinghu-ai.model-face-replacement.738063-143"));if(!de.value.originalVideoUrl)return c.error(g("components-qinghu-ai.model-face-replacement.738063-144"));if(!L.value&&i.value!=="en")return c.error(g("components-qinghu-ai.model-face-replacement.738063-145"));kt("click_role_replace_create",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ãè§è²æ¿æ¢ãï¼å建任å¡",buttonName:"å建任å¡",imageCount:((Q=de.value.images)==null?void 0:Q.length)||0,hasVideo:!!de.value.originalVideoUrl}),R.value=!0;try{const{code:ie,data:_e,msg:Re}=await Gc(de.value);if(ie===0&&_e.qingHuTaskId){o.path!=="/linkpix/generation"&&await x.push({path:"/linkpix/generation"}),J(!1),await _.fetchTaskCardList("init");return}c.error(Re)}finally{R.value=!1}await za("ModelFaceReplacement",{type:_.LINKPIN_VIDEO_USAGE_TYPE}),Ft.emit("usage-updated",{type:_.LINKPIN_VIDEO_USAGE_TYPE,key:"ModelFaceReplacement"})}},ce=async()=>{try{R.value=!0;const{code:Q,data:ie,msg:_e}=await Vc({type:2,times:O.value});if(Q===0&&ie){ae.value=ie;return}c.error(_e)}finally{R.value=!1}},J=Q=>{Q&&kt("click_role_replace",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ç¹å»ãè§è²æ¿æ¢ã",buttonName:"è§è²æ¿æ¢"}),tt(()=>{E.value=Q})},oe=(Q={})=>{(Q==null?void 0:Q.actionKey)===Zn.MODEL_FACE_REPLACEMENT&&J(!0)},te=()=>{K.value.open()};return Rt(()=>{Ft.on(Da,oe)}),fa(()=>{Ft.off(Da,oe)}),(Q,ie)=>{const _e=ca,Re=Wt,ye=qa,me=Lt,re=Mo,fe=So,Oe=Ba;return l(),f("div",null,[y(Oe,{"root-class-name":"model-face-replacement",closable:!1,title:null,width:645,open:E.value,"onUpdate:open":ie[5]||(ie[5]=Ve=>E.value=Ve),onCancel:ie[6]||(ie[6]=Ve=>J(!1))},{default:P(()=>[t("div",TL,[t("div",AL,[t("div",UL,[t("div",LL,[t("div",EL,r(e(g)("components-qinghu-ai.model-face-replacement.738063-146")),1),t("div",qL,r(e(g)("components-qinghu-ai.model-face-replacement.912708-6")),1)]),ie[9]||(ie[9]=t("img",{src:x0,class:"w-206px h-128px",alt:""},null,-1))]),t("div",DL,[ie[10]||(ie[10]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),t("span",OL,r(e(g)("components-qinghu-ai.model-face-replacement.237013-1")),1),y(_e,null,{title:P(()=>[t("div",null,[t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-138")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-147")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-139")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-148")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-139")),1)])]),default:P(()=>[y(e(pa),{class:"text-#CCCCCC"})]),_:1})]),t("div",null,[de.value.originalVideoUrl?(l(),f("div",NL,[t("div",RL,[t("video",{src:de.value.originalVideoUrl,controls:!0},null,8,FL),t("div",GL,r(e(hg)(O.value)),1)]),t("div",{class:"delete-btn",onClick:Be(w,["stop"])},[y(e(ma))])])):(l(),ve(ye,{key:1,class:"video-upload","list-type":"picture-card",customRequest:k,fileList:S.value,"onUpdate:fileList":ie[0]||(ie[0]=Ve=>S.value=Ve),accept:"video/*",disabled:a.value},{default:P(()=>[a.value?(l(),f("div",VL,[y(Re),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-149")),1)])):(l(),f("div",zL,[t("div",BL,[ie[13]||(ie[13]=t("img",{src:Jn,alt:"",class:"w-54px h-54px"},null,-1)),t("div",KL,r(e(g)("components-qinghu-ai.model-face-replacement.912708-13")),1),t("div",WL,[t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-138")),1),ie[11]||(ie[11]=t("div",{class:"mx-4px"},"·",-1)),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-147")),1)]),t("div",jL,[t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-148")),1),ie[12]||(ie[12]=t("div",{class:"mx-4px"},"·",-1))]),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-139")),1)])]))]),_:1},8,["fileList","disabled"]))]),t("div",HL,[ie[14]||(ie[14]=t("span",{class:"color-[#F53F3F] mt-4px mr-5px"},"*",-1)),t("span",JL,r(e(g)("components-qinghu-ai.model-face-replacement.738063-163")),1),y(_e,null,{title:P(()=>[t("div",null,[t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-151")),1
134),t("div",null,r(e(g)("components-qinghu-ai.one-click-film.658492-41")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-153")),1),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-139")),1)])]),default:P(()=>[y(e(pa),{class:"text-#CCCCCC"})]),_:1})]),t("div",YL,[de.value.images.length?(l(!0),f(we,{key:0},Je(de.value.images,(Ve,H)=>(l(),f("div",{key:H,class:"w-100% h-240px flex-center relative rounded-[6px] overflow-hidden bg-#FFF b-dashed b-1px b-#D9D9D9 group"},[t("img",{src:Ve,alt:"",class:"w-240px h-228px object-cover rounded-4px"},null,8,QL),t("div",{class:"absolute bottom-0px h-32px bg-[rgba(0,0,0,0.8)] color-[#fff] w-240px flex items-center rounded-bl-4px rounded-br-4px justify-center cursor-pointer opacity-0 group-hover:opacity-100",onClick:I},r(e(g)("components-qinghu-ai.model-face-replacement.747658-15")),1)]))),128)):(l(),ve(ga,{key:1,ref_key:"uploadRef",ref:q,name:"avatar",value:de.value.images,"onUpdate:value":ie[2]||(ie[2]=Ve=>de.value.images=Ve),temp:!0,multiple:!1,showUploadList:!1,maxCount:1,onLoading:ie[3]||(ie[3]=Ve=>{G.value=Ve}),uploadBizType:"AI_OPTIMIZED_IMAGE",size:5*1024*1024,validateWH:!1,ignoreImageHead:!1,isUpdate:!1,onSuccess:V},{default:P(()=>[G.value?(l(),f("div",XL,[y(Re),t("div",null,r(e(g)("qinghu-ai.video-storyboard.212512-14")),1)])):(l(),f("div",{key:1,class:"flex justify-center items-center",onClick:ie[1]||(ie[1]=Be(()=>{},["stop"]))},[t("div",ZL,[ie[16]||(ie[16]=t("img",{src:Jn,alt:"",class:"w-54px h-54px"},null,-1)),t("div",eE,[y(me,{class:"border-#6051F8! text-#6051F8! w-190px",onClick:B},{default:P(()=>[De(r(e(g)("components-qinghu-ai.model-face-replacement.912708-14")),1)]),_:1}),y(yu,{onSelect:be},{default:P(()=>[y(me,{type:"primary",class:"relative font-400 w-190px"},{default:P(()=>[De(r(e(g)("components-qinghu-ai.model-face-replacement.747658-16"))+" ",1),t("div",tE,r(e(g)("components-qinghu-ai.model-face-replacement.912708-15")),1)]),_:1})]),_:1})]),t("div",aE,r(e(g)("components-qinghu-ai.model-face-replacement.912708-16")),1),t("div",null,[t("div",nE,[t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-151")),1)]),t("div",oE,[t("div",null,r(e(g)("components-qinghu-ai.one-click-film.658492-41")),1),ie[15]||(ie[15]=t("div",{class:"mx-4px"},"·",-1)),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-153")),1)]),t("div",null,r(e(g)("components-qinghu-ai.model-face-replacement.738063-139")),1)])])]))]),_:1},8,["value"]))]),e(i)!=="en"?(l(),f("div",sE,[y(re,{checked:L.value,"onUpdate:checked":ie[4]||(ie[4]=Ve=>L.value=Ve)},null,8,["checked"]),t("span",lE,[De(r(e(g)("components-qinghu-ai.model-face-replacement.738063-158")),1),t("span",{class:"color-primary cursor-pointer",onClick:te},r(e(g)("components-qinghu-ai.model-face-replacement.738063-159")),1),De(r(e(g)("components-qinghu-ai.model-face-replacement.738063-160")),1)])])):he("",!0)]),t("div",iE,[e($)?(l(),ve(fe,{key:1,title:e(g)("components-qinghu-ai.model-face-replacement.912708-9",[ae.value]),"ok-text":e(g)("login-form.login-container-global.submit"),"cancel-text":e(g)("agent.index.174028-3"),onConfirm:le,onOpenChange:ne,open:d.value},{default:P(()=>[y(me,{type:"primary",class:"w-500px h-42px!",loading:R.value,disabled:U.value},{default:P(()=>[De(r(e(g)("components-qinghu-ai.model-face-replacement.747658-17"))+" ",1),ae.value?(l(),f("span",cE,r(e(g)("components-qinghu-ai.model-face-replacement.738063-161"))+" "+r(ae.value)+" "+r(e(g)("components-qinghu-ai.model-face-replacement.738063-162")),1)):he("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["title","ok-text","cancel-text","open"])):(l(),ve(Hu,{key:0,open:e(Y)},{default:P(()=>[y(me,{type:"primary",class:"w-500px h-42px!",loading:R.value,disabled:""},{default:P(()=>[De(r(e(g)("components-qinghu-ai.model-face-replacement.747658-17"))+" ",1),ae.value?(l(),f("span",rE,r(e(g)("components-qinghu-ai.model-face-replacement.738063-161"))+" "+r(ae.value)+" "+r(e(g)("components-qinghu-ai.model-face-replacement.738063-162")),1)):he("",!0)]),_:1},8,["loading"])]),_:1},8,["open"]))])])]),_:1},8,["open"]),u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:ie[8]||(ie[8]=Be(Ve=>J(!0),["stop"]))},[ie[19]||(ie[19]=t("img",{src:Ul,class:"w-14px h-14px",alt:""},null,-1)),t("span",gE,r(e(g)("components-qinghu-ai.model-face-replacement.738063-146")),1)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] bg-[#ffffff] cursor-pointer shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",ref_key:"cardElement",ref:z,onClick:ie[7]||(ie[7]=Ve=>J(!0))},[t("div",uE,[t("div",dE,[ie[17]||(ie[17]=t("img",{src:Ul,class:"w-14px h-14px",alt:""},null,-1)),t("span",pE,r(e(g)("components-qinghu-ai.model-face-replacement.738063-146")),1)]),t("div",mE,r(e(g)("components-qinghu-ai.model-face-replacement.912708-10")),1),ie[18]||(ie[18]=t("img",{src:b0,alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,-1))])],512)),y($L,{ref_key:"riskDisclosureRef",ref:K},null,512)])}}}),vE={class:"px-14px py-24px h-full relative group"},hE={class:"flex items-center h-12px"},_E=["src"],yE={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},xE=["src"],bE={class:"mt-8px text-12px color-[rgba(61,61,61,0.80)] truncate relative z-10",style:{"line-height":"1"}},IE=["src"],CE=["src"],kE={class:"ml-4px text-14px color-[rgba(0,0,0,0.9)]"},wE=["src"],PE=Dt({__name:"video-workflow-dressup",props:{isChatPinned:{type:Boolean,default:!1}},setup(u){const{t:g}=mt(),i=Kt(),c=g("components-qinghu-ai.video-workflow-dressup.920146-0"),o=g("components-qinghu-ai.video-workflow-dressup.920146-1"),x=()=>{kt("click_dressup_workflow",{page:"é¦é¡µ",module:"è§é¢çæ",moduleCategory1:"è§é¢çæ",moduleCategory2:"åè½å·¥å
·æé®åº",eventDesc:"ç¹å»ãæ¨¡ç¹æ¢è¡£å·¥ä½æµã",buttonName:c}),window.open(i.resolve({path:"/workflow/home"}).href,"_blank")};return(_,m)=>u.isChatPinned?(l(),f("div",{key:1,class:"mr-8px bg-[#ffffff] px-12px py-6px rounded-[50px] flex items-center border-1px border-#F0F0F0 border-solid cursor-pointer",onClick:Be(x,["stop"])},[t("img",{src:e(Vr),class:"w-14px h-14px",alt:""},null,8,CE),t("span",kE,r(e(c)),1),t("img",{src:e(xs),class:"ml-6px h-14px w-auto",alt:"hot"},null,8,wE)])):(l(),f("div",{key:0,class:"w-[max-conter] h-[90px] bg-[#ffffff] cursor-pointer shadow-[0px_4px_10px_0px_rgba(0,0,0,0.08)] linkpix-fn-card",onClick:x},[t("div",vE,[t("div",hE,[t("img",{src:e(Vr),class:"w-14px h-14px",alt:""},null,8,_E),t("span",yE,r(e(c)),1),t("img",{src:e(xs),class:"ml-6px h-14px w-auto",alt:"hot"},null,8,xE)]),t("div",bE,r(e(o)),1),t("img",{src:e(I0),alt:"",class:"absolute bottom-[0px] right-0 hi-lite-img"},null,8,IE)])]))}}),ME={class:"flex items-center max-w-max"},SE={class:"section-grid-mask section-grid-mask-left"},$E={class:"section-grid-mask section-grid-mask-right"},TE={__name:"video-fc-card",props:{isChatPinned:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},emits:["onGenerateVideo","on-generate-video","update:visible"],setup(u,{emit:g}){const i=u,c=g,o=Pa(),x=bt(),_=Kt(),m=F({get:()=>i.visible,set:W=>{c("update:visible",W)}}),p=h(null),d=h(!1),R=h(!1),U=()=>{const W=p.value;if(!W)return;const $=W.scrollLeft,Y=W.scrollWidth,j=W.clientWidth;d.value=$>0,R.value=$+j<Y-1};h({});const G=W=>{const $=p.value;if(!$)return;const Y=Math.max($.clientWidth*.72,240);$.scrollBy({left:W==="right"?Y:-Y,behavior:"smooth"}),window.setTimeout(U,250)},a=W=>{c("on-prompt-generate-video",W)},E=W=>{c("onGenerateVideo",W)},z=[{key:"AIDANCE_DRESSUP_WORKFLOW",component:PE,globalHidden:!0},{key:"videoScript",component:oA,componentProps:{isChatPinned:i.isChatPinned},componentEvents:{"on-generate-video":a}},{key:"videoCopy",component:vA,componentProps:{isChatPinned:i.isChatPinned},componentEvents:{"on-generate-video":a}},{key:"videoStoryboard",component:rU,componentProps:{isChatPinned:i.isChatPinned},componentEvents:{onGenerateVideo:E}},{key:"videoOneClickFilm",component:WU},{key:"ModelFaceReplacement",component:fE}],q=W=>Yn(W,{type:x.LINKPIN_VIDEO_USAGE_TYPE}),S=()=>z.filter(W=>!0),O=h(q(S())),N=()=>{O.value=q(S())},ae=W=>{W!=null&&W.type&&W.type!==x.LINKPIN_VIDEO_USAGE_TYPE||N()},L=W=>(Array.isArray(W)?W:[W]).flatMap(Y=>String(Y).split(";
134")).filter(Boolean).map(Y=>decodeURIComponent(Y)),K=async()=>{const W={...o.query};delete W.actionKey,delete W[ya],await _.replace({path:o.path,query:W})},de=async W=>{const $=tn(o.query[ya]),Y=($==null?void 0:$.type)==="videoFeature"?$.value:Array.isArray(W)?W[0]:W;OT(Y)&&(Ft.emit(Da,{actionKey:Y}),await K())};return Rt(()=>{const W=o.query.url,$=o.query.action;if($&&$==="script_generate"){const Y=L(W||"");Y.length&&(x.batchUploadImgUrls=Y,x.setDefaultPurpose({defaultlist:Y}),m.value=!0)}N(),Ft.on("usage-updated",ae),p.value&&(p.value.addEventListener("scroll",U),U()),tt(()=>{de(o.query.actionKey)})}),fa(()=>{Ft.off("usage-updated",ae),p.value&&p.value.removeEventListener("scroll",U)}),Ne(()=>o.query.actionKey,(W,$)=>{W===$||!W||de(W)}),(W,$)=>(l(),f("div",{class:"w-full section-grid overflow-x-auto",ref_key:"linkpixFcBlockRef",ref:p},[t("div",ME,[(l(!0),f(we,null,Je(e(O),Y=>(l(),f("div",{key:Y.key,class:"linkpix-fn-item"},[Y.key!="videoScript"||!e(x).videoFileInfo?(l(),ve(rn(Y.component),In({key:0,ref_for:!0},Y.componentProps,Qn(Y.componentEvents),{visible:e(m),"onUpdate:visible":$[0]||($[0]=j=>Fe(m)?m.value=j:null),isChatPinned:u.isChatPinned}),null,16,["visible","isChatPinned"])):he("",!0)]))),128))]),ua(t("div",SE,[t("button",{type:"button",class:"section-grid-mask-button section-grid-mask-button-left","aria-label":"Scroll left",onClick:$[1]||($[1]=Y=>G("left"))},[y(e(sn),{class:"font-600"})])],512),[[da,e(d)]]),ua(t("div",$E,[t("button",{type:"button",class:"section-grid-mask-button","aria-label":"Scroll right",onClick:$[2]||($[2]=Y=>G("right"))},[y(e(sn))])],512),[[da,e(R)]])],512))}},AE=It(TE,[["__scopeId","data-v-2794d1fd"]]),UE={class:"flex ad-material-param-group"},LE={class:"ad-material-panel ad-material-type-panel"},EE={class:"ad-material-panel__header"},qE={class:"ad-material-panel__title-wrap"},DE=["src"],OE={class:"ad-material-panel__title"},NE={class:"ad-material-panel__desc"},RE={class:"ad-material-type-list"},FE=["onClick"],GE={class:"ad-material-type-card__thumb"},VE=["src"],zE={class:"ad-material-type-card__body"},BE={class:"ad-material-type-card__title-row"},KE={class:"ad-material-type-card__title"},WE={class:"ad-material-type-card__meta"},jE={class:"ad-material-type-card__desc"},HE={class:"flex items-center h-12px"},JE={class:"line-height-1 ml-4px"},YE={class:"ad-material-panel ad-material-params-panel"},QE={class:"ad-material-form-block"},XE={class:"ad-material-form-label"},ZE={class:"ad-material-count-row"},eq={class:"ad-material-count-row__unit"},tq={style:{"font-size":"12px","margin-top":"2px",color:"#6e7486"}},aq={class:"ad-material-form-block mt-14px"},nq={class:"ad-material-form-label"},oq={class:"ad-material-segment-list"},sq=["onClick"],lq={class:"ad-material-ratio-text"},iq={class:"flex items-center h-12px min-w-0"},rq={class:"line-height-1 ad-material-param-btn__text"},cq={class:"beginner-prompt-panel"},uq={class:"beginner-prompt-panel__header"},dq={class:"beginner-prompt-panel__title"},pq={class:"beginner-prompt-panel__desc"},mq={class:"flex items-center h-12px"},gq=["src"],fq={class:"ad-material-panel ad-material-params-panel"},vq={class:"ad-material-form-block"},hq={class:"ad-material-form-label"},_q={class:"ad-material-count-row"},yq={class:"ad-material-count-row__unit"},xq={class:"ad-material-form-block mt-6px"},bq={class:"ad-material-form-label"},Iq={class:"ad-material-form-block"},Cq={class:"ad-material-form-label"},kq={class:"ad-material-image-ratio-list"},wq=["onClick"],Pq={class:"ad-material-image-size-item__label"},Mq=["src"],Sq={key:1,class:"ad-material-image-size-item__icon"},$q={class:"ad-material-image-size-item__size"},Tq=["onClick"],Aq={class:"flex items-center h-12px min-w-0"},Uq={class:"line-height-1 ad-material-param-btn__text"},Lq=Dt({__name:"ad-material-params",props:{isChatPinned:{type:Boolean,default:!1},modeLoading:{type:Boolean,default:!1}},emits:["apply-config","prompt-mode-change"],setup(u,{emit:g}){const i=g,c=bt(),{t:o}=mt(),x=Pa(),_=h(!1),m=h(!1),p=h(!1),d=h(""),R=D=>D.parentNode,U={douyin:"dd.png",taobao:"tb.png",tmall:"tb.png",pdd:"pdd.png",jd:"jd.png",shopee:"sp.png",tiktok:"tk.png",amazon:"amazon.jpeg",lazada:"lazada.png",temu:"temu.png",ozon:"ozon.png",wildberries:"wb.png"},G=D=>{var qt;const Ae=String((D==null?void 0:D.icon)||"").trim();if(/^(https?:|data:|blob:|\/)/.test(Ae))return Ae;const We=String((D==null?void 0:D.key)||"").toLowerCase(),ot=String((D==null?void 0:D.label)||"").toLowerCase(),it=Ae||((qt=Object.entries(U).find(([Gt])=>We.includes(Gt)||ot.includes(Gt)))==null?void 0:qt[1])||"";return it?Ms(it):""},a={page:o("qinghu-ai.ad-material-params.266304-11"),module:o("qinghu-ai.ad-material-params.266304-12"),moduleCategory1:o("qinghu-ai.ad-material-params.266304-12"),moduleCategory2:o("qinghu-ai.ad-material-params.266304-13")},E=F(()=>c.adMaterialOptionsGroup.AD_VIDEO||[]),z=F(()=>(c.adMaterialOptionsGroup.AD_IMAGE||[])[0]||null),q=F(()=>c.adMaterialParams.materialType||"video"),S=F(()=>E.value.find(D=>D.id===c.adMaterialChatMode)||E.value[0]||null),O=F(()=>{var D;return((D=S.value)==null?void 0:D.videoParameterOptions)||{}}),N=F(()=>{const D=S.value||E.value[0],Ae=z.value;return[{value:"video",title:o("qinghu-ai.ad-material-params.266304-14"),meta:(D==null?void 0:D.description)||o("qinghu-ai.ad-material-params.266304-15"),description:o("qinghu-ai.ad-material-params.266304-16"),icon:C0},{value:"image",title:(Ae==null?void 0:Ae.name)||o("qinghu-ai.ad-material-params.266304-6"),meta:(Ae==null?void 0:Ae.description)||o("qinghu-ai.ad-material-params.266304-17",[L.value]),description:o("qinghu-ai.ad-material-params.266304-18"),icon:k0}]}),ae=F(()=>{var D;return Number(((D=z.value)==null?void 0:D.minCount)||1)}),L=F(()=>{var D;return Number(((D=z.value)==null?void 0:D.maxCount)||10)}),K=F(()=>be.value===ne.value),de=D=>{if(typeof D!="string")return D;try{return JSON.parse(D)}catch{return null}},W=F(()=>{var Ae;const D=de((Ae=z.value)==null?void 0:Ae.imageParameterOptions);return Array.isArray(D)?D:Array.isArray(D==null?void 0:D.list)?D.list:[]}),$=D=>Array.isArray(D==null?void 0:D.children)?D.children:[],Y=D=>(D==null?void 0:D.type)==="group"&&$(D).length>0,j=D=>{var Ae;return String((D==null?void 0:D.value)||(D==null?void 0:D.aspectRatio)||((Ae=$(D)[0])==null?void 0:Ae.aspectRatio)||"")},V=D=>Y(D)?(D==null?void 0:D.value)||(D==null?void 0:D.label)||j(D):(D==null?void 0:D.label)||j(D),w=D=>`${Y(D)?"group":"item"}-${String((D==null?void 0:D.key)||j(D)||(D==null?void 0:D.label)||"")}`,I=F(()=>W.value.filter(D=>(D==null?void 0:D.type)!=="group"||Y(D))),k=F(()=>I.value.filter(D=>Y(D))),B=D=>k.value.find(Ae=>{const We=$(Ae);return j(Ae)===D||We.some(ot=>ot.aspectRatio===D)}),be=F(()=>{var D,Ae;return Number(((Ae=(D=O.value)==null?void 0:D.duration)==null?void 0:Ae.min)||1)}),ne=F(()=>{var D,Ae;return Number(((Ae=(D=O.value)==null?void 0:D.duration)==null?void 0:Ae.max)||60)}),le=F(()=>{var D,Ae;return Number(((Ae=(D=O.value)==null?void 0:D.duration)==null?void 0:Ae.step)||1)}),ce=F(()=>{var Ae;const D=(Ae=O.value)==null?void 0:Ae.orientations;return Array.isArray(D)&&D.length?D.map(We=>We.value):["1:1","3:4","4:3","16:9","9:16"]}),J=D=>`is-${String(D||"").replace(":","-")}`,oe=F(()=>q.value==="image"?o("qinghu-ai.ad-material-params.266304-6"):o("qinghu-ai.ad-material-params.266304-14")),te=F(()=>c.adMaterialVideoChatMode!=="MASTER"),Q=D=>{const Ae=Number(D||0);return Ae>0?`${Ae}${o("qinghu-ai.ad-material-params.266304-3")}`:o("qinghu-ai.ad-material-params.266304-19")},ie=D=>Math.min(L.value,Math.max(ae.value,Number(D||ae.value))),_e=F({get:()=>ie(Number(c.adMaterialParams.imageCount||ae.value)),set:D=>{c.adMaterialParams.imageCount=ie(D)}}),Re=D=>{var Ae,We,ot;return Math.min(ne.value,Math.max(be.value,Number(D||((Ae=S.value)==null?void 0:Ae.duration)||((ot=(We=O.value)==null?void 0:We.duration)==null?void 0:ot.defaultValue)||30)))},ye=F({get:()=>{var D,Ae,We;return Re(Number(c.adMaterialParams.videoDuration||((D=S.value)==null?void 0:D.duration)||((We=(Ae=O.value)==null?void 0:Ae.duration)==null?void 0:We.defaultValue)||30))},set:D=>{c.adMaterialParams.videoDuration=Re(D)}}),me=F(()=>{var D;return c.adMaterialParams.aspectRatio||((D=S.value)==null?void 0:D.aspectRatio)||ce.value[0]||"1:1"}),re=F(()=>c.adMaterialParams.language||"simplified-chinese"),fe=F(()=>{var D;return c.adMaterialParams.aspectRatio||((D=z.value)==null?void 0:D.aspectRatio)||"3:4"}),Oe=F(()=>B(fe.value)||k.value[0]||null);F(()=>$(Oe.value));const Ve=F(()=>c.adMaterialParams.sizeKey||c.adMaterialParams.size||""),H=D=>D.key===Ve.value||D.size===Ve.value,st=D=>{const Ae=fe.value;return j(D)===Ae||$(D).some(We=>We.aspectRatio===Ae)},ge=D=>d.value===w(D),Ce=(D,Ae)=>{const We=w(Ae);D?d.value=We:d.value===We&&(d.value="")},$e=()=>{d.value=""},at=D=>{c.adMaterialParams.sizeKey=(D==null?void 0:D.key)||"",c.adMaterialParams.size=(D==null?void 0:D.size)||"",c.adMaterialParams.quality=(D==null?void 0:D.quality)||""},nt=()=>{c.adMaterialParams.sizeKey="",c.adMaterialParams.size="",c.adMaterialParams.quality="",$e()},Se=F(()=>Kr(re.value)),se=F(()=>[Q(ye.value),me.value].join(" · ")),Te=F(()=>[fe.value,Se.value||o("qinghu-ai.ad-material-params.266304-20"),`${_e.value}${o("qinghu-ai.ad-material-params.266304-9")}`].join(" · ")),Xe=(D={})=>{i("apply-config",D)},pt=D=>{var ot,it;const Ae=D;_.value=!1,m.value=!1,p.value=!1;const We=q.value;if(c.setAdMaterialMaterialType(Ae),Ae==="image"){c.adMaterialParams.imageCount=ie(Number(c.adMaterialParams.imageCount||ae.value));const qt=We!=="image"?((ot=z.value)==null?void 0:ot.aspectRatio)||"3:4":c.adMaterialParams.aspectRatio||((it=z.value)==null?void 0:it.aspectRatio)||"3:4";c.adMaterialParams.aspectRatio=qt,c.adMaterialParams.sizeKey="",c.adMaterialParams.size="",c.adMaterialParams.quality=""}kt("select_ad_template_type",{...a,eventDesc:o("qinghu-ai.ad-material-params.266304-21"),buttonName:o(Ae==="image"?"qinghu-ai.ad-material-params.266304-6":"qinghu-ai.ad-material-params.266304-14"),materialType:Ae,source:x.path}),Xe({generatePrompt:!0,previousMaterialType:We})}
134,gt=D=>{i("prompt-mode-change",!!D)},Ge=D=>{c.adMaterialParams.videoDuration=Re(Number(c.adMaterialParams.videoDuration||ye.value)),Xe()},T=D=>{c.adMaterialParams.aspectRatio=D,Xe()},X=D=>{c.adMaterialParams.imageCount=ie(D),kt("select_ad_image_count",{...a,eventDesc:o("qinghu-ai.ad-material-params.266304-22"),buttonName:`${c.adMaterialParams.imageCount}${o("qinghu-ai.ad-material-params.266304-9")}`,count:c.adMaterialParams.imageCount,source:x.path}),Xe()},Ee=D=>{c.adMaterialParams.aspectRatio=D;const Ae=B(D);Ae?(d.value=w(Ae),c.adMaterialParams.sizeKey="",c.adMaterialParams.size="",c.adMaterialParams.quality=""):nt(),Xe()},Ye=(D,Ae)=>{c.adMaterialParams.aspectRatio=D.aspectRatio||j(Ae)||"1:1",at(D),$e(),Xe()},Me=D=>{c.adMaterialParams.language=D,kt("select_ad_image_language",{...a,eventDesc:o("qinghu-ai.ad-material-params.266304-23"),buttonName:Kr(D),language:D,source:x.path}),Xe()};return(D,Ae)=>{const We=Lt,ot=Bt,it=jl,qt=Hl,Gt=Xn,jt=Qa,$t=Ya,Ht=Ts,ta=$s,ea=As;return l(),f("div",UE,[y(ot,{open:e(_),"onUpdate:open":Ae[1]||(Ae[1]=ft=>Fe(_)?_.value=ft:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"ad-material-setting-popover",getPopupContainer:R},{content:P(()=>[t("div",LE,[t("button",{type:"button",class:"ad-material-panel__close",onClick:Ae[0]||(Ae[0]=ft=>_.value=!1)},"Ã"),t("div",EE,[t("div",qE,[t("img",{src:e(zc),alt:"",class:"ad-material-panel__head-icon-img"},null,8,DE),t("div",null,[t("div",OE,r(e(o)("qinghu-ai.ad-material-params.266304-0")),1),t("div",NE,r(e(o)("qinghu-ai.ad-material-params.266304-1")),1)])])]),t("div",RE,[(l(!0),f(we,null,Je(e(N),ft=>(l(),f("div",{key:ft.value,class:Qe(["ad-material-type-card",{"is-active":e(q)===ft.value}]),onClick:wt=>pt(ft.value)},[t("div",GE,[t("img",{src:ft.icon,alt:"",class:"ad-material-type-card__thumb-img"},null,8,VE)]),t("div",zE,[t("div",BE,[t("div",KE,r(ft.title),1),t("div",{class:Qe(["ad-material-type-card__badge",{"is-active":e(q)===ft.value}])},null,2)]),t("div",WE,r(ft.meta),1),t("div",jE,r(ft.description),1)])],10,FE))),128))])])]),default:P(()=>[y(We,{class:Qe(["mr-6px group ant-no-wave ad-material-param-btn",[u.isChatPinned?"border-none!":""]])},{default:P(()=>[t("div",HE,[y(e(hf),{class:"w-14px h-14px"}),t("span",JE,r(e(oe)),1),y(e(Qt),{class:"ml-10px!"})])]),_:1},8,["class"])]),_:1},8,["open"]),y(ot,{open:e(m),"onUpdate:open":Ae[6]||(Ae[6]=ft=>Fe(m)?m.value=ft:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"ad-material-setting-popover",getPopupContainer:R},{content:P(()=>[t("div",YE,[t("div",QE,[t("div",XE,r(e(o)("qinghu-ai.ad-material-params.266304-2")),1),t("div",ZE,[e(K)?he("",!0):(l(),ve(it,{key:0,class:"ad-material-count-row__slider",min:e(be),max:e(ne),step:e(le),"tooltip-open":!1,value:e(ye),"onUpdate:value":Ae[2]||(Ae[2]=ft=>Fe(ye)?ye.value=ft:null),onChange:Ae[3]||(Ae[3]=ft=>Ge("duration"))},null,8,["min","max","step","value"])),y(qt,{class:"ad-material-count-row__input",min:e(be),max:e(ne),controls:!1,disabled:e(K),value:e(ye),"onUpdate:value":Ae[4]||(Ae[4]=ft=>Fe(ye)?ye.value=ft:null),onChange:Ae[5]||(Ae[5]=ft=>Ge("duration"))},null,8,["min","max","disabled","value"]),t("span",eq,r(e(o)("qinghu-ai.ad-material-params.266304-3")),1)]),t("div",tq,r(e(o)("qinghu-ai.ad-material-params.266304-4")),1)]),t("div",aq,[t("div",nq,r(e(o)("qinghu-ai.ad-material-params.266304-5")),1),t("div",oq,[(l(!0),f(we,null,Je(e(ce),ft=>(l(),f("button",{key:ft,type:"button",class:Qe(["ad-material-segment-item",{"is-active":e(me)===ft}]),onClick:wt=>T(ft)},[t("span",{class:Qe(["ad-material-ratio-icon",J(ft)])},null,2),t("span",lq,r(ft),1)],10,sq))),128))])])])]),default:P(()=>[ua(y(We,{class:Qe(["mr-6px group ant-no-wave ad-material-param-btn ad-material-param-btn--wide",[u.isChatPinned?"border-none!":""]])},{default:P(()=>[t("div",iq,[t("span",rq,r(e(se)),1),y(e(Qt),{class:"ml-10px! flex-shrink-0"})])]),_:1},8,["class"]),[[da,e(q)==="video"]])]),_:1},8,["open"]),e(q)==="video"?(l(),ve(ot,{key:0,placement:"top",trigger:"click",overlayClassName:"beginner-prompt-popover",getPopupContainer:R},{content:P(()=>[t("div",cq,[t("div",uq,[t("span",dq,r(e(o)("components-qinghu-ai.video-params.446330-68")),1),y(Gt,{loading:u.modeLoading,checked:e(te),size:"small",onChange:gt},null,8,["loading","checked"])]),t("div",pq,r(e(o)("components-qinghu-ai.video-params.446330-69")),1)])]),default:P(()=>[y(We,{class:Qe(["mr-6px group ant-no-wave beginner-prompt-entry order-[100]",[u.isChatPinned?" border-none!":""]])},{default:P(()=>[t("div",mq,[t("img",{src:e(tu),class:"beginner-prompt-entry__icon",alt:""},null,8,gq),t("span",null,r(e(o)("components-qinghu-ai.video-params.446330-68")),1)])]),_:1},8,["class"])]),_:1})):he("",!0),y(ot,{open:e(p),"onUpdate:open":Ae[9]||(Ae[9]=ft=>Fe(p)?p.value=ft:null),placement:"top",trigger:"click",arrow:!1,overlayClassName:"ad-material-setting-popover",getPopupContainer:R},{content:P(()=>[t("div",fq,[t("div",vq,[t("div",hq,r(e(o)("qinghu-ai.ad-material-params.266304-8")),1),t("div",_q,[y(it,{class:"ad-material-count-row__slider",min:e(ae),max:e(L),step:1,"tooltip-open":!1,value:e(_e),"onUpdate:value":Ae[7]||(Ae[7]=ft=>Fe(_e)?_e.value=ft:null),onChange:X},null,8,["min","max","value"]),y(qt,{class:"ad-material-count-row__input",min:e(ae),max:e(L),controls:!1,value:e(_e),"onUpdate:value":Ae[8]||(Ae[8]=ft=>Fe(_e)?_e.value=ft:null),onChange:X},null,8,["min","max","value"]),t("span",yq,r(e(o)("qinghu-ai.ad-material-params.266304-9")),1)])]),t("div",xq,[t("div",bq,r(e(o)("qinghu-ai.ad-material-params.266304-10")),1),y($t,{class:"ad-material-language-select",value:e(re),onChange:Me},{default:P(()=>
134[(l(!0),f(we,null,Je(e(Cs),ft=>(l(),ve(jt,{key:ft.code,value:ft.code},{default:P(()=>[De(r(ft.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),t("div",Iq,[t("div",Cq,r(e(o)("qinghu-ai.ad-material-params.266304-5")),1),t("div",kq,[(l(!0),f(we,null,Je(e(I),ft=>(l(),f(we,{key:w(ft)},[Y(ft)?(l(),ve(ea,{key:0,open:ge(ft),placement:"top",trigger:"click",overlayClassName:"ad-material-image-size-dropdown",onOpenChange:wt=>Ce(wt,ft)},{overlay:P(()=>[y(ta,{class:"ad-material-image-size-list overflow-auto! max-h-300px! scrollbar"},{default:P(()=>[(l(!0),f(we,null,Je($(ft),wt=>(l(),ve(Ht,{key:wt.key||wt.size,onClick:Vt=>Ye(wt,ft)},{default:P(()=>[t("div",{class:Qe(["ad-material-image-size-item",{"is-active":H(wt)}])},[t("span",Pq,[G(wt)?(l(),f("img",{key:0,src:G(wt),alt:"",class:"ad-material-image-size-item__img"},null,8,Mq)):(l(),f("span",Sq)),De(" "+r(wt.label),1)]),t("span",$q,r(wt.showSize||wt.size),1)],2)]),_:2},1032,["onClick"]))),128))]),_:2},1024)]),default:P(()=>[t("button",{type:"button",class:Qe(["ad-material-image-ratio-item ad-material-image-ratio-item--size",{"is-active":st(ft)}]),onClick:wt=>Ee(j(ft))},[t("span",null,r(V(ft)),1),y(e(Qt),{class:"ad-material-image-ratio-item__arrow"})],10,wq)]),_:2},1032,["open","onOpenChange"])):(l(),f("button",{key:1,type:"button",class:Qe(["ad-material-image-ratio-item",{"is-active":e(fe)===j(ft)}]),onClick:wt=>Ee(j(ft))},r(V(ft)),11,Tq))],64))),128))])])])]),default:P(()=>[ua(y(We,{class:Qe(["mr-6px group ant-no-wave ad-material-param-btn ad-material-param-btn--wide",[u.isChatPinned?"border-none!":""]])},{default:P(()=>[t("div",Aq,[t("span",Uq,r(e(Te)),1),y(e(Qt),{class:"ml-10px! flex-shrink-0"})])]),_:1},8,["class"]),[[da,e(q)==="image"]])]),_:1},8,["open"])])}}}),Eq=It(Lq,[["__scopeId","data-v-1dc3a972"]]),qq=()=>{const{t:u}=mt(),g=bt(),i=()=>new Promise(x=>{Zt.confirm({title:"æç¤º",content:St("div",[St("div",{style:"color: #666; font-size: 14px; line-height: 1.5;"},"æªææå®æ ¼å¼å¡«åï¼å½±åå¥å¾ææã")]),footer:St("div",{style:"display: flex; justify-content: flex-end; margin-bottom: -12px; margin-top: 36px;"},[St("div",{style:"padding: 4px 14px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; color: #666; cursor: pointer;",onClick:()=>{Zt.destroyAll(),x("cancel")}},"åæ¶"),St("div",{style:"padding: 4px 14px;margin-right: -12px; margin-left: 12px; border: 1px solid #d9d9d9; border-radius: 4px; background: #6051F8; color: #fff; cursor: pointer;",onClick:()=>{Zt.destroyAll(),x("submit")}},"ä¾ç¶æäº¤")]),onCancel:()=>{x("cancel")},closable:!1,width:428})});
134function c(x){if(g.mainImageChatMode!=="SKU_GENERATION"&&g.longImageChatMode!=="SKU_GENERATION")return{isValid:!0,message:"æ ¡éªéè¿"};if(!x||x.trim()==="")return{isValid:!1,msg:"å 容ä¸è½ä¸ºç©º"};const _=["产ååç§°ååç±»","æ ¸å¿ç¹å¾"];for(const R of _)if(x.indexOf(R)===-1)return{isValid:!1,message:`æ ¼å¼é误ï¼å¿ é¡»å å«å ³é®è¯â${R}â`};if(!/[:ï¼]/.test(x))return{isValid:!1,message:"æ ¼å¼éè¯¯ï¼æ é¢å请è·éåå·ï¼: æ ï¼ï¼"};const p=o(x,"产ååç§°ååç±»");if(!p||p==="å¡«å产å")return{isValid:!1,message:"请填åå ·ä½ç产ååç§°ååç±»"};const d=o(x,"æ ¸å¿ç¹å¾");return!d||d==="å¡«åæ ¸å¿ç¹å¾"?{isValid:!1,message:"请填åå ·ä½çæ ¸å¿ç¹å¾"}:{isValid:!0,message:"æ ¡éªéè¿"}}function o(x,_){let m=x.indexOf(_),p=x.indexOf("ï¼",m);if(p===-1&&(p=x.indexOf(":",m)),p===-1)return"";let d=x.substring(p+1).trim();if(d.startsWith("ã")){let U=d.indexOf("ã");return U>-1?d.substring(1,U).trim():""}let R=d.indexOf(` 135`);return(R===-1?d:d.substring(0,R)).trim()}return{showValidateConfirm:i,validatePromptFormat:c}},Dq={class:"input-area"},Oq={key:0,class:"px-8px py-8px"},Nq={class:"chat-img-box"},Rq={key:1,class:"video-material-row"},Fq={key:0,"aria-disabled":"true",class:"text-[14px] text-[#666] pt-[8px] hover:cursor-not-allowed"},Gq={key:1,"aria-disabled":"true",class:"pl-12px text-[14px] text-[#aaa] pt-[8px] hover:cursor-not-allowed"},Vq={key:0,class:"ml-12px px-6px border border-1px border-solid border-[rgba(96,81,248,0.27)] text-10px max-w-max rounded-4px text-#999999"},zq={class:"text-#6051F8"},Bq={key:1,class:"editor-loading"},Kq={key:0,class:"actions"},Wq={class:"param-list flex"},jq=["onClick"],Hq={class:"flex flex-shrink-0 pl-10px items-center"},Jq={class:"flex items-center mr-12px h-24px"},Yq={class:"mr-6px"},Qq={class:"flex items-center mr-12px h-24px"},Xq={class:"flex items-center mr-12px h-24px"},Zq={class:"mx-12px"},eD={class:"max-h-188px overflow-hidden text-[#3D3D3D] w-480px"},tD={class:"mb-14px text-18px flex items-center"},aD={key:0,class:"agent-list-row"},nD={class:"pr-16px"},oD=["onClick"],sD={class:"arrow-icon"},lD={key:1,class:"agent-list-row"},iD={class:"pr-16px"},rD=["onClick"],cD={class:"arrow-icon"},uD={class:"flex flex-shrink-0 pl-10px items-center"},dD={key:0,class:"mr-10px color-[#3F3A49] flex items-center"},pD={key:0,class:"mr-10px color-[#3F3A49]"},mD={key:1,class:"mr-10px color-[#3F3A49]"},gD={key:2,class:"mr-10px color-[#3F3A49]"},fD={key:3,class:"mr-10px color-[#3F3A49] flex items-center"},vD={key:4},Pc=300,hD="MODEL_DRESS_UP",_D="IMAGE_TRANSLATION",vs=" ",yD=50,Mc=3,xD=10,Fn="LinkPixMainImageSuiteCount",Sc="LinkPixDetailImageSuiteCount",bD=Dt({__name:"AIChatInput",props:{messageInput:{type:String,default:""},placeholder:{type:String,default:""},isSending:{type:Boolean,default:!1},currentChat:{type:[Object,null],default:()=>({})},isHomeStyle:{type:Boolean,default:!0},showAgent:{type:Boolean,default:!0},agentList:{type:Array,default:()=>[]},exampleList:{type:Array,default:()=>[]},disableSpecialTrigger:{type:Boolean,default:!1},showUse:{type:Boolean,default:!0},isChatPinned:{type:Boolean,default:!1},isExpand:{type:Boolean,default:!1},maxCharacterCount:{type:Number,default:void 0}},emits:["update:messageInput","send","stop","updateScript","update:isExpand"],setup(u,{expose:g,emit:i}){const c=_g(),o=la(),{userInfo:x}=va(o),_=h(!1),m=h(!1),{locale:p,t:d}=mt(),R=Dc(),U=wa(),G=Kt(),a=bt(),{validateFirstFrameAspectRatio:E}=eT(),{showImageUploadCountTips:z}=$o(),q=h(a.videoTimeData),S=n=>(n==null?void 0:n.specialType)===hD,O=n=>(n==null?void 0:n.lockInput)===!0,N=n=>(n==null?void 0:n.lockInput)===!0&&(n==null?void 0:n.hideLockIcon)!==!0,ae=F(()=>q.value.length>0&&q.value.every(n=>n.maintenance)),L=F(()=>{var s;if(!Uc((s=a.imageGenerateUseWay)==null?void 0:s.useWayData).character)return!1;const n=a.imageOptions.find(v=>v.id===a.imageGenerateParams.currentImageActiveId);return!n||n.characterEnabled!==!1}),K=F(()=>a.videoTimeData.find(n=>String(n.id)===String(a.videoGenerateParams.currentTimeActiveId))),de=F(()=>{var n;return Oc((n=K.value)==null?void 0:n.referenceRules)}),W=F(()=>{var n;return cn((n=K.value)==null?void 0:n.referenceRules)}),$=F(()=>{var n;return a.aiMessageType!=="IMAGETOVIDEO"?null:(n=Tr(a.batchUploadVideoUrls,de.value))!=null?n:Ar(a.batchUploadVideoUrls,de.value,a.videoGenerateParams.duration)}),Y=F(()=>{var s;const n=(s=a.imageGenerateParams)==null?void 0:s.currentImageActiveId;return(a.imageOptions||[]).find(v=>String(v==null?void 0:v.id)===String(n))}),j=F(()=>{var n,s,v,C;return a.aiMessageType==="IMAGETOVIDEO"?(n=K.value)==null?void 0:n.referenceRules:a.aiMessageType!=="LINKPIX"?null:((v=(s=a.imageGenerateUseWay)==null?void 0:s.useWayData)==null?void 0:v.referenceRules)||((C=Y.value)==null?void 0:C.referenceRules)}),V=F(()=>
135ko(j.value)?{...wo(j.value),maxFileSizeMb:Po(j.value)}:null),w=F(()=>{var n;return((n=V.value)==null?void 0:n.maxImageCount)||5}),I=F(()=>{const n=a.imageGenerateParams;return Cu({maxCount:a.aiMessageType==="IMAGETOVIDEO"?w.value:hi.value,rules:V.value,isFree:n==null?void 0:n.isFree,quality:n==null?void 0:n.quality,imageCount:n==null?void 0:n.imageCount})}),k=F(()=>V.value?yg(a.batchUploadImgUrls,V.value):null),B=n=>{n&&(n.code==="format"?qe.warning(d("image-reference.rules.formats",[n.formats.join(", ")])):n.code==="metadata"?qe.warning(d("image-reference.rules.metadata-failed")):n.code==="file-size"?qe.warning(d("image-reference.rules.file-size",[n.maxFileSizeMb])):n.code==="max-count"?qe.warning(d("image-reference.rules.max-count",[n.maxCount])):n.code==="min-dimension"?qe.warning(d("image-reference.rules.min-dimension",[n.minDimension])):n.code==="aspect-ratio"&&qe.warning(d("image-reference.rules.aspect-ratio-range",n.range)))},be=async()=>{var ee;if(!V.value||!((ee=a.batchUploadImgUrls)!=null&&ee.length))return!0;const n=a.aiMessageType==="IMAGETOVIDEO"?String(a.videoGenerateParams.currentTimeActiveId):String(a.imageGenerateParams.currentImageActiveId),s=JSON.stringify(a.batchUploadImgUrls),v=En(j.value),C=await Promise.all(a.batchUploadImgUrls.map(pe=>_n(pe,V.value)));if(s!==JSON.stringify(a.batchUploadImgUrls)||v!==En(j.value))return!1;const M=a.aiMessageType==="IMAGETOVIDEO"?String(a.videoGenerateParams.currentTimeActiveId):String(a.imageGenerateParams.currentImageActiveId);if(n!==M)return!1;const A=C.find(Boolean);return A?(B(A),!1):!0},ne=n=>new Promise((s,v)=>{const C=document.createElement("video");let M=null;const A=()=>{M&&clearTimeout(M),C.onloadedmetadata=null,C.onerror=null,C.removeAttribute("src")};C.preload="metadata",C.onloadedmetadata=()=>{const ee=C.duration;A(),Number.isFinite(ee)&&ee>0?s(ee):v(new Error("Invalid video duration"))},C.onerror=()=>{A(),v(new Error("Failed to load video duration"))},M=setTimeout(()=>{A(),v(new Error("Video duration load timeout"))},1e4),C.src=n}),le=async()=>{var s;if(a.aiMessageType!=="IMAGETOVIDEO")return!0;if((s=a.batchUploadVideoUrls)!=null&&s.length){const v=Tg(a.batchUploadVideoUrls);if(v.some(M=>Lr(M)===null)){const M=String(a.videoGenerateParams.currentTimeActiveId),A=JSON.stringify(Er(v));try{const ee=await Promise.all(v.map(async ze=>Lr(ze)!==null?ze:{...ze,durationSeconds:await ne(ze.url)})),pe=M===String(a.videoGenerateParams.currentTimeActiveId),Le=A===JSON.stringify(Er(a.batchUploadVideoUrls));if(!pe||!Le)return!1;a.batchUploadVideoUrls=ee,await tt()}catch{return qe.warning(d("components-qinghu-ai.video-generate-upload.930519-113")),!1}}const C=Tr(a.batchUploadVideoUrls,de.value);if(C){if(C.code==="max-count")qe.warning(d("video-reference.rules.max-count",[C.maxCount]));else if(C.code==="total-duration")qe.warning(d("video-reference.rules.total-duration",[C.limit]));else if(C.code==="single-duration"){const M=a.batchUploadVideoUrls[C.index],A=(M==null?void 0:M.fileName)||(M==null?void 0:M.name)||d("task-monitor.uploadVideo.059106-5"),[ee,pe]=C.range;qe.warning(d("components.AIChatInput.605011-5",[A,d("components.AIChatInput.605011-1",[ee,pe])]))}return!1}}const n=Ar(a.batchUploadVideoUrls,de.value,a.videoGenerateParams.duration);return n?(qe.warning(d("video-reference.rules.input-output-duration",[n.limit])),!1):!0},ce=()=>{var s;if(a.aiMessageType!=="IMAGETOVIDEO"||!((s=a.batchUploadAudioUrls)!=null&&s.length))return!0;const n=mc(a.batchUploadAudioUrls,W.value);return n?(qe.warning(hn(n,d)),!1):!0},J=F(()=>{var s;const n=Number((s=K.value)==null?void 0:s.promptByteLimit);return Number.isFinite(n)&&n>0?n:null}),oe=F(()=>!K.value||K.value.characterEnabled!==!1),te=F(()=>!K.value||K.value.batchGenerationEnabled!==!1),Q=F(()=>{var n;return((n=K.value)==null?void 0:n.videoSupported)===!0}),ie=()=>{let n=!1;H.value.state.doc.descendants(s=>s.type.name==="mention"&&s.attrs.type==="character"?(n=!0,!1):!0),n&&(H.value.commands.setContent(""),st.value="")};Ne(()=>oe.value,(n,s)=>{s&&!n&&H.value&&ie()}),Ne(()=>L.value,(n,s)=>{s&&!n&&H.value&&ie()}),Ne(()=>te.value,n=>{!n&&Number(a.videoGenerateParams.count||1)!==1&&(a.videoGenerateParams.count=1)},{immediate:!0});const _e=u,Re=F(()=>_e.maxCharacterCount!==void 0?_e.maxCharacterCount:a.aiMessageType==="IMAGETOVIDEO"?5:10),ye=i;let me=null;const re=()=>{me&&(clearTimeout(me),me=null)},fe=()=>{re(),m.value=!1},Oe=()=>{re(),me=setTimeout(()=>{_e.isSending||(m.value=!1),me=null},Pc)},Ve=Nl(),H=ef(null),st=h(""),ge=h(!0),Ce=h(0),$e=h(null),at=h(null),nt=h(!1),Se=h(null),se=h(null),Te=h(!1),Xe=h(null),pt=h(!1),gt
135=h(!1),Ge=F(()=>_e.isChatPinned),T=Pa(),X=F(()=>Array.isArray(T.query.type)?T.query.type[0]:T.query.type),Ee=h(null),Ye=h([]),Me=h([]),D=h([]),Ae=h(!1),We=h(!1),ot=h(null),it=h(null),qt=h(null),{showValidateConfirm:Gt,validatePromptFormat:jt}=qq(),$t={shop_name:[i6,"value"],goods_url:[H_,"value"]},Ht=h(""),ta=h(!1),ea=h(null),ft=h([]),wt=h({}),Vt=h({runType:xo.ONCE,scheduleType:"immediate"}),He=h(""),Ue=h([]),ut=h(!1),At=h(!1),Ut=F(()=>ut.value||At.value),Et=h(d("components.AIChatInput.107298-0")),Ot=h(!1),zt=h(!1),sa=h(null),ue=h(null),ke=h(null),et=h(null),lt=h(null),je=h(null),_t=h([]),vt=h({clothingImages:[],modelImages:[],placeholderList:[]}),rt=h(null);let ct=!1,Tt=0;const _a=(n=[])=>(n||[]).map(s=>({...s,images:Array.isArray(s==null?void 0:s.images)?[...s.images].filter(Boolean):[]})),ha=(n=[])=>(n||[]).flatMap(s=>s.images||[]).filter(Boolean),Aa=h(!1),xe=n=>Array.isArray(n)?n[0]:n,b=F(()=>{var n,s;if(a.aiMessageType==="LINKPIX"&&a.imageGenerateUseWay.showComponents){if(S(a.imageGenerateUseWay.useWayData)){const v=vt.value.clothingImages||[],C=vt.value.modelImages||[];return v.length>0&&C.length>0}return((n=a.imageGenerateUseWay.placeholderList)==null?void 0:n.length)&&((s=a.batchUploadImgUrls)==null?void 0:s.length)>1}return!0}),Z=F(()=>{if(a.aiMessageType!=="LINKPIX"||!S(a.imageGenerateUseWay.useWayData))return!1;const n=vt.value.clothingImages||[],s=vt.value.modelImages||[];return n.length>0||s.length>0}),Ie=h(!1),Pe=F(()=>a.aiMessageType=="POD_MATERIAL"),yt=F(()=>a.podMaterialParams.podMaterialMode=="STAMP_APPLY"),Yt=F(()=>!Pe.value),aa=F(()=>a.aiMessageType=="IMAGETOVIDEO"&&ae.value),Jt=F(()=>(a.podMaterialParams.images||[]).some(n=>typeof n=="string"?!!n:!!(n!=null&&n.url))),Ua=F(()=>(a.podMaterialParams.productImages||[]).some(Boolean)),eo=()=>{const n=a.podMaterialParams;n.images=[],n.productImages=[]},Ka=F(()=>Pe.value?Jt.value?!yt.value||Ua.value:!1:!0),xt=F(()=>a.aiMessageType!=="LINKPIX"||!a.imageGenerateUseWay.useWayData?!0:(a.batchUploadImgUrls||[]).some(n=>typeof n=="string"?!!n.trim():!!(n!=null&&n.url))),Ke=F(()=>(!Yt.value||!Ot.value)&&Ka.value&&xt.value&&!Ie.value&&!Ut.value&&!$.value&&!k.value&&b.value),Ct=F(()=>m.value?!0:a.aiMessageType=="VIDEO_TRANSLATION"?!1:!Ke.value||aa.value),na=F(()=>aa.value?!1:Pe.value?Ke.value:a.aiMessageType=="IMAGETOVIDEO"?!0:!Ot.value),{getGenerateMode:Ds,setGenerateMode:to}=bu(),ao=h([]),Ju=h(!1),Ia=h([]),ii=h(!1),ri=h(!1),ci=h(!1),ui=h(!1),di=h(!1),pi=h(!1),un=h([]),Yu=["QUICK_GENERATION","ACCURATE_GENERATION"],To=F(()=>a.aiMessageType=="LONGIMAGE"?un.value.filter(n=>n.frontHide!==1):_f.value.filter(n=>Yu.includes(n.value))),Os=h(0),mi=h(0),Qu=h(0),Xu=h(0),Zu=h(0),dn=h(!1),Ao=h(!1),Ns=h(!1),Rs=h(!1),no=h(!1),oo=h(!1),gi=F(()=>(a.batchUploadImgUrls||[]).length<=Tc),Uo=F(()=>{var n;return(n=a.estimatedPoints)==null?void 0:n.score}),ed=F(()=>Uo.value!==void 0&&Uo.value!==null&&Uo.value!==""),fi=F(()=>a.imageGenerateParams),Lo=F(()=>xg(a.imageGenerateUseWay.useWayData,a.imageGenerateParams.currentImageActiveId,a.mainImageChatMode)),Fs=F(()=>a.aiMessageType==="LINKPIX"&&!!fi.value.isFree),Gs=F(()=>{var n;return S(a.imageGenerateUseWay.useWayData)?Ir():((n=a.batchUploadImgUrls)==null?void 0:n.length)||0}),td=F(()=>{var n;return oo.value&&(Fa(a.imageGenerateUseWay.useWayData)||((n=a.imageGenerateUseWay.useWayData)==null?void 0:n.supportMultiImage)===!1)}),ad=F(()=>{var n;return((n=a.imageGenerateUseWay.useWayData)==null?void 0:n.specialType)===_D}),vi=F(()=>{var n;return((n=x.value)==null?void 0:n.defaultVip)===!0&&ad.value}),hi=F(()=>vi.value?1:0),nd=F(()=>vi.value?d("components.AIChatInput.912708-2"):""),Vs=F(()=>td.value&&Gs.value>1),Eo=F(()=>Fs.value&&a.imageGenerateParams.quality==="1K"&&Number(a.imageGenerateParams.imageCount||1)===1&&gi.value),zs=F(()=>!!a.imageGenerateParams.otherFreeSkuId&&(Fa(a.imageGenerateUseWay.useWayData)?Gs.value===1:Number(a.imageGenerateParams.imageCount||1)===1)&&gi.value&&!Vs.value),_i=F(()=>Fs.value&&!a.imageGenerateParams.otherFreeSkuId&&!Eo.value),od=F(()=>!!a.imageGenerateParams.otherFreeSkuId&&!zs.value),yi=F(()=>oo.value&&!Vs.value);F(()=>a.imageGenerateParams.isFree?oo.value?yi.value:!0:!1);const xi=()=>{var n;!Fs.value||!((n=x.value)!=null&&n.defaultVip)||_i.value||Fa(a.imageGenerateUseWay.useWayData)||(a.imageGenerateParams.quality="1K",a.imageGenerateParams.imageCount=1)},sd=["STAMP_EXTRACT","STAMP_APPLY"],Bs=(n=a.podMaterialParams||{})=>(n==null?void 0:n.podMaterialMode)==="STAMP_APPLY"&&hs(n)===Ea.ONE_PATTERN_TO_MULTI_PRODUCT,qo=F(()=>
135{if(a.aiMessageType!=="POD_MATERIAL")return!1;const n=a.podMaterialParams||{},s=Array.isArray(n.images)?n.images.filter(C=>typeof C=="string"?!!C:!!(C!=null&&C.url)).length:0;return!sd.includes(n.podMaterialMode)||s!==1?!1:Bs(n)?(Array.isArray(n.productImages)?n.productImages.filter(Boolean).length:0)===1:!0}),Xa=(n=!1)=>{a.podSingleFreeAvailable=n},Ks=(n={})=>{Os.value=n.userDailyUsedCount||0,mi.value=n.userDailyLimit||0,Qu.value=n.systemDailyLimit||0,Xu.value=n.systemDailyUsedCount||0,Zu.value=n.systemDailyRemainingCount||0,Ns.value=!!n.hasFreeEligibility,Rs.value=!!n.activityActive,dn.value=n.systemDailyRemainingCount!==void 0&&n.systemDailyRemainingCount<=0,Ao.value=n.userDailyUsedCount!==void 0&&n.userDailyLimit!==void 0&&n.userDailyUsedCount>=n.userDailyLimit},ld=n=>{var C;const s=((C=a.podMaterialParams)==null?void 0:C.podMaterialMode)||"POD",v=hs();return`podSingleFree_${s}_${v}_${n}_${new Date().toDateString()}`},Do=h(!1),id=F(()=>{if(a.aiMessageType=="LINKPIX"){if(a.imageGenerateParams.otherFreeSkuId&&a.imageGenerateParams.otherFreeSkuId==28)return!1;if(a.imageGenerateParams.currentImageActiveId!=55)return!0}else{if(a.aiMessageType=="LONGIMAGE"||a.aiMessageType=="AD_MATERIAL"||a.aiMessageType=="POD_MATERIAL"||a.aiMessageType=="VIDEO_TRANSLATION")return!0;if(a.aiMessageType=="IMAGETOVIDEO")return!(bi&&Os>0)}}),rd=()=>{const n=`${window.location.origin}/active-page`;Cg({page:"LinkPix",module:"LinkPixæ´»å¨å
¥å£",moduleCategory1:"LinkPixæ´»å¨å
¥å£",moduleCategory2:"LinkPixè¾å
¥æ¡ä¹°ä¸éä¸å
¥å£",label:"ä¹°ä¸é䏿´»å¨",source:T.path,extra:{targetUrl:n}}),window.open(n,"_blank")},bi=F(()=>{if(!(a.aiMessageType=="IMAGETOVIDEO"&&Ns.value&&Rs.value&&!a.videoFileInfo))return!1;if(!dn.value&&!Ao.value)return!0;const s=new Date().toDateString();return localStorage.getItem("freeVideoConfirmedDate")!==s}),cd=F(()=>{if(a.aiMessageType!="LINKPIX")return!1;if(oo.value)return yi.value;if(a.estimatedPointsLoading||!ed.value||Number(Uo.value)!==0||a.imageGenerateParams.otherFreeSkuId&&!zs.value||fi.value.isFree&&!a.imageGenerateParams.otherFreeSkuId&&!Eo.value)return!1;if(a.imageGenerateParams.otherFreeSkuId&&!a.imageGenerateParams.otherSkuIsSystemQuotaExhausted)return!0;if(a.imageGenerateParams.otherFreeSkuId&&a.imageGenerateParams.otherSkuIsSystemQuotaExhausted){const v=new Date().toDateString();return localStorage.getItem("freeImagePurposeConfirmedDate")!==v}if(!Ns.value||!Rs.value)return!1;if(!dn.value)return!0;const n=new Date().toDateString();return localStorage.getItem("freeImageConfirmedDate")!==n}),ud=F(()=>a.aiMessageType==="POD_MATERIAL"&&qo.value&&a.podSingleFreeAvailable),dd=async()=>{try{const n=await Wn({businessType:"pod_material"});if(n&&n.data){ao.value=n.data,a.podMaterialOptions=ao.value;const s=tn(T.query[ya]),v=(s==null?void 0:s.type)==="podMode"?s.value:Array.isArray(T.query.podMode)?T.query.podMode[0]:T.query.podMode;if(v&&!di.value){const C=ao.value.find(M=>M.value==v);if(di.value=!0,C){a.podMaterialParams.podMaterialMode=C.value,a.podMaterialParams.modelSkuId=C.id,en();const M={...T.query};delete M.podMode,delete M[ya],await G.replace({path:T.path,query:M}),a.aiMessageType=="POD_MATERIAL"&&Ka.value&&a.getEstimatedPoints();return}}md(),a.aiMessageType=="POD_MATERIAL"&&Ka.value&&a.getEstimatedPoints()}}catch{}},Ii=async()=>{try{const n=await Wn({businessType:"image"});n&&n.data&&(Ia.value=n.data,a.imageOptions=Ia.value,ki(),await pd(),a.getEstimatedPoints())}catch{}},pd=async()=>{const n=tn(T.query[ya]),s=(n==null?void 0:n.type)==="mainImageWisdomUseWay"?n.value:null,v=typeof s=="string"?Wf[s]||s:null;if(!v||ri.value)return;const C=Ia.value.find(M=>M.value==="WISDOM_GENERATION"&&(M==null?void 0:M.frontHide)!=1);if(C){ri.value=!0,a.mainImageChatMode=C.value,a.imageGenerateParams.currentImageActiveId=C.id,a.imageGenerateParams.isFree=C.isFree;try{const{code:M,success:A,payload:ee}=await Rl("IMAGE_USE_WAY");if(M===200&&A&&Array.isArray(ee)){const pe=ee.find(Le=>(Le==null?void 0:Le.name)===v);pe&&await ts(pe)}}finally{const M={...T.query};delete M[ya],await G.replace({path:T.path,query:M})}}},Ci=async()=>{try{const n=await Wn({businessType:"ecommerce-poster"});if(n&&n.data){un.value=n.data,a.posterImageOptions=un.value;const s=T.query.id||T.query.taskId;if(s){let M=un.value.find(ee=>ee.id==s&&(ee==null?void 0:ee.frontHide)!=1);if(M){a.longImageChatMode=M.value,a.getEstimatedPoints();return}let A=un.value.find(ee=>ee.value==s&&(ee==null?void 0:ee.frontHide)!=1);if(A){a.longImageChatMode=A.value,a.getEstimatedPoints();return}}const v=tn(T.query[ya]),C=(v==null?void 0:v.type)==="detailImageMode"?v.value:Array.isArray(T.query.modeValue)?T.query.modeValue[0]:T.query.modeValue;if(C&&!ci.value){let M=un.value.find(A=>A.value==C&&(A==null?void 0:A.frontHide)!=1);if(ci.value=!0,M){a.longImageChatMode=M.value;const A={...T.query};delete A.modeValue,delete A[ya],await G.replace({path:T.path,query:A}),a.getEstimatedPoints();return}}if(!a.longImageChatMode){const M=localStorage.getItem("longImageDetailModel"),A=n.data.filter(ee=>ee.frontHide!=1).find(ee=>ee.value===M||ee.defaultModel&&ee.sort===0);a.longImageChatMode=A==null?void 0:A.value}a.getEstimatedPoints()}}catch{}},md=()=>{var n;if((n=ao.value)!=null&&n.length){if(a.podMaterialParams.podMaterialMode){en();return}const s=ao.value.find(v=>v.defaultModel);s&&(a.podMaterialParams.podMaterialMode=s.value,a.podMaterialParams.modelSkuId=s.id,en())}},ki=async()=>{var n;if(Ia.value){const s=T.query.otherFreeId||T.query.id||T.query.taskId;if(s&&!ii.value){let M=Ia.value.find(A=>A.id==s&&(A==null?void 0:A.frontHide)!=1);ii.value=!0,M&&(a.mainImageChatMode=M.value,a.imageGenerateParams.currentImageActiveId=M.id,M.value==="SKU_G
135ENERATION"&&(Sn(),Xo()))}let v=null;a.mainImageChatMode&&(v=Ia.value.find(M=>M.value==a.mainImageChatMode&&(M==null?void 0:M.frontHide)!=1));let C=Ia.value.filter(M=>M.frontHide!=1).find(M=>M.defaultModel&&M.sort===0);if(v||C||a.imageGenerateParams.otherFreeSkuId){a.imageGenerateParams.currentImageActiveId=(v==null?void 0:v.id)||(C==null?void 0:C.id);let M=Ia.value.find(A=>A.id==a.imageGenerateParams.currentImageActiveId);M&&(a.mainImageChatMode=M.value,a.imageGenerateParams.isFree=M.isFree),M&&await Mr(),!dn.value&&a.imageGenerateParams.isFree&&((n=x.value)!=null&&n.defaultVip)&&Eo.value&&(Wp()?co():a.imageGenerateParams.imageCount=1,a.imageGenerateParams.quality="1K")}else if(!a.mainImageChatMode){let M=Ia.value.filter(A=>A.frontHide!=1).find(A=>A.defaultModel&&A.sort===0);a.mainImageChatMode=M==null?void 0:M.value,a.imageGenerateParams.currentImageActiveId=M==null?void 0:M.id}}},gd=async()=>{const n=tn(T.query[ya]),s=(n==null?void 0:n.type)==="adMaterialType"?n.value:Array.isArray(T.query.materialType)?T.query.materialType[0]:T.query.materialType;if(!s||ui.value||s!=="image"&&s!=="video")return;ui.value=!0,a.setAdMaterialMaterialType(s);const v={...T.query};delete v.materialType,delete v[ya],await G.replace({path:T.path,query:v})},fd=async()=>{const n=tn(T.query[ya]),s=(n==null?void 0:n.type)==="translationPackage"?n.value:Array.isArray(T.query.translationPackage)?T.query.translationPackage[0]:T.query.translationPackage;if(!s||pi.value)return;const v=Number(s);if(![1,2,3].includes(v))return;pi.value=!0,a.longVideoParams.translationPackage=v;const C={...T.query};delete C.translationPackage,delete C[ya],await G.replace({path:T.path,query:C})};Ne(()=>[st.value,a.aiMessageType],()=>{if(!Yt.value){Ot.value=!1;return}let n="";try{H&&H.value&&typeof gn=="function"&&(n=gn(H.value)||"")}catch{n=""}Ot.value=!((""+n).trim().length>0),Ot.value||ye("update:isExpand",!0)},{immediate:!0,deep:!0}),Ne(()=>a.portraitCheckFailImages,n=>{Ie.value=!!(Array.isArray(a.portraitCheckFailImages)&&a.portraitCheckFailImages.length)},{immediate:!0,deep:!0});const wn={default:{type:"default",placeholder:d("components.AIChatInput.950192-12"),color:"#E3F2FD",key:d("components.AIChatInput.950192-13")}},wi=go.create({name:"templateNode",group:"inline",inline:!0,selectable:!0,atom:!1,content:"text*",addAttributes(){return{type:{default:"default",parseHTML:n=>n.getAttribute("data-type")||"default",renderHTML:n=>({"data-type":n.type})},placeholder:{default:"",parseHTML:n=>n.getAttribute("data-placeholder")||"",renderHTML:n=>({"data-placeholder":n.placeholder})},key:{default:"",parseHTML:n=>n.getAttribute("data-key")||"",renderHTML:n=>({"data-key":n.key})}}},parseHTML(){return[{tag:"span.template-node",getAttrs:n=>{if(typeof n=="string")return{};const s=n;return{type:s.getAttribute("data-type")||"default",placeholder:s.getAttribute("data-placeholder")||"",key:s.getAttribute("data-key")||""}}}]},renderHTML({HTMLAttributes:n,node:s}){const v=n.type||"default",C=n.key||"",M=!s.textContent,A=wn.default;let ee=["template-node"];return M&&ee.push("template-node-empty"),["span",{class:ee,"data-type":v,style:`background-color: ${A.color}; padding: 2px 4px; border-radius: 4px; cursor: text;`,"data-placeholder":M?A.placeholder:"","data-key":C},["span",{class:"template-node-content"},0]]},addNodeView(){return({node:n,editor:s,getPos:v})=>{const C=document.createElement("span"),M=n.attrs.type||"default",A=n.attrs.key||"",ee=wn.default,pe=n.attrs.placeholder||ee.placeholder;C.className="template-node",(!n.content||n.content.size===0)&&C.classList.add("template-node-empty"),C.setAttribute("data-type",M),C.setAttribute("data-placeholder",pe),C.setAttribute("data-key",A),C.style.backgroundColor=ee.color,C.style.padding="2px 4px",C.style.borderRadius="4px",C.style.cursor="text",C.style.position="relative",C.style.display="inline-block";const Le=document.createElement("span");return Le.className="template-node-content",Le.style.position="relative",Le.style.lineHeight="18px",Le.style.zIndex="1",Le.style.minWidth="4px",Le.style.display="inline-block",C.appendChild(Le),{dom:C,contentDOM:Le,update:ze=>{if(ze.type.name!==wi.name)return!1;ze.attrs.type;const Ze=ze.attrs.placeholder||wn.default;return!ze.content||ze.content.size===0?(C.classList.add("template-node-empty"),C.setAttribute("data-placeholder",ze.attrs.placeholder||Ze.placeholder)):(C.classList.remove("template-node-empty"),C.removeAttribute("data-placeholder")),!0},destroy(){}}}},addKeyboardShortcuts(){return{Backspace:()=>{const{empty:n,$anchor:s}=this.editor.state.selection;return n&&s.parent.type.name===this.name&&s.parentOffset===0?this.editor.commands.deleteNode(this.name):!1}}}}),Za=n=>{var s;return((s=n==null?void 0:n.type)==null?void 0:s.name)==="suiteTemplateVariable"},Ws=n=>{var s;return!((s=n==null?void 0:n.content)!=null&&s.size)},vd=()=>a.aiMessageType==="LINKPIX"&&O(a.imageGenerateUseWay.useWayData),Oo=()=>vd(),hd=()=>a.aiMessageType==="LINKPIX"&&!!a.imageGenerateUseWay.useWayData,No=()=>hd(),so=()=>
135a.aiMessageType==="LINKPIX"?a.mainImageChatMode==="SKU_GENERATION":a.isDetailImg?a.longImageChatMode==="SKU_GENERATION":a.aiMessageType==="AD_MATERIAL"&&a.adMaterialParams.materialType==="image",pn=()=>No()||so(),Ro=n=>{const{$from:s,$to:v}=n;return s.parent===v.parent&&Za(s.parent)},js=n=>{const{doc:s,selection:v}=n,C=v.node;if(C&&Za(C))return so();if(v.empty||Ro(v))return!1;let M=!1;return s.nodesBetween(v.from,v.to,A=>Za(A)?(M=!0,!1):!M),M&&so()},Pi=(n,s="")=>{const{selection:v,tr:C}=n.state;if(!Ro(v))return!1;const M=ia(s||"").replace(/\n+/g," ");return C.insertText(M,v.from,v.to),n.dispatch(C.scrollIntoView()),!0},Mi=(n,s)=>{if(!pn())return!1;const{doc:v,selection:C}=n.state,M=C.node;if(M&&Za(M))return so();if(!C.empty){const{$from:ee,$to:pe,from:Le,to:ze}=C;if(Ro(C)){if(Le===ee.start()&&ze===ee.end()){if(No())return!1;const ht=n.state.tr.delete(Le,ze);return ht.setSelection(rs.near(ht.doc.resolve(ee.start()))),n.view.dispatch(ht.scrollIntoView()),!0}return!1}let Ze=!1;return v.nodesBetween(Le,ze,ht=>Za(ht)?(Ze=!0,!1):!Ze),Ze&&so()}const{$from:A}=C;if(Za(A.parent)){const ee=A.start(),pe=A.parent.content.size,Le=s==="Backspace"?A.parentOffset===0:A.parentOffset===pe;if(!pe){if(!No())return!0;const ht=n.state.tr.delete(ee-1,ee+pe+1);return n.view.dispatch(ht.scrollIntoView()),!0}if(Le)return!0;if(pe!==1)return!1;const ze=n.schema.nodes.suiteTemplateVariable.create({...A.parent.attrs}),Ze=n.state.tr.replaceWith(ee-1,ee+pe+1,ze);return Ze.setSelection(rs.near(Ze.doc.resolve(ee))),n.view.dispatch(Ze.scrollIntoView()),!0}return Za(s==="Backspace"?A.nodeBefore:A.nodeAfter)},_d=go.create({name:"suiteTemplateVariable",group:"inline",inline:!0,content:"text*",atom:!1,selectable:!1,addAttributes(){return{placeholder:{default:"",parseHTML:n=>n.getAttribute("data-placeholder")||"",renderHTML:n=>({"data-placeholder":n.placeholder})}}},parseHTML(){return[{tag:"span.suite-template-variable"}]},renderHTML({HTMLAttributes:n,node:s}){return["span",{...n,class:`suite-template-variable${Ws(s)?" is-empty":""}`},["span",{class:"suite-template-variable-content"},0]]},addNodeView(){return({node:n,editor:s,getPos:v})=>{const C=document.createElement("span"),M=document.createElement("span");let A=n;const ee=()=>{const dt=Oo();C.classList.toggle("is-disabled",dt),M.contentEditable=dt?"false":"true"},pe=()=>{const dt=typeof v=="function"?v():null;if(typeof dt!="number")return!1;const Mt=s.schema.nodes.suiteTemplateVariable.create({...A.attrs}),Xt=s.state.tr.replaceWith(dt,dt+A.nodeSize,Mt);return Xt.setSelection(rs.near(Xt.doc.resolve(dt+1))),s.view.dispatch(Xt.scrollIntoView()),!0},Le=()=>{const dt=typeof v=="function"?v():null;if(typeof dt!="number")return!1;const Mt=s.state.tr.delete(dt,dt+A.nodeSize);return s.view.dispatch(Mt.scrollIntoView()),!0},ze=dt=>{const Mt=dt.inputType,Xt=dt.key,La=Mt==="deleteContentBackward"||Mt==="deleteContentForward"||Xt==="Backspace"||Xt==="Delete";
135return!pn()||!La?!1:A.content.size?A.content.size!==1?!1:(dt.preventDefault(),dt.stopPropagation(),pe()):(dt.preventDefault(),dt.stopPropagation(),No()?Le():!0)},Ze=dt=>{var Xt;if(!pn()||Oo())return!1;const Mt=((Xt=dt.clipboardData)==null?void 0:Xt.getData("text/plain"))||"";return dt.preventDefault(),dt.stopPropagation(),Mt?Pi(s.view,Mt):!0},ht=dt=>{if(Oo())return dt.preventDefault(),dt.stopPropagation(),!0;if(A.content.size)return!1;const Mt=typeof v=="function"?v():null;return typeof Mt!="number"?!1:(dt.preventDefault(),dt.stopPropagation(),requestAnimationFrame(()=>{var vn;const Xt=typeof v=="function"?v():Mt;if(typeof Xt!="number")return;const La=Xt+1;try{const ss=s.state.tr.setSelection(rs.create(s.state.doc,La));s.view.dispatch(ss.scrollIntoView()),s.view.focus();const Un=(vn=window.getSelection)==null?void 0:vn.call(window);if(Un){const Pt=document.createRange();Pt.selectNodeContents(M),Pt.collapse(!1),Un.removeAllRanges(),Un.addRange(Pt)}}catch{s.chain().focus().setTextSelection(La).run()}}),!0)};return C.className="suite-template-variable",C.setAttribute("data-placeholder",n.attrs.placeholder||""),Ws(n)&&C.classList.add("is-empty"),M.className="suite-template-variable-content",M.setAttribute("data-placeholder",n.attrs.placeholder||""),C.appendChild(M),ee(),C.addEventListener("pointerdown",ht),C.addEventListener("mousedown",ht),C.addEventListener("click",ht),M.addEventListener("beforeinput",ze),M.addEventListener("keydown",ze),M.addEventListener("paste",Ze),{dom:C,contentDOM:M,update:dt=>dt.type.name!=="suiteTemplateVariable"?!1:(A=dt,C.setAttribute("data-placeholder",dt.attrs.placeholder||""),M.setAttribute("data-placeholder",dt.attrs.placeholder||""),C.classList.toggle("is-empty",Ws(dt)),ee(),!0),stopEvent:dt=>Oo()&&["pointerdown","mousedown","click","beforeinput","paste","cut"].includes(dt.type)?!0:!A.content.size&&["pointerdown","mousedown","click"].includes(dt.type),destroy(){C.removeEventListener("pointerdown",ht),C.removeEventListener("mousedown",ht),C.removeEventListener("click",ht),M.removeEventListener("beforeinput",ze),M.removeEventListener("keydown",ze),M.removeEventListener("paste",Ze)}}}},addKeyboardShortcuts(){return{Backspace:()=>Mi(this.editor,"Backspace"),Delete:()=>Mi(this.editor,"Delete")}}}),yd=(n,s)=>!1,Si=()=>({type:"text",text:vs}),xd=(n={})=>n.type==="material_image"||n.type==="character"||n.dataType==="video"||n.dataType==="audio",Wa=n=>{var s;return((s=n==null?void 0:n.type)==null?void 0:s.name)==="mention"&&xd(n.attrs||{})},Fo=n=>{var s,v,C;return((s=n==null?void 0:n.type)==null?void 0:s.name)==="mention"&&(((v=n.attrs)==null?void 0:v.dataType)==="video"||((C=n.attrs)==null?void 0:C.type)==="video")},Hs=n=>(n==null?void 0:n.isText)&&/^[\s\u00A0]/.test(n.text||""),Go=(n,s)=>{if(s<0||s>n.content.size)return 0;const v=n.resolve(s).nodeAfter;return Hs(v)?1:0},bd=(n,s)=>{const{doc:v,selection:C}=n,M=C.node;if(M&&Wa(M))return{from:C.from,to:Math.min(C.to+Go(v,C.to),v.content.size)};if(!C.empty)return null;const{$from:A}=C,ee=A.nodeBefore,pe=A.nodeAfter;if(s==="Backspace"){if(Wa(ee))return{from:A.pos-ee.nodeSize,to:Math.min(A.pos+Go(v,A.pos),v.content.size)};const Le=A.pos-1;if(Le<0)return null;const ze=v.textBetween(Le,A.pos);if(!/^[\s\u00A0]$/.test(ze))return null;const Ze=v.resolve(Le).nodeBefore;return Wa(Ze)?{from:Le-Ze.nodeSize,to:A.pos}:null}if(Wa(pe)){const Le=A.pos+pe.nodeSize;return{from:A.pos,to:Math.min(Le+Go(v,Le),v.content.size)}}return Wa(ee)&&Hs(pe)?{from:A.pos-ee.nodeSize,to:Math.min(A.pos+1,v.content.size)}:null},Id=(n,s)=>{const v=bd(n.state,s);return!v||v.from<0||v.to<=v.from?!1:(n.dispatch(n.state.tr.delete(v.from,v.to).scrollIntoView()),!0)},Cd=n=>{if(!H.value)return!1;const{doc:s,selection:v}=n.state;if(!v.empty)return!1;const{$from:C}=v,M=C.nodeBefore;if(Fo(M)){const ze=C.pos-M.nodeSize;return ze<0?!1:(H.value.commands.setTextSelection(ze),!0)}const A=C.pos-1;if(A<0||s.textBetween(A,C.pos)!==vs)return!1;const pe=s.resolve(A).nodeBefore;if(!Fo(pe))return!1;const Le=A-pe.nodeSize;return Le<0?!1:(H.value.commands.setTextSelection(Le),!0)},kd=n=>{if(!H.value)return!1;const{doc:s,selection:v}=n.state;if(!v.empty)return!1;const{$from:C}=v,M=C.nodeAfter;if(!Fo(M)){const Le=C.nodeBefore;
135return Fo(Le)&&s.textBetween(C.pos,C.pos+1)===vs?(H.value.commands.setTextSelection(C.pos+1),!0):!1}const A=C.pos+M.nodeSize;if(A>s.content.size)return!1;const ee=Go(s,A);if(ee>0)return H.value.commands.setTextSelection(A+ee),!0;const pe=s.resolve(A).nodeAfter;return pe!=null&&pe.isText?(H.value.commands.setTextSelection(A),!0):Js(A)},Js=n=>{if(!H.value||Vo)return!1;const{state:s}=H.value;if(n<0||n>s.doc.content.size)return!1;Vo=!0;try{const C=s.doc.resolve(n).nodeAfter;return Hs(C)?(H.value.commands.setTextSelection(n+1),!0):(C!=null&&C.isText||H.value.chain().insertContentAt(n,Si()).setTextSelection(n+1).run(),!0)}finally{requestAnimationFrame(()=>{Vo=!1})}},Ys=n=>{H.value&&H.value.chain().focus().insertContent([{type:"mention",attrs:n},Si()]).run()};let Vo=!1;const Qs=(n=!1)=>{if(!H.value||Vo)return;const{state:s}=H.value,{selection:v}=s;if(!v.empty)return;const{$from:C}=v,M=C.nodeBefore,A=C.nodeAfter;let ee=-1;n&&Wa(A)?ee=C.pos+A.nodeSize:Wa(M)&&!(A!=null&&A.isText)&&(ee=C.pos),!(ee<0)&&Js(ee)},wd=n=>{if(!H.value||!n)return;const s=H.value.view,v=H.value.state;let C=-1;try{C=s.posAtDOM(n,0)}catch{Qs(!0);return}const M=[C,C-1,C+1];for(const A of M){if(A<0||A>v.doc.content.size)continue;const ee=v.doc.nodeAt(A);if(Wa(ee)){Js(A+ee.nodeSize);return}}Qs(!0)},Pd=tf.extend({name:"mention",addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),type:{default:"mention",parseHTML:s=>s.getAttribute("data-type")||"mention",renderHTML:s=>({"data-type":s.type})},real:{default:null,parseHTML:s=>s.getAttribute("data-real"),renderHTML:s=>s.real?{"data-real":s.real}:{}},imageUrl:{default:null,parseHTML:s=>s.getAttribute("data-image-url"),renderHTML:s=>s.imageUrl?{"data-image-url":s.imageUrl}:{}},characterId:{default:null,parseHTML:s=>s.getAttribute("data-character-id"),renderHTML:s=>s.characterId?{"data-character-id":s.characterId}:{}},dataType:{default:null,parseHTML:s=>s.getAttribute("data-media-type")||s.getAttribute("data-data-type"),renderHTML:s=>s.dataType?{"data-media-type":s.dataType}:{}},url:{default:null,parseHTML:s=>s.getAttribute("data-url"),renderHTML:s=>s.url?{"data-url":s.url}:{}},fileName:{default:null,parseHTML:s=>s.getAttribute("data-file-name"),renderHTML:s=>s.fileName?{"data-file-name":s.fileName}:{}}}},renderHTML({node:n,HTMLAttributes:s}){if(n.attrs.type==="material_image"&&n.attrs.imageUrl){const M=document.createElement("img");M.src=n.attrs.imageUrl,M.style.cssText="width:32px;height:32px;border-radius:4px;object-fit:cover;vertical-align:middle;",M.alt="",M.draggable=!1;const A=document.createElement("span");return Object.entries(s).forEach(([ee,pe])=>{pe!=null&&A.setAttribute(ee,String(pe))}),A.classList.add("mention","mention-material-image"),A.setAttribute("data-type","material_image"),A.setAttribute("data-image-url",n.attrs.imageUrl||""),A.setAttribute("data-character-id",n.attrs.characterId||""),A.setAttribute("data-id",n.attrs.id||""),A.setAttribute("contenteditable","false"),A.appendChild(M),A}const v=n.attrs.dataType;if(v==="video"){const M=n.attrs.url,A=document.createElement("span");Object.entries(s).forEach(([Le,ze])=>{ze!=null&&A.setAttribute(Le,String(ze))}),A.classList.add("mention","mention-video"),A.setAttribute("data-type",v),A.setAttribute("data-media-type",v),A.setAttribute("data-id",n.attrs.id),A.setAttribute("data-url",M),A.setAttribute("data-file-name",n.attrs.fileName),A.setAttribute("contenteditable","false");const ee=document.createElement("video");ee.src=M,ee.className="mention-video-preview",ee.muted=!0,ee.preload="metadata",ee.playsInline=!0;const pe=document.createElement("span");return pe.className="mention-video-play",pe.textContent="â¶",A.appendChild(ee),A.appendChild(pe),A}if(v==="audio"){const M=n.attrs.fileName,A=n.attrs.url,ee=document.createElement("span");Object.entries(s).forEach(([ze,Ze])=>{Ze!=null&&ee.setAttribute(ze,String(Ze))}),ee.classList.add("mention","mention-media",`mention-${v}`),ee.setAttribute("data-type",v),ee.setAttribute("data-media-type",v),ee.setAttribute("data-id",n.attrs.id),ee.setAttribute("data-url",A),ee.setAttribute("data-file-name",n.attrs.fileName),ee.setAttribute("data-file-size",n.attrs.fileSize),ee.setAttribute("contenteditable","false");const pe=document.createElement("img");pe.src=Vl,pe.className="mention-media-icon",pe.alt="",pe.draggable=!1;const Le=document.createElement("span");return Le.className="mention-media-label",Le.textContent=`@ ${M}
135`,ee.appendChild(pe),ee.appendChild(Le),ee}const C=n.attrs.label?`@${n.attrs.label}`:"";return["span",{...s,class:"mention"},C]},addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),HTMLAttributes:{class:"mention"},renderLabel({node:s}){return s.attrs.type==="material_image"&&s.attrs.imageUrl?"":s.attrs.label?`@${s.attrs.label}`:""},suggestion:{renderLabel({node:s}){return s.attrs.type==="material_image"&&s.attrs.imageUrl?"":s.attrs.label?`@${s.attrs.label}`:""}}}}}),Pn=n=>n?new TextEncoder().encode(n).length:0,$i=n=>{Ce.value=Pn(n)},Ti=()=>J.value||0,Ai=()=>{if(a.aiMessageType=="LINKPIX")return a.mainImageChatMode==="SKU_GENERATION"?"ä¸ä¼ 主å¾ï¼èªå¨çææç¤ºè¯æ¨¡æ¿ã":d("components.AIChatInput.849692-5");if(a.aiMessageType=="IMAGETOVIDEO")return a.videoChatMode==="NOOB"?d("components.AIChatInput.849692-23"):"å¦éèªå¨è¯å«ååå¾çææç¤ºè¯ï¼è¯·å¨ä¸æ¹âæç¤ºè¯â夿å¼";if(a.aiMessageType=="LONGIMAGE")return a.longImageChatMode==="SKU_GENERATION"?"ä¸ä¼ ç´ æå¾ï¼èªå¨çææç¤ºè¯æ¨¡æ¿ã":d("components.AIChatInput.849692-7");if(a.aiMessageType=="POSTERIMAGE")return d("components.AIChatInput.849692-8");if(a.aiMessageType=="AD_MATERIAL")return a.adMaterialParams.materialType==="image"?"ä¸ä¼ 主å¾ï¼èªå¨çææç¤ºè¯æ¨¡æ¿ã":a.adMaterialParams.generatePrompt===!1?"å¦éèªå¨è¯å«ååå¾çææç¤ºè¯ï¼è¯·å¨ä¸æ¹âæç¤ºè¯â夿å¼":d("components.AIChatInput.849692-23");if(a.aiMessageType=="POD_MATERIAL"){if(a.podMaterialParams.podMaterialMode==="STAMP_EXTRACT")return d("components.AIChatInput.930519-0");if(a.podMaterialParams.podMaterialMode==="STAMP_APPLY")return Bs()?"åå°è±å¾ï¼
135æ¹éè´´åå°å¤å¼ 产åå¾ä¸":d("components.AIChatInput.930519-1");if(a.podMaterialParams.podMaterialMode==="STAMP_FISSION")return d("components.AIChatInput.930519-2")}return a.aiMessageType=="SOCIALMEDIA"?d("components.AIChatInput.849692-9"):a.aiMessageType=="VIDEO_TRANSLATION"?d("components.AIChatInput.849692-99"):_e.placeholder},Md=()=>{tt(()=>{var n,s;!((n=H.value)!=null&&n.view)||!((s=H.value)!=null&&s.state)||H.value.view.dispatch(H.value.state.tr.setMeta("refreshPlaceholder",Date.now()))})},Sd=go.create({name:"rawCustomTooltipLabel",inline:!0,group:"inline",content:"inline*",atom:!0,addAttributes(){return{props:{default:{},parseHTML:n=>{const s=n.getAttribute("data-props");try{return s?JSON.parse(s):{}}catch{return{}}},renderHTML:n=>({"data-props":JSON.stringify(n.props||{})})}}},parseHTML(){return[]},renderHTML({HTMLAttributes:n}){return["div",{...n,"data-raw-html-inline":""}]},addNodeView(){return xl(F$)}}),$d=go.create({name:"promptLockIcon",inline:!0,group:"inline",atom:!0,selectable:!1,parseHTML(){return[{tag:"span.prompt-lock-icon"}]},renderHTML(){return["span",{class:"prompt-lock-icon",contenteditable:"false"}]},addNodeView(){return xl(V$)}}),Td=go.create({name:"promptLockPlaceholder",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{text:{default:"",parseHTML:n=>n.getAttribute("data-text")||n.textContent||"",renderHTML:n=>({"data-text":n.text||""})}}},parseHTML(){return[{tag:"span.prompt-lock-placeholder"}]},renderHTML({HTMLAttributes:n}){return["span",{...n,class:"prompt-lock-placeholder",contenteditable:"false"},n["data-text"]||""]},addNodeView(){return xl(j$)}}),Xs=n=>{H.value&&H.value.destroy(),mo=[],ge.value=!0,H.value=new sf({extensions:[lf,Pd,rf.configure({emptyEditorClass:"is-editor-empty",placeholder:({editor:v})=>{let C=!1;return v.state.doc.descendants(M=>M.type.name==="rawCustomTooltipLabel"?(C=!0,!1):!0),C?"":Ai()}}),wi,_d,cf,Sd,Td,$d],content:ia(_e.messageInput||n||"").replace(/\n/g,"<br/>"),onUpdate:({editor:v})=>{st.value=v.getHTML();const C=gn(v);$i(C),ye("update:messageInput",C)},onSelectionUpdate:()=>{Qs()},autofocus:"end",editable:!0,injectCSS:!1,onCreate({editor:v}){const C=M=>{var A;if(v.isEditable&&!(M.key!=="Enter"||M.ctrlKey||M.metaKey)){M.preventDefault(),typeof M.stopImmediatePropagation=="function"?M.stopImmediatePropagation():M.stopPropagation();try{const ee=(A=v.state.schema.nodes.hardBreak)==null?void 0:A.create(),pe=ee?v.state.tr.replaceSelectionWith(ee).doc:null;if(pe&&(Ui(Mn(pe.toJSON()))||Li(Mn(pe.toJSON()))||Zs(pe)))return;v.chain&&typeof v.chain=="function"?v.chain().focus().insertContent({type:"hardBreak"}).run():v.commands&&typeof v.commands.insertContent=="function"?(v.commands.insertContent({type:"hardBreak"}),v.commands.focus()):(v.commands.insertContent("<br>"),v.commands.focus())}catch{try{v.commands.insertContent("<br>"),v.commands.focus()}catch{}}}};v.view.dom.addEventListener("keydown",C,!0),v.__ai_input_enter_handler=C},editorProps:{handleKeyDown(v,C){const M=!C.shiftKey&&!C.altKey&&!C.metaKey&&!C.ctrlKey;return M&&C.key==="ArrowLeft"?Cd(v)?(C.preventDefault(),!0):!1:M&&C.key==="ArrowRight"?kd(v)?(C.preventDefault(),!0):!1:C.key!=="Backspace"&&C.key!=="Delete"?!1:Id(v,C.key)?(C.preventDefault(),!0):!1},handleTextInput(v,C,M,A){if(pn()&&A&&C!==M&&js(v.state))return!0;if(!A)return!1;const ee=v.state.tr.insertText(A,C,M).doc,pe=Mn(ee.toJSON());return Ui(pe)||Li(pe)?!0:Zs(ee)},handlePaste(v,C,M){const A=Ud(M);if(pn()&&Ro(v.state.selection))return Pi(v,A);if(pn()&&js(v.state))return!0;const ee=Ti(),pe=ia(A);if(!A){if(a.aiMessageType!="IMAGETOVIDEO"||!ee)return!1;const Mt=v.state.tr.replaceSelection(M).doc,Xt=Zs(Mt);return Xt&&Ei(ee,!1),Xt}if(!pe)return!0;if(a.aiMessageType!="IMAGETOVIDEO"||!ee)return pe!==A?(el(pe),!0):!1;const{from:Le,to:ze}=v.state.selection,Ze=Le===ze?v.state.doc:v.state.tr.deleteRange(Le,ze).doc,ht=ee-Pn(ia(Mn(Ze.toJSON())));if(Pn(pe)<=ht)return pe!==A?(el(pe),!0):!1;const dt=Ld(pe,ht);return Ei(ee,!!dt),dt&&el(dt),!0},handleDOMEvents:{cut:(v,C)=>!pn()||!js(v.state)?!1:(C.preventDefault(),!0),beforeinput:(v,C)=>{var A,ee;const M=C;return An.value||a.aiMessageTypes.includes(X.value||"")?!1:M.inputType==="insertText"&&M.data==="@"&&!(((A=H.value)==null?void 0:A.state.doc.textBetween(0,H.value.state.doc.
135content.size,` 136`))||"").includes("@")&&!Se.value?(M.preventDefault(),nt.value=!0,!0):M.inputType==="insertText"&&M.data==="#"&&!(((ee=H.value)==null?void 0:ee.state.doc.textBetween(0,H.value.state.doc.content.size,` 137`))||"").includes("#")?(M.preventDefault(),se.value.popoverVisible=!0,!0):!1}}}});const s=H.value.setEditable.bind(H.value);H.value.setEditable=(v,C)=>(ge.value=v,s(v,C)),ge.value=H.value.isEditable,tt(()=>{H.value&&(H.value.commands.focus("end"),H.value.commands.setTextSelection(H.value.state.doc.content.size),H.value.isEditable||H.value.setEditable(!0),setTimeout(()=>{var C;const v=(C=at.value)==null?void 0:C.querySelector(".ProseMirror");v&&v.addEventListener("click",()=>{var M;(M=H.value)==null||M.commands.focus()})},200))}),_p(),bm()},Mn=n=>{let s="";const v=M=>{let A="";return M.content&&M.content.length>0&&M.content.forEach(ee=>{ee.type==="text"&&(A+=ee.text)}),A.trim()},C=M=>{var A,ee;if(M.type==="text")s+=(M.text||"").replaceAll(vs," ");else if(M.type==="mention"){const pe=Ed(M.attrs);typeof pe=="object"&&pe!==null?s+=`[@${JSON.stringify(pe)}]`:typeof pe=="string"&&(s+=pe)}else if(M.type==="suiteTemplateVariable")s+=`ã${v(M)}ã`;else if(M.type==="templateNode")s+=v(M);else if(M.type==="customBox")s+=((A=M.attrs)==null?void 0:A.rawHtml)||"";else if(M.type==="hardBreak")s+=` 138`;else if(M.type==="promptLockPlaceholder")s+=((ee=M.attrs)==null?void 0:ee.text)||"";else{if(M.type==="promptLockIcon")return;M.content&&M.content.forEach(C)}};return n.content&&n.content.forEach((M,A)=>{A>0&&M.type==="paragraph"&&(s+=` 139`),C(M)}),s},ia=(n="")=>{const s=" ".repeat(yD);return String(n||"").replace(/\r\n?/g,` 140`).replace(/\n{2,}/g,` 141`).replace(/ {51,}/g,s).trim()},Ad=(n="")=>{const s=String(n||"").replace(/<br\s*\/?>/gi,` 142`).replace(/<\/(p|div|li|h[1-6])>\s*<\1[^>]*>/gi,` 143`).replace(/<\/(p|div|li|h[1-6])>/gi,` 144`).replace(/<[^>]+>/g,"");if(typeof document>"u")return ia(s);const v=document.createElement("textarea");return v.innerHTML=s,ia(v.value)},Ui=(n="")=>/\n{2,}/.test(String(n||"").replace(/\r\n?/g,` 145`)),Li=(n="")=>/ {51,}/.test(String(n||"")),mn=(n="")=>ia(n).replace(/\n/g,"<br/>"),ja=(n="")=>{const s=ia(n);return H.value.commands.setContent(mn(s)),st.value=s,s},gn=n=>ia(Mn(n.getJSON())),Zs=n=>{const s=Ti();if(a.aiMessageType!="IMAGETOVIDEO"||!s||!n)return!1;try{const v=ia(Mn(n.toJSON()));return Pn(v)>s}catch{return!1}},Ud=n=>{var s;return(((s=n==null?void 0:n.content)==null?void 0:s.textBetween(0,n.content.size,` 146`))||"").replace(/\r\n?/g,` 147`)},Ld=(n,s)=>{if(!n||s<=0)return"";let v="",C=0;for(const M of n){const A=Pn(M);if(C+A>s)break;v+=M,C+=A}return v},el=n=>{if(!H.value||!n)return;const s=[];n.split(` 148`).forEach((v,C)=>{C>0&&s.push({type:"hardBreak"}),v&&s.push({type:"text",text:v})}),s.length&&H.value.commands.insertContent(s)},Ei=(n,s)=>{qe.warning(s?d("components.AIChatInput.605011-9",[n]):d("components.AIChatInput.605011-11",[n]))},Ed=n=>{var s,v;if(n.type=="material_image"){const C={type:n.type||"",id:n.id||"",title:n.label||"",imageUrl:n.imageUrl||"",characterId:n.characterId||"",dataType:n.characterId?"character":"image"};return n.characterId&&(C.isCharacter=!0),C}else{if(n.type=="character")return{type:n.type||"",id:n.id||"",title:n.label||"",real:n.real};if(["audio","video"].includes(n.dataType)){const C=n.dataType;return{type:C,dataType:C,id:n.id,title:n.fileName,url:n.url,fileName:n.fileName}}else return n.id=="intelligent-agent"?{...((s=$e.value)==null?void 0:s.originData)||{},id:n.id||"",title:n.label||""}:(v=n==null?void 0:n.id)!=null&&v.includes("title")?n.label+"ï¼"||"":`<span class="mention" data-type="${n.type}">${n.label}</span>`}},qi=n=>{H.value&&at.value&&at.value.contains(n.target)&&H.value.commands.focus()},qd=n=>
148{if(!n)return"";const s=/\[@(\{.*?\})\]/g;let v=n.replace(s,(M,A)=>{try{const ee=JSON.parse(A),pe=ee.id||"",Le=ee.type||"user",ze=ee.title||"",Ze=ee.key||"";let ht=`data-type="mention" data-mention-id="${pe}" data-mention-type="${Le}" data-mention-keye="${Ze}" data-mention-label="${ze}"`;return Object.keys(ee).forEach(dt=>{["id","type","title","key"].includes(dt)||(ht+=` data-${dt}="${ee[dt]}"`)}),`<span ${ht} class="mention">${ze}</span>`}catch{return M}});const C=/<span class="template-node" data-type="([^"]+)"(?: data-placeholder="([^"]*)")?>([^<]*)<\/span>/g;return v=v.replace(C,(M,A,ee,pe,Le)=>{var dt;const ze=A in wn?A:"default",Ze=ee in wn?ee:"",ht=pe||((dt=wn[ze])==null?void 0:dt.placeholder)||"";return`<span class="template-node ${Le?"":"template-node-empty"}" data-type="${ze}" data-key="${Ze}" data-placeholder="${ht}"><span class="template-node-content">${Le||""}</span></span>`}),v};Ne(()=>_e.messageInput,n=>{const s=ia(n||"");if($i(s),H.value&&s!==gn(H.value)){let C=qd(s).replace(/\n/g,"<br/>");H.value.commands.setContent(C),st.value=s,(n||"")!==s&&ye("update:messageInput",s),ye("updateScript")}},{immediate:!0}),fa(()=>{if(document.removeEventListener("click",qi),re(),Oi.cancel(),Tt+=1,po(),Jo(),H.value){try{const n=H.value.__ai_input_enter_handler;n&&H.value.view&&H.value.view.dom&&H.value.view.dom.removeEventListener("keydown",n,!0)}catch{}H.value.destroy()}Ft.off("useChara",os),Ft.off("imageUseWay",Cr),a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},a.chatImage="",a.chatFile=is()});const Dd=()=>{var n;return!!((n=a.paramFormat)!=null&&n.some(s=>s.key==="shop_name"))},Od=()=>{let n="",s=Vt.value.startTime?an(Vt.value.startTime).format("YYYY-MM-DD HH:mm:00"):void 0,v;if(Vt.value.runType===xo.CYCLE&&Vt.value.cycleMode==="hourly"&&(s=an(Vt.value.dateTime).format("YYYY-MM-DD HH:mm:00"),v=an(Vt.value.dateTime).endOf("day").format("YYYY-MM-DD HH:mm:ss")),Vt.value.runType===xo.CYCLE)if(Vt.value.cycleMode==="hourly")n=Ug(s,Vt.value.cycleHourInterval);else{const C=Vt.value.cycleTime,M=C.minute(),A=C.hour();Vt.value.cycleMode==="daily"?n=`0 ${M} ${A} * * ?`:Vt.value.cycleMode==="weekly"?n=`0 ${M} ${A} ? * ${Vt.value.cycleDayOfWeek}`:Vt.value.cycleMode==="monthly"&&(n=`0 ${M} ${A} ${Vt.value.cycleDayOfMonth} * ?`)}return{runType:Vt.value.runType,cycleCron:n||void 0,startTime:s,endTime:v}};Ne(()=>_e.isSending,n=>{n||fe()});const Di=()=>a.aiMessageType==="IMAGETOVIDEO"?{videoParams:JSON.parse(JSON.stringify(a.videoGenerateParams)),videoReferenceItems:JSON.parse(JSON.stringify(a.batchUploadVideoUrls||[]))}:a.aiMessageType==="LINKPIX"?{modelSkuId:Lo.value,mainImageChatMode:a.mainImageChatMode,linkPixInputImageCount:Gs.value,isFreeUseWayChargedByImageCount:Vs.value,isOtherFreeSkuFreeGeneration:zs.value}:a.aiMessageType==="POD_MATERIAL"?{podMaterialParams:JSON.parse(JSON.stringify(a.podMaterialParams))}:{},Nd=async()=>{if(aa.value){qe.warning(d("components.AIChatInput.640597-1"));return}let n=!0,s=!0;const v=async()=>{var M;if(Ke.value||no.value){if(T.path.includes("/qinghu-ai-")||a.aiMessageType!="NORMAL"){if(a.isChatInProgress){qe.warning(d("components.AIChatInput.849692-11"));return}const A=gn(H.value),ee=ia(Pe.value?_l():no.value?a.structuredContent:A);xi(),a.structuredContent=ee,ye("send",ee,{...Di(),isSystemQuotaExhausted:n,isUserQuotaExhausted:s,...qo.value&&!Do.value&&!n&&!s?{freeTaskPending:!0,consumptionCountText:d("generation-history.index.570427-1"),estimatedScore:0}:{}}),Do.value=!1,a.isImageQuote=!1,a.isVideoQuote=!1,no.value=!1,T.path=="/linkpix/generation"&&tt(()=>{if(Pe.value){en(),st.value=_l();return}H.value.commands.setContent(""),st.value=""})}else Vd();(M=je==null?void 0:je.value)==null||M.cleanImg()}else a.aiMessageType=="VIDEO_TRANSLATION"&&ye("send","1",{})};if(xi(),a.aiMessageType==="IMAGETOVIDEO"||a.aiMessageType==="LINKPIX"&&!_i.value&&!od.value||qo.value){let M=a.aiMessageType=="IMAGETOVIDEO"?a.videoGenerateParams.currentTimeActiveId:Lo.value;a.aiMessageType==="POD_MATERIAL"&&(M=a.podMaterialParams.modelSkuId),a.imageGenerateParams.otherFreeSkuId&&(M=a.imageGenerateParams.otherFreeSkuId);const A=a.aiMessageType==="POD_MATERIAL"?{modelSkuId:M,businessType:"pod_material",podMaterialMode:a.podMaterialParams.podMaterialMode}:M;if(await a.getFreeTaskRunning(A)){U.confirm({title:d("strategy-generator.index.033017-10"),icon:St(pa),content:d("pages-link-pix-generation-history.index.912708-22"),onOk(){},onCancel(){}});return}const pe=await a.getFreeQuota(A),{activityActive:Le,hasFreeEligibility:ze,userDailyUsedCount:Ze,userDailyLimit:ht,systemDailyRemainingCount:dt}=pe||{};if(pe&&Ks(pe),Le&&ze){if(n=dt!==void 0&&dt<=0,s=Ze!==void 0&&ht!==void 0&&Ze>=ht,a.aiMessageType==="POD_MATERIAL"&&Xa(!n&&!s),!n&&a.aiMessageType==="LINKPIX"&&Eo.value&&(
148a.imageGenerateParams.imageCount=1),(n||s)&&a.aiMessageType==="IMAGETOVIDEO"||n&&a.aiMessageType==="LINKPIX"||(n||s)&&a.aiMessageType==="POD_MATERIAL"){let Mt="";if(a.aiMessageType==="IMAGETOVIDEO"){Mt="freeVideoConfirmedDate";const La=new Date().toDateString();if(localStorage.getItem(Mt)===La){v();return}}if(a.aiMessageType==="LINKPIX"){Mt="freeImageConfirmedDate",a.imageGenerateParams.otherFreeSkuId&&a.imageGenerateParams.otherSkuIsSystemQuotaExhausted&&(Mt="freeImagePurposeConfirmedDate");const La=new Date().toDateString();if(localStorage.getItem(Mt)===La){v();return}}if(a.aiMessageType==="POD_MATERIAL"&&(Mt=ld(n?"system":"user"),localStorage.getItem(Mt)==="1")){Xa(!1),Do.value=!0,v();return}const Xt=d(n?"components.AIChatInput.266484-1":"components.AIChatInput.266484-2");a.aiMessageType==="POD_MATERIAL"&&await a.getEstimatedPoints(),U.confirm({title:d("strategy-generator.index.033017-10"),icon:St(pa),content:St("div",[St("div",[Xt]),St("div",[d(n?"components.AIChatInput.266484-4":"components.AIChatInput.266484-3"),St(Y$,{style:"margin-right: 4px"}),`${a.getWithhold}`])]),onOk(){localStorage.setItem(Mt,a.aiMessageType==="POD_MATERIAL"?"1":new Date().toDateString()),a.aiMessageType==="POD_MATERIAL"&&(Xa(!1),Do.value=!0),v()},onCancel(){}});return}}else a.aiMessageType==="POD_MATERIAL"&&Xa(!1)}else Xa(!1);v()},Oi=yn(async()=>{try{await Nd()}finally{Oe()}},Pc,{leading:!0,trailing:!1}),Rd=()=>xt.value?Pe.value&&!Jt.value?(qe.warning(d("components.AIChatInput.930519-3")),!1):Pe.value&&yt.value&&!Ua.value?(qe.warning(d("components.AIChatInput.930519-4")),!1):!0:(qe.warning(d("ai-guide-popup.index.upload-image")),!1),Fd=F(()=>{var n;return((n=K.value)==null?void 0:n.inputImageRequired)||!1}),Gd=async()=>{var A,ee;if(m.value||_e.isSending||!Rd())return;if(Ut.value){qe.warning(d("components.AIChatInput.640597-2"));return}if(!await le()||!await be()||!ce())return;if(!((A=a==null?void 0:a.estimatedPoints)!=null&&A.enough)){U.confirm({title:"å½å积åä¸è¶³ï¼æ æ³å建任å¡",icon:y(ra),content:y("div",{style:"color:red;"},"æ¯å¦åå¾è´ä¹°ç§¯åï¼"),okText:"åå¾è´ä¹°",onOk(){G.push({path:"/upgrade"})},onCancel(){},class:"test"});return}const n=gn(H.value);if(a.aiMessageType=="IMAGETOVIDEO"&&J.value&&Pn(n)>J.value)return qe.warning(d("components.AIChatInput.605011-12"));if(a.aiMessageType=="IMAGETOVIDEO"&&((ee=a.batchUploadImgUrls)==null?void 0:ee.length)===0&&Fd.value)return qe.warning(d("ai-guide-popup.index.upload-image"));dm();const s=ia(Ni(n)),{isValid:v}=jt(s);let C=a.isDetailImg&&["SKU_GENERATION"].includes(a.longImageChatMode),M=a.aiMessageType==="LINKPIX"&&a.mainImageChatMode==="SKU_GENERATION";if(!v&&(M||C)){const pe=await Gt();if(pe==="cancel")return;if(pe==="restore"){ns();return}}E({onContinue(){m.value=!0,Oi()}})};function Ni(n){const s=/\[@.*?\]/g;return n.replace(s,"")}const Vd=()=>{if(!H.value)return;const n=gn(H.value),s=ia(Ni(n));if(s.trim().length>0){a.structuredContent=s;let v={};if(Se.value){if(Ue.value=[],!Xe.value||Xe.value&&!Xe.value.length){Ae.value=!0,qe.error(d("components.AIChatInput.950192-16"));return}if(Ye.value.forEach(A=>{const ee=wt.value[A.key];if(!(A.isChatInput&&A.key==="selection_lib"&&A.required&&(!ee||Array.isArray(ee)&&ee.length===0)&&(!wt.value.search_platforms||!wt.value.search_platforms.includes("1688")))){if(A.required&&A.type==="platformStoreSelect"?(Object.keys(ee).length===0&&Ue.value.push(A.label),["shopee"].includes(ee.radioValue)&&((!ee.cascaderValue||ee.cascaderValue.length===0)&&Ue.value.push(d("components.AIChatInput.849692-12",[A.label,ee.radioValue])),A.options.find(ze=>ze.value===ee.radioValue).fillInput&&!ee.currentInputValue&&Ue.value.push(d("components.AIChatInput.849692-13",[A.label,ee.radioValue])))):A.required&&A.type==="pickProduct"&&(ee.activeType?ee.activeType===d("components.AIChatInput.849692-14")?!ee.createTime||!ee.createTime[0]||!ee.createTime[1]?Ue.value.push(d("components.AIChatInput.849692-15")):ee.produceCount||Ue.value.push(d("components.AIChatInput.849692-16")):ee.activeType===d("components.AIChatInput.849692-17")&&(ee.idsText||Ue.value.push(d("components.AIChatInput.849692-18"))):Ue.value.push(A.label)),A.required&&A.key!="shop_name"&&(ee==null||(Array.isArray(ee)?ee.length===0:ee===""))){Ue.value.push(A.label);return}if(A.required&&A.requiredType==="values"){if(!ee||!(ee!=null&&ee.selectValue)){Ue.value.push(A.label);return}let Le=(((A==null?void 0:A.options)||[]).find(ze=>ze.value===(ee==null?void 0:ee.selectValue))||{}).requiredKeys||[];for(let ze of Le)if(!ee[ze]){Ue.value.push(A.label);return}}}}),Ue.value.length>0){qe.error(d("components.AIChatInput.950192-17",[Ue.value.join("ã")]));return}v={...D.value,...wt.value};const C=Xe.value.map(A=>Dd()?{deviceId:A.recordId,productType:A.productType,shopNames:A.checkedShopList&&A.checkedShopList.length?A.checkedShopList:[d("components.AIChatInput.950192-18")]}:{deviceId:A.recordId,productType:A.productType});let M=Od();v={createDTO:{agentCode:Se.value.agentCode,name:Se.value.name+"-"+an().format("YYYYMMDD-HH"),executeParam
148s:JSON.stringify(v),runType:"ONCE",...M},cloudDeviceList:C}}if(s.includes(d("components.AIChatInput.950192-19"))&&!Ve.logSourcePlatform){qe.info(d("components.AIChatInput.950192-20")),se.value.popoverVisible=!0;return}ye("send",s,v),H.value.commands.setContent(""),st.value=""}},zd=()=>{ye("stop")},Bd=()=>{H.value&&(nt.value=!0,H.value.commands.focus())},Kd=()=>{var n;nt.value=!1,(n=H.value)==null||n.commands.focus()},Wd=()=>{var n;Te.value=!1,(n=H.value)==null||n.commands.focus()},jd=()=>{var n;pt.value=!1,(n=H.value)==null||n.commands.focus()},Hd=()=>{var n;gt.value=!1,(n=H.value)==null||n.commands.focus()};let Ri=[],Fi=[];const Jd=()=>{H.value&&H.value.on("transaction",()=>{const n=[];H.value.state.doc.descendants(v=>{v.type.name==="mention"&&v.attrs.id&&n.push(v.attrs.id)}),Ri.filter(v=>!n.includes(v)).includes("intelligent-agent")&&(Se.value=null,D.value={},Ae.value=!1,wt.value={}),Ri=n})},Yd=()=>{H.value&&H.value.on("transaction",()=>{const n=[];H.value.state.doc.descendants(v=>{v.type.name==="templateNode"&&v.attrs.key&&n.push(v.attrs.key)});const s=Fi.filter(v=>!n.includes(v));s.length>0&&s.forEach(v=>{wt.value[v]!==void 0&&(wt.value[v]="")}),Fi=n})},Gi=n=>{a.chatImage="",a.chatFile=is(),H.value&&(H.value.commands.setContent(""),H.value.chain().focus().insertContent(n).run())},tl=async n=>{if(a.chatImage="",a.chatFile=is(),n.agentCode==26){a.aiMessageType="LINKPIX",a.batchUploadImgUrls=[],window.open(G.resolve({path:"/linkpix/image"}).href,"_blank");return}else a.aiMessageType="NORMAL";if(!H.value)return;await Xd(n.id);const s=[];H.value.state.doc.descendants((ze,Ze)=>{ze.type.name==="mention"&&ze.attrs.type==="intelligent-agent"&&s.push({from:Ze,to:Ze+ze.nodeSize})});let v=H.value.chain().focus();s.reverse().forEach(({from:ze,to:Ze})=>{v=v.deleteRange({from:ze,to:Ze})}),v.run(),H.value.commands.focus("end"),H.value.commands.setContent("");let C="";C=He.value?He.value.replace(/ã@agentã/g,Ee.value.name):"";const M=[];M.push({type:"mention",attrs:{id:"intelligent-agent",label:Ee.value.name+"Â Â ",type:"intelligent-agent"}});const A=/ã@(.*?)\#(.*?)ã/g;let ee,pe=0;for(;(ee=A.exec(C))!==null;)ee.index>pe&&M.push({type:"text",text:C.slice(pe,ee.index)}),M.push({type:"templateNode",attrs:{type:"default",placeholder:ee[1],key:ee[2]}}),pe=A.lastIndex;pe<C.length&&M.push({type:"text",text:C.slice(pe)});const Le={type:"paragraph",content:M};H.value.chain().focus().insertContent(Le).run(),D.value={},Ae.value=!1,Se.value=Ee.value,nt.value=!1,Xe.value=null,setTimeout(()=>{Ye.value.filter(Ze=>Ze.required&&Ze.value).forEach(Ze=>{let ht=Wi("",Ze.value);io(Ze.key,ht)})},500)},Qd=n=>{if(!H.value||!n)return;const s=n.map(C=>C.name).join("ã"),v=n.reduce((C,M)=>C.concat(M.checkedShopList||[]),[]);io("device",s),v&&v.length?(io("shop_name",v.length+d("components.AIChatInput.950192-21")),wt.value.shop_name=v):(io("shop_name",d("components.AIChatInput.950192-22")),wt.value.shop_name=[d("components.AIChatInput.950192-18")]),Te.value=!1,Xe.value=n},Xd=async(n,s=!1)=>{var M,A,ee,pe,Le;let v={agentId:n};s&&(v={agentCode:n});let C=await kg(v);if(C.code==200){if(Ee.value=C.payload,Ye.value=JSON.parse((M=Ee==null?void 0:Ee.value)==null?void 0:M.paramFormat),a.paramFormat=JSON.parse((A=Ee==null?void 0:Ee.value)==null?void 0:A.paramFormat),He.value=(ee=Ee==null?void 0:Ee.value)!=null&&ee.extensionJson&&((pe=Ee==null?void 0:Ee.value)!=null&&pe.extensionJson.includes("chatCreateGrammar"))?JSON.parse(((Le=Ee==null?void 0:Ee.value)==null?void 0:Le.extensionJson)||"{}").chatCreateGrammar:"",rp(),Ye.value&&Ye.value.length){const ze=Ye.value.find(Ze=>Ze.key==="selection_lib");ze&&sp(ze)}}else qe.error(d("components.AIChatInput.950192-23"))},zo=h([]),Ha=h({selectValue:"",label:""}),al=h({});let Ma={formatLabel:"name",formatValue:"id"};const Zd=n=>{switch(ye("updateScript",n),n.status){case"start":ot.value&&ot.value.updateImageList(n.imgList),H.value.commands.setContent(""),_.value=!0,H.value.setEditable(!1);break;case"updating":ja(n.script),tt(()=>{H.value.commands.scrollIntoView(),document.querySelector(".qinghu-link-pix-content")&&(document.querySelector(".qinghu-link-pix-content").scrollTop=150),document.querySelector(".editor-container")&&(document.querySelector(".editor-container").scrollTop=1e3)});break;case"finish":_.value=!1,H.value.setEditable(!0),tt(()=>{H.value.commands.scrollIntoView(),H.value.commands.focus("end"),H.value.commands.setTextSelection(H.value.state.doc.
148content.size)});break}},lo=n=>{switch(n.status){case"start":H.value.commands.setContent(""),_.value=!0,H.value.setEditable(!1);break;case"updating":ja(n.prompt),tt(()=>{H.value.commands.scrollIntoView(),document.querySelector(".qinghu-link-pix-content")&&(document.querySelector(".qinghu-link-pix-content").scrollTop=150),document.querySelector(".editor-container")&&(document.querySelector(".editor-container").scrollTop=1e3)});break;case"finish":_.value=!1,H.value.setEditable(!0),tt(()=>{H.value.commands.scrollIntoView(),H.value.commands.focus("end"),H.value.commands.setTextSelection(H.value.state.doc.content.size)});break}},Vi=()=>a.adMaterialParams.materialType==="image"?d("components.AIChatInput.930519-5"):d("components.AIChatInput.930519-6"),Na=h(null),ep=async n=>{var A,ee,pe;const s=a.getSelectedAdMaterialOption(),v=a.adMaterialParams.modelSkuId||(s==null?void 0:s.modelSkuId);if(!v){qe.warning("Ad material template is not ready");return}const C={images:n,imageList:n,promptTemplateId:s==null?void 0:s.promptId,modelSkuId:v};let M="";(A=Na.value)==null||A.abort(),Na.value=new AbortController,_.value=!0,a.isLoading=!0,Et.value=d("components.AIChatInput.950192-31"),(ee=H.value)==null||ee.setEditable(!1);try{await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":p.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify(C),signal:Na.value.signal,openWhenHidden:!0,onmessage(Le){var ze;try{const Ze=JSON.parse(Le.data),{role:ht,type:dt,data:Mt}=Ze||{};if(dt==="chat_number_over"){(ze=Na.value)==null||ze.abort(),Na.value=null,qe.warning(Mt||d("qinghu-ai.prompt-generation.616079-9"));return}ht==="assistant"&&dt==="answer"&&typeof Mt=="string"&&(M+=Mt,ja(M))}catch{}},async onopen(Le){return Le.status&&["401","500","600"].includes(String(Le.status))&&(Le.status==401?(qe.error(d("qinghu-ai.prompt-generation.616079-8")),setTimeout(()=>{window.location.reload()},600)):qe.error(d("qinghu-ai.prompt-generation.616079-9"))),Promise.resolve()},onerror(Le){var ze,Ze;if(!((Ze=(ze=Na.value)==null?void 0:ze.signal)!=null&&Ze.aborted))throw Le},async onclose(){Na.value=null}})}catch(Le){(Le==null?void 0:Le.name)!=="AbortError"&&qe.error("Failed to generate ad material prompt")}finally{_.value=!1,a.isLoading=!1,Et.value="",(pe=H.value)==null||pe.setEditable(!0),Na.value=null}},tp=async n=>{a.adMaterialParams.promptSerialId="",await Zo(n,s=>{jo(Vi(),s),st.value=s||""})},zi=async(n={})=>{if(a.aiMessageType!=="AD_MATERIAL"||!H.value)return;const s=(a.adMaterialParams.materialImg||[]).map(C=>C==null?void 0:C.url).filter(Boolean);if(!s.length){n.silentWhenNoImage||qe.warning("Please upload ad material images first");return}if(a.adMaterialParams.materialType==="video"){await ep(s);return}const v=s.slice(0,1);await tp(v)},ap=()=>{var n,s;(n=Na.value)==null||n.abort(),Na.value=null,_.value=!1,a.isLoading=!1,Et.value="",(s=H.value)==null||s.setEditable(!0),ja(""),ye("update:messageInput","")},np=async(n={})=>{if(n.generatePrompt){if(a.adMaterialParams.materialType==="video"&&a.adMaterialParams.generatePrompt===!1){n.previousMaterialType==="image"&&ap();return}await tt(),await zi({silentWhenNoImage:!0})}},op=async n=>{var s;(s=a.adMaterialParams.materialImg)!=null&&s.length&&(n==null?void 0:n.triggerPrompt)!==!1&&(a.adMaterialParams.materialType==="video"&&a.adMaterialParams.generatePrompt===!1||await zi({silentWhenNoImage:!0}))};async function sp(n){var s,v;if((s=n.remoteConfig)!=null&&s.url)try{const{url:C,method:M="GET",params:A={}}=n.remoteConfig,{success:ee,payload:pe}=M==="POST"?await Tl(C,A,{params:(v=n.remoteConfig)==null?void 0:v.queryParams}):await Al(C,A);zo.value=ee?pe.map(ze=>{let Ze={...ze};return Ma!=null&&Ma.formatLabel&&(Ze.label=ze[Ma==null?void 0:Ma.formatLabel]||"label"),Ma!=null&&Ma.formatValue&&(Ze.value=ze[Ma==null?void 0:Ma.formatValue]||"value"),Ze}):[];let Le=zo.value.find(ze=>{var Ze;return ze.extendJson&&((Ze=ze.extendJson)==null?void 0:Ze.indexOf("xiaofeng1688auth"))})||{value:""};Le.value&&lp(Le.value)}catch{zo.value=[]}}const lp=n=>{const s=zo.value.find(v=>v.value===n);Ha.value={},tt(()=>{var v;if(Ha.value.selectValue=n,Ha.value.label=s.label,s){let C=Br(s);al.value=C,((v=C==null?void 0:C.extendJson)==null?void 0:v.indexOf("xiaofeng1688auth"))>-1&&(C.extendJson=JSON.parse((C==null?void 0:C.extendJson)||"")||{},ip())}else al.value={}})};async function ip(){var s,v,C,M;let n=((s=al.value)==null?void 0:s.extendJson)||{};if((v=n==null?void 0:n.remoteConfig)!=null&&v.url)try{const{url:A,method:ee="GET",params:pe={}}=n.remoteConfig,{success:Le,payload:ze}=ee==="POST"?await Tl(A,pe):await Al(A,pe);Ha.value.account=Le?ze:"",Ha.value.selectProductType=n.selectProductType,(M=(C=Ha==null?void 0:Ha.value)==null?void 0:C.account)!=null&&M.auth&&(wt.value.selection_lib=Ha.value)}catch{}finally{}}function rp(){Me.value=Ye.value.filter(n=>!n.required)}const Bi=n=>{typeof n.key=="string"&&n.key in $t?Ht.value=$t[n.key][0]:(Ht.value=oc,ft.value=[n]),Ye.value.map(s=>{wt.value[s.key]&&(s.value=wt.value[s.key])}),ea.value=n,ta.value=!0};function cp(){const n={};Ye.value.forEach(s=>{s.required?n[s.key]=s.value!==void 0?s.value:"":n[s.key]=s.value!==void 0?s.value:s.type==="array"?[]:""}),wt.value=n}Ne(Ye,cp,{immediate:!0});const io=(n,s)=>{const v=[];H.value.state.doc.descendants((A,ee)=>{A.type.name==="templateNode"&&A.attrs.key===n&&v.push({pos:ee,nodeSize:A.nodeSize})}),s!==null&&typeof s=="object"&&(s=(s==null?void 0:s.label)||(s==null?void 0:s.radioValue)||(s==null?void 0:s.activeType)||"");const C=s.replace(/[\r\n]+/g,"ã");let M=H.value.chain().focus();v.forEach(({pos:A,nodeSize:ee})=>{M=M.deleteRange({from:A+1,to:A+ee-1}),M=M.insertContentAt(A+1,[{type:"text",text:C}])}),M.run()},up=n=>{ta.value=!1,Ki()},Ki=()=>{var v;let n=wt.value[ea.value.key];if(ea.value.key==="volcengineDocId"&&a.customSelectOptions.length){let C=a.customSelectOptions.find(M=>M.id===n);C&&(n=C.name)}let s=Wi(ea.value.key,n);io(ea.value.key,s),ta.value=!1,(v=H.value)==null||v.commands.focus()},Wi=(n="",s)=>s&&Array.isArray(s)&&n!="goods_url"?s.length>0&&typeof s[0]=="object"&&s[0]!==null?s.map(C=>C.label).join(" / "):s.join("-"):n=="goods_url"&&s&&typeof s=="string"?s.split(` 149`).length+d("components.AIChatInput.950192-21"):n=="goods_url"&&s&&Array.isArray(s)?s.length+d("components.AIChatInput.781827-2"):s,dp=async()=>{const n=await Ds();n!=null&&n.videoChatMode&&(a.videoChatMode=n==null?void 0:n.videoChatMode,await to({videoChatMode:n==null?void 0:n.videoChatMode}))},pp=n=>{const[s,v,C]=n.split("|");if(!s||!v)return null;const M=s.toLowerCase(),A=Number(v);return{type:M,id:Number.isNaN(A)?v:A,name:C||""}},mp=async n=>{var v;const s=pp(n);if(s){if(s.type==="image"){a.aiMessageType="LINKPIX",await tt();const C=Ia.value.find(M=>String(M.id)===String(s.id));if(!C)return;a.mainImageChatMode===C.value?(a.imageGenerateParams.currentImageActiveId=C.id,a.imageGenerateParams.isFree=C.isFree||!1):await Qo(C),a.getEstimatedPoints();return}if(s.type==="video"){a.aiMessageType="IMAGETOVIDEO",await tt();let C=a.videoTimeData.find(A=>String(A.id)===String(s.id));!C&&((v=uo.value)!=null&&v.getVideoTimeConfig)&&(await uo.value.getVideoTimeConfig(),
149C=a.videoTimeData.find(A=>String(A.id)===String(s.id)));const M=JSON.parse(JSON.stringify(a.videoGenerateParams));C?(a.videoGenerateParams.modelCode=C.modelCode,a.videoGenerateParams.currentTimeActiveId=C.id,a.videoGenerateParams.duration=C.duration,a.videoGenerateParams.size=C.size,a.videoGenerateParams.imageInputMode=C.imageInputMode,a.videoGenerateParams.isFree=C.isFree||null,a.setFirstFrameInfo(C,M)):a.videoGenerateParams.currentTimeActiveId=s.id,a.getEstimatedPoints()}}},gp=n=>n?n.replace(/\{argument\b[^{}]*\}/g,s=>{const v=s.match(/\bdefault=(["'])(.*?)\1/)||s.match(/\bdefault=\\(["'])(.*?)\\\1/);return(v==null?void 0:v[2])||""}):"",fp=async()=>{var s,v,C;const n=xe(T.query.promptId);if(n)try{const M=await wg(String(n));if(M!=null&&M.error){qe.error(M.error);return}const A=M==null?void 0:M.prompt,ee=JSON.parse(JSON.stringify(A));delete ee.promptText,kt("click_jump_prompt_lib_to_create",ee);const pe=gp((A==null?void 0:A.promptText)||"");if(!pe)return;const Le=yl[A==null?void 0:A.model]||(A.medium==="å¾å"?yl.imageDefault:yl.videoDefault);await mp(Le);const ze=pe.replace(/\n/g,"<br>");(s=H.value)==null||s.commands.setContent(ze),st.value=ze,Ot.value=!1,ye("update:messageInput",pe),tt(()=>{var Ze;(Ze=H.value)==null||Ze.commands.focus("end")})}catch(M){const A=((C=(v=M==null?void 0:M.response)==null?void 0:v.data)==null?void 0:C.error)||(M==null?void 0:M.message)||"Prompt request failed";qe.error(A)}};Rt(async()=>{const n=["/linkpix/image","/linkpix/video","/linkpix/details-image","/linkpix/poster","/linkpix/ad-material","/linkpix/pod-material","/linkpix/social","/linkpix/translation"];if(T.path.includes("/linkpix/")&&!n.includes(T.path)){let s=localStorage.getItem("aiMessageType")||"IMAGETOVIDEO";a.aiMessageType=s=="NORMAL"?"IMAGETOVIDEO":s}try{const{cloned:s}=af(a.defaultChatText);a.defaultChatText&&(a.setDefaultChatText(""),Ot.value=!1),Xs(s.value),Jd(),Yd()}catch{}T.query.character&&os(T.query.character),T.query.prompt&&(Xs(T.query.prompt),Ot.value=!1),Ft.on("useChara",os),Ft.on("imageUseWay",Cr),document.addEventListener("click",qi),await tt(),await vp(),await fp()});const ji={video:"IMAGETOVIDEO",mainImage:"LINKPIX",detailImage:"LONGIMAGE",campaignPoster:"AD_MATERIAL",socialMedia:"SOCIALMEDIA"},Hi=async n=>{var v,C,M,A,ee;if(Ut.value||We.value||((v=sa.value)==null?void 0:v.uploadLoading)||((C=ue.value)==null?void 0:C.uploadLoading)||((M=it.value)==null?void 0:M.uploadLoading)){qe.warning(d("components.AIChatInput.640597-2"));return}if(n&&(a.aiMessageType=n,await tt()),localStorage.getItem("longImageParams")){const pe=JSON.parse(localStorage.getItem("longImageParams")),Le={language:pe.language||"ç®ä½ä¸æ",size:pe.size,seedeTheme:pe.seedeTheme,materialImg:[],imageCount:pe.imageCount,imageSetPlatform:pe.imageSetPlatform};a.longImageParams=Le}if(localStorage.getItem("LINKPIX_SAME_MATERIAL_DATA")){const pe=JSON.parse(localStorage.getItem("LINKPIX_SAME_MATERIAL_DATA"));a.aiMessageType=pe.useType&&ji[pe.useType]?ji[pe.useType]:"IMAGETOVIDEO",tt(()=>{a.batchUploadImgUrls=[],fn(pe),ja(pe.description||""),localStorage.removeItem("LINKPIX_SAME_MATERIAL_DATA")})}if(localStorage.getItem("video_generate_prompt")){const pe=JSON.parse(localStorage.getItem("video_generate_prompt"));ja(Ad(pe)),localStorage.removeItem("video_generate_prompt")}if(localStorage.getItem("LinkPixUrl")&&(a.batchUploadImgUrls=[localStorage.getItem("LinkPixUrl")],dl(localStorage.getItem("LinkPixUrl")||""),localStorage.removeItem("LinkPixUrl")),localStorage.getItem("SourceMainImage"))if(a.aiMessageType=="LONGIMAGE"){const pe=JSON.parse(localStorage.getItem("SourceMainImage")||"[]"),Le=Array.isArray(pe)?pe:[];Op(Le.length);const ze=or(),Ze=(a.longImageParams.materialImg||[]).filter(Ko).length,ht=Le.slice(0,Math.max(0,ze-Ze));ht.length<Le.length&&qe.error(d("public-img-upload.index.101106-2",[ze])),sa.value&&(sa.value.uploadLoading=!0);const dt=ht.map(Xt=>hp(Xt));(await Promise.allSettled(dt)).filter(Xt=>Xt.status==="rejected"),sa.value&&(sa.value.uploadLoading=!1),localStorage.removeItem("SourceMainImage")}else{const pe=JSON.parse(localStorage.getItem("SourceMainImage"))||[];if(Array.isArray(pe)&&pe.length){a.batchUploadImgUrls=[];const Le=I.value;let ze=!1;for(const Ze of pe){if(a.batchUploadImgUrls.length>=Le){ze=!0;break}if(V.value){const ht=await Pg(Ze),dt=ht===void 0?null:Mg({size:ht},V.value);if(dt){B(dt);continue}}try{it.value&&(it.value.uploadLoading=!0);let ht="";a.aiMessageType=="IMAGETOVIDEO"&&(ht=a.videoGenerateParams.currentTimeActiveId);const dt=await _s({url:Ze,type:"IDENTIFY_IMAGE_HEAD",modelSkuId:ht});if(it.value&&(it.value.uploadLoading=!1),dt&&dt.code===0){a.batchUploadImgUrls.push(Ze);try{dl(Ze)}catch{}}else{const Mt=(A=Ze==null?void 0:Ze.split("/"))==null?void 0:A.pop();qe.error(d("components.AIChatInput.658492-3",[Mt])),a==null||a.portraitCheckFailImages.push(ys(Ze,dt))}}catch{it.value&&(it.value.uploadLoading=!1)}}ze&&B({code:"max-count",maxCount:Le})}localStorage.removeItem("SourceMainImage")}
149a.aiMessageType==="LINKPIX"&&a.mainImageChatMode==="SKU_GENERATION"&&(a.imageGenerateParams.imageCount=Gn(a.imageGenerateParams.imageCount,a.mainImageChatMode,!!((ee=x.value)!=null&&ee.defaultVip))),a.aiMessageType=="POD_MATERIAL"&&H.value.setEditable(!1)},vp=async()=>{await dp(),await Promise.all([Ii(),dd(),Ci(),a.fetchAdMaterialOptions()]),await gd(),await fd(),await Hi(),Pr()},hp=async n=>{var A;const v=await(await fetch(n)).blob(),C=(A=n==null?void 0:n.split("/"))==null?void 0:A.pop(),M=new File([v],C,{type:v.type.includes("jpg")?"image/jpeg":v.type});return await Wo(M)},_p=()=>{H.value&&tt(()=>{setTimeout(()=>{var s;const n=(s=at.value)==null?void 0:s.querySelector(".ProseMirror");n&&(n.removeEventListener("click",Yi),n.addEventListener("click",Yi))},1e3)})},Ji=async n=>{if(!n||a.aiMessageType!=="LINKPIX")return;const s=Ia.value.find(v=>[v==null?void 0:v.value].some(C=>String(C)===String(n)));!s||a.mainImageChatMode===s.value||await Qo(s)};function Yi(n){var C,M,A,ee,pe;let s=n.target;const v=(C=s.closest)==null?void 0:C.call(s,".mention");for(((M=v==null?void 0:v.classList)!=null&&M.contains("mention-video")||(A=v==null?void 0:v.classList)!=null&&A.contains("mention-media")||(ee=v==null?void 0:v.classList)!=null&&ee.contains("mention-material-image"))&&tt(()=>{wd(v)});s&&!s.classList.contains("template-node");)s=s.parentElement;if((pe=s==null?void 0:s.classList)!=null&&pe.contains("template-node")){const Le=s.getAttribute("data-key");if(Le==="device"||Le==="shop_name")Te.value=!0;else{const ze=Ye.value.find(Ze=>Ze.key===Le);ze&&Bi(ze)}}}const yp=()=>{},xp=n=>n.source==="custom"||n.personal===!0,bp=n=>(a.portraitCheckFailImages||[]).some(s=>(typeof s=="string"?s:(s==null?void 0:s.sourceUrl)||(s==null?void 0:s.url))===n),Ip=async(n,s)=>{var v,C;if(a.aiMessageType!=="IMAGETOVIDEO"||!xp(s))return!0;try{it.value&&(it.value.uploadLoading=!0);const M=await _s({url:n,type:"IDENTIFY_IMAGE_HEAD",modelSkuId:a.videoGenerateParams.currentTimeActiveId});if((M==null?void 0:M.code)==0)return!0;const A=s.name||((v=n==null?void 0:n.split("/"))==null?void 0:v.pop())||"",ee=(M==null?void 0:M.msg)||(M==null?void 0:M.message)||"";return qe.error(ee?`${d("public-img-upload.index.101106-4",[A])}ï¼${ee}`:d("public-img-upload.index.101106-4",[A])),bp(n)||a==null||a.portraitCheckFailImages.push(ys(n,M)),!1}catch{const A=s.name||((C=n==null?void 0:n.split("/"))==null?void 0:C.pop())||"";return qe.error(d("public-img-upload.index.101106-4",[A])),!1}finally{it.value&&(it.value.uploadLoading=!1)}},nl=n=>{var s;return((s=n.imagesList)==null?void 0:s.find(Boolean))||n.icon||""},Cp=n=>{var A,ee;if(a.aiMessageType!=="LINKPIX"||!a.imageGenerateUseWay.showComponents||!a.imageGenerateUseWay.useWayData)return!1;const s=nl(n);if(!s)return!0;const v=_a(a.imageGenerateUseWay.placeholderList);if(!v.length)return!1;const C=v.map((pe,Le)=>String((pe==null?void 0:pe.name)||"").includes("模ç¹")?Le:-1).filter(pe=>pe!==-1);let M=C.find(pe=>{var Le;return!(((Le=v[pe])==null?void 0:Le.images)||[]).length});return M===void 0&&(M=C[C.length-1]),M===void 0&&(M=v.length>1?v.length-1:0),M<0?!1:(v[M].images=[s],a.imageGenerateUseWay.placeholderList=v,a.batchUploadImgUrls=ha(v),S(a.imageGenerateUseWay.useWayData)&&(vt.value={clothingImages:[...((A=v[0])==null?void 0:A.images)||[]],modelImages:[...((ee=v[1])==null?void 0:ee.images)||[]],placeholderList:v},tt(()=>{var pe,Le;(Le=(pe=je.value)==null?void 0:pe.setImagesFromPlaceholder)==null||Le.call(pe,v)})),!0)},kp=async n=>{var s;if(a.aiMessageType==="IMAGETOVIDEO"){const v=nl(n);if(!v)return;if(V.value&&!a.batchUploadImgUrls.includes(v)){const ee=await _n(v,V.value);if(ee){B(ee);return}}const C=a.batchUploadImgUrls.length,M=a.batchUploadImgUrls.includes(v);if(!M&&C>=Re.value){qe.warning(d("components.AIChatInput.640597-5",Re.value)||d("components.AIChatInput.747658-0"));return}if(!M&&!await Ip(v,n))return;const A=((s=a.materialRefMap[v])==null?void 0:s.materialId)||a.generateMaterialId();a.materialRefMap[v]={materialId:A,url:v,characterInfo:{id:n.id,name:n.name,type:n.type,icon:n.icon,sora2Id:n.sora2Id,viduId:n.viduId}},a.batchUploadImgUrls.includes(v)||a.batchUploadImgUrls.push(v),a.setDefaultPurpose();return}if(H.value){if(a.aiMessageType=="LINKPIX"){if(Cp(n))return;const v=nl(n);if(v&&!a.batchUploadImgUrls.includes(v)){if(V.value){const C=await _n(v,V.value);if(C){B(C);return}}a.batchUploadImgUrls.push(v)}return}Ys({id:n.id,label:`${n.name}`,real:`${n.type}`,type:"character"})}},Qi=n=>{var s;H.value&&Ys({id:n.materialId,label:"",type:"material_image",imageUrl:n.url,characterId:((s=n.characterInfo)==null?void 0:s.id)||""})},Xi=n=>({id:n.id,url:n.url,fileName:n.fileName,fileSize:n.fileSize,fileSizeText:n.fileSizeText,duration:n.duration,durationSeconds:n.durationSeconds,dataType:n.dataType}),wp=n=>{const s=Xi(n);if(!s.url)return;const v=Array.isArray(a.batchUploadAudioUrls)?a.batchUploadAudioUrls:[];if(!v.some(M=>M.id===s.id||M.url===s.url)){const M=mc([...v,s],W.value);
149if(M){qe.warning(hn(M,d));return}a.batchUploadAudioUrls=[...v,s]}ye("update:isExpand",!0)},Zi=n=>{if(!H.value||!n)return;const s=Xi(n);Ys({id:s.id,type:s.dataType,fileName:s.fileName,dataType:s.dataType,url:s.url})},ol=n=>{if(!H.value)return;const{state:s}=H.value,{tr:v}=s,C=[];s.doc.descendants((M,A)=>{M.type.name==="mention"&&M.attrs.type==="material_image"&&M.attrs.imageUrl===n&&C.push({from:A,to:A+M.nodeSize})}),C.reverse().forEach(({from:M,to:A})=>{v.delete(M,A)}),C.length>0&&H.value.view.dispatch(v),a.removeMaterialRef(n)},er=(n,s)=>{if(!H.value||!s)return;const{state:v}=H.value,{tr:C}=v,M=[];v.doc.descendants((A,ee)=>{const pe=A.attrs.dataType,Le=A.attrs.url;A.type.name==="mention"&&pe===n&&Le===s&&M.push({from:ee,to:ee+A.nodeSize})}),M.reverse().forEach(({from:A,to:ee})=>{C.delete(A,ee)}),M.length>0&&H.value.view.dispatch(C)},Pp=n=>{er("video",n.url)},Mp=n=>{er("audio",n.url)},Bo=n=>{if(!H.value)return;const{state:s}=H.value,{tr:v}=s,C=[];s.doc.descendants((M,A)=>{M.type.name==="mention"&&M.attrs.dataType===n&&C.push({from:A,to:A+M.nodeSize})}),C.reverse().forEach(({from:M,to:A})=>{v.delete(M,A)}),C.length>0&&H.value.view.dispatch(v)},tr=()=>{var s,v,C,M;const n=[...a.batchUploadImgUrls||[]];return a.batchUploadImgUrls=[],(v=(s=ot.value)==null?void 0:s.updateImageList)==null||v.call(s,[]),(M=(C=je.value)==null?void 0:C.cleanImg)==null||M.call(C),n.forEac
149h(A=>{typeof A=="string"&&ol(A)}),n.length>0};function Sp({previousModel:n,currentModel:s}){if(!n||!s||String(n.id)===String(s.id))return;const v=En(n.referenceRules),C=En(s.referenceRules);if(v===C)return;(tr()||ut.value)&&qe.info(d("image-reference.rules.model-changed"))}function $p({previousModel:n,currentModel:s}){var ze,Ze,ht,dt;if(!n||!s||String(n.id)===String(s.id))return;const v=Ur(n.referenceRules)!==Ur(s.referenceRules),C=En(n.referenceRules)!==En(s.referenceRules),M=pc(n.referenceRules)!==pc(s.referenceRules);if(!v&&!C&&!M)return;const A=!!((ze=a.batchUploadVideoUrls)!=null&&ze.length),ee=At.value,pe=!!((Ze=a.batchUploadAudioUrls)!=null&&Ze.length);v&&((dt=(ht=qt.value)==null?void 0:ht.clearVideo)==null||dt.call(ht),a.batchUploadVideoUrls=[],Bo("video")),M&&(a.batchUploadAudioUrls=[],Bo("audio"));const Le=C?tr():!1;v&&(A||ee)&&qe.info(d("video-reference.rules.model-changed")),C&&(Le||ut.value)&&qe.info(d("image-reference.rules.model-changed")),M&&pe&&qe.info(d("audio-reference.rules.model-changed"))}const Tp=(n,s)=>{const v=Array.isArray(a.batchUploadAudioUrls)?a.batchUploadAudioUrls:[],C=s||v[n];a.batchUploadAudioUrls=v.filter((M,A)=>A!==n),Mp(C)},ar=n=>{switch(n){case"img":a.chatImage="";break;case"file":a.chatFile=is();break}ro()};Ne(()=>a.chatImage,n=>{n||ro()}),Ne(()=>a.chatFile.fileUrl,n=>{n||ro()}),Ne(()=>a.imageGenerateUseWay.useWayData,n=>{const s=n==null?void 0:n.isFree;oo.value=!!s}),Ne(()=>a.batchUploadImgUrls,n=>{n.length||(a.isObtain=!1)},{immediate:!0,deep:!0});const ro=()=>{H.value&&(Tt+=1,po(),Jo(),a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},H.value.commands.setContent(""),H.value.setEditable(!0))},Ap=["label","key","type","hidden","value"];function Up(n){return n.props?n.props:uf(n,Ap)}const Lp=async n=>{var C,M,A,ee,pe,Le;const s=(C=n.clipboardData)==null?void 0:C.items;if(s){for(const ze of s)if(ze.type.indexOf("image")!==-1){let Ze=ze.getAsFile();if(Ze){let ht=10485760;(a.aiMessageType=="LONGIMAGE"||a.aiMessageType=="POSTERIMAGE"||a.aiMessageType=="SOCIALMEDIA")&&(ht=3*1024*1024),a.aiMessageType=="AD_MATERIAL"&&(ht=3*1024*1024);try{const Mt=await Sg(Ze);Mt.size<Ze.size&&(Ze=Mt)}catch{}let dt=await Fl(Ze,ht);if(dt!=null&&dt.success){if(a.aiMessageType=="LONGIMAGE"||a.aiMessageType=="POSTERIMAGE"||a.aiMessageType=="SOCIALMEDIA")Wo(Ze);else if(a.aiMessageType=="AD_MATERIAL")(M=ue.value)==null||M.uploadImg(Ze);else if(a.aiMessageType=="POD_MATERIAL")(A=ke.value)==null||A.uploadImg(Ze);else if(a.aiMessageType=="LINKPIX")(ee=ot.value)==null||ee.uploadImg(Ze);else if(a.aiMessageType=="IMAGETOVIDEO"){if(a.videoGenerateParams.imageInputMode=="first_last_frame"&&a.batchUploadImgUrls.length>=2){qe.error(d("components.AIChatInput.738063-6"));return}await((pe=it.value)==null?void 0:pe.uploadImg(Ze)),a.setDefaultPurpose()}}}}}const v=(Le=n.clipboardData)==null?void 0:Le.getData("text");v&&/^https?:\/\/.*\.(png|jpg|jpeg|webp|gif)$/i.test(v.trim())},Ep=["SKU_GENERATION","LONG_IMAGE_GENERATION"],qp=()=>a.aiMessageType==="AD_MATERIAL",Dp=()=>qp()?a.adMaterialParams:a.longImageParams,nr=n=>a.isDetailImg&&Ep.includes(n),or=()=>xD,Ko=n=>(n==null?void 0:n.fnType)!=="reference",Op=(n=1)=>{if(!nr(a.longImageChatMode))return;const s=(a.longImageParams.materialImg||[]).filter(Ko).length;n>0&&s+n>Mc&&z()},Np=(n=a.longImageChatMode)=>{if(!nr(n))return;(a.longImageParams.materialImg||[]).filter(Ko).length>Mc&&z()},Wo=async n=>{const s=Dp(),v=or(),C=(s.materialImg||[]).filter(Ko).length;if(a.activeTabKey!=="1"&&C>=v){qe.error(d("public-img-upload.index.101106-2",[v]));return}const M=ee=>new Promise((pe,Le)=>{const ze=new FileReader;ze.onload=()=>pe(ze.result),ze.onerror=Le,ze.readAsDataURL(ee)}),A=ee=>new Promise(pe=>{const Le=new Image;Le.onload=()=>pe({w:Le.naturalWidth||Le.width,h:Le.naturalHeight||Le.height}),Le.onerror=()=>pe({w:0,h:0}),Le.src=ee});try{const ee=await M(n),{w:pe,h:Le}=await A(ee),ze={name:n.name,size:n.size,contentType:n.type||"image/jpeg",dataURL:ee,meta:{w:pe,h:Le}};Et.value=d("components.AIChatInput.849692-20"),_.value=!0;const Ze=await Fc(ze);if(_.value=!1,Et.value=d("components.AIChatInput.849692-4"),Ze&&Ze.code===0){const ht=Ze.data,dt=a.activeTabKey=="1"?"reference":"material",Mt={url:ht.url,filename:ht.filename||"",tag:ht.tag||"",width:ht.width||0,height:ht.height||0,aspectRatio:ht.aspectRatio||0,fnType:dt};a.longImageParams.materialImg.push(Mt),vr((a.longImageParams.materialImg||[]).map(Xt=>Xt.url))}else qe.error((Ze==null?void 0:Ze.message)||d("components.AIChatInput.849692-21",[n.name]))}catch{qe.error(d("components.AIChatInput.849692-21",[n.name]))}finally{}},sr=async(n,s=Tt)=>{if(s===Tt){if(a.imageGenerateParams.otherSkuIsSystemQuotaExhausted=!1,a.aiMessageType=="LINKPIX"&&n.modelSkuId&&n.isFree){const v=await a.getFreeQuota(n.modelSkuId);if(s!==Tt)return;if(v){const{activityActive:C,hasFreeEligibility:M,systemDailyRemainingCount:A}=v||{};if(C&&M){const ee=A!==void 0&&A<=0;a.imageGenerateParams.otherSkuIsSystemQuotaExhausted=ee;return}}}a.imageGenerateParams.otherFreeSkuId=""}},lr=n=>n?`ã${n}ã`:"ãã",Rp=(n,s="",v="")=>{H.value.commands.setContent("");const C=Tn();H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{tooltip:n,id:C}}}),H.value.commands.insertContent(d("components.AIChatInput.407726-9",[lr(s),lr(v)]))},sl=()=>a.aiMessageType=="LINKPIX"?d("ai-guide-popup.index.product-suite"):d("ai-guide-popup.index.product-detail-suite"),ir=(n="")=>W6(n,"suiteTemplateVariable",d("ai-chat.agent-params-modal.617214-3")),rr=(n="")=>{const s=ir(n),v=[];return(Array.isArray(s==null?void 0:s.content)?s.content:[]).forEac
149h((M,A)=>{A>0&&v.push({type:"hardBreak"}),Array.isArray(M==null?void 0:M.content)&&v.push(...M.content)}),v},Fp=(n,s="")=>{const v=ia(s);H.value.commands.setContent("");const C=Tn();H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{tooltip:n,id:C}}}),H.value.commands.insertContent(mn(v)),st.value=v},jo=(n,s="",v={})=>{if(!v.showLabel){H.value.commands.setContent(ir(s||""));return}H.value.commands.setContent("");const C=Tn();H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{tooltip:v.label||n,id:C}}}),H.value.commands.insertContent(rr(s||""))},Gp=n=>[d("ai-guide-popup.index.product-suite"),d("ai-guide-popup.index.product-detail-suite")].includes(n==null?void 0:n.label)||!!(n!=null&&n.rawPrompt)&&a.aiMessageType==="AD_MATERIAL"&&a.adMaterialParams.materialType==="image",Vp=async(n,s=1e4)=>{const v=Date.now();for(;!(n.value||[]).length&&Date.now()-v<s;)await new Promise(C=>setTimeout(C,150))},cr=()=>"",ur=n=>{try{const s=localStorage.getItem(n);if(!s)return{};const v=JSON.parse(s);return v&&typeof v=="object"?v:{}}catch{return{}}},dr=(n,s="")=>{var C;if(!s)return;const v=Number((C=ur(n))==null?void 0:C[s]);return Number.isFinite(v)&&v>0?v:void 0},zp=(n,s="")=>dr(n,s)!==void 0,Ho=(n,s,v)=>{if(!s)return;const C=Number(v);Number.isFinite(C)&&C>0&&localStorage.setItem(n,JSON.stringify({...ur(n),[s]:C}))},ll=(n,s,v)=>dr(n,s)||v,Bp=(n="")=>{var s;return Lc(n,!!((s=x.value)!=null&&s.defaultVip))},Kp=(n="")=>{var s;return n==="SKU_GENERATION"?(s=x.value)!=null&&s.defaultVip?1:9:1},il=n=>!!n&&(Fa(n)||yo(n)),rl=(n=!1)=>{var v,C;if(!n&&il((v=a.imageGenerateUseWay)==null?void 0:v.useWayData))return;const s=Gn(a.imageGenerateParams.imageCount,a.mainImageChatMode,!!((C=x.value)!=null&&C.defaultVip));a.imageGenerateParams.imageCount=s,Ho(Fn,a.mainImageChatMode,s)},pr=()=>{Ho(Sc,a.longImageChatMode,a.longImageParams.imageCount)},co=(n=a.mainImageChatMode)=>{var C;const s=ll(Fn,n,Bp(n)),v=Gn(s,n,!!((C=x.value)!=null&&C.defaultVip));a.imageGenerateParams.imageCount=v,v!==s&&Ho(Fn,n,v)},Jo=(n=(s=>(s=a.imageGenerateUseWay)==null?void 0:s.useWayData)())=>yo(n)?(co(),!0):!1,cl=(n=a.longImageChatMode)=>{a.longImageParams.imageCount=ll(Sc,n,Kp(n))},Wp=(n=a.mainImageChatMode)=>zp(Fn,n),jp=()=>{pr()},Hp=()=>{rl()},mr=()=>a.aiMessageType==="LINKPIX"&&a.mainImageChatMode==="SKU_GENERATION",Yo=()=>{var n;(n=H.value)==null||n.setEditable(!0)},Sn=(n="",s="",v={})=>{var M,A;const C=(v==null?void 0:v.resetParams)===void 0?!0:v==null?void 0:v.resetParams;jo(sl(),cr()),mr()&&Yo(),C&&(a.aiMessageType=="LINKPIX"?co():a.isDetailImg?cl():a.aiMessageType=="AD_MATERIAL"?a.adMaterialParams.imageCount=(M=x.value)!=null&&M.defaultVip?1:9:a.aiMessageType=="POD_MATERIAL"&&(a.podMaterialParams.imageCount=(A=x.value)!=null&&A.defaultVip?1:6),a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null})},ul=(n="",s="")=>{Rp(d("ai-guide-popup.index.product-detail-long"),n,s),cl(a.longImageChatMode)},gr=(n=[])=>n.map(s=>{if(typeof s=="string")return{url:s,fnType:"material"};const v=(s==null?void 0:s.url)||(s==null?void 0:s.imageUrl)||"";return v?{...s,url:v,fnType:(s==null?void 0:s.fnType)||"material"}:null}).filter(Boolean),Jp=n=>(Array.isArray(n)?n:[n]).map(v=>typeof v=="string"?v:(v==null?void 0:v.url)||(v==null?void 0:v.imageUrl)||"").filter(Boolean),Yp=n=>{if(a.aiMessageType==="AD_MATERIAL"){const s=n==null?void 0:n.crmTemplateId;if(!s)return;const v=(a.adMaterialOptions||[]).find(pe=>String(pe.id)===String(s));if(!v)return;if(v.materialType==="AD_VIDEO"){a.setAdMaterialVideoScene(v.id);return}const C=Number(v.minCount||1),M=Number(v.maxCount||10),A=Number(v.defaultCount||C),ee=Number(a.adMaterialParams.imageCount||0);a.adMaterialParams.materialType="image",a.adMaterialChatMode=v.id,a.adMaterialParams.imageCount=ee>0?Math.min(M,Math.max(C,ee)):A;return}if(a.aiMessageType==="POD_MATERIAL"){const s=n==null?void 0:n.crmModelSkuId;if(!s)return;const v=(a.podMaterialOptions||[]).find(C=>String(C.id)===String(s));if(!v)return;a.podMaterialParams.podMaterialMode=v.value||"",a.podMaterialParams.podMaterialApplyBatchType=Ea.MULTI_PATTERN_TO_ONE_PRODUCT,a.podMaterialParams.applyMode=Ag(Ea.MULTI_PATTERN_TO_ONE_PRODUCT),a.podMaterialParams.modelSkuId=v.id||"",a.podMaterialParams.images=gr(n.paramsImgs||[]),a.podMaterialParams.productImages=a.podMaterialParams.podMaterialMode==="STAMP_APPLY"?Jp(n.productImage||[]).slice(0,1):[]}},fr=n=>{var M,A;if(!n)return;const s=a.imageGenerateParams,v=(M=n.imageCount)!=null?M:n.count;v!=null&&(s.imageCount=Gn(v,a.mainImageChatMode,!!((A=x.value)!=null&&A.defaultVip))),["quality","size","as
149pectRatio","language","imageSetPlatform"].forEach(ee=>{Object.prototype.hasOwnProperty.call(n,ee)&&(s[ee]=n[ee])}),rl(!0)},fn=async(n,s=!0)=>{const v=(n==null?void 0:n.clearImageUseWaySelection)===!0;v&&(await es({removeEditorLabel:!1}),Yo());const C=++Tt;kr(n),Yp(n);async function M(){if(a.aiMessageType=="POD_MATERIAL"){tt(en);return}const A=Array.isArray(n.paramsImgs)?[...n.paramsImgs]:[];if((n.replaceInputImages===!0||A.length)&&(a.aiMessageType=="AD_MATERIAL"&&(a.adMaterialParams.materialImg=gr(A)),a.aiMessageType=="LONGIMAGE"||a.aiMessageType=="POSTERIMAGE"||a.aiMessageType=="SOCIALMEDIA"||a.aiMessageType=="AD_MATERIAL"||(a.batchUploadImgUrls=A)),n.label===d("components.AIChatInput.738063-7")||n.modelSkuId&&n.isFree){if(C!==Tt)return;wr(n,[],C);return}else{if(a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},Gp(n)){const pe=a.aiMessageType==="LINKPIX";await Vp(pe?Ia:To);const Le=pe?Ia.value:To.value,ze=pe?a.mainImageChatMode:a.longImageChatMode,Ze=pe?Qo:pl,ht=()=>{const Mt=a.aiMessageType==="AD_MATERIAL"?Vi():sl();jo(Mt,n.rawPrompt||n.description||cr())},dt=a.aiMessageType==="AD_MATERIAL"?null:Le.find(Mt=>Mt.value==="SKU_GENERATION");dt&&ze!=="SKU_GENERATION"?(await Ze(dt),ht()):(Sn("","",{resetParams:!1}),ht());return}if(!n.skipRegenerate&&n.label===d("ai-guide-popup.index.product-detail-long")&&a.isDetailImg){const pe=To.value.find(Le=>Le.value==="LONG_IMAGE_GENERATION");pe&&a.longImageChatMode!=="LONG_IMAGE_GENERATION"?pl(pe):ul();return}}if(H.value.commands.setContent(""),n.label){const pe=Tn();H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{tooltip:n.label,id:pe}}})}if(n.rawPrompt){const pe=ia(n.rawPrompt);Sf(pe,{videoUrls:a.batchUploadVideoUrls,audioUrls:a.batchUploadAudioUrls}).forEach(ze=>{typeof ze=="string"?H.value.commands.insertContent(mn(ze)):H.value.commands.insertContent(ze)}),st.value=pe}else{const pe=ia(n.description||"");H.value.commands.insertContent(mn(pe)||""),st.value=pe}}try{await sr(n,C)}catch{}if(C===Tt&&(await M(),v&&(Yo(),tt(Yo)),n.regenerateImageParams)){if(await tt(),C!==Tt)return;fr(n.regenerateImageParams)}};async function Qp(n){var s,v;for(const C of n)a.aiMessageType=="LONGIMAGE"||a.aiMessageType=="POSTERIMAGE"||a.aiMessageType=="SOCIALMEDIA"||a.aiMessageType=="AD_MATERIAL"?Wo(C):a.aiMessageType=="LINKPIX"?(s=ot.value)==null||s.uploadImg(C):a.aiMessageType=="IMAGETOVIDEO"&&((v=it.value)==null||v.uploadImg(C))}async function dl(n){var s;(s=ot.value)==null||s.addUrl(n),Xo()}const uo=h(null),Xp=h(null),Zp=n=>{var s;(s=sa.value)==null||s.setImageByList(n)},em=()=>{var n;uo.value&&((n=uo.value)==null||n.cleanParams())},tm=async n=>{zt.value||(a.videoChatMode=a.videoChatMode==="NOOB"?"MASTER":"NOOB",zt.value=!0,await to({videoChatMode:a.videoChatMode}),zt.value=!1)},am=async n=>{if(zt.value)return;const s=n?"NOOB":"MASTER";a.adMaterialVideoChatMode=s,a.adMaterialParams.generatePrompt=n,zt.value=!0;try{await to({adMaterialVideoChatMode:s})}finally{zt.value=!1}},Qo=async n=>{var v,C;if(zt.value||(n.value==="SKU_GENERATION"&&((v=a.imageGenerateUseWay)!=null&&v.useWayData)&&await es(),a.mainImageChatMode==n.value))return;Ju.value=!1;const s=(C=a.imageGenerateUseWay)==null?void 0:C.useWayData;rl(),a.mainImageChatMode=n.value,a.imageGenerateParams.currentImageActiveId=n.id,a.imageGenerateParams.isFree=n.isFree||!1,a.imageGenerateParams.type=n.type||(n.value==="SKU_GENERATION"?"non_custom":"custom"),a.imageGenerateParams.size="",a.imageGenerateParams.aspectRatio="",localStorage.removeItem("LinkPixImageConfig"),zt.value=!0,await to({mainImageChatMode:a.mainImageChatMode}),a.mainImageChatMode==="SKU_GENERATION"?Sn():(co(n.value),yo(s)&&(a.imageGenerateParams.imageCount=1)),zt.value=!1},pl=async n=>{zt.value||a.longImageChatMode!==n.value&&(pr(),a.longImageChatMode=n.value,Np(n.value),zt.value=!0,a.longImageChatMode==="SKU_GENERATION"?Sn():a.longImageChatMode==="LONG_IMAGE_GENERATION"?ul():(H.value.commands.setContent(""),cl(n.value)),zt.value=!1)},nm=F(()=>{var v,C;let n="";return!(a.batchUploadImgUrls.length||((v=a.batchUploadVideoUrls)==null?void 0:v.length)||((C=a.batchUploadAudioUrls)==null?void 0:C.length))&&!_e.isChatPinned&&(n="88%"),{"max-width":n}}),om=()=>{ja(d("components.AIChatInput.849692-22"))},sm=n=>{n!=null&&n.length&&ye("update:isExpand",!0)};let ml=!1;const Xo=n=>{var v;if(ml||Fa((v=a.imageGenerateUseWay)==null?void 0:v.useWayData))return;const s=Array.isArray(n)&&n.length?n:a.batchUploadImgUrls;
149a.aiMessageType=="LINKPIX"&&a.mainImageChatMode==="SKU_GENERATION"&&(s==null?void 0:s.length)===1&&Zo(s)},lm=(n,s)=>{Xo(s)},vr=n=>{a.isDetailImg&&a.longImageChatMode==="SKU_GENERATION"&&n.length==1&&Zo(n),a.isDetailImg&&a.longImageChatMode==="LONG_IMAGE_GENERATION"&&n.length==1&&Zo(n,s=>{Fp(d("ai-guide-popup.index.product-detail-long"),s)})};let hr=!1,gl=!0;const Ra=h(null),fl=(n,s)=>hr&&s!==void 0&&n!==s,vl=(n,s=!0)=>{a.isLoading=n,_.value=n,Et.value=n?d("components.AIChatInput.950192-31"):"",hr=n,gl=s};function hl(){var n;(n=Ra.value)==null||n.abort(),Ra.value=null,vl(!1,!1)}Ne(()=>a.aiMessageType,(n,s)=>{fl(n,s)&&hl()}),Ne(()=>a.mainImageChatMode,(n,s)=>{fl(n,s)&&hl()}),Ne(()=>a.longImageChatMode,(n,s)=>{fl(n,s)&&hl()});const im=()=>{var s;if(a.aiMessageType==="AD_MATERIAL"){const v=((s=a.getSelectedAdMaterialOption)==null?void 0:s.call(a))||null;return{promptTemplateId:(v==null?void 0:v.promptId)||"",modelSkuId:(v==null?void 0:v.modelSkuId)||""}}if(a.isDetailImg){const v=un.value.find(C=>C.value===a.longImageChatMode)||null;return{promptTemplateId:(v==null?void 0:v.promptTemplateId)||"",modelSkuId:(v==null?void 0:v.id)||""}}const n=Ia.value.find(v=>v.value===a.mainImageChatMode)||null;return{promptTemplateId:(n==null?void 0:n.promptTemplateId)||"",modelSkuId:(n==null?void 0:n.id)||""}},Zo=async(n,s)=>{var M;if(!n||n.length===0)return;let v="";const C=im();try{vl(!0),(M=Ra.value)==null||M.abort(),Ra.value=new AbortController,await Ga(nn,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":p.value,Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({images:n,imageList:n,...C,language:R&&p.value=="en"?"English":d("components.VideoTranslationParams.738063-22")}),signal:Ra.value.signal,openWhenHidden:!0,onmessage(A){var ee;try{const pe=JSON.parse(A.data),{role:Le,type:ze,data:Ze}=pe||{};if(ze==="chat_number_over"){(ee=Ra.value)==null||ee.abort(),Ra.value=null,qe.warning(Ze||d("qinghu-ai.prompt-generation.616079-9"));return}if(Le==="assistant"&&ze==="answer"&&typeof Ze=="string"){if(!gl)return;v+=Ze,s?s(v):jo(sl(),v);return}}catch{}},async onopen(A){return A.status&&["401","500","600"].includes(String(A.status))&&(A.status==401?(qe.error(d("qinghu-ai.prompt-generation.616079-8")),setTimeout(()=>{window.location.reload()},600)):qe.error(d("qinghu-ai.prompt-generation.616079-9"))),Promise.resolve()},onerror(A){var ee,pe;if(!((pe=(ee=Ra.value)==null?void 0:ee.signal)!=null&&pe.aborted))throw A},async onclose(){Ra.value=null}})}catch(A){A==null||A.name}finally{Ra.value=null,vl(!1,gl)}};Ne(()=>[a.mainImageChatMode],()=>{Xo()},{immediate:!0});const _r=F(()=>{try{const n=Array.isArray(a.batchUploadImgUrls)?a.batchUploadImgUrls.length:0,s=Array.isArray(a.batchUploadVideoUrls)?a.batchUploadVideoUrls.length:0,v=Array.isArray(a.batchUploadAudioUrls)?a.batchUploadAudioUrls.length:0,C=Array.isArray(a.portraitCheckFailImages)?a.portraitCheckFailImages.length:0,M=a.aiMessageType==="AD_MATERIAL"?a.adMaterialParams:a.longImageParams,A=M!=null&&M.materialImg&&Array.isArray(M.materialImg)?M.materialImg.length:0,ee=Array.isArray(a.podMaterialParams.images)?a.podMaterialParams.images.filter(Ze=>typeof Ze=="string"?!!Ze:!!(Ze!=null&&Ze.url)).length:0,pe=Array.isArray(a.podMaterialParams.productImages)?a.podMaterialParams.productImages.filter(Boolean).length:0,Le=!!(a&&a.videoFileInfo),ze=!!(ut&&ut.value);return n>0||Z.value||s>0||v>0||C>0||A>0||ee>0||pe>0||Le||ze}catch{return!1}}),$n=h(null),rm=async n=>{const s=$g;$n.value=new AbortController,H.value.commands.setContent(""),_.value=!0,Et.value=d("components.AIChatInput.640597-6"),H.value.setEditable(!1);let v="";try{await Ga(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("Authorization")}`},body:JSON.stringify({originalPrompt:n.prompt,imageUrl:n.images,sessionId:n.sessionId,conversationId:n.conversationId,diagnosisResult:n.diagnosisResult}),signal:$n.value.signal,openWhenHidden:!0,onmessage(C){var M;try{C.event==="message"?(v+=C.data,ja(v),tt(()=>{H.value.commands.scrollIntoView(),document.querySelector(".editor-container")&&(document.querySelector(".editor-container").scrollTop=1e3)})):C.event==="token"&&((M=$n.value)==null||M.abort(),$n.value=null,_.value=!1,H.value.setEditable(!0))}catch{}},async onopen(C){return C.status&&["401","500","600"].includes(String(C.status))&&(C.status==401?(qe.error(d("qinghu-ai.video-script.120875-14")),setTimeout(()=>window.location.reload(),600)):qe.error(d("components.AIChatInput.738063-10"))),Promise.resolve()}
149,onerror(C){var M;qe.error(d("components.AIChatInput.738063-12")),_.value=!1,H.value.setEditable(!0),(M=$n.value)==null||M.abort(),$n.value=null},async onclose(){_.value=!1,Et.value=d("components.AIChatInput.107298-0"),H.value.setEditable(!0),tt(()=>{H.value.commands.scrollIntoView(),H.value.commands.focus("end"),H.value.commands.setTextSelection(H.value.state.doc.content.size)})}})}catch{qe.error(d("components.AIChatInput.640597-8")),_.value=!1,H.value.setEditable(!0)}},cm=n=>{ja(n||"")},um=(n,s,v)=>{ye("send",ia(n),{...Di(),...v,isSystemQuotaExhausted:s?dn.value:!0,isUserQuotaExhausted:s?Ao.value:!0})},yr=(n,s,v,C={})=>{H.value.commands.setContent("");const M=Tn(),A=mr(),ee=!A&&O(v),pe=!A&&N(v);H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{tooltip:n,id:M,promptLocked:pe,imageUseWayScene:!0}}});const Le=ia(s);pe?H.value.commands.insertContent({type:"promptLockPlaceholder",attrs:{text:Le}}):C.useSuitePromptFormat?H.value.commands.insertContent(rr(Le)):H.value.commands.insertContent(mn(Le)),st.value=Le,H.value.setEditable(!ee),tt(()=>{C.selectionId!==void 0&&C.selectionId!==Tt||(v.isFree&&v.modelSkuId?(a.imageGenerateParams.otherFreeSkuId=v.modelSkuId,Fa(v)||(a.imageGenerateParams.imageCount=1)):a.imageGenerateParams.otherFreeSkuId="")})},xr=n=>{if(!H.value||!a.imageGenerateUseWay.useWayData)return;const s=a.imageGenerateUseWay.useWayData;yr(s.name,n||s.prompt||"",s,{useSuitePromptFormat:!0})},br=n=>{const s=n||{clothingImages:[],modelImages:[],placeholderList:[]};if(vt.value=s,a.aiMessageType==="LINKPIX"&&S(a.imageGenerateUseWay.useWayData)){const v=_a(s.placeholderList||[]);a.imageGenerateUseWay.placeholderList=v,a.batchUploadImgUrls=ha(v)}},Ir=()=>{const n=vt.value.clothingImages||[],s=vt.value.modelImages||[];return n.length+s.length},dm=()=>{if(!S(a.imageGenerateUseWay.useWayData))return;const n=vt.value.clothingImages||[],s=vt.value.modelImages||[];a.batchUploadImgUrls=[...n,...s]},Cr=n=>{const{data:s,images:v,previousModelSkuId:C,regenerateImageParams:M}=n;ts(s,v,{previousModelSkuId:C,regenerateImageParams:M}),v.length&&!S(s)&&(a.batchUploadImgUrls=v)},pm=(n,s=[])=>{if(S(n))return[{name:"æè£
å¾",images:s.length>1?s.slice(0,-1):[]},{name:"模ç¹å¾",images:s.length>1?[s[s.length-1]]:s[0]?[s[0]]:[]}];const[,v=""]=(n.specComps||"").split("_");return v.split("/").map((C,M)=>({name:C,images:s[M]?[s[M]]:[]}))},mm=n=>{var M;if(!Fa(n)||rt.value)return;const s=a.imageGenerateParams,v=(M=a.imageGenerateUseWay)==null?void 0:M.useWayData,C=il(v)?ll(Fn,a.mainImageChatMode,s.imageCount):s.imageCount;rt.value=Br({mainImageChatMode:a.mainImageChatMode,imageGenerateParams:{currentImageActiveId:s.currentImageActiveId,isFree:s.isFree,type:s.type,size:s.size,quality:s.quality,aspectRatio:s.aspectRatio,imageCount:C,language:s.language,imageSetPlatform:s.imageSetPlatform}})},po=()=>{const n=rt.value;return n?(ml=!0,a.mainImageChatMode=n.mainImageChatMode||a.mainImageChatMode,Object.assign(a.imageGenerateParams,n.imageGenerateParams||{}),rt.value=null,tt(()=>{ml=!1}),!0):!1},kr=n=>{var v;const s=(v=a.imageGenerateUseWay)==null?void 0:v.useWayData;if(Fa(s)){Fa(n)||po();return}rt.value=null,mm(n)},wr=(n,s=[],v=Tt)=>{var pe,Le;const{name:C,prompt:M,specComps:A}=n;yo(n)&&(a.imageGenerateParams.imageCount=1);const ee=A||S(n)?pm(n,s):[];vt.value=S(n)?{clothingImages:((pe=ee[0])==null?void 0:pe.images)||[],modelImages:((Le=ee[1])==null?void 0:Le.images)||[],placeholderList:ee}:{clothingImages:[],modelImages:[],placeholderList:[]},a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},tt(()=>{if(v===Tt)if(A||S(n)){const[ze]=(A||"upload_æè£
å¾/模ç¹å¾").split("_");(ze&&ze==="upload"||S(n))&&(S(n)?a.batchUploadImgUrls=[]:s!=null&&s.length?a.batchUploadImgUrls=s:a.batchUploadImgUrls=[],a.imageGenerateUseWay={showComponents:!0,placeholderList:ee,useWayData:n})}else a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:n}}),yr(C,M,n,{useSuitePromptFormat:!0,selectionId:v})},gm=()=>{if(!H.value)return;let n=!1;H.value.state.doc.descendants(s=>{var v,C;s.type.name==="rawCustomTooltipLabel"&&((C=(v=s.attrs)==null?void 0:v.props)==null?void 0:C.imageUseWayScene)===!0&&(n=!0)}),ct=n,H.value.setEditable(!0),H.value.commands.setContent(""),st.value="",ye("update:messageInput","")},es=async(n={})=>{var M;Tt+=1;const s=(M=a.imageGenerateUseWay)==null?void 0:M.useWayData;if(!!!s&&!rt.value)return;const C=po();a.imageUseWayVisible=!1,a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},a.imageGenerateParams.otherFreeSkuId="",a.imageGenerateParams.otherSkuIsSystemQuotaExhausted=!1,a.mainImageCardClickKey="",vt.value={clothingImages:[],modelImages:[],placeholderList:[]},n.removeEditorLabel!==!1&&gm(),C?await to({mainImageChatMode:a.mainImageChatMode}):Jo(s),a.getEstimatedPoints()},ts=async(n,s=[],v={})=>{var Le;const C=++Tt,M=a.mainImageChatMode,A=a.imageGenerateParams.imageCount,ee=(Le=a.imageGenerateUseWay)==null?void 0:Le.useWayData;try{await sr(n,C)}catch{}if(C!==Tt)return;M&&!il(ee)&&Ho(Fn,M,A),kr(n);const pe=bg(Ia.value,v.previousModelSkuId,n==null?void 0:n.recommendMode);
149if(pe?(a.mainImageChatMode=pe.value,a.imageGenerateParams.currentImageActiveId=pe.id,a.imageGenerateParams.isFree=pe.isFree||!1):a.mainImageChatMode=n==null?void 0:n.recommendMode,await tt(),C===Tt&&(v.regenerateImageParams||co(a.mainImageChatMode),a.imageGenerateParams.otherFreeSkuId="",wr(n,s,C),v.regenerateImageParams)){if(await tt(),C!==Tt)return;fr(v.regenerateImageParams)}},fm=n=>{if(n.productImage){const s=Array.isArray(n.productImage)?n.productImage:[n.productImage];a.batchUploadImgUrls=s.filter(Boolean)}if(n.storyboardImages){const s=(Array.isArray(n.storyboardImages)?n.storyboardImages:[n.storyboardImages]).filter(Boolean),v=Array.isArray(a.batchUploadImgUrls)?a.batchUploadImgUrls.filter(Boolean):[];a.batchUploadImgUrls=[...s,...v]}H.value.commands.setContent(mn(n.prompt)),a.structuredContent=ia(n.prompt),no.value=!0},Pr=()=>{H.value&&(H.value.on("custom-tooltip-label-click",({props:n})=>{var s;(s=H.value)==null||s.setEditable(!0),a.batchUploadImgUrls=[],ro()}),H.value.on("prompt-lock-icon-click",()=>{ym()}))},vm=n=>{if(!H.value)return;const s=H.value.state.tr;H.value.state.doc.descendants((v,C)=>{var M,A;v.type.name==="rawCustomTooltipLabel"&&((A=(M=v.attrs)==null?void 0:M.props)==null?void 0:A.promptLocked)!==void 0&&s.setNodeMarkup(C,void 0,{...v.attrs,props:{...v.attrs.props,promptLocked:n}})}),s.docChanged&&H.value.view.dispatch(s)},hm=()=>{if(!H.value)return;const n=[];if(H.value.state.doc.descendants((v,C)=>{v.type.name==="promptLockIcon"&&n.push({from:C,to:C+v.nodeSize})}),!n.length)return;let s=H.value.chain();n.reverse().forEach(({from:v,to:C})=>{s=s.deleteRange({from:v,to:C})}),s.run()},_m=()=>{if(!H.value)return;const n=[];H.value.state.doc.descendants((s,v)=>{var C;s.type.name==="promptLockPlaceholder"&&n.push({from:v,to:v+s.nodeSize,text:((C=s.attrs)==null?void 0:C.text)||""})}),n.length&&n.reverse().forEach(({from:s,to:v,text:C})=>{H.value.commands.insertContentAt({from:s,to:v},mn(C))})},ym=()=>{H.value&&(H.value.setEditable(!0),vm(!1),_m(),hm(),tt(()=>{var n;(n=H.value)==null||n.commands.focus("end")}))};let mo=[],as=0;const Tn=()=>`${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`,xm=yn(()=>{var C;if(!H.value)return;const n=[];let s=!1;if(H.value.state.doc.descendants(M=>{var A,ee;if(M.type.name==="rawCustomTooltipLabel"){const pe=(ee=(A=M.attrs)==null?void 0:A.props)==null?void 0:ee.id;pe&&n.push(pe)}return Wa(M)&&(s=!0),!0}),ct){ct=!1,mo=n,as=n.length;return}const v=H.value.getText().trim().length>0||s;n.length<as&&!v&&n.length===0&&((C=a.imageGenerateUseWay)!=null&&C.useWayData?es({removeEditorLabel:!1}):tt(()=>{a.imageGenerateParams.otherFreeSkuId="",a.batchUploadImgUrls=[],a.mainImageCardClickKey="",a.detailImageCardClickKey=""})),mo=n,as=n.length},100),bm=()=>{H.value&&H.value.on("transaction",()=>{const n=[];H.value.state.doc.descendants(v=>{var C,M;if(v.type.name==="rawCustomTooltipLabel"){const A=(M=(C=v.attrs)==null?void 0:C.props)==null?void 0:M.id;A&&n.push(A)}return!0}),mo.filter(v=>!n.includes(v)).length>0?xm():(mo=n,as=n.length)})},Mr=async()=>{const n=a.aiMessageType=="IMAGETOVIDEO"?a.videoGenerateParams.currentTimeActiveId:Lo.value,s=await a.getFreeQuota(n);s&&(Ks(s),s.activityActive&&s.hasFreeEligibility&&(dn.value=s.systemDailyRemainingCount!==void 0&&s.systemDailyRemainingCount<=0,Ao.value=s.userDailyUsedCount!==void 0&&s.userDailyLimit!==void 0&&s.userDailyUsedCount>=s.userDailyLimit))},Sr=async()=>{if(!qo.value||!a.podMaterialParams.modelSkuId){Xa(!1);return}const n=await a.getFreeQuota({modelSkuId:a.podMaterialParams.modelSkuId,businessType:"pod_material",podMaterialMode:a.podMaterialParams.podMaterialMode});n&&Ks(n);const s=(n==null?void 0:n.systemDailyRemainingCount)!==void 0&&n.systemDailyRemainingCount<=0,v=(n==null?void 0:n.userDailyUsedCount)!==void 0&&(n==null?void 0:n.userDailyLimit)!==void 0&&n.userDailyUsedCount>=n.userDailyLimit;Xa(!!(n!=null&&n.activityActive&&(n!=null&&n.hasFreeEligibility)&&!s&&!v))};function ns(n){a.aiMessageType=="LINKPIX"&&a.mainImageChatMode=="SKU_GENERATION"||a.isDetailImg&&a.longImageChatMode=="SKU_GENERATION"?Sn("","",n
149):a.isDetailImg&&a.longImageChatMode=="LONG_IMAGE_GENERATION"&&ul()}function Im(n,s=!0,v=""){const C=Tn();H.value.commands.insertContent({type:"rawCustomTooltipLabel",attrs:{props:{needDelete:s,placeholder:v,tooltip:n,id:C}}})}const Cm=F(()=>{var n;return(n=a.podMaterialOptions)==null?void 0:n.find(s=>s.value===a.podMaterialParams.podMaterialMode)});function _l(){var n;return Bs()?"å°è±è´´å":((n=Cm.value)==null?void 0:n.label)||""}function en(){if(a.aiMessageType!=="POD_MATERIAL")return;if(!H.value){tt(()=>{H.value&&en()});return}const n=_l();H.value.commands.setContent(""),Im(n,!1,Ai()),H.value.setEditable(!1)}Ne(()=>a.aiMessageType,async(n,s)=>{var v,C;if(s!==void 0&&n!==s&&(Tt+=1,s==="LINKPIX"&&(po(),Jo()),eo()),!!H.value){try{(C=(v=H.value).destroy)==null||C.call(v)}catch{}if(H.value.commands.setContent(""),st.value="",a.batchUploadImgUrls=[],a.ali1688SameStyleImgList=[],a.imageGenerateUseWay={showComponents:!1,placeholderList:[],useWayData:null},a.portraitCheckFailImages=[],a.videoFileInfo=null,a.imageGenerateParams.otherFreeSkuId="",ye("update:messageInput",""),Xs(""),Pr(),a.aiMessageType=="LINKPIX"?await Ii():a.isDetailImg?await Ci():a.aiMessageType=="AD_MATERIAL"?a.getEstimatedPoints():a.aiMessageType=="POD_MATERIAL"?tt(()=>{en(),Sr().then(()=>a.getEstimatedPoints())}):a.aiMessageType!="VIDEO_TRANSLATION"&&a.getEstimatedPoints(),localStorage.setItem("aiMessageType",n),a.isRegenerate)return a.isRegenerate=!1;ns()}},{immediate:!0,deep:!0}),Ne(()=>[a.podMaterialParams.podMaterialMode,a.podMaterialParams.podMaterialApplyBatchType],()=>{tt(en)},{deep:!0}),Ne(()=>{var n,s;return[a.podMaterialParams.podMaterialMode,a.podMaterialParams.podMaterialApplyBatchType,a.podMaterialParams.modelSkuId,(n=a.podMaterialParams.images)==null?void 0:n.length,(s=a.podMaterialParams.productImages)==null?void 0:s.length,a.podMaterialParams.imageCount,a.podMaterialParams.quality]},async()=>{Pe.value&&Ka.value?(await Sr(),a.getEstimatedPoints()):Xa(!1)}),Ne(()=>[a.videoChatMode,a.adMaterialVideoChatMode,a.adMaterialParams.materialType],Md),Ne(()=>a.videoGenerateParams,n=>{n&&localStorage.setItem("videoGenerateParams",JSON.stringify(n))},{deep:!0}),Ne(()=>a.imageGenerateParams.currentImageActiveId,(n,s)=>{if(a.aiMessageType!=="LINKPIX"||!n||!s)return;const v=(a.imageOptions||[]).find(M=>String(M.id)===String(n)),C=(a.imageOptions||[]).find(M=>String(M.id)===String(s));Sp({previousModel:C,currentModel:v})},{flush:"sync"}),Ne(()=>a.videoGenerateParams.currentTimeActiveId,(n,s)=>{if(a.aiMessageType!=="IMAGETOVIDEO"||!n||!s)return;const v=a.videoTimeData.find(M=>String(M.id)===String(n)),C=a.videoTimeData.find(M=>String(M.id)===String(s));$p({previousModel:C,currentModel:v})},{flush:"sync"}),Ne(()=>a.videoGenerateParams.currentTimeActiveId,n=>{var s,v,C,M,A;if(a.aiMessageType==="IMAGETOVIDEO"&&n){const ee=a.videoTimeData.find(pe=>String(pe.id)===String(n));if(ee){const pe=ee.videoSupported!==!0&&((s=a.batchUploadVideoUrls)==null?void 0:s.length),Le=ee.audioSupported!==!0&&((v=a.batchUploadAudioUrls)==null?void 0:v.length),ze=!!a.videoFileInfo;(pe||Le||ze)&&(pe&&Bo("video"),Le&&Bo("audio"),ze&&((C=H.value)==null||C.commands.setContent(""),st.value="",ye("update:messageInput","")),a.clearVideoGenerationUploads({videoFile:ze,videoReferences:!!pe,audioReferences:!!Le}))}}a.getEstimatedPoints(),Mr(),(M=H.value)!=null&&M.view&&((A=H.value)!=null&&A.state)&&H.value.view.updateState(H.value.state)},{deep:!0}),Ne(()=>a.videoGenerateParams.count,()=>{a.aiMessageType==="IMAGETOVIDEO"&&!a.videoFileInfo&&a.getEstimatedPoints()}),Ne(()=>{var n;return[a.imageGenerateParams.imageCount,(n=a.batchUploadImgUrls)==null?void 0:n.length,S(a.imageGenerateUseWay.useWayData)?Ir():0]},()=>{a.aiMessageType==="LINKPIX"&&a.getEstimatedPoints()}),Ne(Lo,()=>{a.aiMessageType==="LINKPIX"&&a.getEstimatedPoints()}),Ne(()=>a.imageGenerateParams.quality,()=>{a.aiMessageType==="LINKPIX"&&a.getEstimatedPoints()}),Ne(()=>{var n;return[a.longImageParams.imageCount,(n=a.longImageParams.materialImg)==null?void 0:n.length]},(n,s=[])=>{a.isDetailImg&&a.getEstimatedPoints()}),Ne(()=>a.mainImageChatMode,n=>{a.aiMessageType=="LINKPIX"&&(ki(),a.getEstimatedPoints(),n=="FREE_GENERATION"&&(a.imageGenerateParams.otherFreeSkuId="",a.imageGenerateParams.otherSkuIsSystemQuotaExhausted=!1,a.batchUploadImgUrls=[]))},{deep:!0}),Ne(()=>a.longImageChatMode,n=>{a.isDetailImg&&(localStorage.setItem("longImageDetailModel",n),a.getEstimatedPoints())}),Ne(()=>a.adMaterialChatMode,()=>{a.aiMessageType==="AD_MATERIAL"&&a.getEstimatedPoints()});const km=yn(()=>{a.aiMessageType==="AD_MATERIAL"&&a.getEstimatedPoints()},500);Ne(()=>[a.adMaterialParams.materialType,a.adMaterialParams.imageCount,a.adMaterialParams.videoDuration,a.adMaterialParams.aspectRatio,a.adMaterialParams.size,a.adMaterialParams.quality,(a.adMaterialParams.materialImg||[]).length],()=>{km()}),Ne(()=>a.batchUploadVideoUrls,()=>{a.aiMessageType==="IMAGETOVIDEO"&&a.getEstimatedPoints()});const An=F(()=>a.aiMessageTypes.includes(a.aiMessageType)),wm=F(()=>_r.value||!An.value?"100%":a.aiMessageType==="IMAGETOVIDEO"&&!a.videoFileInfo&&Q.value?"calc(100% - 138px)":"calc(100% - 70px)"),os=n=>{a.aiMessageType!=="IMAGETOVIDEO"&&(a.aiMessageType="IMAGETOVIDEO"),_e.isExpand||ye("update:isExpand",!0),tt(()=>{et==null||et.value.selectCharacter(n)})},Pm=()=>{H.value.commands.setContent(""),st.value=""},Mm=n=>{a.batchUploadImgUrls.length&&U.confirm({title:d("agent.index.174028-0"),icon:St(pa),content:St("div",[St("div",{},[St("span",[d("components.AIChatInput.738063-14")]),St("span",{style:"color:#5A36FE"},[d("components.AIChatInput.738063-15")]),St("span",[d("components.AIChatInput.738063-16")])])]),onOk(){var s;a.isObtain=!1,H.value.commands.setContent(""),st.value="",(s=it.value)==null||s.beginnerPrompt()},onCancel(){}})};return g({selectAgent:tl,selectExample:Gi,selectCharacter:os,init:ro,handleClickSame:fn,sendPrompt:um,handlePasteByFile:Qp,handleAddUrl:dl,cleanParams:em,startPromptGeneration:rm,initParams:Hi,switchMainImageModelByKey:Ji,setLongImage:Zp,clickInput:()=>{H.value.getText().trim().length>0||ns({resetParams:!1})},initSku_Long_options:ns}),(n,s)=>{var vn,ss,Un;const v=nf,C=g_,M=Wt,A=U3,ee=P3,pe=z5,Le=A2,ze=Xn,Ze=Jv,ht=Lv,dt=ca,Mt=Bt,Xt=ei,La=uv;return l(),f("div",{class:"relative w-full",style:Nt(u.isChatPinned&&!u.isExpand?{"clip-path":"inset(0 round 16px)",height:"100%"}:"")},[t("div",{class:Qe(["ai-chat-input-container",{homeStyle:u.isHomeStyle&&!u.isChatPinned,chat_pinned_style:u.isChatPinned}])},[t("div",Dq,[t("div",{class:"editor-container",ref_key:"editorRef",ref:
149at,onPaste:Lp},[e(H)?(l(),f(we,{key:0},[e(a).chatImage?(l(),f("div",Oq,[t("div",Nq,[y(v,{src:e(a).chatImage,alt:"",class:"max-w-72px max-h-72px"},null,8,["src"]),t("img",{src:Ig,alt:"",class:"delete-icon",onClick:s[0]||(s[0]=Pt=>ar("img"))})])])):he("",!0),e(a).chatFile.fileUrl?(l(),ve(yf,{key:1,"file-info":e(a).chatFile,onClean:s[1]||(s[1]=Pt=>ar("file"))},null,8,["file-info"])):he("",!0),t("div",{class:Qe(e(_r)?"":"flex items-start")},[!e(a).isImageQuote&&!e(a).isVideoQuote?(l(),f(we,{key:0},[e(a).aiMessageType=="LINKPIX"&&e(a).mainImageChatMode!="FREE_GENERATION"?(l(),f(we,{key:0},[e(a).imageGenerateUseWay.showComponents?(l(),f(we,{key:0},[S(e(a).imageGenerateUseWay.useWayData)?(l(),ve(z6,{key:0,ref_key:"modelUploadImgRef",ref:je,placeholderList:e(a).imageGenerateUseWay.placeholderList,"reference-rules":e(V),onPromptChange:xr,onStateChange:br},null,8,["placeholderList","reference-rules"])):(l(),ve(I6,{key:1,ref_key:"modelUploadImgRef",ref:je,imageList:e(_t),placeholderList:e(a).imageGenerateUseWay.placeholderList,"reference-rules":e(V),onPromptChange:xr,onStateChange:br},null,8,["imageList","placeholderList","reference-rules"]))],64)):(l(),ve(c9,{key:1,onClick:s[2]||(s[2]=Be(()=>{},["stop"])),ref_key:"batchUploadImgRef",ref:ot,maxCount:e(hi),limitTip:e(nd),"reference-rules":e(V),onStartUploading:s[3]||(s[3]=Pt=>ut.value=!0),onEndUploading:s[4]||(s[4]=Pt=>ut.value=!1),onSuccess:lm},null,8,["maxCount","limitTip","reference-rules"]))],64)):he("",!0),e(a).aiMessageType=="IMAGETOVIDEO"?(l(),f("div",Rq,[!e(a).videoFileInfo&&e(Q)?(l(),ve(P7,{key:0,onClick:s[5]||(s[5]=Be(()=>{},["stop"])),ref_key:"videoGenerateUploadRef",ref:qt,rules:e(de),onSuccess:sm,onStartUploading:s[6]||(s[6]=Pt=>At.value=!0),onEndUploading:s[7]||(s[7]=Pt=>At.value=!1),onVideoReference:Zi,onVideoDeleted:Pp},null,8,["rules"])):he("",!0),y(Vu,{class:"video-batch-material",onClick:s[8]||(s[8]=Be(()=>{},["stop"])),ref_key:"videoBatcGenerateRef",ref:it,mimeType:"image/jpeg",returnOriginalWhenLarger:!1,isSendDisabled:e(Ot),maxCount:e(w),"reference-rules":e(V),imagesList:e(a).batchUploadImgUrls,isGeneratePromptForm:!1,drawerVisible:e(Aa),isGetSameStyle:!e(no),onSuccess:om,onStartUploading:s[9]||(s[9]=Pt=>ut.value=!0),onEndUploading:s[10]||(s[10]=Pt=>ut.value=!1),onUpdateScript:Zd,onClearFile:Pm,onMaterialReference:Qi,onImageDeleted:ol},null,8,["isSendDisabled","maxCount","reference-rules","imagesList","drawerVisible","isGetSameStyle"]),(vn=e(a).batchUploadAudioUrls)!=null&&vn.length?(l(),f("div",{key:1,class:"audio-reference-list",onClick:s[11]||(s[11]=Be(()=>{},["stop"]))},[(l(!0),f(we,null,Je(e(a).batchUploadAudioUrls,(Pt,Ln)=>(l(),ve(zu,{key:Pt.url||Pt.id||Ln,item:Pt,index:Ln,"media-type":"audio",onReference:Zi,onDelete:Tp},null,8,["item","index"]))),128))])):he("",!0)])):he("",!0),e(a).aiMessageType=="LONGIMAGE"||e(a).aiMessageType=="POSTERIMAGE"||e(a).aiMessageType=="SOCIALMEDIA"?(l(),ve(qb,{key:2,onClick:s[12]||(s[12]=Be(()=>{},["stop"])),ref_key:"longUploadMaterialRef",ref:sa,onSuccess:vr},null,512)):he("",!0),e(a).aiMessageType=="AD_MATERIAL"?(l(),ve(eI,{key:3,onClick:s[13]||(s[13]=Be(()=>{},["stop"])),ref_key:"adUploadMaterialRef",ref:ue,onSuccess:op,onMaterialReference:Qi,onImageDeleted:ol},null,512)):he("",!0),e(a).aiMessageType==="POD_MATERIAL"?(l(),ve(C,{key:4,onClick:s[14]||(s[14]=Be(()=>{},["stop"])),ref_key:"podUploadMaterialRef",ref:ke},null,512)):he("",!0),e(a).aiMessageType=="VIDEO_TRANSLATION"?(l(),ve(q$,{key:5,onClick:s[15]||(s[15]=Be(()=>{},["stop"])),ref_key:"videoTranslationUploadRef",ref:lt},null,512)):he("",!0)],64)):(l(),f(we,{key:1},[e(a).isVideoQuote?(l(),ve(GS,{key:0})):(l(),ve(US,{key:1}))],64)),t("div",{class:Qe(["py-6px",[u.isChatPinned&&!u.isExpand?"h-66px overflow-hidden":""]]),style:Nt({width:e(wm)})},[t("div",{class:Qe(["tiptap-editor-content",{"tiptap-editor-content--disabled":!e(ge)}]),style:Nt({"max-height":u.isChatPinned?"800px":e(An)?"252px":"132px"})},[e(a).aiMessageType=="VIDEO_TRANSLATION"?(l(),f("div",Fq,r(e(d)("components.AIChatInput.849692-99")),1)):e(a).videoFileInfo?(l(),f("div",Gq,r(e(d)("components.AIChatInput.738063-1")),1
149)):(l(),ve(M,{key:2,spinning:e(_),tip:e(Et)},{default:P(()=>[y(e(of),{editor:e(H),id:"tiptap-editor",class:"tiptap-editor",style:Nt(e(nm))},{default:P(()=>[...s[24]||(s[24]=[De("22",-1)])]),_:1},8,["editor","style"])]),_:1},8,["spinning","tip"]))],6),e(a).aiMessageType=="IMAGETOVIDEO"&&((ss=e(K))!=null&&ss.promptByteLimit)&&!e(Ot)?(l(),f("div",Vq,[t("span",zq,r(e(Ce)),1),De(" / "+r(e(K).promptByteLimit),1)])):he("",!0)],6)],2)],64)):(l(),f("div",Bq,r(e(d)("components.AIChatInput.950192-0")),1))],544),!u.isChatPinned||u.isExpand?(l(),f("div",Kq,[t("div",Wq,[e(Se)&&!e(An)?(l(),f(we,{key:0},[t("div",{class:Qe(["item",{"device-warning":!e(Xe)&&e(Ae)}]),onClick:s[16]||(s[16]=Pt=>Te.value=!0)},r(e(d)("components.AIChatInput.950192-1")),3),(l(!0),f(we,null,Je(e(Ye),(Pt,Ln)=>(l(),f(we,{key:Ln},[Pt.required&&(!Pt.hidden||Pt.hidden&&Pt.isChatInput)?(l(),f("div",{key:0,class:Qe(["item",{"device-warning":e(Ue).includes(Pt.key)}]),onClick:CD=>Bi(Pt)},r(Pt.label),11,jq)):he("",!0)],64))),128)),t("div",{class:"item relative",style:{"margin-right":"22px"},onClick:s[17]||(s[17]=Pt=>gt.value=!0)},[s[25]||(s[25]=t("img",{src:w0,alt:"",class:"w-34px h-14px absolute top-[-4px] right-[-20px]"},null,-1)),De(" "+r(e(d)("components.AIChatInput.950192-2")),1)]),e(Me)&&e(Me).length?(l(),f("div",{key:0,class:"item",onClick:s[18]||(s[18]=Pt=>pt.value=!0)},r(e(d)("components.AIChatInput.950192-3")),1)):he("",!0)],64)):he("",!0),e(Ge)&&(e(An)||e(a).aiMessageType=="VIDEO_TRANSLATION")?(l(),ve(A,{key:1,isChatPinned:u.isChatPinned},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType=="LINKPIX"?(l(),ve(ky,{key:2,onSelectNum:Hp,onChangeMainImageMode:Qo,isChatPinned:u.isChatPinned,isSystemQuotaExhausted:e(dn)},null,8,["isChatPinned","isSystemQuotaExhausted"])):he("",!0),e(a).aiMessageType=="IMAGETOVIDEO"&&!e(a).videoFileInfo?(l(),ve(Px,{key:3,ref_key:"videoParamsRef",ref:uo,checkTypeIsDisabled:yd,isChatPinned:u.isChatPinned,showCountSelect:e(te),modeLoading:e(zt),onModeChange:tm,onClear:Mm,onSelectAudio:wp},null,8,["isChatPinned","showCountSelect","modeLoading"])):he("",!0),e(a).aiMessageType=="LINKPIX"&&e(L)||e(a).aiMessageType=="IMAGETOVIDEO"&&!e(a).videoFileInfo&&e(oe)?(l(),ve(yu,{key:4,ref_key:"characterSelectPopover",ref:et,isChatPinned:u.isChatPinned,onSelect:kp},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType=="LINKPIX"?(l(),ve(ee,{key:5,isChatPinned:u.isChatPinned,onChooseUseWay:ts,onClear:es},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType=="LONGIMAGE"||e(a).aiMessageType=="POSTERIMAGE"||e(a).aiMessageType=="SOCIALMEDIA"?(l(),ve(pe,{key:6,ref_key:"longImageParamsRef",ref:Xp,isChatPinned:u.isChatPinned,longImageOptionsList:e(To),modeLoading:e(zt),onSelectNum:jp,onChangeLongImageMode:pl},null,8,["isChatPinned","longImageOptionsList","modeLoading"])):he("",!0),e(a).aiMessageType=="AD_MATERIAL"?(l(),ve(Eq,{key:7,isChatPinned:u.isChatPinned,modeLoading:e(zt),onApplyConfig:np,onPromptModeChange:am},null,8,["isChatPinned","modeLoading"])):he("",!0),e(a).aiMessageType=="POD_MATERIAL"?(l(),ve(Le,{key:8,isChatPinned:u.isChatPinned},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType=="VIDEO_TRANSLATION"?(l(),ve(u$,{key:9,isChatPinned:u.isChatPinned},null,8,["isChatPinned"])):he("",!0)]),t("div",Hq,[u.showAgent&&!e(An)?(l(),f(we,{key:0},[t("div",Jq,[t("span",Yq,r(e(d)("components.AIChatInput.950192-4")),1),y(ze,{checked:e(a).isOnLine,"onUpdate:checked":s[19]||(s[19]=Pt=>e(a).isOnLine=Pt),onChange:yp},null,8,["checked"])]),t("div",Qq,[y(Ze,{ref_key:"SelectionKnowledgeBaseSelectorRef",ref:se},null,512)]),t("div",Xq,[y(ht)]),y(dt,{title:e(d)("components.AIChatInput.950192-5")},{default:P(()=>[t("div",{class:"actions-icon-button default",onClick:Bd}," @ ")]),_:1},8,["title"]),t("div",Zq,[y(Mt,{placement:"top",arrow:!1,overlayInnerStyle:{padding:"20px 0 20px 20px"}},{content:P(()=>[t("div",eD,[t("div",tD,[s[26]||(s[26]=t("img",{src:M0,alt:"",class:"w-18px h-18px mr-8px"},null,-1)),De(" "+r(u.exampleList&&u.exampleList.length?e(d)("components.AIChatInput.950192-9"):e(d)("components.AIChatInput.950192-10")),1)]),u.exampleList.length?(l(),f("div",aD,[t("div",nD,[(l(!0),f(we,null,Je(u.exampleList,Pt=>(l(),f("div",{class:"agent-item",key:Pt.id,onClick:Ln=>Gi(Pt)},[t("div",null,r(Pt),1),t("div",sD,[y(e(Jr),{style:{width:"9px",height:"9px",color:"#ADADAD"}})])],8,oD))),128))])])):u.agentList.length?(l(),f("div",lD,[t("div",iD,[(l(!0),f(we,null,Je(u.agentList.slice(0,4),Pt=>(l(),f("div",{class:"agent-item",key:Pt.id,onClick:Ln=>tl(Pt)},[t("div",null,r(Pt.chatCreateExample||Pt.name),1),t("div",cD,[y(e(Jr),{style:{width:"9px",height:"9px",color:"#ADADAD"}})])],8,rD))),128))])])):he("",!0)])]),default:P(()=>[s[27]||(s[27]=t("img",{src:P0,alt:"",class:"w-24px h-24px"},null,-1))]),_:1})])],64)):he("",!0),t("div",uD,[e(a).aiMessageType!="NORMAL"?(l(),f(we,{key:0},[e(a).aiMessageType=="VIDEO_TRANSLATION"?(l(),f(we,{key:0},[e(a).VideoTranslationScore?(l(),f("span",dD,[De(r(e(d)("components.AIChatInput.912708-0"))+" ",1),s[28]||(s[28]=t("img",{src:Hr,alt:"",class:"w-16px h-16px mx-2px"},null,-1)),De(" "+r(e(a).VideoTranslationScore),1)])):he("",!0)],64)):(l(),f(we,{key:1},[e(na)&&e(bi)?(l(),f("span",pD,r(e(d)("workbench.personal.076990-3"))+r(e(Os))+"/"+r(e(mi))+r(e(d)("components.AIChatInput.266484-0")),1
149)):e(na)&&e(cd)?(l(),f("span",mD,r(e(d)("components.AIChatInput.237013-0")),1)):e(na)&&e(ud)?(l(),f("span",gD,r(e(d)("components.AIChatInput.237013-0")),1)):e(na)&&e(a).getWithhold?(l(),f("span",fD,[De(r(e(d)("components.AIChatInput.912708-0"))+" ",1),s[29]||(s[29]=t("img",{src:Hr,alt:"",class:"w-16px h-16px mx-2px"},null,-1)),De(" "+r(e(a).getWithhold),1)])):he("",!0)],64))],64)):he("",!0),u.isSending?(l(),f("div",{key:2,class:"actions-icon-button danger flex items-center",onClick:zd},[...s[30]||(s[30]=[t("img",{src:S0,class:"w-24px h-24px object-contain",alt:""},null,-1)])])):(l(),f("div",{key:1,class:Qe(["actions-icon-button primary",{disabled:e(Ct)}]),onClick:Gd},[e(m)?(l(),ve(M,{key:0,size:"small"})):(l(),ve(e(gu),{key:1}))],2))])])])):he("",!0)]),(Un=e(c))!=null&&Un.isTheActivityListed&&e(id)&&!e(R)?(l(),f("div",{key:0,class:"absolute right-[-46px] bottom-[38px] active-618-tag",onClick:rd}," ä¹°ä¸éä¸ ")):he("",!0)],2),y(Xt,{dashed:!0,style:{margin:"0"}}),t("div",{class:Qe(["flex items-center linkpix-fn-container",[u.isChatPinned?"py-12px px-12px":"mt-20px chatPinned"]])},[e(a).aiMessageType==="IMAGETOVIDEO"?(l(),ve(AE,{key:0,isChatPinned:u.isChatPinned,visible:e(Aa),"onUpdate:visible":s[20]||(s[20]=Pt=>Fe(Aa)?Aa.value=Pt:null),onOnPromptGenerateVideo:cm,onOnGenerateVideo:fm},null,8,["isChatPinned","visible"])):he("",!0),e(a).aiMessageType==="LINKPIX"?(l(),ve(tM,{key:1,isChatPinned:u.isChatPinned,"switch-main-image-model":Ji,onOnClick:fn,onUseWay:ts,onUpdatePrompt:lo},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType=="SOCIALMEDIA"?(l(),ve(li,{key:2,isChatPinned:u.isChatPinned,onUpdatePrompt:lo},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="LONGIMAGE"?(l(),ve(bM,{key:3,isChatPinned:u.isChatPinned,onUpdatePrompt:lo,onOnClick:fn},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="POSTERIMAGE"?(l(),ve(ZM,{key:4,isChatPinned:u.isChatPinned,onUpdatePrompt:lo,onOnClick:fn},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="AD_MATERIAL"?(l(),ve(gS,{key:5,isChatPinned:u.isChatPinned,onUpdatePrompt:lo,onOnClick:fn},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="POD_MATERIAL"?(l(),ve(La,{key:6,isChatPinned:u.isChatPinned},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="SOCIALMEDIA"?(l(),ve(wS,{key:7,isChatPinned:u.isChatPinned,onOnClick:fn},null,8,["isChatPinned"])):he("",!0),e(a).aiMessageType==="VIDEO_TRANSLATION"?(l(),ve(OM,{key:8,isChatPinned:u.isChatPinned},null,8,["isChatPinned"])):he("",!0)],2),e(nt)?(l(),ve(S_,{key:0,onClose:Kd,onSelectAgent:tl,currentChat:u.currentChat}
149,null,8,["currentChat"])):he("",!0),e(Te)?(l(),ve(q_,{key:1,onClose:Wd,onSelectDevice:Qd,currentDeviceItem:e(Xe),currentChat:u.currentChat,isBlurSave:!0},null,8,["currentDeviceItem","currentChat"])):he("",!0),e(gt)?(l(),ve(G_,{key:2,onClose:Hd,execValue:e(Vt),"onUpdate:execValue":s[21]||(s[21]=Pt=>Fe(Vt)?Vt.value=Pt:null),isBlurSave:!0,selectDevice:e(Xe)},null,8,["execValue","selectDevice"])):he("",!0),e(pt)?(l(),ve(oc,{key:3,onClose:jd,formData:e(D),"onUpdate:formData":s[22]||(s[22]=Pt=>Fe(D)?D.value=Pt:null),currentChat:u.currentChat,paramFormat:e(Me),isBlurSave:!0},null,8,["formData","currentChat","paramFormat"])):he("",!0),e(ta)?(l(),f("div",vD,[(l(),ve(rn(e(Ht)),In({modelValue:e(wt)[e(ea).key],"onUpdate:modelValue":s[23]||(s[23]=Pt=>e(wt)[e(ea).key]=Pt),currentDeviceItem:e(Xe),currentChat:u.currentChat,paramFormat:e(ft),isBlurSave:!0,onClose:up},Up(e(ea)),{onOk:Ki}),null,16,["modelValue","currentDeviceItem","currentChat","paramFormat"]))])):he("",!0)],4)}}}),KD=It(bD,[["__scopeId","data-v-86ce9c21"]]);export{L3 as L,KD as _,ES as a,kn as g};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.