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AHA,CAAG,SAqBH,IAAAY,EAAAC,GAAA,EAICC,EAAGnD,EAJJiD,CAAA,MAICE,CAAG,EACM3D,EAAK4D,CAAA,MACbC,EAACtD,EAAAqD,EAAA,CAAA,EAADC,EAAC,YAAA,0DAFFF,CAAG,UAAHA,EAAG,CAAA,iBAKFG,EAAGC,GAAA,EAIFC,MAJDF,CAAG,EAAA,CAAA,MAIFE,CAAG,EACMrD,UAAOyB,CAAI,CAAA,IADpB4B,CAAG,IAJJF,CAAG,MAAHA,CAAG,oBASHG,EAAAlD,EAAAmD,CAAA,EAAAC,EAAA3D,EAAAyD,EAAA,EAAA,EAAAxD,EAAAwD,CAAA,EAAA,IAAAG,EAAA7D,EAAA0D,EAAA,CAAA,iBASCI,EAACC,GAAA,MAADD,EAAC,EAAA,IAADA,CAAC,cAAoD9B,CAAM,CAAA,CAAA,MAA3D8B,CAAC,aADE9B,CAAM,GAAAT,EAAAyC,CAAA,WARVN,EAAA,SAAAd,EAGUb,CAAO,QAGhBA,CAAO,EAAG,WAAa,aAAa,IANrCZ,EAAA,QAAAuC,EAESzB,CAAU,oBAZhBJ,CAAI,EAAAN,EAAA0C,CAAA,EAAA1C,EAAA2C,EAAA,EAAA,IARThE,EAAAgD,CAAA,EAAA/C,EAAAT,EAAAwD,CAAA,WAtBGxB,EAAO,EAAAH,EAAA4C,CAAA,EAAA5C,EAAA6C,EAAA,EAAA,eA/CJ","names":["badge","$$anchor","span","root_1","$.set_attribute","caption","text","$.sibling","$.child","$.reset","$.append","poster","v","$.noop","a","$.first_child","fragment_1","text_1","a_1","text_2","$0","$.set_text","$1","panelLabel","resolve","panelPath","$.delegated","keepFromDrag","span_1","fragment_2","$$render","consequent","alternate","compact","$.prop","$$props","view","$.state","loading","failed","showPoster","$.set","res","e","$.derived","div","root_5","node_2","button","root_7","text_4","$.get","consequent_1","alternate_1","span_2","root_8","consequent_2","section","root_9","div_1","node_5","p","div_2","root_10","div_3","button_1","fragment_5","text_6","node_8","p_1","root_12","consequent_5","consequent_4","alternate_2","consequent_3","alternate_3"],"sources":["../../../../../../src/lib/components/arena/ArenaModIdentity.svelte"],"sourcesContent":["<script lang=\"ts\">\n\t// Staff-only: who posted an anonymous arena card. The page only knows the\n\t// viewer's staff role (null for everyone else, so this isn't rendered).\n\t// The identity comes from the staff-gated endpoint on an explicit click —\n\t// that call re-checks the role server-side and writes the audit row.\n\t// Callers key this on the post id so moving to another card resets it.\n\t// compact: inline row on the swipe card; otherwise a panel (post detail).\n\timport { resolve } from '$app/paths';\n\timport type { ArenaModView, StaffRole } from '$lib/types/arena-mod-view';\n\n\tlet {\n\t\tsubmissionId,\n\t\trole,\n\t\tcompact = false\n\t}: { submissionId: string; role: StaffRole; compact?: boolean } = $props();\n\n\tlet view = $state<ArenaModView | null>(null);\n\tlet loading = $state(false);\n\tlet failed = $state<string | null>(null);\n\n\tasync function showPoster() {\n\t\tif (loading) return;\n\t\tloading = true;\n\t\tfailed = null;\n\t\ttry {\n\t\t\tconst res = await fetch(\n\t\t\t\t`/api/arena/submission/${encodeURIComponent(submissionId)}/mod-identity`,\n\t\t\t\t{ method: 'POST' }\n\t\t\t);\n\t\t\tif (!res.ok) {\n\t\t\t\tfailed =\n\t\t\t\t\tres.status === 403 ? 'You no longer have mod access.' : 'Could not load the poster.';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tview = (await res.json()) as ArenaModView;\n\t\t} catch {\n\t\t\tfailed = 'Could not load the poster.';\n\t\t} finally {\n\t\t\tloading = false;\n\t\t}\n\t}\n\n\t// The swipe card starts a drag (and captures the pointer) on pointerdown;\n\t// keep that off the staff controls so their clicks land.\n\tfunction keepFromDrag(e: PointerEvent) {\n\t\te.stopPropagation();\n\t}\n\n\t// /mod and /staff/users both search by nickname or email.\n\tconst panelPath = $derived(role === 'admin' ? '/staff/users' : '/mod');\n\tconst panelLabel = $derived(role === 'admin' ? 'Open in the staff console' : 'Open in mod panel');\n\tconst caption = 'Only mods and admins can see this';\n</script>\n\n{#snippet badge()}\n\t<span\n\t\tclass=\"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-border bg-bg px-2.5 py-1 font-display text-[10px] font-bold tracking-[0.16em] text-text uppercase\"\n\t\ttitle={caption}\n\t>\n\t\t<svg\n\t\t\tclass=\"h-3 w-3\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstroke-width=\"2.2\"\n\t\t\taria-hidden=\"true\"\n\t\t\t><path\n\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\td=\"M12 3 4.5 6v5.5c0 4.6 3.2 8.4 7.5 9.5 4.3-1.1 7.5-4.9 7.5-9.5V6L12 3Z\"\n\t\t\t/></svg\n\t\t>\n\t\t{role === 'admin' ? 'Admin view' : 'Mod view'}\n\t</span>\n{/snippet}\n\n{#snippet poster(v: ArenaModView)}\n\t{#if v.nickname}\n\t\t<a\n\t\t\thref={resolve('/u/[nickname]', { nickname: v.nickname })}\n\t\t\tonpointerdown={keepFromDrag}\n\t\t\tclass=\"truncate text-[13px] font-semibold text-text no-underline hover:underline\"\n\t\t\t>@{v.nickname}</a\n\t\t>\n\t\t<!-- resolved path + search query; the rule can't see through the template -->\n\t\t<!-- eslint-disable svelte/no-navigation-without-resolve -->\n\t\t<a\n\t\t\thref={`${resolve(panelPath)}?q=${encodeURIComponent(v.nickname)}`}\n\t\t\tonpointerdown={keepFromDrag}\n\t\t\tclass=\"text-[11px] text-muted no-underline hover:text-text hover:underline\">{panelLabel}</a\n\t\t>\n\t\t<!-- eslint-enable svelte/no-navigation-without-resolve -->\n\t{:else}\n\t\t<span class=\"text-[13px] text-text\">Account without nickname</span>\n\t\t<span class=\"truncate font-mono text-[11px] text-muted\" title={v.userId}\n\t\t\t>{v.userId.slice(0, 8)}</span\n\t\t>\n\t{/if}\n{/snippet}\n\n{#if compact}\n\t<div class=\"ph-no-capture mt-2 flex flex-wrap items-center gap-x-2 gap-y-1.5\">\n\t\t{@render badge()}\n\t\t{#if view}\n\t\t\t{@render poster(view)}\n\t\t{:else}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonclick={showPoster}\n\t\t\t\tonpointerdown={keepFromDrag}\n\t\t\t\tdisabled={loading}\n\t\t\t\ttitle={caption}\n\t\t\t\tclass=\"inline-flex min-h-8 items-center rounded-lg border border-border bg-bg px-3 text-[12px] font-semibold text-text transition-colors hover:bg-bg/60 disabled:opacity-50\"\n\t\t\t>\n\t\t\t\t{loading ? 'Loading…' : 'Show poster'}\n\t\t\t</button>\n\t\t{/if}\n\t\t{#if failed}\n\t\t\t<span class=\"text-[11px] text-muted\" role=\"status\">{failed}</span>\n\t\t{/if}\n\t</div>\n{:else}\n\t<section\n\t\tclass=\"ph-no-capture mt-6 rounded-2xl border border-border bg-surface p-4\"\n\t\taria-label=\"Moderator view: arena poster\"\n\t>\n\t\t<div class=\"flex flex-wrap items-center gap-x-3 gap-y-1.5\">\n\t\t\t{@render badge()}\n\t\t\t<p class=\"text-[12px] text-muted\">{caption}. Viewing is logged.</p>\n\t\t</div>\n\t\t{#if view}\n\t\t\t<div class=\"mt-3 flex min-w-0 flex-col rounded-lg border border-border bg-bg/40 p-3\">\n\t\t\t\t<p class=\"font-display text-[10px] font-bold tracking-[0.2em] text-muted uppercase\">\n\t\t\t\t\tPosted by\n\t\t\t\t</p>\n\t\t\t\t<div class=\"mt-1.5 flex min-w-0 flex-col\">\n\t\t\t\t\t{@render poster(view)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonclick={showPoster}\n\t\t\t\tdisabled={loading}\n\t\t\t\tclass=\"mt-3 inline-flex min-h-11 items-center rounded-lg border border-border bg-bg px-4 text-[13px] font-semibold text-text transition-colors hover:bg-bg/60 disabled:opacity-50\"\n\t\t\t>\n\t\t\t\t{loading ? 'Loading…' : 'Show poster'}\n\t\t\t</button>\n\t\t\t{#if failed}\n\t\t\t\t<p class=\"mt-2 text-[12px] text-muted\" role=\"status\">{failed}</p>\n\t\t\t{/if}\n\t\t{/if}\n\t</section>\n{/if}\n"],"version":3}