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,KAClF,MAAMiD,EAAQL,EAAkBG,EAAE,KAAK,EACtCG,EAAQN,EAAkBG,EAAE,KAAK,EAClC,OAAII,EAAQF,CAAK,GAAK,CAACE,EAAQD,CAAK,GAAK,CAACH,EAAE,KAAO,OAAOA,EAAE,KAAQ,SAAiB,KAC9E,CAAE,MAAAE,EAAO,MAAAC,EAAO,IAAKH,EAAE,GAAA,CAC/B,MAAQ,CACP,OAAO,IACR,CACD,CAGO,MAAMK,GAAiB3E,GAA8B,CAAC,CAACA,GAAKuE,EAAKvE,CAAC,IAAM,KAGxE,SAAS4E,GAAe5E,EAA8B,CAC5D,MAAMsE,EAAIC,EAAKvE,CAAC,EAChB,OAAIsE,GAAGO,GAAA,EACAP,CACR,CAEO,SAASO,IAAuB,CACtC,GAAI,CACH,eAAe,WAAWd,CAAS,CACpC,MAAQ,CAER,CACD,CAEA,MAAMe,EAAS9G,GAAe,KAAK,UAAUmG,EAAkBnG,CAAC,CAAC,EAEpD+G,GAAW,CACvBT,EACAE,EACAC,IACIK,EAAMR,EAAE,KAAK,IAAMQ,EAAMN,CAAK,GAAKM,EAAMR,EAAE,KAAK,IAAMQ,EAAML,CAAK","names":["PLACES","POSES","placePoses","place","p","id","POSE_PLACES","mixedAt","duetPlacePoses","FINISHES","FINISH_SPOT","DEFAULT_SCENE","isPlace","v","isPose","isReady","isFinish","f","placeLabel","poseLabel","poseReady","DUET_POSE_READY","posesOpen","cast","posesFor","here","poseAllowed","placeOpen","duetPlaceOpen","placesFor","READY_PLACES","placeChoiceFor","fitScene","s","poseOpen","sceneOf","q","pose","sceneQuery","withScene","search","kept","kv","sq","sceneLine","t","k","isDefaultScene","elsewhere","rand","pick","xs","places","poses","KEY","readScene","raw","j","saveScene","FRESH_MS","handOff","query","takeHandoff","at","has","list","toggled","x","isWorn","key","g","matKey","isInkKey","GEAR_PIERCINGS","GEAR_JEWELS","GEAR_FUN","GEAR_VJEWELS","toggleShopKey","getShopItem","on","out","MATERIALS","hers","VULVA_INKS","VULVA_TEXT_SAMPLE","vulvaInkFits","vulvaInkSize","RANGES","h","GEAR_HAIRS","w","GEAR_WINGS","sanitizeGear","stripUnowned","entitled","owns","isFreeInkOn","INK_UPLOAD_LIVE","stripUnownedGear","ROUND_KEY","guestSculpt","body","SCULPT_DRAFT_KEY","sanitizeAnySculpt","keepGuestSculpt","keepGuestRound","r","read","penis","vulva","isVulva","hasGuestRound","takeGuestRound","dropGuestRound","canon","samePair"],"sources":["../../../../../../src/lib/sculpt/scene.ts","../../../../../../src/lib/sculpt/editor-handoff.ts","../../../../../../src/lib/sculpt/try-on.ts","../../../../../../src/lib/sculpt/guest-duet.ts"],"sourcesContent":["// RAT-773 (scene flow, phase 1 of RAT-772): where a round plays and how it starts. A leaf with no\n// three in it: the editor's Play sheet, the duet page and its HUD all read it.\n//\n//   - a place (PlaceId): the room the round plays in. Only a place that is `ready` is shown; with only\n//     one, there is nothing to pick and no place shows at all;\n//   - a starting position (PoseId, or 'mixed': today's round, on all fours, then on her back). Which\n//     ones a pair can play and which the duet can show yet are Play's (duet-poses.ts, RAT-774): only\n//     a position that is both is offered;\n//   - a finish preference ('any' | 'inside' | 'outside'), the engine's default when no spot is picked.\n//\n// The choice is remembered on this device (localStorage), and a link carries it as ?place=&pose=\n// (the defaults are left out, so a plain link stays as it was).\nimport {\n\tDUET_POSE_READY,\n\tPOSE_PLACES,\n\tplacePoses as duetPlacePoses,\n\tplaceOpen as duetPlaceOpen,\n\tposeAllowed,\n\tposeOpen,\n\ttype DuetPoseChoice,\n\ttype DuetPoseId,\n\ttype PoseCast\n} from './duet-poses';\n\nimport type { PlaceId } from './render/live/places/place';\n\nexport type { PoseCast };\n\n/** the places, in the sheet's order, with their names; `ready`: offered (the switch: a place\n *  that isn't is not shown, and a link to it plays in the bedroom) (the ids are the duet's, places/place.ts; a\n *  type-only import: the place modules pull three) */\nexport const PLACES = [\n\t{ id: 'bedroom', label: 'Bedroom', ready: true },\n\t{ id: 'sofa', label: 'Sofa', ready: true },\n\t// (offered only while a position there is ready: placesFor; the office's is bent over, the shower's\n\t// standing)\n\t{ id: 'office', label: 'Office', ready: true },\n\t{ id: 'shower', label: 'Shower', ready: true }\n] as const satisfies readonly { id: PlaceId; label: string; ready: boolean }[];\nexport type { PlaceId };\n/** the places a round can play in now; the others aren't shown (RAT-773: no \"Soon\") */\n\n/** the positions, in the sheet's order, with their names (the ids are the game's, DUET_POSES) */\nexport const POSES = [\n\t{ id: 'missionary', label: 'Missionary' },\n\t{ id: 'doggy', label: 'Doggy' },\n\t{ id: 'cowgirl', label: 'Cowgirl' },\n\t{ id: 'reverse', label: 'Reverse cowgirl' },\n\t{ id: 'shoulders', label: 'Legs on shoulders' },\n\t{ id: 'prone', label: 'Prone bone' },\n\t{ id: 'bentover', label: 'Bent over' },\n\t{ id: 'standing', label: 'Standing' },\n\t{ id: 'bed_edge', label: 'Edge of the bed' },\n\t{ id: 'lap', label: 'Lap' },\n\t{ id: 'blowjob', label: 'Blowjob' },\n\t{ id: 'blowjob_lying', label: 'Blowjob, lying' }\n] as const satisfies readonly { id: DuetPoseId; label: string }[];\n\n/** the positions a place stands them in (Play's POSE_PLACES: the office's desk only bent over, the\n *  shower only the wall, the bed and the sofa the lying and kneeling ones) */\nconst placePoses = (place: PlaceId): readonly DuetPoseId[] =>\n\tPOSES.map((p) => p.id).filter((id) => POSE_PLACES[id].includes(place));\n/** 'mixed' (on all fours, then on her back) where doggy and missionary both are */\nexport const mixedAt = (place: PlaceId) => duetPlacePoses(place).includes('mixed');\nexport type PoseId = DuetPoseId;\n/** a starting position, or 'mixed': the round switches between positions by itself (today's) */\nexport type PosePick = DuetPoseChoice;\n\nexport const FINISHES = [\n\t{ id: 'any', label: 'Any' },\n\t{ id: 'inside', label: 'Inside' },\n\t{ id: 'outside', label: 'Outside' }\n] as const;\nexport type FinishPick = (typeof FINISHES)[number]['id'];\n/** the engine's finish spot for a preference (duet-log FinishSpot); 'any': none */\nexport const FINISH_SPOT = { any: null, inside: 'in', outside: 'back' } as const;\n\nexport interface Scene {\n\tplace: PlaceId;\n\tpose: PosePick;\n\tfinish: FinishPick;\n}\n\nexport const DEFAULT_SCENE: Scene = { place: 'bedroom', pose: 'mixed', finish: 'any' };\n\nexport const isPlace = (v: unknown): v is PlaceId => PLACES.some((p) => p.id === v);\nexport const isPose = (v: unknown): v is PoseId => POSES.some((p) => p.id === v);\nexport const isReady = (id: PlaceId) => PLACES.some((p) => p.id === id && p.ready);\nconst isFinish = (v: unknown): v is FinishPick => FINISHES.some((f) => f.id === v);\n\nexport const placeLabel = (id: PlaceId) => PLACES.find((p) => p.id === id)!.label;\nexport const poseLabel = (id: PosePick) =>\n\tid === 'mixed' ? 'Mixed positions' : POSES.find((p) => p.id === id)!.label;\n\n/** the duet can show this position now (else it is \"Soon\") */\nexport const poseReady = (id: PoseId) => DUET_POSE_READY[id];\n\n/** The positions to offer this pair now: the ones it can play and the duet can show (the rest aren't\n *  shown: RAT-773, no \"Soon\"). */\nexport function posesOpen(cast?: PoseCast | null, place?: PlaceId): readonly PoseId[] {\n\treturn posesFor(cast, place).filter(poseReady);\n}\n\n/** The positions this pair can play (shown; a \"Soon\" one among them takes no tap). A scissor has none:\n *  it plays on her back all round. */\nexport function posesFor(cast?: PoseCast | null, place?: PlaceId): readonly PoseId[] {\n\tconst here = place ? placePoses(place) : null;\n\treturn POSES.map((p) => p.id).filter(\n\t\t(id) => poseAllowed(id, cast) && (!here || here.includes(id))\n\t);\n}\n\n/** the place has a position this pair can be put in now (Play's rule, duet-poses placeOpen: the\n *  office's bent over is closed to a strap-on giver, fm and ff) */\nconst placeOpen = (place: PlaceId, cast?: PoseCast | null) => duetPlaceOpen(place, cast);\n\n/** The places to offer this pair: built (`ready`) and with a position it can play there now. A place\n *  whose only positions aren't ready (the office, while bent over isn't) is not shown. */\nexport function placesFor(cast?: PoseCast | null) {\n\treturn PLACES.filter((p) => p.ready && placeOpen(p.id, cast));\n}\n/** the places offered to any pair (the Play sheet's, before the partner is known) */\nexport const READY_PLACES = placesFor(null);\n/** more than one place to pick: the Scene sheet's places and the round's Place chip show */\nexport const placeChoice = READY_PLACES.length > 1;\n/** the same, for this pair */\nexport const placeChoiceFor = (cast?: PoseCast | null) => placesFor(cast).length > 1;\n\n/** A scene this pair can play now: an unready place falls back to the bedroom, a position the pair\n *  can't play (or the duet can't show yet) to Mixed. */\nexport function fitScene(s: Scene, cast?: PoseCast | null): Scene {\n\tconst place = isReady(s.place) && placeOpen(s.place, cast) ? s.place : DEFAULT_SCENE.place;\n\tconst ok = (p: PosePick) =>\n\t\tp === 'mixed' ? mixedAt(place) && poseOpen(p, cast) : posesOpen(cast, place).includes(p);\n\treturn {\n\t\tplace,\n\t\tpose: ok(s.pose) ? s.pose : mixedAt(place) ? 'mixed' : (posesOpen(cast, place)[0] ?? 'mixed'),\n\t\tfinish: s.finish\n\t};\n}\n\n/** The scene a link names (?place=&pose=), checked; what it leaves out is the default. */\nexport function sceneOf(q: URLSearchParams): Scene {\n\tconst place = q.get('place');\n\tconst pose = q.get('pose');\n\treturn fitScene({\n\t\tplace: isPlace(place) ? place : DEFAULT_SCENE.place,\n\t\tpose: isPose(pose) ? pose : 'mixed',\n\t\tfinish: DEFAULT_SCENE.finish\n\t});\n}\n\n/** The query a scene adds to a link: only what differs from the default ('' for the default). */\nexport function sceneQuery(s: Pick<Scene, 'place' | 'pose'>): string {\n\tconst q = new URLSearchParams();\n\tif (s.place !== DEFAULT_SCENE.place) q.set('place', s.place);\n\tif (s.pose !== 'mixed') q.set('pose', s.pose);\n\treturn q.toString();\n}\n\n/** A query (`?a=1&place=…`) with its scene swapped for this one (the rest kept, in order). */\nexport function withScene(search: string, s: Pick<Scene, 'place' | 'pose'>): string {\n\tconst kept = search\n\t\t.replace(/^\\?/, '')\n\t\t.split('&')\n\t\t.filter((kv) => kv && !/^(place|pose)=/.test(kv));\n\tconst sq = sceneQuery(s);\n\treturn [...kept, ...(sq ? [sq] : [])].join('&');\n}\n\n/** \"Bedroom · Mixed positions\" (the Play sheet's row), translated by `t`. */\nexport const sceneLine = (s: Pick<Scene, 'place' | 'pose'>, t: (k: string) => string = (k) => k) =>\n\t`${t(placeLabel(s.place))} · ${t(poseLabel(s.pose))}`;\n\n/** the default place and Mixed: nothing to say on the Play buttons */\nexport const isDefaultScene = (s: Pick<Scene, 'place' | 'pose'>) =>\n\ts.place === DEFAULT_SCENE.place && s.pose === 'mixed';\n\n/** \"Again somewhere new\": another ready place if there is one, and another position than this one\n *  (one the duet can show, for this pair). */\nexport function elsewhere(\n\ts: Scene,\n\tcast?: PoseCast | null,\n\trand: () => number = Math.random\n): Scene {\n\tconst pick = <T>(xs: readonly T[]) => xs[Math.floor(rand() * xs.length)];\n\tconst places = PLACES.filter((p) => p.ready && p.id !== s.place && placeOpen(p.id, cast)).map(\n\t\t(p) => p.id\n\t);\n\tconst place = places.length ? pick(places) : s.place;\n\tconst poses = posesOpen(cast, place).filter((p) => place !== s.place || p !== s.pose);\n\treturn fitScene({ place, pose: poses.length ? pick(poses) : s.pose, finish: s.finish }, cast);\n}\n\n// ---------- remembered on this device ----------\n\nconst KEY = 'sculpt-scene:v1';\n\n/** The scene last picked here, checked; the default if none (or storage is off). */\nexport function readScene(): Scene {\n\ttry {\n\t\tconst raw = localStorage.getItem(KEY);\n\t\tif (!raw) return { ...DEFAULT_SCENE };\n\t\tconst j = JSON.parse(raw) as Partial<Scene>;\n\t\treturn fitScene({\n\t\t\tplace: isPlace(j.place) ? j.place : DEFAULT_SCENE.place,\n\t\t\tpose: j.pose === 'mixed' || isPose(j.pose) ? j.pose : 'mixed',\n\t\t\tfinish: isFinish(j.finish) ? j.finish : DEFAULT_SCENE.finish\n\t\t});\n\t} catch {\n\t\treturn { ...DEFAULT_SCENE };\n\t}\n}\n\nexport function saveScene(s: Scene) {\n\ttry {\n\t\tlocalStorage.setItem(KEY, JSON.stringify(s));\n\t} catch {\n\t\t/* private mode, storage off: not kept */\n\t}\n}\n","// The duet page back to the editor it came from: history.back() (no new entry, so Back and the iOS\n// swipe never cycle editor -> duet -> editor -> ...), with what the editor should open on arrival\n// (?duet-pick=1, ?shop=gear&duet=...) handed over in sessionStorage instead of the URL.\n\nconst KEY = 'sculpt:handoff';\n/** a handoff older than this is a leftover (the back never landed on the editor) */\nconst FRESH_MS = 15_000;\n\nexport function handOff(query: string) {\n\ttry {\n\t\tsessionStorage.setItem(KEY, JSON.stringify({ q: query, at: Date.now() }));\n\t} catch {\n\t\t/* private mode quota: the editor just opens plain */\n\t}\n}\n\n/** The editor's mount: what was handed over (once), or null. */\nexport function takeHandoff(): URLSearchParams | null {\n\ttry {\n\t\tconst raw = sessionStorage.getItem(KEY);\n\t\tif (!raw) return null;\n\t\tsessionStorage.removeItem(KEY);\n\t\tconst { q, at } = JSON.parse(raw) as { q?: unknown; at?: unknown };\n\t\tif (typeof q !== 'string' || typeof at !== 'number' || Date.now() - at > FRESH_MS) return null;\n\t\treturn new URLSearchParams(q);\n\t} catch {\n\t\treturn null;\n\t}\n}\n","// Try-on: any shop item can go on the sculpt before it is owned (the editor and the gear shop apply it\n// straight away); a save is blocked while something unowned is worn (shop.ts unownedInUse), and the\n// server strips it anyway (sculpt-ink.ts enforceShopOwnership). Pure, so both sides agree.\nimport {\n\tGEAR_FUN,\n\tGEAR_HAIRS,\n\tGEAR_JEWELS,\n\tGEAR_PIERCINGS,\n\tGEAR_VJEWELS,\n\tGEAR_WINGS,\n\tsanitizeGear,\n\tstripUnownedGear,\n\ttype GearCharm,\n\ttype GearFun,\n\ttype GearHat,\n\ttype SculptGear\n} from './gear';\nimport { isInkKey, INK_UPLOAD_LIVE } from './ink';\nimport { MATERIALS, matKey, type MaterialId } from './material';\nimport { RANGES } from './params';\nimport {\n\tVULVA_INK_LIVE,\n\tVULVA_INKS,\n\tVULVA_TEXT_SAMPLE,\n\tvulvaInkFits,\n\tvulvaInkSize,\n\ttype AnySculptParams,\n\ttype VulvaParams\n} from './vulva-params';\nimport { getShopItem, isFreeInkOn } from './shop';\n\nconst has = <T extends string>(list: readonly T[], v: string): v is T =>\n\t(list as readonly string[]).includes(v);\nconst toggled = <T>(list: T[] | undefined, k: T) =>\n\tlist?.includes(k) ? list.filter((x) => x !== k) : [...(list ?? []), k];\n\n/** Is this shop item on the sculpt right now? */\nexport function isWorn(p: AnySculptParams, key: string): boolean {\n\tconst g = p.gear ?? {};\n\tif (key.startsWith('mat_')) return p.mat !== null && matKey(p.mat) === key;\n\tif (isInkKey(key)) return p.tat === key;\n\tif (key.startsWith('hair_')) return g.hair === key.slice(5);\n\tif (has(GEAR_PIERCINGS, key)) return !!g.pierce?.includes(key);\n\tif (has(GEAR_JEWELS, key)) return !!g.jewel?.includes(key);\n\tif (key === 'cockring') return !!g.ring && g.ring !== 'diamond';\n\tif (key === 'ring_diamond') return g.ring === 'diamond';\n\tif (key.startsWith('charm_')) return g.charm === key.slice(6);\n\tif (has(GEAR_FUN, key)) return !!g.fun?.includes(key);\n\tif (key.startsWith('hat_')) return g.hat === key.slice(4);\n\tif (key.startsWith('wings_')) return g.wings === key.slice(6);\n\tif (has(GEAR_VJEWELS, key)) return p.body === 'vulva' && !!g.vjewel?.includes(key);\n\tif (key === 'jewel_plug') return p.body === 'vulva' && !!g.plug;\n\tif (key === 'fox_tail') return p.body === 'vulva' && !!g.tail;\n\tif (key === 'pedestal') return !!g.pedestal;\n\treturn false;\n}\n\n/**\n * Put a shop item on (or take it off when it is already worn): a new params object. A charm brings the\n * Prince Albert it hangs on, the PA chain its two piercings; a sleeve opens at full size; her band goes\n * to the lower back (the only spot it fits). Unknown keys leave the params as they are, and so does\n * anything the body can't wear (a vulva: ink outside VULVA_INKS or before VULVA_INK_LIVE, gear other\n * than the pedestal and her own jewellery; a penis: her jewellery).\n */\nexport function toggleShopKey<P extends AnySculptParams>(p: P, key: string): P {\n\tif (!getShopItem(key)) return p;\n\tconst on = !isWorn(p, key);\n\tconst out: P = { ...p, gear: p.gear ? structuredClone(p.gear) : null };\n\tif (key.startsWith('mat_')) {\n\t\tconst id = key.slice(4);\n\t\tout.mat = on && has(MATERIALS, id) ? (id as MaterialId) : null;\n\t\treturn out;\n\t}\n\tconst hers = has(GEAR_VJEWELS, key) || key === 'jewel_plug' || key === 'fox_tail';\n\tif (out.body === 'vulva') {\n\t\tif (isInkKey(key)) {\n\t\t\tif (!VULVA_INK_LIVE || !has(VULVA_INKS, key)) return p;\n\t\t\tconst v = out as VulvaParams;\n\t\t\tv.tat = on ? key : null;\n\t\t\tif (!on) return out;\n\t\t\tif (key === 'text') v.tatText ??= VULVA_TEXT_SAMPLE;\n\t\t\tif (!vulvaInkFits(key, v.tatSpot)) v.tatSpot = 'back';\n\t\t\tv.tatSize = vulvaInkSize(key, v.tatSize);\n\t\t\treturn out;\n\t\t}\n\t\tif (key !== 'pedestal' && !hers) return p;\n\t} else if (hers) return p;\n\telse if (isInkKey(key)) {\n\t\tout.tat = on ? key : null;\n\t\tif (on && key === 'text') out.tatText ??= 'Big Boss';\n\t\tif (on && (key === 'koi' || key === 'dragon')) out.tatSize = RANGES.tatSize.max;\n\t\treturn out;\n\t}\n\tconst g: SculptGear = out.gear ?? {};\n\tif (key.startsWith('hair_')) {\n\t\tconst h = key.slice(5);\n\t\tif (on && has(GEAR_HAIRS, h)) g.hair = h;\n\t\telse delete g.hair;\n\t} else if (has(GEAR_PIERCINGS, key)) g.pierce = toggled(g.pierce, key);\n\telse if (has(GEAR_JEWELS, key)) {\n\t\tg.jewel = toggled(g.jewel, key);\n\t\tif (on && key === 'pachain')\n\t\t\tfor (const k of ['pa', 'hafada'] as const)\n\t\t\t\tif (!g.pierce?.includes(k)) g.pierce = toggled(g.pierce, k);\n\t} else if (key === 'cockring' || key === 'ring_diamond') {\n\t\tif (on) g.ring = key === 'cockring' ? 'metal' : 'diamond';\n\t\telse {\n\t\t\tdelete g.ring;\n\t\t\tdelete g.ringCol;\n\t\t}\n\t} else if (key.startsWith('charm_')) {\n\t\tg.charm = on ? (key.slice(6) as Exclude<GearCharm, 'none'>) : undefined;\n\t\tif (on && !g.pierce?.includes('pa')) g.pierce = toggled(g.pierce, 'pa');\n\t} else if (has(GEAR_FUN, key)) {\n\t\tg.fun = toggled(g.fun, key as GearFun);\n\t\t// one thing at the neck\n\t\tif (on && key === 'bowtie') g.fun = g.fun.filter((f) => f !== 'necktie');\n\t\tif (on && key === 'necktie') g.fun = g.fun.filter((f) => f !== 'bowtie');\n\t} else if (key.startsWith('hat_'))\n\t\tg.hat = on ? (key.slice(4) as Exclude<GearHat, 'none'>) : undefined;\n\telse if (key.startsWith('wings_')) {\n\t\tconst w = key.slice(6);\n\t\tif (on && has(GEAR_WINGS, w)) g.wings = w;\n\t\telse delete g.wings;\n\t} else if (has(GEAR_VJEWELS, key)) {\n\t\tg.vjewel = toggled(g.vjewel, key);\n\t\t// one VCH: plain or the gem one\n\t\tif (on && (key === 'vch' || key === 'vch_gem'))\n\t\t\tg.vjewel = g.vjewel.filter((k) => k === key || (k !== 'vch' && k !== 'vch_gem'));\n\t} else if (key === 'jewel_plug') {\n\t\t// one plug at a time: it swaps the fox tail out\n\t\tif (on) {\n\t\t\tg.plug = g.plug ?? {};\n\t\t\tdelete g.tail;\n\t\t} else delete g.plug;\n\t} else if (key === 'fox_tail') {\n\t\tif (on) {\n\t\t\tg.tail = g.tail ?? {};\n\t\t\tdelete g.plug;\n\t\t} else delete g.tail;\n\t} else if (key === 'pedestal') {\n\t\tif (on) g.pedestal = true;\n\t\telse {\n\t\t\tdelete g.pedestal;\n\t\t\tdelete g.plaque;\n\t\t}\n\t}\n\tout.gear = sanitizeGear(g, out.body);\n\treturn out;\n}\n\n/** The try-on bar's Remove: everything paid that is not owned or entitled comes off (what the server\n *  would strip on save, without the round trip). */\nexport function stripUnowned<P extends AnySculptParams>(p: P, entitled: ReadonlySet<string>): P {\n\tconst out: P = { ...p };\n\tconst owns = (k: string) => isFreeInkOn(k, out.body) || entitled.has(k);\n\tif (out.body === 'vulva') {\n\t\tconst v = out as VulvaParams;\n\t\tif (v.tat !== null && !owns(v.tat)) v.tat = null;\n\t\tif (v.tat === 'text' && !v.tatText) v.tat = null;\n\t} else {\n\t\tif (out.tatText !== null && !owns('text')) out.tatText = null;\n\t\tif (out.tatImg !== null && (!INK_UPLOAD_LIVE || !owns('upload'))) out.tatImg = null;\n\t\tif (out.tat !== null && !owns(out.tat)) out.tat = null;\n\t\tif ((out.tat === 'text' && !out.tatText) || (out.tat === 'upload' && !out.tatImg)) out.tat = null;\n\t}\n\tif (out.mat !== null && !entitled.has(matKey(out.mat))) out.mat = null;\n\tout.gear = stripUnownedGear(p.gear, entitled, p.body);\n\treturn out;\n}\n","// The signed-out duet (RAT-685): the visitor's own side (the editor's draft, if it is the right body)\n// and the round they asked to keep, carried across the sign-up in sessionStorage. Browser only; every\n// read and write is guarded (private mode), and the page works without it. Nothing here is trusted: the\n// server checks the round like any other (its ticket over both snapshots, then simulate()).\n\nimport { SCULPT_DRAFT_KEY } from './draft';\nimport type { DuetLog } from './duet-log';\nimport type { SculptParams } from './params';\nimport { stripUnowned } from './try-on';\nimport {\n\tisVulva,\n\tsanitizeAnySculpt,\n\ttype AnySculptParams,\n\ttype SculptBody,\n\ttype VulvaParams\n} from './vulva-params';\n\nconst ROUND_KEY = 'sculpt:guest-duet';\n/** a round older than this is a leftover: the sign-up never came back */\nconst FRESH_MS = 60 * 60_000;\n\n/** What the visitor built, when it is the body this duet needs: only what a new account may wear (the\n *  free things), so the round they play is the one a save would store. */\nexport function guestSculpt(body: SculptBody): AnySculptParams | null {\n\ttry {\n\t\tconst raw = sessionStorage.getItem(SCULPT_DRAFT_KEY);\n\t\tconst p = raw ? sanitizeAnySculpt(JSON.parse(raw)) : null;\n\t\treturn p && p.body === body ? stripUnowned(p, new Set<string>()) : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** Their side as the editor's draft, so it opens there as it is here. */\nexport function keepGuestSculpt(p: AnySculptParams): void {\n\ttry {\n\t\tsessionStorage.setItem(SCULPT_DRAFT_KEY, JSON.stringify(p));\n\t} catch {\n\t\t/* private mode: the editor opens on its own */\n\t}\n}\n\nexport type GuestRound = { penis: SculptParams; vulva: VulvaParams; log: DuetLog };\n\n/** \"Save it\": the round, for the duet (`q`, duetQuery) it was played in. */\nexport function keepGuestRound(q: string, r: GuestRound): void {\n\ttry {\n\t\tsessionStorage.setItem(ROUND_KEY, JSON.stringify({ q, at: Date.now(), ...r }));\n\t} catch {\n\t\t/* not kept: after the sign-up they play again */\n\t}\n}\n\nfunction read(q: string): GuestRound | null {\n\ttry {\n\t\tconst raw = sessionStorage.getItem(ROUND_KEY);\n\t\tif (!raw) return null;\n\t\tconst r = JSON.parse(raw) as { q?: unknown; at?: unknown; penis?: unknown; vulva?: unknown } & {\n\t\t\tlog?: unknown;\n\t\t};\n\t\tif (r.q !== q || typeof r.at !== 'number' || Date.now() - r.at > FRESH_MS) return null;\n\t\tconst penis = sanitizeAnySculpt(r.penis),\n\t\t\tvulva = sanitizeAnySculpt(r.vulva);\n\t\tif (isVulva(penis) || !isVulva(vulva) || !r.log || typeof r.log !== 'object') return null;\n\t\treturn { penis, vulva, log: r.log as DuetLog };\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** This tab asked to keep a round of the duet `q`. */\nexport const hasGuestRound = (q: string | null): boolean => !!q && read(q) !== null;\n\n/** That round, once. */\nexport function takeGuestRound(q: string): GuestRound | null {\n\tconst r = read(q);\n\tif (r) dropGuestRound();\n\treturn r;\n}\n\nexport function dropGuestRound(): void {\n\ttry {\n\t\tsessionStorage.removeItem(ROUND_KEY);\n\t} catch {\n\t\t/* nothing stored */\n\t}\n}\n\nconst canon = (p: unknown) => JSON.stringify(sanitizeAnySculpt(p));\n/** The round was played on exactly these two sculpts (a changed one can't be saved). */\nexport const samePair = (\n\tr: Pick<GuestRound, 'penis' | 'vulva'>,\n\tpenis: SculptParams,\n\tvulva: VulvaParams\n) => canon(r.penis) === canon(penis) && canon(r.vulva) === canon(vulva);\n"],"version":3}