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AA6B,EAAAY,CAAA,QAaTC,EAAML,EAAAM,EAAA,CAAA,IAAND,EAAME,GAAArC,EAAsBT,EAAQ8C,CAAA,EAAA,IAAAnC,EAARX,CAAQ,CAAA,IAdrCiC,CAAG,IALJP,CAAM,EA+BN,IAAAqB,IA/BArB,EAAM,CAAA,MA+BNqB,CAAG,kBAIO9C,CAAa,CAAA,2BAHtB+C,EAAAC,EAAA,iGAIa,aACF,wDANZF,CAAG,EAWH,IAAAG,IAXAH,EAAG,CAAA,MAWHG,CAAM,uBAANA,CAAM,IA3CPzB,CAAG,IAFJF,CAAG,IAAHA,EAAGuB,GAAArC,EAAwBX,EAAIgD,CAAA,EAAA,IAAAnC,EAAJb,CAAI,CAAA,EAA/BqD,GAAA5B,MAA0CV,CAAM,IADjDQ,CAAG,6CAEDG,EAAM,YAAA4B,EAAA,sCAqBHR,EAAM,YAAAQ,EAAA,gCAvBX/B,CAAG,MAJI","names":["root","$.state","closeBtn","reducedMotion","sizes","$.derived","$$props","fmtLen","onMount","mq","onMq","$.set","returnTo","$.get","prevOverflow","portal","node","onkeydown","e","els","el","first","last","div","root_1","div_1","button","div_2","header","div_3","b","span","root_2","$$render","consequent","div_4","div_5","root_3","button_1","$.child","button_2","$.sibling","$.clsx","$.set_attribute","$.delegated","consequent_1","button_3","node_2","$$value","div_6","Stage_1","$$anchor","footer_1","$.attach","$$args"],"sources":["../../../../../../src/lib/components/sculpt/SculptViewerModal.svelte"],"sourcesContent":["<script lang=\"ts\">\n\t// Fullscreen 3D viewer for the sculpt card. The card owns the open state, the history entry and\n\t// the actions (passed in as the `footer` snippet so the card's own button styles apply); this\n\t// only lays out the overlay. Mounted while open only, so closing disposes the stage (renderer +\n\t// mesh worker). The stage component comes from the card's lazy import: three loads once.\n\timport { onMount, type Component, type ComponentProps, type Snippet } from 'svelte';\n\timport type SculptStage from './SculptStage.svelte';\n\timport type { PublicSculptParams } from '$lib/sculpt/public-params';\n\timport { fmtLen, type Units } from '$lib/sculpt/stats';\n\n\tinterface Props {\n\t\tStage: Component<ComponentProps<typeof SculptStage>>;\n\t\tparams: PublicSculptParams;\n\t\tnickname: string;\n\t\tunits: Units;\n\t\tonunits: (u: Units) => void;\n\t\tonclose: () => void;\n\t\tfooter: Snippet;\n\t}\n\n\tlet { Stage, params, nickname, units, onunits, onclose, footer }: Props = $props();\n\n\tlet root = $state<HTMLDivElement>();\n\tlet closeBtn = $state<HTMLButtonElement>();\n\tlet reducedMotion = $state(false);\n\n\t// a vulva has no numbers: no size line and no units toggle\n\tconst sizes = $derived(\n\t\tparams.body === 'penis' ? `${fmtLen(params.length, units)} · ${fmtLen(params.girth, units)} around` : ''\n\t);\n\n\tonMount(() => {\n\t\tconst mq = window.matchMedia('(prefers-reduced-motion: reduce)');\n\t\treducedMotion = mq.matches;\n\t\tconst onMq = () => (reducedMotion = mq.matches);\n\t\tmq.addEventListener('change', onMq);\n\t\t// focus goes back to whatever opened the viewer (the expand button or the 3D tag)\n\t\tconst returnTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\tcloseBtn?.focus({ preventScroll: true });\n\t\tconst prevOverflow = document.body.style.overflow;\n\t\tdocument.body.style.overflow = 'hidden';\n\t\t// onMount cleanup never runs on the server, so document is safe here\n\t\treturn () => {\n\t\t\tmq.removeEventListener('change', onMq);\n\t\t\tdocument.body.style.overflow = prevOverflow;\n\t\t\treturnTo?.focus({ preventScroll: true });\n\t\t};\n\t});\n\n\t/** Moves the overlay to <body> so no transformed ancestor on the profile can trap the fixed\n\t *  layer. Portalled from inside a wrapper that stays put, so Svelte's teardown never goes\n\t *  looking for a node that has moved (same as MessageChooser). */\n\tfunction portal(node: HTMLElement) {\n\t\tdocument.body.appendChild(node);\n\t\treturn () => node.remove();\n\t}\n\n\t/** Keys only count while focus is in the viewer (or nowhere): a sheet opened on top of it\n\t *  (the sign-in sheet from \"Clash with mine\") keeps its own Esc / Tab. */\n\tfunction onkeydown(e: KeyboardEvent) {\n\t\tif (!root) return;\n\t\tconst a = document.activeElement;\n\t\tif (a && a !== document.body && !root.contains(a)) return;\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tonclose();\n\t\t\treturn;\n\t\t}\n\t\tif (e.key !== 'Tab') return;\n\t\tconst els = [\n\t\t\t...root.querySelectorAll<HTMLElement>(\n\t\t\t\t'a[href], button:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\t\t\t)\n\t\t].filter((el) => el.tabIndex >= 0);\n\t\tif (!els.length) return;\n\t\tconst first = els[0];\n\t\tconst last = els[els.length - 1];\n\t\tif (!root.contains(a) || (e.shiftKey && a === first)) {\n\t\t\te.preventDefault();\n\t\t\t(e.shiftKey ? last : first).focus();\n\t\t} else if (!e.shiftKey && a === last) {\n\t\t\te.preventDefault();\n\t\t\tfirst.focus();\n\t\t}\n\t}\n</script>\n\n<svelte:window {onkeydown} />\n\n<div class=\"svm-anchor\">\n\t<div class=\"svm\" bind:this={root} {@attach portal}>\n\t\t<button class=\"scrim\" type=\"button\" tabindex=\"-1\" aria-label=\"Close\" onclick={onclose}></button>\n\t\t<div class=\"panel\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"svm-title\">\n\t\t\t<header class=\"bar\">\n\t\t\t\t<div class=\"who\">\n\t\t\t\t\t<b id=\"svm-title\">@{nickname}</b>\n\t\t\t\t\t{#if sizes}<span>{sizes}</span>{/if}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"ctl\">\n\t\t\t\t\t{#if sizes}\n\t\t\t\t\t\t<div class=\"chipseg\" role=\"group\" aria-label=\"Units\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclass={[units === 'cm' && 'on']}\n\t\t\t\t\t\t\t\taria-pressed={units === 'cm'}\n\t\t\t\t\t\t\t\tonclick={() => onunits('cm')}>cm</button\n\t\t\t\t\t\t\t><button\n\t\t\t\t\t\t\t\tclass={[units === 'in' && 'on']}\n\t\t\t\t\t\t\t\taria-pressed={units === 'in'}\n\t\t\t\t\t\t\t\tonclick={() => onunits('in')}>in</button\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<button class=\"x\" bind:this={closeBtn} aria-label=\"Close\" onclick={onclose}\n\t\t\t\t\t\t><svg\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-width=\"2.2\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"><path d=\"M6 6l12 12M18 6 6 18\" /></svg\n\t\t\t\t\t\t></button\n\t\t\t\t\t>\n\t\t\t\t</div>\n\t\t\t</header>\n\t\t\t<div class=\"stage\">\n\t\t\t\t<Stage\n\t\t\t\t\t{params}\n\t\t\t\t\t{units}\n\t\t\t\t\twobble={!reducedMotion}\n\t\t\t\t\tinteractive={true}\n\t\t\t\t\tshowRuler={true}\n\t\t\t\t\twatermarkHandle={nickname}\n\t\t\t\t/>\n\t\t\t\t<div class=\"hint\">drag to spin · pinch to zoom</div>\n\t\t\t</div>\n\t\t\t<footer class=\"foot\">{@render footer()}</footer>\n\t\t</div>\n\t</div>\n</div>\n\n<style>\n\t.svm-anchor {\n\t\tdisplay: contents;\n\t}\n\t/* above the bottom nav (50) and pickers (60), below the sign-in sheet (210) so a logged-out\n\t   \"Clash with mine\" still shows over the viewer */\n\t.svm {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tz-index: 200;\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t\tpadding: 24px;\n\t\tanimation: svm-fade 0.18s ease-out;\n\t}\n\t.svm * {\n\t\tbox-sizing: border-box;\n\t}\n\t.scrim {\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tbackground: rgba(0, 0, 0, 0.82);\n\t\tcursor: default;\n\t}\n\t.panel {\n\t\tposition: relative;\n\t\twidth: min(1100px, 100%);\n\t\theight: min(900px, calc(100vh - 48px));\n\t\theight: min(900px, calc(100dvh - 48px));\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 12px;\n\t\tcolor: #f5f5f5;\n\t\tfont: 15px/1.45 var(--font-body);\n\t\tanimation: svm-pop 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 12px;\n\t\tflex: none;\n\t}\n\t.who {\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 3px;\n\t}\n\t.who b {\n\t\tfont: 600 18px/1.1 var(--font-display);\n\t\tletter-spacing: -0.02em;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\t.who span {\n\t\tfont-size: 12.5px;\n\t\tcolor: #a3a3a3;\n\t\tfont-variant-numeric: tabular-nums;\n\t\twhite-space: nowrap;\n\t}\n\t.ctl {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: none;\n\t}\n\t/* the editor's .chipseg, on a lifted dark chip so it reads against the scrim */\n\t.chipseg {\n\t\tdisplay: flex;\n\t\tbackground: #1c1c1c;\n\t\tborder-radius: 999px;\n\t\tpadding: 3px;\n\t}\n\t.chipseg button {\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #bdbdbd;\n\t\tfont: 700 12.5px/1 var(--font-body);\n\t\tpadding: 8px 11px;\n\t\tborder-radius: 999px;\n\t\tcursor: pointer;\n\t\tmin-height: 32px;\n\t}\n\t.chipseg button.on {\n\t\tbackground: #fff;\n\t\tcolor: #0c0c0c;\n\t}\n\t.x {\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tborder-radius: 50%;\n\t\tborder: 0;\n\t\tbackground: #1f1f1f;\n\t\tcolor: #fff;\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t\tcursor: pointer;\n\t\ttransition: background 0.15s;\n\t}\n\t.x:hover {\n\t\tbackground: #262626;\n\t}\n\t.x svg {\n\t\twidth: 19px;\n\t\theight: 19px;\n\t}\n\t/* studio white, same surface as the card's poster box */\n\t.stage {\n\t\tposition: relative;\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tborder-radius: 18px;\n\t\toverflow: hidden;\n\t\tbackground: radial-gradient(120% 100% at 50% 40%, #f4f3f1 0%, #e6e4e0 100%);\n\t}\n\t.hint {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 12px;\n\t\ttext-align: center;\n\t\tfont: 600 11px/1 var(--font-body);\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tcolor: #8c9490;\n\t\tpointer-events: none;\n\t}\n\t.foot {\n\t\tflex: none;\n\t\twidth: 100%;\n\t\tmax-width: 440px;\n\t\tmargin: 0 auto;\n\t}\n\tbutton:focus-visible {\n\t\toutline: 2px solid #fff;\n\t\toutline-offset: 2px;\n\t}\n\t/* phones: true fullscreen, the stage still a rounded card inside the safe area */\n\t@media (max-width: 640px) {\n\t\t.svm {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.panel {\n\t\t\twidth: 100%;\n\t\t\theight: 100vh;\n\t\t\theight: 100dvh;\n\t\t\tgap: 10px;\n\t\t\tbackground: #0c0c0c;\n\t\t\tpadding: calc(env(safe-area-inset-top, 0px) + 8px)\n\t\t\t\tcalc(env(safe-area-inset-right, 0px) + 10px) calc(env(safe-area-inset-bottom, 0px) + 10px)\n\t\t\t\tcalc(env(safe-area-inset-left, 0px) + 10px);\n\t\t}\n\t\t.stage {\n\t\t\tborder-radius: 16px;\n\t\t}\n\t}\n\t@keyframes svm-fade {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t}\n\t@keyframes svm-pop {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.svm,\n\t\t.panel {\n\t\t\tanimation: none;\n\t\t}\n\t}\n</style>\n"],"version":3}