PageSourceSearch

https://visro.ai/_nuxt/DCZk97Hs.js

js visro.ai collected 2026-10-05 13:15:38 UTC 14,750 bytes, 1 lines download raw bytes

1import{_ as e}from"./Bldqe1My.js";import{_ as a}from"./BEeIpIbd.js";import{_ as t}from"./TDeqBoVR.js";import{_ as s}from"./BnVnsD-J.js";import{f as i,t as l,j as o,m as n,p as r,$ as u,c,o as d,a1 as m,u as f,w as p,q as g,a3 as v,ae as b,g as _,b as x,d as k,a as h,y,s as P,C as T,ap as w,W as I,B as C,ao as q}from"./CxpHt3i8.js";import{s as U,f as S,$ as j,u as L,T as A,R as B,h as E}from"#entry";import{u as F,L as $,S as R,m as O,g as N,l as W}from"./BxmXk4u3.js";import{u as G}from"./pOOtZPOT.js";import{s as z}from"./COH8ZT7G.js";import{r as M}from"./DLQSMUM_.js";import{r as D}from"./BG5wYiFG.js";import{r as Q}from"./B-lORaCV.js";import{u as H}from"./DfNKXL8x.js";import{u as J}from"./CTWJHKyp.js";import{_ as V}from"./CLiBHw5z.js";import"./C06JTmLM.js";import"./CCwCS0PT.js";import"./gHxtaHIT.js";import"./B7WOy1Yf.js";import"./N8G8b7jw.js";import"./B8UCMiMp.js";import"./jKeUyJ0T.js";import"./_3JMGzsr.js";/* empty css        */import"./DMmAHxXZ.js";import"./Br2DsMp3.js";const Y=i({__name:"BtnImageFaceSwap",props:{disabled:{type:Boolean,default:!1},fnName:{type:String,required:!0},getSendData:{type:Function,required:!0},beforeSubmit:{type:Function,requeired:!1},needUsePoints:{type:Boolean,default:!0},points:{type:Number,default:0},pollingLimit:{type:Number,default:60},requestPlatformType:{type:String,default:"faceswap-face",requeired:!1},pointsType:{type:String,default:""}},setup(e){const{verifyPoints:a,usePoints:t,useFreePoints:s,useVIPPoints:i,globalConfig:_,isLogin:x,verifyLogin:k,showBuyPointsModal:h}=F(),{generateResult:y,demoName:P,cancelTaskPolling:T,startAnotherTask:w}=U(S()),I=S(),C=e,q=j.fsApiPrefix??"",W=L().public.apiHost,M=l({fn_name:C.fnName,task_id:"",rank:null,queue_len:0,rank_queue:0,polling_count:0,queue_polling_count:0,is_vip_queue:-1,status:-1,loadingText:o(()=>M.status===A.CREATING?"Creating Task...":0===M.status?`Queue: ${M.rank} / ${M.queue_len}`:1===M.status?"Generating...":"Handling..."),percentage:o(()=>{if(M.status===A.QUEUEING&&M.rank&&M.rank_queue)return 5+Math.round((M.rank_queue-M.rank)/M.rank_queue*45);if(M.status===A.GENERATING){let e=1,a=50+M.polling_count*e;return a>=99?99:a}return M.status===A.SUCCESS?100:0})}),D=o(()=>C.requestPlatformType!==B.FACESWAPFACE&&C.requestPlatformType!==B.FACESWAMULTIPFACE),Q=o(()=>{if(C.points)return C.points;let e=0;return _.value&&_.value[C.fnName]&&(e=_.value.faceswap.video_free_points),e}),H=E(),J=G(H.path);let V=null;n(()=>M,()=>{M.task_id&&(Y.setItem("createTask",M),I.setTaskInfoPercentage(M.percentage),I.setTaskInfoLoadingText(M.loadingText),I.setTaskInfoQueuePollingCount(M.queue_polling_count))},{deep:!0});const Y=new $(j.brandPrefix+P.value),K=e=>{ie(),Y.removeItem("createTask"),637===e?.code&&k(),638===e?.code&&h()},X=e=>{if(e.source_image){const a=e.source_image.split("/").pop().split(".")[0];ae.set(a,e.source_image)}Z()},Z=()=>{x.value&&_.value&&C.needUsePoints&&(Q.value?"free"===C.pointsType?s(Q.value):"vip"===C.pointsType&&i(Q.value):t(_.value.faceswap.video_free_points))},ee=r("updateInitTourStatus",e=>{});u(()=>{(()=>{I.setBatchTaskInfoLoading(!1),ie();const e=Y.getItem("createTask");if(e)J.setPageInitTourStatus(!1),ee(!1),I.setTaskInfoLoading(!0),I.setTaskInfoLoadingText(e.loadingText),I.setTaskInfoPercentage(e.percentage),I.setTaskInfoQueuePollingCount(e.queue_polling_count),I.setTaskInfoTaskId(e.task_id),y.value="",se(e),ne(P.value,C.pollingLimit)})()});let ae=new Map;const te=async()=>{if(C.beforeSubmit&&!C.beforeSubmit())return;if(J.setPageInitTourStatus(!1),I.setTaskInfoLoading(!0),x.value&&_.value&&!k())return void I.setTaskInfoLoading(!1);if(x.value&&_.value&&C.needUsePoints&&!a(Q.value))return void I.setTaskInfoLoading(!1);if(Y.getItem("createTask"))return I.setTaskInfoLoading(!1),void R.fire({icon:"warning",title:"Please wait for the previous task to complete",confirmButtonText:"Ok, I got it"});y.value="",O();try{const e=await C.getSendData();le(e,P.value,X,C.requestPlatformType,C.pollingLimit)}catch(e){I.setTaskInfoLoading(!1)}},se=e=>{M.fn_name=e.fn_name,M.polling_count=e.polling_count,M.queue_len=e.queue_len,M.rank=e.rank,M.rank_queue=e.rank_queue,M.status=e.status,M.task_id=e.task_id,M.queue_polling_count=e.queue_polling_count},ie=()=>{I.setTaskInfoLoading(!1),I.setTaskInfoLoadingText("handling..."),I.setTaskInfoPercentage(0),I.setTaskInfoQueuePolling
1Count(0),I.setTaskInfoTaskId(""),y.value=""},le=(e,a,t,s="faceswap-face",i=200)=>{let l="/fs/generate-face";s===B.FACESWAMULTIPFACE?l="/fs/generate-multi-face":s===B.FACESWAGIFFACE?l="/fs/generate-gif-face":s===B.FACESWABATCHFACE&&(l="/fs/generate-batch-face"),N({method:"POST",url:W+q+l,data:{consume_type:-1,...e}}).then(e=>{200===e.code?e.data.task_id?(M.task_id=e.data.task_id,M.rank=e.data.rank,M.is_vip_queue=void 0!==e.data.is_vip_queue?e.data.is_vip_queue:0,t&&t(e),I.setTaskInfoTaskId(e.data.task_id),oe(a,i)):(K(),ue()):(K(),ue(),R.fire({icon:"error",title:"Oops...",text:e.msg,buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn-primary"}}))}).catch(e=>{K(),ue()})},oe=(e,a=200)=>{let t=0;V=z(()=>{if(t++,t>a)return re(),K(),ue(),void R.fire({icon:"error",title:"Task timeout, please try again.",buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn-primary"}});ne(e)},3e3)},ne=e=>{if(I.cancelTaskPolling)return re(),void ue();N({method:"post",url:W+q+"/fs/image-check-status",data:{task_id:M.task_id,is_batch:D.value,is_vip_queue:-1!==M.is_vip_queue?M.is_vip_queue:0}}).then(a=>{if(e===P.value)if(200===a.code)switch(a.data.status){case-1:v({title:"Warning",message:"Not find this task.",type:"warning"}),K(),ue(),re();break;case 0:M.queue_polling_count++,ce(a.data),V=setTimeout(()=>ne(e,pollingLimit),3e3);break;case 1:if(M.polling_count>pollingLimit)return K(),ue(),void R.fire({icon:"error",title:"Timeout, please try again!",buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn-primary"}}).finally(()=>{re()});M.polling_count++,ce(a.data),V=setTimeout(()=>ne(e,pollingLimit),3e3);break;case 2:(e=>{ie(),Y.removeItem("createTask"),Array.isArray(e.result_image)||e.result_image.startsWith("http")?y.value=e.result_image:y.value=j.cdnPathPrefix+e.result_image,R.fire({icon:"success",title:"Success!",toast:!0,timer:3e3,showConfirmButton:!1,position:"top-end"})})(a.data),ue(),re();break;case 3:R.fire({icon:"error",title:a.data?.error||"Failed. Please try again later.",buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn-primary"}}),K(),ue(),re()}else K(a),ue(),re();else re()}).catch(e=>{K(),ue(),re()})},re=()=>{V&&clearTimeout(V),V=null,M.polling_count=0,M.queue_polling_count=0},ue=()=>{M.task_id="",M.rank=null,M.queue_len=0,M.rank_queue=0,M.polling_count=0,M.queue_polling_count=0,M.status=-1,M.is_vip_queue=-1},ce=({rank:e,status:a})=>{M.rank=e,M.status=a};return n(()=>T.value,e=>{e&&((async()=>{try{const e=await N({url:W+q+"/fs/image-cancel-task",method:"post",data:{task_id:M.task_id,is_batch:D.value,is_vip_queue:-1!==M.is_vip_queue?M.is_vip_queue:0}});if(ie(),Y.removeItem("createTask"),re(),e.data.cancelled)return void b.success("Task cancelled successfully");R.fire({icon:"error",title:"Failed to cancel task.",text:e.data.message||"Please try again later.",buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn-primary"}})}catch(e){}finally{K(),ue()}})(),T.value=!1)}),n(()=>w.value,e=>{e&&(re(),ue(),ie(),Y.removeItem("createTask"),w.value=!1)}),(a,t)=>{const s=m;return d(),c(s,{size:"large",type:"primary",class:"yi-submit-btn",onClick:te,loading:f(I).taskInfo.loading,disabled:e.disabled},{default:p(()=>[g(a.$slots,"default"),g(a.$slots,"points")]),_:3},8,["loading","disabled"])}}}),K=Object.assign(Y,{__name:"BtnImageFaceSwap"}),X=[{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/b65bd5859194a4736504dfc9f334635c.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/dc74d2f1c8bc8e4c0318f9c2eb7f8897.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/d895bfe51ba22807e5171588dd94b554.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/76d760f7a76b868d8521cdbb06237cd4.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/aea55077d946ab800a3777e44671a1b0.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/9816d46c22f7f3de612a3631e659e633.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/9e225a9b22a4a538c3fc9ccd0a153bbe.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/356b348fded6de55b62ca6e01d73498b.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/df3d3bb911aa39d91f822e63a1f41783.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/bd1dec2cbe3502a667e43ecf2a89bf39.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/6bfb0e594ce8c6d45b761036aca46869.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/260c29facdf209d5476525eb2cbb55fa.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/7821b01548f4c060f6b0bc998c1094a1.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/5b9bfbf3ba15ef6d3de1e50b89de44f6.webp`},{imageUrl:`${j.tempCdnPathPrefix}demo/pixnova/images/728798bdcfce289cd096951c56f92f58.webp`}],Z={class:"w-full h-full flex flex-col gap-3 text-sm"},ee={class:"flex-1 flex flex-col w-full min-h-0 bg-white border-[0px] yi-tools-box dark:bg-muted-950"},ae={class:"py-3 flex-1 min-h-0"},te={class:"h-full px-3 flex flex-col overflow-auto yi-scrollbar"},se={class:""},ie={class:"flex-1 flex flex-col min-h-[200px]"},le={class:"max-md:mt-3 mt-5"},oe={class:"max-md:mt-3 mt-5 flex-1"},ne={key:0,class:"w-full h-full flex flex-col justify-center items-center"},re={class:"hidden md:block"},ue={class:"el-upload__text"},ce={class:"text-sm"},de={class:"image-slot"},me={class:"size-4"},fe={class:"flex-1 flex flex-col min-h-[200px]"},pe={class:"max-md:mt-3 mt-5"},ge={class:"max-md:mt-3 mt-5 flex-1"},ve={key:0,class:"w-full h-full flex flex-col justify-center items-center"},be={class:"hidden md:block"},_e={class:"el-upload__text"},xe={class:"text-sm"},ke={class:"image-slot"},he={class:"size-4"},ye={class:"w-full yi-submit-box p-3",style:{border:"0 !important"}},Pe=V(i({__name:"GenerationPanel",setup(e){const a=_([]),i=_([]),l=_(""),o=_(""),{taskInfo:r,taskState:u}=U(S()),m=_(""),g=J(),v=e=>!(e.size>1048576*j.maxImgSize)||(R.fire({icon:"warning",title:`The uploaded picture cannot exceed ${j.maxImgSize}M, please check and upload again.'`,buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn btn-primary"}}),!1),L=async()=>{let e=W(l.value);a.value.length&&(e=await H(a.value[0].raw,"single-face",B.FACESWAPFACE));return{...{source_image:e,face_image:await H(i.value[0].raw,"single-face",B.FACESWAPFACE)},request_from:j.brandId}},A=()=>!(!a.value.length&&!l.value||!i.value.length)||(b.error("Please upload your image."),!1),E=(e,t)=>{a.value.length>1&&a.value.shift(),l.value&&(URL.revokeObjectURL(l.value),l.value="");const s=URL.createObjectURL(t.raw);l.value=s},F=(e,a)=>{i.value.length>1&&i.value.shift(),o.value&&(URL.revokeObjectURL(o.value),o.value="");const t=URL.createObjectURL(a.raw);o.value=t},$=e=>r.value.loading?Promise.reject(null):new Promise((a,t)=>{a(e)}),O=e=>{"sourceImage"===e&&(a.value=[],URL.revokeObjectURL(l.value),l.value="",m.value=""),"faceImage"===e&&(i.value=[],URL.revokeObjectURL(o.value),o.value="")};return n(m,e=>{a.value=[],URL.revokeObjectURL(l.value),l.value=e}),(e,n)=>{const b=t,_=s,U=w,S=q,R=K;return d(),x("div",Z,[k("div",ee,[n[11]||(n[11]=k("div",{class:"border-b border-gray-200 dark:border-gray-600"},[k("div",{class:"text-black py-3 px-3 border-b-2 border-b-transparent font-semibold -mb-px flex space-x-8 text-[18px]"},"AI Yearbook Generator")],-1)),k("div",ae,[k("div",te,[k("div",se,[h(b,{templates:f(X),tips:"The template images are uploaded by users. If you have any privacy concerns about the content, feel free to reach out to us — we’ll handle it promptly.",selectedTemplate:m.value,"onUpdate:selectedTemplate":n[0]||(n[0]=e=>m.value=e)},null,8,["templates","selectedTemplate"])]),k("div",ie,[k("div",le,[h(_,{num:1,title:"Upload source image with a face"})]),k("div",oe,[h(S,{class:C(["w-full relative h-[200px] sm:h-[250px]",{"curs
1or-not-allowed":f(r).loading}]),"show-file-list":!1,accept:f(g),"before-upload":v,"file-list":a.value,"onUpdate:fileList":n[2]||(n[2]=e=>a.value=e),"on-success":E,"http-request":$,drag:""},{default:p(()=>[l.value?(d(),c(U,{key:1,class:"w-full h-full yi-generate-image",fit:"contain",src:l.value},{placeholder:p(()=>[k("div",de,[k("div",me,[h(f(D))]),n[7]||(n[7]=k("div",null,"Loading...",-1))])]),_:1},8,["src"])):(d(),x("div",ne,[k("div",re,[h(f(M),{class:"size-14 text-gray-500"})]),k("div",ue,[n[5]||(n[5]=P(" Drop file here or ",-1)),n[6]||(n[6]=k("em",null,"click to upload",-1)),k("div",ce,"(JPG、PNG、WEBP) <= "+T(f(j).maxImgSize)+"MB",1)])])),l.value?(d(),x("div",{key:2,class:"w-[30px] h-[30px] shadow rounded-full absolute cursor-pointer flex justify-center items-center bg-white",title:"Remove avatar",onClick:n[1]||(n[1]=I(e=>O("sourceImage"),["stop"])),style:{top:"10px",right:"10px"}},[h(f(Q),{class:"size-5"})])):y("",!0)]),_:1},8,["class","accept","file-list"])])]),k("div",fe,[k("div",pe,[h(_,{num:2,title:"Upload a face image"})]),k("div",ge,[h(S,{class:C(["w-full relative h-[200px] sm:h-[250px]",{"cursor-not-allowed":f(r).loading}]),"show-file-list":!1,accept:f(g),"before-upload":v,"file-list":i.value,"onUpdate:fileList":n[4]||(n[4]=e=>i.value=e),"on-success":F,"http-request":$,drag:""},{default:p(()=>[o.value?(d(),c(U,{key:1,class:"w-full h-full yi-generate-image",fit:"contain",src:o.value},{placeholder:p(()=>[k("div",ke,[k("div",he,[h(f(D))]),n[10]||(n[10]=k("div",null,"Loading...",-1))])]),_:1},8,["src"])):(d(),x("div",ve,[k("div",be,[h(f(M),{class:"size-14 text-gray-500"})]),k("div",_e,[n[8]||(n[8]=P(" Drop file here or ",-1)),n[9]||(n[9]=k("em",null,"click to upload",-1)),k("div",xe,"(JPG、PNG、WEBP) <= "+T(f(j).maxImgSize)+"MB",1)])])),o.value?(d(),x("div",{key:2,class:"w-[30px] h-[30px] shadow rounded-full absolute cursor-pointer flex justify-center items-center bg-white",title:"Remove avatar",onClick:n[3]||(n[3]=I(e=>O("faceImage"),["stop"])),style:{top:"10px",right:"10px"}},[h(f(Q),{class:"size-5"})])):y("",!0)]),_:1},8,["class","accept","file-list"])])])])])]),k("div",ye,[h(R,{class:"w-full",disabled:"ing"===f(u),fnName:"demo-yearbook",getSendData:L,beforeSubmit:A,requestPlatformType:f(B).FACESWAPFACE,needUsePoints:!1},{default:p(()=>[...n[12]||(n[12]=[P("Generate",-1)])]),_:1},8,["disabled","requestPlatformType"])])])}}}),[["__scopeId","data-v-913f6870"]]),Te=i({__name:"index",setup:t=>(t,s)=>{const i=e,l=a;return d(),c(l,{id:"app-playground"},{rightSlot:p(()=>[h(i)]),leftSlot:p(()=>[h(Pe)]),_:1})}});export{Te as default};

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.