import"./base-3037347b.js";import{b as X,q as V,a as D,f as Q,c as j}from"./utils-8747c988.js";import{b as K}from"./loading-dedc0838.js";import"./lib-flexible-a8a91671.js";import{P as z,z as M,r as H,a as $}from"./request-9a0f9c1d.js";import{u as q,G as L,a as d,b as J,E as Z,M as ee,s as G,g as te,c as ae,d as le,f as se,o as oe,e as ne,h as ue}from"./index-ecf281fc.js";import{s as N}from"./index-f53ab261.js";import{s as I}from"./index.module-5cd88979.js";import{h as re,N as m,c as _}from"./index-60511431.js";import{P as ie}from"./index-c856650b.js";import{s as ce}from"./state-a1f4c50e.js";import{K as h,d as P,L as de,c as e,M as t,W as pe,F as B,C as me,N as Ae}from"./runtime-core.esm-bundler-8a997806.js";import{B as ve}from"./index-e1d206b5.js";import{S as fe}from"./index-d8a03cff.js";import"./_commonjsHelpers-edff4021.js";import"./index-ea32d722.js";import"./TransposeCalculator-bb4225f8.js";import"./index-a08f75d4.js";import"./music-d9a14675.js";import"./index-c9e2e377.js";function Ue(){import("data:text/javascript,")}const he="_musicSheet_1x0kx_1",Fe="_btn_1x0kx_8",ge="_btnCont_1x0kx_15",ye="_popup_1x0kx_21",Ce={musicSheet:he,btn:Fe,btnCont:ge,popup:ye},Ee=""+new URL("back-0e8784e6.svg",import.meta.url).href,xe="_header_18vsl_1",_e="_center_18vsl_4",Ne="_info_18vsl_20",Se="_demos_18vsl_29",be="_maininfo_18vsl_51",we="_line_18vsl_102",Ie="_back_18vsl_116",Be="_btns_18vsl_123",De="_pop_18vsl_132",Le="_close_18vsl_168",Oe="_trybtn_18vsl_189",A={header:xe,center:_e,info:Ne,demos:Se,maininfo:be,line:we,back:Ie,btns:Be,pop:De,close:Le,try:"_try_18vsl_183",trybtn:Oe},Te=""+new URL("again-78a8b607.svg",import.meta.url).href,Re=""+new URL("explain-9e197a0a.svg",import.meta.url).href,ke=""+new URL("replay-402515a7.svg",import.meta.url).href,Me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAAHeq0ewAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAC6ADAAQAAAABAAAACwAAAACBvloGAAABH0lEQVQYGW1Ru0oDURA9s27EQrETEbv8g3+RSgub7IoELASF7CYGbbYQFHLjB4gI2WAT8LPEWjCd7Hjm3t1VwWnmdeacmXsFo3SMSi9iqF4CuodgRRGLj7K+YqvbAbLkru4hYrAD69CY6Ckgz1gu1wR5ck+qK1/wDUJmC4ngyonBA9o8J/410vg2qd4wne9DRDFKrqFYl0aVxQfqDIl8FAYmXHk6wSvc4ijC+GTa8isODRShqjJ4RGlHgOd/whZvkXVgfO8c2Q05d3XzQdgkdZ7FGoIVDnrb9QLp089xNU3jTHKze4yi+ArPao08mdUnNDD6X0qWIe/f8PDbFmFMKh9/lOwtXJnFxHcguuLACz/t3OT8oOqAlzoOnTHfsNo35fxqh9SRnu4AAAAASUVORK5CYII=",He=X(),b=q(),f=h("pitch"),S=h(!1),Ge=P({name:"ColexiuReportHeader",props:{detail:{type:Object},record:{type:Object},className:{type:String}},emits:["activeChange"],setup(x,{emit:r,expose:g}){const i=()=>{M({api:"back"})},F=()=>{localStorage.getItem("explain-view")!="1"&&(S.value=!0,setTimeout(()=>{S.value=!1,localStorage.setItem("explain-view","1")},5e3))},p=()=>{if(b.source==="evaluation")i();else{const y=sessionStorage.getItem("behaviorId")||""+new Date().valueOf(),s=V.stringifyUrl({url:location.origin+"/accompany",query:{id:b.id,behaviorId:y,client:He.isTeacher?"teacher":"student"}});M({api:"openAccompanyWebView",content:{url:s,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}};return g({autoShow:F}),()=>{var C;const{detail:y,record:s}=de(x);return e("header",{class:[A.header,A.className]},[e("div",{class:A.info},[b.source!=="web"?e(ve,{onClick:i,class:A.back},{default:()=>[e("img",{src:Ee,alt:"back"},null)]}):null,e("div",{class:[A.maininfo,"van-ellipsis"]},null),s.value&&((C=s.value)!=null&&C.heardLevel)?e(L,{class:A.center,columnNum:5},{default:()=>[e(d,{class:"van-hairline--right"},{text:()=>e("span",null,[t("难度")]),icon:()=>{var o;return e("span",null,[re[(o=s.value)==null?void 0:o.heardLevel]])}}),e(d,{class:"van-hairline--right"},{text:()=>e("span",null,[t("评测分数")]),icon:()=>{var o;return e("span",null,[(o=s.value)==null?void 0:o.score,t("分")])}}),e(d,{class:"van-hairline--right",onClick:()=>{f.value="pitch",r("activeChange","pitch")}},{text:()=>e("span",{class:["switch",{active:f.value==="pitch"}]},[t("音准")]),icon:()=>{var o;return e("span",{style:{color:"#2DC7AA"}},[(o=s.value)==null?void 0:o.intonation,t("分")])}}),e(d,{class:"van-hairline--right",onClick:()=>{f.value="rhythm",r("activeChange","rhythm")}},{text:()=>e("span",{class:["switch",{active:f.value==="rhythm"}]},[t("节奏")]),icon:()=>{var o;return e("span",{style:{color:"#FF4E19"}},[(o=s.value)==null?void 0:o.cadence,t("分")])}}),e(d,{onClick:()=>{f.value="completion",r("activeChange","completion")}},{text:()=>e("span",{class:["switch",{active:f.value==="completion"}]},[t("时值")]),icon:()=>{var o;return e("span",{style:{color:"#FFC459"}},[(o=s.value)==null?void 0:o.integrity,t("分")])}})]}):null,e(L,{columnNum:3,class:A.btns},{default:()=>{var o,w;return[(o=s.value)!=null&&o.videoFilePath&&((w=s.value)==null?void 0:w.expire)===0&&b.source!=="web"?e(ie,pe(s.value,{btnClass:A.btn,popupClass:A.popup}),{default:()=>[e(d,null,{text:()=>e("span",null,[t("回放")]),icon:()=>e("img",{src:ke},null)})]}):null,e(d,{onClick:()=>S.value=!0},{text:()=>e("span",null,[t("释义")]),icon:()=>e("img",{src:Re},null)}),b.source!=="web"?e(d,{onClick:p},{text:()=>e("span",null,[t("再来一遍")]),icon:()=>e("img",{src:Te},null)}):null]}})]),s.value?e("div",{class:A.demos},[f.value==="pitch"&&e(B,null,[e("div",null,[e(m,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null),e("span",null,[t("音高了")])]),e("div",null,[e(m,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null),e("span",null,[t("音低了")])])]),ce.isPercussion?null:e(B,null,[f.value==="rhythm"&&e(B,null,[e("div",null,[e(m,{fill:"#FF4444",shadow:!0,x:0},null),e("span",null,[t("节奏快了")])]),e("div",null,[e(m,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null),e("span",null,[t("节奏慢了")])])]),f.value==="completion"&&e("div",null,[e(m,{fill:"#CC75FF"},null),e("span",null,[t("时值不足")])])])]):null,e(z,{teleport:"body",show:S.value,class:A.pop,style:{width:"60vw"},onClickOverlay:()=>S.value=!1},{default:()=>[e("div",{class:A.close,onClick:()=>S.value=!1},[e("img",{src:Me},null)]),e("h2",null,[t("图标释义")]),e(L,{columnNum:2,class:A.btns,border:!1},{default:()=>[e(d,null,{text:()=>e("span",null,[t("绿色音符:演奏正确")]),icon:()=>e(m,{fill:"#01C1B5"},null)}),e(d,null,{text:()=>e("span",null,[t("红色音符:错音")]),icon:()=>e(m,{fill:"#FF4444"},null)}),e(d,null,{text:()=>e("span",null,[t("音符重影(红色在前):节奏过快")]),icon:()=>e(m,{fill:"#FF4444",shadow:!0,x:0},null)}),e(d,null,{text:()=>e("span",null,[t("音符重影(红色在后):节奏慢了")]),icon:()=>e(m,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null)}),e(d,null,{text:()=>e("span",null,[t("音符重影(黄色在上):音高了")]),icon:()=>e(m,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null)}),e(d,null,{text:()=>e("span",null,[t("音符重影(黄色在下):音低了")]),icon:()=>e(m,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null)}),e(d,null,{text:()=>e("span",null,[t("紫色音符:完整度不足")]),icon:()=>e(m,{fill:"#CC75FF"},null)}),e(d,null,{text:()=>e("span",null,[t("灰色音符:未演奏")]),icon:()=>e(m,{fill:"#AEAEAE"},null)})]})]})])}}}),O=q(),qe=async(x,r)=>{const g=await $(x);let i=h("");const F=le(g);i.value=se(F.parsedXML,{title:r.musicSheetName});const p=Number(O["part-index"])||0;return i.value=oe(i.value,p),i},Pe=x=>{const r=h("loading"),g=h({}),i=h({});return Ae(async()=>{var F;r.value="loading";try{const p=await H.get("/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:O.id}});if(!p.data){r.value="error";return}i.value=p.data,console.log(i.value);const y=await H.get(`/music/sheet/detail/${(F=i.value)==null?void 0:F.musicalNotesPlayStats.examSongId}`);g.value=y.data,N.partIndex=p.data.partIndex||0,r.value="success"}catch(p){r.value="error",console.log(p)}}),[r,g,i]},We=P({name:"Colexiu",setup(){const x=h(),r=h(!0),g=h(!1),i=h(""),F=h([]),p=h([]),[y,s,C]=Pe(O.id);me(y,async()=>{if(y.value==="success"&&s.value.xmlFileUrl){const a=await qe(s.value.xmlFileUrl,s.value);i.value=a.value}}),J();const o=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""}},w=()=>{const a=["RIGHT","WRONG","CADENCE_WRONG"];return f.value==="pitch"?a.push("CADENCE_FAST","CADENCE_SLOW"):f.value==="rhythm"?a.push("INTONATION_HIGH","INTONATION_LOW"):f.value==="completion"&&a.push("INTEGRITY_WRONG"),C.value.musicalNotesPlayStats.notesData.filter(u=>a.includes(u.musicalErrorType))},T=()=>{W(),r.value=!1;for(const a of w()){const u=p.value[a.musicalNotesIndex];setTimeout(()=>{if(F.value.includes(u.id))return;F.value.push(u.id);const l=document.getElementById("vf-"+u.id),n=document.getElementById("vf-"+u.id+"-stem"),c=a.musicalErrorType,E=["INTONATION_HIGH","INTONATION_LOW","CADENCE_FAST","CADENCE_SLOW"].includes(c);if(n==null||n.classList.add(_[c]),l==null||l.classList.add(_[c]),l&&E){n==null||n.classList.remove(_[c]),n==null||n.classList.add(_.RIGHT),l==null||l.classList.remove(_[c]),l==null||l.classList.add(_.RIGHT);const v=l.querySelector(".vf-notehead").cloneNode(!0);v.style.transform=o(c),l.style.opacity=".7",n&&(n.style.opacity=".7"),v.id="vf-"+u.id+"-copy",v==null||v.classList.add(_[c]),osmd==null||osmd.container.querySelector("svg").insertAdjacentElement("afterbegin",v)}},300)}},R=a=>{if(!a)return;const u=a.classList.values();for(const l of u)(l==null?void 0:l.indexOf("vf-"))!==0&&a.classList.remove(l)},W=()=>{for(const a of F.value){R(document.getElementById("vf-"+a)),R(document.getElementById("vf-"+a+"-stem"));const u="vf-"+a+"-copy",l=document.getElementById(u);l&&l.remove()}F.value=[]},U=a=>{var l;r.value=!1,(l=x.value)==null||l.autoShow(),setTimeout(()=>{var n;for(const c of Array.from(document.querySelectorAll(".vf-beam")))(n=c.querySelector("path"))==null||n.setAttribute("fill","#aeaeae")}),G.osmd=a,p.value=te(G.osmd),T();const u=(n,c,E=!0)=>{const v=ne(n);N.evaluatings={...N.evaluatings,[v.measureIndex]:{...v,...ue(c.score),score:c.score,dontTransition:E}}};if(C.value.userMeasureScore){for(const n in C.value.userMeasureScore)if(Object.prototype.hasOwnProperty.call(C.value.userMeasureScore,n)){const c=C.value.userMeasureScore[n];for(const E of p.value)if(c.measureRenderIndex==E.noteElement.sourceMeasure.MeasureNumberXML-1)if(!E.noteElement.tie)u(E,c);else for(const v of E.noteElement.tie.notes){const k=ae(v);k&&u(k,c,v!==E.noteElement.tie.StartNote)}}}},Y=()=>{g.value=!0,r.value=!1};return()=>{const a=r.value||y.value==="loading",u=g.value||y.value==="error";return e("div",{class:[I.container,D.sett.eyeProtection&&"eyeProtection",D.sett.camera&&"openCamera"]},[e(Ge,{className:I.header,detail:s.value,record:C,ref:x,style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"},onActiveChange:()=>T()},null),e("div",{id:"colexiu-detail-music-sheet",class:[I.musicSheet,Ce.musicSheet],style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"}},[a&&!u&&e(fe,{class:I.skeleton,rowWidth:"80%",title:!0,row:3},null),u&&e(Z,null,null),i.value&&e(B,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(ee,{score:i.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:D.sett.type},onRerender:U,onRenderError:Y},null)])])])}}});document.body.style.setProperty("--osdm-zoom",""+Q());K();j(We).mount("#app");export{Ue as __vite_legacy_guard};