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oB,QAa/DK,EAAI,CAAA,SAAQP,CAAI,CAAA,IACrCoD,EAAA,YAAAhD,EAGWK,CAAM,GAAI,MAAS,cAvBhCmB,EAAG,YAAA4D,EAAA,GAAoD,SAAO,MAAA,KAAAA,CAAA,cAQ5DtD,EAAM,YAAAsD,EAAA,GAA8D,SAAO,MAAA,KAAAA,CAAA,IAY3ErB,EAAA,QAAAf,EAKSlC,EAAI,OA1BhBQ,CAAG,MAJI","names":["uid","$.props_id","path","$.derived","$$props","url","$.get","SCULPT_SHARE_UTM","title","host","canShare","copied","$.state","tapCopy","copiedTimer","ogOk","track","method","trackSculptDuet","trackShare","copy","$.set","share","e","trap","sheetFocus","onKey","onDestroy","div","root","div_1","div_2","div_3","div_4","p","h2","button","span","DuetIcon","node","div_5","root_1","img","$.template_effect","$.set_attribute","$$render","consequent","div_6","$.sibling","node_1","node_2","span_1","span_2","text_2","button_1","node_3","$.child","node_4","node_5","consequent_1","alternate","$.reset","button_2","$.first_child","fragment_2","node_7","p_1","root_5","consequent_2","$.delegated","consequent_3","ul","root_6","li","node_10","li_1","node_11","li_2","root_7","node_13","span_3","consequent_4","DuetOpenRow","$$anchor","o","consequent_5","consequent_6","$.set_text","text","text_1","$$args"],"sources":["../../../../../../src/lib/components/sculpt/duet/DuetShareSheet.svelte"],"sourcesContent":["<script lang=\"ts\">\n\t// The duet pages' share sheet (fleet tasks/2026-11-27-sculpt-vulva-duet), ported 1:1 from the pages\n\t// mock's shareSheet():\n\t// - kind 'duet' (PG3, after Save & share): the replay's share image, the link with Copy, Share link\n\t//   where the browser has Web Share, and what the link does;\n\t// - kind 'sculpt' (PG4, the editor's Share while duets are on): the sculpt's link, Copy, Share link,\n\t//   and the duet_open switch (DuetOpenRow).\n\t// Phones: a bottom sheet; wide: a centred card. Both actions run in their own tap, nothing awaited\n\t// first (iOS keeps the activation only that long). Styles: duet.css.\n\timport './duet.css';\n\timport { onDestroy } from 'svelte';\n\timport DuetIcon from './DuetIcon.svelte';\n\timport DuetOpenRow from './DuetOpenRow.svelte';\n\timport { sheetFocus } from './sheet-focus';\n\timport { trackShare, trackSculptDuet } from '$lib/analytics';\n\timport { SCULPT_SHARE_UTM } from '$lib/sculpt/share';\n\n\ttype Props = {\n\t\t/** the site's origin (page.url.origin): the link is absolute */\n\t\torigin: string;\n\t\tonclose: () => void;\n\t} & (\n\t\t| {\n\t\t\t\tkind: 'duet';\n\t\t\t\t/** the saved duet's code */\n\t\t\t\tcode: string;\n\t\t\t\t/** a real partner's nickname: they get a notification (built-ins don't) */\n\t\t\t\tpartnerUser?: string | null;\n\t\t  }\n\t\t| {\n\t\t\t\tkind: 'sculpt';\n\t\t\t\tnickname: string;\n\t\t\t\t/** the share title: a penis invites a clash */\n\t\t\t\ttitle: string;\n\t\t\t\t/** the switch's value; null: no switch */\n\t\t\t\tduetOpen?: boolean | null;\n\t\t\t\tonduetopen?: (open: boolean) => void;\n\t\t  }\n\t);\n\n\tlet props: Props = $props();\n\n\tconst uid = $props.id();\n\tconst path = $derived(\n\t\tprops.kind === 'duet'\n\t\t\t? `/sculpt/duet/${props.code}`\n\t\t\t: `/sculpt/${encodeURIComponent(props.nickname)}`\n\t);\n\t// a shared sculpt carries the clash invite's utm, as share.ts sculptShareUrl does\n\tconst url = $derived(\n\t\tprops.origin + path + (props.kind === 'sculpt' ? `?utm_source=${SCULPT_SHARE_UTM}` : '')\n\t);\n\tconst title = $derived(props.kind === 'duet' ? 'A sculpt duet on ratemyd' : props.title);\n\tconst host = $derived(props.origin.replace(/^https?:\\/\\/(www\\.)?/, ''));\n\t// the browser decides once: no Web Share (most desktops) means Copy is the action\n\tconst canShare = typeof navigator !== 'undefined' && typeof navigator.share === 'function';\n\n\tlet copied = $state(false);\n\t/** Web Share refused (not the user's cancel): Copy is the way, said once */\n\tlet tapCopy = $state(false);\n\tlet copiedTimer: ReturnType<typeof setTimeout> | undefined;\n\t/** the share image (S4); a missing one takes its row away */\n\tlet ogOk = $state(true);\n\n\tfunction track(method: 'copy' | 'native') {\n\t\tif (props.kind === 'duet') trackSculptDuet('share', { method });\n\t\telse trackShare(method === 'copy' ? 'clipboard' : 'native', 'sculpt', 'share_sheet');\n\t}\n\n\tfunction copy() {\n\t\t// in the tap: clipboard access needs the activation on iOS\n\t\tnavigator.clipboard?.writeText(url).then(\n\t\t\t() => {\n\t\t\t\tcopied = true;\n\t\t\t\ttapCopy = false;\n\t\t\t\tclearTimeout(copiedTimer);\n\t\t\t\tcopiedTimer = setTimeout(() => (copied = false), 1600);\n\t\t\t\ttrack('copy');\n\t\t\t},\n\t\t\t() => {\n\t\t\t\t// no clipboard: the link's text selects whole on a tap (user-select: all)\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction share() {\n\t\t// synchronously in the click: iOS drops the activation across anything awaited\n\t\tnavigator.share({ url, title }).then(\n\t\t\t() => track('native'),\n\t\t\t(e: unknown) => {\n\t\t\t\t// no copy here: past the share sheet the tap's activation is gone (iOS refuses it)\n\t\t\t\tif ((e as { name?: string })?.name !== 'AbortError') tapCopy = true;\n\t\t\t}\n\t\t);\n\t}\n\n\tconst trap = sheetFocus();\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (e.key === 'Escape') props.onclose();\n\t\telse trap.key(e);\n\t}\n\n\tonDestroy(() => clearTimeout(copiedTimer));\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"dp\" style:display=\"contents\">\n\t<div class=\"sh-scrim\" aria-hidden=\"true\" onclick={props.onclose}></div>\n\t<div class=\"sh\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"{uid}-h\" {@attach trap.attach}>\n\t\t<i class=\"sh-grab\" aria-hidden=\"true\"></i>\n\t\t<div class=\"sh-hd\">\n\t\t\t<div>\n\t\t\t\t<p class=\"eb\">{props.kind === 'duet' ? 'Saved' : 'Share'}</p>\n\t\t\t\t<h2 id=\"{uid}-h\">{props.kind === 'duet' ? 'Share the replay.' : 'Share your sculpt.'}</h2>\n\t\t\t</div>\n\t\t\t<button class=\"sh-x\" type=\"button\" aria-label=\"Close\" onclick={props.onclose} data-autofocus\n\t\t\t\t><span><DuetIcon id=\"close\" /></span></button\n\t\t\t>\n\t\t</div>\n\t\t{#if props.kind === 'duet' && ogOk}\n\t\t\t<div class=\"ss-og\">\n\t\t\t\t<img src=\"/og/duet/{props.code}\" alt=\"\" decoding=\"async\" onerror={() => (ogOk = false)} />\n\t\t\t</div>\n\t\t{/if}\n\t\t<div class=\"ss-link\">\n\t\t\t<DuetIcon id=\"link\" />\n\t\t\t<span class=\"ss-url\">{host}<span>{path}</span></span>\n\t\t\t<button\n\t\t\t\tclass=\"b b-sec ss-copy\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-done={copied || undefined}\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tonclick={copy}\n\t\t\t>\n\t\t\t\t{#if copied}<DuetIcon id=\"check\" />Copied{:else}<DuetIcon id=\"copy\" />Copy{/if}\n\t\t\t</button>\n\t\t</div>\n\t\t{#if canShare}\n\t\t\t<button class=\"b b-pri b-wide\" type=\"button\" onclick={share}\n\t\t\t\t><DuetIcon id=\"share\" />Share link</button\n\t\t\t>\n\t\t\t{#if tapCopy}<p class=\"ss-err\" role=\"status\">Sharing didn't open. Tap Copy.</p>{/if}\n\t\t{/if}\n\t\t{#if props.kind === 'duet'}\n\t\t\t<ul class=\"ss-notes\">\n\t\t\t\t<li><DuetIcon id=\"lock\" /><span>Anyone with the link can watch the replay.</span></li>\n\t\t\t\t<li>\n\t\t\t\t\t<DuetIcon id=\"duets\" /><span>Not in the feed. It sits on your profile, under Duets.</span>\n\t\t\t\t</li>\n\t\t\t\t{#if props.partnerUser}\n\t\t\t\t\t<li><DuetIcon id=\"bell\" /><span>@{props.partnerUser} gets a notification.</span></li>\n\t\t\t\t{/if}\n\t\t\t</ul>\n\t\t{:else if props.duetOpen != null}\n\t\t\t<DuetOpenRow\n\t\t\t\topen={props.duetOpen}\n\t\t\t\tonchange={(o) => props.kind === 'sculpt' && props.onduetopen?.(o)}\n\t\t\t/>\n\t\t{/if}\n\t</div>\n</div>\n"],"version":3}