1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StudioPanel-DGzLur9b.js","assets/index-CEq6EAUz.js","assets/index-CIO7eHA4.css","assets/ArtistImg-4d8dRmYr.js","assets/radio-wtxo3AHs.js","assets/music-2-iOS-PdBz.js","assets/audio-lines-DGkBP9F2.js","assets/brain-CWh3oF8f.js","assets/gauge-CHtfsJQ1.js","assets/circle-check-DYw0AERI.js","assets/crown-C-yVFN4o.js","assets/shield-check-DoWUAbzx.js","assets/pen-line-pWnJFnKh.js","assets/layers-C35TKclg.js","assets/gem-Dg0RPhxQ.js","assets/wand-sparkles-DSclFm0x.js","assets/badge-check-Cm2CwtHB.js","assets/image-Dr3S5mJE.js","assets/palette-T7J9EpRT.js","assets/type-Dz3IcPn-.js","assets/download-C2KCpfq7.js","assets/share-2-42cbRWRc.js","assets/dna-DhCrjNji.js","assets/rhymeDetection-Cidq4TSZ.js","assets/security-BvUm4POP.js","assets/acousticAnalyzer-CDBoRS9h.js","assets/downloadFile-D5FSlcKT.js","assets/lyricLanguageRules-FIosy6i5.js","assets/UpgradePaywall-BYvPKCbM.js","assets/index-CzjoYJf_.js","assets/playBilling-B-iQnWHt.js","assets/FirstOffer-BFMukNfh.js","assets/MgSheet-D95Zfr0r.js","assets/use-reduced-motion-C-9K3hxL.js","assets/timer-iUInvvrO.js","assets/zap-Cc0rplsG.js","assets/check-BxAC0MjD.js","assets/credit-card-CbDFtIZD.js","assets/user-plus-D-V3bm3j.js","assets/target-DqzfGLRa.js","assets/save-Dc8FNZlk.js","assets/activity-Bt-JGRZE.js","assets/mic-vocal-CJWpucOw.js","assets/arrow-up-right-Ct9CLWhW.js","assets/circle-DnGNIU84.js","assets/dailyLyric-CcBS0gpx.js","assets/square-9dUhBOqO.js","assets/mic-hxO5XSEZ.js","assets/upload-C2DRVS5-.js","assets/trash-2-HiVMG9Mx.js","assets/lock-keyhole-BWQU8xIE.js","assets/pen-tool-DR9PaOgY.js","assets/copy-5TiARjo6.js","assets/message-circle-NOrullP4.js","assets/thumbs-up-CiuFT1m_.js","assets/search-CMha1ATw.js","assets/git-merge-DcMa7JSP.js","assets/chevron-up-CCMx7K6t.js","assets/chevron-down-zClUZ5_n.js","assets/send-nGysUjVU.js","assets/PricingPanel-DgOy77F1.js","assets/GenieMascot-BJMIC8JV.js","assets/shield-BXfhK_sN.js","assets/AddArtistPanel-CoOLIDiw.js","assets/bell-s3pGSusw.js","assets/arrow-right-BpN5kYVm.js","assets/triangle-alert-CM7M4O_7.js","assets/heart-B5gLCo2X.js","assets/CustomLyricistPanel-B-7GOWYb.js","assets/arrow-left-zgVC41dm.js","assets/camera-B-fA32pL.js","assets/link-2-BzVuim4N.js","assets/earth-D8bCA6ro.js","assets/plus-QkdZOPFd.js","assets/FeedPanel-C7tbY4Yh.js","assets/UserBadges-D6QFK8OC.js","assets/trophy-Cm9c67BZ.js","assets/flame-DhG1FM-4.js","assets/star-Dhku3EWB.js","assets/SponsoredPlacementAd-O_Hoq7cJ.js","assets/ellipsis-OOL2gmwk.js","assets/info-BiAOm8e3.js","assets/flag-AfaA26Lf.js","assets/external-link-_xXbGX0L.js","assets/repeat-2-C7L0rmfH.js","assets/languages-Bs1RLdc6.js","assets/headphones-sybjnoYk.js","assets/chevron-left-wofN6E-i.js","assets/chevron-right-DV0K5ViL.js","assets/arrow-up-Cy5xJQao.js","assets/user-round-BqDtZGW5.js","assets/eye-off-DpXJVcTV.js","assets/trending-up-GTPd5rhW.js","assets/ViralityLabPanel-Cw_TVndT.js","assets/flask-conical-D4I_xDRy.js","assets/waves-4rzVJ3Dg.js","assets/LeaderboardPanel-DmAENVu4.js","assets/useGamification-BsJNiQtk.js","assets/clock-D1FAfH0T.js","assets/eye-CdrnGrx9.js","assets/RewardsPanel-DL9lfXBj.js","assets/users-DYW9_uQ7.js","assets/message-square-text-D7UvL9lT.js","assets/gift-BHL43gXu.js","assets/CardsPanel-zJttjJCC.js","assets/DiscoverPanel-D9LGR40j.js","assets/WelcomePlanModal-D407sfqI.js","assets/toolHandoff-uvm-al0k.js","assets/music-4-DLOxoErV.js","assets/FirstSongScreen-clzQo1VO.js","assets/artistLanguage-BiB3LMXz.js","assets/ArtistsGalleryPanel-CoKzhule.js","assets/artistFavoritesCache-metJJ7Kc.js","assets/artistStats-D_GsekRP.js","assets/sliders-horizontal-qc8hCsmr.js","assets/DnaPanel-C_QjXCqb.js","assets/dnaArchetype-BCghWW2g.js","assets/ear-DUeEa5kw.js","assets/file-text-D9GhLTTP.js","assets/GeniePanel-B-OysafK.js","assets/genieScore-DVAv1f1E.js","assets/MadeForMePanel-DHnpzBP2.js","assets/lightbulb-D0QS-TUC.js","assets/clapperboard-B02RwB_x.js","assets/library-BLJEMmhb.js","assets/DnaReveal-IiD8Ibnw.js","assets/FeatsPanel-CKVdqifj.js","assets/FeatsPanel-DFrosbzc.css","assets/ProfilePanel-EDKGe_-y.js","assets/chart-column-BfzgXP9h.js","assets/link-ChCepUKM.js","assets/SettingsPanel-D_J9ngIu.js","assets/LibraryPanel-jUnziR0X.js","assets/list-music-Zg4kvKFR.js","assets/ToolRouter-BZPj2gXr.js","assets/tools-CUhEFm7f.js","assets/AffiliatesPage-lxdNv0h-.js","assets/BlockReveal-BC1i12DB.js","assets/dollar-sign-Cw06g7fS.js","assets/DiscoverPage-YT-1Sf81.js","assets/GeneratePanel-BgC066rT.js","assets/realisticVoiceStrings-BmuZNXTg.js","assets/AppBanner-BnPdbtUe.js","assets/smartphone-a0J9PZJE.js","assets/audioDna-Bl9kPlQv.js","assets/songAnalyzer-C8OLsU3R.js","assets/scissors-CQ32yTvw.js","assets/megaphone-3MFW5Hfz.js","assets/settings-DLODnn9U.js","assets/cpu-OGtAFvfU.js","assets/FirstLyricQuest-x3o8eZ0d.js","assets/ticket-DoiyYNxB.js"])))=>i.map(i=>d[i]); 2import{J as we,g as r,j as e,A as G,k as c,q as ke,O as Ee,t as y,Q as Pe,R as W,S as v,_ as m,X as te}from"./index-CEq6EAUz.js";import{A as ae}from"./ArtistImg-4d8dRmYr.js";import{g as b}from"./generationUsage-BYpNjdma.js";import{N as ie}from"./NotificationBell-BG3XGezC.js";import{a as Ce}from"./FirstOffer-BFMukNfh.js";import{M as de}from"./menu-D_rU9hdY.js";import{A as ne}from"./arrow-left-zgVC41dm.js";import{C as Q}from"./chevron-down-zClUZ5_n.js";import{G as Y}from"./gem-Dg0RPhxQ.js";import{E as Te}from"./eye-CdrnGrx9.js";import{U as De}from"./user-round-BqDtZGW5.js";import{S as Re}from"./settings-DLODnn9U.js";import{C as se}from"./crown-C-yVFN4o.js";import{A as ce}from"./arrow-right-BpN5kYVm.js";import{M as Le}from"./message-circle-NOrullP4.js";import{U as ze}from"./user-plus-D-V3bm3j.js";import{C as Ie}from"./credit-card-CbDFtIZD.js";import"./bell-s3pGSusw.js";import"./lightbulb-D0QS-TUC.js";import"./repeat-2-C7L0rmfH.js";import"./music-2-iOS-PdBz.js";import"./trophy-Cm9c67BZ.js";import"./gift-BHL43gXu.js";import"./heart-B5gLCo2X.js";import"./handshake-BteMAbq-.js";import"./MgSheet-D95Zfr0r.js";import"./index-CzjoYJf_.js";import"./use-reduced-motion-C-9K3hxL.js";import"./timer-iUInvvrO.js";import"./zap-Cc0rplsG.js";const $e=r.lazy(()=>m(()=>import("./StudioPanel-DGzLur9b.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]))),Oe=r.lazy(()=>m(()=>import("./PricingPanel-DgOy77F1.js"),__vite__mapDeps([60,1,2,30,61,33,31,32,29,34,35,62,14,36,37,12]))),Se=r.lazy(()=>m(()=>import("./AddArtistPanel-CoOLIDiw.js"),__vite__mapDeps([63,1,2,64,65,36,66,14,5,7,41,67]))),Fe=r.lazy(()=>m(()=>import("./CustomLyricistPanel-B-7GOWYb.js"),__vite__mapDeps([68,1,2,3,36,69,14,11,15,7,18,70,71,72,67,13,8,49,73]))),Me=r.lazy(()=>m(()=>import("./FeedPanel-C7tbY4Yh.js"),__vite__mapDeps([74,1,2,75,76,5,77,10,78,23,3,79,80,81,82,83,4,84,12,85,86,67,87,88,69,89,90,53,57,58,91,49,59,92]))),Ue=r.lazy(()=>m(()=>import("./ViralityLabPanel-Cw_TVndT.js"),__vite__mapDeps([93,1,2,94,14,73,95,55,5,58,72,65]))),Be=r.lazy(()=>m(()=>import("./LeaderboardPanel-DmAENVu4.js"),__vite__mapDeps([96,1,2,97,77,62,76,98,99,21,35,39,10,57]))),Ge=r.lazy(()=>m(()=>
2import("./RewardsPanel-DL9lfXBj.js"),__vite__mapDeps([100,1,2,97,14,9,11,90,36,76,101,78,53,54,102,103,65]))),We=r.lazy(()=>m(()=>import("./CardsPanel-zJttjJCC.js"),__vite__mapDeps([104,1,2,17,19,10,20,21]))),Qe=r.lazy(()=>m(()=>import("./DiscoverPanel-D9LGR40j.js"),__vite__mapDeps([105,1,2,55,101,53,65,83,67,98]))),Ye=r.lazy(()=>m(()=>import("./WelcomePlanModal-D407sfqI.js"),__vite__mapDeps([106,1,2,32,29,33,107,42,108,36,14,65]))),qe=r.lazy(()=>m(()=>import("./FirstSongScreen-clzQo1VO.js"),__vite__mapDeps([109,1,2,3,107,110,55,77,70,69,36,65]))),He=typeof window<"u"&&new URLSearchParams(window.location.search).get("welcome")==="plan",re=r.lazy(()=>m(()=>import("./ArtistsGalleryPanel-CoKzhule.js"),__vite__mapDeps([111,1,2,110,3,112,113,28,29,30,31,32,33,34,35,36,14,11,37,38,77,67,114,55,5,58,16,85,12,73,10,101,81]))),Ke=r.lazy(()=>m(()=>import("./DnaPanel-C_QjXCqb.js").then(t=>t.D),__vite__mapDeps([115,1,2,22,23,36,49,73,116,7,77,35,88,39,21,117,80,118,20,62,47,5,12]))),Je=r.lazy(()=>m(()=>import("./GeniePanel-B-OysafK.js"),__vite__mapDeps([119,1,2,26,120,107,45,22,23,27,113,110,121,3,36,88,35,42,61,33,6,46,47,89,70,7,5,122,55,15,58,20,123,17,124]))),Xe=r.lazy(()=>m(()=>import("./DnaReveal-IiD8Ibnw.js"),__vite__mapDeps([125,1,2,22,23,116]))),Ze=r.lazy(()=>m(()=>import("./FeatsPanel-CKVdqifj.js"),__vite__mapDeps([126,1,2,29,6,36,44,5,4,86,53,73,82,101,59,52,34,55,127]))),Ae=r.lazy(()=>m(()=>import("./ProfilePanel-EDKGe_-y.js"),__vite__mapDeps([128,1,2,48,17,10,36,40,90,52,83,78,129,130]))),Ve=r.lazy(()=>m(()=>import("./SettingsPanel-D_J9ngIu.js"),__vite__mapDeps([131,1,2,30,10,90,37,64,5,11,20,66,14,65,83,36,72,49]))),le=r.lazy(()=>m(()=>import("./LibraryPanel-jUnziR0X.js"),__vite__mapDeps([132,1,2,3,5,67,12,42,133,73,72,49,87,88]))),et=r.lazy(()=>m(()=>import("./ToolRouter-BZPj2gXr.js"),__vite__mapDeps([134,1,2,135]))),tt=r.lazy(()=>m(()=>import("./AffiliatesPage-lxdNv0h-.js"),__vite__mapDeps([136,1,2,137,138,101,92,130,36,52,21,38,83]))),at=r.lazy(()=>m(()=>import("./DiscoverPage-YT-1Sf81.js"),__vite__mapDeps([139,1,2,137,69,5,77,90,73,130,55,53,54,129,49,83]))),it=r.lazy(()=>m(()=>import("./GeneratePanel-BgC066rT.js").then(t=>t.G),__vite__mapDeps([140,1,2,29,135,141,45,120,8,65,58,15,28,30,31,32,33,34,35,36,14,11,37,38,6,110,112,113,27,3,107,26,142,20,143,64,22,23,121,88,42,144,145,10,73,71,17,12,66,114,94,55,101,72,95,52,67,80,146,21,147,59,148,149,78]))),I={free:{label:"FREE",icon:v,badge:"bg-slate-100 text-slate-600 border-slate-200",meter:"bg-slate-400"},starter:{label:"STARTER",icon:v,badge:"bg-cyan-50 text-cyan-700 border-cyan-200",meter:"bg-cyan-500"},pro:{label:"PRO",icon:se,badge:"bg-emerald-50 text-emerald-700 border-emerald-200",meter:"bg-emerald-500"},elite:{label:"ELITE",icon:se,badge:"bg-amber-50 text-amber-700 border-amber-200",meter:"bg-amber-500"}};r.lazy(()=>m(()=>import("./FirstLyricQuest-x3o8eZ0d.js"),__vite__mapDeps([150,1,2,3,110,101,151,55,78,69,65,15,36])));function nt(t){return t.remaining<=0?t.plan==="free"?"0 credits left":"monthly credits used":t.monthlyRemaining<=0&&t.extra>0?`${t.extra} extra credits`:`${t.remaining} credits left`}function st(t){return t.remaining<=0?`${t.used}/${t.limit} credits used`:t.extra>0?`${t.monthlyRemaining} monthly + ${t.extra} extra credits`:`${t.used}/${t.limit} credits used`}function rt(t){var a;return t.remaining<=0?t.plan==="free"?"Your 14 monthly coins are used. Complete a creator action or upgrade for more.":`${((a=I[t.plan])==null?void 0:a.label)||"Plan"} credits used this month. Upgrade or buy extra credits.`:t.monthlyRemaining<=0&&t.extra>0?`Monthly credits used; ${t.extra} extra credit${t.extra===1?"":"s"} remain.`:`${t.monthlyRemaining} credits left this month${t.extra>0?` + ${t.extra} extra`:""}`}function oe({plan:t}){const a=I[t]||I.free,s=a.icon;return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[8px] font-black tracking-wide ${a.badge}`,children:[e.jsx(s,{className:"h-2.5 w-2.5"}),a.label]})}function lt({profile:t,compact:a=!1}){const s=b(t),n=s.remaining<=0,x=n?"bg-rose-500":s.remainingPct<=25?"bg-orange-500":s.remainingPct<=50?"bg-amber-400":"bg-emerald-500",g=n?"text-rose-600":s.remainingPct<=25?"text-orange-600":"text-slate-900";return e.jsxs("div",{className:`group flex h-10 items-center rounded-xl border border-slate-200/90 bg-white shadow-sm transition-colors hover:border-amber-300 ${a?"gap-1.5 px-1.5 sm:gap-2 sm:px-2":"gap-2 px-2"}`,title:st(s),"aria-label":`${s.remaining} credits available`,children:[e.jsxs("div",{className:"relative grid h-7 w-7 flex-none place-items-center rounded-lg border border-amber-300 bg-amber-100 text-amber-700 shadow-[inset_0_1px_0_rgba(255,255,255,0.85),0_2px_6px_rgba(180,120,20,0.16)]",children:[e.jsx(Y,{className:"h-3.5 w-3.5",
2strokeWidth:2.4}),e.jsx(v,{className:"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full bg-white text-amber-500",strokeWidth:2.6})]}),e.jsxs("div",{className:"w-[38px] min-w-0 sm:w-[82px]",children:[e.jsxs("div",{className:"flex items-baseline gap-1 leading-none",children:[e.jsx("span",{className:`text-[12px] font-black tabular-nums ${g}`,children:s.remaining}),e.jsx("span",{className:"hidden text-[8px] font-black uppercase text-slate-400 sm:inline",children:"credits"})]}),e.jsx("div",{className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-slate-100 ring-1 ring-inset ring-slate-200/60",role:"progressbar","aria-label":"Credits available this month","aria-valuemin":0,"aria-valuemax":s.limit,"aria-valuenow":Math.min(s.remaining,s.limit),children:e.jsx(c.div,{initial:!1,animate:{width:`${s.remainingPct}%`},transition:{duration:.45,ease:"easeOut"},className:`h-full rounded-full ${x}`})})]}),e.jsxs("div",{className:"hidden border-l border-slate-100 pl-2 text-left sm:block",children:[e.jsxs("p",{className:"text-[9px] font-black tabular-nums text-slate-700",children:[s.monthlyRemaining,"/",s.limit]}),e.jsx("p",{className:"text-[7px] font-bold uppercase text-slate-400",children:"monthly left"}),s.extra>0&&e.jsxs("p",{className:"text-[8px] font-black text-emerald-600",children:["+",s.extra," extra"]})]})]})}function ot({profile:t,onOpenPlans:a,onOpenMenu:s}){var p;const n=b(t),g=n.remaining<=0?"bg-rose-500":n.remainingPct<=25?"bg-orange-500":n.remainingPct<=50?"bg-amber-400":"bg-emerald-500";return e.jsxs("div",{className:"native-credit-bar flex w-full flex-shrink-0 items-center gap-2 border-b border-slate-200 bg-white px-3 pb-1.5 shadow-[0_1px_0_rgba(15,23,42,0.03)]",style:{paddingTop:"calc(6px + env(safe-area-inset-top, 0px))"},children:[e.jsx("button",{type:"button",onClick:()=>{W(),s==null||s()},className:"grid h-9 w-9 flex-none place-items-center rounded-xl border border-slate-200 bg-slate-50 text-slate-700 shadow-[inset_0_1px_0_rgba(255,255,255,0.8)] active:scale-[0.96] active:bg-slate-100","aria-label":"Open menu",children:e.jsx(de,{className:"h-[18px] w-[18px]",strokeWidth:2.3})}),e.jsxs("button",{type:"button",onClick:()=>{W(),a==null||a()},className:"flex min-w-0 flex-1 items-center gap-2 text-left active:opacity-80","aria-label":`${n.remaining} credits available. Open plans and credit packs.`,children:[e.jsxs("span",{className:"relative grid h-7 w-7 flex-none place-items-center rounded-lg border border-amber-300 bg-amber-100 text-amber-700",children:[e.jsx(Y,{className:"h-3.5 w-3.5",strokeWidth:2.4}),e.jsx(v,{className:"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full bg-white text-amber-500",strokeWidth:2.6})]}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center justify-between gap-2 leading-none",children:[e.jsxs("span",{className:"text-[12px] font-black text-slate-900",children:[n.remaining," credit",n.remaining===1?"":"s"]}),e.jsx("span",{className:"text-[9px] font-black uppercase text-slate-400",children:((p=I[n.plan])==null?void 0:p.label)||"FREE"})]}),e.jsx("span",{className:"mt-1.5 block h-1.5 w-full overflow-hidden rounded-full bg-slate-100 ring-1 ring-inset ring-slate-200/70",role:"progressbar","aria-label":"Credits available this month","aria-valuemin":0,"aria-valuemax":n.limit,"aria-valuenow":Math.min(n.remaining,n.limit),children:e.jsx(c.span,{initial:!1,animate:{width:`${n.remainingPct}%`},transition:{duration:.45,ease:"easeOut"},className:`block h-full rounded-full ${g}`})})]}),e.jsxs("span",{className:"flex-none text-right leading-none",children:[e.jsxs("span",{className:"block text-[10px] font-black tabular-nums text-slate-700",children:[n.monthlyRemaining,"/",n.limit]}),e.jsx("span",{className:`mt-1 block text-[8px] font-bold ${n.extra>0?"text-emerald-600":"text-slate-400"}`,children:n.extra>0?`+${n.extra} extra`:"monthly left"})]}),e.jsx(ce,{className:"h-3.5 w-3.5 flex-none text-slate-300"})]})]})}function dt(){return e.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:e.jsxs("div",{className:"rounded-2xl border border-emerald-100 bg-white px-4 py-3 text-center shadow-sm",children:[e.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent"}),e.jsx("p",{className:"mt-2 text-[11px] font-black text-slate-500",children:"Loading panel..."})]})})}
2function ct({user:t,profile:a,setView:s}){const n=r.useRef(!1),[x,g]=r.useState(()=>{var E,R;if(typeof window>"u"||(((R=(E=window.matchMedia)==null?void 0:E.call(window,"(max-width: 767px)"))==null?void 0:R.matches)??!0))return!0;const _=window.localStorage.getItem("mg_creator_missions_collapsed");return _?_==="1":!0}),[p,j]=r.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("mg_creator_missions_hidden")==="1"),d=b(a),T=!!(a!=null&&a.referral_invite_reward_claimed_at),w=!!t&&d.plan==="free"&&!p&&d.remaining<=0;r.useEffect(()=>{try{window.localStorage.setItem("mg_creator_missions_collapsed",x?"1":"0")}catch{}},[x]),r.useEffect(()=>{!w||n.current||(n.current=!0,y("credit_options_banner_shown",{reason:"free_monthly_limit_full",used:d.used,limit:d.limit,monthly_remaining:d.monthlyRemaining,extra:d.extra}))},[w,d.used,d.limit,d.monthlyRemaining,d.extra]);const D=()=>{y("mission_paywall_closed",{reason:"dismissed",used:d.used,limit:d.limit}),j(!0);try{window.localStorage.setItem("mg_creator_missions_hidden","1")}catch{}};if(!w)return null;const $=()=>{try{y("mission_invite_clicked",{remaining:d.remaining,invite_claimed:T}),window.dispatchEvent(new CustomEvent("mg:open-referral"))}catch(k){console.warn("Could not open referral popup:",k)}};return x?e.jsx("section",{"data-mg-bottom-dock":"credits",className:"fixed inset-x-2 bottom-[calc(72px+env(safe-area-inset-bottom,0px))] z-[120] rounded-2xl border border-emerald-100 bg-white/95 px-2 py-1.5 shadow-xl shadow-emerald-950/10 backdrop-blur md:static md:z-auto md:flex-shrink-0 md:rounded-none md:border-x-0 md:border-t-0 md:bg-white/90 md:px-4 md:shadow-none",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>{y("mission_paywall_expanded",{reason:"user_opened",used:d.used,limit:d.limit}),g(!1)},className:"flex min-h-10 min-w-0 flex-1 items-center justify-between gap-2 rounded-2xl border border-emerald-100 bg-gradient-to-r from-slate-950 via-emerald-950 to-slate-950 px-3 text-left shadow-lg shadow-emerald-950/10 transition hover:border-emerald-200","aria-expanded":"false",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"grid h-7 w-7 flex-shrink-0 place-items-center rounded-xl bg-emerald-300 text-slate-950",children:e.jsx(v,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"truncate text-[11px] font-black text-white",children:["More room to create",e.jsx("span",{className:"ml-1 font-bold text-emerald-200",children:d.remaining<=0?"0 credits left":`${d.remaining} credits left`})]}),e.jsx("p",{className:"hidden truncate text-[9px] font-bold text-white/55 sm:block",children:"Explore available rewards or compare plans for lyrics and music."})]})]}),e.jsxs("span",{className:"flex flex-shrink-0 items-center gap-1 rounded-full bg-white/10 px-2 py-1 text-[9px] font-black text-emerald-100 shadow-sm",children:["Open",e.jsx(Q,{className:"h-3 w-3"})]})]}),e.jsx("button",{type:"button",onClick:D,className:"grid h-9 w-9 flex-shrink-0 place-items-center rounded-2xl border border-slate-200 bg-white text-slate-400 shadow-sm transition hover:border-rose-200 hover:bg-rose-50 hover:text-rose-500","aria-label":"Close creator missions",children:e.jsx(te,{className:"h-3.5 w-3.5"})})]})}):e.jsx("section",{className:"fixed inset-x-2 bottom-[calc(72px+env(safe-area-inset-bottom,0px))] z-[120] max-h-[46vh] overflow-y-auto rounded-3xl border border-emerald-200/70 bg-white p-2 shadow-2xl shadow-emerald-950/20 md:static md:z-auto md:max-h-none md:flex-shrink-0 md:overflow-visible md:rounded-none md:border-x-0 md:border-t-0 md:bg-gradient-to-r md:from-emerald-50 md:via-white md:to-cyan-50 md:px-4 md:py-2 md:shadow-none",children:e.jsxs("div",{className:"mx-auto grid max-w-6xl gap-3 overflow-hidden rounded-[22px] border border-white bg-white/95 p-2.5 shadow-sm shadow-emerald-100/60 backdrop-blur md:grid-cols-[minmax(0,1fr)_auto] md:items-center md:p-3",children:[e.jsxs("div",{className:"min-w-0 rounded-2xl bg-gradient-to-r from-slate-950 via-emerald-950 to-slate-950 p-3 text-white md:bg-none md:p-0 md:text-slate-950",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-300 px-2.5 py-1 text-[9px] font-black uppercase tracking-wide text-slate-950 md:bg-slate-950 md:text-emerald-200",children:[e.jsx(v,{className:"h-3 w-3"}),"Monthly credits"]}),e.jsx("p",{className:"text-[12px] font-black md:text-slate-950",children:d.remaining<=0?"Keep creating lyrics and music.":`${d.remaining} credit${d.remaining===1?"":"s"} left to create.`})]}),e.jsxs("p",{className:"mt-1.5 max-w-3xl text-[10px] font-bold leading-4 text-white/60 md:text-slate-500",children:["You used ",d.used,"/",d.limit," monthly credits. Lyrics and music share one balance; each action shows its cost before you start. Explore available rewards or compare plans. You can still listen to your finished songs."]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4 md:flex md:items-center",children:[e.jsxs("button",{type:"button",onClick:()=>{y("mission_forum_clicked",{remaining:d.remaining}),s("rewards")},className:"inline-flex min-h-10 items-center justify-center gap-1.5 rounded-2xl border border-cyan-200 bg-cyan-50 px-3 text-[10px] font-black text-cyan-800 transition hover:bg-white",children:[e.jsx(Le,{className:"h-3.5 w-3.5"}),"Available rewards"]}),e.jsxs("button",{type:"button",onClick:$,className:"inline-flex min-h-10 items-center justify-center gap-1.5 rounded-2xl border border-violet-200 bg-vi
2olet-50 px-3 text-[10px] font-black text-violet-800 transition hover:bg-white",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),T?"Invite more friends":"Invite friends"]}),e.jsxs("button",{type:"button",onClick:()=>{y("mission_upgrade_clicked",{remaining:d.remaining}),s("pricing")},className:"inline-flex min-h-10 items-center justify-center gap-1.5 rounded-2xl bg-slate-950 px-3 text-[10px] font-black text-white shadow-lg shadow-slate-950/15 transition hover:bg-emerald-600",children:[e.jsx(Ie,{className:"h-3.5 w-3.5"}),"Compare plans",e.jsx(ce,{className:"h-3 w-3"})]}),e.jsxs("button",{type:"button",onClick:()=>{y("mission_paywall_minimized",{reason:"user_minimized",used:d.used,limit:d.limit}),g(!0)},className:"col-span-2 inline-flex min-h-10 items-center justify-center gap-1.5 rounded-2xl border border-slate-200 bg-white px-3 text-[10px] font-black text-slate-500 transition hover:bg-slate-50 sm:col-span-1","aria-expanded":"true",children:["Minimize",e.jsx(Q,{className:"h-3 w-3 rotate-180"})]}),e.jsxs("button",{type:"button",onClick:D,className:"col-span-2 inline-flex min-h-10 items-center justify-center gap-1.5 rounded-2xl border border-rose-100 bg-white px-3 text-[10px] font-black text-rose-500 transition hover:bg-rose-50 sm:col-span-1","aria-label":"Close creator missions",children:["Close",e.jsx(te,{className:"h-3 w-3"})]})]})]})})}function mt({profile:t,onClick:a}){return null}function xt({profile:t,email:a}){var p,j;const[s,n]=r.useState(!1),x=t==null?void 0:t.avatar_url,g=((j=(p=(t==null?void 0:t.display_name)||a)==null?void 0:p[0])==null?void 0:j.toUpperCase())||"U";return r.useEffect(()=>{n(!1)},[x]),x&&!s?e.jsx("img",{src:x,alt:"",className:"w-6 h-6 rounded-full object-cover ring-1 ring-emerald-200 bg-emerald-50",onError:()=>n(!0)}):e.jsx("div",{className:"w-6 h-6 rounded-full bg-gradient-to-br from-emerald-500 to-teal-400 flex items-center justify-center text-[9px] font-bold text-white",children:g})}function Yt({view:t,setView:a,nativeApp:s=!1,selectedArtist:n,setSelectedArtist:x,onSelectArtist:g,artists:p,setArtists:j,countries:d,plans:T,plansLoading:w,plansLoadError:D,onRetryPlans:$,sidebarOpen:k,setSidebarOpen:_,onGenerated:E,initialOutput:R,initialQualityVersion:me,pendingSongDraft:xe,onPendingSongDraftGenerated:pe,initialStudioMo
2de:ue="write",initialGenerateSection:he=null,onProductLaunchConsumed:q,clearInitialOutput:ge,history:O=[],onSelectHistory:H}){var ee;const{user:l,profile:o,signOut:K,updateProfileLocal:ut}=we(),[S,N]=r.useState(!1),[fe,F]=r.useState(!1),[M,J]=r.useState(""),[P,X]=r.useState(!1),[Z,U]=r.useState(""),be=async()=>{if(!(M.trim().toUpperCase()!=="DELETE"||P)){X(!0),U(""),y("account_delete_confirmed",{});try{const i=await Pe();if(!i)throw new Error("Session expired. Sign in again to delete your account.");const u=await fetch("/api/account/delete",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({confirm:"DELETE"})}),h=await u.json().catch(()=>({}));if(!u.ok||!h.ok)throw new Error(h.error||"Could not delete the account.");y("account_deleted",{}),await K(),window.location.href="/?account=deleted"}catch(i){U(i.message||"Could not delete the account."),X(!1)}}};r.useEffect(()=>{const i=()=>{y("account_delete_opened",{source:"settings"}),J(""),U(""),F(!0)};return window.addEventListener("mg:open-delete-account",i),()=>window.removeEventListener("mg:open-delete-account",i)},[]);const A=r.useRef(null),V=i=>{s&&W(),a(i)};r.useEffect(()=>{var i,u;(u=(i=A.current)==null?void 0:i.scrollTo)==null||u.call(i,{top:0,left:0})},[t,n==null?void 0:n.id]);const B=(O||[]).length>0||Number((o==null?void 0:o.monthly_generations)||0)>0||Number((o==null?void 0:o.tokens_used_this_month)||0)>0||Number((o==null?void 0:o.generations_this_month)||0)>0,C=l!=null&&l.id?`mg_first_lyric_quest_done_${l.id}`:"",[ye,L]=r.useState(!0),[je,z]=r.useState("");r.useEffect(()=>{if(!C){L(!0),z("");return}try{const i=window.localStorage.getItem(C)||"";L(!!i),z(i)}catch{L(!1),z("")}},[C]);const _e=(i="completed")=>{if(C)try{window.localStorage.setItem(C,i),i==="skipped"?window.localStorage.removeItem("mg_first_win_dismissed"):window.localStorage.setItem("mg_first_win_dismissed","1")}catch{}L(!0),z(i),y("first_quest_closed",{reason:i})},Ne=!1,ve=!!l&&!["auth","pricing","settings","profile"].includes(t)&&!B&&!ye&&(p||[]).length>0;return e.jsxs("main",{className:`flex-1 min-w-0 min-h-0 flex flex-col h-full overflow-hidden ${s?"native-app-main":""}`,style:{background:s?"#f6f8fb":"var(--mg-bg, #f9fafb)"},children:[!s&&e.jsxs("header",{className:`relative z-[100] flex min-h-14 flex-shrink-0 items-center justify-between gap-2 px-3 sm:px-4 ${t==="studio"&&n?"":"md:hidden"}`,style:{background:"var(--mg-surface, white)",borderBottom:"1px solid var(--mg-border, #e5e7eb)",paddingTop:"env(safe-area-inset-top, 0px)",minHeight:"calc(56px + env(safe-area-inset-top, 0px))"},children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx("button",{onClick:()=>_(!0),className:`grid h-10 w-10 flex-shrink-0 place-items-center rounded-xl md:hidden ${s?"bg-white/10 text-slate-200":"bg-gray-50 text-gray-500 hover:bg-gray-100"}`,"aria-label":"Open menu",children:e.jsx(de,{className:"h-5 w-5"})}),t==="studio"&&n?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{x(null),a("studio")},className:"inline-flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl border border-gray-200 bg-gray-50 text-gray-600 transition hover:border-emerald-200 hover:bg-emerald-50 hover:text-emerald-700 sm:w-auto sm:px-2.5",title:"Change artist","aria-label":"Change artist",children:[e.jsx(ne,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Change artist"})]}),e.jsx(ae,{name:n.name,url:n.avatar_url,size:32,className:"ring-1 ring-emerald-300/50"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:`block max-w-[42vw] truncate text-[13px] font-bold sm:max-w-none ${s?"text-slate-50":""}`,style:{color:s?void 0:"#1f2937",fontFamily:"Outfit, sans-serif"},children:n.name}),e.jsxs("span",{className:"hidden text-[9px] sm:inline sm:ml-2",style:{color:s?"#94a3b8":"#9ca3af"},children:[n.genre," - ",Number(n.songs_analyzed||0)>0?`${n.songs_analyzed} songs`:["ready","active"].includes(String(n.status||"").toLowerCase())?"Style DNA ready":"Analysing style, a few minutes"]}),e.jsxs("span",{className:"hidden",style:{color:"#9ca3af"},children:[n.genre," ⢠",n.songs_analyzed," songs"]})]})]}):e.jsx("span",{className:"truncate text-[13px] font-bold",style:{color:s?"#e2e8f0":"#6b7280",fontFamily:"Outfit, sans-serif"},children:{studio:"Select an artist",pricing:"Plans","add-artist":"Add Real Artist",feed:"Feed",discover:"Discover",forum:"Forum",generate:"Generate",research:"Virality Lab",games:"Games",feats:"Feats",cards:"Lyric Cards",leaderboard:"Top Creators",profile:"Profile",affiliates:"Affiliate Program"}[t]||""})]}),e.jsxs("div",{className:"relative md:hidden",children:[l?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"hidden sm:block",children:e.jsx(mt,{profile:o,onClick:()=>a("pricing")})}),l&&e.jsx(Ce,{onOpenPlans:()=>a("pricing")}),e.jsx("div",{className:"block",children:e.jsx(lt,{profile:o,compact:!0})}),l&&e.jsx(ie,{onNavigate:a}),e.jsxs("button",{onClick:()=>N(!S),className:`flex h-10 items-center gap-1 rounded-xl px-1.5 transition-all sm:gap-2 sm:px-2 ${s?"bg-white/10 hover:bg-white/20":"hover:bg-gray-100"}`,"aria-label":"Open account menu",children:[e.jsx(xt,{profile:o,email:l.email}),e.jsxs("span",{className:"hidden text-left sm:block",children:[e.jsx("span",{className:`block max-w-[120px] truncate text-[11px] font-bold ${s?"text-slate-100":"text-gray-700"}`,children:(o==null?void 0:o.display_name)||((ee=l.email)==null?void 0:ee.split("@")[0])}),e.jsxs("span",{className:"mt-0.5 flex items-center gap-1",children:[e.jsx(oe,{plan:b(o).plan}),e.jsx("span",{className:`text-[8px] font-bold md:hidden ${s?"text-slate-400":"text-gray-400"}`,children:nt(b(o))})]})]}),e.jsx(Q,{className:`hidden h-3 w-3 sm:block ${s?"text-slate-500":"text-gray-300"}`})]})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>V("auth"),className:"text-[11px] text-gray-500 hover:text-gray-700 font-medium px-3 py-1.5 rounded-lg hover:bg-gray-100 transition-all",children:"Log In"}),e.jsx("button",{onClick:()=>V("auth"),className:"btn-primary text-[11px] px-3 py-1.5",children:"Register"})]}),e.jsx(G,{children:S&&l&&e.jsxs(c.div,{initial:{opacity:0,y:-4,scale:.95}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.95},className:"absolute right-0 top-full mt-1 w-48 bg-white rounded-xl border border-gray-200 shadow-xl shadow-gray-200 py-1.5 z-[999]",children:[e.jsxs("div",{className:"px-3 py-2 border-b border-gray-200",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-[11px] font-bold text-gray-700",children:(o==null?void 0:o.display_name)||"User"}),e.jsx("p",{className:"text-[9px] text-gray-400",children:l.email})]}),e.jsx(oe,{plan:b(o).plan})]}),e.jsxs("div",{className:"mt-2 rounded-xl border border-amber-200/70 bg-amber-50/50 p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[9px] font-black uppercase text-amber-700",children:[e.jsx(Y,{className:"h-3 w-3"})," Credits available"]}),e.jsx("span",{className:"text-[12px] font-black tabular-nums text-slate-900",children:b(o).remaining})]}),e.jsx("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-white ring-1 ring-inset ring-amber-100",role:"progressbar","aria-label":"Credits available this month","aria-valuemin":0,"aria-valuemax":b(o).limit,"aria-valuenow":Math.min(b(o).remaining,b(o).limit),children:e.jsx(c.div,{initial:!1,animate:{width:`${b(o).remainingPct}%`},transition:{duration:.45,ease:"easeOut"},className:`h-full rounded-full ${b(o).remaining<=0?"bg-rose-500":b(o).remainingPct<=25?"bg-orange-500":b(o).remainingPct<=50?"bg-amber-400":"bg-emerald-500"}`})}),e.jsx("p",{className:"mt-1 text-[9px] font-bold text-emerald-600",children:rt(b(o))})]})]}),e.jsxs("button",{onClick:i=>{i.stopPropagation();const u=(o==null?void 0:o.username)||l.id;ke(`/u/${u}`),N(!1)},className:"w-full text-left px-3 py-2 text-[11px] text-gray-600 hover:bg-gray-50 transition-colors flex items-center gap-1.5",children:[e.jsx(Te,{className:"w-3 h-3"})," View Profile"]}),e.jsxs("button",{onClick:i=>{i.stopPropagation(),a("profile"),N(!1)},className:"w-full text-left px-3 py-2 text-[11px] text-gray-600 hover:bg-gray-50 transition-colors flex items-center gap-1.5",children:[e.jsx(De,{className:"w-3 h-3"}),"Edit Profile"]}),e.jsxs("button",{onClick:i=>{i.stopPropagation(),a("settings"),N(!1)},className:"w-full text-left px-3 py-2 text-[11px] text-gray-600 hover:bg-gray-50 transition-colors flex items-center gap-1.5",children:[e.jsx(Re,{className:"w-3 h-3"}),"Settings"]}),e.jsx("button",{onClick:i=>{i.stopPropagation(),a("affiliates"),N(!1),window.history.pushState({},"","/affiliates")},className:"w-full text-left px-3 py-2 text-[11px] text-gray-600 hover:bg-gray-50 transition-colors",children:"Affiliate Program"}),e.jsxs("button",{onClick:i=>{i.stopPropagation(),K(),N(!1)},className:"w-full text-left px-3 py-2 text-[11px] text-red-500 hover:bg-red-50 transition-colors flex items-center gap-1.5",children:[e.jsx(Ee,{className:"w-3 h-3"})," Sign Out"]})]})})]})]}),e.jsx(G,{children:fe&&e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},onClick:()=>!P&&F(!1),className:"fixed inset-0 z-[300] flex justify-center overflow-y-auto overscroll-contain p-4 sm:items-center",style:{background:"rgba(2,6,23,0.72)",backdropFilter:"blur(4px)"},children:e.jsxs(c.div,{initial:{scale:.94,y:14},animate:{scale:1,y:0},exit:{scale:.94,y:14},onClick:i=>i.stopPropagation(),className:"my-auto h-fit w-full max-w-sm rounded-3xl bg-white p-5 shadow-2xl",children:[e.jsx("h3",{className:"text-base font-black text-slate-950",children:"Delete your account?"}),e.jsx("p",{className:"mt-2 text-[12px] font-semibold leading-5 text-slate-500",children:"This is permanent. Your lyrics, custom lyricists, credits and progress are deleted and canât be recovered. Any active subscription is cancelled immediately."}),e.jsx("label",{className:"mt-4 block text-[10px] font-black uppercase tracking-wide text-slate-400",children:"Type DELETE to confirm"}),e.jsx("input",{value:M,onChange:i=>J(i.target.value),placeholder:"DELETE",autoFocus:!0,className:"mt-1 w-full rounded-xl border border-slate-200 bg-slate-50 px-3 py-2.5 text-[13px] font-bold text-slate-800 outline-none focus:border-red-300",style:{fontSize:"16px"}}),Z&&e.jsx("p",{className:"mt-2 rounded-xl bg-red-50 px-3 py-2 text-[11px] font-bold text-red-600",children:Z}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("button",{onClick:()=>F(!1),disabled:P,className:"flex-1 rounded-xl border border-slate-200 px-4 py-2.5 text-[12px] font-black text-slate-600 transition hover:bg-slate-50 disabled:opacity-50",children:"Keep my account"}),e.jsx("button",{onClick:be,disabled:P||M.trim().toUpperCase()!=="DELETE",className:"flex-1 rounded-xl bg-red-600 px-4 py-2.5 text-[12px] font-black text-white transition hover:bg-red-700 disabled:opacity-40",children:P?"Deletingâ¦":"Delete forever"})]})]})})}),s&&l&&e.jsx(ot,{profile:o,onOpenPlans:()=>a("pricing"),onOpenMenu:()=>_==null?void 0:_(!0)}),s&&t==="studio"&&n&&e.jsxs("header",{className:"native-studio-topbar flex flex-shrink-0 items-center gap-2 px-3 py-2",style:{paddingTop:l?"8px":"calc(8px + env(safe-area-inset-top, 0px))"},children:[e.jsxs("button",{type:"button",onClick:()=>{x(null),a("studio")},className:"inline-flex min-h-[40px] items-center gap-1 rounded-xl border border-slate-200 bg-white px-2.5 text-[12px] font-black text-slate-600 active:scale-[0.97]","aria-label":"Back to artist hub",children:[e.jsx(ne,{className:"h-4 w-4"}),"Hub"]}),e.jsx(ae,{name:n.name,url:n.avatar_url,size:34,className:"ring-1 ring-emerald-300/50"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-[14px] font-black text-slate-900",style:{fontFamily:"Outfit, sans-serif"},children:n.name}),e.jsxs("p",{className:"truncate text-[10px] font-bold text-slate-400",children:[n.genre,Number(n.songs_analyzed||0)>0?` · ${n.songs_analyzed} songs`:["ready","active"].includes(String(n.status||"").toLowerCase())?" · Style DNA ready":""]})]}),l&&e.jsx(ie,{onNavigate:a})]}),l&&!s&&t!=="genie"&&t!=="auth"&&(()=>{let i=!1;try{i=localStorage.getItem("mg_genie_wish_day")!==new Date().toISOString().slice(0,10)}catch{}if(!i)return null;const u=typeof document<"u"&&document.documentElement.lang||"en",h={es:"Tu deseo del dÃa está listo â¨",pt:"Seu desejo do dia está pronto â¨",fr:"Ton vÅu du jour est prêt â¨",de:"Dein Wunsch des Tages ist bereit â¨",it:"Il tuo desiderio del giorno è pronto â¨"}[u]||"Your wish of the day is ready â¨";return e.jsx("button",{type:"button",onClick:()=>a("genie"),className:"fixed bottom-[30px] right-[88px] z-[90] hidden max-w-[240px] rounded-2xl rounded-br-md bg-white px-3.5 py-2 text-left text-[12.5px] font-bold text-slate-800 shadow-[0_8px_24px_-10px_rgba(15,23,42,.35)] ring-1 ring-slate-200 transition hover:-translate-y-0.5 lg:block",children:h})})(),l&&!s&&t!=="genie"&&t!=="auth"&&e.jsx("button",{type:"button",onClick:()=>a("genie"),title:"Genie","aria-label":"Open Genie",className:"group fixed bottom-5 right-5 z-[90] hidden h-14 w-14 place-items-center overflow-hidden rounded-full bg-white shadow-[0_8px_20px_-8px_rgba(2,44,34,.45)] ring-1 ring-emerald-100 transition hover:-translate-y-0.5 lg:grid",children:e.jsx("img",{src:"/mascot/genie-free.png",onError:i=>{i.currentTarget.onerror=null,i.currentTarget.src="https://d8j0ntlcm91z4.cloudfront.net/user_3HJbM9RlUhS89gzTBK9VDXudTHN/hf_20260929_190423_4d5c9894-3afd-4855-9c15-5ad76ae7bb3d.png"},alt:"",className:"h-16 w-16 translate-y-2 object-contain transition group-hover:translate-y-1",draggable:!1})}),l&&e.jsx(r.Suspense,{fallback:null,children:e.jsx(Xe,{})}),l&&B&&t!=="pricing"&&t!=="auth"&&e.jsx(ct,{user:l,profile:o,setVie
2w:a}),l&&He&&e.jsx(r.Suspense,{fallback:null,children:e.jsx(Ye,{setView:a,setSelectedArtist:x,artists:p})}),e.jsxs(G,{children:[ve&&e.jsx(r.Suspense,{fallback:null,children:e.jsx(qe,{artists:p,profile:o,setSelectedArtist:x,setView:a,onDone:i=>_e(i==="started"?"started_generation":"skipped")})}),Ne]}),e.jsx("div",{ref:A,className:`dashboard-main-scroll flex-1 min-h-0 ${t==="studio"&&n?"overflow-hidden":t==="genie"?"overflow-hidden pb-mobile-nav md:pb-0":"overflow-y-auto pb-mobile-nav md:pb-0"}`,onClick:()=>S&&N(!1),children:e.jsx(r.Suspense,{fallback:e.jsx(dt,{}),children:e.jsx(e.Fragment,{children:t==="studio"&&n?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"h-full min-h-0",children:l?e.jsx($e,{artist:n,artists:p,countries:d,nativeApp:s,initialMode:ue,onInitialModeApplied:q,onGenerated:E,initialOutput:R,initialQualityVersion:me,clearInitialOutput:ge,onNavigate:a,onSelectArtist:g,suppressInlineMissionPanel:B,onExploreLyricists:()=>{x(null),a("studio")}}):e.jsx(f,{setView:a})},"s"):t==="studio"?e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"h-full min-h-0",children:e.jsx(re,{artists:p,onNavigate:a,onCreateLyricist:()=>a("custom-lyricist"),onArtistUpdated:i=>{j(u=>u.map(h=>h.id===i.id?{...h,...i}:h))},onArtistDeleted:i=>{j(u=>u.filter(h=>h.id!==i)),(n==null?void 0:n.id)===i&&x(null)},onSelectArtist:i=>{y("welcome_artist_card_clicked",{artist_id:i==null?void 0:i.id,artist_slug:i==null?void 0:i.slug,artist_source:(i==null?void 0:i.source_type)||"official"}),g?g(i):(x(i),a("studio"))}})},je==="skipped"?"w-skipped":"w"):t==="pricing"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(Oe,{plans:T,plansLoading:w,plansLoadError:D,onRetryPlans:$})},"p"):t==="add-artist"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(Se,{countries:d,artists:p,setArtists:j,onBack:a,onSelectArtist:i=>{g?g(i):(x(i),a("studio"))}}):e.jsx(f,{setView:a})},"a"):t==="custom-lyricist"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"h-full",children:l?e.jsx(Fe,{artists:p,onBack:a,onCreated:i=>{j(u=>[i,...u.filter(h=>h.id!==i.id)]),x(i),a("studio")}}):e.jsx(f,{setView:a})},"cl"):t==="feed"?e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},children:e.jsx(Me,{artists:p})},"f"):t==="forum"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(at,{embedded:!0})},"disc"):t==="generate"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full min-w-0 overflow-x-hidden",children:l?e.jsx(it,{artists:p,countries:d,setView:a,initialSection:he,onInitialSectionApplied:q,onGenerated:E,pendingSongDraft:xe,onPendingSongDraftGenerated:pe}):e.jsx(f,{setView:a})},"generate"):t==="feats"?l?e.jsx(Ze,{},l.id):e.jsx(f,{setView:a}):t==="research"||t==="people"||t==="games"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(Ue,{onNavigate:a}):e.jsx(f,{setView:a})},"research"):t==="library"||t==="studio-match"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(le,{setView:a,history:O,artists:p,onSelectHistory:H}):e.jsx(f,{setView:a})},"library"):t==="discover"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full min-w-0 overflow-x-hidden",children:e.jsx(Qe,{onNavigate:a})},"discover"):t==="tools"||String(t).startsWith("tool:")?e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"w-full min-w-0",children:l?e.jsx(et,{slug:String(t).startsWith("tool:")?String(t).slice(5):null,onNavigate:a}):e.jsx(f,{setView:a})},t):t==="lyrics"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(le,{setView:a,history:O,artists:p,onSelectHistory:H,initialTab:"lyrics"}):e.jsx(f,{setView:a})},"lyrics"):t==="genie"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"h-full w-full min-w-0",children:l?e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"p-6 text-[12px] font-semibold text-slate-400",children:"Loading Genieâ¦"}),children:e.jsx(Je,{artists:p,setView:a})}):e.jsx(f,{setView:a})},"genie"):t==="dna"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full min-w-0",children:l?e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"p-6 text-[12px] font-semibold text-slate-400",children:"Loading your DNAâ¦"}),children:e.jsx(Ke,{user:l,profile:o,setView:a})}):e.jsx(f,{setView:a})},"dna"):t==="artists-gallery"?e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},children:e.jsx(re,{artists:p,onNavigate:a,onCreateLyricist:()=>a("custom-lyricist"),onArtistUpdated:i=>{j(u=>u.map(h=>h.id===i.id?{...h,...i}:h))},onArtistDeleted:i=>{j(u=>u.filter(h=>h.id!==i)),(n==null?void 0:n.id)===i&&x(null)},onSelectArtist:i=>{g?g(i):(x(i),a("studio"))}})},"artists-gallery"):t==="cards"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(We,{onNavigate:a})},"cards"):t==="leaderboard"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(Be,{})},"lb"):t==="rewards"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(Ge,{setView:a}):e.jsx(f,{setView:a})},"rewards"):t==="affiliates"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(tt,{}):e.jsx(f,{setView:a})},"aff"):t==="profile"?e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(Ae,{countries:d}):e.jsx(f,{setView:a})},"pr"):t==="settings"?e.jsx(c.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},children:l?e.jsx(Ve,{countries:d,setView:a}):e.jsx(f,{setView:a})},"set"):e.jsx(c.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(pt,{view:t,setView:a,setSelectedArtist:x})},"unknown")})})})]})}function pt({view:t,setView:a,setSelectedArtist:s}){return e.jsx("div",{className:"flex min-h-full items-center justify-center p-4 pb-24 md:pb-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-3xl border border-slate-200 bg-white p-5 text-center shadow-sm",children:[e.jsx("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-2xl bg-emerald-50 text-emerald-700",children:e.jsx(v,{className:"h-5 w-5"})}),e.jsx("h2",{className:"text-lg font-black text-slate-950",children:"Dashboard view not found"}),e.jsxs("p",{className:"mt-2 text-sm leading-6 text-slate-500",children:['View "',t,'" is not available right now. Studio is ready.']}),e.jsx("button",{onClick:()=>{s==null||s(null),a("studio")},className:"mt-4 rounded-2xl bg-emerald-400 px-5 py-3 text-sm font-black text-slate-950",children:"Open Studio"})]})})}function f({setView:t}){return e.jsx("div",{className:"h-full flex items-center justify-center p-6",children:e.jsxs("div",{className:"text-center max-w-xs",children:[e.jsx("div",{className:"text-3xl mb-3 opacity-30",children:"ð"}),e.jsx("h2",{className:"text-lg font-display font-bold text-gray-800 mb-1",children:"Sign in required"}),e.jsx("p",{className:"text-gray-400 text-xs mb-4",children:"Free users get 14 credits/month. Classic 1.0 costs 3."}),e.jsx("button",{onClick:()=>t("auth"),className:"btn-primary px-6 py-2.5 text-sm",children:"Sign In / Register"})]})})}export{Yt 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.