System.register(["./vue-legacy-a77002d8.js","./CustomForm.vue_vue_type_style_index_0_lang-legacy-9fd46059.js","./loading2.vue_vue_type_style_index_0_lang-legacy-46f03ae0.js","./resetbutton.vue_vue_type_style_index_0_lang-legacy-e72cc57a.js","./form-legacy-2adc72b2.js","./ImageEdit-legacy-4d0e45e5.js","./Task-legacy-da35db10.js","./tool-legacy-3f4f95f0.js","./index-legacy-02a74204.js","./index-legacy-b3c74255.js","./index-legacy-4c8f9698.js","./withInstall-legacy-a4ca9144.js","./useGlobalIcon-legacy-7d8ca2a4.js","./useVModel-legacy-71bf3ab2.js","./index-legacy-e38592e5.js","./dialog-legacy-771f8f43.js","./index-legacy-0aff25a3.js","./v4-legacy-ad483dde.js","./index.vue_vue_type_style_index_0_lang-legacy-19b5295d.js","./ScrollLoad.vue_vue_type_script_setup_true_lang-legacy-a9d41414.js","./_plugin-vue_export-helper-legacy-762b7923.js"],(function(l,e){"use strict";var a,t,s,u,i,n,c,o,d,r,g,m,_,v,y,p,b,f,j,x,h,w,k,I,S,O,L,C,E,B,F,G,q;return{setters:[l=>{a=l.f,t=l.h,s=l.v,u=l.k,i=l.x,n=l.Q,c=l.V,o=l.z,d=l.i,r=l.j,g=l.L,m=l.D,_=l.E,v=l.w,y=l.F,p=l.A,b=l.n,f=l.o},l=>{j=l._},l=>{x=l._},l=>{h=l._},l=>{w=l._,k=l.a,I=l.e,S=l.F},l=>{O=l.I},l=>{L=l.M,C=l.d,E=l.e,l.i,B=l.g,F=l.f},l=>{G=l.C},l=>{q=l.a},null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){const e=a({props:{list:Object,status:String,backgroundImage:String,config:Object,OverlayImages:Object,module_status:Number},emits:["submit"],setup(l,{emit:e}){const a=t(L.wait);s((()=>l.module_status),(l=>{l&&(a.value=l)}));const o=l=>{e("submit",l)},d=()=>{const{status:e}=l;return""==e?u(w,null,null):"loading"==e?u(k,null,null):"edit"==e?"":u("div",{class:"load-success-box"},[u("div",{class:"result-img-box narrow-scrollbar"},[l.list?l.list.map((l=>u("div",{class:"result-img"},[u("img",{class:"img",src:l,alt:""},null)]))):""]),u("div",{class:"download-img-box"},[u(h,null,{default:()=>[c("下载")]})])])};return()=>u("div",{class:"img-res-status"},[d(),i(u(O,{module_status:a.value,list:l.OverlayImages,edit_image:l.backgroundImage,config:l.config,onSubmit:o},null),[[n,"edit"==l.status]])])}}),z={class:"custom-model-template"},A={class:"generation-box-parent"},M={class:"interaction-form"},V={class:"confirm-box"},D=_("div",{class:"pay-num"},null,-1),N={class:"generate-result"},Q=_("div",{class:"help"},null,-1);l("default",a({__name:"index",setup(l){const a=t(!1),s=p().query.id,w=t();let k=null;const O=o({url:"",prompt:"",name:""}),T=t({}),H=o({list:[],callback_list:[],status:"",module_status:L.wait,reset_num:1}),J=o({list:[]}),K=t(),P=t(),R=l=>{J.list.length?J.list[0]=l:J.list.push(l)},U=l=>{O.url=l.url,O.prompt=l.prompt,O.name=l.name,H.status="edit"},W=l=>{k=window.setInterval((()=>{(async l=>{try{let e=await F({key:l});0==e.code&&e.data.image&&(H.status="success",e.data.image.length>H.callback_list.length&&(H.callback_list=e.data.image),4==e.data.image.length&&X())}catch(e){}})(l)}),2e3)},X=()=>{k&&(window.clearInterval(k),clearInterval(k),k=null)},Y=()=>{H.list.forEach((l=>{l.lists.forEach((l=>{l.value&&(l.value="")}))})),H.status="",H.callback_list=[],H.reset_num+=1},Z=l=>{if(l){const e=I(H.list);e&&(e.image=l,e[O.name]=O.prompt,$(e))}},$=async l=>{try{let e=await E({scenario_id:K.value,parameters:l});0==e.code&&(W(e.data.uuid),H.status="loading")}catch(e){}},ll=()=>{I(H.list)&&(H.module_status=L.upload,H.status="loading")};d((async()=>{(async()=>{try{let l=await C();0==l.code&&(T.value=l.data)}catch(l){}})()}));const el=async()=>{try{a.value=!0;let l=await B(s,"id");if(0==l.code){K.value=l.data.id,P.value=l.data.sub_type;let e=l.data.form;if(!e.length)return void q("表单未配置");e=S(e).list,H.list=e}a.value=!1,b((()=>{w.value&&G(w.value)}))}catch(l){a.value=!1}};return r((async()=>{s?await el():q("禁止访问")})),g((()=>{X()})),(l,t)=>(f(),m("div",z,[_("div",A,[i(_("div",{class:"generation-box",ref_key:"GenerationBox",ref:w},[_("div",M,[u(j,{formList:H.list,sub_type:P.value,onSubmitBackGround:U,onSubmitLocalImage:R},null,8,["formList","sub_type"]),_("div",V,[D,u(h,{onClick:Y,width:"20%"},{default:v((()=>[c("重置")])),_:1}),u(h,{onClick:ll,width:"50%",bold:""},{default:v((()=>[c("生成图片")])),_:1})])]),_("div",N,[u(y(e),{status:H.status,backgroundImage:O.url,OverlayImages:J.list,list:H.callback_list,module_status:H.module_status,config:T.value,onSubmit:Z},null,8,["status","backgroundImage","OverlayImages","list","module_status","config"])])],512),[[n,!a.value]])]),Q,i(u(x,null,null,512),[[n,a.value]])]))}}))}}}));
