1import{j as s,a as v}from"./react-vendor-BGQ-fvu8.js";import{h as P,cf as L,cg as H,M as h,B as q,bP as N,Y as E,ai as y,D,k as U,bp as k,o as I,ao as B,E as O,bD as V,ak as T,al as f,R as z}from"./main-BjGN4ckN.js";import{u as _,b as R,a as G,d as K,c as J}from"./useAnalyticsMinDate-CwFyeBJx.js";import{u as Y,P as Z,G as $,A as g,H as Q,T as F,F as W,a as X,E as ss,O as x,D as as}from"./DataByDateChart-CSZuSph5.js";import{u as M,c as ts,b as es}from"./data-by-date-DACIhSC0.js";import{C as is,u as os}from"./useDateRange-Do_A0exP.js";import{D as ns}from"./DataTable-QKvIPynO.js";import{U as A}from"./useConnectionPage-BTbbEfwS.js";import"./charts-vendor-fU6IkEZ_.js";import"./lodash-vendor-0cI-KiNp.js";import"./apollo-vendor-WdUFfbxi.js";import"./countryEmoji-CyKpmZpl.js";import"./breadcrumb-DeDhdVa1.js";import"./XYChart-D0PXfi2q.js";import"./SectionCard-C2oBF_MU.js";import"./arrow-right-BkQYzSlb.js";import"./button-group-BJMhmbJF.js";import"./checkbox-CLy4ehUu.js";import"./useValueChanged-CApZTwHC.js";import"./chart-C26FJTdv.js";import"./analytics-FvfVKYZ7.js";import"./index-D1CuvHOY.js";import"./form-vendor-0hBSyWfc.js";import"./useForm-B9SS0o31.js";import"./editor-vendor-BUwO_Joe.js";import"./switch-BTo2ktPD.js";import"./popover-0Z-4IRr6.js";import"./chevron-left-5-Gg-yzc.js";import"./textarea-BvmO5uxP.js";import"./eye-Bbl7GlPX.js";import"./radio-group-C_7LLUci.js";import"./table-CFsjfTm-.js";import"./index-Q4xRmGO5.js";const ds=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],rs=P("trophy",ds);function ls(){const{data:a}=M(),{platformRank:i,appRank:e}=_({platform:a?.studioAnalyticShowClientPlatformFind?.platform||[],appName:a?.studioAnalyticShowClientPlatformFind?.appName||[]}),o=a?.studioAnalyticShowHourlyUniqueStartsFind||[],{timezoneOffsetHour:r,hourlyUniqueStarts:n}=Y({data:o}),d=a?.studioAnalyticShowFlinkFindOne,l=a?.studioAnalyticShowAudienceCountryFind,p=a?.studioShowFindOne,t=p?.urlSlug||p?.id;return s.jsxs("div",{children:[s.jsx(Z,{platform:i,appName:e}),s.jsx("div",{className:"mt-8",children:s.jsx($,{country:l})}),s.jsx("div",{className:"mt-8",children:s.jsxs(g,{icon:L,titleId:"dashboard.hourlyUniqueStarts",hintId:"dashboard.hourlyUniqueStartsHint",children:[s.jsx(Q,{data:n}),s.jsx(F,{timezoneOffset:r})]})}),s.jsx("div",{className:"mt-8",children:s.jsxs(g,{icon:H,titleId:"dashboard.genderAndAge",children:[s.jsx("div",{className:"mb-2",children:s.jsx(h,{id:"dashboard.genderAndAge.noSpotify"})}),s.jsx(q,{nativeButton:!1,render:s.jsx("a",{href:"https://creators.spotify.com/dash/home",target:"_blank",rel:"noopener noreferrer"}),children:s.jsx(h,{id:"dashboard.goSpotify"})})]})}),s.jsx("div",{className:"mt-8",children:s.jsx(W,{type:"user",itemId:t,flinkAnalyticData:d})})]})}function cs({isUnique:a,loading:i,episodeRank:e,dateRange:o,onDateRangeChange:r}){const n=N(),d=E(),l=v.useMemo(()=>[{id:"rank",enableSorting:!1,size:48,accessorFn:(t,c)=>c+1,header:()=>"#",cell:t=>t.getValue()},{id:"title",enableSorting:!1,accessorFn:t=>t,header:()=>s.jsx(h,{id:"general.title"}),cell:t=>{const c=t.getValue();return s.jsx("span",{className:"text-sm",children:c.title})}},{id:"starts",enableSorting:!1,accessorFn:t=>t,meta:{align:"right"},header:()=>s.jsx(h,{id:a?"dashboard.uniqueStarts":"dashboard.playCount"}),cell:t=>{const c=t.getValue();return s.jsx("span",{className:"tabular-nums",children:n(a?c.uniqueStarts:c.starts)})}}],[n,a]),p=v.useCallback(t=>{d.push(`/episodes/${t.id}`)},[d]);return s.jsxs(g,{icon:rs,titleId:"dashboard.episodeRank",hintId:"dashboard.dataByDate.noSpotify",className:"mr-5 min-h-[500px]",headerRight:s.jsx("div",{className:"flex",children:s.jsx(is,{dateRange:o,onChange:r})}),children:[s.jsx(ns,{data:e,columns:l,loading:i,onRowClick:p,getRowId:t=>t.id}),s.jsx(F,{timezoneOffset:0})]})}function ps({dateRange:a,onDateRangeChange:i}){const{loading:e,data:o}=ts({dateRange:a}),{loading:r,data:n}=X(),d=o?.studioAnalyticEpisodeRankFind||[],l=n?.studioAnalyticEpisodePacingFind;return s.jsxs("div",{children:[s.jsx("div",{className:"mb-8",children:s.jsx(ss,{loading:r,average:l?.average,episodes:l?.records})}),s.jsx("div",{className:"mb-8",children:s.jsx(cs,{isUnique:!0,loading:e,episodeRank:d,dateRange:a,onDateRangeChange:i})})]})}function ms({aggregate:a,showDownloads:i}){const e=N(),{showVideoAnalytics:o}=R(),r=a?.starts??0,n=a?.uniqueStarts??0,d=a?.spotifyPlays??0,l=a?.spotifyStreams??0,p=a?.previousHostStarts??0,t=a?.videoStarts??0,c=a?.videoUniqueStarts??0,m=a?.average??{starts:0,uniqueStarts:0,spotifyPlays:0,spotifyStreams:0,videoStarts:0,videoUniqueStarts:0}
1,u=n+p+l+c,b=r+d+t,S=m.uniqueStarts+(m.spotifyStreams??0)+(m.videoUniqueStarts??0),w=m.starts+(m.spotifyPlays??0)+(m.videoStarts??0),C=o?"dashboard.listens.tooltip":"dashboard.listens.tooltip.noVideo";return s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(y,{className:"p-4 md:p-6",children:s.jsx(x,{titleId:"dashboard.listens",hintId:C,value:u?e(u):"-"})}),s.jsx(A,{type:D.User.Feature.advancedAnalytics,locked:!i,trigger:"repeated_listens",children:({hasFeature:j})=>s.jsx(y,{className:"p-4 md:p-6",children:s.jsx(x,{titleId:"dashboard.repeatedListens",hintId:"dashboard.repeatedListens.tooltip",value:j&&b?e(b):"-"})})}),s.jsx(y,{className:"p-4 md:p-6",children:s.jsx(x,{titleId:"dashboard.listens.average",hintId:"dashboard.listens.average.tooltip",value:S?e(S):"-"})}),s.jsx(A,{type:D.User.Feature.advancedAnalytics,locked:!i,trigger:"repeated_listens_average",children:({hasFeature:j})=>s.jsx(y,{className:"p-4 md:p-6",children:s.jsx(x,{titleId:"dashboard.repeatedListens.average",hintId:"dashboard.repeatedListens.average.tooltip",value:j&&w?e(w):"-"})})})]})}function hs(a){const i=U();v.useEffect(()=>{if(!a)return;const e=i.hash.replace("#","");if(e){const o=document.getElementById(e);o&&o.scrollIntoView({behavior:"smooth"})}},[i,a])}function us({dateRange:a,onDateRangeChange:i}){const{loading:e,data:o}=M(),{loading:r,data:n}=es({from:k(new Date(a.doubleRangeFrom),"yyyy-MM-dd"),to:k(new Date(a.to),"yyyy-MM-dd")}),{showDownloads:d}=G(),{showSpotifyAnalytics:l}=K(),{showVideoAnalytics:p}=R(),t=I();hs(!e);const c=o?.studioAnalyticShowAggregationFindOne,m=n?.studioAnalyticShowDataByDateFind,u=[{label:t.formatMessage({id:"dashboard.spotify.listeners"}),hintId:"dashboard.spotify.listeners.hint",dataKey:"spotifyListeners"},{label:t.formatMessage({id:"dashboard.spotify.followers"}),hintId:"dashboard.spotify.followers.hint",dataKey:"spotifyFollowers"}];return s.jsxs("div",{children:[s.jsx("section",{children:s.jsx(as,{title:"podcast",loading:r,dateRange:a,dataByDate:m,showDownloads:d,showSpotifyAnalytics:l,showVideoAnalytics:p,extraTabs:u,onDateRangeChange:i})}),s.jsxs("section",{className:"mt-6",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xl font-semibold",children:s.jsx(h,{id:"profile.analytics.overall"})}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.jsx(h,{id:"profile.analytics.overall.description"})})]}),s.jsx("div",{className:"mt-8",children:s.jsx(ms,{aggregate:c,showDownloads:d})})]})]})}function Ys(){const a=I(),e=B().show,o=J(e),{dateRange:r,handleDateRangeChange:n}=os({minDate:o}),d=v.useMemo(()=>[{name:a.formatMessage({id:"profile.analytics.overview"}),path:"/podcast/analytics/overview"},{name:a.formatMessage({id:"profile.analytics.episodes"}),path:"/podcast/analytics/episodes"},{name:a.formatMessage({id:"profile.analytics.audience"}),path:"/podcast/analytics/audience"}],[a]);return s.jsxs(O,{title:a.formatMessage({id:"profile.analytics"}),helpLinkId:"analyticData",children:[s.jsx(V,{tabs:d,className:"overflow-visible"}),s.jsx("div",{className:"mt-6",children:s.jsxs(T,{children:[s.jsx(f,{path:"/podcast/analytics/overview",children:s.jsx(us,{dateRange:r,onDateRangeChange:n})}),s.jsx(f,{path:"/podcast/analytics/episodes",children:s.jsx(ps,{dateRange:r,onDateRangeChange:n})}),s.jsx(f,{path:"/podcast/analytics/audience",children:s.jsx(ls,{})}),s.jsx(f,{children:s.jsx(z,{to:"/podcast/analytics/overview"})})]})})]})}export{Ys as default};
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.