index-legacy-735346fa-1723711575229.js 25 KB

1
  1. System.register(["./index-legacy-f759517e-1723711575229.js","./icon_back-legacy-a8ad0d25-1723711575229.js","./icon_separator-legacy-74573619-1723711575229.js","./index-legacy-1ac9eb24-1723711575229.js","./index-legacy-164ea0bc-1723711575229.js","./icon-collect-active-legacy-b7c75e66-1723711575229.js","./icon_default-legacy-fa9bb009-1723711575229.js","./catchData-legacy-637cc94a-1723711575229.js","./api-legacy-2fb7bd6e-1723711575229.js","./index-legacy-7dba2a59-1723711575229.js","./api-legacy-c7e34d7b-1723711575229.js","./index-legacy-25ecefb6-1723711575229.js","./index-legacy-c415a154-1723711575229.js","./urlUtils-legacy-0ad6488a-1723711575229.js","./contants-legacy-6ddd2d26-1723711575229.js","./index-legacy-0e957a3d-1723711575229.js","./Slider-legacy-8de4084e-1723711575229.js","./index-legacy-167d4ed1-1723711575229.js","./Scrollbar-legacy-26352b34-1723711575229.js"],(function(e,t){"use strict";var i,n,l,a,s,o,c,r,d,_,w,f,u,m,p,g,h,v,y,b,x,S,I,k,T,A,P,B,C,L,F,j,N,R,M,U,E,z,$,D,W,G,O,J,V,q,Y,Q,X,H,K,Z,ee,te;return{setters:[e=>{i=e.d,n=e.e,l=e.$,a=e.r,s=e.q,o=e.C,c=e.T,r=e.f,d=e.a0,_=e.a1,w=e.k,f=e.F,u=e.c,m=e.a,p=e.u,g=e.U,h=e.aP,v=e.A,y=e.x,b=e.aQ,x=e.aR,S=e.j,I=e.w,k=e.E,T=e.z,A=e.aC,P=e._,B=e.l,C=e.m,L=e.D,F=e.aS},e=>{j=e.i},e=>{N=e.i},e=>{R=e.T},e=>{M=e.P,U=e.T,E=e.i,z=e.a},e=>{$=e.i,D=e.a},e=>{W=e.i},e=>{G=e.u},e=>{O=e.c,J=e.d,V=e.e},e=>{q=e.g,Y=e.s},e=>{Q=e.g,X=e.s},e=>{H=e.T},e=>{K=e.u},e=>{Z=e.v},e=>{ee=e.a},e=>{te=e.C},null,null,null],execute:function(){var ie=document.createElement("style");ie.textContent="._container_wlncf_1{display:flex;flex-direction:column;height:100%}._container_wlncf_1 ._iconBack_wlncf_6{width:1.875vw;height:1.875vw}._container_wlncf_1 .n-breadcrumb .n-breadcrumb-item{font-size:max(.83333333rem,12Px)!important}._container_wlncf_1 .n-breadcrumb>ul{display:flex;align-items:center}._container_wlncf_1 .n-breadcrumb>ul .n-breadcrumb-item{display:flex;align-items:center}._container_wlncf_1 .n-breadcrumb>ul .n-breadcrumb-item__separator{display:none}._container_wlncf_1 .n-breadcrumb>ul .n-breadcrumb-item__link{padding:.26041667vw .9375vw;background:#FFFFFF;border-radius:.83333333vw;color:#21225d;line-height:1.04166667vw}._container_wlncf_1 .n-breadcrumb .n-breadcrumb-item:last-child .n-breadcrumb-item__link{color:#fff;background:var(--product-color)}._container_wlncf_1>.n-space{height:1.875vw;flex-shrink:0}._container_wlncf_1 ._separator_wlncf_39{width:.46875vw;height:.78125vw;margin:0 .83333333vw}._wrap_wlncf_44{padding-top:.78125vw;flex:1;transition:padding .3s;overflow:hidden}._wrap_wlncf_44._wrapBottom_wlncf_50{padding-bottom:5.625vw}._content_wlncf_53{display:flex;flex-direction:column;height:100%;background:#DDF2FF;border-radius:1.04166667vw}._tools_wlncf_60{padding:1.04166667vw;display:flex;align-items:center;flex-shrink:0}._tools_wlncf_60 .n-input{margin-left:auto;width:18.80208333vw}._tools_wlncf_60 .n-input__input-el{height:100%;line-height:100%}._tools_wlncf_60 .n-button{--n-height: 1.92708333vw !important;height:1.92708333vw;padding:0 1.25vw;font-size:max(.9375rem,13Px)}._tools_wlncf_60 .n-button.n-button--primary-type{font-weight:700!important;color:#fff}._contentWrap_wlncf_84{flex:1;display:flex;padding:0 1.04166667vw 1.04166667vw;overflow:hidden;gap:0 1.66666667vw}._musicList_wlncf_91{background-color:#fff;border-radius:.83333333vw;width:26.66666667vw;min-width:15.3125vw;height:100%;overflow-x:hidden;overflow-y:auto;min-width:330Px}._musicList_wlncf_91::-webkit-scrollbar{width:0;display:none}._musicList_wlncf_91 ._wrapList_wlncf_105{width:26.66666667vw;min-width:15.3125vw;min-height:100%;border-radius:.83333333vw}._musicList_wlncf_91 ._empty_wlncf_111{display:flex;align-items:center;justify-content:center;height:50vh}._searchSection_wlncf_117{position:sticky;top:0;left:0;z-index:9;padding:1.25vw;background-color:#fff;display:flex;align-items:center}._searchSection_wlncf_117 .TheSearch{background:#F5F6FA;--n-color-focus: #F5F6FA !important}._searchSection_wlncf_117 .nBaseCascaser{border-radius:5.20833333vw;width:8.85416667vw;background:#F5F6FA;margin-right:.83333333vw}._searchSection_wlncf_117 .nBaseCascaser .n-base-selection__border{border-color:#f5f6fa}._itemContainer_wlncf_140{width:100%;border-radius:.83333333vw;padding:.20833333vw .41666667vw}._itemContainer_wlncf_140:first-child{padding-top:.41666667vw}._itemContainer_wlncf_140:last-child{padding-bottom:.41666667vw}._item_wlncf_140{position:relative;display:flex;align-items:center;padding:.52083333vw;border-radius:.625vw;cursor:pointer}._item_wlncf_140:hover{background-color:rgba(0,0,0,.05)}._item_wlncf_140._active_wlncf_162{background-color:#ddf2ff}._item_wlncf_140._active_wlncf_162 ._arrow_wlncf_165{opacity:1}._item_wlncf_140 ._img_wlncf_168{position:relative;width:3.125vw;height:3.125vw;border-radius:.41666667vw;margin-right:.625vw;overflow:hidden;flex-shrink:0}._item_wlncf_140 ._img_wlncf_168 .n-image{width:3.125vw;height:3.125vw}._item_wlncf_140 ._img_wlncf_168 img{transition:opacity .3s;opacity:0;height:100%;width:100%}._item_wlncf_140 ._img_wlncf_168 img[data-loaded=true]{opacity:1}._item_wlncf_140 ._title_wlncf_190{flex:1;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start}._item_wlncf_140 ._title_wlncf_190 ._titleName_wlncf_197{font-size:max(.9375rem,13Px);font-weight:600;color:#131415;line-height:1.45833333vw;width:100%}._item_wlncf_140 ._title_wlncf_190 ._titleDes_wlncf_204{font-size:max(.72916667rem,11Px);font-weight:400;color:#777;line-height:1.04166667vw;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:.15625vw 0}._item_wlncf_140 ._title_wlncf_190 ._iconType_wlncf_215{background:#fff;border-radius:.15625vw;padding:0px .15625vw;font-size:max(.625rem,9Px);text-align:center;font-weight:400;line-height:1;border:1px solid transparent;margin-right:.26041667vw}._item_wlncf_140 ._title_wlncf_190 ._iconPlay_wlncf_226{border:1px solid #15B2FD;color:#00adff}._item_wlncf_140 ._title_wlncf_190 ._iconSing_wlncf_230{border:1px solid #CD8613;color:#ce8208}._item_wlncf_140 ._btn_wlncf_234{margin-left:auto;width:4.375vw;height:1.875vw;background:linear-gradient(to right,#44CAFF,#259DFE);border:none;padding:0;font-weight:700!important;flex-shrink:0;min-width:3.22916667vw;min-height:1.5625vw;font-size:max(.9375rem,12Px)}._item_wlncf_140 ._btn_wlncf_234 .n-button__content>img{margin-left:.52083333vw;width:.46875vw;height:.625vw}._item_wlncf_140 ._arrow_wlncf_165{position:absolute;top:50%;right:.625vw;transform:translate(124%,-50%);opacity:0}._item_wlncf_140 ._showPlayLoading_wlncf_259{opacity:0}._loadingWrap_wlncf_262{display:flex;justify-content:center;min-height:4.16666667vw}._loadingWrap_wlncf_262._showLoading_wlncf_267{height:0;opacity:0;min-height:0;display:none}._musicStaff_wlncf_273{display:flex;flex-direction:column;position:relative;left:-.41666667vw;flex:1;background-color:#fff;border-radius:.83333333vw;z-index:1;overflow:hidden}._musicStaff_wlncf_273::-webkit-scrollbar{width:0;display:none}._musicStaff_wlncf_273 ._goBtn_wlncf_288{position:absolute;left:50%;bottom:2.39583333vw;transform:translate(-50%);height:3.64583333vw;cursor:pointer;transition:all .2s ease-in}._musicStaff_wlncf_273 ._rightBtns_wlncf_297{position:absolute;top:1.04166667vw;right:1.25vw;display:flex;align-items:center}._musicStaff_wlncf_273 ._rightBtns_wlncf_297 ._textBtn_wlncf_304{margin-right:1.25vw;padding:1px .83333333vw!important;line-height:1.92708333vw!important;height:1.92708333vw!important;background:#F5F6FA;--n-border: #F5F6FA !important}._musicStaff_wlncf_273 ._rightBtns_wlncf_297 ._transBtn_wlncf_312{width:2.34375vw;cursor:pointer;margin-right:.78125vw}._musicStaff_wlncf_273 ._favitor_wlncf_317{width:2.5vw;height:2.5vw;cursor:pointer;transition:all .3s}._musicStaff_wlncf_273 ._favitor_wlncf_317:hover{transform:scale(1.1)}._musicStaff_wlncf_273 ._favitor_wlncf_317>img{display:block;width:100%;height:100%;filter:drop-shadow(0 0 .52083333vw rgba(27,35,55,.1))}._musicName_wlncf_332{padding-top:1.5625vw;font-size:1.35416667rem;font-weight:500;color:#333;line-height:1.25vw;text-align:center}._staffImgs_wlncf_340{flex:1;overflow-y:auto;height:100%;padding:0 1.5625vw}._staffImgs_wlncf_340>img{width:100%}.van-fade-enter-active,.van-fade-leave-active{transition:all .3s}.van-fade-enter-from,.van-fade-leave-to{opacity:0}._previewWindow_wlncf_357{width:85%;height:85vh;position:relative}._previewWindow_wlncf_357 ._previewClose_wlncf_362{position:absolute;left:2.08333333vw;top:2.08333333vw;width:3.125vw;height:3.38541667vw}._previewWindow_wlncf_357 ._previewIframe_wlncf_369{width:100%;height:85vh;background-color:#fff;border-radius:.83333333vw}._popSelect_wlncf_375{font-size:.83333333rem;width:15.625vw;max-height:26.04166667vw;overflow-y:scroll;box-shadow:0 .10416667vw .83333333vw rgba(0,0,0,.08);border-radius:.57291667vw;--n-option-height: 1.77083333vw}._popSelect_wlncf_375 .n-base-select-option__content{width:80%!important}._popSelect1_wlncf_387{font-size:.83333333rem;width:12.5vw;box-shadow:0 .10416667vw .83333333vw rgba(0,0,0,.08);border-radius:.57291667vw;--n-option-height: 1.77083333vw}._popSelect1_wlncf_387 .n-base-select-option__content{width:80%!important}._popTrans_wlncf_397{font-size:.83333333rem;width:10.41666667vw;overflow-y:scroll;box-shadow:0 2 .83333333vw rgba(0,0,0,.08);border-radius:.57291667vw;--n-option-height: 1.77083333vw}._popTrans_wlncf_397 .n-base-select-option__content{width:80%!important}._textBtn_wlncf_304 ._iconArrow_wlncf_408{display:inline-block;margin-left:.41666667vw;margin-top:.10416667vw;width:.41666667vw;height:.26041667vw;background:url("+new URL("icon-arrow-66c56d73.svg",t.meta.url).href+") no-repeat center center / contain;transform:rotate(180deg);color:#131415;fill:#131415}._textBtn_wlncf_304:hover,._textBtn_wlncf_304._textBtnActive_wlncf_420{background:#198CFE!important;font-weight:500!important;color:#fff!important}._textBtn_wlncf_304:hover ._iconArrow_wlncf_408,._textBtn_wlncf_304._textBtnActive_wlncf_420 ._iconArrow_wlncf_408{transform:rotate(0);background:url("+new URL("icon-arrow2-3d2121db.svg",t.meta.url).href+") no-repeat center center / contain;color:#fff;fill:#fff;margin-top:0}\n",document.head.appendChild(ie);const ne={container:"_container_wlncf_1",iconBack:"_iconBack_wlncf_6",separator:"_separator_wlncf_39",wrap:"_wrap_wlncf_44",wrapBottom:"_wrapBottom_wlncf_50",content:"_content_wlncf_53",tools:"_tools_wlncf_60",contentWrap:"_contentWrap_wlncf_84",musicList:"_musicList_wlncf_91",wrapList:"_wrapList_wlncf_105",empty:"_empty_wlncf_111",searchSection:"_searchSection_wlncf_117",itemContainer:"_itemContainer_wlncf_140",item:"_item_wlncf_140",active:"_active_wlncf_162",arrow:"_arrow_wlncf_165",img:"_img_wlncf_168",title:"_title_wlncf_190",titleName:"_titleName_wlncf_197",titleDes:"_titleDes_wlncf_204",iconType:"_iconType_wlncf_215",iconPlay:"_iconPlay_wlncf_226",iconSing:"_iconSing_wlncf_230",btn:"_btn_wlncf_234",showPlayLoading:"_showPlayLoading_wlncf_259",loadingWrap:"_loadingWrap_wlncf_262",showLoading:"_showLoading_wlncf_267",musicStaff:"_musicStaff_wlncf_273",goBtn:"_goBtn_wlncf_288",rightBtns:"_rightBtns_wlncf_297",textBtn:"_textBtn_wlncf_304",transBtn:"_transBtn_wlncf_312",favitor:"_favitor_wlncf_317",musicName:"_musicName_wlncf_332",staffImgs:"_staffImgs_wlncf_340",previewWindow:"_previewWindow_wlncf_357",previewClose:"_previewClose_wlncf_362",previewIframe:"_previewIframe_wlncf_369",popSelect:"_popSelect_wlncf_375",popSelect1:"_popSelect1_wlncf_387",popTrans:"_popTrans_wlncf_397",iconArrow:"_iconArrow_wlncf_408",textBtnActive:"_textBtnActive_wlncf_420"},le=""+new URL("icon_goXiaoku-5d0db670.png",t.meta.url).href,ae=""+new URL("icon-close-1bf25bcf.png",t.meta.url).href,se=""+new URL("icon_trans-e9b9e2da.png",t.meta.url).href,oe=i({name:"music-guide",emits:["close"],setup(e,{emit:t}){const i=n({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:q("music1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:l(-4),left:l(0),width:l(533),height:l(271)},btnsStyle:{bottom:l(40),left:l(-10)},eleRectPadding:{left:7,top:7,width:14,height:14},boxStyle:{}},{ele:"",img:q("music2.png"),imgStyle:{top:l(-4),left:l(-205),width:l(420),height:l(228)},btnsStyle:{bottom:l(35),left:l(-48)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:7,top:7,width:14,height:14}},{ele:"",img:q("music3.png"),imgStyle:{top:"100%",left:l(-130),width:l(401),height:l(304)},btnsStyle:{bottom:l(100),left:l(30)},boxStyle:{borderRadius:"40px"},eleRectPadding:{left:7,top:7,width:14,height:14},type:"bottom"}],step:0}),u=a(!1),m=a({});(async()=>{try{const e=await Q({guideTag:"teacher-guideInfo"});e.data?m.value=JSON.parse(e.data?.guideValue)||null:m.value={},m.value&&m.value.musicGuide?u.value=!1:u.value=!0}catch(e){console.log(e)}})();const p=()=>{const e=document.getElementById(`music-${i.step}`);if(e){const t=e.getBoundingClientRect();if(console.log(e.style.display,"ele"),"none"==e.style.display)return void v();const n=i.steps[i.step].eleRectPadding?.left||0,l=i.steps[i.step].eleRectPadding?.top||0,a=i.steps[i.step].eleRectPadding?.width||0,s=i.steps[i.step].eleRectPadding?.height||0;i.box={left:t.x-n+"px",top:t.y-l+"px",width:t.width+a+"px",height:t.height+s+"px"}}else v()},g=async e=>{try{if("xiaoku-music"!==e)return;m.value?m.value.musicGuide=!1:m.value={musicGuide:!1};try{await X({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(m.value)})}catch(t){console.log(t)}i.step=0,p(),u.value=!0}catch{}};s((()=>{p(),window.addEventListener("resize",h),o.on("teacher-guideInfo",g)}));const h=()=>{p()};c((()=>{window.removeEventListener("resize",h),o.off("teacher-guideInfo",g)}));const v=()=>{i.step>=3?y():(i.step=i.step+1,p())},y=async()=>{m.value?m.value.musicGuide=!0:m.value={musicGuide:!0};try{await X({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(m.value)})}catch(e){console.log(e)}u.value=!1};return()=>r(f,null,[u.value?d(r("div",{"onUpdate:show":e=>u.value=e,class:["n-modal-mask","n-modal-mask-guide"]},[r("div",{class:Y.content,onClick:()=>v()},[r("div",{class:Y.backBtn,onClick:e=>{e.stopPropagation(),y()}},[w("跳过")]),r("div",{class:Y.box,style:{...i.box,...i.steps[i.step].boxStyle},id:`modeType-${i.step}`},[i.steps.map(((e,t)=>r("div",{onClick:e=>e.stopPropagation(),class:Y.item,style:"bottom"==e.type?{display:t===i.step?"":"none",left:`${e.eleRect?.left}px`,top:`-${e.imgStyle?.height}`}:{display:t===i.step?"":"none",left:`${e.eleRect?.left}px`,top:`${i.box?.height}`}},[r("img",{class:Y.img,style:e.imgStyle,src:e.img},null),r("div",{class:Y.btns,style:e.btnsStyle},[i.step+1==i.steps.length?r(f,null,[r("div",{class:[Y.endBtn],onClick:()=>y()},[w("完成")]),r("div",{class:Y.nextBtn,onClick:()=>{i.step=0,p()}},[w("再看一遍")])]):r("div",{class:Y.btn,onClick:()=>v()},[w("下一步 ("),i.step+1,w("/"),i.steps.length,w(")")])])])))])])]),[[_,u.value,"show"]]):null])}});e("default",i({name:"XiaokuMusic",setup(){const e=G(),t=u(),i=m(),l=p(),o=n({page:1,rows:20,status:!0,name:"",audioPlayTypes:"",musicSheetCategoriesId:i.query.id||""}),d=n({loading:!1,finshed:!1,reshing:!1,tags:[],tagIndex:0,musicalInstrumentId:"",musicSubject:"",list:[],listActive:0,musicInstrumentIndex:0,playState:"pause",showPlayer:!1,previewModal:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,audioPlayTypeList:[],iframeSrc:"",showMusicImg:"staff",trackList:[],showTransBtn:!0,trackName:"切换声部"}),_=a(""),q=a(!1),Y=u(),Q=e=>{for(const t of e)t.instruments&&t.instruments.length>0&&(t.instruments.forEach((e=>{e.columnName="乐器"})),t.children=t.instruments,Q(t.instruments))},X=async()=>{d.loading=!0;let e={};try{const{audioPlayTypes:t,...i}=o;e=await O({...i,audioPlayTypes:t?"PLAY_SING"===t?["PLAY","SING"]:[t]:[],musicSubject:d.musicSubject,musicalInstrumentId:d.musicalInstrumentId})}catch(t){console.log(t)}if(d.reshing&&(d.list=[],d.reshing=!1),200===e?.code&&Array.isArray(e?.data?.rows)){console.log(e?.data?.rows),(e?.data?.rows||[]).forEach((e=>{e.audioPlayTypeArray=e.audioPlayTypes?e.audioPlayTypes.split(","):[]})),d.list=[...d.list,...e.data.rows],d.finshed=e.data.rows.length<o.rows;const t=d.list[d.listActive];t&&t.isScoreRender&&0===d.listActive&&(d.musicInstrumentIndex=999)}else d.finshed=!0;d.list[d.listActive]&&de(d.list[d.listActive]),d.loading=!1,setTimeout((()=>{q.value=!0}),500)},ie=()=>{d.listActive=0,d.showPlayer=!1,d.playState="pause",o.page=1,d.finshed=!1,X()},ce=a(),re=e=>{"api_fingerPreView"===e.data?.api&&(d.showCloseBtn=!e.data.state)};s((async()=>{const t=Object.keys(ee).map((e=>({value:e,label:ee[e]})));d.audioPlayTypeList=[{label:"全部",value:""},...t],await e.getSubjects(),K(document.querySelector(".musicList-container"),(e=>{const t=e[0],{height:i}=t.contentRect;document.documentElement.style.setProperty("--xiaoku-music-height",i+"px")})),(async()=>{const t=e.getSubjectList,i=sessionStorage.getItem("musicSubjectList")?JSON.parse(sessionStorage.getItem("musicSubjectList")):[],n=[];console.log(t,i,"subjectList"),t.forEach((e=>{i.find((t=>t.id===e.id))&&n.push(e)})),Q(n),d.tags=[{columnName:"声部",name:"全部声部",id:""},...n]})(),await X(),new IntersectionObserver((e=>{e[0].intersectionRatio>0&&(d.loading||d.finshed||(o.page=o.page+1,X()))})).observe(ce.value),ve(),pe(),window.addEventListener("message",re)})),c((()=>{window.removeEventListener("message",re)}));const de=async e=>{const t=await J({type:"MUSIC",materialId:e.id});200===t?.code&&(e.favitor=t.data)},_e=g((()=>(d.list[d.listActive]&&(Z(),d.list[d.listActive]?.xmlFileUrl,Y.getToken),d.list[d.listActive]||{}))),we=()=>{d.list[d.listActive].favitor=!d.list[d.listActive].favitor,V({favoriteFlag:d.list[d.listActive].favitor,type:"MUSIC",materialId:d.list[d.listActive].id})},fe=e=>{const t=d.list.findIndex((t=>t.id===e.id));t>-1&&(d.listActive===t?d.playState="play"===d.playState?"pause":"play":d.playState="play",d.showPlayer=!0,d.listActive=t)};g((()=>{const e=d.list[d.listActive],t=[];return(e?.musicalInstruments||[]).forEach(((e,i)=>{t.push({label:e.name,value:i})})),t}));const ue=g((()=>{if(d.list.length){const e=d.list[d.listActive]?.musicSheetType;return"SINGLE"!==e}return!1})),me=(e,t)=>!!(e||""===e||null==e||["JIAN","FIRST"].includes(t)&&!e),pe=()=>{const e=Y.getToken,t=d.list[d.listActive],i="first"===d.showMusicImg?"firstTone":"fixed"===d.showMusicImg?"fixedTone":(d.showMusicImg,"staff");d.iframeSrc=`${Z()}/instrument/?id=${t.id}&modelType=practise&modeType=json&Authorization=${e}&isPreView=true&part-index=${d.musicInstrumentIndex}&musicRenderType=${i}`,console.log(d.iframeSrc,"iframeSrc")},ge=e=>{"play"===e?d.playState="play":"pause"===e?d.playState="pause":"pre"===e?d.list[d.listActive-1]&&fe(d.list[d.listActive-1]):"next"===e?d.list[d.listActive+1]&&fe(d.list[d.listActive+1]):"favitor"===e&&we()},he=g((()=>{const e=d.list[d.listActive],{scoreType:t,isConvertibleScore:i}=e||{},n=[{value:"first",label:"首调"},{value:"fixed",label:"固定调"}];return["JIAN","FIRST"].includes(t)&&!1===i||null==i||n.unshift({value:"staff",label:"五线谱"}),n})),ve=async()=>{const e=d.list[d.listActive];if("CONCERT"===e?.musicSheetType){if(e.xmlFileUrl){const t=await fetch(e.xmlFileUrl).then((e=>e.text()));ye(t)}}else{const{scoreType:t,isConvertibleScore:i}=e||{};let n="first";n="STAVE"===t?"staff":"JIAN"===t?"fixed":"first",d.showMusicImg=n,d.showTransBtn=me(i,t)}},ye=e=>{const t=(new DOMParser).parseFromString(e,"text/xml"),i=t.getElementsByTagName("part-list")?.[0]?.getElementsByTagName("score-part")||[],n=Array.from(i).map((e=>e.getElementsByTagName("part-name")?.[0]?.textContent?.trim()||""));"COMMON"===n[0]?.toLocaleUpperCase?.()&&n.shift();const l=d.list[d.listActive]?.multiTracksSelection,a=l?l?.split(","):[],s=n.map(((e,t)=>{const i=!(0!=a.length&&!a.includes(e)),n=h(e);return{label:e+(n?`(${n})`:""),value:t,sortId:F(n,t),canselect:i,track:e}})).filter((e=>e.canselect)).sort(((e,t)=>e.sortId-t.sortId));d.trackList=s;const o=d.list[d.listActive];o&&o.isScoreRender&&d.trackList.unshift({label:"总谱",value:999,sortId:0,canselect:!0,track:999});const c=d.list[d.listActive],{scoreType:r,isConvertibleScore:_}=c||{};let w="first";w="STAVE"===r?"staff":"JIAN"===r?"fixed":"first",d.showMusicImg=w,d.showTransBtn=me(_,r)};v((()=>d.listActive),(async()=>{d.musicInstrumentIndex=0,ve()}));const be=g((()=>{let e=[];if("first"===d.showMusicImg){const t=_e.value?.musicFirstImg;e=t?t.split(","):[]}else if("fixed"===d.showMusicImg){const t=_e.value?.musicJianImg;e=t?t.split(","):[]}else if("staff"===d.showMusicImg){const t=_e.value?.musicImg||_e.value?.musicSvg;e=t?t.split(","):[]}return e}));return()=>{let e;return r("div",{class:ne.container},[r(y,{align:"center",wrapItem:!1,size:16},{default:()=>[r("img",{style:{cursor:"pointer"},src:j,class:ne.iconBack,onClick:()=>l.push({path:"/xiaoku-ai"})},null),r(b,{separator:""},{default:()=>[r(x,{onClick:()=>l.push({path:"/xiaoku-ai"})},{default:()=>[w("全部列表")]}),r("img",{class:ne.separator,src:N},null),r(x,null,{default:()=>[i.query.name]})]})]}),r("div",{class:[ne.wrap,d.showPlayer?ne.wrapBottom:""]},[r("div",{class:ne.content},[r("div",{class:ne.tools},[r(y,{style:{width:"100%"},size:[12,6],wrapItem:!1},(n=e=d.audioPlayTypeList.map((e=>r(S,{round:!0,textColor:o.audioPlayTypes===e.value?"#fff":"#000",color:o.audioPlayTypes===e.value?"#198CFE":"#fff",type:o.audioPlayTypes===e.value?"primary":"default",onClick:()=>{o.audioPlayTypes=e.value||"","SING"===e.value&&(d.musicalInstrumentId="",d.musicSubject=""),d.reshing=!0,document.querySelector(".musicList-container")?.scroll(0,0),ie()}},{default:()=>[e.label]}))),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!L(n)?e:{default:()=>[e]}))]),r("div",{class:ne.contentWrap},[r("div",{class:[ne.musicList,"musicList-container"]},[r("div",{class:ne.searchSection},["SING"!==o.audioPlayTypes&&r(te,{placeholder:"全部乐器",arrowType:"small",childShowAllCheck:!1,class:ne.instrumentSection,value:_.value,"onUpdate:value":e=>_.value=e,options:d.tags,onMoreId:e=>{d.loading||(d.musicalInstrumentId=e.childId,d.musicSubject=e.parentId,d.reshing=!0,document.querySelector(".musicList-container")?.scroll(0,0),ie())}},null),r(R,{style:{marginLeft:"auto"},round:!0,border:!1,onSearch:e=>{d.loading||(o.name=e,d.reshing=!0,ie())}},null)]),r("div",{class:[ne.wrapList,"music-wrap-list"]},[d.list.map(((e,t)=>r("div",{class:ne.itemContainer},[r("div",{class:[ne.item,d.listActive===t&&ne.active],onClick:async()=>{(e=>{const t=d.list.findIndex((t=>t.id===e.id));t>-1&&(d.listActive=t),de(e)})(e),await ve();const t=d.list[d.listActive];console.log(t,"selected music"),t&&t.isScoreRender?d.musicInstrumentIndex=999:d.musicInstrumentIndex=0,pe()}},[r("div",{class:ne.img},[r(I,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:e.titleImg||W,onLoad:e=>{e.target.dataset.loaded="true"}},null),r(M,{class:[d.listActive===t&&"play"===d.playState?"":ne.showPlayLoading]},null)]),r("div",{class:ne.title},[r("div",{class:ne.titleName},[r(U,{text:e.musicSheetName},null)]),r("div",{class:ne.titleDes},[e.audioPlayTypeArray?.includes("PLAY")&&r("span",{class:[ne.iconType,ne.iconPlay]},[w("演奏")]),e.audioPlayTypeArray?.includes("SING")&&r("span",{class:[ne.iconType,ne.iconSing]},[w("演唱")]),e.composer])]),r("img",{class:ne.arrow,src:E},null)])]))),r("div",{ref:ce,class:[ne.loadingWrap,d.finshed&&ne.showLoading]},[r(k,{show:!0},null)]),!d.loading&&0===d.list.length&&r("div",{class:ne.empty},[r(H,null,null)])])]),r("div",{class:ne.musicStaff},[r("div",{class:ne.musicName},[_e.value.musicSheetName]),r("img",{id:"music-2",style:{display:_e.value.id?"":"none"},class:[ne.goBtn],src:le,onClick:()=>{ge("pause");let e="staff";"first"===d.showMusicImg?e="firstTone":"fixed"===d.showMusicImg?e="fixedTone":"staff"===d.showMusicImg&&(e="staff");let i=`${Z()}/instrument?v=${+new Date}&platform=pc&id=${_e.value.id}&Authorization=${t.getToken}&musicRenderType=${e}&showGuide=true&part-index=${d.musicInstrumentIndex}`;d.musicalInstrumentId&&(i+="&instrumentId="+d.musicalInstrumentId),window.matchMedia("(display-mode: standalone)").matches?(T.application=window.matchMedia("(display-mode: standalone)").matches,d.previewModal=!0,d.previewUrl=i,d.showPreivew=!1):window.open(i)}},null),r("div",{class:ne.rightBtns,style:{display:_e.value.id?"":"none"}},[ue.value&&r(A,{options:d.trackList,trigger:"hover",value:d.musicInstrumentIndex,"onUpdate:value":[e=>d.musicInstrumentIndex=e,async e=>{await ve(),d.trackName=d.trackList.find((e=>e.value===d.musicInstrumentIndex))?.label||"切换声部",pe()}],class:[ne.popSelect]},{default:()=>[r(S,{round:!0,class:[ne.textBtn]},{default:()=>[d.trackName,r("i",{class:ne.iconArrow},null)]})]}),d.showTransBtn&&r(A,{options:he.value,trigger:"hover",value:d.showMusicImg,"onUpdate:value":[e=>d.showMusicImg=e,async e=>{d.showMusicImg=e,ue.value&&pe()}],class:[ne.popTrans]},{default:()=>[r("img",{class:[ne.transBtn],src:se},null)]}),r("div",{class:ne.favitor,onClick:()=>we()},[r(P,{name:"favitor",mode:"out-in"},{default:()=>[_e.value.favitor?r("img",{src:$,key:"1"},null):r("img",{src:D,key:"2"},null)]})])]),r("div",{class:ne.staffImgs},[ue.value?r("iframe",{id:"staffIframeRef",style:{width:"100%",height:"100%",paddingTop:"20px"},src:d.iframeSrc,onLoad:()=>{}},null):r(f,null,[be.value.length>0?be.value.map((e=>r("img",{src:e,key:e},null))):r(H,null,null)])])])])])]),0!==d.list.length&&r(z,{show:d.showPlayer,playState:d.playState,item:_e.value,onChange:e=>ge(e)},null),q.value?r(oe,null,null):null,r(B,{maskClosable:C,show:d.previewModal,"onUpdate:show":[e=>d.previewModal=e,e=>{e||(d.previewUrl="")}],class:ne.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[r(k,{show:d.showPreivew,style:"--n-opacity-spinning: 1;"},{default:()=>[r("img",{style:{display:d.showCloseBtn?"":"none"},src:ae,class:ne.previewClose,onClick:()=>{d.previewModal=!1,d.previewUrl=""}},null),r("iframe",{class:ne.previewIframe,onLoad:()=>{d.showPreivew=!1},frameborder:"0",src:d.previewUrl},null)]})]})]);var n}}}))}}}));