import{d as C,Q as T,U as s,j as a,bd as A,aS as F,A as b,B as I,F as w,y as h,g as y,V as x}from"./ResizeObserver.es.b7226882.js";import"./index.f6c44874.js";import"./index.cf00521e.js";import{T as P,a as n}from"./index.dc988884.js";import{c as V}from"./index.1eaf642c.js";import{C as k}from"./index.40f703b6.js";import{s as R}from"./song-empty.5c514691.js";import{s as u,P as B,A as D,C as H,a as M}from"./album-my.7355debb.js";import{S as N}from"./index.f4934f0d.js";import{g as q}from"./music.e5884c70.js";import{u as U}from"./hooks.a4ed20cb.js";import{C as W}from"./index.969bba7f.js";import"./use-id.5d5e6e63.js";import"./use-tab-status.db1f6d2e.js";import"./use-refs.428b450a.js";import"./index.9fec2202.js";import"./index.320010a3.js";import"./index.023f50db.js";import"./index.20c0f4c5.js";import"./icon-xin.797feb04.js";import"./icon_uploader.21a85a4d.js";import"./icon_album.4957b8e0.js";import"./icon_album_active.cb923735.js";import"./icon_exquisite.01ddc5aa.js";import"./icon_music_active.f55820b3.js";import"./icon-play.bc9e7aab.js";var j=C({name:"Practice",emits:["favorite"],setup(f,{expose:t,emit:v}){const m=T(),o=s(0),e=s(!1),l=s({}),{isLoading:i,state:p,execute:d}=V(r=>h.get("/music/sheet/practice",{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(r==null?void 0:r.rows)||3}}),null),E=async()=>{try{await h.get("/music/sheet/practice/del/"+l.value.id,{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student"}),d(),e.value=!1}catch{}};return t({reload:d}),()=>{var g;const r=((g=p.value)==null?void 0:g.data.rows)||[];return o.value===0&&(o.value=r.length),a(w,null,[o.value>0&&a(k,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:u.practice},[a(N,{list:r,onDetail:c=>{if(c.play===1){l.value=c,e.value=!0;return}const S=location.origin+location.pathname+"#/music-detail?id="+c.id;A(S,()=>{m.push({path:"/music-detail",query:{id:c.id}})})}},null)]),a(F,{show:e.value,class:u.songEfficacy,round:!0,onClose:()=>e.value=!1},{default:()=>[a("div",{class:u.songContainer},[a("div",{class:u.title},[b("\u8BE5\u66F2\u76EE\u5DF2\u5931\u6548")]),a("img",{src:R},null),a("div",{class:u.btnGroup},[a(I,{round:!0,onClick:E},{default:()=>[b("\u6211\u77E5\u9053\u4E86")]})])])]})])}}}),fe=C({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",q());const f=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const t=s(f||"personal");sessionStorage.setItem("music-personal-tab-value",t.value);const v=s(),m=s(),o=s();return x(()=>{U("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:u.personal},[a(W,null,null),a(j,{ref:o,onFavorite:()=>{var e,l,i,p;t.value==="personal"?(l=(e=v.value)==null?void 0:e.reset)==null||l.call(e):t.value==="collection"&&((p=(i=m.value)==null?void 0:i.reset)==null||p.call(i))}},null),a(P,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:t.value,"onUpdate:active":e=>t.value=e,onChange:e=>{t.value=e,sessionStorage.setItem("music-personal-tab-value",e)}},{default:()=>[a(n,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(n,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(n,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(n,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null),a(n,{title:"\u8D60\u9001\u5355\u66F2",name:"personal-gift"},null),a(n,{title:"\u8D60\u9001\u4E13\u8F91",name:"album-gift"},null)]}),(t.value==="personal"||t.value==="personal-gift")&&a(B,{ref:v,gift:t.value==="personal-gift"?1:0,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),(t.value==="personal-album"||t.value==="album-gift")&&a(D,{gift:t.value==="album-gift"?1:0},null),t.value==="collection"&&a(H,{ref:m,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(M,null,null)])}});export{fe as default};