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CAAA,CAAA,YAH3BH,EAAA,IAEeX,IAAO,CAAA,EAFtBe,EAAAC,EAAAL,CAAA,aADItB,CAAO,GAAA4B,EAAAC,CAAA,4BAWX,IAAAC,EAAAC,EAAA,SAAAD,EAAA,aAAAN,CAAA,EAAA,CAAA,IAGYC,EAAE,cAAc,CAAA,CAAA,YAH5BK,EAAA,IAEenB,EAAK,CAAC,CAAA,EAFrBe,EAAAC,EAAAG,CAAA,aADI5B,CAAK,GAAA0B,EAAAI,CAAA,MApBXnB,CAAG,EACFoB,EAAA,IAAAC,EAAAnB,EAAA,aAAAoB,EAAA,KAAA,CAAA,MADDtB,CAAG,KAFI","names":["el","atStart","$.state","atEnd","measure","$.set","rail","node","key","x","onScroll","ro","page","dir","div","root","div_1","$.child","node_1","$.reset","$.attach","node_2","$.sibling","button","root_1","$0","t","$.append","$$anchor","$$render","consequent","button_1","root_2","consequent_1","$.template_effect","$.set_attribute","$$props"],"sources":["../../../../../../src/lib/components/post/Rail.svelte"],"sourcesContent":["<script lang=\"ts\">\n\t// RAT-674: one horizontal swipe row for Explore (people, niches). Full-bleed\n\t// on a phone and snapped so a card never rests half-cut; with a mouse there\n\t// is no sideways wheel, so arrow buttons page it. It can remember how far it\n\t// was swiped, so coming back from a profile or a niche lands on the same card.\n\timport { t } from '$lib/i18n';\n\timport type { Snippet } from 'svelte';\n\timport type { Attachment } from 'svelte/attachments';\n\n\tinterface Props {\n\t\tchildren: Snippet;\n\t\t/** accessible name of the row */\n\t\tlabel: string;\n\t\t/** sessionStorage key for the scroll position */\n\t\trestoreKey?: string;\n\t}\n\tlet { children, label, restoreKey }: Props = $props();\n\n\tlet el: HTMLDivElement | null = null;\n\tlet atStart = $state(true);\n\tlet atEnd = $state(false);\n\n\tfunction measure() {\n\t\tif (!el) return;\n\t\tatStart = el.scrollLeft <= 4;\n\t\tatEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - 4;\n\t}\n\n\tconst rail: Attachment<HTMLDivElement> = (node) => {\n\t\tel = node;\n\t\tconst key = restoreKey ? `rmd_rail_x:${restoreKey}` : null;\n\t\tif (key) {\n\t\t\ttry {\n\t\t\t\tconst x = Number(sessionStorage.getItem(key) ?? 0);\n\t\t\t\tif (x > 0) node.scrollLeft = x;\n\t\t\t} catch {\n\t\t\t\t/* storage blocked — starts at the first card */\n\t\t\t}\n\t\t}\n\t\tconst onScroll = () => {\n\t\t\tmeasure();\n\t\t\tif (!key) return;\n\t\t\ttry {\n\t\t\t\tsessionStorage.setItem(key, String(Math.round(node.scrollLeft)));\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t};\n\t\tconst ro = new ResizeObserver(measure);\n\t\tro.observe(node);\n\t\tnode.addEventListener('scroll', onScroll, { passive: true });\n\t\tmeasure();\n\t\treturn () => {\n\t\t\tro.disconnect();\n\t\t\tnode.removeEventListener('scroll', onScroll);\n\t\t\tel = null;\n\t\t};\n\t};\n\n\tfunction page(dir: 1 | -1) {\n\t\tel?.scrollBy({ left: dir * el.clientWidth * 0.85, behavior: 'smooth' });\n\t}\n</script>\n\n<div class=\"relative\">\n\t<div\n\t\t{@attach rail}\n\t\trole=\"region\"\n\t\taria-label={label}\n\t\tclass=\"-mx-5 flex snap-x snap-mandatory scroll-px-5 gap-3 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:scroll-px-0 sm:px-0 [&::-webkit-scrollbar]:hidden\"\n\t>\n\t\t{@render children()}\n\t</div>\n\t<!-- mouse only: a touch screen swipes, and a sticky hover would leave them up -->\n\t{#if !atStart}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonclick={() => page(-1)}\n\t\t\taria-label={t('scroll left')}\n\t\t\tclass=\"absolute top-1/2 left-1 hidden h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full border border-border bg-surface-2 text-text shadow-[0_4px_16px_rgba(0,0,0,0.45)] transition-colors hover:bg-border [@media(hover:hover)_and_(pointer:fine)]:flex\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M10 3.5L5.5 8l4.5 4.5\" /></svg>\n\t\t</button>\n\t{/if}\n\t{#if !atEnd}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonclick={() => page(1)}\n\t\t\taria-label={t('scroll right')}\n\t\t\tclass=\"absolute top-1/2 right-1 hidden h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full border border-border bg-surface-2 text-text shadow-[0_4px_16px_rgba(0,0,0,0.45)] transition-colors hover:bg-border [@media(hover:hover)_and_(pointer:fine)]:flex\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 3.5L10.5 8 6 12.5\" /></svg>\n\t\t</button>\n\t{/if}\n</div>\n"],"version":3}