import{b as Q,u as X,r as A,d as j,t as V,a as e,G as R,e as d,g as t,B as $,F as O,P as H,T as z,w as K,h as J,i as T,j as _,S as Z,E as ee,M as te,k,o as ae,l as q,m as P,n as se,p as le,q as oe,v as ne,x as ue,y as re,z as ie,C as ce,f as de,D as pe,c as Ae}from"./App.03d0734f.js";import"./lib-flexible.08f197e6.js";/* empty css */import{h as me,N as p,c as N}from"./index.aaeaa9d5.js";import{s as ve}from"./state.731c32e9.js";import{w as fe}from"./wx_bg.fc243df2.js";import"./index.04ceacbb.js";import"./music.b35eb5be.js";import"./index.a0d4ab04.js";import"./index.270b5f1c.js";function He(){import("data:text/javascript,")}const he="_musicSheet_18na6_1",Fe="_btn_18na6_7",ge="_btnCont_18na6_14",ye="_popup_18na6_20";var Ce={musicSheet:he,btn:Fe,btnCont:ge,popup:ye};const Ee="_header_15pat_1",Se="_center_15pat_4",xe="_info_15pat_20",Ne="_demos_15pat_29",_e="_maininfo_15pat_52",we="_line_15pat_103",Ie="_back_15pat_117",be="_btns_15pat_124",Be="_pop_15pat_130",De="_close_15pat_166",Te="_trybtn_15pat_187";var f={header:Ee,center:Se,info:xe,demos:Ne,maininfo:_e,line:we,back:Ie,btns:be,pop:Be,close:De,try:"_try_15pat_181",trybtn:Te},Oe="/orchestra-music-score/assets/explain.9e197a0a.svg",Le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAAHeq0ewAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAC6ADAAQAAAABAAAACwAAAACBvloGAAABH0lEQVQYGW1Ru0oDURA9s27EQrETEbv8g3+RSgub7IoELASF7CYGbbYQFHLjB4gI2WAT8LPEWjCd7Hjm3t1VwWnmdeacmXsFo3SMSi9iqF4CuodgRRGLj7K+YqvbAbLkru4hYrAD69CY6Ckgz1gu1wR5ck+qK1/wDUJmC4ngyonBA9o8J/410vg2qd4wne9DRDFKrqFYl0aVxQfqDIl8FAYmXHk6wSvc4ijC+GTa8isODRShqjJ4RGlHgOd/whZvkXVgfO8c2Q05d3XzQdgkdZ7FGoIVDnrb9QLp089xNU3jTHKze4yi+ArPao08mdUnNDD6X0qWIe/f8PDbFmFMKh9/lOwtXJnFxHcguuLACz/t3OT8oOqAlzoOnTHfsNo35fxqh9SRnu4AAAAASUVORK5CYII=";const W=Q(),Y=X(),v=A("pitch"),w=A(!1),U=A(!1);var Re=j({name:"ColexiuReportHeader",props:{detail:{type:Object},record:{type:Object},className:{type:String}},emits:["activeChange"],setup(E,{emit:r,expose:F}){return F({autoShow:()=>{localStorage.getItem("explain-view")!="1"&&(w.value=!0,setTimeout(()=>{w.value=!1,localStorage.setItem("explain-view","1")},5e3))}}),()=>{var g,b;const{detail:h,record:l}=V(E),C=()=>{var B,D;const{origin:n}=location;let I=n+"/student/#/music-detail";I+=`?id=${(D=(B=l.value)==null?void 0:B.musicalNotesPlayStats)==null?void 0:D.examSongId}`;const x={url:I,action:Y.action||"h5",pageTag:Y.pageTag||1},L=encodeURIComponent(JSON.stringify(x));/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?window.location.href=`ColexiuStudent://linkUrl=${L}`:/(Android)/i.test(navigator.userAgent)?(x.url=encodeURIComponent(x.url),window.location.href=`colexiustudent://html:8888/SplashActivity?url=${encodeURIComponent(JSON.stringify(x))}`):z("\u8BF7\u7528\u624B\u673A\u6216\u79FB\u52A8\u8BBE\u5907\u6253\u5F00")},S=()=>{W.weixin?U.value=!0:(C(),W.isApp||setTimeout(()=>{location.href=location.origin+"/student/#/download"},3e3))};return e("header",{class:[f.header,f.className]},[e("div",{class:f.info},[l.value&&((g=l.value)==null?void 0:g.heardLevel)?e(R,{class:f.center,columnNum:5},{default:()=>[e(d,{class:"van-hairline--right"},{text:()=>e("span",null,[t("\u96BE\u5EA6")]),icon:()=>{var n;return e("span",null,[me[(n=l.value)==null?void 0:n.heardLevel]])}}),e(d,{class:"van-hairline--right"},{text:()=>e("span",null,[t("\u8BC4\u6D4B\u5206\u6570")]),icon:()=>{var n;return e("span",null,[(n=l.value)==null?void 0:n.score,t("\u5206")])}}),e(d,{class:"van-hairline--right",onClick:()=>{v.value="pitch",r("activeChange","pitch")}},{text:()=>e("span",{class:["switch",{active:v.value==="pitch"}]},[t("\u97F3\u51C6")]),icon:()=>{var n;return e("span",{style:{color:"#2DC7AA"}},[(n=l.value)==null?void 0:n.intonation,t("\u5206")])}}),e(d,{class:"van-hairline--right",onClick:()=>{v.value="rhythm",r("activeChange","rhythm")}},{text:()=>e("span",{class:["switch",{active:v.value==="rhythm"}]},[t("\u8282\u594F")]),icon:()=>{var n;return e("span",{style:{color:"#FF4E19"}},[(n=l.value)==null?void 0:n.cadence,t("\u5206")])}}),e(d,{onClick:()=>{v.value="completion",r("activeChange","completion")}},{text:()=>e("span",{class:["switch",{active:v.value==="completion"}]},[t("\u65F6\u503C")]),icon:()=>{var n;return e("span",{style:{color:"#FFC459"}},[(n=l.value)==null?void 0:n.integrity,t("\u5206")])}})]}):null,e(R,{columnNum:3,class:f.btns},{default:()=>[e(d,{onClick:()=>w.value=!0},{text:()=>e("span",null,[t("\u91CA\u4E49")]),icon:()=>e("img",{src:Oe},null)})]})]),(b=l.value)!=null&&b.score?e("div",{class:f.try},[e($,{class:f.trybtn,onClick:S},{default:()=>[t("\u6211\u6765\u8BD5\u4E00\u8BD5")]})]):null,l.value?e("div",{class:f.demos},[v.value==="pitch"&&e(O,null,[e("div",null,[e(p,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null),e("span",null,[t("\u97F3\u9AD8\u4E86")])]),e("div",null,[e(p,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null),e("span",null,[t("\u97F3\u4F4E\u4E86")])])]),ve.isPercussion?null:e(O,null,[v.value==="rhythm"&&e(O,null,[e("div",null,[e(p,{fill:"#FF4444",shadow:!0,x:0},null),e("span",null,[t("\u8282\u594F\u5FEB\u4E86")])]),e("div",null,[e(p,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null),e("span",null,[t("\u8282\u594F\u6162\u4E86")])])]),v.value==="completion"&&e("div",null,[e(p,{fill:"#CC75FF"},null),e("span",null,[t("\u65F6\u503C\u4E0D\u8DB3")])])])]):null,e(H,{show:U.value,position:"top",style:{background:"none"}},{default:()=>[e("img",{src:fe,style:{width:"80%",display:"block",margin:"auto"}},null)]}),e(H,{teleport:"body",show:w.value,class:f.pop,style:{width:"60vw"},onClickOverlay:()=>w.value=!1},{default:()=>[e("div",{class:f.close,onClick:()=>w.value=!1},[e("img",{src:Le},null)]),e("h2",null,[t("\u56FE\u6807\u91CA\u4E49")]),e(R,{columnNum:2,class:f.btns,border:!1},{default:()=>[e(d,null,{text:()=>e("span",null,[t("\u7EFF\u8272\u97F3\u7B26\uFF1A\u6F14\u594F\u6B63\u786E")]),icon:()=>e(p,{fill:"#01C1B5"},null)}),e(d,null,{text:()=>e("span",null,[t("\u7EA2\u8272\u97F3\u7B26\uFF1A\u9519\u97F3")]),icon:()=>e(p,{fill:"#FF4444"},null)}),e(d,null,{text:()=>e("span",null,[t("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u524D)\uFF1A\u8282\u594F\u8FC7\u5FEB")]),icon:()=>e(p,{fill:"#FF4444",shadow:!0,x:0},null)}),e(d,null,{text:()=>e("span",null,[t("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u540E)\uFF1A\u8282\u594F\u6162\u4E86")]),icon:()=>e(p,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null)}),e(d,null,{text:()=>e("span",null,[t("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0A)\uFF1A\u97F3\u9AD8\u4E86")]),icon:()=>e(p,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null)}),e(d,null,{text:()=>e("span",null,[t("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0B)\uFF1A\u97F3\u4F4E\u4E86")]),icon:()=>e(p,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null)}),e(d,null,{text:()=>e("span",null,[t("\u7D2B\u8272\u97F3\u7B26\uFF1A\u5B8C\u6574\u5EA6\u4E0D\u8DB3")]),icon:()=>e(p,{fill:"#CC75FF"},null)}),e(d,null,{text:()=>e("span",null,[t("\u7070\u8272\u97F3\u7B26\uFF1A\u672A\u6F14\u594F")]),icon:()=>e(p,{fill:"#AEAEAE"},null)})]})]})])}}});const M=X(),ke=async(E,r)=>{const F=await oe(E);let c=A("");const h=ne(F);c.value=ue(h.parsedXML,{title:r.musicSheetName});const l=Number(M["part-index"])||0;return c.value=re(c.value,l),c},Me=E=>{const r=A("loading"),F=A({}),c=A({});return ae(async()=>{var h;r.value="loading";try{const l=await q.get("/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:M.id}});if(!l.data){r.value="error";return}c.value=l.data,console.log(c.value);const C=await q.get(`/music/sheet/detail/${(h=c.value)==null?void 0:h.musicalNotesPlayStats.examSongId}`);F.value=C.data,_.partIndex=l.data.partIndex||0,r.value="success"}catch(l){r.value="error",console.log(l)}}),[r,F,c]};var Ge=j({name:"Colexiu",setup(){const E=A(),r=A(!0),F=A(!1),c=A(""),h=A([]),l=A([]),[C,S,g]=Me(M.id);K(C,async()=>{if(C.value==="success"&&S.value.xmlFileUrl){const a=await ke(S.value.xmlFileUrl,S.value);c.value=a.value}}),J();const b=a=>{switch(a){case"CADENCE_FAST":return"translateX(2px)";case"CADENCE_SLOW":return"translateX(-2px)";case"INTONATION_HIGH":return"translateY(-2px)";case"INTONATION_LOW":return"translateY(2px)";default:return""}},n=()=>{const a=["RIGHT","WRONG","CADENCE_WRONG"];return v.value==="pitch"?a.push("CADENCE_FAST","CADENCE_SLOW"):v.value==="rhythm"?a.push("INTONATION_HIGH","INTONATION_LOW"):v.value==="completion"&&a.push("INTEGRITY_WRONG"),g.value.musicalNotesPlayStats.notesData.filter(u=>a.includes(u.musicalErrorType))},I=()=>{L(),r.value=!1;for(const a of n()){const u=l.value[a.musicalNotesIndex];setTimeout(()=>{if(h.value.includes(u.id))return;h.value.push(u.id);const s=document.getElementById("vf-"+u.id),o=document.getElementById("vf-"+u.id+"-stem"),i=a.musicalErrorType,y=["INTONATION_HIGH","INTONATION_LOW","CADENCE_FAST","CADENCE_SLOW"].includes(i);if(o==null||o.classList.add(N[i]),s==null||s.classList.add(N[i]),s&&y){o==null||o.classList.remove(N[i]),o==null||o.classList.add(N.RIGHT),s==null||s.classList.remove(N[i]),s==null||s.classList.add(N.RIGHT);const m=s.querySelector(".vf-notehead").cloneNode(!0);m.style.transform=b(i),s.style.opacity=".7",o&&(o.style.opacity=".7"),m.id="vf-"+u.id+"-copy",m==null||m.classList.add(N[i]),osmd==null||osmd.container.querySelector("svg").insertAdjacentElement("afterbegin",m)}},300)}},x=a=>{if(!a)return;const u=a.classList.values();for(const s of u)(s==null?void 0:s.indexOf("vf-"))!==0&&a.classList.remove(s)},L=()=>{for(const a of h.value){x(document.getElementById("vf-"+a)),x(document.getElementById("vf-"+a+"-stem"));const u="vf-"+a+"-copy",s=document.getElementById(u);s&&s.remove()}h.value=[]},B=a=>{var s;r.value=!1,(s=E.value)==null||s.autoShow(),setTimeout(()=>{var o;for(const i of Array.from(document.querySelectorAll(".vf-beam")))(o=i.querySelector("path"))==null||o.setAttribute("fill","#aeaeae")}),P.osmd=a,l.value=se(P.osmd),I();const u=(o,i,y=!0)=>{const m=ie(o);_.evaluatings={..._.evaluatings,[m.measureIndex]:{...m,...ce(i.score),score:i.score,dontTransition:y}}};if(g.value.userMeasureScore){for(const o in g.value.userMeasureScore)if(Object.prototype.hasOwnProperty.call(g.value.userMeasureScore,o)){const i=g.value.userMeasureScore[o];for(const y of l.value)if(i.measureRenderIndex==y.noteElement.sourceMeasure.MeasureNumberXML-1)if(!y.noteElement.tie)u(y,i);else for(const m of y.noteElement.tie.notes){const G=le(m);!G||u(G,i,m!==y.noteElement.tie.StartNote)}}}},D=()=>{F.value=!0,r.value=!1};return()=>{const a=r.value||C.value==="loading",u=F.value||C.value==="error";return e("div",{class:[T.container,k.sett.eyeProtection&&"eyeProtection",k.sett.camera&&"openCamera"]},[e(Re,{className:T.header,detail:S.value,record:g,ref:E,style:{paddingLeft:_.isSpecialShapedScreen?_.notchHeight/2+"px":"auto"},onActiveChange:()=>I()},null),e("div",{id:"colexiu-detail-music-sheet",class:[T.musicSheet,Ce.musicSheet],style:{paddingLeft:_.isSpecialShapedScreen?_.notchHeight/2+"px":"auto"}},[a&&!u&&e(Z,{class:T.skeleton,rowWidth:"80%",title:!0,row:3},null),u&&e(ee,null,null),c.value&&e(O,null,[e("h3",{style:{fontSize:"24px",fontWeight:"normal",textAlign:"center",padding:"0 10px",marginTop:"36px",marginBottom:"0px",marginLeft:"auto"},class:"van-ellipsis"},[S.value.musicSheetName]),e(te,{score:c.value,showSection:!0,opotions:{drawTitle:!1,drawComposer:!1,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0,autoResize:!1},EngravingRules:{DefaultColorNotehead:"#aeaeae",DefaultColorRest:"#aeaeae",DefaultColorMusic:"#aeaeae",DefaultColorStem:"#aeaeae",DefaultColorChordSymbol:"#aeaeae",DefaultColorLabel:"#aeaeae",DYMusicScoreType:k.sett.type},onRerender:B,onRenderError:D},null)])])])}}});document.body.style.setProperty("--osdm-zoom",""+de());pe();Ae(Ge).mount("#app");export{He as __vite_legacy_guard};