import{v as u,ab as d,l as _,r as n,ax as f,aC as L,ac as M,a7 as g,aO as w,af as P,g as m}from"./vendor-core-BKehvho7.js";import{c as T}from"./useCompMetaLocalStore-BKTMp_k8.js";import{m as v,r}from"./index-D88CvPWT.js";import{_ as b}from"./index.vue_vue_type_script_setup_true_lang-DTC1Qz-g.js";import{_ as I}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./vendor-ui-CGT0cG1n.js";import"./useVscodeOpen-BBdyQ3W2.js";import"./useMessage-Cbhfk7Nk.js";const O={class:"size-full"},R=u({__name:"index",props:{version:{},compAttrs:{}},setup(a){return(l,e)=>(d(),_("div",O,[n(b,{compAttrs:a.compAttrs,version:a.version,compType:f(v).IFRAME_ROUTES.ITEM.PREVIEW_LOCAL},null,8,["compAttrs","version","compType"])]))}}),k={class:"size-full"},j=u({__name:"index",setup(a){const l=L(),{compId:e}=l.params,t=T(e)(),h=new Map;M(v.PROVIDE_KEY_CALLBACKS,h);const o=P(!1),s=m(()=>t.detail),A=m(()=>Object.keys(s.value??{}).length>0);async function y(){if(!e)return;o.value=!0;const c=await r.v1Comp.compcontrollerLocalcompdetailbypathhash({fullPathHash:e}),i=await r.v1Comp.compcontrollerDep({compPath:c.data.path}),{thirdParty:p=[]}=i.data,C=p.map(x=>x.name),E=await r.v1Module.modulecontrollerPrebuild({deps:C}),{entryNameToFile:D={}}=E.data;t.setDetail(c.data),t.setDep(p),t.setDepToFile(D),o.value=!1}return g(async()=>{await y()}),(c,i)=>(d(),_("div",k,[n(f(I),{isEmpty:!A.value,loading:o.value,class:"size-full"},{default:w(()=>[n(R,{compAttrs:s.value,version:s.value.version},null,8,["compAttrs","version"])]),_:1},8,["isEmpty","loading"])]))}});export{j as default};
