import{a as _}from"./useSetting-bf1f702c.js";import{a as f}from"./path-8ad564a3.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as l,bL as d,o,c as i,t as k,l as g}from"./index-25eb6331.js";import"./file-5139c625.js";import"./request-14d7fed5.js";import"./index-3bef6acb.js";/* empty css                */import"./dialog-66decf59.js";import"./index-db57f3ab.js";import"./vnode-761469ca.js";import"./scroll-044a6ede.js";import"./button-c2afb424.js";import"./overlay-25bb32bf.js";import"./refs-e3c707bd.js";/* empty css                     *//* empty css               *//* empty css                  */import"./dropdown-item-13559a59.js";import"./index-51e1cffc.js";import"./index-b7ba0c9a.js";import"./dropdown-8894c5a8.js";import"./index-0746525e.js";import"./_initCloneObject-55db8b76.js";import"./directive-77ef4fb1.js";import"./index-98eb1092.js";import"./validator-551b2058.js";import"./index-02f3ff91.js";import"./base-00eb0fe9.js";const w={class:"zfile-kkfile-viewer"},h={key:0,class:"viewer-status"},F={key:1,class:"viewer-status error"},S=["src"],V={__name:"KkFileViewer",props:{url:String,name:String},setup(n){const m=n,c=_(),e=l(!0),r=l(""),t=l("");return d(()=>{e.value=!0,r.value="",t.value="";const a=c.globalConfig.kkFileViewUrl,s=m.url,p=m.name;if(!a){r.value="预览服务地址未配置。",e.value=!1;return}if(!s){r.value="文件URL无效，无法预览。",e.value=!1;return}if(!p){r.value="文件名无效，无法预览。",e.value=!1;return}const u={name:p,url:s};t.value=f(u,a),e.value=!1}),(a,s)=>(o(),i("div",w,[e.value?(o(),i("div",h," 正在加载预览, 请稍候... ")):r.value?(o(),i("div",F," 加载预览失败："+k(r.value),1)):t.value?(o(),i("iframe",{key:2,src:t.value,width:"100%",height:"100%",frameborder:"0"},"\n    ",8,S)):g("",!0)]))}},$=v(V,[["__scopeId","data-v-d0d7ac6d"]]);export{$ as default};
