import{d as f,P as g,S as n,j as a,be as h,F as S,w as C,g as y,U as T}from"./index.394decd7.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as I,a as i}from"./index.ae00317c.js";import{c as P}from"./index.75a0444f.js";import{C as w}from"./index.9e0d46e4.js";import{s as d,P as A,A as F,C as x,a as k}from"./album-my.3e040a29.js";import{S as E}from"./index.3dfdbf1b.js";import{g as M}from"./music.8e2b5f5b.js";import{u as R}from"./hooks.9e5ee122.js";import{C as V}from"./index.e6e212d8.js";import"./use-id.e2f22365.js";import"./use-tab-status.723110ee.js";import"./use-refs.09b2d19c.js";import"./index.b9aedd1d.js";import"./index.dc786267.js";import"./index.e5a263f6.js";import"./index.9849c993.js";import"./index.ae2dd816.js";import"./icon-xin.62588855.js";import"./icon_uploader.ff962490.js";import"./icon_album.ed729d4a.js";import"./icon_album_active.469423f9.js";import"./icon_exquisite.4b18ad76.js";import"./icon_music_active.1e7b47ef.js";import"./icon-play.bc9e7aab.js";var q=f({name:"Practice",emits:["favorite"],setup(p,{expose:t,emit:m}){const u=g(),r=n(0),{isLoading:e,state:l,execute:s}=P(o=>C.get("/music/sheet/practice",{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(o==null?void 0:o.rows)||3}}),null);return t({reload:s}),()=>{var c;const o=((c=l.value)==null?void 0:c.data.rows)||[];return r.value===0&&(r.value=o.length),a(S,null,[r.value>0&&a(w,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:d.practice},[a(E,{list:o,onDetail:v=>{const b=location.origin+location.pathname+"#/music-detail?id="+v.id;h(b,()=>{u.push({path:"/music-detail",query:{id:v.id}})})}},null)])])}}}),ie=f({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",M());const p=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const t=n(p||"personal");sessionStorage.setItem("music-personal-tab-value",t.value);const m=n(),u=n(),r=n();return T(()=>{R("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:d.personal},[a(V,null,null),a(q,{ref:r,onFavorite:()=>{var e,l,s,o;t.value==="personal"?(l=(e=m.value)==null?void 0:e.reset)==null||l.call(e):t.value==="collection"&&((o=(s=u.value)==null?void 0:s.reset)==null||o.call(s))}},null),a(I,{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(i,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(i,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(i,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(i,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null),a(i,{title:"\u8D60\u9001\u5355\u66F2",name:"personal-gift"},null),a(i,{title:"\u8D60\u9001\u4E13\u8F91",name:"album-gift"},null)]}),(t.value==="personal"||t.value==="personal-gift")&&a(A,{ref:m,gift:t.value==="personal-gift"?1:0,onFavorite:()=>{var e,l;(l=(e=r.value)==null?void 0:e.reload)==null||l.call(e)}},null),(t.value==="personal-album"||t.value==="album-gift")&&a(F,{gift:t.value==="album-gift"?1:0},null),t.value==="collection"&&a(x,{ref:u,onFavorite:()=>{var e,l;(l=(e=r.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(k,null,null)])}});export{ie as default};