import{A as v}from"./index-23442447-1742362401929.js";import{d as w,b4 as m,a5 as u,q as p,ap as c,f as t,l as f,m as h,ai as i,aa as r}from"./index-ab183db6-1742362401929.js";const y="_previewWindow_1jnin_1",I={previewWindow:y},b=w({name:"preview-window",props:{show:{type:Boolean,default:!1},type:{type:String,default:""},params:{type:Object,default:()=>({})}},emit:["update:show"],setup(s,{emit:n}){const{show:l,type:o,params:e}=m(s);u(()=>s.show,()=>{l.value=s.show}),u(()=>s.type,()=>{o.value=s.type}),u(()=>s.params,()=>{e.value=s.params});const d=a=>{console.log(a,"iframe_exit"),a.data.api==="iframe_exit"&&n("update:show",!1)};return p(()=>{window.addEventListener("message",d)}),c(()=>{window.removeEventListener("message",d)}),()=>t(i,null,[t(f,{maskClosable:h,show:l.value,"onUpdate:show":[a=>l.value=a,()=>{n("update:show",l.value)}],class:I.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(i,null,[l.value?o.value=="attend"?t(v,{type:e.value.type||"",instrumentId:e.value.instrumentId||"",courseId:e.value.courseId||"",detailId:e.value.detailId||"",classGroupId:e.value.classGroupId||"",lessonCourseId:e.value.lessonCourseId||"",classId:e.value.classId||"",preStudentNum:e.value.preStudentNum,onClose:()=>n("update:show",!1)},null):o.value=="notation"?t("iframe",{src:e.value.src,onLoad:a=>{r(a.target)}},null):o.value=="music"?t("iframe",{src:e.value.src,key:e.value.src,onLoad:a=>{r(a.target)},style:{height:"100vh"}},null):"":""])]})])}});export{b as P};
