1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8573],{10732:e=>{e.exports={ArtistAdmin:"artist-admin_ArtistAdmin__7dW55",ShowcaseWrap:"artist-admin_ShowcaseWrap__bhpMz",Tag:"artist-admin_Tag__hziSI",Logo:"artist-admin_Logo__TCjTf",Column:"artist-admin_Column__6peRd",ArtistAdmin__content:"artist-admin_ArtistAdmin__content__XzC5f",ArtistAdmin__content__item:"artist-admin_ArtistAdmin__content__item__7UYbw",copyIdBtn:"artist-admin_copyIdBtn__Ecffm"}},18808:(e,t,s)=>{"use strict";s.d(t,{A:()=>u});var a=s(54631);s(38959);var i=s(92301),n=s(29641),r=s.n(n),l=s(6993),o=s(92378),c=s(56778),d=s(53803),m=s.n(d);function u(e){let{item:t,variant:s="single",disabled:n=!1,countries:d=[],showGeoCountries:u=!1,...g}=e,h=(0,c.C)();if(!t)return null;let p=[],y=r()(m().tag,{[m().feed]:"feed"===s});if((t.tagdisplay||t.usertags)&&(p=(t.tagdisplay||t.usertags).split(",").map((e,t)=>{let s=e.trim(),{title:r,isLocation:l}=(0,o.D)(s),c=(l?void 0:(0,o.b)(s,h))??encodeURIComponent(s);return(0,a.jsxs)(i.default,{className:y,"aria-disabled":n,href:`/search?q=tag:${c}`,children:["#",r]},t)})),t.genre){let e=l._v[t.genre];"playlist"===t.type&&(e=l.cX[t.genre]);let s=(0,a.jsxs)(i.default,{className:y,"aria-disabled":n,href:`/search?q=genre:${t.genre}`,children:["#",e]},"genre-tag");p.unshift(s)}if(t.trending_genres&&Object.entries(t.trending_genres).forEach(e=>{let[s,r]=e;if(r){let e;"global"===s?e="Global":(e=l._v[s],"playlist"===t.type&&(e=l.cX[s])),p=[(0,a.jsxs)(i.default,{className:y,"aria-disabled":n,href:`/search?q=genre:${s}`,children:["#",e]},`genre-tag-${s}`)]}}),t.featured_countries){let e=t.featured_countries.map(e=>{let t=d.find(t=>t.id===e);return t?(0,a.jsx)(i.default,{className:y,"aria-disabled":n,href:`/search?q=country:${t.name}`,children:t.name},t.id):null}).filter(Boolean);u?p=e:p.unshift(...e)}return(0,a.jsx)("div",{className:m().TagContainer,...g,children:p})}},24516:e=>{e.exports={MusicAdmin:"music-admin_MusicAdmin__SSsdB",ShowcaseWrap:"music-admin_ShowcaseWrap__ykck3",Tag:"music-admin_Tag__2ItAF",Logo:"music-admin_Logo__9OfqL",MusicAdmin__content:"music-admin_MusicAdmin__content__wUKxd",MusicAdmin__content__item:"music-admin_MusicAdmin__content__item__CML92",copyIdBtn:"music-admin_copyIdBtn__vnOgu",copyIconBtn:"music-admin_copyIconBtn__nQrCj"}},25925:(e,t,s)=>{"use strict";s.d(t,{TI:()=>d,Pd:()=>u,uG:()=>h,ze:()=>y,Sp:()=>g,Zz:()=>p,Ss:()=>x});var a=s(40983),i=s(63210);let n=i.Ik({addedon:i.ai(),display:i.Yj(),normalizedKey:i.Yj(),section:i.Yj(),tag:i.Yj()}),r=i.YO(n),l=i.g1(i.zM()),o=i.Ik({id:i.KC([i.Yj(),i.ai()]),keywords:i.Yj()}),c=i.YO(o);async function d(){try{return await (0,a.H2)({endpoint:"musictags",schema:r})}catch(e){return(0,a._Y)("musictags",e),null}}let m=null;function u(){return m||(m=d().then(e=>e??[]))}async function g(e){let{type:t,id:s,tags:i,action:n}=e,r="playlist"===t?`musictags/playlist/${s}`:`musictags/music/${s}`;try{let e={tags:JSON.stringify(i)};return await (0,a.H2)({endpoint:r,fetchOptions:{method:"add"===n?"POST":"DELETE",headers:{"Content-Type":"application/x-www-form-urlencoded"}},bodyParams:e,noResponse:!0})}catch(e){return(0,a._Y)(r,e,{type:t,id:s,tags:i,action:n}),null}}async function h(e){try{return await (0,a.H2)({endpoint:"playlist/tags",params:{playlist_id:e},schema:l})}catch(t){return(0,a._Y)("playlist/tags",t,{playlistId:e}),null}}async function p(e){let{playlistId:t,tags:s}=e;try{let e={playlist_id:t,tags:JSON.stringify(s)};return await (0,a.H2)({endpoint:"playlist/addtags",fetchOptions:{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},bodyParams:e,noResponse:!0})}catch(e){return(0,a._Y)("playlist/addtags",e,{playlistId:t,tags:s}),null}}async function y(e){try{return await (0,a.H2)({endpoint:`admin/search-keywords/${e}`,schema:c})}catch(t){return(0,a._Y)(`admin/search-keywords/${e}`,t,{type:e}),null}}async function x(e){let{type:t,id:s,term:i,value:n}=e;try{return await (0,a.H2)({endpoint:`admin/search-keywords/terms/${t}/${s}`,fetchOptions:{method:"POST",headers:{"Content-Type":"application/json"}},bodyParams:{term:i,value:n},noResponse:!0})}catch(e){return(0,a._Y)(`admin/search-keywords/terms/${t}/${s}`,e,{type:t,id:s,term:i,value:n}),null}}},49023:e=>{e.exports={GenreMenu:"components-misc_GenreMenu__anlLC",active:"components-misc_active__axyz6",player:"components-misc_player__sgp_N",playerCover:"components-misc_playerCover__W7d1c",playerControls:"components-misc_playerControls__7g7YL",playButton:"components-misc_playButton__ywMWP",play:"components-misc_play___bxif",pause:"components-misc_pause__
1CLxhm",progressContainer:"components-misc_progressContainer__knBMp",progressBar:"components-misc_progressBar__R25fW",timeDisplay:"components-misc_timeDisplay__k4DAj",errorContainer:"components-misc_errorContainer__ojBek",trackList:"components-misc_trackList__yvX9V",trackItem:"components-misc_trackItem__xMK6v",trackButton:"components-misc_trackButton__xoVWt",trackImage:"components-misc_trackImage__go2S_",trackInfo:"components-misc_trackInfo__W7Bfh",trackTitle:"components-misc_trackTitle__f6NcV",trackControls:"components-misc_trackControls__c9uVx",trackSlider:"components-misc_trackSlider___4O6k",trackTime:"components-misc_trackTime__IBwiE",playIcon:"components-misc_playIcon__vL1sQ",playIconWrapper:"components-misc_playIconWrapper__LdtCH",albumContainer:"components-misc_albumContainer__X94eE",albumHeader:"components-misc_albumHeader__BdpEo",albumInfo:"components-misc_albumInfo__PQqlV",albumCover:"components-misc_albumCover__9EdYB",contentContainer:"components-misc_contentContainer__IAoeM",trackListContainer:"components-misc_trackListContainer__rDxSa",playerContainer:"components-misc_playerContainer__roOqr",singleTrackContainer:"components-misc_singleTrackContainer__7Yisv"}},53803:e=>{e.exports={tag:"music-tags_tag__7gwid",feed:"music-tags_feed__6l4zL",TagContainer:"music-tags_TagContainer__RqWcg"}},56226:(e,t,s)=>{"use strict";s.d(t,{Zl:()=>d,rt:()=>o,w9:()=>c});var a=s(40983),i=s(20434),n=s(93103),r=s(1872),l=s(2292);let o=async()=>{let e=(0,i.a5)(a.o_)||"",t=(0,i.a5)(a.TB)||"";await c({token:e,secret:t,expiration:0}),r.A.remove(a.o_,{path:"/",secure:!0,sameSite:"strict",domain:a.w9}),r.A.remove(a.TB,{path:"/",secure:!0,sameSite:"strict",domain:a.w9})},c=async e=>{let t,{token:s,secret:i,user:o,expiration:c}=e,d=Date.now()/1e3;t=o&&o?.is_admin?d+604800:d+31536e3;let m=((o&&o?.is_admin?t:c||t)-d)/3600/24;return(r.A.set(a.CV,s,{path:"/",expires:m,secure:"true"!==l.env.AUDIOMACK_DEV,sameSite:"lax",domain:a.w9}),r.A.set(a.bB,i,{path:"/",expires:m,secure:"true"!==l.env.AUDIOMACK_DEV,sameSite:"lax",domain:a.w9}),o)?(n.Ay.set(n.jN,+o.id),{token:s,secret:i,user:o}):{token:s,secret:i}},d=async e=>{if(!e)return;await c({token:e.oauth_token,secret:e.oauth_token_secret,user:e.user});let t=Date.now()/1e3,s=(t+604800-t)/3600/24;return r.A.set(a.o_,e.admin_token,{path:"/",expires:s,secure:!0,sameSite:"strict",domain:a.w9}),r.A.set(a.TB,e.admin_token_secret,{path:"/",expires:s,secure:!0,sameSite:"strict",domain:a.w9}),e}},56778:(e,t,s)=>{"use strict";s.d(t,{C:()=>n});var a=s(38959),i=s(25925);let n=()=>{let[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=!0;return(0,i.Pd)().then(s=>{e&&t(s)}),()=>{e=!1}},[]),e}},58573:(e,t,s)=>{"use strict";s.d(t,{p:()=>eR,X:()=>e_});var a=s(54631),i=s(38959),n=s(24516),r=s.n(n),l=s(46329),o=s(60140),c=s(23771),d=s(68695),m=s(87768),u=s(40983),g=s(7389);let h=e=>{let{music:t,updateMusic:s}=e,{createToast:n,createDisclosure:r}=(0,g.j)(),h=(0,m.useRouter)(),p=(0,m.usePathname)(),[y,x]=(0,i.useState)(!1),f=()=>t?.status==="complete"||t?.status==="suspended"||t?.status==="unplayable"?"takedown":t?.status==="removed"||t?.status==="takedown"?"restore":void 0,j=async()=>{await r({title:`${f()} ${t?.type}`,message:`Are you sure you want to ${f()} this ${t?.type}?`}),x(!0);try{let e=await (0,u.H2)({endpoint:"songs/toggle-dmca",fetchOptions:{method:"POST"},bodyParams:{id:t?.id,operation:f()}});n({lifespan:1e4,message:(0,d.X5)(`${t?.title} has been ${"takedown"===f()?"taken down":"restored"} successfully`,{casing:"capitalize"})}),s({...t,status:e?.status}),(p===(0,l.HK)(t)||p.includes((0,l.HK)(t)))&&h.refresh()}catch(e){n({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{x(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:j,isLoading:y,children:(0,a.jsxs)(c.E,{inheritFont:!0,casing:"capitalize",children:[f()," Music"]})})},p=e=>{let{music:t,isAdminSuspend:s=!1,children:n,className:r,updateMusic:h,...p}=e,{createToast:y,createDisclosure:x}=(0,g.j)(),f=(0,m.useRouter)(),j=(0,m.usePathname)(),[w,_]=(0,i.useState)(!1),b="suspended"===t.status?"unsuspend":"suspend",v=async()=>{await x({title:`${b} ${t.type}`,message:`Are you sure you want to ${b} this ${t.type}?`}),_(!0);try{let e=await (0,u.H2)({endpoint:`music/${t.id}/suspend`,fetchOptions:{method:"suspend"===b?"PUT":"DELETE"}});y({message:(0,d.X5)(`${t.type} ${"suspend"===b?"suspended":"unsuspended"} successfully`,{casing:"capitalize"})}),h(e),(j===(0,l.HK)(t)||j.includes((0,l.HK)(t)))&&f.refresh()}catch(e){y({message:e?.data?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{_(!1)}};return s?(0,a.jsx)("button",{className:r,onClick:()=>{p?.disabled?window.location.href="/legal":v()},...p,children:(0,a.jsx)(a.Fragment,{children:n})}):(0,a.jsx)(o.E.button,{size:"sm",onClick:v,isLoading:w,children:(0,a.jsxs)(c.E,{inheritFont:!0,casing:"capitalize",children:[b," Music"]})})},y=e=>{let{music:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,d]=(0,i.useState)(!1),h=(0,m.useRouter)(),p=(0,m.usePathname)(),y=async()=>{await n({title:"Censor Artwork",message:`Are you sure you want to censor the artwork of ${t.title}?`}),d(!0);try{let e=t?.id,a="playlist"===t.type?"playlist":"music",i="";"music"===a&&(i="songs/censor-artwork"),"playlist"===a&&(i="playlists/censor-artwork"),await (0,u.H2)({endpoint:i,fetchOptions:{method:"POST"},bodyParams:{id:e}}),s({message:`You censored the artwork of ${t.title} successfully`}),(p===(0,l.HK)(t)||p.includes((0,l.HK)(t)))&&h.refresh()}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{d(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:y,isLoading:r,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Censor Artwork"})})};var x=s(58783),f=s(54718);let j=e=>{let{music:t,updateMusic:s}=e,{createToast:n}=(0,g.j)(),[r,h]=i.useState(!1),[p,y]=(0,i.useState)(!1),[j,w]=i.useState(!1),_=t?.stats_excluded?"include":"exclude",b=(0,m.useRouter)(),v=(0,m.usePathname)(),k=async()=>{h(!1),y(!0);try{let e=await (0,u.H2)({endpoint:`admin/music/exclude-stats/${_}`,fetchOptions:{method:"PUT",headers:{"Content-Type":"application/json"}},bodyParams:{items:[`${t?.id}`],allTracks:j}});n({message:(0,d.X5)(`${t?.type} ${"exclude"===_?"excluded":"included"} successfully`,{casing:"capitalize"})}),s({...t,stats_excluded:e?.data?.status}),(v===(0,l.HK)(t)||v.includes((0,l.HK)(t)))&&b.refresh()}catch(e){n({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"}),console.log(e)}finally{w(!1),y(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>h(!0),isLoading:p,children:(0,a.jsxs)(c.E,{inheritFont:!0,casing:"capitalize",children:[_," Stats"]})}),(0,a.jsxs)(f.EN,{disclosure:{title:`${_} ${t?.type}`,isOpen:r,message:null},resetDisclosure:()=>h(!1),handleConfirm:k,handleCancel:()=>h(!1),children:["Are you sure you want to ",_," this ",t?.type,"?",t?.type==="album"&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{})," ",(0,a.jsx)("br",{}),(0,a.jsx)(x.Sc,{label:"Exclude all tracks",isChecked:j,onChange:()=>{w(!j)}})]})]})]})},w=Object.assign(j,{ExcludeInclude:j,ClearStats:e=>{let{music:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),r=(0,m.useRouter)(),h=(0,m.usePathname)(),[p,y]=(0,i.useState)(!1),x=async()=>{await n({title:`Clear ${t?.type} Stats`,message:`Are you sure you want to clear ${t?.type} stats?`}),y(!0);try{await (0,u.H2)({endpoint:"songs/clear",fetchOptions:{method:"POST"},bodyParams:{id:t?.id}}),s({message:(0,d.X5)(`${t?.type} stats cleared successfully`,{casing:"capitalize"})}),(h===(0,l.HK)(t)||h.includes((0,l.HK)(t)))&&r.refresh()}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{y(!1)}};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(o.E.button,{size:"sm",onClick:x,isLoading:p,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Clear Stats"})})})}}),_=e=>{let{music:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),r=(0,m.useRouter)(),h=(0,m.usePathname)(),[p,y]=(0,i.useState)(!1),x=async()=>{await n({title:"Censor Artwork",message:`Are you sure you want to ban the audio of ${t.title}?`}),y(!0);try{await (0,u.H2)({endpoint:`music/${t?.id}/ban-audio`,fetchOptions:{method:"POST"}}),s({message:(0,d.X5)(`You banned the audio of ${t.title} successfully`,{casing:"capitalize"})}),(h===(0,l.HK)(t)||h.includes((0,l.HK)(t)))&&r.refresh()}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{y(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:x,isLoading:p,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Ban Audio"})})};var b=s(245);let v=e=>{let{music:t}=e,{createToast:s}=(0,b.dj)(),[n,r]=(0,i.useState)(!1),l=async()=>{r(!0);try{await (0,u.H2)({endpoint:`music/${t?.id}/repair-url`,fetchOptions:{method:"POST"}}),s({message:`You repaired the url of ${t.title} successfully`})}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{r(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:l,isLoading:n,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Repair Url"})})};var k=s(20434),S=s(26815),C=s(41595),E=s(44979),A=s(97664);let T=e=>{let{music:t}=e,[s,n]=i.useState(!1),[r,l]=i.useState(!1),{createToast:d}=(0,b.dj)(),{refreshRecognition:m,refreshRecognitionIsLoading:g}=(e=>{let{musicId:t,skip:s}=e,[a,n]=(0,i.useState)(),[r,l]=(0,i.useState)(!1);(0,i.useEffect)(()=>{t&&!s&&(async()=>{try{l(!0);let e=await o({musicId:t});if(!e)return n(null);n(e)}catch(e){n(null)}finally{l(!1)}})()},[s]);let o=async e=>{let{musicId:t}=e;return await (0,u.H2)({endpoint:`music/${t}/recognition-refresh`})};return{refreshRecognition:a,refreshRecognitionIsLoading:r}}
1)({musicId:t?.id,skip:!s||!r}),{getMusicRecognition:h,recognition:p,recognitionIsLoading:y}=(e=>{let{musicId:t,skip:s}=e,[a,n]=(0,i.useState)(),[r,l]=(0,i.useState)(!1);(0,i.useEffect)(()=>{o()},[s]);let o=async()=>{if(t&&!s)try{l(!0);let e=await c({musicId:t});if(!e)return n(null);n(e)}catch(e){n(null)}finally{l(!1)}},c=async e=>{let{musicId:t}=e;return await (0,u.H2)({endpoint:`music/${t}/recognition`})};return{recognition:a,recognitionIsLoading:r,getMusicRecognition:o}})({musicId:t?.id,skip:!s}),x=m?.result||p?.result;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>n(!0),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"View Recognitions"})}),(0,a.jsx)(S.a,{in:s,onClose:()=>n(!1),title:"Content Recognition",children:(0,a.jsx)(C.so.Column,{gap:"6px",css:{margin:"1rem 0"},children:y||g?(0,a.jsx)(E.y,{}):(0,a.jsxs)(a.Fragment,{children:[(0,k.Im)(x)?(0,a.jsx)(A.S,{size:"sm",message:"No recognitions found"}):(0,a.jsx)(a.Fragment,{children:Object.keys(x||{}).map(e=>(0,a.jsxs)(c.E,{casing:"capitalize",fontSize:"16px",weight:600,children:[(0,a.jsx)(c.E.span,{weight:700,casing:"uppercase",color:"var(--text-gray)",fontSize:"13px",inheritFont:!0,children:e.replace(/[^\w\s]/gi," ")}),": ",x?.[e]||"N/A"]},e))}),(0,a.jsx)(o.E.button,{size:"sm",style:{margin:"8px auto"},onClick:()=>{l(!0),m&&!g?(l(!1),h(),d({message:"Rescan successful"})):setTimeout(()=>{l(!1)},1e3)},children:"Re-scan and Refresh"})]})})})]})},z=e=>{let{music:t}=e,[s,n]=i.useState(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>n(!0),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Show Monetization"})}),(0,a.jsx)(S.a,{in:s,onClose:()=>n(!1),title:"Album Monetization",children:(0,a.jsx)(C.so.Column,{gap:"6px",css:{margin:"1rem 0"},children:t?.length?t?.map(e=>(0,a.jsxs)(c.E,{casing:"capitalize",fontSize:"16px",weight:600,children:[(0,a.jsx)(c.E.span,{weight:700,color:"var(--color-gray-45)",inheritFont:!0,children:e.title})," ",": ",e.amp_partner]},e.id)):(0,a.jsx)(A.S,{message:"No Monetization",size:"sm"})})})]})};var $=s(57644),P=s(99905),N=s.n(P);let L=e=>{let{music:t}=e,{createToast:s}=(0,b.dj)(),[n,r]=i.useState(null),[l,d]=i.useState([]),m=async e=>{r(e);try{let a=await (0,u.H2)({endpoint:`music/${t?.id}/${e}`});if("album"===t.type){let t=Object.entries(a).map(e=>{let[t,s]=e;return{id:t,url:s}});d(s=>[...s.filter(t=>t?.type!==e),{type:e,urls:t}]),s({message:"Your download links are ready"})}else a.url?window.open(a.url,"_blank"):s({message:"Could not retrieve the file URL.",variant:"error"})}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{r(null)}};return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:N().downloadBtnGroup,children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>m("source"),isLoading:"source"===n,outline:!0,trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Get Source File Links"})}),(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>m("stream"),isLoading:"stream"===n,outline:!0,trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Get Streaming File Links"})})]}),l.length>0&&(0,a.jsx)("section",{className:"mt-6 space-y-6",children:l.map(e=>{let{type:t,urls:s}=e;return(0,a.jsxs)("article",{children:[(0,a.jsxs)("header",{className:N().downloadTitle,children:[(0,a.jsx)(c.E.b,{inheritFont:!0,weight:600,fontSize:"16px",children:"source"===t?"Source Files (expires soon)":"Streaming Files (expires soon)"})," "]}),(0,a.jsx)("ol",{className:N().downloadList,children:s.map(e=>{let{id:t,url:s}=e;return(0,a.jsx)("li",{className:N().downloadItem,children:(0,a.jsxs)("a",{href:s,rel:"noopener noreferrer",className:N().downloadLink,children:[(0,a.jsx)("span",{children:"Track"}),(0,a.jsx)("img",{src:(0,$.f)("external-link","#0000ff"),alt:"",className:N().downloadIcon})]})},t)})})]},t)})})]})};var I=s(73608),F=s(76679),O=s(42766),M=s(29641),D=s.n(M),H=s(49023),B=s.n(H);let U=e=>{let{tag:t,handleTagsToggle:s}=e,[n,r]=(0,i.useState)(!1),l=(0,i.useCallback)(e=>({parent:t.children.find(e=>e.isChecked?e:null),child:e&&e.isChecked?e:null}),[t.children]);return(0,i.useEffect)(()=>
1{l()?.parent&&r(!0)},[l]),(0,a.jsxs)(C.so.Column,{className:D()([B().GenreMenu,n&&B().active]),children:[(0,a.jsx)("button",{className:B().GenreMenuButton,onClick:e=>{e.stopPropagation(),r(!n)},children:t?.name}),(0,a.jsx)(C.so.Column,{gap:"14px",css:{marginLeft:"12px",opacity:.85},children:n&&t?.children?.map((e,t)=>(0,a.jsx)(x.Sc,{label:e?.name,isDisabled:!1,isChecked:e.isChecked,onChange:t=>s(e?.key,t.target.checked)},`${e.name}:${t}`))})]})};var W=s(18808);let R=["Admin Only","Mood","Submission","Contest"],Y=e=>{let{title:t,tags:s,onTagToggle:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.E,{weight:700,casing:"uppercase",style:{marginBottom:"1.5rem"},children:t}),(0,a.jsx)(C.so,{flexWrap:"wrap",gap:"2px",justifyContent:"space-between",children:s.length?s.map(e=>(0,a.jsx)(U,{tag:e,handleTagsToggle:i},e.name)):(0,a.jsx)(c.E,{children:"No tags available"})})]})},K=e=>{let{title:t,tags:s,onTagToggle:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.E,{weight:700,casing:"uppercase",style:{marginBottom:"1.5rem"},children:t}),(0,a.jsx)(C.so.Column,{gap:"16px",children:s.length?s.flatMap(e=>e.children.map(t=>(0,a.jsx)(x.Sc,{label:t.name,isDisabled:!1,isChecked:t.isChecked,onChange:e=>i(t.key,e.target.checked)},`${e.name}-${t.name}`))):(0,a.jsx)(c.E,{children:"No tags available"})})]})},q=i.memo(e=>{let{music:t}=e,{isLoadingTags:s,tagsData:n}=(()=>{let[e,t]=(0,i.useState)(null),[s,a]=(0,i.useState)(!1),n=(0,i.useCallback)(async()=>{a(!0);try{let e=await (0,u.H2)({endpoint:"musictags"});t(e)}catch(e){console.log("getSearchTags error --\x3e",e?.message)}finally{a(!1)}},[]);return(0,i.useEffect)(()=>{n()},[n]),{tagsData:e,isLoadingTags:s,refetch:n}})(),{createToast:r}=(0,b.dj)(),[l,o]=i.useState(""),[m,g]=i.useState(t?.usertags||""),h=(0,i.useMemo)(()=>!n?.length||s?{left:[],right:[]}:n.reduce((e,t)=>{let s=R.includes(t.section)?"right":"left",a=e[s].find(e=>e.name===t.section),i=m.split(",").map(e=>e.trim().normalize("NFKD")).filter(Boolean).some(e=>e===t.tag||e===t.display||e===t.normalizedKey),n={name:t.display,key:t.tag,isChecked:i};a?a.children.push(n):t.section&&e[s].push({name:t.section,children:[n]});let r=e=>e.sort((e,t)=>e.name.localeCompare(t.name));return{left:r(e.left),right:r(e.right)}},{left:[],right:[]}),[n,s,m]),p=(0,i.useMemo)(()=>{if(!l)return h;let e=l.toLowerCase().normalize("NFKD"),t=t=>t.map(t=>({...t,children:t.children.filter(t=>t.name.toLowerCase().normalize("NFKD").includes(e))})).filter(e=>e.children.length>0);return{left:t(h.left),right:t(h.right)}},[h,l]),y=async(e,s)=>{try{let a=t?.type==="playlist"?"playlist":"music";await (0,u.H2)({endpoint:`musictags/${a}/${t?.id}`,fetchOptions:{method:"add"==(s?"add":"delete")?"POST":"DELETE",headers:{"Content-Type":"application/x-www-form-urlencoded"}},bodyParams:{tags:[e]}}),r({message:(0,d.X5)(`You have ${s?"added":"removed"} ${t?.title} from ${e} successfully`,{casing:"capitalize"})}),g(t=>{let a=t.split(",");return s&&a.push(e),s||a.splice(a.indexOf(e),1),a.join(",")})}catch(e){r({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}},x=(0,i.useCallback)(e=>{o(e.target.value)},[]);return s?(0,a.jsx)(E.y,{}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.D,{onChange:x,placeholder:"Search tags...",value:l,className:"w-full"}),(0,a.jsxs)(C.so,{flexWrap:"wrap",alignItems:"baseline",css:{marginBottom:"0.6rem"},children:[(0,a.jsx)(c.E,{fontSize:"13px",weight:700,style:{marginRight:"10px"},children:"Current Tags:"}),(0,a.jsx)(W.A,{item:t,disabled:!0})]}),(0,a.jsx)(C.so,{flexWrap:"wrap",alignItems:"baseline",css:{marginBottom:"0.6rem"},children:(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"24px",css:{marginTop:"1rem"},fullWidth:!0,justifyContent:"space-between",children:[(0,a.jsx)(C.so.Column,{flex:"0 0 45%",children:l?(0,a.jsx)(K,{title:"Sub Genres",tags:p.left,onTagToggle:y}):(0,a.jsx)(Y,{title:"Sub Genres",tags:p.left,onTagToggle:y})}),(0,a.jsx)(C.so.Column,{flex:"0 0 45%",children:l?(0,a.jsx)(K,{title:"Moods & More",tags:p.right,onTagToggle:y}):(0,a.jsx)(Y,{title:"Moods & More",tags:p.right,onTagToggle:y})})]})})]})}),G=e=>{let{music:t}=e,[s,n]=i.useState(null);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>n("trending"),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Trending Controls"})}),(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>n("tags"),children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Tags Controls"})}),(0,a.jsx)(S.a,{in:!!s,onClose:()=>n(null),size:"xlg",maxHeight:!0,children:(0,a.jsxs)(I.tU,{centered:!0,defaultTab:s||"",onChangeTab:e=>{n(e)},children:[(0,a.jsx)(I.tU.Tab,{title:"Trending Controls",dataKey:"trending",children:(0,a.jsx)(V,{music:t})}),(0,a.jsx)(I.tU.Tab,{title:"Tags Control",dataKey:"tags",children:(0,a.jsx)(q,{music:t})}),(0,a.jsx)(I.tU.Tab,{title:"Search Keywords",dataKey:"search-keywords",children:(0,a.jsx)(X,{})})]})})]})},X=()=>{let{createToast:e}=(0,b.dj)();return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"20px",justifyContent:"space-between",children:[(0,a.jsx)(c.E,{fontSize:"13px",weight:700,children:"Update keyword(s) on a music object."}),(0,a.jsxs)(F.D.Form,{onSubmit:async t=>{t.preventDefault();try{let{terms:e}=t.target;console.log("terms",e)}catch(t){e({message:Object.values(t?.data?.message).join("")||"Something went wrong",variant:"error"})}},children:[(0,a.jsx)(F.D.Input,{label:"Keyword(s) / Phrase(s)",placeholder:"",name:"terms",required:!0,type:"text"}),(0,a.jsx)(O.h,{size:24,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E.button,{size:"lg",type:"submit",children:"Save"})})]})]})})},V=e=>{let{music:t}=e,{originalArgs:s,trendMusic:n,trendMusicIsLoading:r}=(()=>{let[e,t]=(0,i.useState)(!1),[s,a]=(0,i.useState)(null);return{trendMusic:(0,i.useCallback)(async e=>{t(!0),a(e);try{let t=Object.fromEntries(Object.entries({genre:e.genre,region:e.region}).filter(e=>{let[,t]=e;return t}));return await (0,u.H2)({endpoint:`music/${e?.id}/trend`,fetchOptions:{method:e.trend?"PUT":"DELETE"},bodyParams:t})}catch(e){console.log("trendMusic error --\x3e",e)}finally{t(!1),a(null)}},[]),trendMusicIsLoading:e,originalArgs:s}})(),{allRegions:l,regionsIsLoading:o}=(()=>{let[e,t]=(0,i.useState)(null),[s,a]=(0,i.useState)(!1),n=(0,i.useCallback)(async()=>{a(!0);try{let e=await (0,u.H2)({endpoint:"region"});t(e)}catch(e){console.log("fetchRegions error --\x3e",e?.message)}finally{a(!1)}},[]);return(0,i.useEffect)(()=>{n()},[n]),{allRegions:e,regionsIsLoading:s,refetch:n}})(),{data:m}=(e=>{let{musicId:t}=e,[s,a]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),l=(0,i.useCallback)(async()=>
1{if(t){r(!0);try{let e=await (0,u.H2)({endpoint:`trending/music/${t}`});a(e)}catch(e){console.log("fetchMusicTrending err --\x3e",e)}finally{r(!1)}}},[t]);return(0,i.useEffect)(()=>{t&&l()},[l,t]),{data:s,isLoading:n,refetch:l}})({musicId:t?.id}),[g,h]=i.useState(m?.genres),[p,y]=i.useState(m?.regions),{createToast:f}=(0,b.dj)(),j=async e=>{let{genre:s,region:a,trend:i}=e,r=i?"trended":"un-trended";try{await n({id:t.id,genre:s,trend:i,region:a}),f({message:(0,d.X5)(`You have ${r} ${t?.title} in ${s||a} successfully`,{casing:"capitalize"})})}catch(e){throw f({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"}),e}},w=(0,i.useMemo)(()=>{let e=m?.genres||{};return Object.keys(e).reduce((t,s)=>(t[(e=>({global:"global"})[e]||e)(s)]=e[s],t),{})},[m?.genres]);return(0,i.useEffect)(()=>(h(w),m?.regions&&l&&y([...Object.keys(m?.regions)?.map(e=>({code:e,isActivated:m?.regions[e],name:l.find(t=>t.code===e)?.name}))]),()=>{h({}),y([])}),[m?.regions,l,w]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"24px",css:{marginTop:"1rem"},justifyContent:"space-between",children:[(0,a.jsxs)(C.so.Column,{flex:"0 0 45%",children:[(0,a.jsx)(c.E,{weight:700,casing:"uppercase",style:{marginBottom:"1rem"},children:"Genres"}),(0,a.jsx)(F.D,{onChange:e=>{let t=e.target.value,s={};Object.keys(w)?.forEach(e=>{let a=(0,d.X5)(e,{casing:"lower"}),i=(0,d.X5)(t,{casing:"lower"});a.includes(i)&&(s[e]=w[e])}),h(s)},placeholder:"Search in Trending Genres"}),(0,a.jsx)(C.so,{flexWrap:"wrap",gap:"20px",justifyContent:"space-between",children:g&&Object.keys(g)?.length>0?Object.keys(g)?.map(e=>"global"!==e&&(0,a.jsx)(C.so.Column,{flex:"1 0 50%",children:(0,a.jsx)(x.Sc,{size:"sm",label:s?.genre===e&&r?"Loading...":(0,d.X5)(e,{casing:"capitalize"}),isDisabled:s?.genre===e&&r,isChecked:g[e],onChange:async t=>{try{h(s=>({...s,[e]:t.target.checked})),await j({genre:e,trend:t.target.checked})}catch(s){h(s=>({...s,[e]:!t.target.checked}))}}})},e)):(0,a.jsx)(c.E,{children:"No genres available."})})]}),(0,a.jsxs)(C.so.Column,{flex:"0 0 48%",children:[(0,a.jsx)(c.E,{weight:700,casing:"uppercase",style:{marginBottom:"1rem"},children:"Regions"}),(0,a.jsx)(F.D,{onChange:e=>{let t=e.target.value,s=[];l?.forEach(e=>{let a=(0,d.X5)(e?.name,{casing:"lower"}),i=(0,d.X5)(t,{casing:"lower"});a?.toLowerCase().includes(i)&&s.push(e)}),y(s)},placeholder:"Search in Regions"}),(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"14px 19px",justifyContent:"space-between",children:[g&&(0,a.jsx)(C.so.Column,{flex:"1 0 50%",children:(0,a.jsx)(x.Sc,{size:"sm",label:s?.genre==="global"&&r?"Loading...":"Rest of the world",isDisabled:s?.genre==="global"&&r,isChecked:g.global,onChange:async e=>{try{h(t=>({...t,global:e.target.checked})),await j({genre:"global",trend:e.target.checked})}catch(t){h(t=>({...t,global:!e.target.checked}))}}})}),o?(0,a.jsx)(E.y,{}):p?.length>0?p.map(e=>{let{code:t,name:s,isActivated:i}=e;return(0,a.jsx)(C.so.Column,{flex:"1 0 50%",children:(0,a.jsx)(x.Sc,{size:"sm",label:s,isChecked:i,onChange:async e=>{try{y(s=>s.map(s=>s.code===t?{...s,isActivated:e.target.checked}:s)),await j({region:t,trend:e.target.checked})}catch(s){y(s=>s.map(s=>s.code===t?{...s,isActivated:!e.target.checked}:s))}}})},t)}):(0,a.jsx)(c.E,{children:"No regions available."})]})]})]})})};var Q=s(45487),J=s(527),Z=s(67555);let ee={currentlyPlaying:null,currentTrackId:null},et=e=>{let{track:t,streamingUrl:s,isLoading:n,onError:r,onTrackPlay:l}=e,o=(0,i.useRef)(null),[d,m]=(0,i.useState)({isPlaying:!1,currentTime:0,duration:0,error:null});(0,i.useEffect)(()=>{ee.currentTrackId!==t.song_id&&d.isPlaying&&m(e=>({...e,isPlaying:!1}))},[ee.currentTrackId,t.song_id]);let u=(0,i.useCallback)(()=>{o.current&&s&&(d.isPlaying?(o.current.pause(),m(e=>({...e,isPlaying:!1})),ee.currentTrackId=null):(ee.currentlyPlaying&&ee.currentlyPlaying!==o.current&&ee.currentlyPlaying.pause(),o.current.play().catch(()=>{let e="Unable to play this track. Please try again later.";m(t=>({...t,error:e,isPlaying:!1})),r?.(e)}),ee.currentlyPlaying=o.current,ee.currentTrackId=t.song_id||null,m(e=>({...e,isPlaying:!0})),l?.(t.song_id||"")))},[s,d.isPlaying,r,t.song_id,l]),g=(0,i.useCallback)(e=>{if(o.current){let t=parseFloat(e.target.value);o.current.currentTime=t,m(e=>({...e,currentTime:t}))}}
1,[]),h=e=>{let t=Math.floor(e/60),s=Math.floor(e%60);return`${t}:${s.toString().padStart(2,"0")}`};return t?(0,a.jsxs)("div",{className:B().trackItem,children:[(0,a.jsxs)("div",{className:B().trackButton,children:[(0,a.jsx)("img",{src:t.image||"https://assets.audiomack.com/default-song-image.png",alt:t.title,className:B().trackImage}),(0,a.jsxs)("div",{className:B().trackInfo,children:[(0,a.jsx)("div",{className:B().trackTitle,children:(0,a.jsx)(c.E,{inheritFont:!0,children:t.title})}),!d.error&&d.isPlaying&&s&&(0,a.jsxs)("div",{className:B().trackControls,children:[(0,a.jsx)("input",{type:"range",min:"0",max:d.duration||0,value:d.currentTime,onChange:g,className:B().trackSlider}),(0,a.jsxs)(c.E,{color:"secondary",className:B().trackTime,children:[h(d.currentTime)," / ",h(d.duration)]})]})]}),(0,a.jsx)("button",{onClick:u,className:B().playButton,disabled:!s||n,children:n?(0,a.jsx)(c.E,{children:"Loading..."}):d.error?(0,a.jsx)(c.E,{color:"error",children:"Error"}):d.isPlaying?(0,a.jsx)(J.default,{className:B().playIcon}):(0,a.jsx)(Q.default,{className:B().playIcon})})]}),s&&(0,a.jsx)("audio",{ref:o,src:s,onTimeUpdate:()=>{o.current&&m(e=>({...e,currentTime:o.current.currentTime}))},onLoadedMetadata:()=>{o.current&&m(e=>({...e,duration:o.current.duration}))},onEnded:()=>{m(e=>({...e,isPlaying:!1})),ee.currentlyPlaying=null,ee.currentTrackId=null},children:(0,a.jsx)("track",{kind:"captions"})})]}):null},es=e=>{let{tracks:t}=e,[s,n]=(0,i.useState)({}),[r,l]=(0,i.useState)({}),[o,c]=(0,i.useState)({}),d=(0,i.useCallback)(e=>{ee.currentTrackId=e},[]),{tryStreamingUrl:m}=(0,Z.u)(),u=(0,i.useCallback)(async e=>{if(e.song_id&&!s[e.song_id]&&!r[e.song_id]){l(t=>({...t,[e.song_id]:!0}));try{let t=await m({musicItem:{...e,id:e.song_id?parseInt(e.song_id,10):void 0},nonBlocking:!0});if(t?.signedUrl)n(s=>({...s,[e.song_id]:t.signedUrl}));else throw Error("Unable to get streaming URL")}catch(t){c(t=>({...t,[e.song_id]:"An error occurred while trying to load this track."}))}finally{l(t=>({...t,[e.song_id]:!1}))}}},[]);return(0,i.useEffect)(()=>{t.forEach(e=>{e.song_id&&!s[e.song_id]&&u(e)})},[t,u]),(0,a.jsx)("div",{className:B().trackList,children:t.map(e=>(0,a.jsx)(et,{track:e,streamingUrl:e.song_id?s[e.song_id]:void 0,isLoading:!!e.song_id&&r[e.song_id],onError:t=>e.song_id&&c(s=>({...s,[e.song_id]:t})),onTrackPlay:d},e.song_id))})},ea=e=>{let{track:t}=e,[s,n]=(0,i.useState)(t.streaming_url),[r,l]=(0,i.useState)(!1),[o,c]=(0,i.useState)(null),{tryStreamingUrl:d}=(0,Z.u)(),m=(0,i.useCallback)(async()=>{if(t.song_id&&!s){l(!0);try{let e=await d({musicItem:{...t,id:t.song_id?parseInt(t.song_id,10):void 0},nonBlocking:!0});if(e?.signedUrl)n(e.signedUrl);else throw Error("Unable to get streaming URL")}catch(e){c("An error occurred while trying to load this track.")}finally{l(!1)}}},[t,s]);return!t.song_id||s||r||m(),(0,a.jsx)(et,{track:t,streamingUrl:s,isLoading:r,onError:c})},ei=e=>{let{music:t}=e,[s,n]=(0,i.useState)(!1),r="album"===t.type&&Array.isArray(t.tracks),l={id:t.id,song_id:t.id,title:t.title,streaming_url:t.streaming_url,image:t.image};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>n(!0),children:(0,a.jsxs)(c.E,{inheritFont:!0,casing:"capitalize",children:["Play ",r?"Album":"Music"]})}),(0,a.jsx)(S.a,{in:s,onClose:()=>n(!1),size:"lg",children:(0,a.jsx)("div",{children:r?(0,a.jsxs)("div",{className:B().albumContainer,children:[(0,a.jsx)("div",{className:B().albumHeader,children:(0,a.jsxs)("div",{className:B().albumInfo,children:[(0,a.jsx)("img",{src:t.image||"https://assets.audiomack.com/default-song-image.png",alt:t.title,className:B().albumCover}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.E,{children:t.title}),(0,a.jsxs)(c.E,{children:[t.tracks?.length||0," Tracks"]})]})]})}),(0,a.jsx)(es,{tracks:t.tracks})]}):(0,a.jsx)("div",{className:B().singleTrackContainer,children:(0,a.jsx)(ea,{track:l})})})})]})},en=e=>{let{music:t}=e,{createDisclosure:s,createToast:n}=(0,g.j)(),[r,l]=(0,i.useState)(!1),d=async()=>{l(!0);try{await s({message:`Are you sure you want to remove the amp partner of ${t.title}?`,title:"Remove Amp Partner"}),await (0,u.H2)({endpoint:`music/${t?.id}/amp`,fetchOptions:{method:"DELETE"}}),n({message:`You removed the amp partner of ${t?.title} successfully`})}catch(e){n({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{l(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:d,isLoading:r,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Remove AMP Partner"})})},er=e=>{let{music:t}=e,{createDisclosure:s,createToast:n}=(0,g.j)(),[r,l]=(0,i.useState)(!1),d=async()=>{try{await s({message:`Are you sure you want to make ${t.title} WW?`}),l(!0),await (0,u.H2)({endpoint:`music/${t?.id}/geo`,fetchOptions:{method:"POST"},bodyParams:{country:"WW",geo_lock:"on"}}),n({message:`You made ${t.title} WW successfully`})}catch(e){n({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{l(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",isLoading:r,onClick:d,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Make Music WW"})})},el=e=>{let{music:t}=e,{createToast:s}=(0,b.dj)(),[n,r]=(0,i.useState)(!1),l=async()=>{r(!0);try{await (0,u.H2)({endpoint:`music/${t?.id}/repair-promo-assets`,fetchOptions:{method:"POST"}}),s({message:`You repaired the promo assets of ${t?.title} successfully`})}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{r(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:l,isLoading:n,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Repair Promo Assets"})})},eo=e=>{let{music:t}=e,{createToast:s}=(0,b.dj)(),[n,r]=(0,i.useState)(!1),l=async()=>{r(!0);try{await (0,u.H2)({endpoint:`music/${t?.id}/clear-error`,fetchOptions:{method:"POST"}}),s({message:`You have cleared any errors on ${t.title} successfully`})}catch(e){s({message:e?.data?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{r(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:l,isLoading:n,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Clear Upload Errors"})})};var ec=s(14909),ed=s(8438),em=s(3130),eu=s(22606),eg=s(82645),eh=s(50267),ep=s(20117),ey=s(76478),ex=s(32853);function ef(e){let{date:t,children:s,format:i="PPpp",className:n,options:r}=e;return(0,a.jsx)("time",{className:n,dateTime:(0,ey.x)(function(e){let t=Date.parse(e);return isNaN(t)?e?new Date(Date.parse(e.replace(/-/g,"/").replace("T"," ").replace(/\..*|\+.*/,""))):new Date:t}(t)),title:(0,ex.GP)(t,i,r),children:(0,a.jsx)(a.Fragment,{children:s||(0,ex.GP)(t,i,r)})})}ef.defaultProps={className:null};var ej=s(58275),ew=s(18064);let e_=e=>{let t,{musicItem:s}=e,[n,l]=(0,i.useState)(s),g=e=>l(t=>({...t,music:e})),[x,f]=i.useState(!1),[j,b]=i.useState(!1),{musicData:k}=(e=>{let{apiArgs:t,musicStaticData:s}=e,[a,n]=(0,i.useState)();return(0,i.useEffect)(()=>{t?.songId&&(async()=>{try{let e=await (0,eh.oj)({...t});if(!e)return n(null);let s={...e,...(0,ep.b)(e)};n(s)}catch(e){n(null)}})()},[s]),{musicData:a}})({musicStaticData:n,apiArgs:{artistSlug:"object"==typeof n?.artist?n?.artist?.url_slug:n?.artist,songId:n?.id?.toString(),type:n?.type}}),S=(0,i.useMemo)(()=>k?.results||n,[k,n]),[E]=(0,ew.C)({toast:!0}),A=(0,m.usePathname)(),P=(0,m.useSearchParams)(),N=A.includes("/trending-now"),I=(P.toString()?`${A}?${P.toString()}`:A).includes((0,ed.HK)(S)),{monetizedTracks:F,monetizedTracksIsLoading:M}=(e=>{let{music:t}=e,[s,a]=(0,i.useState)(),[n,r]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{r(!0);try{let e=await l({musicId:t?.id});if(!e)return a(null);a(e)}catch(e){a(null)}finally{r(!1)}})()},[]);let l=async e=>{let{musicId:s}=e;if(t?.id&&t?.type==="album")return await (0,u.H2)({endpoint:`music/${s}/monetization`})};return{monetizedTracks:s,monetizedTracksIsLoading:n}})({music:S}),{geoCountries:D}=(e=>{let{musicId:t}=e,[s,a]=(0,i.useState)();(0,i.useEffect)(()=>{t&&(async()=>{try{let e=await n({musicId:t});if(!e)return a(null);a(e)}catch(e){a(null)}})()},[]);let n=async e=>{let{musicId:t}=e;return await (0,u.H2)({endpoint:`music/${t}/geo`})};return{geoCountries:s}})({musicId:S?.id}),H=(0,a.jsxs)("span",{style:{marginLeft:10},children:[(0,a.jsx)("strong",{children:"WW"})," Worldwide"]}),B=D??S?.geo_restrictions,U=Array.isArray(S?.geo_premium)?S?.geo_premium.join(", "):D??S?.geo_premium,W=e=>
1e?.replace(/\s+/g,"").split(",").filter(Boolean)||[],R=W(B),Y=W(U),K=(e,t,s)=>[...e].sort((e,t)=>e.localeCompare(t)).slice(0,t?e.length:10).map((t,i)=>(0,a.jsxs)(c.E.span,{style:{marginLeft:4},inheritFont:!0,children:["(",(0,a.jsx)("strong",{children:t})," ",(0,d.qQ)(t),")",i===e.length-1?"":","]},`${s}-geo-${i}`));B&&"WW"!==B&&(H=(0,a.jsx)("span",{style:{marginLeft:10},children:K(R,x,"geo")})),U&&"WW"!==U&&(t=(0,a.jsx)("span",{style:{marginLeft:10},children:K(Y,j,"premium")}));let q=S?.type!=="playlist"?"Music":"Playlist";return(0,a.jsxs)("div",{className:r().MusicAdmin,children:[(0,a.jsxs)(eu.D.h6,{align:"center",casing:"uppercase",weight:700,color:"var(--gray-lightest)",children:["Admin Controls - ",S?.title]}),(0,a.jsxs)(C.so,{alignItems:"flex-start",justifyContent:"flex-start",className:r().ShowcaseWrap,gap:"14px",children:[(0,a.jsx)(ej.E,{src:S?.image||S?.image_base,width:92}),(0,a.jsxs)(C.so.Column,{gap:"4px",flex:"1",children:[(0,a.jsx)(eg.m,{tooltip:`Click to copy ${q} ID`,children:(0,a.jsx)(c.E,{casing:"uppercase",weight:700,color:"var(--color-orange)",children:(0,a.jsxs)("button",{className:r().copyIdBtn,onClick:()=>E(S?.id),children:[q?.toUpperCase()," ID - ",S?.id]})})}),(0,a.jsx)(O.h,{size:2,direction:"vertical"}),(0,a.jsx)(c.E,{casing:"uppercase",weight:600,children:S?.type}),(0,a.jsx)(c.E,{weight:600,noOfLines:1,children:(0,ed.j4)(S)}),(0,a.jsx)(c.E,{fontSize:"16px",casing:"capitalize",weight:700,noOfLines:1,children:S?.title}),(0,a.jsx)(O.h,{size:6,direction:"vertical"}),(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"8px",children:[(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:[S?.type!=="playlist"?"Uploaded: ":"Created: ",(0,a.jsx)(ef,{date:new Date(1e3*(S?.uploaded||S?.created)),format:"MMM dd, yyyy - h:mm a zzz"})]}),(0,d.JI)(S)&&(0,a.jsx)(c.E,{weight:700,className:r().Tag,color:"var(--color-orange)",children:"Premium Only"}),S?.type!=="playlist"&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["Geo Fenced: ",H,S?.geo_lock==="on"?"(Geo Locked)":"",B&&R?.length>10&&(0,a.jsx)("button",{onClick:()=>f(!x),style:{marginLeft:8},children:(0,a.jsx)(c.E.span,{weight:700,color:"var(--color-orange)",children:x?"Show Less":"Show More"})})]}),(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["Premium Geo Fenced: ",t,Y&&Y?.length>10&&(0,a.jsx)("button",{onClick:()=>b(!j),style:{marginLeft:8},children:(0,a.jsx)(c.E.span,{weight:700,color:"var(--color-orange)",children:j?"Show Less":"Show More"})})]}),(0,a.jsx)(c.E,{weight:700,className:r().Tag,children:S?.amp?(0,a.jsxs)(a.Fragment,{children:["Monetization on -"," ",(0,a.jsxs)("strong",{children:[S.amp_partner," ",(()=>{let e="",t=[];return M&&(e="Loading..."),F?.results.length>0&&(F?.results.map(e=>{t.push(e.amp_partner)}),e=[...new Set(t)].join(", ")),e})()]})]}):"Monetization: off"}),S?.party_name&&(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["Party Name: ",S?.party_name]}),S?.distributor_name&&(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["Distributor Name: ",S?.distributor_name]}),S?.upc&&(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["UPC ",S.upc,(0,a.jsx)("button",{className:r().copyIconBtn,onClick:()=>E(S.upc),"aria-label":"Copy UPC",children:(0,a.jsx)("img",{src:(0,$.f)("copy","#FFFFFF"),width:16,alt:""})})]}),S?.type==="song"&&S?.isrc&&(0,a.jsxs)(c.E,{weight:700,className:r().Tag,children:["ISRC ",S.isrc,(0,a.jsx)("button",{className:r().copyIconBtn,onClick:()=>E(S.isrc),"aria-label":"Copy ISRC",children:(0,a.jsx)("img",{src:(0,$.f)("copy","#FFFFFF"),width:16,alt:""})})]})]})]})]}),(0,a.jsx)("img",{src:"/icons/logo.svg",alt:"",className:r().Logo})]}),S?.type!=="playlist"&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Super Admin Edit"}),(0,a.jsxs)("div",{className:r().MusicAdmin__content__item,children:[(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,em.fd)(`/admin/${S?.type}s/edit${(0,ed.HK)(S).replace(/(\/song|\/album|\/playlist)/g,"")}`),target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"Super Admin Edit"}),(0,a.jsx)(o.E.button,{size:"sm",outline:!0,onClick:()=>E(`${(0,ed.HK)(S,{host:ec.h3?.APP_URL})}?admin=true`),children:"Share Admin Edit Link"}),S?.dist_id&&(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:`https://creators.audiomack.com/admin/feed-management?query_music_id=${S.id}`,target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"View in Feed Management"})]})]}),(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Music Controls"}),(0,a.jsxs)("div",{className:r().MusicAdmin__content__item,children:[(0,a.jsx)(h,{music:S,updateMusic:g}),(0,a.jsx)(p,{music:S,updateMusic:g}),(0,a.jsx)(eo,{music:S}),(0,a.jsx)(ei,{music:S}),S?.type==="song"?(0,a.jsx)(T,{music:S}):(0,a.jsx)(z,{music:F?.results}),(0,a.jsx)(en,{music:S}),!I&&(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,ed.HK)(S),trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"Go to Music Page"}),B&&"WW"!==B&&(0,a.jsx)(er,{music:S})]})]}),!N&&(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Trending / Tag Controls"}),(0,a.jsx)("div",{className:r().MusicAdmin__content__item,children:(0,a.jsx)(G,{music:S})})]}),(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"STATS"}),(0,a.jsxs)("div",{className:r().MusicAdmin__content__item,children:[(0,a.jsx)(w.ExcludeInclude,{music:S,updateMusic:g}),(0,a.jsx)(w.ClearStats,{music:S})]})]}),(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Download File"}),(0,a.jsx)("div",{className:r().MusicAdmin__content__item,children:(0,a.jsx)(L,{music:S})})]})]}),(0,a.jsxs)("div",{className:r().MusicAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Audio Controls"}),(0,a.jsxs)("div",{className:r().MusicAdmin__content__item,children:[S?.type==="song"&&(0,a.jsx)(_,{music:S}),S?.type!=="playlist"&&(0,a.jsx)(v,{music:S}),(0,a.jsx)(el,{music:S}),(0,a.jsx)(y,{music:S})]})]})]})};var eb=s(10732),ev=s.n(eb),ek=s(89594),eS=s(66106),eC=s(30579),eE=s(56226);let eA=e=>{let{artist:t}=e,{createToast:s}=(0,g.j)(),{user:n}=(0,eC.u)(),{isMasquerading:r,handleStopMasquerading:l}=(0,eS.A)(),[c,d]=(0,i.useState)(!1),m=async()=>{d(!0);try{let e=await (0,u.H2)({endpoint:"admin_token",fetchOptions:{method:"POST"},bodyParams:{user_id:t?.id}});
1console.log("res",e),e&&(await (0,eE.Zl)(e),await s({message:`You have been logged in as ${t?.name} successfully, Refreshing...`}),window.location.reload())}catch(e){s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{d(!1)}};return(0,a.jsxs)(a.Fragment,{children:[void 0===r&&(0,a.jsx)(o.E.button,{size:"sm",outline:!0,disabled:t?.url_slug===n?.url_slug,leadingIcon:(0,a.jsx)("img",{src:(0,$.f)("default-user-icon","#fff"),alt:"",width:"16px"}),onClick:m,isLoading:c,children:"Login as this user"}),r&&(0,a.jsx)(o.E.button,{size:"sm",onClick:l,children:"Get back to doing me"})]})},eT=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,l]=i.useState("banned"===t.verified),[c,d]=(0,i.useState)(!1),m=r?"Unblock Authentication":"Block Authentication",h=async()=>{await n({title:"Block Authentication",message:`Are you sure you want to ${r?"enable":"block"} authentication apply access for ${t.name}?`}),d(!0);try{await (0,u.H2)({endpoint:`artist/${t?.id}/block-authentication`,fetchOptions:{method:"PUT"}}),l(!r),s({message:`You have ${r?"unblocked":"blocked"} ${t.name} from applying for authentication successfully`})}catch(e){l(r),s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{d(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:h,isLoading:c,children:m})},ez=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,l]=(0,i.useState)(!1),c=async()=>{await n({title:"Recalculate Plays",message:`Are you sure you want to recalculate total plays for ${t?.name}?`}),l(!0);try{await (0,u.H2)({endpoint:`artist/${t?.id}/recalculate-total-plays`,fetchOptions:{method:"POST"}}),await s({message:`${t?.name} plays have been successfully queued for recalculation`})}catch(e){s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{l(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:c,isLoading:r,children:"Recalculate Plays"})},e$=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),r=t?.follow_list?"Remove from follow list":"Add to follow list",[l,c]=(0,i.useState)(!1),d=async()=>{await n({title:r,message:`Are you sure you want to ${t.follow_list?"remove":"add"} ${t.name} ${t.follow_list?"from":"to"} the follow list?`}),c(!0);try{t?.follow_list?(await (0,u.H2)({endpoint:`follow_list/${t?.id}`,fetchOptions:{method:"DELETE"}}),s({message:`${t.name} removed from follow list`})):(await (0,u.H2)({endpoint:"follow_list",fetchOptions:{method:"POST"},bodyParams:{artist_id:t?.id},noResponse:!0}),s({message:`${t.name} added to follow list`}))}catch(e){s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{c(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:d,isLoading:l,children:r})},eP=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,l]=i.useState(t.comment_banned),[c,d]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!1),p=async()=>{await n({title:"Censor Artwork",message:`Are you sure you want to ban artist ${t.name} from commenting?`}),d(!0);try{await (0,u.H2)({endpoint:`comments/user/${t.user_id}`,fetchOptions:{method:"DELETE"}}),l(!r),s({message:`${t?.name} has been banned from commenting successfully`,variant:"primary"})}catch(e){l(r),s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{d(!1)}},y=async()=>{await n({title:"Censor Artwork",message:`Are you sure you want to remove comment ban from ${t.name}?`}),h(!0);try{await (0,u.H2)({endpoint:`comments/un-ban/user/${t?.user_id}`,fetchOptions:{method:"POST"}}),s({message:`Comment Ban has been removed for ${t?.name} successfully`,variant:"primary"}),l(!r)}catch(e){l(r),s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{h(!1)}};return(0,a.jsxs)(o.E.button,{size:"sm",onClick:r?y:p,isLoading:r?m:c,children:[`${r?"Unban":"Ban"}`," Comment"]})},eN=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,l]=(0,i.useState)(!1),c=async()=>{await n({title:"Censor Artwork",message:`Are you sure you want to censor the artwork of ${t.name}?`}),l(!0);try{await (0,u.H2)({endpoint:"artists/censor-artwork",fetchOptions:{method:"POST"},bodyParams:{id:t?.id,name:t?.id}}),s({message:`You censored the artwork of ${t.name} successfully`})}catch(e){s({message:e?.message||"Something went wrong, please try again",lifespan:1e4,variant:"error"})}finally{l(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:c,isLoading:r,children:"Censor Artwork"})},eL=e=>{let{artist:t}=e,{createToast:s,createDisclosure:n}=(0,g.j)(),[r,l]=i.useState(!1),[d,m]=i.useState(void 0!==t?.can_upload&&t?.can_upload),[h,p]=(0,i.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:d?()=>l(!0):async()=>{await n({title:"Un-block Artist",message:`Are you sure you want to un-block ${t?.name}?`}),p(!1);try{await (0,u.H2)({endpoint:"admin/artist/upload",fetchOptions:{method:"POST",headers:{"Content-Type":"application/json"}},bodyParams:{items:[t.id],operation:"allowed",clear:!1,banaudio:!1}}),s({message:`${t?.name} has been un-blocked successfully`}),m(!d)}catch(e){m(d),s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{p(!1)}},isLoading:h,children:d?"Block":"Un-block"}),(0,a.jsxs)(S.a,{in:!!r,onClose:()=>l(!1),size:"lg",maxHeight:!0,title:"Are You Sure You Want To Block This Artist?",children:[(0,a.jsx)(O.h,{size:10,direction:"vertical"}),(0,a.jsxs)(c.E,{children:["Please confirm that you wish to block ",t?.name]}),(0,a.jsx)(O.h,{size:10,direction:"vertical"}),(0,a.jsxs)(F.D.Form,{onSubmit:async e=>{e.preventDefault();try{let{clear_uploads:a}=e.target;await (0,u.H2)({endpoint:"admin/artist/upload",fetchOptions:{method:"POST",headers:{"Content-Type":"application/json"}},bodyParams:{items:[t.id],operation:"banned",clear:a?.checked,banaudio:!1}}),m(!d),l(!1),await s({message:`${t?.name} has been blocked successfully`,variant:"primary"})}catch(e){m(d),s({message:e?.message||"Something went wrong, please try again",variant:"error"})}},children:[(0,a.jsx)(c.E,{weight:400,children:"You can optionally take down all songs and albums associated with this artist"}),(0,a.jsx)(O.h,{size:6,direction:"vertical"}),(0,a.jsx)(C.so,{gap:"24px",children:(0,a.jsx)(F.D.Checkbox,{checkingType:"uncontrolled",name:"clear_uploads",label:"Clear Uploads"})}),(0,a.jsx)(O.h,{size:24,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E,{type:"submit",isLoading:h,children:"Block"})})]})]})]})},eI=[{value:"yes",label:"Verified",icon:"verified"},{value:"authenticated",label:"Authenticated",icon:"verified"},{value:"tastemaker",label:"Tastemaker",icon:"taste-maker"},{value:"no",label:"Unverified",icon:"close"}],eF=e=>"yes"===e||"authenticated"===e||"tastemaker"===e?e:"no",eO=e=>{let{artist:t,onStatusChange:s}=e,{createToast:n}=(0,g.j)(),[r,l]=(0,i.useState)(eF(t?.verified)),[o,c]=(0,i.useState)(null),d=(0,m.useRouter)();(0,i.useEffect)(()=>
1{l(eF(t?.verified))},[t]);let h=async e=>{if(e!==r&&null===o){c(e);try{await (0,u.H2)({endpoint:`artist/${t?.id}/toggle-verified`,fetchOptions:{method:"POST"},bodyParams:{value:e}}),await n({message:`${t?.name} has been ${{yes:"verified",authenticated:"authenticated",tastemaker:"tastemaker",no:"unverified"}[e]} successfully`,variant:"primary"}),l(e),s?.(e),d?.refresh()}catch(e){n({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{c(null)}}};return(0,a.jsxs)(C.so.Column,{gap:"6px",children:[(0,a.jsx)("span",{style:{fontSize:"11px",color:"var(--color-gray-light)",whiteSpace:"nowrap"},children:"Change status to:"}),eI.map(e=>{let t=r===e.value,s=o===e.value,i="#FFA200";return(0,a.jsxs)("button",{onClick:()=>h(e.value),disabled:null!==o,style:{background:"none",border:"none",cursor:null!==o?"not-allowed":"pointer",opacity:s?.5:1,padding:"4px 0",display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("img",{src:(0,$.f)(e.icon,t?i:"#666666"),alt:"",width:"20",height:"20",style:{filter:t?"none":"grayscale(100%)",transition:"filter 0.2s ease"}}),(0,a.jsx)("span",{style:{fontSize:"12px",color:t?i:"#999999",fontWeight:t?600:400},children:e.label})]},e.value)})]})},eM=e=>{let{artist:t}=e,{createToast:s}=(0,g.j)(),[n,r]=(0,i.useState)(!1),l=async()=>{r(!0);try{await (0,u.H2)({endpoint:`artist/${t?.id}/verify-email`,fetchOptions:{method:"POST"}}),s({message:`${t.name} email has been verified successfully`})}catch(e){s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{r(!1)}};return(0,a.jsx)(o.E.button,{size:"sm",onClick:l,isLoading:n,disabled:t?.verified_email,children:"Verify Email"})},eD=e=>{let{artist:t}=e,{createToast:s}=(0,g.j)(),[n,r]=i.useState(!1),[l,d]=(0,i.useState)(!1),[m,h]=i.useState(""),[p,y]=i.useState(""),[x,f]=i.useState(""),[j,w]=i.useState(!1),[_,b]=i.useState(""),v=()=>{r(!1),h(""),b(""),y(""),f(""),w(!1)},k=async e=>{e.preventDefault(),d(!0);try{let e=await (0,u.H2)({endpoint:"newadmin/artist/claim-ghost",fetchOptions:{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},bodyParams:{artistId:t.id,email:_}});if(e?.data?.exception)throw Error(e.data.exception);if(e?.data?.newPassword){s({message:"New Password Received.",variant:"primary"}),h(e.data.newPassword);return}e&&e?.data?.urlSlug&&(y(`${ec.h3?.APP_URL}/${e.data.urlSlug}`),f(e.data.artistName),w(e.data.verified),console.log(p,x,j),s({message:"Email owned by another artist",variant:"secondary"}))}catch(t){console.log(t);let e="Something went wrong, please try again";t instanceof Error?e=t?.message:"object"==typeof t&&null!==t&&(e=t?.data?.exception||e),s({message:e,variant:"error"})}finally{d(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>r(!0),isLoading:l,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Claim account"})}),(0,a.jsxs)(S.a,{in:!!n,onClose:v,size:"lg",maxHeight:!0,title:`Change the email for ${t?.name}`,children:[(0,a.jsx)(O.h,{size:10,direction:"vertical"}),m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.E,{weight:600,children:["New email address for ",t?.name," saved. Here's the new password for the artist:"]}),(0,a.jsx)(O.h,{size:12,direction:"vertical"}),(0,a.jsx)(c.E,{style:{textAlign:"center",width:"100%"},fontSize:"24px",children:m}),(0,a.jsx)(O.h,{size:24,direction:"vertical"}),(0,a.jsxs)(C.so,{justifyContent:"center",gap:"24px",children:[(0,a.jsx)(o.E.button,{onClick:()=>{navigator.clipboard.writeText(m),s({message:"New Password copied to clipboard",variant:"primary"})},children:"Copy password"}),(0,a.jsx)(o.E.button,{onClick:v,children:"Close"})]})]}):p?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(c.E,{style:{textAlign:"center",width:"100%"},fontSize:"24px",children:["This email is owned by "," ",(0,a.jsx)("a",{href:p,target:"_blank",rel:"noopener noreferrer",style:{color:"orange"},children:x})," ","and is ",j?"":"not ","verified."]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.E,{weight:600,children:["Please enter the email address to assign to ",t?.name]}),(0,a.jsxs)(F.D.Form,{onSubmit:k,children:[(0,a.jsx)(O.h,{size:12,direction:"vertical"}),(0,a.jsx)(C.so,{gap:"24px",children:(0,a.jsx)(F.D.Input,{placeholder:"Email Address",name:"email",type:"email",required:!0,value:_,onCh
1ange:e=>b(e.target.value)})}),(0,a.jsx)(O.h,{size:24,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E,{type:"submit",isLoading:l,children:"Submit"})})]})]})]})]})},eH=e=>{let{artist:t}=e,{createToast:s}=(0,g.j)(),[n,r]=i.useState(!1),[l,d]=(0,i.useState)(!1),m=async()=>{try{await s({message:"Sending email Confirmation..."}),await (0,u.H2)({endpoint:"admin/artist/resend-email",fetchOptions:{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}},bodyParams:{artistId:t?.id}}),await s({message:"Email Confirmation Sent"})}catch(e){s({message:"Your confirmation has been sent. If you can't find it, please check your spam or wait 15 minutes to request another email.",variant:"error"})}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>r(!0),isLoading:l,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Edit User"})}),(0,a.jsxs)(S.a,{in:!!n,onClose:()=>r(!1),size:"lg",maxHeight:!0,title:"Edit User",children:[(0,a.jsx)(O.h,{size:10,direction:"vertical"}),(0,a.jsxs)(c.E,{weight:600,children:["Edit ",t?.name,"âs email and password."]}),(0,a.jsxs)(c.E,{color:"var(--text-gray)",children:["Email Verified: ",t.verified_email?"Yes":"No"," ",!t.verified_email&&(0,a.jsx)("button",{onClick:()=>m(),children:(0,a.jsx)(c.E.span,{inheritFont:!0,color:"var(--primary-theme)",fontSize:"13px",children:"(Resend Confirmation Email)"})})]}),(0,a.jsx)(O.h,{size:10,direction:"vertical"}),(0,a.jsxs)(F.D.Form,{onSubmit:async e=>{e.preventDefault(),d(!0);try{let{email:a,password:i,password2:n}=e.target,r=a.value.trim(),l=i.value,o=n.value;if(l||o){if(!l||!o)return void await s({message:"Please fill in both password fields",variant:"error"});if(l!==o)return void await s({message:"Passwords do not match",variant:"error"})}await (0,u.H2)({endpoint:"admin/artist/edit-email-password",noResponse:!0,fetchOptions:{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}},bodyParams:{artistId:t.id,newEmail:r,...l?{newPassword:l}:{}}}),await s({message:`${t?.name} ${l?"email & password":"email"} has been updated successfully`,variant:"primary"})}catch(e){s({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{d(!1)}},children:[(0,a.jsx)(O.h,{size:12,direction:"vertical"}),(0,a.jsx)(C.so,{gap:"24px",children:(0,a.jsx)(F.D.Input,{placeholder:"Email Address",name:"email",type:"email",defaultValue:t?.email||"",required:!0})}),(0,a.jsx)(O.h,{size:6,direction:"vertical"}),(0,a.jsx)(C.so,{gap:"24px",children:(0,a.jsx)(F.D.Input,{placeholder:"New Password",name:"password",type:"password",passwordHint:!0,validationMode:"onChange"})}),(0,a.jsx)(O.h,{size:6,direction:"vertical"}),(0,a.jsx)(C.so,{gap:"24px",children:(0,a.jsx)(F.D.Input,{placeholder:"Confirm New Password",name:"password2",type:"password",passwordHint:!1,validationMode:"onChange"})}),(0,a.jsx)(O.h,{size:24,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E,{type:"submit",isLoading:l,children:"Save Changes"})})]})]})]})},eB=e=>{let{artist:t,type:s}=e,{createToast:n}=(0,b.dj)(),[r,l]=i.useState(!1),[d,m]=(0,i.useState)(!1);if("list"===s)return(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,em.fd)(`/the-backwoods/activity-log/artist/${t?.id}`),target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"List Activity Logs"});let g=async e=>{e.preventDefault(),m(!0);try{let{title:s,reason:a}=e.target,i={title:s.value,reason:a.value,endpoint_location:!0},r={event_type:"manual_note",target_type:"artist",target_id:t?.id.toString(),topic_type:"other",pinned:!1,attributes:i};await (0,u.H2)({endpoint:"admin/activity-log/",fetchOptions:{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"}},bodyParams:{...r}}),await n({message:`Activity log saved successfully for ${t?.name}`,variant:"primary"})}catch(e){n({message:e?.message||"Something went wrong, please try again",variant:"error"})}finally{m(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>
1l(!0),children:"Add Activity Log"}),(0,a.jsxs)(S.a,{in:!!r,onClose:()=>l(!1),size:"lg",maxHeight:!0,title:"Add Activity Log",children:[(0,a.jsx)(O.h,{size:10,direction:"vertical"}),(0,a.jsxs)(F.D.Form,{onSubmit:async e=>{g(e)},children:[(0,a.jsx)(c.E,{weight:400,children:`Manually add an activity log for ${t?.name}`}),(0,a.jsx)(O.h,{size:8,direction:"vertical"}),(0,a.jsx)(F.D.Input,{label:"Title",placeholder:"Enter Log Title",name:"title",required:!0,type:"text",maxLength:50}),(0,a.jsx)(F.D.Textarea,{label:"Reason",name:"reason",required:!0,rows:4,cols:3,placeholder:"Enter reason for activity log"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E,{type:"submit",isLoading:d,children:"Save"})})]})]})]})};var eU=s(48401);let eW=e=>{let{artist:t}=e,{createToast:s}=(0,g.j)(),[n,r]=i.useState(!1),[l,d]=(0,i.useState)(!1),[m,u]=i.useState(!1),[h,p]=i.useState(""),y=()=>{r(!1),u(!1),p("")},x=async e=>{e.preventDefault(),d(!0);try{let e=await (0,eU.M7)({artistId:t.id});if(!e)throw Error("Something went wrong, please try again");if(e.data.exception)throw p(e.data.exception),Error(e.data.exception);if(e.data.success){s({message:"Artist successfully ghostified.",variant:"primary"}),y();return}throw Error("Incorrectly formatted response from server. Please try again.")}catch(t){let e="Something went wrong, please try again";t instanceof Error&&(e=t.message),s({message:e,variant:"error"})}finally{d(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.E.button,{size:"sm",onClick:()=>r(!0),isLoading:l,children:(0,a.jsx)(c.E,{inheritFont:!0,casing:"capitalize",children:"Ghostify"})}),(0,a.jsxs)(S.a,{in:!!n,onClose:y,size:"lg",maxHeight:!0,title:`Ghostify ${t?.name}`,children:[(0,a.jsx)(O.h,{size:10,direction:"vertical"}),m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.E,{style:{textAlign:"center",width:"100%"},weight:600,children:["Successfully ghostified ",t?.name,"."]}),(0,a.jsx)(O.h,{size:12,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",gap:"24px",children:(0,a.jsx)(o.E.button,{onClick:y,children:"Close"})})]}):h?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(c.E,{style:{textAlign:"center",width:"100%",color:"red"},fontSize:"24px",children:h})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.E,{weight:600,children:[" Are you sure you want to ghostify ",t?.name,". This is not reversible"]}),(0,a.jsxs)(F.D.Form,{onSubmit:x,children:[(0,a.jsx)(O.h,{size:12,direction:"vertical"}),(0,a.jsx)(C.so,{justifyContent:"center",fullWidth:!0,children:(0,a.jsx)(o.E,{type:"submit",isLoading:l,children:"Submit"})})]})]})]})]})},eR=e=>{let{artist:t}=e,[s,n]=(0,i.useState)(),[r]=(0,ew.C)({toast:!0});return((0,i.useEffect)(()=>{(async()=>{try{let e=await (0,eU.$B)({artist:t?.url_slug});n(e?.results)}catch(e){n(t),console.log("error",e)}})()},[]),s)?(0,a.jsxs)("div",{className:ev().ArtistAdmin,children:[(0,a.jsxs)(eu.D.h6,{align:"center",casing:"uppercase",weight:700,color:"var(--gray-lightest)",children:["Admin Controls - ",s.url_slug]}),(0,a.jsxs)(C.so,{alignItems:"flex-start",justifyContent:"flex-start",className:ev().ShowcaseWrap,gap:"14px",children:[(0,a.jsx)(ek.e,{src:s?.image,size:80}),(0,a.jsxs)(C.so.Column,{className:ev().Column,gap:"4px",flex:"1",children:[(0,a.jsx)(eg.m,{tooltip:"Click to copy Artist ID",children:(0,a.jsx)(c.E,{casing:"uppercase",weight:700,color:"var(--color-orange)",children:(0,a.jsxs)("button",{className:ev()?.copyIdBtn,onClick:()=>r(s?.id?.toString()),children:["ARTIST ID - ",s?.id?.toString()]})})}),(0,a.jsx)(eg.m,{tooltip:"Click to copy User ID",children:(0,a.jsx)(c.E,{casing:"uppercase",weight:700,color:"var(--color-orange)",children:(0,a.jsxs)("button",{className:ev()?.copyIdBtn,onClick:()=>r(s?.user_id),children:["USER ID - ",s?.user_id]})})}),(0,a.jsx)(O.h,{size:2,direction:"vertical"}),(0,a.jsxs)(c.E,{fontSize:"16px",casing:"capitalize",weight:700,noOfLines:1,children:[s.name," (",(0,a.jsx)(c.E.span,{weight:500,color:"var(--text-gray-light)",decoration:"underline",children:s.url_slug}),")"," | ",(0,a.jsx)(eg.m,{tooltip:"Click to copy Artist Email",children:(0,a.jsx)(c.E.span,{weight:500,color:"var(--text-gray)",children:(0,a.jsx)("button",{onClick:()=>r(s?.email||""),children:s?.email||"No email yet"})})})]}),(0,a.jsx)(O.h,{size:6,direction:"vertical"}),(0,a.jsxs)(C.so,{flexWrap:"wrap",gap:"8px",children:[(0,a.jsxs)(c.E,{weight:700,className:ev().Tag,children:["Verified: ",(()=>{let e=s?.verified;return"yes"===e?"Yes":"verify-pending"===e?"Verification Pending":"No"})()]}),(0,a.jsxs)(c.E,{weight:700,className:ev().Tag,children:["Authenticated: ",(0,em.bd)(s?.verified)?"Yes":"No"]}),(0,a.jsxs)(c.E,{weight:700,className:ev().Tag,children:["Verified Email: ",s?.verified_email?"Yes":"No"]}),(0,a.jsxs)(c.E,{weight:700,className:ev().Tag,children:["Status: ",s?.status?s?.status:"None?"]})]})]}),(0,a.jsx)(eO,{artist:s,onStatusChange:e=>{n(t=>t?{...t,verified:e}:t)}}),(0,a.jsx)("img",{src:"/images/icon/logo.svg",alt:"",className:ev().Logo})]}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Super Admin Actions"}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content__item,children:[(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,em.fd)(`/admin/artists/list/${s?.url_slug}`),target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"List"}),(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,em.fd)(`/admin/artists/edit/artist/${s.id}`),target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"Edit Artist"}),(0,a.jsx)(eA,{artist:s})]})]}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Artist Controls"}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content__item,children:[(0,a.jsx)(eT,{artist:s}),(0,a.jsx)(ez,{artist:s}),(0,a.jsx)(e$,{artist:s}),(0,a.jsx)(eP,{artist:s}),(0,a.jsx)(eN,{artist:s}),(0,a.jsx)(eL,{artist:s}),(0,a.jsx)(eM,{artist:s}),s?.status==="ghost"&&!s?.email&&(0,a.jsx)(eD,{artist:s}),(s?.status==="ghost"&&s?.email||s?.status!=="ghost")&&(0,a.jsx)(eW,{artist:s})]})]}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"User Controls"}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content__item,children:[(0,a.jsx)(eH,{artist:s}),(0,a.jsx)(o.E.a,{size:"sm",outline:!0,href:(0,em.fd)(`/the-backwoods/comments/recent-comments/user/${s?.user_id}`),target:"_blank",trailingIcon:(0,a.jsx)("img",{src:(0,$.f)("external-link","#ffa200"),width:13,alt:""}),children:"User Comments"})]})]}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content,children:[(0,a.jsx)(eu.D.h6,{children:"Activity L
1ogs"}),(0,a.jsxs)("div",{className:ev().ArtistAdmin__content__item,children:[(0,a.jsx)(eB,{artist:s,type:"add"}),(0,a.jsx)(eB,{artist:s,type:"list"})]})]})]}):null}},66106:(e,t,s)=>{"use strict";s.d(t,{A:()=>d,b:()=>c});var a=s(38959),i=s(20434),n=s(30579),r=s(40983),l=s(56226),o=s(7389);let c=()=>{let e=(0,i.a5)(r.CV),t=(0,i.a5)(r.bB),{user:s}=(0,n.u)(),{createToast:c,createDisclosure:d}=(0,o.j)();return{isMasquerading:a.useMemo(()=>((0,i.a5)(r.o_)||(0,i.a5)(r.TB))&&e!==r.o_&&t!==r.TB,[e,t]),handleStopMasquerading:a.useCallback(async e=>{e&&e.preventDefault(),await d({message:`Are you sure you want to stop masquerading as ${s?.name}?`,title:"Stop Masquerading",confirmText:"Stop Masquerading"});try{await (0,l.rt)?.(),window.location.reload(),c({message:`You are no longer masquerading as ${s?.name}`})}catch(e){console.log(e),c({message:e?.data?.message||"Something went wrong, please try again",variant:"error"})}},[s,d,c])}},d=c},67555:(e,t,s)=>{"use strict";s.d(t,{u:()=>o});var a=s(38959),i=s(49244),n=s(40983),r=s(87768),l=s(57695);let o=()=>{let{currentSong:e,message:t,setPlayerMessage:s}=(0,i.K)(),[c,d]=(0,a.useState)(!1),m=(0,r.usePathname)(),[u,g]=(0,a.useState)();return{loading:c,streamingUrl:u,playerMessage:t,tryStreamingUrl:async t=>{let{musicItem:a,nonBlocking:i=!1}=t,r=a||e;if(!e?.isSponsored){i||d(!0);try{let e=await (e=>{let{id:t,key:s,section:a,session:i,album_id:r,playlist_id:l,hq:o,time:c,environment:d,referer:m}=e,u=Object.fromEntries(Object.entries({key:s,section:a,session:i,album_id:r,playlist_id:l,hq:o,time:c,environment:d,referer:m}).filter(e=>{let[,t]=e;return void 0!==t}));return(0,n.H2)({endpoint:`music/play/${t}`,params:u})})({id:r?.id,key:window?.location?.search?.split("key=")?.[1]||null,section:(0,l.Sx)(m)});if(e){if(a)return e;g({streaming_url:e?.signedUrl,player_uuid:e?.playUuid})}else i||s?.("Could not play song, please try again later")}catch(e){i||s?.("Something went wrong, please try again later")}finally{i||d(!1)}}},useTryStreamingUrl:o}}},68695:(e,t,s)=>{"use strict";s.d(t,{JI:()=>l,X5:()=>o,n7:()=>c,qQ:()=>r});var a=s(6993),i=s(61312),n=s(90420);function r(e){return a.Xr?.[e]||e}function l(e){var t;return e?.type==="song"?(0,i.YL)(e?.premium_user_only)||!1:(t=e?.tracks)&&t.some(e=>(0,i.YL)(e.premium_user_only))}function o(e,t){let{casing:s="lower"}=t||{},a=e.replace(/[^a-zA-Z0-9]/g," ");switch(s){case"upper":return a.toUpperCase();case"capitalize":return a.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());case"lower":return a.toLowerCase();default:return a}}let c=e=>{let t=e.split("/").filter(Boolean),s=n.A.locales.includes(t[0])?t.slice(1):t;return 1===s.length||2===s.length&&["songs","albums","playlists","re-ups","likes","feed"].includes(s[1])}},92378:(e,t,s)=>{"use strict";s.d(t,{D:()=>n,b:()=>i});let a=e=>e.trim().toLowerCase().normalize("NFKD"),i=(e,t)=>{let s=a(e);return t.find(e=>a(e.display)===s)?.tag},n=e=>{let t=e.match(/^(.+?)->(.*?)->(.*?)$/);if(!t)return{title:e,isLocation:!1};let[,s="",a="",i=""]=t,n=s.trim(),r=a.trim(),l=i.trim();return{title:"United States"===n?`${l}, ${r}`:`${l}, ${l?n:""}`,isLocation:!0}}},99905:e=>{e.exports={downloadList:"download-file_downloadList__ootX3",downloadItem:"download-file_downloadItem__66M5c",downloadBtnGroup:"download-file_downloadBtnGroup__VoOtV",downloadLink:"download-file_downloadLink__tED4s",downloadIcon:"download-file_downloadIcon__t8gbT",downloadTitle:"download-file_downloadTitle__qYqDd"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.