PageSourceSearch

https://www.artcore.com/_next/static/chunks/8160.df52d2ed9b7ef538.js

js artcore.com collected 2026-10-01 15:16:49 UTC 15,061 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8160],{28160:(e,s,t)=>{t.r(s),t.d(s,{ManageStatsTab:()=>v});var l=t(37876),a=t(14232),r=t(10553),i=t(75656),n=t(19512),d=t(35803),c=t(54395),x=t(37863),m=t(53968),o=t(4186),h=t(92306),u=t(61875),p=t(48230),j=t.n(p),b=t(68812);function y({label:e,value:s}){return(0,l.jsxs)("div",{className:"flex flex-row",children:[(0,l.jsx)("div",{className:"w-3/4 text-neutral-500",children:e}),(0,l.jsx)("div",{className:"w-1/4 text-right",children:s})]})}function N({page:e,pageCount:s,total:t,onPageChange:a}){return 0===t?null:(0,l.jsxs)("div",{className:"mt-3 flex flex-row items-center justify-between gap-2 text-xxs text-neutral-500",children:[(0,l.jsxs)("span",{children:[t," result",1===t?"":"s",s>1?` \xb7 page ${e+1} of ${s}`:""]}),s>1?(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)(n.A,{size:"small",variant:"outlined",disabled:e<=0,onClick:()=>a(e-1),children:"Prev"}),(0,l.jsx)(n.A,{size:"small",variant:"outlined",disabled:e>=s-1,onClick:()=>a(e+1),children:"Next"})]}):null]})}function g(e,s,t){let l="desc"===t?-1:1;return[...e].sort((e,t)=>{let a=e[s],r=t[s];return"number"==typeof a&&"number"==typeof r?(a-r)*l:String(a).localeCompare(String(r))*l})}function f({label:e,active:s,dir:t,onClick:a,className:r}){return(0,l.jsxs)("th",{className:`cursor-pointer select-none py-2 pr-2 text-neutral-500 hover:text-neutral-300 ${r??""}`,onClick:a,children:[e,s?"desc"===t?" ↓":" ↑":""]})}function k({daily:e}){let s=(0,a.useMemo)(()=>{let s=1;for(let t of e)s=Math.max(s,t.plays,t.listens);return s},[e]);if(0===e.length)return(0,l.jsx)("div",{className:"text-neutral-500 text-sm",children:"No plays in this period."});let t=Math.max(4,Math.min(14,Math.floor(420/e.length)));return(0,l.jsxs)("div",{className:"overflow-x-auto pb-2",children:[(0,l.jsx)("div",{className:"flex flex-row items-end gap-px h-36 min-w-min",children:e.map(e=>(0,l.jsxs)("div",{className:"flex flex-col items-center justify-end",title:e.day,children:[(0,l.jsxs)("div",{className:"flex flex-row items-end gap-px",style:{height:120},children:[(0,l.jsx)("div",{className:"rounded-t bg-orange-400/90",style:{width:t,height:`${Math.max(2,e.plays/s*120)}px`}}),(0,l.jsx)("div",{className:"rounded-t bg-brand",style:{width:t,height:`${Math.max(2,e.listens/s*120)}px`}})]}),(0,l.jsx)("div",{className:"mt-1 max-w-[52px] truncate text-[9px] text-neutral-500",children:e.day.slice(5)})]},e.day))}),(0,l.jsxs)("div",{className:"mt-2 flex flex-row gap-4 text-xxs text-neutral-400",children:[(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm bg-orange-400/90 mr-1 align-middle"})," Plays"]}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm bg-brand mr-1 align-middle"})," Qualified listens"]})]})]})}function v({sellerId:e}){let{data:s}=(0,r.useSession)(),t=!!s?.isAdmin,p=t&&e?`/api/edit/seller/analytics?sellerId=${e}`:null,{data:w,error:_,isLoading:C}=(0,i.Ay)(p,(0,h.we)()),[L,P]=(0,a.useState)({key:"plays_all",dir:"desc"}),[$,S]=(0,a.useState)({key:"plays_all",dir:"desc"}),[M,A]=(0,a.useState)(null),[T,D]=(0,a.useState)(90),[z,q]=(0,a.useState)("tracks"),[I,Q]=(0,a.useState)(""),[F,R]=(0,a.useState)(0),V=t&&e&&M?`/api/edit/seller/analytics/detail?sellerId=${e}&${"track"===M.kind?"trackId":"releaseId"}=${M.id}&days=${T}`:null,{data:E,error:O,isLoading:U}=(0,i.Ay)(V,(0,h.we)()),Y=I.trim().toLowerCase(),K=(0,a.useMemo)(()=>{let e=w?.premium.catalogTracks??[];return Y?e.filter(e=>`${e.title}${e.mix_name?` ${e.mix_name}`:""}`.toLowerCase().includes(Y)||e.artists.toLowerCase().includes(Y)||String(e.track_id).includes(Y)):e},[w,Y]),W=(0,a.useMemo)(()=>{let e=w?.premium.catalogReleases??[];return Y?e.filter(e=>e.title.toLowerCase().includes(Y)||e.artists.toLowerCase().includes(Y)||String(e.release_id).includes(Y)):e},[w,Y]),B=(0,a.useMemo)(()=>g(K,L.key,L.dir),[K,L]),G=(0,a.useMemo)(()=>g(W,$.key,$.dir),[W,$]),H=Math.max(1,Math.ceil(("tracks"===z?B:G).length/25)),J=Math.min(F,H-1),X=(0,a.useMemo)(()=>{let e=25*J;return B.slice(e,e+25)},[B,J]),Z=(0,a.useMemo)(()=>{let e=25*J;return G.slice(e,e+25)},[G,J]);function ee(e){R(0),P(s=>s.key===e?{key:e,dir:"desc"===s.dir?"asc":"desc"}:{key:e,dir:"desc"})}function es(e){R(0),S(s=>s.key===e?{key:e,dir:"desc"===s.dir?"asc":"desc"}:{key:e,dir:"desc"})}return t&&e?(0,l.jsxs)("section",{className:"mt-4 px-2 md:px-0",children:[(0,l.jsx)(u.Pz,{className:"mb-2 text-neutral-300",children:"Stats"}),(0,l.jsx)("p",{className:"mb-4 text-xxs text-neutral-500",children:"Plays = track play starts (PLAY). Qualified listens = threshold listens (PLAY_30). Daily chart uses UTC dates."}),C?(0,l.jsx)("div",{className:"text-neutral-400",children:"Loading stats…"}):_?(0,l.jsx)("div",{className:"text-red-400",children:"Could not load stats."}):w?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 rounded-md border border-neutral-800 bg-neutral-900/80 p-4 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium text-neutral-300",children:"Basic"}),(0,l.jsx)(y,{label:"Plays (all time)",value:w.basic.playStartsTotal}),(0,l.jsx)(y,{label:"Plays (last 7 days)",value:w.basic.playStartsLast7Days}),(0,l.jsx)(y,{label:"Profile views (all time)",value:w.basic.profileViewsTotal}),(0,l.jsx)(y,{label:"Profile views (last 7 days)",value:w.basic.profileViewsLast7Days})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium text-neutral-300",children:"Premium"}),(0,l.jsx)(y,{label:"Qualified listens (all time)",value:w.premium.qualifiedListensTotal}),(0,l.jsx)(y,{label:"Qualified listens (last 7 days)",value:w.premium.qualifiedListensLast7Days}),(0,l.jsx)(y,{label:"Unique listeners (PLAY_30, last 30 days)",value:w.premium.uniqueListenersQualifiedLast30Days})]})]}),(0,l.jsxs)("div",{className:"mt-6 rounded-md border border-neutral-800 bg-neutral-900/80 p-4 text-sm",children:[(0,l.jsx)("div",{className:"mb-2 font-medium text-neutral-300",children:"Top tracks by plays (last 30 days)"}),(0,l.jsx)("p",{className:"mb-2 text-xxs text-neutral-500",children:"Tracks with any plays or listens in the rolling last 30 days, ranked by play starts."}),(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs text-neutral-300",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-neutral-800 text-neutral-500",children:[(0,l.jsx)("th",{className:"py-2 pr-2",children:"Track"}),(0,l.jsx)("th",{className:"py-2 pr-2 text-right",children:"Plays"}),(0,l.jsx)("th",{className:"py-2 pr-2 text-right",children:"Listens"}),(0,l.jsx)("th",{className:"py-2 text-right",children:"Details"})]})}),(0,l.jsx)("tbody",{children:0===w.premium.topTracksLast30Days.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:4,className:"py-3 text-neutral-500",children:"No track activity in the last 30 days."})}):w.premium.topTracksLast30Days.map(e=>(0,l.jsxs)("tr",{className:"border-t border-neutral-800",children:[(0,l.jsxs)("td",{className:"max-w-[220px] truncate py-2 pr-2",children:[e.title,e.mix_name?` (${e.mix_name})`:""]}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.play_starts}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.qualified_listens}),(0,l.jsx)("td",{className:"py-2 text-right",children:(0,l.jsx)(n.A,{size:"small",variant:"outlined",onClick:()=>A({kind:"track",id:e.track_id}),children:"Open"})})]},e.track_id))})]})})]}),(0,l.jsxs)("div",{className:"mt-6 rounded-md border border-neutral-800 bg-neutral-900/80 p-4 text-sm",children:[(0,l.jsx)(b.e,{ariaLabel:"Catalog",className:"mb-4",tabs:[{id:"tracks",label:"Tracks"},{id:"releases",label:"Releases"}],value:z,onChange:function(e){q(e),R(0)}}),(0,l.jsx)("div",{className:"mb-3",children:(0,l.jsx)("input",{type:"search",value:I,onChange:e=>{Q(e.target.value),R(0)},placeholder:"Filter by title, artist, or id…","aria-label":"Filter catalog",className:"w-full max-w-md rounded border border-neutral-700 bg-neutral-950 px-3 py-2 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-500 focus:outline-none"})}),"tracks"===z?(0,l.jsxs)("div",{role:"tabpanel","aria-labelledby":"manage-subtab-tracks",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs text-neutral-300",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-neutral-800",children:[(0,l.jsx)(f,{label:"Track",active:"title"===L.key,dir:L.dir,onClick:()=>ee("title")}),(0,l.jsx)(f,{label:"Plays (all)",active:"plays_all"===L.key,dir:L.dir,onClick:()=>ee("plays_all"),className:"text-right"}),(0,l.jsx)(f,{label:"Listens (all)",active:"listens_all"===L.key,dir:L.dir,onClick:()=>ee("listens_all"),className:"text-right"}
1),(0,l.jsx)(f,{label:"Plays (30d)",active:"plays_30d"===L.key,dir:L.dir,onClick:()=>ee("plays_30d"),className:"text-right"}),(0,l.jsx)(f,{label:"Listens (30d)",active:"listens_30d"===L.key,dir:L.dir,onClick:()=>ee("listens_30d"),className:"text-right"}),(0,l.jsx)("th",{className:"py-2 text-right",children:"Details"})]})}),(0,l.jsx)("tbody",{children:0===X.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"py-3 text-neutral-500",children:Y?"No tracks match this filter.":"No tracks."})}):X.map(e=>(0,l.jsxs)("tr",{className:"border-t border-neutral-800",children:[(0,l.jsxs)("td",{className:"max-w-[220px] truncate py-2 pr-2",children:[e.title,e.mix_name?` (${e.mix_name})`:""]}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.plays_all}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.listens_all}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.plays_30d}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.listens_30d}),(0,l.jsx)("td",{className:"py-2 text-right",children:(0,l.jsx)(n.A,{size:"small",variant:"outlined",onClick:()=>A({kind:"track",id:e.track_id}),children:"Open"})})]},e.track_id))})]})}),(0,l.jsx)(N,{page:J,pageCount:H,total:B.length,onPageChange:R})]}):(0,l.jsxs)("div",{role:"tabpanel","aria-labelledby":"manage-subtab-releases",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs text-neutral-300",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-neutral-800",children:[(0,l.jsx)(f,{label:"Release",active:"title"===$.key,dir:$.dir,onClick:()=>es("title")}),(0,l.jsx)(f,{label:"Plays (all)",active:"plays_all"===$.key,dir:$.dir,onClick:()=>es("plays_all"),className:"text-right"}),(0,l.jsx)(f,{label:"Listens (all)",active:"listens_all"===$.key,dir:$.dir,onClick:()=>es("listens_all"),className:"text-right"}),(0,l.jsx)(f,{label:"Plays (30d)",active:"plays_30d"===$.key,dir:$.dir,onClick:()=>es("plays_30d"),className:"text-right"}),(0,l.jsx)(f,{label:"Listens (30d)",active:"listens_30d"===$.key,dir:$.dir,onClick:()=>es("listens_30d"),className:"text-right"}),(0,l.jsx)("th",{className:"py-2 text-right",children:"Details"})]})}),(0,l.jsx)("tbody",{children:0===Z.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"py-3 text-neutral-500",children:Y?"No releases match this filter.":"No releases."})}):Z.map(e=>(0,l.jsxs)("tr",{className:"border-t border-neutral-800",children:[(0,l.jsx)("td",{className:"max-w-[220px] truncate py-2 pr-2",children:e.title}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.plays_all}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.listens_all}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.plays_30
1d}),(0,l.jsx)("td",{className:"py-2 text-right",children:e.listens_30d}),(0,l.jsx)("td",{className:"py-2 text-right",children:(0,l.jsx)(n.A,{size:"small",variant:"outlined",onClick:()=>A({kind:"release",id:e.release_id}),children:"Open"})})]},e.release_id))})]})}),(0,l.jsx)(N,{page:J,pageCount:H,total:G.length,onPageChange:R})]})]})]}):null,(0,l.jsxs)(d.A,{open:!!M,onClose:()=>A(null),maxWidth:"md",fullWidth:!0,children:[(0,l.jsxs)(c.A,{className:"flex flex-row items-center justify-between pr-2",children:[(0,l.jsxs)("span",{className:"text-base",children:[M?.kind==="track"?"Track":"Release"," analytics"]}),(0,l.jsx)(x.A,{onClick:()=>A(null),size:"small","aria-label":"close",children:(0,l.jsx)(o.m6K,{})})]}),(0,l.jsxs)(m.A,{children:[(0,l.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-sm text-neutral-400",children:[(0,l.jsx)("span",{children:"Period:"}),[30,90,180].map(e=>(0,l.jsxs)(n.A,{size:"small",variant:T===e?"contained":"outlined",onClick:()=>D(e),children:[e,"d"]},e))]}),U?(0,l.jsx)("div",{className:"text-neutral-400",children:"Loading detail…"}):O?(0,l.jsx)("div",{className:"text-red-400",children:"Could not load detail."}):E?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mb-1 text-lg text-neutral-100",children:E.title}),(0,l.jsx)("div",{className:"mb-4 text-xxs text-neutral-500",children:"track"===E.kind?(0,l.jsx)(j(),{className:"text-brand",href:`/track/${E.id}`,target:"_blank",rel:"noreferrer",children:"View public track page"}):(0,l.jsx)(j(),{className:"text-brand",href:`/release/${E.id}`,target:"_blank",rel:"noreferrer",children:"View public release page"})}),(0,l.jsx)("div",{className:"mb-2 font-medium text-neutral-300",children:"Daily activity (UTC)"}),(0,l.jsx)(k,{daily:E.daily}),(0,l.jsxs)("div",{className:"mt-6 border-t border-neutral-800 pt-4",children:[(0,l.jsx)("div",{className:"mb-2 font-medium text-neutral-300",children:"Location segmentation"}),(0,l.jsx)("p",{className:"text-sm text-neutral-500",children:E.segmentationNote}),E.byCountry.length>0?(0,l.jsxs)("table",{className:"mt-2 w-full text-left text-xs",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"text-neutral-500",children:[(0,l.jsx)("th",{className:"py-1",children:"Country"}),(0,l.jsx)("th",{className:"py-1 text-right",children:"Plays"}),(0,l.jsx)("th",{className:"py-1 text-right",children:"Listens"})]})}),(0,l.jsx)("tbody",{children:E.byCountry.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:e.country}),(0,l.jsx)("td",{className:"text-right",children:e.plays}),(0,l.jsx)("td",{className:"text-right",children:e.listens})]},e.country))})]}):null]})]}):null]})]})]}):null}},68812:(e,s,t)=>{t.d(s,{e:()=>a});var l=t(37876);function a({tabs:e,value:s,onChange:t,ariaLabel:r,className:i="mb-3"}){return(0,l.jsx)("div",{className:`flex flex-row gap-4 border-b border-neutral-800 ${i}`,role:"tablist","aria-label":r,children:e.map(e=>{let a=e.id===s;return(0,l.jsxs)("div",{role:"tab",id:`manage-subtab-${e.id}`,tabIndex:0,"aria-selected":a,className:`cursor-pointer shrink-0 whitespace-nowrap bg-transparent pb-2 text-sm hover:bg-transparent ${a?"border-b-[2px] border-brand font-semibold text-mainheading":"border-b-[2px] border-transparent text-neutral-400 hover:border-b-[2px] hover:text-neutral-200"}`,onClick:()=>t(e.id),onKeyDown:s=>{("Enter"===s.key||" "===s.key)&&(s.preventDefault(),t(e.id))},children:[e.label,"number"==typeof e.count?` (${e.count})`:""]},e.id)})})}t(14232)}}]);

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.