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D","names":["BUNDLE_DISCOUNT_PCT","BUNDLE_MIN_ALBUMS","sum","xs","n","x","bundlePrice","prices","busy","hidden","error","div","root","div_1","$.child","div_2","div_3","span","div_4","root_1","div_5","root_2","$$render","consequent","alternate","button","$.sibling","node_1","consequent_1","$$props","consequent_2","alternate_1","$.reset","classes","$.set_class","$.delegated","$$args","bundleOffer","label","$.noop","$.first_child","fragment_3","p_1","p_2","s_1","text_4","p_3","root_5","bundleError","$.set_text","text_1","$.get","bundle","text_2","text_3","bundling","unlockBundle","album","$.state","$.proxy","tokens","$.user_effect","$.set","unlocking","showBuy","errorMsg","copied","albumUrl","avatarUrl","getAvatarUrl","visiblePhotos","$.derived","p","lockedCount","canAfford","videoCount","mediaNoun","rating","heroClip","heroRatio","spoke","sphSpokeFor","isAi","lockedClips","videoJsonLd","jsonLdScript","SITE_URL","isoDuration","redditHref","fmtDur","sec","m","s","blurFailed","SvelteSet","onMount","activeMode","showBar","boxInView","watchBoxButton","node","io","entry","unlock","surface","trackAlbumUnlockTap","hitSignInGate","RESUME_ALBUM_UNLOCK","buyFor","src","$page","res","body","gateResumed","untrack","consumeResume","trackAuthGateResumed","finishing","bundleAlbums","a","bundleDone","need","buyReason","buySuccessPath","fromTap","trackAlbumBundleTap","count","invalidateAll","q","forAlbum","forBundle","tick","clean","replaceState","done","ready","stopped","start","late","r","messageCreator","nick","saveDmPrefill","goto","resolve","shareAlbum","copyLink","justPublished","pushState","pushPermission","turnOnPush","enablePush","tips","out","lightboxIndex","lightboxPhoto","autoplayMuted","play","lightboxVideoEl","videoState","autoRecovered","resignLightboxVideo","onVideoState","state","reason","trackVideoLoadError","id","retryLightboxVideo","openLightbox","url","idx","closeLightbox","step","dir","onKey","$.head","$$anchor","main","fragment_4","header","nav","a_1","fragment_5","text_6","a_2","root_7","consequent_3","h1","text_7","a_3","node_6","DuelAvatar","span_1","span_2","root_8","text_10","$.append","span_3","root_9","$.template_effect","text_11","consequent_4","root_10","p_4","root_11","text_12","consequent_5","p_5","node_9","span_4","root_12","consequent_6","span_5","root_13","text_13","consequent_7","span_6","node_11","text_14","consequent_8","figure","root_14","video","figcaption","span_7","button_1","root_15","node_14","text_16","$0","text_17","consequent_9","alternate_2","consequent_10","$.set_attribute","styles","$.set_style","consequent_11","div_6","node_12","div_7","photo","button_2","root_19","node_16","img","root_21","video_1","root_22","consequent_12","alternate_3","span_8","root_23","text_18","img_1","root_24","consequent_14","alternate_4","span_9","root_25","consequent_15","div_8","root_26","node_20","img_2","fragment_10","$.event","$.replay_events","span_10","root_28","text_19","consequent_18","span_11","root_29","text_20","consequent_19","consequent_16","alternate_5","aside","node_23","div_9","root_30","a_4","node_24","div_10","div_11","div_12","root_31","text_22","div_13","root_32","consequent_20","alternate_6","div_14","span_12","text_23","span_13","p_6","root_33","consequent_21","div_15","root_34","button_3","root_35","node_28","alternate_7","consequent_24","$.action","$$node","consequent_22","alternate_8","p_7","root_39","consequent_25","consequent_26","p_8","root_41","b_1","consequent_27","div_16","node_31","line","div_17","root_42","span_14","div_18","root_43","span_15","b_2","button_4","consequent_28","text_21","text_24","section","root_45","p_9","button_5","button_6","text_32","node_34","div_19","root_46","button_7","p_10","root_47","text_33","consequent_30","alternate_9","payoutUsd","consequent_31","section_1","node_33","div_20","span_16","text_34","div_21","div_22","p_11","p_12","div_23","p_13","p_14","b_3","text_38","a_5","section_2","root_49","button_8","a_6","div_24","span_17","button_9","text_41","consequent_32","section_3","root_50","ul","tip","li","root_51","b_4","span_18","text_42","text_43","consequent_33","section_4","root_52","h3","p_15","a_7","text_46","text_44","consequent_34","alternate_10","text_35","text_36","div_25","root_53","p_16","root_54","text_47","consequent_36","button_10","node_38","text_48","p_17","p_18","root_56","consequent_37","alternate_11","consequent_38","div_26","root_58","div_27","p_19","a_8","div_28","a_9","root_59","div_29","img_3","root_60","consequent_39","p_20","text_51","consequent_40","text_49","consequent_35","consequent_41","consequent_29","div_30","root_61","ReportTrigger","node_44","consequent_42","p_21","a_10","root_62","text_52","consequent_43","a_11","root_63","consequent_44","div_31","root_64","button_11","$.key","node_49","div_32","root_66","video_2","$$value","$$action_arg","videoLoadGuard","node_50","div_33","root_67","button_12","consequent_45","img_4","root_68","consequent_46","alternate_12","button_13","fragment_18","button_14","consequent_47","button_15","node_51","consequent_48","AlbumUnlockBar","consequent_49","BuyTokensModal","node_53","text_8","text_9"],"sources":["../../../../../../src/lib/album-bundle.ts","../../../../../../src/lib/components/album/AlbumUnlockBar.svelte","../../../../../../src/routes/album/[id]/+page.svelte"],"sourcesContent":["/**\n * All of a creator's albums in one purchase: the ones a buyer hasn't unlocked\n * yet, 20% off together. Client-safe, so the album page shows exactly the\n * price the server charges (and the server refuses a price that has changed).\n */\n\nexport const BUNDLE_DISCOUNT_PCT = 20;\n/** Fewer albums than this left to unlock, and there is no bundle. */\nexport const BUNDLE_MIN_ALBUMS = 2;\n\nconst sum = (xs: number[]) => xs.reduce((n, x) => n + x, 0);\n\n/** The bundle's price: the albums' own prices together, 20% off, rounded down. */\nexport function bundlePrice(prices: number[]): number {\n\treturn Math.floor((sum(prices) * (100 - BUNDLE_DISCOUNT_PCT)) / 100);\n}\n\n/**\n * Splits `total` over the albums in proportion to their own prices, in whole\n * tokens that add up to exactly `total` (largest remainder; a tie goes to the\n * earlier album). Each album's unlock row records its share as the price paid,\n * so per-album earnings still add up to what the buyer was charged.\n */\nexport function allocateBundle(prices: number[], total: number): number[] {\n\tif (prices.length === 0) return [];\n\tconst full = sum(prices);\n\tconst exact = prices.map((p) => (full > 0 ? (p * total) / full : total / prices.length));\n\tconst out = exact.map((x) => Math.floor(x));\n\tlet left = total - sum(out);\n\tconst byRemainder = exact\n\t\t.map((x, i) => ({ i, r: x - Math.floor(x) }))\n\t\t.sort((a, b) => b.r - a.r || a.i - b.i);\n\tfor (const { i } of byRemainder) {\n\t\tif (left <= 0) break;\n\t\tout[i] += 1;\n\t\tleft -= 1;\n\t}\n\treturn out;\n}\n","<script lang=\"ts\">\n\t/**\n\t * RAT-517: the phone's unlock bar on an album page.\n\t *\n\t * A small card floating just above the bottom nav: what it costs on the\n\t * left, one action on the right. It is the buy box's own button in a place\n\t * the thumb can reach — the same `onunlock`, so signing in, the token sheet\n\t * and the purchase all behave exactly as they do there. Phones only\n\t * (md:hidden, the bottom nav's breakpoint); `hidden` slides it away while the\n\t * buy box itself is on screen, so the page never shows two of the same\n\t * button at once. A failed unlock says so here, where it was pressed.\n\t */\n\tlet {\n\t\tpriceTokens,\n\t\tcount,\n\t\tnoun,\n\t\tsignedIn,\n\t\tbusy = false,\n\t\thidden = false,\n\t\terror = null,\n\t\tonunlock\n\t}: {\n\t\tpriceTokens: number;\n\t\tcount: number;\n\t\tnoun: string;\n\t\tsignedIn: boolean;\n\t\tbusy?: boolean;\n\t\thidden?: boolean;\n\t\terror?: string | null;\n\t\tonunlock: () => void;\n\t} = $props();\n</script>\n\n<div class=\"unlock-bar fixed inset-x-0 z-40 px-3 md:hidden\" class:is-hidden={hidden} inert={hidden}>\n\t<div\n\t\tclass=\"mx-auto flex max-w-md items-center gap-3 rounded-2xl border border-border bg-surface py-2.5 pr-2.5 pl-4 shadow-[0_10px_30px_rgba(0,0,0,0.45)]\"\n\t>\n\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t<div class=\"flex items-baseline gap-1.5\">\n\t\t\t\t<span class=\"font-display text-[19px] leading-none font-bold tracking-tight text-yellow\"\n\t\t\t\t\t>{priceTokens}</span\n\t\t\t\t>\n\t\t\t\t<span class=\"text-[12px] font-semibold text-muted\">tokens</span>\n\t\t\t</div>\n\t\t\t{#if error}\n\t\t\t\t<div class=\"mt-1 truncate text-[12px] font-medium text-coral\" role=\"alert\">{error}</div>\n\t\t\t{:else}\n\t\t\t\t<div class=\"mt-1 truncate text-[12px] text-muted\">all {count} {noun}, yours to keep</div>\n\t\t\t{/if}\n\t\t</div>\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonclick={onunlock}\n\t\t\tdisabled={busy}\n\t\t\tclass=\"flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-xl bg-yellow px-5 py-3 font-display text-[15px] font-bold tracking-tight text-black transition-colors hover:bg-yellow/85 active:scale-[0.98] disabled:opacity-50\"\n\t\t>\n\t\t\t{#if busy}\n\t\t\t\tunlocking…\n\t\t\t{:else if signedIn}\n\t\t\t\t<svg class=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"\n\t\t\t\t\t><path\n\t\t\t\t\t\td=\"M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm3 8H9V6a3 3 0 0 1 6 0v3z\"\n\t\t\t\t\t/></svg\n\t\t\t\t>\n\t\t\t\tunlock\n\t\t\t{:else}\n\t\t\t\tsign in to unlock\n\t\t\t{/if}\n\t\t</button>\n\t</div>\n</div>\n\n<style>\n\t/* Sits on the bottom nav with a small breath: the nav is 68px of body plus\n\t   its 1px border plus the home-indicator inset (BottomNav.svelte). Solid, not\n\t   frosted: touch devices drop every backdrop blur (layout.css, RAT-38). */\n\t.unlock-bar {\n\t\tbottom: calc(env(safe-area-inset-bottom, 0px) + 77px);\n\t\ttransition:\n\t\t\ttransform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),\n\t\t\topacity 220ms ease;\n\t}\n\t/* Down behind the nav rather than off the page, so coming back is a short,\n\t   quiet move — and never a layout change. */\n\t.unlock-bar.is-hidden {\n\t\ttransform: translateY(calc(100% + 24px));\n\t\topacity: 0;\n\t\tpointer-events: none;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.unlock-bar {\n\t\t\ttransition: opacity 150ms linear;\n\t\t}\n\t\t.unlock-bar.is-hidden {\n\t\t\ttransform: none;\n\t\t}\n\t}\n</style>\n","<script lang=\"ts\">\n\timport { onMount, tick, untrack } from 'svelte';\n\timport { SvelteSet } from 'svelte/reactivity';\n\timport { goto, invalidateAll, replaceState } from '$app/navigation';\n\timport { resolve } from '$app/paths';\n\timport { saveDmPrefill } from '$lib/album-next';\n\timport { page } from '$app/stores';\n\timport { videoLoadGuard, type VideoLoadState } from '$lib/actions/video-load-guard';\n\timport {\n\t\ttrackAlbumBundleTap,\n\t\ttrackAlbumUnlockTap,\n\t\ttrackAuthGateResumed,\n\t\ttrackVideoLoadError\n\t} from '$lib/analytics';\n\timport { bundlePrice, BUNDLE_MIN_ALBUMS } from '$lib/album-bundle';\n\timport { hitSignInGate, RESUME_ALBUM_UNLOCK } from '$lib/contextual-sign-in';\n\timport { consumeResume } from '$lib/oauth-resume';\n\timport { activeMode } from '$lib/stores/activeMode';\n\timport { getAvatarUrl } from '$lib/avatar';\n\timport DuelAvatar from '$lib/components/duel/DuelAvatar.svelte';\n\timport BuyTokensModal from '$lib/components/BuyTokensModal.svelte';\n\timport ReportTrigger from '$lib/components/ReportTrigger.svelte';\n\timport AlbumUnlockBar from '$lib/components/album/AlbumUnlockBar.svelte';\n\timport { isoDuration, sphSpokeFor } from '$lib/album-watch';\n\timport { payoutUsd } from '$lib/payout-rate';\n\timport { pushPermission, enablePush, type PushPermission } from '$lib/push-client';\n\timport { jsonLdScript, SITE_URL } from '$lib/seo';\n\timport type { AlbumDetail } from '$lib/types/album';\n\timport type { PageData } from './$types';\n\n\tlet { data }: { data: PageData } = $props();\n\n\t// Seed local state from data, resync on reload (Svelte 5 + invalidateAll\n\t// canonical pattern — locals decoupled from props go stale otherwise).\n\tlet album = $state<AlbumDetail>(data.album);\n\tlet tokens = $state(data.tokens);\n\t$effect(() => {\n\t\talbum = data.album;\n\t\ttokens = data.tokens;\n\t});\n\n\tlet unlocking = $state(false);\n\tlet showBuy = $state(false);\n\tlet errorMsg = $state<string | null>(null);\n\tlet copied = $state(false);\n\tlet albumUrl = $state('');\n\n\tconst avatarUrl = $derived(getAvatarUrl(album.creator.avatarPath));\n\tconst visiblePhotos = $derived(album.photos.filter((p) => p.url));\n\tconst lockedCount = $derived(album.photoCount - visiblePhotos.length);\n\tconst canAfford = $derived(tokens >= album.priceTokens);\n\t// Album content may be photos, video clips, or a mix — label the count so an\n\t// all-video set doesn't read as \"3 photos\".\n\tconst videoCount = $derived(album.photos.filter((p) => p.kind === 'video').length);\n\tfunction mediaNoun(n: number): string {\n\t\tif (videoCount === 0) return n === 1 ? 'photo' : 'photos';\n\t\tif (videoCount >= album.photoCount) return n === 1 ? 'clip' : 'clips';\n\t\treturn n === 1 ? 'item' : 'items';\n\t}\n\tconst rating = $derived(data.creatorRating);\n\n\t// RAT-618: the free preview clip leads the page for anyone who hasn't\n\t// unlocked, with the album's own words and the price right under it.\n\tconst heroClip = $derived(\n\t\t!album.unlocked ? (album.photos.find((p) => p.kind === 'video' && p.url) ?? null) : null\n\t);\n\t// The clip's own shape, at most three quarters of the screen tall: most\n\t// previews are filmed upright, and a 16:9 box shrank them to a strip.\n\tconst heroRatio = $derived(\n\t\theroClip?.width && heroClip.height ? heroClip.width / heroClip.height : 9 / 16\n\t);\n\tconst spoke = $derived(sphSpokeFor(album.tags));\n\tconst isAi = $derived(album.tags.includes('ai'));\n\tconst lockedClips = $derived(album.photos.filter((p) => p.kind === 'video' && p.locked).length);\n\tconst videoJsonLd = $derived(\n\t\tdata.watch.indexable && data.watch.hasPoster\n\t\t\t? jsonLdScript({\n\t\t\t\t\t'@context': 'https://schema.org',\n\t\t\t\t\t'@type': 'VideoObject',\n\t\t\t\t\tname: album.title,\n\t\t\t\t\tdescription: album.description,\n\t\t\t\t\tthumbnailUrl: [`${SITE_URL}/album/${album.id}/poster.jpg`],\n\t\t\t\t\tuploadDate: album.publishedAt ?? album.createdAt,\n\t\t\t\t\t...(data.watch.previewSec ? { duration: isoDuration(data.watch.previewSec) } : {}),\n\t\t\t\t\tcontentUrl: `${SITE_URL}/album/${album.id}/preview.mp4`,\n\t\t\t\t\tisFamilyFriendly: false,\n\t\t\t\t\tisAccessibleForFree: true,\n\t\t\t\t\tauthor: { '@type': 'Person', name: `@${album.creator.nickname ?? 'creator'}` }\n\t\t\t\t})\n\t\t\t: ''\n\t);\n\tconst redditHref = $derived(\n\t\t`https://www.reddit.com/submit?url=${encodeURIComponent(albumUrl)}&title=${encodeURIComponent(album.title)}`\n\t);\n\n\tfunction fmtDur(sec: number | null): string {\n\t\tif (!sec || sec < 1) return '';\n\t\tconst m = Math.floor(sec / 60);\n\t\tconst s = sec % 60;\n\t\treturn `${m}:${String(s).padStart(2, '0')}`;\n\t}\n\n\t// Locked tiles whose blurred stand-in didn't load keep the plain lock.\n\tconst blurFailed = new SvelteSet<string>();\n\n\tonMount(() => {\n\t\tactiveMode.set('albums');\n\t\talbumUrl = `${location.origin}/album/${album.id}`;\n\t\treturn () => activeMode.set(null);\n\t});\n\n\t// RAT-517: the phone's sticky unlock bar (hidden from md up by its own CSS).\n\t// It stands in for the buy box's button while that button is out of reach,\n\t// and steps aside once it has cleared the bar and the nav at the bottom of\n\t// the screen.\n\tconst showBar = $derived(!album.unlocked && !album.isOwner);\n\tlet boxInView = $state(false);\n\t/** Whether the buy box's button is on screen: above the bottom 160px, where\n\t *  the bar and the nav would cover it. */\n\tfunction watchBoxButton(node: HTMLElement) {\n\t\tif (typeof IntersectionObserver === 'undefined') return;\n\t\tconst io = new IntersectionObserver(([entry]) => (boxInView = entry.isIntersecting), {\n\t\t\trootMargin: '0px 0px -160px 0px'\n\t\t});\n\t\tio.observe(node);\n\t\treturn {\n\t\t\tdestroy() {\n\t\t\t\tio.disconnect();\n\t\t\t\tboxInView = false;\n\t\t\t}\n\t\t};\n\t}\n\n\t/** `surface` is where the tap came from; null is the unlock carried out after\n\t *  sign-in (RAT-519), whose tap was logged before it. */\n\tasync function unlock(surface: 'box' | 'bar' | 'player' | null) {\n\t\terrorMsg = null;\n\t\tif (surface) {\n\t\t\ttrackAlbumUnlockTap({\n\t\t\t\talbumId: album.id,\n\t\t\t\tsurface,\n\t\t\t\tsignedIn: data.isLoggedIn,\n\t\t\t\tcanAfford\n\t\t\t});\n\t\t}\n\t\tif (!data.isLoggedIn) {\n\t\t\t// RAT-519: sign in right here; the unlock goes through once they're in.\n\t\t\thitSignInGate({\n\t\t\t\tsurface: 'album_unlock',\n\t\t\t\tnext: `/album/${album.id}`,\n\t\t\t\tcontext: {\n\t\t\t\t\ttitle: `unlock “${album.title}”`,\n\t\t\t\t\tdetail: `${album.priceTokens} tokens · all ${album.photoCount} ${mediaNoun(album.photoCount)}, yours to keep`,\n\t\t\t\t\timageUrl: avatarUrl\n\t\t\t\t},\n\t\t\t\tresume: { key: RESUME_ALBUM_UNLOCK, payload: { albumId: album.id } }\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!canAfford) {\n\t\t\tbuyFor = 'album';\n\t\t\tshowBuy = true;\n\t\t\treturn;\n\t\t}\n\t\tif (unlocking) return;\n\t\tunlocking = true;\n\t\ttry {\n\t\t\t// RAT-449: carry the arrival surface (?src=feed/browse/arena from the\n\t\t\t// card link) into the purchase so revenue attributes to the right slot.\n\t\t\tconst src = $page.url.searchParams.get('src');\n\t\t\tconst res = await fetch(`/api/album/${album.id}/unlock`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ src })\n\t\t\t});\n\t\t\tif (res.status === 402) {\n\t\t\t\tbuyFor = 'album';\n\t\t\t\tshowBuy = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) {\n\t\t\t\terrorMsg = 'could not unlock — try again';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst body = (await res.json()) as { ok: boolean; album: AlbumDetail };\n\t\t\talbum = body.album;\n\t\t\ttokens = Math.max(0, tokens - body.album.priceTokens);\n\t\t} catch {\n\t\t\terrorMsg = 'network error — try again';\n\t\t} finally {\n\t\t\tunlocking = false;\n\t\t}\n\t}\n\n\t// RAT-519: back from signing in at this album's unlock gate — finish the\n\t// unlock they asked for (a new account short of tokens gets the token sheet,\n\t// as a tap would). Once per page; an entry for another album is dropped.\n\tlet gateResumed = false;\n\t$effect(() => {\n\t\tif (!data.isLoggedIn || gateResumed) return;\n\t\tgateResumed = true;\n\t\tuntrack(() => {\n\t\t\tconst r = consumeResume<{ albumId?: string }>(RESUME_ALBUM_UNLOCK);\n\t\t\tif (r?.albumId !== album.id || album.unlocked) return;\n\t\t\ttrackAuthGateResumed({ surface: 'album_unlock' });\n\t\t\tvoid unlock(null);\n\t\t});\n\t});\n\n\t// ─── RAT-534 (album-next) ─────────────────────────────────────────────────\n\t// Short on tokens, unlock opens the token packs — the same ones /pricing\n\t// lists — and the unlock finishes on the way back from checkout, no second\n\t// press. The creator bundle below works the same way.\n\tlet finishing = $state<'idle' | 'waiting' | 'late'>('idle');\n\n\t// ── Creator bundle: every album by this creator the buyer can still unlock,\n\t// 20% off together. Priced by $lib/album-bundle, the same function the\n\t// server charges with, and the server refuses a price that has changed.\n\tconst bundleAlbums = $derived(\n\t\t(data.bundle?.albums ?? []).filter((a) => !(a.id === album.id && album.unlocked))\n\t);\n\tconst bundle = $derived.by(() => {\n\t\tif (bundleAlbums.length < BUNDLE_MIN_ALBUMS) return null;\n\t\tconst prices = bundleAlbums.map((a) => a.priceTokens);\n\t\treturn {\n\t\t\tcount: bundleAlbums.length,\n\t\t\tfull: prices.reduce((n, p) => n + p, 0),\n\t\t\tprice: bundlePrice(prices),\n\t\t\twithThis: bundleAlbums.some((a) => a.id === album.id)\n\t\t};\n\t});\n\tlet bundling = $state(false);\n\tlet bundleError = $state<string | null>(null);\n\tlet bundleDone = $state(0);\n\t// what the token sheet is topping up for\n\tlet buyFor = $state<'album' | 'bundle'>('album');\n\n\tconst need = $derived(\n\t\tMath.max(0, (buyFor === 'bundle' && bundle ? bundle.price : album.priceTokens) - tokens)\n\t);\n\tconst buyReason = $derived(\n\t\tneed === 0\n\t\t\t? null\n\t\t\t: buyFor === 'bundle' && bundle\n\t\t\t\t? `you need ${need} more tokens for all ${bundle.count} albums`\n\t\t\t\t: `you need ${need} more tokens for this album`\n\t);\n\t// ?bundle= carries the price it was bought for, so the purchase never\n\t// finishes at a price the buyer wasn't shown.\n\tconst buySuccessPath = $derived(\n\t\tbuyFor === 'bundle' && bundle\n\t\t\t? `/album/${album.id}?bundle=${bundle.price}`\n\t\t\t: `/album/${album.id}?unlock=1`\n\t);\n\n\tasync function unlockBundle(fromTap: boolean) {\n\t\tif (!bundle || !data.bundle || bundling) return;\n\t\tbundleError = null;\n\t\tif (fromTap) {\n\t\t\ttrackAlbumBundleTap({\n\t\t\t\talbumId: album.id,\n\t\t\t\tcount: bundle.count,\n\t\t\t\tpriceTokens: bundle.price,\n\t\t\t\tcanAfford: tokens >= bundle.price\n\t\t\t});\n\t\t}\n\t\tif (tokens < bundle.price) {\n\t\t\tbuyFor = 'bundle';\n\t\t\tshowBuy = true;\n\t\t\treturn;\n\t\t}\n\t\tbundling = true;\n\t\tconst count = bundle.count;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/album/bundle', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tcreatorId: data.bundle.creatorId,\n\t\t\t\t\texpectedTokens: bundle.price,\n\t\t\t\t\tsrc: $page.url.searchParams.get('src')\n\t\t\t\t})\n\t\t\t});\n\t\t\tif (res.status === 402) {\n\t\t\t\tbuyFor = 'bundle';\n\t\t\t\tshowBuy = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (res.status === 409) {\n\t\t\t\tbundleError = 'the albums changed since — here’s the new price';\n\t\t\t\tawait invalidateAll();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) {\n\t\t\t\tbundleError = 'could not unlock — try again';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait invalidateAll();\n\t\t\tbundleDone = count;\n\t\t} catch {\n\t\t\tbundleError = 'network error — try again';\n\t\t} finally {\n\t\t\tbundling = false;\n\t\t}\n\t}\n\n\t// Back from checkout: the tokens arrive by webhook a moment later, so wait\n\t// for them (up to 20 s, polling just the balance) and unlock without a\n\t// second press.\n\tonMount(() => {\n\t\tconst q = $page.url.searchParams;\n\t\tconst forAlbum = q.get('unlock') === '1';\n\t\tconst forBundle = q.has('bundle') ? Number(q.get('bundle')) : null;\n\t\tif (!data.isLoggedIn || (!forAlbum && forBundle == null)) return;\n\t\tvoid tick().then(() => {\n\t\t\tconst clean = new URL($page.url);\n\t\t\tclean.searchParams.delete('unlock');\n\t\t\tclean.searchParams.delete('bundle');\n\t\t\ttry {\n\t\t\t\t// The page's own address minus a parameter: nothing to resolve.\n\t\t\t\t// eslint-disable-next-line svelte/no-navigation-without-resolve\n\t\t\t\treplaceState(clean, {});\n\t\t\t} catch {\n\t\t\t\t// router not ready — the parameter stays, harmlessly\n\t\t\t}\n\t\t});\n\t\tconst done = () => (forBundle != null ? bundleDone > 0 || !bundle : album.unlocked);\n\t\t// a bundle whose price moved since is left for the buyer to tap again\n\t\tif (done() || (forBundle != null && bundle?.price !== forBundle)) return;\n\t\tconst ready = () => (forBundle != null ? tokens >= forBundle : canAfford);\n\t\tlet stopped = false;\n\t\tfinishing = 'waiting';\n\t\t(async () => {\n\t\t\t// 20 s at a brisk pace, then — \"on the way\" — every 5 s for two minutes.\n\t\t\tconst start = Date.now();\n\t\t\twhile (!stopped && !done() && Date.now() - start < 140_000) {\n\t\t\t\tif (ready()) {\n\t\t\t\t\tif (forBundle != null) await unlockBundle(false);\n\t\t\t\t\telse await unlock(null);\n\t\t\t\t\tif (done() || bundleError) break;\n\t\t\t\t}\n\t\t\t\tconst late = Date.now() - start >= 20_000;\n\t\t\t\tif (late && finishing === 'waiting') finishing = 'late';\n\t\t\t\tawait new Promise((r) => setTimeout(r, late ? 5000 : 1500));\n\t\t\t\ttry {\n\t\t\t\t\tconst r = await fetch('/api/tokens/balance');\n\t\t\t\t\tif (r.ok) tokens = ((await r.json()) as { tokens: number }).tokens;\n\t\t\t\t} catch {\n\t\t\t\t\t// try again on the next round\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!stopped && (done() || bundleError)) finishing = 'idle';\n\t\t})();\n\t\treturn () => {\n\t\t\tstopped = true;\n\t\t};\n\t});\n\n\t// Unlocked: the conversation, one tap away, first line already written.\n\tfunction messageCreator() {\n\t\tconst nick = album.creator.nickname;\n\t\tif (!nick) return;\n\t\tsaveDmPrefill(nick, `just unlocked “${album.title}” 🔥`);\n\t\t// eslint-disable-next-line svelte/no-navigation-without-resolve -- resolve()d; the query string defeats the rule\n\t\tgoto(`${resolve('/(chat)/c/[nickname]', { nickname: nick })}?from=album`);\n\t}\n\n\t// Share — navigator.share needs user activation, so it runs synchronously in\n\t// the click handler (no await before it on iOS Safari); clipboard fallback.\n\tfunction shareAlbum() {\n\t\tif (typeof navigator !== 'undefined' && navigator.share) {\n\t\t\tnavigator\n\t\t\t\t.share({ title: album.title, text: 'check out my album on ratemyd', url: albumUrl })\n\t\t\t\t.catch(() => {});\n\t\t\treturn;\n\t\t}\n\t\tcopyLink();\n\t}\n\tfunction copyLink() {\n\t\tnavigator.clipboard\n\t\t\t?.writeText(albumUrl)\n\t\t\t.then(() => {\n\t\t\t\tcopied = true;\n\t\t\t\tsetTimeout(() => (copied = false), 1800);\n\t\t\t})\n\t\t\t.catch(() => {});\n\t}\n\n\t// ── Owner ─────────────────────────────────────────────────────────────────\n\t// Straight from publishing (?published=1): the panel says it's live and\n\t// puts sharing first. Shown once; the parameter leaves the address.\n\tlet justPublished = $state(false);\n\tlet pushState = $state<PushPermission | 'asking'>('unsupported');\n\tonMount(() => {\n\t\tif (!album.isOwner || $page.url.searchParams.get('published') !== '1') return;\n\t\tjustPublished = album.status === 'published';\n\t\tpushState = pushPermission();\n\t\tvoid tick().then(() => {\n\t\t\tconst clean = new URL($page.url);\n\t\t\tclean.searchParams.delete('published');\n\t\t\ttry {\n\t\t\t\t// eslint-disable-next-line svelte/no-navigation-without-resolve\n\t\t\t\treplaceState(clean, {});\n\t\t\t} catch {\n\t\t\t\t// router not ready — the parameter stays, harmlessly\n\t\t\t}\n\t\t});\n\t});\n\t// Asks for permission inside the tap, as browsers require.\n\tasync function turnOnPush() {\n\t\tpushState = 'asking';\n\t\tpushState = await enablePush().catch((): PushPermission => 'default');\n\t}\n\n\t// Only the advice this album hasn't taken yet. Sold within 14 days of\n\t// publishing (2026-07-20..10-11): 2–3 free previews 53%, 0–1 33–39%; 15–20\n\t// tokens 60%, 10 or less 31–32% (above 30 sold less often but earned the\n\t// most per album, so pricier albums get no price advice).\n\tconst tips = $derived.by(() => {\n\t\tif (!album.isOwner) return [];\n\t\tconst out: { t: string; d: string }[] = [];\n\t\tconst free = album.photos.filter((p) => p.isPreview).length;\n\t\tif (free < 2 && album.photoCount >= 3)\n\t\t\tout.push({ t: 'Make 2–3 of them free', d: 'Albums with 2–3 free ones sold most often.' });\n\t\tif (album.priceTokens < 15)\n\t\t\tout.push({ t: 'Try 15–20 tokens', d: 'Albums at 15–20 sold twice as often as ones at 10.' });\n\t\tif (videoCount === 0)\n\t\t\tout.push({ t: 'Add a clip', d: 'Albums with a clip sell about a quarter more often.' });\n\t\treturn out;\n\t});\n\n\t// ── Lightbox ──────────────────────────────────────────────────────────────\n\tlet lightboxIndex = $state<number | null>(null);\n\tconst lightboxPhoto = $derived(\n\t\tlightboxIndex !== null ? (visiblePhotos[lightboxIndex] ?? null) : null\n\t);\n\t// Start playback the moment the lightbox opens so it's not tap-to-open then\n\t// tap-to-play. Muted-autoplay is the only kind allowed without a fresh\n\t// gesture; iOS checks the muted *attribute* (Svelte sets only the property),\n\t// so set it explicitly + retry on load events. Controls let the user unmute.\n\tfunction autoplayMuted(node: HTMLVideoElement) {\n\t\tnode.muted = true;\n\t\tnode.defaultMuted = true;\n\t\tnode.setAttribute('muted', '');\n\t\tconst play = () => node.play().catch(() => {});\n\t\tplay();\n\t\tnode.addEventListener('loadeddata', play, { once: true });\n\t\tnode.addEventListener('canplay', play, { once: true });\n\t}\n\t// Video load state — a stalled / dead clip used to sit on the native spinner\n\t// forever (this player had no error handling at all). The guard flips to\n\t// `error` on a hard error OR a load timeout; we then show an explicit retry.\n\tlet lightboxVideoEl = $state<HTMLVideoElement | null>(null);\n\tlet videoState = $state<VideoLoadState>('loading');\n\t// Auto-recover once per clip (parity with the chat player's re-sign-on-error);\n\t// bounded so a genuinely dead object doesn't loop invalidateAll forever.\n\tconst autoRecovered = new SvelteSet<string>();\n\n\tasync function resignLightboxVideo() {\n\t\t// Re-run the page load → server re-signs every visible URL; the fresh\n\t\t// signed URL lands in `data.album` and the $effect resyncs it, swapping the\n\t\t// <video> src (which reloads). Also force a reload for the transient case\n\t\t// where the URL is unchanged.\n\t\tawait invalidateAll();\n\t\tlightboxVideoEl?.load();\n\t}\n\tasync function onVideoState(state: VideoLoadState, reason?: 'error' | 'timeout') {\n\t\tvideoState = state;\n\t\tif (state !== 'error') return;\n\t\ttrackVideoLoadError('album', reason ?? 'error', 'lightbox');\n\t\tconst id = lightboxPhoto?.id;\n\t\tif (id && !autoRecovered.has(id)) {\n\t\t\tautoRecovered.add(id);\n\t\t\tawait resignLightboxVideo();\n\t\t}\n\t}\n\tasync function retryLightboxVideo() {\n\t\tvideoState = 'loading';\n\t\tawait resignLightboxVideo();\n\t}\n\n\tfunction openLightbox(url: string) {\n\t\tconst idx = visiblePhotos.findIndex((p) => p.url === url);\n\t\tif (idx >= 0) {\n\t\t\tvideoState = 'loading';\n\t\t\tlightboxIndex = idx;\n\t\t}\n\t}\n\tfunction closeLightbox() {\n\t\tlightboxIndex = null;\n\t}\n\tfunction step(dir: 1 | -1) {\n\t\tif (lightboxIndex === null) return;\n\t\tconst n = visiblePhotos.length;\n\t\tvideoState = 'loading';\n\t\tlightboxIndex = (lightboxIndex + dir + n) % n;\n\t}\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (lightboxIndex === null) return;\n\t\tif (e.key === 'Escape') closeLightbox();\n\t\telse if (e.key === 'ArrowRight') step(1);\n\t\telse if (e.key === 'ArrowLeft') step(-1);\n\t}\n</script>\n\n<!-- The title and robots tag come from data.seo (RAT-618): a watch page is\n     indexed under its own title, every other album stays noindex. -->\n<svelte:head>\n\t{#if videoJsonLd}\n\t\t{@html videoJsonLd}\n\t{/if}\n</svelte:head>\n\n<svelte:window onkeydown={onKey} />\n\n<main class=\"relative min-h-dvh pt-20 {showBar ? 'pb-44' : 'pb-28'} md:pt-24 md:pb-28\">\n\t<div class=\"mx-auto max-w-5xl px-5\">\n\t\t<!-- Header -->\n\t\t<header class=\"mb-6\">\n\t\t\t<nav aria-label=\"breadcrumb\" class=\"mb-3 font-mono text-[11px] tracking-[0.14em] text-muted uppercase\">\n\t\t\t\t{#if spoke}\n\t\t\t\t\t<a href=\"/sph\" class=\"text-muted no-underline hover:text-text\">SPH</a>\n\t\t\t\t\t<span aria-hidden=\"true\"> / </span>\n\t\t\t\t\t<a href={spoke.path} class=\"text-muted no-underline hover:text-text\">{spoke.name}</a>\n\t\t\t\t{:else}\n\t\t\t\t\t<a href=\"/albums\" class=\"text-muted no-underline hover:text-text\">albums</a>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\t\t\t<p\n\t\t\t\tclass=\"mb-2.5 font-display text-[11px] font-bold tracking-[0.28em] text-fuchsia/80 uppercase\"\n\t\t\t>\n\t\t\t\tpaid album\n\t\t\t</p>\n\t\t\t<h1\n\t\t\t\tclass=\"font-display text-[clamp(2rem,6vw,3.4rem)] leading-[0.95] font-bold tracking-tighter text-text\"\n\t\t\t>\n\t\t\t\t{album.title}\n\t\t\t</h1>\n\t\t\t<div class=\"mt-3.5 flex flex-wrap items-center gap-x-3 gap-y-2 text-[13px] text-muted\">\n\t\t\t\t<a\n\t\t\t\t\thref=\"/u/{album.creator.nickname}\"\n\t\t\t\t\tclass=\"group inline-flex items-center gap-2 font-semibold text-text no-underline\"\n\t\t\t\t>\n\t\t\t\t\t<DuelAvatar nickname={album.creator.nickname} {avatarUrl} size={24} link={false} />\n\t\t\t\t\t<span class=\"group-hover:text-fuchsia\">@{album.creator.nickname ?? 'creator'}</span>\n\t\t\t\t</a>\n\t\t\t\t<span class=\"h-1 w-1 rounded-full bg-muted/40\"></span>\n\t\t\t\t<span>{album.photoCount} {mediaNoun(album.photoCount)}</span>\n\t\t\t\t<span class=\"h-1 w-1 rounded-full bg-muted/40\"></span>\n\t\t\t\t{#if album.isOwner}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"font-semibold {album.status === 'published' ? 'text-fuchsia' : 'text-yellow'}\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{album.status === 'published' ? 'live' : album.status}\n\t\t\t\t\t</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span>{album.unlockCount} unlocked</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<!-- RAT-618: the creator's own words, shown at last (they were saved\n\t\t\t     but never displayed), with what a buyer wants to know first -->\n\t\t\t{#if album.description || isAi || data.watch.fullMinutes}\n\t\t\t\t<div class=\"mt-4 max-w-2xl\">\n\t\t\t\t\t{#if album.description}\n\t\t\t\t\t\t<p class=\"text-sm leading-relaxed whitespace-pre-line text-text/85 md:text-base\">\n\t\t\t\t\t\t\t{album.description}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<p class=\"mt-3 flex flex-wrap gap-2 text-[11px] font-semibold\">\n\t\t\t\t\t\t{#if isAi}\n\t\t\t\t\t\t\t<span class=\"rounded-md bg-surface-2 px-2 py-1 text-text\">AI-made</span>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{#if data.watch.fullMinutes}\n\t\t\t\t\t\t\t<span class=\"rounded-md bg-surface-2 px-2 py-1 text-text\"\n\t\t\t\t\t\t\t\t>{data.watch.fullMinutes} min</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t<span class=\"rounded-md bg-surface-2 px-2 py-1 text-text\">{album.priceTokens} tokens</span>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</header>\n\n\t\t{#if heroClip}\n\t\t\t<!-- RAT-618: the free preview as the page's main content: a player, not\n\t\t\t     a tile, so the clip is what the page is about (Google's rule for\n\t\t\t     showing a video result), and the price is one tap below it -->\n\t\t\t<figure class=\"mb-8\">\n\t\t\t\t<!-- `video-with-controls`: layout.css hides the native controls on every\n\t\t\t\t     other <video>, and this one has to be playable as it stands -->\n\t\t\t\t<div class=\"flex justify-center overflow-hidden rounded-2xl border border-border bg-black\">\n\t\t\t\t\t<!-- svelte-ignore a11y_media_has_caption -->\n\t\t\t\t\t<video\n\t\t\t\t\t\tsrc={heroClip.url}\n\t\t\t\t\t\tposter={heroClip.posterUrl ?? undefined}\n\t\t\t\t\t\tcontrols\n\t\t\t\t\t\tplaysinline\n\t\t\t\t\t\tpreload=\"metadata\"\n\t\t\t\t\t\tstyle:aspect-ratio={heroRatio}\n\t\t\t\t\t\tstyle:width=\"min(100%, calc(75dvh * {heroRatio}))\"\n\t\t\t\t\t\tclass=\"video-with-controls block bg-black object-contain\"\n\t\t\t\t\t></video>\n\t\t\t\t</div>\n\t\t\t\t<figcaption\n\t\t\t\t\tclass=\"mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"text-[13px] text-muted\">\n\t\t\t\t\t\t{['free preview', fmtDur(heroClip.durationSec), isAi ? 'AI-made' : '']\n\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t.join(' · ')}\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- from md up: below it the sticky unlock bar is this button -->\n\t\t\t\t\t{#if !album.isOwner}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonclick={() => unlock('player')}\n\t\t\t\t\t\t\tdisabled={unlocking}\n\t\t\t\t\t\t\tclass=\"hidden items-center justify-center rounded-xl bg-fuchsia px-5 py-3 font-display text-[14px] font-bold text-white transition-colors hover:bg-fuchsia-dark disabled:opacity-60 md:inline-flex\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#if data.watch.fullMinutes}\n\t\t\t\t\t\t\t\tunlock the full {data.watch.fullMinutes}-minute {lockedClips > 1\n\t\t\t\t\t\t\t\t\t? 'set'\n\t\t\t\t\t\t\t\t\t: 'episode'} · {album.priceTokens} tokens\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\tunlock all {album.photoCount}\n\t\t\t\t\t\t\t\t{mediaNoun(album.photoCount)} · {album.priceTokens} tokens\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/if}\n\t\t\t\t</figcaption>\n\t\t\t</figure>\n\t\t{/if}\n\n\t\t<div class=\"grid grid-cols-1 gap-7 lg:grid-cols-[minmax(0,1fr)_360px] lg:items-start\">\n\t\t\t<!-- ───────── GALLERY ───────── -->\n\t\t\t<div\n\t\t\t\tclass=\"grid grid-cols-2 gap-2.5 sm:grid-cols-2 {album.isOwner ? 'order-2 lg:order-1' : ''}\"\n\t\t\t>\n\t\t\t\t{#each album.photos as photo, i (photo.id)}\n\t\t\t\t\t{#if photo.url}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonclick={() => openLightbox(photo.url!)}\n\t\t\t\t\t\t\tclass=\"group relative block aspect-[3/4] cursor-zoom-in overflow-hidden rounded-xl border border-border bg-bg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#if photo.kind === 'video'}\n\t\t\t\t\t\t\t\t{#if photo.posterUrl}\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\tsrc={photo.posterUrl}\n\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\t\t\t\t\t\tclass=\"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t<!-- no captured poster (legacy) — #t=0.1 renders the first frame. -->\n\t\t\t\t\t\t\t\t\t<!-- svelte-ignore a11y_media_has_caption -->\n\t\t\t\t\t\t\t\t\t<video\n\t\t\t\t\t\t\t\t\t\tsrc=\"{photo.url}#t=0.1\"\n\t\t\t\t\t\t\t\t\t\tpreload=\"metadata\"\n\t\t\t\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\t\t\t\tplaysinline\n\t\t\t\t\t\t\t\t\t\tclass=\"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]\"\n\t\t\t\t\t\t\t\t\t></video>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"pointer-events-none absolute inset-0 grid place-items-center\"\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"grid h-11 w-11 place-items-center rounded-full bg-black/55 backdrop-blur-sm\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<svg class=\"ml-0.5 h-5 w-5 text-white\" viewBox=\"0 0 24 24\" fill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t><path d=\"M8 5v14l11-7z\" /></svg\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{#if fmtDur(photo.durationSec)}\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"pointer-events-none absolute right-2 bottom-2 rounded bg-black/75 px-1.5 py-0.5 font-display text-[10px] font-bold text-text/90 tabular-nums backdrop-blur-sm\"\n\t\t\t\t\t\t\t\t\t\t>{fmtDur(photo.durationSec)}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tsrc={photo.url}\n\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\t\t\t\t\tclass=\"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{#if photo.isPreview && !album.unlocked}\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"absolute top-2 left-2 rounded bg-black/70 px-1.5 py-0.5 font-display text-[9px] font-bold tracking-[0.5px] text-text/90 uppercase backdrop-blur-sm\"\n\t\t\t\t\t\t\t\t\t>preview</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<!-- locked tile: a blurred stand-in drawn server-side from a 32 px\n\t\t\t\t\t\t     rendition (shape, no detail) under the lock; no file URL emitted -->\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"relative grid aspect-[3/4] place-items-center overflow-hidden rounded-xl border border-border bg-surface\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#if photo.blurrable && !blurFailed.has(photo.id)}\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tsrc=\"/album/{album.id}/blur/{photo.id}.jpg\"\n\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\t\t\t\t\tonerror={() => blurFailed.add(photo.id)}\n\t\t\t\t\t\t\t\t\tclass=\"absolute inset-0 h-full w-full scale-110 object-cover\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span class=\"absolute inset-0 bg-black/35\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t<span class=\"relative grid h-11 w-11 place-items-center rounded-full bg-black/50 text-white\">\n\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t><path\n\t\t\t\t\t\t\t\t\t\td=\"M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm3 8H9V6a3 3 0 0 1 6 0v3z\"\n\t\t\t\t\t\t\t\t\t/></svg\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{#if photo.kind === 'video'}\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"absolute top-2 right-2 inline-flex items-center gap-1 rounded bg-black/70 px-1.5 py-0.5 font-display text-[10px] font-bold text-white tabular-nums\"\n\t\t\t\t\t\t\t\t\t><svg class=\"h-2.5 w-2.5\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t><path d=\"M8 5v14l11-7z\" /></svg\n\t\t\t\t\t\t\t\t\t>{fmtDur(photo.durationSec) || 'clip'}</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{#if i === album.photos.length - 1 && lockedCount > 1}\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"absolute right-0 bottom-2.5 left-0 text-center font-display text-[11px] font-bold text-white/90\"\n\t\t\t\t\t\t\t\t\t>+ {lockedCount} locked</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t{/each}\n\t\t\t</div>\n\n\t\t\t<!-- ───────── RIGHT RAIL ───────── -->\n\t\t\t<aside\n\t\t\t\tclass=\"flex flex-col gap-3.5 lg:sticky lg:top-24 {album.isOwner\n\t\t\t\t\t? 'order-1 lg:order-2'\n\t\t\t\t\t: ''}\"\n\t\t\t>\n\t\t\t\t{#if !album.unlocked}\n\t\t\t\t\t<!-- BUY BOX -->\n\t\t\t\t\t<div class=\"rounded-2xl border border-border bg-surface p-5\">\n\t\t\t\t\t\t<a href=\"/u/{album.creator.nickname}\" class=\"flex items-center gap-3 no-underline\">\n\t\t\t\t\t\t\t<DuelAvatar nickname={album.creator.nickname} {avatarUrl} size={40} link={false} />\n\t\t\t\t\t\t\t<div class=\"min-w-0\">\n\t\t\t\t\t\t\t\t<div class=\"truncate font-display text-[15px] font-bold text-text\">\n\t\t\t\t\t\t\t\t\t@{album.creator.nickname ?? 'creator'}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{#if rating.count > 0}\n\t\t\t\t\t\t\t\t\t<div class=\"text-[12px] text-muted\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"text-yellow\">★</span>\n\t\t\t\t\t\t\t\t\t\t{rating.avg.toFixed(1)} · {rating.count}\n\t\t\t\t\t\t\t\t\t\t{rating.count === 1 ? 'review' : 'reviews'}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t<div class=\"text-[12px] text-muted\">creator on ratemyd</div>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\n\t\t\t\t\t\t<div class=\"my-4 h-px bg-border\"></div>\n\n\t\t\t\t\t\t<div class=\"flex items-baseline gap-2\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"font-display text-[40px] leading-none font-bold tracking-tighter text-yellow\"\n\t\t\t\t\t\t\t\t>{album.priceTokens}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"text-[14px] text-muted\">tokens</span>\n\t\t\t\t\t\t\t<span class=\"ml-auto text-[12px] text-muted\"\n\t\t\t\t\t\t\t\t>one-time · unlocks all {album.photoCount}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{#if finishing === 'late'}\n\t\t\t\t\t\t\t<p class=\"mt-4 text-center text-[12.5px] text-muted-2\" role=\"status\">\n\t\t\t\t\t\t\t\tyour tokens are on the way — it unlocks by itself the moment they land.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{#if finishing === 'waiting'}\n\t\t\t\t\t\t\t<!-- RAT-534: back from checkout — the unlock finishes by itself. -->\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"mt-4 flex w-full items-center justify-center gap-2 rounded-xl bg-surface-2 px-5 py-3.5 text-[14px] font-semibold text-text\"\n\t\t\t\t\t\t\t\trole=\"status\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"inline-block h-2 w-2 animate-pulse rounded-full bg-yellow\"></span>\n\t\t\t\t\t\t\t\tfinishing your purchase…\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tuse:watchBoxButton\n\t\t\t\t\t\t\tonclick={() => unlock('box')}\n\t\t\t\t\t\t\tdisabled={unlocking}\n\t\t\t\t\t\t\tclass=\"mt-4 flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl bg-yellow px-5 py-3.5 font-display text-[15px] font-bold tracking-tight text-black transition-colors hover:bg-yellow/85 disabled:opacity-50\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#if unlocking}\n\t\t\t\t\t\t\t\tunlocking…\n\t\t\t\t\t\t\t{:else if !data.isLoggedIn}\n\t\t\t\t\t\t\t\tsign in to unlock\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<svg class=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t><path\n\t\t\t\t\t\t\t\t\t\td=\"M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm3 8H9V6a3 3 0 0 1 6 0v3z\"\n\t\t\t\t\t\t\t\t\t/></svg\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tunlock the full album\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{/if}\n\n\t\t\t\t\t\t{#if errorMsg}\n\t\t\t\t\t\t\t<p class=\"mt-2 text-center text-[12px] font-medium text-coral\">{errorMsg}</p>\n\t\t\t\t\t\t{/if}\n\n\t\t\t\t\t\t{#if bundle?.withThis && finishing === 'idle'}\n\t\t\t\t\t\t\t{@render bundleOffer(`all ${bundle.count} albums from @${album.creator.nickname ?? 'creator'}`)}\n\t\t\t\t\t\t{/if}\n\n\t\t\t\t\t\t{#if album.unlockCount > 0}\n\t\t\t\t\t\t\t<p class=\"mt-3 text-center text-[12.5px] text-muted\">\n\t\t\t\t\t\t\t\t<b class=\"font-semibold text-text\"\n\t\t\t\t\t\t\t\t\t>{album.unlockCount} {album.unlockCount === 1 ? 'person' : 'people'}</b\n\t\t\t\t\t\t\t\t> already unlocked this\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t{/if}\n\n\t\t\t\t\t\t<div class=\"mt-4 flex flex-col gap-2.5 border-t border-border pt-4\">\n\t\t\t\t\t\t\t{#each [`all ${album.photoCount} ${mediaNoun(album.photoCount)} in full resolution`, 'yours forever — unlock once, view anytime', 'instant access, no subscription'] as line (line)}\n\t\t\t\t\t\t\t\t<div class=\"flex items-start gap-2 text-[13px] text-muted\">\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\tclass=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-green\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tstroke-width=\"3\"\n\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"><path d=\"M20 6 9 17l-5-5\" /></svg\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span>{line}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{#if data.isLoggedIn}\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"mt-4 flex items-center justify-between rounded-xl border border-border bg-bg px-3.5 py-2.5 text-[12.5px] text-muted\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t>your balance: <b class=\"font-semibold {canAfford ? 'text-text' : 'text-coral'}\"\n\t\t\t\t\t\t\t\t\t\t>{tokens} tokens</b\n\t\t\t\t\t\t\t\t\t></span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\t\t\t\tbuyFor = 'album';\n\t\t\t\t\t\t\t\t\t\tshowBuy = true;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tclass=\"font-semibold text-yellow hover:underline\">get more →</button\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t{:else if album.isOwner}\n\t\t\t\t\t{#if justPublished}\n\t\t\t\t\t\t<!-- Straight from publishing: the one thing left to do is share it -->\n\t\t\t\t\t\t<section aria-labelledby=\"live-h\" class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t\t<span class=\"grid h-10 w-10 place-items-center rounded-full bg-text text-bg\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t><path d=\"M20 6 9 17l-5-5\" /></svg\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<h2 id=\"live-h\" class=\"mt-3 font-display text-[22px] font-bold tracking-tight text-text\">\n\t\t\t\t\t\t\t\tYour album is live.\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p class=\"mt-1 text-[14px] leading-snug text-muted-2\">\n\t\t\t\t\t\t\t\tEach unlock pays you {payoutUsd(album.priceTokens)}. Albums sell when people see them: share the link.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonclick={shareAlbum}\n\t\t\t\t\t\t\t\tclass=\"mt-4 flex min-h-12 w-full items-center justify-center rounded-xl bg-fuchsia px-4 font-display text-[15px] font-bold text-white transition-colors hover:bg-fuchsia-dark\"\n\t\t\t\t\t\t\t\t>Share</button\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonclick={copyLink}\n\t\t\t\t\t\t\t\tclass=\"mt-2 flex min-h-11 w-full items-center justify-center rounded-xl bg-surface-2 px-4 text-[14px] font-semibold text-text transition-colors hover:bg-border\"\n\t\t\t\t\t\t\t\t>{copied ? 'Link copied' : 'Copy link'}</button\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#if pushState === 'default' || pushState === 'asking'}\n\t\t\t\t\t\t\t\t<div class=\"mt-4 flex items-center justify-between gap-3 border-t border-border pt-4\">\n\t\t\t\t\t\t\t\t\t<p class=\"text-[13.5px] text-muted-2\">Get a notification when it sells</p>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonclick={turnOnPush}\n\t\t\t\t\t\t\t\t\t\tdisabled={pushState === 'asking'}\n\t\t\t\t\t\t\t\t\t\tclass=\"min-h-11 shrink-0 rounded-full bg-surface-2 px-4 text-[14px] font-semibold text-text transition-colors hover:bg-border disabled:opacity-60\"\n\t\t\t\t\t\t\t\t\t\t>Turn on</button\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<p class=\"mt-4 border-t border-border pt-4 text-[13px] text-muted\">\n\t\t\t\t\t\t\t\t\t{pushState === 'granted'\n\t\t\t\t\t\t\t\t\t\t? 'You’ll get a notification and an email when it sells.'\n\t\t\t\t\t\t\t\t\t\t: 'We’ll email you when it sells.'}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</section>\n\t\t\t\t\t{/if}\n\n\t\t\t\t\t<!-- CREATOR DASHBOARD: what it earned, in dollars -->\n\t\t\t\t\t<section aria-labelledby=\"owner-h\" class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t<div class=\"flex items-center justify-between gap-3\">\n\t\t\t\t\t\t\t<h2 id=\"owner-h\" class=\"text-[13px] font-medium text-muted\">Your album</h2>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"rounded-full px-2.5 py-1 text-[12px] font-semibold {album.status === 'published'\n\t\t\t\t\t\t\t\t\t? 'bg-text text-bg'\n\t\t\t\t\t\t\t\t\t: 'bg-surface-2 text-muted-2'}\"\n\t\t\t\t\t\t\t\t>{album.status === 'published' ? 'Live' : album.status === 'draft' ? 'Draft' : 'Hidden'}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"mt-3 grid grid-cols-2 gap-2\">\n\t\t\t\t\t\t\t<div class=\"rounded-xl bg-bg px-3.5 py-3\">\n\t\t\t\t\t\t\t\t<p class=\"font-display text-[24px] leading-none font-bold tracking-tight text-text tabular-nums\">\n\t\t\t\t\t\t\t\t\t{album.unlockCount}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p class=\"mt-1.5 text-[12px] text-muted\">{album.unlockCount === 1 ? 'Unlock' : 'Unlocks'}</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"rounded-xl bg-bg px-3.5 py-3\">\n\t\t\t\t\t\t\t\t<p class=\"font-display text-[24px] leading-none font-bold tracking-tight text-text tabular-nums\">\n\t\t\t\t\t\t\t\t\t{payoutUsd(data.earnedTokens)}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p class=\"mt-1.5 text-[12px] text-muted\">Earned</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<p class=\"mt-3 text-[13.5px] text-muted-2\">\n\t\t\t\t\t\t\t{album.priceTokens} tokens · each unlock pays you\n\t\t\t\t\t\t\t<b class=\"font-semibold text-text\">{payoutUsd(album.priceTokens)}</b>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref=\"/album/{album.id}/edit\"\n\t\t\t\t\t\t\tclass=\"mt-3.5 flex min-h-11 items-center justify-center rounded-xl bg-surface-2 px-4 text-[14px] font-semibold text-text no-underline transition-colors hover:bg-border\"\n\t\t\t\t\t\t\t>Edit album</a\n\t\t\t\t\t\t>\n\t\t\t\t\t</section>\n\n\t\t\t\t\t{#if album.status === 'published'}\n\t\t\t\t\t\t{#if !justPublished}\n\t\t\t\t\t\t\t<!-- SHARE -->\n\t\t\t\t\t\t\t<section aria-labelledby=\"share-h\" class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t\t\t<h3 id=\"share-h\" class=\"font-display text-[16px] font-bold tracking-tight text-text\">Share to sell more</h3>\n\t\t\t\t\t\t\t\t<p class=\"mt-1 text-[13px] text-muted\">Albums sell when people see them.</p>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tonclick={shareAlbum}\n\t\t\t\t\t\t\t\t\tclass=\"mt-3.5 flex min-h-12 w-full items-center justify-center rounded-xl bg-fuchsia px-4 font-display text-[15px] font-bold text-white transition-colors hover:bg-fuchsia-dark\"\n\t\t\t\t\t\t\t\t\t>Share</button\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref={redditHref}\n\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\t\t\t\t\tclass=\"mt-2 flex min-h-11 items-center justify-center rounded-xl bg-surface-2 px-4 text-[14px] font-semibold text-text no-underline transition-colors hover:bg-border\"\n\t\t\t\t\t\t\t\t\t>Post on Reddit</a\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div class=\"mt-2 flex items-center gap-2 rounded-xl bg-bg py-1 pr-1 pl-3.5\">\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 truncate text-[12.5px] text-muted\"\n\t\t\t\t\t\t\t\t\t\t>{albumUrl || `ratemyd.app/album/${album.id}`}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonclick={copyLink}\n\t\t\t\t\t\t\t\t\t\tclass=\"min-h-10 shrink-0 rounded-lg px-3 text-[13px] font-semibold text-text hover:bg-surface-2\"\n\t\t\t\t\t\t\t\t\t\t>{copied ? 'Copied' : 'Copy'}</button\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</section>\n\t\t\t\t\t\t{/if}\n\n\t\t\t\t\t\t{#if tips.length > 0}\n\t\t\t\t\t\t\t<!-- SELL MORE: only the tips this album hasn't taken yet -->\n\t\t\t\t\t\t\t<section aria-labelledby=\"tips-h\" class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t\t\t<h3 id=\"tips-h\" class=\"text-[13px] font-medium text-muted\">To sell more</h3>\n\t\t\t\t\t\t\t\t<ul class=\"mt-3 flex flex-col gap-3\">\n\t\t\t\t\t\t\t\t\t{#each tips as tip (tip.t)}\n\t\t\t\t\t\t\t\t\t\t<li class=\"text-[13.5px] leading-snug\">\n\t\t\t\t\t\t\t\t\t\t\t<b class=\"font-semibold text-text\">{tip.t}.</b>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"text-muted\">{tip.d}</span>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</section>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<!-- not live: one way forward -->\n\t\t\t\t\t\t<section class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t\t<h3 class=\"font-display text-[16px] font-bold tracking-tight text-text\">\n\t\t\t\t\t\t\t\t{album.status === 'draft' ? 'Buyers can’t see it yet' : 'Hidden from buyers'}\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<p class=\"mt-1 text-[13px] text-muted\">\n\t\t\t\t\t\t\t\t{album.status === 'draft'\n\t\t\t\t\t\t\t\t\t? 'Publish it to start earning.'\n\t\t\t\t\t\t\t\t\t: 'Buyers who unlocked it keep it. Publish it again to sell it.'}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"/album/{album.id}/edit\"\n\t\t\t\t\t\t\t\tclass=\"mt-3.5 flex min-h-12 items-center justify-center rounded-xl bg-fuchsia px-4 font-display text-[15px] font-bold text-white no-underline transition-colors hover:bg-fuchsia-dark\"\n\t\t\t\t\t\t\t\t>{album.status === 'draft' ? 'Finish & publish' : 'Open the editor'}</a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</section>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else if data.isLoggedIn && album.creator.nickname}\n\t\t\t\t\t<!-- RAT-534: unlocked — the creator is one message away, and has more. -->\n\t\t\t\t\t<div class=\"rounded-2xl bg-surface p-5\">\n\t\t\t\t\t\t<p class=\"text-[11px] font-bold tracking-[0.18em] text-muted uppercase\">it's yours</p>\n\t\t\t\t\t\t{#if bundleDone > 1}\n\t\t\t\t\t\t\t<p class=\"mt-2 text-[15px] font-semibold text-text\" role=\"status\">\n\t\t\t\t\t\t\t\tall {bundleDone} albums by @{album.creator.nickname} are yours now.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonclick={messageCreator}\n\t\t\t\t\t\t\tclass=\"mt-3 flex w-full items-center justify-center rounded-xl bg-text px-5 py-3.5 font-display text-[15px] font-bold tracking-tight text-bg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tmessage @{album.creator.nickname}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<p class=\"mt-2 text-center text-[12px] text-muted\">\n\t\t\t\t\t\t\topens your chat with “just unlocked {album.title}” ready to send\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t{#if bundle && !bundle.withThis}\n\t\t\t\t\t\t\t{#if finishing !== 'idle'}\n\t\t\t\t\t\t\t\t<p class=\"mt-4 flex items-center justify-center gap-2 rounded-xl bg-bg px-4 py-3 text-[13.5px] font-semibold text-text\" role=\"status\">\n\t\t\t\t\t\t\t\t\t<span class=\"inline-block h-2 w-2 animate-pulse rounded-full bg-yellow\"></span>\n\t\t\t\t\t\t\t\t\tfinishing your purchase…\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t{@render bundleOffer(`the other ${bundle.count} albums from @${album.creator.nickname}`)}\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{#if data.moreAlbums.length > 0}\n\t\t\t\t\t\t\t<div class=\"mt-5 border-t border-border pt-4\">\n\t\t\t\t\t\t\t\t<div class=\"flex items-baseline justify-between\">\n\t\t\t\t\t\t\t\t\t<p class=\"text-[13px] font-semibold text-text\">more from @{album.creator.nickname}</p>\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref={resolve('/u/[nickname]', { nickname: album.creator.nickname })}\n\t\t\t\t\t\t\t\t\t\tclass=\"text-[12px] text-muted no-underline hover:text-text\">see all →</a\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"mt-3 grid grid-cols-3 gap-2\">\n\t\t\t\t\t\t\t\t\t{#each data.moreAlbums as a (a.id)}\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref={resolve('/album/[id]', { id: a.id })}\n\t\t\t\t\t\t\t\t\t\t\tclass=\"group block overflow-hidden rounded-lg bg-bg no-underline\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"aspect-[4/5] overflow-hidden bg-surface-2\">\n\t\t\t\t\t\t\t\t\t\t\t\t{#if a.coverUrl || a.coverPosterUrl}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc={a.coverKind === 'video' ? (a.coverPosterUrl ?? '') : (a.coverUrl ?? '')}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-full w-full object-cover\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"truncate px-1.5 py-1 text-[11px] text-muted group-hover:text-text\">\n\t\t\t\t\t\t\t\t\t\t\t\t{a.priceTokens} tokens\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\n\t\t\t\t{#if !album.isOwner}\n\t\t\t\t\t<div class=\"flex justify-center pt-1\">\n\t\t\t\t\t\t<ReportTrigger entityType=\"creator_album\" entityId={album.id} label=\"report this album\" />\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</aside>\n\t\t</div>\n\n\t\t<!-- RAT-618: where to go next, for the buyer and for the crawler -->\n\t\t<p class=\"mt-10 flex flex-wrap gap-x-6 gap-y-2 text-sm font-semibold\">\n\t\t\t{#if spoke}\n\t\t\t\t<a href={spoke.path} class=\"text-text no-underline hover:text-fuchsia\">more {spoke.name} →</a>\n\t\t\t{/if}\n\t\t\t{#if album.creator.nickname}\n\t\t\t\t<a href=\"/u/{album.creator.nickname}\" class=\"text-muted no-underline hover:text-text\"\n\t\t\t\t\t>more from @{album.creator.nickname} →</a\n\t\t\t\t>\n\t\t\t{/if}\n\t\t\t<a href=\"/albums\" class=\"text-muted no-underline hover:text-text\">all albums →</a>\n\t\t</p>\n\t</div>\n</main>\n\n<!-- The creator bundle as one row: what's in it, the price against the full\n     one, and a single button (the buy box and the unlocked card share it). -->\n{#snippet bundleOffer(label: string)}\n\t{#if bundle}\n\t\t<div class=\"mt-3 flex items-center gap-3 rounded-xl border border-border bg-bg py-2.5 pr-2.5 pl-3.5\">\n\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t<p class=\"text-[13.5px] leading-snug font-semibold text-text\">{label}</p>\n\t\t\t\t<p class=\"mt-0.5 text-[12.5px] text-muted\">\n\t\t\t\t\t<b class=\"font-semibold text-yellow\">{bundle.price} tokens</b>\n\t\t\t\t\t<s class=\"ml-1 text-muted/80\">{bundle.full}</s> · save {bundle.full - bundle.price}\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonclick={() => unlockBundle(true)}\n\t\t\t\tdisabled={bundling}\n\t\t\t\tclass=\"min-h-11 shrink-0 rounded-xl bg-text px-4 font-display text-[14px] font-bold text-bg transition-opacity hover:opacity-90 disabled:opacity-50\"\n\t\t\t\t>{bundling ? 'unlocking…' : 'get all'}</button\n\t\t\t>\n\t\t</div>\n\t\t{#if bundleError}\n\t\t\t<p class=\"mt-2 text-center text-[12px] font-medium text-coral\" role=\"alert\">{bundleError}</p>\n\t\t{/if}\n\t{/if}\n{/snippet}\n\n<!-- Lightbox -->\n{#if lightboxPhoto?.url}\n\t<div\n\t\tclass=\"fixed inset-0 z-[120] flex items-center justify-center bg-black/90 backdrop-blur-sm\"\n\t\trole=\"dialog\"\n\t\taria-modal=\"true\"\n\t>\n\t\t<button class=\"absolute inset-0 cursor-zoom-out\" onclick={closeLightbox} aria-label=\"Close\"\n\t\t></button>\n\t\t{#if lightboxPhoto.kind === 'video'}\n\t\t\t<!-- svelte-ignore a11y_media_has_caption -->\n\t\t\t<!-- `video-with-controls` opts back into the native UA controls (scrub,\n\t\t\t\t pause, volume, fullscreen); layout.css hides native controls on every\n\t\t\t\t other <video>. Same opt-in the rate-session viewer uses. Poster gives\n\t\t\t\t an instant frame; #key remounts when stepping between clips. -->\n\t\t\t{#key lightboxPhoto.id}\n\t\t\t\t<div class=\"relative z-[1] flex max-h-[88dvh] max-w-[92vw]\">\n\t\t\t\t\t<!-- svelte-ignore a11y_media_has_caption -->\n\t\t\t\t\t<video\n\t\t\t\t\t\tbind:this={lightboxVideoEl}\n\t\t\t\t\t\tuse:autoplayMuted\n\t\t\t\t\t\tuse:videoLoadGuard={{ onState: onVideoState }}\n\t\t\t\t\t\tsrc={lightboxPhoto.url}\n\t\t\t\t\t\tposter={lightboxPhoto.posterUrl}\n\t\t\t\t\t\tcontrols\n\t\t\t\t\t\tautoplay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tplaysinline\n\t\t\t\t\t\tpreload=\"auto\"\n\t\t\t\t\t\tclass=\"video-with-controls max-h-[88dvh] max-w-[92vw] object-contain\"\n\t\t\t\t\t></video>\n\t\t\t\t\t{#if videoState === 'error'}\n\t\t\t\t\t\t<!-- Explicit recovery in place of the endless native spinner. -->\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"absolute inset-0 z-[2] flex flex-col items-center justify-center gap-3.5 rounded-lg bg-black/70 p-6 text-center backdrop-blur-sm\"\n\t\t\t\t\t\t\trole=\"alert\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p class=\"m-0 text-[14px] text-white/85\">couldn't load this video.</p>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonclick={retryLightboxVideo}\n\t\t\t\t\t\t\t\tclass=\"rounded-[10px] bg-fuchsia px-6 py-2.5 font-display text-[14px] font-bold text-white transition-colors hover:bg-fuchsia-dark\"\n\t\t\t\t\t\t\t\t>retry</button\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t{/key}\n\t\t{:else}\n\t\t\t<img\n\t\t\t\tsrc={lightboxPhoto.url}\n\t\t\t\talt=\"\"\n\t\t\t\tclass=\"relative z-[1] max-h-[88dvh] max-w-[92vw] object-contain\"\n\t\t\t/>\n\t\t{/if}\n\t\t{#if visiblePhotos.length > 1}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonclick={() => step(-1)}\n\t\t\t\taria-label=\"Previous\"\n\t\t\t\tclass=\"absolute left-3 z-[2] flex h-11 w-11 items-center justify-center rounded-full border border-white/15 bg-black/50 text-white transition-colors hover:bg-black/70 sm:left-6\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"h-5 w-5\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"><path d=\"m15 18-6-6 6-6\" /></svg\n\t\t\t\t>\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonclick={() => step(1)}\n\t\t\t\taria-label=\"Next\"\n\t\t\t\tclass=\"absolute right-3 z-[2] flex h-11 w-11 items-center justify-center rounded-full border border-white/15 bg-black/50 text-white transition-colors hover:bg-black/70 sm:right-6\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"h-5 w-5\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\" /></svg\n\t\t\t\t>\n\t\t\t</button>\n\t\t{/if}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonclick={closeLightbox}\n\t\t\taria-label=\"Close\"\n\t\t\tclass=\"absolute top-4 right-4 z-[2] flex h-10 w-10 items-center justify-center rounded-full border border-white/15 bg-black/50 text-white transition-colors hover:bg-black/70\"\n\t\t>\n\t\t\t<svg\n\t\t\t\tclass=\"h-5 w-5\"\n\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstroke-width=\"2\"\n\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\tstroke-linejoin=\"round\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg\n\t\t\t>\n\t\t</button>\n\t</div>\n{/if}\n\n{#if showBar}\n\t<AlbumUnlockBar\n\t\tpriceTokens={album.priceTokens}\n\t\tcount={album.photoCount}\n\t\tnoun={mediaNoun(album.photoCount)}\n\t\tsignedIn={data.isLoggedIn}\n\t\tbusy={unlocking || finishing === 'waiting'}\n\t\thidden={boxInView}\n\t\terror={errorMsg}\n\t\tonunlock={() => unlock('bar')}\n\t/>\n{/if}\n\n<BuyTokensModal\n\topen={showBuy}\n\tonclose={() => (showBuy = false)}\n\treason={buyReason}\n\t{need}\n\tnote=\"it unlocks by itself once you’re back.\"\n\tsuccessPath={buySuccessPath}\n\tsource={buyFor === 'bundle' ? 'album_bundle' : 'album_next'}\n/>\n"],"version":3}