import{d as b,r as s,c as y,q as F,aq as g,f as t,l as d,m as p,a9 as k,k as u,x as R,j as m,bc as q,ab as z,a7 as C}from"./index-8c26cc43-1776006071491.js";const M="_wrap_rryzt_1",S="_previewWindow_rryzt_12",I="_previewIframe_rryzt_16",x="_removeVisiable_rryzt_21",D="_studentRemove_rryzt_27",N="_btnGroupModal_rryzt_39",a={wrap:M,previewWindow:S,previewIframe:I,removeVisiable:x,studentRemove:D,btnGroupModal:N},U=b({name:"notation-a",setup(){const r=s(!1),v=new Date().getTime(),n=s(!1),l=s({}),o=s(!1),w=y().getToken||"",i=s(),f=sessionStorage.getItem("notation-open-create")=="1"?"&addShow=1":"";sessionStorage.removeItem("notation-open-create");const _={src:"".concat(/(192|localhost)/.test(location.origin)?"https://test.lexiaoya.cn":z(),"/notation/?t=").concat(Date.now(),"#/create?v=").concat(Date.now(),"&Authorization=").concat(w).concat(f)},h=()=>{const e=document.documentElement;e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},c=e=>{e.data.api==="notation_open"?window.matchMedia("(display-mode: standalone)").matches?(r.value=!0,n.value=!0,l.value={url:e.data.url},h()):window.open(e.data.url):e.data.api==="notation_exit"?o.value=!0:e.data.api==="onAuthNotInstalled"&&C.emit("auth-not-installed")};return F(()=>{window.addEventListener("message",c)}),g(()=>{window.removeEventListener("message",c)}),()=>t("div",{class:a.wrap},[t("iframe",{ref:i,src:_.src,key:v},null),t(d,{maskClosable:p,show:n.value,"onUpdate:show":e=>n.value=e,class:a.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(k,{show:r.value,style:"--n-opacity-spinning: 1;"},{default:()=>[t("iframe",{class:a.previewIframe,onLoad:()=>{r.value=!1},frameborder:"0",src:l.value.url},null)]})]}),t(d,{maskClosable:p,show:o.value,"onUpdate:show":e=>o.value=e,preset:"card",class:["modalTitle",a.removeVisiable],title:"退出制谱"},{default:()=>[t("div",{class:a.studentRemove},[t("p",null,[u("是否退出制谱功能？")]),t(R,{class:a.btnGroupModal,justify:"center"},{default:()=>[t(m,{round:!0,type:"primary",onClick:()=>{n.value=!1,l.value.url="",o.value=!1,i.value.contentWindow.postMessage({api:"reload"},"*"),q()}},{default:()=>[u("确定")]}),t(m,{round:!0,onClick:()=>o.value=!1},{default:()=>[u("取消")]})]})])]})])}});export{U as default};
