import{v as _,ab as v,l as E,r as c,ax as p,aC as x,ac as D,a7 as I,aO as R,k,af as P,g as O}from"./vendor-core-CzvSW5ae.js";import{c as V,p as F}from"./index-CEQStqDa.js";import{E as C,y as N,s as $,q as f}from"./index-B5qe6yln.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-rk3Yu4M8.js";import{_ as B}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js";import"./vendor-ui-DXwyveTF.js";import"./useMessage-CYVXvlqq.js";const L={class:"size-full"},j=_({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(e){return(l,a)=>(v(),E("div",L,[c(z,{compAttrs:e.compAttrs,version:e.version,bgColor:e.compAttrs?.bgColor,compType:p(C).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])]))}}),q={key:0,class:"size-full"},Q=_({__name:"index",setup(e){const l=x(),a=N(),y=new Map;D(C.PROVIDE_KEY_CALLBACKS,y);const{compId:t,version:r=""}=l.params,m=P(!1),o=V(t)(),d=O(()=>o.detail[r]);async function A(){if(await a.initSetting(),!t)throw new Error("compId is required");const n=await $.v1Comp.compcontrollerCompdetail({compId:t,version:r}),{objectId:u,version:s,files:g,dep:b}=n.data,w={objectId:u,version:s,files:g.map(i=>i.path)},S=await f.v1Comp.compcontrollerCompfilesosssignedurl(w),h=F(b,a.deps).map(i=>i.name),M=await f.v1Module.modulecontrollerPrebuild({deps:h}),{entryNameToFile:T={}}=M.data;o.setDetail(s,{...n.data,_id:t}),o.setDepEntryNameToFile(s,T),o.setVersionToFileAccessPath(s,S.data.signedUrls)}return I(async()=>{await A(),m.value=!0}),(n,u)=>m.value?(v(),E("div",q,[c(p(B),{isEmpty:!d.value,class:"size-full"},{default:R(()=>[c(j,{compAttrs:d.value,version:p(r)},null,8,["compAttrs","version"])]),_:1},8,["isEmpty"])])):k("",!0)}});export{Q as default};
