System.register(["./index-legacy-c607a020.js"],(function(e,t){"use strict";var i,n,o,a,l,r,d,s,u,c,m,p,v,g,h,_,S,y,b,w,T,f=document.createElement("style");return f.textContent="._skeleton_1jzuh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_1jzuh_12{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent}._detail_1jzuh_12 ._container_1jzuh_19{margin:0;border-radius:.26667rem}._detail_1jzuh_12 #osmdCanvasPage1{position:relative!important}._detail_1jzuh_12 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_1jzuh_12 .smoothAnimationBox{height:0!important;overflow:hidden}\n",document.head.appendChild(f),{setters:[e=>{i=e.d,n=e.g,o=e.n,a=e.c,l=e.m,r=e.bF,d=e.ae,s=e.h,u=e.av,c=e.a0,m=e.V,p=e.bG,v=e.bH,g=e.aD,h=e.bI,_=e.bJ,S=e.aH,y=e.bK,b=e.bL,w=e.bM,T=e.bN}],execute:function(){const t="_detail_1jzuh_12",f="_container_1jzuh_19";e("default",i({name:"simple-detail",setup(){const e=n(),i=o({isLoading:!0,currentTime:0,totalTime:0}),j=e=>{var t,n,o,a;let r={};try{r="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(S){console.error("parse_error: Invalid JSON data received")}var d,s,u,c,m,p,v,g,h,_;"api_play"===(null===(t=r)||void 0===t?void 0:t.api)&&(console.log("h5开始播放"),l.playState="play",I()),"api_paused"===(null===(n=r)||void 0===n?void 0:n.api)&&(console.log("暂停播放"),l.playState="paused"),"api_updateProgress"===(null===(o=r)||void 0===o?void 0:o.api)&&(console.log("拖动的进度"),"paused"===l.playState&&(i.currentTime=null!==(d=r)&&void 0!==d&&null!==(s=d.content)&&void 0!==s&&s.currentTime?null===(u=r)||void 0===u||null===(c=u.content)||void 0===c?void 0:c.currentTime:i.currentTime,z())),"api_playProgress"===(null===(a=r)||void 0===a?void 0:a.api)&&null!==(m=r)&&void 0!==m&&null!==(p=m.content)&&void 0!==p&&p.currentTime&&((null===(v=r)||void 0===v||null===(g=v.content)||void 0===g?void 0:g.currentTime){const t=e.id||"";l.isSimplePage=!0,await r(t,"open"),i.isLoading=!1,l.isSingleLine=!0,window.addEventListener("message",j)})),d((()=>{l.isSimplePage=!1,window.removeEventListener("message",j)}));const x=async e=>{var t;const i=null===(t=document.getElementById("scrollContainer"))||void 0===t?void 0:t.getBoundingClientRect().height;l.osmd=e,0===l.originSpeed&&(l.originSpeed=l.speed=e.bpm||e.Sheet.userStartTempoInBPM||100);const n=(c.get("speeds")||{})[l.examSongId]||l.speed||e.bpm||e.Sheet.userStartTempoInBPM;n&&m(n),p(),v(),l.times=g(e),console.log("🚀 ~ state.times:",l.times,l.subjectId,l),h(l.times),_(),S(),console.log("渲染完成",i),window.parent.postMessage({api:"api_musicPage",height:i},"*"),y({height:i})},z=()=>{const e=i.currentTime;let t=b(e);t&&w(t),l.activeNoteIndex=(null==t?void 0:t.i)||0,l.isSingleLine&&T(e)},I=()=>{if("play"!==l.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(z(),I()):setTimeout((()=>{z(),I()}),16.7)}))};return()=>s("div",{class:t},[s("div",{id:"scrollContainer",class:[f,"hideCursor"]},[!i.isLoading&&s(u,{onRendered:x,musicColor:"#FFFFFF"},null)])])}}))}}}));