import{T as u}from"./index.aa12cb22.js";import{T as p,r as d}from"./request.08b2dc2e.js";import{d as h,r as c,D as m,c as i,Y as f}from"./index.fdb8061e.js";import{S as w,a as _}from"./index.baa7e1bd.js";const S="_hotMusic_olatt_1",y="_title_olatt_4",v="_swipeItem_olatt_7",n={hotMusic:S,title:y,swipeItem:v};function M(t,o=4){if(t.length<=0||o<=0)return t;let a=[];for(let s=0;s<t.length;s=s+o)a.push(t.slice(s,s+o));return a}function b(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!f(t)}const A=h({name:"HotMusic",setup(){const t=c([]),o=async()=>{try{const{data:e}=await d.post("/api-website/open/music/sheet/list",{data:{albumStatus:"PASS",page:1,rows:12,state:1}});e&&Array.isArray(e.rows)&&(t.value=M(e.rows,4))}catch{}};m(()=>{o(),l()});const a=c(312),s=c(!1),l=()=>{s.value=!1;const e=document.body.clientWidth>750?750:document.body.clientWidth;a.value=e-63,s.value=!0};return()=>{let e;return i("div",{class:n.hotMusic},[i(p,{class:n.title,title:"\u70ED\u95E8\u66F2\u76EE"},null),s.value&&i(w,{showIndicators:!1,loop:!1,width:a.value},b(e=t.value.map(r=>i(_,{class:n.swipeItem},{default:()=>[i(u,{list:r},null)]})))?e:{default:()=>[e]})])}}});export{A as H};
