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A,mBA8DlJ,YAAU,EAAA,EAAA,eAMuD,KAAK,IA5FhFqE,GAAA,QAAAlE,EAESL,CAAW,EAFpB4B,EAAAlB,EAAAL,CAAA,MAFO","names":["showCreator","owner","href","onclick","tint","surface","trackView","$.prop","$$props","tracked","$.derived","avatarUrl","getAvatarUrl","locked","target","$.get","handleClick","recordAlbumClick","tintText","tintHoverBorder","tintGrad","a","root","div","$.child","AlbumCoverMedia","$$anchor","div_1","$.first_child","fragment_1","$.template_effect","$.set_class","$$render","consequent","alternate","span","$.sibling","node","node_1","span_1","root_3","text","$.reset","AI_MADE_LABEL","$.append","d","isAiAlbum","div_2","node_2","span_2","root_4","text_1","span_3","root_5","node_3","TokenCoin","span_4","root_6","consequent_3","alternate_1","span_5","text_3","div_3","div_4","div_5","root_7","DuelAvatar","node_5","span_6","UserBadge","node_6","div_6","root_8","span_7","root_9","b","span_8","root_10","albumCountLabel","consequent_5","alternate_2","consequent_4","alternate_3","$$node","$$action_arg","albumImpression","$.set_attribute","$.delegated"],"sources":["../../../../../../src/lib/components/album/AlbumCard.svelte"],"sourcesContent":["<script lang=\"ts\">\n\timport type { AlbumCard } from '$lib/types/album';\n\timport { albumCountLabel } from '$lib/types/album';\n\timport { AI_MADE_LABEL, isAiAlbum } from '$lib/types/album-tags';\n\timport { getAvatarUrl } from '$lib/avatar';\n\timport DuelAvatar from '$lib/components/duel/DuelAvatar.svelte';\n\timport TokenCoin from '$lib/components/TokenCoin.svelte';\n\timport UserBadge from '$lib/components/UserBadge.svelte';\n\timport AlbumCoverMedia from '$lib/components/album/AlbumCoverMedia.svelte';\n\timport { albumImpression, recordAlbumClick, type AlbumSurface } from '$lib/album-impressions';\n\n\tinterface Props {\n\t\t/** RAT-641: `gate` set = the cover is the server's blurred stand-in\n\t\t *  (coverUrl, or null for a plain tile) and taps on it ask for the age check. */\n\t\talbum: AlbumCard & { gate?: 'blur' | 'uploader' };\n\t\t/** Show the creator row (used on /r + feed where albums aren't already\n\t\t *  under a creator's profile). Off on the owner's own profile grid. */\n\t\tshowCreator?: boolean;\n\t\t/** Owner studio mode: show the album status (draft/published) instead of\n\t\t *  the unlock/price badge, and link to the editor by default. */\n\t\towner?: boolean;\n\t\t/** Link target override (studio points cards at the editor). */\n\t\thref?: string | undefined;\n\t\tonclick?: (() => void) | undefined;\n\t\t/** Chrome tint. Defaults to the fuchsia album brand; pass 'accent' to\n\t\t *  follow the host page's themed accent (e.g. green on /r raters), or\n\t\t *  'neutral' for no hue at all (the signup-first landing keeps to two\n\t\t *  accents, coral and token gold). */\n\t\ttint?: 'fuchsia' | 'accent' | 'neutral';\n\t\t/** RAT-449: funnel tracking. When set, the card carries ?src=<surface> into\n\t\t *  the album link + records a click. `trackView` also counts a real-visibility\n\t\t *  impression (off where the page records impressions itself, e.g. profile\n\t\t *  counts every visit rather than card-scroll). No tracking in owner mode. */\n\t\tsurface?: AlbumSurface | undefined;\n\t\ttrackView?: boolean;\n\t}\n\n\tlet {\n\t\talbum,\n\t\tshowCreator = false,\n\t\towner = false,\n\t\thref = undefined,\n\t\tonclick = undefined,\n\t\ttint = 'fuchsia',\n\t\tsurface = undefined,\n\t\ttrackView = true\n\t}: Props = $props();\n\n\tconst tracked = $derived(!!surface && !owner);\n\n\tconst avatarUrl = $derived(getAvatarUrl(album.creator.avatarPath));\n\t// Locked = priced content the viewer hasn't unlocked (and isn't the owner).\n\tconst locked = $derived(!album.unlocked);\n\tconst target = $derived(\n\t\thref ??\n\t\t\t(owner\n\t\t\t\t? `/album/${album.id}/edit`\n\t\t\t\t: `/album/${album.id}${tracked ? `?src=${surface}` : ''}`)\n\t);\n\tfunction handleClick() {\n\t\tif (tracked) recordAlbumClick(album.id, surface!);\n\t\tonclick?.();\n\t}\n\n\t// Tint class fragments — full literal strings so Tailwind's scanner keeps them.\n\tconst tintText = $derived(\n\t\ttint === 'accent' ? 'text-accent' : tint === 'neutral' ? 'text-text' : 'text-fuchsia'\n\t);\n\tconst tintHoverBorder = $derived(\n\t\ttint === 'accent'\n\t\t\t? 'hover:border-accent/45'\n\t\t\t: tint === 'neutral'\n\t\t\t\t? 'hover:border-muted/60'\n\t\t\t\t: 'hover:border-fuchsia/40'\n\t);\n\tconst tintGrad = $derived(\n\t\ttint === 'accent' ? 'from-accent/25' : tint === 'neutral' ? 'from-white/5' : 'from-fuchsia/25'\n\t);\n</script>\n\n<a\n\thref={target}\n\tonclick={handleClick}\n\tuse:albumImpression={tracked && trackView ? { albumId: album.id, surface: surface! } : undefined}\n\tclass=\"album-card group flex h-full flex-col overflow-hidden rounded-xl border border-border bg-surface no-underline transition-colors {tintHoverBorder}\"\n>\n\t<div class=\"relative aspect-square shrink-0 overflow-hidden bg-bg\">\n\t\t{#if album.gate || album.coverUrl}\n\t\t\t<AlbumCoverMedia\n\t\t\t\turl={album.coverUrl}\n\t\t\t\tkind={album.coverKind}\n\t\t\t\tposterUrl={album.coverPosterUrl}\n\t\t\t\timgClass=\"absolute inset-0 h-full w-full object-cover transition-transform duration-700 group-hover:scale-[1.04]\"\n\t\t\t\tgate={album.gate}\n\t\t\t/>\n\t\t{:else}\n\t\t\t<div class=\"absolute inset-0 bg-gradient-to-br {tintGrad} to-bg/0\"></div>\n\t\t\t<div\n\t\t\t\tclass=\"absolute inset-0 bg-[radial-gradient(circle_at_30%_25%,rgba(255,255,255,0.05),transparent_55%)]\"\n\t\t\t></div>\n\t\t{/if}\n\n\t\t<!-- top-left: ALBUM type tag -->\n\t\t<span\n\t\t\tclass=\"absolute top-2 left-2 inline-flex items-center gap-1 rounded bg-black/70 px-1.5 py-0.5 font-display text-[9px] font-bold tracking-[0.5px] {tintText} uppercase backdrop-blur-sm\"\n\t\t>\n\t\t\talbum\n\t\t</span>\n\t\t<!-- top-right: made with AI, said before the tap -->\n\t\t{#if isAiAlbum(album.tags)}\n\t\t\t<span\n\t\t\t\tclass=\"absolute top-2 right-2 inline-flex items-center rounded bg-black/70 px-1.5 py-0.5 font-display text-[9px] font-bold tracking-[0.5px] text-text uppercase backdrop-blur-sm\"\n\t\t\t>\n\t\t\t\t{AI_MADE_LABEL}\n\t\t\t</span>\n\t\t{/if}\n\n\t\t<!-- bottom overlay: price (locked) or unlocked badge -->\n\t\t<div\n\t\t\tclass=\"absolute inset-x-0 bottom-0 flex items-end justify-between gap-2 bg-gradient-to-t from-black/65 to-transparent p-2\"\n\t\t>\n\t\t\t{#if owner}\n\t\t\t\t<span\n\t\t\t\t\tclass=\"inline-flex items-center gap-1 rounded bg-black/75 px-1.5 py-1 font-display text-[10px] font-bold tracking-tight backdrop-blur-sm {album.status ===\n\t\t\t\t\t'published'\n\t\t\t\t\t\t? tintText\n\t\t\t\t\t\t: album.status === 'draft'\n\t\t\t\t\t\t\t? 'text-yellow'\n\t\t\t\t\t\t\t: 'text-muted'}\"\n\t\t\t\t>\n\t\t\t\t\t{album.status}\n\t\t\t\t</span>\n\t\t\t{:else if locked}\n\t\t\t\t<span\n\t\t\t\t\tclass=\"inline-flex items-center gap-1 rounded bg-black/40 px-1.5 py-1 font-display text-[10px] font-bold tracking-tight text-text backdrop-blur-md\"\n\t\t\t\t>\n\t\t\t\t\t<TokenCoin size={12} />\n\t\t\t\t\t{album.priceTokens}\n\t\t\t\t</span>\n\t\t\t{:else}\n\t\t\t\t<span\n\t\t\t\t\tclass=\"inline-flex items-center gap-1 rounded bg-black/40 px-1.5 py-1 font-display text-[10px] font-bold tracking-tight {tintText} backdrop-blur-md\"\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"h-3 w-3\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"3\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M20 6 9 17l-5-5\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\tunlocked\n\t\t\t\t</span>\n\t\t\t{/if}\n\t\t\t<span\n\t\t\t\tclass=\"inline-flex items-center gap-1 rounded bg-black/40 px-1.5 py-1 font-display text-[10px] font-semibold text-text/90 tabular-nums backdrop-blur-md\"\n\t\t\t>\n\t\t\t\t<svg class=\"h-3 w-3\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M21 3H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm-1 14.59-3.29-3.3a1 1 0 0 0-1.42 0L13 17.59l-4.29-4.3a1 1 0 0 0-1.42 0L4 16.59V5h16zM8 11a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t{album.photoCount}\n\t\t\t</span>\n\t\t</div>\n\t</div>\n\n\t<div class=\"flex flex-1 flex-col px-3 pt-2 pb-3\">\n\t\t<div class=\"truncate font-display text-sm font-semibold text-text\">{album.title}</div>\n\n\t\t{#if showCreator}\n\t\t\t<div class=\"mt-2 flex items-center gap-1.5\">\n\t\t\t\t<DuelAvatar nickname={album.creator.nickname} {avatarUrl} size={18} link={false} />\n\t\t\t\t<span class=\"truncate text-[11px] text-muted\">@{album.creator.nickname ?? 'creator'}</span>\n\t\t\t\t<UserBadge rater={album.creator.isRater} creator={album.creator.isCreator} verified={album.creator.isVerified} subscriber={album.creator.isSubscriber} size={12} />\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<div class=\"mt-auto pt-2 text-[10.5px] text-muted\">\n\t\t\t\t{#if album.unlockCount > 0}\n\t\t\t\t\t<span><b class=\"font-semibold text-text\">{album.unlockCount}</b> unlocked</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span>{albumCountLabel(album)}</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t</div>\n</a>\n"],"version":3}