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tBTC,EAAAf,EAAA,EAAAgB,EAAA,CACQ,KAAM5B,EAAO,GAAI,SAAS,CAAA,CAAA,IADlCY,EAAA,aAAAL,EAEYN,CAAO,IAAK,KAAO,SAASG,CAAK,EAAG,KAAO,KAAK,EAG1DyB,EAAAZ,UAAOnB,CAAG,IAAA,EAAwC+B,EAAAX,UAAWpB,CAAG,IAAA,EAC9DgC,EAAAC,EAAA/B,EAAA,EACC,iDACA,6GAA6G,EAGjH6B,EAAAV,EAAA,eAAAZ,EAIcH,CAAK,CAAA,EAJnByB,EAAAV,EAAA,kBAAA,GAKkBrB,CAAG,IAAA,EALrB+B,EAAAV,EAAA,mBAAA,GAMmBrB,CAAG,IAAA,EANtB+B,EAAAV,EAAA,YAAAZ,EAOWN,CAAO,IAAK,MAAQ,MAAS,IAPxC+B,EAAA,QAAAb,EAQSb,CAAM,YArBT","names":["uid","$.props_id","compact","pending","$.state","error","shown","$$props","toggle","$.get","next","$.set","j","trackSculptDuet","div","$.first_child","fragment","div_1","$.child","b","small","button","$.sibling","$.reset","node","p","root_1","$$render","consequent","$.set_class","$.clsx","$.set_attribute","$.set_text","text","$.delegated"],"sources":["../../../../../../src/lib/components/sculpt/duet/DuetOpenRow.svelte"],"sourcesContent":["<script lang=\"ts\">\n\t// \"Let others duet with my sculpt\" (fleet tasks/2026-11-27-sculpt-vulva-duet, PG4), ported 1:1 from\n\t// the pages mock's switchRow(): in the editor's share sheet and at the duet picker's foot. On by\n\t// default (sculpt.duet_open). The switch moves at once and stays busy until the server answers\n\t// (POST /api/sculpt/duet-open); a refusal puts it back and says so. The parent hears the new value\n\t// (it toasts on off: past duets leave the profile too). Styles: duet.css.\n\timport './duet.css';\n\timport { trackSculptDuet } from '$lib/analytics';\n\n\tinterface Props {\n\t\topen: boolean;\n\t\t/** the picker's foot: the short line */\n\t\tcompact?: boolean;\n\t\tonchange: (open: boolean) => void;\n\t}\n\n\tlet { open, compact = false, onchange }: Props = $props();\n\n\tconst uid = $props.id();\n\t/** the value on its way to the server; null when none is */\n\tlet pending = $state<boolean | null>(null);\n\tlet error = $state('');\n\tconst shown = $derived(pending ?? open);\n\n\tasync function toggle() {\n\t\tif (pending !== null) return;\n\t\tconst next = !open;\n\t\tpending = next;\n\t\terror = '';\n\t\ttry {\n\t\t\tconst r = await fetch('/api/sculpt/duet-open', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ open: next })\n\t\t\t});\n\t\t\tconst j = await r.json().catch(() => ({}));\n\t\t\tif (!r.ok) {\n\t\t\t\terror =\n\t\t\t\t\ttypeof j.message === 'string' && j.message ? j.message : \"Couldn't save that. Try again.\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttrackSculptDuet('toggle', { open: next });\n\t\t\tonchange(next);\n\t\t} catch {\n\t\t\terror = \"Couldn't save that. Try again.\";\n\t\t} finally {\n\t\t\tpending = null;\n\t\t}\n\t}\n</script>\n\n<div\n\tclass={['sw', compact && 'compact']}\n\tdata-state={pending !== null ? 'busy' : shown ? 'on' : 'off'}\n>\n\t<div class=\"sw-t\">\n\t\t<b id=\"{uid}-l\">Let others duet with my sculpt</b><small id=\"{uid}-d\"\n\t\t\t>{compact\n\t\t\t\t? 'Yours can be suggested to others as a partner.'\n\t\t\t\t: 'Yours can be suggested to others as a partner. You get a notification, and you can hide or delete any duet.'}</small\n\t\t>\n\t</div>\n\t<button\n\t\tclass=\"sw-b\"\n\t\ttype=\"button\"\n\t\trole=\"switch\"\n\t\taria-checked={shown}\n\t\taria-labelledby=\"{uid}-l\"\n\t\taria-describedby=\"{uid}-d\"\n\t\taria-busy={pending !== null || undefined}\n\t\tonclick={toggle}\n\t></button>\n</div>\n{#if error}<p class=\"ss-err\" role=\"alert\">{error}</p>{/if}\n"],"version":3}