import{A as v}from"./index-63cfc38a-1776006071491.js";import{d as w,b7 as m,a5 as u,q as c,aq as p,f as t,l as f,m as h,aj as r,aa as i}from"./index-8c26cc43-1776006071491.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 c(()=>{window.addEventListener("message",d)}),p(()=>{window.removeEventListener("message",d)}),()=>t(r,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(r,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=>{i(a.target)}},null):o.value=="music"?t("iframe",{src:e.value.src,key:e.value.src,onLoad:a=>{i(a.target)},style:{height:"100vh"}},null):"":""])]})])}});export{b as P};
