Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
refactor(viewer): modularize source while preserving standalone HTML (#381)
Friend Abb71ccdd64cd
diff --git a/.gitattributes b/.gitattributesindex 6cb7c1f6..0f499f17 100644--- a/.gitattributes+++ b/.gitattributes@@ -1,5 +1,5 @@# Generated diagram artifacts and built documentation surfaces.-# Keep renderer/viewer templates and the hand-authored landing page visible to Linguist.+# Keep source templates and the hand-authored landing page visible to Linguist./archify/examples/*.html linguist-generated=true/examples/*.html linguist-generated=true/docs/cases/*.html linguist-generated=true@@ -10,6 +10,7 @@/experiments/**/*.html linguist-generated=true# Deterministic build outputs committed for zero-install and release verification.+/archify/assets/template.html linguist-generated=true/archify/renderers/shared/generated-brand-marks.mjs linguist-generated=true/archify/renderers/shared/generated-validators.mjs linguist-generated=truediff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex e15448f5..8942a7fe 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -45,8 +45,14 @@ jobs:working-directory: archifyenv:ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}- - name: Verify packaged examples and the adaptive reader in a real browser- run: node --test test/desktop-reader-browser.test.mjs+ - name: Verify packaged examples and Reader Layout boundaries in a real browser+ run: node --test test/desktop-reader-browser.test.mjs test/reader-layout-browser.test.mjs+ working-directory: archify+ env:+ ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}+ ARCHIFY_CHROME_NO_SANDBOX: '1'+ - name: Verify SVG export cleanup and live state isolation+ run: node --test test/export-cleanup-browser.test.mjsworking-directory: archifyenv:ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}@@ -72,8 +78,8 @@ jobs:env:ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}ARCHIFY_CHROME_NO_SANDBOX: '1'- - name: Verify Viewer chrome stays clear of SVG legends- run: node --test test/viewer-chrome-layout.test.mjs+ - name: Verify Viewer chrome, camera, motion and input interactions+ run: node --test --test-concurrency=2 test/viewer-chrome-layout.test.mjs test/viewer-camera-browser.test.mjs test/motion-governor-browser.test.mjs test/finder-browser.test.mjs test/intent-trace-browser.test.mjs test/semantic-lens-browser.test.mjs test/route-probe-browser.test.mjs test/guided-views-browser.test.mjs test/focus-browser.test.mjs test/export-browser.test.mjsworking-directory: archifyenv:ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 69dc7b92..c7df5482 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -75,6 +75,10 @@ A browser test skipped because Chrome was unavailable is **skipped**, not passed## Packages and generated artifacts+Viewer maintenance starts in [`viewer/`](viewer/README.md). Edit its source+files, then run `npm run generate:viewer` from `archify/`; the delivered template+is generated and its freshness is checked by `npm test`.+Published artifacts must be reproducible from tracked content. Use a tracked-only, symlink-safe staging path or explicit allowlist, with negative coverage for untracked files and external symlinks. Test the extracted package outside the repository on the affected advertised hosts.Review source and focused tests before regenerating artifacts. Regenerate only outputs whose authoritative inputs changed, from the final combined source:diff --git a/archify.zip b/archify.zipindex 1b21ad02..20cff800 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/assets/template.html b/archify/assets/template.htmlindex 587415f2..2bf71579 100644--- a/archify/assets/template.html+++ b/archify/assets/template.html@@ -5790,6 +5790,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -5975,186 +6159,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10094,7 +10099,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10844,6 +10851,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.htmlindex eefc319d..08f32fb3 100644--- a/archify/examples/dataflow-product-analytics.html+++ b/archify/examples/dataflow-product-analytics.html@@ -5901,6 +5901,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6086,186 +6270,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10205,7 +10210,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10955,6 +10962,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.htmlindex be708309..33692ec3 100644--- a/archify/examples/lifecycle-agent-run.html+++ b/archify/examples/lifecycle-agent-run.html@@ -5836,6 +5836,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6021,186 +6205,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10140,7 +10145,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10890,6 +10897,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.htmlindex 47a66b5f..7de50a1c 100644--- a/archify/examples/sequence-cache-miss-request.html+++ b/archify/examples/sequence-cache-miss-request.html@@ -5916,6 +5916,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6101,186 +6285,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10220,7 +10225,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10970,6 +10977,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.htmlindex b53fdac0..ff65a3e5 100644--- a/archify/examples/web-app-rendered.html+++ b/archify/examples/web-app-rendered.html@@ -5865,6 +5865,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6050,186 +6234,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10169,7 +10174,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10919,6 +10926,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.htmlindex d2a6d6e6..c44cd78c 100644--- a/archify/examples/workflow-agent-tool-call-rendered.html+++ b/archify/examples/workflow-agent-tool-call-rendered.html@@ -5907,6 +5907,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6092,186 +6276,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10211,7 +10216,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10961,6 +10968,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/archify/package.json b/archify/package.jsonindex 17429313..f88fef4b 100644--- a/archify/package.json+++ b/archify/package.json@@ -12,6 +12,8 @@"node": ">=18"},"scripts": {+ "generate:viewer": "node ../scripts/generate-viewer.mjs",+ "check:viewer": "node ../scripts/generate-viewer.mjs --check","generate:brand-marks": "node scripts/generate-brand-marks.mjs","check:brand-marks": "node scripts/generate-brand-marks.mjs --check","generate:validators": "node scripts/generate-validators.mjs",@@ -22,7 +24,7 @@"build:start": "node ../scripts/build-start.mjs ../docs/start.html","build:readme-showcase": "node ../scripts/build-readme-showcase.mjs","test:webm": "node test/webm-artifact.smoke.mjs && node --test test/site-language-integration.mjs",- "test": "npm run check:brand-marks && npm run check:validators && npm run check:release-identity && node test/golden.mjs && node ../scripts/run-tests.mjs",+ "test": "npm run check:viewer && npm run check:brand-marks && npm run check:validators && npm run check:release-identity && node test/golden.mjs && node ../scripts/run-tests.mjs","render:examples": "node scripts/render-examples.mjs ../examples"},"devDependencies": {diff --git a/archify/test/export-browser.test.mjs b/archify/test/export-browser.test.mjsnew file mode 100644index 00000000..fe400055--- /dev/null+++ b/archify/test/export-browser.test.mjs@@ -0,0 +1,283 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Export preserves menu, clipboard, semantic cards and recording lifecycles', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Export checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-export-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_EXPORT_RUNTIME_EVIDENCE;+ const records = [];+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ t.after(() => { if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n'); });+ const input = path.join(scratch, 'motion.json');+ const file = path.join(scratch, 'motion.html');+ const source = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples/web-app.architecture.json'), 'utf8'));+ source.meta.animation = 'trace';+ source.meta.visual_preset = 'signal-flow';+ fs.writeFileSync(input, JSON.stringify(source));+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'), input, file]);+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ // Instrument browser boundaries only: all serialization, drawing and encoding+ // remain production code. Each navigation restores the original environment.+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.exportErrors=[];window.exportAlerts=[];window.exportConsole=[];+ addEventListener('error',e=>exportErrors.push(e.message));+ addEventListener('unhandledrejection',e=>exportErrors.push(String(e.reason)));+ window.alert=message=>exportAlerts.push(message);+ console.error=(...args)=>exportConsole.push(args.map(String).join(' '));+ window.exportUrls=new Map();window.exportDownloads=[];window.exportTracks=[];window.exportCancelled=[];+ const create=URL.createObjectURL.bind(URL),revoke=URL.revokeObjectURL.bind(URL);+ URL.createObjectURL=blob=>{const url=create(blob);exportUrls.set(url,{blob,revoked:false});return url;};+ URL.revokeObjectURL=url=>{const item=exportUrls.get(url);if(item)item.revoked=true;revoke(url);};+ const click=HTMLAnchorElement.prototype.click;+ HTMLAnchorElement.prototype.click=function(){if(this.download){exportDownloads.push({name:this.download,blob:exportUrls.get(this.href).blob,attached:this.isConnected});return;}return click.call(this);};+ const capture=HTMLCanvasElement.prototype.captureStream;+ if(capture)HTMLCanvasElement.prototype.captureStream=function(...args){const stream=capture.apply(this,args);exportTracks.push(...stream.getTracks());return stream;};+ const cancel=window.cancelAnimationFrame;+ window.cancelAnimationFrame=id=>{exportCancelled.push(id);return cancel(id);};+ // Activation can survive asynchronous work. Observe the actual handler+ // stack so even a microtask cannot masquerade as synchronous construction.+ window.copyInClickHandler=false;+ const listen=EventTarget.prototype.addEventListener;+ EventTarget.prototype.addEventListener=function(type,listener,options){+ if(this.id==='export-menu'&&type==='click'&&typeof listener==='function'){+ const handler=listener;+ listener=function(event){+ copyInClickHandler=true;+ try{return handler.call(this,event);}finally{copyInClickHandler=false;}+ };+ }+ return listen.call(this,type,listener,options);+ };+ window.exportWait=predicate=>new Promise((resolve,reject)=>{const start=performance.now();function poll(){if(predicate())return resolve();if(performance.now()-start>12000)return reject(new Error('Export observation timed out'));setTimeout(poll,20);}poll();});+ const fault=new URL(location.href).searchParams.get('fault');+ if(fault==='unsupported'){window.MediaRecorder=undefined;window.ClipboardItem=undefined;HTMLCanvasElement.prototype.toDataURL=()=> 'data:image/png;base64,';}+ ` });+ async function load({ width = 1440, theme = 'dark', extra = '' } = {}) {+ await send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'reduce' }] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(file).href + '?theme=' + theme + extra });+ await loaded;+ await run('document.fonts.ready');+ await run('Archify.readerLayout.whenStable()');+ await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ async function click(selector) {+ const point = await run(`(()=>{const r=document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect();return {x:r.left+r.width/2,y:r.top+r.height/2};})()`);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', ...point, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...point, button: 'left', clickCount: 1 });+ }+ async function record(label) {+ const value = await run(`({open:Archify.exportMenu.isOpen(),expanded:document.getElementById('btn-export').getAttribute('aria-expanded'),+ active:document.activeElement.id||document.activeElement.dataset.action||document.activeElement.dataset.format,+ downloads:exportDownloads.map(d=>({name:d.name,type:d.blob.type,attached:d.attached})),+ urls:[...exportUrls.values()].map(u=>({type:u.blob.type,revoked:u.revoked})),tracks:exportTracks.map(t=>t.readyState),+ receipt:Object.fromEntries([...document.documentElement.attributes].filter(a=>a.name.startsWith('data-last-export-')&&!a.name.endsWith('-bytes')).map(a=>[a.name,a.value])),+ errors:exportErrors,alerts:exportAlerts,console:exportConsole,+ external:performance.getEntriesByType('resource').map(r=>r.name).filter(n=>/^https?:/.test(n))})`);+ assert.deepEqual(value.errors, [], label);+ assert.deepEqual(value.external, [], label);+ records.push({ label, ...value });+ return value;+ }+ const route = `Archify.routeProbe.begin({source:'users',focusNode:false});if(!Archify.routeProbe.choose('db',{updateUrl:false}))throw new Error('route fixture failed');`;+ const reach = `Archify.focus.set('api',{toggle:false,updateUrl:false});if(!Archify.focus.reach('downstream',{toggle:false,updateUrl:false,reveal:false}))throw new Error('reach fixture failed');`;++ await t.test('native menu input skips unavailable entries and preserves focus and mutual exclusion', async () => {+ for (const width of [390, 720, 1440]) {+ await load({ width, extra: '&fault=unsupported' });+ assert.deepEqual(await run('Object.keys(Archify.exportMenu).sort()'), ['close','copyShareCard','downloadReachShareCard','downloadRouteShareCard','isOpen','open','run','shareCard','syncReachShare','syncRouteShare'].sort());+ assert.deepEqual(await run('Object.keys(Archify.motion).sort()'), ['canRecord','recordWebm']);+ assert.deepEqual(await run(`[...document.querySelectorAll('#export-menu [data-format="jpeg"],#export-menu [data-format="webp"],#export-menu [data-format="webm"],#export-menu [data-action="copy"]')].map(e=>e.disabled)`), [true,true,true,true]);+ await run(`document.getElementById('btn-export').focus()`);+ await key('ArrowUp', 'ArrowUp', 38);+ const last = await run(`document.activeElement.dataset.format||document.activeElement.dataset.action`);+ await key('Home', 'Home', 36);+ const first = await run(`document.activeElement.dataset.format||document.activeElement.dataset.action`);+ assert.notEqual(first, last);+ await key('ArrowUp', 'ArrowUp', 38);+ assert.equal(await run(`document.activeElement.dataset.format||document.activeElement.dataset.action`), last);+ await key('ArrowDown', 'ArrowDown', 40);+ assert.equal(await run(`document.activeElement.dataset.format||document.activeElement.dataset.action`), first);+ await key('End', 'End', 35);+ assert.equal(await run(`document.activeElement.dataset.format||document.activeElement.dataset.action`), last);+ await key('Escape', 'Escape', 27);+ assert.equal((await record('escape-' + width)).active, 'btn-export');+ assert.equal(await run('Archify.exportMenu.isOpen()'), false);+ await click('#btn-export');+ await key('Tab', 'Tab', 9);+ assert.equal(await run('Archify.exportMenu.isOpen()'), false);+ await click('#btn-export');+ assert.equal(await run(`document.getElementById('export-menu').contains(document.elementFromPoint(5,5))`), false);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', x: 5, y: 5, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', x: 5, y: 5, button: 'left', clickCount: 1 });+ assert.equal(await run('Archify.exportMenu.isOpen()'), false);+ await run('Archify.preset.open();Archify.exportMenu.open()');+ assert.equal(await run('Archify.preset.isOpen()'), false);+ await run('Archify.semanticLens.open();Archify.exportMenu.open()');+ assert.equal(await run('Archify.semanticLens.isOpen()'), false);+ const state = await record('menu-' + width);+ assert.equal(state.open, true);assert.equal(state.expanded, 'true');assert.deepEqual(state.console, []);+ }+ });++ await t.test('auto-open and themed menu rendering keep stable layout', async () => {+ for (const theme of ['dark', 'light']) {+ await load({ theme, extra: '&openExport=1' });+ await run('exportWait(()=>Archify.exportMenu.isOpen())');+ const state = await record('auto-' + theme);+ assert.equal(state.expanded, 'true');assert.deepEqual(state.console, []);+ if (evidence) {+ await run(`Promise.all(document.getAnimations().filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, theme + '-menu.png'), Buffer.from(shot.data, 'base64'));+ }+ }+ });++ await t.test('semantic card downloads retain snapshots, receipts and URL lifetime', async () => {+ for (const variant of ['route', 'reach']) {+ await load();await run(variant === 'route' ? route : reach);+ await run(`Archify.exportMenu.open();document.querySelector('[data-action="${variant}-share-card"]').focus()`);+ const result = await run(`(async()=>{let triggerFocus=0;const trigger=document.getElementById('btn-export');const onFocus=()=>triggerFocus++;trigger.addEventListener('focus',onFocus);const blob=await Archify.exportMenu.${variant === 'route' ? 'downloadRouteShareCard' : 'downloadReachShareCard'}();const image=await createImageBitmap(blob);const dimensions=[image.width,image.height];image.close();trigger.removeEventListener('focus',onFocus);return {dimensions,triggerFocus,type:blob.type};})()`);+ assert.deepEqual(result, { dimensions: [1200,630], triggerFocus: 0, type: 'image/png' });+ const live = await record(variant + '-download');+ assert.equal(live.receipt['data-last-export-variant'], variant);+ assert.equal(live.receipt['data-last-export-canonical'], 'false');+ assert.equal(live.receipt['data-last-export-' + variant + '-state-clean'], 'true');+ assert.ok(live.downloads[0].name.endsWith(variant === 'route' ? '-route-share-card.png' : '-downstream-reach-share-card.png'));+ assert.deepEqual(live.urls.map(u=>u.revoked), [true,false]);+ assert.equal(await run(`document.querySelectorAll('a[download]').length`), 0);+ await run('exportWait(()=>[...exportUrls.values()].every(u=>u.revoked))');+ assert.deepEqual((await record(variant + '-released')).urls.map(u=>u.revoked), [true,true]);+ await run(`Archify.exportMenu.open();${variant === 'route' ? 'Archify.routeProbe.clear()' : 'Archify.focus.clearReach()'};`);+ assert.equal(await run(`document.querySelector('[data-action="${variant}-share-card"]').hidden`), true);+ await run(`Archify.exportMenu.${variant === 'route' ? 'downloadRouteShareCard' : 'downloadReachShareCard'}()`);+ const missing = await record(variant + '-invalidated');+ assert.equal(missing.receipt['data-last-export-error-format'], 'share-card');+ assert.equal(missing.receipt['data-last-export-variant'], undefined);assert.equal(missing.alerts.length, 1);+ // An invalid provider snapshot must not be sanitized into a different route.+ await run(variant === 'route' ? route : reach);+ await run(`(()=>{const provider=${variant === 'route' ? 'Archify.routeProbe' : 'Archify.focus'};const method=${JSON.stringify(variant === 'route' ? 'exportSnapshot' : 'reachabilitySnapshot')};const snapshot=provider[method]();snapshot.nodeIds=['missing'];provider[method]=()=>snapshot;})()`);+ assert.equal(await run(`Archify.exportMenu.shareCard({variant:${JSON.stringify(variant)}}).then(()=>false,()=>true)`), true);+ assert.equal((await record(variant + '-malformed')).downloads.length, 1);+ }+ });++ await t.test('clipboard keeps promise construction in the click and distinct fallback/error receipts', async () => {+ for (const action of ['copy','copy-share-card']) for (const mode of ['promise','fallback','reject']) {+ await load();+ await run(`window.copyCalls=[];window.copyDone=false;window.copyBlob=null;+ window.ClipboardItem=class {constructor(data){const value=data['image/png'];copyCalls.push({promise:value instanceof Promise,gesture:navigator.userActivation.isActive,inClickHandler:copyInClickHandler});if(${JSON.stringify(mode)}==='fallback'&&value instanceof Promise)throw new Error('promise unsupported');this.value=value;}};+ Object.defineProperty(navigator,'clipboard',{configurable:true,value:{write(items){copyCalls.push({write:true});if(${JSON.stringify(mode)}==='reject'){copyDone=true;return Promise.reject(new Error('clipboard denied'));}return Promise.resolve(items[0].value).then(blob=>{copyBlob=blob;copyDone=true;});}}});+ document.querySelector('[data-action="${action}"]').disabled=false;Archify.exportMenu.open();`);+ await click(`[data-action="${action}"]`);+ await run(`exportWait(()=>copyDone&&(${JSON.stringify(mode)}==='reject'?exportAlerts.length>0:${JSON.stringify(action)}==='copy-share-card'?document.documentElement.hasAttribute('data-last-export-format'):document.querySelector('.archify-toast').textContent.length>0))`);+ const calls = await run('copyCalls');+ assert.deepEqual(calls[0], { promise: true, gesture: true, inClickHandler: true });+ if (mode === 'fallback') assert.equal(calls[1].inClickHandler, false, 'Blob fallback remains asynchronous');+ assert.deepEqual(calls.map(c=>c.write?'write':c.promise?'promise':'blob'), mode === 'fallback' ? ['promise','blob','write'] : ['promise','write']);+ const state = await record(action + '-' + mode);+ assert.equal(state.active, 'btn-export');+ if (mode !== 'reject') {+ assert.equal(await run('copyBlob.type'), 'image/png');+ const dims = await run('(async()=>{const b=await createImageBitmap(copyBlob);const size=[b.width,b.height];b.close();return size;})()');+ if (action === 'copy-share-card') assert.deepEqual(dims,[1200,630]);+ else assert.ok(dims[0] > 1200);+ assert.equal(state.receipt['data-last-export-format'], action === 'copy-share-card' ? 'share-card' : undefined);+ } else {+ assert.equal(state.alerts.length,1);+ assert.equal(state.receipt['data-last-export-error-format'], action === 'copy-share-card' ? 'share-card' : undefined);+ }+ await run('exportWait(()=>[...exportUrls.values()].every(u=>u.revoked))');+ }+ await load({extra:'&fault=unsupported'});+ assert.equal(await run('Archify.exportMenu.copyShareCard() === undefined'), true);+ assert.equal((await record('clipboard-unavailable')).alerts.length, 1);+ });++ await t.test('raster failures release sources and retain retry and synchronous SVG behavior', async () => {+ for (const fault of ['image','context','null-blob']) {+ await load();+ await run(`window.savedImage=Image;window.savedContext=HTMLCanvasElement.prototype.getContext;window.savedToBlob=HTMLCanvasElement.prototype.toBlob;`);+ if (fault === 'image') await run(`window.Image=class {set src(value){queueMicrotask(()=>this.onerror(new Error('image failed')));}}`);+ if (fault === 'context') await run('HTMLCanvasElement.prototype.getContext=()=>null');+ if (fault === 'null-blob') await run('HTMLCanvasElement.prototype.toBlob=function(callback){callback(null)}');+ await run(`Archify.exportMenu.run('png')`);+ const state = await record('raster-' + fault);+ assert.equal(state.receipt['data-last-export-error-format'],'png');assert.equal(state.alerts.length,1);+ assert.equal(state.urls.length,1);assert.equal(state.urls[0].revoked,true);assert.deepEqual(state.downloads,[]);+ await run(`window.Image=savedImage;HTMLCanvasElement.prototype.getContext=savedContext;HTMLCanvasElement.prototype.toBlob=savedToBlob;Archify.exportMenu.run('png')`);+ await run('exportWait(()=>exportDownloads.length===1)');+ assert.equal((await record('retry-' + fault)).receipt['data-last-export-error-format'],undefined);+ }+ await load();+ const sync = await run(`(()=>{const svg=document.querySelector('.diagram-container > svg'),clone=svg.cloneNode;svg.cloneNode=()=>{throw new Error('sync serialization')};try{Archify.exportMenu.run('svg');return false;}catch(e){return e.message==='sync serialization';}finally{svg.cloneNode=clone;}})()`);+ assert.equal(sync,true);assert.deepEqual((await record('svg-sync-throw')).receipt,{});+ });++ await t.test('recording succeeds with real encoding and releases tracks and the background URL', async () => {+ await load();assert.equal(await run('Archify.motion.canRecord()'),true);+ const result = await run(`(async()=>{const blob=await Archify.motion.recordWebm({duration:500,fps:10});window.recordedBlob=blob;const url=URL.createObjectURL(blob),video=document.createElement('video');video.muted=true;video.src=url;await new Promise((resolve,reject)=>{video.onloadeddata=resolve;video.onerror=()=>reject(new Error('WebM decode failed'));});const dimensions=[video.videoWidth,video.videoHeight];await video.play();await new Promise(resolve=>video.requestVideoFrameCallback(resolve));video.pause();video.removeAttribute('src');video.load();URL.revokeObjectURL(url);return {type:blob.type,nonempty:blob.size>0,dimensions,cancelled:exportCancelled.length>0};})()`);+ assert.match(result.type,/^video\/webm/);assert.equal(result.nonempty,true);assert.equal(result.cancelled,true);assert.ok(result.dimensions.every(n=>n>0&&n%2===0));+ const state = await record('webm-real');assert.ok(state.tracks.length>0);assert.ok(state.tracks.every(s=>s==='ended'));assert.ok(state.urls.every(u=>u.revoked));assert.deepEqual(state.console,[]);+ if(evidence){const bytes=await run(`(async()=>Array.from(new Uint8Array(await recordedBlob.arrayBuffer())))()`);fs.writeFileSync(path.join(evidence,'recording.webm'),Buffer.from(bytes));}+ });++ await t.test('menu recording writes its receipt and downloads the real default-duration WebM', async () => {+ await load();await run('Archify.exportMenu.open()');+ await click('[data-format="webm"]');+ await run('exportWait(()=>exportDownloads.length===1)');+ const state=await record('webm-download');+ assert.equal(state.active,'btn-export');assert.equal(state.receipt['data-last-export-format'],'webm');+ assert.equal(state.receipt['data-last-export-canonical'],'true');assert.deepEqual(state.console,[]);+ assert.ok(state.downloads[0].name.endsWith('.webm'));assert.match(state.downloads[0].type,/^video\/webm/);+ assert.equal(await run('Number(document.documentElement.dataset.lastMotionBytes)===exportDownloads[0].blob.size&&exportDownloads[0].blob.size>0'),true);+ assert.ok(state.tracks.length>0);assert.ok(state.tracks.every(s=>s==='ended'));+ assert.deepEqual(state.urls.map(u=>u.revoked),[true,false]);+ await run('exportWait(()=>[...exportUrls.values()].every(u=>u.revoked))');+ });++ await t.test('recording constructor/error/empty failures clean up and public run disables WebM', async () => {+ for (const fault of ['constructor','error','empty']) {+ await load();+ await run(`window.MediaRecorder=class {+ static isTypeSupported(){return true;}+ constructor(){if(${JSON.stringify(fault)}==='constructor')throw new Error('recorder constructor');this.state='inactive';this.mimeType='video/webm';}+ start(){this.state='recording';if(${JSON.stringify(fault)}==='error')setTimeout(()=>{this.state='inactive';this.onerror({error:new Error('recorder error')});},20);}+ requestData(){} stop(){this.state='inactive';this.onstop();}+ };`);+ assert.equal(await run('Archify.motion.recordWebm({duration:250,fps:10}).then(()=>false,()=>true)'),true);+ const state=await record('webm-'+fault);assert.ok(state.urls.every(u=>u.revoked));assert.ok(state.tracks.length>0);assert.ok(state.tracks.every(s=>s==='ended'));+ }+ await load({extra:'&fault=unsupported'});+ await run(`Archify.exportMenu.run('webm')`);+ const state=await record('webm-unavailable');assert.equal(state.receipt['data-last-export-error-format'],'webm');assert.deepEqual(state.alerts,[]);+ assert.deepEqual(await run(`(()=>{const b=document.querySelector('[data-format="webm"]');return {disabled:b.disabled,opacity:b.style.opacity};})()`),{disabled:true,opacity:'0.5'});+ });+});diff --git a/archify/test/export-cleanup-browser.test.mjs b/archify/test/export-cleanup-browser.test.mjsnew file mode 100644index 00000000..8800e679--- /dev/null+++ b/archify/test/export-cleanup-browser.test.mjs@@ -0,0 +1,294 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;+const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+};++test('Export cleanup preserves canonical artifacts and live interaction state', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser export checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-export-cleanup-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_EXPORT_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ const file = path.join(scratch, `${mode}.html`);+ if (process.env.ARCHIFY_EXPORT_BASELINE_DIR) {+ fs.copyFileSync(path.join(process.env.ARCHIFY_EXPORT_BASELINE_DIR, `${mode}.html`), file);+ } else {+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), file]);+ }+ files[mode] = file;+ }+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `window.exportTestErrors = [];+ addEventListener('error', e => exportTestErrors.push(e.message));+ addEventListener('unhandledrejection', e => exportTestErrors.push(String(e.reason)));` });+ async function evaluate(expression, awaitPromise = false) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ async function load(file, theme = 'dark', reduced = false) {+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { features: [+ { name: 'prefers-color-scheme', value: theme },+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ const result = await send('Page.navigate', { url: pathToFileURL(file).href + `?theme=${theme}` });+ assert.equal(result.errorText, undefined);+ await loaded;+ await evaluate('(async () => { await document.fonts.ready; await Archify.readerLayout.whenStable(); await Archify.viewerChromeLayout.whenStable(); })()', true);+ assert.deepEqual(await evaluate('exportTestErrors'), []);+ }+ async function exported(label, action = '') {+ // Capture the SVG synchronously at the public export call. Timers and+ // animation frames cannot explain away a live-DOM mutation by cleanup.+ const value = await evaluate(`(async () => {+ ${action}+ const svg = document.querySelector('.diagram-container > svg');+ const before = svg.outerHTML;+ const original = URL.createObjectURL;+ let blob;+ URL.createObjectURL = function (value) {+ if (value.type.startsWith('image/svg+xml')) blob = value;+ return original.call(URL, value);+ };+ let after;+ try {+ const pending = Archify.exportMenu.run('svg');+ after = svg.outerHTML;+ await pending;+ } finally { URL.createObjectURL = original; }+ if (!blob) throw new Error('Export did not produce SVG');+ const text = await blob.text();+ const root = new DOMParser().parseFromString(text, 'image/svg+xml').documentElement;+ const transient = root.querySelectorAll('[data-focus-selected], [data-reach-match], [data-lens-selected], [data-intent-trace-overlay], [data-route-probe-overlay], [data-route-journey-overlay], [data-story-overlay], [data-chapter-preview-role], [data-source-evidence-beacon], [data-relationship-hit-overlay]');+ return { text, liveUnchanged: before === after, transientCount: transient.length,+ geometry: root.getAttribute('viewBox'), liveGeometry: svg.getAttribute('viewBox'),+ rootClean: !['data-view-scale', 'data-focus-active', 'data-reach-active', 'data-route-active', 'data-lens-active', 'data-story-active', 'data-share-route', 'data-share-reach'].some(a => root.hasAttribute(a)),+ resources: performance.getEntriesByType('resource').map(e => e.name).filter(n => /^https?:/.test(n)), errors: exportTestErrors };+ })()`, true);+ assert.equal(value.liveUnchanged, true, `${label}: live SVG changed`);+ assert.equal(value.transientCount, 0, label);+ assert.equal(value.rootClean, true, label);+ assert.equal(value.geometry, value.liveGeometry, label);+ assert.deepEqual(value.resources, [], label);+ assert.deepEqual(value.errors, [], label);+ if (evidence) fs.writeFileSync(path.join(evidence, `${label}.svg`), value.text);+ const { text, ...observation } = value;+ records.push({ label, ...observation });+ return text;+ }++ await t.test('five modes export standalone SVG in both themes and reduced motion', async () => {+ for (const [mode, file] of Object.entries(files)) {+ for (const theme of ['dark', 'light']) {+ await load(file, theme, theme === 'light');+ await exported(`${mode}-${theme}`);+ }+ }+ });++ await t.test('real zoom, focus, preview, lens, story and route actions leave exports clean', async () => {+ await load(files.architecture);+ const pristine = await exported('interaction-pristine');+ const actions = {+ zoom: `Archify.view.zoomIn();`,+ focus: `if (!Archify.focus.set('api', { toggle: false, updateUrl: false })) throw new Error('focus failed');`,+ preview: `if (!Archify.intentTrace.show('api')) throw new Error('preview failed');`,+ lens: `Archify.semanticLens.select('backend'); if (!Archify.semanticLens.active()) throw new Error('lens failed');`,+ story: `Archify.guidedViews.activate('request-path', { updateUrl: false }); Archify.guidedViews.playCurrent(); if (!Archify.guidedViews.isPlaying()) throw new Error('story failed');`,+ route: `Archify.routeProbe.begin({ source: 'users', focusNode: false }); if (!Archify.routeProbe.choose('db', { updateUrl: false })) throw new Error('route failed');`,+ upstream: `Archify.focus.set('api', { toggle: false, updateUrl: false }); if (!Archify.focus.reach('upstream', { toggle: false, updateUrl: false, reveal: false })) throw new Error('reach failed');`,+ downstream: `Archify.focus.set('api', { toggle: false, updateUrl: false }); if (!Archify.focus.reach('downstream', { toggle: false, updateUrl: false, reveal: false })) throw new Error('reach failed');`,+ };+ for (const [name, action] of Object.entries(actions)) {+ await load(files.architecture);+ const text = await exported(`active-${name}`, action);+ // Existing style.removeProperty calls can leave empty style attributes.+ // Apart from that inert serialization detail, compare the entire SVG.+ assert.equal(text.replace(/ style=""/g, ''), pristine.replace(/ style=""/g, ''), name);+ }+ });++ await t.test('raster and share-card exports preserve dimensions and current theme', async () => {+ for (const theme of ['dark', 'light']) {+ await load(files.architecture, theme, theme === 'light');+ for (const format of ['png', 'jpeg', 'webp', 'share-card']) {+ const result = await evaluate(`(async () => {+ Archify.focus.set('api', { toggle: false, updateUrl: false });+ const format = ${JSON.stringify(format)};+ const original = URL.createObjectURL;+ let blob;+ URL.createObjectURL = function (value) {+ if (value.type.startsWith('image/') && value.type !== 'image/svg+xml') blob = value;+ return original.call(URL, value);+ };+ try {+ if (format === 'share-card') blob = await Archify.exportMenu.shareCard();+ else await Archify.exportMenu.run(format);+ } finally { URL.createObjectURL = original; }+ if (!blob) throw new Error('Missing raster export');+ const bitmap = await createImageBitmap(blob);+ const dimensions = [bitmap.width, bitmap.height];+ bitmap.close();+ const svg = document.querySelector('.diagram-container > svg');+ const expected = format === 'share-card' ? [1200, 630] : [svg.viewBox.baseVal.width * 4, svg.viewBox.baseVal.height * 4];+ const data = await new Promise((resolve, reject) => {+ const reader = new FileReader();+ reader.onload = () => resolve(reader.result.split(',')[1]);+ reader.onerror = reject;+ reader.readAsDataURL(blob);+ });+ return { data, dimensions, expected, type: blob.type, errors: exportTestErrors };+ })()`, true);+ assert.deepEqual(result.dimensions, result.expected);+ assert.equal(result.type, format === 'share-card' ? 'image/png' : `image/${format}`);+ assert.deepEqual(result.errors, []);+ const label = `${theme}-${format}`;+ if (evidence) fs.writeFileSync(path.join(evidence, `${label}.${format === 'share-card' ? 'png' : format}`), Buffer.from(result.data, 'base64'));+ const { data, ...observation } = result;+ records.push({ label, ...observation });+ }+ }+ });++ // Private checks supplement the real public exports. The hook exists only in+ // this disposable test artifact; production receives no testing interface.+ const html = fs.readFileSync(files.architecture, 'utf8');+ let cleanup = html.match(/function cleanExportClone\(clone\) \{[\s\S]*?\n \}/)?.[0];+ if (!cleanup && process.env.ARCHIFY_EXPORT_BASELINE_DIR) {+ const start = html.indexOf(' // View transforms and neighborhood focus');+ const end = html.indexOf(' var vb = svg.viewBox.baseVal;', start);+ assert.ok(start >= 0 && end > start);+ cleanup = `function cleanExportClone(clone) {\n${html.slice(start, end)}return canonicalStateClean;\n}`;+ }+ assert.ok(cleanup, 'the extracted cleanup implementation is present');+ const cleanupReference = html.includes('function cleanExportClone(clone)') ? 'cleanExportClone' : cleanup;+ const hooked = html.replace(' function download(blob, filename) {',+ ` window.exportCleanupTest = { serialize: serializeSvg, clean: ${cleanupReference} };\n function download(blob, filename) {`);+ assert.notEqual(hooked, html);+ const privateFile = path.join(scratch, 'private.html');+ fs.writeFileSync(privateFile, hooked);++ await t.test('clone restoration, preservation and repeated cleanup are independent of live DOM', async () => {+ await load(privateFile);+ const result = await evaluate(`(() => {+ const svg = document.querySelector('.diagram-container > svg');+ const before = svg.outerHTML;+ const clone = svg.cloneNode(true);+ // A small authored fragment is the independent preservation oracle.+ const group = document.createElementNS(svg.namespaceURI, 'g');+ group.setAttribute('id', 'authored-preservation');+ group.setAttribute('data-node-id', 'authored');+ group.setAttribute('data-animate', 'node');+ group.innerHTML = '<path d="M 0 0 L 10 20" transform="translate(3 4)"/><text>Keep 中文 & text</text>';+ clone.appendChild(group);+ const authored = group.outerHTML;+ const labels = ['original', '', null].map((value, i) => {+ const node = document.createElementNS(svg.namespaceURI, 'g');+ node.setAttribute('id', 'restore-' + i);+ node.setAttribute('aria-label', 'runtime label');+ node.setAttribute('data-source-evidence-count', '2');+ if (value !== null) node.setAttribute('data-source-evidence-original-label', value);+ clone.appendChild(node);+ return node;+ });+ clone.setAttribute('data-share-route', 'true');+ clone.setAttribute('data-share-reach', 'upstream');+ group.setAttribute('data-share-route-match', '');+ group.setAttribute('data-share-reach-match', '');+ const clean = exportCleanupTest.clean(clone);+ const once = clone.outerHTML;+ const twiceClean = exportCleanupTest.clean(clone);+ const empty = document.createElementNS(svg.namespaceURI, 'svg');+ empty.setAttribute('viewBox', '0 0 100 50');+ const emptyBefore = empty.outerHTML;+ const emptyClean = exportCleanupTest.clean(empty);+ const orphan = document.createElementNS(svg.namespaceURI, 'g');+ orphan.setAttribute('data-story-carrier-token', 'true');+ const residual = empty.cloneNode(true);+ residual.appendChild(orphan);+ const residualClean = exportCleanupTest.clean(residual);+ return { clean, twiceClean, unchanged: before === svg.outerHTML, idempotent: once === clone.outerHTML,+ authored: group.outerHTML === authored, labels: labels.map(n => n.getAttribute('aria-label')),+ restorationRecords: clone.querySelectorAll('[data-source-evidence-count], [data-source-evidence-original-label]').length,+ shares: clone.hasAttribute('data-share-route') || clone.hasAttribute('data-share-reach'),+ residualClean, emptyClean, emptyUnchanged: emptyBefore === empty.outerHTML };+ })()`);+ assert.deepEqual(result, { clean: true, twiceClean: true, unchanged: true, idempotent: true,+ authored: true, labels: ['original', null, null], restorationRecords: 0, shares: false,+ residualClean: false, emptyClean: true, emptyUnchanged: true });+ records.push({ label: 'restoration', ...result });+ });++ await t.test('share decoration follows cleanup and preserves snapshot rejection behavior', async () => {+ for (const variant of ['route', 'upstream', 'downstream']) {+ await load(privateFile);+ const result = await evaluate(`(() => {+ const variant = ${JSON.stringify(variant)};+ let snapshot;+ if (variant === 'route') {+ Archify.routeProbe.begin({ source: 'users', focusNode: false });+ Archify.routeProbe.choose('db', { updateUrl: false });+ snapshot = Archify.routeProbe.exportSnapshot();+ } else {+ Archify.focus.set('api', { toggle: false, updateUrl: false });+ Archify.focus.reach(variant, { toggle: false, updateUrl: false, reveal: false });+ snapshot = Archify.focus.reachabilitySnapshot();+ }+ if (!snapshot) throw new Error('missing ' + variant + ' snapshot');+ const key = variant === 'route' ? 'routeSnapshot' : 'reachSnapshot';+ const field = variant === 'route' ? 'routeStateClean' : 'reachStateClean';+ const svg = document.querySelector('.diagram-container > svg');+ const before = svg.outerHTML;+ const data = exportCleanupTest.serialize(1, { [key]: snapshot });+ const rejected = exportCleanupTest.serialize(1, { [key]: { ...snapshot, nodeIds: [] } });+ const viewBox = svg.getAttribute('viewBox');+ svg.setAttribute('viewBox', '0 0 0 0');+ const invalidDimensions = exportCleanupTest.serialize(1, { [key]: snapshot });+ svg.setAttribute('viewBox', viewBox);+ const root = new DOMParser().parseFromString(data.svgString, 'image/svg+xml').documentElement;+ return { text: data.svgString, canonical: data.canonicalStateClean, accepted: data[field],+ rejected: rejected[field], invalidDimensions: invalidDimensions[field], unchanged: before === svg.outerHTML,+ route: root.hasAttribute('data-share-route'), reach: root.getAttribute('data-share-reach'),+ ids: [...root.querySelectorAll('[data-share-route-match][data-node-id], [data-share-reach-match][data-node-id]')].map(n => n.getAttribute('data-node-id')).sort(),+ expectedIds: snapshot.nodeIds.slice().sort() };+ })()`);+ assert.equal(result.canonical, true);+ assert.equal(result.accepted, true);+ assert.equal(result.rejected, false);+ assert.equal(result.invalidDimensions, false);+ assert.equal(result.unchanged, true);+ assert.equal(result.route, variant === 'route');+ assert.equal(result.reach, variant === 'route' ? null : variant);+ assert.deepEqual(result.ids, result.expectedIds);+ if (evidence) fs.writeFileSync(path.join(evidence, `share-${variant}.svg`), result.text);+ const { text, ...observation } = result;+ records.push({ label: `share-${variant}`, ...observation });+ }+ });+});diff --git a/archify/test/finder-browser.test.mjs b/archify/test/finder-browser.test.mjsnew file mode 100644index 00000000..95abccd0--- /dev/null+++ b/archify/test/finder-browser.test.mjs@@ -0,0 +1,274 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';+import { createViewerClick } from './helpers/viewer-click.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Finder preserves search, keyboard, contextual Route selection and cleanup', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Finder checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-finder-browser-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_FINDER_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ // A controlled metadata fixture exercises the Finder's input boundary;+ // repository verification and brand rendering have their own tests.+ files.metadata = path.join(scratch, 'metadata.html');+ const metadataSource = fs.readFileSync(files.architecture, 'utf8');+ assert.ok(metadataSource.includes(' Archify.finder = (function () {'), 'Finder fixture anchor');+ fs.writeFileSync(files.metadata, metadataSource.replace(+ ' Archify.finder = (function () {', `+ document.querySelector('[data-node-id="api"]').setAttribute('data-node-brand', 'finder-brand-token');+ var finderOriginalSources = Archify.sourceEvidence.node;+ Archify.sourceEvidence.node = function (id) {+ return id === 'api' ? [{path:'src/finder-proof.js',label:'Finder proof',line:12,endLine:18}] : finderOriginalSources(id);+ };+ Archify.finder = (function () {`));+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ // Match the focused-page setup used by the WebM browser harness so that+ // programmatic SVG focus also dispatches native focusin/focusout events.+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ const click = await createViewerClick({ send, run, timeout: 10000 });+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.finderErrors = [];+ addEventListener('error', e => finderErrors.push(e.message));+ addEventListener('unhandledrejection', e => finderErrors.push(String(e.reason)));+ window.finderWait = (predicate, description = 'Finder observation') => new Promise((resolve, reject) => {+ const start = performance.now();+ function sample() {+ if (predicate()) return resolve();+ if (performance.now()-start > 10000) return reject(new Error(description + ' timed out; open=' + Archify.finder.isOpen() + ', active=' + document.activeElement.id));+ requestAnimationFrame(sample);+ }+ requestAnimationFrame(sample);+ });+ ` });+ async function load(mode = 'architecture', { theme = 'dark', width = 1440, height = 900, reduced = false, query = '' } = {}) {+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });+ await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { media: '', features: [+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}${query}` });+ await loaded;+ await run('document.fonts.ready');+ await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ async function opened() {+ await run(`finderWait(() => Archify.finder.isOpen(), 'Finder panel opening')`);+ await run(`finderWait(() => document.activeElement.id === 'node-finder-input', 'Finder input focus')`);+ }+ async function search(text) {+ await run(`document.getElementById('node-finder-input').select()`);+ await send('Input.insertText', { text });+ }+ async function snapshot(scenario) {+ const value = await run(`(() => {+ const panel=document.getElementById('node-finder'), input=document.getElementById('node-finder-input');+ return {open:Archify.finder.isOpen(), context:Archify.finder.context(), count:Archify.finder.count,+ expanded:document.getElementById('btn-node-finder').getAttribute('aria-expanded'),+ panelContext:panel.getAttribute('data-context'), title:document.getElementById('node-finder-title').textContent,+ query:input.value, placeholder:input.placeholder, empty:document.getElementById('node-finder-empty').hidden,+ status:document.getElementById('node-finder-status').textContent,+ results:[...panel.querySelectorAll('.node-finder-result')].map(el=>({id:el.dataset.nodeId,badge:el.querySelector('em').textContent,aria:el.getAttribute('aria-label')})),+ activeId:document.activeElement.id, activeNode:document.activeElement.getAttribute('data-node-id'),+ focus:Archify.focus.active(), route:Archify.routeProbe.active(),+ routeFinder:document.getElementById('route-probe').getAttribute('data-finder-open'),+ errors:finderErrors,+ external:performance.getEntriesByType('resource').map(e=>e.name).filter(n=>/^https?:/.test(n))};+ })()`);+ assert.deepEqual(value.errors, [], scenario); assert.deepEqual(value.external, [], scenario);+ records.push({ scenario, ...value });+ return value;+ }+ const ids = state => state.results.map(item => item.id);++ await t.test('five modes initialize one index and no external resources', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode);+ const state = await snapshot(mode + '-initial');+ assert.equal(state.open, false); assert.equal(state.count, state.results.length);+ assert.equal(state.count, await run(`document.querySelectorAll('.diagram-container svg [data-node-id]').length`));+ assert.equal(new Set(ids(state)).size, state.count);+ // One full open/close cycle covers the shared controller; retain+ // initialization and index checks for all five renderer inputs.+ if (mode === 'architecture') {+ await click('#btn-node-finder'); await opened();+ assert.equal((await snapshot(mode + '-open')).expanded, 'true');+ await key('Escape', 'Escape', 27);+ assert.equal((await snapshot(mode + '-closed')).activeId, 'btn-node-finder');+ }+ }+ });++ await t.test('search normalizes queries and preserves contextual lists and retained context', async () => {+ await load('metadata'); await click('#btn-node-finder'); await opened();+ for (const query of [' API SERVER ', 'finder-brand-token', 'src/finder-proof.js']) {+ await search(query); const state = await snapshot('query-' + query.trim());+ assert.deepEqual(ids(state), ['api']); assert.equal(state.empty, true);+ assert.match(state.status, /1/);+ }+ await search('no-matching-node');+ const empty = await snapshot('query-empty'); assert.deepEqual(ids(empty), []); assert.equal(empty.empty, false);+ await key('Enter', 'Enter', 13); assert.equal(await run('Archify.finder.isOpen()'), true);+ await run(`Archify.finder.open({context:{kind:'fixture',allowedIds:['db','api'],badges:{api:'custom badge'}}})`); await opened();+ const restricted = await snapshot('restricted');+ assert.deepEqual(ids(restricted), ['api', 'db']); assert.equal(restricted.results[0].badge, 'custom badge');+ await run(`Archify.finder.close()`);+ const closed = await snapshot('retained-context');+ assert.equal(closed.context, 'fixture'); assert.deepEqual(closed.results, restricted.results);+ await run(`Archify.finder.open({context:{allowedIds:[]}})`); await opened();+ assert.deepEqual(ids(await snapshot('no-allowed-items')), []);+ assert.equal(await run(`Archify.finder.select('missing')`), false);+ // Filtering is a list contract; the public select method uses all items.+ assert.equal(await run(`Archify.finder.select('api')`), true);+ assert.equal(await run('Archify.focus.active()'), 'api');+ await run('Archify.finder.open()'); await opened();+ const reset = await snapshot('default-restored'); assert.equal(reset.context, 'focus'); assert.equal(reset.results.length, reset.count);+ });++ await t.test('trusted keyboard navigation, selection and Escape preserve focus boundaries', async () => {+ await load();+ await key('/', 'Slash', 191); await opened();+ await key('ArrowDown', 'ArrowDown', 40);+ const first = await snapshot('keyboard-first'); assert.equal(first.activeNode, first.results[0].id);+ await key('ArrowUp', 'ArrowUp', 38);+ assert.equal((await snapshot('keyboard-wrap')).activeNode, first.results.at(-1).id);+ await key('Home', 'Home', 36); assert.equal((await snapshot('keyboard-home')).activeNode, first.results[0].id);+ await key('End', 'End', 35); assert.equal((await snapshot('keyboard-end')).activeNode, first.results.at(-1).id);+ await key('Escape', 'Escape', 27);+ assert.equal((await snapshot('keyboard-escape')).activeId, 'btn-node-finder');+ await run(`Archify.guidedViews.activate('request-path')`);+ await run(`finderWait(() => !Archify.guidedViews.handoff())`);+ await key('/', 'Slash', 191); await opened(); await search('API Server');+ // Slash in an input must not reopen the panel and erase the query.+ await key('/', 'Slash', 191); assert.equal(await run(`document.getElementById('node-finder-input').value`), 'API Server');+ await key('Enter', 'Enter', 13);+ await run(`finderWait(() => !document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ const selected = await snapshot('normal-selection');+ assert.equal(selected.open, false); assert.equal(selected.focus, 'api'); assert.equal(selected.activeNode, 'api');+ assert.equal(await run('Archify.guidedViews.active()'), null);+ assert.match(await run('location.hash'), /focus=api/);+ assert.equal(await run(`(() => {const n=document.querySelector('.diagram-container svg [data-node-id="api"]').getBoundingClientRect(),s=Archify.viewerChromeLayout.stageRect();return n.right>s.left&&n.left<s.right&&n.bottom>s.top&&n.top<s.bottom;})()`), true);+ });++ await t.test('real Route controls select source and target; cancellation restores Route focus', async () => {+ await load(); await click('#btn-route-probe'); await click('#route-probe-find'); await opened();+ let state = await snapshot('route-source');+ assert.equal(state.context, 'route-source'); assert.equal(state.routeFinder, 'true');+ assert.ok(ids(state).includes('users')); assert.ok(!ids(state).includes('db'));+ await key('Escape', 'Escape', 27);+ state = await snapshot('route-source-cancel'); assert.equal(state.route, 'source'); assert.equal(state.routeFinder, null); assert.equal(state.activeId, 'route-probe-find');+ await click('#route-probe-find'); await opened(); await search('Users');+ await click('.node-finder-result[data-node-id="users"]');+ state = await snapshot('route-source-selected'); assert.equal(state.route, 'target'); assert.equal(state.open, false); assert.equal(state.routeFinder, null);+ await click('#route-probe-find'); await opened();+ state = await snapshot('route-target'); assert.equal(state.context, 'route-target');+ assert.ok(ids(state).includes('db')); assert.ok(!ids(state).includes('users')); assert.ok(!ids(state).includes('auth'));+ assert.match(state.results.find(item => item.id === 'db').badge, /4/);+ assert.equal(await run(`Archify.finder.select('auth')`), false);+ assert.equal(await run('Archify.finder.isOpen()'), true);+ await key('Escape', 'Escape', 27);+ assert.equal((await snapshot('route-target-cancel')).activeId, 'route-probe-find');+ await click('#route-probe-find'); await opened(); await search('PostgreSQL');+ await key('Enter', 'Enter', 13);+ state = await snapshot('route-result'); assert.equal(state.route, 'result'); assert.equal(state.routeFinder, null); assert.equal(state.open, false);+ const result = await run('Archify.routeProbe.result()');+ assert.deepEqual(result.nodes, ['users', 'cdn', 'lb', 'api', 'db']); assert.equal(result.hops, 4);+ // A sink is allowed by Route's public API even though the source picker+ // filters it out. Its actual target context must render an empty list.+ await run(`Archify.routeProbe.begin({source:'db'})`);+ await click('#route-probe-find'); await opened();+ state = await snapshot('route-empty-target');+ assert.equal(state.context, 'route-target'); assert.deepEqual(ids(state), []); assert.equal(state.empty, false);+ await key('Enter', 'Enter', 13); assert.equal(await run('Archify.routeProbe.active()'), 'target');+ await key('Escape', 'Escape', 27);+ await click('#route-probe-clear'); await key('/', 'Slash', 191); await opened();+ assert.equal((await snapshot('route-cleared-default')).context, 'focus');+ });++ await t.test('panel coordination, outside clicks, repeated close and embed retain baseline semantics', async () => {+ await load();+ await run('Archify.exportMenu.open(); Archify.finder.open()'); await opened();+ assert.equal(await run('Archify.exportMenu.isOpen()'), false);+ await run('Archify.semanticLens.open(); Archify.finder.open()'); await opened();+ assert.equal(await run('Archify.semanticLens.isOpen()'), false);+ await run(`Archify.finder.close(); document.querySelector('[data-legend-kind][role="button"]').focus()`);+ assert.equal(await run(`document.querySelector('.diagram-container > svg').hasAttribute('data-legend-preview-active')`), true);+ await run('Archify.finder.open()'); await opened();+ assert.equal(await run(`document.querySelector('.diagram-container > svg').hasAttribute('data-legend-preview-active')`), false);+ await click('#btn-node-finder'); assert.equal(await run('Archify.finder.isOpen()'), false);+ await click('#btn-node-finder'); await opened();+ await click('h1'); assert.equal(await run('Archify.finder.isOpen()'), false);+ const rapid = await run(`(() => {Archify.finder.open(); const a=Archify.finder.close({restoreFocus:false}); const b=Archify.finder.close({restoreFocus:false}); return {a:a===undefined,b:b===undefined,open:Archify.finder.isOpen()};})()`);+ assert.deepEqual(rapid, { a: true, b: true, open: false });+ await run('new Promise(resolve => requestAnimationFrame(resolve))');+ await snapshot('rapid-close');+ await load('architecture', { query: '&embed=1' });+ assert.equal(await run('Archify.finder.open()'), false); assert.equal((await snapshot('embed')).open, false);+ });++ await t.test('themes, constrained viewport, reduced motion and exported SVG', async () => {+ for (const theme of ['dark', 'light']) {+ await load('architecture', { theme, width: 640, height: 600, reduced: true });+ await click('#btn-node-finder'); await opened();+ const layout = await run(`(() => {const p=document.getElementById('node-finder').getBoundingClientRect(),r=document.getElementById('node-finder-results'); return {visible:p.width>0&&p.height>0,within:p.left>=-1&&p.right<=innerWidth+1&&p.top>=-1&&p.bottom<=innerHeight+1,scroll:getComputedStyle(r).overflowY};})()`);+ assert.equal(layout.visible, true); assert.equal(layout.within, true); assert.match(layout.scroll, /auto|scroll/);+ await snapshot('constrained-' + theme);+ if (evidence) {+ await run(`Promise.all(document.querySelector('.node-finder-search').getAnimations({subtree:true}).map(animation=>animation.finished.catch(()=>{})))`);+ await run('new Promise(resolve=>requestAnimationFrame(()=>requestAnimationFrame(resolve)))');+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, theme + '.png'), Buffer.from(shot.data, 'base64'));+ }+ await search('API Server'); await key('Enter', 'Enter', 13);+ await run(`finderWait(() => !document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ assert.equal(await run('Archify.focus.active()'), 'api');+ const exported = await run(`(async () => {+ const original=URL.createObjectURL; let blob;+ URL.createObjectURL=function(value){if(value.type.startsWith('image/svg+xml'))blob=value;return original.call(URL,value);};+ try {await Archify.exportMenu.run('svg');} finally {URL.createObjectURL=original;}+ const text=await blob.text(),root=new DOMParser().parseFromString(text,'image/svg+xml').documentElement;+ return {clean:!root.querySelector('[id^="node-finder"],.node-finder-result,[data-focus-selected]')&&!root.hasAttribute('data-focus-active'),geometry:root.getAttribute('viewBox')===document.querySelector('.diagram-container > svg').getAttribute('viewBox')};+ })()`);+ assert.deepEqual(exported, { clean: true, geometry: true });+ await snapshot('export-' + theme);+ }+ });+});diff --git a/archify/test/focus-browser.test.mjs b/archify/test/focus-browser.test.mjsnew file mode 100644index 00000000..d1f88741--- /dev/null+++ b/archify/test/focus-browser.test.mjs@@ -0,0 +1,226 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { findChrome } from '../bin/visual-check.mjs';+import { desktopBrowser, desktopPointerCheck } from './helpers/desktop-browser.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Focus preserves semantic selection, relationships, reachability and shared flow tokens', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Focus checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-focus-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_FOCUS_EVIDENCE;+ const records = [];+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ t.after(() => { if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n'); });+ const cases = { architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json', sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json', lifecycle: 'agent-run.lifecycle.json' };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`), path.join(skillRoot, 'examples', example), files[mode]]);+ }+ // The graph fixture deliberately exercises DOM fragment contracts outside IR validation.+ const graph = `<g data-edge-key="a" data-edge-id="edge-a" data-edge-from="users" data-edge-to="cdn"></g>+ <path data-edge-key="a" data-edge-id="edge-a" data-edge-from="users" data-edge-to="cdn" d="M 110 180 L 245 180"/>+ <line data-edge-key="b" data-edge-id="edge-b" data-edge-from="cdn" data-edge-to="lb" x1="245" y1="180" x2="380" y2="180"/>+ <polyline data-edge-key="c" data-edge-id="edge-c" data-edge-from="lb" data-edge-to="users" points="380,210 110,210 110,180"/>+ <path data-edge-key="d" data-edge-id="edge-d" data-edge-from="cdn" data-edge-to="api" d="M 245 180 Q 380 100 515 180"/>+ <path data-edge-key="e" data-edge-id="edge-e" data-edge-from="cdn" data-edge-to="api" d="M 245 180 Q 380 260 515 180"/>+ <g data-edge-key="f" data-edge-id="edge-f" data-edge-from="api" data-edge-to="db" transform="translate(0 3)"><path d="M 515 180 L 650 180"/></g>+ <path data-edge-key="g" data-edge-id="edge-g" data-edge-from="api" data-edge-to="api" d="M 515 180 C 470 100 560 100 515 180"/>+ <path data-edge-key="h" data-edge-id="edge-h" data-edge-from="db" data-edge-to="cache" d="M 650 180 L 785 180"/>+ <line data-edge-key="i" data-edge-id="edge-i" data-edge-from="worker" data-edge-to="cdn" x1="920" y1="230" x2="245" y2="230"/>+ ${['users','cdn','lb','api','db','cache','worker','isolated'].map((id,i)=>`<g data-node-id="${id}" data-node-label="${id}" data-node-kind="${id==='db'?'database':id==='worker'?'messagebus':'backend'}" tabindex="0" role="button"><rect x="${60+i*135}" y="150" width="100" height="60" fill="var(--backend-fill)"/><text x="${70+i*135}" y="185">${id}</text></g>`).join('')}`;+ const graphSetup = `var fixtureSvg=document.querySelector('.diagram-container > svg');fixtureSvg.setAttribute('viewBox','0 0 1200 500');fixtureSvg.setAttribute('data-animation','trace');fixtureSvg.innerHTML=${JSON.stringify(graph)};`;+ function variant(name, setup) {+ files[name] = path.join(scratch, name + '.html');+ const original = fs.readFileSync(files.architecture, 'utf8');+ assert.ok(original.includes(' var Archify = {};'), 'Focus fixture anchor');+ fs.writeFileSync(files[name], original.replace(' var Archify = {};', setup + '\n var Archify = {};'));+ }+ variant('graph', graphSetup);+ variant('no-geometry', graphSetup + `document.querySelector('[data-edge-key="f"] path').remove();`);+ const browser = desktopBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const checkPointer = await desktopPointerCheck(browser, session);+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const r = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(r.exceptionDetails, undefined, r.exceptionDetails?.exception?.description);+ return r.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.focusErrors=[];window.pulseEvents=[];addEventListener('error',e=>focusErrors.push(e.message));addEventListener('unhandledrejection',e=>focusErrors.push(String(e.reason)));+ for(const type of ['animationend','animationcancel'])addEventListener(type,e=>{if(e.target.matches('.relationship-flow-pulse'))pulseEvents.push({type,trusted:e.isTrusted});},true);+ try{localStorage.removeItem('archify-motion');}catch(_){}+ window.focusWait=predicate=>new Promise((resolve,reject)=>{const start=performance.now();function poll(){if(predicate())return resolve();if(performance.now()-start>12000)return reject(new Error('Focus observation timed out'));requestAnimationFrame(poll);}requestAnimationFrame(poll);});+ ` });+ let navigationId=0;+ async function load(mode='graph', { theme='dark', reduced=true, width=1440, hash='' }={}) {+ await send('Input.dispatchMouseEvent',{type:'mouseMoved',x:0,y:0});+ await send('Emulation.setDeviceMetricsOverride',{width,height:900,deviceScaleFactor:1,mobile:false});+ await send('Emulation.setEmulatedMedia',{features:[{name:'prefers-reduced-motion',value:reduced?'reduce':'no-preference'}]});+ const loaded=browser.cdp.waitFor('Page.loadEventFired',session);+ await send('Page.navigate',{url:pathToFileURL(files[mode]).href+'?theme='+theme+'&keep=yes&run='+(++navigationId)+hash});await loaded;+ await checkPointer();+ await run('document.fonts.ready');await stable();+ }+ async function stable() {+ await run(`focusWait(()=>!document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ await run('Archify.viewerChromeLayout.whenStable()');+ await run('new Promise(resolve=>requestAnimationFrame(()=>requestAnimationFrame(resolve)))');+ }+ const node=id=>`.diagram-container > svg [data-node-id="${id}"]`;+ const hit=key=>`[data-relationship-hit-key="${key}"]`;+ const relation=key=>`#relationship-lens-list [data-relationship-key="${key}"]`;+ async function point(selector) { return run(`(()=>{const r=document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect();return {x:r.left+r.width/2,y:r.top+r.height/2};})()`); }+ async function move(selector) { await send('Input.dispatchMouseEvent',{type:'mouseMoved',...(selector?await point(selector):{x:0,y:0})}); }+ async function click(selector) {+ const p=await point(selector);await send('Input.dispatchMouseEvent',{type:'mousePressed',...p,button:'left',clickCount:1});await send('Input.dispatchMouseEvent',{type:'mouseReleased',...p,button:'left',clickCount:1});await stable();+ }+ async function key(key,code,windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent',{type:'keyDown',key,code,windowsVirtualKeyCode,text:key==='Enter'?'\r':key===' '?' ':undefined});await send('Input.dispatchKeyEvent',{type:'keyUp',key,code,windowsVirtualKeyCode});await stable();+ }+ async function focus(selector) { await run(`document.querySelector(${JSON.stringify(selector)}).focus({preventScroll:true})`); }+ async function select(id,options={}) { assert.equal(await run(`Archify.focus.set(${JSON.stringify(id)},${JSON.stringify(options)})`),true);await stable(); }+ async function snapshot(scenario) {+ const s=await run(`(()=>{const svg=document.querySelector('.diagram-container > svg'),f=Archify.focus,chip=document.getElementById('focus-chip');+ const attrs=e=>Object.fromEntries([...e.attributes].filter(a=>/^(data-(focus|relationship|reach)|aria-(pressed|expanded|current))/.test(a.name)).map(a=>[a.name,a.value]));+ return {active:f.active(),relationship:f.relationship(),reach:f.reachability(),snapshot:f.reachabilitySnapshot(),hash:location.hash,svg:attrs(svg),chip:{hidden:chip.hidden,label:document.getElementById('focus-label').textContent,attrs:attrs(chip)},+ nodes:[...svg.querySelectorAll('[data-node-id]')].map(n=>({id:n.dataset.nodeId,attrs:attrs(n)})),edges:[...svg.querySelectorAll('[data-edge-from]')].map(n=>({key:n.dataset.edgeKey,attrs:attrs(n)})),+ hits:[...svg.querySelectorAll('[data-relationship-hit-key]')].map(n=>({key:n.dataset.relationshipHitKey,tab:n.tabIndex,attrs:attrs(n)})),+ rows:[...document.querySelectorAll('#relationship-lens-list [data-relationship-key]')].map(n=>({key:n.dataset.relationshipKey,target:n.dataset.relationshipTarget,attrs:attrs(n)})),pulse:svg.querySelectorAll('[data-relationship-pulse-overlay]').length,errors:focusErrors,external:performance.getEntriesByType('resource').map(r=>r.name).filter(n=>/^https?:/.test(n))};})()`);+ assert.deepEqual(s.errors,[],scenario);assert.deepEqual(s.external,[],scenario);records.push({scenario,...s});return s;+ }++ await t.test('five modes expose the same Focus and flowTokens surfaces at cold start',async()=>{+ const expected=['set','setMany','clear','copyLink','reach','clearReach','reachabilitySnapshot','inspectRelationship','inspectRelationshipById','reposition','relationship','reachability','active'].sort();+ for(const mode of Object.keys(cases)) {+ await load(mode);assert.deepEqual(await run('Object.keys(Archify.focus).sort()'),expected);assert.deepEqual(await run('Object.keys(Archify.flowTokens).sort()'),['create','kind','path']);+ const cold=await snapshot(mode+'-cold');assert.equal(cold.active,null);+ const id=await run(`document.querySelector('.diagram-container > svg [data-node-id]').dataset.nodeId`);await select(id);assert.equal((await snapshot(mode+'-selected')).active,id);+ }+ });+ await t.test('native node input and option variants preserve selection and cleanup side effects',async()=>{+ await load();await click(node('users'));assert.equal((await snapshot('node-click')).active,'users');+ await focus(node('users'));await key(' ','Space',32);assert.equal(await run('Archify.focus.active()'),null);+ await focus(node('cdn'));await key('Enter','Enter',13);assert.equal(await run('Archify.focus.active()'),'cdn');+ await run(`document.querySelector('.diagram-container').setAttribute('data-just-panned','true');document.querySelector('[data-node-id="users"]').dispatchEvent(new MouseEvent('click',{bubbles:true}))`);assert.equal(await run('Archify.focus.active()'),'cdn');await run(`document.querySelector('.diagram-container').removeAttribute('data-just-panned')`);+ const many=await run(`(()=>{const result=Archify.focus.setMany(['cdn','missing','users','cdn'],{toggle:false,hideChip:true,updateUrl:false});const copy=Archify.focus.active();copy.push('db');return {result,active:Archify.focus.active(),hidden:document.getElementById('focus-chip').hidden};})()`);+ assert.deepEqual(many,{result:true,active:['cdn','users'],hidden:true});const multi=await snapshot('multi-selection');assert.deepEqual(multi.edges.filter(e=>'data-focus-match' in e.attrs).map(e=>e.key),['a','a']);+ await run(`Archify.focus.setMany(['users','cdn'],{toggle:false,label:'Custom',urlKey:'view',urlValue:'custom'});`);assert.equal((await snapshot('custom-selection')).hash,'#view=custom');+ await run(`Archify.semanticLens.select('backend')`);assert.equal(await run(`Archify.focus.setMany([])`),false);assert.equal(await run('Archify.semanticLens.active()'),null);+ await run(`Archify.routeProbe.begin({source:'users'})`);assert.equal(await run(`Archify.focus.setMany(['missing'])`),false);assert.equal(await run('Archify.routeProbe.active()'),null);+ await run(`Archify.routeProbe.begin({source:'users'});Archify.focus.set('api',{preserveRoute:true,updateUrl:false})`);assert.notEqual(await run('Archify.routeProbe.active()'),null);+ await run(`Archify.routeProbe.clear();Archify.focus.set('api',{toggle:false});Archify.focus.clear({restoreFocus:true,updateUrl:false,preserveView:true})`);assert.equal(await run('document.activeElement.dataset.nodeId'),'api');assert.equal(await run('Archify.focus.active()'),null);+ await run('Archify.focus.clear();Archify.focus.clear()');assert.equal((await snapshot('repeated-clear')).hash,'');+ });+ await t.test('Passport rows preserve keyboard navigation, missing metadata and no-neighbor state',async()=>{+ await load();await select('cdn');await focus('#btn-focus-relations');await key('Enter','Enter',13);+ assert.equal(await run(`document.querySelectorAll('#relationship-lens-list [data-relationship-target]').length`),5);+ await focus(relation('a'));await key('End','End',35);assert.equal(await run('document.activeElement.dataset.relationshipKey'),'i');await key('Home','Home',36);assert.equal(await run('document.activeElement.dataset.relationshipKey'),'b');+ await key('ArrowDown','ArrowDown',40);assert.equal(await run('document.activeElement.dataset.relationshipKey'),'d');await key('Enter','Enter',13);assert.equal(await run('Archify.focus.active()'),'api');assert.equal(await run('document.activeElement.dataset.nodeId'),'api');+ await select('isolated');const s=await snapshot('isolated-passport');assert.equal(s.rows.length,0);assert.deepEqual(await run(`({up:document.getElementById('btn-reach-upstream').disabled,down:document.getElementById('btn-reach-downstream').disabled,evidence:document.getElementById('focus-evidence').hidden,detail:document.getElementById('focus-detail').hidden})`),{up:true,down:true,evidence:true,detail:true});assert.equal(await run(`Archify.focus.reach('upstream')`),false);+ });+ await t.test('relationship focus and pointer intents yield to pins and direct keyboard exploration',async()=>{+ await load();await select('cdn');await focus('#btn-focus-relations');await key('Enter','Enter',13);await move(relation('a'));await focus(relation('b'));await stable();assert.equal((await snapshot('focus-over-hover')).svg['data-relationship-preview-active'],'b');+ await run('document.activeElement.blur()');await stable();assert.equal((await snapshot('hover-restored')).svg['data-relationship-preview-active'],'a');+ await run('Archify.focus.clear()');await move(null);await focus(hit('d'));await key('Enter','Enter',13);assert.equal((await snapshot('direct-pin')).relationship.id,'edge-d');+ await focus(hit('e'));await stable();assert.equal(await run('Archify.focus.relationship().id'),'edge-d');await key('Escape','Escape',27);assert.equal(await run('Archify.focus.active()'),null);+ await focus(hit('a'));await key('ArrowLeft','ArrowLeft',37);assert.equal(await run('document.activeElement.dataset.relationshipKey'),'i');await key('Home','Home',36);assert.equal(await run('document.activeElement.dataset.relationshipKey'),'a');await key(' ','Space',32);assert.equal(await run('Archify.focus.relationship().id'),'edge-a');+ assert.equal(await run(`Archify.focus.inspectRelationshipById('unknown')`),false);await snapshot('direct-navigation');+ });+ await t.test('direct pointer delay, touch filtering and background input keep ownership rules',async()=>{+ await load('graph',{reduced:false});await move(hit('b'));+ await run(`focusWait(()=>document.querySelector('.diagram-container > svg').getAttribute('data-relationship-preview-active')==='b')`);+ await snapshot('direct-pointer-preview');await move(null);await stable();assert.equal((await snapshot('direct-pointer-left')).svg['data-relationship-preview-active'],undefined);+ await move(hit('b'));await move(null);await run('new Promise(resolve=>setTimeout(resolve,120))');assert.equal((await snapshot('cancelled-direct-delay')).svg['data-relationship-preview-active'],undefined);+ // Synthetic pointerType/owner fixtures complement the real mouse path above.+ await run(`document.querySelector('[data-relationship-hit-key="b"]').dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType:'touch'}))`);+ await run('new Promise(resolve=>setTimeout(resolve,120))');assert.equal((await snapshot('touch-fixture')).svg['data-relationship-preview-active'],undefined);+ await run(`Archify.semanticLens.select('backend');document.querySelector('[data-relationship-hit-key="b"]').dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType:'mouse'}))`);+ await run('new Promise(resolve=>setTimeout(resolve,120))');assert.equal((await snapshot('lens-blocked-fixture')).svg['data-relationship-preview-active'],undefined);+ await load();await click(node('users'));+ const p=await run(`(()=>{for(let y=30;y<innerHeight;y+=25)for(let x=10;x<innerWidth;x+=25){const e=document.elementFromPoint(x,y);if(e?.matches('.diagram-container > svg'))return {x,y};}throw new Error('No visible SVG background in fixture');})()`);+ await send('Input.dispatchMouseEvent',{type:'mousePressed',...p,button:'left',clickCount:1});await send('Input.dispatchMouseEvent',{type:'mouseReleased',...p,button:'left',clickCount:1});await stable();assert.equal((await snapshot('background-click')).active,null);+ });+ await t.test('authored graph geometry and shared token kinds preserve grouping and direction',async()=>{+ await load();const result=await run(`(()=>{const f=Archify.flowTokens,svg=document.querySelector('.diagram-container > svg');const edges=[...svg.querySelectorAll('[data-edge-from]')];return edges.filter(e=>e.matches('path,line,polyline')||e.querySelector('path')).map(e=>{const shape=e.matches('path,line,polyline')?e:e.querySelector('path');const token=f.create(e,shape,{duration:'0.78s',className:'story-token'});return {key:e.dataset.edgeKey,kind:f.kind(e),path:f.path(shape),duration:token.querySelector('animateMotion').getAttribute('dur'),cloned:!token.isConnected};});})()`);+ assert.equal(result.length,9);assert.deepEqual(result.map(r=>r.kind),['call','call','call','call','call','data','call','data','event']);assert.equal(result[1].path,'M 245 180 L 380 180');assert.equal(result[2].path,'M 380 210 L 110 210 L 110 180');assert.ok(result.every(r=>r.cloned&&r.duration==='0.78s'));records.push({scenario:'flow-tokens',result});+ assert.deepEqual(await run(`({missing:Archify.flowTokens.create(null,null),empty:Archify.flowTokens.path(null)})`),{missing:null,empty:''});+ await load('no-geometry');assert.equal(await run(`Archify.focus.inspectRelationshipById('edge-f')`),false);await snapshot('missing-geometry');+ });+ await t.test('reachability handles cycles, parallel edges, toggles and strict snapshot rejection',async()=>{+ await load();await select('cdn');assert.equal(await run(`Archify.focus.reach('downstream',{reveal:false})`),true);let s=await snapshot('reach-downstream');assert.deepEqual(s.reach.nodeIds,['cdn','lb','api','users','db','cache']);assert.equal(s.reach.maxDepth,3);assert.ok(s.snapshot);assert.equal(s.reach.edgeKeys.length,8);+ assert.equal(await run(`(()=>{const copy=Archify.focus.reachability();copy.nodeIds.length=0;return Archify.focus.reachability().nodeIds.length;})()`),6);+ await run(`Archify.focus.reach('downstream')`);assert.equal(await run('Archify.focus.reachabilitySnapshot()'),null);+ await run(`Archify.focus.reach('upstream',{reveal:false})`);s=await snapshot('reach-upstream');assert.deepEqual(s.reach.nodeIds,['cdn','users','worker','lb']);+ for(const mutation of [+ `svg.querySelector('[data-node-id="users"]').removeAttribute('data-reach-match')`,+ `svg.appendChild(svg.querySelector('[data-node-id="users"]').cloneNode(true))`,+ `svg.appendChild(svg.querySelector('path[data-edge-key="a"]').cloneNode(true))`,+ ]) { await load();await select('cdn');await run(`Archify.focus.reach('downstream',{reveal:false});const svg=document.querySelector('.diagram-container > svg');${mutation}`);assert.equal(await run('Archify.focus.reachabilitySnapshot()'),null); }+ await load();await select('cdn');await run(`Archify.focus.reach('downstream',{reveal:false});Archify.focus.clearReach({updateUrl:true})`);assert.equal((await snapshot('clear-reach')).hash,'#focus=cdn');await select('isolated');assert.equal(await run(`Archify.focus.reach('downstream')`),false);+ });+ await t.test('cold URLs and hashchange preserve focus, relation, reach and query semantics',async()=>{+ for(const [hash,active,relationId] of [['#focus=cdn&reach=downstream','cdn',null],['#relation=edge-d','cdn','edge-d'],['#relation=unknown',null,null],['#view=request-path','users',null],['#focus=isolated','isolated',null],['#route=users~db',null,null]]) {+ await load('graph',{hash});const s=await snapshot('cold-'+hash);if(hash.startsWith('#view=')){assert.ok(s.active);continue;}assert.equal(s.active,active);assert.equal(s.relationship?.id||null,relationId);+ }+ await load();await run(`new Promise(resolve=>{addEventListener('hashchange',()=>requestAnimationFrame(resolve),{once:true});location.hash='focus=cdn&reach=upstream';})`);await stable();assert.equal((await snapshot('hash-reach')).reach.direction,'upstream');+ await run(`new Promise(resolve=>{addEventListener('hashchange',()=>requestAnimationFrame(resolve),{once:true});location.hash='';})`);await stable();assert.equal(await run('Archify.focus.active()'),null);+ await load('graph',{hash:'&embed=1#relation=edge-a'});assert.equal(await run('Archify.focus.relationship()'),null);assert.equal(await run(`document.querySelectorAll('[data-relationship-hit-key]').length`),0);+ });+ await t.test('copy fallback and delayed feedback retain node, reach and relation links',async()=>{+ for(const mode of ['success','reject','missing','false','throw']) {+ await load();await select('cdn');await run(`Archify.focus.reach('downstream',{reveal:false})`);+ const r=await run(`(async()=>{let value;const exec=document.execCommand;Object.defineProperty(navigator,'clipboard',{configurable:true,value:${mode==='missing'?'undefined':`{writeText:text=>{value=text;return ${mode==='success'?'Promise.resolve()':'Promise.reject(new Error("denied"))'};}}`}});+ document.execCommand=()=>{value=document.querySelector('textarea[readonly]').value;${mode==='throw'?'throw new Error("copy denied");':`return ${mode==='false'?'false':'true'};`}};+ try{const copied=await Archify.focus.copyLink();return {copied,hash:new URL(value).hash,query:new URL(value).search,label:document.getElementById('btn-focus-copy').textContent,remaining:document.querySelectorAll('textarea[readonly]').length};}finally{document.execCommand=exec;}})()`);+ assert.equal(r.copied,!['false','throw'].includes(mode));assert.equal(r.hash,'#focus=cdn&reach=downstream');assert.match(r.query,/keep=yes/);assert.equal(r.remaining,0);assert.equal(r.label,r.copied?'Copied':'Copy failed');records.push({scenario:'copy-'+mode,...r});+ await run(`focusWait(()=>document.getElementById('btn-focus-copy').textContent===viewerText('viewer.passport.copy'))`);+ }+ await load();await run(`Archify.focus.inspectRelationshipById('edge-d');Object.defineProperty(navigator,'clipboard',{configurable:true,value:{writeText:value=>{window.copiedFocusUrl=value;return Promise.resolve();}}})`);assert.equal(await run('Archify.focus.copyLink()'),true);assert.equal(await run('new URL(copiedFocusUrl).hash'),'#relation=edge-d');await run('Archify.focus.clear()');await run('new Promise(resolve=>setTimeout(resolve,1650))');assert.equal(await run(`document.getElementById('btn-focus-copy').textContent`),await run(`viewerText('viewer.passport.copy')`));assert.equal(await run('Archify.focus.copyLink()'),false);+ });+ await t.test('real pulse completion and motion transitions preserve static relationship state',async()=>{+ await load('graph',{reduced:false});await run(`Archify.focus.inspectRelationshipById('edge-d')`);assert.equal(await run(`document.querySelectorAll('[data-relationship-pulse-overlay]').length`),1);+ await run(`focusWait(()=>pulseEvents.some(e=>e.type==='animationend'&&e.trusted))`);assert.equal((await snapshot('pulse-ended')).pulse,0);+ await run(`Archify.focus.clear();Archify.focus.inspectRelationshipById('edge-d')`);await send('Emulation.setEmulatedMedia',{features:[{name:'prefers-reduced-motion',value:'reduce'}]});await run(`focusWait(()=>!document.querySelector('[data-relationship-pulse-overlay]'))`);assert.equal((await snapshot('reduced-preserves-pin')).relationship.id,'edge-d');+ await load('graph',{reduced:false});await run(`Archify.focus.inspectRelationshipById('edge-d');focusWait(()=>document.querySelector('.relationship-flow-pulse').getAnimations().some(a=>a.currentTime>0))`);await run(`document.querySelector('.relationship-flow-pulse').style.animation='none'`);await run(`focusWait(()=>pulseEvents.some(e=>e.type==='animationcancel'&&e.trusted))`);assert.equal(await run(`document.querySelectorAll('[data-relationship-pulse-overlay]').length`),0);+ await run(`Archify.focus.clear();Object.defineProperty(document,'hidden',{configurable:true,value:true});Archify.focus.inspectRelationshipById('edge-d');document.dispatchEvent(new Event('visibilitychange'))`);assert.equal((await snapshot('hidden-fixture')).pulse,0);+ await load('graph',{reduced:false});await run(`Archify.motionGovernor.pause();Archify.focus.inspectRelationshipById('edge-d')`);assert.equal((await snapshot('still-preserves-pin')).pulse,0);+ });+ await t.test('real SVG export strips temporary Focus, Reach and relationship state from clones',async()=>{+ for(const [name,setup] of [['focus',`Archify.focus.set('cdn')`],['reach',`Archify.focus.set('cdn');Archify.focus.reach('downstream',{reveal:false})`],['pin',`Archify.focus.inspectRelationshipById('edge-d')`],['preview',`Archify.focus.set('cdn');document.getElementById('btn-focus-relations').click();document.querySelector('#relationship-lens-list [data-relationship-key="b"]').focus()`]]) {+ await load('graph',{reduced:false});await run(setup);+ const present=await run(`(()=>{const svg=document.querySelector('.diagram-container > svg');return {focus:svg.hasAttribute('data-focus-active'),reach:svg.hasAttribute('data-reach-active'),pin:svg.hasAttribute('data-relationship-pin-active'),preview:svg.hasAttribute('data-relationship-preview-active'),pulse:!!svg.querySelector('[data-relationship-pulse-overlay]'),hits:!!svg.querySelector('[data-relationship-hit-overlay]')};})()`);+ assert.deepEqual(present,{focus:true,reach:name==='reach',pin:name==='pin',preview:['pin','preview'].includes(name),pulse:['pin','preview'].includes(name),hits:true});+ const r=await run(`(async()=>{const svg=document.querySelector('.diagram-container > svg'),before=svg.outerHTML,create=URL.createObjectURL;let blob,after;+ const geometry=root=>[...root.querySelectorAll('[data-edge-from]')].map(n=>({tag:n.tagName,key:n.dataset.edgeKey,d:n.getAttribute('d'),points:n.getAttribute('points'),transform:n.getAttribute('transform')}));const source=geometry(svg);+ URL.createObjectURL=value=>{if(value.type.startsWith('image/svg+xml'))blob=value;return create.call(URL,value);};try{const pending=Archify.exportMenu.run('svg');after=svg.outerHTML;await pending;}finally{URL.createObjectURL=create;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {liveSame:before===after,geometrySame:JSON.stringify(source)===JSON.stringify(geometry(root)),viewBox:root.getAttribute('viewBox')===svg.getAttribute('viewBox'),clean:![root,...root.querySelectorAll('*')].some(n=>[...n.attributes].some(a=>/^data-(focus|reach|relationship)/.test(a.name)))};})()`);+ // Moving focus to the export trigger clears the focus-backed preview.+ assert.deepEqual(r,{liveSame:name!=='preview',geometrySame:true,viewBox:true,clean:true});records.push({scenario:'export-'+name,present,...r});+ }+ });+ await t.test('Passport layout and dark/light output remain stable through viewport and camera changes',async()=>{+ for(const width of [390,720,1440]) {+ await load('architecture',{width});await select('api');await focus('#btn-focus-relations');await key('Enter','Enter',13);await run(`Archify.view.reveal(['api'],{reason:'focus',instant:true})`);await stable();+ const r=await run(`(()=>{const chip=document.getElementById('focus-chip'),r=chip.getBoundingClientRect();return {hidden:chip.hidden,width:r.width,left:r.left,right:r.right,viewport:innerWidth,top:r.top,bottom:r.bottom,height:innerHeight};})()`);assert.equal(r.hidden,false);assert.ok(r.width>0&&r.left>=-1&&r.right<=r.viewport+1,JSON.stringify(r));assert.ok(r.top>=-1&&r.bottom<=r.height+1,JSON.stringify(r));records.push({scenario:'layout-'+width,...r});+ }+ for(const theme of ['dark','light']) {+ await load('architecture',{theme});await select('api');await focus('#btn-focus-relations');await key('Enter','Enter',13);await stable();await snapshot(theme+'-passport');+ if(evidence){await run(`Promise.all(document.getAnimations().filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);const shot=await send('Page.captureScreenshot',{format:'png'});fs.writeFileSync(path.join(evidence,theme+'-passport.png'),Buffer.from(shot.data,'base64'));}+ }+ });+});diff --git a/archify/test/generate-viewer.test.mjs b/archify/test/generate-viewer.test.mjsnew file mode 100644index 00000000..1de23f7e--- /dev/null+++ b/archify/test/generate-viewer.test.mjs@@ -0,0 +1,165 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { spawnSync } from 'node:child_process';+import { fileURLToPath } from 'node:url';++const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');+const marker = '/* ARCHIFY:READER_LAYOUT */';+const exportMarker = '/* ARCHIFY:EXPORT */';+const cleanupMarker = '/* ARCHIFY:EXPORT_CLEANUP */';+const chromeMarker = '/* ARCHIFY:CHROME_LAYOUT */';+const cameraMarker = '/* ARCHIFY:CAMERA */';+const radarMarker = '/* ARCHIFY:RADAR */';+const motionMarker = '/* ARCHIFY:MOTION_GOVERNOR */';+const finderMarker = '/* ARCHIFY:NODE_FINDER */';+const intentMarker = '/* ARCHIFY:INTENT_TRACE */';+const lensMarker = '/* ARCHIFY:SEMANTIC_LENS */';+const routeMarker = '/* ARCHIFY:ROUTE_PROBE */';+const focusMarker = '/* ARCHIFY:FOCUS */';+const guidedMarker = '/* ARCHIFY:GUIDED_VIEWS */';+const fragments = { export: exportMarker, reader: marker, cleanup: cleanupMarker, chrome: chromeMarker, camera: cameraMarker, radar: radarMarker, motion: motionMarker, finder: finderMarker, intent: intentMarker, lens: lensMarker, route: routeMarker, guided: guidedMarker, focus: focusMarker };++function fixture(t) {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-viewer-build-'));+ t.after(() => fs.rmSync(root, { recursive: true, force: true }));+ fs.mkdirSync(path.join(root, 'scripts'));+ fs.mkdirSync(path.join(root, 'archify/assets'), { recursive: true });+ fs.cpSync(path.join(repoRoot, 'viewer'), path.join(root, 'viewer'), { recursive: true });+ fs.copyFileSync(path.join(repoRoot, 'scripts/generate-viewer.mjs'), path.join(root, 'scripts/generate-viewer.mjs'));+ const output = path.join(root, 'archify/assets/template.html');+ fs.copyFileSync(path.join(repoRoot, 'archify/assets/template.html'), output);+ return {+ root, output,+ shell: path.join(root, 'viewer/template.source.html'),+ export: path.join(root, 'viewer/export.js'),+ reader: path.join(root, 'viewer/reader-layout.js'),+ cleanup: path.join(root, 'viewer/export-cleanup.js'),+ chrome: path.join(root, 'viewer/viewer-chrome-layout.js'),+ camera: path.join(root, 'viewer/viewer-camera.js'),+ radar: path.join(root, 'viewer/semantic-radar.js'),+ motion: path.join(root, 'viewer/motion-governor.js'),+ finder: path.join(root, 'viewer/node-finder.js'),+ intent: path.join(root, 'viewer/intent-trace.js'),+ lens: path.join(root, 'viewer/semantic-lens.js'),+ route: path.join(root, 'viewer/route-probe.js'),+ guided: path.join(root, 'viewer/guided-views.js'),+ focus: path.join(root, 'viewer/focus.js'),+ run: (...args) => spawnSync(process.execPath, [path.join(root, 'scripts/generate-viewer.mjs'), ...args], {+ cwd: os.tmpdir(), encoding: 'utf8',+ }),+ };+}++test('the committed Viewer rebuilds deterministically outside the repository working directory', (t) => {+ const f = fixture(t);+ const baseline = fs.readFileSync(f.output);+ for (let attempt = 0; attempt < 2; attempt += 1) {+ const generated = f.run();+ assert.equal(generated.status, 0, generated.stderr);+ assert.deepEqual(fs.readFileSync(f.output), baseline);+ }+ const beforeCheck = fs.statSync(f.output).mtimeMs;+ const checked = f.run('--check');+ assert.equal(checked.status, 0, checked.stderr);+ assert.equal(fs.statSync(f.output).mtimeMs, beforeCheck, '--check must not rewrite output');+});++test('editing any authoritative source requires explicit regeneration', (t) => {+ const f = fixture(t);+ for (const input of [f.shell, f.export, f.reader, f.cleanup, f.chrome, f.camera, f.radar, f.motion, f.finder, f.intent, f.lens, f.route, f.guided, f.focus]) {+ const previous = fs.readFileSync(f.output);+ fs.appendFileSync(input, '\n/* source change */\n');+ const stale = f.run('--check');+ assert.equal(stale.status, 1);+ assert.match(stale.stderr, /stale.*generate:viewer/);+ assert.deepEqual(fs.readFileSync(f.output), previous);+ assert.equal(f.run().status, 0);+ assert.equal(f.run('--check').status, 0);+ assert.notDeepEqual(fs.readFileSync(f.output), previous);+ }+});++test('a missing generated template is stale and can be regenerated', (t) => {+ const f = fixture(t);+ fs.unlinkSync(f.output);+ assert.equal(f.run('--check').status, 1);+ assert.equal(fs.existsSync(f.output), false);+ assert.equal(f.run().status, 0);+ assert.equal(f.run('--check').status, 0);+});++for (const [fragment, slot] of Object.entries(fragments)) {+ for (const failure of ['missing shell', 'missing fragment', 'missing marker', 'duplicate marker', 'empty fragment', ...Object.keys(fragments).map(name => `${name} marker`)]) {+ test(`assembly rejects ${fragment}: ${failure} without overwriting a valid artifact`, (t) => {+ const f = fixture(t);+ const previous = fs.readFileSync(f.output);+ if (failure === 'missing shell') fs.unlinkSync(f.shell);+ if (failure === 'missing fragment') fs.unlinkSync(f[fragment]);+ const owner = fragment === 'cleanup' ? f.export : f.shell;+ if (failure === 'missing marker') fs.writeFileSync(owner, fs.readFileSync(owner, 'utf8').replace(slot, ''));+ if (failure === 'duplicate marker') fs.appendFileSync(owner, slot);+ if (failure === 'empty fragment') fs.writeFileSync(f[fragment], ' \n');+ const embeddedSlot = fragments[failure.replace(/ marker$/, '')];+ if (embeddedSlot) fs.appendFileSync(f[fragment], embeddedSlot);+ for (const args of [[], ['--check']]) {+ const result = f.run(...args);+ assert.equal(result.status, 1, failure);+ assert.match(result.stderr, /ENOENT|marker|empty/);+ assert.deepEqual(fs.readFileSync(f.output), previous);+ assert.deepEqual(fs.readdirSync(path.dirname(f.output)), ['template.html']);+ }+ });+ }+}++test('assembly preserves literal replacement tokens, Unicode and source line endings', (t) => {+ const f = fixture(t);+ const reader = '// $& $\' $` $$ 中文 \u{1f5fa}\r\n(function () {})();\r\n';+ fs.writeFileSync(f.shell, `<script>\r\n${focusMarker}${guidedMarker}${routeMarker}${lensMarker}${intentMarker}${finderMarker}${motionMarker}${radarMarker}${cameraMarker}${chromeMarker}${exportMarker}${marker}</script>\n`);+ fs.writeFileSync(f.export, reader + cleanupMarker);+ fs.writeFileSync(f.cleanup, reader);+ fs.writeFileSync(f.chrome, reader);+ fs.writeFileSync(f.camera, reader);+ fs.writeFileSync(f.radar, reader);+ fs.writeFileSync(f.motion, reader);+ fs.writeFileSync(f.finder, reader);+ fs.writeFileSync(f.intent, reader);+ fs.writeFileSync(f.lens, reader);+ fs.writeFileSync(f.route, reader);+ fs.writeFileSync(f.guided, reader);+ fs.writeFileSync(f.focus, reader);+ fs.writeFileSync(f.reader, reader);+ assert.equal(f.run().status, 0);+ assert.equal(fs.readFileSync(f.output, 'utf8'), `<script>\r\n${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}${reader}</script>\n`);+ assert.equal(f.run('--check').status, 0);+});++test('an invalid invocation cannot silently regenerate the template', (t) => {+ const f = fixture(t);+ const previous = fs.readFileSync(f.output);+ const result = f.run('--chek');+ assert.equal(result.status, 1);+ assert.match(result.stderr, /Usage:/);+ assert.deepEqual(fs.readFileSync(f.output), previous);+});++for (const placement of ['additional shell slot', 'moved to shell']) {+ test(`Cleanup ownership rejects ${placement} without overwriting output`, (t) => {+ const f = fixture(t);+ const previous = fs.readFileSync(f.output);+ fs.appendFileSync(f.shell, cleanupMarker);+ if (placement === 'moved to shell') {+ fs.writeFileSync(f.export, fs.readFileSync(f.export, 'utf8').replace(cleanupMarker, ''));+ }+ for (const args of [[], ['--check']]) {+ const result = f.run(...args);+ assert.equal(result.status, 1, result.stderr);+ assert.match(result.stderr, /marker/);+ assert.deepEqual(fs.readFileSync(f.output), previous);+ assert.deepEqual(fs.readdirSync(path.dirname(f.output)), ['template.html']);+ }+ });+}diff --git a/archify/test/guided-views-browser.test.mjs b/archify/test/guided-views-browser.test.mjsnew file mode 100644index 00000000..642d1d4a--- /dev/null+++ b/archify/test/guided-views-browser.test.mjs@@ -0,0 +1,460 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { findChrome } from '../bin/visual-check.mjs';+import { desktopBrowser, desktopPointerCheck } from './helpers/desktop-browser.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Guided Views preserves chapters, Story playback and handoff contracts', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Guided Views checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-guided-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_GUIDED_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ const trace = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', cases.architecture), 'utf8'));+ trace.meta.animation = 'trace';+ const traceInput = path.join(scratch, 'trace.json');+ fs.writeFileSync(traceInput, JSON.stringify(trace)); files.trace = path.join(scratch, 'trace.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'), traceInput, files.trace]);+ // HTML fixtures isolate invalid payloads and graph shapes outside renderer validation.+ function variant(name, views, setup = '') {+ const original = fs.readFileSync(files.trace, 'utf8');+ assert.match(original, /<script id="archify-guided-views-data"[^>]*>[\s\S]*?<\/script>/, 'Guided Views data fixture anchor');+ assert.ok(original.includes(' var Archify = {};'), 'Guided Views setup fixture anchor');+ const html = original.replace(+ /(<script id="archify-guided-views-data"[^>]*>)[\s\S]*?(<\/script>)/,+ (_, start, end) => start + (typeof views === 'string' ? views : JSON.stringify(views)) + end,+ ).replace(' var Archify = {};', setup + '\n var Archify = {};');+ files[name] = path.join(scratch, name + '.html'); fs.writeFileSync(files[name], html);+ }+ const chapter = (id, focus) => ({ id, label: id, focus, note: 'Chapter ' + id });+ const scrollNodes = ['users','cdn','lb','api','db','cache','worker'];+ variant('scroll', Array.from({length: 9}, (_, i) => chapter('chapter-' + i, scrollNodes)));+ variant('empty', []); variant('invalid', '{');+ variant('filtered', [chapter('filtered', ['users', 'unknown', 'users', 'cdn']), chapter('empty', ['unknown']), chapter('solo', ['db'])]);+ variant('short', [chapter('one', ['users', 'cdn']), chapter('two', ['cdn', 'lb'])]);+ variant('disjoint', [chapter('one', ['users','cdn']), chapter('two', ['api','db'])]);+ variant('relations', [chapter('relations', ['users','cdn','lb','api','db']), chapter('other', ['api','cache'])], `+ document.querySelector('.diagram-container > svg').innerHTML =+ '<g data-edge-from="users" data-edge-to="cdn" data-edge-key="a" data-edge-label="forward"></g>' ++ '<g data-edge-from="users" data-edge-to="cdn" data-edge-key="a" data-edge-label="forward" transform="translate(3 4)"><path d="M 90 100 L 230 100"/></g>' ++ '<path data-edge-from="lb" data-edge-to="cdn" data-edge-key="b" data-edge-label="reverse" d="M 370 100 L 230 100"/>' ++ '<line data-edge-from="lb" data-edge-to="api" data-edge-key="c" x1="370" y1="100" x2="510" y2="100"/>' ++ '<polyline data-edge-from="api" data-edge-to="lb" data-edge-key="d" points="510,110 370,110"/>' ++ ['users','cdn','lb','api','db','cache'].map((id,i)=>'<g tabindex="0" data-node-id="'+id+'" data-node-label="'+id+'" data-node-kind="backend"><rect x="'+(50+i*140)+'" y="80" width="80" height="40"/><text x="'+(50+i*140)+'" y="100">'+id+'</text></g>').join('');+ `);+ const browser = desktopBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const checkPointer = await desktopPointerCheck(browser, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.storyErrors=[];window.storyEnds=[];addEventListener('animationend',e=>{if(e.target.matches('.story-trail-flow'))storyEnds.push({name:e.animationName,trusted:e.isTrusted});},true);addEventListener('error',e=>storyErrors.push(e.message));+ addEventListener('unhandledrejection',e=>storyErrors.push(String(e.reason)));+ try {localStorage.removeItem('archify-motion');} catch (_) {}+ window.storyWait=predicate=>new Promise((resolve,reject)=>{+ const start=performance.now();function sample(){if(predicate())return resolve();+ if(performance.now()-start>12000)return reject(new Error('Story observation timed out'));requestAnimationFrame(sample);}requestAnimationFrame(sample);+ });+ ` });+ async function load(mode = 'architecture', { theme = 'dark', reduced = true, suffix = '' } = {}) {+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { media: '', features: [{ name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' }] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}` + suffix });+ await loaded;+ await checkPointer();+ await run('document.fonts.ready'); await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function point(selector) {+ return run(`(()=>{const r=document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect();return {x:r.x+r.width/2,y:r.y+r.height/2};})()`);+ }+ async function move(selector) { await send('Input.dispatchMouseEvent', { type: 'mouseMoved', ...(selector ? await point(selector) : { x: 0, y: 0 }) }); }+ async function click(selector) {+ const p = await point(selector);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', ...p, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...p, button: 'left', clickCount: 1 });+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode, text: key === 'Enter' ? '\r' : key === ' ' ? ' ' : undefined });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ const chapterButton = id => `[data-guided-view-id="${id}"]`;+ const stop = id => `#guided-view-trail [data-story-node="${id}"]`;+ async function activate(id) {+ assert.equal(await run(`Archify.guidedViews.activate(${JSON.stringify(id)})`), true);+ await settled();+ }+ async function settled() {+ await run(`storyWait(()=>!Archify.guidedViews.handoff?.()&&!document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ }+ async function hash(value) {+ await run(`new Promise(resolve=>{addEventListener('hashchange',()=>requestAnimationFrame(resolve),{once:true});location.hash=${JSON.stringify(value)};})`);+ await settled();+ }+ async function snapshot(scenario) {+ const state = await run(`(()=>{+ const g=Archify.guidedViews,svg=document.querySelector('.diagram-container > svg'),panel=document.getElementById('guided-views');+ const attrs=el=>Object.fromEntries([...el.attributes].filter(a=>/^(data-(story|chapter|active-view|playing|autoplay|share)|aria-(current|pressed|live))/.test(a.name)).map(a=>[a.name,a.value]));+ return {count:g.count,active:g.active(),beat:g.beat?.()||null,preview:g.preview?.()||null,playing:g.isPlaying?.()||false,focus:g.focus?.()||[],hidden:panel.hidden,+ panel:attrs(panel),svg:attrs(svg),html:attrs(document.documentElement),hash:location.hash,+ chapters:[...document.querySelectorAll('[data-guided-view-id]')].map(n=>({id:n.dataset.guidedViewId,tab:n.tabIndex,preview:n.dataset.previewActive||null,attrs:attrs(n)})),+ stops:[...document.querySelectorAll('#guided-view-trail [data-story-node]')].map(n=>({id:n.dataset.storyNode,relation:n.dataset.storyRelation,disabled:n.disabled,current:n.getAttribute('aria-current')})),+ nodes:[...svg.querySelectorAll('[data-node-id]')].filter(n=>n.hasAttribute('data-story-step')||n.hasAttribute('data-chapter-preview-role')).map(n=>({id:n.dataset.nodeId,attrs:attrs(n)})),+ edges:[...svg.querySelectorAll('[data-edge-from][data-story-beat-step]')].map(n=>({key:n.dataset.edgeKey,from:n.dataset.edgeFrom,to:n.dataset.edgeTo,attrs:attrs(n)})),+ overlays:svg.querySelectorAll('[data-story-overlay]').length,carriers:svg.querySelectorAll('[data-story-carrier-overlay]').length,+ note:document.getElementById('guided-view-note').textContent,caption:document.getElementById('guided-story-caption').textContent.trim(),+ cue:{hidden:document.getElementById('share-chapter-cue').hidden,state:document.getElementById('share-chapter-cue').dataset.state||null},+ errors:storyErrors,external:performance.getEntriesByType('resource').map(e=>e.name).filter(n=>/^https?:/.test(n))};+ })()`);+ assert.deepEqual(state.errors, [], scenario); assert.deepEqual(state.external, [], scenario);+ records.push({ scenario, ...state }); return state;+ }+ // Controlled clocks expose cancelled callbacks; real timing is tested separately.+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.storyClock=body=>{+ const schedule=setTimeout,cancel=clearTimeout,clock=Date.now;let now=1000,serial=0;const jobs=[];+ window.setTimeout=(fn,delay)=>{const job={id:++serial,fn,delay,cancelled:false};jobs.push(job);return job.id;};+ window.clearTimeout=id=>{const job=jobs.find(j=>j.id===id);if(job)job.cancelled=true;};Date.now=()=>now;+ try{return body({jobs,advance:ms=>now+=ms,last:delay=>jobs.filter(j=>j.delay===delay).at(-1),fire:job=>job.fn()});}+ finally{window.setTimeout=schedule;window.clearTimeout=cancel;Date.now=clock;}+ };+ ` });++ await t.test('five modes, empty payloads and filtered chapter interfaces initialize faithfully', async () => {+ const members=['count','activate','showAll','play','playCurrent','pause','beatLink','copyBeatLink','cancelHandoff','settleHandoff','clearPreview','isPlaying','handoff','active','preview','delta','beat','focus'];+ for (const mode of Object.keys(cases)) {+ await load(mode); const s=await snapshot(mode+'-initial'); assert.equal(s.count,3); assert.equal(s.active,null); assert.equal(s.hidden,false);+ assert.deepEqual(await run('Object.keys(Archify.guidedViews)'),members);+ }+ for (const mode of ['empty','invalid']) {+ await load(mode); assert.deepEqual(await run('Object.keys(Archify.guidedViews)'),['count','active']);+ const s=await snapshot(mode); assert.equal(s.hidden,true); assert.equal(s.count,0);+ }+ await load('filtered'); await activate('filtered'); assert.deepEqual((await snapshot('filtered')).focus,['users','cdn']);+ await activate('empty'); assert.deepEqual((await snapshot('empty-focus')).stops,[]);+ await activate('solo'); assert.equal((await snapshot('solo')).stops.length,1);+ assert.equal(await run(`Archify.guidedViews.activate('unknown')`),false);+ });++ await t.test('native chapter and beat input preserves preview, focus and Escape ordering', async () => {+ await load(); await click(chapterButton('request-path')); await settled();+ assert.equal((await snapshot('chapter-click')).active,'request-path');+ await run(`document.querySelector(${JSON.stringify(chapterButton('request-path'))}).focus()`);+ await key('ArrowRight','ArrowRight',39); assert.equal(await run('Archify.guidedViews.preview()'),'identity-and-cache');+ await key('End','End',35); await key('ArrowRight','ArrowRight',39);+ assert.equal(await run('document.activeElement.dataset.guidedViewId'),'async-work');+ await key('Home','Home',36); await key('ArrowLeft','ArrowLeft',37);+ assert.equal(await run('document.activeElement.dataset.guidedViewId'),'request-path');+ await key('ArrowRight','ArrowRight',39); await key('Enter','Enter',13); await settled();+ assert.equal((await snapshot('chapter-key')).active,'identity-and-cache');+ await click(stop('cache')); await settled(); assert.equal((await snapshot('beat-click')).beat.nodeId,'cache');+ await run(`document.querySelector(${JSON.stringify(stop('api'))}).focus()`); await key(' ','Space',32); await settled();+ assert.equal((await snapshot('beat-key')).beat.nodeId,'api');+ await run(`document.querySelector(${JSON.stringify(chapterButton('async-work'))}).focus()`);+ assert.equal(await run('Archify.guidedViews.preview()'),'async-work');+ await key('Escape','Escape',27); assert.equal(await run('Archify.guidedViews.preview()'),null); assert.equal(await run('Archify.guidedViews.active()'),'identity-and-cache');+ await key('Escape','Escape',27); assert.equal((await snapshot('escape-overview')).active,null);+ await run('document.activeElement.blur()'); await key(']','BracketRight',221); await settled();+ assert.equal(await run('Archify.guidedViews.active()'),'request-path');+ await key('[','BracketLeft',219); assert.equal(await run('Archify.guidedViews.active()'),null);+ await activate('request-path'); await click('.diagram-container > svg [data-node-id="api"]'); await settled();+ const takeover=await snapshot('node-takeover'); assert.equal(takeover.active,null); assert.equal(await run('Archify.focus.active()'),'api');+ await run(`Archify.guide.open()`); await key(']','BracketRight',221); assert.equal(await run('Archify.guidedViews.active()'),null);+ await run(`Archify.guide.close();Archify.finder.open();document.getElementById('node-finder-input').focus()`);+ await key(']','BracketRight',221); assert.equal(await run('Archify.guidedViews.active()'),null);+ });++ await t.test('chapter preview retains independent pointer and focus intent with owner blocking', async () => {+ await load(); await activate('request-path');+ await run(`document.querySelector(${JSON.stringify(chapterButton('identity-and-cache'))}).focus()`);+ await move(chapterButton('async-work')); await run(`storyWait(()=>Archify.guidedViews.preview()==='async-work')`);+ await snapshot('pointer-wins'); await move(null); await run(`storyWait(()=>Archify.guidedViews.preview()==='identity-and-cache')`);+ await snapshot('focus-fallback'); await run('document.activeElement.blur()'); assert.equal(await run('Archify.guidedViews.preview()'),null);+ const touch=await run(`(()=>{const b=document.querySelector(${JSON.stringify(chapterButton('async-work'))});b.dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType:'touch'}));return Archify.guidedViews.preview();})()`);+ assert.equal(touch,null);+ for (const [name,action] of [['route',`Archify.routeProbe.begin({source:'users'})`],['lens',`Archify.semanticLens.select('backend')`],['focus',`Archify.guidedViews.showAll();Archify.focus.set('api')`]]) {+ await load(); await activate('request-path'); await run(action);+ await run(`document.querySelector(${JSON.stringify(chapterButton('async-work'))}).focus()`);+ assert.equal((await snapshot('preview-blocked-'+name)).preview,null);+ }+ await load('trace',{reduced:false}); await activate('request-path'); await run('Archify.guidedViews.play()');+ await run(`document.querySelector(${JSON.stringify(chapterButton('async-work'))}).focus()`);+ assert.equal(await run('Archify.guidedViews.isPlaying()'),false); assert.equal(await run('Archify.guidedViews.preview()'),'async-work');+ await snapshot('preview-pauses-play');+ });++ await t.test('Story geometry distinguishes direction, grouping and duplicate fragments without BFS', async () => {+ await load('relations'); await activate('relations');+ let s=await snapshot('relations'); assert.deepEqual(s.stops.map(n=>n.relation),['start','forward','reverse','multiple','group']);+ assert.deepEqual(s.edges.map(e=>e.key),['a','b','c','d']);+ const geometry=await run(`(()=>{const svg=document.querySelector('.diagram-container > svg'),g=Archify.guidedViews;+ const f=g.focus();f.pop();const d=g.delta('other');d.enter.push('bad');+ return {focus:g.focus(),delta:g.delta('other'),shapes:[...svg.querySelectorAll('.story-trail-flow')].map(n=>({tag:n.tagName,d:n.getAttribute('d'),points:n.getAttribute('points'),transform:n.parentElement.getAttribute('transform'),key:n.getAttribute('data-edge-key')}))};})()`);+ assert.deepEqual(geometry.focus,['users','cdn','lb','api','db']); assert.deepEqual(geometry.delta,{stay:['api'],enter:['cache'],leave:['users','cdn','lb','db']});+ assert.equal(geometry.shapes.length,4); assert.equal(geometry.shapes[0].transform,'translate(3 4)'); assert.equal(geometry.shapes[0].d,'M 90 100 L 230 100'); assert.ok(geometry.shapes.every(n=>n.key===null));+ records.push({scenario:'geometry-copies',...geometry});+ for (const id of ['users','cdn','lb','api','db']) {+ await click(stop(id)); await settled(); s=await snapshot('relation-beat-'+id); assert.equal(s.beat.nodeId,id);+ assert.equal(await run(`(()=>{const b=Archify.guidedViews.beat();b.edgeKeys.push('bad');return Archify.guidedViews.beat().edgeKeys.includes('bad');})()`),false);+ }+ await run(`document.querySelectorAll('.diagram-container > svg [data-edge-from]').forEach(e=>e.remove());Archify.guidedViews.activate('relations')`); await settled();+ assert.equal((await snapshot('no-geometry')).overlays,0);+ });++ await t.test('handoff holds an authored anchor and preserves cancellation versus settling', async () => {+ await load('trace',{reduced:false}); await activate('request-path');+ const holding=await run(`(()=>{Archify.guidedViews.activate('identity-and-cache');return {handoff:Archify.guidedViews.handoff(),disabled:[...document.querySelectorAll('#guided-view-trail button')].every(n=>n.disabled),anchor:document.querySelector('.diagram-container > svg').dataset.chapterAnchor};})()`);+ assert.equal(holding.handoff.mode,'holding'); assert.equal(holding.anchor,'api'); assert.equal(holding.disabled,true);+ await settled(); assert.equal((await snapshot('handoff-complete')).active,'identity-and-cache');+ const states=await run(`storyClock(c=>{+ const reveal=Archify.view.reveal;const calls=[];const receipts=[];+ Archify.view.reveal=(ids,opts)=>{let resolve;const finished=new Promise(r=>resolve=r);const receipt={finished,cancel:(reason,commit)=>{calls.push({reason,commit});resolve({state:reason});}};receipts.push({ids:[...ids],opts,resolve});return receipt;};+ const g=Archify.guidedViews;+ try {+ g.activate('request-path');const hold=c.last(110);const first=g.handoff();g.cancelHandoff('manual-test');c.fire(hold);const cancelled=g.handoff();+ g.activate('identity-and-cache');c.fire(c.last(110));g.settleHandoff('settled-test');+ g.activate('request-path');c.fire(c.last(110));g.cancelHandoff('manual-camera');+ return {firstMode:first.mode,cancelled,calls,receipts:receipts.map(r=>({ids:r.ids,duration:r.opts.duration})),remaining:g.handoff()};+ } finally {g.cancelHandoff('fixture-cleanup');Archify.view.reveal=reveal;}+ })`);+ assert.equal(states.firstMode,'holding'); assert.equal(states.cancelled,null); assert.equal(states.remaining,null);+ assert.deepEqual(states.calls,[{reason:'settled-test',commit:true},{reason:'manual-camera',commit:false}]);+ assert.ok(states.receipts.every(r=>r.duration===420)); records.push({scenario:'handoff-clock-camera-fixture',...states});+ await load('disjoint',{reduced:false});await activate('one');+ const noAnchor=await run(`(()=>{Archify.guidedViews.activate('two');return document.querySelector('.diagram-container > svg').dataset.chapterHandoff;})()`);assert.equal(noAnchor,'no-anchor');await settled();await snapshot('no-anchor-handoff');+ await load('relations',{reduced:false}); await activate('relations');+ await run(`Archify.guidedViews.activate('other')`); await settled();+ await run(`Archify.guidedViews.activate('relations')`); await run(`storyWait(()=>Archify.guidedViews.handoff()?.mode==='settling')`);+ await run('Archify.view.zoomIn()'); assert.equal(await run('Archify.guidedViews.handoff()'),null); await snapshot('manual-camera-handoff');+ await load('trace',{reduced:false}); await activate('request-path');+ const replacement=await run(`storyClock(c=>{const g=Archify.guidedViews;g.activate('identity-and-cache');const old=c.last(110);g.activate('async-work');const before=g.handoff();c.fire(old);const same=g.handoff().id===before.id;g.showAll();c.fire(old);return {same,active:g.active(),handoff:g.handoff()};})`);+ assert.deepEqual(replacement,{same:true,active:null,handoff:null}); records.push({scenario:'replaced-hold',...replacement});+ });++ await t.test('real Story and chapter playback complete while precise clock fixtures preserve dwell', async () => {+ await load('short',{reduced:false}); assert.equal(await run('Archify.guidedViews.play()'),true);+ await run(`storyWait(()=>Archify.guidedViews.active()==='two'&&Archify.guidedViews.isPlaying())`);+ await run(`storyWait(()=>!Archify.guidedViews.isPlaying())`); let s=await snapshot('whole-story-complete');+ assert.equal(s.active,'two'); assert.equal(s.beat.nodeId,'lb'); assert.match(await run(`document.getElementById('guided-view-play-label').textContent`),/Replay/);+ assert.equal(await run('Archify.guidedViews.play()'),true); await run('Archify.guidedViews.pause()'); assert.equal(await run('Archify.guidedViews.active()'),'one');+ await load('short',{reduced:false}); assert.equal(await run('Archify.guidedViews.playCurrent()'),true);+ await run(`storyWait(()=>!Archify.guidedViews.isPlaying())`); s=await snapshot('single-chapter-complete'); assert.equal(s.active,'one'); assert.equal(s.panel['data-autoplay'],'complete');+ await load('short',{reduced:false}); await activate('one');+ const timing=await run(`storyClock(c=>{+ const g=Archify.guidedViews;g.play();const initial=c.last(1600);c.advance(400);g.pause();g.play();const resumed=c.last(1200);c.fire(resumed);const next=c.last(1600);const beat=g.beat().nodeId;g.pause();+ g.showAll();c.fire(initial);c.fire(next);return {initial:initial.delay,resumed:resumed.delay,next:next.delay,beat,after:g.active(),playing:g.isPlaying()};+ })`);+ assert.deepEqual(timing,{initial:1600,resumed:1200,next:1600,beat:'cdn',after:null,playing:false}); records.push({scenario:'dwell-clock',...timing});+ await load('trace',{reduced:false}); await activate('request-path');+ const stale=await run(`storyClock(c=>{const g=Archify.guidedViews;g.play();const old=c.last(1100);document.querySelector('[data-story-node="lb"]').click();const before=g.beat().nodeId;c.fire(old);const after=g.beat().nodeId;g.showAll();return {before,after,playing:g.isPlaying()};})`);+ assert.deepEqual(stale,{before:'lb',after:'lb',playing:false}); records.push({scenario:'manual-step-stale-timer',...stale});+ });++ await t.test('Motion lifecycle and real capability handoffs preserve Story cleanup', async () => {+ for (const [name,action] of [+ ['camera',`Archify.view.zoomIn()`],['guide',`Archify.guide.open()`],['still',`Archify.motionGovernor.pause()`],+ ['print-fixture',`dispatchEvent(new Event('beforeprint'))`],+ ['hidden-fixture',`Object.defineProperty(document,'hidden',{configurable:true,value:true});document.dispatchEvent(new Event('visibilitychange'))`],+ ]) {+ await load('trace',{reduced:false}); await activate('request-path'); await run('Archify.guidedViews.play()'); await run(action);+ let s=await snapshot(name+'-pause'); assert.equal(s.playing,false); assert.equal(s.active,'request-path'); assert.equal(s.carriers,0);+ if(name==='hidden-fixture') await run(`delete document.hidden;document.dispatchEvent(new Event('visibilitychange'))`);+ if(name==='still') await run('Archify.motionGovernor.resume()');+ assert.equal(await run('Archify.guidedViews.isPlaying()'),false);+ }+ for (const [name,action] of [['finder',`Archify.finder.open()`],['route',`Archify.routeProbe.begin({source:'users'})`],['lens',`Archify.semanticLens.select('backend')`]]) {+ await load('trace',{reduced:false}); await activate('request-path'); await run('Archify.guidedViews.play()'); await run(action);+ if(name==='finder'){+ const opened=await snapshot('finder-open-preserves-story');assert.equal(opened.active,'request-path');assert.equal(opened.playing,true);+ await run(`storyWait(()=>document.activeElement.id==='node-finder-input')`);+ await run(`document.getElementById('node-finder-input').value='PostgreSQL';document.getElementById('node-finder-input').dispatchEvent(new Event('input',{bubbles:true}))`);await key('Enter','Enter',13);+ }+ const s=await snapshot(name+'-takeover'); assert.equal(s.active,null); assert.equal(s.playing,false); assert.equal(s.overlays,0);+ }+ await load('trace',{reduced:false});await activate('request-path');await run('Archify.guidedViews.play()');+ await send('Emulation.setEmulatedMedia',{features:[{name:'prefers-reduced-motion',value:'reduce'}]});+ await run(`storyWait(()=>!Archify.guidedViews.isPlaying())`);await snapshot('live-system-reduced-motion');+ await load('architecture',{reduced:false}); assert.equal(await run('Archify.guidedViews.play()'),true); await run('Archify.guidedViews.pause()'); await snapshot('nontrace-playback');+ await load('trace'); assert.equal(await run('Archify.guidedViews.play()'),false);+ await load('trace',{reduced:false}); await activate('request-path'); await click(stop('cdn')); await settled();+ await run(`storyWait(()=>storyEnds.some(e=>e.trusted)&&!document.querySelector('[data-story-carrier-overlay]'))`);+ assert.equal(await run(`document.querySelectorAll('[data-story-pulse]').length`),0); await snapshot('animationend-cleared');+ const preempt=await run(`(()=>{document.querySelector('[data-story-node="lb"]').click();const before=document.querySelectorAll('[data-story-carrier-overlay]').length;const token=Archify.motionGovernor.claim('handoff',()=>{});const after=document.querySelectorAll('[data-story-carrier-overlay]').length;Archify.motionGovernor.release(token);return {before,after};})()`);+ assert.deepEqual(preempt,{before:1,after:0}); records.push({scenario:'pulse-owner-preempt',...preempt});+ // Explicit hidden-page fixture leaves play=1 pending until visibility resumes.+ variant('pending',[chapter('one',['users','cdn'])],`Object.defineProperty(document,'hidden',{configurable:true,value:true});`);+ await load('pending',{reduced:false,suffix:'&embed=1&play=1#view=one'});+ assert.equal(await run(`document.getElementById('guided-views').dataset.autoplay`),'pending');+ await run(`delete document.hidden;document.dispatchEvent(new Event('visibilitychange'))`);+ assert.equal(await run('Archify.guidedViews.isPlaying()'),true); await run('Archify.guidedViews.pause()'); await snapshot('pending-consumed-on-visible');+ });++ await t.test('hash and moment links retain restoration, query and clipboard feedback contracts', async () => {+ await load('trace',{suffix:'&keep=yes#view=request-path&beat=lb'}); await settled();+ await run(`storyWait(()=>Archify.guidedViews.beat()?.nodeId==='lb')`); assert.equal((await snapshot('initial-linked-beat')).beat.nodeId,'lb');+ const link=await run(`(()=>{const u=new URL(Archify.guidedViews.beatLink());return {hash:u.hash,query:u.search};})()`);+ assert.deepEqual(link,{hash:'#view=request-path&beat=lb',query:'?theme=dark&keep=yes'});+ await hash('#view=identity-and-cache&beat=cache'); assert.equal((await snapshot('hash-beat')).beat.nodeId,'cache');+ await hash('#view=identity-and-cache&beat=unknown'); assert.equal((await snapshot('unknown-beat')).beat,null);+ await hash('#view=unknown'); assert.equal((await snapshot('unknown-view')).active,null);+ await hash('#focus=api'); assert.equal((await snapshot('focus-hash')).active,null);+ await hash('#route=users~db'); assert.equal((await snapshot('route-hash')).active,null);+ await hash(''); assert.equal((await snapshot('empty-hash')).active,null);+ assert.equal(await run('Archify.guidedViews.copyBeatLink()'),false);+ await load('trace',{suffix:'&play=1&keep=yes#view=request-path&beat=cdn'}); await settled();+ await run(`storyWait(()=>Archify.guidedViews.beat()?.nodeId==='cdn')`);+ assert.equal(await run(`new URL(Archify.guidedViews.beatLink()).searchParams.has('play')`),false);+ for (const mode of ['success','reject','absent','failure','throw']) {+ const copied=await run(`(async()=>{+ const descriptor=Object.getOwnPropertyDescriptor(navigator,'clipboard'),exec=document.execCommand;let value='',calls=0;+ const expected=Archify.guidedViews.beatLink();+ Object.defineProperty(navigator,'clipboard',{configurable:true,value:${mode==='success'?"{writeText:v=>{value=v;return Promise.resolve();}}":mode==='reject'?"{writeText:()=>Promise.reject(new Error('fixture'))}":'undefined'}});+ document.execCommand=()=>{calls++;value=document.activeElement.value;if(${JSON.stringify(mode)}==='throw')throw new Error('fixture');return ${JSON.stringify(mode)}!=='failure';};+ try {const ok=await Archify.guidedViews.copyBeatLink();return {ok,calls,correct:value===expected,fields:document.querySelectorAll('textarea[readonly]').length,state:document.getElementById('guided-view-beat-link').dataset.copyState};}+ finally{document.execCommand=exec;if(descriptor)Object.defineProperty(navigator,'clipboard',descriptor);else delete navigator.clipboard;}+ })()`);+ assert.equal(copied.ok,!['failure','throw'].includes(mode)); assert.equal(copied.calls,mode==='success'?0:1); assert.equal(copied.correct,true); assert.equal(copied.fields,0); assert.equal(copied.state,copied.ok?'copied':'failed');+ await run(`storyWait(()=>!document.getElementById('guided-view-beat-link').hasAttribute('data-copy-state'))`); records.push({scenario:'copy-'+mode,...copied});+ }+ const late=await run(`(async()=>{const descriptor=Object.getOwnPropertyDescriptor(navigator,'clipboard');let resolve;Object.defineProperty(navigator,'clipboard',{configurable:true,value:{writeText:()=>new Promise(r=>resolve=r)}});+ try{const pending=Archify.guidedViews.copyBeatLink();Archify.guidedViews.showAll();resolve();await pending;const button=document.getElementById('guided-view-beat-link');return {active:Archify.guidedViews.active(),state:button.dataset.copyState,disabled:button.disabled};}+ finally{if(descriptor)Object.defineProperty(navigator,'clipboard',descriptor);else delete navigator.clipboard;}})()`);+ assert.deepEqual(late,{active:null,state:'copied',disabled:true}); records.push({scenario:'copy-completes-after-overview',...late});+ await run(`storyWait(()=>!document.getElementById('guided-view-beat-link').hasAttribute('data-copy-state'))`);+ await load('trace',{reduced:false}); await activate('request-path');+ await run(`location.hash='view=identity-and-cache&beat=cache';new Promise(resolve=>requestAnimationFrame(()=>{location.hash='view=async-work&beat=worker';requestAnimationFrame(resolve);}))`);+ await settled(); await run(`storyWait(()=>Archify.guidedViews.beat()?.nodeId==='worker')`); await snapshot('latest-hash-wins');+ });+++ await t.test('active preview, handoff and carrier serialize without leaking transient state', async () => {+ const actions={+ 'focus-preview':`document.querySelector('[data-guided-view-id="identity-and-cache"]').focus()`,+ 'pointer-preview':`void 0`,+ handoff:`Archify.guidedViews.activate('identity-and-cache')`,+ carrier:`document.querySelector('[data-story-node="cdn"]').click()`,+ };+ for(const [name,action] of Object.entries(actions)){+ await load('trace',{reduced:false});await activate('request-path');+ if(name==='pointer-preview')await move(chapterButton('identity-and-cache'));+ const result=await run(`(async()=>{+ ${action};const svg=document.querySelector('.diagram-container > svg');+ const present=${JSON.stringify(name)}.endsWith('preview')?!!Archify.guidedViews.preview():${JSON.stringify(name)}==='handoff'?!!Archify.guidedViews.handoff():!!svg.querySelector('[data-story-carrier-overlay]');+ const geometry=root=>[...root.querySelectorAll('[data-edge-from]')].map(n=>({tag:n.tagName,key:n.getAttribute('data-edge-key'),d:n.getAttribute('d'),points:n.getAttribute('points'),transform:n.getAttribute('transform')}));+ const sourceGeometry=geometry(svg),before=svg.outerHTML,create=URL.createObjectURL;let blob,after;+ URL.createObjectURL=function(value){if(value.type.startsWith('image/svg+xml'))blob=value;return create.call(URL,value);};+ try{const pending=Archify.exportMenu.run('svg');after=svg.outerHTML;await pending;}finally{URL.createObjectURL=create;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {present,liveSame:before===after,geometrySame:JSON.stringify(sourceGeometry)===JSON.stringify(geometry(root)),viewBox:root.getAttribute('viewBox')===svg.getAttribute('viewBox'),clean:![...root.querySelectorAll('*'),root].some(n=>[...n.attributes].some(a=>/^data-(story|chapter)/.test(a.name)))};+ })()`);+ // Export focuses its trigger before serialization: focus-backed preview clears.+ // Pointer-backed preview remains and must be removed only from the clone.+ assert.deepEqual(result,{present:true,liveSame:name!=='focus-preview',geometrySame:true,viewBox:true,clean:true});records.push({scenario:'export-'+name,...result});+ }+ });++ await t.test('theme, narrow layout, embed moments and real SVG exports keep canonical geometry', async () => {+ for(const theme of ['dark','light']) {+ for(const position of ['overview','beat']) {+ await load('trace',{theme}); await activate('request-path');+ if(position==='beat'){await click(stop('lb'));await settled();}+ const style=await run(`({flow:getComputedStyle(document.querySelector('.story-trail-flow')).animationName,carriers:document.querySelectorAll('[data-story-carrier-overlay]').length})`);+ assert.deepEqual(style,{flow:'none',carriers:0}); await snapshot(theme+'-'+position);+ if(evidence){+ await run(`Promise.all(document.getAnimations().filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);+ const shot=await send('Page.captureScreenshot',{format:'png'});fs.writeFileSync(path.join(evidence,theme+'-'+position+'.png'),Buffer.from(shot.data,'base64'));+ }+ const exported=await run(`(async()=>{const svg=document.querySelector('.diagram-container > svg'),before=svg.outerHTML,create=URL.createObjectURL;let blob,after;+ URL.createObjectURL=function(value){if(value.type.startsWith('image/svg+xml'))blob=value;return create.call(URL,value);};+ try{const pending=Archify.exportMenu.run('svg');after=svg.outerHTML;await pending;}finally{URL.createObjectURL=create;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {liveSame:before===after,viewBox:root.getAttribute('viewBox')===svg.getAttribute('viewBox'),clean:![...root.querySelectorAll('*'),root].some(n=>[...n.attributes].some(a=>/^data-(story|chapter)/.test(a.name)))};+ })()`); assert.deepEqual(exported,{liveSame:true,viewBox:true,clean:true});+ }+ }+ for(const width of [720,390,1440]) {+ await load(); await send('Emulation.setDeviceMetricsOverride',{width,height:900,deviceScaleFactor:1,mobile:false});await run('Archify.viewerChromeLayout.whenStable()');+ await run(`document.querySelector(${JSON.stringify(chapterButton('request-path'))}).focus()`);await key('End','End',35);await key('Enter','Enter',13);await settled();+ await run(`document.querySelector(${JSON.stringify(stop('worker'))}).focus()`);await key('Enter','Enter',13);await settled();+ assert.equal(await run('Archify.guidedViews.active()'), 'async-work');+ assert.equal(await run('Archify.guidedViews.beat().nodeId'), 'worker');+ }+ for(const width of [390,720,1440]) {+ await load('scroll');+ await send('Emulation.setDeviceMetricsOverride',{width,height:900,deviceScaleFactor:1,mobile:false});+ await run('Archify.viewerChromeLayout.whenStable()');+ // Keyboard activation must reveal and center off-screen items itself.+ // preventScroll keeps native focus scrolling from concealing a regression.+ for(const index of [8,4,0]) {+ const chapterId='chapter-'+index;+ await run(`document.querySelector(${JSON.stringify(chapterButton(chapterId))}).focus({preventScroll:true})`);+ await key('Enter','Enter',13);await settled();await run('Archify.viewerChromeLayout.whenStable()');+ assert.equal(await run('Archify.guidedViews.active()'),chapterId);+ for(const nodeId of [null,'worker','api','users']) {+ if(nodeId) {+ await run(`document.querySelector(${JSON.stringify(stop(nodeId))}).focus({preventScroll:true})`);+ await key('Enter','Enter',13);await settled();+ assert.equal(await run('Archify.guidedViews.beat().nodeId'),nodeId);+ }+ const scroll=await run(`(()=>{+ function measure(container,selector) {+ const c=document.getElementById(container),item=c.querySelector(selector),r=item.getBoundingClientRect(),box=c.getBoundingClientRect();+ const left=box.left+c.clientLeft,right=left+c.clientWidth;+ return {itemWidth:r.width,leftGap:r.left-left,rightGap:right-r.right,+ centerDelta:(r.left+r.right-left-right)/2,scroll:c.scrollLeft,maxScroll:c.scrollWidth-c.clientWidth};+ }+ return ${nodeId ? `{trail:measure('guided-view-trail','[data-story-node="${nodeId}"]')}` : `{chapter:measure('guided-view-chapters','[data-guided-view-id="${chapterId}"]')}`};+ })()`);+ for(const [name,position] of Object.entries(scroll)) {+ const context=JSON.stringify({width,chapterId,nodeId,name,...position});+ assert.ok(position.itemWidth>0 && position.leftGap>=-1 && position.rightGap>=-1,'selected item is fully visible: '+context);+ assert.ok(Math.abs(position.centerDelta)<=1 ||+ (position.scroll<=1 && position.centerDelta<0) ||+ (position.scroll>=position.maxScroll-1 && position.centerDelta>0),'centered or clamped at the corresponding edge: '+context);+ if(width===390) assert.ok(position.maxScroll>20,'fixture genuinely overflows: '+context);+ }+ records.push({scenario:'scroll-'+width+'-'+chapterId+'-'+nodeId,...scroll});+ if(width===390 && index===4 && nodeId==='api') {+ await run(`document.getElementById('guided-view-trail').scrollLeft=0;new Promise(resolve=>requestAnimationFrame(()=>requestAnimationFrame(resolve)))`);+ assert.equal(await run(`document.getElementById('guided-view-trail').scrollLeft`),0,'manual scrolling alone must not recenter the active beat');+ }+ }+ }+ }+ for(const suffix of ['&embed=1#view=request-path&beat=lb','&embed=1&play=1#view=request-path&beat=lb']) {+ await load('trace',{suffix});await settled();await run(`storyWait(()=>Archify.guidedViews.beat()?.nodeId==='lb')`);+ const s=await snapshot(suffix.includes('play=1')?'embed-static-share':'embed-pinned');assert.equal(s.playing,false);assert.equal(s.cue.hidden,false);assert.equal(s.cue.state,suffix.includes('play=1')?'reduced-motion':'pinned');+ }+ });+});diff --git a/archify/test/helpers/desktop-browser.mjs b/archify/test/helpers/desktop-browser.mjsnew file mode 100644index 00000000..00bc1f46--- /dev/null+++ b/archify/test/helpers/desktop-browser.mjs@@ -0,0 +1,48 @@+import assert from 'node:assert/strict';+import { spawn } from 'node:child_process';+import { ChromeVisualBrowser } from '../../bin/visual-check.mjs';++// Test-only Blink settings: headless hosts may have no physical mouse.+// Disabling touch emulation would restore those host defaults and undo this.+const pointerSettings = '--blink-settings=availableHoverTypes=2,primaryHoverType=2,availablePointerTypes=4,primaryPointerType=4';++export function desktopBrowser(chrome) {+ return new ChromeVisualBrowser(chrome, {+ spawnImpl: (command, args, options) => spawn(command, [pointerSettings, ...args], options),+ });+}++export async function desktopPointerCheck(browser, session) {+ const version = await browser.cdp.send('Browser.getVersion');+ await browser.cdp.send('Page.addScriptToEvaluateOnNewDocument', { source: `+ (() => {+ // Capture the native query before controlled coarse-pointer fixtures run.+ const query = window.matchMedia.bind(window);+ const sample = () => ({+ hover: query('(hover: hover)').matches,+ fine: query('(pointer: fine)').matches,+ combined: query('(hover: hover) and (pointer: fine)').matches,+ anyHover: query('(any-hover: hover)').matches,+ anyFine: query('(any-pointer: fine)').matches,+ maxTouchPoints: navigator.maxTouchPoints,+ });+ window.__archifyTestPointer = { initial: sample(), sample };+ })();+ ` }, session);+ return async function checkDesktopPointer() {+ const result = await browser.cdp.send('Runtime.evaluate', {+ expression: '({initial:__archifyTestPointer.initial,current:__archifyTestPointer.sample()})',+ returnByValue: true,+ }, session);+ assert.equal(result.exceptionDetails, undefined, 'Desktop pointer diagnostics did not initialize');+ const samples = result.result.value;+ for (const phase of ['initial', 'current']) {+ for (const capability of ['hover', 'fine', 'combined', 'anyHover', 'anyFine']) {+ assert.equal(samples[phase][capability], true,+ `Desktop pointer capability ${phase}.${capability}: ${JSON.stringify({+ browser: version.product, platform: process.platform, pointerSettings, samples,+ })}`);+ }+ }+ };+}diff --git a/archify/test/helpers/viewer-click.mjs b/archify/test/helpers/viewer-click.mjsnew file mode 100644index 00000000..85aae826--- /dev/null+++ b/archify/test/helpers/viewer-click.mjs@@ -0,0 +1,72 @@+import assert from 'node:assert/strict';++// Keep native input and assert the actual event target, so a later docking+// update cannot silently turn a missed click into an unrelated state timeout.+function installClickObserver() {+ const describe = el => el ? { tag: el.tagName, id: el.id, node: el.getAttribute('data-node-id') } : null;+ const state = el => {+ const r = el?.getBoundingClientRect();+ const point = r ? { x: r.x + r.width / 2, y: r.y + r.height / 2 } : null;+ const hit = point && document.elementFromPoint(point.x, point.y);+ return {+ point, rect: r ? [r.x, r.y, r.width, r.height] : null,+ visible: !!el?.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true }),+ enabled: !!el && !el.matches(':disabled,[aria-disabled="true"]'),+ hit: describe(hit), matches: !!el && (el === hit || el.contains(hit)),+ camera: document.querySelector('.diagram-container')?.getAttribute('data-camera-transaction'),+ dock: document.getElementById('route-probe')?.getAttribute('data-route-dock'),+ };+ };+ let listener, observation;+ function arm(selector) {+ if (listener) removeEventListener('click', listener, true);+ observation = null;+ listener = event => {+ const el = document.querySelector(selector);+ observation = { trusted: event.isTrusted, matches: !!el && (el === event.target || el.contains(event.target)),+ target: describe(event.target), state: state(el), x: event.clientX, y: event.clientY };+ };+ addEventListener('click', listener, { capture: true, once: true });+ }+ window.viewerClick = {+ async ready(selector, timeout) {+ document.querySelector(selector)?.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'instant' });+ await Archify.viewerChromeLayout.whenStable();+ return new Promise((resolve, reject) => {+ const start = performance.now();+ let previous;+ function sample() {+ const current = state(document.querySelector(selector));+ const stable = current.rect && previous?.every((value, i) => Math.abs(value - current.rect[i]) < 0.1);+ if (stable && current.visible && current.enabled && current.matches && !current.camera) {+ arm(selector);+ return resolve(current.point);+ }+ if (performance.now() - start > timeout) {+ return reject(new Error('Viewer click target not ready: ' + selector + ' ' + JSON.stringify(current)));+ }+ previous = current.rect;+ requestAnimationFrame(sample);+ }+ requestAnimationFrame(sample);+ });+ },+ finish() {+ removeEventListener('click', listener, true);+ listener = null;+ return observation;+ },+ };+}++export async function createViewerClick({ send, run, timeout }) {+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `(${installClickObserver.toString()})();` });+ return async selector => {+ const point = await run(`viewerClick.ready(${JSON.stringify(selector)}, ${timeout})`);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', ...point, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...point, button: 'left', clickCount: 1 });+ const observation = await run('viewerClick.finish()');+ assert.ok(observation?.trusted && observation.matches,+ `Native click missed ${selector}: ${JSON.stringify({ point, observation })}`);+ };+}diff --git a/archify/test/intent-trace-browser.test.mjs b/archify/test/intent-trace-browser.test.mjsnew file mode 100644index 00000000..497e0934--- /dev/null+++ b/archify/test/intent-trace-browser.test.mjs@@ -0,0 +1,284 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { findChrome } from '../bin/visual-check.mjs';+import { desktopBrowser, desktopPointerCheck } from './helpers/desktop-browser.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Intent Trace preserves input handoffs, transient geometry and cleanup', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Intent Trace checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-intent-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_INTENT_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ const trace = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', cases.architecture), 'utf8'));+ trace.meta.animation = 'trace';+ const traceInput = path.join(scratch, 'trace.json');+ fs.writeFileSync(traceInput, JSON.stringify(trace)); files.trace = path.join(scratch, 'trace.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'), traceInput, files.trace]);++ const browser = desktopBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const checkPointer = await desktopPointerCheck(browser, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.intentErrors=[]; window.intentEnds=[];+ addEventListener('error',e=>intentErrors.push(e.message));+ addEventListener('unhandledrejection',e=>intentErrors.push(String(e.reason)));+ addEventListener('animationend',e=>{if(e.target.matches('.intent-trace-flow'))intentEnds.push({name:e.animationName,trusted:e.isTrusted});},true);+ try {localStorage.removeItem('archify-motion');} catch (_) {}+ window.intentWait=predicate=>new Promise((resolve,reject)=>{+ const start=performance.now();+ function sample(){if(predicate())return resolve();if(performance.now()-start>12000)return reject(new Error('Intent observation timed out'));requestAnimationFrame(sample);}+ requestAnimationFrame(sample);+ });+ // This synchronous fixture isolates timer ordering; ordinary pointer tests+ // below still use the browser's real timers and CDP input.+ window.intentTimerFixture=body=>{+ const schedule=window.setTimeout,cancel=window.clearTimeout,queue=new Map(),delays=[];let serial=0;+ window.setTimeout=(fn,delay)=>{delays.push(delay);queue.set(++serial,fn);return serial;};+ window.clearTimeout=id=>queue.delete(id);+ const node=id=>document.querySelector('.diagram-container svg [data-node-id="'+id+'"]');+ const over=(id,related=null,pointerType='mouse')=>node(id).dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType,relatedTarget:related}));+ const out=id=>node(id).dispatchEvent(new PointerEvent('pointerout',{bubbles:true,pointerType:'mouse'}));+ try {return body({node,over,out,queue,delays,fire:()=>{const [id,fn]=queue.entries().next().value;queue.delete(id);fn();}});}+ finally {window.setTimeout=schedule;window.clearTimeout=cancel;}+ };+ ` });+ async function media(reduced) {+ await send('Emulation.setEmulatedMedia', { media: '', features: [+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ }+ async function load(mode = 'architecture', { theme = 'dark', reduced = false } = {}) {+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await media(reduced);+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}` });+ await loaded;+ await checkPointer();+ await run('document.fonts.ready'); await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function point(selector) {+ return run(`(()=>{const r=document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect();return {x:r.x+r.width/2,y:r.y+r.height/2};})()`);+ }+ async function move(id) {+ const p = id ? await point(`.diagram-container svg [data-node-id="${id}"]`) : { x: 0, y: 0 };+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', ...p });+ }+ async function click(selector) {+ const p = await point(selector);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', ...p, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...p, button: 'left', clickCount: 1 });+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ async function snapshot(scenario) {+ const state = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg');+ return {active:Archify.intentTrace.active(),attribute:svg.getAttribute('data-intent-trace-active'),+ selected:[...svg.querySelectorAll('[data-intent-trace-selected]')].map(n=>n.getAttribute('data-node-id')),+ matched:[...svg.querySelectorAll('[data-node-id][data-intent-trace-match]')].map(n=>n.getAttribute('data-node-id')),+ edges:svg.querySelectorAll('[data-edge-from][data-intent-trace-match]').length,+ overlays:svg.querySelectorAll('[data-intent-trace-overlay]').length,+ directions:[...svg.querySelectorAll('.intent-trace-flow')].map(n=>n.getAttribute('data-direction')),+ status:document.getElementById('intent-trace-status').textContent,+ focus:Archify.focus.active(),route:Archify.routeProbe.active(),owner:Archify.motionGovernor.owner(),+ errors:intentErrors,external:performance.getEntriesByType('resource').map(e=>e.name).filter(n=>/^https?:/.test(n))};+ })()`);+ assert.deepEqual(state.errors, [], scenario); assert.deepEqual(state.external, [], scenario);+ records.push({ scenario, ...state }); return state;+ }+ async function afterTimer() { await run('new Promise(resolve=>setTimeout(resolve,150))'); }++ await t.test('five modes initialize and public return/broadcast contracts remain intact', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode); const initial = await snapshot(mode + '-initial');+ assert.equal(initial.active, null); assert.equal(initial.overlays, 0); assert.equal(initial.status, '');+ assert.deepEqual(await run('Object.keys(Archify.intentTrace).sort()'), ['active', 'clear', 'show']);+ }+ await load();+ const api = await run(`(()=>{+ const p=Archify.intentTrace;const shown=p.show('api',{announce:true}),text=document.getElementById('intent-trace-status').textContent;+ const overlay=document.querySelector('[data-intent-trace-overlay]');+ const repeated=p.show('api',{announce:true}),same=overlay===document.querySelector('[data-intent-trace-overlay]');+ const missing=p.show('missing'),retained=document.getElementById('intent-trace-status').textContent===text;+ const empty=p.show(''),cleared=p.clear(),twice=p.clear();+ return {shown,repeated,same,missing,retained,empty,cleared:cleared===undefined,twice:twice===undefined,text};+ })()`);+ assert.deepEqual({ ...api, text: '' }, { shown: true, repeated: true, same: true, missing: false, retained: true, empty: false, cleared: true, twice: true, text: '' });+ assert.match(api.text, /API Server/); assert.equal((await snapshot('public-cleared')).status, '');+ });++ await t.test('real pointer delay, fast exit, keyboard focus and Escape share cleanup', async () => {+ await load(); await move('api');+ await run(`intentWait(()=>Archify.intentTrace.active()==='api')`);+ let state = await snapshot('hover-api'); assert.equal(state.status, ''); assert.equal(state.overlays, 1);+ await move(); await afterTimer(); assert.equal((await snapshot('hover-left')).active, null);+ await move('db'); await move(); await afterTimer(); assert.equal((await snapshot('fast-exit')).active, null);+ await move('api'); await move('db');+ await run(`intentWait(()=>Archify.intentTrace.active()==='db')`); await afterTimer();+ assert.equal((await snapshot('hover-replaced')).active, 'db');+ await run(`document.querySelector('.diagram-container svg [data-node-id="api"]').focus()`);+ state = await snapshot('keyboard-api'); assert.equal(state.active, 'api'); assert.match(state.status, /API Server/);+ const internalFocus = await run(`(()=>{+ const overlay=document.querySelector('[data-intent-trace-overlay]'),child=document.querySelector('.diagram-container svg [data-node-id="api"] text');+ child.setAttribute('tabindex','0');child.focus();+ const same=overlay===document.querySelector('[data-intent-trace-overlay]')&&Archify.intentTrace.active()==='api';+ child.blur();child.removeAttribute('tabindex');return same;+ })()`);+ assert.equal(internalFocus, true);+ assert.equal((await snapshot('focusout-falls-back')).active, 'db');+ await move();+ await run(`document.querySelector('.diagram-container svg [data-node-id="api"]').focus()`);+ await key('Escape', 'Escape', 27);+ state = await snapshot('escape'); assert.equal(state.active, null); assert.equal(state.status, '');+ await move('db'); await run(`intentWait(()=>Archify.intentTrace.active()==='db')`);+ // Pointerout sync can reuse the retained keyboard reference after clear.+ await move(); assert.equal((await snapshot('retained-focus')).active, 'api');+ await click('.diagram-nav'); await afterTimer();+ assert.equal((await snapshot('outside-pointerdown')).active, null);+ });++ await t.test('controlled timers preserve repeated-show, retained-input and input-filter semantics', async () => {+ await load();+ const result = await run(`intentTimerFixture(({node,over,out,queue,delays,fire})=>{+ const p=Archify.intentTrace;+ node('api').focus();const text=document.getElementById('intent-trace-status').textContent;+ over('db');p.show('api',{announce:true});const pending=queue.size;fire();const afterHover=p.active();+ out('db');const afterSync=p.active();+ over('db');p.clear({announce:false});const cancelled=queue.size,retained=document.getElementById('intent-trace-status').textContent===text;+ out('db');const reactivated=p.active();+ over('api',node('api').querySelector('text'));const internal=queue.size;+ node('api').blur();p.clear();over('db',null,'touch');const touch=queue.size;+ const mm=window.matchMedia;window.matchMedia=()=>({matches:false});over('db');const coarse=queue.size;+ window.matchMedia=undefined;over('db');const fallback=queue.size;fire();window.matchMedia=mm;+ const fallbackActive=p.active();p.clear();+ return {pending,afterHover,afterSync,cancelled,retained,reactivated,internal,touch,coarse,fallback,fallbackActive,delays};+ })`);+ assert.deepEqual(result, { pending: 1, afterHover: 'db', afterSync: 'api', cancelled: 0, retained: true, reactivated: 'api', internal: 0, touch: 0, coarse: 0, fallback: 1, fallbackActive: 'db', delays: [90, 90, 90] });+ await snapshot('timer-fixture');+ await load(); await move('api'); await run('Archify.intentTrace.clear()'); await afterTimer();+ assert.equal((await snapshot('pending-clear')).active, null);+ await run(`Archify.intentTrace.show('api',{announce:true}); window.dispatchEvent(new Event('blur'))`); await afterTimer();+ const blurred = await snapshot('blur-fixture'); assert.equal(blurred.active, null); assert.match(blurred.status, /API Server/);+ });++ await t.test('a minimal SVG fixture preserves counting, cloned geometry and isolated nodes', async () => {+ await load();+ const result = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg');+ svg.innerHTML='<g data-edge-from="a" data-edge-to="b" data-edge-key="ab" transform="translate(3 4)"><path id="original-path" d="M0 0 L10 10" class="original" style="opacity:.7" marker-end="url(#arrow)"/><line x1="1" y1="2" x2="3" y2="4"/></g><path data-edge-from="a" data-edge-to="b" data-edge-key="ab" d="M2 3 L4 5"/><polyline data-edge-from="c" data-edge-to="a" data-edge-label="incoming" points="1,2 3,4"/><path data-edge-from="a" data-edge-to="a" d="M0 0 C1 2 3 4 0 0"/><g data-node-id="a" data-node-label="Alpha"><rect width="10" height="10"/></g><g data-node-id="b"/><g data-node-id="c"/><g data-node-id="solo"/>';+ const original=svg.querySelector('#original-path').outerHTML;Archify.intentTrace.show('a',{announce:true});+ const overlay=svg.querySelector('[data-intent-trace-overlay]'),shapes=[...overlay.querySelectorAll('.intent-trace-flow')];+ const data={directions:shapes.map(n=>n.getAttribute('data-direction')),status:document.getElementById('intent-trace-status').textContent,+ transform:overlay.firstElementChild.getAttribute('transform'),d:shapes[0].getAttribute('d'),points:shapes[3].getAttribute('points'),+ stripped:!overlay.querySelector('[id],[style],[marker-end],[data-edge-from]'),pathLength:shapes.every(n=>n.getAttribute('pathLength')==='1'),+ original:svg.querySelector('#original-path').outerHTML===original,beforeEdges:overlay.nextElementSibling.hasAttribute('data-edge-from')};+ Archify.intentTrace.show('solo',{announce:true});data.solo={active:Archify.intentTrace.active(),overlays:svg.querySelectorAll('[data-intent-trace-overlay]').length,status:document.getElementById('intent-trace-status').textContent};+ return data;+ })()`);+ assert.deepEqual(result.directions, ['out', 'out', 'out', 'in', 'loop']);+ assert.match(result.status, /Alpha/); assert.match(result.status, /1 outgoing/); assert.match(result.status, /1 incoming/);+ assert.match(result.status, /1 self loop/); assert.match(result.status, /3 connections/);+ assert.equal(result.transform, 'translate(3 4)'); assert.equal(result.d, 'M0 0 L10 10'); assert.equal(result.points, '1,2 3,4');+ for (const flag of ['stripped', 'pathLength', 'original', 'beforeEdges']) assert.equal(result[flag], true, flag);+ assert.equal(result.solo.active, 'solo'); assert.equal(result.solo.overlays, 0);+ assert.match(result.solo.status, /0 connections/);+ await snapshot('geometry-fixture');+ });++ await t.test('blockers gate requests while actual Focus, Route and Lens retain handoff behavior', async () => {+ await load();+ const blockers = await run(`(()=>{+ const html=document.documentElement,svg=document.querySelector('.diagram-container > svg'),container=svg.parentElement,p=Archify.intentTrace;+ const cases=[[html,'data-embed','true'],[html,'data-guide-open','true'],[svg,'data-lens-active',''],[svg,'data-story-active',''],[svg,'data-relationship-preview-active','']];+ const results=cases.map(([el,name,value])=>{p.show('api');el.setAttribute(name,value);const before=p.active(),rejected=p.show('api'),after=p.active();el.removeAttribute(name);return {before,rejected,after};});+ container.classList.add('is-panning');results.push({rejected:p.show('api'),after:p.active()});container.classList.remove('is-panning');return results;+ })()`);+ for (const row of blockers) { assert.equal(row.rejected, false); assert.equal(row.after, null); }+ assert.ok(blockers.slice(0, 5).every(row => row.before === 'api'));+ for (const [name, action, release] of [+ ['focus', `Archify.focus.set('api',{toggle:false})`, `Archify.focus.clear({updateUrl:false})`],+ ['route', `Archify.routeProbe.begin({source:'users'})`, `Archify.routeProbe.clear({updateUrl:false})`],+ ['lens', `Archify.semanticLens.select('backend')`, `Archify.semanticLens.clear({updateUrl:false})`],+ ]) {+ await load(); await move('db'); await run(`intentWait(()=>Archify.intentTrace.active()==='db')`);+ await run(action); await snapshot(name + '-handoff');+ assert.equal(await run(`Archify.intentTrace.show('db')`), false);+ assert.equal((await snapshot(name + '-blocked')).overlays, 0);+ await run(release); await move(); await move('db');+ await run(`intentWait(()=>Archify.intentTrace.active()==='db')`);+ assert.equal((await snapshot(name + '-released')).active, 'db');+ }+ });++ await t.test('real CSS completion, Motion ownership, reduced motion and themes preserve previews', async () => {+ await load('trace'); await run(`intentWait(()=>document.documentElement.getAttribute('data-ambient-motion')==='settled')`);+ await move('api'); await run(`intentWait(()=>Archify.motionGovernor.owner()==='intent')`);+ await run(`intentWait(()=>intentEnds.some(e=>e.trusted&&e.name==='archify-intent-trace-flow'))`);+ assert.equal((await snapshot('animation-complete')).active, 'api');+ const direction = await run(`getComputedStyle(document.querySelector('.intent-trace-flow[data-direction="in"]')).animationDirection`);+ assert.equal(direction, 'normal');+ await move(); await run(`intentWait(()=>Archify.motionGovernor.owner()==='')`);+ await snapshot('owner-cleared');+ for (const theme of ['dark', 'light']) {+ await load('trace', { theme, reduced: true });+ const scheduled = await run(`intentTimerFixture(({over,queue,delays,fire})=>{over('api');const before=Archify.intentTrace.active();fire();return {before,after:Archify.intentTrace.active(),delays};})`);+ assert.deepEqual(scheduled, { before: null, after: 'api', delays: [0] });+ await run(`intentWait(()=>Archify.motionGovernor.owner()==='intent')`);+ const style = await run(`(()=>{const c=getComputedStyle(document.querySelector('.intent-trace-flow'));return {animation:c.animationName,pointer:getComputedStyle(document.querySelector('.intent-trace-overlay')).pointerEvents,dash:c.strokeDasharray};})()`);+ assert.equal(style.animation, 'none'); assert.equal(style.pointer, 'none'); assert.equal(style.dash, 'none');+ await snapshot('reduced-' + theme);+ if (evidence) {+ await run(`Promise.all([...document.querySelectorAll('[data-intent-trace-match]')].flatMap(n=>n.getAnimations()).filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);+ await run('new Promise(resolve=>requestAnimationFrame(()=>requestAnimationFrame(resolve)))');+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, theme + '.png'), Buffer.from(shot.data, 'base64'));+ }+ const exported = await run(`(async()=>{+ const original=URL.createObjectURL;let blob;+ URL.createObjectURL=function(v){if(v.type.startsWith('image/svg+xml'))blob=v;return original.call(URL,v);};+ try {await Archify.exportMenu.run('svg');}finally{URL.createObjectURL=original;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {clean:!root.hasAttribute('data-intent-trace-active')&&!root.querySelector('[data-intent-trace-overlay],[data-intent-trace-match],[data-intent-trace-selected]'),viewBox:root.getAttribute('viewBox')===document.querySelector('.diagram-container > svg').getAttribute('viewBox')};+ })()`);+ assert.deepEqual(exported, { clean: true, viewBox: true });+ await click('.diagram-container svg [data-node-id="api"]');+ assert.equal(await run('Archify.focus.active()'), 'api');+ }+ });+});diff --git a/archify/test/motion-governor-browser.test.mjs b/archify/test/motion-governor-browser.test.mjsnew file mode 100644index 00000000..c5fc6d02--- /dev/null+++ b/archify/test/motion-governor-browser.test.mjs@@ -0,0 +1,330 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Motion Governor preserves mode, ownership, ambient completion and real callers', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser motion checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-motion-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_MOTION_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ const doc = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', example), 'utf8'));+ doc.meta.animation = 'trace';+ const input = path.join(scratch, mode + '.json');+ fs.writeFileSync(input, JSON.stringify(doc));+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`), input, files[mode]]);+ }+ files.static = path.join(scratch, 'static.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'),+ path.join(skillRoot, 'examples', cases.architecture), files.static]);+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ let startup;+ let navigationId = 0;+ async function media(reduced) {+ await send('Emulation.setEmulatedMedia', { media: '', features: [+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ }+ async function load(mode = 'architecture', { theme = 'dark', reduced = false, fixture = '', preserveStorage = false, query = '' } = {}) {+ const expectedNavigation = ++navigationId;+ if (startup) await send('Page.removeScriptToEvaluateOnNewDocument', { identifier: startup });+ ({ identifier: startup } = await send('Page.addScriptToEvaluateOnNewDocument', { source: `(() => {+ if (new URL(location.href).searchParams.get('testNavigation') !== '${expectedNavigation}') return;+ window.motionNavigation = ${expectedNavigation};+ try { window.motionStartupPreference = localStorage.getItem('archify-motion'); }+ catch (error) { window.motionStartupPreference = String(error); }+ window.motionErrors = []; window.motionEnds = []; window.motionAmbient = [];+ addEventListener('error', e => motionErrors.push(e.message));+ addEventListener('unhandledrejection', e => motionErrors.push(String(e.reason)));+ addEventListener('animationend', e => {+ if (e.target.matches('[data-animate]')) motionEnds.push({ trusted:e.isTrusted, name:e.animationName });+ }, true);+ new MutationObserver(records => {+ for (const r of records) if (r.attributeName === 'data-ambient-motion') {+ motionAmbient.push({ before:r.oldValue, after:r.target.getAttribute(r.attributeName) });+ }+ }).observe(document, { subtree:true, attributes:true, attributeOldValue:true, attributeFilter:['data-ambient-motion'] });+ window.motionWait = predicate => new Promise((resolve, reject) => {+ const start = performance.now();+ function sample() {+ if (predicate()) return resolve();+ if (performance.now() - start > 12000) return reject(new Error('Motion observation timed out'));+ requestAnimationFrame(sample);+ }+ requestAnimationFrame(sample);+ });+ ${preserveStorage ? '' : "try { localStorage.removeItem('archify-motion'); } catch (_) {}"}+ ${fixture}+ })();` }));+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await media(reduced);+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ const navigation = await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}&testNavigation=${expectedNavigation}${query}` });+ assert.ok(navigation.loaderId, 'Motion fixture must load a new document.');+ await loaded;+ await run('document.fonts.ready');+ assert.equal(await run('window.motionNavigation'), expectedNavigation, 'Motion fixture document identity');+ }+ async function snapshot(label) {+ const value = await run(`(() => {+ const m = Archify.motionGovernor, root = document.documentElement, btn = document.getElementById('btn-motion');+ return { capable:m.capable, mode:m.mode(), paused:m.isPaused(), owner:m.owner(),+ rootMode:root.getAttribute('data-motion'), rootOwner:root.getAttribute('data-motion-owner'),+ ambient:root.getAttribute('data-ambient-motion'), reason:root.getAttribute('data-ambient-settle-reason'),+ hidden:btn.hidden, disabled:btn.disabled, pressed:btn.getAttribute('aria-pressed'),+ label:document.getElementById('motion-label').textContent, aria:btn.getAttribute('aria-label'), errors:motionErrors };+ })()`);+ assert.deepEqual(value.errors, [], label);+ records.push({ scenario: label, ...value });+ return value;+ }+ async function screenshot(name) {+ if (!evidence) return;+ await run('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))');+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, name + '.png'), Buffer.from(shot.data, 'base64'));+ }++ await t.test('five trace modes initialize; representative CSS animation completes once; static methods remain inert', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode);+ const initial = await snapshot(mode + '-initial');+ assert.equal(initial.capable, true); assert.equal(initial.mode, 'live');+ // All modes share the same Governor/CSS. One real completion plus the+ // five-mode initialization contract covers this seam without five waits.+ if (mode === 'architecture') {+ await run(`motionWait(() => document.documentElement.getAttribute('data-ambient-motion') === 'settled')`);+ const state = await snapshot(mode + '-settled');+ assert.equal(state.capable, true); assert.equal(state.mode, 'live'); assert.equal(state.reason, 'complete');+ const ambient = await run(`({ running:motionAmbient.some(r => r.after === 'running' || r.before === 'running'),+ ended:motionEnds.some(e => e.trusted), animations:Array.from(document.querySelectorAll('[data-animate]'), e => getComputedStyle(e).animationName),+ security:Array.from(document.querySelectorAll('.a-security'), e => getComputedStyle(e).strokeDasharray) })`);+ assert.equal(ambient.running, true); assert.equal(ambient.ended, true);+ assert.ok(ambient.animations.every(name => name === 'none'));+ assert.ok(ambient.security.every(dash => dash === '5px, 5px'));+ }+ await run(`Archify.motionGovernor.pause(); Archify.motionGovernor.resume();`);+ assert.equal((await snapshot(mode + '-resumed')).ambient, 'settled');+ }+ await load('static');+ const inert = await run(`(() => { const m=Archify.motionGovernor; return [m.capable,m.pause(),m.resume(),m.toggle(),m.setMode('live'),m.mode(),m.claim('story'),m.release(1),m.suspend('test')(),m.isPaused(),m.owner()]; })()`);+ assert.deepEqual(inert, [false,false,false,false,'still','still',0,false,false,true,'']);+ assert.equal((await snapshot('static')).hidden, true);+ });++ await t.test('stored user intent remains distinct from reduced motion and suspension', async () => {+ await load();+ assert.equal(await run('Archify.motionGovernor.pause()'), true);+ assert.equal(await run(`localStorage.getItem('archify-motion')`), 'still');+ for (let reload = 0; reload < 5; reload++) {+ await load('architecture', { preserveStorage: true });+ const stored = await run(`({initial:motionStartupPreference,current:localStorage.getItem('archify-motion'),navigation:motionNavigation,url:location.href})`);+ assert.equal((await snapshot('stored-still-' + reload)).mode, 'still', JSON.stringify(stored));+ }+ assert.equal(await run(`Archify.motionGovernor.setMode('live', {persist:false})`), 'live');+ assert.equal(await run(`localStorage.getItem('archify-motion')`), 'still');+ assert.equal(await run('Archify.motionGovernor.resume()'), false);+ assert.equal(await run(`localStorage.getItem('archify-motion')`), null);+ await media(true);+ await run('motionWait(() => document.getElementById("btn-motion").disabled)');+ assert.equal(await run('Archify.motionGovernor.resume()'), false);+ assert.equal((await snapshot('reduced-resume')).mode, 'still');+ await run('window.releaseTest = Archify.motionGovernor.suspend("test")');+ await media(false);+ await run('motionWait(() => !document.getElementById("btn-motion").disabled)');+ assert.equal((await snapshot('suspension-after-media')).mode, 'still');+ assert.equal(await run('releaseTest()'), true);+ assert.equal(await run('releaseTest()'), false);+ assert.equal((await snapshot('released')).mode, 'live');+ assert.equal(await run('Archify.motionGovernor.toggle()'), true);+ assert.equal(await run('Archify.motionGovernor.toggle()'), false);+ await load('architecture', { fixture: `Storage.prototype.getItem = Storage.prototype.setItem = Storage.prototype.removeItem = function () { throw new Error('storage fixture'); };` });+ assert.equal(await run('Archify.motionGovernor.pause()'), true);+ assert.equal(await run('Archify.motionGovernor.resume()'), false);+ await snapshot('storage-unavailable');+ });++ await t.test('claims preempt cleanup, normal release does not, and SVG owners fall back automatically', async () => {+ await load();+ await run(`window.main = document.querySelector('.diagram-container > svg'); main.setAttribute('data-focus-active','true'); main.setAttribute('data-route-active','true');`);+ await run(`motionWait(() => Archify.motionGovernor.owner() === 'route')`);+ assert.equal((await snapshot('derived-route')).rootOwner, 'route');+ const claims = await run(`(() => {+ const m=Archify.motionGovernor, events=[];+ const a=m.claim('story',()=>events.push('A'));+ const b=m.claim('story',()=>{ events.push('B'); throw new Error('cleanup fixture'); });+ const stale=m.release(a), ownerAfterStale=m.owner();+ const c=m.claim('handoff',()=>events.push('C'));+ const released=m.release(c), repeated=m.release(c);+ return {events,stale,ownerAfterStale,released,repeated,increasing:a<b&&b<c,owner:m.owner(),empty:m.claim('')};+ })()`);+ assert.deepEqual(claims, { events:['A','B'], stale:false, ownerAfterStale:'story', released:true, repeated:false, increasing:true, owner:'route', empty:0 });+ await run(`main.removeAttribute('data-route-active')`);+ await run(`motionWait(() => Archify.motionGovernor.owner() === 'focus')`);+ const focus = await snapshot('derived-focus'); assert.equal(focus.rootOwner, 'focus'); assert.match(focus.aria, /focus/i);+ await run(`main.removeAttribute('data-focus-active')`);+ await run(`motionWait(() => Archify.motionGovernor.owner() === '')`);+ assert.equal((await snapshot('derived-empty')).rootOwner, null);+ });++ await t.test('counted suspensions and the existing visibility-key interaction remain distinct', async () => {+ await load();+ const values = await run(`(() => {+ const m=Archify.motionGovernor, a=m.suspend('a'), b=m.suspend('a'), c=m.suspend('c');+ const first=[c(),m.isPaused(),b(),m.isPaused(),b(),a(),m.isPaused()];+ const releaseVisibility=m.suspend('visibility');+ Object.defineProperty(document,'hidden',{configurable:true,value:true}); document.dispatchEvent(new Event('visibilitychange'));+ const hidden=m.mode();+ Object.defineProperty(document,'hidden',{configurable:true,value:false}); document.dispatchEvent(new Event('visibilitychange'));+ const shown=m.mode(),released=releaseVisibility(); delete document.hidden;+ return {first,hidden,shown,released,hiddenAttr:document.documentElement.getAttribute('data-document-hidden')};+ })()`);+ assert.deepEqual(values, {first:[true,true,true,true,false,true,false],hidden:'still',shown:'live',released:true,hiddenAttr:null});+ await snapshot('visibility-key-fixture');+ });++ await t.test('ambient cancellation, empty targets and optional platform interfaces keep their fallback', async () => {+ await load();+ const cancelled = await run(`(() => {+ const root=document.documentElement, svg=document.querySelector('.diagram-container > svg');+ const before=root.getAttribute('data-ambient-motion');+ svg.dispatchEvent(new Event('animationcancel',{bubbles:true}));+ const ignored=root.getAttribute('data-ambient-motion');+ svg.querySelectorAll('[data-animate="edge"], [data-animate="node"]').forEach(e=>e.dispatchEvent(new Event('animationcancel',{bubbles:true})));+ return {before,ignored,after:root.getAttribute('data-ambient-motion'),reason:root.getAttribute('data-ambient-settle-reason')};+ })()`);+ assert.deepEqual(cancelled, {before:'running',ignored:'running',after:'settled',reason:'complete'});+ await load('architecture', { fixture: `const query = Element.prototype.querySelectorAll; Element.prototype.querySelectorAll = function (s) { return s === '[data-animate="edge"], [data-animate="node"]' ? [] : query.call(this,s); };` });+ assert.equal((await snapshot('empty-target-fixture')).reason, 'empty');+ for (const [name, fixture] of [+ ['no-media', 'window.matchMedia = undefined;'],+ ['legacy-media', `const nativeMatch=window.matchMedia.bind(window); window.matchMedia=q=>{const m=nativeMatch(q); m.addEventListener=undefined; return m;};`],+ ['no-observer', 'window.MutationObserver = undefined;'],+ ]) {+ await load('architecture', { fixture });+ assert.equal(await run('Archify.motionGovernor.pause()'), true);+ assert.equal((await snapshot(name)).mode, 'still');+ if (name === 'legacy-media') {+ await run('Archify.motionGovernor.resume()'); await media(true);+ await run('motionWait(() => document.getElementById("btn-motion").disabled)');+ assert.equal((await snapshot('legacy-media-changed')).mode, 'still');+ }+ }+ for (const query of ['&embed=1', '&play=1']) {+ await load('architecture', { query });+ // Share playback sets its root flag after Governor initialization.+ await run(`motionWait(() => document.documentElement.getAttribute('data-ambient-settle-reason') === 'suppressed')`);+ assert.equal((await snapshot('suppressed-' + query)).ambient, 'settled');+ }+ await load('architecture', { fixture: `Object.defineProperty(document,'hidden',{configurable:true,value:true});` });+ assert.equal((await snapshot('initial-hidden-fixture')).mode, 'still');+ });++ await t.test('Motion pauses actual Story, handoff and Route without discarding elapsed dwell', async () => {+ await load();+ await run(`Archify.guidedViews.activate('request-path'); motionWait(() => !Archify.guidedViews.handoff())`);+ assert.equal(await run('Archify.guidedViews.play()'), true);+ assert.equal(await run('Archify.guidedViews.isPlaying()'), true);+ await run('Archify.motionGovernor.pause()');+ assert.equal(await run('Archify.guidedViews.isPlaying()'), false);+ await run('Archify.motionGovernor.resume()');+ assert.equal(await run('Archify.guidedViews.isPlaying()'), false);+ await load();+ await run(`Archify.guidedViews.activate('request-path'); motionWait(() => !Archify.guidedViews.handoff())`);+ const handoff = await run(`(() => {+ Archify.guidedViews.activate('identity-and-cache');+ const before=Archify.guidedViews.handoff(); Archify.motionGovernor.pause();+ return {before:!!before,after:Archify.guidedViews.handoff()};+ })()`);+ assert.deepEqual(handoff, {before:true,after:null});+ await load();+ const route = await run(`(async () => {+ Archify.routeProbe.begin({source:'users'}); Archify.routeProbe.choose('db');+ const schedule=window.setTimeout, delays=[];+ window.setTimeout=function(callback,delay,...args){ delays.push(delay); return schedule(callback,delay,...args); };+ const started=Archify.routeProbe.playJourney();+ await new Promise(resolve=>schedule(resolve,180));+ const before=Archify.routeProbe.result(), pauses=[], pause=Archify.routeProbe.pauseJourney;+ Archify.routeProbe.pauseJourney=function(options){pauses.push(options); return pause(options);};+ Object.defineProperty(document,'hidden',{configurable:true,value:true}); document.dispatchEvent(new Event('visibilitychange'));+ const paused=Archify.routeProbe.result();+ Object.defineProperty(document,'hidden',{configurable:true,value:false}); document.dispatchEvent(new Event('visibilitychange'));+ const autoResumed=Archify.routeProbe.isJourneyPlaying();+ delays.length=0; const resumed=Archify.routeProbe.playJourney();+ const remaining=delays.at(-1); window.setTimeout=schedule; delete document.hidden;+ Archify.routeProbe.pauseJourney=pause; pause();+ return {started,before,paused,autoResumed,resumed,remaining,pauses};+ })()`);+ assert.equal(route.started, true); assert.equal(route.before.playing, true); assert.equal(route.paused.playing, false);+ assert.equal(route.paused.journey, route.before.journey); assert.equal(route.autoResumed, false); assert.equal(route.resumed, true);+ assert.ok(route.pauses.some(options => options.preserveElapsed === true && options.reason === 'hidden'));+ assert.ok(route.remaining > 0 && route.remaining < 1000, JSON.stringify(route));+ await snapshot('route-hidden-pause');+ });++ await t.test('dark and light modes expose the same controls and computed Still state', async () => {+ for (const theme of ['dark', 'light']) {+ await load('architecture', { theme });+ await run(`motionWait(() => document.documentElement.getAttribute('data-ambient-motion') === 'settled')`);+ const live = await snapshot('live-' + theme); assert.equal(live.pressed, 'true');+ await screenshot('live-' + theme);+ await run(`document.getElementById('btn-motion').click()`);+ const still = await snapshot('still-' + theme); assert.equal(still.mode, 'still'); assert.equal(still.pressed, 'false');+ assert.match(still.aria, /resume/i);+ assert.equal(await run(`getComputedStyle(document.querySelector('.pulse-dot')).animationName`), 'none');+ await screenshot('still-' + theme);+ await run(`Archify.focus.set('api', {toggle:false}); motionWait(() => Archify.motionGovernor.owner() === 'focus')`);+ const exported = await run(`(async () => {+ const svg=document.querySelector('.diagram-container > svg'), m=Archify.motionGovernor;+ const before={svg:svg.outerHTML,mode:m.mode(),owner:m.owner()}, original=URL.createObjectURL;+ let blob, serialized;+ URL.createObjectURL=function(value){if(value.type.startsWith('image/svg+xml'))blob=value;return original.call(URL,value);};+ // Capture serialization synchronously; the later download click can+ // reach the existing outside-click Focus handler.+ try {+ const pending=Archify.exportMenu.run('svg');+ serialized={svg:svg.outerHTML,mode:m.mode(),owner:m.owner()};+ await pending;+ } finally { URL.createObjectURL=original; }+ const text=await blob.text(), root=new DOMParser().parseFromString(text,'image/svg+xml').documentElement;+ return {unchanged:before.svg===serialized.svg&&before.mode===serialized.mode&&before.owner===serialized.owner,+ modeUnchanged:before.mode===m.mode(),+ clean:!root.querySelector('[data-focus-selected], [data-radar-node-id]')&&!root.hasAttribute('data-focus-active'),+ geometry:root.getAttribute('viewBox')===svg.getAttribute('viewBox')};+ })()`);+ assert.deepEqual(exported, {unchanged:true,modeUnchanged:true,clean:true,geometry:true});+ await snapshot('export-' + theme);++ }+ });+});diff --git a/archify/test/reader-layout-browser.test.mjs b/archify/test/reader-layout-browser.test.mjsnew file mode 100644index 00000000..f5f46b33--- /dev/null+++ b/archify/test/reader-layout-browser.test.mjs@@ -0,0 +1,320 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chromePath = process.env.ARCHIFY_CHROME ? findChrome() : null;+const cases = {+ architecture: 'web-app.architecture.json',+ workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json',+ dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+};++test('Reader Layout preserves final-artifact behavior across its ownership boundaries', {+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-reader-browser-'));+ const evidence = process.env.ARCHIFY_READER_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const artifacts = {};+ for (const [mode, example] of Object.entries(cases)) {+ const output = path.join(scratch, `${mode}.html`);+ // Optional captured base artifacts let the same behavioral cases establish+ // a pre-extraction baseline without changing the implementation under test.+ if (process.env.ARCHIFY_READER_BASELINE_DIR) {+ fs.copyFileSync(path.join(process.env.ARCHIFY_READER_BASELINE_DIR, `${mode}.html`), output);+ } else {+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), output]);+ }+ artifacts[mode] = output;+ }+ const browser = new ChromeVisualBrowser(chromePath);+ const records = [];+ try {+ const session = await browser.sessionPromise;+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ async function evaluate(expression, awaitPromise = false) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', {+ source: `window.readerTestErrors = [];+ addEventListener('error', function (event) { readerTestErrors.push(event.message); });+ addEventListener('unhandledrejection', function (event) { readerTestErrors.push(String(event.reason)); });`,+ });+ async function viewport(width, height) {+ await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false });+ }+ async function media(theme = 'dark', reduced = false, print = false) {+ await send('Emulation.setEmulatedMedia', { media: print ? 'print' : '', features: [+ { name: 'prefers-color-scheme', value: theme },+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ }+ async function stable() {+ await evaluate(`(async function () {+ for (var i = 0; i < 2; i += 1) {+ await Archify.readerLayout.whenStable();+ await Archify.viewerChromeLayout.whenStable();+ }+ })()`, true);+ }+ async function snapshot(label) {+ const value = await evaluate(`(function () {+ var html = document.documentElement;+ var diagram = document.querySelector('.diagram-container');+ var svg = diagram.querySelector(':scope > svg');+ return {+ active: Archify.readerLayout.active(), receipt: Archify.readerLayout.receipt(),+ width: html.style.getPropertyValue('--archify-reader-width'),+ layout: html.getAttribute('data-reader-layout'), overflow: html.getAttribute('data-reader-overflow'),+ wide: diagram.getAttribute('data-wide-diagram'), shape: html.getAttribute('data-diagram-shape'),+ geometry: ['viewBox', 'width', 'height'].map(function (name) { return svg.getAttribute(name); }),+ shellWidth: document.querySelector('.container').getBoundingClientRect().width,+ scrollHeight: Math.max(html.scrollHeight, document.body.scrollHeight),+ innerWidth: innerWidth, innerHeight: innerHeight,+ theme: html.getAttribute('data-theme'), reduced: matchMedia('(prefers-reduced-motion: reduce)').matches,+ errors: window.readerTestErrors,+ externalResources: performance.getEntriesByType('resource').map(function (entry) { return entry.name; }).filter(function (name) { return /^https?:/.test(name); })+ };+ })()`);+ assert.deepEqual(value.errors, [], `${label}: uncaught Viewer errors`);+ assert.deepEqual(value.externalResources, [], `${label}: external runtime assets`);+ records.push({ label, ...value });+ return value;+ }+ async function load(file, { width = 1440, height = 900, theme = 'dark', reduced = false, query = '', print = false, waitForLayout = true } = {}) {+ await viewport(width, height);+ await media(theme, reduced, print);+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ const result = await send('Page.navigate', { url: pathToFileURL(file).href + `?theme=${theme}${query}` });+ assert.equal(result.errorText, undefined, result.errorText);+ await loaded;+ assert.deepEqual(await evaluate('window.readerTestErrors'), [], 'Viewer initialization');+ if (waitForLayout) await stable();+ }+ function variant(name, { ratio, beforeViewer = '' } = {}) {+ let html = fs.readFileSync(artifacts.architecture, 'utf8');+ if (ratio !== undefined) assert.match(html, /<svg\b[^>]*\bviewBox="[^"]+"/, 'Reader viewBox fixture anchor');+ if (beforeViewer) assert.ok(html.includes(' <script>\n var Archify = {};'), 'Reader setup fixture anchor');+ if (ratio !== undefined) html = html.replace(/(<svg\b[^>]*\bviewBox=")[^"]+(")/, (_, start, end) => `${start}0 0 ${ratio * 1000} 1000${end}`);+ if (beforeViewer) html = html.replace(' <script>\n var Archify = {};', () => ` <script>${beforeViewer}</script>\n <script>\n var Archify = {};`);+ const file = path.join(scratch, `${name}.html`);+ fs.writeFileSync(file, html);+ return file;+ }+ function inactive(state, wide = true) {+ assert.equal(state.active, false);+ assert.equal(state.width, '');+ assert.equal(state.layout, null);+ assert.equal(state.overflow, null);+ assert.equal(state.receipt.width, 0);+ assert.equal(state.wide, wide ? 'true' : null);+ assert.equal(state.shape, wide ? 'wide' : null);+ }++ await t.test('five modes initialize, export clean SVG, and honor themes and reduced motion', async () => {+ for (const [mode, file] of Object.entries(artifacts)) {+ for (const theme of ['dark', 'light']) {+ await load(file, { theme, reduced: theme === 'light' });+ const state = await snapshot(`${mode}-${theme}`);+ assert.equal(state.theme, theme);+ assert.equal(state.reduced, theme === 'light');+ assert.equal(state.active, state.receipt.ratio >= 1.55);+ await evaluate('Archify.view.zoomIn()');+ await stable();+ const exported = await evaluate(`(async function () {+ var original = URL.createObjectURL;+ var captured;+ URL.createObjectURL = function (blob) {+ if (blob.type.indexOf('image/svg+xml') === 0) captured = blob;+ return original.call(URL, blob);+ };+ try {+ await Archify.exportMenu.run('svg');+ if (!captured) throw new Error('SVG export did not produce a blob');+ var text = await captured.text();+ var svg = new DOMParser().parseFromString(text, 'image/svg+xml').documentElement;+ return { text: text, geometry: ['viewBox', 'width', 'height'].map(function (name) { return svg.getAttribute(name); }),+ dirty: !!svg.querySelector('[data-focus-match], [data-story-step], [data-route-match], [data-reader-layout], [data-source-evidence-beacon]') ||+ svg.hasAttribute('data-view-scale') || svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-route-active') };+ } finally { URL.createObjectURL = original; }+ })()`, true);+ assert.equal(exported.dirty, false);+ assert.equal(exported.geometry[0], state.geometry[0]);+ if (evidence) fs.writeFileSync(path.join(evidence, `${mode}-${theme}.svg`), exported.text);+ await evaluate('Archify.view.reset()');+ await stable();+ const reset = await snapshot(`${mode}-${theme}-reset`);+ assert.deepEqual(reset.geometry, state.geometry);+ if (evidence && mode === 'architecture') {+ const capture = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, `architecture-1440x900-${theme}.png`), Buffer.from(capture.data, 'base64'));+ }+ }+ }+ });++ await t.test('ratio and desktop thresholds preserve shape while clearing temporary state', async () => {+ for (const ratio of [1.549, 1.55, 1.551]) {+ await load(variant(`ratio-${ratio}`, { ratio }));+ const before = await snapshot(`ratio-${ratio}`);+ assert.equal(before.active, ratio >= 1.55);+ if (ratio < 1.55) inactive(before, false);+ for (const width of [1023, 1024, 1025, 1023, 1440]) {+ await viewport(width, 900);+ await stable();+ const state = await snapshot(`ratio-${ratio}-width-${width}`);+ assert.deepEqual(state.geometry, before.geometry);+ if (ratio >= 1.55 && width >= 1024) assert.equal(state.active, true);+ else inactive(state, ratio >= 1.55);+ }+ }+ });++ const wide = variant('wide', { ratio: 3 });+ await t.test('desktop budgets, extreme content and limited horizontal space preserve geometry', async () => {+ for (const [width, height] of [[1440, 900], [1600, 1000], [1920, 1080], [2048, 1320]]) {+ await load(wide, { width, height });+ const state = await snapshot(`desktop-${width}x${height}`);+ assert.equal(state.active, true);+ assert.ok(state.receipt.width >= 960 && state.receipt.width <= Math.min(width, 1920));+ }+ await load(wide, { width: 2048, height: 3000 });+ assert.equal((await snapshot('maximum-width')).receipt.width, 1920);+ await evaluate(`document.body.style.paddingLeft = '100px'; document.body.style.paddingRight = '100px'`);+ await viewport(1024, 900);+ await stable();+ assert.equal((await snapshot('available-width-below-floor')).receipt.width, 824);+ await load(wide, { width: 1440, height: 300 });+ const geometry = (await snapshot('short-window')).geometry;+ await evaluate(`document.querySelector('.header').style.minHeight = '1000px';+ document.querySelector('.cards').innerHTML = '<div style="height:1200px">Long content</div>'`);+ await stable();+ const overflow = await snapshot('long-content');+ assert.equal(overflow.receipt.width, 960);+ assert.equal(overflow.overflow, 'authored');+ assert.ok(overflow.scrollHeight > overflow.innerHeight);+ assert.deepEqual(overflow.geometry, geometry);+ });++ await t.test('embed, presentation and print return to ordinary layout without clearing shape', async () => {+ for (const mode of ['embed', 'present', 'print']) {+ await load(wide, { query: mode === 'print' ? '' : `&${mode}=1`, print: mode === 'print' });+ inactive(await snapshot(`initial-${mode}`));+ if (mode === 'print') await media();+ else if (mode === 'present') await evaluate('Archify.presentation.exit()');+ else await evaluate("document.documentElement.removeAttribute('data-embed')");+ await stable();+ assert.equal((await snapshot(`exit-${mode}`)).active, true);+ for (let attempt = 0; attempt < 2; attempt += 1) {+ if (mode === 'print') await media('dark', false, true);+ else if (mode === 'present') await evaluate('Archify.presentation.enter()');+ else await evaluate("document.documentElement.setAttribute('data-embed', 'true')");+ await stable();+ inactive(await snapshot(`enter-${mode}-${attempt}`));+ if (mode === 'print') await media();+ else if (mode === 'present') await evaluate('Archify.presentation.exit()');+ else await evaluate("document.documentElement.removeAttribute('data-embed')");+ await stable();+ assert.equal((await snapshot(`return-${mode}-${attempt}`)).active, true);+ }+ }+ });++ await t.test('content observers and burst scheduling converge while camera state remains usable', async () => {+ await load(wide, { width: 1920, height: 1080 });+ const before = await snapshot('before-content');+ await evaluate(`document.querySelector('.header h1').textContent = 'Long reader title '.repeat(30);+ document.querySelector('.cards').innerHTML += '<div class="card" style="height:500px">Late card</div>';+ for (var i = 0; i < 30; i += 1) { dispatchEvent(new Event('resize')); Archify.readerLayout.schedule(); }+ Archify.view.zoomIn();`);+ await stable();+ const changed = await snapshot('after-content');+ assert.ok(changed.receipt.width <= before.receipt.width);+ assert.deepEqual(changed.geometry, before.geometry);+ await evaluate('Archify.view.reset()');+ await stable();+ const first = await snapshot('settled-1');+ await stable();+ assert.deepEqual(await snapshot('settled-2'), first);+ });++ await t.test('optional content and browser interfaces retain their fallback behavior', async () => {+ const file = variant('optional', { ratio: 3, beforeViewer: `+ document.querySelector('.cards').remove();+ // Other Viewer modules require the chapter control IDs. Only remove+ // Reader's optional layout selector, keeping those controls available.+ document.querySelector('.guided-views')?.classList.remove('guided-views');+ window.ResizeObserver = undefined;+ window.MutationObserver = undefined;+ Object.defineProperty(document, 'fonts', { value: undefined });+ ` });+ await load(file);+ assert.equal((await snapshot('optional-interfaces-absent')).active, true);+ await viewport(1023, 900);+ await stable();+ inactive(await snapshot('optional-resize-out'));+ await viewport(1440, 900);+ await stable();+ assert.equal((await snapshot('optional-resize-back')).active, true);+ });++ await t.test('font readiness gates sampling and pending-frame timeout remains explicit', async () => {+ const delayedFonts = variant('delayed-fonts', { ratio: 3, beforeViewer: `+ window.readerTestOriginalFonts = document.fonts;+ Object.defineProperty(document, 'fonts', { configurable: true, value: {+ ready: new Promise(function (resolve) { window.readerTestReleaseFonts = resolve; })+ } });+ ` });+ await load(delayedFonts, { waitForLayout: false });+ const fontGate = await evaluate(`(async function () {+ var resolved = false;+ var ready = Archify.readerLayout.whenStable().then(function () { resolved = true; });+ document.querySelector('.cards').style.minHeight = '450px';+ await new Promise(function (resolve) { requestAnimationFrame(function () { requestAnimationFrame(resolve); }); });+ var beforeReady = resolved;+ readerTestReleaseFonts();+ await ready;+ Object.defineProperty(document, 'fonts', { configurable: true, value: readerTestOriginalFonts });+ return { beforeReady: beforeReady, afterReady: resolved };+ })()`, true);+ assert.deepEqual(fontGate, { beforeReady: false, afterReady: true });+ await stable();+ assert.equal((await snapshot('delayed-fonts-and-content')).active, true);+ await load(wide);+ const result = await evaluate(`(async function () {+ var original = document.fonts;+ var release;+ var scheduled = 0;+ Object.defineProperty(document, 'fonts', { configurable: true, value: { ready: new Promise(function (resolve) { release = resolve; }) } });+ try {+ var waiting = Archify.waitForStableLayout({ maximumFrames: 1, schedule: function () { scheduled += 1; }, pending: function () { return true; } });+ var observed = waiting.then(function () { return 'unexpected success'; }, function (error) { return error.message; });+ await new Promise(function (resolve) { requestAnimationFrame(function () { requestAnimationFrame(resolve); }); });+ var beforeReady = scheduled;+ release();+ return { beforeReady: beforeReady, outcome: await observed, afterReady: scheduled };+ } finally { Object.defineProperty(document, 'fonts', { configurable: true, value: original }); }+ })()`, true);+ assert.equal(result.beforeReady, 0);+ assert.equal(result.afterReady, 1);+ assert.match(result.outcome, /did not reach stable dimensions/);+ await stable();+ });+ } finally {+ if (evidence) fs.writeFileSync(path.join(evidence, 'reader-observations.json'), `${JSON.stringify(records, null, 2)}\n`);+ await browser.close();+ fs.rmSync(scratch, { recursive: true, force: true });+ }+});diff --git a/archify/test/repository-language-metadata.test.mjs b/archify/test/repository-language-metadata.test.mjsindex 0a1535ae..328b7508 100644--- a/archify/test/repository-language-metadata.test.mjs+++ b/archify/test/repository-language-metadata.test.mjs@@ -17,6 +17,7 @@ function linguistGenerated(relativePath) {test('repository language metadata separates generated artifacts from implementation source', () => {for (const generatedPath of [+ 'archify/assets/template.html','archify/examples/web-app-rendered.html','examples/web-app.html','docs/cases/mco-runtime.architecture.html',@@ -36,7 +37,21 @@ test('repository language metadata separates generated artifacts from implementa}for (const sourcePath of [- 'archify/assets/template.html',+ 'viewer/template.source.html',+ 'viewer/reader-layout.js',+ 'viewer/viewer-chrome-layout.js',+ 'viewer/viewer-camera.js',+ 'viewer/semantic-radar.js',+ 'viewer/motion-governor.js',+ 'viewer/node-finder.js',+ 'viewer/intent-trace.js',+ 'viewer/semantic-lens.js',+ 'viewer/route-probe.js',+ 'viewer/guided-views.js',+ 'viewer/focus.js',+ 'viewer/export.js',+ 'viewer/export-cleanup.js',+ 'scripts/generate-viewer.mjs','scripts/gallery-template.html','scripts/guide-template.html','scripts/start-template.html',diff --git a/archify/test/route-journey.test.mjs b/archify/test/route-journey.test.mjsindex 87f7020d..e84c5fe8 100644--- a/archify/test/route-journey.test.mjs+++ b/archify/test/route-journey.test.mjs@@ -112,12 +112,14 @@ test('motion, camera, layered Escape, mobile, print, and embed boundaries stay e});test('standalone export strips every journey attribute and transient pulse', () => {- assert.match(template, /clone\.removeAttribute\('data-route-journey'\)/);- assert.match(template, /clone\.querySelectorAll\('\[data-route-journey-overlay\]'\)/);- assert.match(template, /el\.removeAttribute\('data-route-journey-state'\)/);- assert.match(template, /el\.removeAttribute\('data-route-journey-current'\)/);- assert.match(template, /!clone\.hasAttribute\('data-route-journey'\)/);- assert.match(template, /canonicalStateClean[\s\S]*?\[data-route-journey-overlay\][\s\S]*?\[data-route-journey-current\]/);+ const cleanup = template.match(/function cleanExportClone\(clone\) \{[\s\S]*?\n \}/)?.[0] || '';+ assert.match(template, /var canonicalStateClean = cleanExportClone\(clone\);/);+ assert.match(cleanup, /clone\.removeAttribute\('data-route-journey'\)/);+ assert.match(cleanup, /clone\.querySelectorAll\('\[data-route-journey-overlay\]'\)/);+ assert.match(cleanup, /el\.removeAttribute\('data-route-journey-state'\)/);+ assert.match(cleanup, /el\.removeAttribute\('data-route-journey-current'\)/);+ assert.match(cleanup, /!clone\.hasAttribute\('data-route-journey'\)/);+ assert.match(cleanup, /return !clone[\s\S]*?\[data-route-journey-overlay\][\s\S]*?\[data-route-journey-current\]/);});process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));diff --git a/archify/test/route-probe-browser.test.mjs b/archify/test/route-probe-browser.test.mjsnew file mode 100644index 00000000..2438ba26--- /dev/null+++ b/archify/test/route-probe-browser.test.mjs@@ -0,0 +1,363 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';+import { createViewerClick } from './helpers/viewer-click.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Route Probe preserves directed paths, Journey and export contracts', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Route Probe checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-route-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_ROUTE_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ const trace = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', cases.architecture), 'utf8'));+ trace.meta.animation = 'trace';+ const traceInput = path.join(scratch, 'trace.json');+ fs.writeFileSync(traceInput, JSON.stringify(trace)); files.trace = path.join(scratch, 'trace.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'), traceInput, files.trace]);+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ const click = await createViewerClick({ send, run, timeout: 12000 });+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.routeErrors=[];window.routeEnds=[];addEventListener('animationend',e=>{if(e.target.matches('.route-journey-flow'))routeEnds.push({name:e.animationName,trusted:e.isTrusted});},true);addEventListener('error',e=>routeErrors.push(e.message));+ addEventListener('unhandledrejection',e=>routeErrors.push(String(e.reason)));+ try {localStorage.removeItem('archify-motion');} catch (_) {}+ window.routeWait=predicate=>new Promise((resolve,reject)=>{+ const start=performance.now();function sample(){if(predicate())return resolve();+ if(performance.now()-start>12000)return reject(new Error('Route observation timed out'));requestAnimationFrame(sample);}requestAnimationFrame(sample);+ });+ ` });+ async function load(mode = 'architecture', { theme = 'dark', reduced = false, suffix = '' } = {}) {+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { media: '', features: [{ name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' }] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}` + suffix });+ await loaded; await run('document.fonts.ready'); await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode, text: key === 'Enter' ? '\r' : key === ' ' ? ' ' : undefined });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ const node = id => `.diagram-container > svg [data-node-id="${id}"]`;+ async function snapshot(scenario) {+ const state = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg'),p=Archify.routeProbe,panel=document.getElementById('route-probe');+ return {active:p.active(),result:p.result(),panel:panel.dataset.state,hidden:panel.hidden,hash:location.hash,+ nodes:[...svg.querySelectorAll('[data-node-id][data-route-match]')].map(n=>n.dataset.nodeId),+ candidates:[...svg.querySelectorAll('[data-route-candidate]')].map(n=>n.dataset.nodeId),+ edges:[...svg.querySelectorAll('[data-edge-from][data-route-match]')].map(n=>({key:n.dataset.edgeKey||null,from:n.dataset.edgeFrom,to:n.dataset.edgeTo,step:n.dataset.routeStep})),+ journey:[...svg.querySelectorAll('[data-node-id][data-route-journey-state]')].map(n=>({id:n.dataset.nodeId,state:n.dataset.routeJourneyState})),+ currentEdges:[...svg.querySelectorAll('[data-edge-from][data-route-journey-current]')].map(n=>n.dataset.edgeKey||null),+ overlays:svg.querySelectorAll('[data-route-probe-overlay]').length,pulses:svg.querySelectorAll('[data-route-journey-overlay]').length,+ chips:[...panel.querySelectorAll('[data-route-journey-index]')].map(n=>({id:n.dataset.routeNodeId,tab:n.tabIndex,current:n.getAttribute('aria-current')})),+ controls:[...document.querySelectorAll('#route-journey-controls button')].map(n=>({id:n.id,disabled:n.disabled,pressed:n.getAttribute('aria-pressed')})),+ status:document.getElementById('route-probe-status').textContent,focus:Archify.focus.active(),owner:Archify.motionGovernor.owner(),+ errors:routeErrors,external:performance.getEntriesByType('resource').map(e=>e.name).filter(n=>/^https?:/.test(n))};+ })()`);+ assert.deepEqual(state.errors, [], scenario); assert.deepEqual(state.external, [], scenario);+ records.push({ scenario, ...state }); return state;+ }+ async function route(source = 'users', target = 'db') {+ assert.equal(await run(`Archify.routeProbe.begin({source:${JSON.stringify(source)}});Archify.routeProbe.choose(${JSON.stringify(target)})`), true);+ }+ async function hash(value) {+ await run(`new Promise(resolve=>{addEventListener('hashchange',()=>requestAnimationFrame(resolve),{once:true});location.hash=${JSON.stringify(value)};})`);+ }+ // Synchronous clock fixture isolates callbacks, including cancelled callbacks.+ // Real playback and animation completion are exercised separately below.+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.routeClock=body=>{+ const schedule=window.setTimeout,cancel=window.clearTimeout,clock=Date.now;let now=1000,serial=0;const jobs=[];+ window.setTimeout=(fn,delay)=>{const job={id:++serial,fn,delay,cancelled:false};jobs.push(job);return job.id;};+ window.clearTimeout=id=>{const job=jobs.find(j=>j.id===id);if(job)job.cancelled=true;};Date.now=()=>now;+ try{return body({jobs,advance:ms=>now+=ms,last:delay=>jobs.filter(j=>j.delay===delay).at(-1),fire:job=>job.fn()});}+ finally{window.setTimeout=schedule;window.clearTimeout=cancel;Date.now=clock;}+ };+ ` });++ await t.test('five modes initialize and trusted endpoint input preserves capture and error recovery', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode); const s = await snapshot(mode + '-initial'); assert.equal(s.active, null); assert.equal(s.hidden, true); assert.equal(s.result, null);+ assert.deepEqual(await run('Object.keys(Archify.routeProbe).sort()'), ['active', 'begin', 'choose', 'clear', 'copyLink', 'escape', 'exportSnapshot', 'finderClosed', 'finderContext', 'finderOpening', 'isJourneyPlaying', 'openFinder', 'pauseJourney', 'playJourney', 'result', 'selectJourneyIndex', 'showOverview', 'syncMotion', 'toggle']);+ }+ await load(); await click('#btn-route-probe'); assert.equal((await snapshot('source')).active, 'source');+ await click(node('users')); let s = await snapshot('target'); assert.equal(s.active, 'target'); assert.equal(s.focus, null);+ assert.deepEqual(s.candidates, ['cdn', 'lb', 'api', 'cache', 'db', 's3', 'queue', 'worker']);+ assert.equal(await run(`Archify.routeProbe.choose('unknown')`), false);+ await click(node('users')); s = await snapshot('same-node'); assert.equal(s.active, 'target'); assert.equal(s.panel, 'error');+ await run(`document.querySelector(${JSON.stringify(node('auth'))}).focus()`); await key('Enter', 'Enter', 13);+ s = await snapshot('unreachable'); assert.equal(s.active, 'target'); assert.equal(s.panel, 'error'); assert.equal(s.focus, null);+ await run(`document.querySelector(${JSON.stringify(node('db'))}).focus()`); await key(' ', 'Space', 32);+ s = await snapshot('result'); assert.deepEqual(s.result.nodes, ['users', 'cdn', 'lb', 'api', 'db']); assert.equal(s.result.hops, 4);+ assert.equal(s.result.journey, -1); assert.equal(s.result.playing, false); assert.equal(s.focus, null);+ assert.deepEqual(s.edges.map(e => [e.from, e.to]), [['users', 'cdn'], ['cdn', 'lb'], ['lb', 'api'], ['api', 'db']]);+ assert.equal(await run(`Archify.routeProbe.choose('cache')`), false);+ assert.equal(await run(`(()=>{const r=Archify.routeProbe.result();r.nodes.length=0;return Archify.routeProbe.result().nodes.length;})()`), 5);+ await load(); await run(`Archify.focus.set('api',{toggle:false});Archify.routeProbe.begin()`);+ assert.equal((await snapshot('focus-seeded')).active, 'target');+ await load(); await run(`Archify.focus.setMany(['api','db']);Archify.routeProbe.begin({focusNode:true})`);+ assert.equal((await snapshot('multi-focus-source')).active, 'source');+ assert.equal(await run('document.activeElement.dataset.nodeId'), 'users');+ const filtered = await run(`(()=>{const p=Archify.routeProbe,svg=document.querySelector('.diagram-container > svg'),container=svg.parentElement,n=svg.querySelector('[data-node-id="users"]');+ const event=key=>new KeyboardEvent('keydown',{key,bubbles:true,cancelable:true});const unrelated=event('ArrowRight');n.dispatchEvent(unrelated);container.setAttribute('data-just-panned','true');const panned=event('Enter');let capture;svg.addEventListener('keydown',()=>{capture={mode:p.active(),prevented:panned.defaultPrevented};},{capture:true,once:true});n.dispatchEvent(panned);container.removeAttribute('data-just-panned');return {capture,mode:p.active(),unrelated:unrelated.defaultPrevented,panned:panned.defaultPrevented,focus:Archify.focus.active()};})()`);+ // Route lets the panned key through; the existing Focus handler then consumes it.+ assert.deepEqual(filtered, { capture: { mode: 'source', prevented: false }, mode: null, unrelated: false, panned: true, focus: 'users' });+ await load('architecture', { suffix: '&embed=1#route=users~db' });+ assert.equal(await run('Archify.routeProbe.begin()'), false); assert.equal((await snapshot('embed-hash')).active, null);+ });++ await t.test('SVG graph fixtures preserve directed BFS order, parallel edges and strict export snapshots', async () => {+ await load('trace');+ // Isolate noncanonical graph inputs; original renderers remain unchanged.+ await run(`window.routeGraph=()=>{+ Archify.routeProbe.clear({preserveView:true});const svg=document.querySelector('.diagram-container > svg');+ svg.innerHTML='<g data-edge-from="a" data-edge-to="b" data-edge-key="ab" data-edge-id="first" transform="translate(3 4)"><path id="author-path" d="M0 0 L10 10" class="author" style="opacity:.7" marker-end="url(#arrow)"/><line x1="0" y1="0" x2="5" y2="5"/></g><path data-edge-from="a" data-edge-to="b" data-edge-key="parallel" d="M2 2 L20 20"/><path data-edge-from="a" data-edge-to="c" data-edge-key="ac" d="M0 0 L10 10"/><polyline data-edge-from="b" data-edge-to="d" data-edge-key="bd" points="0,0 10,10"/><path data-edge-from="c" data-edge-to="d" data-edge-key="cd" d="M0 0 L10 10"/><path data-edge-from="b" data-edge-to="a" data-edge-key="cycle" d="M0 0 L10 10"/><path data-edge-from="a" data-edge-to="a" data-edge-key="loop" d="M0 0 L10 10"/><path data-edge-from="a" data-edge-to="missing" data-edge-key="dangling" d="M0 0 L10 10"/>'+['a','b','c','d','solo'].map((id,i)=>'<g data-node-id="'+id+'" data-node-label="'+id.toUpperCase()+'" data-node-kind="backend" transform="translate('+i*100+' 100)"><rect width="60" height="40"/></g>').join('');+ }`);+ await run('routeGraph()'); await route('a', 'd');+ let s = await snapshot('graph-order'); assert.deepEqual(s.result.nodes, ['a', 'b', 'd']); assert.deepEqual(s.edges.map(e => e.key), ['ab', 'bd']);+ const shape = await run(`(()=>{const overlay=document.querySelector('[data-route-probe-overlay]'),shapes=[...overlay.querySelectorAll('.route-probe-flow')];return {count:shapes.length,transform:overlay.firstElementChild.getAttribute('transform'),d:shapes[0].getAttribute('d'),points:shapes[2].getAttribute('points'),steps:shapes.map(n=>n.style.getPropertyValue('--route-step')),normalized:shapes.every(n=>n.getAttribute('pathLength')==='1'),stripped:!overlay.querySelector('[id],[marker-end],[data-edge-key]'),original:document.getElementById('author-path').getAttribute('d'),beforeNode:overlay.nextElementSibling.hasAttribute('data-node-id')};})()`);+ assert.deepEqual(shape, { count: 3, transform: 'translate(3 4)', d: 'M0 0 L10 10', points: '0,0 10,10', steps: ['0', '0', '1'], normalized: true, stripped: true, original: 'M0 0 L10 10', beforeNode: true });+ const valid = await run(`(()=>{const p=Archify.routeProbe,s=p.exportSnapshot();s.nodeIds.length=0;s.edges[0].key='mutated';s.source.label='mutated';return p.exportSnapshot();})()`);+ assert.deepEqual(valid.nodeIds, ['a', 'b', 'd']); assert.equal(valid.edges[0].key, 'ab'); assert.equal(valid.source.label, 'A'); records.push({ scenario: 'geometry', shape, snapshot: valid });+ await run(`(()=>{routeGraph();const svg=document.querySelector('.diagram-container > svg');svg.insertBefore(svg.querySelector('[data-edge-key="ac"]'),svg.firstChild);})()`); await route('a', 'd');+ assert.deepEqual((await snapshot('reordered-tie')).result.nodes, ['a', 'c', 'd']);+ await run(`Archify.routeProbe.begin({source:'d'})`); assert.equal(await run(`Archify.routeProbe.choose('a')`), false);+ s = await snapshot('directed-unreachable'); assert.deepEqual(s.candidates, []); assert.equal(s.active, 'target');+ for (const [name, mutation] of [+ ['duplicate-node', `svg.appendChild(svg.querySelector('[data-node-id="a"]').cloneNode(true))`],+ ['detached-edge', `edge.remove()`], ['missing-key', `edge.removeAttribute('data-edge-key')`],+ ['duplicate-key', `svg.querySelector('[data-edge-key="bd"]').setAttribute('data-edge-key','ab')`],+ ['inconsistent-fragment', `const n=document.createElementNS(svg.namespaceURI,'text');n.setAttribute('data-edge-key','ab');n.setAttribute('data-edge-from','a');n.setAttribute('data-edge-to','c');svg.appendChild(n)`],+ ['multiple-drawable', `svg.appendChild(edge.cloneNode(true))`],+ ['zero-drawable', `edge.querySelectorAll('path,line').forEach(n=>n.remove())`],+ ['different-drawable', `const n=edge.cloneNode(true);edge.querySelectorAll('path,line').forEach(n=>n.remove());svg.appendChild(n)`],+ ]) {+ await run('routeGraph()'); await route('a', 'd');+ const rejected = await run(`(()=>{const svg=document.querySelector('.diagram-container > svg'),edge=svg.querySelector('[data-edge-key="ab"]');${mutation};return {result:Archify.routeProbe.result()!==null,snapshot:Archify.routeProbe.exportSnapshot()};})()`);+ assert.deepEqual(rejected, { result: true, snapshot: null }, name); records.push({ scenario: 'snapshot-' + name, ...rejected });+ }+ await run(`(()=>{routeGraph();const svg=document.querySelector('.diagram-container > svg');svg.querySelectorAll('[data-edge-from]').forEach(e=>{e.querySelectorAll('path,line,polyline').forEach(n=>n.remove());if(e.matches('path,line,polyline'))e.remove();});})()`);+ await route('a', 'b'); assert.equal(await run(`document.querySelector('[data-route-probe-overlay]').children.length`), 0);+ await run('Archify.routeProbe.selectJourneyIndex(1)'); assert.equal((await snapshot('no-geometry')).pulses, 0);+ await run(`Archify.routeProbe.clear();document.querySelector('.diagram-container > svg').innerHTML='';Archify.routeProbe.begin({focusNode:true})`);+ assert.deepEqual(await run('Archify.routeProbe.finderContext().allowedIds'), []); assert.equal(await run(`Archify.routeProbe.choose('missing')`), false); await snapshot('empty-graph');+ });++ await t.test('native Journey controls, finite playback, pause and layered Escape preserve path state', async () => {+ await load('trace'); await route();+ await run(`document.querySelector('[data-route-journey-index="0"]').focus()`); await key('ArrowLeft', 'ArrowLeft', 37);+ assert.equal(await run('document.activeElement.dataset.routeJourneyIndex'), '0');+ await key('End', 'End', 35); await key('ArrowRight', 'ArrowRight', 39); assert.equal(await run('document.activeElement.dataset.routeJourneyIndex'), '4');+ await key('Home', 'Home', 36); await key('ArrowRight', 'ArrowRight', 39); await key('Enter', 'Enter', 13);+ let s = await snapshot('journey-position'); assert.equal(s.result.journey, 1); assert.deepEqual(s.currentEdges, [s.edges[0].key]);+ assert.deepEqual(s.journey.map(n=>n.state), ['past','current','future','future','future']); assert.equal(s.chips.filter(n=>n.tab===0).length, 1);+ await run(`routeWait(()=>!document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ await click('#route-journey-next'); assert.equal((await snapshot('journey-next')).result.journey, 2);+ await click('#route-journey-prev'); assert.equal((await snapshot('journey-prev')).result.journey, 1);+ await click('#route-journey-overview'); assert.equal((await snapshot('overview')).result.journey, -1);+ await click('#route-journey-play'); assert.equal(await run('Archify.routeProbe.isJourneyPlaying()'), true);+ await run(`routeWait(()=>Archify.routeProbe.result().journey>=1)`); await snapshot('real-play-step');+ await key('Escape', 'Escape', 27); s = await snapshot('escape-paused'); assert.equal(s.result.playing, false); assert.ok(s.result.journey >= 1);+ await key('Escape', 'Escape', 27); assert.equal((await snapshot('escape-overview')).result.journey, -1);+ await key('Escape', 'Escape', 27); assert.equal((await snapshot('escape-cleared')).active, null);+ await route('api', 'db'); await click('#route-journey-play');+ assert.equal(await run('Archify.routeProbe.isJourneyPlaying()'), true, 'native Play click starts the journey');+ await run(`routeWait(()=>!Archify.routeProbe.isJourneyPlaying())`);+ s = await snapshot('natural-completion'); assert.equal(s.result.journey, 1); assert.equal(s.hash, '#route=api~db');+ assert.match(await run(`document.getElementById('route-journey-play').getAttribute('aria-label')`), /Replay/i);+ await click('#route-journey-play'); s = await snapshot('replay'); assert.equal(s.result.journey, 0); assert.equal(s.result.playing, true);+ await run(`document.querySelector('[data-route-journey-index="1"]').focus()`); assert.equal(await run('Archify.routeProbe.isJourneyPlaying()'), false);+ await key(' ', 'Space', 32); assert.equal((await snapshot('native-space-position')).result.journey, 1);+ });++ await t.test('controlled clocks preserve elapsed dwell, fresh steps, stale generations and pulse cleanup', async () => {+ await load('trace'); await route();+ const timing = await run(`routeClock(({jobs,last,advance,fire})=>{+ const p=Archify.routeProbe;const started=p.playJourney(),first=last(1100);advance(400);p.pauseJourney();const paused=p.result();p.playJourney();const resumed=jobs.at(-1).delay;fire(jobs.at(-1));const advanced=p.result();const fresh=jobs.at(-1).delay;+ p.clear({preserveView:true});const afterClear=p.result();fire(first);const stale=p.result();+ p.begin({source:'api'});p.choose('db');p.playJourney();const replaced=last(1100);p.begin({source:'users'});p.choose('cache');const replacement=p.result();fire(replaced);const afterReplacement=p.result();p.clear({preserveView:true});+ const cancelled=['overview','manual'].map(action=>{p.begin({source:'users'});p.choose('db');p.playJourney();const job=last(1100);if(action==='overview')p.showOverview({reveal:false});else p.selectJourneyIndex(2);const before=p.result();fire(job);const after=p.result();p.clear({preserveView:true});return {action,before,after};});+ return {cancelled,started,paused,advanced,resumed,fresh,afterClear,stale,replacement,afterReplacement};+ })`);+ assert.equal(timing.started, true); assert.equal(timing.paused.playing, false); assert.equal(timing.paused.journey, 0);+ assert.equal(timing.resumed, 700); assert.equal(timing.advanced.journey, 1); assert.equal(timing.fresh, 1100);+ for (const row of timing.cancelled) assert.deepEqual(row.after, row.before, row.action);+ assert.equal(timing.afterClear, null); assert.equal(timing.stale, null); assert.deepEqual(timing.afterReplacement, timing.replacement); records.push({ scenario: 'clock-fixture', ...timing });+ await route();+ const pulses = await run(`routeClock(({last,fire})=>{+ const p=Archify.routeProbe;p.selectJourneyIndex(1);const old=document.querySelector('[data-route-journey-overlay]'),fallback=last(860);p.selectJourneyIndex(2);const next=document.querySelector('[data-route-journey-overlay]');fire(fallback);const retained=next.isConnected;p.clear({preserveView:true});fire(last(860));return {oldGone:!old.isConnected,retained,afterClear:document.querySelectorAll('[data-route-journey-overlay]').length};+ })`);+ assert.deepEqual(pulses, { oldGone: true, retained: true, afterClear: 0 });+ await route();+ const fallback = await run(`routeClock(({last,fire})=>{Archify.routeProbe.selectJourneyIndex(1);const before=!!document.querySelector('[data-route-journey-overlay]');fire(last(860));return {before,after:!!document.querySelector('[data-route-journey-overlay]'),result:Archify.routeProbe.result()};})`);+ assert.equal(fallback.before, true); assert.equal(fallback.after, false); assert.equal(fallback.result.journey, 1);+ records.push({ scenario: 'pulse-fixture', pulses, fallback });+ await run('Archify.routeProbe.selectJourneyIndex(2)');+ await run(`routeWait(()=>routeEnds.some(e=>e.trusted&&e.name==='archify-route-journey-flow'))`);+ await run(`routeWait(()=>!document.querySelector('[data-route-journey-overlay]'))`);+ assert.equal((await snapshot('real-animation-complete')).result.journey, 2);+ await run(`Archify.routeProbe.selectJourneyIndex(3);window.foreignToken=Archify.motionGovernor.claim('story',()=>{})`);+ assert.equal((await snapshot('owner-replacement')).pulses, 0);+ await run('Archify.motionGovernor.release(foreignToken)'); await snapshot('owner-released');+ });++ await t.test('actual Finder, Focus, Lens, Guide and Camera handoffs retain cleanup options', async () => {+ await load('trace'); await click('#btn-route-probe'); await click('#route-probe-find');+ await run(`routeWait(()=>document.activeElement.id==='node-finder-input')`);+ assert.equal(await run('Archify.finder.context()'), 'route-source');+ assert.equal(await run(`document.getElementById('route-probe').dataset.finderOpen`), 'true');+ await key('Escape', 'Escape', 27); assert.equal(await run('document.activeElement.id'), 'route-probe-find');+ await run(`Archify.routeProbe.choose('users')`);+ const context = await run('Archify.routeProbe.finderContext()'); assert.ok(context.allowedIds.includes('db')); assert.ok(!context.allowedIds.includes('auth')); assert.match(context.badges.db, /4/);+ assert.equal(await run('Archify.routeProbe.openFinder()'), true);+ await run(`routeWait(()=>document.activeElement.id==='node-finder-input')`);+ await run(`document.getElementById('node-finder-input').value='PostgreSQL';document.getElementById('node-finder-input').dispatchEvent(new Event('input',{bubbles:true}))`);+ await key('Enter', 'Enter', 13); assert.equal((await snapshot('finder-result')).active, 'result');+ for (const [name, action] of [+ ['focus', `Archify.focus.set('api',{toggle:false})`], ['lens', `Archify.semanticLens.select('backend')`],+ ]) {+ await load('trace'); await route(); await run('Archify.routeProbe.playJourney()'); await run(action);+ const s = await snapshot(name + '-takeover'); assert.equal(s.active, null); assert.equal(s.overlays, 0); assert.equal(s.pulses, 0);+ }+ for (const [name, action] of [+ ['camera', `Archify.view.zoomIn()`], ['guide', `Archify.guide.open()`], ['still', `Archify.motionGovernor.pause()`],+ ['print-fixture', `dispatchEvent(new Event('beforeprint'))`],+ ['hidden-fixture', `Object.defineProperty(document,'hidden',{configurable:true,value:true});document.dispatchEvent(new Event('visibilitychange'))`],+ ]) {+ await load('trace'); await route(); await run('Archify.routeProbe.playJourney()'); await run(action);+ const s = await snapshot(name + '-pause'); assert.equal(s.active, 'result'); assert.equal(s.result.playing, false); assert.equal(s.result.journey, 0);+ if (name === 'hidden-fixture') { await run(`delete document.hidden;document.dispatchEvent(new Event('visibilitychange'))`); assert.equal(await run('Archify.routeProbe.isJourneyPlaying()'), false); }+ if (name === 'still') { await run('Archify.motionGovernor.resume()'); assert.equal(await run('Archify.routeProbe.isJourneyPlaying()'), false); }+ }+ await load(); await route(); assert.equal(await run('Archify.routeProbe.playJourney()'), false);+ await run('Archify.view.zoomIn()'); const view = await run('Archify.view.state()');+ assert.equal(await run('Archify.routeProbe.clear({preserveView:true,updateUrl:false})===undefined'), true);+ assert.deepEqual(await run('Archify.view.state()'), view); assert.equal((await snapshot('clear-preserved')).hash, '#route=users~db');+ await run('Archify.routeProbe.clear()'); assert.deepEqual(await run('Archify.view.state()'), view);+ await route(); await run('Archify.view.zoomIn();Archify.routeProbe.clear({restoreFocus:true})');+ assert.equal(await run('Archify.view.state().scale'), 1); assert.equal(await run('document.activeElement.id'), 'btn-route-probe'); await snapshot('clear-reset');+ });++ await t.test('hash restoration and controlled clipboard preserve invalid states, query and delayed feedback', async () => {+ await load('architecture', { suffix: '&keep=yes#route=users~db' });+ let s = await snapshot('initial-hash'); assert.equal(s.active, 'result'); assert.equal(s.result.journey, -1);+ for (const value of ['#route=users', '#route=unknown~db', '#route=users~db~api']) {+ await hash(value); assert.deepEqual((await snapshot(value)).result.nodes, ['users','cdn','lb','api','db']);+ }+ await hash('#route=users~users'); s = await snapshot('hash-same'); assert.equal(s.active, 'target'); assert.equal(s.panel, 'error'); assert.equal(s.hash, '#route=users~users');+ await hash('#route=db~users'); s = await snapshot('hash-unreachable'); assert.equal(s.active, 'target'); assert.equal(s.panel, 'error');+ await hash('#route='); assert.equal((await snapshot('hash-empty')).active, null);+ await hash('#route=api~db'); await hash('#unrelated=yes'); assert.equal((await snapshot('hash-missing')).active, null);+ assert.equal(await run('Archify.routeProbe.copyLink()'), false);+ await run(`Archify.routeProbe.begin({source:'api'});Archify.routeProbe.choose('db',{updateUrl:false})`); assert.equal(await run('location.hash'), '#unrelated=yes');+ assert.equal(await run('location.search'), '?theme=dark&keep=yes');+ for (const mode of ['success','reject','absent','failure','throw']) {+ const copied = await run(`(async()=>{+ const descriptor=Object.getOwnPropertyDescriptor(navigator,'clipboard'),exec=document.execCommand;let captured,commands=0;+ const expected=location.href.replace(/#.*$/,'')+'#route=api~db';+ Object.defineProperty(navigator,'clipboard',{configurable:true,value:${mode === 'success' ? "{writeText:v=>{captured=v;return Promise.resolve();}}" : mode === 'reject' ? "{writeText:()=>Promise.reject(new Error('fixture'))}" : 'undefined'}});+ document.execCommand=command=>{commands++;captured=document.activeElement.value;if(${JSON.stringify(mode)}==='throw')throw new Error('fixture');return ${JSON.stringify(mode)}!=='failure';};+ try {const value=await Archify.routeProbe.copyLink(),button=document.getElementById('route-probe-copy');return {value,commands,correct:captured===expected,fields:document.querySelectorAll('textarea[readonly]').length,text:button.textContent,aria:button.getAttribute('aria-label')};}+ finally {document.execCommand=exec;if(descriptor)Object.defineProperty(navigator,'clipboard',descriptor);else delete navigator.clipboard;}+ })()`);+ assert.equal(copied.value, !['failure','throw'].includes(mode)); assert.equal(copied.commands, mode === 'success' ? 0 : 1); assert.equal(copied.correct, true); assert.equal(copied.fields, 0);+ assert.match(copied.text, copied.value ? /Copied/ : /Copy failed/i); assert.match(copied.aria, copied.value ? /copied/i : /Could not copy/i);+ // A pending feedback callback is not cancelled by clearing the route.+ if (mode === 'throw') await run('Archify.routeProbe.clear()');+ await run(`routeWait(()=>document.getElementById('route-probe-copy').getAttribute('aria-label')==='Copy link to traced route')`);+ records.push({ scenario: 'copy-' + mode, ...copied });+ }+ await snapshot('feedback-after-clear');+ });++ await t.test('docking rectangle and timer fixtures preserve top/bottom ties, resize and scroll', async () => {+ await load(); await route();+ await run(`routeWait(()=>!document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ const docked = await run(`(()=>{+ const panel=document.getElementById('route-probe'),container=document.querySelector('.diagram-container'),nav=container.querySelector('.diagram-nav'),nodes=[...container.querySelectorAll('[data-node-id]')],elements=[panel,container,nav,...nodes];+ const saved=elements.map(e=>Object.getOwnPropertyDescriptor(e,'getBoundingClientRect')),props=['offsetWidth','offsetHeight'].map(n=>Object.getOwnPropertyDescriptor(panel,n));let top=10,size=100;+ const rect=(x,y,w,h)=>({left:x,right:x+w,top:y,bottom:y+h,width:w,height:h});+ panel.getBoundingClientRect=()=>rect(0,10,200,100);container.getBoundingClientRect=()=>rect(0,0,1000,1000);nav.getBoundingClientRect=()=>rect(600,900,300,40);+ nodes.forEach(n=>n.getBoundingClientRect=()=>rect(0,top,200,100));Object.defineProperty(panel,'offsetWidth',{configurable:true,get:()=>size?200:0});Object.defineProperty(panel,'offsetHeight',{configurable:true,get:()=>size});+ try {const sides=[];for(const value of [10,790,400]){top=value;container.dispatchEvent(new Event('scroll'));sides.push(panel.dataset.routeDock);}size=0;container.dispatchEvent(new Event('scroll'));const noSize=panel.dataset.routeDock;+ const scheduled=routeClock(({jobs})=>{dispatchEvent(new Event('resize'));return jobs.map(j=>j.delay);});Archify.routeProbe.clear({preserveView:true});container.dispatchEvent(new Event('scroll'));return {sides,noSize,scheduled,hidden:panel.getAttribute('data-route-dock')};}+ finally{elements.forEach((e,i)=>{if(saved[i])Object.defineProperty(e,'getBoundingClientRect',saved[i]);else delete e.getBoundingClientRect;});['offsetWidth','offsetHeight'].forEach((n,i)=>{if(props[i])Object.defineProperty(panel,n,props[i]);else delete panel[n];});}+ })()`);+ assert.deepEqual(docked.sides, ['bottom','top','top']); assert.equal(docked.noSize, 'top'); assert.equal(docked.hidden, null);+ assert.ok(docked.scheduled.includes(120)); assert.ok(docked.scheduled.includes(560)); records.push({ scenario: 'docking-fixture', ...docked });+ await route();+ for (const width of [720, 390, 1440]) {+ await send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await run('Archify.viewerChromeLayout.whenStable()');+ await run(`routeWait(()=>['top','bottom'].includes(document.getElementById('route-probe').dataset.routeDock))`);+ const state = await run(`(()=>{const p=document.getElementById('route-probe'),container=document.querySelector('.diagram-container');container.scrollLeft=40;return {width:innerWidth,dock:p.dataset.routeDock,hidden:p.hidden};})()`);+ assert.equal(state.hidden, false); records.push({ scenario: 'viewport-' + width, ...state });+ }+ });++ await t.test('theme snapshots, Still rendering and real exports retain authored route semantics', async () => {+ for (const theme of ['dark','light']) {+ for (const position of [-1, 2]) {+ await load('trace', { theme, reduced: true }); await route();+ if (position >= 0) await run(`Archify.routeProbe.selectJourneyIndex(${position})`);+ await run(`routeWait(()=>!document.querySelector('.diagram-container').hasAttribute('data-camera-transaction'))`);+ assert.equal(await run('Archify.routeProbe.playJourney()'), false);+ const style = await run(`({flow:getComputedStyle(document.querySelector('.route-probe-flow')).animationName,pulses:document.querySelectorAll('[data-route-journey-overlay]').length})`);+ assert.deepEqual(style, { flow: 'none', pulses: 0 }); await snapshot(theme + '-' + position);+ if (evidence) {+ await run(`Promise.all(document.getAnimations().filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);+ await run('new Promise(resolve=>requestAnimationFrame(()=>requestAnimationFrame(resolve)))');+ const shot=await send('Page.captureScreenshot',{format:'png'});fs.writeFileSync(path.join(evidence,theme+(position<0?'-overview':'-position')+'.png'),Buffer.from(shot.data,'base64'));+ }+ const exported = await run(`(async()=>{+ const original=URL.createObjectURL;let blob;URL.createObjectURL=function(v){if(v.type.startsWith('image/svg+xml'))blob=v;return original.call(URL,v);};+ try {await Archify.exportMenu.run('svg');}finally{URL.createObjectURL=original;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {clean:!root.hasAttribute('data-route-active')&&!root.hasAttribute('data-route-journey')&&!root.querySelector('[data-route-match],[data-route-step],[data-route-journey-current],[data-route-probe-overlay],[data-route-journey-overlay]'),viewBox:root.getAttribute('viewBox')===document.querySelector('.diagram-container > svg').getAttribute('viewBox')};+ })()`);+ assert.deepEqual(exported, { clean: true, viewBox: true });+ }+ }+ await load('trace'); await route(); await run('Archify.motionGovernor.pause()');+ assert.equal(await run(`getComputedStyle(document.querySelector('.route-probe-flow')).animationName`), 'none');+ assert.equal(await run('Archify.routeProbe.playJourney()'), false);+ await run('Archify.exportMenu.open()');+ const share = await run(`(()=>{const n=document.querySelector('[data-action="route-share-card"]');return {hidden:n.hidden,disabled:n.disabled};})()`);+ assert.deepEqual(share, { hidden: false, disabled: false });+ await run('Archify.routeProbe.clear({preserveView:true})');+ assert.equal(await run(`document.querySelector('[data-action="route-share-card"]').hidden`), true);+ });+});diff --git a/archify/test/semantic-lens-browser.test.mjs b/archify/test/semantic-lens-browser.test.mjsnew file mode 100644index 00000000..a22af4a2--- /dev/null+++ b/archify/test/semantic-lens-browser.test.mjs@@ -0,0 +1,372 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { findChrome } from '../bin/visual-check.mjs';+import { desktopBrowser, desktopPointerCheck } from './helpers/desktop-browser.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;++test('Semantic Lens preserves selection, legend preview and panel contracts', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser Semantic Lens checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-lens-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_LENS_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+ };+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, mode + '.html');+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ const trace = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', cases.architecture), 'utf8'));+ trace.meta.animation = 'trace';+ const traceInput = path.join(scratch, 'trace.json');+ fs.writeFileSync(traceInput, JSON.stringify(trace)); files.trace = path.join(scratch, 'trace.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'), traceInput, files.trace]);+ // Initialization fixtures alter only inputs immediately before Lens captures DOM/media.+ const original = fs.readFileSync(files.architecture, 'utf8');+ assert.ok(original.includes(' Archify.semanticLens = (function () {'), 'Lens fixture anchor');+ for (const [name, source] of Object.entries({+ absent: `document.querySelector('[data-legend-bridge]').remove();`,+ small: `document.querySelectorAll('[data-legend-kind]').forEach((e,i)=>{if(i>1)e.remove();});`,+ zero: `document.querySelector('[data-legend-kind]').setAttribute('data-legend-kind','missing');`,+ coarse: `window.lensMatchMedia=window.matchMedia;window.matchMedia=q=>q==='(hover: hover) and (pointer: fine)'?{matches:false}:lensMatchMedia(q);`,+ })) {+ files[name] = path.join(scratch, name + '.html');+ fs.writeFileSync(files[name], original.replace(' Archify.semanticLens = (function () {', source + '\n Archify.semanticLens = (function () {'));+ }+ const browser = desktopBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const checkPointer = await desktopPointerCheck(browser, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await send('Emulation.setFocusEmulationEnabled', { enabled: true });+ async function run(expression) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.lensErrors=[];window.lensEnds=[];addEventListener('animationend',e=>{if(e.target.matches('.semantic-lens-flow'))lensEnds.push({name:e.animationName,trusted:e.isTrusted});},true);addEventListener('error',e=>lensErrors.push(e.message));+ addEventListener('unhandledrejection',e=>lensErrors.push(String(e.reason)));+ try {localStorage.removeItem('archify-motion');} catch (_) {}+ window.lensWait=predicate=>new Promise((resolve,reject)=>{+ const start=performance.now();function sample(){if(predicate())return resolve();+ if(performance.now()-start>12000)return reject(new Error('Lens observation timed out'));requestAnimationFrame(sample);}requestAnimationFrame(sample);+ });+ ` });+ async function load(mode = 'architecture', { theme = 'dark', reduced = false, suffix = '' } = {}) {+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false });+ await send('Emulation.setEmulatedMedia', { media: '', features: [{ name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' }] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}` + suffix });+ await loaded;+ await checkPointer();+ await run('document.fonts.ready'); await run('Archify.viewerChromeLayout.whenStable()');+ }+ async function point(selector) {+ return run(`(()=>{const r=document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect();return {x:r.x+r.width/2,y:r.y+r.height/2};})()`);+ }+ async function move(selector) { await send('Input.dispatchMouseEvent', { type: 'mouseMoved', ...(selector ? await point(selector) : { x: 0, y: 0 }) }); }+ async function click(selector) {+ const p = await point(selector);+ await send('Input.dispatchMouseEvent', { type: 'mousePressed', ...p, button: 'left', clickCount: 1 });+ await send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...p, button: 'left', clickCount: 1 });+ }+ async function key(key, code, windowsVirtualKeyCode) {+ await send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode, text: key === 'Enter' ? '\r' : key === ' ' ? ' ' : undefined });+ await send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode });+ }+ const legend = kind => `[data-legend-kind="${kind}"]`;+ async function snapshot(scenario) {+ const state = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg'),p=Archify.semanticLens;+ const ids=a=>[...svg.querySelectorAll('[data-node-id]['+a+']')].map(n=>n.getAttribute('data-node-id'));+ return {active:p.active(),open:p.isOpen(),kinds:p.kinds(),hash:location.hash,+ selected:ids('data-lens-selected'),peers:ids('data-lens-peer'),preview:svg.getAttribute('data-legend-preview-active'),+ previewSelected:ids('data-legend-preview-selected'),previewPeers:ids('data-legend-preview-peer'),+ edges:[...svg.querySelectorAll('[data-edge-from][data-lens-match]')].map(n=>[n.getAttribute('data-edge-from'),n.getAttribute('data-edge-to'),n.getAttribute('data-edge-key')]),+ count:svg.getAttribute('data-lens-flow-count'),density:svg.getAttribute('data-lens-flow-density'),+ overlays:svg.querySelectorAll('[data-semantic-lens-overlay]').length,+ directions:[...svg.querySelectorAll('.semantic-lens-flow')].map(n=>n.getAttribute('data-direction')),+ status:document.getElementById('semantic-lens-status').textContent,+ buttons:[...document.querySelectorAll('#semantic-lens-kinds button')].map(n=>({kind:n.dataset.kind,disabled:n.disabled,pressed:n.getAttribute('aria-pressed'),label:n.getAttribute('aria-label')})),+ owner:Archify.motionGovernor.owner(),errors:lensErrors,external:performance.getEntriesByType('resource').map(e=>e.name).filter(n=>/^https?:/.test(n))};+ })()`);+ assert.deepEqual(state.errors, [], scenario); assert.deepEqual(state.external, [], scenario);+ records.push({ scenario, ...state }); return state;+ }+ async function hash(value) {+ await run(`new Promise(resolve=>{addEventListener('hashchange',()=>resolve(),{once:true});location.hash=${JSON.stringify(value)};})`);+ }++ await t.test('five modes and optional legend initialization preserve counts, roles and embed boundaries', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode); const state = await snapshot(mode + '-initial');+ assert.equal(state.active, null); assert.equal(state.open, false);+ assert.deepEqual(await run('Object.keys(Archify.semanticLens).sort()'), ['active', 'clear', 'clearPreview', 'close', 'copyLink', 'isOpen', 'kinds', 'open', 'select', 'toggle']);+ assert.deepEqual(state.buttons.map(n => n.kind), state.kinds.map(n => n.id));+ assert.ok(state.kinds.every((k, i, a) => i === 0 || a[i - 1].count >= k.count));+ assert.equal(await run(`(()=>{const svg=document.querySelector('.diagram-container > svg');return Archify.semanticLens.kinds().reduce((n,k)=>n+k.count,0)===new Set([...svg.querySelectorAll('[data-node-id][data-node-kind]')].map(n=>n.dataset.nodeId).filter(Boolean)).size;})()`), true);+ }+ for (const mode of ['absent', 'small', 'zero']) {+ await load(mode);+ const facts = await run(`(()=>{const b=document.querySelector('[data-legend-bridge]'),z=document.querySelector('[data-legend-zero]');return {role:b?.getAttribute('role')||null,buttons:b?.querySelectorAll('[role="button"]').length||0,zero:z?{count:z.dataset.legendCount,role:z.getAttribute('role'),hit:!!z.querySelector('[data-legend-hit]'),badge:!!z.querySelector('[data-legend-count-badge]')}:null};})()`);+ if (mode === 'absent') assert.equal(facts.role, null);+ if (mode === 'small') { assert.equal(facts.role, 'group'); assert.equal(facts.buttons, 2); }+ if (mode === 'zero') assert.deepEqual(facts.zero, { count: '0', role: null, hit: true, badge: true });+ assert.equal(await run(`Archify.semanticLens.select('backend')`), true); await snapshot(mode);+ }+ await load('architecture', { suffix: '&embed=1#lens=backend' });+ assert.equal(await run('Archify.semanticLens.open()'), false);+ assert.equal(await run(`document.querySelectorAll('[data-legend-bridge-runtime]').length`), 0);+ assert.deepEqual((await snapshot('embed-hash')).active, ['backend']);+ assert.equal((await snapshot('embed-flow')).overlays, 0);+ });++ await t.test('trusted buttons, selection transitions, return values and three cleanup operations stay distinct', async () => {+ await load(); await click('#btn-semantic-lens');+ await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`);+ await click('#semantic-lens-kinds [data-kind="backend"]');+ let s = await snapshot('one-kind'); assert.deepEqual(s.active, ['backend']); assert.equal(s.open, true);+ assert.deepEqual(s.selected, ['api', 'worker']); assert.ok(s.peers.length > 0); assert.ok(s.edges.length > 0);+ await click('#semantic-lens-kinds [data-kind="database"]');+ s = await snapshot('two-kinds'); assert.deepEqual(s.active, ['backend', 'database']);+ assert.ok(s.buttons.filter(n => !s.active.includes(n.kind)).every(n => n.disabled));+ assert.equal(await run('Archify.semanticLens.clearPreview()===undefined'), true);+ s = await snapshot('selection-after-clear-preview'); assert.deepEqual(s.active, ['backend', 'database']); assert.equal(s.open, true); assert.equal(s.hash, '#lens=backend~database');+ assert.equal(await run(`Archify.semanticLens.select('cloud')`), false);+ assert.equal(await run(`Archify.semanticLens.select('unknown')`), false);+ assert.equal(await run(`(()=>{const a=Archify.semanticLens.active();a.push('fake');return Archify.semanticLens.active().length;})()`), 2);+ const close = await run(`(()=>{const p=Archify.semanticLens,h=location.hash,o=document.querySelector('[data-semantic-lens-overlay]');return {value:p.close(),hash:h===location.hash,overlay:o===document.querySelector('[data-semantic-lens-overlay]'),focus:document.activeElement.id};})()`);+ assert.deepEqual(close, { value: false, hash: true, overlay: true, focus: 'btn-semantic-lens' });+ assert.equal((await snapshot('closed-selected')).open, false);+ assert.equal(await run(`Archify.semanticLens.select('database')`), true);+ await run('Archify.view.zoomIn()'); const zoom = await run('Archify.view.state()');+ assert.equal(await run(`Archify.semanticLens.select('backend')`), false);+ assert.deepEqual(await run('Archify.view.state()'), zoom);+ await run(`Archify.semanticLens.select('backend');Archify.semanticLens.open()`);+ await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`);+ await run('Archify.view.zoomIn()'); const beforeClear = await run('Archify.view.state()');+ assert.equal(await run(`Archify.semanticLens.clear({preserveView:true,updateUrl:false})`), false);+ s = await snapshot('clear-preserve'); assert.equal(s.active, null); assert.equal(s.open, true); assert.equal(s.hash, '#lens=backend');+ assert.deepEqual(await run('Archify.view.state()'), beforeClear);+ await run(`Archify.semanticLens.clear({closePanel:true})`);+ s = await snapshot('clear-default'); assert.equal(s.open, false); assert.equal(s.hash, ''); assert.equal(s.overlays, 0);+ assert.equal(await run('Archify.view.state().scale'), 1);+ await move(legend('backend')); assert.equal((await snapshot('preview-only')).preview, 'backend');+ assert.equal(await run(`Archify.semanticLens.clear({preserveView:true});document.querySelector('.diagram-container > svg').getAttribute('data-legend-preview-active')`), 'backend');+ assert.equal(await run('Archify.semanticLens.clearPreview()===undefined'), true);+ assert.equal((await snapshot('preview-cleared')).preview, null);+ // Retained hover reference is reused by the original focusout sync path.+ await run(`document.querySelector(${JSON.stringify(legend('database'))}).focus();document.activeElement.blur()`);+ assert.equal((await snapshot('retained-hover')).preview, 'backend');+ assert.equal(await run(`Archify.semanticLens.select('unknown')`), false);+ assert.equal((await snapshot('invalid-clears-preview')).preview, null);+ });++ await t.test('native legend focus, pointer transitions, keyboard activation and opener restoration', async () => {+ await load(); await move(legend('backend'));+ let s = await snapshot('legend-hover'); assert.equal(s.preview, 'backend'); assert.equal(s.active, null); assert.equal(s.overlays, 0); assert.equal(s.hash, '');+ await run(`document.querySelector(${JSON.stringify(legend('database'))}).focus()`);+ await move(legend('cloud')); assert.equal((await snapshot('focus-preferred')).preview, 'database');+ await run('document.activeElement.blur()'); assert.equal((await snapshot('hover-fallback')).preview, 'cloud');+ const internal = await run(`(()=>{const e=document.querySelector(${JSON.stringify(legend('cloud'))});e.dispatchEvent(new PointerEvent('pointerout',{bubbles:true,pointerType:'mouse',relatedTarget:e.querySelector('text')}));return document.querySelector('.diagram-container > svg').getAttribute('data-legend-preview-active');})()`);+ assert.equal(internal, 'cloud');+ await move(); await run(`document.querySelector('[data-legend-kind][role="button"]').focus()`);+ const entries = await run(`Array.from(document.querySelectorAll('[data-legend-kind][role="button"]'),n=>n.dataset.legendKind)`);+ await key('End', 'End', 35); assert.equal(await run('document.activeElement.dataset.legendKind'), entries.at(-1));+ await key('ArrowRight', 'ArrowRight', 39); assert.equal(await run('document.activeElement.dataset.legendKind'), entries[0]);+ await key('ArrowLeft', 'ArrowLeft', 37); assert.equal(await run('document.activeElement.dataset.legendKind'), entries.at(-1));+ await key('Home', 'Home', 36); assert.equal(await run('document.activeElement.dataset.legendKind'), entries[0]);+ assert.equal(await run(`document.querySelectorAll('[data-legend-kind][tabindex="0"]').length`), 1);+ await key('Enter', 'Enter', 13);+ await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`);+ assert.deepEqual((await snapshot('legend-enter')).active, [entries[0]]);+ await key('Escape', 'Escape', 27); assert.equal(await run('document.activeElement.dataset.legendKind'), entries[0]);+ await key(' ', 'Space', 32); await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`);+ s = await snapshot('legend-space-toggle'); assert.equal(s.active, null); assert.equal(s.open, true);+ await key('Enter', 'Enter', 13); assert.ok((await snapshot('panel-native-enter')).active);+ // Selection rebuilds buttons and removes the focused target; refocus the new button.+ await run(`document.querySelector('#semantic-lens-kinds [aria-pressed="true"]').focus()`);+ await key(' ', 'Space', 32);+ assert.equal((await snapshot('panel-native-space')).active, null);+ await run(`Archify.semanticLens.clear({closePanel:true,preserveView:true});Archify.semanticLens.select('backend');Archify.semanticLens.select('database');`);+ await click(legend('cloud'));+ s = await snapshot('third-legend-opens'); assert.deepEqual(s.active, ['backend', 'database']); assert.equal(s.open, true);+ await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`); await key('Escape', 'Escape', 27);+ assert.equal(await run('document.activeElement.dataset.legendKind'), 'cloud');+ for (const mode of ['architecture', 'coarse']) {+ await load(mode);+ await run(`document.querySelector(${JSON.stringify(legend('backend'))}).dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType:${JSON.stringify(mode === 'coarse' ? 'mouse' : 'touch')}}))`);+ assert.equal((await snapshot(mode + '-filtered-pointer')).preview, null);+ }+ });++ await t.test('minimal SVG fixtures preserve node indexing, grouped directions, first-member geometry and 24/25 threshold', async () => {+ await load();+ const data = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg'),p=Archify.semanticLens;+ svg.innerHTML='<g data-edge-from="a" data-edge-to="b" data-edge-key="ab" transform="translate(3 4)"><path id="source-path" d="M0 0 L10 10" class="author" style="opacity:.7" marker-end="url(#arrow)"/><line x1="1" y1="2" x2="3" y2="4"/></g><path data-edge-from="a" data-edge-to="b" data-edge-key="ab" d="M1 1 L2 2"/><polyline data-edge-from="b" data-edge-to="a" points="1,2 3,4"/><path data-edge-from="b" data-edge-to="a" d="M3 3 L5 5"/><path data-edge-from="a" data-edge-to="a" d="M0 0 C1 2 3 4 0 0"/><g data-node-id="a" data-node-kind="backend"/><g data-node-id="b" data-node-kind="database"/><g data-node-id="a" data-node-kind="ignored"/><g data-node-id="missing-kind"/><g data-node-id="" data-node-kind="ignored"/><g data-node-id="solo" data-node-kind=""/>';+ const before=svg.querySelector('#source-path').outerHTML;p.select('backend');+ const overlay=svg.querySelector('[data-semantic-lens-overlay]'),shapes=[...overlay.querySelectorAll('.semantic-lens-flow')];+ const result={kinds:p.kinds(),single:{count:svg.dataset.lensFlowCount,matched:svg.querySelectorAll('[data-edge-from][data-lens-match]').length,directions:shapes.map(n=>n.dataset.direction),status:document.getElementById('semantic-lens-status').textContent},+ geometry:{transform:overlay.firstElementChild.getAttribute('transform'),d:shapes[0].getAttribute('d'),points:shapes[2].getAttribute('points'),delays:shapes.map(n=>n.style.getPropertyValue('--lens-flow-delay')),stripped:!overlay.querySelector('[id],[marker-end],[data-edge-from]'),normalized:shapes.every(n=>n.getAttribute('pathLength')==='1'),unchanged:before===svg.querySelector('#source-path').outerHTML,beforeNode:overlay.nextElementSibling.hasAttribute('data-node-id')}};+ p.select('database');result.double={count:svg.dataset.lensFlowCount,directions:[...svg.querySelectorAll('.semantic-lens-flow')].map(n=>n.dataset.direction),peers:svg.querySelectorAll('[data-lens-peer]').length,status:document.getElementById('semantic-lens-status').textContent};+ p.clear({preserveView:true});p.select('database');p.select('backend');result.reverse=[...svg.querySelectorAll('.semantic-lens-flow')].map(n=>n.dataset.direction);+ p.clear({preserveView:true});p.select('neutral');p.select('backend');result.zero={count:svg.dataset.lensFlowCount,overlays:svg.querySelectorAll('[data-semantic-lens-overlay]').length};return result;+ })()`);+ assert.deepEqual(data.kinds.map(n => n.id).sort(), ['backend', 'database', 'neutral']);+ assert.ok(data.kinds.every(n => n.count === 1));+ assert.equal(data.single.count, '3'); assert.equal(data.single.matched, 5);+ assert.deepEqual(data.single.directions, ['out', 'out', 'in', 'within']); assert.match(data.single.status, /3 touching relationships/);+ assert.deepEqual(data.geometry, { transform: 'translate(3 4)', d: 'M0 0 L10 10', points: '1,2 3,4', delays: ['0.00s', '0.00s', '0.08s', '0.16s'], stripped: true, normalized: true, unchanged: true, beforeNode: true });+ assert.equal(data.double.count, '2'); assert.equal(data.double.peers, 0);+ assert.deepEqual(data.double.directions, ['forward', 'forward', 'reverse']);+ assert.deepEqual(data.reverse, ['reverse', 'reverse', 'forward']); assert.deepEqual(data.zero, { count: '0', overlays: 0 });+ records.push({ scenario: 'geometry-fixture', ...data });+ for (const count of [24, 25, 24, 0]) {+ await run(`(()=>{const svg=document.querySelector('.diagram-container > svg');Archify.semanticLens.clear({preserveView:true});svg.innerHTML=Array.from({length:${count}},(_,i)=>'<path data-edge-from="a" data-edge-to="b" data-edge-key="e'+i+'" d="M0 0 L10 10"/>').join('')+'<g data-node-id="a" data-node-kind="backend"/><g data-node-id="b" data-node-kind="database"/>';Archify.semanticLens.select('backend');})()`);+ const s = await snapshot('threshold-' + count); assert.equal(s.count, String(count)); assert.equal(s.edges.length, count);+ assert.equal(s.overlays, count > 0 && count <= 24 ? 1 : 0); assert.equal(s.density, count > 24 ? 'quiet' : null);+ }+ await run(`(()=>{const svg=document.querySelector('.diagram-container > svg');Archify.semanticLens.clear({preserveView:true});svg.innerHTML='<g data-edge-from="a" data-edge-to="b"><text>No shape</text></g><g data-node-id="a" data-node-kind="backend"/><g data-node-id="b" data-node-kind="database"/>';Archify.semanticLens.select('backend');})()`);+ const s = await snapshot('no-shape'); assert.equal(s.count, '1'); assert.equal(s.overlays, 0);+ });++ await t.test('initial URL, hashchange and controlled clipboard boundaries retain normalization and feedback', async () => {+ await load('architecture', { suffix: '&keep=yes#lens=database~database~unknown~backend~cloud' });+ let s = await snapshot('initial-hash'); assert.deepEqual(s.active, ['database', 'backend']); assert.equal(s.open, false);+ assert.equal(s.hash, '#lens=database~database~unknown~backend~cloud');+ await hash('#lens=unknown'); assert.deepEqual((await snapshot('invalid-hash')).active, ['database', 'backend']);+ await hash('#lens='); assert.equal((await snapshot('empty-hash')).active, null);+ await hash('#lens=backend'); await hash('#unrelated=1'); assert.equal((await snapshot('missing-hash')).active, null);+ assert.equal(await run('Archify.semanticLens.copyLink()'), false);+ await run(`Archify.semanticLens.select('backend',{updateUrl:false})`);+ assert.equal(await run('location.hash'), '#unrelated=1');+ await run(`Archify.semanticLens.select('database')`); assert.equal(await run('location.search'), '?theme=dark&keep=yes');+ // Never touch the host clipboard: replace both the preferred API and fallback.+ for (const mode of ['success', 'reject', 'absent', 'failure', 'throw']) {+ const copied = await run(`(async()=>{+ const descriptor=Object.getOwnPropertyDescriptor(navigator,'clipboard'),exec=document.execCommand;let captured,commands=0;+ const expected=location.href.replace(/#.*$/,'')+'#lens=backend~database';+ Object.defineProperty(navigator,'clipboard',{configurable:true,value:${mode === 'success' ? "{writeText:v=>{captured=v;return Promise.resolve();}}" : mode === 'reject' ? "{writeText:()=>Promise.reject(new Error('fixture'))}" : 'undefined'}});+ document.execCommand=command=>{commands++;captured=document.activeElement.value;if(${JSON.stringify(mode)}==='throw')throw new Error('fixture');return ${JSON.stringify(mode)}!=='failure';};+ try {const value=await Archify.semanticLens.copyLink();return {value,commands,correct:captured===expected,fields:document.querySelectorAll('textarea[readonly]').length,text:document.getElementById('semantic-lens-copy').textContent};}+ finally {document.execCommand=exec;if(descriptor)Object.defineProperty(navigator,'clipboard',descriptor);else delete navigator.clipboard;}+ })()`);+ assert.equal(copied.value, !['failure', 'throw'].includes(mode)); assert.equal(copied.commands, mode === 'success' ? 0 : 1);+ assert.equal(copied.correct, true); assert.equal(copied.fields, 0);+ assert.match(copied.text, copied.value ? /Copied/ : /Copy failed/i);+ await run(`lensWait(()=>document.getElementById('semantic-lens-copy').textContent==='Copy link')`);+ records.push({ scenario: 'copy-' + mode, ...copied });+ }+ await snapshot('copy-feedback-restored');+ });++ await t.test('actual capability handoffs and blocked previews preserve existing ownership', async () => {+ for (const [name, action] of [+ ['focus', `Archify.focus.set('api',{toggle:false})`],+ ['route', `Archify.routeProbe.begin({source:'users'})`],+ ['guided', `Archify.guidedViews.activate('request-path');await lensWait(()=>!Archify.guidedViews.handoff())`],+ ['intent', `Archify.intentTrace.show('api',{announce:true})`],+ ]) {+ await load('trace'); await run(`(async()=>{${action}})()`); await run(`Archify.semanticLens.select('backend')`);+ const result = await run(`({focus:Archify.focus.active(),route:Archify.routeProbe.active(),intent:Archify.intentTrace.active(),guided:Archify.guidedViews.active()})`);+ assert.deepEqual(result, { focus: null, route: null, intent: null, guided: null });+ await run(`lensWait(()=>Archify.motionGovernor.owner()==='lens')`); await snapshot(name + '-to-lens');+ }+ await run('Archify.semanticLens.open();Archify.finder.open()');+ assert.equal(await run('Archify.semanticLens.isOpen()'), false); assert.equal(await run('Archify.finder.isOpen()'), true);+ await run('Archify.semanticLens.open();Archify.guide.open()');+ assert.equal(await run('Archify.semanticLens.isOpen()'), false); await snapshot('lens-to-guide');+ await load();+ const blockers = await run(`(()=>{+ const svg=document.querySelector('.diagram-container > svg'),html=document.documentElement,e=document.querySelector(${JSON.stringify(legend('backend'))});+ return [[html,'data-present'],[svg,'data-focus-active'],[svg,'data-intent-trace-active'],[svg,'data-route-picking'],[svg,'data-route-active'],[svg,'data-story-active'],[svg,'data-relationship-preview-active']].map(([el,a])=>{+ el.setAttribute(a,'true');e.dispatchEvent(new PointerEvent('pointerover',{bubbles:true,pointerType:'mouse'}));const preview=svg.getAttribute('data-legend-preview-active');e.dispatchEvent(new PointerEvent('pointerout',{bubbles:true,pointerType:'mouse'}));el.removeAttribute(a);return {attribute:a,preview};});+ })()`);+ assert.ok(blockers.every(row => row.preview === null)); records.push({ scenario: 'blocker-fixture', blockers });+ });++ await t.test('panel events, pending frames and controlled docking geometry preserve responsive branches', async () => {+ await load(); await key('l', 'KeyL', 76);+ await run(`lensWait(()=>document.activeElement.matches('#semantic-lens-kinds button'))`);+ await click('#semantic-lens-kinds [data-kind="backend"]'); assert.equal(await run('Archify.semanticLens.isOpen()'), true);+ await click('h1'); assert.equal(await run('Archify.semanticLens.isOpen()'), false);+ await click('#btn-semantic-lens'); await click('#btn-semantic-lens'); assert.equal(await run('Archify.semanticLens.isOpen()'), false);+ const quick = await run(`new Promise(resolve=>{const p=Archify.semanticLens;const values=[p.open(),p.open(),p.close({restoreFocus:false})];requestAnimationFrame(()=>resolve({values,open:p.isOpen(),dock:document.getElementById('semantic-lens').getAttribute('data-dock-side')}));})`);+ assert.deepEqual(quick, { values: [true, true, false], open: false, dock: null });+ // Only measured rectangle inputs are overridden; public open/select/resize drive docking.+ const docking = await run(`(async()=>{+ const panel=document.getElementById('semantic-lens'),svg=document.querySelector('.diagram-container > svg'),container=svg.parentElement,nav=container.querySelector('.diagram-nav'),legend=svg.querySelector('[data-legend]'),node=svg.querySelector('[data-node-id="api"]');+ const rect=(left,top,width,height)=>({left,top,width,height,right:left+width,bottom:top+height});+ const elements=[panel,container,nav,legend,node].filter(Boolean),saved=elements.map(e=>Object.getOwnPropertyDescriptor(e,'getBoundingClientRect'));+ let position=700;panel.getBoundingClientRect=()=>rect(700,100,200,200);container.getBoundingClientRect=()=>rect(0,0,1000,800);+ [nav,legend].filter(Boolean).forEach(e=>e.getBoundingClientRect=()=>rect(0,600,100,20));node.getBoundingClientRect=()=>rect(position,100,200,200);+ try {Archify.semanticLens.open();await new Promise(requestAnimationFrame);const sides=[];for(const x of [700,16,400]){position=x;dispatchEvent(new Event('resize'));sides.push(panel.getAttribute('data-dock-side'));}return sides;}+ finally {elements.forEach((e,i)=>{if(saved[i])Object.defineProperty(e,'getBoundingClientRect',saved[i]);else delete e.getBoundingClientRect;});}+ })()`);+ assert.deepEqual(docking, ['left', 'right', 'right']); records.push({ scenario: 'docking-fixture', sides: docking });+ for (const width of [720, 721, 1440]) {+ await send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await run(`lensWait(()=>innerWidth===${width}).then(()=>Archify.viewerChromeLayout.whenStable())`);+ const dock = await run(`document.getElementById('semantic-lens').getAttribute('data-dock-side')`);+ if (width === 720) assert.equal(dock, null); else assert.ok(['left', 'right'].includes(dock));+ assert.equal(await run(`Array.from(document.querySelectorAll('[data-legend-hit]'),n=>Number(n.getAttribute('width'))).every(w=>w>=24)`), true);+ records.push({ scenario: 'width-' + width, dock });+ }+ });++ await t.test('themes, reduced motion, Still and real SVG export retain selection and preview rendering', async () => {+ for (const theme of ['dark', 'light']) {+ for (const state of ['selection', 'preview']) {+ await load('trace', { theme, reduced: true });+ if (state === 'selection') await run(`Archify.semanticLens.select('backend')`); else await move(legend('backend'));+ await run(`lensWait(()=>Archify.motionGovernor.owner()===${JSON.stringify(state === 'selection' ? 'lens' : 'legend')})`);+ const s = await snapshot(theme + '-' + state); assert.equal(state === 'selection' ? s.active[0] : s.preview, 'backend');+ if (state === 'selection') {+ const style = await run(`(()=>{const n=document.querySelector('.semantic-lens-flow'),c=getComputedStyle(n);return {animation:c.animationName,pointer:getComputedStyle(n.parentElement.parentElement).pointerEvents};})()`);+ assert.deepEqual(style, { animation: 'none', pointer: 'none' });+ }+ if (evidence) {+ await run(`Promise.all(document.getAnimations().filter(a=>Number.isFinite(a.effect.getTiming().iterations)).map(a=>a.finished.catch(()=>{})))`);+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, theme + '-' + state + '.png'), Buffer.from(shot.data, 'base64'));+ }+ const exported = await run(`(async()=>{+ const original=URL.createObjectURL;let blob;URL.createObjectURL=function(v){if(v.type.startsWith('image/svg+xml'))blob=v;return original.call(URL,v);};+ try {await Archify.exportMenu.run('svg');}finally{URL.createObjectURL=original;}+ const root=new DOMParser().parseFromString(await blob.text(),'image/svg+xml').documentElement;+ return {clean:!root.hasAttribute('data-lens-active')&&!root.hasAttribute('data-legend-preview-active')&&!root.querySelector('[data-semantic-lens-overlay],[data-lens-match],[data-lens-selected],[data-lens-peer],[data-legend-preview-match],[data-legend-bridge-runtime],[data-legend-count]'),viewBox:root.getAttribute('viewBox')===document.querySelector('.diagram-container > svg').getAttribute('viewBox')};+ })()`);+ assert.deepEqual(exported, { clean: true, viewBox: true });+ }+ }+ await load('trace'); await run(`Archify.semanticLens.select('backend')`);+ const animation = await run(`getComputedStyle(document.querySelector('.semantic-lens-flow')).animationName`);+ assert.equal(animation, 'archify-semantic-lens-flow');+ await run(`lensWait(()=>lensEnds.some(e=>e.trusted&&e.name==='archify-semantic-lens-flow'))`);+ assert.deepEqual((await snapshot('animation-finished')).active, ['backend']);+ await run(`Archify.motionGovernor.setMode('still')`);+ await run(`lensWait(()=>getComputedStyle(document.querySelector('.semantic-lens-flow')).animationName==='none')`);+ assert.deepEqual((await snapshot('still-selection')).active, ['backend']);+ });+});diff --git a/archify/test/semantic-radar.test.mjs b/archify/test/semantic-radar.test.mjsindex 2cf1efac..8149d14c 100644--- a/archify/test/semantic-radar.test.mjs+++ b/archify/test/semantic-radar.test.mjs@@ -318,6 +318,21 @@ test('Semantic Radar avoids an expanded mobile Passport without hiding a collisiassert.equal(closed.radarHidden, true, JSON.stringify(closed, null, 2));assert.equal(closed.passportYielded, null, JSON.stringify(closed, null, 2));assert.equal(closed.passportVisible, true, JSON.stringify(closed, null, 2));++ for (const original of [null, 'false', 'true']) {+ const restored = await evaluate(browser, sessionId, `(function () {+ var passport = document.getElementById('focus-chip');+ var original = ${JSON.stringify(original)};+ if (original === null) passport.removeAttribute('aria-hidden');+ else passport.setAttribute('aria-hidden', original);+ Archify.radar.open();+ document.getElementById('overview-map-expand').click();+ var during = { yielded: passport.getAttribute('data-radar-yielded'), aria: passport.getAttribute('aria-hidden') };+ Archify.radar.close();+ return { during: during, yielded: passport.getAttribute('data-radar-yielded'), aria: passport.getAttribute('aria-hidden') };+ })()`);+ assert.deepEqual(restored, { during: { yielded: 'true', aria: 'true' }, yielded: null, aria: original });+ }} finally {await browser.close();}@@ -347,6 +362,7 @@ test('Semantic Radar reports a consistent unavailable state and recovers when spvar trigger = document.getElementById('btn-overview-map');var feedback = document.getElementById('overview-map-feedback');resolve({+ requested: Archify.radar.isOpen(),panelHidden: panel.hidden,expanded: trigger.getAttribute('aria-expanded'),limited: trigger.getAttribute('data-radar-space-limited'),@@ -356,6 +372,7 @@ test('Semantic Radar reports a consistent unavailable state and recovers when sp}, 260);});})()`, true);+ assert.equal(unavailable.requested, true);assert.equal(unavailable.panelHidden, true, JSON.stringify(unavailable, null, 2));assert.equal(unavailable.expanded, 'false', JSON.stringify(unavailable, null, 2));assert.equal(unavailable.limited, 'true', JSON.stringify(unavailable, null, 2));@@ -374,12 +391,14 @@ test('Semantic Radar reports a consistent unavailable state and recovers when spvar trigger = document.getElementById('btn-overview-map');var feedback = document.getElementById('overview-map-feedback');resolve({+ requested: Archify.radar.isOpen(),panelHidden: panel.hidden,expanded: trigger.getAttribute('aria-expanded'),feedbackHidden: feedback.hidden});}, 260);})`, true);+ assert.equal(recovered.requested, true);assert.equal(recovered.panelHidden, false, JSON.stringify(recovered, null, 2));assert.equal(recovered.expanded, 'true', JSON.stringify(recovered, null, 2));assert.equal(recovered.feedbackHidden, true, JSON.stringify(recovered, null, 2));@@ -516,7 +535,6 @@ test('Semantic Radar titlebar drag persists while surface drag still pans the diawait dragMouse(browser, sessionId, titleStart, titleTarget);const manuallyPlaced = await evaluate(browser, sessionId, `(function () {- Archify.radar.sync();var radar = document.getElementById('overview-map').getBoundingClientRect();return { left: radar.left, top: radar.top, state: Archify.view.state() };})()`);@@ -524,6 +542,49 @@ test('Semantic Radar titlebar drag persists while surface drag still pans the diassert.ok(Math.abs(manuallyPlaced.top - geometry.target.top) <= 2, JSON.stringify({ geometry, manuallyPlaced }, null, 2));assert.deepEqual(manuallyPlaced.state, geometry.state);+ // Capture the transient drag and cancellation in the same page operation.+ for (const cancel of ['pointercancel', 'Escape']) {+ const cancelled = await evaluate(browser, sessionId, `(function () {+ var panel = document.getElementById('overview-map');+ var head = panel.querySelector('.overview-map-head');+ var rect = panel.getBoundingClientRect();+ var start = { left: rect.left, top: rect.top };+ var h = head.getBoundingClientRect();+ function pointer(type, offset) {+ head.dispatchEvent(new PointerEvent(type, { bubbles: true, cancelable: true, pointerId: 71,+ button: 0, clientX: h.left + 48 + offset, clientY: h.top + h.height / 2 }));+ }+ pointer('pointerdown', 0);+ pointer('pointermove', 80);+ var moved = panel.getBoundingClientRect().left !== start.left;+ var dragging = panel.getAttribute('data-panel-dragging');+ if (${JSON.stringify(cancel)} === 'Escape') document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, cancelable: true }));+ else pointer('pointercancel', 80);+ var end = panel.getBoundingClientRect();+ return { start: start, end: { left: end.left, top: end.top }, moved: moved, dragging: dragging,+ afterDragging: panel.getAttribute('data-panel-dragging'), open: Archify.radar.isOpen(), state: Archify.view.state() };+ })()`);+ assert.equal(cancelled.moved, true, cancel);+ assert.equal(cancelled.dragging, 'true', cancel);+ assert.equal(cancelled.afterDragging, null, cancel);+ assert.equal(cancelled.open, true, cancel);+ assert.deepEqual(cancelled.end, cancelled.start, cancel);+ assert.deepEqual(cancelled.state, manuallyPlaced.state, cancel);+ }+ const reopened = await evaluate(browser, sessionId, `(function () {+ Archify.radar.close();+ Archify.radar.open();+ Archify.radar.open();+ var rect = document.getElementById('overview-map').getBoundingClientRect();+ return { left: rect.left, top: rect.top, roots: document.querySelectorAll('#overview-map-surface > svg').length,+ count: Archify.radar.count(), nodes: document.querySelectorAll('[data-radar-node-id]').length };+ })()`);+ assert.equal(reopened.left, manuallyPlaced.left);+ assert.equal(reopened.top, manuallyPlaced.top);+ assert.equal(reopened.roots, 1);+ assert.ok(reopened.count > 0);+ assert.equal(reopened.count, reopened.nodes);+const surfaceState = await evaluate(browser, sessionId, `(function () {var radar = document.getElementById('overview-map').getBoundingClientRect();var surface = document.getElementById('overview-map-surface').getBoundingClientRect();@@ -572,4 +633,103 @@ test('Semantic Radar titlebar drag persists while surface drag still pans the di}});+test('closing a pending Radar request prevents retry and reflow from reopening it', {+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',+}, async () => {+ render('architecture', CASES.architecture);+ const browser = new ChromeVisualBrowser(chromePath);+ try {+ const sessionId = await loadArtifact(browser, path.join(tmp, 'architecture.html'), { width: 390, height: 300 });+ const transition = await evaluate(browser, sessionId, `(function () {+ var container = document.querySelector('.diagram-container');+ window.scrollTo(0, container.offsetTop);+ Archify.focus.set('lb', { toggle: false });+ document.getElementById('btn-focus-relations').click();+ var opened = Archify.radar.open();+ var panel = document.getElementById('overview-map');+ var waiting = { result: opened, requested: Archify.radar.isOpen(), hidden: panel.hidden };+ var closed = Archify.radar.close({ restoreFocus: true });+ return { waiting: waiting, closed: closed, requested: Archify.radar.isOpen(),+ focused: document.activeElement.id, feedbackHidden: document.getElementById('overview-map-feedback').hidden };+ })()`);+ assert.deepEqual(transition, { waiting: { result: true, requested: true, hidden: true },+ closed: false, requested: false, focused: 'btn-overview-map', feedbackHidden: true });+ await browser.cdp.send('Emulation.setDeviceMetricsOverride', {+ width: 390, height: 600, deviceScaleFactor: 1, mobile: false,+ }, sessionId);+ // Observe the whole original retry window, not just a single settled frame.+ const after = await evaluate(browser, sessionId, `new Promise(function (resolve) {+ var reopened = false;+ var start = performance.now();+ function sample() {+ var panel = document.getElementById('overview-map');+ reopened = reopened || Archify.radar.isOpen() || !panel.hidden;+ if (performance.now() - start < 500) return requestAnimationFrame(sample);+ resolve({ reopened: reopened, expanded: document.getElementById('btn-overview-map').getAttribute('aria-expanded'),+ feedbackHidden: document.getElementById('overview-map-feedback').hidden });+ }+ requestAnimationFrame(sample);+ })`, true);+ assert.deepEqual(after, { reopened: false, expanded: 'false', feedbackHidden: true });+ } finally {+ await browser.close();+ }+});++test('Radar reflects camera viewport, status and Focus/Story activity through normal callers', {+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',+}, async () => {+ render('architecture', CASES.architecture);+ const browser = new ChromeVisualBrowser(chromePath);+ try {+ const sessionId = await loadArtifact(browser, path.join(tmp, 'architecture.html'));+ await browser.cdp.send('Emulation.setEmulatedMedia', { features: [+ { name: 'prefers-reduced-motion', value: 'reduce' },+ ] }, sessionId);+ async function observe(action) {+ return evaluate(browser, sessionId, `(async () => {+ ${action}+ let previous = '', equal = 0;+ for (let frame = 0; frame < 240; frame += 1) {+ await new Promise(resolve => requestAnimationFrame(resolve));+ const viewport = document.querySelector('.overview-map-viewport');+ const actual = ['x','y','width','height'].map(name => Number(viewport.getAttribute(name)));+ const logical = Archify.view.logicalViewport();+ const expected = [logical.x,logical.y,logical.width,logical.height];+ const active = Array.from(document.querySelectorAll('[data-radar-active]'), node => node.getAttribute('data-radar-node-id')).sort();+ const status = document.getElementById('overview-map-status').textContent;+ const state = { actual, expected, active, status, count: Archify.radar.count(), scale: logical.scale,+ beat: Archify.guidedViews.beat()?.nodeId || null };+ const value = JSON.stringify(state);+ equal = value === previous ? equal + 1 : 0; previous = value;+ if (equal >= 8) return state;+ }+ throw new Error('Radar observations did not settle');+ })()`, true);+ }+ const initial = await observe(`window.scrollTo(0, document.querySelector('.diagram-container').offsetTop); Archify.radar.open();`);+ assert.deepEqual(initial.actual, initial.expected);+ assert.equal(initial.status, initial.count + ' nodes · full map');+ const zoomed = await observe(`document.querySelector('[data-view="in"]').click();`);+ assert.deepEqual(zoomed.actual, zoomed.expected);+ assert.notDeepEqual(zoomed.actual, initial.actual);+ assert.equal(zoomed.status, zoomed.count + ' nodes · ' + Math.round(zoomed.scale * 100) + '% viewport');+ assert.notEqual(zoomed.status, initial.status);+ assert.deepEqual((await observe(`Archify.focus.set('lb', { toggle:false });`)).active, ['lb']);+ assert.deepEqual((await observe(`Archify.focus.set('db', { toggle:false });`)).active, ['db']);+ assert.deepEqual((await observe(`Archify.focus.clear();`)).active, []);+ await observe(`Archify.guidedViews.activate('request-path');`);+ const first = await observe(`document.querySelector('[data-story-index="0"]').click(); Archify.focus.clear({ updateUrl:false });`);+ assert.ok(first.beat);+ assert.deepEqual(first.active, [first.beat]);+ const second = await observe(`document.querySelector('[data-story-index="1"]').click(); Archify.focus.clear({ updateUrl:false });`);+ assert.ok(second.beat);+ assert.notEqual(second.beat, first.beat);+ assert.deepEqual(second.active, [second.beat]);+ assert.deepEqual((await observe(`Archify.guidedViews.showAll();`)).active, []);+ } finally {+ await browser.close();+ }+});+process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));diff --git a/archify/test/story-horizon.test.mjs b/archify/test/story-horizon.test.mjsindex 2cd213d3..2b378875 100644--- a/archify/test/story-horizon.test.mjs+++ b/archify/test/story-horizon.test.mjs@@ -83,7 +83,9 @@ test('Still, accessibility, teardown, and export preserve the product boundary',assert.ok((template.match(/svg\.removeAttribute\('data-story-next'\)/g) || []).length >= 3);assert.ok((template.match(/panel\.removeAttribute\('data-story-next'\)/g) || []).length >= 2);assert.match(template, /clone\.removeAttribute\('data-story-next'\)/);- assert.match(template, /canonicalStateClean[\s\S]*!clone\.hasAttribute\('data-story-next'\)/);+ const cleanup = template.match(/function cleanExportClone\(clone\) \{[\s\S]*?\n \}/)?.[0] || '';+ assert.match(cleanup, /return !clone[\s\S]*!clone\.hasAttribute\('data-story-next'\)/);+ assert.match(template, /var canonicalStateClean = cleanExportClone\(clone\);/);});process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));diff --git a/archify/test/viewer-camera-browser.test.mjs b/archify/test/viewer-camera-browser.test.mjsnew file mode 100644index 00000000..f25fded7--- /dev/null+++ b/archify/test/viewer-camera-browser.test.mjs@@ -0,0 +1,395 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import { execFileSync } from 'node:child_process';+import { fileURLToPath, pathToFileURL } from 'node:url';+import { ChromeVisualBrowser, findChrome } from '../bin/visual-check.mjs';++const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const chrome = process.env.ARCHIFY_CHROME ? findChrome() : null;+const cases = {+ architecture: 'web-app.architecture.json', workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json', dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+};++test('Camera preserves transactions, rendered state and real caller handoffs', {+ skip: chrome ? false : 'Set ARCHIFY_CHROME to run real-browser camera checks.',+}, async (t) => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-camera-'));+ t.after(() => fs.rmSync(scratch, { recursive: true, force: true }));+ const evidence = process.env.ARCHIFY_CAMERA_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const records = [];+ t.after(() => {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(records, null, 2) + '\n');+ });+ const files = {};+ for (const [mode, example] of Object.entries(cases)) {+ files[mode] = path.join(scratch, `${mode}.html`);+ execFileSync(process.execPath, [path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example), files[mode]]);+ }+ const trace = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', cases.architecture), 'utf8'));+ trace.meta.animation = 'trace';+ fs.writeFileSync(path.join(scratch, 'trace.json'), JSON.stringify(trace));+ files.trace = path.join(scratch, 'trace.html');+ execFileSync(process.execPath, [path.join(skillRoot, 'renderers/architecture/render-architecture.mjs'),+ path.join(scratch, 'trace.json'), files.trace]);+ const browser = new ChromeVisualBrowser(chrome);+ t.after(() => browser.close());+ const session = await browser.sessionPromise;+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ await browser.cdp.send('Browser.setDownloadBehavior', { behavior: 'deny' });+ async function run(expression, awaitPromise = false) {+ const result = await send('Runtime.evaluate', { expression, awaitPromise, returnByValue: true });+ assert.equal(result.exceptionDetails, undefined, result.exceptionDetails?.exception?.description);+ return result.result?.value;+ }+ await send('Page.addScriptToEvaluateOnNewDocument', { source: `+ window.cameraErrors = [];+ addEventListener('error', e => cameraErrors.push(e.message));+ addEventListener('unhandledrejection', e => cameraErrors.push(String(e.reason)));+ window.cameraWait = predicate => new Promise((resolve, reject) => {+ let frames = 0;+ function sample() {+ if (predicate()) return resolve();+ if (++frames > 300) return reject(new Error('Camera observation did not settle'));+ requestAnimationFrame(sample);+ }+ requestAnimationFrame(sample);+ });+ ` });+ async function viewport(width = 1440, height = 900) {+ await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false });+ }+ async function stable() {+ // Observe automatic camera/layout work without forcing sync or measurement.+ await run(`(async () => {+ await document.fonts.ready;+ let previous = '', equal = 0;+ await cameraWait(() => {+ const container = document.querySelector('.diagram-container');+ const svg = container.querySelector(':scope > svg');+ const rect = svg.getBoundingClientRect();+ const current = JSON.stringify([Archify.view.state(), getComputedStyle(svg).transform,+ svg.style.clipPath, container.scrollLeft, container.getAttribute('data-camera-transaction'),+ container.style.getPropertyValue('--archify-nav-reserve'), rect.x, rect.y, rect.width, rect.height]);+ equal = current === previous ? equal + 1 : 0;+ previous = current;+ return equal >= 8 && !container.hasAttribute('data-camera-transaction');+ });+ })()`, true);+ }+ async function load(mode = 'architecture', { width = 1440, height = 900, theme = 'dark', reduced = false } = {}) {+ await viewport(width, height);+ await send('Emulation.setEmulatedMedia', { media: '', features: [+ { name: 'prefers-reduced-motion', value: reduced ? 'reduce' : 'no-preference' },+ ] });+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(files[mode]).href + `?theme=${theme}` });+ await loaded;+ await stable();+ }+ const snapshotExpression = `(() => {+ const c = document.querySelector('.diagram-container'), svg = c.querySelector(':scope > svg');+ const rect = e => { const r = e.getBoundingClientRect(); return [r.x,r.y,r.width,r.height]; };+ return { state: Archify.view.state(), viewport: Archify.view.logicalViewport(),+ transform: getComputedStyle(svg).transform, clip: svg.style.clipPath,+ stage: rect(svg), nav: rect(c.querySelector('.diagram-nav')), scrollLeft: c.scrollLeft,+ reserve: c.style.getPropertyValue('--archify-nav-reserve'),+ transaction: c.getAttribute('data-camera-transaction'),+ mode: c.getAttribute('data-camera-mode'), detail: c.getAttribute('data-detail-level'),+ viewBox: svg.getAttribute('viewBox'), errors: cameraErrors,+ external: performance.getEntriesByType('resource').map(e => e.name).filter(n => /^https?:/.test(n)) };+ })()`;+ async function snapshot(label, captured) {+ const value = captured || await run(snapshotExpression);+ assert.deepEqual(value.errors, [], label);+ assert.deepEqual(value.external, [], label);+ records.push({ label, ...value });+ return value;+ }+ async function screenshot(name) {+ if (!evidence) return;+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, `${name}.png`), Buffer.from(shot.data, 'base64'));+ }++ await t.test('five modes keep initial state, zoom limits and canonical geometry', async () => {+ for (const mode of Object.keys(cases)) {+ await load(mode);+ const initial = await snapshot(`${mode}-initial`);+ assert.deepEqual(initial.state, { scale: 1, x: 0, y: 0, mode: 'overview' });+ const limits = await run(`(() => {+ const copy = Archify.view.state(); copy.scale = 99;+ const independent = Archify.view.state().scale === 1;+ for (let i = 0; i < 12; i++) Archify.view.zoomIn();+ const max = Archify.view.state().scale;+ for (let i = 0; i < 12; i++) Archify.view.zoomOut();+ return { independent, max, min: Archify.view.state().scale };+ })()`);+ assert.deepEqual(limits, { independent: true, max: 3, min: 1 });+ await stable();+ assert.equal((await snapshot(`${mode}-limits`)).viewBox, initial.viewBox);+ }+ });++ await t.test('pointer cancellation ends dragging and controls do not begin a pan', async () => {+ await load();+ await run('Archify.view.zoomIn()');+ await stable();+ const result = await run(`(() => {+ const c = document.querySelector('.diagram-container'), svg = c.querySelector(':scope > svg');+ const geometry = () => [...svg.querySelectorAll('[data-node-id], [data-edge-id]')].map(n =>+ ['data-node-id','data-edge-id','transform','d','x','y','width','height'].map(a => n.getAttribute(a)));+ const beforeGeometry = JSON.stringify(geometry());+ const pointer = (type, x, y) => new PointerEvent(type, { bubbles: true, pointerId: 31, button: 0, clientX: x, clientY: y });+ const before = Archify.view.state();+ c.querySelector('.diagram-nav').dispatchEvent(pointer('pointerdown', 500, 400));+ c.dispatchEvent(pointer('pointermove', 450, 350));+ const controlExcluded = JSON.stringify(before) === JSON.stringify(Archify.view.state());+ c.dispatchEvent(pointer('pointerdown', 500, 400));+ c.dispatchEvent(pointer('pointermove', 450, 350));+ const dragged = c.classList.contains('is-panning');+ c.dispatchEvent(pointer('pointercancel', 450, 350));+ const cancelled = !c.classList.contains('is-panning');+ const ended = Archify.view.state();+ c.dispatchEvent(pointer('pointermove', 100, 100));+ return { step: before.scale, controlExcluded, dragged, cancelled,+ unchanged: JSON.stringify(ended) === JSON.stringify(Archify.view.state()),+ geometryUnchanged: beforeGeometry === JSON.stringify(geometry()) };+ })()`);+ assert.deepEqual(result, { step: 1.25, controlExcluded: true, dragged: true, cancelled: true, unchanged: true, geometryUnchanged: true });+ await stable();+ await snapshot('pointer-cancel');+ });++ await t.test('target selection, failure branches and instant options preserve their side effects', async () => {+ await load();+ const value = await run(`(async () => {+ const v = Archify.view, node = document.querySelector('[data-node-id="api"]');+ const original = node.getBBox;+ const empty = v.reveal([], { instant: true });+ const unknown = v.reveal(['missing'], { instant: true });+ node.getBBox = () => { throw new Error('test geometry'); };+ const failedBox = v.reveal(['api'], { instant: true });+ node.getBBox = original;+ const mixed = v.reveal(['missing', 'api'], { instant: true, maxScale: 1.5, padding: 64 });+ const mixedResult = await mixed.finished;+ const multi = v.reveal(['api', 'db'], { instant: true, includeNeighbors: true });+ await multi.finished;+ return { empty, unknown, failedBox, mixed: mixedResult.state, scale: mixed.target.scale,+ multi: multi.settled, badCenter: v.centerAt('invalid', 10) };+ })()`, true);+ assert.deepEqual(value, { empty: false, unknown: false, failedBox: false, mixed: 'complete', scale: 1.5, multi: true, badCenter: false });+ await stable();+ await snapshot('targets');+ });++ await t.test('running transactions complete, replace, cancel and yield to manual navigation', async () => {+ for (const theme of ['dark', 'light']) {+ await load('architecture', { theme });+ // Start and observe in one page evaluation: CDP round trips may outlast+ // the animation, so the middle snapshot must be captured in its frame.+ const animation = await run(`(async () => {+ const camera = Archify.view.reveal(['api'], { duration: 520 });+ const samples = [];+ let middle = null;+ function sampleCamera() {+ const svg = document.querySelector('.diagram-container > svg');+ const state = Archify.view.state();+ samples.push({ state, transform: getComputedStyle(svg).transform, clip: svg.style.clipPath, settled: camera.settled });+ if (!middle && !camera.settled && state.scale > 1.15) middle = ${snapshotExpression};+ if (!camera.settled) requestAnimationFrame(sampleCamera);+ }+ requestAnimationFrame(sampleCamera);+ const outcome = await camera.finished;+ return { middle, samples, outcome };+ })()`, true);+ assert.ok(animation.middle, 'the running animation must yield a middle snapshot');+ const middle = await snapshot(`animation-middle-${theme}`, animation.middle);+ assert.ok(middle.state.scale > 1 && middle.state.scale < 2.15);+ assert.equal(animation.outcome.state, 'complete');+ assert.ok(animation.samples.filter(s => !s.settled && s.clip).length > 1);+ if (evidence) fs.writeFileSync(path.join(evidence, `animation-${theme}.json`), JSON.stringify(animation.samples, null, 2));+ await stable();+ await snapshot(`animation-final-${theme}`);+ await screenshot(`animation-final-${theme}`);+ }+ const results = await run(`(async () => {+ const v = Archify.view, results = [];+ for (const action of ['replace', 'cancel', 'commit', 'manual', 'reset']) {+ v.reset({ automatic: true });+ const first = v.reveal(['api'], { duration: 520 });+ await cameraWait(() => !first.settled && v.state().scale > 1.05);+ const before = v.state();+ let second;+ if (action === 'replace') second = v.reveal(['db'], { instant: true });+ else if (action === 'cancel' || action === 'commit') first.cancel('test-stop', action === 'commit');+ else if (action === 'manual') v.zoomOut();+ else v.reset({ automatic: true });+ const outcome = await first.finished;+ const repeated = first.cancel('again', true);+ const ended = v.state();+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));+ results.push({ action, outcome: outcome.state, repeated, settled: first.settled,+ before, ended, target: first.target,+ unchanged: JSON.stringify(ended) === JSON.stringify(v.state()),+ next: second ? (await second.finished).state : null });+ }+ return results;+ })()`, true);+ assert.deepEqual(results.map(r => r.outcome), ['replaced', 'test-stop', 'test-stop', 'manual', 'reset']);+ for (const r of results) {+ assert.equal(r.repeated, false); assert.equal(r.settled, true); assert.equal(r.unchanged, true);+ if (r.action === 'cancel' || r.action === 'commit') {+ assert.notDeepEqual(r.before, r.target, 'cancellation must occur before reaching the target');+ assert.deepEqual(r.ended, r.action === 'commit' ? r.target : r.before, r.action);+ }+ }+ records.push({ label: 'transaction-results', results });+ await stable();+ });++ await t.test('mobile branches, automatic scroll guard and scrollTo fallback stay distinct', async () => {+ for (const width of [719, 720, 721]) {+ await load('architecture', { width });+ const result = await run(`(async () => {+ const receipt = Archify.view.reveal(['db'], { instant: true });+ return { outcome: (await receipt.finished).state, scrollTarget: 'scrollLeft' in receipt.target };+ })()`, true);+ assert.equal(result.scrollTarget, width <= 720);+ await stable();+ await snapshot(`width-${width}`);+ }+ await load('architecture', { width: 720 });+ const value = await run(`(async () => {+ const c = document.querySelector('.diagram-container'), v = Archify.view;+ const empty = v.reveal([]);+ const emptyMode = v.state().mode;+ c.removeAttribute('data-wide-diagram');+ const contained = v.reveal([]);+ const containedOutcome = (await contained.finished).state;+ c.setAttribute('data-wide-diagram', 'true');+ const original = c.scrollTo;+ c.scrollTo = () => { throw new Error('test scroll fallback'); };+ const fallback = v.reveal(['db'], { instant: true });+ await fallback.finished;+ // Even the assignment fallback participates in the container's existing+ // smooth-scroll CSS. Receipt completion alone is not scroll convergence.+ await cameraWait(() => Math.abs(c.scrollLeft - fallback.target.scrollLeft) < 1);+ const reached = Math.abs(c.scrollLeft - fallback.target.scrollLeft) < 1;+ c.scrollTo = original;+ v.reset({ automatic: true });+ const started = Date.now(), moving = v.reveal(['users']);+ c.dispatchEvent(new Event('scroll'));+ const protectedMode = v.state().mode;+ const outcome = await moving.finished;+ await cameraWait(() => Date.now() - started > 500);+ c.dispatchEvent(new Event('scroll'));+ return { empty, emptyMode, containedOutcome, reached, protectedMode, outcome: outcome.state, manualMode: v.state().mode };+ })()`, true);+ assert.deepEqual(value, { empty: false, emptyMode: 'semantic', containedOutcome: 'complete', reached: true,+ protectedMode: 'semantic', outcome: 'complete', manualMode: 'manual' });+ await stable();+ await snapshot('mobile-scroll');+ });++ await t.test('reduced motion and call-time hidden state keep immediate completion semantics', async () => {+ await load('architecture', { theme: 'light', reduced: true });+ assert.equal(await run(`Archify.view.reveal(['api']).finished.then(r => r.state)`, true), 'reduced-motion');+ await stable();+ await snapshot('reduced-motion');+ await load();+ // A local capability fixture exercises the call-time branch. It does not+ // claim to emulate background-tab frame throttling or visibility events.+ const hidden = await run(`(async () => {+ Object.defineProperty(document, 'hidden', { configurable: true, value: true });+ try { return (await Archify.view.reveal(['api']).finished).state; }+ finally { delete document.hidden; }+ })()`, true);+ assert.equal(hidden, 'hidden');+ await stable();+ await snapshot('hidden-call-fixture');+ });++ await t.test('actual Story, Route, Finder and Radar callers retain camera ownership', async () => {+ await load('trace');+ const story = await run(`(async () => {+ Archify.motionGovernor.resume();+ Archify.guidedViews.activate('request-path');+ await cameraWait(() => !Archify.guidedViews.handoff());+ Archify.guidedViews.activate('identity-and-cache');+ await cameraWait(() => Archify.guidedViews.handoff()?.mode === 'settling');+ const wasHandoff = !!Archify.guidedViews.handoff();+ Archify.view.zoomIn();+ const cleared = Archify.guidedViews.handoff() === null;+ const played = Archify.guidedViews.play();+ const wasPlaying = Archify.guidedViews.isPlaying();+ Archify.view.zoomOut();+ return { wasHandoff, cleared, played, wasPlaying, paused: !Archify.guidedViews.isPlaying() };+ })()`, true);+ assert.deepEqual(story, { wasHandoff: true, cleared: true, played: true, wasPlaying: true, paused: true });+ await stable();+ await snapshot('story-takeover');+ await load('trace');+ const route = await run(`(() => {+ Archify.motionGovernor.resume();+ Archify.routeProbe.begin({ source: 'users' });+ Archify.routeProbe.choose('db');+ const played = Archify.routeProbe.playJourney();+ const before = Archify.routeProbe.result();+ Archify.view.zoomIn();+ const after = Archify.routeProbe.result();+ return { played, before, after };+ })()`);+ assert.equal(route.played, true); assert.equal(route.before.playing, true); assert.equal(route.after.playing, false);+ assert.deepEqual(route.after.nodes, route.before.nodes);+ assert.equal(route.after.journey, route.before.journey);+ await stable();+ await snapshot('route-takeover');+ await load('architecture', { height: 600 });+ await run(`Archify.finder.select('api')`);+ await stable();+ assert.equal(await run(`Archify.focus.active()`), 'api');+ await snapshot('finder-low-height');+ await run(`window.scrollTo(0, 160); Archify.radar.open(); Archify.radar.focus('db')`);+ await stable();+ assert.equal(await run(`Archify.focus.active()`), 'db');+ await snapshot('radar-focus');+ await viewport(1280, 720);+ await stable();+ await snapshot('automatic-resize');+ await run(`location.hash = 'focus=api'`);+ await run(`cameraWait(() => Archify.focus.active() === 'api')`, true);+ await stable();+ await snapshot('automatic-hashchange');+ });++ await t.test('export removes camera transforms without mutating the live camera', async () => {+ await load();+ await run(`Archify.view.reveal(['api'], { instant: true })`);+ await stable();+ const exported = await run(`(async () => {+ const svg = document.querySelector('.diagram-container > svg'), before = svg.outerHTML;+ const state = JSON.stringify(Archify.view.state()), original = URL.createObjectURL;+ let blob;+ URL.createObjectURL = value => { if (value.type.startsWith('image/svg+xml')) blob = value; return original.call(URL, value); };+ let after;+ try { const pending = Archify.exportMenu.run('svg'); after = svg.outerHTML; await pending; }+ finally { URL.createObjectURL = original; }+ const text = await blob.text();+ const root = new DOMParser().parseFromString(text, 'image/svg+xml').documentElement;+ return { text, unchanged: before === after && state === JSON.stringify(Archify.view.state()),+ clean: !root.hasAttribute('data-view-scale') && !root.style.transform && !root.style.clipPath,+ geometry: root.getAttribute('viewBox') === svg.getAttribute('viewBox'),+ ids: [...root.querySelectorAll('[data-node-id]')].map(n => n.getAttribute('data-node-id')).join() === [...svg.querySelectorAll('[data-node-id]')].map(n => n.getAttribute('data-node-id')).join() };+ })()`, true);+ assert.equal(exported.unchanged, true); assert.equal(exported.clean, true); assert.equal(exported.geometry, true); assert.equal(exported.ids, true);+ if (evidence) fs.writeFileSync(path.join(evidence, 'camera-export.svg'), exported.text);+ await snapshot('export');+ });+});diff --git a/archify/test/viewer-chrome-layout.test.mjs b/archify/test/viewer-chrome-layout.test.mjsindex 6b9725ff..310bd3dc 100644--- a/archify/test/viewer-chrome-layout.test.mjs+++ b/archify/test/viewer-chrome-layout.test.mjs@@ -869,4 +869,236 @@ test('mobile, embed, and print keep zero reserve while hidden Legends retain the}});++test('Chrome Layout preserves scheduling, mode restoration and Reader handoffs', {+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',+}, async (t) => {+ const browser = new ChromeVisualBrowser(chromePath);+ t.after(() => browser.close());+ const evidence = process.env.ARCHIFY_CHROME_LAYOUT_EVIDENCE;+ if (evidence) fs.mkdirSync(evidence, { recursive: true });+ const observations = [];+ const file = render('architecture', CASES.architecture);+ const session = await browser.sessionPromise;+ const send = (method, params = {}) => browser.cdp.send(method, params, session);+ const run = (expression, awaitPromise = false) => evaluate(browser, session, expression, awaitPromise);+ await send('Page.addScriptToEvaluateOnNewDocument', {+ source: `window.chromeLayoutErrors = [];+ addEventListener('error', e => chromeLayoutErrors.push(e.message));+ addEventListener('unhandledrejection', e => chromeLayoutErrors.push(String(e.reason)));`,+ });+ async function resize(width, height = 900) {+ await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false });+ await waitForLayout(browser, session);+ }+ async function state(label) {+ // Read DOM first, without receipt(), measure() or public stability methods.+ // This ensures those methods cannot make a missed automatic event pass.+ const raw = await run(`(() => {+ const html = document.documentElement;+ const container = document.querySelector('.diagram-container');+ const svg = container.querySelector(':scope > svg');+ return {+ reserve: parseFloat(container.style.getPropertyValue('--archify-nav-reserve')) || 0,+ rootRail: html.getAttribute('data-nav-stage-rail'), rail: container.getAttribute('data-nav-stage-rail'),+ reader: html.getAttribute('data-reader-layout'), width: innerWidth,+ viewBox: svg.getAttribute('viewBox'),+ errors: chromeLayoutErrors,+ external: performance.getEntriesByType('resource').map(e => e.name).filter(n => /^https?:/.test(n))+ };+ })()`);+ assert.deepEqual(raw.errors, [], label);+ assert.deepEqual(raw.external, [], label);+ const geometry = await finalGeometry(browser, session);+ assert.equal(raw.reserve, geometry.receiptReserve, `${label}: observation must not repair stale state`);+ assert.equal(raw.rootRail, raw.reserve ? 'true' : null, label);+ assert.equal(raw.rail, raw.rootRail, label);+ observations.push({ label, ...raw, geometry });+ return { ...raw, geometry };+ }+ function zero(value) {+ assert.equal(value.reserve, 0);+ assert.equal(value.rail, null);+ assert.equal(value.rootRail, null);+ }+ function clearStage(value) {+ assert.equal(value.geometry.dockStageIntersectionArea, 0, JSON.stringify(value));+ assert.ok(value.geometry.stageGap >= 9, JSON.stringify(value));+ }+ function variant(name, source) {+ const original = fs.readFileSync(file, 'utf8');+ const html = original.replace(' <script>\n var Archify = {};',+ () => ` <script>${source}</script>\n <script>\n var Archify = {};`);+ assert.notEqual(html, original);+ const output = path.join(tmp, `chrome-${name}.html`);+ fs.writeFileSync(output, html);+ return output;+ }+ try {+ await t.test('automatic resize crosses Chrome and Reader thresholds without reserve accumulation', async () => {+ await load(browser, file);+ const initial = await state('threshold-initial');+ for (const width of [719, 720, 721, 1023, 1024, 1025, 720, 1440]) {+ await resize(width);+ const current = await state(`threshold-${width}-${observations.length}`);+ assert.equal(current.geometry.receiptEligible, width > 720);+ assert.equal(current.reader, width >= 1024 ? 'adaptive' : null);+ assert.equal(current.viewBox, initial.viewBox);+ if (width <= 720) zero(current);+ else clearStage(current);+ if (width === 1440) assert.equal(current.reserve, initial.reserve);+ }+ });++ await t.test('automatic observer callbacks handle navigation size, visibility and content changes', async () => {+ await load(browser, file);+ const initial = await state('observer-initial');+ await run(`document.querySelector('.diagram-nav').style.display = 'none'`);+ await waitForLayout(browser, session);+ zero(await state('observer-nav-hidden'));+ await run(`document.querySelector('.diagram-nav').style.display = ''`);+ await waitForLayout(browser, session);+ const restored = await state('observer-nav-restored');+ assert.equal(restored.reserve, initial.reserve);+ await run(`document.querySelector('.diagram-nav').style.height = '120px'`);+ await waitForLayout(browser, session);+ const taller = await state('observer-nav-taller');+ assert.ok(taller.reserve > initial.reserve);+ clearStage(taller);+ // A legend mutation drives the existing MutationObserver. Font/preset+ // rules remain the production rules; no public layout method is invoked.+ await run(`document.querySelector('[data-legend]').setAttribute('transform', 'translate(0,-20)')`);+ await waitForLayout(browser, session);+ clearStage(await state('observer-legend-changed'));+ await run(`document.querySelector('.diagram-nav').style.height = ''; window.dispatchEvent(new Event('resize'))`);+ await waitForLayout(browser, session);+ assert.equal((await state('observer-returned')).reserve, initial.reserve);+ await run(`document.querySelector('.diagram-nav').style.bottom = '-200px'; window.dispatchEvent(new Event('resize'))`);+ await waitForLayout(browser, session);+ zero(await state('no-reserve-needed'));+ });++ await t.test('embed and print restore a zoomed rail, while Presentation remains eligible', async () => {+ for (const mode of ['embed', 'print']) {+ if (mode === 'print') await send('Emulation.setEmulatedMedia', { media: 'print' });+ await load(browser, file, { query: mode === 'embed' ? '?embed=1' : '' });+ zero(await state(`${mode}-initial`));+ await send('Emulation.setEmulatedMedia', { media: '' });+ await load(browser, file);+ const initial = await state(`${mode}-ordinary`);+ await run('Archify.view.zoomIn()');+ await waitForLayout(browser, session);+ for (let cycle = 0; cycle < 2; cycle += 1) {+ if (mode === 'embed') await run(`document.documentElement.setAttribute('data-embed', 'true')`);+ else {+ await send('Emulation.setEmulatedMedia', { media: 'print' });+ await run(`window.dispatchEvent(new Event('beforeprint'))`);+ }+ await waitForLayout(browser, session);+ zero(await state(`${mode}-enter-${cycle}`));+ if (mode === 'embed') await run(`document.documentElement.removeAttribute('data-embed')`);+ else {+ await send('Emulation.setEmulatedMedia', { media: '' });+ await run(`window.dispatchEvent(new Event('afterprint'))`);+ }+ await waitForLayout(browser, session);+ const restored = await state(`${mode}-return-${cycle}`);+ assert.equal(restored.reserve, initial.reserve);+ clearStage(restored);+ }+ }+ for (const theme of ['dark', 'light']) {+ await send('Emulation.setEmulatedMedia', { media: '', features: [+ { name: 'prefers-reduced-motion', value: theme === 'light' ? 'reduce' : 'no-preference' },+ ] });+ await load(browser, file, { query: `?theme=${theme}&present=1` });+ const present = await state(`presentation-${theme}`);+ assert.equal(present.geometry.receiptEligible, true);+ clearStage(present);+ if (evidence) {+ const shot = await send('Page.captureScreenshot', { format: 'png' });+ fs.writeFileSync(path.join(evidence, `presentation-${theme}.png`), Buffer.from(shot.data, 'base64'));+ }+ await run('Archify.presentation.exit()');+ await waitForLayout(browser, session);+ clearStage(await state(`presentation-return-${theme}`));+ }+ await send('Emulation.setEmulatedMedia', { features: [] });+ });++ await t.test('pending Reader probes coalesce and retain the rail when the camera changes', async () => {+ for (const reject of [false, true]) {+ await load(browser, file);+ const initial = await state(`probe-initial-${reject}`);+ assert.ok(initial.reserve > 0);+ const pending = await run(`(() => {+ const reader = Archify.readerLayout;+ const original = reader.whenStable;+ let release;+ const gate = new Promise((resolve, reject) => { release = ${reject} ? () => reject(new Error('test reader rejection')) : resolve; });+ reader.whenStable = () => gate;+ const first = Archify.viewerChromeLayout.reprobe();+ const second = Archify.viewerChromeLayout.reprobe();+ const measuring = Archify.viewerChromeLayout.measure();+ const reserve = document.querySelector('.diagram-container').style.getPropertyValue('--archify-nav-reserve');+ Archify.view.zoomIn();+ window.dispatchEvent(new Event('resize'));+ window.finishChromeProbe = async () => {+ reader.whenStable = original;+ release();+ const result = await first;+ delete window.finishChromeProbe;+ return result;+ };+ return { same: first === second, measuring, reserve };+ })()`);+ assert.deepEqual(pending, { same: true, measuring: null, reserve: '' });+ assert.equal(await run('finishChromeProbe()', true), true);+ await waitForLayout(browser, session);+ const restored = await state(`probe-restored-${reject}`);+ assert.equal(restored.reserve, initial.reserve);+ clearStage(restored);+ await run(`for (let i = 0; i < 20; i++) { Archify.viewerChromeLayout.schedule(); Archify.viewerChromeLayout.reprobe(); window.dispatchEvent(new Event('resize')); }`);+ await waitForLayout(browser, session);+ const repeated = await state(`probe-burst-${reject}`);+ assert.equal(repeated.reserve, initial.reserve);+ assert.deepEqual(repeated.geometry, restored.geometry);+ }+ });++ await t.test('font readiness and optional observers preserve their existing fallbacks', async () => {+ const noObservers = variant('no-observers', 'window.ResizeObserver = undefined; window.MutationObserver = undefined;');+ await load(browser, noObservers);+ const initial = await state('fallback-initial');+ await resize(720);+ zero(await state('fallback-mobile'));+ await resize(1440);+ assert.equal((await state('fallback-return')).reserve, initial.reserve);++ const delayedFonts = variant('fonts', `window.originalChromeFonts = document.fonts;+ Object.defineProperty(document, 'fonts', { configurable: true, value: { ready: new Promise(resolve => { window.releaseChromeFonts = resolve; }) } });`);+ // Bypass load's font/stability wait to observe the deliberately pending gate.+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ await send('Page.navigate', { url: pathToFileURL(delayedFonts).href });+ await loaded;+ const result = await run(`(async () => {+ let resolved = false;+ const stable = Archify.viewerChromeLayout.whenStable().then(() => { resolved = true; });+ document.querySelector('.diagram-nav').style.height = '100px';+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));+ const beforeReady = resolved;+ releaseChromeFonts();+ await stable;+ Object.defineProperty(document, 'fonts', { configurable: true, value: originalChromeFonts });+ return { beforeReady, resolved };+ })()`, true);+ assert.deepEqual(result, { beforeReady: false, resolved: true });+ await waitForLayout(browser, session);+ clearStage(await state('font-ready'));+ });+ } finally {+ if (evidence) fs.writeFileSync(path.join(evidence, 'observations.json'), JSON.stringify(observations, null, 2) + '\n');+ }+});+process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gifindex 3f0f7d64..9db6cc79 100644Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differdiff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.jsonindex 9b47db9b..b4b0a2cc 100644--- a/docs/assets/archify-live-proof.json+++ b/docs/assets/archify-live-proof.json@@ -7,13 +7,13 @@"fps": 10,"frameCount": 54,"durationSeconds": 5.4,- "bytes": 1629621,- "sha256": "ede2e0c6f3d5ef9f1d3aa9324a3ba55d23a8628c340d8ef50c6b7e3ce09610d5",+ "bytes": 1681740,+ "sha256": "58a57dc5e1e8fa377d67fd0501ed35b868f22c2778c2563c78fc272f077842cb","scenes": [{"id": "signal-flow","artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",- "artifactSha256": "fc7643fa7f3b0c85250f781f9927a905f518a5b4a8c28ec08afd6f3889f435e4",+ "artifactSha256": "3ad7b10452fc1afe61008c2dd6eebf6348c7e694227f0b03f217bd1bac1fe046","view": "happy-path","eyebrow": "WORKFLOW · SIGNAL FLOW","title": "Agent Tool Call",@@ -22,7 +22,7 @@{"id": "blueprint","artifact": "docs/gallery/artifacts/production-deployment.architecture.html",- "artifactSha256": "dccd530553b06c10397cf00a23c8f2a04e2bb25548c6d0c29ae912ed0d5a05fe",+ "artifactSha256": "e2b4168de0170e58a04a72966438770e3dade7e62bf57dc8b108dc33d65cfa58","view": "request-boundary","eyebrow": "ARCHITECTURE · BLUEPRINT","title": "Production Deployment",@@ -31,7 +31,7 @@{"id": "classic","artifact": "docs/gallery/artifacts/cache-miss.sequence.html",- "artifactSha256": "7c5c8f5c39c10dc8148591f654cd79a05ff49bb70166a4c45607414ca02cbe3a",+ "artifactSha256": "1a38f34911db256a86962512fbd744ed6ec894750b91256a0ca41ca543921d0b","view": "cache-fallback","eyebrow": "SEQUENCE · CLASSIC","title": "Cache Miss Request",diff --git a/docs/cases/mco-runtime.architecture.html b/docs/cases/mco-runtime.architecture.htmlindex 34258ac9..ff783503 100644--- a/docs/cases/mco-runtime.architecture.html+++ b/docs/cases/mco-runtime.architecture.html@@ -10217,7 +10217,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10967,6 +10969,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery.html b/docs/gallery.htmlindex 0fc8e9b2..9e375c5f 100644--- a/docs/gallery.html+++ b/docs/gallery.html@@ -298,7 +298,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="fc7643fa7f3b0c85250f781f9927a905f518a5b4a8c28ec08afd6f3889f435e4">fc7643fa7f3b</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3ad7b10452fc1afe61008c2dd6eebf6348c7e694227f0b03f217bd1bac1fe046">3ad7b10452fc</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html?present=1&play=1#view=happy-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -328,7 +328,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="dccd530553b06c10397cf00a23c8f2a04e2bb25548c6d0c29ae912ed0d5a05fe">dccd530553b0</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e2b4168de0170e58a04a72966438770e3dade7e62bf57dc8b108dc33d65cfa58">e2b4168de017</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html?present=1&play=1#view=request-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -357,7 +357,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7c5c8f5c39c10dc8148591f654cd79a05ff49bb70166a4c45607414ca02cbe3a">7c5c8f5c39c1</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="1a38f34911db256a86962512fbd744ed6ec894750b91256a0ca41ca543921d0b">1a38f34911db</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html?present=1&play=1#view=cache-fallback" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -386,7 +386,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ebe7c1363e5e7943f885e71029e135b4271b87eeb82255708727692969ec99b7">ebe7c1363e5e</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="75cdfb37ec8803c1c90738e76f2a7b64ba99db4d43cacb6d1f4e60b0948778d8">75cdfb37ec88</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html?present=1&play=1#view=approval-to-production" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -415,7 +415,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="8a56193e079b25feed917ba33f29dd01e49615c99d5030f582d6ea34bc3d1f27">8a56193e079b</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="61ae407a326474dbf1f02b1d46509d68a0b9e3faa3ec2138c67f86e72635cf5b">61ae407a3264</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html?present=1&play=1#view=mitigate-and-verify" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -444,7 +444,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c75c04344269b16e25c72551101e706d05004ee93d298e8d0c4c5bd93d4050e9">c75c04344269</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c401af2063084329198bc915c0c3caec1c5156668dfd12c7f599f0573cb74814">c401af206308</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html?present=1&play=1#view=consent-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -473,7 +473,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="8fb45b739efdc45b56f7f9a0cf2f7bf95573d382897198731f4b4b2f33567930">8fb45b739efd</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="33bf7ef66adc0a3e9bb40d4269c6cb3976445c44b3284e2763a68035ccfb9013">33bf7ef66adc</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html?present=1&play=1#view=work-and-retry" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -502,7 +502,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7cc04cbd1d9a6c9999fb69a8ef226c682be0f32b5c5dbbdfef06a28670f68df5">7cc04cbd1d9a</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d8ddc6a43617e37ae514b187f1aba723f2bfe8b8cb080be0fb8479bded0ec0d4">d8ddc6a43617</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html?present=1&play=1#view=order-transit" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -531,7 +531,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="87b43a172dd3c9292fbc12fb37bcdadc9580171473cec33cffcd5d81b2deea25">87b43a172dd3</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e11f2b1db9bb0c9659516f33a139c6c0e4f68c7a8ff264daf941e8bf4347f8bd">e11f2b1db9bb</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html?present=1&play=1#view=main-lifecycle" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -560,7 +560,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="cb7939eb251a51138fd748de573402d8272d6cfc3cf31a375850dec39bccb323">cb7939eb251a</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="a812754ab6358777fed0154da55222986873ed077f6197b700957b97d3c569bd">a812754ab635</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html?present=1&play=1#view=rollback-outcomes" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -589,7 +589,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="acfb4794ff836ca93ed4139345cce763cdf62514a10133e4a8a32ef1a69066d1">acfb4794ff83</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3b6576e29920ce22343b48ab6ee8cb3c98aa1febc583b569e4af30543e37be96">3b6576e29920</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/web-app.architecture.html?present=1&play=1#view=request-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -675,8 +675,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 12,"edgeCount": 11,- "artifactBytes": 817897,- "artifactSha256": "fc7643fa7f3b0c85250f781f9927a905f518a5b4a8c28ec08afd6f3889f435e4",+ "artifactBytes": 818979,+ "artifactSha256": "3ad7b10452fc1afe61008c2dd6eebf6348c7e694227f0b03f217bd1bac1fe046","sourceBytes": 5687,"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c","checks": [@@ -775,8 +775,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": "deployment-ownership","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 819731,- "artifactSha256": "dccd530553b06c10397cf00a23c8f2a04e2bb25548c6d0c29ae912ed0d5a05fe",+ "artifactBytes": 820813,+ "artifactSha256": "e2b4168de0170e58a04a72966438770e3dade7e62bf57dc8b108dc33d65cfa58","sourceBytes": 5476,"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb","checks": [@@ -875,8 +875,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 7,"edgeCount": 12,- "artifactBytes": 813020,- "artifactSha256": "7c5c8f5c39c10dc8148591f654cd79a05ff49bb70166a4c45607414ca02cbe3a",+ "artifactBytes": 814102,+ "artifactSha256": "1a38f34911db256a86962512fbd744ed6ec894750b91256a0ca41ca543921d0b","sourceBytes": 4374,"sourceSha256": "9a799a3661c16cd6ab4f6373ff6a04da95a9ab70d93b0a349b668466f4912fd7","checks": [@@ -975,8 +975,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 10,"edgeCount": 10,- "artifactBytes": 814097,- "artifactSha256": "ebe7c1363e5e7943f885e71029e135b4271b87eeb82255708727692969ec99b7",+ "artifactBytes": 815179,+ "artifactSha256": "75cdfb37ec8803c1c90738e76f2a7b64ba99db4d43cacb6d1f4e60b0948778d8","sourceBytes": 5164,"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91","checks": [@@ -1075,8 +1075,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 11,"edgeCount": 10,- "artifactBytes": 811426,- "artifactSha256": "8a56193e079b25feed917ba33f29dd01e49615c99d5030f582d6ea34bc3d1f27",+ "artifactBytes": 812508,+ "artifactSha256": "61ae407a326474dbf1f02b1d46509d68a0b9e3faa3ec2138c67f86e72635cf5b","sourceBytes": 5375,"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b","checks": [@@ -1175,8 +1175,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 10,"edgeCount": 10,- "artifactBytes": 815337,- "artifactSha256": "c75c04344269b16e25c72551101e706d05004ee93d298e8d0c4c5bd93d4050e9",+ "artifactBytes": 816419,+ "artifactSha256": "c401af2063084329198bc915c0c3caec1c5156668dfd12c7f599f0573cb74814","sourceBytes": 5618,"sourceSha256": "91411404fb4828a3b7ea358f3a7b9877781c9e9dc9c04b42b6eb4a757281b59f","checks": [@@ -1275,8 +1275,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 7,"edgeCount": 14,- "artifactBytes": 812111,- "artifactSha256": "8fb45b739efdc45b56f7f9a0cf2f7bf95573d382897198731f4b4b2f33567930",+ "artifactBytes": 813193,+ "artifactSha256": "33bf7ef66adc0a3e9bb40d4269c6cb3976445c44b3284e2763a68035ccfb9013","sourceBytes": 4370,"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9","checks": [@@ -1375,8 +1375,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 12,"edgeCount": 12,- "artifactBytes": 819318,- "artifactSha256": "7cc04cbd1d9a6c9999fb69a8ef226c682be0f32b5c5dbbdfef06a28670f68df5",+ "artifactBytes": 820400,+ "artifactSha256": "d8ddc6a43617e37ae514b187f1aba723f2bfe8b8cb080be0fb8479bded0ec0d4","sourceBytes": 5433,"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e","checks": [@@ -1475,8 +1475,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 10,"edgeCount": 6,- "artifactBytes": 808440,- "artifactSha256": "87b43a172dd3c9292fbc12fb37bcdadc9580171473cec33cffcd5d81b2deea25",+ "artifactBytes": 809522,+ "artifactSha256": "e11f2b1db9bb0c9659516f33a139c6c0e4f68c7a8ff264daf941e8bf4347f8bd","sourceBytes": 4044,"sourceSha256": "7c0ad72ee7affbd6c6e4758b7520d61ddd4508c917acf36beabcad3ee7ca3ba7","checks": [@@ -1575,8 +1575,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 11,"edgeCount": 6,- "artifactBytes": 809982,- "artifactSha256": "cb7939eb251a51138fd748de573402d8272d6cfc3cf31a375850dec39bccb323",+ "artifactBytes": 811064,+ "artifactSha256": "a812754ab6358777fed0154da55222986873ed077f6197b700957b97d3c569bd","sourceBytes": 4274,"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71","checks": [@@ -1675,8 +1675,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"engineeringProfile": null,"nodeCount": 10,"edgeCount": 9,- "artifactBytes": 810075,- "artifactSha256": "acfb4794ff836ca93ed4139345cce763cdf62514a10133e4a8a32ef1a69066d1",+ "artifactBytes": 811157,+ "artifactSha256": "3b6576e29920ce22343b48ab6ee8cb3c98aa1febc583b569e4af30543e37be96","sourceBytes": 3793,"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf","checks": [diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.htmlindex be708309..33692ec3 100644--- a/docs/gallery/artifacts/agent-run.lifecycle.html+++ b/docs/gallery/artifacts/agent-run.lifecycle.html@@ -5836,6 +5836,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6021,186 +6205,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10140,7 +10145,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10890,6 +10897,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.htmlindex d2a6d6e6..c44cd78c 100644--- a/docs/gallery/artifacts/agent-tool-call.workflow.html+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html@@ -5907,6 +5907,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6092,186 +6276,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10211,7 +10216,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10961,6 +10968,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.htmlindex 1b399ab7..217eaf06 100644--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html@@ -5928,6 +5928,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6113,186 +6297,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10232,7 +10237,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10982,6 +10989,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.htmlindex 47a66b5f..7de50a1c 100644--- a/docs/gallery/artifacts/cache-miss.sequence.html+++ b/docs/gallery/artifacts/cache-miss.sequence.html@@ -5916,6 +5916,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6101,186 +6285,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10220,7 +10225,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10970,6 +10977,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.htmlindex 05de1498..e5d14d44 100644--- a/docs/gallery/artifacts/deployment-release.lifecycle.html+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html@@ -5862,6 +5862,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6047,186 +6231,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10166,7 +10171,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10916,6 +10923,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.htmlindex f770cc2b..a70c75e1 100644--- a/docs/gallery/artifacts/event-stream.dataflow.html+++ b/docs/gallery/artifacts/event-stream.dataflow.html@@ -5940,6 +5940,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6125,186 +6309,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10244,7 +10249,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10994,6 +11001,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.htmlindex 123edd5d..ce5f5168 100644--- a/docs/gallery/artifacts/incident-response.workflow.html+++ b/docs/gallery/artifacts/incident-response.workflow.html@@ -5867,6 +5867,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6052,186 +6236,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10171,7 +10176,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10921,6 +10928,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.htmlindex eefc319d..08f32fb3 100644--- a/docs/gallery/artifacts/product-analytics.dataflow.html+++ b/docs/gallery/artifacts/product-analytics.dataflow.html@@ -5901,6 +5901,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6086,186 +6270,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10205,7 +10210,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10955,6 +10962,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.htmlindex 09809789..5054e853 100644--- a/docs/gallery/artifacts/production-deployment.architecture.html+++ b/docs/gallery/artifacts/production-deployment.architecture.html@@ -5932,6 +5932,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6117,186 +6301,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10236,7 +10241,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10986,6 +10993,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.htmlindex 85045ea4..eed09a79 100644--- a/docs/gallery/artifacts/release-delivery.workflow.html+++ b/docs/gallery/artifacts/release-delivery.workflow.html@@ -5893,6 +5893,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6078,186 +6262,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10197,7 +10202,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10947,6 +10954,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.htmlindex b53fdac0..ff65a3e5 100644--- a/docs/gallery/artifacts/web-app.architecture.html+++ b/docs/gallery/artifacts/web-app.architecture.html@@ -5865,6 +5865,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6050,186 +6234,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10169,7 +10174,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10919,6 +10926,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.jsonindex 9c6fd65b..94c4a3e7 100644--- a/docs/gallery/manifest.json+++ b/docs/gallery/manifest.json@@ -27,8 +27,8 @@"engineeringProfile": null,"nodeCount": 12,"edgeCount": 11,- "artifactBytes": 817897,- "artifactSha256": "fc7643fa7f3b0c85250f781f9927a905f518a5b4a8c28ec08afd6f3889f435e4",+ "artifactBytes": 818979,+ "artifactSha256": "3ad7b10452fc1afe61008c2dd6eebf6348c7e694227f0b03f217bd1bac1fe046","sourceBytes": 5687,"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c","checks": [@@ -127,8 +127,8 @@"engineeringProfile": "deployment-ownership","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 819731,- "artifactSha256": "dccd530553b06c10397cf00a23c8f2a04e2bb25548c6d0c29ae912ed0d5a05fe",+ "artifactBytes": 820813,+ "artifactSha256": "e2b4168de0170e58a04a72966438770e3dade7e62bf57dc8b108dc33d65cfa58","sourceBytes": 5476,"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb","checks": [@@ -227,8 +227,8 @@"engineeringProfile": null,"nodeCount": 7,"edgeCount": 12,- "artifactBytes": 813020,- "artifactSha256": "7c5c8f5c39c10dc8148591f654cd79a05ff49bb70166a4c45607414ca02cbe3a",+ "artifactBytes": 814102,+ "artifactSha256": "1a38f34911db256a86962512fbd744ed6ec894750b91256a0ca41ca543921d0b","sourceBytes": 4374,"sourceSha256": "9a799a3661c16cd6ab4f6373ff6a04da95a9ab70d93b0a349b668466f4912fd7","checks": [@@ -327,8 +327,8 @@"engineeringProfile": null,"nodeCount": 10,"edgeCount": 10,- "artifactBytes": 814097,- "artifactSha256": "ebe7c1363e5e7943f885e71029e135b4271b87eeb82255708727692969ec99b7",+ "artifactBytes": 815179,+ "artifactSha256": "75cdfb37ec8803c1c90738e76f2a7b64ba99db4d43cacb6d1f4e60b0948778d8","sourceBytes": 5164,"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91","checks": [@@ -427,8 +427,8 @@"engineeringProfile": null,"nodeCount": 11,"edgeCount": 10,- "artifactBytes": 811426,- "artifactSha256": "8a56193e079b25feed917ba33f29dd01e49615c99d5030f582d6ea34bc3d1f27",+ "artifactBytes": 812508,+ "artifactSha256": "61ae407a326474dbf1f02b1d46509d68a0b9e3faa3ec2138c67f86e72635cf5b","sourceBytes": 5375,"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b","checks": [@@ -527,8 +527,8 @@"engineeringProfile": null,"nodeCount": 10,"edgeCount": 10,- "artifactBytes": 815337,- "artifactSha256": "c75c04344269b16e25c72551101e706d05004ee93d298e8d0c4c5bd93d4050e9",+ "artifactBytes": 816419,+ "artifactSha256": "c401af2063084329198bc915c0c3caec1c5156668dfd12c7f599f0573cb74814","sourceBytes": 5618,"sourceSha256": "91411404fb4828a3b7ea358f3a7b9877781c9e9dc9c04b42b6eb4a757281b59f","checks": [@@ -627,8 +627,8 @@"engineeringProfile": null,"nodeCount": 7,"edgeCount": 14,- "artifactBytes": 812111,- "artifactSha256": "8fb45b739efdc45b56f7f9a0cf2f7bf95573d382897198731f4b4b2f33567930",+ "artifactBytes": 813193,+ "artifactSha256": "33bf7ef66adc0a3e9bb40d4269c6cb3976445c44b3284e2763a68035ccfb9013","sourceBytes": 4370,"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9","checks": [@@ -727,8 +727,8 @@"engineeringProfile": null,"nodeCount": 12,"edgeCount": 12,- "artifactBytes": 819318,- "artifactSha256": "7cc04cbd1d9a6c9999fb69a8ef226c682be0f32b5c5dbbdfef06a28670f68df5",+ "artifactBytes": 820400,+ "artifactSha256": "d8ddc6a43617e37ae514b187f1aba723f2bfe8b8cb080be0fb8479bded0ec0d4","sourceBytes": 5433,"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e","checks": [@@ -827,8 +827,8 @@"engineeringProfile": null,"nodeCount": 10,"edgeCount": 6,- "artifactBytes": 808440,- "artifactSha256": "87b43a172dd3c9292fbc12fb37bcdadc9580171473cec33cffcd5d81b2deea25",+ "artifactBytes": 809522,+ "artifactSha256": "e11f2b1db9bb0c9659516f33a139c6c0e4f68c7a8ff264daf941e8bf4347f8bd","sourceBytes": 4044,"sourceSha256": "7c0ad72ee7affbd6c6e4758b7520d61ddd4508c917acf36beabcad3ee7ca3ba7","checks": [@@ -927,8 +927,8 @@"engineeringProfile": null,"nodeCount": 11,"edgeCount": 6,- "artifactBytes": 809982,- "artifactSha256": "cb7939eb251a51138fd748de573402d8272d6cfc3cf31a375850dec39bccb323",+ "artifactBytes": 811064,+ "artifactSha256": "a812754ab6358777fed0154da55222986873ed077f6197b700957b97d3c569bd","sourceBytes": 4274,"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71","checks": [@@ -1027,8 +1027,8 @@"engineeringProfile": null,"nodeCount": 10,"edgeCount": 9,- "artifactBytes": 810075,- "artifactSha256": "acfb4794ff836ca93ed4139345cce763cdf62514a10133e4a8a32ef1a69066d1",+ "artifactBytes": 811157,+ "artifactSha256": "3b6576e29920ce22343b48ab6ee8cb3c98aa1febc583b569e4af30543e37be96","sourceBytes": 3793,"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf","checks": [diff --git a/examples/archify-repo-grid.html b/examples/archify-repo-grid.htmlindex aefa634a..5b053f7c 100644--- a/examples/archify-repo-grid.html+++ b/examples/archify-repo-grid.html@@ -10108,7 +10108,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10858,6 +10860,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/archify-repo.html b/examples/archify-repo.htmlindex 935923c7..7c6d936a 100644--- a/examples/archify-repo.html+++ b/examples/archify-repo.html@@ -10170,7 +10170,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10920,6 +10922,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.htmlindex 3eb58ff2..b99bf226 100644--- a/examples/checkout-platform-delta.html+++ b/examples/checkout-platform-delta.html@@ -10624,6 +10624,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -10809,186 +10993,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -14928,7 +14933,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -15678,6 +15685,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();@@ -25824,9 +25847,193 @@ OTHER DEALINGS IN THE FONT SOFTWARE..replace(/^-+|-+$/g, '') || 'diagram';}- function currentBg() {- return getComputedStyle(document.body).backgroundColor || '#ffffff';- }+ function currentBg() {+ return getComputedStyle(document.body).backgroundColor || '#ffffff';+ }++ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }+/*** Serialize the main SVG into a standalone document.@@ -26013,186 +26220,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -30132,7 +30160,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -30882,6 +30912,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.jsonindex 57536a03..7b8ad355 100644--- a/examples/checkout-platform-delta.receipt.json+++ b/examples/checkout-platform-delta.receipt.json@@ -219,8 +219,8 @@"Boundary identity is conservatively derived from kind + label."],"artifact": {- "sha256": "4dfa76443ff644609ff0a4f7e6117a4a5d977a57db63258417d192f9f8072293",- "bytes": 2213635+ "sha256": "c6ad05b9e1852f1dd68c8c076e03d026f00ad8edcfe7fbd186f82b73db923aae",+ "bytes": 2215875},"validation": {"checksPassed": 28,diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.htmlindex eefc319d..08f32fb3 100644--- a/examples/dataflow-product-analytics.html+++ b/examples/dataflow-product-analytics.html@@ -5901,6 +5901,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6086,186 +6270,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10205,7 +10210,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10955,6 +10962,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.htmlindex be708309..33692ec3 100644--- a/examples/lifecycle-agent-run.html+++ b/examples/lifecycle-agent-run.html@@ -5836,6 +5836,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6021,186 +6205,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10140,7 +10145,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10890,6 +10897,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/maka-architecture.html b/examples/maka-architecture.htmlindex b88a1a92..ffdabe3d 100644--- a/examples/maka-architecture.html+++ b/examples/maka-architecture.html@@ -10196,7 +10196,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10946,6 +10948,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/rag-pipeline.html b/examples/rag-pipeline.htmlindex 42cb6e8e..1d99727a 100644--- a/examples/rag-pipeline.html+++ b/examples/rag-pipeline.html@@ -10211,7 +10211,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10961,6 +10963,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.htmlindex 47a66b5f..7de50a1c 100644--- a/examples/sequence-cache-miss-request.html+++ b/examples/sequence-cache-miss-request.html@@ -5916,6 +5916,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6101,186 +6285,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10220,7 +10225,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10970,6 +10977,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.htmlindex b53fdac0..ff65a3e5 100644--- a/examples/web-app-rendered.html+++ b/examples/web-app-rendered.html@@ -5865,6 +5865,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6050,186 +6234,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10169,7 +10174,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10919,6 +10926,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/web-app.html b/examples/web-app.htmlindex b53fdac0..ff65a3e5 100644--- a/examples/web-app.html+++ b/examples/web-app.html@@ -5865,6 +5865,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6050,186 +6234,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10169,7 +10174,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10919,6 +10926,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.htmlindex d2a6d6e6..c44cd78c 100644--- a/examples/workflow-agent-tool-call-rendered.html+++ b/examples/workflow-agent-tool-call-rendered.html@@ -5907,6 +5907,190 @@ OTHER DEALINGS IN THE FONT SOFTWARE.return getComputedStyle(document.body).backgroundColor || '#ffffff';}+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }++/*** Serialize the main SVG into a standalone document.*@@ -6092,186 +6276,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var svg = document.querySelector('.diagram-container svg');var clone = svg.cloneNode(true);- // View transforms and neighborhood focus are HTML exploration state,- // never part of a downloaded full-diagram artifact.- clone.style.removeProperty('transform');- clone.style.removeProperty('clip-path');- clone.removeAttribute('data-view-scale');- clone.removeAttribute('data-focus-active');- clone.removeAttribute('data-reach-active');- clone.removeAttribute('data-lens-active');- clone.removeAttribute('data-lens-flow-count');- clone.removeAttribute('data-lens-flow-density');- clone.removeAttribute('data-legend-preview-active');- clone.removeAttribute('data-relationship-preview-active');- clone.removeAttribute('data-relationship-direct-active');- clone.removeAttribute('data-relationship-pin-active');- clone.removeAttribute('data-intent-trace-active');- clone.removeAttribute('data-route-picking');- clone.removeAttribute('data-route-active');- clone.removeAttribute('data-route-journey');- clone.removeAttribute('data-share-route');- clone.removeAttribute('data-share-reach');- clone.removeAttribute('data-story-active');- clone.removeAttribute('data-story-playing');- clone.removeAttribute('data-story-beat');- clone.removeAttribute('data-story-next');- clone.removeAttribute('data-story-follow');- clone.removeAttribute('data-chapter-handoff');- clone.removeAttribute('data-chapter-anchor');- clone.removeAttribute('data-chapter-preview');- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {- el.removeAttribute('data-chapter-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {- el.removeAttribute('data-chapter-preview-role');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {- el.removeAttribute('data-legend-kind');- el.removeAttribute('data-legend-label');- el.removeAttribute('data-legend-count');- el.removeAttribute('data-legend-zero');- el.removeAttribute('data-legend-selected');- el.removeAttribute('role');- el.removeAttribute('tabindex');- el.removeAttribute('aria-label');- el.removeAttribute('aria-pressed');- el.removeAttribute('aria-haspopup');- el.removeAttribute('aria-controls');- el.removeAttribute('aria-expanded');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {- el.removeAttribute('data-legend-bridge');- el.removeAttribute('role');- el.removeAttribute('aria-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {- el.remove();- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {- var originalLabel = el.getAttribute('data-source-evidence-original-label');- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');- else el.setAttribute('aria-label', originalLabel);- el.removeAttribute('data-source-evidence-count');- el.removeAttribute('data-source-evidence-original-label');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {- el.removeAttribute('data-story-step');- el.removeAttribute('data-story-beat-state');- el.removeAttribute('data-story-beat-step');- el.style.removeProperty('--story-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {- el.removeAttribute('data-focus-match');- el.removeAttribute('data-focus-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {- el.removeAttribute('data-reach-match');- el.removeAttribute('data-reach-origin');- el.removeAttribute('data-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {- el.removeAttribute('data-lens-match');- el.removeAttribute('data-lens-selected');- el.removeAttribute('data-lens-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {- el.removeAttribute('data-legend-preview-match');- el.removeAttribute('data-legend-preview-selected');- el.removeAttribute('data-legend-preview-peer');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {- el.removeAttribute('data-relationship-preview');- el.removeAttribute('data-relationship-preview-node');- el.removeAttribute('data-relationship-preview-source');- el.removeAttribute('data-relationship-preview-target');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {- el.removeAttribute('data-intent-trace-match');- el.removeAttribute('data-intent-trace-selected');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {- el.removeAttribute('data-route-match');- el.removeAttribute('data-route-start');- el.removeAttribute('data-route-end');- el.removeAttribute('data-route-step');- el.removeAttribute('data-route-candidate');- el.removeAttribute('data-route-journey-state');- el.removeAttribute('data-route-journey-current');- el.style.removeProperty('--route-step');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {- el.removeAttribute('data-share-route-match');- el.removeAttribute('data-share-route-step');- el.removeAttribute('data-share-route-start');- el.removeAttribute('data-share-route-end');- el.removeAttribute('data-share-route-middle');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {- el.removeAttribute('data-share-reach-match');- el.removeAttribute('data-share-reach-origin');- el.removeAttribute('data-share-reach-depth');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {- el.removeAttribute('data-detail');- el.removeAttribute('data-detail-anchor');- });- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {- el.setAttribute('aria-pressed', 'false');- });- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&- !clone.hasAttribute('data-focus-active') &&- !clone.hasAttribute('data-reach-active') &&- !clone.hasAttribute('data-lens-active') &&- !clone.hasAttribute('data-lens-flow-count') &&- !clone.hasAttribute('data-lens-flow-density') &&- !clone.hasAttribute('data-legend-preview-active') &&- !clone.hasAttribute('data-relationship-preview-active') &&- !clone.hasAttribute('data-relationship-direct-active') &&- !clone.hasAttribute('data-intent-trace-active') &&- !clone.hasAttribute('data-route-picking') &&- !clone.hasAttribute('data-route-active') &&- !clone.hasAttribute('data-route-journey') &&- !clone.hasAttribute('data-share-route') &&- !clone.hasAttribute('data-share-reach') &&- !clone.hasAttribute('data-story-active') &&- !clone.hasAttribute('data-story-playing') &&- !clone.hasAttribute('data-story-beat') &&- !clone.hasAttribute('data-story-next') &&- !clone.hasAttribute('data-story-follow') &&- !clone.hasAttribute('data-chapter-handoff') &&- !clone.hasAttribute('data-chapter-anchor') &&- !clone.hasAttribute('data-chapter-preview') &&- !clone.style.getPropertyValue('transform') &&- !clone.style.getPropertyValue('clip-path') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ var canonicalStateClean = cleanExportClone(clone);var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -10211,7 +10216,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10961,6 +10968,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/experiments/mco-showcase/mco-runtime.html b/experiments/mco-showcase/mco-runtime.htmlindex ab2974b8..d9fde722 100644--- a/experiments/mco-showcase/mco-runtime.html+++ b/experiments/mco-showcase/mco-runtime.html@@ -10094,7 +10094,9 @@function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10844,6 +10846,22 @@});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/generated/maka-regenerated.workflow.html b/generated/maka-regenerated.workflow.htmlindex 06beddc0..3954abbf 100644--- a/generated/maka-regenerated.workflow.html+++ b/generated/maka-regenerated.workflow.html@@ -10082,7 +10082,9 @@function centerStoryStop(stop) {if (!stop || !trail) return false;- var target = Math.max(0, stop.offsetLeft - (trail.clientWidth - stop.offsetWidth) / 2);+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);trail.scrollLeft = target;return true;}@@ -10832,6 +10834,22 @@});storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });}+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }window.addEventListener('beforeprint', function () {clearChapterPreview({ clearIntents: true });if (playing) pausePlayback();diff --git a/scripts/generate-viewer.mjs b/scripts/generate-viewer.mjsnew file mode 100644index 00000000..7415279d--- /dev/null+++ b/scripts/generate-viewer.mjs@@ -0,0 +1,62 @@+#!/usr/bin/env node++import fs from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const output = path.join(root, 'archify/assets/template.html');+const fragments = [+ ['/* ARCHIFY:EXPORT */', 'export.js'],+ ['/* ARCHIFY:READER_LAYOUT */', 'reader-layout.js'],+ ['/* ARCHIFY:CHROME_LAYOUT */', 'viewer-chrome-layout.js'],+ ['/* ARCHIFY:CAMERA */', 'viewer-camera.js'],+ ['/* ARCHIFY:RADAR */', 'semantic-radar.js'],+ ['/* ARCHIFY:MOTION_GOVERNOR */', 'motion-governor.js'],+ ['/* ARCHIFY:NODE_FINDER */', 'node-finder.js'],+ ['/* ARCHIFY:FOCUS */', 'focus.js'],+ ['/* ARCHIFY:INTENT_TRACE */', 'intent-trace.js'],+ ['/* ARCHIFY:SEMANTIC_LENS */', 'semantic-lens.js'],+ ['/* ARCHIFY:ROUTE_PROBE */', 'route-probe.js'],+ ['/* ARCHIFY:GUIDED_VIEWS */', 'guided-views.js'],+ ['/* ARCHIFY:EXPORT_CLEANUP */', 'export-cleanup.js'],+];++try {+ const args = process.argv.slice(2);+ if (args.length > 1 || (args.length === 1 && args[0] !== '--check')) {+ throw new Error('Usage: node scripts/generate-viewer.mjs [--check]');+ }+ let generated = fs.readFileSync(path.join(root, 'viewer/template.source.html'), 'utf8');+ for (const [marker, filename] of fragments) {+ const source = fs.readFileSync(path.join(root, 'viewer', filename), 'utf8');+ const parts = generated.split(marker);+ if (parts.length !== 2) throw new Error(`Viewer source must contain exactly one ${filename} marker.`);+ // Export owns the sole nested fragment; expand it before Cleanup.+ const childMarker = filename === 'export.js' ? '/* ARCHIFY:EXPORT_CLEANUP */' : null;+ if (!source.trim() || (childMarker && source.split(childMarker).length !== 2) ||+ fragments.some(([slot]) => source.includes(slot) && slot !== childMarker)) {+ throw new Error(`${filename} source is empty or contains an unresolved marker.`);+ }+ // Preserve classic-script scope, execution position and literal source bytes,+ // including characters with String.replace semantics.+ generated = parts[0] + source + parts[1];+ }+ if (args[0] === '--check') {+ if (!fs.existsSync(output) || fs.readFileSync(output, 'utf8') !== generated) {+ throw new Error('Viewer template is stale — run npm run generate:viewer from archify/.');+ }+ } else {+ const temporary = `${output}.${process.pid}.tmp`;+ try {+ fs.writeFileSync(temporary, generated);+ fs.renameSync(temporary, output);+ } finally {+ fs.rmSync(temporary, { force: true });+ }+ console.log('generated archify/assets/template.html');+ }+} catch (error) {+ console.error(error.message);+ process.exitCode = 1;+}diff --git a/viewer/README.md b/viewer/README.mdnew file mode 100644index 00000000..002b9940--- /dev/null+++ b/viewer/README.md@@ -0,0 +1,943 @@+# Viewer source++Edit `reader-layout.js` for Adaptive Reader Layout, `viewer-chrome-layout.js`+for navigation clearance, `viewer-camera.js` for camera interactions and+transactions, `semantic-radar.js` for the overview map, `motion-governor.js` for+motion mode and ownership, `node-finder.js` for node search and endpoint picking,+`intent-trace.js` for hover/focus previews, `semantic-lens.js` for type selection+and legend previews, `route-probe.js` for directed paths and Route Journey,+`guided-views.js` for authored chapters and Story playback,+`focus.js` for semantic selection, relationships, reachability and shared flow tokens,+`export.js` for export menus, serialization, images, cards, clipboard and WebM,+`export-cleanup.js` for its private SVG clone cleanup, and+`template.source.html` for the rest of the Viewer.+`archify/assets/template.html` is the committed+generated artifact, consumed unchanged by all five renderers and the installed+Skill. These maintainer sources live outside the packaged `archify/` directory.++From `archify/`, run `npm run generate:viewer` after editing any source.+`npm run check:viewer` verifies freshness without writing; `npm test` includes+that check. Assembly inserts each fragment verbatim at its fixed marker.+Reader, Chrome Layout, Camera, Radar, Motion Governor, Finder, Intent Trace, Semantic Lens, Route Probe, Guided Views, Focus and Export+extractions preserve delivered HTML bytes. Export cleanup adds a+private function and a call, changing script bytes but preserving cleanup order+and SVG output. All fragments retain classic-script scope and initialization order.+Generated output is not a second editing+surface; release identity changes also belong in `template.source.html`.++## Export contract++`export.js` contains the complete Export heading and IIFE. It initializes once+at its original position after Theme/Preset and before Motion Governor and+Source Evidence. `export-cleanup.js` stays private to that closure. Assembly has+one explicit child relationship: Export must contain exactly one EXPORT_CLEANUP+marker and no other known marker. The shell owns EXPORT; all other fragments+reject nested markers. Export is expanded before Cleanup in the fixed list,+without changing the generated script's execution order. This is not a recursive+loader or a second runtime initialization step.++### Interface and dependencies++The interface includes all ten `Archify.exportMenu` methods: open, close, isOpen,+run, shareCard, downloadRouteShareCard, downloadReachShareCard, syncRouteShare,+syncReachShare and copyShareCard. The same closure installs+`Archify.motion.canRecord` and `recordWebm`; this recording capability is distinct+from Motion Governor. Return values and synchronous/asynchronous failure modes+are part of the interface, not normalized by the extraction.++- Initialization requires the export menu, trigger and Route/Reach menu items;+ it probes format/clipboard/recording support, registers listeners and creates+ one toast live region. Later calls require the main diagram SVG and use the+ existing header, document title, font style and computed theme/preset styles.+- Shared viewerText, viewerCount and hasDrawableGeometry remain in classic-script+ scope. The last helper verifies drawable semantic edges in export snapshots.+- Menu open looks up Preset and Semantic Lens at call time, preserving optional+ checks, close arguments and preview clearing. Route Probe and Focus provide+ exportSnapshot/reachabilitySnapshot at sync/export time; their later script+ positions do not justify early capture or new initialization dependencies.+- Preset, Lens, Finder and Presentation close Export through its existing+ interface. Guide/Presentation open it; Route Probe and Focus synchronize their+ share items. The DOM menu routes clicks to the private ordinary PNG copy path.+ External consumers of Archify.motion retain both recording methods.++### DOM, styles and output state++- Menu state is its open class plus the trigger's aria-expanded. Navigation skips+ hidden/disabled items; ArrowUp/Down wrap, Home/End select endpoints, Escape+ restores trigger focus, Tab/outside clicks close without forced restoration.+ Ordinary export/copy uses close(true); Route/Reach downloads use close(false).+- The query openExport=1 waits for fonts and two animation frames; without the+ Font Loading API it retains the 200ms fallback. No new readiness coordinator+ is introduced. Toast reuses role=status, a frame callback and a 1500ms timer.+- shareCard returns a PNG Blob and does not download or write a receipt. Semantic+ variants re-read their current provider, reject unavailable/invalid snapshots,+ and retain the existing clone geometry/identity checks. Menu visibility does+ not grant a stale snapshot permission to export after Route/Reach is cleared.+- Downloaded SVG embeds both themes. Raster/card/recording serialization locks+ current theme variables after host CSS. CSS rule filtering, stylesheet order,+ cross-origin cssRules catches, embedded fonts and temporary theme probes stay+ unchanged. Moving CSS can change export output even when the live page looks+ similar; styles remain in the main template.+- Cleanup affects the clone. Canonical output excludes transient camera/focus/+ preview/route/story state; semantic cards intentionally apply their own share+ markers and styles afterwards. This does not promise that menu-driven focus+ changes leave all live preview state untouched.+- Raster scale chooses the largest fitting member of 4/3/2/1, falling back to 1+ even when that size exceeds the advisory pixel cap. Cards remain 1200x630.+ File names, MIME probes, quality and background choices remain unchanged.+- run clears old export receipts before starting. Success writes format/bytes/+ canonical and optional dimensions/variant/clean flags. Route/Reach downloads+ return their Blob and mark canonical=false. Their failures report share-card+ errors and alert. Regular run resolves through its existing handlers; failures+ record an error and alert, except WebM disables its item and shows a toast.+- Ordinary PNG copy only toasts on success; card copy also writes a card receipt.+ Their failure receipt behavior differs. Unsupported copy can return undefined.+ ClipboardItem construction with a Promise stays inside the user gesture;+ synchronous rejection falls back to a Blob, asynchronous write rejection does+ not take that fallback. SVG serialization can throw before run constructs its+ Promise chain. No common wrapper changes these distinctions.++### Resources and verification++| Owner/path | Lifetime |+| --- | --- |+| Auto-theme probes | Detached after computed-style sampling, including finally on failure |+| Download URL/anchor | Anchor appended/clicked/removed synchronously; URL revoked after 1000ms |+| Raster/card SVG URL | Lives until Image load/draw or error; revoked before toBlob completion, with existing catch cleanup |+| Recording background URL | Survives background loading and recording; released on image error, recorder-constructor failure or recorder cleanup |+| Recording tracks/rAF | Constructor failure stops created tracks; recorder error/stop uses existing guarded cleanup to stop tracks and cancel the frame callback |+| Recording/toast timers | Preserve existing bounded callbacks and state checks; extraction adds no cancellation protocol or shared busy flag |++recordWebm retains duration/fps options, defaults, minimums, MIME selection,+geometry-driven scene and encoder flush timing. This table describes existing+paths; it does not add universal recovery from arbitrary browser API exceptions.++`export-browser.test.mjs` exercises native menu input, unavailable formats,+auto-open/themes, real semantic cards, clipboard call order/fallback, raster+failures/retry, synchronous serialization failure, real WebM decode and recorder+failure cleanup. It intercepts download and clipboard boundaries without changing+production serialization. `export-cleanup-browser.test.mjs` supplies five-mode+canonical SVG and real raster/theme coverage. Existing share-card and WebM smoke+checks retain their broader artifact contracts. Set ARCHIFY_CHROME for browser+checks; ARCHIFY_EXPORT_RUNTIME_EVIDENCE optionally saves runtime observations,+menu screenshots and a real recording. CI runs the browser suite without relying+on optional evidence capture. Compare the same final tests on a fixed baseline+and candidate; encoding bytes/timing are not a deterministic oracle for video.++## Focus / Semantic Explorer contract++The complete IIFE initializes once after Source Evidence and installBeacons(),+before Intent Trace and Guided Views. Reader/Chrome Layout, Camera, Finder, Route+and Lens keep their later positions. Required diagram SVG, Passport controls and+relationship list remain required DOM. Shared viewerText/viewerCount/viewerKindLabel+and hasDrawableGeometry stay in the template's classic-script scope.++The interface is thirteen Focus methods: set, setMany, clear, copyLink, reach,+clearReach, reachabilitySnapshot, inspectRelationship, inspectRelationshipById,+reposition, relationship, reachability and active. The same closure also installs+Archify.flowTokens.create/kind/path before Story can consume them. This shared+provider is part of Focus ownership, not a second initialization step.++- set writes neighborhood mode into its supplied options object and delegates to+ setMany. setMany clears Lens preview/selection and, unless preserveRoute is true,+ Route before filtering IDs. An empty/unknown selection can therefore return false+ after those side effects. Valid IDs are deduplicated in supplied order. Repeating+ the same ordered selection toggles through ordinary clear unless toggle is false.+- A single neighborhood matches incident edges and neighboring nodes. Multi-node+ or explicit selection mode matches only edges whose endpoints are both selected.+ Focus counts duplicate edge keys once while marking every matching fragment.+ hideChip, label, mode, updateUrl, urlKey and urlValue keep their existing defaults.+- clear removes Reach, Intent, relationship preview/pin and Focus markers;+ it hides Passport and resets its existing fields.+ It resets Camera unless preserveView, updates the URL unless updateUrl is false,+ and restores a previously single selected node only when restoreFocus is true.+ clearReach and clearRelationshipPreview have narrower effects. Repeated clear+ does not gain a no-op return or stronger cancellation guarantee.+- active returns null, a single ID or a copied array. relationship returns a fresh+ record or null; reachability returns copied node/edge arrays. Snapshot results+ are constructed from current authored nodes, edges and validated Reach state.+- Passport uses existing label/kind/detail/context/tag/brand/source metadata. The+ Source Evidence provider owns repository/node lookup and beacon installation;+ Focus owns displaying or hiding evidence and building the existing safe links.+ Relationship rows are grouped out/in/loop, retaining authored order within each+ group and deduplicating keys. Up/Down/Home/End clamp within the resulting rows.+- Relationship intent priority is pin, then focus, then hover. Clearing one intent+ may restore another. Pointer transitions within the same row/hit target do not+ reset intent; touch and non-fine-pointer hover retain their filters. Direct hover+ waits 90ms (0 with reduced motion), rechecking pointer, pin and owner state when+ the timer fires. Clearing preview cancels that timer; it does not always unpin.+- Direct hit targets are created once from drawable path/line/polyline fragments.+ Same-key compatible fragments share one record; conflicting identity or duplicate+ authored relationship IDs make records ineligible. Hit geometry is cloned, with+ original path/points and existing transform handling retained. Focus does not+ repair malformed geometry or derive connectivity from labels.+- Direct pointer exploration is blocked by embed, Guide, panning, ordinary active+ Focus, Story, Route picking/result, Lens and chapter preview under the original+ predicates. Pointer and keyboard paths retain their different guards. Direct+ target arrows wrap, Home/End choose endpoints, Enter/Space inspect or toggle, and+ pinned Escape clears with updateUrl:false. Global Escape/shortcuts stay outside.+- Pinning first clears the curated view with the existing options, focuses the+ relation source, previews the matching Passport row and marks its hit target.+ Camera reveal remains a call-time lookup with the original one-rAF retry if+ Camera is not initialized yet. No polling service or dependency capture is added.+- Reach traverses authored direction breadth-first, deduplicates edge keys and+ preserves the original traversal/edge order for cycles, parallel edges and loops.+ It requires one selected origin and at least one other reachable node; repeated+ direction toggles unless toggle:false. It clears curated view/relationship state,+ updates Export controls and optionally URL/Camera according to existing options.+- reachabilitySnapshot fails closed when selection, Reach mode/attributes, depths,+ live node multiplicity or edge identity disagree. Each edge key requires exactly+ one drawable fragment, though compatible shapeless fragments are allowed. Extra+ marked nodes/edges, multiple drawable fragments and inconsistent endpoints/IDs+ yield null. It does not sanitize or silently rederive an invalid live snapshot.+- flowTokens consumes existing shape geometry, edge classes and node kinds. Kind+ priority remains security, event, data, state, call. create produces a detached+ token with the existing path, duration/class options and null behavior. Story's+ carrier lifecycle and Motion ownership remain in their existing modules.+- Relationship pulse removes any previous pulse, clones existing shape geometry+ and installs at most one flow token, retaining overlay placement and animation+ end/cancel removal. Embed, hidden, paused Motion and reduced motion prevent new+ pulses. Visibility/reduced-motion callbacks remove pulse without universally+ clearing static selection, preview or pin. Motion observes shared attributes;+ Focus does not gain a new owner token or controller.+- Hash restoration prioritizes relation, then focus/reach; a view hash avoids the+ ordinary no-focus clear branch. Invalid relation and embed relation restore use+ existing clear behavior. Focus does not become the parser for Route/Lens/Story.+ No new handling of arbitrary malformed IDs or selector escaping is introduced.+- copyLink requires exactly one selected node, prefers an authored pinned relation+ URL, otherwise copies focus plus optional reach. It preserves the non-hash URL,+ clipboard/fallback results and 1600ms feedback. Older feedback callbacks still+ render the then-current copy action; no generation or cancellation policy is+ added. Fallback textarea cleanup and promise return values are unchanged.++| State or surface | Owner and dependencies |+| --- | --- |+| Selected IDs, hover/focus/pin/preview references, reachability, hit targets, direct timer, lens rAF | Focus closure; page lifetime, no destroy interface |+| data-focus-active/match/selected, node aria-pressed, Passport content/hidden/expanded/top | Focus writes/clears; Camera reveals/resets and Radar syncs through call-time lookups |+| data-reach-active/match/origin/depth and Passport Reach controls | Focus; Export consumes syncReachShare and reachabilitySnapshot |+| data-relationship-preview/direct/pin-active, preview source/target and row/hit ARIA | Focus; Lens/Route/Story/Intent/Guide state controls existing eligibility rules |+| Relationship hit/pulse overlays and flowTokens construction | Focus creates; canonical export removes transient clones through Export Cleanup |+| Source Evidence payload/repository links, camera transactions, other feature state | Their existing modules; Focus remains a caller, with original options and order |+| SVG/document capture, node/row/hit keyboard and pointer subscriptions, passive scroll, resize, visibility, media listeners | Original execution positions and capture/passive/once semantics retained |++Export triggers may move focus or cause normal input-state handoff before the clone+is made. Verify live state and clone state separately; do not assert that every+export leaves every focus-backed preview unchanged. Author geometry, stable IDs,+viewBox and static SVG output remain unchanged by this source extraction.++Browser checks exercise actual node/relationship inputs, pointer delay, pin priority,+Passport grouping, cyclic Reach and strict rejection, cold/hash URLs, copy feedback,+real pulse end/cancel, media preference transitions, actual SVG export, three widths+and dark/light screenshots. Explicit DOM/clipboard/visibility/pointerType fixtures+cover controlled edge cases and are not claims about OS permissions or devices.++## Guided Views / Story contract++Chapter and Trail scrolling use their own viewports. Trail centering measures DOM+rectangles rather than an ancestor-relative offset. A page-lifetime ResizeObserver+watches both scroll containers and recenters the active item only when its viewport+width changes; scrolling alone does not recenter it. Without ResizeObserver, direct+selection still centers the item. This is a follow-up behavior fix, not part of the+original byte-preserving extraction.++The complete IIFE initializes once after Focus/flowTokens and Intent Trace, before+Reader/Chrome Layout/Camera. Camera and Lens remain call-time lookups; the delayed+initial Story follow must still work before Camera exists. Payload parsing, initial+focus filtering, cold panel state, chapter index, listeners, synchronous hash+restoration and pending share playback's double rAF retain their original order.+Required panel, Trail, payload and direct diagram SVG nodes remain required.++With authored chapters the interface is `count` plus seventeen methods: `activate`,+`showAll`, `play`, `playCurrent`, `pause`, `beatLink`, `copyBeatLink`, `cancelHandoff`,+`settleHandoff`, `clearPreview`, `isPlaying`, `handoff`, `active`, `preview`, `delta`,+`beat` and `focus`. Empty chapters, including the JSON parse-error fallback, return+only `count: 0` and `active`. The fragment does not add missing methods or normalize+arbitrary invalid JSON types. Initial focus filtering removes unknown/repeated IDs+in authored order; it is not a new dynamic graph index or kind filter.++- Guided Views owns chapter/beat selection, Story steps, playing/scope/completion,+ elapsed/dwell/timer and separate generations, handoff objects and promises,+ pointer/focus preview intents, Motion tokens, autoplay pending and copy feedback.+ Returned focus/delta/beat arrays are copies. Focus owns selected graph semantics+ and the shared flowTokens implementation; Camera owns reveal transactions.+- Activation preserves Focus's setMany options and the existing order of pause,+ preview cleanup, old handoff cancellation, Trail rendering, new handoff, controls+ and URL updates. `showAll`, `pause`, `clearPreview`, `cancelHandoff` and+ `settleHandoff` have different effects. Existing options and return values remain;+ no common reset or stronger panel exclusion rule is added.+- The chapter rail uses roving tabindex, clamped Left/Right, Home/End and native+ button activation. Focus can preview without activating. Trail beat buttons use+ click/Enter/Space and focusin pauses playback; they do not gain Route Journey's+ arrow navigation. SVG capture listeners release a curated chapter before normal+ exploration continues. The captured P/bracket/Escape keys retain editor/Guide+ guards and propagation differences; the template's global shortcuts stay put.+- Delta uses authored stable-ID intersections and order. Handoff anchors prefer+ the outgoing beat when shared, then search the old chapter backwards. No labels+ or geometry infer relationships. Pointer/focus previews are independent intents;+ the newest valid intent wins and clearing one may reveal the other. Hover/touch+ and relatedTarget filters remain. Setting intent can pause playback before+ checking preview eligibility. Presentation cleanup is distinct from intent reset.+- Preview blocking still depends on hidden/playing/handoff/embed/print and the+ existing Route/Lens/Intent/relationship/Focus attributes. MutationObserver and+ Motion preemption keep their original callbacks; release is not a universal+ promise that no other owner or remaining intent exists.+- Handoff retains first/same chapter and static fallbacks, a 110ms anchor hold,+ 420ms Camera transaction, holding/no-anchor/settling state, receipt, role/anchor+ overlays and temporarily disabled beat/copy controls. Settle commits the target;+ cancel does not force target commit. Old hold/Camera/afterHandoff callbacks retain+ their different identity/playing/generation checks, not a common cancellation API.+- Story follow frames previous/current/next nodes with padding 64, maxScale 1.65+ and duration 320. Initial deferred rAF, reason/manual/linked/instant options and+ settled/interrupted receipts remain. Camera manual takeover and Motion/Guide+ callers keep their existing pause/settle responsibilities.+- Story steps follow authored chapter order, classifying adjacent-node relations+ as start/forward/reverse/multiple/group from direct edges. A group is not a+ computed path. Edge-key/fallback-key deduplication keeps DOM order and replaces+ an initially shapeless fragment with a later shape-bearing one. Shape presence+ is not Route's exportSnapshot drawable-validity check.+- Overlay shallow clones preserve path/line/polyline geometry and transform, the+ exact attribute removal list, insertion point, and node/edge step assignments.+ No shapes means no Story overlay. Beat states are past/active/next/pending, with+ original caption, note, ARIA, progress and next-node updates. Shared geometry is+ not recomputed or reversed for the story's reading order.+- A pulse requires one forward/reverse relationship and the existing motion+ conditions. Carrier creation uses flowTokens with 0.78s and the original placement.+ Pulse cleanup uses animationend plus its generation; there is no Route-style+ fallback timer. Claim/release/preempt and release:false stay intact. Governor+ also derives chapter/story ownership from SVG state, independently of tokens.+- Each beat dwells for max(1100, 3200 / max(1, total)) milliseconds. Pause normally+ retains elapsed time; resume uses the remainder, fresh beats reset it. Date.now,+ timer clearing and generation checks remain. Whole-story play can cross chapters+ after handoff; playCurrent has chapter scope and does not advance to another+ chapter. Repeated starts and replay retain their own existing effects.+- Automatic playback, pulse motion and handoff eligibility are different checks.+ Non-trace does not prohibit all Story playback. `play=1` marks pending single+ chapter playback, attempted after initial double rAF or visibility restoration.+ Consumed playback does not restart merely on visible, but pending playback can+ start there. Linked static moments and reduced-motion share outcomes keep their+ original beat/overview decisions and pending/playing/complete/interrupted/pinned+ presentation. Embed is not a blanket public-method guard.+- Chapter updates replace hash with view while preserving pathname/query. Moment+ links encode view/beat, remove play from the returned URL and leave the page URL+ alone. Initial/hashchange restoration, handoff deferral and latest-intent checks+ remain; unknown view/beat, empty hash and Focus/Relation/Route hashes retain their+ different existing effects. Manual beat selection does not write every step URL.+- Copy pauses as before, returns false without a moment, and uses clipboard with+ textarea/execCommand fallback. The 1600ms feedback timer is reset by existing+ cleanup, but a still-pending copy promise can complete after the chapter clears.+ No promise cancellation or shared Route copy helper is introduced.+- Guided Views produces data-story-*/data-chapter-* SVG/node/edge state, panel+ data-active-view/data-playing/data-autoplay, chapter-button state, Trail/caption/+ progress styles and Share Cue HTML/ARIA. CSS owns Shelf/Director layout, themes,+ responsive scrolling, Still/reduced-motion, print and embed rendering. Export+ owns cleanup of Story/carrier/handoff/preview/follow clones. Export first focuses+ its trigger, clearing focus-backed chapter preview; pointer-backed intent can+ remain. This input handoff precedes clone cleanup. Serialization is+ distinct from later download clicks and their global input effects.++`guided-views-browser.test.mjs` supplements the Story/Chapter source and SVG checks+with real navigation, timing, handoff, preview, links and exports. Graph, clock,+Camera receipt, visibility and clipboard fixtures expose specific edge cases;+real Camera, input, animation and complete playback are also exercised. Fixtures+are not evidence for OS clipboard permission, background throttling or arbitrary+screen/content collision freedom.++## Route Probe contract++The complete IIFE initializes once after Finder and before Semantic Lens, in the+existing classic-script scope. It registers listeners then synchronously restores+the initial hash. Later hashchange restoration runs in rAF. Required inputs are+the document root, diagram container/direct SVG, Route/Journey controls, shared+`viewerText`, `viewerCount` and `hasDrawableGeometry`. The latter stays shared+with Focus and Export; Lens remains a runtime lookup because it initializes later.++The nineteen methods remain `begin`, `choose`, `clear`, `toggle`, `escape`,+`copyLink`, `playJourney`, `pauseJourney`, `showOverview`, `selectJourneyIndex`,+`syncMotion`, `isJourneyPlaying`, `finderContext`, `finderOpening`, `finderClosed`,+`openFinder`, `exportSnapshot`, `active` and `result`. There is no mount/unmount API.++- Route owns mode, endpoint IDs, path node arrays and exact edge DOM references,+ Journey index/playing/complete, timer/generation/elapsed time, Motion token,+ overlays and its panel/listener state. Mode is idle/source/target/result;+ panel error is presentation state and can coexist with target mode. `active`+ returns mode or null. `result` returns copied nodes and scalar state only in+ result mode; it does not certify an exportable snapshot.+- Nodes and edges are read dynamically. The node map keeps the last element per+ ID; it does not use Lens's kind filter or first-ID rule. Outgoing relationships+ require existing endpoints and ignore self-loops. BFS follows directed DOM edge+ order, keeping the first reached path and exact edge references. There is no+ grouping by edge key, weighted search, new sort order or persistent graph index.+- Source selection marks reachable targets, including the existing no-outgoing+ outcome. In target mode, same-node/unreachable choices return false and render+ error while retaining target mode. Unknown IDs and choices outside picker mode+ retain their existing early returns. Finder's allowed list does not constrain+ every public choose call. Results retain full path/hops and begin in overview.+- `begin` rejects embed, clears Lens preview/active selection, captures an explicit+ source or single Focus node, clears old Route, then clears Intent/Guided/Focus+ and closes Finder/Radar in the existing order. Optional checks and options stay+ unchanged. Multi-Focus and invalid sources are not normalized into new behavior.+- `clear` returns undefined, closes only the applicable route Finder context,+ invalidates Journey work and removes Route state, overlays and docking, then+ updates controls/Export. Camera resets only when previously active and without+ `preserveView:true`; `updateUrl:false` retains URL. Only `restoreFocus:true`+ requests trigger focus. Repeated clear can still update controls and URL.+- Pause retains path and position; overview retains path but clears Journey+ position; clear removes the path. Escape returns paused, overview, then cleared+ across those states. Focus requests retain their original targets even if a+ browser refuses focus on a disabled control. Finder owns its search panel;+ Route supplies allowed IDs/badges, finder-open state and close/docking callbacks.+- Journey marks past/current/future nodes and the exact incoming edge. Position+ zero has no incoming pulse. Manual stepping stops playback and resets completion;+ arrows clamp at endpoints. Native chip focus pauses, while Enter/Space chooses+ the position. Camera reveal keeps the existing neighbor slice and parameters.+- Playback requires result, multiple nodes, non-embed, visible document and a+ capable, unpaused Motion Governor. Dwell is 1100ms per position. Pause normally+ retains elapsed time; resume uses the remainder, new positions use a fresh dwell.+ Date.now, generation invalidation, timer order and synchronous handoff resets+ stay intact. Final dwell completes without looping; replay restarts at zero.+ Returning to visible/Live does not automatically restart playback.+- Journey pulses actively claim/release a Motion token, alongside Governor's+ attribute-derived ownership. A released token does not imply an empty global+ owner. Owner callbacks, animationend and the 860ms fallback retain their order+ and isConnected guards. Clear invalidates playback but does not introduce a+ universal cancellation mechanism for every delayed callback.+- Overlay clones preserve path/line/polyline geometry, transform, removal lists,+ pathLength=1 and insertion position. Overview can insert an empty overlay when+ selected edges have no cloneable shapes; Journey rejects that empty pulse.+ No common overlay factory or geometry recomputation is introduced.+- `exportSnapshot` is stricter than interaction: it requires a consistent result,+ unique extant path nodes, attached edges, nonempty distinct keys and consistent+ from/to/edge-id across each key's fragments. Exactly one fragment must be+ drawable according to the shared geometry check, and it must be the selected+ edge. Returned data contain no DOM references. Export consumes the snapshot;+ it owns Share Card rendering, rejection receipts and clone cleanup.+- URL updates replace the hash with encoded source~target and preserve query.+ Journey progress is never serialized. Missing/empty route clears active state;+ malformed pairs/unknown endpoints return early. Valid but same/unreachable+ endpoints retain begin/choose error state and the original hash. Existing+ encoding, asynchronous hashchange order and embed guards are unchanged.+- Copy returns a Promise, preferring clipboard and falling back to temporary+ textarea/execCommand. Non-result resolves false. Text/ARIA feedback resets after+ 1600ms even when subsequent cleanup has occurred; no debounce/cancellation is+ added. SVG capture listeners intercept picker click/Enter/Space with+ stopImmediatePropagation. With data-just-panned they let events through; later+ Focus handlers can still consume a key and clear Route. Global R/Slash/Escape+ and other modules' callers stay outside this source.+- Docking compares top/bottom overlap with route nodes or the start node, nav+ weight 4 and an out-of-bounds penalty; ties choose top. Hidden panels remove+ dock, zero-size panels return without replacing it. Scroll measures directly;+ requests retain rAF plus 120/560ms rechecks, without coalescing or cancellation.+ This is not Lens's left/right or 720px eligibility algorithm.+- Route produces node/edge data-route-* attributes, step styles and panel/control+ DOM/ARIA. Existing CSS owns themes, flow, Still/reduced motion, print/embed and+ responsive rendering. Focus/Lens clear Route; Camera/Motion/Guide can pause it.+ These dependencies remain explicit runtime collaboration after the source split.++`route-probe-browser.test.mjs` complements static Route/Journey/Share Card tests+with actual input, playback, handoffs, snapshots, themes and SVG export. Graph,+clock, hidden-page, geometry and clipboard fixtures isolate specific boundaries;+they do not certify hardware input, OS clipboard permission or all-screen collision+freedom. Serialization is distinguished from later download/global-click effects.++## Semantic Lens contract++The complete IIFE initializes once after Route Probe and before Guide, in the+existing classic-script scope. Legend decoration, listeners, `renderKinds()` and+`syncFromHash()` retain their order. The ten methods remain `open`, `close`,+`toggle`, `clear`, `clearPreview`, `select`, `copyLink`, `isOpen`, `active`, and+`kinds`. Required inputs are the document root, diagram container/direct SVG,+Lens controls and shared translation helpers; Legend Bridge is optional.++- Selection, legend preview and panel visibility are separate states. Lens owns+ selected kinds, legend entry/input references, active preview, opener, runtime+ decoration, flow overlay and page-lifetime listeners/callbacks. `active()`+ returns a copied array or null; `isOpen()` reads panel visibility; `kinds()`+ dynamically collects counts. There is no mount/unmount API or persistent index.+- Collection requires node ID and kind, keeps the first element per nonempty ID,+ and treats empty kind as neutral. Sort is count descending then translated+ label. Relationships group by edge key, otherwise from/to/label. Single-kind+ selection marks touching relationships and peers; two kinds include only+ direct cross-kind relationships, with direction relative to selection order.+- `select` clears legend preview before validation. Unknown or third kinds return+ false; existing kinds toggle off. Removing the last kind returns false without+ the Camera reset performed by explicit `clear`. Adding the first kind clears+ Focus, Route, Guided Views and Intent in that order, with existing options.+ These real callers can affect Camera; the second kind does not repeat prepare.+- `close` returns false and hides only the panel, retaining selection, hash and+ flow. It normally restores the current opener's focus. `clear` returns false,+ clears selection/Lens SVG state and docking, updates URL unless disabled,+ resets Camera unless `preserveView:true`, and closes only for `closePanel:true`.+ It does not itself clear legend preview. `clearPreview` returns undefined,+ clears preview attributes but retains hovered/focused references, selection,+ URL and panel state. A false return is not a guarantee of no side effects.+- `open` rejects embed early, records the opener, closes Export/Finder/Radar/Guide+ as currently implemented, renders and opens the panel, then docks/focuses in+ rAF. It does not introduce a universal preview cleanup. Repeated/rapid calls+ retain pending-frame ordering. Guide is initialized later and stays a runtime+ lookup. Other module callers and the global L/Escape shortcuts stay in the shell.+- Legend decoration is initialization-only. Zero-count entries get hit/badge+ decoration but no button role; positive entries use roving tabindex and count+ ARIA. One or two available entries use group, three or more use toolbar.+ No bridge or embed skips decoration. Fonts-ready and resize remeasure authored+ children, excluding runtime decoration, with the existing getBBox fallback.+- Fine-pointer non-touch hover and native focus drive preview; focused entries+ win during sync and relatedTarget guards internal transitions. Media query is+ captured at initialization. Selection, open panel, Presentation, Focus, Intent,+ Route, Story and relationship preview gate new previews. The same active entry+ can return early before checking blockers; no new observer guarantees instant+ cleanup when another attribute changes. Preview writes node/edge match, selected+ and peer attributes without committing selection, URL or flow overlay.+- Legend arrows wrap; Home/End and Enter/Space preserve keyboard behavior and+ opener restoration. Activation still opens after a rejected third selection.+ Panel buttons rerender during click, so outside-click detection must retain+ composedPath as well as contains and launcher exemptions. The dialog remains+ non-modal; no focus trap or panel coordinator is introduced.+- Flow count measures relationship groups. Zero/embed produces no overlay;+ more than 24 sets quiet density without dropping matches/counts. Returning to+ 24 restores flow. Only each group's first member supplies transform/shapes;+ unlike Intent, later members are not cloned. Shallow path/line/polyline clones+ preserve authored geometry, the removal list, pathLength=1, direction and+ step-times-0.08s delay. No shapes can mean an active selection without overlay.+- URL updates replace the hash, preserving pathname/query. Hash restoration+ filters unknown/duplicate kinds and keeps the first two, without opening or+ normalizing the URL. Missing/empty lens clears an existing selection while+ preserving view and URL; a nonempty all-invalid value retains selection.+ Copy prefers clipboard then textarea/execCommand fallback, cleans the field+ and restores feedback after 1600ms. It has no cancellation/debounce contract.+- Docking removes the side attribute first. Hidden, width <=720 and zero-size+ panels return right without writing it. Desktop compares selected-node overlap+ plus legend/nav overlap weighted 1000, with 16px margins and ties going right.+ Open/select and selected-open resize retain their triggers; no Camera observer+ or guarantee of collision-free layout at every size is added.+- Lens writes `data-lens-*`, `data-legend-preview-*`, legend decoration and panel+ DOM/ARIA. Existing CSS owns themes, opacity, flow directions, reduced/Still,+ print/embed and responsive rendering. Motion Governor observes semantic state+ to derive owner; Lens does not claim/release it. Export Cleanup strips clone+ state and decoration; it remains in its own module. Export serialization and+ subsequent download/global-click effects are distinct observations.++`semantic-lens-browser.test.mjs` covers five-mode initialization, trusted input,+real capability handoffs, cleanup, URL/copy, themes, motion and SVG export.+Explicit DOM/media/geometry/clipboard fixtures isolate boundary inputs; they do+not certify touch hardware, OS clipboard permission, screen readers or arbitrary+layout collision freedom. Static Lens/legend/flow checks remain useful alongside+browser checks. This split narrows maintenance scope while preserving runtime+collaboration and single-file delivery.++## Intent Trace contract++The complete IIFE initializes once after Focus and before Guided Views, with+the existing classic-script scope and listener order. Its interface remains+`show(id, options)`, `clear(options)` and `active()`. It requires the diagram's+direct SVG child, `#intent-trace-status`, document root and shared `viewerText`.+Focus/Route active queries are runtime lookups; Route initializes later.++- Intent owns active ID, hovered/focused node references, the entry timer,+ preview overlay, Intent node/edge attributes and status text. Its listeners+ last for the page lifetime; there is no mount/unmount API or persistent index.+- `show` first rejects empty IDs or blocked requests, silently clearing the old+ preview and returning false. An already-active ID returns true without+ rebuilding, announcing or cancelling a pending entry timer. Other IDs clear+ the old preview before lookup, including unknown IDs, which return false.+ Isolated nodes can be active without an inserted overlay.+- `clear` returns undefined, cancels the entry timer, clears active ID, removes+ overlay/Intent attributes, and normally clears status. `announce:false`+ retains status. It does not erase hovered/focused references, so later input+ can reuse them. Only `show` with `announce === true` writes status; repeated,+ rejected or silent requests can retain previous text.+- Fine-pointer non-touch pointerover schedules entry after 90ms, or an+ asynchronous 0ms under system reduced motion. Internal pointer transitions+ are ignored through relatedTarget. `matchMedia` absence retains the current+ fine-pointer fallback. User Still mode does not change this delay rule.+- The entry callback checks the hovered reference before showing. Native+ focusin records focus and shows immediately; pointerout/focusout update their+ reference and run sync, which prefers focused over hovered. This local+ preference does not extend to every scheduled callback. The existing+ duplicate-show and retained-reference behavior is not a global priority or+ suppression mechanism.+- Non-node container pointerdown and window blur silently clear. Global Escape+ remains in the template with its existing capability priority. Blocking is+ evaluated by show: embed, Guide, panning, Lens, Story, relationship preview,+ and active Focus/Route. Changing a blocking attribute alone does not install+ a new observer or promise immediate cleanup; callers retain their effects.+- Every actual build reads semantic nodes and directed relationships from the+ SVG. Counts deduplicate by edge key, or from/to/label fallback; DOM edge+ members are still all marked/cloned. Self-loops are counted once as loops.+ Only path/line/polyline shapes are shallow-cloned, using the existing attribute+ removal list, wrapper transform and insertion position. Author geometry is+ preserved; `pathLength=1` normalizes animation, not coordinates.+- Incoming/outgoing labels describe direction relative to the previewed node.+ Both animate along authored source-to-target geometry; incoming is not+ reversed. The single 1.15s CSS animation does not clear the preview on end.+ Reduced motion/Still retain the existing static preview styles.+- Intent writes `data-intent-trace-active`, node/edge match and node-selected+ attributes and the aria-hidden overlay. Existing CSS owns opacity, direction,+ theme/preset and motion rendering; the overlay remains pointer-transparent.+ Motion Governor observes the active attribute to derive ownership; Intent+ never claims or releases an owner. Export Cleanup strips cloned Intent state,+ while Intent clears the live diagram. Neither dependency moves into this file.++`intent-trace.test.mjs` retains generated-output checks. The browser test covers+five-mode initialization, real pointer/native focus handoffs, bounded timer+cleanup, isolated timer and SVG fixtures, blockers and actual callers, real CSS+completion, Motion ownership, reduced motion, themes and SVG export. Fixtures+do not claim touchscreen hardware, background throttling or screen-reader+verification. The extraction narrows maintenance scope without redesigning the+existing runtime collaboration.++## Node Finder contract++The complete IIFE initializes once after Presentation and before Route Probe.+It uses the existing classic-script scope and renders the initial list at that+position. Its interface is `open`, `close`, `toggle`, `select`, `isOpen`,+`context`, and the numeric `count` property. There is no mount/unmount API.++- Finder owns its initial semantic-node index, visible result list, context,+ panel rendering and page-lifetime listeners. `count` is the initial index+ size, not the current result count. Changing the SVG later does not reindex.+- Initialization requires the diagram SVG, Finder controls, Source Evidence+ and the shared `viewerText`, `viewerCount`, and `viewerKindLabel` functions.+ Source Evidence supplies search metadata; Finder does not verify repositories.+ Route Probe and Semantic Lens initialize later, so their references remain+ runtime `Archify.*` lookups with the existing availability checks.+- Search preserves authored DOM order and the existing ID, label, type, text,+ metadata, brand and source-reference matching. Queries are trimmed and+ lowercased for substring matching. Connections are counted by distinct+ directed from/to pairs, not edge keys or distinct neighbors.+- Context comes from explicit `options.context`, otherwise the current Route+ Probe picker, otherwise focus defaults. Requested fields shallowly override+ defaults. `allowedIds: null` leaves all items available; `[]` leaves none.+ This filters results only: public `select(id)` still searches the whole index.+- Opening rejects embed before other work, clears Lens preview, closes Export+ and Lens as currently implemented, resolves context, updates controls and+ clears the query, then schedules input focus with rAF. Reopening repeats this+ work. It does not establish a global exclusive-panel coordinator.+- Closing hides the panel, clears the input and updates `aria-expanded`, but+ retains context and rendered results until the next open/render. Ordinary+ close returns focus to the trigger unless `restoreFocus:false`; route close+ delegates focus and docking to Route Probe. Repeated close and pending input+ focus retain their current ordering; there is no rAF cancellation mechanism.+- Ordinary selection runs Guided Views `showAll({clearFocus:false,+ updateUrl:false})`, Camera `reset({automatic:true})`, Focus+ `set(id,{toggle:false})`, then Camera `reveal([id],{includeNeighbors:true,+ reason:'finder'})`, preserving optional checks and order. It closes without+ restoring trigger focus and focuses the node with the existing preventScroll+ fallback. An unknown ID returns false before these actions.+- Route-source/target selection delegates to Route Probe `choose`. Missing or+ rejected choices return false without the success path. A resulting target+ state requests Camera reveal with `reason:'route-pick'`; then Finder closes+ and focuses the node. This branch does not directly call ordinary Focus or+ Guided View selection; global event handlers retain their own effects.+- Finder writes panel `hidden`/`data-context`, trigger `aria-expanded`, title,+ input placeholder, list ARIA, result children, empty-state visibility and+ status text. Route Probe owns its `data-finder-open` attribute through+ `finderOpening`/`finderClosed`. Existing HTML/CSS remain in the template.+- Input ArrowDown enters results and Enter selects the first visible result;+ result arrows wrap and Home/End move to the endpoints. Escape prevents default+ and stops propagation before closing. Outside clicks close without restoring+ focus, except the existing `[data-node-finder-trigger]` exemption. Global `/`+ handling, Guide and Route callers remain outside Finder. The dialog stays+ non-modal; no focus trap or keyboard adapter is introduced.++`finder.test.mjs` retains generated-output checks; `finder-browser.test.mjs`+exercises five-mode initialization, trusted keyboard/mouse input, real Route+source/target collaboration, retained context, panel cleanup, themes, constrained+layout, reduced motion and SVG export. Its metadata fixture isolates search+inputs; it does not claim repository verification or brand-rendering coverage.+The source split narrows maintenance scope while preserving runtime dependencies.++## Reader contract++- The IIFE initializes once, after the page DOM and shared+ `Archify.waitForStableLayout` exist, before `viewerChromeLayout` and `view`.+ It captures `.container`, `.diagram-container` and its direct child SVG,+ optional header/chapter/card elements, and the initial viewBox ratio.+- The public Interface remains `measure`, `schedule`, `whenStable`, `active`,+ and `receipt`. Viewer Chrome Layout calls `schedule` after changing the+ navigation reserve and `whenStable` while probing layout. The browser+ visual checker also uses `window.Archify.readerLayout.whenStable`.+- Reader owns the outer width (`html`'s `--archify-reader-width`) and temporary+ `data-reader-layout` / `data-reader-overflow` attributes. Ineligible measures+ clear them and reset the recorded width. CSS consumes the width on `.container`.+ Reader never writes canonical SVG geometry, viewBox or semantic IDs.+- Initial wide-diagram classification sets `data-wide-diagram` on the diagram+ container and `data-diagram-shape` on `html`. These survive eligibility changes;+ CSS and camera/radar behavior still depend on the wide-diagram flag on narrow+ screens. This is not live reclassification after replacing the diagram.+- Reader owns its measure/overflow animation-frame handles and the load/resize,+ font-ready, ResizeObserver and MutationObserver subscriptions. They last for+ the page lifetime. `schedule` coalesces requests; deferred overflow settling+ rechecks eligibility. Leaving adaptive layout clears its state without+ unmounting the module or clearing another module's state.+- Width eligibility, overflow fallback and optional-observer behavior are+ unchanged. Shared `waitForStableLayout` waits for fonts, pending work and+ consecutive stable dimensions; its default 240-frame sampling limit starts+ after font readiness. It is not a wall-clock timeout for stalled fonts or+ background pages. Keep this helper shared with Viewer Chrome Layout.++## Viewer Chrome Layout contract++The IIFE initializes once after the shared waiter and Reader Layout, before+Camera (`Archify.view`). Its interface remains `measure`, `schedule`, `reprobe`,+`whenStable`, `stageRect`, `active`, and `receipt`. `measure` may return null while+probing or arranging follow-up work; `receipt` may measure if no receipt exists.++- `schedule` coalesces a measurement into one animation frame. Camera calls it+ after applying transforms. It does not request a fresh zero-reserve baseline.+- `reprobe` temporarily removes the rail, waits for Reader's `whenStable` and+ schedules measurement again. Concurrent probes reuse the pending Promise.+ A non-baseline camera or an empty baseline only schedules and resolves false;+ a completed probe resolves true. Reader rejection is caught as before.+- Writing a changed reserve calls Reader's `schedule`. Chrome's `whenStable`+ uses the shared waiter, including font readiness and the pending frame/probe+ checks. It has the same sampling limits described in the Reader contract.++| Owned state | Meaning and lifetime |+| --- | --- |+| Container `--archify-nav-reserve`; container and html `data-nav-stage-rail` | Current visible rail. Clearing removes these inline values/attributes. |+| Reserve and rail latch | Keep the clearance decision stable while Reader incorporates the extra space. |+| Baseline gap/intersection and restorable reserve | Preserve the unzoomed layout reference. Temporary ineligibility while zoomed can retain the recovery baseline even though the visible rail is zero. |+| Probe fallback and pending Promise | If Camera changes during a probe, retain the prior reserve for recovery. They settle through the existing Reader Promise chain. |+| Measurement frame, follow-up frame, receipt, event/observer subscriptions | Page lifetime. There is no unmount/destroy; leaving eligibility is a layout state change, not module disposal. |++Eligibility requires the container, direct-child SVG, visible navigation, width+above 720px, no embed mode and no print media. This differs from Reader's 1024px+threshold. Presentation is eligible when its navigation is visible. A hidden or+absent legend does not disable protection of the SVG stage. `stageRect` removes+camera scale/translation from measured geometry; it never rewrites SVG geometry.++Resize, load, print, font readiness and the existing observers retain their+original roles. ResizeObserver watches navigation/SVG/legend size;+MutationObserver watches legend content and the root embed/presentation/preset/+theme attributes. Camera Reset preserves the established rail; viewport, mode+and content changes are responsible for baseline reprobes. Optional observer+fallbacks remain event-driven, without a new polling mechanism.++CSS stays in the shell: reserve affects container and floating-panel spacing,+while root rail state also changes header/chapter/card spacing. Reader reads the+resulting layout rather than importing Chrome's private state. Keeping this+contract beside the source localizes navigation-clearance maintenance; the+Reader/Chrome feedback and Camera/CSS dependencies still exist.++## Camera contract++`viewer-camera.js` initializes `Archify.view` once, after Reader and Chrome+Layout, before Radar. It captures the diagram container, its first SVG, required+zoom/reset controls and the initial viewBox. The existing `apply()`,+`pinControls()` and next-frame semantic sync stay in that order. Focus and Guided+Views already exist; checks for later modules and deferred callers remain needed.+The shared `viewerText` helper stays in classic-script scope.++The interface remains `zoomIn`, `zoomOut`, `reset`, `reveal`, `centerAt`,+`logicalViewport`, `sync`, and `state`. `state()` returns a copy of scale/x/y/mode;+the modes are overview, manual and semantic. Zoom and Reset return undefined;+`centerAt` returns a boolean, `logicalViewport` can return null, and `sync`+delegates to `reveal` or returns false. Manual Reset interrupts callers, whereas+`reset({ automatic: true })` stops camera motion without the manual takeover path.++`reveal` returns a transaction or false, with branch-specific side effects.+Desktop empty/unknown targets can return before changing the camera. At widths+up to 720px it first stops motion and applies a semantic scale-1 state; a wide+diagram can then return false for missing targets. A non-wide mobile diagram+returns an immediately completed transaction even without targets. Do not turn+these branches into a uniform Promise or assume false means no state change.++Transactions expose `id`, `state`, `target`, `settled`, `frame`, `timer`,+`finished`, `resolve` and `cancel(reason, commitTarget)`. `finished` resolves to+`{ id, state }` through the existing completion path. Replacement, manual+takeover, Reset and explicit cancellation preserve their distinct reasons;+repeated cancellation returns false. Committing a target during cancellation+differs from leaving the current state. Object/settled checks and cancellation+of frames/timers prevent superseded camera work from advancing; callers retain+their own stale-result checks. These fields are documented compatibility facts,+not an invitation for callers to manage the private scheduler.++Desktop transactions use animation frames. Wide mobile diagrams use contained+scrolling, the existing 460ms completion timer and automatic-scroll guard;+completion does not certify that native smooth scrolling has ended. The instant,+reduced-motion and call-time hidden-page branches keep their existing outcomes.+Camera does not subscribe to every later visibility/media change: Guided Views,+Motion Governor and other callers retain their own responsibilities.++| State / dependency | Ownership and coordination |+| --- | --- |+| Scale/x/y/mode, drag, transaction generation/object, camera frame/timer, clip/resize frames, automatic-scroll guard | Camera owns its page-lifetime state and pointer/scroll/resize/hashchange subscriptions. There is no destroy method. |+| SVG `transform`, `clip-path`, `data-view-scale` | Camera applies runtime transforms and clipping without rewriting authored geometry, viewBox or semantic IDs. Export cleanup removes these from its clone. |+| Container detail/camera attributes, `is-pannable`, camera movement/transaction flags, `data-just-panned`, `--archify-scroll-x` | Camera updates controls, drag suppression and mobile control positioning. `is-panning` is also used by Radar surface dragging; it is not exclusively owned by Camera. |+| Zoom/Reset labels, disabled state, detail attributes, title and ARIA text | Camera renders controls through shared translation helpers; associated CSS stays in the shell. |+| Reader width/wide-diagram classification; Chrome navigation reserve | Owned by the layout modules. Camera consumes geometry and classification; `apply()` schedules Chrome and synchronizes Radar. |+| Focus / Guided Views / Route | Finishing transactions repositions Focus. Manual takeover cancels guided handoffs and pauses Story and Route Journey, preserving Route elapsed time as before. Semantic sync prioritizes Guided Views over Focus. |++Focus, Guided Views/Story, Finder, Route and Radar reveal semantic targets;+Radar also consumes `logicalViewport` and calls `centerAt`. Presentation resets+and schedules semantic sync. Guide and keyboard shortcuts invoke navigation+commands. Camera samples rendered transforms when manual input takes over,+rather than treating the intended target as the current painted position.++Transaction completion, rendered transform/clip convergence and Reader/Chrome+layout stability are different observations. `finished` is not a page-wide+stability promise. CSS transitions and the clip sampler remain coordinated with+the existing layout feedback. Extraction localizes camera maintenance without+removing these runtime dependencies.++## Semantic Radar contract++`semantic-radar.js` initializes `Archify.radar` once after Camera and before+Presentation. It captures the diagram container and direct-child SVG, initial+viewBox, map panel/surface/controls, navigation and optional Passport. It creates+one runtime map SVG outside the canonical diagram and schedules the initial+node build. Reopening rebuilds node rectangles without appending another map SVG.+The shared `viewerText` helper and the existing HTML/CSS stay in the shell.++The interface remains `open`, `close`, `toggle`, `sync`, `focus`, `isOpen`, and+`count`. `isOpen()` reports requested intent, not panel visibility: unavailable+space can leave intent true while the panel is hidden and aria-expanded is false.+`open()` returns true even in that state; `close(options)` returns false and+optionally restores focus to the trigger. `toggle()` switches intent without+requesting surface focus. `sync()` immediately retries a requested hidden panel;+otherwise it coalesces work into one animation frame. It is not a stability Promise.++`focus(id)` returns whether the main node was found and actions were issued, not+whether navigation finished. It preserves Guided Views expansion, Focus selection,+Camera reveal, delayed page scrolling and main-node focus. `count()` reflects the+last build; it may be zero before the initial frame or with invalid geometry.+Failed getBBox calls and non-positive boxes are skipped. Required DOM and input+assumptions are unchanged.++| State / dependency | Ownership and coordination |+| --- | --- |+| Open intent, panel hidden, trigger ARIA/labels/title and space feedback | Radar owns them. A hidden requested panel can recover on retry or reflow. Close clears intent and retries. |+| Manual position and last placement; dock/side/compact/placement attributes; `--archify-radar-left/right/top` | Radar owns placement. Close clears current docking styles but retains position memory. Reopening or resizing can constrain it to current geometry. |+| Panel drag and viewport drag | Titlebar input moves the panel; surface input calls Camera. Pointer matching, capture/release and cancellation retain their separate rules. `is-panning` is shared with Camera. |+| Passport `data-radar-yielded` and saved `aria-hidden` | During compact expansion Radar can yield Passport space. Restoration reinstates the exact original attribute value, or removes it if originally absent. |+| Map nodes, viewport rectangle, activity markers and status | Derived from main-node bounds, Camera logicalViewport, Focus and Story state. Authored SVG geometry, viewBox and semantic IDs are not rewritten. |+| Sync frame, space retry and resize/scroll/ResizeObserver subscriptions | Page lifetime; no destroy method. Hidden-panel-only observer notifications are ignored to avoid a retry loop. |++Placement retains normal, compact and unavailable fallbacks. Navigation, Passport+and legend are hard blockers; active nodes are soft blockers. Manual position+priority, candidate scoring, clamping, gap and rounding remain private Radar+implementation. Cancelling titlebar drag restores the previous position intent+and recomputes placement in the current layout; it need not restore identical+pixels after geometry changes. Capture-phase Escape cancels titlebar dragging+before the global close shortcut. Surface pointercancel ends its drag without+restoring the previous camera state.++Compact expansion may hide Passport temporarily. Failed expansion, returning to+compact, unavailable space and closing restore it through their existing paths.+Space retry permits four 60ms attempts per round; success and external reflow+can reset the count. Close clears that timer and both drag records, hides the+panel and removes the shared panning class. It does not cancel the already queued+sync frame (which checks hidden), the untracked delayed node-scroll callback, or+universally remove every drag attribute. In particular, `data-dragging` is removed+by the surface drag-end handler, not by the close/reset-docking path.++Camera and Focus notify Radar to sync. Radar consumes Camera logicalViewport and+calls centerAt/reveal; opening clears Semantic Lens preview and closes that panel+as before. Route, Semantic Lens, Guide and global keyboard handlers keep their+existing mutual-exclusion and focus rules. Reader's wide-diagram classification+and Chrome's navigation reserve affect measured placement without transferring+ownership. Embed/print and narrow-screen presentation retain their existing CSS+and caller rules, rather than a new universal Radar eligibility gate. Export+continues cloning only the canonical diagram, excluding the runtime map SVG.++## Motion Governor contract++`motion-governor.js` initializes `Archify.motionGovernor` once after Export,+before Source Evidence and Focus. It captures the initial trace capability,+main SVG, controls and reduced-motion query. Guided Views and Route initialize+later; their existence checks remain necessary. The final `syncVisibility()`,+`publishOwner()`, `render()` calls keep their original order. CSS, controls,+translation helpers and authored animation metadata stay in their existing sources.++The interface is `capable` plus `pause`, `resume`, `toggle`, `setMode`, `mode`,+`claim`, `release`, `suspend`, `isPaused`, and `owner`. Capability is fixed from+the initial SVG `data-animation="trace"`. Non-trace pages hide the control, clear+the existing root motion attributes, and return inert methods: false for pause/+resume/toggle/release, zero for claim, still for modes, true for isPaused, an+empty owner, and a suspension function returning false. That branch does not+install the trace listeners or run its visibility initialization.++For trace pages, pause/resume/toggle return the reader's pause intent, while+mode/isPaused report effective pause: reader intent OR reduced motion OR a+nonempty suspension table. Thus resume can return false while mode remains still.+setMode treats only `still` as a pause request, returns effective mode and honors+`persist:false`. The storage key remains `archify-motion`; user pause writes+`still`, resume removes it, and storage errors are ignored. System suspension+does not become a persisted user preference. Becoming live does not restart+Story/Route playback or replay an already settled ambient pass.++Explicit claims override derived owners. Without a claim, SVG attributes select+Story playing/follow, chapter, route, lens, relationship, intent, focus, legend,+then empty, in that order. A semantic owner can coexist with live mode. Claiming+even the same name clears the previous claim and invokes its cleanup before+publishing a new token/owner. Cleanup errors are caught; synchronous reentry keeps+the existing call order without a new guard or queue. Releasing the current token+does not run cleanup, advances the token and falls back to current SVG state.+Stale/repeated releases return false. Claims are not a stack of resumable owners.++| State / dependency | Ownership and coordination |+| --- | --- |+| Reader pause, suspension table, previous effective-pause value | Governor owns these. Ordinary suspend keys count references; each returned release function succeeds once. Visibility directly sets/deletes the same table's `visibility` key, so a caller using that key does not have independent counting guarantees. |+| Explicit/derived owner, token and cleanup callback | Governor owns arbitration. Guided handoff, chapter preview, Story and Route provide cleanup; their decorations and transaction state remain caller-owned. |+| Root motion/owner/capable/document-hidden attributes and button hidden/disabled/ARIA/text/title | Governor writes them; CSS consumes them. System preference, suspension, reader pause and owner retain their existing label precedence. Only the system preference disables the button. |+| Ambient started flag and pending element set | Governor starts at most one ambient pass and finishes it on the existing animation boundary or suppression paths. |+| Button/media/visibility/mutation/animation subscriptions | Page lifetime, no destroy method. Owner observation is installed only when initially non-embed and supported; it watches the explicit SVG attribute list. |++Entering effective pause pauses Story, settles handoff, and pauses Route Journey+with elapsed time preserved, using the existing reason priority and call order.+Route syncMotion retains its render-time notification. The previous-pause guard+does not imply a universal once-only guarantee under synchronous caller reentry.++Ambient starts from the initial edge/node animation targets. Animationend and+animationcancel remove event targets from the pending set; unrelated targets+are ignored, and an empty set settles and detaches those listeners. There is no+animation-name filter, timeout or polling loop. Empty targets settle as empty;+pause, owner, embed, share playback or document-hidden suppress the pass through+the existing render paths. Settle reason can be overwritten by a later render;+it is not immutable history. Runtime root-mode changes do not install additional+listeners or guarantee immediate reevaluation without an existing render trigger.++The Governor manages these Viewer signals, not every animation on the page.+Camera retains its transactions and CSS transitions; Export retains its separate+WebM canvas timeline. Authored geometry/IDs and canonical export cleanup remain+unchanged by this source extraction.++## Export cleanup contract++`cleanExportClone(clone)` lives inside the Export closure. Its sole caller is+`serializeSvg`: clone the live SVG, clean it, apply an explicitly requested+Route/Reach snapshot, then add dimensions, theme/font styles and serialize.+It mutates only the supplied SVG clone and returns the existing+`canonicalStateClean` boolean. It neither reads live selection nor calls a+Viewer capability or changes the live DOM. No new `Archify` interface is exposed.++| State owner | Clone treatment |+| --- | --- |+| Camera | Remove runtime transform, clipping and view scale. Preserve authored geometry and viewBox. |+| Focus, relationship preview, reachability, Intent Trace | Remove selection/preview markers and runtime overlays; reset node `aria-pressed` using the existing rule. |+| Guided Views and Story | Remove chapter/handoff/preview/beat markers, overlays and story step styles. |+| Route Probe | Remove picking, result and journey markers/overlays and route step styles. |+| Semantic Lens and legend preview | Remove filtering/preview decorations and runtime legend accessibility attributes. |+| Source Evidence | Remove beacons/counts; restore recorded original labels. Missing or empty original labels remove `aria-label`, as before. |+| Previous Route/Reach share decoration | Remove before applying the current export's explicit snapshot. |++Original content, node/edge identity, geometry and authored animation metadata+remain. Animation handling for share variants and recordings stays in Export.+Cleanup preserves the existing operation order, including overlay removal before+descendant cleanup. Missing optional decorations are harmless; repeated cleanup+is idempotent. The function assumes an SVG clone supplied by Export, not null or+the live SVG. Restore records are runtime metadata, not a general undo history.++The boolean checks the existing known transient-state contract; it cannot detect+arbitrary future decorations. Keep the cleanup and its check together. Adding a+new runtime decoration still requires checking this contract: extraction isolates+that knowledge from serialization, but does not eliminate producer/cleanup+coordination. Do not broaden rules or rejection behavior during a pure extraction.++Route/Reach validation, finite-dimension checks, receipts, errors, menu behavior,+rasterization, clipboard and recording remain owned by Export. Its existing+callers use the same paths and return fields. Tests exercise final browser exports;+isolated clone tests supplement them for restoration and idempotence.++For required browser, output and package evidence, follow+[Contributing](../CONTRIBUTING.md#local-setup-and-verification).diff --git a/viewer/export-cleanup.js b/viewer/export-cleanup.jsnew file mode 100644index 00000000..100d5efc--- /dev/null+++ b/viewer/export-cleanup.js@@ -0,0 +1,182 @@+ function cleanExportClone(clone) {+ // View transforms and neighborhood focus are HTML exploration state,+ // never part of a downloaded full-diagram artifact.+ clone.style.removeProperty('transform');+ clone.style.removeProperty('clip-path');+ clone.removeAttribute('data-view-scale');+ clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');+ clone.removeAttribute('data-lens-active');+ clone.removeAttribute('data-lens-flow-count');+ clone.removeAttribute('data-lens-flow-density');+ clone.removeAttribute('data-legend-preview-active');+ clone.removeAttribute('data-relationship-preview-active');+ clone.removeAttribute('data-relationship-direct-active');+ clone.removeAttribute('data-relationship-pin-active');+ clone.removeAttribute('data-intent-trace-active');+ clone.removeAttribute('data-route-picking');+ clone.removeAttribute('data-route-active');+ clone.removeAttribute('data-route-journey');+ clone.removeAttribute('data-share-route');+ clone.removeAttribute('data-share-reach');+ clone.removeAttribute('data-story-active');+ clone.removeAttribute('data-story-playing');+ clone.removeAttribute('data-story-beat');+ clone.removeAttribute('data-story-next');+ clone.removeAttribute('data-story-follow');+ clone.removeAttribute('data-chapter-handoff');+ clone.removeAttribute('data-chapter-anchor');+ clone.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {+ el.removeAttribute('data-chapter-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {+ el.removeAttribute('data-chapter-preview-role');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {+ el.removeAttribute('data-legend-kind');+ el.removeAttribute('data-legend-label');+ el.removeAttribute('data-legend-count');+ el.removeAttribute('data-legend-zero');+ el.removeAttribute('data-legend-selected');+ el.removeAttribute('role');+ el.removeAttribute('tabindex');+ el.removeAttribute('aria-label');+ el.removeAttribute('aria-pressed');+ el.removeAttribute('aria-haspopup');+ el.removeAttribute('aria-controls');+ el.removeAttribute('aria-expanded');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {+ el.removeAttribute('data-legend-bridge');+ el.removeAttribute('role');+ el.removeAttribute('aria-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {+ el.remove();+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {+ var originalLabel = el.getAttribute('data-source-evidence-original-label');+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');+ else el.setAttribute('aria-label', originalLabel);+ el.removeAttribute('data-source-evidence-count');+ el.removeAttribute('data-source-evidence-original-label');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {+ el.removeAttribute('data-story-step');+ el.removeAttribute('data-story-beat-state');+ el.removeAttribute('data-story-beat-step');+ el.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {+ el.removeAttribute('data-focus-match');+ el.removeAttribute('data-focus-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {+ el.removeAttribute('data-lens-match');+ el.removeAttribute('data-lens-selected');+ el.removeAttribute('data-lens-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {+ el.removeAttribute('data-legend-preview-match');+ el.removeAttribute('data-legend-preview-selected');+ el.removeAttribute('data-legend-preview-peer');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {+ el.removeAttribute('data-relationship-preview');+ el.removeAttribute('data-relationship-preview-node');+ el.removeAttribute('data-relationship-preview-source');+ el.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {+ el.removeAttribute('data-intent-trace-match');+ el.removeAttribute('data-intent-trace-selected');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {+ el.removeAttribute('data-route-match');+ el.removeAttribute('data-route-start');+ el.removeAttribute('data-route-end');+ el.removeAttribute('data-route-step');+ el.removeAttribute('data-route-candidate');+ el.removeAttribute('data-route-journey-state');+ el.removeAttribute('data-route-journey-current');+ el.style.removeProperty('--route-step');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {+ el.removeAttribute('data-share-route-match');+ el.removeAttribute('data-share-route-step');+ el.removeAttribute('data-share-route-start');+ el.removeAttribute('data-share-route-end');+ el.removeAttribute('data-share-route-middle');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {+ el.removeAttribute('data-share-reach-match');+ el.removeAttribute('data-share-reach-origin');+ el.removeAttribute('data-share-reach-depth');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {+ el.removeAttribute('data-detail');+ el.removeAttribute('data-detail-anchor');+ });+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {+ el.setAttribute('aria-pressed', 'false');+ });+ return !clone.hasAttribute('data-view-scale') &&+ !clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&+ !clone.hasAttribute('data-lens-active') &&+ !clone.hasAttribute('data-lens-flow-count') &&+ !clone.hasAttribute('data-lens-flow-density') &&+ !clone.hasAttribute('data-legend-preview-active') &&+ !clone.hasAttribute('data-relationship-preview-active') &&+ !clone.hasAttribute('data-relationship-direct-active') &&+ !clone.hasAttribute('data-intent-trace-active') &&+ !clone.hasAttribute('data-route-picking') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ !clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-share-reach') &&+ !clone.hasAttribute('data-story-active') &&+ !clone.hasAttribute('data-story-playing') &&+ !clone.hasAttribute('data-story-beat') &&+ !clone.hasAttribute('data-story-next') &&+ !clone.hasAttribute('data-story-follow') &&+ !clone.hasAttribute('data-chapter-handoff') &&+ !clone.hasAttribute('data-chapter-anchor') &&+ !clone.hasAttribute('data-chapter-preview') &&+ !clone.style.getPropertyValue('transform') &&+ !clone.style.getPropertyValue('clip-path') &&+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ }diff --git a/viewer/export.js b/viewer/export.jsnew file mode 100644index 00000000..7337ec07--- /dev/null+++ b/viewer/export.js@@ -0,0 +1,1270 @@+ /* ============================================================+ Export — Share Card / PNG / JPEG / WebP / SVG / WebM and clipboard++ Raster exports are always rendered at 4x source resolution for+ maximum sharpness. The trick: we set the serialized SVG's+ `width`/`height` to viewBox * 4 so the browser rasterizes the+ vectors at that resolution natively. drawImage then draws at+ the image's natural size (no upscaling = no blur).++ JPEG/WebP paint the current theme's background explicitly since+ those formats have no alpha channel.+ ============================================================ */+ (function () {+ var RASTER_SCALE = 4;+ var MOTION_DURATION = 6000;+ var MOTION_FPS = 30;+ var SHARE_CARD_WIDTH = 1200;+ var SHARE_CARD_HEIGHT = 630;+ var SHARE_CARD_PADDING = 36;+ var SHARE_CARD_HEADER = 112;++ function exportError(key, values) {+ var error = new Error(viewerText(key, values));+ error.archifyViewerMessage = true;+ return error;+ }++ function exportMessage(error) {+ return error && error.archifyViewerMessage+ ? error.message+ : viewerText('viewer.export.unknown');+ }++ function diagramFilename() {+ var title = (document.title || 'diagram')+ .replace(/\s+Architecture(\s+Diagram)?$/i, '')+ .replace(/\s+Diagram$/i, '')+ .trim();+ return title.replace(/[^a-z0-9_\-]+/gi, '-')+ .toLowerCase()+ .replace(/^-+|-+$/g, '') || 'diagram';+ }++ function currentBg() {+ return getComputedStyle(document.body).backgroundColor || '#ffffff';+ }++/* ARCHIFY:EXPORT_CLEANUP */++ /**+ * Serialize the main SVG into a standalone document.+ *+ * Two modes:+ * - Default (opts.autoTheme=false) — locks the serialized SVG to the+ * viewer's current theme. Used by the raster pipeline+ * (PNG/JPEG/WebP/clipboard) because canvas rasterization needs+ * deterministic colors; a raster cannot react to+ * prefers-color-scheme after encoding.+ * - autoTheme=true — emits BOTH dark and light variable sets plus a+ * `@media (prefers-color-scheme)` rule so the resulting SVG+ * self-themes when embedded in GitHub READMEs or other hosts that+ * expose a color scheme. Used for "Download SVG".+ */+ function applyRouteSnapshot(clone, snapshot) {+ if (!snapshot || !Array.isArray(snapshot.nodeIds) || !Array.isArray(snapshot.edges) ||+ snapshot.nodeIds.length < 2 || snapshot.edges.length !== snapshot.nodeIds.length - 1 ||+ snapshot.hops !== snapshot.edges.length ||+ !snapshot.source || !snapshot.target ||+ snapshot.source.id !== snapshot.nodeIds[0] ||+ snapshot.target.id !== snapshot.nodeIds[snapshot.nodeIds.length - 1]) return false;++ clone.removeAttribute('data-animation');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-animate]'), function (element) {+ element.removeAttribute('data-animate');+ element.style.removeProperty('--step');+ });++ var cloneNodes = Array.prototype.slice.call(clone.querySelectorAll('[data-node-id]'));+ var cloneEdges = Array.prototype.slice.call(clone.querySelectorAll('[data-edge-key]'));+ var nodeIds = Object.create(null);+ var edgeKeys = Object.create(null);+ var nodeMatches = [];+ var edgeMatches = [];++ for (var nodeIndex = 0; nodeIndex < snapshot.nodeIds.length; nodeIndex++) {+ var nodeId = snapshot.nodeIds[nodeIndex];+ if (typeof nodeId !== 'string' || !nodeId || nodeIds[nodeId]) return false;+ var matchedNodes = cloneNodes.filter(function (candidate) {+ return candidate.getAttribute('data-node-id') === nodeId;+ });+ if (matchedNodes.length !== 1) return false;+ nodeIds[nodeId] = true;+ nodeMatches.push(matchedNodes);+ }++ for (var edgeIndex = 0; edgeIndex < snapshot.edges.length; edgeIndex++) {+ var edge = snapshot.edges[edgeIndex];+ var fromId = snapshot.nodeIds[edgeIndex];+ var toId = snapshot.nodeIds[edgeIndex + 1];+ if (!edge || typeof edge.key !== 'string' || !edge.key || edgeKeys[edge.key] ||+ edge.from !== fromId || edge.to !== toId) return false;+ var matchedEdges = cloneEdges.filter(function (candidate) {+ return candidate.getAttribute('data-edge-key') === edge.key;+ });+ var drawableMatches = matchedEdges.filter(hasDrawableGeometry);+ if (!matchedEdges.length || drawableMatches.length !== 1 || !matchedEdges.every(function (candidate) {+ return candidate.getAttribute('data-edge-from') === edge.from &&+ candidate.getAttribute('data-edge-to') === edge.to &&+ (candidate.getAttribute('data-edge-id') || '') === (edge.id || '');+ })) return false;+ edgeKeys[edge.key] = true;+ edgeMatches.push(matchedEdges);+ }++ clone.setAttribute('data-share-route', '');+ nodeMatches.forEach(function (matches, step) {+ matches.forEach(function (element) {+ element.setAttribute('data-share-route-match', '');+ element.setAttribute('data-share-route-step', String(step));+ if (step === 0) element.setAttribute('data-share-route-start', '');+ else if (step === snapshot.nodeIds.length - 1) element.setAttribute('data-share-route-end', '');+ else element.setAttribute('data-share-route-middle', '');+ });+ });+ edgeMatches.forEach(function (matches, step) {+ matches.forEach(function (element) {+ element.setAttribute('data-share-route-match', '');+ element.setAttribute('data-share-route-step', String(step));+ });+ });++ return clone.hasAttribute('data-share-route') &&+ !clone.hasAttribute('data-animation') &&+ !clone.hasAttribute('data-route-active') &&+ !clone.hasAttribute('data-route-journey') &&+ clone.querySelectorAll('[data-animate], [data-route-match], [data-route-step], [data-route-start], [data-route-end], [data-route-journey-state], [data-route-journey-current], [data-route-journey-overlay]').length === 0 &&+ clone.querySelectorAll('[data-share-route-match]').length ===+ nodeMatches.reduce(function (count, matches) { return count + matches.length; }, 0) ++ edgeMatches.reduce(function (count, matches) { return count + matches.length; }, 0);+ }++ function applyReachSnapshot(clone, snapshot) {+ if (!snapshot || (snapshot.direction !== 'upstream' && snapshot.direction !== 'downstream') ||+ !snapshot.origin || typeof snapshot.origin.id !== 'string' || !snapshot.origin.id ||+ typeof snapshot.origin.label !== 'string' || !snapshot.origin.label.trim() ||+ !Array.isArray(snapshot.nodeIds) || snapshot.nodeIds.length < 2 ||+ !Array.isArray(snapshot.edges) || !snapshot.edges.length ||+ !snapshot.depths || typeof snapshot.depths !== 'object' ||+ !Number.isInteger(snapshot.maxDepth) || snapshot.maxDepth < 1 ||+ snapshot.nodeIds[0] !== snapshot.origin.id) return false;++ clone.removeAttribute('data-animation');+ Array.prototype.forEach.call(clone.querySelectorAll('[data-animate]'), function (element) {+ element.removeAttribute('data-animate');+ element.style.removeProperty('--step');+ });++ var cloneNodes = Array.prototype.slice.call(clone.querySelectorAll('[data-node-id]'));+ var cloneEdges = Array.prototype.slice.call(clone.querySelectorAll('[data-edge-key]'));+ var nodeIds = Object.create(null);+ var edgeKeys = Object.create(null);+ var nodeMatches = [];+ var edgeMatches = [];+ var measuredMaxDepth = 0;++ for (var nodeIndex = 0; nodeIndex < snapshot.nodeIds.length; nodeIndex++) {+ var nodeId = snapshot.nodeIds[nodeIndex];+ var depth = snapshot.depths[nodeId];+ if (typeof nodeId !== 'string' || !nodeId || nodeIds[nodeId] ||+ !Number.isInteger(depth) || depth < 0 || depth > snapshot.maxDepth ||+ (nodeId === snapshot.origin.id ? depth !== 0 : depth < 1)) return false;+ var matchedNodes = cloneNodes.filter(function (candidate) {+ return candidate.getAttribute('data-node-id') === nodeId;+ });+ if (matchedNodes.length !== 1) return false;+ nodeIds[nodeId] = true;+ measuredMaxDepth = Math.max(measuredMaxDepth, depth);+ nodeMatches.push({ elements: matchedNodes, id: nodeId, depth: depth });+ }+ if (measuredMaxDepth !== snapshot.maxDepth) return false;++ for (var edgeIndex = 0; edgeIndex < snapshot.edges.length; edgeIndex++) {+ var edge = snapshot.edges[edgeIndex];+ if (!edge || typeof edge.key !== 'string' || !edge.key || edgeKeys[edge.key] ||+ !nodeIds[edge.from] || !nodeIds[edge.to] ||+ !Number.isInteger(edge.depth) || edge.depth < 1 || edge.depth > snapshot.maxDepth ||+ edge.depth !== Math.max(snapshot.depths[edge.from], snapshot.depths[edge.to])) return false;+ var matchedEdges = cloneEdges.filter(function (candidate) {+ return candidate.getAttribute('data-edge-key') === edge.key;+ });+ var drawableMatches = matchedEdges.filter(hasDrawableGeometry);+ if (!matchedEdges.length || drawableMatches.length !== 1 || !matchedEdges.every(function (candidate) {+ return candidate.getAttribute('data-edge-from') === edge.from &&+ candidate.getAttribute('data-edge-to') === edge.to &&+ (candidate.getAttribute('data-edge-id') || '') === (edge.id || '');+ })) return false;+ edgeKeys[edge.key] = true;+ edgeMatches.push({ elements: matchedEdges, depth: edge.depth });+ }++ clone.setAttribute('data-share-reach', snapshot.direction);+ nodeMatches.forEach(function (match) {+ match.elements.forEach(function (element) {+ element.setAttribute('data-share-reach-match', '');+ element.setAttribute('data-share-reach-depth', String(match.depth));+ if (match.id === snapshot.origin.id) element.setAttribute('data-share-reach-origin', '');+ });+ });+ edgeMatches.forEach(function (match) {+ match.elements.forEach(function (element) {+ element.setAttribute('data-share-reach-match', '');+ element.setAttribute('data-share-reach-depth', String(match.depth));+ });+ });++ return clone.getAttribute('data-share-reach') === snapshot.direction &&+ !clone.hasAttribute('data-animation') &&+ !clone.hasAttribute('data-reach-active') &&+ clone.querySelectorAll('[data-animate], [data-reach-match], [data-reach-origin], [data-reach-depth]').length === 0 &&+ clone.querySelectorAll('[data-share-reach-origin]').length === 1 &&+ clone.querySelectorAll('[data-share-reach-match]').length ===+ nodeMatches.reduce(function (count, match) { return count + match.elements.length; }, 0) ++ edgeMatches.reduce(function (count, match) { return count + match.elements.length; }, 0);+ }++ function serializeSvg(scale, opts) {+ // scale: integer multiplier for intrinsic SVG pixel dimensions used by+ // the raster path. Defaults to 1 (natural size) for SVG download.+ scale = scale || 1;+ opts = opts || {};+ var autoTheme = opts.autoTheme === true;+ var svg = document.querySelector('.diagram-container svg');+ var clone = svg.cloneNode(true);++ var canonicalStateClean = cleanExportClone(clone);++ var vb = svg.viewBox.baseVal;+ var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&+ Number.isFinite(vb.width) && Number.isFinite(vb.height) && vb.width > 0 && vb.height > 0;+ var routeStateClean = opts.routeSnapshot+ ? canonicalStateClean && finiteSvgDimensions && applyRouteSnapshot(clone, opts.routeSnapshot)+ : null;+ var reachStateClean = opts.reachSnapshot+ ? canonicalStateClean && finiteSvgDimensions && !opts.routeSnapshot && applyReachSnapshot(clone, opts.reachSnapshot)+ : null;+ // Scale width/height so the browser rasterizes the vectors at target+ // resolution directly. viewBox stays unchanged so coordinates don't+ // shift. This is the key to sharp rasters — do NOT scale later via+ // canvas upscaling.+ clone.setAttribute('width', vb.width * scale);+ clone.setAttribute('height', vb.height * scale);+ clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');++ // Only the SVG-relevant rules: semantic classes, markers, and the+ // theme variable blocks. Toolbar/cards/print CSS can never apply+ // inside a standalone SVG and would only bloat the export.+ var hostStyle = (function () {+ var out = [];+ Array.prototype.forEach.call(document.styleSheets, function (sheet) {+ var rules;+ try { rules = sheet.cssRules; } catch (_) { return; } // cross-origin+ if (!rules) return;+ Array.prototype.forEach.call(rules, function (rule) {+ if (rule.type === 7 && /^archify-/.test(rule.name || '')) {+ out.push(rule.cssText);+ return;+ }+ if (rule.type !== 1) return; // plain style rules only+ var sel = rule.selectorText || '';+ if (/(^|,)\s*(svg|:root|\[data-theme|\[data-preset|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {+ out.push(rule.cssText);+ }+ });+ });+ return out.join('\n');+ })();++ // Derive the variable list from the stylesheet so newly added theme+ // variables can never be missed by the export pipeline again+ // (--lane-fill/--lane-stroke once were).+ var varNames = (function () {+ var seen = {};+ var names = [];+ (hostStyle.match(/--[a-zA-Z0-9-]+(?=\s*:)/g) || []).forEach(function (n) {+ if (!seen[n]) { seen[n] = true; names.push(n); }+ });+ return names;+ })();++ // Resolve the full variable set for a given data-theme via an+ // off-DOM probe, independent of what the viewer is currently set to.+ function resolveVars(themeAttr) {+ var probe = document.createElement('div');+ probe.setAttribute('data-theme', themeAttr);+ probe.setAttribute('data-preset', document.documentElement.getAttribute('data-preset') || 'classic');+ probe.style.cssText = 'position:absolute;width:0;height:0;visibility:hidden;';+ document.body.appendChild(probe);+ try {+ var c = getComputedStyle(probe);+ return varNames.map(function (n) {+ return n + ': ' + c.getPropertyValue(n).trim() + ';';+ }).join(' ');+ } finally {+ document.body.removeChild(probe);+ }+ }++ // Keep the same font bytes, character coverage, and attribution in+ // standalone SVGs and the SVG images used by every raster export.+ var fontCss = document.getElementById('archify-fonts').textContent;++ var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');+ var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');+ bgRect.setAttribute('width', '100%');+ bgRect.setAttribute('height', '100%');++ if (autoTheme) {+ // Dual-theme SVG. Dark is the default (so hosts without+ // prefers-color-scheme still render), light swaps in via media+ // query, and svg[data-theme="..."] still lets downstream+ // consumers force a specific theme.+ var darkVars = resolveVars('dark');+ var lightVars = resolveVars('light');++ style.textContent =+ fontCss + "\n" ++ "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" ++ hostStyle + "\n" ++ ":root, svg { " + darkVars + " }\n" ++ "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" ++ "svg[data-theme=\"light\"] { " + lightVars + " }\n" ++ "svg[data-theme=\"dark\"] { " + darkVars + " }\n" ++ "rect.c-bg-rect { fill: var(--bg); }\n";++ // Don't lock the serialized SVG to the viewer's current theme.+ clone.removeAttribute('data-theme');+ // Background follows the CSS variable, not a fixed color, so it+ // swaps with the media query.+ bgRect.setAttribute('class', 'c-bg-rect');+ } else {+ // Raster path: lock to the viewer's current theme.+ var theme = document.documentElement.getAttribute('data-theme') || 'dark';+ var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;+ var computed = getComputedStyle(themeHost);+ var vars = varNames.map(function (n) {+ return n + ': ' + computed.getPropertyValue(n).trim() + ';';+ }).join(' ');++ // IMPORTANT: inject the resolved variables AFTER hostStyle,+ // otherwise hostStyle's ":root, [data-theme=\"dark\"] { ... }" rule+ // overrides our chosen theme via later-in-cascade equal-specificity.+ // Keep this order.+ style.textContent =+ fontCss + "\n" ++ "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" ++ hostStyle + "\n" ++ ":root, svg { " + vars + " }\n";++ bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');+ }++ if (opts.routeSnapshot) {+ style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from] { opacity: 0.18; }\n" ++ "svg[data-share-route] [data-share-route-match] { opacity: 1; }\n" ++ "svg[data-share-route] [data-share-route-start] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3; stroke-dasharray: 5 3; }\n" ++ "svg[data-share-route] [data-share-route-middle] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 2.2; }\n" ++ "svg[data-share-route] [data-share-route-end] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3.4; stroke-dasharray: 1 0; }\n";+ }+ if (opts.reachSnapshot) {+ style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from] { opacity: 0.14; }\n" ++ "svg[data-share-reach] [data-share-reach-match] { opacity: 1; }\n" ++ "svg[data-share-reach] [data-edge-from][data-share-reach-match] { stroke-width: 1.55; }\n" ++ "svg[data-share-reach=\"upstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--database-stroke); stroke-width: 3.4; stroke-dasharray: 5 3; }\n" ++ "svg[data-share-reach=\"downstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--backend-stroke); stroke-width: 3.4; stroke-dasharray: 1 0; }\n" ++ "svg[data-preset=\"blueprint\"][data-share-reach] [data-share-reach-origin], svg[data-preset=\"blueprint\"][data-share-reach] [data-edge-from][data-share-reach-match] { filter: none; }\n";+ }++ clone.insertBefore(style, clone.firstChild);+ clone.insertBefore(bgRect, style.nextSibling);++ return {+ svgString: new XMLSerializer().serializeToString(clone),+ width: vb.width * scale,+ height: vb.height * scale,+ canonicalStateClean: canonicalStateClean,+ routeStateClean: routeStateClean,+ reachStateClean: reachStateClean+ };+ }++ function download(blob, filename) {+ var url = URL.createObjectURL(blob);+ var a = document.createElement('a');+ a.href = url;+ a.download = filename;+ document.body.appendChild(a);+ a.click();+ a.remove();+ setTimeout(function () { URL.revokeObjectURL(url); }, 1000);+ }++ // Conservative upper bound on total canvas pixels. Older Safari on iOS+ // silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /+ // desktop Safari are far higher but start failing on memory-constrained+ // devices. We pick the largest integer scale in {4,3,2,1} whose target+ // pixel count fits under this cap.+ var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;++ function pickSafeScale(vbW, vbH) {+ for (var s = RASTER_SCALE; s >= 1; s--) {+ if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;+ }+ return 1;+ }++ function rasterize(format) {+ // Serialize at a safe scale (RASTER_SCALE=4 by default, reduced if the+ // resulting canvas would exceed MAX_CANVAS_PIXELS). The SVG itself is+ // rasterized at target resolution natively; drawImage draws at natural+ // size — no upsampling blur.+ var svg = document.querySelector('.diagram-container svg');+ var vb = svg.viewBox.baseVal;+ var scale = pickSafeScale(vb.width, vb.height);+ var data = serializeSvg(scale);+ var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });+ var svgUrl = URL.createObjectURL(svgBlob);++ return new Promise(function (resolve, reject) {+ var img = new Image();+ img.onload = function () {+ try {+ var canvas = document.createElement('canvas');+ canvas.width = data.width;+ canvas.height = data.height;+ var ctx = canvas2dOrThrow(canvas, format);+ if (format === 'jpeg') {+ ctx.fillStyle = currentBg();+ ctx.fillRect(0, 0, canvas.width, canvas.height);+ }+ // Draw at natural size — SVG was already rasterized at target res.+ ctx.drawImage(img, 0, 0);+ URL.revokeObjectURL(svgUrl);+ var mime = format === 'jpeg' ? 'image/jpeg' :+ format === 'webp' ? 'image/webp' : 'image/png';+ var quality = format === 'png' ? undefined : 0.95;+ canvas.toBlob(function (blob) {+ if (!blob) reject(exportError('viewer.export.error.toBlobNull', { label: format }));+ else resolve(blob);+ }, mime, quality);+ } catch (error) {+ URL.revokeObjectURL(svgUrl);+ reject(error);+ }+ };+ img.onerror = function (e) {+ URL.revokeObjectURL(svgUrl);+ reject(e);+ };+ img.src = svgUrl;+ });+ }++ function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight) {+ var value = String(text || '').trim();+ var size = startSize;+ var family = "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";+ while (size > minSize) {+ ctx.font = (weight || '600') + ' ' + size + 'px ' + family;+ if (ctx.measureText(value).width <= maxWidth) return value;+ size -= 1;+ }+ ctx.font = (weight || '600') + ' ' + minSize + 'px ' + family;+ if (ctx.measureText(value).width <= maxWidth) return value;+ var suffix = '\u2026';+ while (value.length > 1 && ctx.measureText(value + suffix).width > maxWidth) {+ value = value.slice(0, -1);+ }+ return value + suffix;+ }++ function canvas2dOrThrow(canvas, label) {+ if (!canvas || typeof canvas.getContext !== 'function') {+ throw exportError('viewer.export.error.canvasUnavailable', { label: label });+ }+ var ctx = canvas.getContext('2d');+ if (!ctx) throw exportError('viewer.export.error.contextUnavailable', { label: label });+ if (typeof canvas.toBlob !== 'function') throw exportError('viewer.export.error.toBlobUnavailable', { label: label });+ return ctx;+ }++ function renderShareCard(options) {+ options = options || {};+ var routeSnapshot = options.routeSnapshot || null;+ var reachSnapshot = options.reachSnapshot || null;+ if (routeSnapshot && reachSnapshot) return Promise.reject(exportError('viewer.export.error.variantsCombined'));+ var svg = document.querySelector('.diagram-container svg');+ var vb = svg.viewBox.baseVal;+ var sourceScale = Math.min(2, pickSafeScale(vb.width, vb.height));+ var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot });+ if (!data.canonicalStateClean) return Promise.reject(exportError('viewer.export.error.viewerState'));+ if (routeSnapshot && !data.routeStateClean) return Promise.reject(exportError('viewer.export.error.routeState'));+ if (reachSnapshot && !data.reachStateClean) return Promise.reject(exportError('viewer.export.error.reachState'));+ var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });+ var svgUrl = URL.createObjectURL(svgBlob);++ return new Promise(function (resolve, reject) {+ var img = new Image();+ img.onload = function () {+ try {+ var canvas = document.createElement('canvas');+ canvas.width = SHARE_CARD_WIDTH;+ canvas.height = SHARE_CARD_HEIGHT;+ var ctx = canvas2dOrThrow(canvas, viewerText('viewer.export.shareCard'));+ var computed = getComputedStyle(document.documentElement);+ var bg = computed.getPropertyValue('--bg').trim() || currentBg();+ var text = computed.getPropertyValue('--text').trim() || '#ffffff';+ var muted = computed.getPropertyValue('--text-muted').trim() || '#94a3b8';+ var border = computed.getPropertyValue('--panel-border').trim() || '#334155';+ var accentProperty = reachSnapshot+ ? (reachSnapshot.direction === 'upstream' ? '--database-stroke' : '--backend-stroke')+ : '--frontend-stroke';+ var accent = computed.getPropertyValue(accentProperty).trim() || '#22d3ee';+ var titleNode = document.querySelector('.header h1');+ var subtitleNode = document.querySelector('.header .subtitle');+ var title = titleNode ? titleNode.textContent : document.title;+ var directionLabel = reachSnapshot+ ? viewerText('viewer.export.direction.' + reachSnapshot.direction)+ : '';+ var subtitle = routeSnapshot+ ? viewerCount('viewer.export.card.routeSummary', routeSnapshot.hops, {+ source: routeSnapshot.source.label,+ target: routeSnapshot.target.label+ })+ : reachSnapshot+ ? viewerText('viewer.export.card.reachSummary', {+ direction: directionLabel,+ origin: reachSnapshot.origin.label,+ nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),+ links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),+ hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)+ })+ : subtitleNode ? subtitleNode.textContent : '';+ var preset = document.documentElement.getAttribute('data-preset') || 'classic';+ var theme = document.documentElement.getAttribute('data-theme') || 'dark';+ var presetKey = preset === 'signal-flow'+ ? 'viewer.preset.flow.short'+ : 'viewer.preset.' + preset;+ var presetLabel = viewerText(presetKey).toUpperCase();+ var themeLabel = viewerText('viewer.theme.' + theme).toUpperCase();+ var cardLabel = routeSnapshot+ ? viewerText('viewer.export.card.routeBadge', {+ hops: viewerCount('viewer.export.card.hop', routeSnapshot.hops).toUpperCase()+ })+ : reachSnapshot+ ? viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() })+ : viewerText('viewer.export.card.defaultBadge', { preset: presetLabel, theme: themeLabel });++ ctx.fillStyle = bg;+ ctx.fillRect(0, 0, SHARE_CARD_WIDTH, SHARE_CARD_HEIGHT);++ ctx.fillStyle = accent;+ ctx.fillRect(SHARE_CARD_PADDING, 27, 42, 3);++ ctx.textBaseline = 'alphabetic';+ ctx.fillStyle = text;+ var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 330, 29, 18, '700');+ ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 62);++ ctx.fillStyle = muted;+ var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 280, 13, 11, '500');+ ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 87);++ ctx.font = "600 12px 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";+ ctx.textAlign = 'right';+ ctx.fillStyle = accent;+ ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 50);+ ctx.textAlign = 'left';++ var availableWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;+ var availableHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;+ var fit = Math.min(availableWidth / data.width, availableHeight / data.height);+ var drawWidth = data.width * fit;+ var drawHeight = data.height * fit;+ var drawX = SHARE_CARD_PADDING + (availableWidth - drawWidth) / 2;+ var drawY = SHARE_CARD_HEADER + (availableHeight - drawHeight) / 2;++ ctx.strokeStyle = border;+ ctx.lineWidth = 1;+ ctx.strokeRect(drawX - 0.5, drawY - 0.5, drawWidth + 1, drawHeight + 1);+ ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);+ URL.revokeObjectURL(svgUrl);++ canvas.toBlob(function (blob) {+ if (!blob) reject(exportError('viewer.export.error.toBlobNull', { label: viewerText('viewer.export.shareCard') }));+ else resolve(blob);+ }, 'image/png');+ } catch (error) {+ URL.revokeObjectURL(svgUrl);+ reject(error);+ }+ };+ img.onerror = function (e) {+ URL.revokeObjectURL(svgUrl);+ reject(e);+ };+ img.src = svgUrl;+ });+ }++ function rasterizeShareCard(options) {+ options = options || {};+ if (!options.variant) return renderShareCard();+ if (options.variant !== 'route' && options.variant !== 'reach') {+ return Promise.reject(exportError('viewer.export.unknownVariant', { variant: options.variant }));+ }+ if (options.variant === 'route') {+ var routeSnapshot = Archify.routeProbe && Archify.routeProbe.exportSnapshot();+ if (!routeSnapshot) return Promise.reject(exportError('viewer.export.routeRequired'));+ return renderShareCard({ routeSnapshot: routeSnapshot });+ }+ var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'+ ? Archify.focus.reachabilitySnapshot()+ : null;+ if (!snapshot) return Promise.reject(exportError('viewer.export.reachRequired'));+ return renderShareCard({ reachSnapshot: snapshot });+ }++ function motionMimeType() {+ if (typeof MediaRecorder === 'undefined') return '';+ var candidates = [+ 'video/webm;codecs=vp9',+ 'video/webm;codecs=vp8',+ 'video/webm'+ ];+ for (var i = 0; i < candidates.length; i++) {+ if (!MediaRecorder.isTypeSupported || MediaRecorder.isTypeSupported(candidates[i])) return candidates[i];+ }+ return '';+ }++ function canRecordMotion() {+ var svg = document.querySelector('.diagram-container svg');+ return !!(svg && svg.getAttribute('data-animation') === 'trace' &&+ typeof MediaRecorder !== 'undefined' && motionMimeType() &&+ typeof HTMLCanvasElement !== 'undefined' &&+ typeof HTMLCanvasElement.prototype.captureStream === 'function');+ }++ // Record the live CSS animation without Puppeteer, ffmpeg, or a network+ // dependency. SVG files loaded through Image are commonly rasterized as+ // one cached bitmap, so repeatedly drawing that Image does not reliably+ // advance its CSS animation. Keep one crisp static SVG background, then+ // render an explicit time-varying signal scene over the real authored+ // relationship geometry on every captured canvas frame.+ function recordWebm(options) {+ options = options || {};+ if (!canRecordMotion()) {+ return Promise.reject(exportError('viewer.export.error.webmRequirements'));+ }+ var duration = Math.max(250, Number(options.duration) || MOTION_DURATION);+ var fps = Math.max(1, Number(options.fps) || MOTION_FPS);+ var svg = document.querySelector('.diagram-container svg');+ var vb = svg.viewBox.baseVal;+ var scale = Math.min(1, 1280 / vb.width);+ var data = serializeSvg(scale);+ var sourceUrl = URL.createObjectURL(new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' }));++ function createMotionScene(root) {+ var rootMatrix = root.getCTM ? root.getCTM() : null;++ function pointInRoot(element, point) {+ if (!rootMatrix || !element.getCTM || !point.matrixTransform) return { x: point.x, y: point.y };+ try {+ var elementMatrix = element.getCTM();+ if (!elementMatrix) return { x: point.x, y: point.y };+ var mapped = point.matrixTransform(rootMatrix.inverse().multiply(elementMatrix));+ return { x: mapped.x, y: mapped.y };+ } catch (_) {+ return { x: point.x, y: point.y };+ }+ }++ function samplesFor(element) {+ if (typeof element.getTotalLength !== 'function' || typeof element.getPointAtLength !== 'function') return [];+ var length;+ try { length = element.getTotalLength(); } catch (_) { return []; }+ if (!Number.isFinite(length) || length <= 0) return [];+ var count = Math.max(12, Math.min(72, Math.ceil(length / 12)));+ var points = [];+ for (var i = 0; i <= count; i++) {+ points.push(pointInRoot(element, element.getPointAtLength(length * i / count)));+ }+ return points;+ }++ function authoredStep(element, fallback) {+ var raw = element.style.getPropertyValue('--step') || getComputedStyle(element).getPropertyValue('--step');+ var value = Number(raw);+ return Number.isFinite(value) ? value : fallback;+ }++ var edges = Array.prototype.slice.call(root.querySelectorAll('[data-animate="edge"]')).map(function (element, index) {+ var computed = getComputedStyle(element);+ return {+ points: samplesFor(element),+ color: computed.stroke && computed.stroke !== 'none' ? computed.stroke : '#22d3ee',+ width: Math.max(1.5, parseFloat(computed.strokeWidth) || 1.5),+ delay: Math.min(12, authoredStep(element, index)) * 0.16+ };+ }).filter(function (edge) { return edge.points.length > 1; });++ var nodes = Array.prototype.slice.call(root.querySelectorAll('[data-node-id][data-animate="node"]')).map(function (element, index) {+ var box;+ try { box = element.getBBox(); } catch (_) { return null; }+ var painted = element.querySelector('[class*="c-"]') || element;+ var computed = getComputedStyle(painted);+ return {+ x: box.x,+ y: box.y,+ width: box.width,+ height: box.height,+ color: computed.stroke && computed.stroke !== 'none' ? computed.stroke : '#22d3ee',+ delay: Math.min(12, authoredStep(element, index)) * 0.16+ };+ }).filter(Boolean);++ return { edges: edges, nodes: nodes, x: vb.x, y: vb.y, width: vb.width, height: vb.height };+ }++ function pointAlong(points, progress) {+ var scaled = Math.max(0, Math.min(1, progress)) * (points.length - 1);+ var index = Math.min(points.length - 2, Math.floor(scaled));+ var mix = scaled - index;+ return {+ x: points[index].x + (points[index + 1].x - points[index].x) * mix,+ y: points[index].y + (points[index + 1].y - points[index].y) * mix+ };+ }++ function roundedRectPath(ctx, x, y, width, height, radius) {+ var r = Math.max(0, Math.min(radius, width / 2, height / 2));+ ctx.beginPath();+ ctx.moveTo(x + r, y);+ ctx.lineTo(x + width - r, y);+ ctx.quadraticCurveTo(x + width, y, x + width, y + r);+ ctx.lineTo(x + width, y + height - r);+ ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);+ ctx.lineTo(x + r, y + height);+ ctx.quadraticCurveTo(x, y + height, x, y + height - r);+ ctx.lineTo(x, y + r);+ ctx.quadraticCurveTo(x, y, x + r, y);+ ctx.closePath();+ }++ function drawMotionFrame(ctx, backgroundImage, motionScene, elapsed) {+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);+ ctx.drawImage(backgroundImage, 0, 0, ctx.canvas.width, ctx.canvas.height);+ ctx.save();+ ctx.scale(ctx.canvas.width / motionScene.width, ctx.canvas.height / motionScene.height);+ ctx.translate(-motionScene.x, -motionScene.y);++ motionScene.edges.forEach(function (edge) {+ var duration = 1.75;+ var progress = (elapsed - edge.delay) / duration;+ if (progress < 0 || progress > 1) return;+ var head = Math.max(0, Math.min(1, progress));+ var tail = Math.max(0, head - 0.24);+ var opacity = Math.sin(Math.PI * Math.min(1, progress));++ ctx.save();+ ctx.strokeStyle = edge.color;+ ctx.fillStyle = edge.color;+ ctx.lineCap = 'round';+ ctx.lineJoin = 'round';+ ctx.lineWidth = Math.max(3.2, edge.width * 2.2);+ ctx.globalAlpha = 0.42 + opacity * 0.5;+ ctx.shadowColor = edge.color;+ ctx.shadowBlur = 10;+ ctx.beginPath();+ for (var i = 0; i <= 14; i++) {+ var trailPoint = pointAlong(edge.points, tail + (head - tail) * i / 14);+ if (i === 0) ctx.moveTo(trailPoint.x, trailPoint.y);+ else ctx.lineTo(trailPoint.x, trailPoint.y);+ }+ ctx.stroke();++ var point = pointAlong(edge.points, head);+ ctx.globalAlpha = 0.95;+ ctx.beginPath();+ ctx.arc(point.x, point.y, 4.8, 0, Math.PI * 2);+ ctx.fill();+ ctx.restore();+ });++ motionScene.nodes.forEach(function (node) {+ var progress = (elapsed - node.delay) / 2.6;+ if (progress < 0 || progress > 1) return;+ var pulse = Math.sin(Math.PI * progress);+ if (pulse <= 0.02) return;+ ctx.save();+ ctx.strokeStyle = node.color;+ ctx.lineWidth = 1.4 + pulse * 1.8;+ ctx.globalAlpha = pulse * 0.5;+ ctx.shadowColor = node.color;+ ctx.shadowBlur = 12 * pulse;+ var inset = 2 + pulse * 3;+ roundedRectPath(ctx, node.x - inset, node.y - inset, node.width + inset * 2, node.height + inset * 2, 8);+ ctx.stroke();+ ctx.restore();+ });++ ctx.restore();+ }++ var motionScene = createMotionScene(svg);++ return new Promise(function (resolve, reject) {+ var backgroundImage = new Image();+ backgroundImage.onload = function () {+ var canvas = document.createElement('canvas');+ canvas.width = Math.max(2, Math.round(data.width / 2) * 2);+ canvas.height = Math.max(2, Math.round(data.height / 2) * 2);+ var ctx = canvas.getContext('2d');+ var stream = canvas.captureStream(fps);+ var mime = motionMimeType();+ var recorder;+ try {+ recorder = new MediaRecorder(stream, { mimeType: mime, videoBitsPerSecond: 6000000 });+ } catch (err) {+ URL.revokeObjectURL(sourceUrl);+ stream.getTracks().forEach(function (track) { track.stop(); });+ reject(err);+ return;+ }+ var chunks = [];+ var raf = 0;+ var stopped = false;+ var startedAt = performance.now();+ function cleanup() {+ if (stopped) return;+ stopped = true;+ cancelAnimationFrame(raf);+ URL.revokeObjectURL(sourceUrl);+ stream.getTracks().forEach(function (track) { track.stop(); });+ }+ function draw(now) {+ var elapsed = Math.max(0, ((Number(now) || performance.now()) - startedAt) / 1000);+ drawMotionFrame(ctx, backgroundImage, motionScene, elapsed);+ raf = requestAnimationFrame(draw);+ }+ recorder.ondataavailable = function (event) {+ if (event.data && event.data.size) chunks.push(event.data);+ };+ recorder.onerror = function (event) {+ cleanup();+ reject(event.error || exportError('viewer.export.error.mediaRecorder'));+ };+ recorder.onstop = function () {+ cleanup();+ var blob = new Blob(chunks, { type: recorder.mimeType || mime });+ if (!blob.size) reject(exportError('viewer.export.error.emptyWebm'));+ else resolve(blob);+ };+ drawMotionFrame(ctx, backgroundImage, motionScene, 0);+ recorder.start(250);+ startedAt = performance.now();+ raf = requestAnimationFrame(draw);+ setTimeout(function () {+ if (recorder.state === 'inactive') return;+ // Chromium normally emits the final chunk during stop(), but+ // some embedded browser shells need an explicit encoder flush+ // first. Keep the short grace window bounded and harmless for+ // browsers that already delivered timeslice chunks.+ try { recorder.requestData(); } catch (_) {}+ setTimeout(function () {+ if (recorder.state !== 'inactive') recorder.stop();+ }, 120);+ }, duration);+ };+ backgroundImage.onerror = function () {+ URL.revokeObjectURL(sourceUrl);+ reject(exportError('viewer.export.error.webmBackground'));+ };+ backgroundImage.src = sourceUrl;+ });+ }++ var menu = document.getElementById('export-menu');+ var btn = document.getElementById('btn-export');+ var routeShareItem = menu.querySelector('button[data-action="route-share-card"]');+ var reachShareItem = menu.querySelector('button[data-action="reach-share-card"]');+ var items = function () {+ return Array.prototype.slice.call(menu.querySelectorAll('button[role="menuitem"]'));+ };++ function syncRouteShareItem() {+ var snapshot = Archify.routeProbe && typeof Archify.routeProbe.exportSnapshot === 'function'+ ? Archify.routeProbe.exportSnapshot()+ : null;+ routeShareItem.hidden = !snapshot;+ routeShareItem.disabled = !snapshot;+ return snapshot;+ }++ function syncReachShareItem() {+ var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'+ ? Archify.focus.reachabilitySnapshot()+ : null;+ reachShareItem.hidden = !snapshot;+ reachShareItem.disabled = !snapshot;+ return snapshot;+ }++ // ---- Clipboard support ----------------------------------------------+ function canCopyImage() {+ return typeof ClipboardItem !== 'undefined' &&+ navigator.clipboard &&+ typeof navigator.clipboard.write === 'function';+ }++ // ---- Raster format detection ----------------------------------------+ // canvas.toBlob('image/webp') silently returns a PNG on browsers without+ // WebP encoding (older Safari), so detect explicitly.+ function supports(format) {+ if (format === 'share-card') return true;+ if (format === 'svg' || format === 'png') return true;+ if (format === 'webm') return canRecordMotion();+ var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';+ try {+ var c = document.createElement('canvas');+ c.width = c.height = 2;+ return c.toDataURL(mime).indexOf('data:' + mime) === 0;+ } catch (_) { return false; }+ }++ // Gray out unsupported items.+ items().forEach(function (it) {+ if (it.dataset.format && !supports(it.dataset.format)) {+ it.disabled = true;+ it.title = viewerText('viewer.export.unsupported');+ }+ if ((it.dataset.action === 'copy' || it.dataset.action === 'copy-share-card') && !canCopyImage()) {+ it.disabled = true;+ it.title = viewerText('viewer.export.clipboardUnsupported');+ }+ });++ // ---- Toast ----------------------------------------------------------+ // A live region only announces CHANGES to an existing node, so the toast+ // element is created once up front and updated in place.+ var toastEl = document.createElement('div');+ toastEl.className = 'archify-toast';+ toastEl.setAttribute('role', 'status');+ document.body.appendChild(toastEl);+ var toastTimer = null;++ function toast(msg) {+ toastEl.textContent = '';+ requestAnimationFrame(function () {+ toastEl.textContent = msg;+ toastEl.classList.add('show');+ });+ clearTimeout(toastTimer);+ toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 1500);+ }++ function open(focusLast) {+ if (Archify.preset && Archify.preset.isOpen()) Archify.preset.close(false);+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });+ syncRouteShareItem();+ syncReachShareItem();+ menu.classList.add('open');+ btn.setAttribute('aria-expanded', 'true');+ var available = items().filter(function (i) { return !i.hidden && !i.disabled; });+ var target = focusLast ? available[available.length - 1] : available[0];+ if (target) target.focus();+ }+ function close(focusTrigger) {+ menu.classList.remove('open');+ btn.setAttribute('aria-expanded', 'false');+ if (focusTrigger) btn.focus();+ }+ function isOpen() { return menu.classList.contains('open'); }++ btn.addEventListener('click', function (e) {+ e.stopPropagation();+ if (isOpen()) close(false);+ else open();+ });+ // APG menu-button pattern: ArrowDown/ArrowUp on the trigger opens the menu.+ btn.addEventListener('keydown', function (e) {+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {+ e.preventDefault();+ if (!isOpen()) open(e.key === 'ArrowUp');+ }+ });+ document.addEventListener('click', function (e) {+ if (!menu.contains(e.target) && e.target !== btn) close(false);+ });++ // Keyboard navigation inside the menu.+ // Menu items: Up/Down, Home/End.+ // Esc closes + returns focus to trigger; Tab closes.+ menu.addEventListener('keydown', function (e) {+ if (e.key === 'Escape') { e.preventDefault(); close(true); return; }+ if (e.key === 'Tab') { close(false); return; }++ var available = items().filter(function (i) { return !i.hidden && !i.disabled; });+ var current = available.indexOf(document.activeElement);+ switch (e.key) {+ case 'ArrowDown':+ e.preventDefault();+ if (available.length) available[(current + 1 + available.length) % available.length].focus();+ break;+ case 'ArrowUp':+ e.preventDefault();+ if (available.length) available[(current - 1 + available.length) % available.length].focus();+ break;+ case 'Home':+ e.preventDefault();+ if (available[0]) available[0].focus();+ break;+ case 'End':+ e.preventDefault();+ if (available.length) available[available.length - 1].focus();+ break;+ }+ });++ function runExport(format) {+ var base = diagramFilename();+ close(true);+ clearExportReceipt();+ if (format === 'webm') toast(viewerText('viewer.export.recording'));+ return (format === 'share-card'+ ? rasterizeShareCard().then(function (blob) {+ recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });+ download(blob, base + '-share-card.png');+ toast(viewerText('viewer.export.downloadedShare'));+ })+ : format === 'svg'+ ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {+ var blob = new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' });+ recordExportReceipt('svg', blob, d.canonicalStateClean);+ download(blob, base + '.svg');+ })+ : format === 'webm'+ ? recordWebm().then(function (blob) {+ document.documentElement.setAttribute('data-last-motion-bytes', String(blob.size));+ recordExportReceipt('webm', blob, true);+ download(blob, base + '.webm');+ toast(viewerText('viewer.export.downloadedWebm'));+ })+ : rasterize(format).then(function (blob) {+ recordExportReceipt(format, blob, true);+ download(blob, base + '.' + format);+ })+ ).catch(function (err) {+ console.error(err);+ var technicalMessage = err && err.message ? err.message : format;+ var message = exportMessage(err);+ document.documentElement.setAttribute('data-last-export-error-format', format);+ document.documentElement.setAttribute('data-last-export-error', technicalMessage);+ if (format === 'webm') {+ var motionItem = menu.querySelector('button[data-format="webm"]');+ if (motionItem) {+ motionItem.disabled = true;+ motionItem.title = viewerText('viewer.export.motionUnavailable');+ motionItem.style.opacity = '0.5';+ }+ toast(viewerText('viewer.export.webmUnavailable'));+ return;+ }+ alert(viewerText('viewer.export.failed', { message: message }));+ });+ }++ function runRouteShareCard() {+ close(false);+ clearExportReceipt();+ var snapshot = Archify.routeProbe && Archify.routeProbe.exportSnapshot();+ var blobPromise = snapshot+ ? renderShareCard({ routeSnapshot: snapshot })+ : Promise.reject(exportError('viewer.export.routeRequired'));+ return blobPromise.then(function (blob) {+ recordExportReceipt('share-card', blob, false, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT }, 'route', true);+ download(blob, diagramFilename() + '-route-share-card.png');+ toast(viewerText('viewer.export.downloadedRoute'));+ return blob;+ }).catch(function (err) {+ console.error(err);+ var technicalMessage = err && err.message ? err.message : 'share-card';+ var message = exportMessage(err);+ document.documentElement.setAttribute('data-last-export-error-format', 'share-card');+ document.documentElement.setAttribute('data-last-export-error', technicalMessage);+ alert(viewerText('viewer.export.routeFailed', { message: message }));+ });+ }++ function runReachShareCard() {+ close(false);+ clearExportReceipt();+ var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'+ ? Archify.focus.reachabilitySnapshot()+ : null;+ var blobPromise = snapshot+ ? renderShareCard({ reachSnapshot: snapshot })+ : Promise.reject(exportError('viewer.export.reachRequired'));+ return blobPromise.then(function (blob) {+ recordExportReceipt('share-card', blob, false, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT }, 'reach', false, true);+ download(blob, diagramFilename() + '-' + snapshot.direction + '-reach-share-card.png');+ toast(viewerText('viewer.export.downloadedReach'));+ return blob;+ }).catch(function (err) {+ console.error(err);+ var technicalMessage = err && err.message ? err.message : 'share-card';+ var message = exportMessage(err);+ document.documentElement.setAttribute('data-last-export-error-format', 'share-card');+ document.documentElement.setAttribute('data-last-export-error', technicalMessage);+ alert(viewerText('viewer.export.reachFailed', { message: message }));+ });+ }++ // A compact, machine-readable receipt for local QA and generated proof+ // galleries. It exposes no diagram contents, only the completed format,+ // byte count, and whether temporary viewer state was excluded.+ function recordExportReceipt(format, blob, canonical, dimensions, variant, routeStateClean, reachStateClean) {+ document.documentElement.setAttribute('data-last-export-format', format);+ document.documentElement.setAttribute('data-last-export-bytes', String(blob.size));+ document.documentElement.setAttribute('data-last-export-canonical', canonical ? 'true' : 'false');+ if (variant) {+ document.documentElement.setAttribute('data-last-export-variant', variant);+ } else {+ document.documentElement.removeAttribute('data-last-export-variant');+ }+ if (routeStateClean === true) {+ document.documentElement.setAttribute('data-last-export-route-state-clean', 'true');+ } else {+ document.documentElement.removeAttribute('data-last-export-route-state-clean');+ }+ if (reachStateClean === true) {+ document.documentElement.setAttribute('data-last-export-reach-state-clean', 'true');+ } else {+ document.documentElement.removeAttribute('data-last-export-reach-state-clean');+ }+ if (dimensions) {+ document.documentElement.setAttribute('data-last-export-width', String(dimensions.width));+ document.documentElement.setAttribute('data-last-export-height', String(dimensions.height));+ } else {+ document.documentElement.removeAttribute('data-last-export-width');+ document.documentElement.removeAttribute('data-last-export-height');+ }+ }++ function clearExportReceipt() {+ document.documentElement.removeAttribute('data-last-export-format');+ document.documentElement.removeAttribute('data-last-export-bytes');+ document.documentElement.removeAttribute('data-last-export-canonical');+ document.documentElement.removeAttribute('data-last-export-width');+ document.documentElement.removeAttribute('data-last-export-height');+ document.documentElement.removeAttribute('data-last-export-variant');+ document.documentElement.removeAttribute('data-last-export-route-state-clean');+ document.documentElement.removeAttribute('data-last-export-reach-state-clean');+ document.documentElement.removeAttribute('data-last-export-error-format');+ document.documentElement.removeAttribute('data-last-export-error');+ }++ function writePngToClipboard(blobPromise) {+ // WebKit requires ClipboardItem to be constructed synchronously inside+ // the user gesture. Chromium accepts the same pending Promise<Blob>;+ // engines that reject promise values fall back to an awaited Blob.+ try {+ return navigator.clipboard.write([new ClipboardItem({ 'image/png': blobPromise })]);+ } catch (_) {+ return blobPromise.then(function (blob) {+ return navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);+ });+ }+ }++ function runCopyShareCard() {+ close(true);+ clearExportReceipt();+ if (!canCopyImage()) {+ alert(viewerText('viewer.export.clipboardUnsupported.period'));+ return;+ }+ var blobPromise = rasterizeShareCard();+ return writePngToClipboard(blobPromise).then(function () {+ return blobPromise.then(function (blob) {+ recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });+ toast(viewerText('viewer.export.copiedShare'));+ });+ }).catch(function (err) {+ console.error(err);+ var technicalMessage = err && err.message ? err.message : 'share-card';+ var message = exportMessage(err);+ document.documentElement.setAttribute('data-last-export-error-format', 'share-card');+ document.documentElement.setAttribute('data-last-export-error', technicalMessage);+ alert(viewerText('viewer.export.copyFailed', { message: message }));+ });+ }++ function runCopy() {+ close(true);+ clearExportReceipt();+ if (!canCopyImage()) {+ alert(viewerText('viewer.export.clipboardUnsupported.short'));+ return;+ }+ var blobPromise = rasterize('png');+ return writePngToClipboard(blobPromise).then(function () {+ toast(viewerText('viewer.export.copiedPng'));+ }).catch(function (err) {+ console.error(err);+ alert(viewerText('viewer.export.copyFailed', {+ message: exportMessage(err)+ }));+ });+ }++ menu.addEventListener('click', function (e) {+ var routeShareCardBtn = e.target.closest('button[data-action="route-share-card"]');+ if (routeShareCardBtn && !routeShareCardBtn.disabled && !routeShareCardBtn.hidden) { runRouteShareCard(); return; }++ var reachShareCardBtn = e.target.closest('button[data-action="reach-share-card"]');+ if (reachShareCardBtn && !reachShareCardBtn.disabled && !reachShareCardBtn.hidden) { runReachShareCard(); return; }++ var copyShareCardBtn = e.target.closest('button[data-action="copy-share-card"]');+ if (copyShareCardBtn && !copyShareCardBtn.disabled) { runCopyShareCard(); return; }++ var copyBtn = e.target.closest('button[data-action="copy"]');+ if (copyBtn && !copyBtn.disabled) { runCopy(); return; }++ var formatBtn = e.target.closest('button[data-format]');+ if (formatBtn && !formatBtn.disabled) { runExport(formatBtn.dataset.format); }+ });++ Archify.motion = { canRecord: canRecordMotion, recordWebm: recordWebm };+ Archify.exportMenu = {+ open: open,+ close: close,+ isOpen: isOpen,+ run: runExport,+ shareCard: rasterizeShareCard,+ downloadRouteShareCard: runRouteShareCard,+ downloadReachShareCard: runReachShareCard,+ syncRouteShare: syncRouteShareItem,+ syncReachShare: syncReachShareItem,+ copyShareCard: runCopyShareCard+ };++ // Auto-open on page load for demo/screenshot purposes: ?openExport=1+ // Wait for fonts (so the menu doesn't flash before typography lands)+ // and paint before opening. Fallback timeout for browsers without the+ // Font Loading API.+ try {+ if (new URLSearchParams(window.location.search).get('openExport') === '1') {+ var openWhenReady = function () {+ requestAnimationFrame(function () { requestAnimationFrame(open); });+ };+ if (document.fonts && document.fonts.ready) {+ document.fonts.ready.then(openWhenReady);+ } else {+ setTimeout(openWhenReady, 200);+ }+ }+ } catch (_) {}+ })();\ No newline at end of filediff --git a/viewer/focus.js b/viewer/focus.jsnew file mode 100644index 00000000..65a21419--- /dev/null+++ b/viewer/focus.js@@ -0,0 +1,1441 @@+ /* ============================================================+ Explore — stable-ID neighborhood focus + dependency-free pan/zoom.+ Renderer IDs become deep-linkable semantic hooks without turning the+ standalone artifact into a canvas editor.+ ============================================================ */+ Archify.focus = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector('svg');+ var chip = document.getElementById('focus-chip');+ var label = document.getElementById('focus-label');+ var detail = document.getElementById('focus-detail');+ var kind = document.getElementById('focus-kind');+ var context = document.getElementById('focus-context');+ var tag = document.getElementById('focus-tag');+ var semanticId = document.getElementById('focus-id');+ var evidence = document.getElementById('focus-evidence');+ var repositoryLink = document.getElementById('focus-repository');+ var evidenceLinks = document.getElementById('focus-evidence-links');+ var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');+ var relationshipList = document.getElementById('relationship-lens-list');+ var copyBtn = document.getElementById('btn-focus-copy');+ var relationsBtn = document.getElementById('btn-focus-relations');+ var clearBtn = document.getElementById('btn-focus-clear');+ var activeIds = [];+ var hoveredRelationship = null;+ var focusedRelationship = null;+ var pinnedRelationship = null;+ var pinnedRelationshipKey = null;+ var activeRelationshipPreview = null;+ var relationshipHitOverlay = null;+ var relationshipHitTargets = [];+ var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;+ var svgNamespace = 'http://www.w3.org/2000/svg';+ var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;+ var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;++ function nodes() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));+ }+ function edges() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));+ }+ function nodeLabel(node, fallback) {+ return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');+ }+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (Archify.exportMenu && typeof Archify.exportMenu.syncReachShare === 'function') {+ Archify.exportMenu.syncReachShare();+ }+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? viewerCount('viewer.passport.reach.upstream', upstreamReach)+ : viewerText('viewer.passport.reach.noUpstream'));+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? viewerCount('viewer.passport.reach.downstream', downstreamReach)+ : viewerText('viewer.passport.reach.noDownstream'));+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = viewerText(direction === 'upstream'+ ? 'viewer.passport.upstream'+ : 'viewer.passport.downstream');+ reachStatus.textContent = viewerText('viewer.passport.reach.status', {+ direction: directionLabel,+ nodes: reachableCount,+ links: result.edgeKeys.length,+ hops: result.maxDepth+ });+ reachStatus.hidden = false;+ if (Archify.exportMenu && typeof Archify.exportMenu.syncReachShare === 'function') {+ Archify.exportMenu.syncReachShare();+ }+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }+ function reachabilitySnapshot() {+ if (!activeReachability || activeIds.length !== 1 ||+ (reachabilityMode !== 'upstream' && reachabilityMode !== 'downstream') ||+ activeReachability.direction !== reachabilityMode ||+ activeReachability.originId !== activeIds[0] ||+ svg.getAttribute('data-reach-active') !== reachabilityMode) return null;++ var originId = activeReachability.originId;+ var nodeIds = activeReachability.nodeIds.slice();+ var edgeKeys = activeReachability.edgeKeys.slice();+ if (nodeIds.length < 2 || nodeIds[0] !== originId || !edgeKeys.length ||+ !activeReachability.depths || !Number.isInteger(activeReachability.maxDepth) ||+ activeReachability.maxDepth < 1) return null;++ var allNodes = nodes();+ var allEdges = edges();+ var seenNodeIds = Object.create(null);+ var seenEdgeKeys = Object.create(null);+ var nodeIdSet = Object.create(null);+ var depths = Object.create(null);+ var originNode = null;+ var measuredMaxDepth = 0;++ if (nodeIds.some(function (id) {+ var depth = activeReachability.depths[id];+ var matches = allNodes.filter(function (node) {+ return node.getAttribute('data-node-id') === id;+ });+ if (typeof id !== 'string' || !id || seenNodeIds[id] || matches.length !== 1 ||+ !matches[0].hasAttribute('data-reach-match') ||+ !Number.isInteger(depth) || depth < 0 || depth > activeReachability.maxDepth ||+ (id === originId+ ? (!matches[0].hasAttribute('data-reach-origin') || depth !== 0)+ : depth < 1)) return true;+ seenNodeIds[id] = true;+ nodeIdSet[id] = true;+ depths[id] = depth;+ measuredMaxDepth = Math.max(measuredMaxDepth, depth);+ if (id === originId) originNode = matches[0];+ return false;+ }) || !originNode || measuredMaxDepth !== activeReachability.maxDepth ||+ allNodes.filter(function (node) { return node.hasAttribute('data-reach-match'); }).length !== nodeIds.length) return null;++ var edgeRecords = [];+ if (edgeKeys.some(function (key) {+ if (typeof key !== 'string' || !key || seenEdgeKeys[key]) return true;+ var fragments = allEdges.filter(function (edge) {+ return edge.getAttribute('data-edge-key') === key;+ });+ var drawableFragments = fragments.filter(hasDrawableGeometry);+ if (!fragments.length || drawableFragments.length !== 1 ||+ !fragments.every(function (fragment) { return fragment.hasAttribute('data-reach-match'); })) return true;+ var first = fragments[0];+ var from = first.getAttribute('data-edge-from');+ var to = first.getAttribute('data-edge-to');+ var id = first.getAttribute('data-edge-id') || '';+ var labelValue = first.getAttribute('data-edge-label') || '';+ if (!nodeIdSet[from] || !nodeIdSet[to] || !fragments.every(function (fragment) {+ return fragment.getAttribute('data-edge-from') === from &&+ fragment.getAttribute('data-edge-to') === to &&+ (fragment.getAttribute('data-edge-id') || '') === id;+ })) return true;+ seenEdgeKeys[key] = true;+ edgeRecords.push({+ key: key,+ id: id,+ from: from,+ to: to,+ label: labelValue,+ depth: Math.max(depths[from], depths[to])+ });+ return false;+ })) return null;++ var liveEdgeKeys = Object.create(null);+ if (allEdges.some(function (edge) {+ if (!edge.hasAttribute('data-reach-match')) return false;+ var key = edge.getAttribute('data-edge-key');+ if (!key || !seenEdgeKeys[key]) return true;+ liveEdgeKeys[key] = true;+ return false;+ }) || Object.keys(liveEdgeKeys).length !== edgeKeys.length) return null;++ return {+ direction: reachabilityMode,+ origin: { id: originId, label: nodeLabel(originNode, originId) },+ nodeIds: nodeIds,+ depths: depths,+ maxDepth: activeReachability.maxDepth,+ edges: edgeRecords+ };+ }+ function setPassportValue(element, value) {+ var normalized = value == null ? '' : String(value).trim();+ element.textContent = normalized;+ element.hidden = !normalized;+ }+ function renderSourceEvidence(id) {+ evidenceLinks.textContent = '';+ repositoryLink.removeAttribute('href');+ repositoryLink.removeAttribute('aria-label');+ repositoryLink.textContent = '';+ var sources = Archify.sourceEvidence.node(id);+ var repository = Archify.sourceEvidence.repository();+ if (!repository || !sources.length) {+ evidence.hidden = true;+ return;+ }+ repositoryLink.textContent = repository.label + ' @ ' + repository.shortRevision;+ if (repository.href) {+ repositoryLink.href = repository.href;+ repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));+ }+ evidence.title = viewerText('viewer.passport.verificationScope');+ sources.forEach(function (source) {+ var link = document.createElement(source.href ? 'a' : 'div');+ link.className = 'semantic-passport-source';+ if (source.href) {+ link.href = source.href;+ link.target = '_blank';+ link.rel = 'noopener noreferrer';+ link.referrerPolicy = 'no-referrer';+ link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));+ }+ var name = document.createElement('strong');+ name.textContent = source.label || source.path.split('/').pop() || source.path;+ var location = document.createElement('code');+ location.textContent = source.line+ ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + (source.href ? ' ↗' : '')+ : source.href ? viewerText('viewer.passport.source.openLink') : '';+ var sourcePath = document.createElement('small');+ sourcePath.textContent = source.path;+ link.appendChild(name);+ link.appendChild(location);+ link.appendChild(sourcePath);+ evidenceLinks.appendChild(link);+ });+ evidence.hidden = false;+ }+ function renderPassport(id, node) {+ setPassportValue(detail, node.getAttribute('data-node-sublabel'));+ setPassportValue(kind, viewerKindLabel(node.getAttribute('data-node-kind') || 'node'));+ setPassportValue(context, node.getAttribute('data-node-context'));+ setPassportValue(tag, node.getAttribute('data-node-tag'));+ setPassportValue(document.getElementById('focus-brand'), node.getAttribute('data-node-brand'));+ semanticId.textContent = id;+ semanticId.hidden = false;+ renderSourceEvidence(id);+ }+ function relationshipsFor(id, byId) {+ var seen = {};+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ if (from !== id && to !== id) return;+ var edgeLabel = edge.getAttribute('data-edge-label') || '';+ var edgeKey = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + edgeLabel);+ var edgeId = edge.getAttribute('data-edge-id') || '';+ if (seen[edgeKey]) return;+ seen[edgeKey] = true;+ var direction = from === id && to === id ? 'loop' : (from === id ? 'out' : 'in');+ var neighborId = direction === 'in' ? from : to;+ var neighbor = byId[neighborId];+ relationships.push({+ key: edgeKey,+ id: edgeId,+ from: from,+ to: to,+ direction: direction,+ neighborId: neighborId,+ neighborLabel: neighbor ? nodeLabel(neighbor, neighborId) : neighborId,+ label: edgeLabel || viewerText(direction === 'loop'+ ? 'viewer.passport.relationship.loopsBack'+ : direction === 'out'+ ? 'viewer.passport.relationship.connectsTo'+ : 'viewer.passport.relationship.connectsFrom')+ });+ });+ return relationships;+ }+ function relationshipEdgeShapes(edge) {+ if (!edge) return [];+ if (/^(path|line|polyline)$/i.test(edge.tagName || '')) return [edge];+ return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));+ }+ function relationshipHitRecords() {+ var recordsByKey = {};+ var recordsById = {};+ var byId = {};+ nodes().forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });+ var records = [];+ edges().forEach(function (edge) {+ var shapes = relationshipEdgeShapes(edge);+ if (!shapes.length) return;+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var labelValue = edge.getAttribute('data-edge-label') || '';+ var edgeId = edge.getAttribute('data-edge-id') || '';+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + labelValue);+ var existing = recordsByKey[key];+ if (existing) {+ if (existing.from !== from || existing.to !== to || existing.labelValue !== labelValue || existing.id !== edgeId) {+ existing.invalid = true;+ return;+ }+ shapes.forEach(function (shape) {+ if (existing.shapes.indexOf(shape) === -1) existing.shapes.push(shape);+ });+ return;+ }+ var record = {+ key: key,+ id: edgeId,+ from: from,+ to: to,+ fromLabel: byId[from] ? nodeLabel(byId[from], from) : from,+ toLabel: byId[to] ? nodeLabel(byId[to], to) : to,+ labelValue: labelValue,+ label: labelValue || viewerText(from === to+ ? 'viewer.passport.relationship.loopsBack'+ : 'viewer.passport.relationship.connectsTo'),+ edge: edge,+ shapes: shapes,+ invalid: false+ };+ recordsByKey[key] = record;+ if (edgeId) {+ if (recordsById[edgeId]) {+ recordsById[edgeId].invalid = true;+ record.invalid = true;+ } else {+ recordsById[edgeId] = record;+ }+ }+ records.push(record);+ });+ return records.filter(function (record) { return !record.invalid && record.from && record.to; });+ }+ function relationshipRecordForKey(key) {+ return relationshipHitRecords().find(function (record) { return record.key === key; }) || null;+ }+ function pinnedRelationshipRecord() {+ return pinnedRelationshipKey ? relationshipRecordForKey(pinnedRelationshipKey) : null;+ }+ function renderRelationshipCopyAction() {+ var record = pinnedRelationshipRecord();+ if (record && record.id) {+ copyBtn.textContent = viewerText('viewer.passport.copyRelation');+ copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copyPinned'));+ } else if (pinnedRelationshipKey) {+ copyBtn.textContent = viewerText('viewer.passport.copyNode');+ copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copySource'));+ } else {+ copyBtn.textContent = viewerText('viewer.passport.copy');+ copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copy.focus'));+ }+ }+ function relationshipHitGeometry(shape, className) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('filter');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('tabindex');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-labelledby');+ clone.removeAttribute('aria-hidden');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.setAttribute('class', className || 'relationship-hit-rail');+ return clone;+ }+ function removeRelationshipPulse() {+ Array.prototype.forEach.call(svg.querySelectorAll('[data-relationship-pulse-overlay]'), function (element) {+ element.remove();+ });+ }+ function relationshipPulseGeometry(shape) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('transform');+ clone.removeAttribute('filter');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('tabindex');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-hidden');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.removeAttribute('data-focus-match');+ clone.removeAttribute('data-relationship-preview');+ clone.setAttribute('class', 'relationship-flow-pulse');+ clone.setAttribute('pathLength', '1');+ return clone;+ }+ function relationshipTokenKind(edge) {+ var shapes = relationshipEdgeShapes(edge);+ var classEvidence = [edge.getAttribute('class') || ''].concat(shapes.map(function (shape) {+ return shape.getAttribute('class') || '';+ })).join(' ');+ var from = edge.getAttribute('data-edge-from') || '';+ var to = edge.getAttribute('data-edge-to') || '';+ var source = nodes().find(function (node) { return node.getAttribute('data-node-id') === from; });+ var target = nodes().find(function (node) { return node.getAttribute('data-node-id') === to; });+ var sourceKind = source ? source.getAttribute('data-node-kind') || 'neutral' : 'neutral';+ var targetKind = target ? target.getAttribute('data-node-kind') || 'neutral' : 'neutral';+ if (/\ba-security\b/.test(classEvidence) || sourceKind === 'security' || targetKind === 'security' || targetKind === 'failure') return 'security';+ if (/\ba-dashed\b/.test(classEvidence) || sourceKind === 'messagebus' || targetKind === 'messagebus') return 'event';+ if (sourceKind === 'database' || targetKind === 'database') return 'data';+ if (targetKind === 'waiting' || targetKind === 'success') return 'state';+ return 'call';+ }+ function relationshipTokenPath(shape) {+ if (!shape) return '';+ var tagName = String(shape.tagName || '').toLowerCase();+ if (tagName === 'path') return shape.getAttribute('d') || '';+ if (tagName === 'line') {+ return 'M ' + shape.getAttribute('x1') + ' ' + shape.getAttribute('y1') ++ ' L ' + shape.getAttribute('x2') + ' ' + shape.getAttribute('y2');+ }+ if (tagName === 'polyline' && shape.points && shape.points.numberOfItems > 1) {+ var commands = [];+ for (var i = 0; i < shape.points.numberOfItems; i += 1) {+ var point = shape.points.getItem(i);+ commands.push((i === 0 ? 'M ' : 'L ') + point.x + ' ' + point.y);+ }+ return commands.join(' ');+ }+ return '';+ }+ function relationshipTokenPart(tagName, className, attrs) {+ var part = document.createElementNS(svgNamespace, tagName);+ part.setAttribute('class', className);+ Object.keys(attrs || {}).forEach(function (name) { part.setAttribute(name, attrs[name]); });+ return part;+ }+ function relationshipTokenGeometry(shape, kind, key, options) {+ options = options || {};+ var pathData = relationshipTokenPath(shape);+ if (!pathData) return null;+ var token = document.createElementNS(svgNamespace, 'g');+ token.setAttribute('class', 'semantic-flow-token ' + (options.className || 'relationship-flow-token'));+ token.setAttribute('data-token-kind', kind);+ token.setAttribute('data-token-edge-key', key);+ token.setAttribute('aria-hidden', 'true');+ token.appendChild(relationshipTokenPart('circle', 'semantic-flow-token-halo', { cx: '0', cy: '0', r: '7' }));+ if (kind === 'data') {+ token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-5', y: '-4', width: '10', height: '8', rx: '2' }));+ token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'M -2.8 -1.2 h 5.6 M -2.8 1.4 h 3.8' }));+ } else if (kind === 'event') {+ token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-7', y: '-3', width: '4', height: '6', rx: '1' }));+ token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-2', y: '-3', width: '4', height: '6', rx: '1' }));+ token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '3', y: '-3', width: '4', height: '6', rx: '1' }));+ } else if (kind === 'security') {+ token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-shape', { d: 'M 0 -5 L 4 -3.4 V 0 c 0 3 -1.6 4.5 -4 5.5 C -2.4 4.5 -4 3 -4 0 v -3.4 Z' }));+ token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'm -2 .2 1.4 1.4 L 2 -1.4' }));+ } else if (kind === 'state') {+ token.appendChild(relationshipTokenPart('circle', 'relationship-flow-token-shape', { cx: '0', cy: '0', r: '5' }));+ token.appendChild(relationshipTokenPart('circle', 'relationship-flow-token-dot', { cx: '0', cy: '0', r: '1.35' }));+ } else {+ token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'M -5 -3 L -1 0 L -5 3 M 0 -3 L 4 0 L 0 3' }));+ }+ var motion = document.createElementNS(svgNamespace, 'animateMotion');+ motion.setAttribute('path', pathData);+ motion.setAttribute('dur', options.duration || '1.2s');+ motion.setAttribute('begin', '0s');+ motion.setAttribute('fill', 'freeze');+ motion.setAttribute('rotate', 'auto');+ motion.setAttribute('calcMode', 'spline');+ motion.setAttribute('keyTimes', '0;1');+ motion.setAttribute('keySplines', '.2 0 .2 1');+ token.appendChild(motion);+ return token;+ }+ function createSemanticFlowToken(edge, shape, options) {+ if (!edge || !shape) return null;+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ return relationshipTokenGeometry(shape, relationshipTokenKind(edge), key, options);+ }+ Archify.flowTokens = {+ create: createSemanticFlowToken,+ kind: function (edge) { return relationshipTokenKind(edge); },+ path: relationshipTokenPath+ };+ function renderRelationshipPulse(key) {+ removeRelationshipPulse();+ if (!key || document.documentElement.getAttribute('data-embed') === 'true') return false;+ if (document.hidden || (Archify.motionGovernor && Archify.motionGovernor.isPaused())) return false;+ if (reducedMotionQuery && reducedMotionQuery.matches) return false;+ var matchingEdges = edges().filter(function (edge) {+ return edge.getAttribute('data-edge-key') === key;+ });+ if (!matchingEdges.length) return false;+ var overlay = document.createElementNS(svgNamespace, 'g');+ overlay.setAttribute('class', 'relationship-pulse-overlay');+ overlay.setAttribute('data-relationship-pulse-overlay', '');+ overlay.setAttribute('data-relationship-pulse-key', key);+ overlay.setAttribute('aria-hidden', 'true');+ var tokenAdded = false;+ matchingEdges.forEach(function (edge) {+ var wrapper = document.createElementNS(svgNamespace, 'g');+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));+ var shapes = relationshipEdgeShapes(edge);+ shapes.forEach(function (shape) {+ wrapper.appendChild(relationshipPulseGeometry(shape));+ });+ if (!tokenAdded && shapes.length) {+ var tokenKind = relationshipTokenKind(edge);+ var token = relationshipTokenGeometry(shapes[0], tokenKind, key);+ if (token) {+ wrapper.appendChild(token);+ overlay.setAttribute('data-relationship-token-kind', tokenKind);+ tokenAdded = true;+ }+ }+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);+ });+ if (!overlay.childNodes.length) return false;+ var finishPulse = function () {+ if (overlay.parentNode) overlay.remove();+ };+ overlay.addEventListener('animationend', finishPulse, { once: true });+ overlay.addEventListener('animationcancel', finishPulse, { once: true });+ var firstNode = svg.querySelector('[data-node-id]');+ if (firstNode) svg.insertBefore(overlay, firstNode);+ else svg.appendChild(overlay);+ return true;+ }+ function clearRelationshipPreview(options) {+ options = options || {};+ if (directPreviewTimer) window.clearTimeout(directPreviewTimer);+ directPreviewTimer = null;+ removeRelationshipPulse();+ activeRelationshipPreview = null;+ svg.removeAttribute('data-relationship-preview-active');+ svg.removeAttribute('data-relationship-direct-active');+ if (options.clearPin === true) {+ pinnedRelationship = null;+ pinnedRelationshipKey = null;+ svg.removeAttribute('data-relationship-pin-active');+ }+ chip.removeAttribute('data-relationship-previewing');+ edges().forEach(function (edge) { edge.removeAttribute('data-relationship-preview'); });+ nodes().forEach(function (node) {+ node.removeAttribute('data-relationship-preview-node');+ node.removeAttribute('data-relationship-preview-source');+ node.removeAttribute('data-relationship-preview-target');+ });+ Array.prototype.forEach.call(relationshipList.querySelectorAll('[data-preview-active]'), function (button) {+ button.removeAttribute('data-preview-active');+ });+ relationshipHitTargets.forEach(function (target) {+ target.setAttribute('aria-pressed', pinnedRelationshipKey && target.getAttribute('data-relationship-key') === pinnedRelationshipKey ? 'true' : 'false');+ target.removeAttribute('data-preview-active');+ });+ renderRelationshipCopyAction();+ requestLensPlacement();+ }+ function previewRelationship(button, options) {+ options = options || {};+ if (pinnedRelationshipKey && pinnedRelationship && button !== pinnedRelationship) return;+ clearRelationshipPreview();+ if (!button) return;+ var key = button.getAttribute('data-relationship-key');+ var from = button.getAttribute('data-relationship-from');+ var to = button.getAttribute('data-relationship-to');+ if (!key || !from || !to) return;+ svg.setAttribute('data-relationship-preview-active', key);+ if (options.direct === true) svg.setAttribute('data-relationship-direct-active', key);+ edges().forEach(function (edge) {+ if (edge.getAttribute('data-edge-key') === key) edge.setAttribute('data-relationship-preview', '');+ });+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (id !== from && id !== to) return;+ node.setAttribute('data-relationship-preview-node', '');+ if (id === from) node.setAttribute('data-relationship-preview-source', '');+ if (id === to) node.setAttribute('data-relationship-preview-target', '');+ });+ button.setAttribute('data-preview-active', 'true');+ if (!chip.hidden && options.direct !== true) chip.setAttribute('data-relationship-previewing', 'true');+ activeRelationshipPreview = button;+ renderRelationshipPulse(key);+ requestLensPlacement();+ }+ function syncRelationshipPreview() {+ var next = pinnedRelationship || focusedRelationship || hoveredRelationship;+ if (next === activeRelationshipPreview) return;+ previewRelationship(next, { direct: !!(next && next.hasAttribute('data-relationship-hit-key')) });+ }+ function directRelationshipBlocked() {+ return html.getAttribute('data-embed') === 'true' ||+ html.getAttribute('data-guide-open') === 'true' ||+ container.classList.contains('is-panning') ||+ (activeIds.length > 0 && !pinnedRelationshipKey) ||+ svg.hasAttribute('data-story-active') ||+ svg.hasAttribute('data-route-picking') ||+ svg.hasAttribute('data-route-active') ||+ svg.hasAttribute('data-lens-active') ||+ svg.hasAttribute('data-chapter-preview');+ }+ function scheduleDirectRelationshipPreview(target) {+ if (directPreviewTimer) window.clearTimeout(directPreviewTimer);+ if (pinnedRelationshipKey) return;+ directPreviewTimer = window.setTimeout(function () {+ directPreviewTimer = null;+ if (pinnedRelationshipKey || hoveredRelationship !== target || directRelationshipBlocked()) return;+ previewRelationship(target, { direct: true });+ }, reducedMotionQuery && reducedMotionQuery.matches ? 0 : 90);+ }+ function relationshipHitTarget(key) {+ return relationshipHitTargets.find(function (target) {+ return target.getAttribute('data-relationship-key') === key;+ }) || null;+ }+ function revealPinnedRelationship(record) {+ function reveal() {+ if (!record || pinnedRelationshipKey !== record.key) return true;+ if (!Archify.view || typeof Archify.view.reveal !== 'function') return false;+ Archify.view.reveal([record.from, record.to], { reason: 'relationship-direct' });+ return true;+ }+ if (!reveal()) requestAnimationFrame(reveal);+ }+ function inspectRelationship(key, options) {+ options = options || {};+ if (html.getAttribute('data-embed') === 'true') return false;+ if (directPreviewTimer) window.clearTimeout(directPreviewTimer);+ directPreviewTimer = null;+ hoveredRelationship = null;+ focusedRelationship = null;+ if (pinnedRelationshipKey === key) {+ if (options.toggle === false) return true;+ clear({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var record = relationshipRecordForKey(key);+ if (!record) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ set(record.from, { toggle: false, updateUrl: false });+ var row = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-key]')).find(function (candidate) {+ return candidate.getAttribute('data-relationship-key') === key;+ });+ if (!row) return false;+ previewRelationship(row);+ pinnedRelationship = row;+ pinnedRelationshipKey = key;+ svg.setAttribute('data-relationship-pin-active', key);+ var target = relationshipHitTarget(key);+ if (target) target.setAttribute('aria-pressed', 'true');+ renderRelationshipCopyAction();+ summary.textContent = viewerText('viewer.passport.relationship.pinned', {+ from: record.fromLabel,+ to: record.toLabel,+ label: record.label+ });+ revealPinnedRelationship(record);+ if (options.updateUrl !== false && record.id) {+ try { history.replaceState(null, '', location.pathname + location.search + '#relation=' + encodeURIComponent(record.id)); } catch (_) {}+ }+ return true;+ }+ function inspectRelationshipById(id, options) {+ var record = relationshipHitRecords().find(function (item) { return item.id === id; });+ return record ? inspectRelationship(record.key, options) : false;+ }+ function installRelationshipHitTargets() {+ if (html.getAttribute('data-embed') === 'true') return 0;+ var records = relationshipHitRecords();+ if (!records.length) return 0;+ relationshipHitOverlay = document.createElementNS(svgNamespace, 'g');+ relationshipHitOverlay.setAttribute('class', 'relationship-hit-overlay');+ relationshipHitOverlay.setAttribute('data-relationship-hit-overlay', '');+ relationshipHitOverlay.setAttribute('role', 'group');+ relationshipHitOverlay.setAttribute('aria-label', viewerText('viewer.passport.relationship.explorer'));+ var relationshipHelp = document.createElementNS(svgNamespace, 'desc');+ relationshipHelp.id = 'archify-relationship-help';+ relationshipHelp.textContent = viewerText('viewer.passport.relationship.help');+ relationshipHitOverlay.appendChild(relationshipHelp);+ records.forEach(function (record, index) {+ var target = document.createElementNS(svgNamespace, 'g');+ target.setAttribute('class', 'relationship-hit-target');+ target.setAttribute('data-relationship-hit-key', record.key);+ target.setAttribute('data-relationship-key', record.key);+ target.setAttribute('data-relationship-from', record.from);+ target.setAttribute('data-relationship-to', record.to);+ if (record.id) target.setAttribute('data-relationship-id', record.id);+ target.setAttribute('role', 'button');+ target.setAttribute('tabindex', index === 0 ? '0' : '-1');+ target.setAttribute('aria-pressed', 'false');+ target.setAttribute('aria-describedby', relationshipHelp.id);+ var description = viewerText('viewer.passport.relationship.inspect', {+ index: index + 1,+ total: records.length,+ from: record.fromLabel,+ to: record.toLabel,+ label: record.label+ });+ target.setAttribute('aria-label', description);+ var title = document.createElementNS(svgNamespace, 'title');+ title.textContent = record.fromLabel + ' \u2192 ' + record.toLabel + ' \u00b7 ' + record.label;+ target.appendChild(title);+ record.shapes.forEach(function (shape) {+ target.appendChild(relationshipHitGeometry(shape));+ target.appendChild(relationshipHitGeometry(shape, 'relationship-focus-rail'));+ });+ if (target.childNodes.length > 1) {+ relationshipHitTargets.push(target);+ relationshipHitOverlay.appendChild(target);+ }+ });+ if (!relationshipHitTargets.length) return 0;+ var firstNode = svg.querySelector('[data-node-id]');+ var nodeLayer = firstNode;+ while (nodeLayer && nodeLayer.parentNode && nodeLayer.parentNode !== svg) nodeLayer = nodeLayer.parentNode;+ if (nodeLayer && nodeLayer.parentNode === svg) svg.insertBefore(relationshipHitOverlay, nodeLayer);+ else svg.appendChild(relationshipHitOverlay);++ relationshipHitOverlay.addEventListener('pointerdown', function (event) {+ if (event.target.closest('[data-relationship-hit-key]')) event.stopPropagation();+ });+ relationshipHitOverlay.addEventListener('pointerover', function (event) {+ if (event.pointerType === 'touch') return;+ if (finePointerQuery && !finePointerQuery.matches) return;+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target || directRelationshipBlocked() || pinnedRelationshipKey) return;+ if (event.relatedTarget && target.contains(event.relatedTarget)) return;+ hoveredRelationship = target;+ scheduleDirectRelationshipPreview(target);+ });+ relationshipHitOverlay.addEventListener('pointerout', function (event) {+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target || (event.relatedTarget && target.contains(event.relatedTarget))) return;+ if (hoveredRelationship === target) hoveredRelationship = null;+ syncRelationshipPreview();+ });+ relationshipHitOverlay.addEventListener('focusin', function (event) {+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target || directRelationshipBlocked()) return;+ focusedRelationship = target;+ if (!pinnedRelationshipKey) previewRelationship(target, { direct: true });+ });+ relationshipHitOverlay.addEventListener('focusout', function (event) {+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target || (event.relatedTarget && target.contains(event.relatedTarget))) return;+ if (focusedRelationship === target) focusedRelationship = null;+ syncRelationshipPreview();+ });+ relationshipHitOverlay.addEventListener('click', function (event) {+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target || directRelationshipBlocked()) return;+ event.preventDefault();+ event.stopPropagation();+ focusedRelationship = null;+ hoveredRelationship = null;+ inspectRelationship(target.getAttribute('data-relationship-key'));+ });+ relationshipHitOverlay.addEventListener('keydown', function (event) {+ var target = event.target.closest('[data-relationship-hit-key]');+ if (!target) return;+ if (event.key === 'Escape' && pinnedRelationshipKey) {+ event.preventDefault();+ clear({ updateUrl: false });+ return;+ }+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ focusedRelationship = null;+ hoveredRelationship = null;+ inspectRelationship(target.getAttribute('data-relationship-key'));+ return;+ }+ if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft' && event.key !== 'ArrowDown' && event.key !== 'ArrowUp' && event.key !== 'Home' && event.key !== 'End') return;+ var index = relationshipHitTargets.indexOf(target);+ if (event.key === 'Home') index = 0;+ else if (event.key === 'End') index = relationshipHitTargets.length - 1;+ else if (event.key === 'ArrowRight' || event.key === 'ArrowDown') index = (index + 1) % relationshipHitTargets.length;+ else index = (index - 1 + relationshipHitTargets.length) % relationshipHitTargets.length;+ event.preventDefault();+ relationshipHitTargets.forEach(function (item, itemIndex) { item.setAttribute('tabindex', itemIndex === index ? '0' : '-1'); });+ try { relationshipHitTargets[index].focus({ preventScroll: true }); }+ catch (_) { try { relationshipHitTargets[index].focus(); } catch (_) {} }+ });+ return relationshipHitTargets.length;+ }+ function renderRelationshipLens(id, byId) {+ hoveredRelationship = null;+ focusedRelationship = null;+ clearRelationshipPreview({ clearPin: true });+ renderPassport(id, byId[id]);+ var relationships = relationshipsFor(id, byId);+ chip.removeAttribute('data-relations-expanded');+ relationsBtn.setAttribute('aria-expanded', 'false');+ relationsBtn.textContent = viewerCount('viewer.passport.relationship.count', relationships.length);+ relationsBtn.setAttribute('aria-label', viewerCount('viewer.passport.relationship.show', relationships.length));+ var counts = { out: 0, in: 0, loop: 0 };+ relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });+ summary.textContent = viewerText('viewer.passport.relationship.summary', {+ out: counts.out,+ in: counts.in,+ loops: counts.loop ? viewerText('viewer.passport.relationship.loops', { count: counts.loop }) : ''+ });+ renderReachabilityControls(id);+ relationshipList.textContent = '';+ if (!relationships.length) {+ var empty = document.createElement('p');+ empty.className = 'relationship-lens-empty';+ empty.textContent = viewerText('viewer.passport.relationship.none');+ relationshipList.appendChild(empty);+ return;+ }++ [+ { id: 'out', label: viewerText('viewer.passport.relationship.group.out') },+ { id: 'in', label: viewerText('viewer.passport.relationship.group.in') },+ { id: 'loop', label: viewerText('viewer.passport.relationship.group.loop') }+ ].forEach(function (group) {+ var items = relationships.filter(function (relationship) { return relationship.direction === group.id; });+ if (!items.length) return;+ var section = document.createElement('div');+ section.className = 'relationship-lens-group';+ var heading = document.createElement('span');+ heading.className = 'relationship-lens-group-title';+ heading.textContent = group.label + ' · ' + items.length;+ section.appendChild(heading);+ items.forEach(function (relationship) {+ var button = document.createElement('button');+ button.type = 'button';+ button.className = 'relationship-lens-row';+ button.setAttribute('data-direction', relationship.direction);+ button.setAttribute('data-relationship-target', relationship.neighborId);+ button.setAttribute('data-relationship-key', relationship.key);+ button.setAttribute('data-relationship-from', relationship.from);+ button.setAttribute('data-relationship-to', relationship.to);+ if (relationship.id) button.setAttribute('data-relationship-id', relationship.id);+ button.setAttribute('aria-label', viewerText('viewer.passport.relationship.row', {+ group: group.label,+ relationship: relationship.label,+ neighbor: relationship.neighborLabel+ }));+ var direction = document.createElement('span');+ direction.className = 'relationship-lens-direction';+ direction.setAttribute('aria-hidden', 'true');+ direction.textContent = viewerText(relationship.direction === 'out'+ ? 'viewer.passport.relationship.direction.out'+ : relationship.direction === 'in'+ ? 'viewer.passport.relationship.direction.in'+ : 'viewer.passport.relationship.direction.loop');+ var target = document.createElement('strong');+ target.textContent = relationship.neighborLabel;+ var relation = document.createElement('small');+ relation.textContent = relationship.label;+ button.appendChild(direction);+ button.appendChild(target);+ button.appendChild(relation);+ section.appendChild(button);+ });+ relationshipList.appendChild(section);+ });+ }+ var lensFrame = 0;+ function placeRelationshipLens() {+ lensFrame = 0;+ if (chip.hidden || activeIds.length !== 1) return;+ var node = svg.querySelector('[data-node-id="' + activeIds[0] + '"]');+ if (!node) return;+ var containerRect = container.getBoundingClientRect();+ var nodeRect = node.getBoundingClientRect();+ if (containerRect.bottom <= 0 || containerRect.top >= window.innerHeight) return;+ var padding = window.innerWidth <= 720 ? 8 : 16;+ var visibleTop = Math.max(padding, -containerRect.top + padding);+ var visibleBottom = Math.min(containerRect.height - padding, window.innerHeight - containerRect.top - padding);+ var maxTop = Math.max(padding, visibleBottom - chip.offsetHeight);+ var minTop = Math.min(visibleTop, maxTop);+ var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;+ var mobile = window.innerWidth <= 720;+ var previewingOnMobile = mobile && chip.getAttribute('data-relationship-previewing') === 'true';+ var compactOnMobile = mobile && chip.getAttribute('data-relations-expanded') !== 'true';+ var preferred;+ if (compactOnMobile) {+ var nodeTop = nodeRect.top - containerRect.top;+ var nodeBottom = nodeRect.bottom - containerRect.top;+ var gap = 10;+ var above = nodeTop - chip.offsetHeight - gap;+ var below = nodeBottom + gap;+ if (above >= visibleTop) preferred = above;+ else if (below + chip.offsetHeight <= visibleBottom - 56) preferred = below;+ else preferred = nodeCenter < (visibleTop + visibleBottom) / 2+ ? Math.max(minTop, visibleBottom - chip.offsetHeight - 56)+ : visibleTop;+ } else if (previewingOnMobile) {+ var pinnedTop = visibleTop;+ var pinnedBottom = Math.max(minTop, visibleBottom - chip.offsetHeight - 56);+ preferred = nodeCenter < (visibleTop + visibleBottom) / 2 ? pinnedBottom : pinnedTop;+ } else {+ preferred = nodeCenter - chip.offsetHeight / 2;+ }+ var top = Math.max(minTop, Math.min(maxTop, preferred));+ var chipRect = chip.getBoundingClientRect();+ var safeGap = 10;+ var protectViewerChrome = !mobile || compactOnMobile || previewingOnMobile;+ var protectedRects = (protectViewerChrome+ ? [svg.querySelector('[data-legend]'), container.querySelector('.diagram-nav')]+ : [])+ .filter(function (element) {+ if (!element || element.hidden) return false;+ var style = window.getComputedStyle(element);+ return style.display !== 'none' && style.visibility !== 'hidden';+ })+ .map(function (element) { return element.getBoundingClientRect(); })+ .filter(function (rect) {+ return rect.width > 0 && rect.height > 0 &&+ chipRect.left < rect.right + safeGap && chipRect.right > rect.left - safeGap;+ });+ if (protectedRects.length) {+ var candidates = [top, minTop, maxTop];+ protectedRects.forEach(function (rect) {+ candidates.push(+ rect.top - containerRect.top - chip.offsetHeight - safeGap,+ rect.bottom - containerRect.top + safeGap+ );+ });+ var valid = candidates.map(function (candidate) {+ return Math.max(minTop, Math.min(maxTop, candidate));+ }).filter(function (candidate, index, all) {+ if (all.indexOf(candidate) !== index) return false;+ var candidateTop = containerRect.top + candidate;+ var candidateBottom = candidateTop + chip.offsetHeight;+ return protectedRects.every(function (rect) {+ return candidateBottom <= rect.top - safeGap || candidateTop >= rect.bottom + safeGap;+ });+ });+ valid.sort(function (first, second) {+ return Math.abs(first - preferred) - Math.abs(second - preferred);+ });+ if (valid.length) top = valid[0];+ }+ chip.style.top = Math.round(top) + 'px';+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();+ }+ function requestLensPlacement() {+ if (lensFrame) return;+ lensFrame = requestAnimationFrame(placeRelationshipLens);+ }+ function clear(options) {+ options = options || {};+ var restoreNode = options.restoreFocus === true && activeIds.length === 1+ ? svg.querySelector('[data-node-id="' + activeIds[0] + '"]')+ : null;+ clearReachability({ updateUrl: false });+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {+ Archify.intentTrace.clear({ announce: false });+ }+ hoveredRelationship = null;+ focusedRelationship = null;+ clearRelationshipPreview({ clearPin: true });+ activeIds = [];+ svg.removeAttribute('data-focus-active');+ nodes().forEach(function (node) {+ node.removeAttribute('data-focus-match');+ node.removeAttribute('data-focus-selected');+ node.setAttribute('aria-pressed', 'false');+ });+ edges().forEach(function (edge) { edge.removeAttribute('data-focus-match'); });+ chip.hidden = true;+ label.textContent = '';+ detail.textContent = '';+ detail.hidden = true;+ kind.textContent = '';+ kind.hidden = true;+ context.textContent = '';+ context.hidden = true;+ tag.textContent = '';+ tag.hidden = true;+ semanticId.textContent = '';+ semanticId.hidden = true;+ evidence.hidden = true;+ evidenceLinks.textContent = '';+ repositoryLink.removeAttribute('href');+ repositoryLink.textContent = '';+ summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;+ relationshipList.textContent = '';+ copyBtn.textContent = viewerText('viewer.passport.copy');+ copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copy.focus'));+ relationsBtn.textContent = viewerText('viewer.passport.relations');+ relationsBtn.setAttribute('aria-label', viewerText('viewer.passport.relations.show'));+ relationsBtn.setAttribute('aria-expanded', 'false');+ chip.removeAttribute('data-relations-expanded');+ chip.style.removeProperty('top');+ if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {+ Archify.view.reset({ automatic: true });+ }+ if (options.updateUrl !== false) {+ try { history.replaceState(null, '', location.pathname + location.search); } catch (_) {}+ }+ if (restoreNode) {+ try { restoreNode.focus({ preventScroll: true }); }+ catch (_) { try { restoreNode.focus(); } catch (_) {} }+ }+ }++ function setMany(ids, options) {+ options = options || {};+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (Archify.semanticLens && Archify.semanticLens.active()) {+ Archify.semanticLens.clear({ updateUrl: false, preserveView: true, closePanel: true });+ }+ if (options.preserveRoute !== true && Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {+ Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });+ }+ var nodeList = nodes();+ var byId = {};+ nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });+ var normalized = [];+ (ids || []).forEach(function (id) {+ if (byId[id] && normalized.indexOf(id) === -1) normalized.push(id);+ });+ if (!normalized.length) return false;+ if (normalized.length === activeIds.length && normalized.every(function (id, index) { return activeIds[index] === id; }) && options.toggle !== false) {+ clear();+ return true;+ }++ clear({ updateUrl: false, preserveView: true });+ activeIds = normalized;+ var selected = {};+ var related = {};+ var seenEdges = {};+ var matchedEdges = 0;+ normalized.forEach(function (id) { selected[id] = true; related[id] = true; });+ var selectionMode = options.mode === 'selection' || normalized.length > 1;++ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var match = selectionMode ? selected[from] && selected[to] : selected[from] || selected[to];+ if (!match) return;+ edge.setAttribute('data-focus-match', '');+ if (!selectionMode) { related[from] = true; related[to] = true; }+ var edgeKey = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!seenEdges[edgeKey]) { seenEdges[edgeKey] = true; matchedEdges += 1; }+ });+ nodeList.forEach(function (node) {+ var nodeId = node.getAttribute('data-node-id');+ if (related[nodeId]) node.setAttribute('data-focus-match', '');+ if (selected[nodeId]) {+ node.setAttribute('data-focus-selected', '');+ node.setAttribute('aria-pressed', 'true');+ }+ });+ svg.setAttribute('data-focus-active', normalized.join(' '));+ var defaultLabel = normalized.length === 1+ ? nodeLabel(byId[normalized[0]], normalized[0])+ : viewerText('viewer.guided.chapter.selectedNodes', { count: normalized.length });+ label.textContent = options.label || defaultLabel;+ chip.hidden = options.hideChip === true || normalized.length !== 1 || selectionMode;+ if (!chip.hidden) {+ renderRelationshipLens(normalized[0], byId);+ requestLensPlacement();+ }+ if (options.updateUrl !== false) {+ var key = options.urlKey || 'focus';+ var value = options.urlValue || normalized[0];+ try { history.replaceState(null, '', location.pathname + location.search + '#' + key + '=' + encodeURIComponent(value)); } catch (_) {}+ }+ return true;+ }++ function set(id, options) {+ options = options || {};+ options.mode = 'neighborhood';+ return setMany([id], options);+ }++ function fallbackCopy(value) {+ var field = document.createElement('textarea');+ field.value = value;+ field.setAttribute('readonly', '');+ field.style.position = 'fixed';+ field.style.opacity = '0';+ document.body.appendChild(field);+ field.select();+ var copied = false;+ try { copied = document.execCommand('copy'); } catch (_) {}+ field.remove();+ return copied;+ }++ function copyFocusLink() {+ if (activeIds.length !== 1) return Promise.resolve(false);+ var record = pinnedRelationshipRecord();+ var relationId = record && record.id;+ var value = location.href.replace(/#.*$/, '') + (relationId+ ? '#relation=' + encodeURIComponent(relationId)+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));+ var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })+ : Promise.resolve(fallbackCopy(value));+ return copy.then(function (copied) {+ copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');+ copyBtn.setAttribute('aria-label', copied+ ? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')+ : viewerText(relationId ? 'viewer.passport.copy.pinned.failed' : 'viewer.passport.copy.focused.failed'));+ window.setTimeout(function () {+ renderRelationshipCopyAction();+ }, 1600);+ return copied;+ });+ }++ svg.addEventListener('click', function (event) {+ if (container.getAttribute('data-just-panned') === 'true') return;+ var node = event.target.closest('[data-node-id]');+ if (node) {+ var id = node.getAttribute('data-node-id');+ set(id);+ if (activeIds.indexOf(id) !== -1 && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });+ }+ }+ else if (activeIds.length) clear();+ });+ svg.addEventListener('keydown', function (event) {+ var node = event.target.closest('[data-node-id]');+ if (!node || (event.key !== 'Enter' && event.key !== ' ')) return;+ event.preventDefault();+ var id = node.getAttribute('data-node-id');+ set(id);+ if (activeIds.indexOf(id) !== -1 && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });+ }+ });+ clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });+ copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });+ relationsBtn.addEventListener('click', function () {+ var expanded = chip.getAttribute('data-relations-expanded') === 'true';+ if (expanded) chip.removeAttribute('data-relations-expanded');+ else chip.setAttribute('data-relations-expanded', 'true');+ relationsBtn.setAttribute('aria-expanded', expanded ? 'false' : 'true');+ relationsBtn.setAttribute('aria-label', viewerText(expanded+ ? 'viewer.passport.relations.show'+ : 'viewer.passport.relations.hide'));+ requestLensPlacement();+ });+ relationshipList.addEventListener('click', function (event) {+ var button = event.target.closest('[data-relationship-target]');+ if (!button) return;+ var id = button.getAttribute('data-relationship-target');+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ set(id, { toggle: false });+ if (Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'relationship' });+ }+ var node = svg.querySelector('[data-node-id="' + id + '"]');+ if (node) {+ try { node.focus({ preventScroll: true }); } catch (_) { try { node.focus(); } catch (_) {} }+ }+ });+ relationshipList.addEventListener('pointerover', function (event) {+ if (event.pointerType === 'touch') return;+ if (finePointerQuery && !finePointerQuery.matches) return;+ var button = event.target.closest('[data-relationship-key]');+ if (!button || !relationshipList.contains(button)) return;+ if (event.relatedTarget && button.contains(event.relatedTarget)) return;+ hoveredRelationship = button;+ syncRelationshipPreview();+ });+ relationshipList.addEventListener('pointerout', function (event) {+ var button = event.target.closest('[data-relationship-key]');+ if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;+ if (hoveredRelationship === button) hoveredRelationship = null;+ syncRelationshipPreview();+ });+ relationshipList.addEventListener('focusin', function (event) {+ var button = event.target.closest('[data-relationship-key]');+ if (!button) return;+ focusedRelationship = button;+ syncRelationshipPreview();+ });+ relationshipList.addEventListener('focusout', function (event) {+ var button = event.target.closest('[data-relationship-key]');+ if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;+ if (focusedRelationship === button) focusedRelationship = null;+ syncRelationshipPreview();+ });+ relationshipList.addEventListener('keydown', function (event) {+ if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp' && event.key !== 'Home' && event.key !== 'End') return;+ var buttons = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-target]'));+ if (!buttons.length) return;+ var index = buttons.indexOf(document.activeElement);+ if (event.key === 'Home') index = 0;+ else if (event.key === 'End') index = buttons.length - 1;+ else if (event.key === 'ArrowDown') index = Math.min(buttons.length - 1, Math.max(0, index + 1));+ else index = Math.max(0, index < 0 ? 0 : index - 1);+ event.preventDefault();+ buttons[index].focus();+ });+ document.addEventListener('click', function (event) {+ var target = event.target;+ if (chip.hidden || !target || typeof target.closest !== 'function' || chip.contains(target)) return;+ if (container.getAttribute('data-just-panned') === 'true') return;+ if (target.closest('[data-node-id], [data-relationship-hit-key], .overview-map')) return;+ clear();+ }, true);+ window.addEventListener('scroll', requestLensPlacement, { passive: true });+ window.addEventListener('resize', requestLensPlacement);+ container.addEventListener('scroll', requestLensPlacement, { passive: true });+ document.addEventListener('visibilitychange', function () {+ if (document.hidden) removeRelationshipPulse();+ });+ function syncRelationshipMotionPreference(event) {+ if (event.matches) removeRelationshipPulse();+ }+ if (reducedMotionQuery) {+ if (typeof reducedMotionQuery.addEventListener === 'function') {+ reducedMotionQuery.addEventListener('change', syncRelationshipMotionPreference);+ } else if (typeof reducedMotionQuery.addListener === 'function') {+ reducedMotionQuery.addListener(syncRelationshipMotionPreference);+ }+ }++ installRelationshipHitTargets();++ function syncFocusFromHash() {+ try {+ var params = new URLSearchParams(location.hash.replace(/^#/, ''));+ var relation = params.get('relation');+ var initial = params.get('focus');+ var reach = params.get('reach');+ if (relation) {+ if (html.getAttribute('data-embed') === 'true' ||+ !inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });+ }+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }+ else if (!params.get('view')) clear({ updateUrl: false });+ } catch (_) {}+ }++ window.addEventListener('hashchange', syncFocusFromHash);+ syncFocusFromHash();++ return {+ set: set,+ setMany: setMany,+ clear: clear,+ copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,+ reachabilitySnapshot: reachabilitySnapshot,+ inspectRelationship: inspectRelationship,+ inspectRelationshipById: inspectRelationshipById,+ reposition: requestLensPlacement,+ relationship: function () {+ var record = pinnedRelationshipRecord();+ return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;+ },+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },+ active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }+ };+ })();\ No newline at end of filediff --git a/viewer/guided-views.js b/viewer/guided-views.jsnew file mode 100644index 00000000..da96dc9c--- /dev/null+++ b/viewer/guided-views.js@@ -0,0 +1,1730 @@+ Archify.guidedViews = (function () {+ var data = document.getElementById('archify-guided-views-data');+ var panel = document.getElementById('guided-views');+ var prev = document.getElementById('guided-view-prev');+ var next = document.getElementById('guided-view-next');+ var all = document.getElementById('guided-view-all');+ var play = document.getElementById('guided-view-play');+ var playIcon = document.getElementById('guided-view-play-icon');+ var playLabel = document.getElementById('guided-view-play-label');+ var beatLink = document.getElementById('guided-view-beat-link');+ var beatLinkLabel = document.getElementById('guided-view-beat-link-label');+ var progressBar = document.getElementById('guided-view-progress-bar');+ var count = document.getElementById('guided-view-count');+ var handoffReceipt = document.getElementById('guided-view-handoff');+ var label = document.getElementById('guided-view-label');+ var note = document.getElementById('guided-view-note');+ var trail = document.getElementById('guided-view-trail');+ var storyCaption = document.getElementById('guided-story-caption');+ var storyCaptionIndex = document.getElementById('guided-story-caption-index');+ var storyCaptionRoute = document.getElementById('guided-story-caption-route');+ var storyCaptionDetail = document.getElementById('guided-story-caption-detail');+ var storyCaptionNext = document.getElementById('guided-story-caption-next');+ var storyCaptionNextLabel = document.getElementById('guided-story-caption-next-label');+ var chapterIndex = document.getElementById('guided-view-index');+ var chapterList = document.getElementById('guided-view-chapters');+ var shareCue = document.getElementById('share-chapter-cue');+ var shareCueState = document.getElementById('share-chapter-state');+ var shareCueCount = document.getElementById('share-chapter-count');+ var shareCueLabel = document.getElementById('share-chapter-label');+ var shareCueNote = document.getElementById('share-chapter-note');+ var shareCueRoute = document.getElementById('share-chapter-route');+ var shareCueProgress = document.getElementById('share-chapter-progress-bar');+ var svg = document.querySelector('.diagram-container svg');+ var views = [];+ var activeIndex = -1;+ var playing = false;+ var storyBeatTimer = null;+ var storyBeatIndex = -1;+ var storyBeatStartedAt = 0;+ var storyBeatElapsedMs = 0;+ var storyBeatDwellMs = 0;+ var storyPlaybackGeneration = 0;+ var storyFollowGeneration = 0;+ var storyPlaybackScope = 'story';+ var storyPlaybackComplete = false;+ var beatLinkFeedbackTimer = null;+ var momentRestoreGeneration = 0;+ var storySteps = [];+ var storyPulseOwnerToken = 0;+ var storyPulseGeneration = 0;+ var autoplayPending = false;+ var VIEW_INTERVAL_MS = 3200;+ var STORY_FOLLOW_MIN_DWELL_MS = 1100;+ var STORY_FOLLOW_DURATION_MS = 320;+ var chapterButtons = [];+ var handoffGeneration = 0;+ var currentHandoff = null;+ var previewGeneration = 0;+ var pointerPreviewIntent = null;+ var focusPreviewIntent = null;+ var activePreviewIndex = -1;+ var previewOwnerToken = 0;++ try { views = JSON.parse(data.textContent || '[]'); } catch (_) { views = []; }+ if (!views.length) return { count: 0, active: function () { return null; } };+ var canonicalNodeIds = {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ canonicalNodeIds[node.getAttribute('data-node-id')] = true;+ });+ views.forEach(function (view) {+ var seen = {};+ view.focus = (view.focus || []).filter(function (id) {+ if (!canonicalNodeIds[id] || seen[id]) return false;+ seen[id] = true;+ return true;+ });+ });+ // Establish the compact cold state before exposing the panel so the+ // full Director cannot flash during first paint. Hash restoration runs+ // in the same task and replaces this state before paint when valid.+ panel.setAttribute('data-active-view', 'all');+ panel.hidden = false;+ panel.setAttribute('data-view-interval-ms', String(VIEW_INTERVAL_MS));+ panel.setAttribute('data-story-follow-min-dwell-ms', String(STORY_FOLLOW_MIN_DWELL_MS));+ buildChapterIndex();++ function reducedMotion() {+ return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);+ }++ function findNode(id) {+ return Array.prototype.find.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ return node.getAttribute('data-node-id') === id;+ }) || null;+ }++ function chapterDelta(previous, destination) {+ var previousFocus = previous ? previous.focus : [];+ var destinationFocus = destination ? destination.focus : [];+ var previousIds = {};+ var destinationIds = {};+ previousFocus.forEach(function (id) { previousIds[id] = true; });+ destinationFocus.forEach(function (id) { destinationIds[id] = true; });+ return {+ stay: previousFocus.filter(function (id) { return destinationIds[id]; }),+ enter: destinationFocus.filter(function (id) { return !previousIds[id]; }),+ leave: previousFocus.filter(function (id) { return !destinationIds[id]; })+ };+ }++ function chapterAnchor(previous, destination, outgoingBeatIndex, delta) {+ if (!previous || !destination) return '';+ var stayIds = {};+ delta.stay.forEach(function (id) { stayIds[id] = true; });+ var activeBeat = outgoingBeatIndex >= 0 ? previous.focus[outgoingBeatIndex] : '';+ if (activeBeat && stayIds[activeBeat]) return activeBeat;+ for (var index = previous.focus.length - 1; index >= 0; index -= 1) {+ if (stayIds[previous.focus[index]]) return previous.focus[index];+ }+ return '';+ }++ function handoffMotionAllowed() {+ if (document.hidden || reducedMotion()) return false;+ if (document.documentElement.getAttribute('data-embed') === 'true') return false;+ if (window.matchMedia && window.matchMedia('print').matches) return false;+ return !(Archify.motionGovernor && Archify.motionGovernor.capable && Archify.motionGovernor.isPaused());+ }++ function classifyHandoff(delta, anchor) {+ var roles = {};+ delta.stay.forEach(function (id) { roles[id] = 'stay'; });+ delta.enter.forEach(function (id) { roles[id] = 'enter'; });+ delta.leave.forEach(function (id) { roles[id] = 'leave'; });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ var id = node.getAttribute('data-node-id');+ var role = roles[id] || '';+ if (role) node.setAttribute('data-chapter-role', role);+ else node.removeAttribute('data-chapter-role');+ });+ svg.setAttribute('data-chapter-handoff', anchor ? 'anchor' : 'no-anchor');+ if (anchor) svg.setAttribute('data-chapter-anchor', anchor);+ else svg.removeAttribute('data-chapter-anchor');+ }++ function drawHandoffAnchor(id) {+ var node = findNode(id);+ if (!node) return null;+ var box;+ try { box = node.getBBox(); } catch (_) { return null; }+ var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');+ var ring = document.createElementNS('http://www.w3.org/2000/svg', 'rect');+ overlay.setAttribute('class', 'chapter-handoff-overlay');+ overlay.setAttribute('data-chapter-handoff-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ ring.setAttribute('class', 'chapter-handoff-anchor');+ ring.setAttribute('x', String(box.x - 8));+ ring.setAttribute('y', String(box.y - 8));+ ring.setAttribute('width', String(box.width + 16));+ ring.setAttribute('height', String(box.height + 16));+ ring.setAttribute('rx', '10');+ overlay.appendChild(ring);+ svg.appendChild(overlay);+ return overlay;+ }++ function clearHandoffPresentation() {+ svg.removeAttribute('data-chapter-handoff');+ svg.removeAttribute('data-chapter-anchor');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-handoff-overlay]'), function (overlay) { overlay.remove(); });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-role]'), function (node) { node.removeAttribute('data-chapter-role'); });+ if (handoffReceipt) {+ handoffReceipt.hidden = true;+ handoffReceipt.textContent = '';+ }+ }++ function completeHandoff(handoff, outcome) {+ if (!handoff || currentHandoff !== handoff) return false;+ if (handoff.holdTimer) clearTimeout(handoff.holdTimer);+ handoff.holdTimer = null;+ currentHandoff = null;+ clearHandoffPresentation();+ if (handoff.ownerToken && Archify.motionGovernor) Archify.motionGovernor.release(handoff.ownerToken);+ handoff.resolve({ id: handoff.id, state: outcome || 'complete', anchor: handoff.anchor || null });+ syncStoryControlsDisabled();+ syncChapterPreview();+ return true;+ }++ function settleHandoff(reason) {+ var handoff = currentHandoff;+ if (!handoff) return false;+ if (handoff.holdTimer) clearTimeout(handoff.holdTimer);+ handoff.holdTimer = null;+ if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'settled', true);+ else if (Archify.view && Archify.view.reveal) Archify.view.reveal(handoff.focus, { instant: true, reason: reason || 'settled' });+ completeHandoff(handoff, reason || 'settled');+ return true;+ }++ function cancelHandoff(reason) {+ var handoff = currentHandoff;+ if (!handoff) return false;+ if (handoff.holdTimer) clearTimeout(handoff.holdTimer);+ handoff.holdTimer = null;+ if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'manual', false);+ completeHandoff(handoff, reason || 'manual');+ return true;+ }++ function afterHandoff(callback) {+ if (!currentHandoff) { callback(); return; }+ currentHandoff.finished.then(callback);+ }++ function beginHandoff(previousIndex, nextIndex, previous, destination, outgoingBeatIndex, reason) {+ if (!Archify.view || !Archify.view.reveal) return null;+ if (!previous || previousIndex === nextIndex) {+ Archify.view.reveal(destination.focus, { reason: reason });+ return null;+ }+ var delta = chapterDelta(previous, destination);+ var anchor = chapterAnchor(previous, destination, outgoingBeatIndex, delta);+ if (!handoffMotionAllowed()) {+ Archify.view.reveal(destination.focus, { instant: true, reason: reason });+ return null;+ }+ var resolver;+ var handoff = {+ id: ++handoffGeneration,+ mode: anchor ? 'holding' : 'no-anchor',+ anchor: anchor,+ focus: destination.focus.slice(),+ holdTimer: null,+ camera: null,+ ownerToken: 0,+ finished: new Promise(function (resolve) { resolver = resolve; }),+ resolve: resolver+ };+ currentHandoff = handoff;+ classifyHandoff(delta, anchor);+ if (anchor) {+ drawHandoffAnchor(anchor);+ var node = findNode(anchor);+ var nodeLabel = node ? (node.getAttribute('data-node-label') || anchor) : anchor;+ handoffReceipt.textContent = viewerText('viewer.guided.handoff', {+ from: (previousIndex + 1 < 10 ? '0' : '') + (previousIndex + 1),+ to: (nextIndex + 1 < 10 ? '0' : '') + (nextIndex + 1),+ label: nodeLabel+ });+ handoffReceipt.hidden = false;+ }+ if (Archify.motionGovernor) {+ handoff.ownerToken = Archify.motionGovernor.claim('handoff', function () {+ if (currentHandoff === handoff) settleHandoff('preempted');+ });+ }+ var startCamera = function () {+ if (currentHandoff !== handoff) return;+ handoff.holdTimer = null;+ handoff.mode = 'settling';+ svg.setAttribute('data-chapter-handoff', anchor ? 'settling' : 'no-anchor');+ handoff.camera = Archify.view.reveal(destination.focus, { reason: reason, duration: 420 });+ if (handoff.camera && handoff.camera.finished) {+ handoff.camera.finished.then(function (outcome) {+ if (currentHandoff === handoff) completeHandoff(handoff, outcome && outcome.state || 'complete');+ });+ } else {+ completeHandoff(handoff, 'complete');+ }+ };+ if (anchor) handoff.holdTimer = setTimeout(startCamera, 110);+ else startCamera();+ return handoff;+ }++ function centerChapterButton(button) {+ if (!button || !chapterList) return false;+ var target = Math.max(0, button.offsetLeft - (chapterList.clientWidth - button.offsetWidth) / 2);+ if (typeof chapterList.scrollTo === 'function') chapterList.scrollTo({ left: target, behavior: 'auto' });+ else chapterList.scrollLeft = target;+ return true;+ }++ function focusChapterButton(index) {+ if (!chapterButtons.length) return false;+ index = Math.max(0, Math.min(chapterButtons.length - 1, index));+ chapterButtons.forEach(function (button, buttonIndex) {+ button.setAttribute('tabindex', buttonIndex === index ? '0' : '-1');+ });+ chapterButtons[index].focus();+ centerChapterButton(chapterButtons[index]);+ return true;+ }++ function buildChapterIndex() {+ chapterButtons = [];+ chapterList.textContent = '';+ views.forEach(function (view, index) {+ var item = document.createElement('li');+ var button = document.createElement('button');+ button.type = 'button';+ button.className = 'guided-view-chapter';+ button.setAttribute('data-guided-view-id', view.id);+ button.setAttribute('aria-pressed', 'false');+ button.setAttribute('tabindex', index === 0 ? '0' : '-1');+ button.setAttribute('aria-label', viewerText('viewer.guided.chapter.open', {+ index: index + 1,+ total: views.length,+ label: view.label,+ count: view.focus.length+ }));+ button.title = view.label + ' — ' + (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }));+ var position = document.createElement('span');+ position.className = 'guided-view-chapter-index';+ position.setAttribute('aria-hidden', 'true');+ position.textContent = (index + 1 < 10 ? '0' : '') + (index + 1);+ var title = document.createElement('span');+ title.className = 'guided-view-chapter-title';+ title.textContent = view.label;+ var stops = document.createElement('em');+ stops.className = 'guided-view-chapter-count';+ stops.textContent = viewerCount('viewer.guided.chapter.stop', view.focus.length);+ var delta = document.createElement('span');+ delta.className = 'guided-view-chapter-delta';+ delta.hidden = true;+ delta.setAttribute('aria-hidden', 'true');+ ['stay', 'enter', 'leave'].forEach(function (kind) {+ var value = document.createElement('span');+ value.setAttribute('data-delta-kind', kind);+ delta.appendChild(value);+ });+ button.appendChild(position);+ button.appendChild(title);+ button.appendChild(stops);+ button.appendChild(delta);+ item.appendChild(button);+ chapterList.appendChild(item);+ chapterButtons.push(button);+ });+ }++ function syncChapterIndex() {+ chapterButtons.forEach(function (button, index) {+ var current = index === activeIndex;+ var stops = button.querySelector('.guided-view-chapter-count');+ var deltaLabel = button.querySelector('.guided-view-chapter-delta');+ var position = activeIndex < 0 ? 'available' : (current ? 'current' : (index < activeIndex ? 'before' : 'after'));+ button.setAttribute('data-chapter-position', position);+ button.setAttribute('aria-pressed', current ? 'true' : 'false');+ button.setAttribute('tabindex', current || (activeIndex < 0 && index === 0) ? '0' : '-1');+ if (current) {+ stops.hidden = false;+ deltaLabel.hidden = true;+ button.removeAttribute('data-chapter-delta');+ button.setAttribute('aria-label', viewerText('viewer.guided.chapter.current', {+ index: index + 1,+ total: views.length,+ label: views[index].label,+ count: views[index].focus.length+ }));+ button.title = viewerText('viewer.guided.chapter.current.title', {+ label: views[index].label,+ count: views[index].focus.length+ });+ } else {+ var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);+ var compact = '=' + delta.stay.length + ' +' + delta.enter.length + ' \u2212' + delta.leave.length;+ var expanded = viewerText('viewer.guided.chapter.delta.expanded', {+ stay: delta.stay.length,+ enter: delta.enter.length,+ leave: delta.leave.length+ });+ stops.hidden = true;+ deltaLabel.hidden = false;+ deltaLabel.querySelector('[data-delta-kind="stay"]').textContent = '=' + delta.stay.length;+ deltaLabel.querySelector('[data-delta-kind="enter"]').textContent = '+' + delta.enter.length;+ deltaLabel.querySelector('[data-delta-kind="leave"]').textContent = '\u2212' + delta.leave.length;+ button.setAttribute('data-chapter-delta', compact);+ button.setAttribute('aria-label', viewerText('viewer.guided.chapter.delta.aria', {+ index: index + 1,+ total: views.length,+ label: views[index].label,+ delta: expanded+ }));+ button.title = viewerText('viewer.guided.chapter.delta.title', {+ label: views[index].label,+ delta: compact+ });+ }+ if (current) button.setAttribute('aria-current', 'step');+ else button.removeAttribute('aria-current');+ if (button.parentElement) button.parentElement.setAttribute('data-chapter-position', position);+ });+ if (activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ }++ function chapterPreviewBlocked() {+ if (document.hidden || playing || currentHandoff) return true;+ if (document.documentElement.getAttribute('data-embed') === 'true') return true;+ if (window.matchMedia && window.matchMedia('print').matches) return true;+ if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return true;+ if (svg.hasAttribute('data-lens-active') || svg.hasAttribute('data-legend-preview-active')) return true;+ if (svg.hasAttribute('data-relationship-preview-active') || svg.hasAttribute('data-intent-trace-active')) return true;+ return activeIndex < 0 && svg.hasAttribute('data-focus-active');+ }++ function clearChapterPreviewPresentation() {+ svg.removeAttribute('data-chapter-preview');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-preview-role]'), function (node) {+ node.removeAttribute('data-chapter-preview-role');+ });+ chapterButtons.forEach(function (button) { button.removeAttribute('data-preview-active'); });+ activePreviewIndex = -1;+ if (previewOwnerToken && Archify.motionGovernor) {+ var token = previewOwnerToken;+ previewOwnerToken = 0;+ Archify.motionGovernor.release(token);+ }+ }++ function clearChapterPreview(options) {+ options = options || {};+ previewGeneration += 1;+ if (options.clearIntents !== false) {+ pointerPreviewIntent = null;+ focusPreviewIntent = null;+ }+ clearChapterPreviewPresentation();+ return true;+ }++ function winningChapterPreviewIntent() {+ return [pointerPreviewIntent, focusPreviewIntent].filter(function (intent) {+ return intent && intent.index >= 0 && intent.index < views.length && intent.index !== activeIndex;+ }).sort(function (left, right) { return right.generation - left.generation; })[0] || null;+ }++ function showChapterPreview(index) {+ if (index < 0 || index >= views.length || index === activeIndex || chapterPreviewBlocked()) {+ clearChapterPreviewPresentation();+ return false;+ }+ if (activePreviewIndex === index && svg.getAttribute('data-chapter-preview') === views[index].id) return true;+ clearChapterPreviewPresentation();+ var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);+ var roles = {};+ delta.stay.forEach(function (id) { roles[id] = 'stay'; });+ delta.enter.forEach(function (id) { roles[id] = 'enter'; });+ delta.leave.forEach(function (id) { roles[id] = 'leave'; });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ var role = roles[node.getAttribute('data-node-id')];+ if (role) node.setAttribute('data-chapter-preview-role', role);+ });+ svg.setAttribute('data-chapter-preview', views[index].id);+ chapterButtons[index].setAttribute('data-preview-active', 'true');+ activePreviewIndex = index;+ if (Archify.motionGovernor && Archify.motionGovernor.capable) {+ previewOwnerToken = Archify.motionGovernor.claim('chapter-preview', function () {+ previewOwnerToken = 0;+ clearChapterPreviewPresentation();+ });+ }+ return true;+ }++ function syncChapterPreview() {+ var intent = winningChapterPreviewIntent();+ if (!intent || chapterPreviewBlocked()) {+ clearChapterPreviewPresentation();+ return false;+ }+ return showChapterPreview(intent.index);+ }++ function setChapterPreviewIntent(source, index) {+ var intent = { index: index, generation: ++previewGeneration };+ if (source === 'pointer') pointerPreviewIntent = intent;+ else focusPreviewIntent = intent;+ if (playing) pausePlayback();+ return syncChapterPreview();+ }++ function clearChapterPreviewIntent(source, index) {+ var intent = source === 'pointer' ? pointerPreviewIntent : focusPreviewIntent;+ if (intent && (typeof index !== 'number' || intent.index === index)) {+ if (source === 'pointer') pointerPreviewIntent = null;+ else focusPreviewIntent = null;+ previewGeneration += 1;+ }+ return syncChapterPreview();+ }++ function hoverCapable() {+ return !!(window.matchMedia && window.matchMedia('(hover: hover)').matches);+ }++ function sharePlaybackRequested() {+ try { return new URLSearchParams(location.search).get('play') === '1'; }+ catch (_) { return false; }+ }++ autoplayPending = sharePlaybackRequested();+ if (autoplayPending) {+ document.documentElement.setAttribute('data-share-playback', 'true');+ setAutoplayState('pending');+ }++ function setAutoplayState(state) {+ if (state) panel.setAttribute('data-autoplay', state);+ else panel.removeAttribute('data-autoplay');+ renderShareCue();+ }++ function shareCueStatus(state) {+ return {+ pending: viewerText('viewer.guided.state.ready'),+ playing: viewerText('viewer.guided.state.playing'),+ complete: viewerText('viewer.guided.state.settled'),+ interrupted: viewerText('viewer.guided.state.paused'),+ pinned: viewerText('viewer.guided.state.pinned'),+ 'reduced-motion': viewerText('viewer.guided.state.still')+ }[state] || viewerText('viewer.guided.state.ready');+ }++ function shareCueBeatCopy(state, view, stops) {+ var total = stops.length;+ var activeStop = storyBeatIndex >= 0 ? stops[storyBeatIndex] : null;+ if ((state === 'playing' || state === 'interrupted') && activeStop) {+ return viewerText('viewer.guided.share.step', {+ index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),+ total: (total < 10 ? '0' : '') + total,+ label: activeStop.textContent+ });+ }+ if (state === 'pinned' && activeStop) {+ return storyBeatCopy(storySteps[storyBeatIndex], total);+ }+ if (state === 'reduced-motion' && activeStop && hashBeatMatchesCurrent()) {+ return viewerText('viewer.guided.share.staticMoment', {+ step: viewerText('viewer.guided.share.step', {+ index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),+ total: (total < 10 ? '0' : '') + total,+ label: activeStop.textContent+ })+ });+ }+ if (state === 'complete') return viewerText('viewer.guided.share.complete', {+ count: total,+ note: view.note || viewerText('viewer.guided.share.settled')+ });+ if (state === 'reduced-motion') return viewerText('viewer.guided.share.staticPath', { count: total });+ if (state === 'pending') return viewerText('viewer.guided.share.ready', { count: total });+ return view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length });+ }++ function renderShareCue() {+ if (!shareCue) return;+ var view = activeIndex >= 0 ? views[activeIndex] : null;+ var shareMode = document.documentElement.getAttribute('data-share-playback') === 'true';+ var embedMode = document.documentElement.getAttribute('data-embed') === 'true';+ var pinnedMode = !shareMode && embedMode && hashBeatMatchesCurrent();+ if (pinnedMode) document.documentElement.setAttribute('data-share-moment', 'true');+ else document.documentElement.removeAttribute('data-share-moment');+ shareCue.hidden = !(embedMode && view && (shareMode || pinnedMode));+ if (shareCue.hidden) return;+ var state = pinnedMode ? 'pinned' : (panel.getAttribute('data-autoplay') || 'pending');+ var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));+ var route = stops.map(function (stop, index) {+ if (index === 0) return stop.textContent;+ var kind = stop.getAttribute('data-story-link');+ var separator = kind === 'forward' ? '\u2192' : (kind === 'reverse' ? '\u2190' : (kind === 'multiple' ? '\u21c4' : '\u00b7'));+ return separator + ' ' + stop.textContent;+ }).join(' ');+ var beatCopy = shareCueBeatCopy(state, view, stops);+ shareCue.setAttribute('data-state', state);+ shareCue.setAttribute('aria-live', state === 'playing' ? 'off' : 'polite');+ shareCueState.textContent = shareCueStatus(state);+ shareCueCount.textContent = viewerText('viewer.guided.share.chapter', {+ index: (activeIndex + 1 < 10 ? '0' : '') + (activeIndex + 1),+ total: (views.length < 10 ? '0' : '') + views.length+ });+ shareCueLabel.textContent = view.label;+ shareCueNote.textContent = beatCopy;+ shareCueRoute.textContent = route;+ shareCue.setAttribute('aria-label', viewerText('viewer.guided.share.aria', {+ state: shareCueStatus(state),+ index: activeIndex + 1,+ total: views.length,+ label: view.label,+ beat: beatCopy,+ route: route+ }));+ }++ function setShareCueProgress(fraction) {+ if (!shareCueProgress) return;+ shareCueProgress.style.animation = 'none';+ shareCueProgress.style.setProperty('--guided-progress-start', String(Math.max(0, Math.min(1, fraction))));+ shareCueProgress.style.transform = 'scaleX(' + Math.max(0, Math.min(1, fraction)) + ')';+ }++ function startShareCueProgress(fraction, duration) {+ if (!shareCueProgress) return;+ setShareCueProgress(fraction || 0);+ void shareCueProgress.offsetWidth;+ shareCueProgress.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';+ }++ function storyNodeLabel(node, fallback) {+ if (!node) return fallback;+ return node.getAttribute('data-node-label') ||+ (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');+ }++ function storyEdgeKey(edge) {+ return edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ }++ function uniqueStoryEdges(edgeList) {+ var positions = {};+ var unique = [];+ edgeList.forEach(function (edge) {+ var key = storyEdgeKey(edge);+ if (!Object.prototype.hasOwnProperty.call(positions, key)) {+ positions[key] = unique.length;+ unique.push(edge);+ return;+ }+ var index = positions[key];+ if (!storyGeometry(unique[index]).length && storyGeometry(edge).length) unique[index] = edge;+ });+ return unique;+ }++ function storyStep(view, index, edgeList, byId) {+ var id = view.focus[index];+ var node = byId[id];+ var previousId = index > 0 ? view.focus[index - 1] : '';+ var forward = [];+ var reverse = [];+ if (previousId) {+ edgeList.forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ if (from === previousId && to === id) forward.push(edge);+ else if (from === id && to === previousId) reverse.push(edge);+ });+ }+ forward = uniqueStoryEdges(forward);+ reverse = uniqueStoryEdges(reverse);+ var edges = forward.concat(reverse).sort(function (left, right) {+ return edgeList.indexOf(left) - edgeList.indexOf(right);+ });+ var relation = index === 0 ? 'start' : (!edges.length ? 'group' : (+ edges.length === 1 && forward.length === 1 ? 'forward' :+ (edges.length === 1 && reverse.length === 1 ? 'reverse' : 'multiple')+ ));+ return {+ index: index,+ nodeId: id,+ nodeLabel: storyNodeLabel(byId[id], id),+ previousId: previousId,+ previousLabel: previousId ? storyNodeLabel(byId[previousId], previousId) : '',+ relation: relation,+ edges: edges,+ edgeKeys: edges.map(storyEdgeKey),+ edgeLabels: edges.map(function (edge) { return edge.getAttribute('data-edge-label') || ''; }).filter(function (value, edgeIndex, values) {+ return value && values.indexOf(value) === edgeIndex;+ }),+ responsibility: node ? (node.getAttribute('data-node-sublabel') || '') : '',+ context: node ? (node.getAttribute('data-node-context') || '') : ''+ };+ }++ function storyBeatCopy(step, total) {+ if (!step) return '';+ var position = (step.index + 1 < 10 ? '0' : '') + (step.index + 1);+ var countValue = (total < 10 ? '0' : '') + total;+ if (step.relation === 'start') return viewerText('viewer.guided.beat.start', { index: position, total: countValue, label: step.nodeLabel });+ if (step.relation === 'forward') return viewerText('viewer.guided.beat.forward', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });+ if (step.relation === 'reverse') return viewerText('viewer.guided.beat.reverse', { index: position, total: countValue, from: step.nodeLabel, to: step.previousLabel });+ if (step.relation === 'multiple') return viewerText('viewer.guided.beat.multiple', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel, count: step.edges.length });+ return viewerText('viewer.guided.beat.group', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });+ }++ function storyBeatAria(step, total) {+ var prefix = viewerText('viewer.guided.beat.aria.prefix', { index: step.index + 1, total: total, label: step.nodeLabel });+ if (step.relation === 'start') return prefix + viewerText('viewer.guided.beat.aria.start');+ if (step.relation === 'forward') return prefix + viewerText('viewer.guided.beat.aria.forward', { from: step.previousLabel });+ if (step.relation === 'reverse') return prefix + viewerText('viewer.guided.beat.aria.reverse', { from: step.previousLabel, to: step.nodeLabel });+ if (step.relation === 'multiple') return prefix + viewerText('viewer.guided.beat.aria.multiple', { from: step.previousLabel, count: step.edges.length });+ return prefix + viewerText('viewer.guided.beat.aria.group', { from: step.previousLabel });+ }++ function storyCaptionRouteCopy(step) {+ if (step.relation === 'start') return step.nodeLabel + ' · ' + viewerText('viewer.guided.caption.start');+ if (step.relation === 'reverse') return step.previousLabel + ' ← ' + step.nodeLabel;+ if (step.relation === 'multiple') return step.previousLabel + ' ⇄ ' + step.nodeLabel;+ if (step.relation === 'group') return step.previousLabel + ' · ' + step.nodeLabel;+ return step.previousLabel + ' → ' + step.nodeLabel;+ }++ function storyCaptionDetailCopy(step) {+ var facts = [];+ if (step.relation === 'group') facts.push(viewerText('viewer.guided.caption.grouped'));+ else if (step.edgeLabels.length) facts.push(step.edgeLabels.slice(0, 3).join(' + ') + (step.edgeLabels.length > 3 ? viewerText('viewer.guided.caption.more', { count: step.edgeLabels.length - 3 }) : ''));+ else if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.reverse'));+ else if (step.relation === 'multiple') facts.push(viewerText('viewer.guided.caption.relationships', { count: step.edges.length }));+ else if (step.relation !== 'start') facts.push(viewerText('viewer.guided.caption.relationship'));+ if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.direction', { from: step.nodeLabel, to: step.previousLabel }));+ if (step.responsibility) facts.push(step.responsibility);+ if (step.context) facts.push(step.context);+ if (!facts.length) facts.push(viewerText('viewer.guided.caption.starting'));+ return facts.join(' · ');+ }++ function renderStoryCaption(step, total, nextStep) {+ if (!storyCaption) return;+ if (!step) {+ storyCaption.hidden = true;+ storyCaption.removeAttribute('data-story-caption');+ storyCaptionNext.hidden = true;+ storyCaptionNextLabel.textContent = '';+ return;+ }+ storyCaption.hidden = false;+ storyCaption.setAttribute('data-story-caption', step.relation);+ storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');+ storyCaptionIndex.textContent = (step.index + 1 < 10 ? '0' : '') + (step.index + 1) + ' / ' + (total < 10 ? '0' : '') + total;+ storyCaptionRoute.textContent = storyCaptionRouteCopy(step);+ storyCaptionDetail.textContent = storyCaptionDetailCopy(step);+ storyCaptionNext.hidden = !nextStep;+ storyCaptionNextLabel.textContent = nextStep+ ? ((nextStep.index + 1 < 10 ? '0' : '') + (nextStep.index + 1) + ' · ' + nextStep.nodeLabel)+ : '';+ storyCaption.style.animation = 'none';+ void storyCaption.offsetWidth;+ storyCaption.style.removeProperty('animation');+ }++ function storyMomentLink() {+ var view = activeIndex >= 0 ? views[activeIndex] : null;+ var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;+ if (!view || !step) return '';+ var url = new URL(location.href);+ url.searchParams.delete('play');+ url.hash = 'view=' + encodeURIComponent(view.id) + '&beat=' + encodeURIComponent(step.nodeId);+ return url.href;+ }++ function fallbackCopyStoryMoment(value) {+ var field = document.createElement('textarea');+ field.value = value;+ field.setAttribute('readonly', '');+ field.style.position = 'fixed';+ field.style.opacity = '0';+ document.body.appendChild(field);+ field.select();+ var copied = false;+ try { copied = document.execCommand('copy'); } catch (_) {}+ field.remove();+ return copied;+ }++ function resetBeatLinkFeedback() {+ if (beatLinkFeedbackTimer) clearTimeout(beatLinkFeedbackTimer);+ beatLinkFeedbackTimer = null;+ beatLink.removeAttribute('data-copy-state');+ beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');+ }++ function syncBeatLink() {+ var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;+ var available = !!(activeIndex >= 0 && step && !currentHandoff);+ beatLink.disabled = !available;+ if (!beatLink.hasAttribute('data-copy-state')) beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');+ var description = available+ ? viewerText('viewer.guided.beatLink', { index: step.index + 1, total: storySteps.length, label: step.nodeLabel })+ : viewerText('viewer.guided.selectBeatLink');+ beatLink.setAttribute('aria-label', description);+ beatLink.title = description;+ }++ function setBeatLinkFeedback(copied) {+ resetBeatLinkFeedback();+ beatLink.setAttribute('data-copy-state', copied ? 'copied' : 'failed');+ beatLinkLabel.textContent = viewerText(copied ? 'viewer.guided.copied' : 'viewer.guided.copyFailed');+ beatLink.setAttribute('aria-label', viewerText(copied ? 'viewer.guided.momentCopied' : 'viewer.guided.momentCopyFailed'));+ beatLinkFeedbackTimer = setTimeout(function () {+ resetBeatLinkFeedback();+ syncBeatLink();+ }, 1600);+ }++ function copyStoryMomentLink() {+ if (playing) pausePlayback();+ var value = storyMomentLink();+ if (!value) return Promise.resolve(false);+ var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopyStoryMoment(value); })+ : Promise.resolve(fallbackCopyStoryMoment(value));+ return copy.then(function (copied) {+ setBeatLinkFeedback(copied);+ return copied;+ });+ }++ function hashBeatMatchesCurrent() {+ var view = activeIndex >= 0 ? views[activeIndex] : null;+ var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;+ if (!view || !step) return false;+ try {+ var params = new URLSearchParams(location.hash.replace(/^#/, ''));+ return params.get('view') === view.id && params.get('beat') === step.nodeId;+ } catch (_) { return false; }+ }++ function storyMotionAllowed() {+ if (document.hidden || reducedMotion()) return false;+ if (document.documentElement.getAttribute('data-motion') !== 'live') return false;+ if (document.documentElement.getAttribute('data-embed') === 'true' &&+ document.documentElement.getAttribute('data-share-playback') !== 'true') return false;+ if (window.matchMedia && window.matchMedia('print').matches) return false;+ return !(Archify.motionGovernor && Archify.motionGovernor.isPaused());+ }++ function storyAutomaticPlaybackAllowed() {+ if (document.hidden || reducedMotion()) return false;+ if (window.matchMedia && window.matchMedia('print').matches) return false;+ if (Archify.motionGovernor && Archify.motionGovernor.capable) return !Archify.motionGovernor.isPaused();+ return true;+ }++ function clearStoryPulse(options) {+ options = options || {};+ storyPulseGeneration += 1;+ Array.prototype.forEach.call(svg.querySelectorAll('.story-trail-flow[data-story-pulse]'), function (flow) {+ flow.removeAttribute('data-story-pulse');+ });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-carrier-overlay]'), function (overlay) {+ overlay.remove();+ });+ if (storyPulseOwnerToken && options.release !== false && Archify.motionGovernor) {+ var token = storyPulseOwnerToken;+ storyPulseOwnerToken = 0;+ Archify.motionGovernor.release(token);+ } else if (options.release === false) storyPulseOwnerToken = 0;+ }++ function pulseStoryStep(step) {+ clearStoryPulse();+ if (!step || (step.relation !== 'forward' && step.relation !== 'reverse') || step.edges.length !== 1 || !storyMotionAllowed()) return false;+ var flows = Array.prototype.slice.call(svg.querySelectorAll('.story-trail-flow[data-story-beat-step="' + step.index + '"]'));+ if (!flows.length) return false;+ var pulseGeneration = storyPulseGeneration;+ if (Archify.motionGovernor && Archify.motionGovernor.capable) {+ storyPulseOwnerToken = Archify.motionGovernor.claim('story', function () {+ clearStoryPulse({ release: false });+ });+ }+ flows.forEach(function (flow) { flow.setAttribute('data-story-pulse', 'true'); });+ if (Archify.flowTokens && typeof Archify.flowTokens.create === 'function') {+ var edge = step.edges[0];+ var shapes = storyGeometry(edge);+ var carrier = shapes.length ? Archify.flowTokens.create(edge, shapes[0], {+ className: 'story-flow-token',+ duration: '0.78s'+ }) : null;+ if (carrier) {+ var carrierOverlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');+ var carrierWrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');+ carrierOverlay.setAttribute('class', 'story-carrier-overlay');+ carrierOverlay.setAttribute('data-story-carrier-overlay', '');+ carrierOverlay.setAttribute('aria-hidden', 'true');+ if (edge.hasAttribute('transform')) carrierWrapper.setAttribute('transform', edge.getAttribute('transform'));+ carrier.setAttribute('data-story-carrier-token', '');+ carrier.setAttribute('data-story-beat-step', String(step.index));+ carrierWrapper.appendChild(carrier);+ carrierOverlay.appendChild(carrierWrapper);+ var firstNode = svg.querySelector('[data-node-id]');+ while (firstNode && firstNode.parentNode !== svg) firstNode = firstNode.parentNode;+ if (firstNode) svg.insertBefore(carrierOverlay, firstNode);+ else svg.appendChild(carrierOverlay);+ }+ }+ void flows[0].getBoundingClientRect();+ flows[0].addEventListener('animationend', function () {+ if (pulseGeneration === storyPulseGeneration) clearStoryPulse();+ }, { once: true });+ return true;+ }++ function stopStoryBeatTimer(options) {+ options = options || {};+ storyPlaybackGeneration += 1;+ if (storyBeatTimer && options.preserveElapsed === true && storyBeatStartedAt) {+ storyBeatElapsedMs = Math.min(storyBeatDwellMs, storyBeatElapsedMs + Math.max(0, Date.now() - storyBeatStartedAt));+ }+ if (storyBeatTimer) clearTimeout(storyBeatTimer);+ storyBeatTimer = null;+ storyBeatStartedAt = 0;+ }++ function centerStoryStop(stop) {+ if (!stop || !trail) return false;+ var bounds = stop.getBoundingClientRect();+ var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;+ var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);+ trail.scrollLeft = target;+ return true;+ }++ function storyBeatDwell(total) {+ return Math.max(STORY_FOLLOW_MIN_DWELL_MS, VIEW_INTERVAL_MS / Math.max(1, total));+ }++ function clearStoryFollow() {+ storyFollowGeneration += 1;+ svg.removeAttribute('data-story-follow');+ panel.removeAttribute('data-story-follow');+ panel.removeAttribute('data-story-follow-node');+ }++ function storyFrameIds(step) {+ if (!step) return [];+ var ids = [];+ if (step.index > 0 && storySteps[step.index - 1]) ids.push(storySteps[step.index - 1].nodeId);+ ids.push(step.nodeId);+ if (step.index + 1 < storySteps.length) ids.push(storySteps[step.index + 1].nodeId);+ return ids;+ }++ function followStoryStep(step, options) {+ options = options || {};+ if (!step || document.hidden) return false;+ if (!Archify.view || typeof Archify.view.reveal !== 'function') {+ var deferredIndex = step.index;+ var deferredGeneration = ++storyFollowGeneration;+ requestAnimationFrame(function () {+ if (deferredGeneration !== storyFollowGeneration || storyBeatIndex !== deferredIndex) return;+ if (Archify.view && typeof Archify.view.reveal === 'function') followStoryStep(step, options);+ });+ return true;+ }+ if (window.matchMedia && window.matchMedia('print').matches) return false;+ var embed = document.documentElement.getAttribute('data-embed') === 'true';+ var explicitEmbedPlayback = document.documentElement.getAttribute('data-share-playback') === 'true';+ if (embed && !explicitEmbedPlayback && options.linked !== true) return false;+ var ids = storyFrameIds(step);+ var generation = ++storyFollowGeneration;+ svg.setAttribute('data-story-follow', step.nodeId);+ panel.setAttribute('data-story-follow', 'moving');+ panel.setAttribute('data-story-follow-node', step.nodeId);+ var receipt = Archify.view.reveal(ids, {+ reason: options.manual === true ? 'story-beat' : 'story-follow',+ padding: 64,+ maxScale: 1.65,+ duration: STORY_FOLLOW_DURATION_MS,+ instant: options.instant === true || reducedMotion() || document.documentElement.getAttribute('data-motion') !== 'live'+ });+ if (receipt && receipt.finished && typeof receipt.finished.then === 'function') {+ receipt.finished.then(function (result) {+ if (generation !== storyFollowGeneration || storyBeatIndex !== step.index) return;+ svg.removeAttribute('data-story-follow');+ panel.setAttribute('data-story-follow', result && result.state === 'complete' ? 'settled' : 'interrupted');+ });+ } else if (generation === storyFollowGeneration) {+ panel.setAttribute('data-story-follow', 'settled');+ }+ return receipt;+ }++ function setStoryBeat(index, options) {+ options = options || {};+ var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));+ if (!stops.length) return false;+ resetBeatLinkFeedback();+ storyBeatIndex = Math.max(0, Math.min(stops.length - 1, index));+ var nextStep = storyBeatIndex + 1 < storySteps.length ? storySteps[storyBeatIndex + 1] : null;+ svg.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);+ panel.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);+ if (nextStep) {+ svg.setAttribute('data-story-next', nextStep.nodeId);+ panel.setAttribute('data-story-next', nextStep.nodeId);+ } else {+ svg.removeAttribute('data-story-next');+ panel.removeAttribute('data-story-next');+ }+ function storyBeatState(step) {+ if (step < storyBeatIndex) return 'past';+ if (step === storyBeatIndex) return 'active';+ if (step === storyBeatIndex + 1) return 'next';+ return 'pending';+ }+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step]'), function (node) {+ var step = Number(node.getAttribute('data-story-step'));+ node.setAttribute('data-story-beat-state', storyBeatState(step));+ });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-step]'), function (edge) {+ var step = Number(edge.getAttribute('data-story-beat-step'));+ edge.setAttribute('data-story-beat-state', storyBeatState(step));+ });+ stops.forEach(function (stop, step) {+ stop.setAttribute('data-story-beat-state', storyBeatState(step));+ if (step === storyBeatIndex) stop.setAttribute('aria-current', 'step');+ else stop.removeAttribute('aria-current');+ });+ note.setAttribute('aria-live', 'off');+ note.textContent = storyBeatCopy(storySteps[storyBeatIndex], stops.length);+ renderStoryCaption(storySteps[storyBeatIndex], stops.length, nextStep);+ if (options.center === true) centerStoryStop(stops[storyBeatIndex]);+ if (options.pulse === true) pulseStoryStep(storySteps[storyBeatIndex]);+ else clearStoryPulse();+ if (options.follow === true) followStoryStep(storySteps[storyBeatIndex], {+ manual: options.manual === true,+ linked: options.linked === true,+ instant: options.followInstant === true+ });+ renderShareCue();+ syncBeatLink();+ return true;+ }++ function settleStoryBeats() {+ stopStoryBeatTimer();+ clearStoryPulse();+ clearStoryFollow();+ resetBeatLinkFeedback();+ storyBeatIndex = -1;+ storyBeatElapsedMs = 0;+ storyBeatDwellMs = 0;+ svg.removeAttribute('data-story-beat');+ svg.removeAttribute('data-story-next');+ panel.removeAttribute('data-story-beat');+ panel.removeAttribute('data-story-next');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-state]'), function (el) {+ el.removeAttribute('data-story-beat-state');+ });+ Array.prototype.forEach.call(trail.querySelectorAll('[data-story-beat-state]'), function (stop) {+ stop.removeAttribute('data-story-beat-state');+ stop.removeAttribute('aria-current');+ });+ note.setAttribute('aria-live', 'polite');+ if (activeIndex >= 0) note.textContent = views[activeIndex].note || viewerText('viewer.guided.chapter.selectedNodes', { count: views[activeIndex].focus.length });+ renderStoryCaption(null, 0);+ renderShareCue();+ syncBeatLink();+ }++ function clearStoryTrail() {+ stopStoryBeatTimer();+ clearStoryPulse();+ clearStoryFollow();+ resetBeatLinkFeedback();+ storyBeatIndex = -1;+ storyBeatElapsedMs = 0;+ storyBeatDwellMs = 0;+ storySteps = [];+ svg.removeAttribute('data-story-active');+ svg.removeAttribute('data-story-playing');+ svg.removeAttribute('data-story-beat');+ svg.removeAttribute('data-story-next');+ panel.removeAttribute('data-story-beat');+ panel.removeAttribute('data-story-next');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-overlay]'), function (overlay) {+ overlay.remove();+ });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step], [data-story-beat-state]'), function (node) {+ node.removeAttribute('data-story-step');+ node.removeAttribute('data-story-beat-state');+ node.style.removeProperty('--story-step');+ });+ Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-story-beat-step]'), function (edge) {+ edge.removeAttribute('data-story-beat-step');+ edge.removeAttribute('data-story-beat-state');+ });+ trail.textContent = '';+ trail.hidden = true;+ trail.removeAttribute('aria-label');+ renderStoryCaption(null, 0);+ syncBeatLink();+ }++ function storyGeometry(edge) {+ if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];+ return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));+ }++ function renderStoryTrail(view) {+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ clearStoryTrail();+ if (!view) return;++ var nodeList = Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));+ var edgeList = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));+ var byId = {};+ nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });+ storySteps = view.focus.map(function (_, index) { return storyStep(view, index, edgeList, byId); });+ var labels = [];+ storySteps.forEach(function (step, index) {+ var id = step.nodeId;+ var node = byId[id];+ if (!node) return;+ node.setAttribute('data-story-step', String(index));+ node.style.setProperty('--story-step', String(index));+ var nodeLabel = step.nodeLabel;+ labels.push(nodeLabel);+ var stop = document.createElement('button');+ stop.type = 'button';+ stop.className = 'guided-view-stop';+ stop.setAttribute('data-story-node', id);+ stop.setAttribute('data-story-index', String(index));+ stop.setAttribute('data-story-relation', step.relation);+ stop.setAttribute('data-story-number', (index + 1 < 10 ? '0' : '') + (index + 1));+ if (index > 0) stop.setAttribute('data-story-link', step.relation);+ stop.style.setProperty('--story-step', String(index));+ stop.setAttribute('aria-label', storyBeatAria(step, storySteps.length));+ stop.title = storyBeatCopy(step, storySteps.length);+ stop.textContent = nodeLabel;+ trail.appendChild(stop);+ });+ trail.hidden = labels.length === 0;+ trail.setAttribute('aria-label', viewerText('viewer.guided.storyTrail', { label: view.label, count: labels.length }));+ trail.scrollLeft = 0;+ svg.setAttribute('data-story-active', view.id);++ var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');+ overlay.setAttribute('class', 'story-trail-overlay');+ overlay.setAttribute('data-story-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ var copied = 0;+ storySteps.forEach(function (step) {+ step.edges.forEach(function (edge) {+ var edgeBeat = step.index;+ edge.setAttribute('data-story-beat-step', String(edgeBeat));+ var wrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));+ storyGeometry(edge).forEach(function (shape) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('role');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.setAttribute('class', 'story-trail-flow');+ clone.setAttribute('data-story-beat-step', String(edgeBeat));+ clone.style.setProperty('--story-step', String(edgeBeat));+ wrapper.appendChild(clone);+ copied += 1;+ });+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);+ });+ });+ if (copied) {+ var firstEdge = edgeList[0];+ if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);+ else svg.insertBefore(overlay, svg.firstChild);+ }+ }++ function syncStoryPlayback() {+ var shouldPlay = playing && activeIndex >= 0;+ if (shouldPlay && svg.getAttribute('data-story-playing') !== 'true') svg.setAttribute('data-story-playing', 'true');+ else if (!shouldPlay && svg.hasAttribute('data-story-playing')) svg.removeAttribute('data-story-playing');+ }++ function resetProgress(fraction) {+ fraction = Math.max(0, Math.min(1, Number(fraction) || 0));+ progressBar.style.animation = 'none';+ progressBar.style.setProperty('--guided-progress-start', String(fraction));+ progressBar.style.transform = 'scaleX(' + fraction + ')';+ }++ function startProgress(fraction, duration) {+ resetProgress(fraction);+ void progressBar.offsetWidth;+ progressBar.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';+ }++ function currentStoryProgress() {+ var total = storySteps.length;+ if (!total || storyBeatIndex < 0) return 0;+ var elapsed = storyBeatElapsedMs;+ if (playing && storyBeatTimer && storyBeatStartedAt) elapsed += Math.max(0, Date.now() - storyBeatStartedAt);+ var dwell = storyBeatDwellMs || storyBeatDwell(total);+ return Math.max(0, Math.min(1, (storyBeatIndex + Math.min(1, elapsed / dwell)) / total));+ }++ function renderPlayback() {+ var automaticPlaybackAllowed = storyAutomaticPlaybackAllowed();+ panel.setAttribute('data-playing', playing ? 'true' : 'false');+ syncStoryPlayback();+ play.disabled = !playing && !automaticPlaybackAllowed;+ play.setAttribute('aria-pressed', playing ? 'true' : 'false');+ play.setAttribute('aria-label', viewerText(playing+ ? 'viewer.guided.pause'+ : !automaticPlaybackAllowed+ ? 'viewer.guided.motionUnavailable'+ : storyPlaybackComplete+ ? 'viewer.guided.replay'+ : 'viewer.guided.play'));+ play.title = viewerText(playing+ ? 'viewer.guided.pause.title'+ : !automaticPlaybackAllowed+ ? 'viewer.guided.enableMotion'+ : storyPlaybackComplete+ ? 'viewer.guided.replay.title'+ : 'viewer.guided.play.title');+ playIcon.textContent = playing ? '\u2016' : '\u25b6';+ playLabel.textContent = viewerText(playing+ ? 'viewer.guided.pauseStory'+ : storyPlaybackComplete+ ? 'viewer.guided.replayStory'+ : 'viewer.guided.playStory');+ if (storyCaption && !storyCaption.hidden) storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');+ }++ function render() {+ var view = views[activeIndex];+ count.textContent = activeIndex < 0 ? '0 / ' + views.length : (activeIndex + 1) + ' / ' + views.length;+ label.textContent = view ? view.label : viewerText('viewer.guided.explore');+ note.setAttribute('aria-live', storyBeatIndex >= 0 ? 'off' : 'polite');+ note.textContent = storyBeatIndex >= 0+ ? storyBeatCopy(storySteps[storyBeatIndex], storySteps.length)+ : (view+ ? (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }))+ : viewerText('viewer.guided.intro'));+ prev.disabled = activeIndex < 0;+ next.disabled = activeIndex >= views.length - 1;+ all.disabled = activeIndex < 0;+ panel.setAttribute('data-active-view', view ? view.id : 'all');+ syncChapterIndex();+ renderShareCue();+ renderPlayback();+ syncBeatLink();+ }++ function pausePlayback(options) {+ options = options || {};+ var progress = options.complete === true ? 1 : currentStoryProgress();+ if (panel.getAttribute('data-autoplay') === 'playing') {+ setShareCueProgress(progress);+ setAutoplayState(options.complete === true ? 'complete' : 'interrupted');+ }+ stopStoryBeatTimer({ preserveElapsed: options.complete !== true });+ clearStoryPulse();+ clearStoryFollow();+ playing = false;+ storyPlaybackComplete = options.complete === true;+ resetProgress(progress);+ renderPlayback();+ renderShareCue();+ }++ function finishStoryChapter() {+ if (!playing) return false;+ if (storyPlaybackScope === 'chapter') {+ pausePlayback({ complete: true });+ return true;+ }+ if (activeIndex < views.length - 1) {+ var destinationIndex = activeIndex + 1;+ activate(destinationIndex, { playback: true });+ afterHandoff(function () {+ if (!playing || activeIndex !== destinationIndex) return;+ storyBeatElapsedMs = 0;+ setStoryBeat(0, { pulse: true, follow: true });+ scheduleStoryPlayback();+ });+ return true;+ }+ pausePlayback({ complete: true });+ return true;+ }++ function scheduleStoryPlayback() {+ var total = storySteps.length;+ if (!playing || !total || reducedMotion()) {+ if (playing) pausePlayback();+ return false;+ }+ storyBeatDwellMs = storyBeatDwell(total);+ if (storyBeatIndex < 0) {+ storyBeatElapsedMs = 0;+ setStoryBeat(0, { pulse: true, follow: true });+ }+ storyBeatElapsedMs = Math.max(0, Math.min(storyBeatDwellMs, storyBeatElapsedMs));+ var remainingDwell = Math.max(1, storyBeatDwellMs - storyBeatElapsedMs);+ var progress = (storyBeatIndex + storyBeatElapsedMs / storyBeatDwellMs) / total;+ var remainingChapter = remainingDwell + Math.max(0, total - storyBeatIndex - 1) * storyBeatDwellMs;+ startProgress(progress, remainingChapter);+ if (panel.getAttribute('data-autoplay') === 'playing') startShareCueProgress(progress, remainingChapter);+ var generation = ++storyPlaybackGeneration;+ storyBeatStartedAt = Date.now();+ storyBeatTimer = setTimeout(function () {+ if (!playing || generation !== storyPlaybackGeneration) return;+ storyBeatTimer = null;+ storyBeatStartedAt = 0;+ storyBeatElapsedMs = 0;+ if (storyBeatIndex < total - 1) {+ setStoryBeat(storyBeatIndex + 1, { pulse: true, follow: true });+ scheduleStoryPlayback();+ } else finishStoryChapter();+ }, remainingDwell);+ return true;+ }++ function startPlayback() {+ if (!storyAutomaticPlaybackAllowed()) {+ renderPlayback();+ return false;+ }+ autoplayPending = false;+ setAutoplayState(null);+ setShareCueProgress(0);+ document.documentElement.removeAttribute('data-share-playback');+ storyPlaybackScope = 'story';+ if (storyPlaybackComplete) showAll({ updateUrl: false });+ storyPlaybackComplete = false;+ if (activeIndex < 0) activate(0, { playback: true });+ playing = true;+ renderPlayback();+ afterHandoff(function () {+ if (!playing) return;+ if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);+ scheduleStoryPlayback();+ });+ return true;+ }++ function startCurrentViewPlayback() {+ if (document.hidden) return false;+ autoplayPending = false;+ document.documentElement.setAttribute('data-share-playback', 'true');+ storyPlaybackScope = 'chapter';+ storyPlaybackComplete = false;+ if (activeIndex < 0) activate(0, { playback: true, updateUrl: false });+ if (!storyAutomaticPlaybackAllowed()) {+ var preserveMoment = hashBeatMatchesCurrent();+ setShareCueProgress(preserveMoment && storySteps.length ? (storyBeatIndex + 1) / storySteps.length : 1);+ setAutoplayState('reduced-motion');+ playing = false;+ if (preserveMoment) {+ clearStoryPulse();+ renderShareCue();+ } else settleStoryBeats();+ renderPlayback();+ return false;+ }+ playing = true;+ setAutoplayState('playing');+ renderPlayback();+ afterHandoff(function () {+ if (!playing) return;+ if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);+ scheduleStoryPlayback();+ });+ return true;+ }++ function maybeStartSharePlayback() {+ if (!autoplayPending || document.hidden) return false;+ return startCurrentViewPlayback();+ }++ function togglePlayback() {+ return playing ? (pausePlayback(), false) : startPlayback();+ }++ function syncStoryControlsDisabled() {+ Array.prototype.forEach.call(trail.querySelectorAll('[data-story-node]'), function (stop) {+ stop.disabled = !!currentHandoff;+ });+ syncBeatLink();+ }++ function selectStoryBeat(index) {+ if (currentHandoff || activeIndex < 0 || index < 0 || index >= storySteps.length) return false;+ momentRestoreGeneration += 1;+ clearChapterPreview({ clearIntents: true });+ if (playing) pausePlayback();+ else {+ stopStoryBeatTimer();+ clearStoryPulse();+ }+ storyPlaybackComplete = false;+ storyPlaybackScope = 'story';+ storyBeatElapsedMs = 0;+ storyBeatDwellMs = storyBeatDwell(storySteps.length);+ var view = views[activeIndex];+ Archify.focus.setMany(view.focus, {+ toggle: false,+ updateUrl: false,+ mode: 'selection',+ label: view.label,+ hideChip: true+ });+ setStoryBeat(index, { manual: true, center: true, pulse: true, follow: true });+ resetProgress(index / storySteps.length);+ renderPlayback();+ return true;+ }++ function selectStoryBeatById(id, options) {+ options = options || {};+ var index = storySteps.findIndex(function (step) { return step.nodeId === id; });+ if (index < 0) return false;+ if (playing) pausePlayback();+ else {+ stopStoryBeatTimer();+ clearStoryPulse();+ }+ storyPlaybackComplete = false;+ storyPlaybackScope = 'story';+ storyBeatElapsedMs = 0;+ storyBeatDwellMs = storyBeatDwell(storySteps.length);+ setStoryBeat(index, {+ manual: false,+ center: true,+ pulse: false,+ follow: options.follow === true,+ linked: options.linked === true,+ followInstant: options.followInstant === true+ });+ resetProgress(index / storySteps.length);+ renderPlayback();+ return true;+ }++ function updateUrl(view) {+ try {+ history.replaceState(null, '', location.pathname + location.search + (view ? '#view=' + encodeURIComponent(view.id) : ''));+ } catch (_) {}+ }++ function showAll(options) {+ options = options || {};+ if (options.restore !== true) momentRestoreGeneration += 1;+ clearChapterPreview({ clearIntents: true });+ if (playing && options.playback !== true) pausePlayback();+ if (options.playback !== true) storyPlaybackComplete = false;+ cancelHandoff('overview');+ activeIndex = -1;+ renderStoryTrail(null);+ if (options.clearFocus !== false) Archify.focus.clear({ updateUrl: false });+ if (options.resetView !== false && Archify.view && typeof Archify.view.reset === 'function') {+ Archify.view.reset({ automatic: true });+ }+ render();+ if (options.updateUrl !== false) updateUrl(null);+ }++ function activate(index, options) {+ options = options || {};+ if (options.restore !== true) momentRestoreGeneration += 1;+ if (playing && options.playback !== true) pausePlayback();+ if (options.playback !== true) storyPlaybackComplete = false;+ if (index < 0) { showAll(options); return true; }+ if (index >= views.length) return false;+ clearChapterPreview({ clearIntents: true });+ var previousIndex = activeIndex;+ var previous = previousIndex >= 0 ? views[previousIndex] : null;+ var outgoingBeatIndex = storyBeatIndex;+ cancelHandoff('replaced');+ activeIndex = index;+ var view = views[index];+ Archify.focus.setMany(view.focus, {+ toggle: false,+ updateUrl: false,+ mode: 'selection',+ label: view.label,+ hideChip: true+ });+ renderStoryTrail(view);+ beginHandoff(previousIndex, index, previous, view, outgoingBeatIndex, options.playback === true ? 'playback' : 'guided');+ syncStoryControlsDisabled();+ render();+ if (options.updateUrl !== false) updateUrl(view);+ return true;+ }++ function activateById(id, options) {+ var index = views.findIndex(function (view) { return view.id === id; });+ return index >= 0 && activate(index, options);+ }++ prev.addEventListener('click', function () { activate(activeIndex - 1); });+ next.addEventListener('click', function () { activate(activeIndex + 1); });+ all.addEventListener('click', function () { showAll(); });+ play.addEventListener('click', togglePlayback);+ beatLink.addEventListener('click', copyStoryMomentLink);+ trail.addEventListener('focusin', function (event) {+ if (!event.target.closest('[data-story-node]')) return;+ if (playing) pausePlayback();+ });+ trail.addEventListener('click', function (event) {+ var stop = event.target.closest('[data-story-node]');+ if (!stop || stop.disabled) return;+ selectStoryBeat(Number(stop.getAttribute('data-story-index')));+ });+ trail.addEventListener('keydown', function (event) {+ if (event.key !== 'Enter' && event.key !== ' ') return;+ var stop = event.target.closest('[data-story-node]');+ if (!stop || stop.disabled) return;+ event.preventDefault();+ selectStoryBeat(Number(stop.getAttribute('data-story-index')));+ });+ chapterList.addEventListener('click', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ if (!button) return;+ activateById(button.getAttribute('data-guided-view-id'));+ });+ chapterList.addEventListener('pointerover', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ if (!button || !hoverCapable() || event.pointerType === 'touch') return;+ if (event.relatedTarget && button.contains(event.relatedTarget)) return;+ setChapterPreviewIntent('pointer', chapterButtons.indexOf(button));+ });+ chapterList.addEventListener('pointerout', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;+ clearChapterPreviewIntent('pointer', chapterButtons.indexOf(button));+ });+ chapterIndex.addEventListener('focusin', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ if (!button) return;+ setChapterPreviewIntent('focus', chapterButtons.indexOf(button));+ });+ chapterIndex.addEventListener('focusout', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;+ clearChapterPreviewIntent('focus', chapterButtons.indexOf(button));+ });+ chapterList.addEventListener('keydown', function (event) {+ var button = event.target.closest('[data-guided-view-id]');+ var index = chapterButtons.indexOf(button);+ if (index < 0) return;+ var target = null;+ if (event.key === 'ArrowRight') target = Math.min(chapterButtons.length - 1, index + 1);+ else if (event.key === 'ArrowLeft') target = Math.max(0, index - 1);+ else if (event.key === 'Home') target = 0;+ else if (event.key === 'End') target = chapterButtons.length - 1;+ if (target === null) return;+ event.preventDefault();+ focusChapterButton(target);+ });++ // A direct node exploration supersedes the curated view. Capture phase+ // releases the view before the focus explorer writes its own deep link.+ function releaseForNode(event) {+ if (activeIndex >= 0 && event.target.closest('[data-node-id]')) {+ pausePlayback();+ showAll({ clearFocus: false, updateUrl: false });+ }+ }+ svg.addEventListener('click', releaseForNode, true);+ svg.addEventListener('keydown', function (event) {+ if (event.key === 'Enter' || event.key === ' ') releaseForNode(event);+ }, true);++ document.addEventListener('keydown', function (event) {+ if (event.metaKey || event.ctrlKey || event.altKey) return;+ if (document.documentElement.getAttribute('data-guide-open') === 'true') return;+ var target = event.target;+ if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return;+ if (event.key === ']') {+ event.preventDefault();+ if (activeIndex < views.length - 1) activate(activeIndex + 1);+ } else if (event.key === '[') {+ event.preventDefault();+ if (activeIndex >= 0) activate(activeIndex - 1);+ } else if (event.key.toLowerCase() === 'p') {+ event.preventDefault();+ togglePlayback();+ } else if (event.key === 'Escape' && activePreviewIndex >= 0) {+ event.preventDefault();+ event.stopImmediatePropagation();+ clearChapterPreview({ clearIntents: true });+ } else if (event.key === 'Escape' && activeIndex >= 0) {+ event.preventDefault();+ showAll();+ }+ }, true);++ function syncViewFromHash() {+ try {+ var params = new URLSearchParams(location.hash.replace(/^#/, ''));+ var initial = params.get('view');+ var requestedBeat = params.get('beat');+ var restoreGeneration = ++momentRestoreGeneration;+ if (initial) {+ var activated = activateById(initial, { updateUrl: false, restore: true });+ if (!activated) {+ showAll({ updateUrl: false, restore: true });+ return;+ }+ if (requestedBeat) afterHandoff(function () {+ if (restoreGeneration !== momentRestoreGeneration) return;+ var latest = new URLSearchParams(location.hash.replace(/^#/, ''));+ if (latest.get('view') !== initial || latest.get('beat') !== requestedBeat) return;+ if (activeIndex < 0 || views[activeIndex].id !== initial) return;+ selectStoryBeatById(requestedBeat, { linked: true, follow: true, followInstant: true });+ });+ } else if (params.get('focus') || params.get('relation')) {+ activeIndex = -1;+ render();+ } else {+ showAll({ updateUrl: false, restore: true });+ }+ } catch (_) { showAll({ updateUrl: false, restore: true }); }+ }++ window.addEventListener('hashchange', syncViewFromHash);+ document.addEventListener('visibilitychange', function () {+ if (document.hidden) {+ clearChapterPreview({ clearIntents: true });+ if (playing) pausePlayback();+ else clearStoryPulse();+ settleHandoff('hidden');+ }+ else if (!document.hidden) maybeStartSharePlayback();+ });+ if (window.matchMedia) {+ var guidedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');+ var onGuidedMotionChange = function () {+ if (guidedMotionQuery.matches) {+ if (playing) pausePlayback();+ else clearStoryPulse();+ settleHandoff('reduced-motion');+ }+ };+ if (typeof guidedMotionQuery.addEventListener === 'function') guidedMotionQuery.addEventListener('change', onGuidedMotionChange);+ else if (typeof guidedMotionQuery.addListener === 'function') guidedMotionQuery.addListener(onGuidedMotionChange);+ }+ if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node && document.documentElement instanceof Node) {+ var chapterPreviewOwnerObserver = new MutationObserver(syncChapterPreview);+ chapterPreviewOwnerObserver.observe(svg, {+ attributes: true,+ attributeFilter: [+ 'data-route-picking', 'data-route-active', 'data-lens-active',+ 'data-legend-preview-active', 'data-relationship-preview-active',+ 'data-intent-trace-active', 'data-focus-active'+ ]+ });+ var storyMotionObserver = new MutationObserver(function () {+ if (document.documentElement.getAttribute('data-motion') !== 'live') clearStoryPulse();+ renderPlayback();+ });+ storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });+ }+ if (typeof ResizeObserver === 'function') {+ var chapterViewportWidth = chapterList.clientWidth;+ var trailViewportWidth = trail.clientWidth;+ var storyScrollObserver = new ResizeObserver(function () {+ var chapterWidth = chapterList.clientWidth;+ var trailWidth = trail.clientWidth;+ if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);+ if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {+ centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);+ }+ chapterViewportWidth = chapterWidth;+ trailViewportWidth = trailWidth;+ });+ storyScrollObserver.observe(chapterList);+ storyScrollObserver.observe(trail);+ }+ window.addEventListener('beforeprint', function () {+ clearChapterPreview({ clearIntents: true });+ if (playing) pausePlayback();+ else clearStoryPulse();+ settleHandoff('print');+ });+ syncViewFromHash();+ if (autoplayPending) {+ requestAnimationFrame(function () {+ requestAnimationFrame(maybeStartSharePlayback);+ });+ }++ return {+ count: views.length,+ activate: activateById,+ showAll: showAll,+ play: startPlayback,+ playCurrent: startCurrentViewPlayback,+ pause: pausePlayback,+ beatLink: storyMomentLink,+ copyBeatLink: copyStoryMomentLink,+ cancelHandoff: cancelHandoff,+ settleHandoff: settleHandoff,+ clearPreview: function () { return clearChapterPreview({ clearIntents: true }); },+ isPlaying: function () { return playing; },+ handoff: function () {+ return currentHandoff ? { id: currentHandoff.id, mode: currentHandoff.mode, anchor: currentHandoff.anchor || null } : null;+ },+ active: function () { return activeIndex < 0 ? null : views[activeIndex].id; },+ preview: function () { return activePreviewIndex < 0 ? null : views[activePreviewIndex].id; },+ delta: function (id) {+ var index = views.findIndex(function (view) { return view.id === id; });+ if (index < 0) return null;+ var value = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);+ return { stay: value.stay.slice(), enter: value.enter.slice(), leave: value.leave.slice() };+ },+ beat: function () {+ var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;+ return step ? {+ index: step.index,+ position: step.index + 1,+ total: storySteps.length,+ nodeId: step.nodeId,+ relation: step.relation,+ edgeKeys: step.edgeKeys.slice()+ } : null;+ },+ focus: function () { return activeIndex < 0 ? [] : views[activeIndex].focus.slice(); }+ };+ })();\ No newline at end of filediff --git a/viewer/intent-trace.js b/viewer/intent-trace.jsnew file mode 100644index 00000000..0ff2bcca--- /dev/null+++ b/viewer/intent-trace.js@@ -0,0 +1,213 @@+ /* ============================================================+ Intent Trace — temporary one-hop topology before durable focus.+ Fine-pointer hover and keyboard focus share the same stable-ID preview;+ touch continues directly to the existing click-to-focus contract.+ ============================================================ */+ Archify.intentTrace = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector(':scope > svg');+ var status = document.getElementById('intent-trace-status');+ var namespace = 'http://www.w3.org/2000/svg';+ var activeId = null;+ var hoveredNode = null;+ var focusedNode = null;+ var enterTimer = null;++ function nodes() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));+ }+ function edges() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));+ }+ function nodeLabel(node, fallback) {+ return node.getAttribute('data-node-label') ||+ (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];+ }+ function finePointer() {+ return !window.matchMedia || window.matchMedia('(hover: hover) and (pointer: fine)').matches;+ }+ function reducedMotion() {+ return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);+ }+ function blocked() {+ return html.getAttribute('data-embed') === 'true' ||+ html.getAttribute('data-guide-open') === 'true' ||+ container.classList.contains('is-panning') ||+ svg.hasAttribute('data-lens-active') ||+ svg.hasAttribute('data-story-active') ||+ svg.hasAttribute('data-relationship-preview-active') ||+ !!(Archify.routeProbe && typeof Archify.routeProbe.active === 'function' && Archify.routeProbe.active()) ||+ !!(Archify.focus && typeof Archify.focus.active === 'function' && Archify.focus.active());+ }+ function edgeShapes(edge) {+ if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];+ return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));+ }+ function removeOverlay() {+ Array.prototype.forEach.call(svg.querySelectorAll('[data-intent-trace-overlay]'), function (overlay) {+ overlay.remove();+ });+ }+ function clear(options) {+ options = options || {};+ if (enterTimer) window.clearTimeout(enterTimer);+ enterTimer = null;+ activeId = null;+ svg.removeAttribute('data-intent-trace-active');+ removeOverlay();+ nodes().forEach(function (node) {+ node.removeAttribute('data-intent-trace-match');+ node.removeAttribute('data-intent-trace-selected');+ });+ edges().forEach(function (edge) { edge.removeAttribute('data-intent-trace-match'); });+ if (options.announce !== false) status.textContent = '';+ }+ function traceGeometry(shape, direction) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-labelledby');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.removeAttribute('data-intent-trace-match');+ clone.removeAttribute('data-intent-trace-selected');+ clone.setAttribute('class', 'intent-trace-flow');+ clone.setAttribute('data-direction', direction);+ clone.setAttribute('pathLength', '1');+ return clone;+ }+ function show(id, options) {+ options = options || {};+ if (!id || blocked()) {+ clear({ announce: false });+ return false;+ }+ if (activeId === id) return true;+ clear({ announce: false });+ var nodeList = nodes();+ var edgeList = edges();+ var byId = {};+ nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });+ var selected = byId[id];+ if (!selected) return false;++ var overlay = document.createElementNS(namespace, 'g');+ overlay.setAttribute('class', 'intent-trace-overlay');+ overlay.setAttribute('data-intent-trace-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ var related = {};+ var seen = {};+ var counts = { out: 0, in: 0, loop: 0 };+ related[id] = true;++ edgeList.forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ if (from !== id && to !== id) return;+ var direction = from === id && to === id ? 'loop' : (from === id ? 'out' : 'in');+ var key = edge.getAttribute('data-edge-key') ||+ (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!seen[key]) {+ seen[key] = true;+ counts[direction] += 1;+ }+ related[from] = true;+ related[to] = true;+ edge.setAttribute('data-intent-trace-match', '');+ var wrapper = document.createElementNS(namespace, 'g');+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));+ edgeShapes(edge).forEach(function (shape) {+ wrapper.appendChild(traceGeometry(shape, direction));+ });+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);+ });++ nodeList.forEach(function (node) {+ var nodeId = node.getAttribute('data-node-id');+ if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');+ if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');+ });+ if (overlay.childNodes.length) {+ var firstEdge = edgeList[0];+ var firstNode = svg.querySelector('[data-node-id]');+ if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);+ else if (firstNode) svg.insertBefore(overlay, firstNode);+ else svg.appendChild(overlay);+ }+ activeId = id;+ svg.setAttribute('data-intent-trace-active', id);+ if (options.announce === true) {+ var total = counts.out + counts.in + counts.loop;+ status.textContent = viewerText('viewer.intent.summary', {+ label: nodeLabel(selected, id),+ out: counts.out,+ in: counts.in,+ loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',+ total: total+ });+ }+ return true;+ }+ function schedule(node) {+ if (enterTimer) window.clearTimeout(enterTimer);+ enterTimer = window.setTimeout(function () {+ enterTimer = null;+ if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });+ }, reducedMotion() ? 0 : 90);+ }+ function sync() {+ var candidate = focusedNode || hoveredNode;+ if (!candidate) {+ clear();+ return;+ }+ show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });+ }++ svg.addEventListener('pointerover', function (event) {+ var node = event.target.closest('[data-node-id]');+ if (!node || !finePointer() || event.pointerType === 'touch') return;+ if (event.relatedTarget && node.contains(event.relatedTarget)) return;+ hoveredNode = node;+ schedule(node);+ });+ svg.addEventListener('pointerout', function (event) {+ var node = event.target.closest('[data-node-id]');+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;+ if (hoveredNode === node) hoveredNode = null;+ sync();+ });+ svg.addEventListener('focusin', function (event) {+ var node = event.target.closest('[data-node-id]');+ if (!node) return;+ focusedNode = node;+ show(node.getAttribute('data-node-id'), { announce: true });+ });+ svg.addEventListener('focusout', function (event) {+ var node = event.target.closest('[data-node-id]');+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;+ if (focusedNode === node) focusedNode = null;+ sync();+ });+ container.addEventListener('pointerdown', function (event) {+ if (!event.target.closest('[data-node-id]')) clear({ announce: false });+ });+ window.addEventListener('blur', function () { clear({ announce: false }); });++ return {+ show: show,+ clear: clear,+ active: function () { return activeId; }+ };+ })();\ No newline at end of filediff --git a/viewer/motion-governor.js b/viewer/motion-governor.jsnew file mode 100644index 00000000..ebd5afc5--- /dev/null+++ b/viewer/motion-governor.js@@ -0,0 +1,264 @@+ /* ============================================================+ Motion Governor — one reader switch and one motion budget. Ambient+ trace yields to the strongest semantic owner; Still also parks bounded+ viewer signals without discarding their static meaning.+ ============================================================ */+ Archify.motionGovernor = (function () {+ var STORAGE_KEY = 'archify-motion';+ var html = document.documentElement;+ var svg = document.querySelector('.diagram-container svg');+ var btn = document.getElementById('btn-motion');+ var label = document.getElementById('motion-label');+ var motionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;+ var capable = !!(svg && svg.getAttribute('data-animation') === 'trace');+ var readerPaused = false;+ var suspensions = Object.create(null);+ var explicitOwner = '';+ var owner = '';+ var ownerToken = 0;+ var ownerCleanup = null;+ var lastEffectivePaused = null;+ var ambientStarted = false;+ var ambientPending = new Set();++ function detachAmbientBoundary() {+ if (!svg) return;+ svg.removeEventListener('animationend', onAmbientBoundary, true);+ svg.removeEventListener('animationcancel', onAmbientBoundary, true);+ }+ function settleAmbient(reason) {+ if (!capable) return false;+ ambientStarted = true;+ ambientPending.clear();+ detachAmbientBoundary();+ html.setAttribute('data-ambient-motion', 'settled');+ html.setAttribute('data-ambient-settle-reason', reason || 'complete');+ return true;+ }+ function onAmbientBoundary(event) {+ if (!ambientPending.has(event.target)) return;+ ambientPending.delete(event.target);+ if (!ambientPending.size) settleAmbient('complete');+ }+ function startAmbient() {+ if (ambientStarted || !capable) return false;+ ambientStarted = true;+ ambientPending = new Set(Array.prototype.slice.call(svg.querySelectorAll('[data-animate="edge"], [data-animate="node"]')));+ if (!ambientPending.size) return settleAmbient('empty');+ svg.addEventListener('animationend', onAmbientBoundary, true);+ svg.addEventListener('animationcancel', onAmbientBoundary, true);+ html.setAttribute('data-ambient-motion', 'running');+ html.removeAttribute('data-ambient-settle-reason');+ return true;+ }++ function readStored() {+ try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }+ }+ function writeStored() {+ try {+ if (readerPaused) localStorage.setItem(STORAGE_KEY, 'still');+ else localStorage.removeItem(STORAGE_KEY);+ } catch (_) {}+ }+ function reducedMotion() {+ return !!(motionQuery && motionQuery.matches);+ }+ function hasSuspension() {+ return Object.keys(suspensions).length > 0;+ }+ function effectivePaused() {+ return readerPaused || reducedMotion() || hasSuspension();+ }+ function ownerLabel(value) {+ if (value === 'story') return viewerText('viewer.owner.story');+ if (value === 'chapter') return viewerText('viewer.owner.chapter');+ if (value === 'chapter-preview') return viewerText('viewer.owner.chapterPreview');+ if (value === 'handoff') return viewerText('viewer.owner.handoff');+ if (value === 'route') return viewerText('viewer.owner.route');+ if (value === 'lens') return viewerText('viewer.owner.lens');+ if (value === 'relationship') return viewerText('viewer.owner.relationship');+ if (value === 'intent') return viewerText('viewer.owner.intent');+ if (value === 'focus') return viewerText('viewer.owner.focus');+ if (value === 'legend') return viewerText('viewer.owner.legend');+ return viewerText('viewer.owner.reader');+ }+ function render() {+ if (!capable) return;+ var systemPaused = reducedMotion();+ var paused = effectivePaused();+ html.setAttribute('data-motion', paused ? 'still' : 'live');+ if (paused || owner || html.hasAttribute('data-embed') || html.hasAttribute('data-share-playback') || html.hasAttribute('data-document-hidden')) {+ settleAmbient('suppressed');+ } else if (!ambientStarted) {+ startAmbient();+ }+ btn.setAttribute('aria-pressed', paused ? 'false' : 'true');+ btn.disabled = systemPaused;+ label.textContent = viewerText(paused ? 'viewer.motion.still' : 'viewer.motion.live');+ if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.isPlaying()) {+ Archify.guidedViews.pause();+ }+ if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.settleHandoff) {+ Archify.guidedViews.settleHandoff(systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still'));+ }+ if (paused && lastEffectivePaused !== true && Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {+ Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still') });+ }+ lastEffectivePaused = paused;+ if (Archify.routeProbe && typeof Archify.routeProbe.syncMotion === 'function') Archify.routeProbe.syncMotion();+ if (systemPaused) {+ btn.setAttribute('aria-label', viewerText('viewer.motion.reduced'));+ btn.title = viewerText('viewer.motion.reduced');+ } else if (hasSuspension()) {+ btn.setAttribute('aria-label', viewerText('viewer.motion.hidden'));+ btn.title = viewerText('viewer.motion.hidden');+ } else if (paused) {+ btn.setAttribute('aria-label', viewerText('viewer.motion.resume'));+ btn.title = viewerText('viewer.motion.resume');+ } else if (owner) {+ btn.setAttribute('aria-label', viewerText('viewer.motion.yielding', { owner: ownerLabel(owner) }));+ btn.title = viewerText('viewer.motion.yielding.title', { owner: ownerLabel(owner) });+ } else {+ btn.setAttribute('aria-label', viewerText('viewer.motion.pause'));+ btn.title = viewerText('viewer.motion.pause');+ }+ }+ function setPaused(next, options) {+ options = options || {};+ readerPaused = !!next;+ if (options.persist !== false) writeStored();+ render();+ return readerPaused;+ }+ function publishOwner() {+ owner = explicitOwner || deriveOwner();+ if (owner) html.setAttribute('data-motion-owner', owner);+ else html.removeAttribute('data-motion-owner');+ render();+ return owner;+ }+ function deriveOwner() {+ if (!svg) return '';+ if (svg.hasAttribute('data-story-playing') || svg.hasAttribute('data-story-follow')) return 'story';+ if (svg.hasAttribute('data-story-active')) return 'chapter';+ if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return 'route';+ if (svg.hasAttribute('data-lens-active')) return 'lens';+ if (svg.hasAttribute('data-relationship-preview-active')) return 'relationship';+ if (svg.hasAttribute('data-intent-trace-active')) return 'intent';+ if (svg.hasAttribute('data-focus-active')) return 'focus';+ if (svg.hasAttribute('data-legend-preview-active')) return 'legend';+ return '';+ }+ function clearClaim(preempted) {+ var cleanup = ownerCleanup;+ ownerCleanup = null;+ explicitOwner = '';+ if (preempted && cleanup) {+ try { cleanup(); } catch (_) {}+ }+ }+ function claim(next, cleanup) {+ if (!capable || !next) return 0;+ clearClaim(true);+ ownerToken += 1;+ explicitOwner = next;+ ownerCleanup = typeof cleanup === 'function' ? cleanup : null;+ publishOwner();+ return ownerToken;+ }+ function release(token) {+ if (!capable || token !== ownerToken || !explicitOwner) return false;+ clearClaim(false);+ ownerToken += 1;+ publishOwner();+ return true;+ }+ function suspend(reason) {+ var key = String(reason || 'runtime');+ var active = true;+ suspensions[key] = (suspensions[key] || 0) + 1;+ render();+ return function () {+ if (!active) return false;+ active = false;+ if (suspensions[key] > 1) suspensions[key] -= 1;+ else delete suspensions[key];+ render();+ return true;+ };+ }+ function syncVisibility() {+ if (document.hidden) {+ suspensions.visibility = true;+ html.setAttribute('data-document-hidden', 'true');+ } else {+ delete suspensions.visibility;+ html.removeAttribute('data-document-hidden');+ }+ render();+ }++ if (!capable) {+ btn.hidden = true;+ html.removeAttribute('data-motion-capable');+ html.removeAttribute('data-motion');+ html.removeAttribute('data-motion-owner');+ html.removeAttribute('data-ambient-motion');+ html.removeAttribute('data-ambient-settle-reason');+ return {+ capable: false,+ pause: function () { return false; },+ resume: function () { return false; },+ toggle: function () { return false; },+ setMode: function () { return 'still'; },+ mode: function () { return 'still'; },+ claim: function () { return 0; },+ release: function () { return false; },+ suspend: function () { return function () { return false; }; },+ isPaused: function () { return true; },+ owner: function () { return ''; }+ };+ }++ html.setAttribute('data-motion-capable', 'true');+ btn.hidden = false;+ readerPaused = readStored() === 'still';+ btn.addEventListener('click', function () { setPaused(!readerPaused); });+ if (motionQuery) {+ if (typeof motionQuery.addEventListener === 'function') motionQuery.addEventListener('change', render);+ else if (typeof motionQuery.addListener === 'function') motionQuery.addListener(render);+ }+ document.addEventListener('visibilitychange', syncVisibility);+ if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node) {+ var ownerObserver = new MutationObserver(function () { publishOwner(); });+ ownerObserver.observe(svg, {+ attributes: true,+ attributeFilter: [+ 'data-story-playing', 'data-story-follow', 'data-story-active', 'data-route-picking', 'data-route-active',+ 'data-lens-active', 'data-relationship-preview-active', 'data-intent-trace-active',+ 'data-focus-active', 'data-legend-preview-active'+ ]+ });+ }+ syncVisibility();+ publishOwner();+ render();++ return {+ capable: true,+ pause: function () { return setPaused(true); },+ resume: function () { return setPaused(false); },+ toggle: function () { return setPaused(!readerPaused); },+ setMode: function (next, options) {+ setPaused(next === 'still', options);+ return effectivePaused() ? 'still' : 'live';+ },+ mode: function () { return effectivePaused() ? 'still' : 'live'; },+ claim: claim,+ release: release,+ suspend: suspend,+ isPaused: effectivePaused,+ owner: function () { return owner; }+ };+ })();\ No newline at end of filediff --git a/viewer/node-finder.js b/viewer/node-finder.jsnew file mode 100644index 00000000..8f9116bc--- /dev/null+++ b/viewer/node-finder.js@@ -0,0 +1,265 @@+ /* ============================================================+ Node Finder — stable-ID search over the existing semantic SVG.+ Search never changes the IR or SVG geometry: selecting a result resets+ the viewport, releases a guided view, and delegates to semantic focus.+ ============================================================ */+ Archify.finder = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector('svg');+ var trigger = document.getElementById('btn-node-finder');+ var panel = document.getElementById('node-finder');+ var heading = document.getElementById('node-finder-title');+ var closeBtn = document.getElementById('node-finder-close');+ var input = document.getElementById('node-finder-input');+ var results = document.getElementById('node-finder-results');+ var empty = document.getElementById('node-finder-empty');+ var status = document.getElementById('node-finder-status');+ var visibleItems = [];++ function defaultContext() {+ return {+ kind: 'focus',+ title: viewerText('viewer.finder.title'),+ placeholder: viewerText('viewer.finder.placeholder'),+ empty: viewerText('viewer.finder.empty'),+ resultsLabel: viewerText('viewer.finder.results'),+ availableNoun: viewerText('viewer.finder.noun.nodes'),+ allowedIds: null,+ badges: null+ };+ }++ var context = defaultContext();++ function semanticType(node) {+ var authored = node.getAttribute('data-node-kind');+ if (authored) return authored;+ var types = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];+ return types.find(function (type) { return node.querySelector('.c-' + type); }) || 'node';+ }++ function connectionsFor(id) {+ var count = 0;+ var seen = {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = from + '\u0000' + to;+ if ((from === id || to === id) && !seen[key]) {+ seen[key] = true;+ count += 1;+ }+ });+ return count;+ }++ var items = Array.prototype.map.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ var id = node.getAttribute('data-node-id');+ var label = node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || id).replace(/^Focus\s+/, '');+ var text = (node.textContent || '').replace(/\s+/g, ' ').trim();+ var sublabel = node.getAttribute('data-node-sublabel') || '';+ var context = node.getAttribute('data-node-context') || '';+ var tag = node.getAttribute('data-node-tag') || '';+ var brand = node.getAttribute('data-node-brand') || '';+ var type = semanticType(node);+ var sources = Archify.sourceEvidence.node(id);+ var sourceSearch = sources.map(function (source) {+ return [source.path, source.label, source.line, source.endLine].filter(Boolean).join(' ');+ }).join(' ');+ return {+ id: id,+ label: label,+ type: type,+ sublabel: sublabel,+ context: context,+ tag: tag,+ brand: brand,+ sources: sources,+ links: connectionsFor(id),+ search: (id + ' ' + label + ' ' + type + ' ' + sublabel + ' ' + context + ' ' + tag + ' ' + sourceSearch + ' ' + text).toLowerCase() + ' ' + brand.toLowerCase(),+ node: node+ };+ });++ function resultButtons() {+ return Array.prototype.slice.call(results.querySelectorAll('.node-finder-result'));+ }++ function resolveContext(options) {+ var requested = options && options.context ? options.context : null;+ if (!requested && Archify.routeProbe && typeof Archify.routeProbe.finderContext === 'function') {+ requested = Archify.routeProbe.finderContext();+ }+ if (!requested) return defaultContext();+ var resolved = defaultContext();+ Object.keys(requested).forEach(function (key) { resolved[key] = requested[key]; });+ return resolved;+ }++ function availableItems() {+ if (!context.allowedIds) return items.slice();+ return items.filter(function (item) { return context.allowedIds.indexOf(item.id) !== -1; });+ }++ function applyContext() {+ panel.setAttribute('data-context', context.kind);+ heading.textContent = context.title;+ input.placeholder = context.placeholder;+ empty.textContent = context.empty;+ results.setAttribute('aria-label', context.resultsLabel);+ }++ function select(id) {+ var item = items.find(function (candidate) { return candidate.id === id; });+ if (!item) return false;+ var routeSelection = context.kind === 'route-source' || context.kind === 'route-target';+ if (routeSelection) {+ if (!Archify.routeProbe || typeof Archify.routeProbe.choose !== 'function' || !Archify.routeProbe.choose(id)) return false;+ if (Archify.routeProbe.active() === 'target' && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'route-pick' });+ }+ close({ restoreFocus: false });+ try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }+ return true;+ }+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ if (Archify.view && typeof Archify.view.reset === 'function') Archify.view.reset({ automatic: true });+ Archify.focus.set(id, { toggle: false });+ if (Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'finder' });+ }+ close({ restoreFocus: false });+ try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }+ return true;+ }++ function render(query) {+ query = (query || '').trim().toLowerCase();+ var available = availableItems();+ visibleItems = available.filter(function (item) { return !query || item.search.indexOf(query) !== -1; });+ results.textContent = '';+ visibleItems.forEach(function (item) {+ var button = document.createElement('button');+ button.type = 'button';+ button.className = 'node-finder-result';+ button.setAttribute('data-node-id', item.id);+ var badge = context.badges && context.badges[item.id]+ ? context.badges[item.id]+ : context.kind === 'focus'+ ? viewerCount('viewer.finder.link', item.links)+ : String(item.links);+ var action = context.kind === 'route-source'+ ? viewerText('viewer.finder.result.routeStart', { label: item.label })+ : context.kind === 'route-target'+ ? viewerText('viewer.finder.result.routeTarget', { label: item.label, links: badge })+ : viewerCount('viewer.finder.result.focus', item.links, { label: item.label });+ button.setAttribute('aria-label', action);++ var name = document.createElement('strong');+ name.textContent = item.label;+ var links = document.createElement('em');+ links.textContent = badge;+ links.title = context.kind === 'focus' ? badge : action;+ var meta = document.createElement('small');+ meta.textContent = [viewerKindLabel(item.type), item.id, item.sublabel, item.tag].filter(Boolean).join(' \u00b7 ');+ meta.title = [viewerKindLabel(item.type), item.id, item.context, item.sublabel, item.tag].filter(Boolean).join(' \u00b7 ');+ button.appendChild(name);+ button.appendChild(links);+ button.appendChild(meta);+ button.addEventListener('click', function () { select(item.id); });+ results.appendChild(button);+ });+ empty.hidden = visibleItems.length !== 0;+ status.textContent = query+ ? viewerText('viewer.finder.status.filtered', {+ visible: visibleItems.length,+ available: available.length,+ noun: context.availableNoun+ })+ : viewerText('viewer.finder.status.all', { available: available.length, noun: context.availableNoun });+ }++ function open(options) {+ if (html.getAttribute('data-embed') === 'true') return false;+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);+ if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });+ context = resolveContext(options || {});+ applyContext();+ panel.hidden = false;+ trigger.setAttribute('aria-expanded', 'true');+ if (context.kind.indexOf('route-') === 0 && Archify.routeProbe && typeof Archify.routeProbe.finderOpening === 'function') {+ Archify.routeProbe.finderOpening();+ }+ input.value = '';+ render('');+ requestAnimationFrame(function () { input.focus(); });+ return true;+ }++ function close(options) {+ options = options || {};+ var routeContext = context.kind.indexOf('route-') === 0;+ panel.hidden = true;+ trigger.setAttribute('aria-expanded', 'false');+ input.value = '';+ if (routeContext && Archify.routeProbe && typeof Archify.routeProbe.finderClosed === 'function') {+ Archify.routeProbe.finderClosed({ restoreFocus: options.restoreFocus !== false });+ } else if (options.restoreFocus !== false) {+ trigger.focus();+ }+ }++ function toggle() { return panel.hidden ? open() : (close(), false); }++ trigger.addEventListener('click', toggle);+ closeBtn.addEventListener('click', function () { close(); });+ input.addEventListener('input', function () { render(input.value); });+ input.addEventListener('keydown', function (event) {+ var buttons = resultButtons();+ if (event.key === 'ArrowDown' && buttons.length) {+ event.preventDefault();+ buttons[0].focus();+ } else if (event.key === 'Enter' && visibleItems.length) {+ event.preventDefault();+ select(visibleItems[0].id);+ }+ });+ results.addEventListener('keydown', function (event) {+ var buttons = resultButtons();+ var index = buttons.indexOf(document.activeElement);+ if (index < 0 || !buttons.length) return;+ var next = null;+ if (event.key === 'ArrowDown') next = (index + 1) % buttons.length;+ else if (event.key === 'ArrowUp') next = (index - 1 + buttons.length) % buttons.length;+ else if (event.key === 'Home') next = 0;+ else if (event.key === 'End') next = buttons.length - 1;+ if (next !== null) {+ event.preventDefault();+ buttons[next].focus();+ }+ });+ panel.addEventListener('keydown', function (event) {+ if (event.key !== 'Escape') return;+ event.preventDefault();+ event.stopPropagation();+ close();+ });+ document.addEventListener('click', function (event) {+ if (!panel.hidden && !panel.contains(event.target) && !event.target.closest('[data-node-finder-trigger]')) close({ restoreFocus: false });+ });++ render('');+ return {+ open: open,+ close: close,+ toggle: toggle,+ select: select,+ isOpen: function () { return !panel.hidden; },+ context: function () { return context.kind; },+ count: items.length+ };+ })();\ No newline at end of filediff --git a/viewer/reader-layout.js b/viewer/reader-layout.jsnew file mode 100644index 00000000..d7f1a288--- /dev/null+++ b/viewer/reader-layout.js@@ -0,0 +1,168 @@+ Archify.readerLayout = (function () {+ var html = document.documentElement;+ var body = document.body;+ var shell = document.querySelector('.container');+ var diagram = document.querySelector('.diagram-container');+ var svg = diagram && diagram.querySelector(':scope > svg');+ var header = shell && shell.querySelector('.header');+ var guided = shell && shell.querySelector('.guided-views');+ var cards = shell && shell.querySelector('.cards');+ var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;+ var ratio = viewBox && viewBox.height > 0 ? viewBox.width / viewBox.height : 0;+ var frame = 0;+ var settleFrame = 0;+ var lastWidth = 0;+ var WIDE_RATIO = 1.55;+ var MIN_DESKTOP_WIDTH = 1024;+ var MIN_READER_WIDTH = 960;+ var MAX_READER_WIDTH = 1920;+ var SAFE_BOTTOM_GAP = 12;++ if (diagram && ratio >= WIDE_RATIO) {+ diagram.setAttribute('data-wide-diagram', 'true');+ html.setAttribute('data-diagram-shape', 'wide');+ }++ function number(value) {+ var parsed = parseFloat(value);+ return Number.isFinite(parsed) ? parsed : 0;+ }+ function visible(element) {+ return Boolean(element && !element.hidden && window.getComputedStyle(element).display !== 'none');+ }+ function outerHeight(element) {+ if (!visible(element)) return 0;+ var style = window.getComputedStyle(element);+ return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);+ }+ function eligible() {+ return Boolean(+ shell && diagram && svg && ratio >= WIDE_RATIO &&+ window.innerWidth >= MIN_DESKTOP_WIDTH &&+ html.getAttribute('data-embed') !== 'true' &&+ html.getAttribute('data-present') !== 'true' &&+ (!window.matchMedia || !window.matchMedia('print').matches)+ );+ }+ function clear() {+ html.style.removeProperty('--archify-reader-width');+ html.removeAttribute('data-reader-layout');+ html.removeAttribute('data-reader-overflow');+ lastWidth = 0;+ }+ function chromeMetrics() {+ var bodyStyle = window.getComputedStyle(body);+ var diagramStyle = window.getComputedStyle(diagram);+ return {+ bodyX: number(bodyStyle.paddingLeft) + number(bodyStyle.paddingRight),+ bodyY: number(bodyStyle.paddingTop) + number(bodyStyle.paddingBottom),+ diagramX: number(diagramStyle.paddingLeft) + number(diagramStyle.paddingRight) ++ number(diagramStyle.borderLeftWidth) + number(diagramStyle.borderRightWidth),+ diagramY: number(diagramStyle.paddingTop) + number(diagramStyle.paddingBottom) ++ number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)+ };+ }+ function applyWidth(width) {+ var rounded = Math.round(width);+ if (Math.abs(rounded - lastWidth) < 1) return false;+ lastWidth = rounded;+ html.style.setProperty('--archify-reader-width', rounded + 'px');+ html.setAttribute('data-reader-layout', 'adaptive');+ return true;+ }+ function settleOverflow(minWidth) {+ if (settleFrame) cancelAnimationFrame(settleFrame);+ settleFrame = requestAnimationFrame(function () {+ settleFrame = 0;+ if (!eligible() || !lastWidth) return;+ var overflow = Math.max(+ document.documentElement.scrollHeight,+ document.body.scrollHeight+ ) - window.innerHeight;+ if (overflow > 1 && lastWidth > minWidth) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ html.setAttribute('data-reader-overflow', 'reduced');+ } else if (overflow > 1) {+ html.setAttribute('data-reader-overflow', 'authored');+ } else {+ html.removeAttribute('data-reader-overflow');+ }+ });+ }+ function measure() {+ frame = 0;+ if (!eligible()) {+ clear();+ return null;+ }+ var chrome = chromeMetrics();+ var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);+ var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);+ var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);+ var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP ++ outerHeight(header) + outerHeight(guided) + outerHeight(cards);+ var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);+ var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;+ var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));+ applyWidth(width);+ settleOverflow(minWidth);+ return {+ ratio: ratio,+ width: Math.round(width),+ availableSvgHeight: Math.round(availableSvgHeight),+ fixedHeight: Math.round(fixedHeight)+ };+ }+ function schedule() {+ if (frame) return;+ frame = requestAnimationFrame(measure);+ }+ function stableSnapshot() {+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };+ return [+ lastWidth,+ html.getAttribute('data-reader-layout') || '',+ html.getAttribute('data-reader-overflow') || '',+ Math.ceil(document.documentElement.scrollWidth),+ Math.ceil(document.documentElement.scrollHeight),+ Math.ceil(document.body.scrollWidth),+ Math.ceil(document.body.scrollHeight),+ Math.round(shellRect.width * 100) / 100,+ Math.round(shellRect.height * 100) / 100,+ Math.round(diagramRect.width * 100) / 100,+ Math.round(diagramRect.height * 100) / 100+ ].join('|');+ }+ function whenStable() {+ return Archify.waitForStableLayout({+ schedule: schedule,+ pending: function () { return Boolean(frame || settleFrame); },+ snapshot: stableSnapshot,+ timeoutMessage: 'Adaptive reader layout did not reach stable dimensions.'+ });+ }++ window.addEventListener('resize', schedule, { passive: true });+ window.addEventListener('load', schedule, { once: true });+ if (document.fonts && document.fonts.ready) document.fonts.ready.then(schedule).catch(function () {});+ if (typeof ResizeObserver === 'function') {+ var resizeObserver = new ResizeObserver(schedule);+ [header, guided, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });+ }+ if (typeof MutationObserver === 'function') {+ var contentObserver = new MutationObserver(schedule);+ if (guided) contentObserver.observe(guided, { attributes: true, childList: true, subtree: true });+ if (cards) contentObserver.observe(cards, { attributes: true, childList: true, subtree: true });+ contentObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });+ }+ schedule();++ return {+ measure: measure,+ schedule: schedule,+ whenStable: whenStable,+ active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },+ receipt: function () { return { ratio: ratio, width: lastWidth }; }+ };+ })();diff --git a/viewer/route-probe.js b/viewer/route-probe.jsnew file mode 100644index 00000000..81b0a9c2--- /dev/null+++ b/viewer/route-probe.js@@ -0,0 +1,1034 @@+ /* ============================================================+ Route Probe — shortest directed path over compiled semantics.+ The graph is read from renderer-owned stable IDs and relationship+ endpoints. BFS order follows authored DOM edge order, so equal-length+ choices are deterministic without adding weights or a graph runtime.+ ============================================================ */+ Archify.routeProbe = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector(':scope > svg');+ var trigger = document.getElementById('btn-route-probe');+ var panel = document.getElementById('route-probe');+ var title = document.getElementById('route-probe-title');+ var path = document.getElementById('route-probe-path');+ var status = document.getElementById('route-probe-status');+ var findBtn = document.getElementById('route-probe-find');+ var copyBtn = document.getElementById('route-probe-copy');+ var clearBtn = document.getElementById('route-probe-clear');+ var journeyControls = document.getElementById('route-journey-controls');+ var journeyPrevBtn = document.getElementById('route-journey-prev');+ var journeyPlayBtn = document.getElementById('route-journey-play');+ var journeyPlayIcon = document.getElementById('route-journey-play-icon');+ var journeyPlayLabel = document.getElementById('route-journey-play-label');+ var journeyNextBtn = document.getElementById('route-journey-next');+ var journeyOverviewBtn = document.getElementById('route-journey-overview');+ var namespace = 'http://www.w3.org/2000/svg';+ var mode = 'idle';+ var startId = null;+ var endId = null;+ var activeNodeIds = [];+ var activeEdges = [];+ var journeyIndex = -1;+ var journeyPlaying = false;+ var journeyComplete = false;+ var journeyGeneration = 0;+ var journeyTimer = null;+ var journeyStartedAt = 0;+ var journeyElapsedMs = 0;+ var journeyOwnerToken = 0;+ var JOURNEY_DWELL_MS = 1100;++ function nodes() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));+ }+ function edges() {+ return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));+ }+ function nodesById() {+ var out = Object.create(null);+ nodes().forEach(function (node) { out[node.getAttribute('data-node-id')] = node; });+ return out;+ }+ function nodeLabel(node, fallback) {+ return node.getAttribute('data-node-label') ||+ (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];+ }+ function exportSnapshot() {+ if (mode !== 'result' || activeNodeIds.length < 2 || activeEdges.length !== activeNodeIds.length - 1) return null;+ var allNodes = nodes();+ var byId = nodesById();+ var seenNodeIds = Object.create(null);+ var seenEdgeKeys = Object.create(null);+ if (startId !== activeNodeIds[0] || endId !== activeNodeIds[activeNodeIds.length - 1] ||+ activeNodeIds.some(function (id) {+ if (seenNodeIds[id] || allNodes.filter(function (node) {+ return node.getAttribute('data-node-id') === id;+ }).length !== 1) return true;+ seenNodeIds[id] = true;+ return !byId[id];+ }) ||+ activeEdges.some(function (edge, index) {+ if (!edge || !svg.contains(edge)) return true;+ var edgeKey = edge.getAttribute('data-edge-key');+ var edgeId = edge.getAttribute('data-edge-id') || '';+ if (!edgeKey || seenEdgeKeys[edgeKey]) return true;+ seenEdgeKeys[edgeKey] = true;+ var fragments = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-key]')).filter(function (candidate) {+ return candidate.getAttribute('data-edge-key') === edgeKey;+ });+ var drawableFragments = fragments.filter(hasDrawableGeometry);+ return !fragments.length || !fragments.every(function (fragment) {+ return fragment.getAttribute('data-edge-from') === activeNodeIds[index] &&+ fragment.getAttribute('data-edge-to') === activeNodeIds[index + 1] &&+ (fragment.getAttribute('data-edge-id') || '') === edgeId;+ }) || drawableFragments.length !== 1 || drawableFragments[0] !== edge ||+ edge.getAttribute('data-edge-from') !== activeNodeIds[index] ||+ edge.getAttribute('data-edge-to') !== activeNodeIds[index + 1];+ })) return null;+ return {+ source: { id: startId, label: nodeLabel(byId[startId], startId) },+ target: { id: endId, label: nodeLabel(byId[endId], endId) },+ nodeIds: activeNodeIds.slice(),+ hops: activeEdges.length,+ edges: activeEdges.map(function (edge) {+ return {+ key: edge.getAttribute('data-edge-key'),+ id: edge.getAttribute('data-edge-id') || '',+ from: edge.getAttribute('data-edge-from'),+ to: edge.getAttribute('data-edge-to'),+ label: edge.getAttribute('data-edge-label') || ''+ };+ })+ };+ }+ function edgeShapes(edge) {+ if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];+ return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));+ }+ function removeOverlay() {+ Array.prototype.forEach.call(svg.querySelectorAll('[data-route-probe-overlay]'), function (overlay) {+ overlay.remove();+ });+ }+ function removeJourneyPulse(options) {+ options = options || {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-route-journey-overlay]'), function (overlay) {+ overlay.remove();+ });+ if (journeyOwnerToken && options.release !== false && Archify.motionGovernor) {+ var token = journeyOwnerToken;+ journeyOwnerToken = 0;+ Archify.motionGovernor.release(token);+ }+ }+ function stopJourneyTimer(options) {+ options = options || {};+ journeyGeneration += 1;+ if (journeyTimer) {+ if (options.preserveElapsed === true && journeyStartedAt) {+ journeyElapsedMs = Math.min(JOURNEY_DWELL_MS, journeyElapsedMs + Math.max(0, Date.now() - journeyStartedAt));+ }+ window.clearTimeout(journeyTimer);+ }+ journeyTimer = null;+ journeyStartedAt = 0;+ if (options.preserveElapsed !== true) journeyElapsedMs = 0;+ }+ function clearJourneyPresentation(options) {+ options = options || {};+ removeJourneyPulse();+ svg.removeAttribute('data-route-journey');+ panel.removeAttribute('data-route-journey');+ nodes().forEach(function (node) {+ node.removeAttribute('data-route-journey-state');+ node.removeAttribute('data-route-journey-current');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-route-journey-state');+ edge.removeAttribute('data-route-journey-current');+ });+ Array.prototype.forEach.call(path.querySelectorAll('[data-route-journey-index]'), function (button, index) {+ button.removeAttribute('data-route-journey-state');+ button.removeAttribute('aria-current');+ button.setAttribute('tabindex', index === 0 ? '0' : '-1');+ });+ if (options.keepControls !== true) journeyControls.hidden = true;+ journeyControls.setAttribute('data-playing', 'false');+ }+ function resetJourneyState() {+ stopJourneyTimer();+ journeyPlaying = false;+ journeyComplete = false;+ journeyIndex = -1;+ clearJourneyPresentation();+ }+ function cleanSvgState() {+ resetJourneyState();+ svg.removeAttribute('data-route-picking');+ svg.removeAttribute('data-route-active');+ removeOverlay();+ nodes().forEach(function (node) {+ node.removeAttribute('data-route-match');+ node.removeAttribute('data-route-start');+ node.removeAttribute('data-route-end');+ node.removeAttribute('data-route-step');+ node.removeAttribute('data-route-candidate');+ node.style.removeProperty('--route-step');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-route-match');+ edge.removeAttribute('data-route-step');+ edge.style.removeProperty('--route-step');+ });+ panel.removeAttribute('data-route-dock');+ }+ function replaceRouteHash(value) {+ try {+ history.replaceState(null, '', location.pathname + location.search + (value ? '#route=' + value : ''));+ } catch (_) {}+ }+ function renderPlaceholder(copy) {+ path.textContent = '';+ var placeholder = document.createElement('span');+ placeholder.className = 'route-probe-placeholder';+ placeholder.textContent = copy;+ path.appendChild(placeholder);+ }+ function renderPath(ids, options) {+ options = options || {};+ var byId = nodesById();+ path.textContent = '';+ ids.forEach(function (id, index) {+ if (index) {+ var arrow = document.createElement('span');+ arrow.className = 'route-probe-arrow';+ arrow.setAttribute('aria-hidden', 'true');+ arrow.textContent = '\u2192';+ path.appendChild(arrow);+ }+ var item = document.createElement(options.interactive === true ? 'button' : 'span');+ if (options.interactive === true) {+ item.type = 'button';+ item.setAttribute('data-route-journey-index', String(index));+ item.setAttribute('data-route-node-id', id);+ item.setAttribute('tabindex', index === 0 ? '0' : '-1');+ item.setAttribute('aria-label', viewerText('viewer.route.position', {+ index: index + 1,+ total: ids.length,+ label: nodeLabel(byId[id], id)+ }));+ }+ item.className = 'route-probe-node';+ item.textContent = nodeLabel(byId[id], id);+ item.title = nodeLabel(byId[id], id) + ' · ' + id;+ if (index === 0) item.setAttribute('data-endpoint', 'start');+ if (index === ids.length - 1 && ids.length > 1) item.setAttribute('data-endpoint', 'end');+ path.appendChild(item);+ });+ }+ function setTrigger(active) {+ trigger.setAttribute('aria-pressed', active ? 'true' : 'false');+ trigger.setAttribute('aria-label', viewerText(active ? 'viewer.route.trigger.clear' : 'viewer.guide.route.aria'));+ }+ function clear(options) {+ options = options || {};+ var wasActive = mode !== 'idle';+ if (Archify.finder && Archify.finder.isOpen() && typeof Archify.finder.context === 'function' && Archify.finder.context().indexOf('route-') === 0) {+ Archify.finder.close({ restoreFocus: false });+ }+ mode = 'idle';+ startId = null;+ endId = null;+ activeNodeIds = [];+ activeEdges = [];+ cleanSvgState();+ panel.hidden = true;+ panel.setAttribute('data-state', 'idle');+ panel.removeAttribute('data-finder-open');+ title.textContent = viewerText('viewer.route.start');+ renderPlaceholder(viewerText('viewer.route.pickTwo'));+ status.textContent = viewerText('viewer.route.instructions');+ findBtn.hidden = true;+ findBtn.textContent = viewerText('viewer.route.start.find');+ findBtn.setAttribute('aria-label', viewerText('viewer.route.start.find.aria'));+ copyBtn.hidden = true;+ copyBtn.textContent = viewerText('viewer.route.copy');+ if (Archify.exportMenu && typeof Archify.exportMenu.syncRouteShare === 'function') Archify.exportMenu.syncRouteShare();+ setTrigger(false);+ if (wasActive && options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {+ Archify.view.reset({ automatic: true });+ }+ if (options.updateUrl !== false) replaceRouteHash('');+ if (options.restoreFocus === true) trigger.focus();+ }+ function outgoingByNode() {+ var byId = nodesById();+ var outgoing = {};+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ if (!byId[from] || !byId[to] || from === to) return;+ if (!outgoing[from]) outgoing[from] = [];+ outgoing[from].push({ edge: edge, to: to });+ });+ return outgoing;+ }+ function reachableFrom(source) {+ var outgoing = outgoingByNode();+ var reached = {};+ var queue = [source];+ reached[source] = true;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var links = outgoing[queue[cursor]] || [];+ links.forEach(function (link) {+ if (reached[link.to]) return;+ reached[link.to] = true;+ queue.push(link.to);+ });+ }+ return reached;+ }+ function hopDistancesFrom(source) {+ var outgoing = outgoingByNode();+ var distances = {};+ var queue = [source];+ distances[source] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var links = outgoing[queue[cursor]] || [];+ links.forEach(function (link) {+ if (Object.prototype.hasOwnProperty.call(distances, link.to)) return;+ distances[link.to] = distances[queue[cursor]] + 1;+ queue.push(link.to);+ });+ }+ return distances;+ }+ function shortestDirectedPath(source, target) {+ if (source === target) return null;+ var outgoing = outgoingByNode();+ var previous = {};+ var queue = [source];+ previous[source] = null;+ for (var cursor = 0; cursor < queue.length && !Object.prototype.hasOwnProperty.call(previous, target); cursor += 1) {+ var links = outgoing[queue[cursor]] || [];+ links.some(function (link) {+ if (Object.prototype.hasOwnProperty.call(previous, link.to)) return false;+ previous[link.to] = { from: queue[cursor], edge: link.edge };+ queue.push(link.to);+ return link.to === target;+ });+ }+ if (!Object.prototype.hasOwnProperty.call(previous, target)) return null;+ var nodeIds = [target];+ var routeEdges = [];+ var current = target;+ while (current !== source) {+ var step = previous[current];+ if (!step) return null;+ routeEdges.unshift(step.edge);+ nodeIds.unshift(step.from);+ current = step.from;+ }+ return { nodes: nodeIds, edges: routeEdges };+ }+ function traceGeometry(shape, step) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-labelledby');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.removeAttribute('data-route-match');+ clone.removeAttribute('data-route-step');+ clone.setAttribute('class', 'route-probe-flow');+ clone.setAttribute('pathLength', '1');+ clone.style.setProperty('--route-step', String(step));+ return clone;+ }+ function renderOverlay(routeEdges) {+ removeOverlay();+ if (!routeEdges.length) return;+ var overlay = document.createElementNS(namespace, 'g');+ overlay.setAttribute('class', 'route-probe-overlay');+ overlay.setAttribute('data-route-probe-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ routeEdges.forEach(function (edge, step) {+ var wrapper = document.createElementNS(namespace, 'g');+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));+ edgeShapes(edge).forEach(function (shape) { wrapper.appendChild(traceGeometry(shape, step)); });+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);+ });+ var firstNode = svg.querySelector('[data-node-id]');+ if (firstNode) svg.insertBefore(overlay, firstNode);+ else svg.appendChild(overlay);+ }+ function journeyButtons() {+ return Array.prototype.slice.call(path.querySelectorAll('[data-route-journey-index]'));+ }+ function journeyMotionAllowed() {+ return html.getAttribute('data-embed') !== 'true' &&+ !document.hidden &&+ Archify.motionGovernor &&+ Archify.motionGovernor.capable === true &&+ !Archify.motionGovernor.isPaused();+ }+ function routeOverviewStatus() {+ return viewerText('viewer.route.overview.status', {+ nodes: viewerCount('viewer.route.overview.node', activeNodeIds.length),+ hops: viewerCount('viewer.route.overview.hop', activeEdges.length)+ });+ }+ function centerJourneyButton(button) {+ if (!button) return;+ var target = button.offsetLeft - Math.max(0, (path.clientWidth - button.offsetWidth) / 2);+ path.scrollLeft = Math.max(0, target);+ }+ function focusJourneyButton(index) {+ var buttons = journeyButtons();+ if (!buttons.length) return false;+ var next = Math.max(0, Math.min(buttons.length - 1, index));+ buttons.forEach(function (button, buttonIndex) {+ button.setAttribute('tabindex', buttonIndex === next ? '0' : '-1');+ });+ try { buttons[next].focus({ preventScroll: true }); } catch (_) { buttons[next].focus(); }+ centerJourneyButton(buttons[next]);+ return true;+ }+ function renderJourneyControls() {+ var hasRoute = mode === 'result' && activeNodeIds.length > 1;+ var canPlay = hasRoute && journeyMotionAllowed();+ journeyControls.hidden = !hasRoute;+ journeyControls.setAttribute('data-playing', journeyPlaying ? 'true' : 'false');+ journeyPrevBtn.disabled = !hasRoute || journeyIndex <= 0;+ journeyNextBtn.disabled = !hasRoute || journeyIndex >= activeNodeIds.length - 1;+ journeyOverviewBtn.disabled = !hasRoute || journeyIndex < 0;+ journeyPlayBtn.disabled = !canPlay;+ journeyPlayBtn.setAttribute('aria-pressed', journeyPlaying ? 'true' : 'false');+ if (journeyPlaying) {+ journeyPlayIcon.textContent = '\u275a\u275a';+ journeyPlayLabel.textContent = viewerText('viewer.route.pause.label');+ journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.pause'));+ journeyPlayBtn.title = viewerText('viewer.route.pause');+ } else if (journeyComplete || journeyIndex === activeNodeIds.length - 1) {+ journeyPlayIcon.textContent = '\u21bb';+ journeyPlayLabel.textContent = viewerText('viewer.route.replay.label');+ journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.replay'));+ journeyPlayBtn.title = viewerText(canPlay ? 'viewer.route.replay' : 'viewer.route.motionRequired');+ } else {+ journeyPlayIcon.textContent = '\u25b6';+ journeyPlayLabel.textContent = viewerText('viewer.route.journey');+ journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.play'));+ journeyPlayBtn.title = viewerText(canPlay ? 'viewer.route.play' : 'viewer.route.motionRequired');+ }+ }+ function journeyGeometry(shape) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-labelledby');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.removeAttribute('data-route-match');+ clone.removeAttribute('data-route-step');+ clone.removeAttribute('data-route-journey-state');+ clone.removeAttribute('data-route-journey-current');+ clone.setAttribute('class', 'route-journey-flow');+ clone.setAttribute('pathLength', '1');+ return clone;+ }+ function renderJourneyPulse(edge) {+ removeJourneyPulse();+ if (!edge || !journeyMotionAllowed()) return false;+ var overlay = document.createElementNS(namespace, 'g');+ overlay.setAttribute('class', 'route-journey-overlay');+ overlay.setAttribute('data-route-journey-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ var wrapper = document.createElementNS(namespace, 'g');+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));+ edgeShapes(edge).forEach(function (shape) { wrapper.appendChild(journeyGeometry(shape)); });+ if (!wrapper.childNodes.length) return false;+ overlay.appendChild(wrapper);+ var firstNode = svg.querySelector('[data-node-id]');+ if (firstNode) svg.insertBefore(overlay, firstNode);+ else svg.appendChild(overlay);+ if (Archify.motionGovernor && Archify.motionGovernor.capable) {+ var token = 0;+ token = Archify.motionGovernor.claim('route', function () {+ if (journeyOwnerToken === token) journeyOwnerToken = 0;+ removeJourneyPulse({ release: false });+ });+ journeyOwnerToken = token;+ }+ overlay.addEventListener('animationend', function () {+ if (overlay.isConnected) removeJourneyPulse();+ }, { once: true });+ window.setTimeout(function () {+ if (overlay.isConnected) removeJourneyPulse();+ }, 860);+ return true;+ }+ function applyJourneyState(index, options) {+ options = options || {};+ if (mode !== 'result' || !activeNodeIds.length) return false;+ var byId = nodesById();+ journeyIndex = Math.max(0, Math.min(activeNodeIds.length - 1, index));+ removeJourneyPulse();+ svg.setAttribute('data-route-journey', (journeyIndex + 1) + '/' + activeNodeIds.length);+ panel.setAttribute('data-route-journey', String(journeyIndex));+ activeNodeIds.forEach(function (id, step) {+ var node = byId[id];+ if (!node) return;+ var state = step < journeyIndex ? 'past' : (step === journeyIndex ? 'current' : 'future');+ node.setAttribute('data-route-journey-state', state);+ if (step === journeyIndex) node.setAttribute('data-route-journey-current', '');+ else node.removeAttribute('data-route-journey-current');+ });+ activeEdges.forEach(function (edge, step) {+ var destination = step + 1;+ var state = destination < journeyIndex ? 'past' : (destination === journeyIndex ? 'current' : 'future');+ edge.setAttribute('data-route-journey-state', state);+ if (destination === journeyIndex) edge.setAttribute('data-route-journey-current', '');+ else edge.removeAttribute('data-route-journey-current');+ });+ var buttons = journeyButtons();+ buttons.forEach(function (button, step) {+ var state = step < journeyIndex ? 'past' : (step === journeyIndex ? 'current' : 'future');+ button.setAttribute('data-route-journey-state', state);+ button.setAttribute('tabindex', step === journeyIndex ? '0' : '-1');+ if (step === journeyIndex) button.setAttribute('aria-current', 'step');+ else button.removeAttribute('aria-current');+ });+ if (options.center !== false) centerJourneyButton(buttons[journeyIndex]);+ var phase = viewerText(journeyPlaying+ ? 'viewer.route.phase.playing'+ : journeyComplete+ ? 'viewer.route.phase.complete'+ : 'viewer.route.phase.inspecting');+ status.textContent = viewerText('viewer.route.step', {+ index: journeyIndex + 1,+ total: activeNodeIds.length,+ phase: phase,+ label: nodeLabel(byId[activeNodeIds[journeyIndex]], activeNodeIds[journeyIndex])+ });+ if (options.pulse === true && journeyIndex > 0) renderJourneyPulse(activeEdges[journeyIndex - 1]);+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(activeNodeIds.slice(Math.max(0, journeyIndex - 1), Math.min(activeNodeIds.length, journeyIndex + 2)), {+ includeNeighbors: false,+ reason: 'route-journey',+ maxScale: 1.65,+ padding: 64,+ duration: 360,+ instant: !journeyMotionAllowed()+ });+ }+ renderJourneyControls();+ requestDocking();+ return true;+ }+ function pauseJourney(options) {+ options = options || {};+ if (!journeyPlaying && options.complete !== true) {+ renderJourneyControls();+ return false;+ }+ stopJourneyTimer({ preserveElapsed: options.complete !== true && options.preserveElapsed !== false });+ journeyPlaying = false;+ journeyComplete = options.complete === true;+ if (journeyComplete) journeyElapsedMs = 0;+ removeJourneyPulse();+ if (journeyIndex >= 0) applyJourneyState(journeyIndex, { center: false, pulse: false, reveal: false });+ else renderJourneyControls();+ return true;+ }+ function selectJourneyIndex(index) {+ if (mode !== 'result') return false;+ stopJourneyTimer();+ journeyPlaying = false;+ journeyComplete = false;+ return applyJourneyState(index, { pulse: true, reveal: true });+ }+ function showJourneyOverview(options) {+ options = options || {};+ if (mode !== 'result') return false;+ stopJourneyTimer();+ journeyPlaying = false;+ journeyComplete = false;+ journeyIndex = -1;+ clearJourneyPresentation({ keepControls: true });+ status.textContent = routeOverviewStatus();+ renderJourneyControls();+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(activeNodeIds, { includeNeighbors: false, reason: 'route', instant: !journeyMotionAllowed() });+ }+ requestDocking();+ return true;+ }+ function scheduleJourney() {+ if (!journeyPlaying || !journeyMotionAllowed()) {+ pauseJourney({ preserveElapsed: true });+ return false;+ }+ var generation = ++journeyGeneration;+ var remaining = Math.max(0, JOURNEY_DWELL_MS - journeyElapsedMs);+ journeyStartedAt = Date.now();+ journeyTimer = window.setTimeout(function () {+ if (generation !== journeyGeneration || !journeyPlaying) return;+ journeyTimer = null;+ journeyStartedAt = 0;+ journeyElapsedMs = 0;+ if (journeyIndex >= activeNodeIds.length - 1) {+ pauseJourney({ complete: true, preserveElapsed: false });+ return;+ }+ applyJourneyState(journeyIndex + 1, { pulse: true, reveal: true });+ // Camera and motion-owner handoff are allowed to synchronously+ // settle the previous step. The new step always starts with a fresh+ // dwell; never carry cleanup time into the next scheduler lease.+ journeyElapsedMs = 0;+ journeyStartedAt = 0;+ scheduleJourney();+ }, remaining);+ return true;+ }+ function playJourney() {+ if (mode !== 'result' || activeNodeIds.length < 2 || !journeyMotionAllowed()) {+ renderJourneyControls();+ return false;+ }+ if (journeyPlaying) return true;+ if (journeyComplete || journeyIndex >= activeNodeIds.length - 1) {+ journeyIndex = -1;+ journeyElapsedMs = 0;+ journeyComplete = false;+ }+ journeyPlaying = true;+ if (journeyIndex < 0) applyJourneyState(0, { pulse: false, reveal: true });+ else applyJourneyState(journeyIndex, { center: false, pulse: false, reveal: false });+ scheduleJourney();+ return true;+ }+ function toggleJourney() {+ return journeyPlaying ? pauseJourney({ preserveElapsed: true }) : playJourney();+ }+ function previousJourney() {+ return selectJourneyIndex(Math.max(0, journeyIndex < 0 ? 0 : journeyIndex - 1));+ }+ function nextJourney() {+ return selectJourneyIndex(Math.min(activeNodeIds.length - 1, journeyIndex + 1));+ }+ function overlapArea(a, b) {+ var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));+ var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));+ return width * height;+ }+ function updateDocking() {+ if (panel.hidden) {+ panel.removeAttribute('data-route-dock');+ return;+ }+ var containerRect = container.getBoundingClientRect();+ var width = panel.offsetWidth;+ var height = panel.offsetHeight;+ if (!width || !height) return;+ var currentRect = panel.getBoundingClientRect();+ var left = currentRect.left;+ var topCandidate = {+ left: left,+ right: left + width,+ top: containerRect.top + 8,+ bottom: containerRect.top + 8 + height+ };+ var nav = container.querySelector('.diagram-nav');+ var navRect = nav ? nav.getBoundingClientRect() : null;+ var bottom = navRect ? navRect.top - 9 : containerRect.bottom - 8;+ var bottomCandidate = {+ left: left,+ right: left + width,+ top: bottom - height,+ bottom: bottom+ };+ var byId = nodesById();+ var relevant = activeNodeIds.length ? activeNodeIds : (startId ? [startId] : []);+ var blockers = relevant.map(function (id) { return byId[id]; }).filter(Boolean).map(function (node) {+ return node.getBoundingClientRect();+ });+ function score(candidate) {+ var value = blockers.reduce(function (sum, rect) { return sum + overlapArea(candidate, rect); }, 0);+ if (navRect) value += overlapArea(candidate, navRect) * 4;+ if (candidate.top < containerRect.top || candidate.bottom > containerRect.bottom) value += 1000000;+ return value;+ }+ if (score(topCandidate) <= score(bottomCandidate)) panel.setAttribute('data-route-dock', 'top');+ else panel.setAttribute('data-route-dock', 'bottom');+ }+ function requestDocking() {+ requestAnimationFrame(updateDocking);+ window.setTimeout(updateDocking, 120);+ window.setTimeout(updateDocking, 560);+ }+ function chooseStart(id) {+ var byId = nodesById();+ if (!byId[id]) return false;+ cleanSvgState();+ startId = id;+ endId = null;+ mode = 'target';+ var reached = reachableFrom(id);+ byId[id].setAttribute('data-route-start', '');+ byId[id].setAttribute('data-route-match', '');+ Object.keys(reached).forEach(function (candidateId) {+ if (candidateId !== id && byId[candidateId]) byId[candidateId].setAttribute('data-route-candidate', '');+ });+ svg.setAttribute('data-route-picking', 'target');+ panel.setAttribute('data-state', 'target');+ title.textContent = viewerText('viewer.route.destination', { label: nodeLabel(byId[id], id) });+ renderPath([id]);+ var count = Math.max(0, Object.keys(reached).length - 1);+ status.textContent = count+ ? viewerCount('viewer.route.destination.count', count)+ : viewerText('viewer.route.noOutgoing');+ findBtn.hidden = false;+ findBtn.textContent = viewerText('viewer.route.destination.find');+ findBtn.setAttribute('aria-label', viewerText('viewer.route.destination.find.aria'));+ requestDocking();+ return true;+ }+ function showResult(result, options) {+ options = options || {};+ var byId = nodesById();+ cleanSvgState();+ mode = 'result';+ startId = result.nodes[0];+ endId = result.nodes[result.nodes.length - 1];+ activeNodeIds = result.nodes.slice();+ activeEdges = result.edges.slice();+ result.nodes.forEach(function (id, step) {+ var node = byId[id];+ if (!node) return;+ node.setAttribute('data-route-match', '');+ node.setAttribute('data-route-step', String(step));+ node.style.setProperty('--route-step', String(step));+ if (step === 0) node.setAttribute('data-route-start', '');+ if (step === result.nodes.length - 1) node.setAttribute('data-route-end', '');+ });+ result.edges.forEach(function (edge, step) {+ edge.setAttribute('data-route-match', '');+ edge.setAttribute('data-route-step', String(step));+ edge.style.setProperty('--route-step', String(step));+ });+ svg.setAttribute('data-route-active', startId + '~' + endId);+ renderOverlay(result.edges);+ renderPath(result.nodes, { interactive: true });+ panel.setAttribute('data-state', 'result');+ panel.hidden = false;+ title.textContent = viewerText('viewer.route.result.title', {+ source: nodeLabel(byId[startId], startId),+ target: nodeLabel(byId[endId], endId)+ });+ findBtn.hidden = true;+ copyBtn.hidden = false;+ setTrigger(true);+ if (Archify.exportMenu && typeof Archify.exportMenu.syncRouteShare === 'function') Archify.exportMenu.syncRouteShare();+ if (options.updateUrl !== false) {+ replaceRouteHash(encodeURIComponent(startId) + '~' + encodeURIComponent(endId));+ }+ showJourneyOverview({ reveal: false });+ if (Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodes, { includeNeighbors: false, reason: 'route' });+ }+ return true;+ }+ function choose(id, options) {+ options = options || {};+ var byId = nodesById();+ if (!byId[id]) return false;+ if (mode === 'source') return chooseStart(id);+ if (mode !== 'target') return false;+ if (id === startId) {+ panel.setAttribute('data-state', 'error');+ title.textContent = viewerText('viewer.route.differentDestination');+ status.textContent = viewerText('viewer.route.distinct');+ return false;+ }+ var result = shortestDirectedPath(startId, id);+ if (!result) {+ panel.setAttribute('data-state', 'error');+ title.textContent = viewerText('viewer.route.unreachable', { label: nodeLabel(byId[id], id) });+ status.textContent = viewerText('viewer.route.unreachable.detail', {+ target: nodeLabel(byId[id], id),+ source: nodeLabel(byId[startId], startId)+ });+ return false;+ }+ return showResult(result, options);+ }+ function begin(options) {+ options = options || {};+ if (html.getAttribute('data-embed') === 'true') return false;+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (Archify.semanticLens && Archify.semanticLens.active()) {+ Archify.semanticLens.clear({ updateUrl: false, preserveView: true, closePanel: true });+ }+ var focused = options.source || (Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null);+ if (Array.isArray(focused)) focused = null;+ clear({ updateUrl: false, preserveView: true, restoreFocus: false });+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ if (Archify.focus && typeof Archify.focus.clear === 'function') {+ Archify.focus.clear({ updateUrl: false, preserveView: true });+ }+ if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });+ if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });+ mode = 'source';+ panel.hidden = false;+ panel.setAttribute('data-state', 'source');+ svg.setAttribute('data-route-picking', 'source');+ title.textContent = viewerText('viewer.route.start');+ renderPlaceholder(viewerText('viewer.route.pickOne'));+ status.textContent = viewerText('viewer.route.start.instructions');+ findBtn.hidden = false;+ findBtn.textContent = viewerText('viewer.route.start.find');+ findBtn.setAttribute('aria-label', viewerText('viewer.route.start.find.aria'));+ copyBtn.hidden = true;+ setTrigger(true);+ if (focused && nodesById()[focused]) chooseStart(focused);+ if (options.focusNode === true && !focused) {+ var first = nodes()[0];+ if (first) {+ try { first.focus({ preventScroll: true }); } catch (_) { try { first.focus(); } catch (_) {} }+ }+ }+ return true;+ }+ function toggle(options) {+ if (mode !== 'idle') {+ clear({ restoreFocus: true });+ return false;+ }+ return begin(options);+ }+ function finderContext() {+ var byId = nodesById();+ if (mode === 'source') {+ var outgoing = outgoingByNode();+ var sourceIds = nodes().map(function (node) { return node.getAttribute('data-node-id'); }).filter(function (id) {+ return outgoing[id] && outgoing[id].length;+ });+ var sourceBadges = {};+ sourceIds.forEach(function (id) { sourceBadges[id] = viewerText('viewer.route.finder.source.badge'); });+ return {+ kind: 'route-source',+ title: viewerText('viewer.route.finder.source.title'),+ placeholder: viewerText('viewer.route.finder.source.placeholder'),+ empty: viewerText('viewer.route.finder.source.empty'),+ resultsLabel: viewerText('viewer.route.finder.source.results'),+ availableNoun: viewerText('viewer.route.finder.source.noun'),+ allowedIds: sourceIds,+ badges: sourceBadges+ };+ }+ if (mode === 'target' && startId && byId[startId]) {+ var distances = hopDistancesFrom(startId);+ var targetIds = Object.keys(distances).filter(function (id) { return id !== startId && byId[id]; });+ var targetBadges = {};+ targetIds.forEach(function (id) {+ targetBadges[id] = viewerCount('viewer.route.hop', distances[id]);+ });+ return {+ kind: 'route-target',+ title: viewerText('viewer.route.finder.target.title', { label: nodeLabel(byId[startId], startId) }),+ placeholder: viewerText('viewer.route.finder.target.placeholder'),+ empty: viewerText('viewer.route.finder.target.empty'),+ resultsLabel: viewerText('viewer.route.finder.target.results'),+ availableNoun: viewerText('viewer.route.finder.target.noun'),+ allowedIds: targetIds,+ badges: targetBadges+ };+ }+ return null;+ }+ function finderOpening() {+ panel.setAttribute('data-finder-open', 'true');+ }+ function finderClosed(options) {+ options = options || {};+ panel.removeAttribute('data-finder-open');+ requestDocking();+ if (options.restoreFocus === true && !findBtn.hidden) findBtn.focus();+ }+ function openFinder() {+ var context = finderContext();+ if (!context || !Archify.finder) return false;+ return Archify.finder.open({ context: context });+ }+ function fallbackCopy(value) {+ var field = document.createElement('textarea');+ field.value = value;+ field.setAttribute('readonly', '');+ field.style.position = 'fixed';+ field.style.opacity = '0';+ document.body.appendChild(field);+ field.select();+ var copied = false;+ try { copied = document.execCommand('copy'); } catch (_) {}+ field.remove();+ return copied;+ }+ function copyLink() {+ if (mode !== 'result') return Promise.resolve(false);+ var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);+ var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })+ : Promise.resolve(fallbackCopy(value));+ return copy.then(function (copied) {+ copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');+ copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));+ window.setTimeout(function () {+ copyBtn.textContent = viewerText('viewer.route.copy');+ copyBtn.setAttribute('aria-label', viewerText('viewer.route.copy.aria'));+ }, 1600);+ return copied;+ });+ }+ function interceptSelection(event) {+ if (mode !== 'source' && mode !== 'target') return;+ if (container.getAttribute('data-just-panned') === 'true') return;+ var node = event.target.closest('[data-node-id]');+ if (!node) return;+ if (event.type === 'keydown' && event.key !== 'Enter' && event.key !== ' ') return;+ event.preventDefault();+ event.stopImmediatePropagation();+ choose(node.getAttribute('data-node-id'));+ }+ function syncFromHash() {+ try {+ var params = new URLSearchParams(location.hash.replace(/^#/, ''));+ var route = params.get('route');+ if (!route) {+ if (mode !== 'idle') clear({ updateUrl: false, restoreFocus: false });+ return;+ }+ var parts = route.split('~');+ if (parts.length !== 2) return;+ var byId = nodesById();+ if (!byId[parts[0]] || !byId[parts[1]]) return;+ begin({ source: parts[0], focusNode: false });+ choose(parts[1], { updateUrl: false });+ } catch (_) {}+ }+ function escapeRoute(options) {+ options = options || {};+ if (journeyPlaying) {+ pauseJourney({ preserveElapsed: true });+ if (options.restoreFocus === true) journeyPlayBtn.focus();+ return 'paused';+ }+ if (journeyIndex >= 0) {+ showJourneyOverview({ reveal: true });+ if (options.restoreFocus === true) journeyOverviewBtn.focus();+ return 'overview';+ }+ clear({ restoreFocus: options.restoreFocus === true });+ return 'cleared';+ }+ function syncJourneyMotion() {+ if (journeyPlaying && !journeyMotionAllowed()) pauseJourney({ preserveElapsed: true });+ renderJourneyControls();+ return journeyMotionAllowed();+ }++ trigger.addEventListener('click', function () { toggle({ focusNode: false }); });+ findBtn.addEventListener('click', openFinder);+ clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });+ copyBtn.addEventListener('click', copyLink);+ journeyPrevBtn.addEventListener('click', previousJourney);+ journeyPlayBtn.addEventListener('click', toggleJourney);+ journeyNextBtn.addEventListener('click', nextJourney);+ journeyOverviewBtn.addEventListener('click', function () { showJourneyOverview({ reveal: true }); });+ path.addEventListener('click', function (event) {+ var button = event.target.closest('[data-route-journey-index]');+ if (!button) return;+ selectJourneyIndex(Number(button.getAttribute('data-route-journey-index')));+ });+ path.addEventListener('focusin', function (event) {+ if (journeyPlaying && event.target.closest('[data-route-journey-index]')) pauseJourney({ preserveElapsed: true });+ });+ path.addEventListener('keydown', function (event) {+ var button = event.target.closest('[data-route-journey-index]');+ if (!button) return;+ var index = Number(button.getAttribute('data-route-journey-index'));+ var next = null;+ if (event.key === 'ArrowRight') next = Math.min(activeNodeIds.length - 1, index + 1);+ else if (event.key === 'ArrowLeft') next = Math.max(0, index - 1);+ else if (event.key === 'Home') next = 0;+ else if (event.key === 'End') next = activeNodeIds.length - 1;+ if (next !== null) {+ event.preventDefault();+ focusJourneyButton(next);+ return;+ }+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ selectJourneyIndex(index);+ }+ });+ svg.addEventListener('click', interceptSelection, true);+ svg.addEventListener('keydown', interceptSelection, true);+ container.addEventListener('scroll', updateDocking, { passive: true });+ window.addEventListener('resize', requestDocking);+ window.addEventListener('beforeprint', function () {+ if (journeyPlaying) pauseJourney({ preserveElapsed: true, reason: 'print' });+ else removeJourneyPulse();+ });+ window.addEventListener('hashchange', function () { requestAnimationFrame(syncFromHash); });+ syncFromHash();++ return {+ begin: begin,+ choose: choose,+ clear: clear,+ toggle: toggle,+ escape: escapeRoute,+ copyLink: copyLink,+ playJourney: playJourney,+ pauseJourney: pauseJourney,+ showOverview: showJourneyOverview,+ selectJourneyIndex: selectJourneyIndex,+ syncMotion: syncJourneyMotion,+ isJourneyPlaying: function () { return journeyPlaying; },+ finderContext: finderContext,+ finderOpening: finderOpening,+ finderClosed: finderClosed,+ openFinder: openFinder,+ exportSnapshot: exportSnapshot,+ active: function () { return mode === 'idle' ? null : mode; },+ result: function () {+ return mode === 'result'+ ? { source: startId, target: endId, nodes: activeNodeIds.slice(), hops: activeEdges.length, journey: journeyIndex, playing: journeyPlaying }+ : null;+ }+ };+ })();\ No newline at end of filediff --git a/viewer/semantic-lens.js b/viewer/semantic-lens.jsnew file mode 100644index 00000000..e8906e73--- /dev/null+++ b/viewer/semantic-lens.js@@ -0,0 +1,675 @@+ /* ============================================================+ Semantic Lens — a counted, viewer-only legend over data-node-kind.+ One selected kind reveals every authored relationship touching it.+ Two selected kinds compare only direct cross-kind relationships while+ preserving the full diagram as a dimmed spatial reference.+ ============================================================ */+ Archify.semanticLens = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector(':scope > svg');+ var trigger = document.getElementById('btn-semantic-lens');+ var panel = document.getElementById('semantic-lens');+ var closeBtn = document.getElementById('semantic-lens-close');+ var kindsRoot = document.getElementById('semantic-lens-kinds');+ var status = document.getElementById('semantic-lens-status');+ var copyBtn = document.getElementById('semantic-lens-copy');+ var clearBtn = document.getElementById('semantic-lens-clear');+ var legendBridge = svg.querySelector('[data-legend-bridge]');+ var legendEntries = [];+ var hoveredLegendEntry = null;+ var focusedLegendEntry = null;+ var activeLegendPreview = null;+ var lensOpener = trigger;+ var selectedKinds = [];+ var namespace = 'http://www.w3.org/2000/svg';+ var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;+ var MAX_LENS_FLOW_EDGES = 24;++ function nodesById() {+ var byId = {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-node-kind]'), function (node) {+ var id = node.getAttribute('data-node-id');+ if (id && !byId[id]) byId[id] = node;+ });+ return byId;+ }+ function collectKinds() {+ var kinds = {};+ var byId = nodesById();+ Object.keys(byId).forEach(function (id) {+ var node = byId[id];+ var value = node.getAttribute('data-node-kind') || 'neutral';+ var kind = kinds[value] || (kinds[value] = { id: value, label: viewerKindLabel(value), nodes: [] });+ kind.nodes.push(node);+ });+ return Object.keys(kinds).map(function (key) { return kinds[key]; }).sort(function (a, b) {+ return b.nodes.length - a.nodes.length || a.label.localeCompare(b.label);+ });+ }+ function edgeGroups() {+ var groups = {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || [from, to, edge.getAttribute('data-edge-label') || ''].join('\u0000');+ if (!groups[key]) groups[key] = { key: key, from: from, to: to, members: [] };+ groups[key].members.push(edge);+ });+ return Object.keys(groups).map(function (key) { return groups[key]; });+ }+ function edgeShapes(edge) {+ if (!edge) return [];+ if (/^(path|line|polyline)$/i.test(edge.tagName || '')) return [edge];+ return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));+ }+ function legendSourceBounds(entry) {+ var bounds = null;+ Array.prototype.forEach.call(entry.children, function (child) {+ if (child.hasAttribute('data-legend-bridge-runtime')) return;+ var box;+ try { box = child.getBBox(); } catch (_) { return; }+ if (!box || !Number.isFinite(box.x) || !Number.isFinite(box.y)) return;+ var next = { left: box.x, top: box.y, right: box.x + box.width, bottom: box.y + box.height };+ if (!bounds) bounds = next;+ else {+ bounds.left = Math.min(bounds.left, next.left);+ bounds.top = Math.min(bounds.top, next.top);+ bounds.right = Math.max(bounds.right, next.right);+ bounds.bottom = Math.max(bounds.bottom, next.bottom);+ }+ });+ return bounds;+ }+ function layoutLegendEntry(entry) {+ var bounds = legendSourceBounds(entry);+ var hit = entry.querySelector('[data-legend-hit]');+ var badge = entry.querySelector('[data-legend-count-badge]');+ if (!bounds || !hit || !badge) return false;+ var count = entry.getAttribute('data-legend-count') || '0';+ var centerY = (bounds.top + bounds.bottom) / 2;+ var badgeWidth = Math.max(14, count.length * 5 + 8);+ var badgeX = bounds.right + 3;+ var hitX = bounds.left - 5;+ var hitRight = badgeX + badgeWidth + 4;+ hit.setAttribute('x', hitX.toFixed(2));+ hit.setAttribute('y', (centerY - 12).toFixed(2));+ hit.setAttribute('width', Math.max(24, hitRight - hitX).toFixed(2));+ hit.setAttribute('height', '24');+ hit.setAttribute('rx', '4');+ var badgeRect = badge.querySelector('rect');+ var badgeText = badge.querySelector('text');+ badgeRect.setAttribute('x', badgeX.toFixed(2));+ badgeRect.setAttribute('y', (centerY - 7).toFixed(2));+ badgeRect.setAttribute('width', badgeWidth.toFixed(2));+ badgeRect.setAttribute('height', '14');+ badgeRect.setAttribute('rx', '7');+ badgeText.setAttribute('x', (badgeX + badgeWidth / 2).toFixed(2));+ badgeText.setAttribute('y', (centerY + 2.5).toFixed(2));+ return true;+ }+ function layoutLegendBridge() {+ legendEntries.forEach(layoutLegendEntry);+ if (!legendBridge) return;+ Array.prototype.forEach.call(legendBridge.querySelectorAll('[data-legend-zero]'), layoutLegendEntry);+ }+ function decorateLegendBridge() {+ legendEntries = [];+ if (!legendBridge || html.getAttribute('data-embed') === 'true') return false;+ var facts = {};+ collectKinds().forEach(function (kind) { facts[kind.id] = kind; });+ Array.prototype.forEach.call(legendBridge.querySelectorAll('[data-legend-kind]'), function (entry) {+ var kind = entry.getAttribute('data-legend-kind');+ var fact = facts[kind];+ var count = fact ? fact.nodes.length : 0;+ entry.setAttribute('data-legend-count', String(count));+ var hit = document.createElementNS(namespace, 'rect');+ hit.setAttribute('data-legend-bridge-runtime', '');+ hit.setAttribute('data-legend-hit', '');+ hit.setAttribute('aria-hidden', 'true');+ entry.insertBefore(hit, entry.firstChild);+ var badge = document.createElementNS(namespace, 'g');+ badge.setAttribute('data-legend-bridge-runtime', '');+ badge.setAttribute('data-legend-count-badge', '');+ badge.setAttribute('aria-hidden', 'true');+ badge.appendChild(document.createElementNS(namespace, 'rect'));+ var countText = document.createElementNS(namespace, 'text');+ countText.textContent = String(count);+ badge.appendChild(countText);+ entry.appendChild(badge);+ if (!fact || !count) {+ entry.setAttribute('data-legend-zero', '');+ return;+ }+ entry.setAttribute('role', 'button');+ entry.setAttribute('tabindex', legendEntries.length ? '-1' : '0');+ var visibleLabel = entry.getAttribute('data-legend-label') || fact.label;+ entry.setAttribute('aria-label', viewerCount('viewer.lens.legend.inspect', count, { label: visibleLabel }));+ entry.setAttribute('aria-pressed', 'false');+ entry.setAttribute('aria-haspopup', 'dialog');+ entry.setAttribute('aria-controls', 'semantic-lens');+ entry.setAttribute('aria-expanded', 'false');+ legendEntries.push(entry);+ });+ if (!legendEntries.length) return false;+ legendBridge.setAttribute('role', legendEntries.length >= 3 ? 'toolbar' : 'group');+ legendBridge.setAttribute('aria-label', viewerText('viewer.lens.legend'));+ syncLegendBridge();+ layoutLegendBridge();+ try {+ if (document.fonts && document.fonts.ready) document.fonts.ready.then(layoutLegendBridge);+ } catch (_) {}+ return true;+ }+ function syncLegendBridge() {+ legendEntries.forEach(function (entry) {+ var selected = selectedKinds.indexOf(entry.getAttribute('data-legend-kind')) >= 0;+ entry.setAttribute('aria-pressed', selected ? 'true' : 'false');+ entry.setAttribute('aria-expanded', !panel.hidden && lensOpener === entry ? 'true' : 'false');+ if (selected) entry.setAttribute('data-legend-selected', '');+ else entry.removeAttribute('data-legend-selected');+ });+ }+ function clearLegendPreview() {+ activeLegendPreview = null;+ svg.removeAttribute('data-legend-preview-active');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (element) {+ element.removeAttribute('data-legend-preview-match');+ element.removeAttribute('data-legend-preview-selected');+ element.removeAttribute('data-legend-preview-peer');+ });+ }+ function strongerLegendOwnerActive() {+ return selectedKinds.length > 0 || !panel.hidden || html.getAttribute('data-present') === 'true' ||+ svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-intent-trace-active') ||+ svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active') ||+ svg.hasAttribute('data-story-active') || svg.hasAttribute('data-relationship-preview-active');+ }+ function previewLegendKind(entry) {+ clearLegendPreview();+ if (!entry || strongerLegendOwnerActive()) return false;+ var kind = entry.getAttribute('data-legend-kind');+ var byId = nodesById();+ var matches = Object.keys(byId).filter(function (id) {+ return (byId[id].getAttribute('data-node-kind') || 'neutral') === kind;+ });+ if (!matches.length) return false;+ var chosen = {};+ matches.forEach(function (id) {+ chosen[id] = true;+ byId[id].setAttribute('data-legend-preview-match', '');+ byId[id].setAttribute('data-legend-preview-selected', '');+ });+ edgeGroups().forEach(function (edge) {+ if (!chosen[edge.from] && !chosen[edge.to]) return;+ edge.members.forEach(function (member) { member.setAttribute('data-legend-preview-match', ''); });+ [edge.from, edge.to].forEach(function (id) {+ if (!byId[id] || chosen[id]) return;+ byId[id].setAttribute('data-legend-preview-match', '');+ byId[id].setAttribute('data-legend-preview-peer', '');+ });+ });+ svg.setAttribute('data-legend-preview-active', kind);+ activeLegendPreview = entry;+ return true;+ }+ function syncLegendPreview() {+ var next = focusedLegendEntry || hoveredLegendEntry;+ if (next === activeLegendPreview) return;+ clearLegendPreview();+ if (next) previewLegendKind(next);+ }+ function activateLegendEntry(entry) {+ if (!entry || entry.getAttribute('role') !== 'button') return false;+ clearLegendPreview();+ select(entry.getAttribute('data-legend-kind'));+ return open({ opener: entry });+ }+ function removeFlowOverlay() {+ Array.prototype.forEach.call(svg.querySelectorAll('[data-semantic-lens-overlay]'), function (element) {+ element.remove();+ });+ svg.removeAttribute('data-lens-flow-count');+ svg.removeAttribute('data-lens-flow-density');+ }+ function flowGeometry(shape, direction, step) {+ var clone = shape.cloneNode(false);+ clone.removeAttribute('id');+ clone.removeAttribute('class');+ clone.removeAttribute('style');+ clone.removeAttribute('marker-start');+ clone.removeAttribute('marker-mid');+ clone.removeAttribute('marker-end');+ clone.removeAttribute('role');+ clone.removeAttribute('aria-label');+ clone.removeAttribute('aria-hidden');+ clone.removeAttribute('data-animate');+ clone.removeAttribute('data-edge-from');+ clone.removeAttribute('data-edge-to');+ clone.removeAttribute('data-edge-key');+ clone.removeAttribute('data-edge-id');+ clone.removeAttribute('data-edge-label');+ clone.removeAttribute('data-lens-match');+ clone.setAttribute('class', 'semantic-lens-flow');+ clone.setAttribute('data-direction', direction);+ clone.setAttribute('pathLength', '1');+ clone.style.setProperty('--lens-flow-delay', (step * 0.08).toFixed(2) + 's');+ return clone;+ }+ function renderFlowOverlay(entries) {+ removeFlowOverlay();+ svg.setAttribute('data-lens-flow-count', String(entries.length));+ if (!entries.length || html.getAttribute('data-embed') === 'true') return false;+ if (entries.length > MAX_LENS_FLOW_EDGES) {+ svg.setAttribute('data-lens-flow-density', 'quiet');+ return false;+ }+ var overlay = document.createElementNS(namespace, 'g');+ overlay.setAttribute('class', 'semantic-lens-overlay');+ overlay.setAttribute('data-semantic-lens-overlay', '');+ overlay.setAttribute('aria-hidden', 'true');+ entries.forEach(function (entry, step) {+ var wrapper = document.createElementNS(namespace, 'g');+ if (entry.edge.members[0].hasAttribute('transform')) {+ wrapper.setAttribute('transform', entry.edge.members[0].getAttribute('transform'));+ }+ edgeShapes(entry.edge.members[0]).forEach(function (shape) {+ wrapper.appendChild(flowGeometry(shape, entry.direction, step));+ });+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);+ });+ if (!overlay.childNodes.length) return false;+ var firstNode = svg.querySelector('[data-node-id]');+ if (firstNode) svg.insertBefore(overlay, firstNode);+ else svg.appendChild(overlay);+ return true;+ }+ function cleanSvgState() {+ removeFlowOverlay();+ svg.removeAttribute('data-lens-active');+ Array.prototype.forEach.call(svg.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (element) {+ element.removeAttribute('data-lens-match');+ element.removeAttribute('data-lens-selected');+ element.removeAttribute('data-lens-peer');+ });+ }+ function renderKinds() {+ kindsRoot.textContent = '';+ collectKinds().forEach(function (kind) {+ var button = document.createElement('button');+ button.type = 'button';+ button.className = 'semantic-lens-kind';+ button.setAttribute('data-kind', kind.id);+ button.setAttribute('aria-pressed', selectedKinds.indexOf(kind.id) >= 0 ? 'true' : 'false');+ button.setAttribute('aria-label', viewerCount('viewer.lens.kind.count', kind.nodes.length, { label: kind.label }));+ button.disabled = selectedKinds.length >= 2 && selectedKinds.indexOf(kind.id) === -1;+ var swatch = document.createElement('span');+ swatch.className = 'semantic-lens-swatch';+ swatch.setAttribute('aria-hidden', 'true');+ var label = document.createElement('strong');+ label.textContent = kind.label;+ var count = document.createElement('em');+ count.textContent = String(kind.nodes.length);+ button.appendChild(swatch);+ button.appendChild(label);+ button.appendChild(count);+ kindsRoot.appendChild(button);+ });+ }+ function updateHash() {+ try {+ var hash = selectedKinds.length+ ? '#lens=' + selectedKinds.map(encodeURIComponent).join('~')+ : '';+ history.replaceState(null, '', location.pathname + location.search + hash);+ } catch (_) {}+ }+ function updateTrigger() {+ var active = selectedKinds.length > 0;+ trigger.setAttribute('aria-pressed', active ? 'true' : 'false');+ trigger.setAttribute('aria-label', viewerText(active ? 'viewer.lens.openActive' : 'viewer.lens.open'));+ copyBtn.hidden = !active;+ syncLegendBridge();+ }+ function overlapArea(a, b) {+ var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));+ var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));+ return width * height;+ }+ function dockPanel(byId) {+ panel.removeAttribute('data-dock-side');+ if (panel.hidden || window.innerWidth <= 720) return 'right';+ var panelRect = panel.getBoundingClientRect();+ var containerRect = container.getBoundingClientRect();+ if (!panelRect.width || !panelRect.height) return 'right';+ var selectedRects = Object.keys(byId).filter(function (id) {+ return selectedKinds.indexOf(byId[id].getAttribute('data-node-kind') || 'neutral') >= 0;+ }).map(function (id) { return byId[id].getBoundingClientRect(); });+ var top = panelRect.top;+ var width = panelRect.width;+ var leftCandidate = { left: containerRect.left + 16, right: containerRect.left + 16 + width, top: top, bottom: panelRect.bottom };+ var rightCandidate = { left: containerRect.right - 16 - width, right: containerRect.right - 16, top: top, bottom: panelRect.bottom };+ var leftScore = selectedRects.reduce(function (score, rect) { return score + overlapArea(leftCandidate, rect); }, 0);+ var rightScore = selectedRects.reduce(function (score, rect) { return score + overlapArea(rightCandidate, rect); }, 0);+ var legend = svg.querySelector('[data-legend]');+ var nav = container.querySelector('.diagram-nav');+ var protectedRects = [legend, nav].filter(function (element) {+ return element && !element.hidden && window.getComputedStyle(element).display !== 'none';+ }).map(function (element) { return element.getBoundingClientRect(); });+ leftScore += protectedRects.reduce(function (score, rect) {+ return score + overlapArea(leftCandidate, rect) * 1000;+ }, 0);+ rightScore += protectedRects.reduce(function (score, rect) {+ return score + overlapArea(rightCandidate, rect) * 1000;+ }, 0);+ var side = leftScore < rightScore ? 'left' : 'right';+ panel.setAttribute('data-dock-side', side);+ return side;+ }+ function applySelection(options) {+ options = options || {};+ cleanSvgState();+ var byId = nodesById();+ var nodeKind = {};+ Object.keys(byId).forEach(function (id) { nodeKind[id] = byId[id].getAttribute('data-node-kind') || 'neutral'; });+ if (!selectedKinds.length) {+ status.textContent = viewerText('viewer.lens.choose');+ updateTrigger();+ renderKinds();+ dockPanel(byId);+ if (options.updateUrl !== false) updateHash();+ return false;+ }++ var chosen = {};+ selectedKinds.forEach(function (kind) { chosen[kind] = true; });+ Object.keys(byId).forEach(function (id) {+ if (!chosen[nodeKind[id]]) return;+ byId[id].setAttribute('data-lens-match', '');+ byId[id].setAttribute('data-lens-selected', '');+ });++ var touching = 0;+ var forward = 0;+ var reverse = 0;+ var crossKind = selectedKinds.length === 2;+ var matchedFlow = [];+ edgeGroups().forEach(function (edge) {+ var fromKind = nodeKind[edge.from];+ var toKind = nodeKind[edge.to];+ var match = false;+ if (crossKind) {+ if (fromKind === selectedKinds[0] && toKind === selectedKinds[1]) { match = true; forward += 1; }+ if (fromKind === selectedKinds[1] && toKind === selectedKinds[0]) { match = true; reverse += 1; }+ } else if (fromKind === selectedKinds[0] || toKind === selectedKinds[0]) {+ match = true;+ touching += 1;+ }+ if (!match) return;+ var direction = 'within';+ if (crossKind) {+ direction = fromKind === selectedKinds[0] ? 'forward' : 'reverse';+ } else {+ direction = fromKind === selectedKinds[0] && toKind !== selectedKinds[0] ? 'out'+ : (toKind === selectedKinds[0] && fromKind !== selectedKinds[0] ? 'in' : 'within');+ }+ matchedFlow.push({ edge: edge, direction: direction });+ edge.members.forEach(function (member) { member.setAttribute('data-lens-match', ''); });+ if (!crossKind) {+ [edge.from, edge.to].forEach(function (id) {+ if (!byId[id]) return;+ byId[id].setAttribute('data-lens-match', '');+ if (!chosen[nodeKind[id]]) byId[id].setAttribute('data-lens-peer', '');+ });+ }+ });++ svg.setAttribute('data-lens-active', selectedKinds.join(' '));+ renderFlowOverlay(matchedFlow);+ if (crossKind) {+ var total = forward + reverse;+ status.textContent = viewerCount('viewer.lens.compare', total, {+ first: viewerKindLabel(selectedKinds[0]),+ second: viewerKindLabel(selectedKinds[1]),+ forward: forward,+ reverse: reverse+ });+ } else {+ var nodeCount = collectKinds().filter(function (kind) { return kind.id === selectedKinds[0]; })[0].nodes.length;+ status.textContent = viewerText('viewer.lens.single', {+ nodes: viewerCount('viewer.lens.node', nodeCount, { label: viewerKindLabel(selectedKinds[0]) }),+ relationships: viewerCount('viewer.lens.relationship', touching)+ });+ }+ updateTrigger();+ renderKinds();+ dockPanel(byId);+ if (options.updateUrl !== false) updateHash();+ return true;+ }+ function prepareForLens() {+ clearLegendPreview();+ if (Archify.focus && typeof Archify.focus.clear === 'function') {+ Archify.focus.clear({ updateUrl: false, preserveView: true });+ }+ if (Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {+ Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });+ }+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {+ Archify.intentTrace.clear({ announce: false });+ }+ }+ function select(kind, options) {+ options = options || {};+ clearLegendPreview();+ var exists = collectKinds().some(function (entry) { return entry.id === kind; });+ if (!exists) return false;+ var index = selectedKinds.indexOf(kind);+ if (index >= 0) selectedKinds.splice(index, 1);+ else {+ if (selectedKinds.length >= 2) return false;+ if (!selectedKinds.length) prepareForLens();+ selectedKinds.push(kind);+ }+ return applySelection(options);+ }+ function close(options) {+ options = options || {};+ panel.hidden = true;+ trigger.setAttribute('aria-expanded', 'false');+ updateTrigger();+ if (options.restoreFocus !== false && lensOpener && typeof lensOpener.focus === 'function') lensOpener.focus();+ return false;+ }+ function open(options) {+ options = options || {};+ if (html.getAttribute('data-embed') === 'true') return false;+ lensOpener = options.opener || trigger;+ if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);+ if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });+ if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });+ if (Archify.guide && Archify.guide.isOpen()) Archify.guide.close({ restoreFocus: false });+ renderKinds();+ panel.hidden = false;+ trigger.setAttribute('aria-expanded', 'true');+ updateTrigger();+ requestAnimationFrame(function () {+ dockPanel(nodesById());+ var activeButton = kindsRoot.querySelector('[aria-pressed="true"]');+ var firstButton = activeButton || kindsRoot.querySelector('button:not(:disabled)');+ if (firstButton) firstButton.focus();+ });+ return true;+ }+ function toggle() { return panel.hidden ? open({ opener: trigger }) : close(); }+ function clear(options) {+ options = options || {};+ selectedKinds = [];+ cleanSvgState();+ panel.removeAttribute('data-dock-side');+ updateTrigger();+ renderKinds();+ status.textContent = viewerText('viewer.lens.choose');+ if (options.updateUrl !== false) updateHash();+ if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {+ Archify.view.reset({ automatic: true });+ }+ if (options.closePanel === true) close({ restoreFocus: false });+ return false;+ }+ function fallbackCopy(value) {+ var field = document.createElement('textarea');+ field.value = value;+ field.setAttribute('readonly', '');+ field.style.position = 'fixed';+ field.style.opacity = '0';+ document.body.appendChild(field);+ field.select();+ var copied = false;+ try { copied = document.execCommand('copy'); } catch (_) {}+ field.remove();+ return copied;+ }+ function copyLink() {+ if (!selectedKinds.length) return Promise.resolve(false);+ var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');+ var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })+ : Promise.resolve(fallbackCopy(value));+ return copy.then(function (copied) {+ copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');+ window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);+ return copied;+ });+ }+ function syncFromHash() {+ try {+ var params = new URLSearchParams(location.hash.replace(/^#/, ''));+ var value = params.get('lens');+ if (!value) {+ if (selectedKinds.length) clear({ updateUrl: false, preserveView: true });+ return;+ }+ var available = collectKinds().map(function (kind) { return kind.id; });+ var requested = value.split('~').filter(function (kind, index, list) {+ return available.indexOf(kind) >= 0 && list.indexOf(kind) === index;+ }).slice(0, 2);+ if (!requested.length) return;+ prepareForLens();+ selectedKinds = requested;+ applySelection({ updateUrl: false });+ } catch (_) {}+ }++ trigger.addEventListener('click', toggle);+ if (decorateLegendBridge()) {+ legendBridge.addEventListener('click', function (event) {+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (entry) activateLegendEntry(entry);+ });+ legendBridge.addEventListener('pointerover', function (event) {+ if (event.pointerType === 'touch' || (finePointerQuery && !finePointerQuery.matches)) return;+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;+ hoveredLegendEntry = entry;+ syncLegendPreview();+ });+ legendBridge.addEventListener('pointerout', function (event) {+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;+ if (hoveredLegendEntry === entry) hoveredLegendEntry = null;+ syncLegendPreview();+ });+ legendBridge.addEventListener('focusin', function (event) {+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (!entry) return;+ focusedLegendEntry = entry;+ legendEntries.forEach(function (candidate) {+ candidate.setAttribute('tabindex', candidate === entry ? '0' : '-1');+ });+ syncLegendPreview();+ });+ legendBridge.addEventListener('focusout', function (event) {+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;+ if (focusedLegendEntry === entry) focusedLegendEntry = null;+ syncLegendPreview();+ });+ legendBridge.addEventListener('keydown', function (event) {+ var entry = event.target.closest('[data-legend-kind][role="button"]');+ if (!entry) return;+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ activateLegendEntry(entry);+ return;+ }+ var index = legendEntries.indexOf(entry);+ var next = null;+ if (event.key === 'ArrowRight') next = (index + 1) % legendEntries.length;+ else if (event.key === 'ArrowLeft') next = (index - 1 + legendEntries.length) % legendEntries.length;+ else if (event.key === 'Home') next = 0;+ else if (event.key === 'End') next = legendEntries.length - 1;+ if (next === null) return;+ event.preventDefault();+ legendEntries.forEach(function (candidate, candidateIndex) {+ candidate.setAttribute('tabindex', candidateIndex === next ? '0' : '-1');+ });+ legendEntries[next].focus();+ });+ }+ closeBtn.addEventListener('click', function () { close(); });+ clearBtn.addEventListener('click', function () { clear({ preserveView: true }); });+ copyBtn.addEventListener('click', copyLink);+ kindsRoot.addEventListener('click', function (event) {+ var button = event.target.closest('[data-kind]');+ if (!button || button.disabled) return;+ select(button.getAttribute('data-kind'));+ });+ kindsRoot.addEventListener('keydown', function (event) {+ var buttons = Array.prototype.slice.call(kindsRoot.querySelectorAll('button:not(:disabled)'));+ var index = buttons.indexOf(document.activeElement);+ var next = null;+ if (index >= 0 && (event.key === 'ArrowRight' || event.key === 'ArrowDown')) next = (index + 1) % buttons.length;+ else if (index >= 0 && (event.key === 'ArrowLeft' || event.key === 'ArrowUp')) next = (index - 1 + buttons.length) % buttons.length;+ else if (event.key === 'Home' && buttons.length) next = 0;+ else if (event.key === 'End' && buttons.length) next = buttons.length - 1;+ if (next !== null) { event.preventDefault(); buttons[next].focus(); }+ });+ panel.addEventListener('keydown', function (event) {+ if (event.key !== 'Escape') return;+ event.preventDefault();+ event.stopPropagation();+ close();+ });+ document.addEventListener('click', function (event) {+ var eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];+ var clickedInside = eventPath.indexOf(panel) >= 0 || panel.contains(event.target);+ var clickedLauncher = event.target === trigger || legendEntries.some(function (entry) {+ return event.target === entry || entry.contains(event.target);+ });+ if (!panel.hidden && !clickedInside && !clickedLauncher) close({ restoreFocus: false });+ });+ window.addEventListener('hashchange', syncFromHash);+ window.addEventListener('resize', function () {+ if (!panel.hidden && selectedKinds.length) dockPanel(nodesById());+ layoutLegendBridge();+ });+ renderKinds();+ syncFromHash();++ return {+ open: open,+ close: close,+ toggle: toggle,+ clear: clear,+ clearPreview: clearLegendPreview,+ select: select,+ copyLink: copyLink,+ isOpen: function () { return !panel.hidden; },+ active: function () { return selectedKinds.length ? selectedKinds.slice() : null; },+ kinds: function () { return collectKinds().map(function (kind) { return { id: kind.id, count: kind.nodes.length }; }); }+ };+ })();\ No newline at end of filediff --git a/viewer/semantic-radar.js b/viewer/semantic-radar.jsnew file mode 100644index 00000000..3c9f5a61--- /dev/null+++ b/viewer/semantic-radar.js@@ -0,0 +1,627 @@+ /* ============================================================+ Semantic Radar — simplified semantic bounds + live viewport.+ The radar is built at runtime so the checked artifact still contains+ one canonical SVG block, and export serialization remains untouched.+ ============================================================ */+ Archify.radar = (function () {+ var container = document.querySelector('.diagram-container');+ var diagram = container.querySelector(':scope > svg');+ var panel = document.getElementById('overview-map');+ var panelHead = panel.querySelector('.overview-map-head');+ var surface = document.getElementById('overview-map-surface');+ var status = document.getElementById('overview-map-status');+ var trigger = document.getElementById('btn-overview-map');+ var closeBtn = document.getElementById('overview-map-close');+ var expandBtn = document.getElementById('overview-map-expand');+ var feedback = document.getElementById('overview-map-feedback');+ var navigation = container.querySelector('.diagram-nav');+ var passport = document.getElementById('focus-chip');+ var namespace = 'http://www.w3.org/2000/svg';+ var viewBox = diagram.viewBox && diagram.viewBox.baseVal;+ var mapSvg = document.createElementNS(namespace, 'svg');+ var nodeLayer = document.createElementNS(namespace, 'g');+ var viewport = document.createElementNS(namespace, 'rect');+ var nodes = [];+ var viewportDrag = null;+ var panelDrag = null;+ var manualPosition = null;+ var lastPlacement = null;+ var requestedOpen = false;+ var passportYielded = false;+ var passportPreviousAriaHidden = null;+ var syncFrame = 0;+ var spaceRetryTimer = 0;+ var spaceRetryCount = 0;+ var placementGap = 16;++ mapSvg.setAttribute('role', 'group');+ mapSvg.setAttribute('aria-label', viewerText('viewer.radar.nodes'));+ mapSvg.setAttribute('preserveAspectRatio', 'xMidYMid meet');+ nodeLayer.setAttribute('class', 'overview-map-nodes');+ viewport.setAttribute('class', 'overview-map-viewport');+ viewport.setAttribute('rx', '3');+ viewport.setAttribute('ry', '3');+ mapSvg.appendChild(nodeLayer);+ mapSvg.appendChild(viewport);+ surface.appendChild(mapSvg);++ function nodeLabel(node, fallback) {+ return node.getAttribute('data-node-label') ||+ (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];+ }+ function build() {+ if (!viewBox || viewBox.width <= 0 || viewBox.height <= 0) return false;+ mapSvg.setAttribute('viewBox', [viewBox.x, viewBox.y, viewBox.width, viewBox.height].join(' '));+ nodeLayer.textContent = '';+ nodes = [];+ Array.prototype.forEach.call(diagram.querySelectorAll('[data-node-id]'), function (node) {+ var box;+ try { box = node.getBBox(); } catch (_) { box = null; }+ if (!box || box.width <= 0 || box.height <= 0) return;+ var id = node.getAttribute('data-node-id');+ var rect = document.createElementNS(namespace, 'rect');+ rect.setAttribute('class', 'overview-map-node');+ rect.setAttribute('x', String(box.x));+ rect.setAttribute('y', String(box.y));+ rect.setAttribute('width', String(Math.max(3, box.width)));+ rect.setAttribute('height', String(Math.max(3, box.height)));+ rect.setAttribute('rx', String(Math.max(2, Math.min(8, Math.min(box.width, box.height) * 0.1))));+ rect.setAttribute('data-radar-node-id', id);+ rect.setAttribute('data-kind', node.getAttribute('data-node-kind') || 'neutral');+ rect.setAttribute('tabindex', '0');+ rect.setAttribute('role', 'button');+ rect.setAttribute('aria-label', viewerText('viewer.radar.focus', { label: nodeLabel(node, id) }));+ nodeLayer.appendChild(rect);+ nodes.push({ id: id, node: node, rect: rect });+ });+ status.textContent = viewerText('viewer.radar.fullMap', { count: nodes.length });+ return true;+ }+ function visibleRect(element) {+ if (!element || element.hidden) return null;+ var rect = element.getBoundingClientRect();+ if (rect.width <= 0 || rect.height <= 0 || rect.right <= 0 || rect.bottom <= 0 || rect.left >= window.innerWidth || rect.top >= window.innerHeight) return null;+ return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height };+ }+ function panelRectAt(position) {+ return {+ left: position.left,+ top: position.top,+ right: position.left + panel.offsetWidth,+ bottom: position.top + panel.offsetHeight,+ width: panel.offsetWidth,+ height: panel.offsetHeight+ };+ }+ function rectsIntersect(first, second, gap) {+ gap = Number(gap) || 0;+ return first.left < second.right + gap &&+ first.right > second.left - gap &&+ first.top < second.bottom + gap &&+ first.bottom > second.top - gap;+ }+ function intersectionArea(first, second) {+ var width = Math.max(0, Math.min(first.right, second.right) - Math.max(first.left, second.left));+ var height = Math.max(0, Math.min(first.bottom, second.bottom) - Math.max(first.top, second.top));+ return width * height;+ }+ function clamp(value, minimum, maximum) {+ if (maximum < minimum) return minimum;+ return Math.max(minimum, Math.min(maximum, value));+ }+ function placementContext() {+ var containerRect = visibleRect(container);+ if (!containerRect) return null;+ var controlRect = visibleRect(navigation);+ var left = Math.max(placementGap, containerRect.left + placementGap);+ var top = Math.max(placementGap, containerRect.top + placementGap);+ var right = Math.min(window.innerWidth - placementGap, containerRect.right - placementGap);+ var bottom = Math.min(window.innerHeight - placementGap, containerRect.bottom - placementGap);+ if (controlRect) bottom = Math.min(bottom, controlRect.top - placementGap);+ var lens = document.getElementById('focus-chip');+ var lensRect = visibleRect(lens);+ var legendRect = visibleRect(diagram.querySelector('[data-legend]'));+ var active = diagram.querySelector('[data-focus-selected]');+ var activeRect = visibleRect(active);+ return {+ bounds: { left: left, top: top, right: right, bottom: bottom },+ hardBlockers: [lensRect, controlRect, legendRect].filter(Boolean),+ softBlockers: [activeRect].filter(Boolean),+ preferredSide: !activeRect || activeRect.left + activeRect.width / 2 > window.innerWidth / 2 ? 'left' : 'right'+ };+ }+ function positionIsValid(position, context) {+ if (!position || !context) return false;+ var rect = panelRectAt(position);+ var bounds = context.bounds;+ if (rect.left < bounds.left || rect.top < bounds.top || rect.right > bounds.right || rect.bottom > bounds.bottom) return false;+ return context.hardBlockers.every(function (blocker) { return !rectsIntersect(rect, blocker, placementGap); });+ }+ function cornerCandidates(context) {+ var bounds = context.bounds;+ var left = bounds.left;+ var right = Math.max(left, bounds.right - panel.offsetWidth);+ var top = bounds.top;+ var bottom = Math.max(top, bounds.bottom - panel.offsetHeight);+ var preferredLeft = context.preferredSide === 'left' ? left : right;+ var alternateLeft = context.preferredSide === 'left' ? right : left;+ return [+ { left: preferredLeft, top: bottom },+ { left: alternateLeft, top: bottom },+ { left: preferredLeft, top: top },+ { left: alternateLeft, top: top }+ ].filter(function (candidate, index, all) {+ return all.findIndex(function (other) { return other.left === candidate.left && other.top === candidate.top; }) === index;+ });+ }+ function nearbyCandidates(context, reference) {+ var bounds = context.bounds;+ var maximumLeft = bounds.right - panel.offsetWidth;+ var maximumTop = bounds.bottom - panel.offsetHeight;+ var requested = reference ? {+ left: clamp(reference.left, bounds.left, maximumLeft),+ top: clamp(reference.top, bounds.top, maximumTop)+ } : null;+ var horizontal = [bounds.left, maximumLeft];+ var vertical = [bounds.top, maximumTop];+ if (requested) {+ horizontal.push(requested.left);+ vertical.push(requested.top);+ }+ context.hardBlockers.forEach(function (blocker) {+ horizontal.push(+ blocker.left - placementGap - panel.offsetWidth,+ blocker.right + placementGap+ );+ vertical.push(+ blocker.top - placementGap - panel.offsetHeight,+ blocker.bottom + placementGap+ );+ });+ horizontal = horizontal.map(function (left) { return clamp(left, bounds.left, maximumLeft); });+ vertical = vertical.map(function (top) { return clamp(top, bounds.top, maximumTop); });+ var candidates = [];+ horizontal.forEach(function (left) {+ vertical.forEach(function (top) { candidates.push({ left: left, top: top }); });+ });+ return candidates.filter(function (candidate, index, all) {+ return all.findIndex(function (other) { return other.left === candidate.left && other.top === candidate.top; }) === index;+ });+ }+ function placementScore(position, context, reference, softWeight) {+ var rect = panelRectAt(position);+ var referenceLeft = reference ? reference.left : (context.preferredSide === 'left' ? context.bounds.left : context.bounds.right - panel.offsetWidth);+ var referenceTop = reference ? reference.top : context.bounds.bottom - panel.offsetHeight;+ var distance = Math.pow(position.left - referenceLeft, 2) + Math.pow(position.top - referenceTop, 2);+ var softOverlap = context.softBlockers.reduce(function (total, blocker) { return total + intersectionArea(rect, blocker); }, 0);+ return distance + softOverlap * softWeight;+ }+ function chooseRadarPlacement(context, reference, options) {+ options = options || {};+ var softWeight = Number.isFinite(options.softWeight) ? options.softWeight : 100;+ var candidates = nearbyCandidates(context, reference).concat(cornerCandidates(context));+ var valid = candidates.filter(function (candidate) { return positionIsValid(candidate, context); });+ valid.sort(function (first, second) {+ return placementScore(first, context, reference, softWeight) - placementScore(second, context, reference, softWeight);+ });+ return valid.length ? valid[0] : null;+ }+ function applyPlacement(position, remember) {+ var useLeft = position.left + panel.offsetWidth / 2 <= window.innerWidth / 2;+ panel.setAttribute('data-docked', 'true');+ panel.setAttribute('data-dock-side', useLeft ? 'left' : 'right');+ if (useLeft) {+ panel.style.setProperty('--archify-radar-left', Math.round(position.left) + 'px');+ panel.style.removeProperty('--archify-radar-right');+ } else {+ panel.style.setProperty('--archify-radar-right', Math.round(window.innerWidth - position.left - panel.offsetWidth) + 'px');+ panel.style.removeProperty('--archify-radar-left');+ }+ panel.style.setProperty('--archify-radar-top', Math.round(position.top) + 'px');+ if (remember !== false) lastPlacement = { left: position.left, top: position.top };+ }+ function resetDockingStyles() {+ panel.removeAttribute('data-docked');+ panel.removeAttribute('data-dock-side');+ panel.removeAttribute('data-panel-dragging');+ panel.removeAttribute('data-placement-invalid');+ panel.removeAttribute('data-placement-degraded');+ panel.removeAttribute('data-placement-unavailable');+ panel.removeAttribute('data-compact');+ panel.removeAttribute('title');+ panel.style.removeProperty('visibility');+ panel.style.removeProperty('--archify-radar-right');+ panel.style.removeProperty('--archify-radar-left');+ panel.style.removeProperty('--archify-radar-top');+ }+ function updateDocking() {+ var options = arguments[0] || {};+ if (panel.hidden) return false;+ if (panelDrag) return true;+ panel.removeAttribute('data-compact');+ panel.removeAttribute('data-placement-degraded');+ panel.removeAttribute('data-placement-invalid');+ panel.removeAttribute('data-placement-unavailable');+ panel.removeAttribute('title');+ panel.style.removeProperty('visibility');+ var context = placementContext();+ if (!context) {+ resetDockingStyles();+ return false;+ }+ var reference = manualPosition || lastPlacement;+ var placementOptions = { softWeight: manualPosition ? 0 : 100 };+ var placement = manualPosition && positionIsValid(manualPosition, context)+ ? manualPosition+ : chooseRadarPlacement(context, reference, placementOptions);+ var compact = false;+ if (!placement && options.allowCompact !== false) {+ compact = true;+ panel.setAttribute('data-compact', 'true');+ panel.setAttribute('data-placement-degraded', 'true');+ panel.setAttribute('title', viewerText('viewer.radar.compacted'));+ context = placementContext();+ placement = chooseRadarPlacement(context, reference, placementOptions);+ }+ if (!placement) {+ resetDockingStyles();+ panel.setAttribute('data-placement-unavailable', 'true');+ return false;+ }+ if (manualPosition && !compact) manualPosition = { left: placement.left, top: placement.top };+ applyPlacement(placement, true);+ return true;+ }+ function clearSpaceRetry() {+ if (spaceRetryTimer) window.clearTimeout(spaceRetryTimer);+ spaceRetryTimer = 0;+ }+ function yieldPassport() {+ if (!passport || passport.hidden || passportYielded) return passportYielded;+ passportPreviousAriaHidden = passport.getAttribute('aria-hidden');+ passportYielded = true;+ passport.setAttribute('data-radar-yielded', 'true');+ passport.setAttribute('aria-hidden', 'true');+ return true;+ }+ function restorePassport() {+ if (!passport || !passportYielded) return;+ passportYielded = false;+ passport.removeAttribute('data-radar-yielded');+ if (passportPreviousAriaHidden === null) passport.removeAttribute('aria-hidden');+ else passport.setAttribute('aria-hidden', passportPreviousAriaHidden);+ passportPreviousAriaHidden = null;+ }+ function reflectVisible() {+ panel.hidden = false;+ panel.removeAttribute('data-placement-unavailable');+ trigger.setAttribute('aria-expanded', 'true');+ trigger.removeAttribute('data-radar-space-limited');+ trigger.setAttribute('aria-label', viewerText('viewer.radar.close'));+ trigger.title = viewerText('viewer.nav.radar.title');+ feedback.hidden = true;+ }+ function scheduleSpaceRetry() {+ if (!requestedOpen || spaceRetryTimer || spaceRetryCount >= 4) return;+ spaceRetryCount += 1;+ spaceRetryTimer = window.setTimeout(function () {+ spaceRetryTimer = 0;+ attemptRequestedOpen();+ }, 60);+ }+ function reflectUnavailable() {+ restorePassport();+ panel.hidden = true;+ panel.setAttribute('data-placement-unavailable', 'true');+ trigger.setAttribute('aria-expanded', 'false');+ trigger.setAttribute('aria-label', viewerText('viewer.radar.cancelWaiting'));+ trigger.setAttribute('data-radar-space-limited', 'true');+ trigger.title = viewerText('viewer.radar.needsSpace');+ feedback.hidden = false;+ scheduleSpaceRetry();+ }+ function attemptRequestedOpen(options) {+ options = options || {};+ if (!requestedOpen) return false;+ panel.hidden = false;+ if (!updateDocking(options)) {+ reflectUnavailable();+ return false;+ }+ clearSpaceRetry();+ spaceRetryCount = 0;+ reflectVisible();+ sync();+ if (options.focus === true && !panel.hasAttribute('data-compact')) surface.focus();+ return true;+ }+ function expandCompactRadar() {+ if (!requestedOpen || panel.hidden || !panel.hasAttribute('data-compact')) return false;+ yieldPassport();+ if (!updateDocking({ allowCompact: false })) {+ restorePassport();+ if (!updateDocking()) {+ reflectUnavailable();+ return false;+ }+ }+ reflectVisible();+ sync();+ if (!panel.hasAttribute('data-compact')) surface.focus();+ return !panel.hasAttribute('data-compact');+ }+ function syncNow() {+ syncFrame = 0;+ if (panel.hidden || !Archify.view || typeof Archify.view.logicalViewport !== 'function') return;+ if (!updateDocking()) {+ reflectUnavailable();+ return;+ }+ if (passportYielded && panel.hasAttribute('data-compact')) {+ restorePassport();+ if (!updateDocking()) {+ reflectUnavailable();+ return;+ }+ }+ reflectVisible();+ var visible = Archify.view.logicalViewport();+ if (!visible) return;+ viewport.setAttribute('x', String(visible.x));+ viewport.setAttribute('y', String(visible.y));+ viewport.setAttribute('width', String(visible.width));+ viewport.setAttribute('height', String(visible.height));+ var full = visible.width >= viewBox.width * 0.98 && visible.height >= viewBox.height * 0.98;+ var mobileWide = window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram');+ var viewportCopy = full+ ? viewerText('viewer.radar.viewport.full')+ : (mobileWide+ ? viewerText('viewer.radar.viewport.width', { percent: Math.round(visible.width / viewBox.width * 100) })+ : viewerText('viewer.radar.viewport.scale', { percent: Math.round(visible.scale * 100) }));+ status.textContent = viewerText('viewer.radar.status', { count: nodes.length, viewport: viewportCopy });+ nodes.forEach(function (item) {+ var active = item.node.hasAttribute('data-focus-selected') ||+ item.node.getAttribute('data-story-beat-state') === 'active';+ if (active) item.rect.setAttribute('data-radar-active', 'true');+ else item.rect.removeAttribute('data-radar-active');+ });+ }+ function sync() {+ if (requestedOpen && panel.hidden) {+ attemptRequestedOpen();+ return;+ }+ if (syncFrame) return;+ syncFrame = requestAnimationFrame(syncNow);+ }+ function setOpen(next, options) {+ options = options || {};+ next = Boolean(next);+ if (next && Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (next && Archify.semanticLens && Archify.semanticLens.isOpen()) {+ Archify.semanticLens.close({ restoreFocus: false });+ }+ requestedOpen = next;+ if (next) {+ clearSpaceRetry();+ spaceRetryCount = 0;+ build();+ attemptRequestedOpen(options);+ } else {+ clearSpaceRetry();+ spaceRetryCount = 0;+ viewportDrag = null;+ panelDrag = null;+ container.classList.remove('is-panning');+ panel.hidden = true;+ resetDockingStyles();+ restorePassport();+ feedback.hidden = true;+ trigger.setAttribute('aria-expanded', 'false');+ trigger.removeAttribute('data-radar-space-limited');+ trigger.setAttribute('aria-label', viewerText('viewer.nav.radar'));+ trigger.title = viewerText('viewer.nav.radar.title');+ if (options.restoreFocus === true) trigger.focus();+ }+ return next;+ }+ function toggle() { return setOpen(!requestedOpen, { focus: false }); }+ function close(options) { return setOpen(false, options); }+ function bringNodeIntoWindow(node) {+ var delay = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 540;+ window.setTimeout(function () {+ var rect = node.getBoundingClientRect();+ var safeTop = 64;+ var safeBottom = window.innerHeight - 64;+ if (rect.top >= safeTop && rect.bottom <= safeBottom) return;+ var top = Math.max(0, window.scrollY + rect.top + rect.height / 2 - window.innerHeight / 2);+ try { window.scrollTo({ top: top, behavior: delay ? 'smooth' : 'auto' }); }+ catch (_) { window.scrollTo(0, top); }+ }, delay);+ }+ function focusNode(id) {+ var main = diagram.querySelector('[data-node-id="' + id + '"]');+ if (!main) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });+ }+ if (Archify.focus && typeof Archify.focus.set === 'function') {+ Archify.focus.set(id, { toggle: false });+ }+ if (Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal([id], { includeNeighbors: true, reason: 'radar' });+ }+ bringNodeIntoWindow(main);+ try { main.focus({ preventScroll: true }); } catch (_) { try { main.focus(); } catch (_) {} }+ sync();+ return true;+ }+ function diagramPoint(event) {+ var matrix = mapSvg.getScreenCTM();+ if (!matrix) return null;+ var point = mapSvg.createSVGPoint();+ point.x = event.clientX;+ point.y = event.clientY;+ return point.matrixTransform(matrix.inverse());+ }+ function navigate(event) {+ var point = diagramPoint(event);+ if (!point || !Archify.view || typeof Archify.view.centerAt !== 'function') return;+ Archify.view.centerAt(point.x, point.y, { minimumScale: 1.5, instant: true });+ sync();+ }+ function endViewportDrag(event) {+ if (!viewportDrag) return;+ viewportDrag = null;+ panel.removeAttribute('data-dragging');+ container.classList.remove('is-panning');+ try { surface.releasePointerCapture(event.pointerId); } catch (_) {}+ }+ function beginPanelDrag(event) {+ if (event.button !== 0 || event.target.closest('button, a, input, [role="button"]')) return;+ var context = placementContext();+ if (!context) return;+ var rect = panel.getBoundingClientRect();+ event.preventDefault();+ event.stopPropagation();+ panelDrag = {+ pointerId: event.pointerId,+ originX: event.clientX,+ originY: event.clientY,+ start: { left: rect.left, top: rect.top },+ current: { left: rect.left, top: rect.top },+ previousManual: manualPosition ? { left: manualPosition.left, top: manualPosition.top } : null+ };+ panel.setAttribute('data-panel-dragging', 'true');+ try { panelHead.setPointerCapture(event.pointerId); } catch (_) {}+ }+ function movePanelDrag(event) {+ if (!panelDrag || panelDrag.pointerId !== event.pointerId) return;+ var context = placementContext();+ if (!context) return;+ event.preventDefault();+ event.stopPropagation();+ var bounds = context.bounds;+ var position = {+ left: clamp(panelDrag.start.left + event.clientX - panelDrag.originX, bounds.left, bounds.right - panel.offsetWidth),+ top: clamp(panelDrag.start.top + event.clientY - panelDrag.originY, bounds.top, bounds.bottom - panel.offsetHeight)+ };+ panelDrag.current = position;+ if (positionIsValid(position, context)) panel.removeAttribute('data-placement-invalid');+ else panel.setAttribute('data-placement-invalid', 'true');+ applyPlacement(position, false);+ }+ function finishPanelDrag(event, cancel) {+ if (!panelDrag || panelDrag.pointerId !== event.pointerId) return;+ event.preventDefault();+ event.stopPropagation();+ var activeDrag = panelDrag;+ panelDrag = null;+ panel.removeAttribute('data-panel-dragging');+ panel.removeAttribute('data-placement-invalid');+ try { panelHead.releasePointerCapture(event.pointerId); } catch (_) {}+ var context = placementContext();+ if (!context) return;+ if (cancel) {+ manualPosition = activeDrag.previousManual;+ lastPlacement = { left: activeDrag.start.left, top: activeDrag.start.top };+ updateDocking();+ return;+ }+ var requested = activeDrag.current;+ manualPosition = { left: requested.left, top: requested.top };+ updateDocking();+ }++ trigger.addEventListener('click', toggle);+ closeBtn.addEventListener('click', function () { close({ restoreFocus: true }); });+ expandBtn.addEventListener('click', expandCompactRadar);+ panelHead.addEventListener('pointerdown', beginPanelDrag);+ panelHead.addEventListener('pointermove', movePanelDrag);+ panelHead.addEventListener('pointerup', function (event) { finishPanelDrag(event, false); });+ panelHead.addEventListener('pointercancel', function (event) { finishPanelDrag(event, true); });+ surface.addEventListener('pointerdown', function (event) {+ if (event.button !== 0 || event.target.closest('[data-radar-node-id]')) return;+ event.preventDefault();+ viewportDrag = { pointerId: event.pointerId };+ panel.setAttribute('data-dragging', 'true');+ container.classList.add('is-panning');+ try { surface.setPointerCapture(event.pointerId); } catch (_) {}+ navigate(event);+ });+ surface.addEventListener('pointermove', function (event) {+ if (!viewportDrag || viewportDrag.pointerId !== event.pointerId) return;+ navigate(event);+ });+ surface.addEventListener('pointerup', endViewportDrag);+ surface.addEventListener('pointercancel', endViewportDrag);+ surface.addEventListener('click', function (event) {+ var node = event.target.closest('[data-radar-node-id]');+ if (node) focusNode(node.getAttribute('data-radar-node-id'));+ });+ surface.addEventListener('keydown', function (event) {+ if (event.key === 'Escape') {+ event.preventDefault();+ event.stopPropagation();+ close({ restoreFocus: true });+ return;+ }+ var node = event.target.closest('[data-radar-node-id]');+ if (node && (event.key === 'Enter' || event.key === ' ')) {+ event.preventDefault();+ focusNode(node.getAttribute('data-radar-node-id'));+ return;+ }+ if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight' && event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return;+ var visible = Archify.view && Archify.view.logicalViewport ? Archify.view.logicalViewport() : null;+ if (!visible) return;+ event.preventDefault();+ var x = visible.x + visible.width / 2;+ var y = visible.y + visible.height / 2;+ var stepX = Math.max(12, visible.width * 0.24);+ var stepY = Math.max(12, visible.height * 0.24);+ if (event.key === 'ArrowLeft') x -= stepX;+ else if (event.key === 'ArrowRight') x += stepX;+ else if (event.key === 'ArrowUp') y -= stepY;+ else y += stepY;+ Archify.view.centerAt(x, y, { minimumScale: 1.5, instant: true });+ sync();+ });+ document.addEventListener('keydown', function (event) {+ if (!panelDrag || event.key !== 'Escape') return;+ finishPanelDrag({+ pointerId: panelDrag.pointerId,+ preventDefault: function () { event.preventDefault(); },+ stopPropagation: function () { event.stopPropagation(); }+ }, true);+ }, true);+ function reflow() {+ if (!requestedOpen) return;+ clearSpaceRetry();+ spaceRetryCount = 0;+ sync();+ }+ window.addEventListener('resize', reflow);+ window.addEventListener('scroll', reflow, { passive: true });+ if (typeof ResizeObserver === 'function') {+ var radarResizeObserver = new ResizeObserver(function (entries) {+ if (!requestedOpen) return;+ if (panel.hidden && entries.every(function (entry) { return entry.target === panel; })) return;+ reflow();+ });+ [container, navigation, document.getElementById('focus-chip'), panel].filter(Boolean).forEach(function (element) {+ radarResizeObserver.observe(element);+ });+ }+ requestAnimationFrame(build);++ return {+ open: function () { return setOpen(true); },+ close: close,+ toggle: toggle,+ sync: sync,+ focus: focusNode,+ isOpen: function () { return requestedOpen; },+ count: function () { return nodes.length; }+ };+ })();\ No newline at end of filediff --git a/viewer/template.source.html b/viewer/template.source.htmlnew file mode 100644index 00000000..fbd46652--- /dev/null+++ b/viewer/template.source.html@@ -0,0 +1,6237 @@+<!DOCTYPE html>+<html lang="en" data-theme="dark" data-preset="[VISUAL PRESET]">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <meta name="generator" content="archify 2.17.0-dev.1">+ <title>[PROJECT NAME] Architecture Diagram</title>+ <script>+ // Resolve the theme before first paint so light-preference users don't+ // see a dark flash. The toolbar script below re-applies with UI state.+ (function () {+ try {+ var theme = null;+ try {+ var param = new URLSearchParams(window.location.search).get('theme');+ if (param === 'light' || param === 'dark') theme = param;+ if (new URLSearchParams(window.location.search).get('embed') === '1') {+ document.documentElement.setAttribute('data-embed', 'true');+ }+ if (new URLSearchParams(window.location.search).get('present') === '1') {+ document.documentElement.setAttribute('data-present', 'true');+ }+ } catch (_) {}+ if (!theme) {+ try { theme = localStorage.getItem('archify-theme'); } catch (_) {}+ }+ if (theme !== 'light' && theme !== 'dark') {+ theme = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';+ }+ document.documentElement.setAttribute('data-theme', theme);+ } catch (_) {}+ })();+ </script>+ <style id="archify-fonts">+/*+JetBrains Mono variable WOFF2 subsets from Google Fonts service revision v24.+These fixed bytes are shared by the viewer and its SVG/raster exports.+No local() source: an installed copy must not override the bundled font.+Uncovered characters (including CJK) still use the system fallback stack.+Upstream: https://github.com/JetBrains/JetBrainsMono++cyrillic-ext 1664 bytes sha256 9343de2ca5d9549f792e7962375af8efb0f320c7643bfd36c884b5a30e5c396f+cyrillic 8892 bytes sha256 4995a9a43ac659ec32fcd8b463755cd6a07b31a6e6b3894a6a153b661cf490e2+greek 6800 bytes sha256 49c3da6c9a2b279b0f1f860f5cfb1f5dc38d88a5c7be9c9b1837bbc4e3db6111+vietnamese 5872 bytes sha256 d44eb1936043a56038eb02dd70b243f379bef65783f94ec12f277550720411f1+latin-ext 11596 bytes sha256 9c38cb2d0d2d93c1ee6e21fa78db76f13ea7e15e15cc64214c7ca89b6aaa35c4+latin 31340 bytes sha256 2c32b9b3ee358c119e210f6f5195f9bd34894d78a785ff2e95d60e718e400af4++Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+https://openfontlicense.org+++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION & CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.+*/+ /* cyrillic-ext */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,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) format('woff2');+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }+ /* cyrillic */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,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) format('woff2');+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }+ /* greek */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,d09GMgABAAAAABqQABIAAAAANggAABopAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGnwbHhyBWgZgP1NUQVSBICceAIFiL0wRCAqrfKMTC4FmADCgXAE2AiQDg0QEIAWHRgeHQRt7L1UHctg4AONHDw/J/98StCEx8OvQuaoS6nSKOb1TAFiw0Fg4OrHmUFx9lE0RHuCAwNZTYLzu0qIYrA2BIRRRhOaLtZ08a/sp9zYCdQA8KAuMM8JgShJLBIph0a9CVKNU5Kz3C6kz9f9u+04Z3maEJLM+PW3a+3+XBRaLKxEnQkSEEoEu1rSppBKruKauuYp7ciJWOcmUo7nhJS8iHiFtjmq7+WH3ih3OVZkJbJviPSALIQK9R2ufHSCVMDwf3t6dTUbxJMCBZZzEHGDq/dW5+BuhCCwAyNGp7Qbfqz4neKAyTZqkGLqcOXD2yAf6S9CXBKjiYHe7/6RBBJEETaIBSYQfAEpOU/IgUnwldDH6e5eQmMaEF7GNOjhvxlN4rPb8O1d9ZTAkFFEhK06K6oYYy9vXX9FcKceGqruiyWE2JCclRgHFyIg66EQRUWcsdUzg/vg/XWk7f2d14NAqqA3ePkfv6RIuurMrd3UqjTRrwUg5rbL7vDodg9Y+ExzrQgidzOugHCAuSqIOqEyXok1RVKmsstSQWe1WWYkPCB2v22Tun9a18LCMh7GGEmM6XPw5a4EAkANqUzghYDwPnpH3EcgHC+HV1Hy4cD5SFB8jho+XzGulG7k3nqCAJyjlCap5At3xCRr0RWDiCSxAMgAPn2dCCl+VdZCABQC7HQBgbrxidHmvu3FUC5SwCxOQ6poAHfAe0QaloTJaGWDAQSf/xZSacW2eDz4yws0e48wXgakYTRmcfIB1YrQBABIopChcNDhxSYyuFQkBLWkYEOfEiH46rVhq7LKIALoAY4AKU0Ks0VTuMAWkyBeci7es/AJwGQrmlb3Lc4DphegAkC3/VwBV054AAUQglOdSAC6bC0HHfoaMIgB+IKiaqDY3RJ1c0XzIqYqUOACyBkixZFk1PQ80AyJmAtBvcq01mxzEpcY2TadE5E01uYqNGl6eWHUBxFlRdDkvwCoOnHc8Qp8o0oKnMPAZENNn8ZCLEXD3WCjk78+zFVcIZUY7xQUucpnb3GeXd3zkq7MDCKNg1uaWuNwd7vcj72Y7IyjK5bt5eUemqvc7oHdv9ub2zrGJ+RcLgrzKRZMfGCxcf1St2sUbIIFGomQp6mmlMjGzqGVUx6CvBoI0BIADCsKO8eFBy0im8g6CgLBNApERkSpqo5xwIekkCiIGu0Q56bBHNWIdBnyzeRuIlgVic0C60JQ8zYDaSR0me6BaVZsihtnzAjUTzCIy0mZ0ndVjc+2+CFPkLJwWCwGKnhBJc01RbKponrUcQ3xFlmEkUmepVC5RCl8nJ6VCKvFQ8XXRScE1AZ5XKFh2x1GxLKp8Iqci3JRuLs5eDvEBbkZWBaVXjMtxAz2UKlepR6xbn9xJzrIlIYHBxrcMDc4lHRT5NKzzVrbmJ/zI5Ml2clsFATKRG6KH58X8xmxb/ETWNKnEi1mJc0GHjAI59LSCo5OiguksFii5rWQpm/XVwm8ie9xZem6I/Q1gp2pK/I1abEITR5Ss19NLEoO76Wx09wvmZNKVNVXSw/OGpmMb8QOAYU9pD5sV4kxzv6ml4HFn6ro29zZQiJisz9xWJR51jr3UvNNN+d6mPmq+y1f8W0GXFeSQJAKZ8Uj0r8nP1NIjgGwjm28qPTfU/iavBDGTrMspK+0JYjONRSmPSRxEF0rKO7LGjw2tUT3knQ3TlKH6Y5XFdvJaBwFGNrdlSWMmBj1xE5tpM6nOcx/j9qJIhkuDeV1spps0ot+0oPB8rgMJIsqOQKV3N0zzQ3V2d+6HwBAdFrHnTO9PaPgz84cgK35rIKzTrwqvJk6i3nopC/XZBflAofAzhJVgLJnfCQ1jbvzldHZqrr3BZ/4KBvv21tV9cmGF8b4UIGg19Piga95n0h9qnnje+IdOFjoM/Pp8IfclGMivV/xKw0GoVWZMeujlo497y7bCxwlNQ0SsMvqH511Qr11f3UjTLZ5RoKxnfn5SvqQppumAUNAVWIdYQtc/2tsG3/nF5shtVeBjHOe4ejr8wC668QvNTa7106oNf0Tq+S2dl4wXjNIYguaICF1TQVF8gjrTrrYNme6SvKgeBo/sbqDWybhnp0d9QUN4beOFQ7jmIRlavgwsle5NI0W0+0WPUaWQ55EIF914AeoD+zzGEdRfgp0FgjTcdkKXBuulJjfQyKjucsrxdrXWqUfpOtAHWz1Mj6CIeIe3cT9spO5Tq6xQS73Js8KyNdNJjl/68DBgmK+eqolt7QYb+rqJfVUuwHxE2LCpSgETT029ZWyhZ+dbloQAVP+PSg8AzYXu8ee7TXGPfXqJyFOc1n5hj/UzZ8oH/h/WPY9Wt61qx5alc0tKY5bVxYTqEMdtP6Idr5ukppispDLqwcJumSGOo0jeA5p6dlYqPgrvs3RAhf4dvULqV6nCfXO6r3Ro1p+fslo/J3Ng1j8Xab2rU/vfab04YfB1fZoroLJnTMXXR2bHk/+Wlfw0pscojR7UKh3FD9Xu6vm7e+awQeIOUXvCMAg94z5r8xhYSnUhlxi26U/b3AeUC70EK6T51mjMoxkWcxuT1UhcmqUxbwVagpjhDC4aoKxqGdHA3POzPiDB+4zynfp118+Onnx2RnEKYTMJz8b/83/0P+lvzwdLn7TfHDxk6+vTFguZxUd1vBpws/HJ2MEHP9fiVmQXHTX5B9gdP77tLos6/dTd/aPTp0dZwsrjUC+kgnrlyqpctQKixPm2aMKj5+QnuWeT1Uhcem5ekrcCLUJKyTm5RQOUmZaxEyBSamvf2vUsD6u6IBId3+N0d2wFv59aZN637SqfeDLzrDHt9rkcWnr2VWpOgtez8S1h3g82Vj8PE9nxmKN+lZfg2Qls1kwcZBukX+VoHCuuvVvVs9+Hll6M+inirm384uLzET9F3c9Vg0a19bF1y1eDT4vO+Tdf+cZWx8QfvgnfXRsnGNz49hPjfw/UnaDD/Rr9w3prW2gNL+LI2LL9ABNUZRfj4qiZqz+tP3UQt7NUf7ACtHo0A02rfKqLS/Z3/N7k8UscTCkBup/TJjq1zrLnbaGf1H1DnChUx7seMd3Zog79Qp2byjh/ZULTu4k6JpvKLdTYMdwK3bOW8GhKmoXNFIS5iGdJ9pe8dDMYdqzGN7g7lGwkW57tBO6IxtdDJq219vlX22y9il5MqRPHb7AWWxvGT8TF9KK8iAx8QXYhFSVFIxfkfs6A6djd7ETHixHiL09UFITqW14psqYQ5/oJevxxbmKmYcqyTlGgsFzEBif/r9VSKoMP9fGroeY9vT3XTgkESGi5d/Conq3+3x+H8TpH020J0tRTxmm+/qoxKjv9gxfVODK/yVF5zVpJ09ZJ0hrbCMzXXg2PeDW4IBBYoL0aEf5qUAEo4uLsTfU0JtQYyK78kBAOaNWFMFbqFS+39T02QjP76D6eC/+O3V3YF88vXdQXDYcfGWK7orUMFJwIcqbBdN7ZtadcYJUrhb2HnAqKy9jUWeG14ZPLi6RBRbKZgmxmTfIppgE+MKutDRMW0rxpVLtrWoutmRATXiQG8e7EeUiSoqLckykXxColWf7D8ulR1QpsiS9ZtMQIS8/qg04Naph7oh6alz5lD/bjuuuRq6/52c/v66tHr4b5WI/QBBUqiIjC1dZqb0OfE/ojsTiQTGgaw+8GfVhS6NLxZ2U34Mb+leuTq6O8rVpiWkcorYhCOovalXYyRxQlR5ItXp9ua/fBzcCdrRT8YuDml8IrXc24nM8vyy6YWgOWYx45MduNEGpHoha5OifSLkRFrZTGEyf2m7R19PtoYNLoH5CdbQDDg2Usye1EGfGDXA1anCaKkDF8Vk6+Cv3O1/BX79gEDLfWyLW5z3Qjx2sTjtXYZl4oGWNimm2pTFm8igteNzC9pDpraHfqn+ivFeQohyqAHjveb1jPdaoOooby/nCdU888aFE33bmT/S+DGejBSHtkCJBrDGoGfL/084zSQAoZfjXdO3GvNNOoFwbR3WpVS7c/578oHibz85OF3SstRUQlr7F1V5pr7xZuwcyUnOIsLquYzjvmodnc78LGloWouhE3Kz/2aIj2jSsN/vTFyMrLEpw+fYmoob4XGvZArX4QFnoPO7fUpMyYnoJ905XD0gI7AwP2B7hkIvJIsjNq/TzfQF+/IF/fIL8m/H/1WsHzTXi7UVHw7FtZpy+01FCTVxJmD1+mCivJk0Y8m6V/g75I026x5myBwyZVP51hRp+xiF+EqkEAcBixdFULucIEs9gFi7AD5rAYS7AU81iGXbEcK7AKu7lKOAWPATHaEtGQFOX+pMZh1N0YzYnxzclwxFRIXBy7FQT4HIZPK6N8Du4GdsaO4CSvZpSAvRLno1ZN1x2K27HTAq1rj2E0WF1HS68SRzI7MZO55kkB2SRESTn0RxQaD+HQzy8mHn77+HymOc3Y8kuqDoAGqJo5aaZpTyzgBC3gDk0ggXqLgVST/1FzFfm9OmaIh0qQgwAfjmvMO0C/ibVA/oOCGrQ1gfTjBFfT5LVT8j1BDEU4lsWr6ltsScw9yP/wu9WFnb+ZGLImADSMUsr70YjU0NgYTNUuCaLr8w8MjYWQd/2gyVKdSgppUjOOI05qzYKSHtWc1JqFRQRpcwRKRpd/cffNqbRZvpuwZGr3q+Pvt/frdOKx65HHZi0m9/x+rBQEAJny/0HsA/TuKrjxEaSCoNk4C3AAV/A9AZGTSJJDqju6i7u5+3qi3/Qd9CKlEupLg2kEjaN9sTGQcUxhFivpZAu7OM1FrnOXx/xJnRkvJpAJZ+KYFCaLKbRcnSNc5TVfj5jNYBtn4uyY03Nxnszv85ZHiOJEpdux6/b6dm+Cd4xwHBc0uJ4zc/25IVwLN4qbwE3j5nJd3CnuAvc5y7l/xSqx2xCfIUH7jz1mSOKQCnEfcbO4XTxDvEC8QtyV63pagAPEowB+bT1GrBUjvWzOdIhD6raZTFEAgrz97+crP9+QRDhA5/BidhXd9DwiFgoUELSDuIgMcGveIt9Ls4McxbIheGS7Wbyk7p4vc10j6QqubI7cQbU/OEh43Q/H7dIyKgq3czCgauO/XWp/9xWb9efGAeBr+RLbpDZjabJPgEK2xW+KRjAEfC4DMpMZoovw5BdXiO3PBhPIg26zedEQlhUICqAoz2FwshwtSQGHB8tuXf/jeYPS/39rNeR3HyTy2tPmbBisuZHb6M/7c4vzc2bzaGFh5vWfKNBbGpBlom2Wx5fYw2ouWXTqltnT1zttLTPZ/347tHM3HC71pf36qspa1R3iYXQGc5DG+3SThNGYXqtFsC8bczSbRrOWTk6mphjNUT9jSDUlMxUkNOQqPB4AVEPyMsKvrXkT5q54vrW21jJ+s6JIAMO2Nt5ZIb/LQoKtST8aCQvd6t5qQ6mPA5GqpI/YPEYOuv4xymOLe8O8EA4dFxVWgjiePHriaPK4QEAQH2YynzKZ96yA36FPlquj7R2CsC+fYCx7DJXS+6WBaOx66cxlFi4ECLbY/NxLr/CiC9Pg08nMuiJOrqbRqCEXJJAJOojxJm2QJB4bsXuXQ2r3us6MVpw7rWeny+Qks+uoGQypHY+ZlAcN9CJgyQtAvOCDQkJklF/UxB5rgexNmtEcosEnsjUi4qEnq8ZhNOxg9y3Ni4Y7cxGdzHnlJQh5XcYq3+gcHkvDNJjWI6KOfKazUaENPS3FiK7XykVWVfQMigZD+PHDQRRttVzoXMvjQlLVnncLPNaIID8Y9pZ1frg3BE5qNh5bWcnqu0GIHzQOH+o7enY3JKZ2lKpGo5533DlOcjUEVcFgnR6gS/98Fqon8s+E1tVmvzDIXAeTyc+f8Z3ESW9+Onv6liSQRAIRbt9HcYZRFJDit4nKNC1H+uTdAWv5yEOXW1yUb70S6d2vZ3npz9+V1mOfHG6O7O8/aTZ9EvgqfIH5OwS8E0W3yr3Ie6XZ0+ipw/8F8f//T4e0k6dOWU1XFU4GKF2vlopUU6SxehMudFw2H8FQVNSMlctAs8SQS3W3pKZuyXF9gk63O6OAXmAJAAKn9fNHBlSvstkScESiUUG0VLW1iwbTmNOn2wc6OGibGjBOaX9iXy3BduM0vomzG7gGYNmhbFJqXgMva0iQT3p4QYkgbKoKtmZ5NV8re+Tju6gk47i7KPBlzP3sSQ5X2uKaJkMvlHJHnz/u0HTW5zdtWvf/F0zXXewX22c1Y5d1x8Bu40oac5JKMa5G+WCWl03JpURyBxtDBwNao+chTgQyGGGFsH32prAplLSw6/BN83zqHXgjq6jeHI3cNdt6mKYZQNc6n4QQcc1bCBH6WnahRdbFO+952BVlk7WSrrOcZTn4FOM40fLHz5w9dRwDp86ePvZKoSdN3iQYZkmgBwdSoPRjBNghy9k1SVLyjeSaI8VHcdcvOdIp58oud450CSYEI9AayNDhQLCHQM7jiSFr02iQKTzr5aydLrNt37m6LFcyp44hG7KbemfiARxS1yhEHRfR6uisjZmdxQJ2a6QQ57E/tie0ZLsaTVPXUJOrbQOK9PRhGO7rirKsP7HhUnlOVQt56e0Pb974zijZzMTwRhCRfR+BExvr64v4gSqK0TAeOJSmpwXFrFo2RYjtS5i1BnyaDJasggMjgVChwDBH760cS5GCJKE+R3wZMSONtgHT0KK6/s4UciaFU3Nt2E0Yexsk2Qu5wm1LJRKcI38SJTmGEjheKtGAWK+vZyjnJGXkuyPxoEtazbp3D75/XxYHJ45gMk+tl+XVFJkjpPbo3AI+ICowUfz307nLv565nkGqlVAUDoIXyhxiUqhtFS0AeBBuFg0X4pMmwIcEwFw7RThMcfEuXHcIz4KjhUJlq5JHZMkYAgxbXi63KWakUGu3t07m6TtbtHdifKLZKH63/xbEaGAckVFymFX9+CBsGpRE+fSOpCadPk9Pfeaew2BZouFWhYdYiJHUxRDK408vVjY20TSJYYJ0bsqAz+DDcDK5gFtWPDCeCLFcgSYInKJGmYdnKWT4DfAHaGWr6HZ7Mnz/tEkHNQDHOjHBpVSQ6P1bwcBlJ6py8UrHea40ffezaOB5Pi4NGhsdM+r/f3brb0TG0bRHszaZef7ukzjK9sSGMYe4Mob7Vh/FNbYTSPLXHcinjzLIXTgaReIoKG6Qv6tGwx3e/O/b229+2b/rCO/kJoF9qyRT8bf8n+SXq9gQa00rmjJqjHwTxupItaKoGSz+/r0gCqcinkToRMEp8ChQxtWIQcC1qpFv53Hh/1YkSTG/FrmvGUxgfFSAAtzewij8VZpDZJPv96k5wkZB/+up/6Cqh85RoiEWrim8fWKikoNO2A6A8bItfNE21jZzZiiKhgjBR4c6StO2ufktUy9LRGLLlQBcDnurg2XwqzWTR3PZSjcOMC0+96v0g79YXoZpVXHzhto8T2RDxnx2zGyVInMz3DjNA8PGdXgnsfjQMeuVi1NyxOFUgLHiHu9/oj01/KCqolIk8F/QtH5Vo6yPDnFbZ4mjIzhi2af3n5bWgwaUl+Y7R7wO8T+wgtNqiXsT3csmGnPDwLE8pGkEIV75qM90NhXBfzlres3syYois6wsV4yuHOoYv2R5BPB1eI7Ovp9S73WSo11OZIEGryR3A6qnFdARClLBWr52wA/cLcjvhypjWu1HGSDyEkNtwPkQORejENEqthGLIPrzKm4WsU6NsI17JMDBB2JFmw6p6hiKUq0OCLGwLt4k+ZaPEGRuDqFIkmLz1AGwHu254R/70ldlbjsg+h0AANZmv1lvPv3VTMPZVdkrKfRkAA4UAECAbx5yqHGi6kPoxYQg72trY4RcVwMWu8mEZjDblVDb2ARaCIdgu35kC23QAlZICTfi2i1VaLLrm8NGN2GNK1vXHra65LSQYoeboEH8mW9xAV3WTFVIsx2YbUFBpl3sxi5sto1qDGXQQj7Ugye2anDKWaNDq2OKukK4vhl0thkTumGXvX/EdYcxSuySAJjcxt0AnhuLxHuOL7WvjgDoEI9BEjbMz4yCAnD2ExgQVgrgPA2oigQ+zYoUSvJOZJBZZ0UW0bVEFMGrRokcIqv8cCVSyuVoBJATCWNxqRJFkKNX5CDBG1EMJ1+JMiQ5LMqhMUlUIFa1qEQqN0MFjv93OoAHcDM9PeE1UfDAaJooSwC+5IJeZNPbcb+T6tSzaPl0iKfTaeEtkuChVqfBCrZGFm7hAYKoZo5Bh5OBi36uCjlImRz1SO1FYsJjast3pfEQgzpGNnMrV96c3vikjKNiCIuxzxh2szEIE+DUG7P5GBtaGuPILGNaSIxtmLxjw87D7CcEUimzvvaMvQrJFKh7a1EbtzkWYfimFpr8hyr45Oui+xmCPB3eWBTeU+o5OrU93h2NEvITau+GBRDsuKMALQvvoAkNj4q2dvy3Ke6yaDMys/Qwoi8pK6qmG6ZlO67H6xOACsKEhEXgCCQKjcHiRMXw4nr16Tdg0JBhI0aNGTdh0pSEpJQjjjqWDVKdcNIpp51x1jnnmSw2h8vjC0xMzczjqILfNVWWYchvbWNrlyXqHBydnBV3qZnh3f0d16+pTEpINJPFu2uS/MS8Qb8i0iS/+nIJ6sO2VW86iWlDK7vsmdZjJ9d7Dru33D7feGRCPjiD86zYfOUR6rZCC42WGp2Rr74P/2ntaI14mx90h8NW4T18/HC+ErzOJ2xnfb1Hu/LzJJ6C/g40HY9xqtYYAmrJlEsKybqgNeHDCbrq5rthkzAXbafuP620/ZELm2jHHQUmhQtPhImM0Z9ZKPBkmvhDglUC8R0/KNYW8jX00uiLnKg5WNisEz8mklcAFKeBQUTuLiXKiySyC2PPZ8UaekxY87W9XgiaVew0K9qvrECVdCYFgs+TcAnl0F4oSOHb75vWbuJ7krbIHBWfF6H29siCNkklk/eLT5Ur/3XvXTqIvrf733vVumw7TrFoj1RDrZ1tGQAAAAA=) format('woff2');+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }+ /* vietnamese */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,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) format('woff2');+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }+ /* latin-ext */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,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) format('woff2');+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }+ /* latin */+ @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;+ src: url(data:font/woff2;base64,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) format('woff2');+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }+ </style>+ <style>+ /* ==========================================================+ THEME VARIABLES — switch by toggling [data-theme] on <html>+ ========================================================== */+ :root,+ [data-theme="dark"] {+ --bg: #020617;+ --grid: #1e293b;+ --text: #ffffff;+ --text-muted: #94a3b8;+ --text-dim: #475569;+ /* UI chrome and menu hints need more contrast than SVG .t-dim accents */+ --text-faint: #7d8da1;++ --panel: rgba(15, 23, 42, 0.5);+ --panel-border: #1e293b;+ --lane-fill: rgba(15, 23, 42, 0.22);+ --lane-stroke: #334155;++ --arrow: #64748b;+ --arrow-emphasis: #34d399;++ /* Opaque mask color used behind semi-transparent component fills+ so the arrows drawn underneath are properly hidden. */+ --mask: #0f172a;++ --frontend-fill: rgba(8, 51, 68, 0.4);+ --frontend-stroke: #22d3ee;+ --backend-fill: rgba(6, 78, 59, 0.4);+ --backend-stroke: #34d399;+ --database-fill: rgba(76, 29, 149, 0.4);+ --database-stroke: #a78bfa;+ --cloud-fill: rgba(120, 53, 15, 0.3);+ --cloud-stroke: #fbbf24;+ --security-fill: rgba(136, 19, 55, 0.4);+ --security-stroke: #fb7185;+ --messagebus-fill: rgba(251, 146, 60, 0.3);+ --messagebus-stroke:#fb923c;+ --external-fill: rgba(30, 41, 59, 0.5);+ --external-stroke: #94a3b8;++ --toolbar-bg: rgba(15, 23, 42, 0.8);+ --toolbar-border: #334155;+ --toolbar-text: #e2e8f0;+ --toolbar-hover: rgba(15, 23, 42, 0.95);+ --toolbar-menu-bg: #0f172a;+ }++ [data-theme="light"] {+ --bg: #f8fafc;+ --grid: #e2e8f0;+ --text: #0f172a;+ --text-muted: #64748b;+ --text-dim: #94a3b8;+ --text-faint: #64748b;++ --panel: #ffffff;+ --panel-border: #e2e8f0;+ --lane-fill: rgba(248, 250, 252, 0.65);+ --lane-stroke: #cbd5e1;++ --arrow: #94a3b8;+ --arrow-emphasis: #059669;++ --mask: #ffffff;++ --frontend-fill: rgba(34, 211, 238, 0.15);+ --frontend-stroke: #0891b2;+ --backend-fill: rgba(52, 211, 153, 0.18);+ --backend-stroke: #059669;+ --database-fill: rgba(167, 139, 250, 0.2);+ --database-stroke: #7c3aed;+ --cloud-fill: rgba(251, 191, 36, 0.18);+ --cloud-stroke: #d97706;+ --security-fill: rgba(251, 113, 133, 0.15);+ --security-stroke: #e11d48;+ --messagebus-fill: rgba(251, 146, 60, 0.15);+ --messagebus-stroke:#ea580c;+ --external-fill: rgba(148, 163, 184, 0.18);+ --external-stroke: #64748b;++ --toolbar-bg: rgba(255, 255, 255, 0.92);+ --toolbar-border: #cbd5e1;+ --toolbar-text: #334155;+ --toolbar-hover: #ffffff;+ --toolbar-menu-bg: #ffffff;+ }++ /* ==========================================================+ SIGNAL FLOW — an opt-in, motion-forward visual preset.+ The variables also target a standalone exported SVG, whose+ root carries data-preset and data-theme directly.+ ========================================================== */+ [data-preset="signal-flow"][data-theme="dark"] {+ --bg: #030711;+ --grid: #15233a;+ --panel: rgba(6, 14, 28, 0.78);+ --panel-border: #1d3350;+ --lane-fill: rgba(9, 22, 40, 0.5);+ --lane-stroke: #2c4564;+ --text: #f5fbff;+ --text-muted: #9eb0c7;+ --text-dim: #52667f;+ --text-faint: #7890ad;+ --mask: #07101e;+ --frontend-fill: rgba(6, 182, 212, 0.14);+ --frontend-stroke: #67e8f9;+ --backend-fill: rgba(16, 185, 129, 0.14);+ --backend-stroke: #5eead4;+ --database-fill: rgba(139, 92, 246, 0.16);+ --database-stroke: #c4b5fd;+ --cloud-fill: rgba(245, 158, 11, 0.13);+ --cloud-stroke: #fcd34d;+ --security-fill: rgba(244, 63, 94, 0.13);+ --security-stroke: #fda4af;+ --messagebus-fill: rgba(249, 115, 22, 0.13);+ --messagebus-stroke: #fdba74;+ --external-fill: rgba(71, 85, 105, 0.24);+ --external-stroke: #a5b4c7;+ --arrow: #7890ad;+ --arrow-emphasis: #2dd4bf;+ --toolbar-bg: rgba(7, 16, 30, 0.86);+ --toolbar-border: #29415f;+ --toolbar-menu-bg: #07101e;+ }++ [data-preset="signal-flow"][data-theme="light"] {+ --bg: #f4f9fc;+ --grid: #d4e5ee;+ --panel: rgba(255, 255, 255, 0.82);+ --panel-border: #bfd5e2;+ --lane-fill: rgba(232, 243, 248, 0.62);+ --lane-stroke: #a9c5d5;+ --text: #102638;+ --text-muted: #587287;+ --text-dim: #8aa2b4;+ --text-faint: #668397;+ --mask: #ffffff;+ --frontend-fill: rgba(6, 182, 212, 0.09);+ --frontend-stroke: #0789a1;+ --backend-fill: rgba(5, 150, 105, 0.09);+ --backend-stroke: #087f69;+ --database-fill: rgba(124, 58, 237, 0.09);+ --database-stroke: #7254c7;+ --cloud-fill: rgba(217, 119, 6, 0.08);+ --cloud-stroke: #b9670b;+ --security-fill: rgba(225, 29, 72, 0.08);+ --security-stroke: #c53a59;+ --messagebus-fill: rgba(234, 88, 12, 0.08);+ --messagebus-stroke: #c65f27;+ --external-fill: rgba(100, 116, 139, 0.1);+ --external-stroke: #607a8c;+ --arrow: #7b97aa;+ --arrow-emphasis: #0d9488;+ }++ /* ==========================================================+ BLUEPRINT — a review-first drafting preset for deployment,+ infrastructure, and technical design documentation. It keeps+ the same semantic palette and geometry while trading glow for+ precise grid contrast, squared materials, and drafting marks.+ ========================================================== */+ [data-preset="blueprint"][data-theme="dark"] {+ --bg: #06131f;+ --grid: #17425a;+ --panel: rgba(7, 27, 43, 0.9);+ --panel-border: #27627f;+ --lane-fill: rgba(10, 43, 66, 0.36);+ --lane-stroke: #34799a;+ --text: #e3f6ff;+ --text-muted: #91b8ca;+ --text-dim: #557e92;+ --text-faint: #739caf;+ --mask: #0a2031;+ --frontend-fill: rgba(26, 157, 193, 0.14);+ --frontend-stroke: #66d9ef;+ --backend-fill: rgba(31, 155, 124, 0.13);+ --backend-stroke: #69dfbd;+ --database-fill: rgba(120, 105, 196, 0.14);+ --database-stroke: #b4a8ff;+ --cloud-fill: rgba(197, 145, 43, 0.13);+ --cloud-stroke: #ffd166;+ --security-fill: rgba(199, 76, 104, 0.13);+ --security-stroke: #ff8da1;+ --messagebus-fill: rgba(207, 112, 49, 0.13);+ --messagebus-stroke: #ffad66;+ --external-fill: rgba(84, 119, 139, 0.18);+ --external-stroke: #a7cad9;+ --arrow: #78a3b7;+ --arrow-emphasis: #64dfc1;+ --toolbar-bg: rgba(7, 28, 45, 0.92);+ --toolbar-border: #34799a;+ --toolbar-text: #d8f3ff;+ --toolbar-hover: rgba(18, 58, 83, 0.95);+ --toolbar-menu-bg: #0a2031;+ }++ [data-preset="blueprint"][data-theme="light"] {+ --bg: #edf7fa;+ --grid: #b5d5e1;+ --panel: rgba(249, 253, 255, 0.94);+ --panel-border: #78aabd;+ --lane-fill: rgba(210, 232, 240, 0.42);+ --lane-stroke: #83b2c4;+ --text: #123344;+ --text-muted: #4e7486;+ --text-dim: #86a6b4;+ --text-faint: #668c9d;+ --mask: #f9fdff;+ --frontend-fill: rgba(8, 145, 178, 0.08);+ --frontend-stroke: #087f9c;+ --backend-fill: rgba(5, 128, 101, 0.08);+ --backend-stroke: #08755f;+ --database-fill: rgba(100, 75, 180, 0.08);+ --database-stroke: #6757a8;+ --cloud-fill: rgba(181, 120, 15, 0.08);+ --cloud-stroke: #a86609;+ --security-fill: rgba(190, 48, 80, 0.07);+ --security-stroke: #b32f50;+ --messagebus-fill: rgba(196, 81, 22, 0.07);+ --messagebus-stroke: #b65120;+ --external-fill: rgba(79, 112, 128, 0.08);+ --external-stroke: #506f7e;+ --arrow: #6d93a5;+ --arrow-emphasis: #087f69;+ --toolbar-bg: rgba(247, 252, 254, 0.94);+ --toolbar-border: #8ab5c5;+ --toolbar-text: #294f61;+ --toolbar-hover: #ffffff;+ --toolbar-menu-bg: #f9fdff;+ }++ /* ==========================================================+ EDITORIAL — a warm, publication-minded preset for design+ reviews, launch notes, and documentation. The diagram keeps+ the same semantic palette and exact geometry, but trades+ software chrome for paper, ink, ruled structure, and one+ restrained vermilion accent.+ ========================================================== */+ [data-preset="editorial"][data-theme="dark"] {+ --bg: #181611;+ --grid: #39342a;+ --panel: rgba(35, 31, 24, 0.96);+ --panel-border: #625a4a;+ --lane-fill: rgba(52, 46, 35, 0.46);+ --lane-stroke: #726957;+ --text: #f4eddf;+ --text-muted: #b9ae9b;+ --text-dim: #776e60;+ --text-faint: #9d917e;+ --mask: #231f18;+ --frontend-fill: rgba(43, 133, 142, 0.16);+ --frontend-stroke: #7fc6c7;+ --backend-fill: rgba(63, 132, 92, 0.16);+ --backend-stroke: #8fc29e;+ --database-fill: rgba(117, 91, 141, 0.17);+ --database-stroke: #c0a4d0;+ --cloud-fill: rgba(170, 119, 49, 0.16);+ --cloud-stroke: #d8ad68;+ --security-fill: rgba(157, 69, 65, 0.17);+ --security-stroke: #df9085;+ --messagebus-fill: rgba(174, 79, 42, 0.16);+ --messagebus-stroke: #df946f;+ --external-fill: rgba(126, 115, 96, 0.18);+ --external-stroke: #b8ad99;+ --arrow: #948978;+ --arrow-emphasis: #dd6b3d;+ --toolbar-bg: rgba(35, 31, 24, 0.92);+ --toolbar-border: #625a4a;+ --toolbar-text: #eee5d5;+ --toolbar-hover: #302a20;+ --toolbar-menu-bg: #231f18;+ }++ [data-preset="editorial"][data-theme="light"] {+ --bg: #f2eee5;+ --grid: #d8d0c2;+ --panel: rgba(251, 248, 241, 0.97);+ --panel-border: #c4b9a6;+ --lane-fill: rgba(229, 221, 207, 0.42);+ --lane-stroke: #b8aa94;+ --text: #242018;+ --text-muted: #6f6658;+ --text-dim: #a09788;+ --text-faint: #817767;+ --mask: #fbf8f1;+ --frontend-fill: rgba(31, 117, 126, 0.09);+ --frontend-stroke: #287e84;+ --backend-fill: rgba(42, 119, 75, 0.09);+ --backend-stroke: #397b53;+ --database-fill: rgba(105, 75, 130, 0.09);+ --database-stroke: #765d86;+ --cloud-fill: rgba(157, 103, 31, 0.1);+ --cloud-stroke: #9a671f;+ --security-fill: rgba(153, 58, 52, 0.09);+ --security-stroke: #9e463f;+ --messagebus-fill: rgba(182, 70, 27, 0.09);+ --messagebus-stroke: #ad4b25;+ --external-fill: rgba(101, 91, 75, 0.09);+ --external-stroke: #746b5e;+ --arrow: #8a806f;+ --arrow-emphasis: #bb4c23;+ --toolbar-bg: rgba(251, 248, 241, 0.94);+ --toolbar-border: #c4b9a6;+ --toolbar-text: #40392f;+ --toolbar-hover: #fffdf8;+ --toolbar-menu-bg: #fbf8f1;+ }++ * { margin: 0; padding: 0; box-sizing: border-box; }++ body {+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;+ background: var(--bg);+ min-height: 100vh;+ padding: 2rem;+ color: var(--text);+ transition: background 0.2s ease, color 0.2s ease;+ }++ html[data-preset="signal-flow"] body {+ background-image:+ radial-gradient(circle at 18% -8%, rgba(34, 211, 238, 0.14), transparent 34rem),+ radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.12), transparent 30rem);+ background-attachment: fixed;+ }+ html[data-preset="signal-flow"][data-theme="light"] body {+ background-image:+ radial-gradient(circle at 18% -8%, rgba(6, 182, 212, 0.12), transparent 34rem),+ radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.08), transparent 30rem);+ }+ html[data-preset="blueprint"] body {+ background-image:+ linear-gradient(var(--grid) 1px, transparent 1px),+ linear-gradient(90deg, var(--grid) 1px, transparent 1px);+ background-size: 32px 32px;+ background-position: -1px -1px;+ background-attachment: fixed;+ }+ html[data-preset="editorial"] body {+ background-image:+ linear-gradient(90deg, transparent 0, transparent 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) calc(5.4rem + 1px), transparent calc(5.4rem + 1px)),+ repeating-linear-gradient(0deg, transparent 0, transparent 31px, color-mix(in srgb, var(--grid) 36%, transparent) 31px, color-mix(in srgb, var(--grid) 36%, transparent) 32px);+ background-attachment: fixed;+ }++ /* Gallery/embed mode keeps the generated artifact as the source of truth+ while presenting only its diagram surface inside a proof card. */+ html[data-embed="true"] body {+ min-height: 0;+ padding: 0;+ overflow: hidden;+ background: var(--bg);+ background-image: none;+ }+ html[data-embed="true"] .toolbar,+ html[data-embed="true"] .header,+ html[data-embed="true"] .cards,+ html[data-embed="true"] .diagram-nav,+ html[data-embed="true"] .overview-map,+ html[data-embed="true"] .focus-chip,+ html[data-embed="true"] .route-probe,+ html[data-embed="true"] .semantic-lens,+ html[data-embed="true"] .diagram-guide,+ html[data-embed="true"] .node-finder,+ html[data-embed="true"] .guided-views { display: none !important; }+ html[data-embed="true"] .container { max-width: none; }+ html[data-embed="true"] .diagram-container {+ padding: 0.5rem;+ border: 0;+ border-radius: 0;+ box-shadow: none;+ }+ html[data-embed="true"] .diagram-container svg { min-width: 0; }++ /* Share Chapter Cue lives in the HTML viewer layer, not inside the SVG.+ It gives one-shot embeds a title, authored note, truthful stop order,+ and lifecycle state while canonical diagram geometry stays untouched. */+ .share-chapter-cue { display: none; }+ html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),+ html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {+ position: absolute;+ z-index: 18;+ top: 0.85rem;+ left: 50%;+ display: grid;+ grid-template-columns: auto minmax(9rem, 13.5rem) minmax(0, 1fr);+ align-items: center;+ gap: 0.45rem 0.85rem;+ width: min(52rem, calc(100% - 1.5rem));+ min-height: 3.35rem;+ padding: 0.55rem 0.75rem 0.65rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));+ border-radius: 0.75rem;+ background:+ linear-gradient(115deg, color-mix(in srgb, var(--frontend-fill) 52%, transparent), transparent 45%),+ color-mix(in srgb, var(--toolbar-menu-bg) 92%, transparent);+ color: var(--toolbar-text);+ box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);+ backdrop-filter: blur(16px);+ pointer-events: none;+ animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ html[data-preset="blueprint"] .share-chapter-cue {+ border-radius: 0.2rem;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 46%, transparent), transparent 36%),+ var(--toolbar-menu-bg);+ box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);+ backdrop-filter: none;+ }+ html[data-preset="editorial"] .share-chapter-cue {+ border-color: var(--panel-border);+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 42%),+ var(--toolbar-menu-bg);+ box-shadow: 0 10px 30px color-mix(in srgb, #000 18%, transparent);+ backdrop-filter: none;+ }+ html[data-preset="editorial"] .share-chapter-state { color: var(--arrow-emphasis); }+ html[data-preset="editorial"] .share-chapter-state::before {+ border-radius: 0;+ box-shadow: none;+ transform: rotate(45deg) scale(0.8);+ }+ .share-chapter-index {+ display: grid;+ gap: 0.12rem;+ min-width: 5rem;+ padding-right: 0.75rem;+ border-right: 1px solid var(--toolbar-border);+ }+ .share-chapter-state {+ display: inline-flex;+ align-items: center;+ gap: 0.36rem;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.14em;+ text-transform: uppercase;+ }+ .share-chapter-state::before {+ width: 0.38rem;+ height: 0.38rem;+ border-radius: 50%;+ background: currentColor;+ box-shadow: 0 0 10px currentColor;+ content: '';+ }+ .share-chapter-cue[data-state="playing"] .share-chapter-state::before {+ animation: archify-share-cue-pulse 1.15s ease-in-out infinite;+ }+ .share-chapter-count {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 700;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .share-chapter-copy { min-width: 0; }+ .share-chapter-copy strong,+ .share-chapter-copy small,+ .share-chapter-route {+ display: block;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .share-chapter-copy strong {+ color: var(--toolbar-text);+ font-size: 0.6875rem;+ line-height: 1.35;+ }+ .share-chapter-copy small {+ margin-top: 0.08rem;+ color: var(--text-muted);+ font-size: 0.5rem;+ line-height: 1.35;+ }+ .share-chapter-route {+ color: color-mix(in srgb, var(--frontend-stroke) 76%, var(--text-muted));+ font-size: 0.5625rem;+ font-weight: 650;+ letter-spacing: 0.015em;+ text-align: right;+ }+ .share-chapter-progress {+ position: absolute;+ right: 0;+ bottom: 0;+ left: 0;+ height: 2px;+ overflow: hidden;+ background: color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ .share-chapter-progress span {+ display: block;+ width: 100%;+ height: 100%;+ background: linear-gradient(90deg, var(--frontend-stroke), var(--database-stroke));+ box-shadow: 0 0 12px var(--frontend-stroke);+ transform: scaleX(0);+ transform-origin: left center;+ }++ /* Presentation Stage is a viewer-only layer: it gives the live diagram+ the viewport while keeping guided views, theme, focus, and exports real.+ Embed mode wins when both query parameters are present. */+ html[data-present="true"]:not([data-embed="true"]) body {+ height: 100dvh;+ min-height: 0;+ padding: 1rem;+ overflow: hidden;+ }+ html[data-present="true"]:not([data-embed="true"]) .container {+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+ width: 100%;+ max-width: none;+ height: calc(100dvh - 2rem);+ }+ html[data-present="true"]:not([data-embed="true"]) .header {+ flex: none;+ min-width: 0;+ margin: 0;+ padding-right: 23rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row { margin-bottom: 0.25rem; }+ html[data-present="true"]:not([data-embed="true"]) .subtitle {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-views {+ flex: none;+ margin-bottom: 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container {+ display: flex;+ flex: 1 1 auto;+ align-items: center;+ justify-content: center;+ min-height: 0;+ padding: 0.75rem;+ padding-bottom: calc(0.75rem + var(--archify-nav-reserve));+ }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container > svg {+ flex: 1 1 auto;+ height: 100%;+ min-height: 0;+ width: 100%;+ min-width: 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .cards { display: none; }+ html[data-present="true"]:not([data-embed="true"]) #btn-present {+ border-color: var(--frontend-stroke);+ color: var(--frontend-stroke);+ }++ /* The reader owns only the outer scale. Wide diagrams keep one authored+ SVG/viewBox while the runtime chooses a desktop width from the actual+ vertical budget. This avoids device-specific files and breakpoint+ jumps between a laptop and a tall monitor. */+ .container {+ width: 100%;+ max-width: var(--archify-reader-width, 1440px);+ margin: 0 auto;+ }+ @media (min-width: 768px) and (max-height: 920px) {+ .header { margin-bottom: 1rem; }+ .diagram-container { padding: 1rem; }+ .cards { margin-top: 1rem; }+ .card { padding: 1rem; }+ }++ .header { margin-bottom: 1.5rem; padding-right: 29.5rem; }++ html[data-preset="signal-flow"] .header,+ html[data-preset="blueprint"] .header,+ html[data-preset="editorial"] .header { padding-right: 29.5rem; }++ .header-row {+ display: flex;+ align-items: center;+ gap: 1rem;+ margin-bottom: 0.5rem;+ }++ .pulse-dot {+ width: 12px;+ height: 12px;+ background: var(--frontend-stroke);+ border-radius: 50%;+ animation: none;+ }++ html[data-motion-capable="true"] .pulse-dot { animation: pulse 2s infinite; }++ @keyframes pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.5; }+ }++ h1 {+ font-size: 1.5rem;+ font-weight: 700;+ letter-spacing: -0.025em;+ }++ .subtitle {+ color: var(--text-muted);+ font-size: 0.875rem;+ margin-left: 1.75rem;+ }++ html[data-preset="signal-flow"] .header-row::after {+ content: attr(data-preset-badge-signal-flow);+ margin-left: auto;+ color: var(--frontend-stroke);+ border: 1px solid var(--frontend-stroke);+ border-radius: 999px;+ padding: 0.28rem 0.6rem;+ font-size: 0.625rem;+ letter-spacing: 0.12em;+ opacity: 0.82;+ box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);+ white-space: nowrap;+ }++ html[data-preset="blueprint"] .pulse-dot {+ width: 10px;+ height: 10px;+ border: 1px solid var(--frontend-stroke);+ border-radius: 1px;+ background: transparent;+ box-shadow: inset 0 0 0 2px var(--bg);+ transform: rotate(45deg);+ animation: none;+ }+ html[data-preset="blueprint"] .header-row::after {+ content: attr(data-preset-badge-blueprint);+ margin-left: auto;+ padding: 0.28rem 0.55rem;+ border-top: 1px solid var(--frontend-stroke);+ border-bottom: 1px solid var(--frontend-stroke);+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 700;+ letter-spacing: 0.14em;+ white-space: nowrap;+ }++ html[data-preset="editorial"] h1,+ html[data-preset="editorial"] .card h3 {+ font-family: Georgia, 'Times New Roman', 'Songti SC', STSong, serif;+ letter-spacing: -0.02em;+ }+ html[data-preset="editorial"] h1 { font-size: 1.72rem; font-weight: 600; }+ html[data-preset="editorial"] .pulse-dot {+ width: 9px;+ height: 9px;+ border: 1px solid var(--arrow-emphasis);+ border-radius: 0;+ background: var(--arrow-emphasis);+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);+ transform: rotate(45deg);+ animation: none;+ }+ html[data-preset="editorial"] .header-row::after {+ content: attr(data-preset-badge-editorial);+ margin-left: auto;+ padding: 0.32rem 0 0.24rem;+ border-bottom: 2px solid var(--arrow-emphasis);+ color: var(--arrow-emphasis);+ font-family: Georgia, 'Times New Roman', serif;+ font-size: 0.625rem;+ font-style: italic;+ font-weight: 600;+ letter-spacing: 0.08em;+ white-space: nowrap;+ }++ .diagram-container {+ --archify-nav-reserve: 0px;+ background: var(--panel);+ border-radius: 1rem;+ border: 1px solid var(--panel-border);+ padding: 1.5rem;+ padding-bottom: calc(1.5rem + var(--archify-nav-reserve));+ overflow: hidden;+ position: relative;+ }++ html[data-preset="signal-flow"] .diagram-container {+ position: relative;+ overflow: hidden;+ background: linear-gradient(180deg, rgba(8, 20, 38, 0.82), rgba(3, 8, 18, 0.94));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.34);+ }+ html[data-preset="signal-flow"][data-theme="light"] .diagram-container {+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 246, 250, 0.94));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 60px rgba(45, 78, 99, 0.12);+ }+ html[data-preset="blueprint"] .diagram-container {+ border-color: var(--panel-border);+ border-radius: 0.35rem;+ background: var(--panel);+ box-shadow:+ inset 0 0 0 1px color-mix(in srgb, var(--panel-border) 34%, transparent),+ 0 18px 48px rgba(0, 0, 0, 0.16);+ }+ html[data-preset="blueprint"] .diagram-container::after {+ content: "";+ position: absolute;+ z-index: 10;+ inset: 0.7rem;+ pointer-events: none;+ background:+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1px 1.35rem no-repeat;+ opacity: 0.58;+ }+ html[data-preset="editorial"] .diagram-container {+ overflow: hidden;+ border-color: var(--panel-border);+ border-radius: 0.38rem;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 12%),+ var(--panel);+ box-shadow:+ 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent),+ 0 18px 48px color-mix(in srgb, #000 19%, transparent);+ }+ html[data-preset="editorial"] .diagram-container::after {+ position: absolute;+ z-index: 10;+ top: 0.72rem;+ right: 1.25rem;+ padding: 0.2rem 0.52rem;+ border: 1px solid var(--panel-border);+ background: var(--panel);+ color: var(--arrow-emphasis);+ content: attr(data-preset-badge-editorial-plate);+ font-family: Georgia, 'Times New Roman', serif;+ font-size: 0.52rem;+ font-style: italic;+ font-weight: 600;+ letter-spacing: 0.09em;+ pointer-events: none;+ }+ html[data-embed="true"][data-preset="editorial"] .diagram-container::after { display: none; }+ html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before {+ content: "";+ position: absolute;+ inset: 0;+ pointer-events: none;+ background: linear-gradient(115deg, transparent 28%, rgba(103, 232, 249, 0.035) 48%, transparent 68%);+ transform: translateX(-70%);+ animation: archify-signal-scan 4.8s ease-in-out 1 both;+ }++ /* Motion Governor gives the reader a real static state and gives the+ strongest semantic action the only motion budget. Atmosphere resets to+ its authored base instead of freezing mid-cycle. Static artifacts never+ start a decorative pulse or scan. */+ html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ }+ html[data-motion="still"] .pulse-dot,+ html[data-motion="still"] .diagram-container::before,+ html[data-motion="still"] svg[data-animation="trace"] [data-animate],+ html[data-motion-owner] .pulse-dot,+ html[data-motion-owner] .diagram-container::before,+ html[data-motion-owner] svg[data-animation="trace"] [data-animate],+ html[data-embed="true"] .pulse-dot,+ html[data-embed="true"] .diagram-container::before,+ html[data-share-playback="true"] .pulse-dot,+ html[data-share-playback="true"] .diagram-container::before,+ html[data-document-hidden="true"] .pulse-dot,+ html[data-document-hidden="true"] .diagram-container::before,+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ }+ html[data-motion="still"] .diagram-container::before,+ html[data-motion-owner] .diagram-container::before,+ html[data-embed="true"] .diagram-container::before,+ html[data-share-playback="true"] .diagram-container::before {+ opacity: 0;+ }+ html[data-motion="still"] .guided-view-progress span,+ html[data-motion="still"] .guided-story-caption,+ html[data-motion="still"] .story-trail-flow,+ html[data-motion="still"] .intent-trace-flow,+ html[data-motion="still"] .route-probe-flow,+ html[data-motion="still"] .route-journey-flow,+ html[data-motion="still"] .semantic-lens-flow,+ html[data-motion="still"] .diagram-guide,+ html[data-motion="still"] [data-story-step],+ html[data-motion="still"] .overview-map-live,+ html[data-motion="still"] .guided-view-stop,+ html[data-motion="still"] .share-chapter-cue,+ html[data-motion="still"] .share-chapter-state::before,+ html[data-motion="still"] .share-chapter-progress span,+ html[data-document-hidden="true"] .guided-view-progress span,+ html[data-document-hidden="true"] .story-trail-flow,+ html[data-document-hidden="true"] .intent-trace-flow,+ html[data-document-hidden="true"] .route-probe-flow,+ html[data-document-hidden="true"] .route-journey-flow,+ html[data-document-hidden="true"] .semantic-lens-flow,+ html[data-document-hidden="true"] .diagram-guide,+ html[data-document-hidden="true"] [data-story-step],+ html[data-document-hidden="true"] .overview-map-live,+ html[data-document-hidden="true"] .guided-view-stop,+ html[data-document-hidden="true"] .share-chapter-cue,+ html[data-document-hidden="true"] .share-chapter-state::before,+ html[data-document-hidden="true"] .share-chapter-progress span {+ animation: none !important;+ }+ html[data-motion="still"] .guided-view-progress span {+ transform: scaleX(1) !important;+ }+ html[data-motion="still"] svg[data-story-playing="true"] .story-trail-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.55;+ }+ html[data-motion="still"] .intent-trace-flow,+ html[data-motion="still"] .route-probe-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.72;+ }+ html[data-motion="still"] .route-journey-overlay,+ html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }+ html[data-motion="still"] .relationship-pulse-overlay,+ html[data-motion="still"] .story-carrier-overlay,+ html[data-document-hidden="true"] .story-carrier-overlay { display: none !important; }+ html[data-motion="still"] .chapter-handoff-overlay { display: none !important; }+ html[data-motion="still"] .chapter-handoff-anchor { animation: none !important; }+ html[data-motion="still"] .guided-view-chapter,+ html[data-motion="still"] svg [data-node-id],+ html[data-motion="still"] svg [data-edge-from],+ html[data-motion="still"] svg [data-detail],+ html[data-motion="still"] svg [data-detail-anchor],+ html[data-motion="still"] svg [data-legend-hit],+ html[data-motion="still"] svg {+ transition: none !important;+ }++ svg {+ width: 100%;+ min-width: min(900px, 100%);+ display: block;+ transform-origin: 0 0;+ transition: transform 0.18s ease;+ }++ .diagram-container.is-camera-moving svg {+ transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);+ }+ .diagram-container.is-camera-transaction svg { transition: none; }+ .diagram-container.is-pannable { cursor: grab; }+ .diagram-container.is-panning { cursor: grabbing; user-select: none; }+ .diagram-container.is-panning svg { transition: none; }++ .diagram-nav {+ position: absolute;+ right: 1rem;+ bottom: 1rem;+ z-index: 12;+ display: inline-flex;+ align-items: center;+ max-width: calc(100% - 2rem);+ padding: 0.15rem;+ gap: 0;+ overflow-x: auto;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 48%, transparent);+ border-radius: 0.58rem;+ background: color-mix(in srgb, var(--toolbar-bg) 82%, transparent);+ box-shadow: 0 5px 14px rgba(0, 0, 0, 0.07);+ backdrop-filter: blur(10px);+ scrollbar-width: none;+ }+ .diagram-nav::-webkit-scrollbar { display: none; }+ .diagram-nav button,+ .focus-chip button,+ .guided-views button {+ border: 0;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ cursor: pointer;+ }+ .diagram-nav button {+ min-width: 2rem;+ height: 2rem;+ padding: 0 0.35rem;+ border-radius: 0.35rem;+ color: color-mix(in srgb, var(--toolbar-text) 68%, transparent);+ font-size: 0.56rem;+ font-weight: 600;+ letter-spacing: 0.02em;+ transition: background 0.15s, color 0.15s;+ }+ .diagram-nav button:hover,+ .diagram-nav button:focus-visible,+ .focus-chip button:hover,+ .focus-chip button:focus-visible,+ .guided-views button:hover,+ .guided-views button:focus-visible { background: var(--toolbar-hover); }+ .diagram-nav button:focus-visible,+ .focus-chip button:focus-visible,+ .guided-views button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .diagram-nav button:disabled { opacity: 0.38; cursor: default; }+ .diagram-nav button:disabled:hover { background: transparent; }+ .diagram-nav #btn-route-probe,+ .diagram-nav #btn-overview-map,+ .diagram-nav #btn-semantic-lens {+ min-width: auto;+ padding-inline: 0.5rem;+ color: color-mix(in srgb, var(--toolbar-text) 86%, transparent);+ font-weight: 650;+ }+ .diagram-nav #btn-node-finder,+ .diagram-nav [data-view="out"] {+ position: relative;+ margin-left: 0.25rem;+ }+ .diagram-nav #btn-node-finder::before,+ .diagram-nav [data-view="out"]::before {+ position: absolute;+ top: 0.4rem;+ bottom: 0.4rem;+ left: -0.13rem;+ width: 1px;+ background: color-mix(in srgb, var(--toolbar-border) 62%, transparent);+ content: "";+ pointer-events: none;+ }+ .diagram-nav-icon {+ display: block;+ width: 0.72rem;+ height: 0.72rem;+ margin: auto;+ background: currentColor;+ -webkit-mask-position: center;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-size: contain;+ mask-position: center;+ mask-repeat: no-repeat;+ mask-size: contain;+ }+ .diagram-nav-icon.find {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ .diagram-nav-icon.guide {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ .diagram-nav-icon.minus {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ .diagram-nav-icon.plus {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ .diagram-nav [data-view="reset"] {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.2rem;+ min-width: 3.1rem;+ padding-inline: 0.35rem;+ }+ .diagram-nav [data-view="reset"][data-detail-visible] {+ min-width: 3.8rem;+ }+ .diagram-nav-detail {+ color: color-mix(in srgb, var(--toolbar-text) 52%, transparent);+ font-size: 0.44rem;+ font-weight: 700;+ line-height: 1;+ letter-spacing: 0.07em;+ }+ .diagram-nav-percent {+ color: color-mix(in srgb, var(--toolbar-text) 84%, transparent);+ font-size: 0.55rem;+ font-weight: 650;+ line-height: 1;+ }+ .diagram-container[data-camera-indicator="true"] .diagram-nav-detail,+ .diagram-container[data-camera-indicator="true"] .diagram-nav-percent { color: var(--frontend-stroke); }+ .diagram-nav #btn-diagram-guide[aria-expanded="true"] {+ color: var(--cloud-stroke);+ background: var(--toolbar-hover);+ }++ /* Semantic Radar is a deliberately simplified, viewer-only overview. It+ uses authored node bounds and the live camera viewport rather than+ cloning the canonical SVG, so IDs, filters, animation, and export state+ stay singular and deterministic. */+ .overview-map {+ position: absolute;+ right: 1rem;+ bottom: calc(4.15rem + var(--archify-nav-reserve));+ z-index: 12;+ width: 11.25rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));+ border-radius: 0.78rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.625rem;+ }+ .overview-map[hidden] { display: none; }+ .overview-map[data-docked="true"] {+ position: fixed;+ right: var(--archify-radar-right, 1rem);+ top: var(--archify-radar-top, 1rem);+ bottom: auto;+ }+ .overview-map[data-docked="true"][data-dock-side="left"] {+ right: auto;+ left: var(--archify-radar-left, 1rem);+ }+ html[data-preset="blueprint"] .overview-map { border-radius: 0.28rem; }+ .overview-map-head {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.45rem;+ min-height: 2.25rem;+ padding: 0.42rem 0.48rem 0.38rem 0.55rem;+ border-bottom: 1px solid var(--toolbar-border);+ background: linear-gradient(110deg, color-mix(in srgb, var(--frontend-fill) 45%, transparent), transparent 68%);+ cursor: grab;+ touch-action: none;+ user-select: none;+ }+ .overview-map[data-panel-dragging="true"] .overview-map-head { cursor: grabbing; }+ .overview-map[data-placement-invalid="true"] {+ border-color: var(--security-stroke);+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--security-stroke) 34%, transparent), 0 16px 42px rgba(0, 0, 0, 0.3);+ }+ .overview-map[data-compact="true"] {+ width: 7.4rem;+ }+ .overview-map[data-compact="true"] .overview-map-head {+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.24rem;+ min-height: 1.5rem;+ padding: 0.05rem 0.16rem 0.05rem 0.32rem;+ border-bottom: 0;+ }+ .overview-map[data-compact="true"] .overview-map-live,+ .overview-map[data-compact="true"] .overview-map-copy,+ .overview-map[data-compact="true"] .overview-map-surface,+ .overview-map[data-compact="true"] .overview-map-hint {+ display: none;+ }+ .overview-map[data-compact="true"] .overview-map-expand { display: inline-flex; }+ .overview-map[data-compact="true"] .overview-map-close {+ width: 1.15rem;+ height: 1.15rem;+ font-size: 0.72rem;+ }+ .overview-map-live {+ width: 0.42rem;+ height: 0.42rem;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent);+ animation: archify-radar-live 2.4s ease-out infinite;+ }+ .overview-map-copy { min-width: 0; line-height: 1.1; }+ .overview-map-copy strong {+ display: block;+ overflow: hidden;+ color: var(--frontend-stroke);+ font-size: 0.59rem;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .overview-map-copy small {+ display: block;+ margin-top: 0.18rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.52rem;+ letter-spacing: 0.04em;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .overview-map-expand {+ display: none;+ align-items: center;+ justify-content: center;+ min-width: 0;+ height: 1.2rem;+ padding: 0 0.34rem;+ overflow: hidden;+ border: 0;+ border-radius: 0.3rem;+ background: transparent;+ color: var(--frontend-stroke);+ font: inherit;+ font-size: 0.49rem;+ font-weight: 700;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ white-space: nowrap;+ cursor: pointer;+ }+ .overview-map-close {+ width: 1.55rem;+ height: 1.55rem;+ padding: 0;+ border: 0;+ border-radius: 0.34rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 0.9rem;+ cursor: pointer;+ }+ .overview-map-expand:hover,+ .overview-map-expand:focus-visible,+ .overview-map-close:hover,+ .overview-map-close:focus-visible { background: var(--toolbar-hover); }+ .overview-map-expand:focus-visible,+ .overview-map-close:focus-visible,+ .overview-map-surface:focus-visible,+ .overview-map-node:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .overview-map-surface {+ position: relative;+ height: 7rem;+ margin: 0.42rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--panel-border) 72%, transparent);+ border-radius: 0.42rem;+ background:+ linear-gradient(color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),+ linear-gradient(90deg, color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),+ color-mix(in srgb, var(--bg) 86%, transparent);+ background-size: 12px 12px;+ cursor: crosshair;+ touch-action: none;+ }+ html[data-preset="blueprint"] .overview-map-surface { border-radius: 0.1rem; }+ .overview-map-surface > svg {+ width: 100%;+ height: 100%;+ min-width: 0;+ transform: none !important;+ transition: none !important;+ display: block;+ overflow: visible;+ }+ .overview-map-node {+ fill: var(--backend-stroke);+ fill-opacity: 0.52;+ stroke: var(--backend-stroke);+ stroke-opacity: 0.86;+ vector-effect: non-scaling-stroke;+ cursor: pointer;+ transition: fill-opacity 140ms ease, stroke-width 140ms ease, filter 140ms ease;+ }+ .overview-map-node[data-kind="frontend"],+ .overview-map-node[data-kind="start"] { fill: var(--frontend-stroke); stroke: var(--frontend-stroke); }+ .overview-map-node[data-kind="database"],+ .overview-map-node[data-kind="success"] { fill: var(--database-stroke); stroke: var(--database-stroke); }+ .overview-map-node[data-kind="cloud"],+ .overview-map-node[data-kind="waiting"] { fill: var(--cloud-stroke); stroke: var(--cloud-stroke); }+ .overview-map-node[data-kind="messagebus"] { fill: var(--messagebus-stroke); stroke: var(--messagebus-stroke); }+ .overview-map-node[data-kind="security"],+ .overview-map-node[data-kind="decision"],+ .overview-map-node[data-kind="failure"] { fill: var(--security-stroke); stroke: var(--security-stroke); }+ .overview-map-node[data-kind="external"],+ .overview-map-node[data-kind="neutral"] { fill: var(--external-stroke); stroke: var(--external-stroke); }+ .overview-map-node[data-radar-active="true"],+ .overview-map-node:hover,+ .overview-map-node:focus-visible {+ fill-opacity: 0.92;+ stroke-width: 2.2;+ filter: drop-shadow(0 0 3px currentColor);+ }+ .overview-map-viewport {+ fill: color-mix(in srgb, var(--frontend-fill) 56%, transparent);+ stroke: var(--frontend-stroke);+ stroke-width: 2;+ vector-effect: non-scaling-stroke;+ pointer-events: none;+ filter: drop-shadow(0 0 3px color-mix(in srgb, var(--frontend-stroke) 54%, transparent));+ }+ .overview-map-hint {+ display: flex;+ justify-content: space-between;+ gap: 0.5rem;+ padding: 0 0.52rem 0.46rem;+ color: var(--text-faint);+ font-size: 0.49rem;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ }+ .diagram-nav #btn-overview-map[aria-expanded="true"] {+ color: var(--frontend-stroke);+ background: var(--toolbar-hover);+ }+ .overview-map-feedback {+ position: absolute;+ right: 1rem;+ bottom: 4.15rem;+ z-index: 13;+ max-width: min(16rem, calc(100% - 2rem));+ padding: 0.38rem 0.55rem;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));+ border-radius: 0.5rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);+ font-size: 0.52rem;+ line-height: 1.35;+ pointer-events: none;+ }+ .overview-map-feedback[hidden] { display: none; }+ .focus-chip[data-radar-yielded="true"] { display: none !important; }+ .diagram-nav #btn-route-probe[aria-pressed="true"] {+ color: var(--backend-stroke);+ background: var(--toolbar-hover);+ }+ .diagram-nav #btn-semantic-lens[aria-expanded="true"],+ .diagram-nav #btn-semantic-lens[aria-pressed="true"] {+ color: var(--database-stroke);+ background: var(--toolbar-hover);+ }++ /* Semantic Lens turns the compiled node-kind palette into an analytical+ legend. One kind reveals its real traffic; two kinds compare only their+ direct authored relationships. Geometry and the canonical SVG stay put. */+ .semantic-lens {+ position: absolute;+ right: 1rem;+ bottom: calc(4.15rem + var(--archify-nav-reserve));+ z-index: 24;+ width: min(20rem, calc(100% - 2rem));+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--database-stroke) 58%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(135deg, color-mix(in srgb, var(--database-fill) 34%, transparent), transparent 48%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);+ backdrop-filter: blur(18px);+ animation: archify-lens-in 180ms cubic-bezier(0.22, 1, 0.36, 1);+ }+ .semantic-lens[hidden] { display: none; }+ .semantic-lens[data-dock-side="left"] { left: 1rem; right: auto; }+ .semantic-lens[data-dock-side="right"] { left: auto; right: 1rem; }+ html[data-preset="blueprint"] .semantic-lens { border-radius: 0.28rem; }+ .semantic-lens-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.75rem;+ padding: 0.72rem 0.78rem 0.62rem;+ border-bottom: 1px solid var(--toolbar-border);+ }+ .semantic-lens-eyebrow {+ display: block;+ color: var(--database-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.16em;+ text-transform: uppercase;+ }+ .semantic-lens-title {+ display: block;+ margin-top: 0.16rem;+ color: var(--text);+ font-size: 0.82rem;+ letter-spacing: -0.02em;+ }+ .semantic-lens-close {+ width: 1.75rem;+ height: 1.75rem;+ padding: 0;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .semantic-lens-close:hover,+ .semantic-lens-close:focus-visible { background: var(--toolbar-hover); }+ .semantic-lens-instruction {+ margin: 0;+ padding: 0.52rem 0.78rem 0.48rem;+ color: var(--text-faint);+ font-size: 0.55rem;+ line-height: 1.45;+ }+ .semantic-lens-kinds {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 0.3rem;+ max-height: min(15rem, 40vh);+ padding: 0 0.5rem 0.5rem;+ overflow-y: auto;+ scrollbar-width: thin;+ }+ .semantic-lens-kind {+ --lens-color: var(--external-stroke);+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.42rem;+ min-width: 0;+ min-height: 2.15rem;+ padding: 0.35rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--lens-color) 24%, var(--toolbar-border));+ border-radius: 0.45rem;+ background: color-mix(in srgb, var(--panel) 76%, transparent);+ color: var(--toolbar-text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;+ }+ html[data-preset="blueprint"] .semantic-lens-kind { border-radius: 0.12rem; }+ .semantic-lens-kind[data-kind="frontend"],+ .semantic-lens-kind[data-kind="start"] { --lens-color: var(--frontend-stroke); }+ .semantic-lens-kind[data-kind="backend"],+ .semantic-lens-kind[data-kind="active"] { --lens-color: var(--backend-stroke); }+ .semantic-lens-kind[data-kind="database"],+ .semantic-lens-kind[data-kind="success"] { --lens-color: var(--database-stroke); }+ .semantic-lens-kind[data-kind="cloud"],+ .semantic-lens-kind[data-kind="waiting"] { --lens-color: var(--cloud-stroke); }+ .semantic-lens-kind[data-kind="messagebus"] { --lens-color: var(--messagebus-stroke); }+ .semantic-lens-kind[data-kind="security"],+ .semantic-lens-kind[data-kind="decision"],+ .semantic-lens-kind[data-kind="failure"] { --lens-color: var(--security-stroke); }+ .semantic-lens-kind:hover,+ .semantic-lens-kind:focus-visible,+ .semantic-lens-kind[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--lens-color) 78%, var(--toolbar-border));+ background: color-mix(in srgb, var(--lens-color) 11%, var(--panel));+ }+ .semantic-lens-kind:focus-visible,+ .semantic-lens-close:focus-visible,+ .semantic-lens-actions button:focus-visible {+ outline: 2px solid var(--database-stroke);+ outline-offset: 1px;+ }+ .semantic-lens-kind:disabled { opacity: 0.34; cursor: default; }+ .semantic-lens-swatch {+ width: 0.48rem;+ height: 0.48rem;+ border-radius: 50%;+ background: var(--lens-color);+ box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color) 58%, transparent);+ }+ .semantic-lens-kind strong {+ overflow: hidden;+ color: var(--text);+ font-size: 0.61rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-lens-kind em {+ color: var(--lens-color);+ font-size: 0.54rem;+ font-style: normal;+ font-weight: 800;+ }+ .semantic-lens-status {+ min-height: 2.5rem;+ margin: 0;+ padding: 0.55rem 0.78rem;+ border-top: 1px solid var(--toolbar-border);+ color: var(--text-faint);+ font-size: 0.55rem;+ line-height: 1.45;+ }+ .semantic-lens-status strong { color: var(--database-stroke); font-weight: 800; }+ .semantic-lens-actions {+ display: flex;+ justify-content: flex-end;+ gap: 0.28rem;+ padding: 0 0.62rem 0.62rem;+ }+ .semantic-lens-actions button {+ min-height: 1.8rem;+ padding: 0.28rem 0.48rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 0.56rem;+ cursor: pointer;+ }+ .semantic-lens-actions button:hover { background: var(--toolbar-hover); }+ .semantic-lens-actions #semantic-lens-copy { color: var(--database-stroke); }+ @keyframes archify-lens-in {+ from { opacity: 0; transform: translateY(5px) scale(0.985); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }++ /* Route Probe answers a reader question over the compiled semantic graph:+ choose two stable nodes and reveal the shortest authored directed route.+ The receipt and signal live entirely in the viewer layer. */+ .route-probe {+ position: absolute;+ left: 1rem;+ bottom: calc(1rem + var(--archify-nav-reserve));+ z-index: 12;+ width: min(46rem, calc(100% - 25rem));+ min-width: 18rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 62%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(115deg, color-mix(in srgb, var(--backend-fill) 50%, transparent), transparent 62%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.625rem;+ }+ .route-probe[hidden] { display: none; }+ .route-probe[data-route-dock="top"] {+ top: 1rem;+ bottom: auto;+ }+ html[data-preset="blueprint"] .route-probe { border-radius: 0.25rem; }+ .route-probe-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.65rem;+ padding: 0.52rem 0.58rem 0.44rem;+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);+ }+ .route-probe-copy { min-width: 0; }+ .route-probe-eyebrow {+ display: block;+ color: var(--backend-stroke);+ font-size: 0.48rem;+ font-weight: 800;+ letter-spacing: 0.15em;+ text-transform: uppercase;+ }+ .route-probe-title {+ display: block;+ margin-top: 0.14rem;+ overflow: hidden;+ color: var(--toolbar-text);+ font-size: 0.72rem;+ line-height: 1.25;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .route-probe-actions { display: flex; gap: 0.2rem; }+ .route-probe button {+ min-height: 1.55rem;+ padding: 0.25rem 0.42rem;+ border: 0;+ border-radius: 0.36rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ cursor: pointer;+ }+ .route-probe button:hover,+ .route-probe button:focus-visible { background: var(--toolbar-hover); }+ .route-probe button:focus-visible {+ outline: 2px solid var(--backend-stroke);+ outline-offset: 1px;+ }+ .route-probe-copy-link { color: var(--frontend-stroke) !important; }+ .route-probe-find { color: var(--backend-stroke) !important; }+ .route-probe-copy-link[hidden] { display: none; }+ .route-probe-find[hidden] { display: none; }+ .route-probe-path {+ display: flex;+ align-items: center;+ min-height: 2.2rem;+ padding: 0.42rem 0.58rem 0.24rem;+ overflow-x: auto;+ scrollbar-width: thin;+ white-space: nowrap;+ }+ .route-probe-node,+ .route-probe button.route-probe-node {+ flex: none;+ max-width: 9.5rem;+ overflow: hidden;+ min-height: 1.75rem !important;+ padding: 0.22rem 0.38rem;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 46%, var(--toolbar-border));+ border-radius: 999px;+ background: color-mix(in srgb, var(--backend-fill) 52%, transparent);+ color: var(--text);+ font-size: 0.56rem;+ font-weight: 700;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .route-probe-node[data-endpoint="start"] {+ border-color: var(--frontend-stroke);+ color: var(--frontend-stroke);+ }+ .route-probe-node[data-endpoint="end"] {+ border-color: var(--security-stroke);+ color: var(--security-stroke);+ }+ .route-probe-node[data-route-journey-state="past"] { opacity: 0.66; }+ .route-probe-node[data-route-journey-state="future"] { opacity: 0.48; }+ .route-probe-node[aria-current="step"] {+ border-color: var(--backend-stroke);+ background: color-mix(in srgb, var(--backend-fill) 82%, var(--toolbar-menu-bg));+ color: var(--text);+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--backend-stroke) 42%, transparent), 0 0 14px color-mix(in srgb, var(--backend-stroke) 34%, transparent);+ opacity: 1;+ }+ html[data-preset="blueprint"] .route-probe-node[aria-current="step"] {+ border-style: double;+ border-width: 3px;+ border-radius: 0.2rem;+ box-shadow: none;+ }+ .route-probe-arrow {+ flex: none;+ padding: 0 0.28rem;+ color: var(--text-faint);+ font-size: 0.65rem;+ }+ .route-probe-placeholder {+ color: var(--text-faint);+ font-size: 0.56rem;+ letter-spacing: 0.03em;+ }+ .route-probe-status {+ display: block;+ min-height: 1.45rem;+ padding: 0.08rem 0.58rem 0.44rem;+ color: var(--text-faint);+ font-size: 0.52rem;+ line-height: 1.35;+ }+ .route-journey-controls {+ display: grid;+ grid-template-columns: 2rem minmax(5.8rem, auto) 2rem minmax(4.8rem, auto);+ justify-content: start;+ gap: 0.22rem;+ padding: 0.08rem 0.58rem 0.28rem;+ }+ .route-journey-controls[hidden] { display: none; }+ .route-journey-controls button {+ min-height: 1.8rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--toolbar-bg) 72%, transparent);+ font-size: 0.54rem;+ font-weight: 700;+ }+ .route-journey-controls button:disabled {+ cursor: default;+ opacity: 0.34;+ }+ .route-journey-play { color: var(--backend-stroke) !important; }+ .route-journey-overview { color: var(--frontend-stroke) !important; }+ .route-journey-controls[data-playing="true"] .route-journey-play {+ border-color: color-mix(in srgb, var(--backend-stroke) 64%, var(--toolbar-border));+ background: color-mix(in srgb, var(--backend-fill) 62%, transparent);+ }+ .route-probe[data-state="error"] {+ border-color: color-mix(in srgb, var(--security-stroke) 72%, var(--toolbar-border));+ }+ .route-probe[data-state="error"] .route-probe-status { color: var(--security-stroke); }++ .focus-chip {+ position: absolute;+ left: 1rem;+ top: 1rem;+ z-index: 12;+ display: block;+ width: min(22rem, calc(100% - 13rem));+ max-width: calc(100% - 13rem);+ overflow: hidden;+ border: 1px solid var(--frontend-stroke);+ border-radius: 0.85rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.6875rem;+ }+ .focus-chip[hidden] { display: none; }+ html[data-preset="blueprint"] .focus-chip { border-radius: 0.3rem; }+ .focus-chip button {+ flex: none;+ padding: 0.3rem 0.45rem;+ border-radius: 0.35rem;+ font-size: 0.625rem;+ }+ .relationship-lens-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.75rem;+ padding: 0.7rem 0.75rem 0.65rem;+ border-bottom: 1px solid var(--toolbar-border);+ background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);+ }+ .relationship-lens-copy { min-width: 0; }+ .relationship-lens-actions {+ display: flex;+ flex-direction: column;+ align-items: flex-end;+ gap: 0.18rem;+ }+ .relationship-lens-actions button { white-space: nowrap; }+ .relationship-lens-actions #btn-focus-clear {+ display: grid;+ width: 1.75rem;+ height: 1.75rem;+ padding: 0;+ place-items: center;+ color: var(--text-muted);+ font-size: 1rem;+ line-height: 1;+ }+ .relationship-lens-actions #btn-focus-clear:hover,+ .relationship-lens-actions #btn-focus-clear:focus-visible {+ background: var(--toolbar-hover);+ color: var(--text);+ }+ .relationship-lens-actions #btn-focus-copy { color: var(--frontend-stroke); }+ .relationship-lens-actions #btn-focus-relations { display: none; }+ .relationship-lens-eyebrow {+ display: block;+ margin-bottom: 0.18rem;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.14em;+ text-transform: uppercase;+ }+ .relationship-lens-title {+ display: block;+ overflow: hidden;+ color: var(--text);+ font-size: 0.8rem;+ line-height: 1.35;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-detail {+ display: block;+ margin-top: 0.12rem;+ overflow: hidden;+ color: var(--text-muted);+ font-size: 0.625rem;+ line-height: 1.4;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-detail[hidden] { display: none; }+ .semantic-passport-meta {+ display: flex;+ flex-wrap: wrap;+ gap: 0.24rem;+ margin-top: 0.42rem;+ }+ .semantic-passport-meta span,+ .semantic-passport-meta code {+ max-width: 100%;+ overflow: hidden;+ padding: 0.14rem 0.34rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 82%, transparent);+ border-radius: 999px;+ background: color-mix(in srgb, var(--panel) 68%, transparent);+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5rem;+ letter-spacing: 0.04em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-meta [data-passport="kind"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 50%, var(--toolbar-border));+ color: var(--frontend-stroke);+ font-weight: 800;+ text-transform: uppercase;+ }+ .semantic-passport-meta [data-passport="tag"] { color: var(--cloud-stroke); }+ .semantic-passport-meta [data-passport="brand"] {+ border-color: color-mix(in srgb, var(--messagebus-stroke) 52%, var(--toolbar-border));+ color: var(--messagebus-stroke);+ font-weight: 700;+ }+ .semantic-passport-meta [hidden] { display: none; }+ html[data-preset="blueprint"] .semantic-passport-meta span,+ html[data-preset="blueprint"] .semantic-passport-meta code { border-radius: 0.1rem; }+ .semantic-passport-evidence {+ margin-top: 0.52rem;+ padding: 0.5rem;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 32%, var(--toolbar-border));+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--backend-fill) 18%, var(--panel));+ }+ .semantic-passport-evidence[hidden] { display: none; }+ html[data-preset="blueprint"] .semantic-passport-evidence { border-radius: 0.18rem; }+ .semantic-passport-evidence-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.55rem;+ margin-bottom: 0.35rem;+ }+ .semantic-passport-evidence-status {+ display: inline-flex;+ align-items: center;+ gap: 0.28rem;+ color: var(--backend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .semantic-passport-evidence-status::before {+ content: '';+ width: 0.38rem;+ height: 0.38rem;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--backend-stroke) 14%, transparent);+ }+ .semantic-passport-repository {+ min-width: 0;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ text-decoration: none;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-repository:hover,+ .semantic-passport-repository:focus-visible { color: var(--backend-stroke); }+ .semantic-passport-evidence-links { display: grid; gap: 0.22rem; }+ .semantic-passport-source {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.15rem 0.45rem;+ align-items: center;+ padding: 0.34rem 0.4rem;+ border: 1px solid transparent;+ border-radius: 0.38rem;+ color: var(--text-muted);+ text-decoration: none;+ }+ a.semantic-passport-source:hover,+ a.semantic-passport-source:focus-visible {+ border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);+ background: color-mix(in srgb, var(--backend-fill) 32%, transparent);+ color: var(--text);+ }+ .semantic-passport-source strong {+ overflow: hidden;+ font-size: 0.5625rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-source code {+ color: var(--backend-stroke);+ font: inherit;+ font-size: 0.5rem;+ }+ .semantic-passport-source small {+ grid-column: 1 / -1;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-summary {+ display: block;+ margin-top: 0.12rem;+ color: var(--text-faint);+ font-size: 0.5625rem;+ }+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }+ .relationship-lens-list {+ max-height: min(18rem, 46vh);+ overflow: auto;+ padding: 0.4rem;+ scrollbar-width: thin;+ scrollbar-color: var(--frontend-stroke) transparent;+ }+ .relationship-lens-list::-webkit-scrollbar { width: 4px; }+ .relationship-lens-list::-webkit-scrollbar-thumb {+ border-radius: 999px;+ background: color-mix(in srgb, var(--frontend-stroke) 68%, transparent);+ }+ .relationship-lens-group + .relationship-lens-group { margin-top: 0.35rem; }+ .relationship-lens-group-title {+ display: block;+ padding: 0.24rem 0.38rem 0.16rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ }+ .relationship-lens-row {+ display: grid;+ grid-template-columns: 2.1rem minmax(0, 1fr);+ gap: 0.06rem 0.45rem;+ width: 100%;+ padding: 0.45rem 0.5rem !important;+ text-align: left;+ }+ .relationship-lens-row:hover,+ .relationship-lens-row:focus-visible,+ .relationship-lens-row[data-preview-active="true"] {+ background: var(--toolbar-hover);+ box-shadow: inset 2px 0 0 var(--frontend-stroke);+ }+ .relationship-lens-row:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: -2px;+ }+ .relationship-lens-direction {+ grid-row: 1 / 3;+ align-self: center;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ }+ .relationship-lens-row[data-direction="in"] .relationship-lens-direction { color: var(--database-stroke); }+ .relationship-lens-row[data-direction="loop"] .relationship-lens-direction { color: var(--security-stroke); }+ .relationship-lens-row strong {+ overflow: hidden;+ color: var(--text);+ font-size: 0.6875rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-row small {+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5625rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-empty {+ margin: 0;+ padding: 0.75rem;+ color: var(--text-faint);+ font-size: 0.625rem;+ text-align: center;+ }++ /* Diagram Guide keeps the artifact's growing reader vocabulary+ discoverable without widening the permanent control bar. It derives+ honest counts at runtime and delegates every action to an existing+ production interaction instead of creating a second command system. */+ .diagram-guide {+ position: absolute;+ top: 1rem;+ right: 1rem;+ z-index: 26;+ width: min(32rem, calc(100% - 2rem));+ max-height: min(42rem, calc(100% - 2rem));+ overflow: auto;+ border: 1px solid color-mix(in srgb, var(--cloud-stroke) 58%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(135deg, color-mix(in srgb, var(--cloud-fill) 32%, transparent), transparent 42%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);+ backdrop-filter: blur(18px);+ animation: archify-guide-in 180ms cubic-bezier(0.22, 1, 0.36, 1);+ }+ .diagram-guide[hidden] { display: none; }+ html[data-preset="blueprint"] .diagram-guide { border-radius: 0.28rem; }+ .diagram-guide-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 1rem;+ padding: 0.82rem 0.9rem 0.68rem;+ border-bottom: 1px solid var(--toolbar-border);+ }+ .diagram-guide-eyebrow {+ display: block;+ color: var(--cloud-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.16em;+ text-transform: uppercase;+ }+ .diagram-guide-title {+ display: block;+ margin-top: 0.16rem;+ color: var(--text);+ font-size: 0.86rem;+ letter-spacing: -0.02em;+ }+ .diagram-guide-close {+ width: 1.8rem;+ height: 1.8rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .diagram-guide-close:hover,+ .diagram-guide-close:focus-visible { background: var(--toolbar-hover); }+ .diagram-guide-stats {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ margin: 0;+ padding: 0.54rem 0.9rem;+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);+ color: var(--text-faint);+ font-size: 0.56rem;+ letter-spacing: 0.025em;+ }+ .diagram-guide-stats::before {+ content: '';+ width: 0.42rem;+ height: 0.42rem;+ flex: none;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 10px color-mix(in srgb, var(--backend-stroke) 72%, transparent);+ }+ .diagram-guide-actions {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 0.38rem;+ padding: 0.62rem;+ }+ .diagram-guide-action {+ --guide-accent: var(--frontend-stroke);+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.55rem;+ min-height: 4.15rem;+ padding: 0.55rem 0.58rem;+ border: 1px solid color-mix(in srgb, var(--guide-accent) 22%, var(--toolbar-border));+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 78%, transparent);+ color: var(--toolbar-text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;+ }+ .diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }+ .diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }+ .diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }+ .diagram-guide-action[data-guide-action="story"] { --guide-accent: var(--security-stroke); }+ .diagram-guide-action[data-guide-action="present"] {+ --guide-accent: var(--cloud-stroke);+ }+ .diagram-guide-action:hover,+ .diagram-guide-action:focus-visible {+ border-color: color-mix(in srgb, var(--guide-accent) 76%, var(--toolbar-border));+ background: color-mix(in srgb, var(--guide-accent) 9%, var(--panel));+ transform: translateY(-1px);+ }+ .diagram-guide-action:focus-visible,+ .diagram-guide-close:focus-visible {+ outline: 2px solid var(--cloud-stroke);+ outline-offset: 1px;+ }+ .diagram-guide-action:disabled {+ opacity: 0.42;+ cursor: default;+ transform: none;+ }+ .diagram-guide-index {+ display: grid;+ place-items: center;+ width: 1.65rem;+ height: 1.65rem;+ border: 1px solid color-mix(in srgb, var(--guide-accent) 64%, var(--toolbar-border));+ border-radius: 0.35rem;+ color: var(--guide-accent);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.06em;+ }+ .diagram-guide-action-copy { min-width: 0; }+ .diagram-guide-action strong {+ display: block;+ overflow: hidden;+ color: var(--text);+ font-size: 0.66rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .diagram-guide-action small {+ display: -webkit-box;+ margin-top: 0.18rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ line-height: 1.35;+ -webkit-box-orient: vertical;+ -webkit-line-clamp: 2;+ }+ .diagram-guide kbd {+ align-self: start;+ min-width: 1.45rem;+ padding: 0.12rem 0.3rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.25rem;+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5rem;+ text-align: center;+ }+ .diagram-guide-shortcuts {+ display: flex;+ flex-wrap: wrap;+ gap: 0.34rem 0.62rem;+ padding: 0.58rem 0.9rem 0.68rem;+ border-top: 1px solid var(--toolbar-border);+ color: var(--text-faint);+ font-size: 0.5rem;+ }+ .diagram-guide-shortcuts span {+ display: inline-flex;+ align-items: center;+ gap: 0.28rem;+ white-space: nowrap;+ }+ .diagram-guide-feedback {+ min-height: 1rem;+ margin: -0.18rem 0.9rem 0.62rem;+ color: var(--security-stroke);+ font-size: 0.5rem;+ }+ .diagram-guide-feedback:empty { display: none; }+ @keyframes archify-guide-in {+ from { opacity: 0; transform: translateY(-5px) scale(0.985); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }++ .node-finder {+ position: absolute;+ top: 1rem;+ left: 1rem;+ z-index: 24;+ display: flex;+ flex-direction: column;+ width: min(22rem, calc(100% - 2rem));+ max-height: calc(100% - 2rem);+ overflow: hidden;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.85rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);+ backdrop-filter: blur(16px);+ }+ .node-finder[hidden] { display: none; }+ .node-finder[data-context="route-source"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 68%, var(--toolbar-border));+ }+ .node-finder[data-context="route-target"] {+ border-color: color-mix(in srgb, var(--security-stroke) 68%, var(--toolbar-border));+ }+ html[data-preset="blueprint"] .node-finder { border-radius: 0.3rem; }+ .node-finder-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.7rem 0.8rem 0.45rem;+ }+ .node-finder-head strong {+ color: var(--text);+ font-size: 0.6875rem;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .node-finder[data-context="route-source"] .node-finder-head strong { color: var(--frontend-stroke); }+ .node-finder[data-context="route-target"] .node-finder-head strong { color: var(--security-stroke); }+ .node-finder-close {+ width: 1.75rem;+ height: 1.75rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .node-finder-close:hover,+ .node-finder-close:focus-visible { background: var(--toolbar-hover); }+ .node-finder-close:focus-visible,+ .node-finder-result:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: -2px;+ }+ .node-finder-search {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.55rem;+ margin: 0 0.55rem 0.55rem;+ padding: 0 0.7rem;+ min-height: 2.6rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 78%, transparent);+ transition: border-color 160ms ease-out, box-shadow 160ms ease-out;+ }+ html[data-preset="blueprint"] .node-finder-search { border-radius: 0.18rem; }+ .node-finder-search > span { color: var(--frontend-stroke); font-size: 0.875rem; }+ .node-finder-search:focus-within {+ border-color: var(--frontend-stroke);+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--frontend-stroke) 20%, transparent);+ }+ .node-finder-input {+ appearance: none;+ width: 100%;+ min-width: 0;+ border: 0;+ outline: 0;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: 0.75rem;+ }+ .node-finder-input:focus-visible { outline: none; }+ .node-finder-input::placeholder { color: var(--text-faint); }+ .node-finder kbd {+ padding: 0.1rem 0.32rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.25rem;+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5625rem;+ }+ .node-finder-results {+ display: grid;+ flex: 1 1 auto;+ gap: 0;+ min-height: 0;+ max-height: min(18rem, 48vh);+ margin: 0 0.55rem 0.45rem;+ padding: 0;+ overflow-y: auto;+ overscroll-behavior: contain;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 78%, transparent);+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 54%, transparent);+ scroll-padding-block: 0.25rem;+ scrollbar-width: thin;+ }+ html[data-preset="blueprint"] .node-finder-results { border-radius: 0.18rem; }+ .node-finder-result {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.2rem 0.75rem;+ width: 100%;+ min-height: 3.25rem;+ padding: 0.58rem 0.65rem;+ border: 0;+ border-radius: 0;+ background: transparent;+ color: var(--text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: background-color 160ms ease-out;+ }+ .node-finder-result:not(:last-child) {+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 62%, transparent);+ }+ .node-finder-result:hover,+ .node-finder-result:focus-visible {+ position: relative;+ z-index: 1;+ background: color-mix(in srgb, var(--frontend-fill) 48%, var(--toolbar-hover));+ }+ .node-finder-result strong {+ overflow: hidden;+ font-size: 0.75rem;+ line-height: 1.25;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .node-finder-result small {+ grid-column: 1 / -1;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5625rem;+ letter-spacing: 0.015em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .node-finder-result em {+ align-self: center;+ color: var(--frontend-stroke);+ font-size: 0.625rem;+ font-style: normal;+ }+ .node-finder[data-context^="route-"] .node-finder-result em {+ padding: 0.1rem 0.3rem;+ border: 1px solid color-mix(in srgb, currentColor 52%, transparent);+ border-radius: 999px;+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.05em;+ text-transform: uppercase;+ }+ .node-finder[data-context="route-target"] .node-finder-result em { color: var(--security-stroke); }+ .node-finder-empty {+ padding: 1.1rem 0.75rem 1.25rem;+ color: var(--text-faint);+ font-size: 0.6875rem;+ text-align: center;+ }+ .node-finder-status {+ margin: 0;+ padding: 0.1rem 0.8rem 0.65rem;+ color: var(--text-faint);+ font-size: 0.5625rem;+ }++ .guided-views {+ display: grid;+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem auto;+ align-items: stretch;+ gap: 0.35rem;+ min-width: 0;+ margin: 0 0 0.75rem;+ padding: 0.35rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.85rem;+ background: var(--toolbar-bg);+ background: linear-gradient(120deg, var(--toolbar-bg), color-mix(in srgb, var(--toolbar-bg) 82%, var(--frontend-fill)));+ box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);+ backdrop-filter: blur(12px);+ }+ .guided-views[hidden] { display: none; }++ html[data-preset="blueprint"] .guided-views {+ border-color: var(--panel-border);+ border-radius: 0.35rem;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 36%, transparent), transparent 24%),+ var(--toolbar-bg);+ box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);+ }+ html[data-preset="blueprint"] .guided-views button { border-radius: 0.2rem; }+ html[data-preset="blueprint"] .guided-view-progress { border-radius: 0; }+ html[data-preset="blueprint"] .guided-view-progress span { border-radius: 0; }+ .guided-views button {+ min-width: 0;+ padding: 0.45rem 0.6rem;+ border-radius: 0.55rem;+ font-size: 0.75rem;+ }+ .guided-views > #guided-view-prev,+ .guided-views > #guided-view-next { min-width: 2.75rem; min-height: 2.75rem; }+ .guided-views button:disabled { opacity: 0.3; cursor: default; }+ .guided-view-copy {+ min-width: 0;+ padding: 0.2rem 0.5rem;+ border-left: 1px solid var(--toolbar-border);+ overflow: hidden;+ }+ .guided-view-meta {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ min-height: 1rem;+ margin-bottom: 0.12rem;+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 700;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ }+ .guided-view-handoff {+ box-sizing: border-box;+ height: 1rem;+ min-width: 0;+ max-width: 15rem;+ overflow: hidden;+ padding: 0 0.38rem;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 46%, transparent);+ border-radius: 999px;+ color: var(--toolbar-text);+ background: color-mix(in srgb, var(--frontend-fill) 44%, transparent);+ font-size: 0.5rem;+ line-height: calc(1rem - 2px);+ letter-spacing: 0.06em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-view-handoff[hidden] { display: none; }+ html[data-preset="blueprint"] .guided-view-handoff { border-radius: 0.15rem; }+ .chapter-handoff-overlay { pointer-events: none; }+ .chapter-handoff-anchor {+ fill: color-mix(in srgb, var(--frontend-fill) 10%, transparent);+ stroke: var(--frontend-stroke);+ stroke-width: 2;+ stroke-dasharray: 4 4;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ animation: archify-chapter-anchor 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="stay"] { opacity: 1; }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="enter"] { opacity: 0.78; }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="leave"] { opacity: 0.26; }+ @keyframes archify-chapter-anchor {+ 0% { opacity: 0.35; stroke-dashoffset: 8; }+ 45% { opacity: 1; }+ 100% { opacity: 0.72; stroke-dashoffset: 0; }+ }+ .guided-view-progress {+ width: 3.5rem;+ height: 2px;+ overflow: hidden;+ border-radius: 999px;+ background: var(--toolbar-border);+ }+ .guided-view-progress span {+ display: block;+ width: 100%;+ height: 100%;+ border-radius: inherit;+ background: var(--frontend-stroke);+ transform: scaleX(0);+ transform-origin: left center;+ }+ .guided-view-copy strong,+ .guided-view-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .guided-view-copy strong { color: var(--toolbar-text); font-size: 0.75rem; line-height: 1.35; }+ .guided-view-copy small { margin-top: 0; color: var(--text-muted); font-size: 0.625rem; line-height: 1.35; }+ .guided-story-caption {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ gap: 0.12rem 0.55rem;+ align-items: center;+ min-width: 0;+ margin-top: 0.18rem;+ padding: 0.3rem 0.5rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 32%, var(--toolbar-border));+ border-radius: 0.58rem;+ background: color-mix(in srgb, var(--frontend-fill) 26%, transparent);+ animation: archify-story-caption-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ .guided-story-caption[hidden] { display: none; }+ .guided-story-caption-index {+ grid-row: 1 / span 2;+ align-self: stretch;+ display: inline-grid;+ min-width: 3.3rem;+ place-items: center;+ padding-right: 0.52rem;+ border-right: 1px solid color-mix(in srgb, var(--frontend-stroke) 28%, var(--toolbar-border));+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .guided-story-caption strong,+ .guided-story-caption small {+ display: block;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-story-caption strong { color: var(--toolbar-text); font-size: 0.6875rem; line-height: 1.3; }+ .guided-story-caption small { color: var(--text-muted); font-size: 0.5625rem; line-height: 1.35; }+ .guided-story-caption-next {+ grid-column: 3;+ grid-row: 1 / span 2;+ display: grid;+ min-width: 6.4rem;+ max-width: 9.5rem;+ align-self: stretch;+ align-content: center;+ padding-left: 0.58rem;+ border-left: 1px solid color-mix(in srgb, var(--frontend-stroke) 22%, var(--toolbar-border));+ }+ .guided-story-caption-next[hidden] { display: none; }+ .guided-story-caption-next small {+ color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--text-muted));+ font-weight: 800;+ letter-spacing: 0.09em;+ text-transform: uppercase;+ }+ .guided-story-caption-next strong { color: var(--text-muted); font-weight: 700; }+ html[data-preset="blueprint"] .guided-story-caption { border-radius: 0.2rem; }+ .guided-views[data-story-beat] .guided-view-copy > #guided-view-label,+ .guided-views[data-story-beat] .guided-view-copy > #guided-view-note { display: none; }+ @keyframes archify-story-caption-in {+ from { opacity: 0; transform: translateY(3px); }+ to { opacity: 1; transform: translateY(0); }+ }+ .guided-view-trail {+ display: flex;+ align-items: center;+ gap: 0.28rem;+ min-width: 0;+ min-height: 1.7rem;+ margin-top: 0;+ padding: 0;+ overflow-x: auto;+ color: var(--text-faint);+ overscroll-behavior-x: contain;+ touch-action: pan-x;+ scrollbar-width: none;+ white-space: nowrap;+ }+ .guided-view-trail[hidden] { display: none; }+ .guided-view-trail::-webkit-scrollbar { display: none; }+ .guided-view-trail .guided-view-stop {+ appearance: none;+ box-sizing: border-box;+ display: inline-flex;+ flex: 0 0 auto;+ align-items: center;+ gap: 0.28rem;+ min-height: 1.5rem;+ padding: 0.1rem 0.3rem 0.1rem 0.18rem;+ border: 1px solid transparent;+ border-radius: 999px;+ background: transparent;+ color: var(--text-muted);+ cursor: pointer;+ font-family: inherit;+ font-size: 0.5625rem;+ font-weight: 650;+ letter-spacing: 0.02em;+ line-height: 1;+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;+ }+ .guided-view-stop:hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);+ background: color-mix(in srgb, var(--frontend-fill) 34%, transparent);+ }+ .guided-view-stop:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .guided-view-stop:disabled { cursor: wait; }+ .guided-view-stop::before {+ display: inline-grid;+ width: 1rem;+ height: 1rem;+ place-items: center;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));+ border-radius: 50%;+ background: color-mix(in srgb, var(--frontend-fill) 58%, var(--toolbar-bg));+ color: var(--frontend-stroke);+ content: attr(data-story-number);+ font-size: 0.5rem;+ line-height: 1;+ }+ .guided-view-stop + .guided-view-stop::after {+ order: -1;+ color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--text-faint));+ content: '\00b7';+ font-size: 0.65rem;+ }+ .guided-view-stop[data-story-link="forward"]::after { content: '\2192'; }+ .guided-view-stop[data-story-link="reverse"]::after { content: '\2190'; }+ .guided-view-stop[data-story-link="multiple"]::after { content: '\21c4'; }+ .guided-view-stop[data-story-beat-state="pending"] { opacity: 0.38; }+ .guided-view-stop[data-story-beat-state="next"] {+ border-style: dashed;+ border-color: color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));+ color: color-mix(in srgb, var(--toolbar-text) 68%, var(--text-muted));+ opacity: 0.58;+ }+ .guided-view-stop[data-story-beat-state="past"] { color: var(--text-muted); opacity: 0.76; }+ .guided-view-stop[data-story-beat-state="active"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--frontend-fill) 42%, transparent);+ color: var(--toolbar-text);+ font-weight: 800;+ opacity: 1;+ }+ .guided-view-stop[data-story-beat-state="active"]::before {+ border-color: var(--frontend-stroke);+ box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 54%, transparent);+ }+ html[data-preset="blueprint"] .guided-view-stop,+ html[data-preset="blueprint"] .guided-view-stop::before { border-radius: 0.1rem; }+ html[data-preset="blueprint"] .guided-view-stop[data-story-beat-state="active"]::before { box-shadow: none; }+ .guided-view-actions { display: flex; align-items: stretch; gap: 0.2rem; }+ .guided-view-actions button { white-space: nowrap; }+ .guided-view-play {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.38rem;+ min-width: 6.25rem !important;+ color: var(--frontend-stroke) !important;+ font-size: 0.625rem !important;+ }+ .guided-view-play[aria-pressed="true"] { background: var(--toolbar-hover); }+ .guided-view-all { min-width: 3.25rem !important; color: var(--text-muted) !important; font-size: 0.625rem !important; }+ .guided-view-beat-link {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.3rem;+ min-width: 5.4rem !important;+ min-height: 1.5rem;+ color: var(--text-muted) !important;+ font-size: 0.5625rem !important;+ letter-spacing: 0.025em;+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease;+ }+ .guided-view-beat-link:not(:disabled):hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));+ color: var(--frontend-stroke) !important;+ }+ .guided-view-beat-link[data-copy-state="copied"] {+ border-color: color-mix(in srgb, var(--backend-stroke) 58%, var(--toolbar-border));+ background: color-mix(in srgb, var(--backend-fill) 46%, transparent);+ color: var(--backend-stroke) !important;+ }+ .guided-view-index {+ grid-column: 1 / -1;+ min-width: 0;+ padding: 0.28rem 0.12rem 0.08rem;+ overflow: hidden;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ @media (min-width: 721px) {+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-index,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-beat-link,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-all,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-trail,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-label,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-note { display: none; }+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-story-caption { margin-top: 0.08rem; }+ }+ .guided-view-chapters {+ display: flex;+ gap: 0.28rem;+ min-width: 0;+ margin: 0;+ padding: 0.08rem 0.05rem 0.2rem;+ overflow-x: auto;+ list-style: none;+ scroll-padding-inline: 0.05rem;+ scroll-snap-type: x proximity;+ scrollbar-width: none;+ }+ .guided-view-chapters::-webkit-scrollbar { display: none; }+ .guided-view-chapters li {+ display: flex;+ flex: 1 1 0;+ min-width: 9.5rem;+ scroll-snap-align: center;+ }+ .guided-view-chapter {+ position: relative;+ display: grid !important;+ grid-template-columns: 1.55rem minmax(0, 1fr) auto;+ align-items: center;+ width: 100%;+ min-height: 2.75rem;+ padding: 0.36rem 0.48rem !important;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent) !important;+ border-radius: 0.48rem !important;+ background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent) !important;+ color: var(--text-muted) !important;+ text-align: left;+ transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;+ }+ .guided-view-chapter:hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--toolbar-border)) !important;+ background: color-mix(in srgb, var(--frontend-fill) 42%, var(--toolbar-bg)) !important;+ }+ .guided-view-chapter:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .guided-view-chapter-index {+ display: inline-grid;+ width: 1.32rem;+ height: 1.32rem;+ place-items: center;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));+ border-radius: 50%;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.03em;+ }+ .guided-view-chapter-title {+ min-width: 0;+ overflow: hidden;+ color: var(--toolbar-text);+ font-size: 0.625rem;+ font-weight: 700;+ line-height: 1.3;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-view-chapter-count {+ grid-column: 3;+ grid-row: 1;+ margin-left: 0.38rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-style: normal;+ font-weight: 650;+ white-space: nowrap;+ }+ .guided-view-chapter-delta {+ display: inline-flex;+ grid-column: 3;+ grid-row: 1;+ align-items: center;+ gap: 0.22rem;+ margin-left: 0.38rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 750;+ letter-spacing: 0.01em;+ white-space: nowrap;+ }+ .guided-view-chapter-delta[hidden] { display: none; }+ .guided-view-chapter-delta [data-delta-kind="stay"] { color: var(--text-muted); }+ .guided-view-chapter-delta [data-delta-kind="enter"] { color: var(--frontend-stroke); }+ .guided-view-chapter-delta [data-delta-kind="leave"] { color: var(--security-stroke); }+ .guided-view-chapter[data-preview-active="true"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border)) !important;+ background: color-mix(in srgb, var(--frontend-fill) 54%, var(--toolbar-bg)) !important;+ }+ .guided-view-chapter[data-chapter-position="current"] {+ border: 2px solid var(--frontend-stroke) !important;+ padding: calc(0.36rem - 1px) calc(0.48rem - 1px) !important;+ box-shadow: inset 3px 0 0 var(--frontend-stroke);+ color: var(--toolbar-text) !important;+ }+ .guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index {+ background: var(--frontend-stroke);+ color: var(--bg);+ }+ .guided-view-chapter[data-chapter-position="before"] {+ border-style: solid !important;+ opacity: 0.72;+ }+ .guided-view-chapter[data-chapter-position="after"] { border-style: dashed !important; }+ html[data-preset="signal-flow"] .guided-view-chapter[data-chapter-position="current"] {+ box-shadow: inset 3px 0 0 var(--frontend-stroke), 0 0 18px color-mix(in srgb, var(--frontend-stroke) 18%, transparent);+ }+ html[data-preset="blueprint"] .guided-view-chapter,+ html[data-preset="blueprint"] .guided-view-chapter-index { border-radius: 0.12rem !important; }++ /* Story Shelf — keep every authored chapter and the Play action visible,+ but do not spend a second row on unavailable director controls before+ the reader enters a chapter. Existing data-active-view state expands+ the full guided surface without a new toggle or stored preference. */+ .guided-views[data-active-view="all"] {+ grid-template-columns: minmax(11rem, .72fr) auto minmax(0, 2fr);+ align-items: center;+ padding: 0.28rem 0.35rem;+ }+ .guided-views[data-active-view="all"] > #guided-view-prev,+ .guided-views[data-active-view="all"] > #guided-view-next,+ .guided-views[data-active-view="all"] .guided-view-beat-link,+ .guided-views[data-active-view="all"] .guided-view-all { display: none; }+ .guided-views[data-active-view="all"] .guided-view-copy {+ grid-column: 1;+ grid-row: 1;+ padding: 0.1rem 0.55rem;+ }+ .guided-views[data-active-view="all"] .guided-view-copy > #guided-view-note { display: none; }+ .guided-views[data-active-view="all"] .guided-view-actions {+ display: block;+ grid-column: 2;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-play { min-height: 2.75rem; }+ .guided-views[data-active-view="all"] .guided-view-index {+ grid-column: 3;+ grid-row: 1;+ padding: 0 0.08rem 0 0.42rem;+ border-top: 0;+ border-left: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ .guided-views[data-active-view="all"] .guided-view-chapters {+ gap: 0.3rem;+ padding: 0;+ }++ .cards {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));+ gap: 1rem;+ margin-top: 2rem;+ }++ .card {+ background: var(--panel);+ border-radius: 0.75rem;+ border: 1px solid var(--panel-border);+ padding: 1.25rem;+ }++ html[data-preset="signal-flow"] .card {+ background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);+ }+ html[data-preset="signal-flow"][data-theme="light"] .card {+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);+ }++ /* Preserve the one-screen guarantee on ordinary laptop displays. The+ high-screen expansion above must not trade a fuller canvas for page+ scrolling at 900–1080px heights. */+ @media (min-width: 768px) and (max-height: 1100px) {+ .header { margin-bottom: 1rem; }+ .diagram-container {+ padding: 0.875rem;+ padding-bottom: calc(0.875rem + var(--archify-nav-reserve));+ }+ .cards { margin-top: 1rem; }+ .card { padding: 1rem; }+ }+ @media (min-width: 768px) and (max-height: 920px) {+ body { padding-block: 1.25rem; }+ .header { margin-bottom: 0.875rem; }+ .cards { margin-top: 0.75rem; }+ html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }+ html[data-nav-stage-rail="true"] .header { margin-bottom: 0.5rem; }+ html[data-nav-stage-rail="true"] .guided-views { margin-bottom: 0.375rem; }+ html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }+ html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }+ }++ html[data-preset="blueprint"] .card {+ position: relative;+ border-color: var(--panel-border);+ border-radius: 0.3rem;+ background: var(--panel);+ box-shadow: none;+ }+ html[data-preset="blueprint"] .card::before {+ content: "";+ position: absolute;+ top: -1px;+ left: 1rem;+ width: 2.5rem;+ border-top: 2px solid var(--frontend-stroke);+ }++ html[data-preset="editorial"] .card {+ position: relative;+ border-radius: 0.28rem;+ background: var(--panel);+ box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);+ }+ html[data-preset="editorial"] .card::before {+ position: absolute;+ top: -1px;+ left: 1.25rem;+ width: 3.25rem;+ border-top: 3px solid var(--arrow-emphasis);+ content: "";+ }+ html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }++ .card-header {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ margin-bottom: 0.75rem;+ }++ .card-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ }++ .card-dot.cyan { background: var(--frontend-stroke); }+ .card-dot.emerald { background: var(--backend-stroke); }+ .card-dot.violet { background: var(--database-stroke); }+ .card-dot.amber { background: var(--cloud-stroke); }+ .card-dot.rose { background: var(--security-stroke); }+ .card-dot.orange { background: var(--messagebus-stroke); }+ .card-dot.slate { background: var(--external-stroke); }++ .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }++ .card ul {+ list-style: none;+ color: var(--text-muted);+ font-size: 0.75rem;+ }++ .card li { margin-bottom: 0.375rem; }++ /* ==========================================================+ Print stylesheet — hide interactive controls, force light,+ drop the grid so the diagram doesn't waste ink, use landscape+ so wide diagrams fit, pack summary cards into 2 columns to+ avoid an orphan card on a trailing page.+ ========================================================== */+ @page { size: landscape; margin: 1.5cm; }++ @media print {+ /* Force the FULL light palette — including component fills/strokes and+ lane/arrow colors — so printing from dark theme doesn't put neon+ strokes and translucent dark fills on white paper. */+ :root, [data-theme="dark"], [data-theme="light"] {+ --bg: #ffffff;+ --grid: transparent;+ --panel: #ffffff;+ --panel-border: #e2e8f0;+ --text: #0f172a;+ --text-muted: #475569;+ --text-dim: #94a3b8;+ --text-faint: #64748b;+ --mask: #ffffff;+ --lane-fill: rgba(248, 250, 252, 0.65);+ --lane-stroke: #cbd5e1;+ --arrow: #94a3b8;+ --arrow-emphasis: #059669;+ --frontend-fill: rgba(34, 211, 238, 0.15);+ --frontend-stroke: #0891b2;+ --backend-fill: rgba(52, 211, 153, 0.18);+ --backend-stroke: #059669;+ --database-fill: rgba(167, 139, 250, 0.2);+ --database-stroke: #7c3aed;+ --cloud-fill: rgba(251, 191, 36, 0.18);+ --cloud-stroke: #d97706;+ --security-fill: rgba(251, 113, 133, 0.15);+ --security-stroke: #e11d48;+ --messagebus-fill: rgba(251, 146, 60, 0.15);+ --messagebus-stroke:#ea580c;+ --external-fill: rgba(148, 163, 184, 0.18);+ --external-stroke: #64748b;+ }+ body { background: #ffffff !important; padding: 0; }+ .container { max-width: none; }+ .toolbar, .diagram-nav, .focus-chip, .guided-views, .archify-toast, .no-print { display: none !important; }+ .chapter-handoff-overlay { display: none !important; }+ svg [data-node-id][data-chapter-role] { opacity: 1 !important; }+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] { opacity: 1 !important; filter: none !important; }+ .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }+ .diagram-container { --archify-nav-reserve: 0px !important; }+ html[data-preset="signal-flow"] .diagram-container,+ html[data-preset="signal-flow"] .card { background: #ffffff; }+ .cards { grid-template-columns: 1fr 1fr; }+ /* Ensure elements break sensibly across pages */+ .card { break-inside: avoid; page-break-inside: avoid; }+ .diagram-container { break-inside: avoid; page-break-inside: avoid; }+ .diagram-container svg [data-detail] {+ opacity: 1 !important;+ pointer-events: auto !important;+ }+ .diagram-container svg [data-detail-anchor] { transform: none !important; }+ .diagram-container svg[data-lens-active] [data-node-id],+ .diagram-container svg[data-lens-active] [data-edge-from],+ .diagram-container svg[data-legend-preview-active] [data-node-id],+ .diagram-container svg[data-legend-preview-active] [data-edge-from] {+ opacity: 1 !important;+ filter: none !important;+ }+ [data-legend-bridge-runtime] { display: none !important; }+ .semantic-lens-overlay { display: none !important; }+ .relationship-hit-overlay { display: none !important; }+ .relationship-pulse-overlay { display: none !important; }+ .route-probe-overlay, .route-journey-overlay { display: none !important; }+ .story-trail-overlay,+ .story-carrier-overlay { display: none !important; }+ .diagram-container svg[data-focus-active] [data-node-id],+ .diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],+ .diagram-container svg[data-story-beat] [data-story-step],+ .diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],+ .diagram-container svg[data-route-active] [data-node-id],+ .diagram-container svg[data-route-active] [data-edge-from] {+ opacity: 1 !important;+ filter: none !important;+ animation: none !important;+ }+ h1, .subtitle { color: #0f172a; }+ }++ /* ==========================================================+ TOOLBAR (theme toggle + export menu)+ ========================================================== */+ .toolbar {+ position: fixed;+ top: 1rem;+ right: 1rem;+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0;+ border: 0;+ background: transparent;+ box-shadow: none;+ z-index: 100;+ }+ .toolbar button {+ background: var(--toolbar-bg);+ color: var(--toolbar-text);+ border: 1px solid var(--toolbar-border);+ padding: 0.5rem 0.875rem;+ border-radius: 0.625rem;+ font-family: inherit;+ font-size: 0.75rem;+ font-weight: 500;+ cursor: pointer;+ white-space: nowrap;+ backdrop-filter: blur(10px);+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);+ transition: background 0.15s, border-color 0.15s, color 0.15s;+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ min-height: 2.75rem;+ }+ .toolbar button:hover {+ background: var(--toolbar-hover);+ border-color: color-mix(in srgb, var(--arrow) 62%, var(--toolbar-border));+ }+ .toolbar button[aria-expanded="true"],+ .toolbar button[aria-pressed="true"]:not(#btn-theme) {+ background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));+ border-color: color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));+ }+ .toolbar #btn-export {+ padding-right: 0.82rem;+ padding-left: 0.82rem;+ }+ .toolbar #btn-export:hover,+ .toolbar #btn-export[aria-expanded="true"] {+ color: var(--toolbar-text);+ background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));+ border-color: color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));+ }+ .toolbar button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 2px;+ }+ .toolbar #btn-motion[hidden] { display: none !important; }+ .toolbar #btn-motion { min-width: 4.4rem; }+ .toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }+ .toolbar .preset-wrap,+ .toolbar .export-wrap {+ position: relative;+ }+ .toolbar-icon {+ display: inline-block;+ width: 0.95rem;+ height: 0.95rem;+ flex: 0 0 auto;+ background: currentColor;+ -webkit-mask-position: center;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-size: contain;+ mask-position: center;+ mask-repeat: no-repeat;+ mask-size: contain;+ }+ .toolbar-chevron {+ width: 0.65rem;+ height: 0.65rem;+ transition: transform 0.15s ease;+ }+ [aria-expanded="true"] > .toolbar-chevron { transform: rotate(180deg); }+ [data-theme="light"] #theme-icon {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E");+ }+ [data-theme="dark"] #theme-icon {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E");+ }+ #btn-present[aria-pressed="false"] #present-icon {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ #btn-present[aria-pressed="true"] #present-icon {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");+ }+ .toolbar-chevron {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");+ }+ .toolbar #btn-preset { min-width: 5.4rem; }+ .preset-control-mark {+ width: 0.58rem;+ height: 0.58rem;+ flex: 0 0 auto;+ border: 1px solid var(--frontend-stroke);+ border-radius: 0.2rem;+ background: color-mix(in srgb, var(--frontend-stroke) 28%, transparent);+ transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s;+ }+ #btn-preset[data-preset-option="signal-flow"] .preset-control-mark {+ border-radius: 50%;+ box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 78%, transparent);+ }+ #btn-preset[data-preset-option="blueprint"] .preset-control-mark {+ border-radius: 0.06rem;+ background: transparent;+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frontend-stroke) 32%, transparent);+ transform: rotate(45deg) scale(0.84);+ }+ #btn-preset[data-preset-option="editorial"] .preset-control-mark {+ border-color: var(--arrow-emphasis);+ border-radius: 0;+ background: var(--arrow-emphasis);+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);+ transform: rotate(45deg) scale(0.72);+ }+ .toolbar .preset-menu {+ position: absolute;+ top: calc(100% + 0.375rem);+ right: 0;+ display: none;+ width: 18.5rem;+ max-width: calc(100vw - 2rem);+ padding: 0.45rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.875rem;+ background: var(--toolbar-menu-bg);+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);+ }+ .toolbar .preset-menu.open { display: block; }+ .toolbar .preset-menu.open,+ .toolbar .export-menu.open {+ animation: toolbar-menu-in 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);+ transform-origin: top right;+ }+ @keyframes toolbar-menu-in {+ from { opacity: 0; transform: translateY(-0.25rem) scale(0.985); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }+ .preset-menu-heading {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.42rem 0.6rem 0.55rem;+ color: var(--text-faint);+ font-size: 0.56rem;+ letter-spacing: 0.13em;+ text-transform: uppercase;+ }+ .preset-menu-heading span:last-child {+ font-size: 0.52rem;+ letter-spacing: 0.04em;+ text-transform: none;+ }+ .toolbar .preset-option {+ display: grid;+ grid-template-columns: 2rem minmax(0, 1fr) 1rem;+ align-items: center;+ gap: 0.68rem;+ width: 100%;+ min-height: 3.35rem;+ padding: 0.5rem 0.62rem;+ border: 0;+ border-radius: 0.5rem;+ background: transparent;+ box-shadow: none;+ backdrop-filter: none;+ text-align: left;+ }+ .toolbar .preset-option:hover,+ .toolbar .preset-option:focus-visible { background: var(--toolbar-hover); }+ .toolbar .preset-option[aria-checked="true"] {+ background: color-mix(in srgb, var(--frontend-stroke) 9%, transparent);+ border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);+ }+ .preset-option-swatch {+ position: relative;+ width: 2rem;+ height: 1.55rem;+ overflow: hidden;+ border: 1px solid #64748b;+ border-radius: 0.24rem;+ background: #0f172a;+ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);+ }+ .preset-option-swatch::before,+ .preset-option-swatch::after { position: absolute; content: ""; }+ .preset-option-swatch.classic::before {+ top: 0.42rem;+ right: 0.35rem;+ bottom: 0.42rem;+ left: 0.35rem;+ border: 1px solid #22d3ee;+ border-radius: 0.16rem;+ background: rgba(34, 211, 238, 0.14);+ }+ .preset-option-swatch.signal-flow {+ border-color: #29415f;+ background: linear-gradient(135deg, #07101e 10%, #10243c 100%);+ }+ .preset-option-swatch.signal-flow::before {+ top: 50%;+ right: 0.2rem;+ left: 0.2rem;+ height: 1px;+ background: linear-gradient(90deg, #67e8f9, #c4b5fd);+ box-shadow: 0 0 8px #67e8f9;+ }+ .preset-option-swatch.signal-flow::after {+ top: calc(50% - 0.13rem);+ right: 0.28rem;+ width: 0.26rem;+ height: 0.26rem;+ border-radius: 50%;+ background: #67e8f9;+ box-shadow: 0 0 7px #67e8f9;+ }+ .preset-option-swatch.blueprint {+ border-color: #34799a;+ border-radius: 0.08rem;+ background-color: #0a2031;+ background-image:+ linear-gradient(rgba(102, 217, 239, 0.18) 1px, transparent 1px),+ linear-gradient(90deg, rgba(102, 217, 239, 0.18) 1px, transparent 1px);+ background-size: 0.42rem 0.42rem;+ }+ .preset-option-swatch.blueprint::before {+ top: 0.34rem;+ right: 0.38rem;+ bottom: 0.34rem;+ left: 0.38rem;+ border: 1px solid #66d9ef;+ }+ .preset-option-swatch.editorial {+ border-color: #b8aa94;+ border-radius: 0.08rem;+ background: repeating-linear-gradient(0deg, #f2eee5 0 0.34rem, #d8d0c2 0.36rem, #f2eee5 0.38rem);+ }+ .preset-option-swatch.editorial::before {+ top: 0;+ bottom: 0;+ left: 0.42rem;+ width: 1px;+ background: #c9502d;+ opacity: 0.72;+ }+ .preset-option-swatch.editorial::after {+ top: 0.52rem;+ right: 0.45rem;+ width: 0.38rem;+ height: 0.38rem;+ background: #c9502d;+ transform: rotate(45deg);+ }+ .preset-option-copy { min-width: 0; }+ .preset-option-copy strong,+ .preset-option-copy small { display: block; }+ .preset-option-copy strong {+ color: var(--toolbar-text);+ font-size: 0.72rem;+ font-weight: 600;+ }+ .preset-option-copy small {+ margin-top: 0.16rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.57rem;+ font-weight: 400;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .preset-option-check {+ display: inline-block;+ width: 0.9rem;+ height: 0.9rem;+ color: var(--frontend-stroke);+ background: currentColor;+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");+ -webkit-mask-position: center;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-size: contain;+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");+ mask-position: center;+ mask-repeat: no-repeat;+ mask-size: contain;+ opacity: 0;+ }+ .preset-option[aria-checked="true"] .preset-option-check { opacity: 1; }+ html[data-preset="editorial"] .toolbar button,+ html[data-preset="editorial"] .preset-menu,+ html[data-preset="editorial"] .export-menu,+ html[data-preset="editorial"] .overview-map,+ html[data-preset="editorial"] .semantic-lens,+ html[data-preset="editorial"] .route-probe,+ html[data-preset="editorial"] .focus-chip,+ html[data-preset="editorial"] .diagram-guide,+ html[data-preset="editorial"] .node-finder,+ html[data-preset="editorial"] .guided-views,+ html[data-preset="editorial"] .share-chapter-cue {+ border-radius: 0.3rem;+ }+ .motion-control-dot {+ width: 0.46rem;+ height: 0.46rem;+ flex: 0 0 auto;+ border: 1px solid var(--frontend-stroke);+ border-radius: 50%;+ background: var(--frontend-stroke);+ box-shadow: 0 0 9px color-mix(in srgb, var(--frontend-stroke) 72%, transparent);+ }+ #btn-motion[aria-pressed="false"] .motion-control-dot {+ background: transparent;+ box-shadow: none;+ }+ .toolbar .export-menu {+ position: absolute;+ top: calc(100% + 0.375rem);+ right: 0;+ background: var(--toolbar-menu-bg);+ border: 1px solid var(--toolbar-border);+ width: 19rem;+ max-width: calc(100vw - 2rem);+ max-height: calc(100vh - 5.5rem);+ overflow-y: auto;+ border-radius: 0.875rem;+ padding: 0.55rem;+ display: none;+ flex-direction: column;+ box-shadow: 0 18px 48px rgba(0,0,0,0.24);+ }+ .toolbar .export-menu.open { display: flex; }+ .export-menu-header {+ display: flex;+ align-items: flex-start;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.5rem 0.55rem 0.72rem;+ }+ .export-menu-header strong,+ .export-menu-header span { display: block; }+ .export-menu-header strong {+ color: var(--toolbar-text);+ font-size: 0.78rem;+ font-weight: 650;+ letter-spacing: -0.015em;+ }+ .export-menu-header span {+ margin-top: 0.16rem;+ color: var(--text-faint);+ font-size: 0.56rem;+ }+ .export-menu-header kbd {+ padding: 0.16rem 0.36rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.3rem;+ color: var(--text-faint);+ background: color-mix(in srgb, var(--toolbar-border) 16%, transparent);+ font-family: inherit;+ font-size: 0.54rem;+ font-weight: 600;+ }+ .export-menu-section {+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ gap: 0.18rem;+ }+ .export-menu-section + .export-menu-section {+ margin-top: 0.42rem;+ padding-top: 0.42rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 68%, transparent);+ }+ .export-menu-heading {+ grid-column: 1 / -1;+ display: block;+ padding: 0.24rem 0.55rem 0.2rem;+ color: var(--text-faint);+ font-size: 0.54rem;+ font-weight: 600;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ }+ .toolbar .export-menu button {+ display: grid;+ grid-template-columns: 1.15rem minmax(0, 1fr);+ align-items: center;+ column-gap: 0.52rem;+ background: transparent;+ border: 1px solid transparent;+ box-shadow: none;+ backdrop-filter: none;+ width: 100%;+ min-height: 3rem;+ text-align: left;+ padding: 0.48rem 0.55rem;+ border-radius: 0.5rem;+ white-space: nowrap;+ }+ .export-item-copy {+ display: block;+ min-width: 0;+ }+ .export-item-copy strong,+ .export-item-copy small { display: block; }+ .export-item-copy strong {+ overflow: hidden;+ color: inherit;+ font-size: 0.7rem;+ font-weight: 550;+ text-overflow: ellipsis;+ }+ .export-item-copy small {+ margin-top: 0.12rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.55rem;+ font-weight: 450;+ text-overflow: ellipsis;+ }+ .toolbar .export-menu button::before {+ width: 1rem;+ height: 1rem;+ background: currentColor;+ content: "";+ opacity: 0.72;+ -webkit-mask-position: center;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-size: contain;+ mask-position: center;+ mask-repeat: no-repeat;+ mask-size: contain;+ }+ .toolbar .export-menu button[data-format="share-card"]::before,+ .toolbar .export-menu button[data-action="route-share-card"]::before,+ .toolbar .export-menu button[data-action="reach-share-card"]::before {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");+ }+ .toolbar .export-menu button[data-action^="copy"]::before {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ }+ .toolbar .export-menu button[data-format="png"]::before,+ .toolbar .export-menu button[data-format="jpeg"]::before,+ .toolbar .export-menu button[data-format="webp"]::before {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ }+ .toolbar .export-menu button[data-format="svg"]::before,+ .toolbar .export-menu button[data-format="webm"]::before {+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");+ }+ .toolbar .export-menu button[data-format="share-card"],+ .toolbar .export-menu button[data-action="route-share-card"],+ .toolbar .export-menu button[data-action="reach-share-card"] {+ min-height: 3.35rem;+ color: var(--toolbar-text);+ background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent);+ border-color: color-mix(in srgb, var(--frontend-stroke) 24%, var(--toolbar-border));+ }+ .toolbar .export-menu button[hidden] { display: none; }+ .toolbar .export-menu button:hover {+ background: var(--toolbar-hover);+ }+ .toolbar .export-menu button:focus-visible {+ background: var(--toolbar-hover);+ outline-offset: -2px;+ }+ .toolbar .export-menu button:disabled {+ color: var(--text-faint);+ background: color-mix(in srgb, var(--toolbar-border) 18%, transparent);+ cursor: not-allowed;+ }+ .toolbar .export-menu button:disabled:hover {+ border-color: transparent;+ }+ .toolbar .export-menu .hint {+ color: var(--text-faint);+ font-size: 0.55rem;+ }++ /* Toast — brief feedback for actions like "copied" */+ .archify-toast {+ position: fixed;+ top: 1rem;+ left: 50%;+ transform: translateX(-50%) translateY(-8px);+ background: var(--toolbar-menu-bg);+ color: var(--text);+ border: 1px solid var(--toolbar-border);+ padding: 0.5rem 1rem;+ border-radius: 0.5rem;+ font-family: inherit;+ font-size: 0.75rem;+ opacity: 0;+ transition: opacity 0.2s, transform 0.2s;+ z-index: 200;+ pointer-events: none;+ box-shadow: 0 4px 20px rgba(0,0,0,0.25);+ }+ .archify-toast.show {+ opacity: 1;+ transform: translateX(-50%) translateY(0);+ }++ @media (max-width: 720px) {+ body { padding: 1rem; }+ .toolbar .preset-menu,+ .toolbar .export-menu {+ position: fixed;+ top: 4.5rem;+ right: 1rem;+ left: 1rem;+ width: auto;+ max-width: none;+ }+ .toolbar {+ position: relative;+ justify-content: flex-end;+ width: max-content;+ max-width: 100%;+ margin-left: auto;+ margin-bottom: 1rem;+ }+ .header { margin-bottom: 1.25rem; padding-right: 0; }+ html[data-preset="signal-flow"] .header,+ html[data-preset="blueprint"] .header,+ html[data-preset="editorial"] .header { padding-right: 0; }+ .header-row {+ gap: 0.75rem;+ align-items: flex-start;+ }+ html[data-preset="signal-flow"] .header-row,+ html[data-preset="blueprint"] .header-row,+ html[data-preset="editorial"] .header-row { flex-wrap: wrap; }+ html[data-preset="signal-flow"] .header-row::after {+ margin-left: 0;+ order: 3;+ }+ html[data-preset="blueprint"] .header-row::after {+ margin-left: 0;+ order: 3;+ }+ html[data-preset="editorial"] .header-row::after {+ margin-left: 0;+ order: 3;+ }+ h1 {+ font-size: 1.25rem;+ line-height: 1.25;+ }+ .subtitle {+ margin-left: 0;+ font-size: 0.8125rem;+ line-height: 1.55;+ }+ .diagram-container {+ padding: 0.75rem;+ border-radius: 0.75rem;+ }+ html:not([data-embed="true"]) .diagram-container {+ padding: 0.75rem 0.75rem 4.25rem;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] {+ overflow-x: auto;+ overflow-y: hidden;+ overscroll-behavior-x: contain;+ scrollbar-width: thin;+ scroll-behavior: smooth;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {+ min-width: 720px;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-nav,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .overview-map,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .focus-chip,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .route-probe,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .semantic-lens,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-guide,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .node-finder {+ transform: translateX(var(--archify-scroll-x, 0px));+ }+ .diagram-nav { right: 0.5rem; bottom: 0.5rem; }+ .diagram-nav button {+ min-width: 2.75rem;+ height: 2.75rem;+ }+ .diagram-nav [data-view="reset"] { min-width: 3.75rem; }+ .diagram-nav [data-view="reset"][data-detail-visible] { min-width: 4.35rem; }+ .overview-map {+ right: 0.5rem;+ bottom: 3.7rem;+ width: min(10.25rem, calc(100% - 1rem));+ }+ .overview-map[data-docked="true"] {+ right: var(--archify-radar-right, 0.5rem);+ top: var(--archify-radar-top, 0.5rem);+ bottom: auto;+ transform: none !important;+ }+ .overview-map[data-docked="true"][data-dock-side="left"] {+ right: auto;+ left: var(--archify-radar-left, 0.5rem);+ }+ .overview-map-surface { height: 4rem; }+ .overview-map-feedback { right: 0.5rem; bottom: 3.7rem; }+ .semantic-lens {+ right: 0.5rem;+ bottom: 3.7rem;+ width: calc(100% - 1rem);+ max-height: calc(100% - 4.2rem);+ }+ .semantic-lens[data-dock-side] { left: auto; right: 0.5rem; }+ .semantic-lens-kinds { max-height: min(12rem, 34vh); }+ .focus-chip {+ left: 0.5rem;+ top: 0.5rem;+ width: calc(100% - 1rem);+ max-width: none;+ }+ .relationship-lens-list { max-height: min(12rem, 38vh); }+ .relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }+ .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }+ .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-list { display: none; }+ /* While a mobile reader previews one relationship, turn the full Lens+ into a compact peek card. This keeps the exact source and target on+ canvas instead of covering them with a long, scrollable list. */+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-list {+ max-height: none;+ padding: 0.35rem;+ overflow: hidden;+ }+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-group { margin: 0; }+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-group-title,+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-row:not([data-preview-active="true"]) {+ display: none;+ }+ .node-finder {+ top: 0.5rem;+ left: 0.5rem;+ width: min(22rem, calc(100% - 1rem));+ max-height: calc(100% - 1rem);+ }+ .diagram-guide {+ top: 0.5rem;+ right: 0.5rem;+ left: 0.5rem;+ width: auto;+ max-height: calc(100% - 1rem);+ }+ .diagram-guide-head { padding: 0.62rem 0.7rem 0.52rem; }+ .diagram-guide-stats { padding: 0.42rem 0.7rem; }+ .diagram-guide-actions {+ grid-template-columns: 1fr;+ gap: 0.28rem;+ padding: 0.42rem;+ }+ .diagram-guide-action {+ min-height: 3.1rem;+ padding: 0.42rem 0.48rem;+ }+ .diagram-guide-action small {+ display: block;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .diagram-guide-index {+ width: 1.5rem;+ height: 1.5rem;+ }+ .diagram-guide-shortcuts { padding: 0.46rem 0.7rem 0.52rem; }+ .diagram-guide-action[data-guide-action="present"] { grid-column: auto; }+ .route-probe[data-guide-open="true"] {+ visibility: hidden;+ pointer-events: none;+ }+ .node-finder-results { max-height: min(16rem, 38vh); }+ .route-probe {+ left: 0.5rem;+ bottom: 3.7rem;+ width: calc(100% - 1rem);+ min-width: 0;+ }+ .route-probe[data-route-dock="top"] {+ top: 0.5rem;+ bottom: auto;+ }+ .route-probe[data-finder-open="true"] {+ visibility: hidden;+ pointer-events: none;+ }+ .route-probe-head { padding: 0.45rem 0.48rem 0.38rem; }+ .route-probe-path { padding: 0.35rem 0.48rem 0.2rem; }+ .route-probe-node { min-height: 2.75rem !important; }+ .route-journey-controls {+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem minmax(0, 1fr);+ padding: 0.08rem 0.48rem 0.32rem;+ }+ .route-journey-controls button { min-height: 2.75rem; }+ .route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }+ .route-probe-node { max-width: 7.5rem; }+ .guided-views {+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;+ gap: 0.2rem;+ padding: 0.25rem;+ }+ .guided-view-actions {+ grid-column: 1 / -1;+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ }+ .guided-views > #guided-view-prev,+ .guided-views > #guided-view-next {+ align-self: center;+ height: 2.75rem;+ }+ .guided-view-play,+ .guided-view-all,+ .guided-view-beat-link { min-height: 2.75rem; }+ .guided-view-copy small { white-space: normal; }+ .guided-story-caption { padding: 0.32rem 0.45rem; }+ .guided-story-caption-index { min-width: 2.9rem; padding-right: 0.42rem; }+ .guided-story-caption strong,+ .guided-story-caption small { white-space: normal; }+ .guided-story-caption-next { display: none; }+ .guided-view-trail { min-height: 2rem; }+ .guided-view-trail .guided-view-stop {+ min-height: 2rem;+ padding: 0.22rem 0.42rem 0.22rem 0.28rem;+ }+ .guided-view-handoff { max-width: min(9rem, 32vw); }+ .guided-view-index { padding-top: 0.35rem; }+ .guided-view-chapters {+ gap: 0.35rem;+ scroll-padding-inline: 0.2rem;+ }+ .guided-view-chapters li {+ flex: 0 0 min(14rem, 78vw);+ min-width: 0;+ }+ .guided-view-chapter { min-height: 2.75rem; }+ .guided-views[data-active-view="all"] {+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.2rem;+ padding: 0.25rem;+ }+ .guided-views[data-active-view="all"] .guided-view-copy {+ grid-column: 1;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-actions {+ grid-column: 2;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-play {+ min-width: 6rem !important;+ min-height: 2.75rem;+ }+ .guided-views[data-active-view="all"] .guided-view-index {+ grid-column: 1 / -1;+ grid-row: 2;+ padding: 0.3rem 0.08rem 0;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ border-left: 0;+ }+ html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),+ html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {+ top: 0.5rem;+ grid-template-columns: auto minmax(0, 1fr);+ gap: 0.28rem 0.55rem;+ width: calc(100% - 1rem);+ min-height: 0;+ padding: 0.45rem 0.55rem 0.55rem;+ }+ html[data-embed="true"][data-share-playback="true"] .diagram-container {+ padding-top: 4.25rem;+ }+ html[data-embed="true"][data-share-moment="true"] .diagram-container {+ padding-top: 4.25rem;+ }+ .share-chapter-index {+ min-width: 4.4rem;+ padding-right: 0.5rem;+ }+ .share-chapter-copy small { font-size: 0.46rem; }+ .share-chapter-route {+ grid-column: 1 / -1;+ font-size: 0.5rem;+ text-align: left;+ }+ .cards {+ grid-template-columns: 1fr;+ margin-top: 1rem;+ }+ html[data-present="true"]:not([data-embed="true"]) body { padding: 0.5rem; }+ html[data-present="true"]:not([data-embed="true"]) .container {+ gap: 0.5rem;+ height: calc(100dvh - 1rem);+ }+ html[data-present="true"]:not([data-embed="true"]) .toolbar {+ position: fixed;+ top: 0.5rem;+ right: 0.5rem;+ margin: 0;+ gap: 0.25rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .toolbar button {+ min-height: 2.75rem;+ padding: 0.42rem 0.58rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .header {+ min-height: 2.25rem;+ padding: 3.5rem 0 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row {+ min-height: 2.25rem;+ margin: 0;+ align-items: center;+ flex-wrap: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row::after,+ html[data-present="true"]:not([data-embed="true"]) .pulse-dot,+ html[data-present="true"]:not([data-embed="true"]) .subtitle { display: none; }+ html[data-present="true"]:not([data-embed="true"]) h1 {+ flex: 1 1 auto;+ min-width: 0;+ max-width: 100%;+ overflow: hidden;+ font-size: 0.875rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-views {+ padding: 0.2rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-view-copy small { display: none; }+ html[data-present="true"]:not([data-embed="true"]) .guided-story-caption small { display: block; }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {+ width: 720px;+ height: auto;+ min-width: 720px;+ }+ }++ @media (max-width: 420px) {+ .export-menu-section { grid-template-columns: 1fr; }+ .export-menu-heading,+ .toolbar .export-menu button[data-format="share-card"],+ .toolbar .export-menu button[data-action="route-share-card"],+ .toolbar .export-menu button[data-action="reach-share-card"] { grid-column: 1; }+ }++ @media (prefers-reduced-motion: reduce) {+ .guided-story-caption { animation: none !important; }+ .toolbar .preset-menu.open,+ .toolbar .export-menu.open { animation: none; }+ .toolbar-chevron { transition: none; }+ }++ @media (max-width: 360px) {+ .toolbar { gap: 0.25rem; }+ .toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }+ .toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }+ #theme-label, #preset-label, #present-label { display: none; }+ .guided-view-handoff { max-width: 6.5rem; }+ }++ /* ==========================================================+ SVG SEMANTIC CLASSES — use these instead of inline fill/stroke+ ========================================================== */+ .c-grid { stroke: var(--grid); fill: none; }+ .c-mask { fill: var(--mask); stroke: none; }++ .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }+ .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }+ .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }+ .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }+ .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }+ .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }+ .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }++ /* Text helpers */+ .t-primary { fill: var(--text); }+ .t-muted { fill: var(--text-muted); }+ .t-dim { fill: var(--text-dim); }+ .t-frontend { fill: var(--frontend-stroke); }+ .t-backend { fill: var(--backend-stroke); }+ .t-database { fill: var(--database-stroke); }+ .t-cloud { fill: var(--cloud-stroke); }+ .t-security { fill: var(--security-stroke); }+ .t-messagebus { fill: var(--messagebus-stroke); }+ .t-external { fill: var(--external-stroke); }++ /* Semantic Sigils are small authored role stamps, not icons from a brand+ pack and not viewer controls. Prefix selectors with svg so the canonical+ export's SVG-only stylesheet collector keeps them automatically. */+ svg .semantic-sigil {+ fill: none;+ stroke: currentColor;+ stroke-width: 1.35;+ stroke-linecap: round;+ stroke-linejoin: round;+ opacity: 0.76;+ pointer-events: none;+ }+ svg .semantic-sigil > * { vector-effect: non-scaling-stroke; }+ svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }+ svg .s-frontend { color: var(--frontend-stroke); }+ svg .s-backend { color: var(--backend-stroke); }+ svg .s-database { color: var(--database-stroke); }+ svg .s-cloud { color: var(--cloud-stroke); }+ svg .s-security { color: var(--security-stroke); }+ svg .s-messagebus { color: var(--messagebus-stroke); }+ svg .s-external { color: var(--external-stroke); }++ /* Brand Marks are authored identity badges. Their color is contained+ inside one neutral plate so vendor color never replaces Archify's+ semantic node and relationship vocabulary. */+ svg .brand-mark { pointer-events: none; }+ svg .brand-mark-badge { fill: #fff; stroke: none; }+ svg .brand-mark-frame {+ fill: none;+ stroke: #cbd5e1;+ stroke-width: 0.8;+ vector-effect: non-scaling-stroke;+ }+ svg .brand-mark-fallback {+ fill: none;+ stroke: #475569;+ stroke-width: 1.15;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ svg[data-preset="blueprint"] .brand-mark-badge,+ svg[data-preset="blueprint"] .brand-mark-frame { rx: 1px; }++ /* Reading Depth is a viewer-only level-of-detail layer. MAP preserves the+ authored structure and primary labels, READ restores relationship labels+ and node context, and FULL restores tags and fine annotations. Semantic+ intent can reveal the relevant detail without moving any geometry. */+ svg [data-detail] { transition: opacity 160ms ease; }+ svg [data-detail-anchor] {+ transform-box: fill-box;+ transform-origin: center;+ transition: transform 160ms ease;+ }+ .diagram-container[data-detail-level="map"] svg [data-detail="context"],+ .diagram-container[data-detail-level="map"] svg [data-detail="fine"],+ .diagram-container[data-detail-level="read"] svg [data-detail="fine"] {+ opacity: 0;+ pointer-events: none;+ }+ .diagram-container[data-detail-level="map"] svg [data-detail-anchor] {+ transform: translateY(8px);+ }++ /* Focus, lens, preview, route, and story states are stronger reader intent than+ the global zoom level. Reveal only their exact semantic matches. */+ svg[data-focus-active] [data-focus-match][data-detail],+ svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],+ svg[data-lens-active] [data-lens-match][data-detail],+ svg[data-lens-active] [data-lens-match] [data-detail],+ svg[data-legend-preview-active] [data-legend-preview-match][data-detail],+ svg[data-legend-preview-active] [data-legend-preview-match] [data-detail],+ svg[data-intent-trace-active] [data-intent-trace-match][data-detail],+ svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],+ svg[data-route-active] [data-route-match][data-detail],+ svg[data-route-active] [data-route-match] [data-detail],+ svg[data-story-active] [data-story-step][data-detail],+ svg[data-story-active] [data-story-step] [data-detail],+ svg[data-relationship-preview-active] [data-relationship-preview][data-detail],+ svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],+ svg [data-node-id]:hover [data-detail],+ svg [data-node-id]:focus-visible [data-detail] {+ opacity: 1;+ pointer-events: auto;+ }+ svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],+ svg[data-lens-active] [data-lens-match] [data-detail-anchor],+ svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],+ svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],+ svg[data-route-active] [data-route-match] [data-detail-anchor],+ svg[data-story-active] [data-story-step] [data-detail-anchor],+ svg [data-node-id]:hover [data-detail-anchor],+ svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }++ /* Arrows */+ .a-default { stroke: var(--arrow); fill: none; }+ .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }+ .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }+ .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }++ /* Arrowhead markers reference these */+ .m-default { fill: var(--arrow); }+ .m-emphasis { fill: var(--arrow-emphasis); }+ .m-security { fill: var(--security-stroke); }+ .m-dashed { fill: var(--database-stroke); }++ /* Stable semantic exploration hooks emitted by every renderer. */+ svg [data-node-id] {+ cursor: pointer;+ transition: opacity 0.18s ease, filter 0.18s ease;+ }+ svg [data-edge-from] { transition: opacity 0.18s ease, filter 0.18s ease; }+ svg [data-node-id]:hover,+ svg [data-node-id]:focus-visible {+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ outline: none;+ }+ /* Verified Source Beacons are installed at runtime only for nodes whose+ repository evidence passed the local revision/blob/line checks. They+ live inside the owning node so every focus, route, story, and guided+ view keeps one coherent opacity state. Export serialization removes+ them before producing the canonical SVG or any derived visual. */+ .source-evidence-beacon {+ pointer-events: none;+ opacity: 0.76;+ transition: opacity 160ms ease, filter 160ms ease;+ }+ .source-evidence-beacon rect {+ fill: color-mix(in srgb, var(--mask) 92%, var(--backend-stroke));+ stroke: color-mix(in srgb, var(--backend-stroke) 82%, var(--panel-border));+ stroke-width: 1;+ vector-effect: non-scaling-stroke;+ }+ .source-evidence-beacon text {+ fill: var(--backend-stroke);+ font-size: 5.5px;+ font-weight: 800;+ letter-spacing: 0.06em;+ text-anchor: middle;+ text-transform: uppercase;+ }+ svg [data-node-id]:hover .source-evidence-beacon,+ svg [data-node-id]:focus-visible .source-evidence-beacon,+ svg [data-node-id][data-focus-selected] .source-evidence-beacon {+ opacity: 1;+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="signal-flow"] .source-evidence-beacon { opacity: 0.9; }+ svg[data-preset="blueprint"] .source-evidence-beacon rect {+ rx: 0.8px;+ filter: none;+ }+ svg [data-legend-kind][role="button"] { cursor: pointer; }+ svg [data-legend-kind]:focus { outline: none; }+ svg [data-legend-hit] {+ fill: transparent;+ stroke: transparent;+ stroke-width: 1.4;+ pointer-events: all;+ vector-effect: non-scaling-stroke;+ transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;+ }+ svg [data-legend-count-badge] { pointer-events: none; }+ svg [data-legend-count-badge] rect {+ fill: var(--mask);+ stroke: var(--panel-border);+ stroke-width: 1;+ vector-effect: non-scaling-stroke;+ }+ svg [data-legend-count-badge] text {+ fill: var(--text-muted);+ font-size: 8px;+ font-weight: 700;+ text-anchor: middle;+ }+ svg [data-legend-kind][role="button"]:hover [data-legend-hit] {+ stroke: color-mix(in srgb, var(--database-stroke) 58%, transparent);+ }+ svg [data-legend-kind][role="button"]:focus-visible [data-legend-hit] {+ stroke: var(--frontend-stroke);+ stroke-width: 1.8;+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg [data-legend-kind][data-legend-selected] [data-legend-hit] {+ stroke: var(--database-stroke);+ stroke-width: 2.2;+ stroke-dasharray: 3 2;+ }+ svg [data-legend-kind][data-legend-selected] [data-legend-count-badge] rect {+ stroke: var(--database-stroke);+ stroke-width: 1.8;+ }+ svg [data-legend-kind][data-legend-zero] { opacity: 0.44; }+ svg[data-preset="signal-flow"] [data-legend-kind][data-legend-selected] [data-legend-hit] {+ filter: drop-shadow(0 0 4px var(--database-stroke));+ }+ svg[data-preset="blueprint"] [data-legend-hit],+ svg[data-preset="blueprint"] [data-legend-count-badge] rect { rx: 0; filter: none; }+ svg[data-legend-preview-active] [data-node-id],+ svg[data-legend-preview-active] [data-edge-from] { opacity: 0.11; }+ svg[data-legend-preview-active] [data-legend-preview-match] { opacity: 1; }+ svg[data-legend-preview-active] [data-legend-preview-peer] { opacity: 0.62; }+ svg[data-legend-preview-active] [data-legend-preview-selected] {+ filter: drop-shadow(0 0 8px var(--database-stroke));+ }+ svg[data-lens-active] [data-node-id],+ svg[data-lens-active] [data-edge-from] { opacity: 0.11; }+ svg[data-lens-active] [data-lens-match] { opacity: 1; }+ svg[data-lens-active] [data-lens-peer] { opacity: 0.62; }+ svg[data-lens-active] [data-lens-selected] {+ filter: drop-shadow(0 0 10px var(--database-stroke));+ }+ .semantic-lens-overlay { pointer-events: none; }+ .semantic-lens-flow {+ fill: none;+ stroke-width: 3.05;+ stroke-linecap: round;+ stroke-dasharray: 0.075 0.925;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.9;+ animation: archify-semantic-lens-flow 1.35s linear 1 both;+ animation-delay: var(--lens-flow-delay, 0s);+ }+ .semantic-lens-flow[data-direction="out"],+ .semantic-lens-flow[data-direction="forward"] {+ stroke: var(--frontend-stroke);+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ .semantic-lens-flow[data-direction="in"],+ .semantic-lens-flow[data-direction="reverse"] {+ stroke: var(--database-stroke);+ filter: drop-shadow(0 0 3px var(--database-stroke));+ }+ .semantic-lens-flow[data-direction="within"] {+ stroke: var(--messagebus-stroke);+ filter: drop-shadow(0 0 3px var(--messagebus-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow {+ stroke-width: 3.7;+ opacity: 1;+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="out"],+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="forward"] {+ filter: drop-shadow(0 0 6px var(--frontend-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="in"],+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="reverse"] {+ filter: drop-shadow(0 0 6px var(--database-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="within"] {+ filter: drop-shadow(0 0 6px var(--messagebus-stroke));+ }+ svg[data-preset="blueprint"] .semantic-lens-flow {+ stroke-width: 2.45;+ stroke-linecap: square;+ filter: none;+ opacity: 0.78;+ }+ html[data-embed="true"] .semantic-lens-overlay { display: none; }+ svg[data-focus-active] [data-node-id],+ svg[data-focus-active] [data-edge-from] { opacity: 0.13; }+ svg[data-focus-active] [data-focus-match] { opacity: 1; }+ svg[data-focus-active] [data-focus-selected] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }++ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }++ /* Direct Relationship Explorer makes authored paths a real input surface+ without changing their visible stroke or canonical SVG. A transparent+ runtime rail supplies forgiving pointer geometry; the exact authored+ path and endpoints continue to carry every visible state. */+ .relationship-hit-overlay { pointer-events: none; }+ .relationship-hit-target { outline: none; }+ .relationship-hit-rail {+ fill: none;+ stroke: transparent;+ stroke-width: 24;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ pointer-events: stroke;+ cursor: pointer;+ }+ .relationship-focus-rail {+ fill: none;+ stroke: color-mix(in srgb, var(--frontend-stroke) 34%, transparent);+ stroke-width: 6;+ stroke-dasharray: 2 4;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ pointer-events: none;+ opacity: 0;+ }+ .relationship-hit-target:focus-visible .relationship-focus-rail {+ opacity: 1;+ }+ svg[data-preset="blueprint"] .relationship-hit-target:focus-visible .relationship-focus-rail {+ stroke-linecap: square;+ filter: none;+ }+ svg[data-relationship-direct-active] [data-node-id],+ svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }+ svg[data-relationship-direct-active] [data-relationship-preview],+ svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }+ svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,+ svg[data-story-active] .relationship-hit-rail,+ svg[data-route-picking] .relationship-hit-rail,+ svg[data-route-active] .relationship-hit-rail,+ svg[data-lens-active] .relationship-hit-rail,+ svg[data-chapter-preview] .relationship-hit-rail { pointer-events: none; }+ html[data-embed="true"] .relationship-hit-overlay { display: none; }+ @media (hover: none), (pointer: coarse) {+ .relationship-hit-rail { stroke-width: 24; }+ }++ /* Relationship Preview is temporary exploration state layered on top of+ neighborhood focus. It changes emphasis only; exported geometry and the+ relationship's original solid/dashed visual language stay untouched. */+ svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }+ svg[data-relationship-preview-active] [data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }+ svg[data-relationship-preview-active] [data-relationship-preview] {+ filter: drop-shadow(0 0 5px var(--arrow-emphasis));+ }+ svg[data-relationship-preview-active] [data-relationship-preview] path,+ svg[data-relationship-preview-active] path[data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview] line,+ svg[data-relationship-preview-active] line[data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview] polyline,+ svg[data-relationship-preview-active] polyline[data-relationship-preview] {+ stroke-width: 2.75;+ }+ svg[data-relationship-preview-active] [data-relationship-preview-source] {+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ }+ svg[data-relationship-preview-active] [data-relationship-preview-target] {+ filter: drop-shadow(0 0 7px var(--database-stroke));+ }+ .relationship-pulse-overlay { pointer-events: none; }+ .relationship-flow-pulse {+ fill: none;+ stroke: var(--arrow-emphasis);+ stroke-width: 3.35;+ stroke-linecap: round;+ stroke-dasharray: 0.085 0.915;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0;+ filter: drop-shadow(0 0 4px var(--arrow-emphasis));+ animation: archify-relationship-pulse 1.2s linear 1 both;+ }+ svg[data-preset="signal-flow"] .relationship-flow-pulse {+ stroke: var(--frontend-stroke);+ stroke-width: 3.85;+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"] .relationship-flow-pulse {+ stroke-width: 2.5;+ stroke-linecap: square;+ filter: none;+ }+ svg[data-preset="editorial"] .relationship-flow-pulse {+ stroke: var(--arrow-emphasis);+ stroke-width: 2.75;+ filter: none;+ }+ .semantic-flow-token {+ color: var(--frontend-stroke);+ opacity: 0;+ pointer-events: none;+ }+ .relationship-flow-token {+ animation: archify-relationship-token-life 1.2s linear 1 both;+ }+ .story-flow-token {+ animation: archify-relationship-token-life 0.78s linear 1 both;+ }+ .semantic-flow-token-halo {+ fill: var(--mask);+ stroke: currentColor;+ stroke-width: 1.1;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ }+ .relationship-flow-token-shape {+ fill: var(--mask);+ stroke: currentColor;+ stroke-width: 1.35;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ }+ .relationship-flow-token-ink {+ fill: none;+ stroke: currentColor;+ stroke-width: 1.05;+ stroke-linecap: round;+ vector-effect: non-scaling-stroke;+ }+ .relationship-flow-token-dot { fill: currentColor; stroke: none; }+ .semantic-flow-token[data-token-kind="data"] { color: var(--database-stroke); }+ .semantic-flow-token[data-token-kind="event"] { color: var(--messagebus-stroke); }+ .semantic-flow-token[data-token-kind="security"] { color: var(--security-stroke); }+ .semantic-flow-token[data-token-kind="state"] { color: var(--cloud-stroke); }+ svg[data-preset="signal-flow"] .semantic-flow-token {+ filter: drop-shadow(0 0 5px currentColor);+ }+ svg[data-preset="blueprint"] .semantic-flow-token { filter: none; }+ svg[data-preset="editorial"] .semantic-flow-token { filter: none; }+ html[data-embed="true"] .relationship-pulse-overlay { display: none; }++ /* Intent Trace is a temporary, pre-click exploration layer. Related+ topology stays readable while a short viewer-only signal runs over+ cloned edge geometry; the authored edge remains untouched underneath. */+ svg[data-intent-trace-active] [data-node-id],+ svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }+ svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }+ svg[data-intent-trace-active] [data-intent-trace-selected] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }+ .intent-trace-overlay { pointer-events: none; }+ .intent-trace-flow {+ fill: none;+ stroke-width: 3.1;+ stroke-linecap: round;+ stroke-dasharray: 0.1 0.9;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.94;+ animation: archify-intent-trace-flow 1.15s linear 1 both;+ }+ /* Direction names describe each edge relative to the focused node only.+ The cloned geometry already runs from the authored source to target, so+ incoming and outgoing signals must share the same playback direction. */+ .intent-trace-flow[data-direction="out"] {+ stroke: var(--frontend-stroke);+ filter: drop-shadow(0 0 4px var(--frontend-stroke));+ }+ .intent-trace-flow[data-direction="in"] {+ stroke: var(--database-stroke);+ filter: drop-shadow(0 0 4px var(--database-stroke));+ animation-direction: normal;+ }+ .intent-trace-flow[data-direction="loop"] {+ stroke: var(--security-stroke);+ filter: drop-shadow(0 0 4px var(--security-stroke));+ }+ svg[data-preset="blueprint"] [data-intent-trace-selected],+ svg[data-preset="blueprint"] .intent-trace-flow {+ filter: none;+ stroke-linecap: square;+ }+ svg[data-preset="editorial"] [data-intent-trace-selected],+ svg[data-preset="editorial"] .intent-trace-flow { filter: none; }+ .intent-trace-status {+ position: absolute;+ width: 1px;+ height: 1px;+ padding: 0;+ margin: -1px;+ overflow: hidden;+ clip: rect(0, 0, 0, 0);+ clip-path: inset(50%);+ white-space: nowrap;+ border: 0;+ }++ /* Route Probe separates a durable two-point query from selection and+ one-hop hover. Only the chosen shortest directed path stays prominent;+ the traveling signal is cloned viewer geometry and never authored SVG. */+ svg[data-route-picking="target"] [data-node-id] { opacity: 0.24; }+ svg[data-route-picking="target"] [data-route-candidate],+ svg[data-route-picking="target"] [data-route-start] { opacity: 1; }+ svg[data-route-picking] [data-node-id] { cursor: crosshair; }+ svg[data-route-picking] [data-route-start] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }+ svg[data-route-active] [data-node-id],+ svg[data-route-active] [data-edge-from] { opacity: 0.11; }+ svg[data-route-active] [data-route-match] { opacity: 1; }+ svg[data-route-active] [data-route-start] {+ filter: drop-shadow(0 0 11px var(--frontend-stroke));+ }+ svg[data-route-active] [data-route-end] {+ filter: drop-shadow(0 0 11px var(--security-stroke));+ }+ svg[data-route-active] [data-route-step]:not([data-route-start]):not([data-route-end]) {+ filter: drop-shadow(0 0 7px var(--backend-stroke));+ }+ svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }+ svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }+ svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }+ svg[data-route-journey] [data-node-id][data-route-journey-current] {+ filter: drop-shadow(0 0 10px var(--backend-stroke));+ }+ svg[data-route-journey] [data-edge-from][data-route-journey-current] {+ opacity: 1;+ filter: drop-shadow(0 0 6px var(--backend-stroke));+ }+ .route-probe-overlay { pointer-events: none; }+ .route-journey-overlay { pointer-events: none; }+ .route-probe-flow {+ fill: none;+ stroke: var(--backend-stroke);+ stroke-width: 3.25;+ stroke-linecap: round;+ stroke-dasharray: 0.085 0.915;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ filter: drop-shadow(0 0 5px var(--backend-stroke));+ animation: archify-route-probe-flow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 1 both;+ animation-delay: calc(var(--route-step, 0) * 0.16s);+ }+ .route-journey-flow {+ fill: none;+ stroke: var(--backend-stroke);+ stroke-width: 3.5;+ stroke-linecap: round;+ stroke-dasharray: 0.1 0.9;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0;+ filter: drop-shadow(0 0 6px var(--backend-stroke));+ animation: archify-route-journey-flow 780ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;+ }+ svg[data-preset="blueprint"] [data-route-start],+ svg[data-preset="blueprint"] [data-route-end],+ svg[data-preset="blueprint"] [data-route-step],+ svg[data-preset="blueprint"] .route-probe-flow {+ filter: none;+ stroke-linecap: square;+ }+ svg[data-preset="blueprint"] .route-journey-flow {+ filter: none;+ stroke-linecap: square;+ }+ svg[data-preset="editorial"] [data-route-start],+ svg[data-preset="editorial"] [data-route-end],+ svg[data-preset="editorial"] [data-route-step],+ svg[data-preset="editorial"] .route-probe-flow,+ svg[data-preset="editorial"] .route-journey-flow { filter: none; }++ svg[data-preset="editorial"] .c-grid {+ stroke-dasharray: 1 4;+ opacity: 0.48;+ }+ svg[data-preset="editorial"] .c-region {+ fill: color-mix(in srgb, var(--cloud-fill) 48%, transparent);+ stroke-dasharray: 9 4;+ }+ svg[data-preset="editorial"] [data-node-id]:hover,+ svg[data-preset="editorial"] [data-node-id]:focus-visible,+ svg[data-preset="editorial"][data-focus-active] [data-focus-selected] {+ filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent));+ }++ svg[data-preset="blueprint"] .c-grid {+ stroke-dasharray: 1 3;+ opacity: 0.78;+ }+ svg[data-preset="blueprint"] .c-region {+ fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);+ stroke-dasharray: 12 4 2 4;+ }+ svg[data-preset="blueprint"] .c-security-group,+ svg[data-preset="blueprint"] .c-lane { stroke-dasharray: 7 3; }+ svg[data-preset="blueprint"] [data-node-id]:hover,+ svg[data-preset="blueprint"] [data-node-id]:focus-visible {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }++ /* Story Trail is a viewer-only overlay derived from the ordered focus IDs+ of the active guided view. The authored edge stays underneath with its+ original color, dash pattern, marker, and geometry intact. */+ .story-trail-overlay { pointer-events: none; }+ .story-carrier-overlay { pointer-events: none; }+ .story-trail-flow {+ fill: none;+ stroke: var(--frontend-stroke);+ stroke-width: 2.8;+ stroke-linecap: round;+ vector-effect: non-scaling-stroke;+ opacity: 0.34;+ filter: drop-shadow(0 0 2px var(--frontend-stroke));+ }+ svg[data-story-beat] [data-story-step] {+ opacity: 0.22;+ filter: saturate(0.42);+ transition: opacity 180ms ease, filter 180ms ease;+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="past"] {+ opacity: 0.72;+ filter: saturate(0.82);+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="next"] {+ opacity: 0.5;+ filter: saturate(0.66);+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="active"] {+ opacity: 1;+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ animation: archify-story-beat-node 360ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ svg[data-story-beat] [data-edge-from][data-story-beat-step] {+ opacity: 0.16;+ transition: opacity 160ms ease;+ }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="past"] { opacity: 0.58; }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="next"] { opacity: 0.34; }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="active"] { opacity: 1; }+ svg[data-story-beat] .story-trail-flow { opacity: 0; transition: opacity 160ms ease; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="past"] { opacity: 0.34; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="next"] { opacity: 0.2; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="active"] { opacity: 0.92; }+ svg[data-story-beat] .story-trail-flow[data-story-pulse="true"] {+ stroke-dasharray: 2 13;+ stroke-dashoffset: 30;+ opacity: 0.92;+ animation: archify-story-flow 0.78s linear 1 both;+ }+ svg[data-preset="blueprint"] .story-trail-flow {+ stroke-linecap: square;+ filter: none;+ opacity: 0.5;+ }+ svg[data-preset="blueprint"][data-story-beat] [data-story-step][data-story-beat-state="active"] {+ filter: none;+ animation: none;+ }+ svg[data-preset="editorial"] .story-trail-flow { filter: none; }+ svg[data-preset="editorial"][data-story-beat] [data-story-step][data-story-beat-state="active"] {+ filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 16%, transparent));+ }++ /* Chapter Delta Preview is a static, pre-commit comparison between two+ chapter focus sets. Symbols in the rail carry the meaning without color;+ these SVG rules only make exact stable-ID membership easier to scan. */+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] {+ opacity: 0.1 !important;+ filter: none !important;+ transition: none !important;+ }+ svg[data-chapter-preview] .story-trail-overlay { opacity: 0.08 !important; }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="stay"] {+ opacity: 0.76 !important;+ filter: saturate(0.7) !important;+ }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="enter"] {+ opacity: 1 !important;+ filter: saturate(1.2) !important;+ }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="leave"] {+ opacity: 0.28 !important;+ filter: grayscale(0.72) !important;+ }+ svg[data-preset="blueprint"][data-chapter-preview] [data-node-id] { filter: none !important; }++ /* Dashed boundary variants */+ .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }+ .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }+ .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }++ /* Optional trace animation, enabled only by meta.animation = "trace".+ The ordinary viewer performs one ambient pass and then restores the+ authored solid/security/async line language. WebM samples the same+ authored geometry into an explicit canvas timeline. */+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="edge"] {+ animation: archify-edge-flow 2.4s linear 1;+ animation-delay: calc(var(--step, 0) * 160ms);+ }+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="node"] {+ transform-box: fill-box;+ transform-origin: center;+ animation: archify-node-pulse 3.6s ease-in-out 1;+ animation-delay: calc(var(--step, 0) * 160ms);+ }+ svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="edge"] {+ stroke-linecap: round;+ filter: drop-shadow(0 0 3px var(--arrow-emphasis));+ animation-duration: 1.75s;+ }+ svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {+ animation-duration: 3.1s;+ }+ svg[data-preset="blueprint"][data-animation="trace"] [data-animate="edge"] {+ stroke-linecap: square;+ filter: none;+ animation-duration: 2.15s;+ }+ svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {+ animation-name: archify-blueprint-node-pulse;+ animation-duration: 3.8s;+ }+ svg[data-preset="editorial"][data-animation="trace"] [data-animate="edge"] {+ filter: none;+ animation-duration: 2.2s;+ }+ svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {+ animation-name: archify-editorial-node-pulse;+ animation-duration: 3.5s;+ }+ /* Embedded proofs are static until a named Story Trail chapter is played.+ This keeps proof grids calm and ensures ?play=1 stops all viewer motion+ after one 3.2 second chapter instead of leaving ambient trace loops on. */+ html[data-embed="true"] svg[data-animation="trace"] [data-animate],+ html[data-share-playback="true"] svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ stroke-dashoffset: 0;+ }+ @keyframes archify-edge-flow {+ 0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }+ 88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }+ 99.9% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }+ 100% { stroke-dashoffset: 0; opacity: 1; }+ }+ @keyframes archify-node-pulse {+ 0%, 72%, 100% { filter: none; stroke-width: 1.5; }+ 18%, 36% {+ filter: drop-shadow(0 0 8px var(--arrow-emphasis));+ stroke-width: 2.4;+ }+ }+ @keyframes archify-blueprint-node-pulse {+ 0%, 72%, 100% { opacity: 1; filter: none; }+ 18%, 36% { opacity: 0.72; filter: drop-shadow(0 0 2px var(--frontend-stroke)); }+ }+ @keyframes archify-editorial-node-pulse {+ 0%, 72%, 100% { opacity: 1; filter: none; }+ 18%, 36% { opacity: 0.78; filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent)); }+ }+ @keyframes archify-signal-scan {+ 0%, 18% { opacity: 1; transform: translateX(-70%); }+ 70% { opacity: 1; transform: translateX(70%); }+ 100% { opacity: 0; transform: translateX(70%); }+ }+ @keyframes archify-radar-live {+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }+ 55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }+ }+ @keyframes archify-guided-progress {+ from { transform: scaleX(var(--guided-progress-start, 0)); }+ to { transform: scaleX(1); }+ }+ @keyframes archify-story-flow {+ to { stroke-dashoffset: 0; }+ }+ @keyframes archify-intent-trace-flow {+ 0% { opacity: 0.28; stroke-dashoffset: 0; }+ 12%, 78% { opacity: 0.94; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-route-probe-flow {+ 0% { stroke-dashoffset: 0; opacity: 0.96; }+ 78% { stroke-dashoffset: -1; opacity: 0.96; }+ 100% { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.58; }+ }+ @keyframes archify-route-journey-flow {+ 0% { opacity: 0.16; stroke-dashoffset: 0; }+ 14%, 76% { opacity: 1; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-semantic-lens-flow {+ 0% { opacity: 0.2; stroke-dashoffset: 0; }+ 12%, 78% { opacity: 0.9; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-relationship-pulse {+ 0% { opacity: 0.18; stroke-dashoffset: 0; }+ 10%, 76% { opacity: 0.98; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-relationship-token-life {+ 0%, 7% { opacity: 0; }+ 13%, 82% { opacity: 1; }+ 100% { opacity: 0; }+ }+ @keyframes archify-story-beat-node {+ from { opacity: 0.48; filter: saturate(0.6); }+ 58% { opacity: 1; filter: drop-shadow(0 0 10px var(--frontend-stroke)); }+ to { opacity: 1; filter: drop-shadow(0 0 7px var(--frontend-stroke)); }+ }+ @keyframes archify-share-cue-enter {+ from { opacity: 0; transform: translate(-50%, -0.45rem); }+ to { opacity: 1; transform: translate(-50%, 0); }+ }+ @keyframes archify-share-cue-pulse {+ 0%, 100% { opacity: 1; transform: scale(1); }+ 50% { opacity: 0.48; transform: scale(0.78); }+ }+ @media (prefers-reduced-motion: reduce) {+ html[data-preset="signal-flow"] .diagram-container::before {+ animation: none !important;+ }+ .pulse-dot { animation: none !important; }+ svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ stroke-dashoffset: 0;+ }+ .guided-view-progress span {+ animation: none !important;+ transform: scaleX(1) !important;+ }+ .story-trail-flow,+ .intent-trace-flow,+ .route-probe-flow,+ .semantic-lens,+ .diagram-guide,+ [data-story-step],+ .overview-map-live,+ .guided-view-stop,+ .share-chapter-cue,+ .chapter-handoff-anchor,+ .share-chapter-state::before,+ .share-chapter-progress span { animation: none !important; }+ .guided-view-chapter,+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] { transition: none !important; }+ svg[data-story-playing="true"] .story-trail-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.55;+ }+ .intent-trace-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.72;+ }+ .route-probe-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.78;+ }+ .route-journey-overlay,+ .story-carrier-overlay { display: none !important; }+ .semantic-lens-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-width: 2.2;+ opacity: 0.34;+ filter: none;+ }+ .relationship-pulse-overlay { display: none !important; }+ .guided-view-chapter { transition: none !important; }+ .source-evidence-beacon,+ svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }+ }+ </style>+</head>+<body>+ <!-- Toolbar: theme, live visual style, trace motion, presentation stage, and export.+ Motion appears only for trace-enabled artifacts and has no shortcut;+ Keyboard: T toggles theme, S cycles style, F toggles the stage, E opens export. -->+ <div class="toolbar" role="toolbar" aria-label="{{i18n:viewer.toolbar.actions}}">+ <button id="btn-theme" type="button"+ title="{{i18n:viewer.theme.toggle.title}}"+ aria-label="{{i18n:viewer.theme.toggle}}"+ aria-pressed="false">+ <span id="theme-icon" class="toolbar-icon" aria-hidden="true"></span>+ <span id="theme-label">{{i18n:viewer.theme.dark}}</span>+ </button>+ <div class="preset-wrap">+ <button id="btn-preset" type="button"+ title="{{i18n:viewer.preset.choose.title}}"+ aria-label="{{i18n:viewer.preset.choose}}"+ aria-haspopup="menu"+ aria-expanded="false"+ aria-controls="preset-menu"+ aria-keyshortcuts="S">+ <span class="preset-control-mark" aria-hidden="true"></span>+ <span id="preset-label">{{i18n:viewer.preset.style}}</span>+ <span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>+ </button>+ <div class="preset-menu" id="preset-menu" role="menu" aria-label="{{i18n:viewer.preset.menu}}">+ <div class="preset-menu-heading" role="presentation"><span>{{i18n:viewer.preset.identity}}</span><span>{{i18n:viewer.preset.cycles}}</span></div>+ <button class="preset-option" data-preset-value="classic" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">+ <span class="preset-option-swatch classic" aria-hidden="true"></span>+ <span class="preset-option-copy"><strong>{{i18n:viewer.preset.classic}}</strong><small>{{i18n:viewer.preset.classic.hint}}</small></span>+ <span class="preset-option-check" aria-hidden="true"></span>+ </button>+ <button class="preset-option" data-preset-value="signal-flow" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">+ <span class="preset-option-swatch signal-flow" aria-hidden="true"></span>+ <span class="preset-option-copy"><strong>{{i18n:viewer.preset.flow}}</strong><small>{{i18n:viewer.preset.flow.hint}}</small></span>+ <span class="preset-option-check" aria-hidden="true"></span>+ </button>+ <button class="preset-option" data-preset-value="blueprint" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">+ <span class="preset-option-swatch blueprint" aria-hidden="true"></span>+ <span class="preset-option-copy"><strong>{{i18n:viewer.preset.blueprint}}</strong><small>{{i18n:viewer.preset.blueprint.hint}}</small></span>+ <span class="preset-option-check" aria-hidden="true"></span>+ </button>+ <button class="preset-option" data-preset-value="editorial" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">+ <span class="preset-option-swatch editorial" aria-hidden="true"></span>+ <span class="preset-option-copy"><strong>{{i18n:viewer.preset.editorial}}</strong><small>{{i18n:viewer.preset.editorial.hint}}</small></span>+ <span class="preset-option-check" aria-hidden="true"></span>+ </button>+ </div>+ </div>+ <button id="btn-motion" type="button" hidden+ title="{{i18n:viewer.motion.pause}}"+ aria-label="{{i18n:viewer.motion.pause}}"+ aria-pressed="true">+ <span class="motion-control-dot" aria-hidden="true"></span>+ <span id="motion-label">{{i18n:viewer.motion.live}}</span>+ </button>+ <button id="btn-present" type="button"+ title="{{i18n:viewer.present.enter.title}}"+ aria-label="{{i18n:viewer.present.enter}}"+ aria-pressed="false">+ <span id="present-icon" class="toolbar-icon" aria-hidden="true"></span>+ <span id="present-label">{{i18n:viewer.present.present}}</span>+ </button>+ <div class="export-wrap">+ <button id="btn-export" type="button"+ title="{{i18n:viewer.export.button.title}}"+ aria-label="{{i18n:viewer.export.diagram}}"+ aria-haspopup="menu"+ aria-expanded="false"+ aria-controls="export-menu">+ {{i18n:viewer.export.button}} <span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>+ </button>+ <div class="export-menu" id="export-menu" role="menu" aria-label="{{i18n:viewer.export.menu}}">+ <div class="export-menu-header" role="presentation">+ <div><strong>{{i18n:viewer.export.diagram}}</strong><span>{{i18n:viewer.export.subtitle}}</span></div>+ <kbd>E</kbd>+ </div>+ <div class="export-menu-section" role="group" aria-label="{{i18n:viewer.export.share}}">+ <span class="export-menu-heading" aria-hidden="true">{{i18n:viewer.export.share}}</span>+ <button data-format="share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>{{i18n:viewer.export.shareCard}}</strong><small class="hint">1200×630 PNG</small></span></button>+ <button data-action="route-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>{{i18n:viewer.export.routeShareCard}}</strong><small class="hint">1200×630 PNG</small></span></button>+ <button data-action="reach-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>{{i18n:viewer.export.reachShareCard}}</strong><small class="hint">1200×630 PNG</small></span></button>+ <button data-action="copy-share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>{{i18n:viewer.export.copyShareCard}}</strong><small class="hint">{{i18n:viewer.export.clipboardPng}}</small></span></button>+ <button data-action="copy" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>{{i18n:viewer.export.copyDiagram}}</strong><small class="hint">{{i18n:viewer.export.clipboardPng}}</small></span></button>+ </div>+ <div class="export-menu-section" role="group" aria-label="{{i18n:viewer.export.raster}}">+ <span class="export-menu-heading" aria-hidden="true">{{i18n:viewer.export.image}}</span>+ <button data-format="png" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>PNG</strong><small class="hint">{{i18n:viewer.export.lossless}}</small></span></button>+ <button data-format="jpeg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>JPEG</strong><small class="hint">{{i18n:viewer.export.compact}}</small></span></button>+ <button data-format="webp" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebP</strong><small class="hint">{{i18n:viewer.export.modern}}</small></span></button>+ </div>+ <div class="export-menu-section" role="group" aria-label="{{i18n:viewer.export.vectorMotion}}">+ <span class="export-menu-heading" aria-hidden="true">{{i18n:viewer.export.vectorMotion.heading}}</span>+ <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG</strong><small class="hint">{{i18n:viewer.export.editable}}</small></span></button>+ <button data-format="webm" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebM</strong><small class="hint">{{i18n:viewer.export.motion6s}}</small></span></button>+ </div>+ </div>+ </div>+ </div>++ <div class="container">+ <!-- Header -->+ <div class="header">+ <div class="header-row"+ data-preset-badge-signal-flow="{{i18n:viewer.preset.badge.signalFlow}}"+ data-preset-badge-blueprint="{{i18n:viewer.preset.badge.blueprint}}"+ data-preset-badge-editorial="{{i18n:viewer.preset.badge.editorial}}">+ <div class="pulse-dot"></div>+ <h1>[PROJECT NAME] Architecture</h1>+ </div>+ <p class="subtitle">[Subtitle description]</p>+ </div>++ <!-- ARCHIFY:GUIDED_VIEWS_DATA -->+ <!-- ARCHIFY:SOURCE_EVIDENCE_DATA -->+ <!-- ARCHIFY:I18N_DATA -->+ <div class="guided-views no-print" id="guided-views" hidden aria-label="{{i18n:viewer.guided.region}}">+ <button id="guided-view-prev" type="button" aria-label="{{i18n:viewer.guided.previous}}" title="{{i18n:viewer.guided.previous.title}}">←</button>+ <div class="guided-view-copy">+ <div class="guided-view-meta">+ <span>{{i18n:viewer.guided.views}}</span>+ <span id="guided-view-count"></span>+ <span class="guided-view-progress" aria-hidden="true"><span id="guided-view-progress-bar"></span></span>+ <span class="guided-view-handoff" id="guided-view-handoff" hidden aria-hidden="true"></span>+ </div>+ <strong id="guided-view-label">{{i18n:viewer.guided.explore}}</strong>+ <small id="guided-view-note" aria-live="polite" aria-atomic="true">{{i18n:viewer.guided.intro}}</small>+ <div class="guided-view-trail" id="guided-view-trail" hidden role="group" aria-label="{{i18n:viewer.guided.trail}}"></div>+ <div class="guided-story-caption" id="guided-story-caption" hidden aria-live="polite" aria-atomic="true">+ <span class="guided-story-caption-index" id="guided-story-caption-index">{{i18n:viewer.guided.beat}}</span>+ <strong id="guided-story-caption-route"></strong>+ <small id="guided-story-caption-detail"></small>+ <span class="guided-story-caption-next" id="guided-story-caption-next" hidden aria-hidden="true">+ <small>{{i18n:viewer.guided.nextBeat}}</small>+ <strong id="guided-story-caption-next-label"></strong>+ </span>+ </div>+ </div>+ <button id="guided-view-next" type="button" aria-label="{{i18n:viewer.guided.next}}" title="{{i18n:viewer.guided.next.title}}">→</button>+ <div class="guided-view-actions">+ <button class="guided-view-play" id="guided-view-play" type="button" aria-label="{{i18n:viewer.guided.play}}" aria-pressed="false" title="{{i18n:viewer.guided.play.title}}">+ <span id="guided-view-play-icon" aria-hidden="true">▶</span>+ <span id="guided-view-play-label">{{i18n:viewer.guided.playStory}}</span>+ </button>+ <button class="guided-view-beat-link" id="guided-view-beat-link" type="button" aria-label="{{i18n:viewer.guided.selectBeatLink}}" title="{{i18n:viewer.guided.selectBeatLink}}" disabled>+ <span aria-hidden="true">#</span>+ <span id="guided-view-beat-link-label">{{i18n:viewer.guided.copyMoment}}</span>+ </button>+ <button class="guided-view-all" id="guided-view-all" type="button" aria-label="{{i18n:viewer.guided.showAll.aria}}">{{i18n:viewer.guided.showAll}}</button>+ </div>+ <nav class="guided-view-index" id="guided-view-index" aria-label="{{i18n:viewer.guided.chapters}}">+ <ol class="guided-view-chapters" id="guided-view-chapters"></ol>+ </nav>+ </div>++ <!-- Main Diagram -->+ <div class="diagram-container" data-detail-level="read"+ data-preset-badge-editorial-plate="{{i18n:viewer.preset.badge.editorialPlate}}">+ <!-- ARCHIFY:SVG_SLOT_START -->+ <svg viewBox="0 0 1000 680" role="img" aria-label="[PROJECT NAME] architecture diagram">+ <!-- Definitions -->+ <defs>+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-default" />+ </marker>+ <marker id="arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />+ </marker>+ <marker id="arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-security" />+ </marker>+ <marker id="arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />+ </marker>+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>+ </pattern>+ </defs>++ <!-- Background Grid -->+ <rect width="100%" height="100%" fill="url(#grid)" />++ <!-- =================================================================+ COMPONENT EXAMPLES — use CSS classes, not inline fill/stroke+ (so theme toggle works). Each box pattern:+ 1. opaque mask rect (.c-mask) to hide arrows underneath+ 2. styled rect (.c-<type>) with 1.5px stroke+ 3. text (.t-primary / .t-muted)+ ================================================================= -->++ <!-- External/Generic Component -->+ <rect x="30" y="280" width="100" height="50" rx="6" class="c-mask"/>+ <rect x="30" y="280" width="100" height="50" rx="6" class="c-external" stroke-width="1.5"/>+ <text x="80" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>+ <text x="80" y="316" class="t-muted" font-size="9" text-anchor="middle">Browser/Mobile</text>++ <!-- Security Component -->+ <rect x="30" y="80" width="100" height="60" rx="6" class="c-mask"/>+ <rect x="30" y="80" width="100" height="60" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="80" y="105" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>+ <text x="80" y="121" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>++ <!-- Region/Cloud Boundary -->+ <rect x="160" y="40" width="820" height="620" rx="12" class="c-region" stroke-width="1"/>+ <text x="172" y="58" class="t-cloud" font-size="10" font-weight="600">AWS Region: us-west-2</text>++ <!-- AWS/Cloud Service -->+ <rect x="200" y="280" width="110" height="50" rx="6" class="c-mask"/>+ <rect x="200" y="280" width="110" height="50" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="255" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>+ <text x="255" y="316" class="t-muted" font-size="9" text-anchor="middle">CDN</text>++ <!-- Multi-line AWS Component (S3 Buckets example) -->+ <rect x="200" y="380" width="110" height="100" rx="6" class="c-mask"/>+ <rect x="200" y="380" width="110" height="100" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="255" y="400" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3 Buckets</text>+ <text x="255" y="420" class="t-muted" font-size="8" text-anchor="middle">• bucket-one</text>+ <text x="255" y="434" class="t-muted" font-size="8" text-anchor="middle">• bucket-two</text>+ <text x="255" y="448" class="t-muted" font-size="8" text-anchor="middle">• bucket-three</text>+ <text x="255" y="466" class="t-cloud" font-size="7" text-anchor="middle">OAI Protected</text>++ <!-- Security Group (dashed boundary). NOTE: extra vertical headroom+ so the sg-name label has ~12px breathing room above the inner+ component. Pattern: boundary y = inner.y - 30, h = inner.h + 50. -->+ <rect x="350" y="250" width="120" height="100" rx="8" class="c-security-group" stroke-width="1"/>+ <text x="358" y="268" class="t-security" font-size="8">sg-name :port</text>++ <!-- Component inside security group -->+ <rect x="360" y="280" width="100" height="50" rx="6" class="c-mask"/>+ <rect x="360" y="280" width="100" height="50" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="410" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>+ <text x="410" y="316" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>++ <!-- Backend Component -->+ <rect x="510" y="280" width="110" height="50" rx="6" class="c-mask"/>+ <rect x="510" y="280" width="110" height="50" rx="6" class="c-backend" stroke-width="1.5"/>+ <text x="565" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>+ <text x="565" y="316" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>++ <!-- Database Component -->+ <rect x="700" y="280" width="120" height="50" rx="6" class="c-mask"/>+ <rect x="700" y="280" width="120" height="50" rx="6" class="c-database" stroke-width="1.5"/>+ <text x="760" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Database</text>+ <text x="760" y="316" class="t-muted" font-size="9" text-anchor="middle">PostgreSQL</text>++ <!-- Frontend Component -->+ <rect x="200" y="520" width="200" height="110" rx="8" class="c-mask"/>+ <rect x="200" y="520" width="200" height="110" rx="8" class="c-frontend" stroke-width="1.5"/>+ <text x="300" y="545" class="t-primary" font-size="12" font-weight="600" text-anchor="middle">Frontend</text>+ <text x="300" y="565" class="t-muted" font-size="9" text-anchor="middle">React + TypeScript</text>+ <text x="300" y="580" class="t-muted" font-size="9" text-anchor="middle">Additional detail</text>+ <text x="300" y="595" class="t-muted" font-size="9" text-anchor="middle">More info</text>+ <text x="300" y="615" class="t-frontend" font-size="8" text-anchor="middle">domain.example.com</text>++ <!-- =================================================================+ ARROW EXAMPLES (use .a-* classes and stroke-width on the line)+ ================================================================= -->++ <!-- Standard arrow with label -->+ <line x1="130" y1="305" x2="198" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="164" y="299" class="t-muted" font-size="9" text-anchor="middle">HTTPS</text>++ <!-- Simple arrow (no label) -->+ <line x1="310" y1="305" x2="358" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Vertical arrow -->+ <line x1="255" y1="330" x2="255" y2="378" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="270" y="358" class="t-muted" font-size="9">OAI</text>++ <!-- Straight arrows between services -->+ <line x1="460" y1="305" x2="508" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="620" y1="305" x2="698" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="655" y="299" class="t-muted" font-size="9">TLS</text>++ <!-- Curved dashed path for auth/security flow -->+ <path d="M 80 140 L 80 200 Q 80 220 100 220 L 200 220 Q 220 220 220 240 L 220 278"+ class="a-security" stroke-width="1.5"/>+ <text x="150" y="210" class="t-security" font-size="8">JWT + PKCE</text>++ <!-- =================================================================+ LEGEND+ ================================================================= -->+ <text x="720" y="70" class="t-primary" font-size="10" font-weight="600">Legend</text>++ <rect x="720" y="82" width="16" height="10" rx="2" class="c-frontend" stroke-width="1"/>+ <text x="742" y="90" class="t-muted" font-size="8">Frontend</text>++ <rect x="720" y="98" width="16" height="10" rx="2" class="c-backend" stroke-width="1"/>+ <text x="742" y="106" class="t-muted" font-size="8">Backend</text>++ <rect x="720" y="114" width="16" height="10" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="742" y="122" class="t-muted" font-size="8">Cloud Service</text>++ <rect x="720" y="130" width="16" height="10" rx="2" class="c-database" stroke-width="1"/>+ <text x="742" y="138" class="t-muted" font-size="8">Database</text>++ <rect x="720" y="146" width="16" height="10" rx="2" class="c-security" stroke-width="1"/>+ <text x="742" y="154" class="t-muted" font-size="8">Security</text>++ <line x1="720" y1="168" x2="736" y2="168" class="a-security" stroke-width="1"/>+ <text x="742" y="171" class="t-muted" font-size="8">Auth Flow</text>++ <rect x="720" y="178" width="16" height="10" rx="2" class="c-security-group" stroke-width="1"/>+ <text x="742" y="186" class="t-muted" font-size="8">Security Group</text>+ </svg>+ <!-- ARCHIFY:SVG_SLOT_END -->+ <p class="intent-trace-status no-print" id="intent-trace-status" role="status" aria-live="polite" aria-atomic="true"></p>+ <div class="share-chapter-cue no-print" id="share-chapter-cue" hidden role="status" aria-live="polite">+ <div class="share-chapter-index">+ <span class="share-chapter-state" id="share-chapter-state">{{i18n:viewer.guided.state.ready}}</span>+ <span class="share-chapter-count" id="share-chapter-count">{{i18n:viewer.guided.share.initial}}</span>+ </div>+ <div class="share-chapter-copy">+ <strong id="share-chapter-label">{{i18n:viewer.guided.share.default}}</strong>+ <small id="share-chapter-note"></small>+ </div>+ <span class="share-chapter-route" id="share-chapter-route"></span>+ <span class="share-chapter-progress" aria-hidden="true"><span id="share-chapter-progress-bar"></span></span>+ </div>+ <div class="diagram-guide no-print" id="diagram-guide" hidden role="dialog" aria-modal="false" aria-labelledby="diagram-guide-title">+ <div class="diagram-guide-head">+ <span>+ <span class="diagram-guide-eyebrow">{{i18n:viewer.guide.eyebrow}}</span>+ <strong class="diagram-guide-title" id="diagram-guide-title">{{i18n:viewer.guided.explore}}</strong>+ </span>+ <button class="diagram-guide-close" id="diagram-guide-close" type="button" aria-label="{{i18n:viewer.guide.close}}">×</button>+ </div>+ <p class="diagram-guide-stats" id="diagram-guide-stats">{{i18n:viewer.guide.inspecting}}</p>+ <div class="diagram-guide-actions" id="diagram-guide-actions" role="group" aria-label="{{i18n:viewer.guide.actions}}">+ <button class="diagram-guide-action" type="button" data-guide-action="find" aria-label="{{i18n:viewer.guide.find}}">+ <span class="diagram-guide-index" aria-hidden="true">01</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.find}}</strong><small>{{i18n:viewer.guide.find.hint}}</small></span>+ <kbd aria-hidden="true">/</kbd>+ </button>+ <button class="diagram-guide-action" type="button" data-guide-action="route" aria-label="{{i18n:viewer.guide.route.aria}}">+ <span class="diagram-guide-index" aria-hidden="true">02</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.route}}</strong><small>{{i18n:viewer.guide.route.hint}}</small></span>+ <kbd aria-hidden="true">R</kbd>+ </button>+ <button class="diagram-guide-action" type="button" data-guide-action="map" aria-label="{{i18n:viewer.guide.map}}">+ <span class="diagram-guide-index" aria-hidden="true">03</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.map}}</strong><small>{{i18n:viewer.guide.map.hint}}</small></span>+ <kbd aria-hidden="true">M</kbd>+ </button>+ <button class="diagram-guide-action" type="button" data-guide-action="lens" aria-label="{{i18n:viewer.guide.lens}}">+ <span class="diagram-guide-index" aria-hidden="true">04</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.lens}}</strong><small>{{i18n:viewer.guide.lens.hint}}</small></span>+ <kbd aria-hidden="true">L</kbd>+ </button>+ <button class="diagram-guide-action" type="button" data-guide-action="story" aria-label="{{i18n:viewer.guide.story}}">+ <span class="diagram-guide-index" aria-hidden="true">05</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.story}}</strong><small id="diagram-guide-story-copy">{{i18n:viewer.guide.story.hint}}</small></span>+ <kbd aria-hidden="true">P</kbd>+ </button>+ <button class="diagram-guide-action" type="button" data-guide-action="present" aria-label="{{i18n:viewer.present.enter}}">+ <span class="diagram-guide-index" aria-hidden="true">06</span>+ <span class="diagram-guide-action-copy"><strong>{{i18n:viewer.guide.present}}</strong><small>{{i18n:viewer.guide.present.hint}}</small></span>+ <kbd aria-hidden="true">F</kbd>+ </button>+ </div>+ <div class="diagram-guide-shortcuts" aria-label="{{i18n:viewer.guide.shortcuts}}">+ <span><kbd>E</kbd> {{i18n:viewer.guide.shortcut.export}}</span><span><kbd>T</kbd> {{i18n:viewer.guide.shortcut.theme}}</span><span><kbd>S</kbd> {{i18n:viewer.guide.shortcut.style}}</span><span><kbd>0</kbd> {{i18n:viewer.guide.shortcut.reset}}</span><span><kbd>+</kbd> {{i18n:viewer.guide.shortcut.zoomIn}}</span><span><kbd>-</kbd> {{i18n:viewer.guide.shortcut.zoomOut}}</span><span><kbd>Esc</kbd> {{i18n:viewer.guide.shortcut.close}}</span>+ </div>+ <p class="diagram-guide-feedback" id="diagram-guide-feedback" aria-live="polite"></p>+ </div>+ <div class="node-finder no-print" id="node-finder" hidden role="dialog" aria-modal="false" aria-labelledby="node-finder-title">+ <div class="node-finder-head">+ <strong id="node-finder-title">{{i18n:viewer.finder.title}}</strong>+ <button class="node-finder-close" id="node-finder-close" type="button" aria-label="{{i18n:viewer.finder.close}}">×</button>+ </div>+ <div class="node-finder-search">+ <span aria-hidden="true">⌕</span>+ <input class="node-finder-input" id="node-finder-input" type="search" autocomplete="off" spellcheck="false" placeholder="{{i18n:viewer.finder.placeholder}}" aria-label="{{i18n:viewer.finder.search}}" aria-describedby="node-finder-status">+ <kbd aria-hidden="true">/</kbd>+ </div>+ <div class="node-finder-results" id="node-finder-results" role="group" aria-label="{{i18n:viewer.finder.results}}"></div>+ <p class="node-finder-empty" id="node-finder-empty" hidden>{{i18n:viewer.finder.empty}}</p>+ <p class="node-finder-status" id="node-finder-status" aria-live="polite"></p>+ </div>+ <div class="focus-chip relationship-lens no-print" id="focus-chip" hidden role="region" aria-labelledby="relationship-lens-title">+ <div class="relationship-lens-head">+ <div class="relationship-lens-copy">+ <span class="relationship-lens-eyebrow">{{i18n:viewer.passport.eyebrow}}</span>+ <strong class="relationship-lens-title" id="relationship-lens-title"><span id="focus-label"></span></strong>+ <span class="semantic-passport-detail" id="focus-detail" hidden></span>+ <div class="semantic-passport-meta" id="focus-passport-meta" aria-label="{{i18n:viewer.passport.metadata}}">+ <span id="focus-kind" data-passport="kind"></span>+ <span id="focus-context" data-passport="context" hidden></span>+ <span id="focus-tag" data-passport="tag" hidden></span>+ <span id="focus-brand" data-passport="brand" hidden></span>+ <code id="focus-id" data-passport="id"></code>+ </div>+ <div class="semantic-passport-evidence" id="focus-evidence" hidden aria-label="{{i18n:viewer.passport.evidence}}">+ <div class="semantic-passport-evidence-head">+ <span class="semantic-passport-evidence-status">{{i18n:viewer.passport.verified}}</span>+ <a class="semantic-passport-repository" id="focus-repository" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer"></a>+ </div>+ <div class="semantic-passport-evidence-links" id="focus-evidence-links"></div>+ </div>+ <span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">{{i18n:viewer.passport.reach}}</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="{{i18n:viewer.passport.reach.trace}}">+ <button id="btn-reach-upstream" type="button" aria-label="{{i18n:viewer.passport.upstream.trace}}" aria-pressed="false">+ <span>{{i18n:viewer.passport.upstream}}</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="{{i18n:viewer.passport.downstream.trace}}" aria-pressed="false">+ <span>{{i18n:viewer.passport.downstream}}</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div>+ </div>+ <div class="relationship-lens-actions">+ <button id="btn-focus-clear" type="button" aria-label="{{i18n:viewer.passport.close}}" title="{{i18n:viewer.common.close}}">×</button>+ <button id="btn-focus-copy" type="button" aria-label="{{i18n:viewer.passport.copy.focus}}">{{i18n:viewer.passport.copy}}</button>+ <button id="btn-focus-relations" type="button" aria-label="{{i18n:viewer.passport.relations.show}}" aria-expanded="false" aria-controls="relationship-lens-list">{{i18n:viewer.passport.relations}}</button>+ </div>+ </div>+ <div class="relationship-lens-list" id="relationship-lens-list" aria-label="{{i18n:viewer.passport.relations.list}}"></div>+ </div>+ <div class="route-probe no-print" id="route-probe" hidden role="region" aria-labelledby="route-probe-title" data-state="idle">+ <div class="route-probe-head">+ <span class="route-probe-copy">+ <span class="route-probe-eyebrow">{{i18n:viewer.route.eyebrow}}</span>+ <strong class="route-probe-title" id="route-probe-title">{{i18n:viewer.route.start}}</strong>+ </span>+ <span class="route-probe-actions">+ <button class="route-probe-find" id="route-probe-find" type="button" aria-label="{{i18n:viewer.route.start.find.aria}}" data-node-finder-trigger>{{i18n:viewer.route.start.find}}</button>+ <button class="route-probe-copy-link" id="route-probe-copy" type="button" aria-label="{{i18n:viewer.route.copy.aria}}" hidden>{{i18n:viewer.route.copy}}</button>+ <button id="route-probe-clear" type="button" aria-label="{{i18n:viewer.route.clear.aria}}">{{i18n:viewer.route.clear}}</button>+ </span>+ </div>+ <div class="route-probe-path" id="route-probe-path" aria-label="{{i18n:viewer.route.traced}}">+ <span class="route-probe-placeholder">{{i18n:viewer.route.pickTwo}}</span>+ </div>+ <div class="route-journey-controls" id="route-journey-controls" hidden role="group" aria-label="{{i18n:viewer.route.controls}}" data-playing="false">+ <button id="route-journey-prev" type="button" aria-label="{{i18n:viewer.route.previous}}" title="{{i18n:viewer.route.previous}}">←</button>+ <button class="route-journey-play" id="route-journey-play" type="button" aria-label="{{i18n:viewer.route.play}}" aria-pressed="false" title="{{i18n:viewer.route.play}}">+ <span id="route-journey-play-icon" aria-hidden="true">▶</span>+ <span id="route-journey-play-label">{{i18n:viewer.route.journey}}</span>+ </button>+ <button id="route-journey-next" type="button" aria-label="{{i18n:viewer.route.next}}" title="{{i18n:viewer.route.next}}">→</button>+ <button class="route-journey-overview" id="route-journey-overview" type="button" aria-label="{{i18n:viewer.route.overview.aria}}" title="{{i18n:viewer.route.overview.aria}}">{{i18n:viewer.route.overview}}</button>+ </div>+ <small class="route-probe-status" id="route-probe-status" aria-live="polite">{{i18n:viewer.route.instructions}}</small>+ </div>+ <div class="semantic-lens no-print" id="semantic-lens" hidden role="dialog" aria-modal="false" aria-labelledby="semantic-lens-title">+ <div class="semantic-lens-head">+ <span>+ <span class="semantic-lens-eyebrow">{{i18n:viewer.lens.eyebrow}}</span>+ <strong class="semantic-lens-title" id="semantic-lens-title">{{i18n:viewer.lens.title}}</strong>+ </span>+ <button class="semantic-lens-close" id="semantic-lens-close" type="button" aria-label="{{i18n:viewer.lens.close}}">×</button>+ </div>+ <p class="semantic-lens-instruction">{{i18n:viewer.lens.instruction}}</p>+ <div class="semantic-lens-kinds" id="semantic-lens-kinds" role="group" aria-label="{{i18n:viewer.lens.kinds}}"></div>+ <p class="semantic-lens-status" id="semantic-lens-status" aria-live="polite">{{i18n:viewer.lens.choose}}</p>+ <div class="semantic-lens-actions">+ <button id="semantic-lens-copy" type="button" aria-label="{{i18n:viewer.lens.copy}}" hidden>{{i18n:viewer.common.copyLink}}</button>+ <button id="semantic-lens-clear" type="button" aria-label="{{i18n:viewer.lens.clear}}">{{i18n:viewer.common.clear}}</button>+ </div>+ </div>+ <div class="overview-map no-print" id="overview-map" hidden role="region" aria-labelledby="overview-map-title">+ <div class="overview-map-head">+ <span class="overview-map-live" aria-hidden="true"></span>+ <span class="overview-map-copy">+ <strong id="overview-map-title">{{i18n:viewer.radar.title}}</strong>+ <small id="overview-map-status" aria-live="polite">{{i18n:viewer.radar.building}}</small>+ </span>+ <button class="overview-map-expand" id="overview-map-expand" type="button" aria-label="{{i18n:viewer.radar.openFull}}">{{i18n:viewer.radar.open}}</button>+ <button class="overview-map-close" id="overview-map-close" type="button" aria-label="{{i18n:viewer.radar.close}}">×</button>+ </div>+ <div class="overview-map-surface" id="overview-map-surface" tabindex="0" role="group" aria-label="{{i18n:viewer.radar.surface}}"></div>+ <div class="overview-map-hint" aria-hidden="true"><span>{{i18n:viewer.radar.click}}</span><span>{{i18n:viewer.radar.drag}}</span></div>+ </div>+ <p class="overview-map-feedback no-print" id="overview-map-feedback" role="status" aria-live="polite" hidden>{{i18n:viewer.radar.space}}</p>+ <div class="diagram-nav no-print" role="toolbar" aria-label="{{i18n:viewer.nav.controls}}">+ <button id="btn-route-probe" type="button" aria-label="{{i18n:viewer.nav.route}}" aria-pressed="false" aria-controls="route-probe" title="{{i18n:viewer.nav.route.title}}">{{i18n:viewer.nav.route.short}}</button>+ <button id="btn-overview-map" type="button" aria-label="{{i18n:viewer.nav.radar}}" aria-expanded="false" aria-controls="overview-map" title="{{i18n:viewer.nav.radar.title}}">{{i18n:viewer.nav.radar.short}}</button>+ <button id="btn-semantic-lens" type="button" aria-label="{{i18n:viewer.nav.lens}}" aria-haspopup="dialog" aria-expanded="false" aria-pressed="false" aria-controls="semantic-lens" title="{{i18n:viewer.nav.lens.title}}">{{i18n:viewer.nav.lens.short}}</button>+ <button id="btn-node-finder" type="button" aria-label="{{i18n:viewer.nav.find}}" aria-haspopup="dialog" aria-expanded="false" aria-controls="node-finder" title="{{i18n:viewer.nav.find.title}}" data-node-finder-trigger><span class="diagram-nav-icon find" aria-hidden="true"></span></button>+ <button id="btn-diagram-guide" type="button" aria-label="{{i18n:viewer.nav.guide}}" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="{{i18n:viewer.nav.guide.title}}"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>+ <button data-view="out" type="button" aria-label="{{i18n:viewer.nav.zoomOut}}" title="{{i18n:viewer.nav.zoomOut.title}}"><span class="diagram-nav-icon minus" aria-hidden="true"></span></button>+ <button data-view="reset" type="button" aria-label="{{i18n:viewer.nav.reset}}" title="{{i18n:viewer.nav.reset.title}}"><span class="diagram-nav-detail" data-view-detail hidden>{{i18n:viewer.nav.read}}</span><span class="diagram-nav-percent" data-view-percent>100%</span></button>+ <button data-view="in" type="button" aria-label="{{i18n:viewer.nav.zoomIn}}" title="{{i18n:viewer.nav.zoomIn.title}}"><span class="diagram-nav-icon plus" aria-hidden="true"></span></button>+ </div>+ </div>++ <!-- ARCHIFY:CARDS_SLOT_START -->+ <div class="cards">+ <div class="card">+ <div class="card-header">+ <div class="card-dot rose"></div>+ <h3>Card Title 1</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>++ <div class="card">+ <div class="card-header">+ <div class="card-dot amber"></div>+ <h3>Card Title 2</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>++ <div class="card">+ <div class="card-header">+ <div class="card-dot violet"></div>+ <h3>Card Title 3</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>+ </div>+ <!-- ARCHIFY:CARDS_SLOT_END -->++ </div>++ <script>+ var Archify = {};+ var archifyI18nData = (function () {+ var node = document.getElementById('archify-i18n-data');+ try { return JSON.parse(node ? node.textContent : '{}'); }+ catch (_) { return { locale: 'en', messages: {} }; }+ })();+ Archify.locale = archifyI18nData.locale || 'en';++ function viewerText(key, values) {+ var messages = archifyI18nData.messages || {};+ var template = Object.prototype.hasOwnProperty.call(messages, key) ? messages[key] : key;+ return String(template).replace(/\{([a-zA-Z0-9_]+)\}/g, function (match, name) {+ return values && Object.prototype.hasOwnProperty.call(values, name) ? String(values[name]) : match;+ });+ }++ function viewerCount(key, count, values) {+ var suffix = Number(count) === 1 ? '.one' : '.other';+ var payload = Object.assign({}, values || {}, { count: count });+ return viewerText(key + suffix, payload);+ }++ function viewerKindLabel(value) {+ var normalized = String(value || 'node').toLowerCase();+ var knownKey = 'viewer.kind.' + normalized;+ var known = viewerText(knownKey);+ if (known !== knownKey) return known;+ return normalized+ .replace(/messagebus/gi, 'message bus')+ .replace(/[-_]+/g, ' ')+ .replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });+ }++ function hasDrawableGeometry(element) {+ if (!element) return false;+ var geometries = /^(path|line|polyline)$/i.test(element.tagName)+ ? [element]+ : Array.prototype.slice.call(element.querySelectorAll('path, line, polyline'));+ return geometries.some(function (geometry) {+ var source = geometry.tagName.toLowerCase() === 'path'+ ? geometry.getAttribute('d')+ : geometry.tagName.toLowerCase() === 'polyline'+ ? geometry.getAttribute('points')+ : [geometry.getAttribute('x1'), geometry.getAttribute('y1'), geometry.getAttribute('x2'), geometry.getAttribute('y2')].join(' ');+ if (!source || /(?:^|[^a-z])(?:nan|infinity)(?:[^a-z]|$)/i.test(source) || typeof geometry.getTotalLength !== 'function') return false;+ try {+ var length = Number(geometry.getTotalLength());+ return Number.isFinite(length) && length > 0;+ } catch (_) {+ return false;+ }+ });+ }++ /* ============================================================+ Visual style try-on — one topology, four bundled presets.+ The reader's choice is intentionally session-only: it updates the+ live page and canonical SVG together, but never rewrites the source,+ URL, or a later diagram's authored default.+ ============================================================ */+ Archify.preset = (function () {+ var PRESETS = ['classic', 'signal-flow', 'blueprint', 'editorial'];+ var LABELS = {+ classic: viewerText('viewer.preset.classic.short'),+ 'signal-flow': viewerText('viewer.preset.flow.short'),+ blueprint: viewerText('viewer.preset.blueprint'),+ editorial: viewerText('viewer.preset.editorial')+ };+ var html = document.documentElement;+ var svg = document.querySelector('.diagram-container svg');+ var btn = document.getElementById('btn-preset');+ var label = document.getElementById('preset-label');+ var menu = document.getElementById('preset-menu');+ var options = function () {+ return Array.prototype.slice.call(menu.querySelectorAll('[data-preset-value]'));+ };+ var authored = PRESETS.indexOf(html.getAttribute('data-preset')) >= 0+ ? html.getAttribute('data-preset')+ : 'classic';++ function current() {+ var value = html.getAttribute('data-preset');+ return PRESETS.indexOf(value) >= 0 ? value : authored;+ }+ function nextAfter(preset) {+ return PRESETS[(PRESETS.indexOf(preset) + 1) % PRESETS.length];+ }+ function apply(preset) {+ if (html.getAttribute('data-embed') === 'true') return false;+ if (PRESETS.indexOf(preset) < 0) return false;+ html.setAttribute('data-preset', preset);+ svg.setAttribute('data-preset', preset);+ btn.setAttribute('data-preset-option', preset);+ label.textContent = LABELS[preset];+ btn.setAttribute('aria-label', viewerText('viewer.preset.current', { style: LABELS[preset] }));+ btn.title = viewerText('viewer.preset.choose.title');+ options().forEach(function (option) {+ var selected = option.getAttribute('data-preset-value') === preset;+ option.setAttribute('aria-checked', String(selected));+ });+ return true;+ }+ function cycle() { return apply(nextAfter(current())); }++ function isOpen() { return menu.classList.contains('open'); }+ function open(focusLast) {+ if (html.getAttribute('data-embed') === 'true') return false;+ if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);+ menu.classList.add('open');+ btn.setAttribute('aria-expanded', 'true');+ var available = options();+ var selected = available.find(function (option) { return option.getAttribute('aria-checked') === 'true'; });+ var target = focusLast ? available[available.length - 1] : (selected || available[0]);+ if (target) target.focus();+ return true;+ }+ function close(focusTrigger) {+ menu.classList.remove('open');+ btn.setAttribute('aria-expanded', 'false');+ if (focusTrigger) btn.focus();+ return false;+ }++ apply(authored);+ btn.addEventListener('click', function (e) {+ e.stopPropagation();+ if (isOpen()) close(false);+ else open(false);+ });+ btn.addEventListener('keydown', function (e) {+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {+ e.preventDefault();+ if (!isOpen()) open(e.key === 'ArrowUp');+ }+ });+ document.addEventListener('click', function (e) {+ if (!menu.contains(e.target) && e.target !== btn) close(false);+ });+ menu.addEventListener('click', function (e) {+ var option = e.target.closest('[data-preset-value]');+ if (!option || !menu.contains(option)) return;+ if (apply(option.getAttribute('data-preset-value'))) close(true);+ });+ menu.addEventListener('keydown', function (e) {+ if (e.key === 'Escape') { e.preventDefault(); close(true); return; }+ if (e.key === 'Tab') { close(false); return; }+ var available = options();+ var active = available.indexOf(document.activeElement);+ switch (e.key) {+ case 'ArrowDown':+ e.preventDefault();+ if (available.length) available[(active + 1 + available.length) % available.length].focus();+ break;+ case 'ArrowUp':+ e.preventDefault();+ if (available.length) available[(active - 1 + available.length) % available.length].focus();+ break;+ case 'Home':+ e.preventDefault();+ if (available[0]) available[0].focus();+ break;+ case 'End':+ e.preventDefault();+ if (available.length) available[available.length - 1].focus();+ break;+ }+ });+ return { cycle: cycle, apply: apply, current: current, authored: authored, open: open, close: close, isOpen: isOpen };+ })();++ /* ============================================================+ Theme toggle — persists to localStorage, respects system pref+ ============================================================ */++ Archify.theme = (function () {+ var STORAGE_KEY = 'archify-theme';+ var html = document.documentElement;+ var btn = document.getElementById('btn-theme');+ var label = document.getElementById('theme-label');++ // localStorage can throw (blocked cookies, sandboxed iframes); the whole+ // script element dies on an uncaught error, so guard every access.+ function readStored() {+ try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }+ }+ function writeStored(value) {+ try { localStorage.setItem(STORAGE_KEY, value); } catch (_) {}+ }+ function urlOverride() {+ // URL param wins (useful for deterministic screenshots / share links)+ try {+ var param = new URLSearchParams(window.location.search).get('theme');+ if (param === 'light' || param === 'dark') return param;+ } catch (_) {}+ return null;+ }++ function resolveInitial() {+ var fromUrl = urlOverride();+ if (fromUrl) return fromUrl;+ var saved = readStored();+ if (saved === 'light' || saved === 'dark') return saved;+ return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';+ }++ function apply(theme) {+ html.setAttribute('data-theme', theme);+ label.textContent = viewerText(theme === 'dark' ? 'viewer.theme.dark' : 'viewer.theme.light');+ btn.setAttribute('aria-pressed', theme === 'light' ? 'true' : 'false');+ }++ function toggle() {+ var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';+ apply(next);+ writeStored(next);+ }++ apply(resolveInitial());+ btn.addEventListener('click', toggle);++ // Follow live OS theme changes while the user has no explicit preference.+ try {+ var media = window.matchMedia('(prefers-color-scheme: light)');+ var onChange = function (e) {+ var saved = readStored();+ if (urlOverride() || saved === 'light' || saved === 'dark') return;+ apply(e.matches ? 'light' : 'dark');+ };+ if (media.addEventListener) media.addEventListener('change', onChange);+ else if (media.addListener) media.addListener(onChange);+ } catch (_) {}++ return { toggle: toggle };+ })();++/* ARCHIFY:EXPORT */++/* ARCHIFY:MOTION_GOVERNOR */++ /* Verified repository evidence is emitted only after the renderer checks+ the authored GitHub revision, source blobs, and optional line ranges+ against the explicit --repo-root. It remains outside the SVG so every+ canonical visual export stays free of repository paths. */+ Archify.sourceEvidence = (function () {+ var element = document.getElementById('archify-source-evidence-data');+ var payload = null;+ var svgNamespace = 'http://www.w3.org/2000/svg';+ if (element) {+ try {+ var parsed = JSON.parse(element.textContent || 'null');+ if (parsed && parsed.verified === true && parsed.repository && parsed.nodes) payload = parsed;+ } catch (_) {}+ }+ function installBeacons() {+ if (!payload) return 0;+ var svg = document.querySelector('.diagram-container svg');+ if (!svg) return 0;+ var installed = 0;+ Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {+ var id = node.getAttribute('data-node-id');+ var sources = payload.nodes[id];+ if (!Array.isArray(sources) || !sources.length || node.querySelector('[data-source-evidence-beacon]')) return;+ var shape = node.querySelector('[data-animate="node"]') || node.querySelector('[class*="c-"]');+ var box;+ try { box = (shape || node).getBBox(); } catch (_) { return; }+ if (!box || !Number.isFinite(box.x) || !Number.isFinite(box.y) || !Number.isFinite(box.width) || box.width < 36) return;++ var count = sources.length;+ var label = viewerCount('viewer.passport.beacon', count);+ var beacon = document.createElementNS(svgNamespace, 'g');+ beacon.classList.add('source-evidence-beacon');+ beacon.setAttribute('data-source-evidence-beacon', '');+ beacon.setAttribute('aria-hidden', 'true');+ var brandOffset = node.hasAttribute('data-node-brand') ? 24 : 0;+ beacon.setAttribute('transform', 'translate(' + (box.x + box.width - 35 - brandOffset) + ' ' + (box.y + 5) + ')');+ var title = document.createElementNS(svgNamespace, 'title');+ title.textContent = label;+ var plate = document.createElementNS(svgNamespace, 'rect');+ plate.setAttribute('width', '30');+ plate.setAttribute('height', '12');+ plate.setAttribute('rx', '6');+ var text = document.createElementNS(svgNamespace, 'text');+ text.setAttribute('x', '15');+ text.setAttribute('y', '8.25');+ text.textContent = viewerText('viewer.passport.sourceMarker') + ' ' + count;+ beacon.appendChild(title);+ beacon.appendChild(plate);+ beacon.appendChild(text);+ node.appendChild(beacon);++ var originalLabel = node.getAttribute('aria-label') || '';+ node.setAttribute('data-source-evidence-count', String(count));+ node.setAttribute('data-source-evidence-original-label', originalLabel);+ node.setAttribute('aria-label', (originalLabel ? originalLabel + ', ' : '') + viewerCount('viewer.passport.sourceCount', count));+ installed += 1;+ });+ return installed;+ }+ return {+ available: function () { return Boolean(payload); },+ repository: function () { return payload ? payload.repository : null; },+ node: function (id) {+ var sources = payload && payload.nodes ? payload.nodes[id] : null;+ return Array.isArray(sources) ? sources.slice() : [];+ },+ installBeacons: installBeacons+ };+ })();+ Archify.sourceEvidence.installBeacons();++/* ARCHIFY:FOCUS */++/* ARCHIFY:INTENT_TRACE */++/* ARCHIFY:GUIDED_VIEWS */++ /* ============================================================+ Adaptive Reader Shell — one diagram across laptop and monitor.+ The canonical SVG and viewBox never change. On ordinary desktop pages,+ wide diagrams receive only enough outer width to use the available+ height without pushing summary cards below the viewport. Mobile,+ embed, presentation, print, and non-wide diagrams retain their own+ established layout contracts.+ ============================================================ */+ Archify.waitForStableLayout = function (options) {+ options = options || {};+ var maximumFrames = Math.max(1, Number(options.maximumFrames) || 240);+ var fontsReady = document.fonts && document.fonts.ready+ ? document.fonts.ready.catch(function () {})+ : Promise.resolve();+ return fontsReady.then(function () {+ if (typeof options.schedule === 'function') options.schedule();+ return new Promise(function (resolve, reject) {+ var previous = '';+ var stableFrames = 0;+ var sampledFrames = 0;+ function sample() {+ sampledFrames += 1;+ if (typeof options.pending === 'function' && options.pending()) {+ previous = '';+ stableFrames = 0;+ } else {+ var current = typeof options.snapshot === 'function' ? options.snapshot() : '';+ if (current === previous) stableFrames += 1;+ else {+ previous = current;+ stableFrames = 0;+ }+ if (stableFrames >= 3) {+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });+ return;+ }+ }+ if (sampledFrames >= maximumFrames) {+ reject(new Error(options.timeoutMessage || 'Layout did not reach stable dimensions.'));+ return;+ }+ requestAnimationFrame(sample);+ }+ requestAnimationFrame(sample);+ });+ });+ };++/* ARCHIFY:READER_LAYOUT */+/* ARCHIFY:CHROME_LAYOUT */+/* ARCHIFY:CAMERA */+/* ARCHIFY:RADAR */++ /* ============================================================+ Presentation Stage — a shareable, viewport-filling live view.+ It changes only HTML layout and URL state; SVG semantics and export+ serialization remain untouched. Escape first clears an active guided+ view/focus, then exits the stage.+ ============================================================ */+ Archify.presentation = (function () {+ var html = document.documentElement;+ var btn = document.getElementById('btn-present');+ var label = document.getElementById('present-label');+ var previousScrollY = 0;++ function active() { return html.getAttribute('data-present') === 'true'; }++ function updateUrl(next) {+ try {+ var url = new URL(window.location.href);+ if (next) url.searchParams.set('present', '1');+ else url.searchParams.delete('present');+ history.replaceState(null, '', url.pathname + url.search + url.hash);+ } catch (_) {}+ }++ function render(next) {+ btn.setAttribute('aria-pressed', next ? 'true' : 'false');+ btn.setAttribute('aria-label', viewerText(next ? 'viewer.present.exit' : 'viewer.present.enter'));+ btn.title = viewerText(next ? 'viewer.present.exit.title' : 'viewer.present.enter.title');+ label.textContent = viewerText(next ? 'viewer.present.exit.label' : 'viewer.present.present');+ }++ function setActive(next, options) {+ options = options || {};+ next = Boolean(next);+ if (next === active()) {+ render(next);+ return next;+ }+ if (next) {+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ previousScrollY = window.scrollY || 0;+ html.setAttribute('data-present', 'true');+ try { window.scrollTo(0, 0); } catch (_) {}+ } else {+ html.removeAttribute('data-present');+ }+ render(next);+ if (options.updateUrl !== false) updateUrl(next);+ requestAnimationFrame(function () {+ if (Archify.view && typeof Archify.view.reset === 'function') {+ Archify.view.reset({ automatic: true });+ requestAnimationFrame(function () {+ if (Archify.view && typeof Archify.view.sync === 'function') Archify.view.sync();+ });+ }+ if (!next && previousScrollY) {+ try { window.scrollTo(0, previousScrollY); } catch (_) {}+ }+ });+ return next;+ }++ function toggle() { return setActive(!active()); }++ render(active());+ btn.addEventListener('click', toggle);++ return {+ enter: function () { return setActive(true); },+ exit: function () { return setActive(false); },+ toggle: toggle,+ active: active+ };+ })();++/* ARCHIFY:NODE_FINDER */++/* ARCHIFY:ROUTE_PROBE */++/* ARCHIFY:SEMANTIC_LENS */++ /* ============================================================+ Diagram Guide — a factual command deck over existing interactions.+ Counts come from compiled semantics; actions delegate to Finder, Route+ Probe, Semantic Radar, Semantic Lens, Story Trail, Presentation, theme, export, and+ camera without adding a second command implementation or SVG state.+ ============================================================ */+ Archify.guide = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector(':scope > svg');+ var trigger = document.getElementById('btn-diagram-guide');+ var panel = document.getElementById('diagram-guide');+ var closeBtn = document.getElementById('diagram-guide-close');+ var stats = document.getElementById('diagram-guide-stats');+ var actions = document.getElementById('diagram-guide-actions');+ var feedback = document.getElementById('diagram-guide-feedback');+ var storyBtn = actions.querySelector('[data-guide-action="story"]');+ var storyCopy = document.getElementById('diagram-guide-story-copy');+ var routePanel = document.getElementById('route-probe');++ function viewCount() {+ return Archify.guidedViews && Number(Archify.guidedViews.count) || 0;+ }+ function relationshipCount() {+ var seen = {};+ Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {+ var key = edge.getAttribute('data-edge-key') || [+ edge.getAttribute('data-edge-from'),+ edge.getAttribute('data-edge-to'),+ edge.getAttribute('data-edge-label') || ''+ ].join('\u0000');+ seen[key] = true;+ });+ return Object.keys(seen).length;+ }+ function renderFacts() {+ var nodes = svg.querySelectorAll('[data-node-id]').length;+ var relationships = relationshipCount();+ var views = viewCount();+ stats.textContent = viewerText('viewer.guide.facts', {+ nodes: viewerCount('viewer.guide.fact.node', nodes),+ relationships: viewerCount('viewer.guide.fact.relationship', relationships),+ views: viewerCount('viewer.guide.fact.view', views)+ });+ storyBtn.disabled = views === 0;+ storyBtn.setAttribute('aria-disabled', views === 0 ? 'true' : 'false');+ storyCopy.textContent = views+ ? viewerCount('viewer.guide.story.available', views)+ : viewerText('viewer.guide.story.unavailable');+ }+ function actionButtons() {+ return Array.prototype.slice.call(actions.querySelectorAll('.diagram-guide-action:not(:disabled)'));+ }+ function close(options) {+ options = options || {};+ panel.hidden = true;+ html.removeAttribute('data-guide-open');+ routePanel.removeAttribute('data-guide-open');+ trigger.setAttribute('aria-expanded', 'false');+ trigger.setAttribute('aria-label', viewerText('viewer.guide.open'));+ feedback.textContent = '';+ if (options.restoreFocus !== false) trigger.focus();+ return false;+ }+ function open() {+ if (html.getAttribute('data-embed') === 'true') return false;+ if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();+ if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);+ if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });+ if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });+ if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });+ if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {+ Archify.guidedViews.pause();+ }+ if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {+ Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: 'guide' });+ }+ renderFacts();+ panel.hidden = false;+ html.setAttribute('data-guide-open', 'true');+ routePanel.setAttribute('data-guide-open', 'true');+ trigger.setAttribute('aria-expanded', 'true');+ trigger.setAttribute('aria-label', viewerText('viewer.guide.close'));+ feedback.textContent = '';+ requestAnimationFrame(function () {+ var first = actionButtons()[0];+ if (first) first.focus();+ });+ return true;+ }+ function toggle() { return panel.hidden ? open() : close(); }+ function execute(action) {+ feedback.textContent = '';+ if (action === 'story' && !viewCount()) {+ feedback.textContent = viewerText('viewer.guide.noStory');+ return false;+ }+ close({ restoreFocus: false });+ if (action === 'find') return Archify.finder.open();+ if (action === 'route') return Archify.routeProbe.begin({ focusNode: true });+ if (action === 'map') return Archify.radar.open();+ if (action === 'lens') return Archify.semanticLens.open();+ if (action === 'story') return Archify.guidedViews.play();+ if (action === 'present') return Archify.presentation.enter();+ if (action === 'export') return Archify.exportMenu.open();+ if (action === 'theme') return Archify.theme.toggle();+ if (action === 'preset') return Archify.preset.cycle();+ if (action === 'reset') return Archify.view.reset();+ if (action === 'zoom-in') return Archify.view.zoomIn();+ if (action === 'zoom-out') return Archify.view.zoomOut();+ return false;+ }+ function actionForKey(key) {+ return {+ '/': 'find',+ r: 'route',+ m: 'map',+ l: 'lens',+ p: 'story',+ f: 'present',+ e: 'export',+ t: 'theme',+ s: 'preset',+ '0': 'reset',+ '+': 'zoom-in',+ '=': 'zoom-in',+ '-': 'zoom-out'+ }[key] || null;+ }++ trigger.addEventListener('click', toggle);+ closeBtn.addEventListener('click', function () { close(); });+ actions.addEventListener('click', function (event) {+ var button = event.target.closest('[data-guide-action]');+ if (!button || button.disabled) return;+ event.stopPropagation();+ execute(button.getAttribute('data-guide-action'));+ });+ panel.addEventListener('keydown', function (event) {+ if (event.key === 'Escape' || event.key === '?') {+ event.preventDefault();+ event.stopPropagation();+ close();+ return;+ }+ var buttons = actionButtons();+ var index = buttons.indexOf(document.activeElement);+ var next = null;+ if (index >= 0 && event.key === 'ArrowRight') next = (index + 1) % buttons.length;+ else if (index >= 0 && event.key === 'ArrowDown') next = (index + 1) % buttons.length;+ else if (index >= 0 && event.key === 'ArrowLeft') next = (index - 1 + buttons.length) % buttons.length;+ else if (index >= 0 && event.key === 'ArrowUp') next = (index - 1 + buttons.length) % buttons.length;+ else if (event.key === 'Home' && buttons.length) next = 0;+ else if (event.key === 'End' && buttons.length) next = buttons.length - 1;+ if (next !== null) {+ event.preventDefault();+ event.stopPropagation();+ buttons[next].focus();+ return;+ }+ var action = actionForKey(event.key.length === 1 ? event.key.toLowerCase() : event.key);+ if (!action) return;+ event.preventDefault();+ event.stopPropagation();+ execute(action);+ });+ document.addEventListener('click', function (event) {+ if (!panel.hidden && !panel.contains(event.target) && event.target !== trigger) close({ restoreFocus: false });+ });++ renderFacts();+ return {+ open: open,+ close: close,+ toggle: toggle,+ execute: execute,+ isOpen: function () { return !panel.hidden; },+ facts: function () {+ return {+ nodes: svg.querySelectorAll('[data-node-id]').length,+ relationships: relationshipCount(),+ views: viewCount()+ };+ }+ };+ })();++ /* ============================================================+ Global keyboard shortcuts+ ? -> open Diagram Guide+ T -> toggle theme+ S -> cycle visual style+ E -> open export menu+ F -> toggle presentation stage+ M -> toggle Semantic Radar+ L -> toggle Semantic Lens+ R -> start/clear Route Probe+ / -> open node finder or the active route endpoint picker+ + / - -> zoom, 0 -> reset view+ Escape -> clear temporary trace/focus/view first, then exit presentation+ Ignored when focus is inside an input/textarea/contenteditable.+ ============================================================ */+ document.addEventListener('keydown', function (e) {+ if (e.metaKey || e.ctrlKey || e.altKey) return;+ if (e.defaultPrevented) return;+ var t = e.target;+ if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;+ if (Archify.preset && Archify.preset.isOpen() && e.key !== 'Escape' && e.key !== 's' && e.key !== 'S') {+ Archify.preset.close(false);+ }+ if (e.key === '?') {+ e.preventDefault();+ Archify.guide.toggle();+ } else if (e.key === '/') {+ e.preventDefault();+ Archify.finder.open();+ } else if (e.key === 't' || e.key === 'T') {+ e.preventDefault();+ Archify.theme.toggle();+ } else if (e.key === 's' || e.key === 'S') {+ e.preventDefault();+ Archify.preset.cycle();+ } else if (e.key === 'e' || e.key === 'E') {+ e.preventDefault();+ if (!Archify.exportMenu.isOpen()) Archify.exportMenu.open();+ } else if (e.key === 'f' || e.key === 'F') {+ e.preventDefault();+ Archify.presentation.toggle();+ } else if (e.key === 'm' || e.key === 'M') {+ e.preventDefault();+ Archify.radar.toggle();+ } else if (e.key === 'l' || e.key === 'L') {+ e.preventDefault();+ Archify.semanticLens.toggle();+ } else if (e.key === 'r' || e.key === 'R') {+ e.preventDefault();+ Archify.routeProbe.toggle({ focusNode: true });+ } else if (e.key === '+' || e.key === '=') {+ e.preventDefault();+ Archify.view.zoomIn();+ } else if (e.key === '-') {+ e.preventDefault();+ Archify.view.zoomOut();+ } else if (e.key === '0') {+ e.preventDefault();+ Archify.view.reset();+ } else if (e.key === 'Escape' && Archify.preset.isOpen()) {+ e.preventDefault();+ Archify.preset.close(true);+ } else if (e.key === 'Escape' && Archify.semanticLens.isOpen()) {+ e.preventDefault();+ Archify.semanticLens.close({ restoreFocus: true });+ } else if (e.key === 'Escape' && Archify.semanticLens.active()) {+ e.preventDefault();+ Archify.semanticLens.clear({ preserveView: true });+ } else if (e.key === 'Escape' && Archify.guide.isOpen()) {+ e.preventDefault();+ Archify.guide.close({ restoreFocus: true });+ } else if (e.key === 'Escape' && Archify.radar.isOpen()) {+ e.preventDefault();+ Archify.radar.close({ restoreFocus: true });+ } else if (e.key === 'Escape' && Archify.routeProbe.active()) {+ e.preventDefault();+ Archify.routeProbe.escape({ restoreFocus: true });+ } else if (e.key === 'Escape' && Archify.intentTrace.active()) {+ e.preventDefault();+ Archify.intentTrace.clear();+ } else if (e.key === 'Escape' && Archify.focus.active()) {+ e.preventDefault();+ Archify.focus.clear({ restoreFocus: true });+ } else if (e.key === 'Escape' && Archify.presentation.active()) {+ e.preventDefault();+ Archify.presentation.exit();+ }+ });+ </script>+</body>+</html>diff --git a/viewer/viewer-camera.js b/viewer/viewer-camera.jsnew file mode 100644index 00000000..305e5c1d--- /dev/null+++ b/viewer/viewer-camera.js@@ -0,0 +1,526 @@+ Archify.view = (function () {+ var container = document.querySelector('.diagram-container');+ var svg = container.querySelector('svg');+ var outBtn = container.querySelector('[data-view="out"]');+ var resetBtn = container.querySelector('[data-view="reset"]');+ var resetDetailLabel = resetBtn.querySelector('[data-view-detail]');+ var resetPercentLabel = resetBtn.querySelector('[data-view-percent]');+ var inBtn = container.querySelector('[data-view="in"]');+ var state = { scale: 1, x: 0, y: 0, mode: 'overview' };+ var drag = null;+ var cameraTimer = null;+ var cameraFrame = null;+ var cameraGeneration = 0;+ var cameraTransaction = null;+ var clipFrame = 0;+ var resizeFrame = 0;+ var autoScrollUntil = 0;++ var viewBox = svg.viewBox && svg.viewBox.baseVal;++ function clamp() {+ var width = svg.clientWidth || 1;+ var height = svg.clientHeight || 1;+ state.x = Math.min(0, Math.max(width - width * state.scale, state.x));+ state.y = Math.min(0, Math.max(height - height * state.scale, state.y));+ }+ function reducedMotion() {+ return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;+ }+ function contentMetrics() {+ if (!viewBox || viewBox.width <= 0 || viewBox.height <= 0) return null;+ var width = svg.clientWidth || 1;+ var height = svg.clientHeight || 1;+ var scale = Math.min(width / viewBox.width, height / viewBox.height);+ return {+ width: width,+ height: height,+ scale: scale,+ offsetX: (width - viewBox.width * scale) / 2,+ offsetY: (height - viewBox.height * scale) / 2+ };+ }+ function logicalViewport() {+ var metrics = contentMetrics();+ if (!metrics) return null;+ var x;+ var y;+ var width;+ var height;+ if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram')) {+ x = viewBox.x + container.scrollLeft / metrics.scale;+ y = viewBox.y;+ width = Math.min(viewBox.width, Math.max(1, container.clientWidth / metrics.scale));+ height = viewBox.height;+ } else {+ x = viewBox.x + ((-state.x / state.scale) - metrics.offsetX) / metrics.scale;+ y = viewBox.y + ((-state.y / state.scale) - metrics.offsetY) / metrics.scale;+ width = Math.min(viewBox.width, metrics.width / state.scale / metrics.scale);+ height = Math.min(viewBox.height, metrics.height / state.scale / metrics.scale);+ }+ width = Math.max(1, Math.min(viewBox.width, width));+ height = Math.max(1, Math.min(viewBox.height, height));+ x = Math.max(viewBox.x, Math.min(viewBox.x + viewBox.width - width, x));+ y = Math.max(viewBox.y, Math.min(viewBox.y + viewBox.height - height, y));+ return { x: x, y: y, width: width, height: height, scale: state.scale };+ }+ function detailLevel() {+ if (state.mode === 'semantic') return 'full';+ if (state.scale >= 1.75) return 'full';+ if (state.scale >= 1) return 'read';+ return 'map';+ }+ function renderControls() {+ var semantic = state.mode === 'semantic' && state.scale > 1.01;+ var detail = detailLevel();+ var percent = Math.round(state.scale * 100) + '%';+ var levelLabel = viewerText('viewer.nav.level.' + detail);+ var detailHint = detail === 'map'+ ? viewerText('viewer.nav.detail.map')+ : detail === 'read'+ ? viewerText('viewer.nav.detail.read')+ : viewerText('viewer.nav.detail.full');+ var resolvedLevel = semantic ? viewerText('viewer.nav.level.auto') : levelLabel;+ var showDetailLevel = semantic || detail !== 'read';+ if (resetDetailLabel) {+ resetDetailLabel.textContent = resolvedLevel;+ resetDetailLabel.hidden = !showDetailLevel;+ }+ if (resetPercentLabel) resetPercentLabel.textContent = percent;+ resetBtn.toggleAttribute('data-detail-visible', showDetailLevel);+ resetBtn.title = viewerText('viewer.nav.camera.title', {+ semantic: semantic ? viewerText('viewer.nav.camera.semantic') : '',+ hint: detailHint+ });+ resetBtn.setAttribute('aria-label', viewerText('viewer.nav.camera', { hint: detailHint }));+ resetBtn.setAttribute('data-detail-level', detail);+ container.setAttribute('data-detail-level', detail);+ container.setAttribute('data-camera-mode', state.mode);+ container.setAttribute('data-camera-indicator', semantic ? 'true' : 'false');+ }+ function clipToViewport(camera) {+ camera = camera || state;+ if (camera.scale <= 1.001) {+ svg.style.removeProperty('clip-path');+ return;+ }+ var width = svg.clientWidth || 1;+ var height = svg.clientHeight || 1;+ var scale = camera.scale;+ var top = Math.max(0, Math.min(height, -camera.y / scale));+ var left = Math.max(0, Math.min(width, -camera.x / scale));+ var right = Math.max(0, Math.min(width, width - (width - camera.x) / scale));+ var bottom = Math.max(0, Math.min(height, height - (height - camera.y) / scale));+ svg.style.clipPath = 'inset(' + [top, right, bottom, left].map(function (value) {+ return Math.round(value * 1000) / 1000 + 'px';+ }).join(' ') + ')';+ }+ function cameraSettled(rendered) {+ return Math.abs(rendered.scale - state.scale) < 0.001 &&+ Math.abs(rendered.x - state.x) < 0.05 &&+ Math.abs(rendered.y - state.y) < 0.05;+ }+ function syncViewportClip() {+ if (clipFrame) cancelAnimationFrame(clipFrame);+ clipFrame = 0;+ function sample() {+ clipFrame = 0;+ var rendered = sampleRenderedState();+ clipToViewport(rendered);+ if (!cameraSettled(rendered)) clipFrame = requestAnimationFrame(sample);+ }+ sample();+ }+ function apply() {+ clamp();+ svg.style.transform = 'translate(' + state.x + 'px,' + state.y + 'px) scale(' + state.scale + ')';+ syncViewportClip();+ renderControls();+ outBtn.disabled = state.scale <= 1;+ inBtn.disabled = state.scale >= 3;+ container.classList.toggle('is-pannable', state.scale > 1);+ svg.setAttribute('data-view-scale', String(state.scale));+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();+ if (Archify.viewerChromeLayout && typeof Archify.viewerChromeLayout.schedule === 'function') {+ Archify.viewerChromeLayout.schedule();+ }+ }+ function sampleRenderedState() {+ var transform = '';+ try { transform = getComputedStyle(svg).transform || ''; } catch (_) {}+ var match = transform.match(/^matrix\(([^)]+)\)$/);+ if (!match) return { scale: state.scale, x: state.x, y: state.y, mode: state.mode };+ var values = match[1].split(',').map(Number);+ if (values.length !== 6 || !values.every(Number.isFinite)) {+ return { scale: state.scale, x: state.x, y: state.y, mode: state.mode };+ }+ return { scale: values[0], x: values[4], y: values[5], mode: state.mode };+ }+ function finishCameraTransaction(transaction, outcome) {+ if (!transaction || transaction.settled) return false;+ transaction.settled = true;+ transaction.state = outcome || 'complete';+ if (transaction.frame) cancelAnimationFrame(transaction.frame);+ if (transaction.timer) clearTimeout(transaction.timer);+ transaction.frame = null;+ transaction.timer = null;+ if (cameraTransaction === transaction) cameraTransaction = null;+ cameraFrame = null;+ cameraTimer = null;+ container.classList.remove('is-camera-moving');+ container.classList.remove('is-camera-transaction');+ container.removeAttribute('data-camera-transaction');+ if (Archify.focus && Archify.focus.reposition) Archify.focus.reposition();+ transaction.resolve({ id: transaction.id, state: transaction.state });+ return true;+ }+ function cameraReceipt(target, options) {+ var resolver;+ var transaction = {+ id: ++cameraGeneration,+ state: 'running',+ target: target,+ settled: false,+ frame: null,+ timer: null,+ finished: new Promise(function (resolve) { resolver = resolve; }),+ resolve: resolver,+ cancel: function (reason, commitTarget) {+ if (transaction.settled) return false;+ if (commitTarget && transaction.target) {+ if (Object.prototype.hasOwnProperty.call(transaction.target, 'scrollLeft')) {+ container.scrollLeft = transaction.target.scrollLeft;+ } else {+ state = {+ scale: transaction.target.scale,+ x: transaction.target.x,+ y: transaction.target.y,+ mode: transaction.target.mode+ };+ apply();+ }+ }+ return finishCameraTransaction(transaction, reason || 'cancelled');+ }+ };+ return transaction;+ }+ function stopCameraMotion(reason, commitTarget) {+ if (cameraTransaction && !cameraTransaction.settled) {+ cameraTransaction.cancel(reason || 'cancelled', commitTarget === true);+ return;+ }+ if (cameraTimer) clearTimeout(cameraTimer);+ if (cameraFrame) cancelAnimationFrame(cameraFrame);+ cameraTimer = null;+ cameraFrame = null;+ container.classList.remove('is-camera-moving');+ container.classList.remove('is-camera-transaction');+ container.removeAttribute('data-camera-transaction');+ }+ function interruptCamera(reason) {+ if (Archify.guidedViews && Archify.guidedViews.cancelHandoff) {+ Archify.guidedViews.cancelHandoff(reason || 'manual');+ }+ var rendered = sampleRenderedState();+ stopCameraMotion(reason || 'manual', false);+ state = rendered;+ state.mode = 'manual';+ apply();+ renderControls();+ if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {+ Archify.guidedViews.pause();+ }+ if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {+ Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: reason || 'manual' });+ }+ }+ function zoom(next, options) {+ options = options || {};+ if (options.manual !== false) interruptCamera();+ var previous = state.scale;+ next = Math.max(1, Math.min(3, Math.round(next * 4) / 4));+ if (next === previous) return;+ var centerX = (svg.clientWidth || 1) / 2;+ var centerY = (svg.clientHeight || 1) / 2;+ var contentX = (centerX - state.x) / previous;+ var contentY = (centerY - state.y) / previous;+ state.scale = next;+ state.x = centerX - contentX * next;+ state.y = centerY - contentY * next;+ apply();+ }+ function reset(options) {+ options = options || {};+ if (options.automatic !== true) interruptCamera();+ else stopCameraMotion('reset', false);+ state = { scale: 1, x: 0, y: 0, mode: 'overview' };+ apply();+ }+ function centerAt(logicalX, logicalY, options) {+ options = options || {};+ logicalX = Number(logicalX);+ logicalY = Number(logicalY);+ var metrics = contentMetrics();+ if (!metrics || !Number.isFinite(logicalX) || !Number.isFinite(logicalY)) return false;+ interruptCamera();+ if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram')) {+ state.scale = 1;+ state.x = 0;+ state.y = 0;+ state.mode = 'manual';+ apply();+ var mobileTarget = (logicalX - viewBox.x) * metrics.scale - container.clientWidth / 2;+ mobileTarget = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, mobileTarget));+ autoScrollUntil = Date.now() + 80;+ try { container.scrollTo({ left: mobileTarget, behavior: options.instant ? 'auto' : 'smooth' }); }+ catch (_) { container.scrollLeft = mobileTarget; }+ return true;+ }+ var minimumScale = Math.max(1, Math.min(3, Number(options.minimumScale) || 1));+ var requestedScale = Number(options.scale);+ state.scale = Math.max(minimumScale, Math.min(3, Number.isFinite(requestedScale) ? requestedScale : state.scale));+ var contentX = metrics.offsetX + (logicalX - viewBox.x) * metrics.scale;+ var contentY = metrics.offsetY + (logicalY - viewBox.y) * metrics.scale;+ state.x = metrics.width / 2 - contentX * state.scale;+ state.y = metrics.height / 2 - contentY * state.scale;+ state.mode = 'manual';+ apply();+ if (Archify.focus && Archify.focus.reposition) Archify.focus.reposition();+ return true;+ }+ function semanticIds(ids, includeNeighbors) {+ var seeds = {};+ var wanted = {};+ (ids || []).forEach(function (id) { seeds[id] = true; wanted[id] = true; });+ if (includeNeighbors) {+ Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ if (seeds[from] || seeds[to]) { wanted[from] = true; wanted[to] = true; }+ });+ }+ return wanted;+ }+ function boxesFor(ids, includeNeighbors) {+ var wanted = semanticIds(ids, includeNeighbors);+ return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'))+ .filter(function (node) { return wanted[node.getAttribute('data-node-id')]; })+ .map(function (node) {+ try { return node.getBBox(); } catch (_) { return null; }+ })+ .filter(Boolean);+ }+ function frameDesktop(ids, options) {+ options = options || {};+ var boxes = boxesFor(ids, options.includeNeighbors === true);+ if (!boxes.length || !viewBox || viewBox.width <= 0 || viewBox.height <= 0) return false;+ var svgWidth = svg.clientWidth || 1;+ var svgHeight = svg.clientHeight || 1;+ var contentScale = Math.min(svgWidth / viewBox.width, svgHeight / viewBox.height);+ var contentOffsetX = (svgWidth - viewBox.width * contentScale) / 2;+ var contentOffsetY = (svgHeight - viewBox.height * contentScale) / 2;+ var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));+ var minY = Math.min.apply(Math, boxes.map(function (box) { return box.y; }));+ var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));+ var maxY = Math.max.apply(Math, boxes.map(function (box) { return box.y + box.height; }));+ var bounds = {+ x: contentOffsetX + minX * contentScale,+ y: contentOffsetY + minY * contentScale,+ width: Math.max(1, (maxX - minX) * contentScale),+ height: Math.max(1, (maxY - minY) * contentScale)+ };+ var padding = options.padding || 48;+ var left = padding;+ var right = svgWidth - padding;+ var top = padding;+ var bottom = svgHeight - Math.max(padding, 72);+ var containerRect = container.getBoundingClientRect();+ var visibleTop = Math.max(0, -containerRect.top);+ var visibleBottom = Math.min(svgHeight, window.innerHeight - containerRect.top);+ if (visibleBottom - visibleTop >= 240) {+ top = Math.max(top, visibleTop + padding);+ bottom = Math.min(bottom, visibleBottom - Math.max(padding, 72));+ }+ var chip = document.getElementById('focus-chip');+ if (chip && !chip.hidden) {+ var lensEnd = chip.offsetLeft + chip.offsetWidth + 24 - (svg.offsetLeft || 0);+ left = Math.max(left, Math.min(svgWidth * 0.42, lensEnd));+ }+ var routeReceipt = document.getElementById('route-probe');+ if (routeReceipt && !routeReceipt.hidden && routeReceipt.hasAttribute('data-route-journey')) {+ var receiptTop = routeReceipt.offsetTop;+ var receiptBottom = receiptTop + routeReceipt.offsetHeight;+ if (receiptTop < svgHeight / 2) top = Math.max(top, receiptBottom + 24);+ else bottom = Math.min(bottom, receiptTop - 24);+ }+ if (right <= left || bottom <= top) return false;+ var maxScale = options.maxScale || (options.includeNeighbors ? 1.9 : 2.15);+ var targetScale = Math.min((right - left) / bounds.width, (bottom - top) / bounds.height) * 0.9;+ targetScale = Math.max(1, Math.min(maxScale, targetScale));+ if (targetScale < 1.08) targetScale = 1;+ var target = {+ scale: Math.round(targetScale * 100) / 100,+ x: 0,+ y: 0,+ mode: 'semantic'+ };+ target.x = (left + right) / 2 - (bounds.x + bounds.width / 2) * target.scale;+ target.y = (top + bottom) / 2 - (bounds.y + bounds.height / 2) * target.scale;+ var start = sampleRenderedState();+ stopCameraMotion('replaced', false);+ var transaction = cameraReceipt(target, options);+ cameraTransaction = transaction;+ var instant = options.instant === true || reducedMotion() || document.hidden;+ if (instant) {+ state = target;+ apply();+ finishCameraTransaction(transaction, reducedMotion() ? 'reduced-motion' : (document.hidden ? 'hidden' : 'complete'));+ return transaction;+ }+ var duration = Math.max(180, Math.min(520, Number(options.duration) || 420));+ var startedAt = 0;+ state = start;+ state.mode = 'semantic';+ apply();+ container.classList.add('is-camera-moving');+ container.classList.add('is-camera-transaction');+ container.setAttribute('data-camera-transaction', String(transaction.id));+ var step = function (timestamp) {+ if (cameraTransaction !== transaction || transaction.settled) return;+ if (!startedAt) startedAt = timestamp;+ var fraction = Math.max(0, Math.min(1, (timestamp - startedAt) / duration));+ var eased = 1 - Math.pow(1 - fraction, 3);+ state = {+ scale: start.scale + (target.scale - start.scale) * eased,+ x: start.x + (target.x - start.x) * eased,+ y: start.y + (target.y - start.y) * eased,+ mode: 'semantic'+ };+ apply();+ if (fraction < 1) {+ transaction.frame = requestAnimationFrame(step);+ cameraFrame = transaction.frame;+ } else {+ state = target;+ apply();+ finishCameraTransaction(transaction, 'complete');+ }+ };+ transaction.frame = requestAnimationFrame(step);+ cameraFrame = transaction.frame;+ return transaction;+ }+ function reveal(ids, options) {+ options = options || {};+ if (window.innerWidth > 720) return frameDesktop(ids, options);+ stopCameraMotion('replaced', false);+ state.scale = 1;+ state.x = 0;+ state.y = 0;+ state.mode = 'semantic';+ apply();+ if (!container.hasAttribute('data-wide-diagram')) {+ var contained = cameraReceipt({ scale: 1, x: 0, y: 0, mode: 'semantic' }, options);+ cameraTransaction = contained;+ finishCameraTransaction(contained, 'complete');+ return contained;+ }+ var boxes = boxesFor(ids, options.includeNeighbors === true);+ if (!boxes.length || !viewBox || viewBox.width <= 0) return false;+ var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));+ var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));+ var center = ((minX + maxX) / 2 / viewBox.width) * (svg.clientWidth || 1);+ var target = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, center - container.clientWidth / 2));+ var transaction = cameraReceipt({ scrollLeft: target }, options);+ cameraTransaction = transaction;+ var instant = options.instant === true || reducedMotion() || document.hidden;+ autoScrollUntil = Date.now() + (instant ? 50 : 470);+ try { container.scrollTo({ left: target, behavior: instant ? 'auto' : 'smooth' }); }+ catch (_) { container.scrollLeft = target; }+ if (instant) finishCameraTransaction(transaction, reducedMotion() ? 'reduced-motion' : (document.hidden ? 'hidden' : 'complete'));+ else {+ transaction.timer = setTimeout(function () { finishCameraTransaction(transaction, 'complete'); }, 460);+ cameraTimer = transaction.timer;+ container.classList.add('is-camera-moving');+ container.setAttribute('data-camera-transaction', String(transaction.id));+ }+ return transaction;+ }+ function syncSemantic() {+ var guided = Archify.guidedViews && typeof Archify.guidedViews.focus === 'function'+ ? Archify.guidedViews.focus() : [];+ if (guided && guided.length) return reveal(guided, { reason: 'guided-sync' });+ var active = Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null;+ if (typeof active === 'string') return reveal([active], { includeNeighbors: true, reason: 'focus-sync' });+ if (Array.isArray(active) && active.length) return reveal(active, { reason: 'selection-sync' });+ return false;+ }+ function pinControls() {+ container.style.setProperty('--archify-scroll-x', container.scrollLeft + 'px');+ }+ function onScroll() {+ pinControls();+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();+ if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram') && Date.now() > autoScrollUntil) {+ interruptCamera();+ }+ }+ function onPointerEnd(event) {+ if (!drag) return;+ var moved = drag.moved;+ drag = null;+ container.classList.remove('is-panning');+ try { container.releasePointerCapture(event.pointerId); } catch (_) {}+ if (moved) {+ container.setAttribute('data-just-panned', 'true');+ setTimeout(function () { container.removeAttribute('data-just-panned'); }, 80);+ }+ }++ inBtn.addEventListener('click', function () { zoom(state.scale + 0.25); });+ outBtn.addEventListener('click', function () { zoom(state.scale - 0.25); });+ resetBtn.addEventListener('click', reset);+ container.addEventListener('pointerdown', function (event) {+ if (state.scale <= 1 || event.button !== 0 || event.target.closest('.diagram-nav, .focus-chip, .node-finder, .diagram-guide, .overview-map, .route-probe, .semantic-lens') || event.target.closest('[data-node-id]') || event.target.closest('[data-relationship-hit-key]')) return;+ interruptCamera();+ drag = { startX: event.clientX, startY: event.clientY, x: state.x, y: state.y, moved: false };+ container.classList.add('is-panning');+ try { container.setPointerCapture(event.pointerId); } catch (_) {}+ });+ container.addEventListener('pointermove', function (event) {+ if (!drag) return;+ var dx = event.clientX - drag.startX;+ var dy = event.clientY - drag.startY;+ if (Math.abs(dx) + Math.abs(dy) > 3) drag.moved = true;+ state.x = drag.x + dx;+ state.y = drag.y + dy;+ apply();+ });+ container.addEventListener('pointerup', onPointerEnd);+ container.addEventListener('pointercancel', onPointerEnd);+ container.addEventListener('scroll', onScroll, { passive: true });+ window.addEventListener('resize', function () {+ if (resizeFrame) cancelAnimationFrame(resizeFrame);+ resizeFrame = requestAnimationFrame(function () {+ resizeFrame = 0;+ if (state.mode === 'semantic') syncSemantic();+ else apply();+ });+ });+ window.addEventListener('hashchange', function () { requestAnimationFrame(syncSemantic); });+ apply();+ pinControls();+ requestAnimationFrame(syncSemantic);++ return {+ zoomIn: function () { zoom(state.scale + 0.25); },+ zoomOut: function () { zoom(state.scale - 0.25); },+ reset: reset,+ reveal: reveal,+ centerAt: centerAt,+ logicalViewport: logicalViewport,+ sync: syncSemantic,+ state: function () { return { scale: state.scale, x: state.x, y: state.y, mode: state.mode }; }+ };+ })();diff --git a/viewer/viewer-chrome-layout.js b/viewer/viewer-chrome-layout.jsnew file mode 100644index 00000000..c57fd26a--- /dev/null+++ b/viewer/viewer-chrome-layout.js@@ -0,0 +1,311 @@+ /* ============================================================+ Viewer Chrome Layout — keep HTML controls clear of the canonical SVG+ stage without changing authored geometry. The dock keeps its floating+ appearance while a small bottom stage rail becomes part of the reader+ budget whenever its zero-reserve position would enter the stage.+ ============================================================ */+ Archify.viewerChromeLayout = (function () {+ var html = document.documentElement;+ var container = document.querySelector('.diagram-container');+ var svg = container && container.querySelector(':scope > svg');+ var nav = container && container.querySelector('.diagram-nav');+ var legend = svg && svg.querySelector('[data-legend]');+ var frame = 0;+ var settleFrame = 0;+ var reserve = 0;+ var railLatched = false;+ var probingBaseline = false;+ var probePromise = null;+ var baselineIntersectionArea = 0;+ var baselineStageGap = null;+ var restorableReserve = 0;+ var probeFallbackReserve = 0;+ var lastReceipt = null;+ var SAFE_GAP = 10;++ function visible(element) {+ if (!element || element.hidden) return false;+ var style = window.getComputedStyle(element);+ return style.display !== 'none' && style.visibility !== 'hidden';+ }+ function usable(rect) {+ return Boolean(rect && rect.width > 0 && rect.height > 0);+ }+ function intersectionArea(a, b) {+ var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));+ var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));+ return width * height;+ }+ function protectedStageRect() {+ if (!svg) return null;+ var rect = svg.getBoundingClientRect();+ var transform = '';+ try { transform = window.getComputedStyle(svg).transform || ''; } catch (_) {}+ var scaleX = 1;+ var scaleY = 1;+ var translateX = 0;+ var translateY = 0;+ var matrix = transform.match(/^matrix\(([^)]+)\)$/);+ var matrix3d = transform.match(/^matrix3d\(([^)]+)\)$/);+ if (matrix) {+ var values = matrix[1].split(',').map(Number);+ if (values.length === 6 && values.every(Number.isFinite)) {+ scaleX = Math.abs(values[0]) || 1;+ scaleY = Math.abs(values[3]) || 1;+ translateX = values[4];+ translateY = values[5];+ }+ } else if (matrix3d) {+ var values3d = matrix3d[1].split(',').map(Number);+ if (values3d.length === 16 && values3d.every(Number.isFinite)) {+ scaleX = Math.abs(values3d[0]) || 1;+ scaleY = Math.abs(values3d[5]) || 1;+ translateX = values3d[12];+ translateY = values3d[13];+ }+ }+ var width = rect.width / scaleX;+ var height = rect.height / scaleY;+ var left = rect.left - translateX;+ var top = rect.top - translateY;+ return {+ x: left,+ y: top,+ left: left,+ top: top,+ right: left + width,+ bottom: top + height,+ width: width,+ height: height+ };+ }+ function eligible() {+ return Boolean(+ container && svg && nav &&+ window.innerWidth > 720 &&+ html.getAttribute('data-embed') !== 'true' &&+ (!window.matchMedia || !window.matchMedia('print').matches) &&+ visible(nav)+ );+ }+ function cameraAtBaseline() {+ var scale = Number(svg && svg.getAttribute('data-view-scale'));+ return !Number.isFinite(scale) || Math.abs(scale - 1) < 0.001;+ }+ function writeReserve(next, options) {+ options = options || {};+ next = Math.max(0, Math.ceil(next));+ if (Math.abs(next - reserve) < 1) return false;+ reserve = next;+ if (reserve) {+ if (options.remember !== false) restorableReserve = reserve;+ container.style.setProperty('--archify-nav-reserve', reserve + 'px');+ container.setAttribute('data-nav-stage-rail', 'true');+ html.setAttribute('data-nav-stage-rail', 'true');+ } else {+ container.style.removeProperty('--archify-nav-reserve');+ container.removeAttribute('data-nav-stage-rail');+ html.removeAttribute('data-nav-stage-rail');+ }+ if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') {+ Archify.readerLayout.schedule();+ }+ if (options.quiet !== true) {+ if (settleFrame) cancelAnimationFrame(settleFrame);+ settleFrame = requestAnimationFrame(function () {+ settleFrame = 0;+ schedule();+ });+ }+ return true;+ }+ function clear(options) {+ options = options || {};+ railLatched = false;+ if (options.preserveBaseline !== true) {+ baselineIntersectionArea = 0;+ baselineStageGap = null;+ restorableReserve = 0;+ }+ writeReserve(0, { quiet: probingBaseline });+ lastReceipt = {+ eligible: false,+ active: false,+ reserve: 0,+ gap: SAFE_GAP,+ baselineStageGap: null,+ stageGap: null,+ stageIntersectionArea: 0,+ baselineIntersectionArea: 0,+ intersectionArea: 0+ };+ return lastReceipt;+ }+ function measure() {+ frame = 0;+ if (probingBaseline) return null;+ if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });++ /* Camera transforms enlarge and translate authored paint inside the+ fixed, clipped root SVG viewport. They must not redefine the+ reader's baseline rail.+ Restore that baseline after temporary mobile/embed/print states.+ Camera Reset preserves the established rail while viewport, mode,+ and content changes remain responsible for baseline reprobes. */+ if (!cameraAtBaseline()) {+ if (reserve === 0 && restorableReserve > 0) {+ if (writeReserve(restorableReserve)) return null;+ }+ var cameraNavRect = nav.getBoundingClientRect();+ var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;+ var cameraStageRect = protectedStageRect();+ var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0+ ? intersectionArea(cameraNavRect, cameraLegendRect)+ : 0;+ lastReceipt = {+ eligible: true,+ active: reserve > 0,+ reserve: reserve,+ gap: SAFE_GAP,+ baselineStageGap: baselineStageGap == null ? null : Math.round(baselineStageGap * 100) / 100,+ stageGap: Math.round((cameraNavRect.top - cameraStageRect.bottom) * 100) / 100,+ stageIntersectionArea: Math.round(intersectionArea(cameraNavRect, cameraStageRect) * 100) / 100,+ baselineIntersectionArea: Math.round(baselineIntersectionArea * 100) / 100,+ intersectionArea: Math.round(cameraIntersectionArea * 100) / 100+ };+ return lastReceipt;+ }++ var navRect = nav.getBoundingClientRect();+ var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;+ var stageRect = protectedStageRect();+ if (!usable(navRect) || !usable(stageRect)) return clear();++ var actualIntersectionArea = usable(legendRect) ? intersectionArea(navRect, legendRect) : 0;+ var stageGap = navRect.top - stageRect.bottom;+ if (!railLatched && reserve === 0) {+ baselineIntersectionArea = actualIntersectionArea;+ baselineStageGap = stageGap;+ if (stageGap < SAFE_GAP) {+ railLatched = true;+ if (writeReserve(Math.max(0, SAFE_GAP - stageGap))) return null;+ }+ } else if (railLatched && reserve > 0 && stageGap < SAFE_GAP) {+ /* Keep the decision latched while Adaptive Reader incorporates the+ rail. Presentation and rounded layout values can require one+ bounded follow-up before the full stage gap is established. */+ var remaining = Math.max(1, SAFE_GAP - stageGap);+ if (writeReserve(reserve + remaining)) return null;+ }++ navRect = nav.getBoundingClientRect();+ legendRect = visible(legend) ? legend.getBoundingClientRect() : null;+ stageRect = protectedStageRect();+ stageGap = navRect.top - stageRect.bottom;+ lastReceipt = {+ eligible: true,+ active: reserve > 0,+ reserve: reserve,+ gap: SAFE_GAP,+ baselineStageGap: baselineStageGap == null ? null : Math.round(baselineStageGap * 100) / 100,+ stageGap: Math.round(stageGap * 100) / 100,+ stageIntersectionArea: Math.round(intersectionArea(navRect, stageRect) * 100) / 100,+ baselineIntersectionArea: Math.round(baselineIntersectionArea * 100) / 100,+ intersectionArea: Math.round((usable(legendRect) ? intersectionArea(navRect, legendRect) : 0) * 100) / 100+ };+ return lastReceipt;+ }+ function reprobe() {+ if (probingBaseline) return probePromise || Promise.resolve(false);+ if (!cameraAtBaseline()) {+ schedule();+ return Promise.resolve(false);+ }+ if (!reserve && !railLatched && !restorableReserve) {+ schedule();+ return Promise.resolve(false);+ }+ probeFallbackReserve = restorableReserve || reserve;+ probingBaseline = true;+ railLatched = false;+ baselineIntersectionArea = 0;+ baselineStageGap = null;+ restorableReserve = 0;+ writeReserve(0, { quiet: true });+ var readerReady = Archify.readerLayout && typeof Archify.readerLayout.whenStable === 'function'+ ? Archify.readerLayout.whenStable().catch(function () {})+ : Promise.resolve();+ probePromise = readerReady.then(function () {+ probingBaseline = false;+ probePromise = null;+ if (!cameraAtBaseline() && probeFallbackReserve > 0) {+ restorableReserve = probeFallbackReserve;+ }+ probeFallbackReserve = 0;+ schedule();+ return true;+ });+ return probePromise;+ }+ function schedule() {+ if (frame) return;+ frame = requestAnimationFrame(measure);+ }+ function stableSnapshot() {+ var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };+ var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };+ var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };+ return [+ reserve,+ Math.round(containerRect.width * 100) / 100,+ Math.round(containerRect.height * 100) / 100,+ Math.round(navRect.left * 100) / 100,+ Math.round(navRect.top * 100) / 100,+ Math.round(legendRect.left * 100) / 100,+ Math.round(legendRect.top * 100) / 100,+ railLatched ? 'latched' : 'clear',+ lastReceipt ? lastReceipt.stageGap : ''+ ].join('|');+ }+ function whenStable() {+ return Archify.waitForStableLayout({+ schedule: schedule,+ pending: function () { return Boolean(frame || settleFrame || probingBaseline); },+ snapshot: stableSnapshot,+ timeoutMessage: 'Viewer chrome layout did not reach stable dimensions.'+ });+ }++ window.addEventListener('resize', reprobe, { passive: true });+ window.addEventListener('load', schedule, { once: true });+ window.addEventListener('beforeprint', schedule);+ window.addEventListener('afterprint', reprobe);+ if (document.fonts && document.fonts.ready) document.fonts.ready.then(reprobe).catch(function () {});+ if (typeof ResizeObserver === 'function') {+ var resizeObserver = new ResizeObserver(schedule);+ [nav, svg, legend].forEach(function (element) { if (element) resizeObserver.observe(element); });+ }+ if (typeof MutationObserver === 'function') {+ var contentObserver = new MutationObserver(function (records) {+ var viewerModeChanged = records.some(function (record) { return record.target === html; });+ if (viewerModeChanged) reprobe();+ else schedule();+ });+ if (legend) contentObserver.observe(legend, { attributes: true, childList: true, subtree: true });+ contentObserver.observe(html, {+ attributes: true,+ attributeFilter: ['data-embed', 'data-present', 'data-preset', 'data-theme']+ });+ }+ schedule();++ return {+ measure: measure,+ schedule: schedule,+ reprobe: reprobe,+ whenStable: whenStable,+ stageRect: protectedStageRect,+ active: function () { return reserve > 0; },+ receipt: function () { return lastReceipt || measure(); }+ };+ })();