← Files LegalQuants LitigationARCHIVED FILE
skills/legaldesign/assets/templates/stacked-explainer.template.html
242 KB · Oct 5, 2026 · 18:33 UTC
<!doctype html><html lang="en" data-theme="light" data-composed-shell="" data-fixed-pages="4:3" data-stable-type="" data-page-layout="adaptive" data-legaldesign-ready="true" style="--ld-index-left: 0px; --ld-result-top: 54px; --ld-page-scale: 1; --ld-page-width: 1256px; --ld-page-height: 734px; --ld-page-left: 12px; --ld-page-top: 54px; --ld-approach-top: 50px;" data-template-id="legaldesign-template-stacked-explainer" data-template-kind="packaged" data-template-blueprint-id="legaldesign-template-stacked-explainer" data-exported="template"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>[Matter] · LegalDesign template</title><style id="ld-composed-shell-style">:root{color-scheme:light;--bg: #fbfbfb;--card: #ffffff;--ink: #111111;--muted: #565656;--faint: #6f6f6f;--line: rgba(17, 17, 17, .14);--line-strong: rgba(17, 17, 17, .32);--red: #c92014;--tint: #f3f3f3;--scrim: rgba(17, 17, 17, .52);--shadow-soft: 0 1px 3px rgba(17, 17, 17, .08), 0 6px 18px rgba(17, 17, 17, .05);--shadow: 0 22px 60px rgba(17, 17, 17, .18);--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;--serif: Charter, "Iowan Old Style", Georgia, serif}html[data-theme=dark]{color-scheme:dark;--bg: #000000;--card: #111111;--ink: #f2f2f0;--muted: #b4b4b0;--faint: #8d8d89;--line: rgba(242, 242, 240, .14);--line-strong: rgba(242, 242, 240, .32);--red: #ff5a4e;--tint: #161616;--scrim: rgba(0, 0, 0, .7);--shadow-soft: 0 1px 3px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .35);--shadow: 0 22px 60px rgba(0, 0, 0, .62)}*{box-sizing:border-box}html,body{min-height:100%;background:var(--bg);color:var(--ink)}body{margin:0;font-family:var(--sans);-webkit-font-smoothing:antialiased}button,input,select,textarea{color:inherit;font:inherit}button,select{cursor:pointer}a{color:var(--red);text-decoration:underline;text-underline-offset:.12em}:focus-visible{outline:2px solid var(--red);outline-offset:2px}[hidden]{display:none!important}.ld-bar{position:sticky;top:0;z-index:40;display:flex;min-height:48px;align-items:center;gap:8px;border-bottom:1px solid var(--line);background:var(--card);padding:6px 12px}.ld-matter{min-width:0;flex:1 1 auto;margin:0;overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.ld-decision-inputs{display:flex;align-items:center;gap:6px}.ld-composed-main{width:min(1280px,calc(100% - clamp(36px,6vw,84px)));margin:0 auto;padding:clamp(22px,3vw,36px) 0 20px}#ld-page-approach{display:flex;flex:0 0 auto;align-items:center;gap:2px;width:fit-content;max-width:100%;margin:0 0 14px;border:1px solid var(--line-strong);border-radius:999px;background:var(--card);padding:2px}.ld-approach-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}#ld-page-approach button{display:inline-flex;min-height:28px;align-items:center;gap:6px;border:0;border-radius:999px;background:transparent;padding:5px 10px;font-size:11.5px;font-weight:600}#ld-page-approach button span{color:var(--red);font-weight:700}#ld-page-approach button[aria-pressed=true]{background:var(--ink);color:var(--bg)}#ld-page-approach button:focus-visible{outline:2px solid var(--red);outline-offset:2px}#ld-page-approach button[aria-pressed=true] span{color:inherit}.ld-page-approach{width:100%}.ld-composed-section+.ld-composed-section{margin-top:clamp(12px,1.5vw,18px)}.ld-composed-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:clamp(12px,1.25vw,18px);align-items:start}.ld-composed-unit{position:relative;grid-row:var(--ld-row);grid-column:var(--ld-column) / span var(--ld-span);min-width:0;container-type:inline-size}.ld-composed-unit[data-role=title]{width:100%;border:0;background:transparent;box-shadow:none;padding:0 0 2px}.ld-composed-unit[data-role=title] h1{max-width:none;margin:0;font-size:clamp(36px,4.2vw,58px);font-weight:700;letter-spacing:-.022em;line-height:1.03;text-wrap:balance}[data-variant-body]{font-size:15px;line-height:1.55}[data-variant-body]>:first-child{margin-top:0}[data-variant-body]>:last-child{margin-bottom:0}[data-variant-body] h2{margin:0 0 8px;font-size:clamp(19px,2vw,25px);letter-spacing:-.015em;line-height:1.12}[data-variant-body] p{margin:0 0 10px}[data-variant-body] ol,[data-variant-body] ul{margin:10px 0 0;padding-left:1.25em}[data-variant-body] li+li{margin-top:6px}.ld-composed-unit[data-role=summary]{max-width:72ch;padding:0;color:var(--muted);font-size:clamp(16px,1.45vw,20px);line-height:1.48}.ld-composed-unit[data-role=summary] [data-variant-body]{font-size:inherit}.ld-composed-unit[data-kind=figure]{overflow:visible;border:0;border-radius:7px;background:var(--tint);padding:clamp(20px,2.3vw,30px)}.ld-figure-title{max-width:64ch;margin:0 110px 12px 0;font-size:clamp(17px,1.55vw,20px);letter-spacing:-.01em;line-height:1.25}.ld-diagram{display:grid;min-height:220px;align-items:center}.ld-diagram svg{display:block;width:min(100%,800px);height:auto;margin-inline:auto}.ld-composed-unit[data-kind=card],.ld-composed-unit[data-kind=decision]{border:0;border-radius:5px;background:var(--card);box-shadow:var(--shadow-soft);padding:clamp(18px,2vw,20px)}.ld-composed-unit[data-kind=table]{overflow:hidden;border-block:1px solid var(--line-strong);padding-block:14px}.ld-composed-unit[data-role=action]{border-top:1px solid var(--line-strong);padding:16px 0 0;font-size:16px}.ld-composed-unit[data-kind=text][data-role=scope],.ld-composed-unit[data-kind=text][data-role=expected],.ld-composed-unit[data-kind=text][data-role=matter]{border-top:1px solid var(--line);padding:14px 0 0;color:var(--muted);font-size:12.5px}.ld-why{margin:16px 0 0;border-top:1px solid var(--line);padding-top:12px;color:var(--muted);font-size:12px;line-height:1.45}.ld-popup-trigger{cursor:pointer;transition:box-shadow .14s ease;-webkit-user-select:none;user-select:none}.ld-popup-trigger[data-kind=card]:hover{box-shadow:inset 0 0 0 1px var(--interaction),var(--shadow-soft)}.ld-decision{margin-top:18px;border-top:1px solid var(--line);padding-top:18px}.ld-decision h3{margin:0 0 14px;font-size:20px;line-height:1.25}.ld-decision-options{display:grid;gap:8px}.ld-decision-option{display:grid;grid-template-columns:28px minmax(0,1fr);gap:3px 10px;width:100%;border:1px solid var(--line-strong);border-radius:4px;background:var(--card);padding:12px;text-align:left}.ld-decision-option[aria-pressed=true]{border-color:var(--red)}.ld-decision-option strong{grid-row:1 / span 2;color:var(--red)}.ld-decision-option small{color:var(--muted);line-height:1.4}.ld-decision-inputs{align-items:stretch;margin-top:10px}.ld-decision-input{display:grid;flex:1 1 220px;gap:5px;color:var(--muted);font-size:12px}.ld-decision-input input,.ld-decision-input textarea{width:100%;border:1px solid var(--line-strong);border-radius:4px;background:var(--card);padding:9px}.ld-scrim{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;overflow:auto;background:var(--scrim);padding:22px}.pop{position:relative;width:min(720px,100%);max-height:calc(100dvh - 44px);overflow:auto;border:1px solid var(--line-strong);border-radius:5px;background:var(--card);box-shadow:var(--shadow);padding:25px}.ld-popup-close{position:absolute;top:10px;right:10px;width:38px;font-size:20px}.pop h2{max-width:18ch;margin:0 48px 12px 0;font-size:clamp(28px,4vw,42px);letter-spacing:-.025em;line-height:1.04}.ld-popup-lede{max-width:62ch;margin:0 48px 22px 0;color:var(--muted);font-size:15px;line-height:1.55}.ld-popup-section{display:grid;grid-template-columns:minmax(120px,.72fr) minmax(0,2fr);gap:18px;border-top:1px solid var(--line);padding:16px 0}.ld-popup-section h3{margin:0;font-size:13px;font-weight:650;line-height:1.35}.ld-popup-section p{margin:0;color:var(--muted);font-size:14px;line-height:1.55}.ld-popup-source{margin-top:4px;border-top:1px solid var(--line-strong);padding-top:16px}.ld-popup-source .out{margin:0;color:var(--muted);font-size:13px;line-height:1.5}@media(min-width:761px)and (max-height:820px){.ld-composed-main{padding-top:20px}#ld-page-approach{margin-bottom:8px}.ld-composed-section+.ld-composed-section{margin-top:10px}.ld-composed-unit[data-role=title] h1{font-size:clamp(42px,4vw,51px)}.ld-composed-unit[data-role=summary]{font-size:18px;line-height:1.4}.ld-composed-unit[data-kind=figure]{padding:16px 26px}.ld-figure-title{margin-bottom:8px}.ld-diagram{min-height:180px}.ld-composed-unit[data-kind=card],.ld-composed-unit[data-kind=decision]{padding-block:18px}}@media(max-width:760px){.ld-bar{flex-wrap:wrap}.ld-matter{flex:1 1 160px}.ld-controls{width:100%;overflow-x:auto}.ld-composed-main{width:min(100% - 24px,640px);padding-top:24px}#ld-page-approach{width:fit-content;max-width:100%}#ld-page-approach button{min-height:36px;justify-content:center}.ld-composed-grid{grid-template-columns:minmax(0,1fr)}.ld-composed-grid>.ld-composed-unit{grid-column:1!important;grid-row:auto!important}.ld-decision-inputs{flex-direction:column}.ld-composed-unit[data-role=title] h1{font-size:clamp(34px,11vw,52px)}.ld-composed-unit[data-role=summary]{padding-right:0;font-size:16px}.ld-composed-unit[data-kind=card],.ld-composed-unit[data-kind=decision]{padding-right:20px}.ld-composed-unit[data-kind=figure]{margin-inline:-12px;border-radius:0;padding-inline:12px}.ld-figure-title{margin-right:0}.ld-scrim{align-items:flex-end;padding:0}.pop{width:100%;max-height:88dvh;border-radius:5px 5px 0 0}.pop h2{max-width:calc(100% - 48px);font-size:30px}.ld-popup-section{grid-template-columns:minmax(0,1fr);gap:6px}}
</style><style id="ld-design-authority"></style><style id="ld-tokens">:root,[data-theme=light]{color-scheme:light;--bg: #fbfbfb;--card: #ffffff;--card-strong: #ffffff;--ink: #111111;--muted: #565656;--faint: #6f6f6f;--line: rgba(17, 17, 17, .13);--line-strong: rgba(17, 17, 17, .3);--red: #c92014;--red-strong: #a01a10;--red-wash: rgba(201, 32, 20, .055);--insert: #2456d6;--interaction: #767676;--detail-feedback: var(--interaction);--tint: #f3f3f3;--scrim: rgba(17, 17, 17, .52);--shadow-soft: 0 1px 3px rgba(17, 17, 17, .08), 0 6px 18px rgba(17, 17, 17, .05);--shadow: 0 22px 60px rgba(17, 17, 17, .18);--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;--serif: Charter, "Iowan Old Style", Georgia, serif;--label: var(--sans);--ld-type-title: 28px;--ld-type-section: 20px;--ld-type-body: 16px;--ld-type-caption: 12px;--ld-space: 8px;--ld-content-gap: 16px;--ld-content-padding: 24px}[data-theme=dark]{color-scheme:dark;--bg: #000000;--card: #111111;--card-strong: #171717;--ink: #f2f2f0;--muted: #b4b4b0;--faint: #8d8d89;--line: rgba(242, 242, 240, .14);--line-strong: rgba(242, 242, 240, .32);--red: #ff5a4e;--red-strong: #ff7d73;--red-wash: rgba(255, 90, 78, .12);--insert: #6fa0ff;--interaction: #a0a09c;--tint: #161616;--scrim: rgba(0, 0, 0, .68);--shadow-soft: 0 1px 3px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .35);--shadow: 0 22px 60px rgba(0, 0, 0, .62)}*{box-sizing:border-box}html,body{background:var(--bg)}html{min-height:100%;color:var(--ink);font-family:var(--sans)}body{min-height:100%;margin:0;color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased}button,input,textarea,select{color:inherit;font:inherit}button,select{cursor:pointer}button:disabled,select:disabled{cursor:default;opacity:.42}a{color:var(--red);text-decoration:underline;text-underline-offset:.12em}a:hover{text-decoration-thickness:2px}html :focus-visible,html #ld-page-approach button:focus-visible{outline:2px solid var(--interaction);outline-offset:2px}[data-detail]:focus-visible,[data-evidence]:focus-visible{outline:2px solid var(--detail-feedback);outline-offset:2px}svg [data-detail]:focus-visible{outline:none}html:not([data-input-modality=pointer]) svg [data-detail]:focus-visible:not(:has(>:is(rect,path,circle,ellipse,polygon,polyline):first-child)){outline:2px solid var(--detail-feedback);outline-offset:3px}html:not([data-input-modality=pointer]) svg [data-detail]:focus-visible>:is(rect,path,circle,ellipse,polygon,polyline):first-child{stroke:var(--detail-feedback);stroke-width:2px}.ld-control:focus:not(:focus-visible),.ld-tool:focus:not(:focus-visible),.ld-ab button:focus:not(:focus-visible),.ld-why-toggle:focus:not(:focus-visible),.ld-popup-close:focus:not(:focus-visible){outline:none}[hidden]{display:none!important}.doc-text{font-family:var(--serif)}.ld-bar{position:sticky;top:0;z-index:40;display:flex;min-height:44px;align-items:center;gap:10px;padding:5px 10px;border-bottom:1px solid var(--line);background:var(--card)}.ld-matter{min-width:0;flex:1 1 auto;margin:0;overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.ld-controls,.ld-editor-tools{display:flex;align-items:center;gap:2px}.ld-controls{max-width:calc(100vw - 220px);overflow-x:auto;border:1px solid var(--line-strong);background:var(--card);padding:2px;scrollbar-width:none}.ld-controls::-webkit-scrollbar{display:none}.ld-control,.ld-ab button,.ld-why-toggle,.ld-popup-close{min-height:27px;border:0;border-radius:2px;background:transparent;padding:5px 9px;font-size:11.5px;font-weight:600;line-height:1;white-space:nowrap}.ld-tool,.ld-palette{min-width:27px;min-height:27px;border:1px solid var(--line-strong);border-radius:999px;background:var(--card);padding:0 8px;color:var(--ink);font-size:10px;font-weight:600;line-height:1;white-space:nowrap}.ld-control:hover,.ld-tool:hover,.ld-ab button:hover,.ld-why-toggle:hover,.ld-control[aria-pressed=true],.ld-ab button[aria-pressed=true]{background:var(--tint);color:var(--ink)}#theme-toggle{display:inline-grid;width:30px;min-width:30px;place-items:center;padding:0}.ld-theme-icon{width:15px;height:15px}.ld-theme-sun,html[data-theme=dark] .ld-theme-moon{display:none}html[data-theme=dark] .ld-theme-sun{display:block}.ld-tool[aria-pressed=true]{border-color:var(--interaction);color:var(--interaction)}.ld-editor-tools{display:none}html[data-mode=edit] .ld-editor-tools{display:flex}.ld-overflow-wrap{position:relative;display:contents}#editor-overflow-toggle{display:none}.ld-overflow-menu{display:contents}.ld-palette{max-width:88px;appearance:auto}.ld-form-nav{position:sticky;top:56px;z-index:30;display:flex;align-items:center;gap:8px;margin:0 0 24px;border:1px solid var(--line);border-radius:4px;background:var(--card);padding:8px}.ld-form-nav [data-walkthrough-status]{min-width:64px;flex:1 1 auto;color:var(--muted);font-size:12px;text-align:center}.ld-form-nav [data-report-section]{overflow:hidden;text-overflow:ellipsis}.ld-form-nav [aria-current=true]{border-color:var(--interaction)}.ld-unit{position:relative}.ld-unit-tools{position:absolute;top:0;right:0;z-index:70;display:none;width:max-content;align-items:center;gap:3px;margin:0;transform:translateY(calc(-100% - 4px));box-shadow:none}html[data-mode=edit] .ld-unit:is(:hover,:focus-within,.ld-selected)>.ld-unit-tools,html[data-mode=edit] .ld-unit:has(.ld-selected)>.ld-unit-tools{display:flex}.ld-ab{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:4px;background:var(--card);padding:2px}.ld-ab:before{content:"\2039";padding:0 3px;color:var(--faint)}.ld-ab:after{content:"\203a";padding:0 3px;color:var(--faint)}.ld-ab button{min-width:27px;min-height:25px;border:0;padding:3px 6px;font-size:10px}.ld-ab button+button:before{content:"\b7";margin-right:8px;color:var(--faint)}.ld-unit-tools .ld-why-toggle{min-height:27px;border:1px solid var(--line-strong);border-radius:999px;background:var(--card);padding:3px 8px;font-size:10px}.ld-why{margin:8px 0 0;border-top:1px solid var(--line);padding:9px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.ld-review,.ld-sheet-open{display:none!important}[data-editable][contenteditable=true]{cursor:text}#ld-editor-layer{position:fixed;inset:0;z-index:140;pointer-events:none}#ld-selection-box{position:fixed;display:none;border:1px solid var(--interaction);border-radius:2px}.ld-handle{position:absolute;width:10px;height:10px;border:1px solid var(--interaction);border-radius:2px;background:var(--card);pointer-events:auto}#ld-selection-box[data-diagram-label-selection] .ld-handle:is([data-handle=nw],[data-handle=n],[data-handle=ne]){top:-12px}#ld-selection-box[data-diagram-label-selection] .ld-handle:is([data-handle=sw],[data-handle=s],[data-handle=se]){bottom:-12px}#ld-selection-box[data-diagram-label-selection] .ld-handle:is([data-handle=nw],[data-handle=w],[data-handle=sw]){left:-12px}#ld-selection-box[data-diagram-label-selection] .ld-handle:is([data-handle=ne],[data-handle=e],[data-handle=se]){right:-12px}.ld-handle[data-handle=nw]{left:-5px;top:-5px;cursor:nwse-resize}.ld-handle[data-handle=n]{left:calc(50% - 5px);top:-5px;cursor:ns-resize}.ld-handle[data-handle=ne]{right:-5px;top:-5px;cursor:nesw-resize}.ld-handle[data-handle=e]{right:-5px;top:calc(50% - 5px);cursor:ew-resize}.ld-handle[data-handle=se]{right:-5px;bottom:-5px;cursor:nwse-resize}.ld-handle[data-handle=s]{left:calc(50% - 5px);bottom:-5px;cursor:ns-resize}.ld-handle[data-handle=sw]{left:-5px;bottom:-5px;cursor:nesw-resize}.ld-handle[data-handle=w]{left:-5px;top:calc(50% - 5px);cursor:ew-resize}#ld-marquee{position:fixed;display:none;border:1px dashed var(--interaction);border-radius:2px;background:color-mix(in srgb,var(--interaction) 7%,transparent)}[data-fill-token=card]{--ld-object-fill: var(--card);background:var(--card)!important}[data-fill-token=card-strong]{--ld-object-fill: var(--card-strong);background:var(--card-strong)!important}[data-fill-token=tint]{--ld-object-fill: var(--tint);background:var(--tint)!important}[data-fill-token=bg]{--ld-object-fill: var(--bg);background:var(--bg)!important}[data-fill-token=none]{--ld-object-fill: none;background:transparent!important}[data-text-token=ink]{--ld-object-text: var(--ink);color:var(--ink)!important}[data-text-token=muted]{--ld-object-text: var(--muted);color:var(--muted)!important}[data-text-token=faint]{--ld-object-text: var(--faint);color:var(--faint)!important}[data-text-token=red]{--ld-object-text: var(--red);color:var(--red)!important}[data-text-token=red-strong]{--ld-object-text: var(--red-strong);color:var(--red-strong)!important}svg [data-fill-token]>:is(rect,circle,ellipse,polygon){fill:var(--ld-object-fill)!important}[data-text-token] :is(h1,h2,h3,h4,p,span,li),[data-text-token]:is(text,tspan),[data-text-token] :is(text,tspan){color:var(--ld-object-text)!important;fill:var(--ld-object-text)!important}html[data-mode=edit] .ld-bar{z-index:150}html[data-mode=edit] .ld-scrim{padding-top:70px}html[data-mode=edit] .ld-scrim .pop{max-height:calc(100dvh - 92px)}html[data-mode=edit] [data-diagram-object]{cursor:move}.ld-added-text{min-height:28px;padding:6px;font-size:18px;line-height:1.4;color:var(--ink);overflow-wrap:anywhere}#ld-color-palette{position:fixed;z-index:200;width:232px;padding:16px;background:var(--card);color:var(--ink);border:1px solid var(--line-strong);border-radius:10px;box-shadow:var(--shadow)}#ld-color-palette strong{display:block;font-size:13px;margin-bottom:12px}#ld-color-palette small{display:block;margin-top:12px;font-size:11px;color:var(--muted)}.ld-swatch-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.ld-color-swatch{width:32px;height:32px;border:1px solid var(--line-strong);border-radius:4px;padding:0}.ld-color-swatch:hover,.ld-color-swatch[aria-pressed=true]{outline:2px solid var(--interaction);outline-offset:2px}.ld-popup-authoring{display:none}html[data-mode=edit] .ld-popup-authoring{display:flex;margin-top:20px;gap:8px}html .pop h2,html .pop .ld-popup-lede{max-width:none;width:100%;margin-right:0;text-wrap:wrap}html .pop h2{padding-right:32px}html .ld-composed-unit[data-role=summary]{max-width:none}html .ld-composed-unit[data-role=title] h1{width:100%;text-wrap:wrap}html .sb-title{padding-right:0}html .sb-title h1,html .sb-title .sb-sub,html .ld-title h1,html .subtitle{width:100%;max-width:none;text-wrap:wrap}html .ld-figure-title{max-width:none;margin-right:0}html[data-theme=dark] .ld-composed-unit[data-kind=figure]{background:var(--bg)}html[data-theme=dark] :is(.ld-card,.sb-card,.ld-composed-unit[data-kind=card]):not([data-fill-token]){--ink: #ffffff;--muted: #d0d0d0;--faint: #b4b4b4;color:var(--ink);background:var(--card);border:1.5px solid rgba(255,255,255,.58);box-shadow:none}html[data-theme=dark] :is(.ld-card,.sb-card,.ld-composed-unit[data-kind=card]):not([data-fill-token]):is(.accent,.open,[data-accent-role]){background:var(--card);border-color:var(--red)}html[data-theme=dark] :is(.ld-card,.sb-card,.ld-composed-unit[data-kind=card]):not([data-fill-token]) :is(a,.cite,.tag,.action){color:var(--red)}html[data-theme=dark] :is(.ld-card,.sb-card,.ld-composed-unit[data-kind=card]):not([data-fill-token]):is(.accent,.open,[data-accent-role]) :is(a,.cite,.tag,.action){color:var(--red)}html[data-theme=dark] :is([data-kind=text],[data-editor-object=text]){border:0;box-shadow:none}html[data-theme=dark] .ld-composed-unit[data-kind=card]:not([data-detail]):not([data-accent-role]):not(.accent):not(.open){border:0;box-shadow:none}.ld-scrim{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;overflow:auto;padding:22px;background:var(--scrim)}.pop{position:relative;width:min(720px,100%);max-height:calc(100dvh - 44px);overflow:auto;border:1px solid var(--line-strong);border-radius:5px;background:var(--card);box-shadow:var(--shadow);padding:25px}.pop:has(.exhibit-shot){width:min(880px,100%)}.pop .ld-popup-section p{max-width:72ch}html[data-theme=dark] .pop :is(.ld-popup-lede,.ld-popup-section p,.desc){color:var(--ink)}.pop[data-scroll-more]{box-shadow:inset 0 -16px 12px -14px var(--ink),var(--shadow)}.ld-popup-close{position:absolute;top:10px;right:10px;width:38px;padding:0;font-size:22px}.pop .tag{margin:0 48px 7px 0;color:var(--red);font-size:11px;letter-spacing:.04em}.pop h2{margin:0 48px 8px 0;font-size:22px;line-height:1.15}.pop .desc{margin:0 0 16px;color:var(--muted);font-size:13px;line-height:1.5}.doc{overflow:hidden;border:1px solid var(--line-strong);border-radius:4px;background:var(--card-strong)}.doc-text{padding:16px 18px;font-size:14px;line-height:1.6}.doc blockquote.doc-text{margin:0;font-family:Charter,Bitstream Charter,Sitka Text,Cambria,serif;white-space:pre-wrap}.ld-source-excerpt>summary{padding:12px 0;cursor:pointer;text-decoration:underline;text-underline-offset:.15em}.doc details p{overflow-wrap:anywhere}.doc-cl,.doc-foot{margin:0;border-top:1px solid var(--line);padding:9px 18px;color:var(--muted);font-family:var(--sans);font-size:11px;line-height:1.4}.doc-foot{background:var(--tint)}.exhibit-shot{display:block;width:auto;max-width:100%;height:auto;border-top:1px solid var(--line)}.pop .out{margin:15px 0 0;font-size:13px}.ld-detail{cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}html :is([data-detail],[data-evidence]){cursor:pointer}html :is(p,span,h1,h2,h3,h4,h5,h6,em,strong,a,text,tspan):is([data-detail],[data-evidence]):not(.ld-card,.sb-card){text-decoration-line:underline;text-underline-offset:.15em;text-decoration-thickness:1px}html[data-mode=edit] [data-editable][contenteditable=true]{cursor:text}html .ld-composed-unit[data-kind=text]:is([data-detail],[data-evidence])>.ld-variant>[data-variant-body],html .ld-reader-popup-text{text-decoration-line:underline;text-underline-offset:.15em;text-decoration-thickness:1px}.ld-inline-detail{display:inline;border:0;border-radius:0;padding:0;background:transparent;color:inherit;font:inherit;text-align:inherit;white-space:normal;text-decoration:underline;text-underline-offset:.15em;text-decoration-thickness:1px}.ld-inline-detail:hover{color:var(--detail-feedback)}.ld-detail-linkline{margin-top:6px;font-size:.85em}html :is(.ld-card,.sb-card,.ld-composed-unit[data-kind=card]):is([data-detail],[data-evidence]):is(:hover,:focus-visible){border-color:var(--detail-feedback)}.ld-detail text{-webkit-user-select:none;user-select:none}html:not([data-mode=edit]) .ld-detail text{pointer-events:none}.ld-detail:hover>:is(.box,.band,.leaf,rect):first-child,html:not([data-input-modality=pointer]) .ld-detail:focus-visible>:is(.box,.band,.leaf,rect):first-child{stroke:var(--detail-feedback)!important;stroke-width:1.5!important}.ld-restore,.ld-save-banner{position:sticky;top:48px;z-index:35;display:flex;align-items:center;justify-content:center;gap:8px;border-bottom:1px solid var(--line-strong);background:var(--card);padding:8px 12px;color:var(--ink);font-size:12px}.ld-restore button{min-height:36px;border:1px solid var(--line-strong);border-radius:4px;background:var(--card);padding:6px 10px}.ld-save-banner{color:var(--muted);flex-wrap:wrap}html[data-fixed-pages] .ld-save-banner{position:fixed;top:var(--ld-result-top, 64px);right:12px;left:12px}.ld-save-banner .ld-export-preview{display:inline-flex;align-items:center;min-height:44px;padding:0 8px;color:var(--ink);text-decoration:underline;flex-shrink:0}@media(max-width:820px){.ld-unit-tools{position:relative;top:auto;right:auto;max-width:100%;margin:0 0 8px auto;transform:none}.ld-matter{display:none}.ld-bar{overflow:visible}.ld-controls{flex-wrap:wrap;margin-left:auto;max-width:100%;overflow:visible}html[data-mode=edit] .ld-controls{max-width:100%}.ld-overflow-menu{display:none;position:absolute;top:44px;right:8px;z-index:60;flex-wrap:wrap;width:min(330px,calc(100vw - 16px));border:1px solid var(--line-strong);border-radius:4px;background:var(--card);padding:7px}html[data-mode=edit] #editor-overflow-toggle{display:inline-flex}html[data-editor-menu=open] .ld-overflow-menu{display:flex}}@media(max-width:480px){#theme-toggle{width:44px;min-width:44px}.ld-bar{flex-wrap:wrap;padding-right:max(6px,env(safe-area-inset-right));padding-left:max(6px,env(safe-area-inset-left))}html[data-mode=edit] .ld-bar{flex-wrap:wrap}.ld-editor-tools{flex:0 0 100%;min-width:0;max-width:100%;overflow-x:auto}.ld-editor-tools .ld-tool,.ld-editor-tools select,.ld-unit-tools .ld-ab button,.ld-unit-tools .ld-why-toggle{min-width:44px;min-height:44px}.ld-controls{gap:3px}.ld-control{min-width:44px;min-height:44px;padding:6px 7px;font-size:11px}.ld-form-nav{top:54px;overflow-x:auto}.ld-scrim{align-items:flex-end;padding:0}.pop{width:100%;max-height:88dvh;border-right:0;border-bottom:0;border-left:0;border-radius:5px 5px 0 0;padding:20px 14px max(16px,env(safe-area-inset-bottom))}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}html[data-fixed-pages],html[data-fixed-pages] body{width:100%;height:100%;min-height:0;overflow:hidden}html[data-fixed-pages] .ld-fixed-page{position:fixed!important;inset:auto!important;left:var(--ld-page-left, 0px)!important;top:var(--ld-page-top, 100px)!important;width:var(--ld-page-width, 1200px)!important;height:var(--ld-page-height, 900px)!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;margin:0!important;padding:44px 48px!important;box-sizing:border-box!important;transform:scale(var(--ld-page-scale, 1));transform-origin:top left;overflow:visible!important;background:var(--bg);font-size:18px;line-height:1.45}html[data-fixed-pages] .ld-composed-main{width:auto!important;max-width:none!important;margin:0!important;padding:0!important}html[data-fixed-pages][data-stable-type] .ld-fixed-page{padding:var(--ld-content-padding)!important;font-size:var(--ld-type-body)}html[data-fixed-pages][data-stable-type] .ld-fixed-page :is(h1,.sb-title h1,.ld-title h1){font-size:var(--ld-type-title);font-weight:600;margin:0}html[data-fixed-pages][data-stable-type] .ld-fixed-page :is(h2,h3,.ld-figure-title){font-size:var(--ld-type-section);font-weight:600;margin-top:0}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-composed-grid>:first-child :is(h1,h2){font-size:var(--ld-type-title);line-height:1.15;letter-spacing:-.018em;color:var(--ink)}html[data-fixed-pages][data-stable-type] .ld-fixed-page :is([data-variant-body],.ld-composed-unit[data-role=summary]){font-size:var(--ld-type-body);line-height:1.5}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-composed-grid{gap:var(--ld-content-gap);align-content:start}@media(min-width:761px){html[data-fixed-pages][data-stable-type][data-has-slide-index=true] .ld-fixed-page .ld-composed-grid{min-height:192px}}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-composed-unit:is([data-kind=card],[data-kind=decision],[data-kind=figure]){padding:calc(var(--ld-space) * 2.5)}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-composed-unit[data-role=scope] [data-variant-body]{font-size:var(--ld-type-caption)}html[data-fixed-pages][data-stable-type] .ld-fixed-page [data-variant-body]>:last-child{margin-bottom:0}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-diagram svg{width:min(100%,880px);max-height:none}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-diagram svg.narrow-viz{width:min(100%,400px)}html[data-fixed-pages] #ld-page-approach{position:fixed;top:var(--ld-approach-top, 56px);left:var(--ld-page-left, 12px);z-index:36;margin:0;width:max-content;max-width:calc(100vw - 24px);flex-wrap:nowrap}html[data-fixed-pages] .ld-fixed-page .ld-composed-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:20px;align-items:start}html[data-fixed-pages] .ld-fixed-page .ld-composed-grid>.ld-composed-unit{grid-column:var(--ld-column) / span var(--ld-span)!important;grid-row:var(--ld-row) / span var(--ld-row-span, 1)!important}html[data-fixed-pages] .ld-fixed-page .ld-composed-section+.ld-composed-section{margin-top:20px}html[data-fixed-pages] .ld-fixed-page :is(h1,.sb-title h1,.ld-title h1){font-size:32px;line-height:1.15;letter-spacing:-.018em;margin-top:0}html[data-fixed-pages] .ld-fixed-page :is(h2,.ld-figure-title){font-size:22px;line-height:1.25}html[data-fixed-pages] .ld-fixed-page :is([data-variant-body],.ld-composed-unit[data-role=summary]){font-size:18px;line-height:1.45}html[data-fixed-pages] .ld-fixed-page .ld-composed-unit[data-kind=figure]{padding:20px;margin:0;border-radius:6px}html[data-fixed-pages] .ld-fixed-page :is(.ld-diagram,.ld-diagram svg){min-height:0}html[data-fixed-pages] .ld-fixed-page .ld-diagram svg{width:min(100%,800px);max-width:100%;height:auto;max-height:calc(var(--ld-page-height, 900px) * .52)}html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-diagram svg{width:min(100%,1000px)}html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-diagram svg.timeline-vertical{width:min(100%,470px);max-height:none;margin-inline:0}html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-composed-unit[data-kind=figure]:has(svg.timeline-vertical){width:100%;max-width:510px;justify-self:start}html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-composed-grid:has(svg.timeline-vertical){row-gap:16px}@media(min-width:1600px)and (min-aspect-ratio:8 / 5){html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-composed-unit[data-kind=card]{font-size:18px;width:100%;max-width:calc(72ch + 40px);justify-self:start}html[data-fixed-pages][data-composed-shell] .ld-fixed-page .ld-composed-unit[data-kind=card] [data-variant-body]{max-width:72ch}}html[data-fixed-pages] .ld-composed-unit[data-kind=card][data-role=action]{padding:20px;border-top:2px solid var(--red)}.ld-issue-body{grid-column:1 / -1;grid-row:var(--ld-row, 2);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ld-content-gap, 16px);min-width:0;align-items:start}.ld-issue-analysis,.ld-issue-support{display:grid;gap:var(--ld-content-gap, 16px);min-width:0;align-content:start}html[data-fixed-pages][data-composed-shell] .ld-issue-body .ld-composed-unit{grid-column:auto!important;grid-row:auto!important;width:100%;max-width:100%;min-width:0;justify-self:stretch;margin:0}html[data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-kind=card]{background:var(--card);border:1px solid var(--line);border-radius:6px;box-shadow:var(--card-shadow, 0 2px 8px #0000000c)}html[data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-role=action]{border-top:2px solid var(--red)}html[data-theme=dark][data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-kind=card]{border-color:var(--line-strong)}html[data-theme=dark][data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-role=action]{border-top-color:var(--red)}html[data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-kind=card]:is([data-detail],[data-evidence]):is(:hover,:focus-visible){border-color:var(--detail-feedback)}html[data-fixed-pages][data-composed-shell] .ld-issue-analysis>.ld-composed-unit[data-role=action]:is(:hover,:focus-visible){border-top-color:var(--red)}.ld-source-preview{margin:0;min-width:0;padding:20px;background:var(--card);border:1px solid var(--line-strong);border-radius:6px}.ld-source-preview :is(img,svg){display:block;width:auto;max-width:100%;height:auto;margin-inline:auto}.ld-source-preview blockquote{margin:0;padding:0;font-family:Charter,Bitstream Charter,Georgia,serif;font-size:18px;line-height:1.45;color:var(--ink)}.ld-source-preview :is(figcaption,.ld-source-caption){display:block;margin-top:12px;font-size:var(--ld-type-caption, 12px);line-height:1.4;color:var(--muted)}.ld-page-reader .ld-issue-body{display:flex;flex-direction:column}.ld-page-reader :is(.ld-issue-analysis,.ld-issue-support){width:100%}html[data-fixed-pages] .ld-composed-unit[data-kind=table] table{width:100%;border-collapse:collapse;text-align:left}html[data-fixed-pages] .ld-composed-unit[data-kind=table] :is(th,td){border-bottom:1px solid var(--line);padding:10px 12px;vertical-align:top;text-align:left}html[data-fixed-pages] .ld-composed-unit[data-kind=table] th{background:var(--tint);font-size:15px;font-weight:600}html[data-fixed-pages] .ld-composed-unit[data-kind=table] tr:last-child td{border-bottom:0}html[data-fixed-pages] .ld-composed-unit[data-role=scope] [data-variant-body]{font-size:13px;line-height:1.4}html[data-fixed-pages] .ld-fixed-page .ld-decision-inputs{flex-direction:row}html[data-fixed-pages] .ld-reference-page>.ld-figure{width:100%;margin-top:24px;padding:20px}html[data-fixed-pages] .ld-reference-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:none;gap:20px;margin-top:0;align-items:start}html[data-fixed-pages] .ld-reference-cards>.ld-card{grid-area:auto;width:auto}html[data-fixed-pages] .ld-reference-page .ld-card-copy{font-size:16px;line-height:1.4}html[data-fixed-pages] .ld-fixed-page .finding-grid{grid-template-columns:minmax(0,1.28fr) minmax(310px,.9fr)}html[data-fixed-pages] .ld-fixed-page .dash-head{grid-template-columns:minmax(180px,.65fr) minmax(0,2fr);gap:24px}html[data-fixed-pages] .ld-fixed-page .dash-facts :has(>.df){grid-template-columns:repeat(6,minmax(0,1fr))}html[data-fixed-pages] .ld-fixed-page :is(.issue-cards,.area-register,.sb-cards,.sb-open-rows,.sb-decisions){grid-template-columns:repeat(3,minmax(0,1fr))}html[data-fixed-pages] .ld-fixed-page .issue-row{min-width:0}html[data-fixed-pages] .ld-fixed-page .reg .rrow{grid-template-columns:18px minmax(0,1fr) auto}html[data-fixed-pages] .ld-fixed-page .report-register .reg .rrow{padding-block:5px}html[data-fixed-pages] .ld-fixed-page .reg .stw{grid-column:auto}html[data-fixed-pages] .ld-fixed-page .foot{position:absolute;bottom:12px;left:48px;right:48px;flex-direction:row}html[data-fixed-pages] .ld-fixed-page .sb-figure{padding:20px}html[data-fixed-pages] .ld-fixed-page .sb-figure .ld-diagram{width:min(920px,100%)}html[data-fixed-pages] .ld-fixed-page .sb-body{margin-top:24px}html[data-fixed-pages] .ld-fixed-page .sb-foot{flex-direction:row;margin-top:24px}.ld-reference-evidence{margin-top:14px;min-height:40px}html[data-fixed-pages] .ld-fixed-page .ld-unit-tools{position:absolute;inset:0 0 auto auto;width:max-content;margin:0;transform:scale(calc(1 / var(--ld-page-scale, 1))) translateY(-100%) translateY(var(--ld-context-offset, 0px));transform-origin:top right}.ld-page-fit-error{position:fixed;z-index:90;left:max(12px,var(--ld-page-left, 12px));right:12px;bottom:12px;padding:14px 18px;border:1px solid var(--red);border-radius:6px;background:var(--bg);color:var(--ink);font:14px / 1.45 var(--sans)}.ld-read-page{position:fixed;z-index:40;right:16px;bottom:12px;min-height:44px;width:44px;padding:0;display:grid;place-items:center;border-radius:6px;background:var(--card);font-size:14px}html .pop.ld-page-reader{width:min(760px,100%);max-height:calc(100dvh - 24px);overflow:auto;padding:46px 22px 24px;font-size:18px;line-height:1.5}.ld-page-reader .ld-reader-section{display:block;width:100%;max-width:none;margin:0 0 24px;padding:0;background:transparent;border:0;box-shadow:none}.ld-page-reader .ld-reader-unit{display:block;width:100%;margin:0 0 22px;padding:0}.ld-page-reader :is(.ld-composed-grid,.ld-core,.finding-grid,.dash-head,.sb-cards,.sb-open-rows,.sb-decisions,.ld-reference-cards){display:block}.ld-page-reader :is(.foot,.sb-foot,.ld-foot){position:static;margin-top:24px}.ld-page-reader :is(h1,h2,h3){font-size:22px;line-height:1.25;margin:0 0 12px}.ld-page-reader :is(p,li,span,td,th){font-size:18px;line-height:1.5}.ld-page-reader .ld-diagram{display:block;width:100%;overflow:auto}.ld-page-reader .ld-diagram svg{width:100%;max-width:none;height:auto}@media(max-width:600px){html .pop.ld-page-reader{padding-inline:14px}}@media print{html[data-fixed-pages],html[data-fixed-pages] body{overflow:visible;height:auto}html[data-fixed-pages] .ld-fixed-page{position:relative!important;left:0!important;top:0!important;transform:none;break-after:page}}html[data-has-slide-index=true] .ld-slide-index{position:fixed;inset:var(--ld-index-top, 72px) auto 0 var(--ld-index-left, 0px);z-index:35;display:flex;flex-direction:column;align-items:stretch;width:206px;margin:0;overflow:auto;border:0;border-right:1px solid var(--line);border-radius:0;background:var(--bg);padding:8px 12px 20px}.ld-slide-index [data-index-list]{display:flex;flex-direction:column;flex:1;gap:3px}.ld-slide-index [data-index-list][hidden]{display:none}.ld-slide-index .ld-index-toggle{width:100%;min-height:44px;margin-bottom:8px;border-bottom:1px solid var(--line);text-align:left}.ld-slide-index [data-report-section]{width:100%;display:block;min-height:28px;padding:4px 6px;flex-shrink:0;white-space:normal;text-align:left;overflow-wrap:anywhere;font-size:12px;font-weight:450;line-height:1.35;border-color:transparent;background:transparent;color:var(--muted)}.ld-slide-index [data-report-section]:has(>.ld-index-number){display:grid;grid-template-columns:14px 1fr;gap:6px}.ld-index-group{border:0;flex-shrink:0;margin-top:6px}.ld-index-group>summary{display:flex;align-items:baseline;gap:6px;padding:5px 6px;color:var(--muted);font-size:10px;font-weight:600;line-height:1.4;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;list-style:none}.ld-index-group>summary::-webkit-details-marker{display:none}.ld-index-group>summary:before{content:"\203a";width:8px;flex-shrink:0}.ld-index-group[open]>summary:before{content:"\2304"}.ld-index-group:has([aria-current=true])>summary{color:var(--ink)}.ld-index-group>summary:focus-visible{outline:2px solid var(--interaction);outline-offset:-2px}.ld-index-group-items{display:flex;flex-direction:column;gap:1px}.ld-slide-index[data-index-expanded=false] .ld-index-pager{display:none}@media(max-width:760px),(pointer:coarse){.ld-slide-index [data-report-section],.ld-index-group>summary{min-height:44px}}[data-section-target]{cursor:pointer}[data-section-target]:hover{box-shadow:inset 0 0 0 1px var(--detail-feedback),var(--shadow-soft)}[data-section-target]:focus-visible{outline:2px solid var(--detail-feedback);outline-offset:3px}.ld-overview-groups{grid-column:var(--ld-column, 1) / span var(--ld-span, 12);grid-row:var(--ld-row, auto);min-width:0;align-self:start;border-top:1px solid var(--line-strong)}.ld-overview-group{margin:0;border-bottom:1px solid var(--line-strong)}.ld-overview-group>summary{display:flex;align-items:center;gap:10px;min-height:36px;padding:7px 10px;color:var(--ink);cursor:pointer;list-style:none;font-size:16px;font-weight:600;line-height:1.35}.ld-overview-group>summary::-webkit-details-marker{display:none}.ld-overview-group>summary:before{content:"+";display:inline-block;width:14px;color:var(--muted);font-weight:450}.ld-overview-group[open]>summary:before{content:"\2212"}.ld-overview-group>summary:hover{background:var(--tint)}.ld-overview-group>summary:focus-visible{outline:2px solid var(--interaction);outline-offset:-2px}.ld-overview-group-count{margin-left:auto;color:var(--muted);font-size:12px;font-weight:450;white-space:nowrap}.ld-overview-group-label{min-width:0;overflow-wrap:anywhere}.ld-overview-topic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:4px 10px 12px}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-overview-topic-grid>section.ld-composed-unit{grid-area:auto!important;justify-self:stretch;width:auto;max-width:none;min-width:0;padding:10px 12px;background:var(--card);box-shadow:var(--shadow-soft);border:1px solid var(--line)}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-overview-topic-grid :is(h2,h3,p){font-size:16px;line-height:1.35}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-overview-topic-grid :is(h2,h3){margin:0;font-weight:600;color:var(--ink)}html[data-fixed-pages][data-stable-type] .ld-fixed-page .ld-overview-topic-grid p{margin-top:4px;color:var(--muted)}.ld-page-reader .ld-overview-topic-grid{grid-template-columns:1fr;padding:4px 0 12px}.ld-page-reader .ld-overview-group>summary{min-height:44px;font-size:18px}.ld-page-reader .ld-overview-topic-grid :is(h2,h3,p){font-size:18px}.ld-page-reader .ld-overview-topic-grid>section{padding:12px;border:1px solid var(--line);border-radius:4px}.ld-slide-index [data-report-section][aria-current=true]{color:var(--ink);background:var(--tint);border-color:var(--line-strong);font-weight:600}.ld-index-number{color:var(--faint);font-size:10px;padding-top:2px}[aria-current=true]>.ld-index-number{color:var(--red)}.ld-slide-index [data-report-section]:hover{color:var(--ink);background:var(--card)}.ld-slide-index .ld-index-pager{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:auto;padding-top:16px;border-top:1px solid var(--line)}.ld-slide-index .ld-index-pager [data-walkthrough-status]{grid-column:1 / -1;grid-row:1;padding:8px 0}html[data-stable-type] .ld-slide-index{overflow:hidden}html[data-stable-type] .ld-slide-index .ld-index-toggle{flex-shrink:0}html[data-stable-type] .ld-slide-index [data-index-list]{min-height:0;overflow-y:auto}html[data-stable-type] .ld-slide-index .ld-index-pager{flex-shrink:0;grid-template-columns:1fr auto 1fr;align-items:center;gap:4px;margin-top:10px;padding-top:8px}html[data-stable-type] .ld-slide-index .ld-index-pager [data-walkthrough-status]{grid-column:2;grid-row:1;padding:4px 0;font-size:11px}html[data-stable-type] .ld-slide-index [data-walkthrough-previous]{grid-column:1;grid-row:1}html[data-stable-type] .ld-slide-index [data-walkthrough-next]{grid-column:3;grid-row:1}@media(max-width:760px){html[data-stable-type] .ld-slide-index:not([data-index-expanded=true]) .ld-index-pager{display:none}}html[data-has-slide-index=true] .ld-composed-main,html[data-has-slide-index=true] .sb-stage{width:calc(100% - 250px);max-width:1320px;margin-left:226px;margin-right:24px}html[data-has-slide-index=true] .sb-stage{padding-inline:0}.ld-slide-index .sb-navigation{display:flex;flex-wrap:wrap;margin-top:16px;gap:8px}.ld-slide-index .sb-navigation .sb-pills{display:none}.ld-slide-index .sb-navigation #position-label{display:block;order:-1;width:100%;text-align:center;border:0;background:transparent}.ld-slide-index .sb-navigation button{flex:1;min-height:44px}@media(max-width:760px){html[data-has-slide-index=true] .ld-slide-index{left:12px;width:44px;overflow-x:hidden;background:var(--bg);border:0;padding:0}html[data-has-slide-index=true] .ld-slide-index[data-index-expanded=true]{z-index:38;width:min(280px,calc(100vw - 24px));padding:12px;background:var(--card);border-radius:12px;box-shadow:var(--shadow);bottom:auto;max-height:calc(100dvh - var(--ld-index-top, 72px) - 12px)}.ld-slide-index .ld-index-toggle{text-align:center;padding-inline:4px}html[data-has-slide-index=true] .ld-composed-main,html[data-has-slide-index=true] .sb-stage{width:calc(100% - 80px);margin-left:68px;margin-right:12px}}@media print{html[data-has-slide-index=true] .ld-slide-index{display:none}html[data-has-slide-index=true] .ld-composed-main,html[data-has-slide-index=true] .sb-stage{width:100%;max-width:none;margin:0}}
</style><script id="ld-components">(()=>{window.LegalDesign=window.LegalDesign||{};var re=window.LegalDesign,be=["flow","timeline","hierarchy","zones","beforeAfter","hub","compareTwo","funnel","loop","matrix","figurePath","stairSteps","pyramid","gears","rungBars","hairlineLine","hairlineArea","tickDonut","tickRows","pairedRungs","stackedRungs","plumbScatter","rungWaterfall","dotHeat","tickGauge","dumbbell","treemap","rungHistogram","tickBox","streamRibbon","rangeBars"],z=Object.create(null),me="http:"+"//www.w3.org/2000/svg",ge=Object.freeze(["open","incomplete","uncovered","recommendation","action","decision","active"]);function O(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function H(o,t,e){return pe(o,t),Object.keys(o).forEach(r=>{if(!e.includes(r))throw new TypeError(`${t}.${r} is an unknown field`)}),o}function pe(o,t="data"){if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError(`${t} must be an object`);return o}function p(o,t,e=!1){if(e&&o==null)return"";if(typeof o!="string"||!e&&!o.trim())throw new TypeError(`${t} must be ${e?"a string when supplied":"a non-empty string"}`);return o}function S(o,t,e,r){if(!Array.isArray(o)||o.length<e||o.length>r)throw new TypeError(`${t} must contain ${e===r?e:`${e}\u2013${r}`} items`);return o}function _(o,t,e,r=!1){if(!(r&&o==null)&&!e.includes(o))throw new TypeError(`${t} must be one of ${e.join(", ")}`)}function Z(o,t,e,r=e){return S(o,t,e,r),o.forEach((i,u)=>{p(i,`${t}[${u}]`)}),o}function I(o,t,e,r,i,u=[]){return S(o,t,e,r),o.forEach((l,c)=>{H(l,`${t}[${c}]`,i.concat(u)),i.forEach(a=>{p(l[a],`${t}[${c}].${a}`)}),u.forEach(a=>{a==="accentRole"?_(l[a],`${t}[${c}].${a}`,ge,!0):a!=="leaves"&&p(l[a],`${t}[${c}].${a}`,!0)})}),o}function ye(o){if(H(o,"opts",["narrow","compact","density","width","theme","ariaLabel"]),o.density!=null&&!["standard","compact"].includes(o.density))throw new TypeError("opts.density must be standard or compact");if(o.narrow!=null&&typeof o.narrow!="boolean")throw new TypeError("opts.narrow must be boolean");if(o.compact!=null&&typeof o.compact!="boolean")throw new TypeError("opts.compact must be boolean")}function j(o,t,e){const r=t&&e?`<rect class="detail-hit" x="${e[0]}" y="${e[1]}" width="${e[2]}" height="${e[3]}" fill="transparent" stroke="none" pointer-events="all"/>`:"";return typeof t=="string"&&t?`<g data-diagram-object class="ld-detail" role="button" tabindex="0" aria-haspopup="dialog" aria-controls="${O(t)}" data-detail="${O(t)}">${r}${o}</g>`:`<g data-diagram-object>${o}</g>`}function we(o){const t=[],e=r=>{typeof r=="string"&&r.trim()?t.push(r.trim()):Array.isArray(r)?r.forEach(e):r&&typeof r=="object"&&Object.keys(r).filter(i=>i!=="detail").forEach(i=>{e(r[i])})};return e(o),`Diagram showing ${t.slice(0,10).join(", ")}.`}function ie(o,t=20,e=3){const r=String(o).trim().split(/\s+/),i=[];return r.forEach(u=>{!i.length||`${i.at(-1)} ${u}`.length>t?i.push(u):i[i.length-1]+=` ${u}`}),i.length>e?[...i.slice(0,e-1),i.slice(e-1).join(" ")]:i}function g(o,t,e,r,i="",u=2,l="middle"){if(o==null||o==="")return"";const c=Math.max(5,Math.floor(r/(i==="edge"?8.25:6.2))),a=ie(o,c,u),s=e-(a.length-1)*7;return`<text class="${i}" x="${t}" y="${s}" text-anchor="${l}">${a.map((h,n)=>`<tspan x="${t}" dy="${n?14:0}">${O(h)}</tspan>`).join("")}</text>`}function te(o,t,e,r="",i={}){ye(t);const u=O(typeof t.ariaLabel=="string"&&t.ariaLabel?t.ariaLabel:we(i)),l=t.width==null?"100%":O(t.width),c=t.theme==null?"":` data-theme="${O(t.theme)}"`,a=o.includes('data-detail="')?"group":"img";return`<svg xmlns="${me}" class="library-viz diagram-viz${r?` ${r}`:""}" viewBox="${e}" width="${l}" role="${a}" aria-label="${u}"${c}><style>.diagram-viz{display:block;color:var(--ink);overflow:visible}.diagram-viz text{font-family:var(--sans);font-size:14px;font-weight:600;fill:var(--ink);stroke:none}.diagram-viz .sub{font-size:12.25px;font-weight:400;fill:var(--muted)}.diagram-viz .zone,.diagram-viz .edge{font-family:var(--sans);font-size:12.25px;font-weight:650;letter-spacing:0;text-transform:none}.diagram-viz .edge{fill:var(--muted)}.diagram-viz .line,.diagram-viz .hair{fill:none;stroke:var(--line-strong);stroke-width:1;vector-effect:non-scaling-stroke}.diagram-viz .box{fill:var(--card);stroke:transparent;stroke-width:1.5;filter:drop-shadow(0 1px 2px rgba(0,0,0,.06)) drop-shadow(0 7px 16px rgba(0,0,0,.07));vector-effect:non-scaling-stroke}.diagram-viz .box.tint{fill:var(--tint);stroke:var(--line-strong)}.diagram-viz .box.accent{fill:var(--red-wash);stroke:var(--red)}.diagram-viz .tint{fill:var(--tint)}.diagram-viz .inkfill{fill:var(--ink);fill-opacity:.1;stroke:var(--ink);stroke-width:1;vector-effect:non-scaling-stroke}.diagram-viz .band{fill:var(--tint);stroke:var(--line-strong);stroke-width:1;vector-effect:non-scaling-stroke}.diagram-viz .edge-band{fill:var(--tint);stroke:none}.diagram-viz .open{stroke:var(--red);fill:var(--red-wash)}.diagram-viz .leaf{fill:var(--tint);stroke:transparent;stroke-width:1;vector-effect:non-scaling-stroke}.diagram-viz .ld-detail{cursor:pointer;outline:none}.diagram-viz .ld-detail text{user-select:none}.chart-viz text{font-size:11.75px}.chart-viz .chart-title{font-size:12.5px;font-weight:650;fill:var(--ink)}.chart-viz .axis-title{font-size:11.75px;font-weight:600;fill:var(--ink)}.chart-viz .value{font-size:12px;font-weight:500;fill:var(--ink)}.chart-viz .muted,.chart-viz .source{fill:var(--muted)}.chart-viz .source{font-size:11.75px}.chart-viz .quiet{fill:none;stroke:var(--muted);stroke-width:1;vector-effect:non-scaling-stroke}.chart-viz .faint{fill:none;stroke:currentColor;stroke-opacity:.18;stroke-width:1;vector-effect:non-scaling-stroke}.chart-viz .fill,.chart-viz .tone-1,.chart-viz .tone-2,.chart-viz .tone-3,.chart-viz .tone-4{stroke:currentColor;stroke-width:1;vector-effect:non-scaling-stroke}.chart-viz .label-pad{stroke:none}.chart-viz .fill,.chart-viz .tone-1{fill:color-mix(in srgb,currentColor 14%,var(--card))}.chart-viz .tone-2{fill:color-mix(in srgb,currentColor 28%,var(--card))}.chart-viz .tone-3{fill:color-mix(in srgb,currentColor 48%,var(--card))}.chart-viz .tone-4{fill:color-mix(in srgb,currentColor 72%,var(--card))}.chart-viz .open{stroke:var(--red);fill:var(--red-wash)}.chart-viz .open-line{stroke:var(--red)}.diagram-viz .ld-detail:hover>.box:first-child,.diagram-viz .ld-detail:hover>.leaf:first-child,html:not([data-input-modality=pointer]) .diagram-viz .ld-detail:focus-visible>.box:first-child,html:not([data-input-modality=pointer]) .diagram-viz .ld-detail:focus-visible>.leaf:first-child{stroke:var(--interaction)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]){--ld-node-fill:var(--card,#111);--ld-node-ink:#fff;--ld-node-muted:#fff;--ld-node-accent-ink:#fff;--ld-node-outline:#999}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) :is(.box,.leaf,.band,.tint,.inkfill){fill:var(--ld-node-fill);fill-opacity:1;stroke:var(--ld-node-outline);stroke-width:2;filter:none}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) :is(.box,.inkfill)+circle.line{stroke:var(--ld-node-muted)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) :is(.box,.band,.leaf).accent,:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) .open{fill:var(--ld-node-fill);fill-opacity:1;stroke:var(--red)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) text{fill:var(--ld-node-ink)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) :is(.line,.hair){stroke:#fff;stroke-width:1.5}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) [data-diagram-object]:has(>:is(.box,.leaf,.band,.tint,.inkfill))>text,:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) .surface-text{fill:var(--ld-node-ink)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) [data-diagram-object]:has(>:is(.box,.leaf,.band,.tint))>text.sub{fill:var(--ld-node-muted)}:is(html[data-theme=dark] .diagram-viz:not([data-theme=light]),.diagram-viz[data-theme=dark]):not(.chart-viz) [data-diagram-object]:has(>:is(.accent,.open))>text:is(.sub,:not(.sub)){fill:var(--ld-node-accent-ink)}html[data-theme=dark] .chart-viz .fill.open,html[data-theme=dark] .chart-viz .tone-1.open,.chart-viz[data-theme=dark] .fill.open,.chart-viz[data-theme=dark] .tone-1.open{fill:color-mix(in srgb,currentColor 14%,var(--card))}html[data-theme=dark] .chart-viz .tone-2.open,.chart-viz[data-theme=dark] .tone-2.open{fill:color-mix(in srgb,currentColor 28%,var(--card))}html[data-theme=dark] .chart-viz .tone-3.open,.chart-viz[data-theme=dark] .tone-3.open{fill:color-mix(in srgb,currentColor 48%,var(--card))}html[data-theme=dark] .chart-viz .tone-4.open,.chart-viz[data-theme=dark] .tone-4.open{fill:color-mix(in srgb,currentColor 72%,var(--card))}
</style>${o}</svg>`}function B(o,t,e="pane",r={}){return te(o,t,e==="wideTall"?"0 0 880 420":e==="wide"?"0 0 880 360":"0 0 400 400","",r)}function J(o){return o?` data-accent-role="${O(o)}"`:""}function L(o,t,e,r,i,u="",l={}){const c=`box${l.tint?" tint":""}${l.accentRole?" accent":""}${l.open?" open":""}`,a=t+r/2;return j(`<rect class="${c}"${J(l.accentRole)} x="${o}" y="${t}" width="${e}" height="${r}" rx="7"/>${g(i,o+e/2,a-(u?8:0),e-18,l.titleClass||"",2)}${u?g(u,o+e/2,a+19,e-18,"sub",2):""}`,l.detail)}function ve(o,t,e,r,i){return L(o,t,e,r,i.title,i.sub,i)}function ce(o,t,e,r,i){return j(`<rect class="leaf" x="${o}" y="${t}" width="${e}" height="${r}" rx="5"/>${g(i.title,o+e/2,t+r/2+4,e-12,"sub",2)}`,i.detail)}function X(o,t,e,r,i=!1){const u=i?t:o,l=i?o:t,c=l>u?1:-1,a=l-c*7;return`<path class="line" d="M${u} ${e}H${a}"/><path class="line" d="M${l-c*7} ${e-4}L${l} ${e}L${l-c*7} ${e+4}"/>${g(r,(o+t)/2,e-25,Math.abs(t-o)-32,"edge",3)}`}function G(o,t,e,r){const i=t>o?1:-1,u=t-i*7;return`<path class="line" d="M${e} ${o}V${u}"/><path class="line" d="M${e-4} ${t-i*7}L${e} ${t}L${e+4} ${t-i*7}"/>${g(r,e+18,(o+t)/2+3,120,"edge",2,"start")}`}function D(o,t,e){return z[o](t,{...e,compact:!1})}function Me(o,t,e=400,r={}){return te(o,t,`0 0 400 ${e}`,"narrow-viz",r)}function C(o,t,e){let r="",i=400;if(o==="flow"){const l=e.density==="compact"?48:62;i=28+t.stages.length*68+(t.stages.length-1)*l+28,t.stages.forEach((c,a)=>{const s=28+a*(68+l);r+=L(40,s,320,68,c.title,c.sub,c),a<t.stages.length-1&&(r+=G(s+68+6,s+68+l-6,200,t.edges[a]))})}else if(o==="timeline")i=24+(t.marks.length-1)*94+66+24,r=`<path class="line" d="M104 38V${i-38}M100 ${i-45}L104 ${i-38}L108 ${i-45}"/>`,t.marks.forEach((c,a)=>{const s=24+a*94,h=s+66/2,n=a===t.nowAt;r+=`${g(c.when,84,h+4,70,n?"zone":"edge",1,"end")}<circle class="${n?"box accent":"box"}"${J(n?"active":void 0)} cx="104" cy="${h}" r="4.5"/>${L(122,s,256,66,c.title,c.sub,{accentRole:n?"active":void 0,detail:c.detail})}`});else if(o==="hierarchy"){const u=e.density==="compact"?28:62,l=t.branches.map(s=>(s.leaves||[]).length?s.sub?122:104:s.sub?82:70);i=94+t.branches.reduce((s,h,n)=>s+u+l[n],0)+24,r=L(142,26,236,68,t.root,t.rootSub,{detail:t.rootDetail});const c=94+l.slice(0,-1).reduce((s,h)=>s+h+u,0)+u;r+=`<path class="line hierarchy-root-bus" d="M142 60H24V${c+l.at(-1)/2}"/>`;let a=94+u;t.branches.forEach((s,h)=>{const n=l[h],d=s.leaves||[],$=a+(s.sub?28:d.length?31:n/2+4),x=a+51;let f=`<rect class="box${s.accentRole?" accent":""}"${J(s.accentRole)} x="142" y="${a}" width="236" height="${n}" rx="7"/>${g(s.title,260,$,202,"",2)}${s.sub?g(s.sub,260,x,202,"sub",2):""}`,b="";if(d.length){const y=(216-10*(d.length-1))/d.length,k=a+(s.sub?70:52),M=n-(k-a)-10;d.forEach((v,E)=>{const U=ce(152+E*(y+10),k,y,M,v);v.detail?b+=U:f+=U})}r+=`<g class="hierarchy-branch-link" data-parent="root" data-branch="${h}">${X(24,134,a+n/2,s.edge)}</g>`+j(f,s.detail)+b,a+=n+u})}else if(o==="zones"){const u=[{title:t.zoneA,items:t.itemsA},{title:t.zoneB,items:t.itemsB}],l=n=>{const d=ie(n.title,51,2).length,$=n.sub?ie(n.sub,51,3).length:0;return Math.max(54,26+d*14+($?7+$*14:0))},c=12,a=u.map(n=>42+n.items.reduce((d,$)=>d+l($),0)+Math.max(0,n.items.length-1)*c+14),s=70;i=18+a[0]+s+a[1]+18;let h=18;u.forEach((n,d)=>{const $=a[d];r+=`<rect class="band" x="16" y="${h}" width="368" height="${$}" rx="4"/>${g(n.title,30,h+25,330,"zone surface-text",1,"start")}`;let x=h+42;n.items.forEach(f=>{const b=l(f);r+=L(30,x,340,b,f.title,f.sub,f),x+=b+c}),d||(r+=G(h+$+8,h+$+s-8,200,t.crossing)),h+=$+s})}else if(o==="beforeAfter")i=350,r=L(40,16,320,110,t.beforeLabel,t.beforeSub,{})+G(136,214,200,t.edge)+L(40,224,320,110,t.afterLabel,t.afterSub);else if(o==="hub")i=124+t.spokes.length*58+(t.spokes.length-1)*12+24,r=L(100,24,200,70,t.centre),r+=`<path class="hair hub-bus" d="M200 94V${124+(t.spokes.length-1)*70+58/2}"/>`,t.spokes.forEach((c,a)=>{const s=124+a*70,h=s+58/2,n=t.toward==="centre",d=n?200:218,$=n?207:211;r+=`<path class="line" d="M200 ${h}H218"/><path class="line hub-arrowhead" data-direction="${n?"centre":"satellites"}" d="M${$} ${h-4}L${d} ${h}L${$} ${h+4}"/>${g(c.edge,190,h+4,154,"edge",1,"end")}${L(224,s,154,58,c.title,"",{detail:c.detail})}`});else if(o==="compareTwo")i=70+t.rows.length*102+20,r=`${j(g(t.a,112,36,168,"zone",1),t.aDetail,[20,8,168,44])}${j(g(t.b,288,36,168,"zone",1),t.bDetail,[212,8,168,44])}`,t.rows.forEach((l,c)=>{const a=62+c*102;r+=`${g(l.label,20,a+14,360,"zone",1,"start")}${L(20,a+26,168,62,l.a,"",{tint:t.highlight==="a",titleClass:l.winner==="a"?"zone":""})}${L(212,a+26,168,62,l.b,"",{tint:t.highlight==="b",titleClass:l.winner==="b"?"zone":""})}`});else if(o==="funnel"){const u=t.tiers.length===3?[352,260,168]:[332,206],l=70,c=58;i=24+t.tiers.length*l+(t.tiers.length-1)*c+82,t.tiers.forEach((a,s)=>{const h=u[s],n=200-h/2,d=24+s*(l+c);s&&(r+=G(d-c+6,d-6,200,t.edges[s-1])),r+=L(n,d,h,l,a.title,a.sub,{detail:a.detail})}),r+=G(i-72,i-44,200,"")+g(t.outcome,200,i-18,340,"zone",2)}else if(o==="loop"){i=70+t.steps.length*58+(t.steps.length-1)*50+54,r=g(t.centre,200,30,340,"zone",2),t.steps.forEach((a,s)=>{const h=58+s*108;r+=L(78,h,284,58,a.title,"",{detail:a.detail}),s<t.steps.length-1&&(r+=G(h+58+6,h+58+50-6,220,a.edge))});const c=58+(t.steps.length-1)*108;r+=`<path class="line loop-return" d="M78 ${c+58/2}H38V${58+58/2}H71M64 ${58+58/2-4}L71 ${58+58/2}L64 ${58+58/2+4}"/><g transform="translate(18 ${(c+58+58)/2}) rotate(-90)">${g(t.steps.at(-1).edge,0,0,220,"edge",1)}</g>`}else if(o==="matrix"){i=430;const u=20,l=36,c=360,a=180;t.quads.forEach((s,h)=>{const n=u+h%2*a,d=l+Math.floor(h/2)*a;r+=j(`<rect class="${h===t.markAt?"band":"box"}" x="${n}" y="${d}" width="${a}" height="${a}"/>${g(s.title,n+a/2,d+a/2-(s.sub?12:0),a-26,"zone",2)}${s.sub?g(s.sub,n+a/2,d+a/2+22,a-28,"sub",3):""}`,s.detail)}),r+=`${g(t.yAxis,20,22,170,"zone",1,"start")}${g(t.xAxis,380,418,170,"zone",1,"end")}`}else if(o==="figurePath"){i=430;const u=[[82,330],[174,236],[266,142]];r=`<path class="line" d="M46 374C88 356 105 304 150 268S220 204 250 164S300 104 350 64M343 60L350 64L346 72"/>${g(t.goal,346,42,112,"zone",1,"end")}`,t.marks.forEach((l,c)=>{r+=`<circle class="inkfill" cx="${u[c][0]}" cy="${u[c][1]}" r="5"/>${g(l,u[c][0]+13,u[c][1]+4,108,"",1,"start")}`}),r+=g(t.caption,200,408,350,"sub",2)}else if(o==="stairSteps"){i=430;const u=344/t.steps.length,l=48,c=28,a=354;t.steps.forEach((s,h)=>{const n=c+h*u,d=a-h*l;r+=`<path class="line" d="M${n} ${h?d+l:d}V${d}H${n+u}"/>${g(s.title,n+u/2,d-(s.sub?30:11),u-10,"",2)}${s.sub?g(s.sub,n+u/2,d-9,u-10,"sub",1):""}`}),t.caption&&(r+=g(t.caption,200,410,350,"sub",2))}else if(o==="pyramid"){i=430;const u=342,l=48;t.blocks.forEach((c,a)=>{const s=352-a*48,h=200-s/2,n=u-a*(l+4);r+=j(`<rect class="band" x="${h}" y="${n}" width="${s}" height="${l}" rx="3"/>${g(c.title,200,n+(c.sub?19:29),s-12,"",1)}${c.sub?g(c.sub,200,n+36,s-12,"sub",1):""}`)}),t.caption&&(r+=g(t.caption,200,408,350,"sub",2))}else if(o==="gears"){i=430;const u=[{cx:106,cy:210,r:42,t:10},{cx:200,cy:158,r:61,t:14},{cx:302,cy:222,r:46,t:11}];[1,0,2].forEach(c=>{const a=u[c];r+=`<path class="${c===2?"inkfill":"box"}" d="${he(a.cx,a.cy,a.r,a.t,c*.22)}"/><circle class="line" cx="${a.cx}" cy="${a.cy}" r="${(a.r*.22).toFixed(2)}"/>`});const l=[[106,292],[200,70],[302,310]];t.labels.forEach((c,a)=>{r+=g(c,l[a][0],l[a][1],116,"",2)}),t.caption&&(r+=g(t.caption,200,404,350,"sub",2))}return Me(r,e,i,t)}z.flow=(o,t)=>{var e=o;t=t||{},H(e,"params",["stages","edges"]);const r=I(e.stages,"stages",2,6,["title"],["sub","detail","accentRole"]),i=Z(e.edges,"edges",r.length-1);if(t.compact)return D("flow",e,t);if(t.narrow===!0)return C("flow",e,t);let u="";if(r.length<=4){const l=r.length===2?160:r.length===3?148:116,c=(832-l*(r.length-1))/r.length,a=88,s=178;r.forEach((h,n)=>{const d=24+n*(c+l);u+=L(d,a,c,s,h.title,h.sub,{accentRole:h.accentRole,detail:h.detail}),n<r.length-1&&(u+=X(d+c+8,d+c+l-8,a+s/2,i[n]))})}else{const a=[22,340,658],s=44,h=218,n=[[a[0],s],[a[1],s],[a[2],s],[a[2],h],[a[1],h],[a[0],h]];u+=X(a[0]+200+8,a[1]-8,s+112/2,i[0]),u+=X(a[1]+200+8,a[2]-8,s+112/2,i[1]),u+=G(s+112+8,h-8,a[2]+200/2,i[2]),u+=X(a[1]+200+8,a[2]-8,h+112/2,i[3],!0),r.length===6&&(u+=X(a[0]+200+8,a[1]-8,h+112/2,i[4],!0)),r.forEach((d,$)=>{const[x,f]=n[$];u+=ve(x,f,200,112,d)})}return B(u,t,"wide",e)},z.timeline=(o,t)=>{var e=o;t=t||{},H(e,"params",["marks","nowAt","orientation"]),_(e.orientation,"orientation",["horizontal","vertical"],!0);const r=I(e.marks,"marks",3,5,["when","title"],["sub","detail"]);if(e.nowAt!=null&&(!Number.isInteger(e.nowAt)||e.nowAt<0||e.nowAt>=r.length))throw new TypeError("nowAt must index marks");if(e.orientation==="vertical"){const s=(f,b)=>ie(f||"",b,1/0),h=r.map(f=>({when:s(f.when,43),title:s(f.title,37),sub:f.sub?s(f.sub,43):[]}));let n=26;const d=h.map(f=>{const b=n,y=f.when.length*16+8+f.title.length*18+(f.sub.length?8+f.sub.length*17:0);return n+=y+28,{y:b,height:y}}),$=(f,b,y,k)=>`<text class="${y}" x="58" y="${b}" text-anchor="start">${f.map((M,v)=>`<tspan x="58" dy="${v?k:0}">${O(M)}</tspan>`).join("")}</text>`;let x=`<style>.timeline-vertical .timeline-hit{fill:transparent;stroke:none}.timeline-vertical .timeline-dot{fill:var(--card);stroke:var(--muted);stroke-width:1.5;vector-effect:non-scaling-stroke}.timeline-vertical .timeline-dot[data-accent-role=active]{fill:var(--red);stroke:var(--red)}
</style><path class="line timeline-rail" d="M28 ${d[0].y+5}V${d.at(-1).y+5}"/>`;return h.forEach((f,b)=>{const{y,height:k}=d[b],M=y+f.when.length*16+8,v=M+f.title.length*18+8,E=`<rect class="timeline-hit" x="12" y="${y-10}" width="376" height="${k+14}" rx="4"/><circle class="timeline-dot"${J(b===e.nowAt?"active":void 0)} cx="28" cy="${y+5}" r="4.5"/>${$(f.when,y+9,"edge",16)}${$(f.title,M+11,"",18)}${f.sub.length?$(f.sub,v+9,"sub",17):""}`;x+=j(E,r[b].detail).replace("<g data-diagram-object",`<g data-timeline-event="${b}" data-diagram-object`)}),te(x,t,`0 0 400 ${n-12}`,"timeline-vertical",e)}if(t.compact)return D("timeline",e,t);if(t.narrow===!0)return C("timeline",e,t);const i=r.length,u=24,l=(828-u*(i-1))/i,c=262;let a=`<path class="line" d="M22 ${c}H858"/><path class="line" d="M851 ${c-4}L858 ${c}L851 ${c+4}"/>`;return r.forEach((s,h)=>{const n=26+h*(l+u),d=n+l/2,$=h===e.nowAt;a+=L(n,54,l,140,s.title,s.sub,{accentRole:$?"active":void 0,detail:s.detail})+`<path class="hair" d="M${d} 194V257"/><circle class="${$?"box accent":"box"}"${J($?"active":void 0)} cx="${d}" cy="${c}" r="4.5"/>${g(s.when,d,292,l,$?"zone":"edge",1)}`}),B(a,t,"wide",e)},z.hierarchy=(o,t)=>{var e=o;t=t||{},H(e,"params",["root","rootSub","rootDetail","branches"]),p(e.root,"root"),p(e.rootSub,"rootSub",!0),p(e.rootDetail,"rootDetail",!0);const r=I(e.branches,"branches",2,4,["title","edge"],["sub","detail","leaves","accentRole"]);if(r.forEach(($,x)=>{$.leaves!=null&&(S($.leaves,`branches[${x}].leaves`,1,2),$.leaves.forEach((f,b)=>{H(f,`branches[${x}].leaves[${b}]`,["title","detail"]),p(f.title,`branches[${x}].leaves[${b}].title`),p(f.detail,`branches[${x}].leaves[${b}].detail`,!0)}))}),t.compact)return D("hierarchy",e,t);if(t.narrow===!0)return C("hierarchy",e,t);const i=300,u=290,l=18,c=82,a=24,s=204,h=156,n=(820-a*(r.length-1))/r.length;let d="";return r.forEach(($,x)=>{const f=30+x*(n+a),b=f+n/2;d+=`<path class="line hierarchy-connector" data-label-y="160" d="M440 ${l+c}V124H${b}V147M${b} 166V${s-8}"/><path class="line" d="M${b-4} ${s-15}L${b} ${s-8}L${b+4} ${s-15}"/>${g($.edge,b,160,n-8,"edge",1)}`}),d+=L(u,l,i,c,e.root,e.rootSub,{detail:e.rootDetail}),r.forEach(($,x)=>{const f=30+x*(n+a),b=$.leaves||[],y=s+84,k=8,M=(n-32-k*Math.max(0,b.length-1))/Math.max(1,b.length),v=b.length?s+($.sub?35:50):s+h/2-($.sub?8:0),E=b.length?s+61:s+h/2+19;let U=`<rect class="box${$.accentRole?" accent":""}"${J($.accentRole)} x="${f}" y="${s}" width="${n}" height="${h}" rx="7"/>${g($.title,f+n/2,v,n-34,"",2)}${$.sub?g($.sub,f+n/2,E,n-34,"sub",2):""}`,ee="";b.forEach((xe,Ee)=>{const Le=f+16+Ee*(M+k),fe=ce(Le,y,M,45,xe);xe.detail?ee+=fe:U+=fe}),d+=j(U,$.detail)+ee}),B(d,t,"wideTall",e)},z.zones=(o,t)=>{var e=o;t=t||{},H(e,"params",["zoneA","itemsA","zoneB","itemsB","crossing"]),p(e.zoneA,"zoneA"),p(e.zoneB,"zoneB"),p(e.crossing,"crossing");const r=I(e.itemsA,"itemsA",1,3,["title"],["sub","detail"]),i=I(e.itemsB,"itemsB",1,3,["title"],["sub","detail"]);if(t.compact)return D("zones",e,t);if(t.narrow===!0)return C("zones",e,t);let u=`<rect class="band" x="14" y="10" width="852" height="150" rx="4"/>${g(e.zoneA,34,32,300,"zone surface-text",1,"start")}<rect class="band" x="14" y="242" width="852" height="168" rx="4"/>${g(e.zoneB,34,266,300,"zone surface-text",1,"start")}`;const l=(c,a)=>{const h=(804-34*(c.length-1))/c.length;return c.map((n,d)=>L(38+d*(h+34),a,h,90,n.title,n.sub,{detail:n.detail})).join("")};return u+=l(r,52)+l(i,286)+G(160,242,440,e.crossing),B(u,t,"wideTall",e)},z.beforeAfter=(o,t)=>{var e=o;if(t=t||{},H(e,"params",["orientation","beforeLabel","beforeSub","edge","afterLabel","afterSub"]),["beforeLabel","beforeSub","edge","afterLabel","afterSub"].forEach(u=>{p(e[u],u)}),_(e.orientation,"orientation",["vertical","horizontal"],!0),t.compact)return D("beforeAfter",e,t);if(t.narrow===!0)return C("beforeAfter",e,t);const r=e.orientation==="horizontal";let i="";return r?i+=L(12,70,126,220,e.beforeLabel,e.beforeSub,{})+X(150,250,180,e.edge)+L(262,70,126,220,e.afterLabel,e.afterSub):i+=L(100,18,200,104,e.beforeLabel,e.beforeSub,{})+G(150,220,200,e.edge)+L(100,248,200,104,e.afterLabel,e.afterSub),B(i,t,"pane",e)},z.hub=(o,t)=>{var e=o;t=t||{},H(e,"params",["centre","spokes","toward"]),p(e.centre,"centre"),_(e.toward,"toward",["centre","satellites"]);const r=I(e.spokes,"spokes",3,6,["title","edge"],["detail"]);if(t.compact)return D("hub",e,t);if(t.narrow===!0)return C("hub",e,t);const i=64,u=24,l=48+r.length*i+(r.length-1)*u,c=l/2;let a=L(24,c-48,180,96,e.centre);return a+=`<path class="line" d="M204 ${c}H236M236 56V${24+(r.length-1)*(i+u)+i/2}"/>`,r.forEach((s,h)=>{const n=24+h*(i+u),d=n+i/2;a+=`<g data-relationship="spoke" data-direction="${e.toward}">${X(236,622,d,s.edge,e.toward==="centre")}</g>`,a+=L(630,n,226,i,s.title,"",{detail:s.detail})}),te(a,t,`0 0 880 ${l}`,"",e)},z.compareTwo=(o,t)=>{var e=o;t=t||{},H(e,"params",["a","b","aDetail","bDetail","highlight","rows"]),p(e.a,"a"),p(e.b,"b"),p(e.aDetail,"aDetail",!0),p(e.bDetail,"bDetail",!0),_(e.highlight,"highlight",["a","b","none"]);const r=I(e.rows,"rows",2,4,["label","a","b","winner"]);if(r.forEach((n,d)=>{_(n.winner,`rows[${d}].winner`,["a","b","none"])}),t.compact)return D("compareTwo",e,t);if(t.narrow===!0)return C("compareTwo",e,t);const i=[24,216,536,856],u=58,l=68,c=u+l*r.length,a=(360-c)/2,s=a+c;let h="";return e.highlight==="a"&&(h+=`<rect class="band" x="${i[1]}" y="${a}" width="${i[2]-i[1]}" height="${c}"/>`),e.highlight==="b"&&(h+=`<rect class="band" x="${i[2]}" y="${a}" width="${i[3]-i[2]}" height="${c}"/>`),h+=`<path class="hair" d="M${i[0]} ${a}H${i[3]}M${i[0]} ${a+u}H${i[3]}M${i[0]} ${a}V${s}M${i[1]} ${a}V${s}M${i[2]} ${a}V${s}M${i[3]} ${a}V${s}"/>${j(g(e.a,(i[1]+i[2])/2,a+34,i[2]-i[1]-24,e.highlight==="a"?"zone surface-text":"zone",2),e.aDetail,[i[1],a,i[2]-i[1],u])}${j(g(e.b,(i[2]+i[3])/2,a+34,i[3]-i[2]-24,e.highlight==="b"?"zone surface-text":"zone",2),e.bDetail,[i[2],a,i[3]-i[2],u])}`,r.forEach((n,d)=>{const $=a+u+d*l,x=$+l/2;h+=`<path class="hair" d="M${i[0]} ${$+l}H${i[3]}"/>${g(n.label,(i[0]+i[1])/2,x,i[1]-i[0]-24,"sub",2)}${g(n.a,(i[1]+i[2])/2,x,i[2]-i[1]-24,`${n.winner==="a"?"zone":"sub"}${e.highlight==="a"?" surface-text":""}`,2)}${g(n.b,(i[2]+i[3])/2,x,i[3]-i[2]-24,`${n.winner==="b"?"zone":"sub"}${e.highlight==="b"?" surface-text":""}`,2)}`}),B(h,t,"wide",e)},z.funnel=(o,t)=>{var e=o;t=t||{},H(e,"params",["tiers","edges","outcome"]);const r=I(e.tiers,"tiers",2,3,["title"],["sub","detail"]),i=Z(e.edges,"edges",r.length-1);if(p(e.outcome,"outcome"),t.compact)return D("funnel",e,t);if(t.narrow===!0)return C("funnel",e,t);const u=r.length===3?[320,224,132]:[300,168],l=r.length===3?[26,138,250]:[50,190],c=76;let a="";r.forEach((h,n)=>{const d=u[n],$=200-d/2,x=l[n];if(n){const f=u[n-1],b=200-f/2,y=l[n-1];a+=`<path class="hair" d="M${b+6} ${y+c}L${$+6} ${x}M${b+f-6} ${y+c}L${$+d-6} ${x}"/>${g(i[n-1],200,(y+c+x)/2+3,d+60,"edge",1)}`}a+=L($,x,d,c,h.title,h.sub,{detail:h.detail})});const s=l.at(-1)+c;return a+=G(s,s+34,200,"")+g(e.outcome,200,s+57,300,"zone",2),B(a,t,"pane",e)},z.loop=(o,t)=>{var e=o;t=t||{},H(e,"params",["centre","steps"]),p(e.centre,"centre");const r=I(e.steps,"steps",3,4,["title","edge"],["detail"]);if(t.compact)return D("loop",e,t);if(t.narrow===!0)return C("loop",e,t);const i=200,u=200,l=130,c=84,a=120,s=50;let h=g(e.centre,i,u+4,108,"zone",3);return r.forEach((n,d)=>{const $=(-90+d*360/r.length)*Math.PI/180,x=(-90+(d+1)*360/r.length)*Math.PI/180,f=$+.34,b=x-.34,y=i+c*Math.cos(f),k=u+c*Math.sin(f),M=i+c*Math.cos(b),v=u+c*Math.sin(b),E=b-.09,U=i+c*Math.cos(E),ee=u+c*Math.sin(E);h+=`<path class="line" d="M${y} ${k}A${c} ${c} 0 0 1 ${U} ${ee}"/><path class="line" d="M${M} ${v}l${-8*Math.cos(b-.55)} ${-8*Math.sin(b-.55)}M${M} ${v}l${-8*Math.cos(b+.55)} ${-8*Math.sin(b+.55)}"/>${g(n.edge,i+(c+24)*Math.cos((f+b)/2),u+(c+24)*Math.sin((f+b)/2),80,"edge",1)}${L(i+l*Math.cos($)-a/2,u+l*Math.sin($)-s/2,a,s,n.title,"",{detail:n.detail})}`}),B(h,t,"pane",e)},z.matrix=(o,t)=>{var e=o;t=t||{},H(e,"params",["xAxis","yAxis","quads","markAt"]),p(e.xAxis,"xAxis"),p(e.yAxis,"yAxis");const r=I(e.quads,"quads",4,4,["title"],["sub","detail"]);if(!Number.isInteger(e.markAt)||e.markAt<0||e.markAt>3)throw new TypeError("markAt must be an index from 0 to 3");if(t.compact)return D("matrix",e,t);if(t.narrow===!0)return C("matrix",e,t);const i=66,u=24,l=304,c=152;let a="";return r.forEach((s,h)=>{const n=i+h%2*c,d=u+Math.floor(h/2)*c;a+=j(`<rect class="${h===e.markAt?"band":"box"}" x="${n}" y="${d}" width="${c}" height="${c}"/>${g(s.title,n+c/2,d+c/2-(s.sub?12:0),c-24,"zone",2)}${s.sub?g(s.sub,n+c/2,d+c/2+24,c-32,"sub",3):""}`,s.detail)}),a+=`<path class="line" d="M${i} ${u}V${u+l}H${i+l}"/><path class="hair" d="M${i+c} ${u}V${u+l}M${i} ${u+c}H${i+l}"/>${g(e.xAxis,i+c,u+l+48,260,"zone",1)}<g transform="translate(12 ${u+c}) rotate(-90)">${g(e.yAxis,0,0,260,"zone",1)}</g>`,B(a,t,"pane",e)},z.figurePath=(o,t)=>{var e=o;if(t=t||{},H(e,"params",["marks","goal","caption"]),Z(e.marks,"marks",3),p(e.goal,"goal"),p(e.caption,"caption"),t.compact)return D("figurePath",e,t);if(t.narrow===!0)return C("figurePath",e,t);const r=[[118,309],[202,241],[277,135]];let i=`<path class="line" d="M46 336C118 336 96 268 168 252S246 224 258 168S292 92 352 74"/><path class="line" d="M352 74V34"/><path class="inkfill" d="M352 34V56L386 45Z"/>${g(e.goal,348,18,96,"zone",1)}`;return e.marks.forEach((u,l)=>{i+=`<circle class="inkfill" cx="${r[l][0]}" cy="${r[l][1]}" r="5"/>${g(u,r[l][0]+14,r[l][1]+18,100,"edge",1,"start")}`}),i+=`<g transform="translate(326 82)"><circle class="line" cx="0" cy="-30" r="7.5"/><path class="line" d="M0 -22V-6M0 -16L-10 -9M0 -16L10 -9M0 -6L-8 6M0 -6L8 6"/></g>${g(e.caption,200,374,350,"sub",2)}`,B(i,t,"pane",e)},z.stairSteps=(o,t)=>{var e=o;t=t||{},H(e,"params",["steps","caption"]);const r=I(e.steps,"steps",3,6,["title"],["sub"]);p(e.caption,"caption",!0);const i=34,u=326,l=332/r.length,c=46;let a="";return t.compact?D("stairSteps",e,t):t.narrow===!0?C("stairSteps",e,t):(r.forEach((s,h)=>{const n=i+h*l,d=u-h*c;a+=`<path class="line" d="M${n} ${h?d+c:d}V${d}H${n+l}"/>${g(s.title,n+l/2,d-(s.sub?30:12),l-8,"edge",2)}${s.sub?g(s.sub,n+l/2,d-9,l-8,"sub",1):""}`}),e.caption&&(a+=g(e.caption,200,374,352,"sub",2)),B(a,t,"pane",e))},z.pyramid=(o,t)=>{var e=o;t=t||{},H(e,"params",["blocks","caption"]);const r=I(e.blocks,"blocks",6,6,["title"],["sub"]);p(e.caption,"caption",!0);const i=[{x:54,y:286,w:292,h:56},{x:82,y:226,w:116,h:56},{x:202,y:226,w:116,h:56},{x:112,y:166,w:86,h:56},{x:202,y:166,w:86,h:56},{x:150,y:58,w:100,h:104,tri:!0}];let u="";return t.compact?D("pyramid",e,t):(i.forEach((l,c)=>{const a=l.x+l.w/2;u+=l.tri?`<path class="band" d="M${a} ${l.y}L${l.x+l.w} ${l.y+l.h}H${l.x}Z"/>`:`<rect class="band" x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" rx="3"/>`,u+=g(r[c].title,a,l.tri?l.y+55:l.y+(r[c].sub?22:32),l.w-10,"edge surface-text",l.tri?2:1),r[c].sub&&(u+=g(r[c].sub,a,l.tri?l.y+78:l.y+42,l.w-10,"sub surface-text",1))}),e.caption&&(u+=g(e.caption,200,374,352,"sub",2)),B(u,t,"pane",e))};function he(o,t,e,r,i=0){const u=e-3.4,l=e+3.4,c=Math.PI*2/r,a=[];for(let s=0;s<r;s++){const h=i+s*c;[[u,-.5],[u,-.28],[l,-.18],[l,.18],[u,.28],[u,.5]].forEach(([n,d])=>{a.push([o+n*Math.cos(h+c*d),t+n*Math.sin(h+c*d)])})}return a.map((s,h)=>`${h?"L":"M"}${s[0].toFixed(1)} ${s[1].toFixed(1)}`).join("")+"Z"}z.gears=(o,t)=>{var e=o;t=t||{},H(e,"params",["labels","caption"]),Z(e.labels,"labels",3),p(e.caption,"caption",!0);const r=[{cx:150,cy:186,r:33,t:8},{cx:236,cy:150,r:58,t:14},{cx:321,cy:203,r:41,t:10}];let i="";if(t.compact)return D("gears",e,t);if(t.narrow===!0)return C("gears",e,t);[1,0,2].forEach(l=>{const c=r[l],a=he(c.cx,c.cy,c.r,c.t,l*.22);i+=`<path class="${l===2?"inkfill":"box"}" d="${a}"/><circle class="line" cx="${c.cx}" cy="${c.cy}" r="${c.r*.22}"/>`});const u=[[150,268],[236,54],[321,280]];return e.labels.forEach((l,c)=>{i+=g(l,u[c][0],u[c][1],112,"edge",1)}),i+='<circle class="line" cx="92" cy="212" r="11"/><path class="line" d="M93 223Q98 252 101 280M101 280L91 316M101 280L124 316M80 319H103M118 319H136M94 238L138 192"/><circle class="inkfill" cx="138" cy="192" r="4"/>',e.caption&&(i+=g(e.caption,200,366,352,"sub",2)),B(i,t,"pane",e)};const m=Object.freeze({left:54,right:346,top:24,base:144});function R(o,t,e=-1/0,r=!1){if(!Number.isFinite(o)||o<e||r&&!Number.isInteger(o))throw new TypeError(`${t} must be ${r?"an integer":"a finite number"}${e!==-1/0?` at least ${e}`:""}`);return o}function ze(o,t){if(o!=null&&typeof o!="boolean")throw new TypeError(`${t} must be boolean when supplied`)}function ke(o,t){p(o,t,!0)}function V(o,t){return H(o,"params",["title",...t]),p(o.title,"title",!0),p(o.sourceNote,"sourceNote"),o}function Q(o,t,e,r){return H(o,t,e),r.forEach(i=>{i==="label"?p(o[i],`${t}.${i}`):R(o[i],`${t}.${i}`)}),e.includes("open")&&ze(o.open,`${t}.open`),e.includes("detail")&&ke(o.detail,`${t}.detail`),o}function A(o){return Number.isInteger(o)?String(o):String(Math.round(o*100)/100)}function F(o,t,e,r,i){return r+(o-t)/(e-t||1)*(i-r)}function ne(o){return o.map((t,e)=>`${e?"L":"M"}${t[0].toFixed(2)} ${t[1].toFixed(2)}`).join("")}function T(o,t=!1){return o&&o.open===!0?t?" open-line":" open":""}function w(o,t,e,r="",i="middle",u="auto"){return`<text class="${/(^|\s)value(\s|$)/.test(r)?`${r} data-label`:r}" x="${Number(t).toFixed(2)}" y="${Number(e).toFixed(2)}" text-anchor="${i}" dominant-baseline="${u}">${O(o)}</text>`}function q(o,t,e,r,i="middle"){return g(o,t,e,r,"muted",2,i)}function le(o,t){return t==null?o:`${o} (${t})`}function N(o,t,e,r="zero"){const i=t.title?w(t.title,12,13,"chart-title","start"):"",u=w(t.sourceNote,12,195,"source","start");return te(`${i}${o}${u}`,e,"0 0 360 200","chart-viz",t).replace(" class=",` data-kind="chart" data-baseline="${O(r)}" class=`)}function W(o,t,e=177){return w(le(o,t),200,e,"axis-title")}function Ae(o,t,e=11,r=84){return`<g transform="translate(${e} ${r}) rotate(-90)">${w(le(o,t),0,0,"axis-title")}</g>`}function de(o,t,e=5){o===t&&(t=o+1);const r=Math.abs(t-o)/Math.max(1,e-1),i=10**Math.floor(Math.log10(r||1)),u=r/i,l=(u<=1?1:u<=2?2:u<=5?5:10)*i,c=Math.ceil(o/l)*l,a=[];for(let s=c;s<=t+l*1e-8&&(a.push(Math.round(s*1e10)/1e10),a.length!==7);s+=l);return(!a.length||Math.abs(a[0]-o)>l*.1)&&a.unshift(o),a.length<7&&Math.abs(a.at(-1)-t)>l*.1&&a.push(t),a.slice(0,7)}function P(o,t,e,r,i={}){const u=i.left==null?m.left:i.left,l=i.right==null?m.right:i.right,c=i.top==null?m.top:i.top,a=i.base==null?m.base:i.base,s=i.horizontal===!0;let h="";return de(o,t,i.tickCount||5).forEach(n=>{if(s){const d=F(n,o,t,u,l);h+=`<path class="faint" d="M${d.toFixed(2)} ${c}V${a}"/>${w(A(n),d,a+13,"muted")}`}else{const d=F(n,o,t,a,c);h+=`<path class="faint" d="M${u} ${d.toFixed(2)}H${l}"/>${w(A(n),u-6,d+3.5,"muted","end")}`}}),h+=s?`<path class="hair" d="M${u} ${a}H${l}"/>`:`<path class="hair" d="M${u} ${c}V${a}H${l}"/>`,e&&(h+=Ae(e,r)),h}function K(o,t,e,r,i,u=!1){if(!Number.isInteger(i)||i<=1)return"";let l="";for(let c=1;c<i;c++)if(u){const a=o+e*c/i;l+=`<path class="hair" d="M${a.toFixed(2)} ${t}V${(t+r).toFixed(2)}"/>`}else{const a=t+r-r*c/i;l+=`<path class="hair" d="M${o} ${a.toFixed(2)}H${(o+e).toFixed(2)}"/>`}return l}function oe(o,t,e,r=["x","y","label","open","detail"]){return S(o.points,"points",t,e).map((i,u)=>(Q(i,`points[${u}]`,r,["x","y"]),i.label!=null&&p(i.label,`points[${u}].label`,!0),i))}function ae(o,t,e,r,i,u){return S(o[t],t,e,r).map((l,c)=>(Q(l,`${t}[${c}]`,u,["label",...i]),i.forEach(a=>{R(l[a],`${t}[${c}].${a}`,0)}),l))}function Y(o,t){return j(o,t&&t.detail)}function se(o){const t=[];return o.map((e,r)=>{const i=e.label||A(e.y),u=Math.max(24,i.length*6.2),l=13,c=[[8,-8,"start"],[-8,-8,"end"],[8,14,"start"],[-8,14,"end"],[0,-13,"middle"],[0,18,"middle"]];let a=c[r%c.length];for(const s of c){const h=e.px+s[0]-(s[2]==="end"?u:s[2]==="middle"?u/2:0),n=e.py+s[1]-l,d={left:h,top:n,right:h+u,bottom:n+l};if(h>=m.left&&d.right<=m.right&&n>=m.top-10&&d.bottom<=m.base&&!t.some($=>d.left<$.right+2&&d.right+2>$.left&&d.top<$.bottom+2&&d.bottom+2>$.top)){t.push(d),a=s;break}}return w(i,e.px+a[0],e.py+a[1],"value",a[2])})}z.rungBars=(o,t)=>{const e=V(o,["items","unit","yAxisTitle","sourceNote"]),r=ae(e,"items",2,8,["value"],["label","value","open","detail"]);t=t||{},p(e.unit,"unit"),p(e.yAxisTitle,"yAxisTitle");const i=Math.max(1,...r.map(a=>a.value)),u=(m.right-m.left)/r.length,l=Math.min(34,u-6);let c=P(0,i,e.yAxisTitle,e.unit);return r.forEach((a,s)=>{const h=F(a.value,0,i,0,m.base-m.top),n=m.left+s*u+(u-l)/2,d=m.base-h;c+=Y(`<rect class="fill${T(a)}" x="${n.toFixed(2)}" y="${d.toFixed(2)}" width="${l.toFixed(2)}" height="${h.toFixed(2)}"/>${K(n,d,l,h,a.value)}${w(A(a.value),n+l/2,Math.max(20,d-5),"value")}${q(a.label,n+l/2,158,u-2)}`,a)}),N(c,e,t,"zero")},z.hairlineLine=(o,t)=>{const e=V(o,["points","xLabels","xAxisTitle","yAxisTitle","unit","baselineZero","sourceNote"]),r=oe(e,3,30);t=t||{},Z(e.xLabels,"xLabels",r.length),["xAxisTitle","yAxisTitle","unit"].forEach(d=>{p(e[d],d)}),_(e.baselineZero,"baselineZero",["yes","no"],!0);const i=Math.min(...r.map(d=>d.x)),u=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=e.baselineZero==="no"?l:Math.min(0,l),a=Math.max(...r.map(d=>d.y),c+1),s=r.map(d=>({...d,px:F(d.x,i,u,m.left,m.right),py:F(d.y,c,a,m.base,m.top)}));let h=P(c,a,e.yAxisTitle,e.unit);h+=`<path class="line" d="${ne(s.map(d=>[d.px,d.py]))}"/>`,s.forEach(d=>{h+=Y(`<circle class="tone-2${T(d)}" cx="${d.px.toFixed(2)}" cy="${d.py.toFixed(2)}" r="3"/>`,d)}),r.length<=12&&(h+=se(s).join(""));const n=Math.max(1,Math.ceil(r.length/7));return e.xLabels.forEach((d,$)=>{($%n===0||$===r.length-1)&&(h+=w(d,s[$].px,157,"muted"))}),h+=W(e.xAxisTitle),N(h,e,t,e.baselineZero==="no"?"observed-min":"zero")},z.hairlineArea=(o,t)=>{const e=V(o,["points","xLabels","xAxisTitle","yAxisTitle","unit","sourceNote"]),r=oe(e,5,60,["x","y","label","open"]);t=t||{},Z(e.xLabels,"xLabels",2,12),["xAxisTitle","yAxisTitle","unit"].forEach(h=>{p(e[h],h)});const i=Math.min(...r.map(h=>h.x)),u=Math.max(...r.map(h=>h.x)),l=Math.max(1,...r.map(h=>h.y)),c=r.map(h=>({...h,px:F(h.x,i,u,m.left,m.right),py:F(h.y,0,l,m.base,m.top)}));let a=P(0,l,e.yAxisTitle,e.unit),s=`${ne(c.map(h=>[h.px,h.py]))}L${m.right} ${m.base}L${m.left} ${m.base}Z`;return a+=`<path class="tone-1" d="${s}"/><path class="line" d="${ne(c.map(h=>[h.px,h.py]))}"/>`,c.forEach(h=>{a+=`<circle class="${h.open?"open":"tone-2"}" cx="${h.px.toFixed(2)}" cy="${h.py.toFixed(2)}" r="2.5"/>`}),a+=se(c).join(""),e.xLabels.forEach((h,n)=>{a+=w(h,F(n,0,e.xLabels.length-1,m.left,m.right),157,"muted")}),a+=W(e.xAxisTitle),N(a,e,t,"zero")},z.tickDonut=(o,t)=>{const e=V(o,["parts","unit","total","sourceNote"]);t=t||{},p(e.unit,"unit"),p(e.total,"total",!0);const r=S(e.parts,"parts",2,6).map((n,d)=>(Q(n,`parts[${d}]`,["label","value","open","detail"],["label","value"]),R(n.value,`parts[${d}].value`,0,!0),n)),i=r.reduce((n,d)=>n+d.value,0);if(!i||i>120)throw new TypeError("parts must total from 1 to 120 ticks");const u=180,l=83,c=42,a=53;let s="",h=0;return r.forEach(n=>{let d="";const $=h;for(let k=0;k<n.value;k++,h++){const M=(h+.5)/i*Math.PI*2-Math.PI/2,v=u+Math.cos(M)*c,E=l+Math.sin(M)*c,U=u+Math.cos(M)*a,ee=l+Math.sin(M)*a;d+=`<path class="line${T(n,!0)}" d="M${v.toFixed(2)} ${E.toFixed(2)}L${U.toFixed(2)} ${ee.toFixed(2)}"/>`}const x=($+n.value/2)/i*Math.PI*2-Math.PI/2,f=u+Math.cos(x)*72,b=l+Math.sin(x)*62,y=Math.cos(x)>.2?"start":Math.cos(x)<-.2?"end":"middle";d+=`${w(n.label,f,b,"muted",y)}${w(n.value,f,b+12,"value",y)}`,s+=Y(d,n)}),s+=`${w(e.total||i,u,l-1,"value")}${w(e.unit,u,l+14,"muted")}`,N(s,e,t,"not-applicable")},z.tickRows=(o,t)=>{const e=V(o,["items","unit","xAxisTitle","sourceNote"]),r=ae(e,"items",2,8,["value"],["label","value","open","detail"]);if(t=t||{},p(e.unit,"unit"),p(e.xAxisTitle,"xAxisTitle"),r.forEach((a,s)=>{R(a.value,`items[${s}].value`,0,!0)}),r.some(a=>a.value>40))throw new TypeError("items[].value must be at most 40 ticks");const i=Math.max(1,...r.map(a=>a.value)),u=116/r.length,l=Math.min(7,210/i);let c=`<path class="hair" d="M112 ${m.top}V${m.base}"/>`;return r.forEach((a,s)=>{const h=m.top+u*(s+.5);let n=q(a.label,104,h+4,88,"end");for(let d=0;d<a.value;d++){const $=118+d*l;n+=`<path class="line${T(a,!0)}" d="M${$.toFixed(2)} ${(h-5).toFixed(2)}V${(h+6).toFixed(2)}"/>`}n+=w(A(a.value),346,h+4,"value","end"),c+=Y(n,a)}),c+=W(e.xAxisTitle,e.unit,174),N(c,e,t,"zero")},z.pairedRungs=(o,t)=>{const e=V(o,["aLabel","bLabel","items","unit","xAxisTitle","sourceNote"]);t=t||{},["aLabel","bLabel","unit","xAxisTitle"].forEach(s=>{p(e[s],s)});const r=ae(e,"items",2,6,["a","b"],["label","a","b","open","detail"]),i=Math.max(1,...r.flatMap(s=>[s.a,s.b])),u=106/r.length,l=96,c=238;let a=`${w(e.aLabel,220,14,"axis-title","end")}${w(e.bLabel,334,14,"axis-title","end")}`;return a+=P(0,i,"",e.unit,{left:l,right:l+c,top:m.top,base:m.base,horizontal:!0}),r.forEach((s,h)=>{const n=m.top+3+h*u,d=F(s.a,0,i,0,c),$=F(s.b,0,i,0,c),x=Math.max(5,Math.min(8,u/2-2));a+=Y(`${q(s.label,l-7,n+x+2,82,"end")}<rect class="tone-3${T(s)}" x="${l}" y="${n.toFixed(2)}" width="${d.toFixed(2)}" height="${x.toFixed(2)}"/>${K(l,n,d,x,s.a,!0)}${w(A(s.a),l+d+4,n+x,"value","start")}<rect class="tone-1${T(s)}" x="${l}" y="${(n+x+3).toFixed(2)}" width="${$.toFixed(2)}" height="${x.toFixed(2)}"/>${K(l,n+x+3,$,x,s.b,!0)}${w(A(s.b),l+$+4,n+x*2+3,"value","start")}`,s)}),a+=W(e.xAxisTitle,e.unit),N(a,e,t,"zero")},z.stackedRungs=(o,t)=>{const e=V(o,["partLabels","items","unit","xAxisTitle","sourceNote"]);t=t||{},Z(e.partLabels,"partLabels",2,4),p(e.unit,"unit"),p(e.xAxisTitle,"xAxisTitle");const r=S(e.items,"items",2,6).map((n,d)=>(Q(n,`items[${d}]`,["label","parts","open","detail"],["label"]),S(n.parts,`items[${d}].parts`,e.partLabels.length,e.partLabels.length),n.parts.forEach(($,x)=>{R($,`items[${d}].parts[${x}]`,0)}),n)),i=r.map(n=>n.parts.reduce((d,$)=>d+$,0)),u=Math.max(1,...i),l=108/r.length,c=91,a=239,s=r.length*e.partLabels.length<=12;let h=e.partLabels.map((n,d)=>w(n,c+(d+.5)*(a/e.partLabels.length),14,`axis-title tone-name-${d+1}`)).join("");return h+=P(0,u,"",e.unit,{left:c,right:c+a,top:m.top,base:m.base,horizontal:!0}),r.forEach((n,d)=>{const $=m.top+d*l+4,x=Math.min(16,l-5);let f=c,b=q(n.label,c-7,$+x/2+4,77,"end");n.parts.forEach((y,k)=>{const M=F(y,0,u,0,a);if(b+=`<rect class="tone-${k+1}${T(n)}" x="${f.toFixed(2)}" y="${$.toFixed(2)}" width="${M.toFixed(2)}" height="${x.toFixed(2)}"/>${K(f,$,M,x,y,!0)}`,s&&M>=18){const v=A(y),E=v.length*7+4;b+=`<rect class="tone-${k+1} label-pad${T(n)}" x="${(f+M/2-E/2).toFixed(2)}" y="${($+x/2-6).toFixed(2)}" width="${E}" height="12"/>`,b+=w(v,f+M/2,$+x/2+4,"value")}f+=M}),b+=w(A(i[d]),f+4,$+x/2+4,"value","start"),h+=Y(b,n)}),h+=W(e.xAxisTitle,e.unit),N(h,e,t,"zero")},z.plumbScatter=(o,t)=>{const e=V(o,["points","xAxisTitle","yAxisTitle","xUnit","yUnit","sourceNote"]),r=oe(e,3,20);t=t||{},["xAxisTitle","yAxisTitle","xUnit","yUnit"].forEach(h=>{p(e[h],h)}),r.forEach((h,n)=>{p(h.label,`points[${n}].label`)});const i=Math.min(0,...r.map(h=>h.x)),u=Math.max(1,...r.map(h=>h.x)),l=Math.min(0,...r.map(h=>h.y)),c=Math.max(1,...r.map(h=>h.y)),a=r.map(h=>({...h,px:F(h.x,i,u,m.left,m.right),py:F(h.y,l,c,m.base,m.top)}));let s=P(l,c,e.yAxisTitle,e.yUnit);return de(i,u,5).forEach(h=>{const n=F(h,i,u,m.left,m.right);s+=`${w(A(h),n,157,"muted")}<path class="faint" d="M${n.toFixed(2)} ${m.top}V${m.base}"/>`}),a.forEach(h=>{s+=Y(`<path class="quiet${T(h,!0)}" d="M${h.px.toFixed(2)} ${m.base}V${h.py.toFixed(2)}"/><circle class="tone-3${T(h)}" cx="${h.px.toFixed(2)}" cy="${h.py.toFixed(2)}" r="3.5"/>`,h)}),s+=se(a).join("")+W(e.xAxisTitle,e.xUnit),N(s,e,t,"zero")},z.rungWaterfall=(o,t)=>{const e=V(o,["start","startLabel","steps","endLabel","unit","yAxisTitle","sourceNote"]);t=t||{},R(e.start,"start"),["startLabel","endLabel","unit","yAxisTitle"].forEach($=>{p(e[$],$)});const r=S(e.steps,"steps",2,6).map(($,x)=>Q($,`steps[${x}]`,["label","delta","open","detail"],["label","delta"])),i=[e.start];r.forEach($=>{i.push(i.at(-1)+$.delta)});const u=Math.min(0,...i),l=Math.max(1,...i),c=r.length+2,a=(m.right-m.left)/c,s=Math.min(28,a-5),h=$=>F($,u,l,m.base,m.top);let n=P(u,l,e.yAxisTitle,e.unit);const d=($,x,f,b)=>{const y=m.left+f*a+(a-s)/2,k=h(0),M=h($),v=Math.min(k,M),E=Math.max(1,Math.abs(M-k));return`<rect class="${b}" x="${y.toFixed(2)}" y="${v.toFixed(2)}" width="${s.toFixed(2)}" height="${E.toFixed(2)}"/>${w(A($),y+s/2,Math.max(20,v-5),"value")}${q(x,y+s/2,158,a-2)}`};return n+=d(e.start,e.startLabel,0,"tone-3"),r.forEach(($,x)=>{const f=i[x],b=i[x+1],y=m.left+(x+1)*a+(a-s)/2,k=h(f),M=h(b),v=Math.min(k,M),E=Math.max(1,Math.abs(M-k));n+=Y(`<rect class="tone-1${T($)}" x="${y.toFixed(2)}" y="${v.toFixed(2)}" width="${s.toFixed(2)}" height="${E.toFixed(2)}"/>${K(y,v,s,E,Math.abs($.delta))}${w(`${$.delta>=0?"+":""}${A($.delta)}`,y+s/2,$.delta>=0?Math.max(20,v-5):Math.min(141,v+E+12),"value")}${q($.label,y+s/2,158,a-2)}`,$),x<r.length-1&&(n+=`<path class="faint" d="M${(y+s).toFixed(2)} ${M.toFixed(2)}H${(y+a).toFixed(2)}"/>`)}),n+=d(i.at(-1),e.endLabel,c-1,"tone-3"),N(n,e,t,"zero")},z.dotHeat=(o,t)=>{const e=V(o,["rows","cols","values","rowAxisTitle","colAxisTitle","unit","sourceNote"]);t=t||{},Z(e.rows,"rows",2,8),Z(e.cols,"cols",2,12),["rowAxisTitle","colAxisTitle","unit"].forEach(n=>{p(e[n],n)}),S(e.values,"values",e.rows.length,e.rows.length),e.values.forEach((n,d)=>{S(n,`values[${d}]`,e.cols.length,e.cols.length),n.forEach(($,x)=>{R($,`values[${d}][${x}]`,0)})});const r=Math.max(1,...e.values.flat()),i=92,u=29,l=252,c=111,a=l/e.cols.length,s=c/e.rows.length;let h=w(`Dot area \xB7 ${e.unit}`,344,14,"axis-title","end");return e.cols.forEach((n,d)=>{h+=q(n,i+(d+.5)*a,24,a-2)}),e.rows.forEach((n,d)=>{h+=q(n,i-7,u+(d+.5)*s+4,76,"end"),e.values[d].forEach(($,x)=>{const f=Math.sqrt($/r)*Math.max(1,Math.min(8,s/2-2)),b=i+(x+.5)*a,y=u+(d+.5)*s;h+=`<circle class="tone-2" cx="${b.toFixed(2)}" cy="${y.toFixed(2)}" r="${f.toFixed(2)}"/>${w($,b,y+3.5,"value")}`})}),h+=`<g transform="translate(11 84) rotate(-90)">${w(e.rowAxisTitle,0,0,"axis-title")}</g>${w(e.colAxisTitle,218,158,"axis-title")}`,N(h,e,t,"not-applicable")},z.tickGauge=(o,t)=>{const e=V(o,["value","max","label","unit","open","sourceNote"]);if(t=t||{},R(e.value,"value",0,!0),R(e.max,"max",1,!0),e.max>100)throw new TypeError("max must be at most 100 ticks");if(e.value>e.max)throw new TypeError("value must not exceed max");["label","unit"].forEach(a=>{p(e[a],a)}),_(e.open,"open",["yes","no"],!0);const r=180,i=116,u=56,l=72;let c="";for(let a=0;a<e.max;a++){const s=Math.PI+(a+.5)/e.max*Math.PI,h=r+Math.cos(s)*u,n=i+Math.sin(s)*u,d=r+Math.cos(s)*l,$=i+Math.sin(s)*l,x=a<e.value,f=x&&e.open==="yes";c+=`<path class="${x?"line":"faint"}${f?" open-line":""}" d="M${h.toFixed(2)} ${n.toFixed(2)}L${d.toFixed(2)} ${$.toFixed(2)}"/>`}return c+=`${w(A(e.value),r,103,"value")}${w("0",r-l,136,"muted")}${w(A(e.max),r+l,136,"value")}${w(le(e.label,e.unit),r,160,"axis-title")}`,N(c,e,t,"zero")},z.dumbbell=(o,t)=>{const e=V(o,["beforeLabel","afterLabel","items","unit","xAxisTitle","sourceNote"]);t=t||{},["beforeLabel","afterLabel","unit","xAxisTitle"].forEach(s=>{p(e[s],s)});const r=ae(e,"items",2,6,["before","after"],["label","before","after","open","detail"]),i=Math.max(1,...r.flatMap(s=>[s.before,s.after])),u=103,l=336,c=105/r.length;let a=`${w(e.beforeLabel,220,14,"axis-title","end")}${w(e.afterLabel,336,14,"axis-title","end")}`;return a+=P(0,i,"",e.unit,{left:u,right:l,top:m.top,base:m.base,horizontal:!0}),r.forEach((s,h)=>{const n=m.top+c*(h+.5),d=F(s.before,0,i,u,l),$=F(s.after,0,i,u,l);a+=Y(`${q(s.label,u-8,n+4,88,"end")}<path class="quiet${T(s,!0)}" d="M${d.toFixed(2)} ${n.toFixed(2)}H${$.toFixed(2)}"/><circle class="fill${T(s)}" cx="${d.toFixed(2)}" cy="${n.toFixed(2)}" r="4"/><circle class="tone-4${T(s)}" cx="${$.toFixed(2)}" cy="${n.toFixed(2)}" r="4"/>${w(A(s.before),d,n-7,"value")}${w(A(s.after),$,n+14,"value")}`,s)}),a+=W(e.xAxisTitle,e.unit),N(a,e,t,"zero")};function ue(o,t,e=0){return S(o,t,2,e?6:8).map((r,i)=>{if(Q(r,`${t}[${i}]`,["label","value","children","open","detail"],["label","value"]),R(r.value,`${t}[${i}].value`,0),r.children!=null){if(e)throw new TypeError(`${t}[${i}].children may only be one level deep`);ue(r.children,`${t}[${i}].children`,e+1)}return r})}function $e(o,t,e,r,i,u=0){const l=o.reduce((s,h)=>s+h.value,0);if(!l)throw new TypeError("treemap levels must total more than zero");let c=u%2?e:t,a="";return o.forEach((s,h)=>{const n=s.value/l,d=u%2?r:r*n,$=u%2?i*n:i,x=u%2?t:c,f=u%2?c:e,b=s.children?Math.min(20,$*.3):0;c+=u%2?$:d,a+=Y(`<rect class="tone-${h%4+1}${T(s)}" x="${x.toFixed(2)}" y="${f.toFixed(2)}" width="${d.toFixed(2)}" height="${$.toFixed(2)}"/>${q(`${s.label} ${A(s.value)}`,x+5,f+14,Math.max(18,d-10),"start")}`,s),s.children&&(a+=$e(s.children,x+3,f+b,Math.max(1,d-6),Math.max(1,$-b-3),u+1))}),a}z.treemap=(o,t)=>{const e=V(o,["items","unit","total","sourceNote"]);t=t||{},p(e.unit,"unit"),p(e.total,"total",!0);const r=ue(e.items,"items"),i=r.reduce((l,c)=>l+c.value,0),u=`${w(e.total||`${A(i)} ${e.unit}`,348,14,"value","end")}${$e(r,14,24,332,145)}`;return N(u,e,t,"not-applicable")},z.rungHistogram=(o,t)=>{const e=V(o,["bins","xAxisTitle","unit","sourceNote"]),r=ae(e,"bins",3,12,["count"],["label","count","open","detail"]);t=t||{},p(e.xAxisTitle,"xAxisTitle"),p(e.unit,"unit"),r.forEach((a,s)=>{R(a.count,`bins[${s}].count`,0,!0)});const i=Math.max(1,...r.map(a=>a.count)),u=(m.right-m.left)/r.length,l=u-1;let c=P(0,i,"Count",e.unit);return r.forEach((a,s)=>{const h=F(a.count,0,i,0,m.base-m.top),n=m.left+s*u,d=m.base-h;c+=Y(`<rect class="tone-2${T(a)}" x="${n.toFixed(2)}" y="${d.toFixed(2)}" width="${l.toFixed(2)}" height="${h.toFixed(2)}"/>${K(n,d,l,h,a.count)}${w(a.count,n+l/2,Math.max(20,d-5),"value")}${q(a.label,n+l/2,158,u-1)}`,a)}),c+=W(e.xAxisTitle,e.unit),N(c,e,t,"zero")},z.tickBox=(o,t)=>{const e=V(o,["groups","xAxisTitle","unit","sourceNote"]);t=t||{},p(e.xAxisTitle,"xAxisTitle"),p(e.unit,"unit");const r=S(e.groups,"groups",1,6).map((n,d)=>{if(Q(n,`groups[${d}]`,["label","min","q1","median","q3","max","outliers","open","detail"],["label","min","q1","median","q3","max"]),!(n.min<=n.q1&&n.q1<=n.median&&n.median<=n.q3&&n.q3<=n.max))throw new TypeError(`groups[${d}] five-number values must be ordered`);return n.outliers!=null&&(S(n.outliers,`groups[${d}].outliers`,0,20),n.outliers.forEach(($,x)=>{R($,`groups[${d}].outliers[${x}]`)})),n}),i=r.flatMap(n=>[n.min,n.max,...n.outliers||[]]),u=Math.min(0,...i),l=Math.max(1,...i),c=91,a=340,s=108/r.length;let h=P(u,l,"",e.unit,{left:c,right:a,top:m.top,base:m.base,horizontal:!0});return r.forEach((n,d)=>{const $=m.top+s*(d+.5),x=v=>F(v,u,l,c,a),f=Math.min(16,s-5),b=x(n.q1),y=x(n.q3),k=`line${T(n,!0)}`;let M=`${q(n.label,c-7,$+4,76,"end")}<path class="${k}" d="M${x(n.min).toFixed(2)} ${$.toFixed(2)}H${x(n.max).toFixed(2)}M${x(n.min).toFixed(2)} ${($-5).toFixed(2)}V${($+5).toFixed(2)}M${x(n.max).toFixed(2)} ${($-5).toFixed(2)}V${($+5).toFixed(2)}"/><rect class="fill${T(n)}" x="${b.toFixed(2)}" y="${($-f/2).toFixed(2)}" width="${Math.max(1,y-b).toFixed(2)}" height="${f.toFixed(2)}"/><path class="${k}" d="M${x(n.median).toFixed(2)} ${($-f/2).toFixed(2)}V${($+f/2).toFixed(2)}"/>${w(A(n.min),x(n.min),$-10,"value")}${w(A(n.q1),x(n.q1),$+17,"value")}${w(A(n.median),x(n.median),$-10,"value")}${w(A(n.q3),x(n.q3),$+17,"value")}${w(A(n.max),x(n.max),$-10,"value")}`;(n.outliers||[]).forEach(v=>{M+=`<circle class="tone-4${T(n)}" cx="${x(v).toFixed(2)}" cy="${$.toFixed(2)}" r="2.5"/>${w(A(v),x(v),$+17,"value")}`}),h+=Y(M,n)}),h+=W(e.xAxisTitle,e.unit),N(h,e,t,"zero")},z.streamRibbon=(o,t)=>{const e=V(o,["seriesLabels","xLabels","values","xAxisTitle","yAxisTitle","unit","sourceNote"]);t=t||{},Z(e.seriesLabels,"seriesLabels",2,5),Z(e.xLabels,"xLabels",3,12),["xAxisTitle","yAxisTitle","unit"].forEach(x=>{p(e[x],x)}),S(e.values,"values",e.seriesLabels.length,e.seriesLabels.length),e.values.forEach((x,f)=>{S(x,`values[${f}]`,e.xLabels.length,e.xLabels.length),x.forEach((b,y)=>{R(b,`values[${f}][${y}]`,0)})});const r=e.xLabels.map((x,f)=>e.values.reduce((b,y)=>b+y[f],0)),i=Math.max(1,...r),u=m.left,l=292,c=x=>F(x,0,e.xLabels.length-1,u,l),a=x=>F(x,0,i,m.base,m.top),s=new Array(e.xLabels.length).fill(0);let h=P(0,i,e.yAxisTitle,e.unit,{right:l});e.values.forEach((x,f)=>{const b=s.slice(),y=x.map((v,E)=>b[E]+v),k=y.map((v,E)=>[c(E),a(v)]),M=b.map((v,E)=>[c(E),a(v)]).reverse();h+=`<path class="tone-${f+1}" d="${ne([...k,...M])}Z"/>`,y.forEach((v,E)=>{s[E]=v})});const n=e.seriesLabels.map((x,f)=>m.top+(f+.5)*(m.base-m.top)/e.seriesLabels.length);let d=0;e.seriesLabels.forEach((x,f)=>{const b=d+e.values[f].at(-1)/2,y=a(b);d+=e.values[f].at(-1),h+=`<path class="quiet" d="M${l} ${y.toFixed(2)}L302 ${n[f].toFixed(2)}"/>${w(x,306,n[f]+3.5,"axis-title","start")}`});const $=Math.max(1,Math.ceil(e.xLabels.length/7));return e.xLabels.forEach((x,f)=>{(f%$===0||f===e.xLabels.length-1)&&(h+=w(x,c(f),157,"muted"))}),h+=`${w(A(r[0]),u+4,Math.max(20,a(r[0])-5),"value","start")}${w(A(r.at(-1)),l-4,Math.max(20,a(r.at(-1))-5),"value","end")}${W(e.xAxisTitle)}`,N(h,e,t,"zero")},z.rangeBars=(o,t)=>{const e=V(o,["items","unit","xAxisTitle","scaleMin","scaleMax","sourceNote"]),r=S(e.items,"items",1,8).map((d,$)=>{if(Q(d,`items[${$}]`,["label","low","high","mark","markLabel","open","detail"],["label","low","high"]),d.low>d.high)throw new TypeError(`items[${$}].low must not exceed high`);return d.mark!=null&&R(d.mark,`items[${$}].mark`),d.markLabel!=null&&p(d.markLabel,`items[${$}].markLabel`,!0),d});t=t||{},p(e.unit,"unit"),p(e.xAxisTitle,"xAxisTitle"),e.scaleMin!=null&&R(e.scaleMin,"scaleMin"),e.scaleMax!=null&&R(e.scaleMax,"scaleMax");const i=r.flatMap(d=>[d.low,d.high,...d.mark==null?[]:[d.mark]]),u=e.scaleMin==null?Math.min(0,...i):e.scaleMin,l=e.scaleMax==null?Math.max(1,...i):e.scaleMax;if(u>=l)throw new TypeError("scaleMin must be less than scaleMax");if(i.some(d=>d<u||d>l))throw new TypeError("scaleMin and scaleMax must contain every item value");const c=94,a=338,s=107/r.length,h=d=>F(d,u,l,c,a);let n=P(u,l,"",e.unit,{left:c,right:a,top:m.top,base:m.base,horizontal:!0});return r.forEach((d,$)=>{const x=m.top+s*($+.5),f=h(d.low),b=h(d.high);let y=`${q(d.label,c-7,x+4,80,"end")}<path class="quiet${T(d,!0)}" d="M${f.toFixed(2)} ${x.toFixed(2)}H${b.toFixed(2)}"/><path class="line${T(d,!0)}" d="M${f.toFixed(2)} ${(x-5).toFixed(2)}V${(x+5).toFixed(2)}M${b.toFixed(2)} ${(x-5).toFixed(2)}V${(x+5).toFixed(2)}"/>${w(A(d.low),f,x-7,"value")}${w(A(d.high),b,x-7,"value")}`;if(d.mark!=null){const k=h(d.mark);y+=`<circle class="tone-4${T(d)}" cx="${k.toFixed(2)}" cy="${x.toFixed(2)}" r="3.5"/>${w(d.markLabel||A(d.mark),k,x+13,"value")}`}n+=Y(y,d)}),n+=W(e.xAxisTitle,e.unit),N(n,e,t,`scale-min:${A(u)}`)},re.registry=be.slice(),re.recommendedRegistry=["flow","timeline","hierarchy","zones","beforeAfter","hub","compareTwo","rungBars","hairlineLine","stackedRungs","rangeBars"],re.components=z,re.render=(o,t,e)=>{var r=z[o];if(!r)throw new Error("unknown component: "+o);return r(t,e||{})}})();
</script><script id="ld-runtime">(()=>{function Je(){window.LegalDesign=window.LegalDesign||{};const _=window.LegalDesign,A=document.documentElement,Ct=document.getElementById("legaldesign-state");if(!Ct)return;const ut=["ink","muted","faint","red","red-strong"],pt=["card","card-strong","tint","bg","none"],Ze=new Set(["accentRole","baselineZero","highlight","markAt","nowAt","open","orientation","toward","winner"]),Wi=Array.from(document.head?document.head.querySelectorAll("style"):[]).map((t,e)=>({id:t.id||null,index:e,attributes:Array.from(t.attributes).map(i=>[i.name,i.value]),text:t.textContent})),ji=new Set(["bg","card","card-strong","faint","ink","insert","label","line","line-strong","muted","red","red-strong","red-wash","scrim","shadow","shadow-soft","tint"]),W={title:"[The claim in one sentence, ending with a period.]",cardTitle:"[The open item in five words.]",cardLine:"[One fact about it, under twenty words.]",figureLabel:"[Stage name.]"},Fi=["sequence","time","hierarchy","containment","comparison","convergence","feedback","priority","progression","interaction","part-of-whole","distribution","correlation","change","quantity"],Hi=["form","framing","granularity","emphasis","layout","register","single"],Ui=["cards","zones","agenda","track"],$i=new Set(["agreed_line","axis","cards","component","encoding","html","items","layout","params","rows","segments","sub","text","title","why"]),Qe={cards:new Set(["action","detail","line","tag","title"]),items:new Set(["line","n","title"]),segments:new Set(["detail","label","line","name","state"])},zi=["text","card","figure","table","evidence","decision"],ti=["title","answer","summary","action","scope","finding","expected","matter"];let M=[];const ft=[];let It=[],D=!1,L=null,nt=!1,Tt=null,Lt=null;const ge=[];let Vt=null,Gt=!1;const Kt='[data-editable],[data-diagram-object],[data-editor-object],.ld-card,.sb-card,section.ld-unit[data-kind="card"],.ld-diagram svg g[role="button"]',be=new WeakSet,rr=window.matchMedia("(prefers-reduced-motion: reduce)"),ei=11,Vi=.01,Gi=880,ii=12.25;function ai(){A.setAttribute("data-legaldesign-ready","true"),window.dispatchEvent(new CustomEvent("legaldesign:ready"))}function ri(t){if(A.removeAttribute("data-legaldesign-ready"),!t){queueMicrotask(ai);return}requestAnimationFrame(()=>{requestAnimationFrame(ai)})}function it(t){return JSON.stringify(t).replace(/</g,"\\u003c")}function F(t){return JSON.parse(JSON.stringify(t))}function ye(t,e){return it(t)===it(e)}function d(t,e){return Array.prototype.slice.call((e||document).querySelectorAll(t))}function Ki(t){d(".ld-review,.ld-sheet-open,.ld-bottom-save,#ld-phone-sheet,#ld-selection-popover",t||document).forEach(e=>{e.remove()})}function Et(t){const e=t.getBoundingClientRect();return!t.hidden&&e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}function ve(t){d("[data-fill-token]",t||document).forEach(e=>{pt.includes(e.getAttribute("data-fill-token"))||e.removeAttribute("data-fill-token")}),d("[data-text-token]",t||document).forEach(e=>{ut.includes(e.getAttribute("data-text-token"))||e.removeAttribute("data-text-token")})}function Xi(t){d("style",t).forEach(a=>{a.closest("head")||a.remove()});const e=t.querySelector("head");if(!e)return;const i=d("style",e),r=new Set;Wi.forEach(a=>{let n=a.id?i.find(o=>!r.has(o)&&o.id===a.id):i[a.index];n&&r.has(n)&&(n=null),n||(n=i.find(o=>!r.has(o))),n||(n=document.createElement("style"),e.appendChild(n)),Array.from(n.attributes).forEach(o=>{n.removeAttribute(o.name)}),a.attributes.forEach(([o,s])=>{n.setAttribute(o,s)}),n.textContent=a.text,r.add(n)}),i.forEach(a=>{r.has(a)||a.remove()})}function Xt(t,e){const i=e||[];return String(t).trim().split(/\s+/).every(r=>i.includes(r)||/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:px|%|em|rem|vh|vw)?$/.test(r))}function Yi(t){if(t=String(t).trim(),t==="none")return!0;const e="-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:px|%|deg)?",i=`${e}(?:\\s*(?:,|\\s)\\s*${e}){0,15}`,r=new RegExp(`(?:matrix3d|matrix|translate3d|translate|translateX|translateY|scale3d|scale|scaleX|scaleY|rotate)\\(\\s*${i}\\s*\\)`,"gi");return t.replace(r,"").trim()===""}function Ji(t){if(t=String(t).trim(),["currentcolor","inherit","none","transparent"].includes(t))return!0;const e=/^var\(--([a-z0-9-]+)\)$/.exec(t);return!!(e&&ji.has(e[1]))}function ni(t,e){if(["--ld-row","--ld-column","--ld-span","--ld-row-span"].includes(t))return/^[1-9]\d{0,3}$/.test(String(e).trim());const i=new Set(["bottom","border-radius","column-gap","font-size","gap","height","left","max-height","max-width","min-height","min-width","right","row-gap","top","width"]),r=/^(?:margin|padding)(?:-(?:top|right|bottom|left))?$/;return i.has(t)?Xt(e,["auto","none"]):r.test(t)?Xt(e,["auto"]):["background","background-color","border-color","color"].includes(t)?Ji(e):t==="transform"?Yi(e):t==="transform-origin"?Xt(e,["bottom","center","left","right","top"]):t==="position"?["absolute","fixed","relative","static","sticky"].includes(e):t==="display"?["block","flex","grid","inline","inline-block","inline-flex","none"].includes(e):t==="justify-content"?["center","end","flex-end","flex-start","space-around","space-between","space-evenly","start"].includes(e):t==="text-align"?["center","end","left","right","start"].includes(e):t==="box-sizing"?["border-box","content-box"].includes(e):t==="transform-box"?["border-box","content-box","fill-box","view-box"].includes(e):t==="font-style"?["italic","normal","oblique"].includes(e):t==="font-weight"?/^(?:normal|bold|[1-9]00)$/.test(e):t==="text-decoration-line"?/^(?:none|underline|overline|line-through)(?:\s+(?:underline|overline|line-through))*$/.test(e):t==="line-height"?e==="normal"||Xt(e):t==="z-index"?/^-?\d+$/.test(e):!1}function Zi(t){const e=new Set(["aria-controls","aria-describedby","aria-labelledby"]),i={"aria-current":new Set(["date","false","location","page","step","time","true"]),"aria-disabled":new Set(["false","true"]),"aria-expanded":new Set(["false","true"]),"aria-haspopup":new Set(["dialog","false","grid","listbox","menu","tree","true"]),"aria-hidden":new Set(["false","true"]),"aria-live":new Set(["assertive","off","polite"]),"aria-modal":new Set(["false","true"]),"aria-pressed":new Set(["false","mixed","true"])},r=new Set(d("[id]",t).map(a=>a.id).filter(Boolean));d("*",t).forEach(a=>{if(!(a.localName==="style"||a.localName==="script")){if(a.hasAttribute("style")){const n=Array.from(a.style).map(o=>({property:o,value:a.style.getPropertyValue(o).trim(),priority:a.style.getPropertyPriority(o)})).filter(o=>ni(o.property,o.value));a.removeAttribute("style"),n.forEach(o=>{a.style.setProperty(o.property,o.value,o.priority)})}if(a.hasAttribute("value")){const n=a.getAttribute("value"),o=a.hasAttribute("data-decision-option")&&/^option-\d+$/.test(n),s=a.matches("#editor-fill-token option")&&[""].concat(pt).includes(n),u=a.matches("#editor-text-token option")&&[""].concat(ut).includes(n);!o&&!s&&!u&&a.removeAttribute("value")}a.hasAttribute("placeholder")&&(a.hasAttribute("data-decision-custom")?a.setAttribute("placeholder","Custom position"):a.hasAttribute("data-decision-note")?a.setAttribute("placeholder","Note"):a.matches("input,textarea")?a.setAttribute("placeholder","[Editable value.]"):a.removeAttribute("placeholder")),Array.from(a.attributes).forEach(n=>{const o=n.name.toLowerCase();if(o.startsWith("aria-")){if(o==="aria-label"||o==="aria-description"){o==="aria-description"&&a.setAttribute(o,"[Accessible description.]");return}if(e.has(o)){const s=n.value.split(/\s+/).filter(u=>u&&r.has(u));s.length?a.setAttribute(o,s.join(" ")):a.removeAttribute(o);return}i[o]&&i[o].has(n.value)||a.removeAttribute(o)}})}})}function Qi(){["mode-toggle","export-html","export-template"].forEach(a=>{const n=document.getElementById(a);n&&n.setAttribute("data-editor-only","")});const t=document.querySelector(".ld-controls"),e=document.querySelector(".ld-editor-tools");if(t&&t.classList.add("ld-pills"),t&&e&&e.parentElement!==t){const a=document.getElementById("theme-toggle");t.insertBefore(e,a||t.firstChild)}[["editor-font-down","A\u2212","Decrease type"],["editor-font-up","A+","Increase type"],["editor-bold","B","Bold"],["editor-italic","I","Italic"],["editor-underline","U","Underline"]].forEach(a=>{const n=document.getElementById(a[0]);n&&(n.textContent=a[1],n.setAttribute("aria-label",a[2]),n.title=a[2])});const i=document.getElementById("theme-toggle");i&&(i.setAttribute("aria-label","Theme"),i.title="Theme",i.innerHTML='<svg class="ld-theme-icon ld-theme-moon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"></path></svg><svg class="ld-theme-icon ld-theme-sun" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"></path></svg>');const r=document.getElementById("editor-overflow-toggle");r&&(r.textContent="More",r.setAttribute("aria-label","More")),[["editor-fill-token","Fill",pt],["editor-text-token","Text",ut]].forEach(a=>{const n=document.getElementById(a[0]);if(!n)return;const o=n.value;n.replaceChildren(),[""].concat(a[2]).forEach(s=>{const u=document.createElement("option");u.value=s,u.textContent=s||a[1],n.appendChild(u)}),[""].concat(a[2]).includes(o)&&(n.value=o)}),ve(document),wa()}function ta(t){const e=t||document.activeElement,i=e&&e.closest("[data-unit]");Tt=e,Lt=e?{id:e.id||null,detail:e.getAttribute("data-detail"),evidence:e.getAttribute("data-evidence"),card:e.matches(".ld-card[data-evidence]"),unit:i&&i.getAttribute("data-unit")}:null}function ea(){let t=Tt;const e=Lt;t&&!t.isConnected&&e&&(e.id&&(t=document.getElementById(e.id)),(!t||!t.isConnected)&&e.detail&&(t=d("[data-detail]").find(i=>i.getAttribute("data-detail")===e.detail&&!i.closest("[hidden]"))),(!t||!t.isConnected)&&e.evidence&&(t=d(e.card?".ld-card[data-evidence]":"[data-evidence]").find(i=>i.getAttribute("data-evidence")===e.evidence&&!i.closest("[hidden]")))),t&&t.isConnected&&t.focus(),Tt=null,Lt=null}function wt(t){const e=Date.parse(t||"");return Number.isFinite(e)?e:0}let Bt;try{if(Bt=JSON.parse(Ct.textContent),Bt.schema!=="legaldesign.state.v1")throw new TypeError("unsupported legaldesign state schema");const t=JSON.parse(it(Bt));if(!ye(Bt,t))throw new Error("legaldesign state round-trip mismatch")}catch(t){console.error("LegalDesign refused to render stale or invalid state.",t),A.setAttribute("data-legaldesign-error","state");return}function Ae(t){let e=2166136261;t=String(t||"");for(let i=0;i<t.length;i+=1)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return(e>>>0).toString(36)}function oi(){try{const t=new URL(window.location.href);return t.search="",t.hash="",t.href}catch{return String(window.location.href||"").split(/[?#]/)[0]}}let c=Bt;const Yt=A.getAttribute("data-exported");if(Yt==="client"){const t=A.getAttribute("data-client-blueprint-id")||c.artifactId,e=t+"-client-copy-"+Ae(oi());c.artifactId=e,A.setAttribute("data-client-blueprint-id",t),A.setAttribute("data-client-id",e),Ct.textContent=it(c)}if(Yt==="template"&&["exported","packaged"].includes(A.getAttribute("data-template-kind"))){const t=A.getAttribute("data-template-blueprint-id")||c.artifactId,e=t+"-copy-"+Ae(oi());c.artifactId=e,A.setAttribute("data-template-blueprint-id",t),A.setAttribute("data-template-id",e),Ct.textContent=it(c)}let Mt="legaldesign:"+c.artifactId+":v1";Yt&&(Mt="legaldesign:"+c.artifactId+":"+Yt+":v1");const xe=Mt+":dom";function ia(){Ct.textContent=it(c)}function K(){ia();try{localStorage.setItem(Mt,it(c))}catch{}}function Jt(){return[document.querySelector("main"),document.getElementById("popup-scrim")].filter(Boolean)}function si(t){const e=t.cloneNode(!0);return d("[contenteditable]",e).forEach(i=>{i.removeAttribute("contenteditable"),i.removeAttribute("spellcheck")}),d(".ld-selected,.ld-selection-mark",e).forEach(i=>{i.classList.remove("ld-selected","ld-selection-mark")}),e.innerHTML}function aa(){return{schema:"legaldesign.editor-dom.v1",artifactId:c.artifactId,savedAt:c.savedAt,roots:Jt().map((t,e)=>({id:t.id||null,index:e,html:si(t)}))}}function at(){if(A.getAttribute("data-exported")!=="client")try{localStorage.setItem(xe,it(aa()))}catch{}}function ra(){try{const t=JSON.parse(localStorage.getItem(xe)||"null");if(t&&t.schema==="legaldesign.editor-dom.v1"&&t.artifactId===c.artifactId&&Array.isArray(t.roots))return t}catch{}return null}function na(t){!t||wt(t.savedAt)>wt(c.savedAt)||((t.roots||[]).forEach(e=>{const i=e.id?document.getElementById(e.id):Jt()[e.index];i&&typeof e.html=="string"&&(i.innerHTML=e.html)}),ve(document))}function Ee(){return re(),{state:F(c),roots:Jt().map(t=>({id:t.id||null,tag:t.tagName,html:si(t)}))}}function we(){ft.push(Ee()),ft.length>100&&ft.shift(),It=[],lt()}function Se(t,e){(!e||e.history!==!1)&&we(),t(c),c.savedAt=new Date().toISOString(),K(),mt(),at()}function li(t){c=F(t.state),(t.roots||[]).forEach((e,i)=>{const r=e.id?document.getElementById(e.id):Jt()[i];r&&(r.innerHTML=e.html)}),ve(document),M=[],L=null,nt=!1,K(),Zt(c.review&&c.review.theme||ke(),!1),Ie(),ne(),Dt(),yt(),qt(),vt(),Z(),at()}function di(){ft.length&&(It.push(Ee()),li(ft.pop()),lt())}function ci(){It.length&&(ft.push(Ee()),li(It.pop()),lt())}function ke(){return c.review&&(c.review.theme==="light"||c.review.theme==="dark")?c.review.theme:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Zt(t,e){const i=t==="dark"?"dark":"light";A.setAttribute("data-theme",i),c.review||(c.review={}),c.review.theme=i,e&&(c.savedAt=new Date().toISOString(),K())}function oa(){let t=null;try{t=JSON.parse(localStorage.getItem(Mt)||"null")}catch{t=null}if(A.getAttribute("data-exported")==="client"){t&&t.schema===c.schema&&wt(t.savedAt)>wt(c.savedAt)&&!ye(t,c)&&(c=t,K(),mt({sync:!1}));return}if(!t||t.schema!==c.schema||wt(t.savedAt)<=wt(c.savedAt)||ye(t,c))return;const e=document.createElement("div");e.className="ld-restore",e.id="ld-restore-banner",e.innerHTML='<span>Restore unsaved changes?</span><button type="button" data-restore>Restore</button><button type="button" data-discard>Discard</button>';const i=document.querySelector(".ld-bar");(i?i.parentNode:document.body).insertBefore(e,i?i.nextSibling:document.body.firstChild),e.querySelector("[data-restore]").addEventListener("click",()=>{c=t,na(ra()),K(),e.remove(),mt({sync:!1}),Ie(),ne(),Dt(),yt(),qt(),vt(),at()}),e.querySelector("[data-discard]").addEventListener("click",()=>{try{localStorage.removeItem(Mt),localStorage.removeItem(xe)}catch{}e.remove(),K()})}function Q(t){return c.units&&c.units[t]}function ui(t){return t&&t.variants?t.variants[t.selected]:null}function pi(t,e){const i=Q(t);!i||!i.variants||!i.variants[e]||Se(()=>{i.selected=e})}function fi(){return!!(c.approaches&&c.approaches.a&&c.approaches.b&&document.querySelector("[data-approach='a']")&&document.querySelector("[data-approach='b']"))}function ht(){return c.review&&c.review.approach==="b"?"b":"a"}function sa(){if(!fi())return;const t=ht();A.setAttribute("data-page-approach",t),d("[data-approach]").forEach(e=>{e.hidden=e.getAttribute("data-approach")!==t}),d("[data-select-approach]").forEach(e=>{e.setAttribute("aria-pressed",e.getAttribute("data-select-approach")===t?"true":"false")})}function Ce(t){if(!fi()||!["a","b"].includes(t)||(c.review||(c.review={}),c.review.approach===t))return;re(),c.review.approach=t,c.review.location=0,c.savedAt=new Date().toISOString();const e=document.getElementById("ld-form-navigation");e&&e.remove(),mt({sync:!1}),qt(),K(),at()}function Ie(){const t=document.getElementById("ld-page-approach");!t||t.__legalDesignApproachBound||(t.__legalDesignApproachBound=!0,t.addEventListener("click",e=>{const i=e.target.closest("[data-select-approach]");i&&Ce(i.getAttribute("data-select-approach"))}),t.addEventListener("keydown",e=>{if(!["ArrowLeft","ArrowRight"].includes(e.key))return;e.preventDefault(),Ce(e.key==="ArrowLeft"?"a":"b");const i=t.querySelector('[data-select-approach="'+ht()+'"]');i&&i.focus()}))}function la(t){return String(t).replace(/~/g,"~0").replace(/\//g,"~1")}function da(t,e,i){if(!t||!e||e[0]!=="/")return!1;const r=e.slice(1).split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));let a=t;for(let n=0;n<r.length-1;n+=1){if(a==null||typeof a!="object")return!1;a=a[r[n]]}return a==null||typeof a!="object"?!1:(a[r[r.length-1]]=i,!0)}function Te(t,e,i){const r=i||[],a=e||"";return typeof t=="string"||typeof t=="number"?(r.push({path:a,value:String(t).replace(/\s+/g," ").trim(),used:!1}),r):Array.isArray(t)?(t.forEach((n,o)=>{Te(n,a+"/"+o,r)}),r):(t&&typeof t=="object"&&Object.keys(t).forEach(n=>{Te(t[n],a+"/"+la(n),r)}),r)}function hi(t){const e=d("tspan",t);return(e.length?e.map(i=>i.textContent.trim()).join(" "):t.textContent).replace(/\s+/g," ").trim()}function Ot(t,e){const i=Te(e||{});d(".ld-diagram svg text",t||document).forEach(r=>{if(r.setAttribute("data-diagram-label",""),r.setAttribute("data-editable",""),D?(r.setAttribute("tabindex","0"),r.setAttribute("role","textbox"),r.setAttribute("aria-label","Editable diagram label")):(r.removeAttribute("tabindex"),r.removeAttribute("role"),r.removeAttribute("aria-label")),r.hasAttribute("data-placeholder")||r.setAttribute("data-placeholder",hi(r)||W.figureLabel),!r.hasAttribute("data-param-path")){const a=hi(r),n=i.find(o=>!o.used&&o.value===a);n&&(n.used=!0,r.setAttribute("data-param-path",n.path))}})}function Le(t,e){d(".ld-variant",t).forEach(i=>{const r=i.getAttribute("data-variant"),a=e.variants&&e.variants[r],n=i.querySelector(".ld-diagram");if(!n||!a||!a.component)return;if((n.hasAttribute("data-editor-preserve-dom")||A.getAttribute("data-exported")==="client")&&n.querySelector("svg")){Ot(n,a.params);return}const o=n.closest(".ld-fixed-page")?n.clientWidth:n.getBoundingClientRect().width,s=o<Gi*ei/ii;n.innerHTML=_.render(a.component,a.params,{narrow:s,density:gt()?"compact":"standard",ariaLabel:e.claim});const u=n.querySelector("svg");if(u&&(Ot(n,a.params),u.setAttribute("data-frame",s?"narrow":"wide"),s&&o>480&&!n.closest(".ld-fixed-page"))){const m=t.getBoundingClientRect(),h=n.getBoundingClientRect(),g=t.querySelector(".ld-source-note");let w=0;if(g){const X=getComputedStyle(g);w=g.getBoundingClientRect().height+(parseFloat(X.marginTop)||0)+(parseFloat(X.marginBottom)||0)}const x=getComputedStyle(t),E=m.bottom-h.top-w-(parseFloat(x.paddingBottom)||0)-(parseFloat(x.borderBottomWidth)||0),N=u.viewBox.baseVal.height*(ei+Vi)/ii;u.style.height=Math.max(E,N)+"px",u.style.maxHeight="none"}})}function ca(t,e){if(e.kind!=="text"||!t.matches(".ld-composed-unit[data-detail]"))return;const i=t.getAttribute("data-detail");d(".ld-variant > [data-variant-body]",t).forEach(r=>{const a=document.createElement("button");a.type="button",a.className="ld-inline-detail",a.setAttribute("data-detail",i),a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-controls",i);const n=e.detailAnchor,o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let s=o.nextNode();n&&s;s=o.nextNode()){const u=s.textContent.indexOf(n);if(u<0||s.parentElement.closest("a,button"))continue;const m=s.splitText(u);m.splitText(n.length),a.textContent=n,m.replaceWith(a);break}if(!a.parentNode){const s=c.evidence?.[i]?.popup?.title;a.textContent=s&&s.length<=72?s:"Read supporting detail";const u=document.createElement("p");u.className="ld-detail-linkline",u.appendChild(a),r.appendChild(u)}}),["data-detail","role","tabindex","aria-haspopup","aria-controls"].forEach(r=>{t.removeAttribute(r)}),t.classList.remove("ld-popup-trigger")}function ua(t){const e=t.getAttribute("data-unit"),i=Q(e);if(!i)return;d(".ld-variant",t).forEach(a=>{const n=a.getAttribute("data-variant");if(a.hidden=n!==i.selected,i.edits&&i.edits[n]!=null&&i.kind!=="figure"&&A.getAttribute("data-exported")!=="client"){const o=a.querySelector("[data-variant-body]");o&&o.innerHTML!==i.edits[n]&&(o.innerHTML=i.edits[n])}}),d(".ld-ab button",t).forEach(a=>{a.setAttribute("aria-pressed",a.getAttribute("data-select-variant")===i.selected?"true":"false")});const r=t.querySelector(".ld-why");if(r){const a=ui(i);r.textContent=a&&a.why?a.why:""}i.kind==="figure"&&Le(t,i),ca(t,i)}function mt(t){D&&(!t||t.sync!==!1)&&re(),sa(),d("section.ld-unit[data-unit]").forEach(ua),Aa(),Zt(c.review&&c.review.theme||ke(),!1),_e()}function Qt(){if(!A.hasAttribute("data-composed-shell"))return[];const t=document.querySelector('#legaldesign-composed-root > [data-approach="'+ht()+'"]');return t?d(":scope > .ld-composed-section[data-composition-section]",t):d("#legaldesign-composed-root > .ld-composed-section[data-composition-section]")}function Be(){return c.brief&&c.brief.form}function gt(){return c.sourceSchemaVersion==="legaldesign.build.v4"}function Me(t){return t&&t.closest&&t.closest(".ld-fixed-page")&&Number(A.style.getPropertyValue("--ld-page-scale"))||1}function te(){return{width:A.clientWidth||window.innerWidth,height:A.clientHeight||window.innerHeight}}function mi(t){let e=te();window.addEventListener("resize",()=>{const i=te();i.width===e.width&&i.height===e.height||(e=i,t())})}function Oe(){if(A.hasAttribute("data-composed-shell")){const e=d("#legaldesign-composed-root > .ld-page-approach");return Be()==="one-page"?e:d(".ld-page-approach > .ld-composed-section")}const t=d("main > .sb-slide[data-frame]");return t.length?t:d("main.ld-page")}function pa(){if(A.hasAttribute("data-composed-shell"))return;const t=document.querySelector("main.ld-page"),e=t&&t.querySelector(":scope > .ld-core"),i=e&&e.querySelector(":scope > .ld-figure");if(!t||!e||!i||t.querySelector(":scope > .sb-slide"))return;const r=document.createElement("section");r.className="sb-slide is-current ld-reference-page",r.setAttribute("data-frame","1");const a=document.createElement("section");a.className="sb-slide ld-reference-page",a.setAttribute("data-frame","2"),a.hidden=!0;let n=!1;Array.from(t.children).forEach(o=>{o===e?(n=!0,r.appendChild(i),e.classList.add("ld-reference-cards"),a.appendChild(e)):(n?a:r).appendChild(o)}),t.append(r,a),t.id||(t.id="slide-stage")}function fa(){const t=document.getElementById("popup-scrim");!t||A.hasAttribute("data-composed-shell")||d("main .finding-grid .evidence-panel").forEach((e,i)=>{const a="reference-evidence-"+(e.closest(".sb-slide[data-frame]")?.getAttribute("data-frame")||i+1),n=e.querySelector("h2")?.textContent||"Evidence reviewed";if(document.getElementById(a))return;c.evidence[a]={cite:"",locator:"",excerpt:"",link:null,status:"authored",popup:{type:"detail",title:n,lede:"",sections:[]}};const o=document.createElement("article");o.id=a,o.className="pop",o.hidden=!0,o.setAttribute("data-evidence-id",a),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",n);const s=document.createElement("button");s.className="ld-popup-close",s.type="button",s.textContent="\xD7",s.setAttribute("aria-label","Close evidence review"),o.appendChild(s);const u=document.createElement("button");u.type="button",u.className="ld-control ld-reference-evidence",u.textContent=n,u.setAttribute("data-detail",a),u.setAttribute("aria-haspopup","dialog"),u.setAttribute("aria-controls",a),e.replaceWith(u),o.appendChild(e),t.appendChild(o)})}let bt=0,gi=!1;function Ne(t){const e=ee()[0],i=document.getElementById("popup-scrim");if(!e||!i)return;document.getElementById("ld-page-reader")?.remove();const r=document.createElement("div");r.id="ld-page-reader",r.className="pop ld-page-reader",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label","Read current page"),r.innerHTML='<button type="button" class="ld-popup-close" aria-label="Close page reader">\xD7</button>';const a=Array.from(e.children);let n=0;a.forEach(o=>{const s=o.cloneNode(!0);d("[hidden],.ld-unit-tools,.ld-why,[data-editor-only]",s).forEach(h=>{h.remove()}),[s,...d(".ld-unit[data-unit]",s)].forEach(h=>{const g=Q(h.getAttribute("data-unit")),w=g&&ui(g);if(w&&w.component&&!h.querySelector("[data-editor-preserve-dom]")){const x=h.querySelector(".ld-diagram");x&&(x.innerHTML=_.render(w.component,w.params,{narrow:!0,density:gt()?"compact":"standard",ariaLabel:g.claim}))}});const u=new Map;d("[id]",s).filter(h=>h instanceof SVGElement).forEach(h=>{const g="ld-reader-svg-"+ ++n;u.set(h.id,g),h.id=g});const m=h=>h.replace(/url\(\s*(['"]?)#([^)'"\s]+)\1\s*\)/g,(g,w,x)=>u.has(x)?"url(#"+u.get(x)+")":g);[s,...d("*",s)].forEach(h=>{h.matches('.ld-composed-unit[data-kind="text"]:is([data-detail],[data-evidence])')&&d(":scope > .ld-variant > [data-variant-body]",h).forEach(g=>{g.classList.add("ld-reader-popup-text")}),h instanceof SVGElement||h.removeAttribute("id"),h instanceof SVGElement&&(Array.from(h.attributes).forEach(g=>{let w=m(g.value);["href","xlink:href"].includes(g.name)&&w.startsWith("#")&&u.has(w.slice(1))&&(w="#"+u.get(w.slice(1))),w!==g.value&&h.setAttribute(g.name,w)}),h.tagName.toLowerCase()==="style"&&(h.textContent=m(h.textContent))),h.removeAttribute("contenteditable"),h.removeAttribute("spellcheck"),h.removeAttribute("tabindex"),["aria-controls","aria-labelledby","aria-describedby","for"].forEach(g=>{h.removeAttribute(g)}),Array.from(h.attributes).forEach(g=>{g.name.startsWith("data-")&&!["data-detail","data-evidence","data-section-target"].includes(g.name)&&h.removeAttribute(g.name)}),h.classList.contains("ld-unit")&&h.classList.add("ld-reader-unit"),h.classList.remove("ld-unit","ld-composed-unit","ld-fixed-page","ld-popup-trigger","ld-selected","ld-selection-mark"),h instanceof SVGElement||h.removeAttribute("style")}),d("input,textarea,select,button:not([data-detail]):not([data-evidence]):not([data-section-target])",s).forEach(h=>{const g=document.createElement("p");g.textContent=h.matches("input,textarea,select")?(h.getAttribute("aria-label")||h.getAttribute("placeholder")||"Response")+": "+(h.value||"\u2014"):h.textContent+(h.getAttribute("aria-pressed")==="true"?" \u2014 selected":""),h.replaceWith(g)}),s.className="ld-reader-section",r.appendChild(s)}),i.appendChild(r),Ei(),yt(),_t(r.id,t),d(".ld-diagram svg",r).forEach(o=>{const s=o.viewBox.baseVal.width||400,u=d("text",o).map(g=>parseFloat(getComputedStyle(g).fontSize)).filter(g=>g>0),m=u.length?Math.min(...u):13,h=o.parentElement.clientWidth;o.style.width=Math.max(h,s*11/m)+"px",o.style.height="auto",o.style.maxHeight="none"}),le(r)}function ha(){let t=document.getElementById("ld-read-page");t||(t=document.createElement("button"),t.id="ld-read-page",t.className="ld-control ld-read-page",t.type="button",t.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M12 5.5C9 3.5 5.5 3.5 2 4.5v14c3.5-1 7-1 10 1 3-2 6.5-2 10-1v-14c-3.5-1-7-1-10 1Zm0 0v14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',t.setAttribute("aria-label","Read page"),t.title="Read page \u2014 larger text and diagram details",t.setAttribute("aria-haspopup","dialog"),t.hidden=!0,document.body.appendChild(t)),t.__legalDesignReaderBound||(t.__legalDesignReaderBound=!0,t.addEventListener("click",()=>Ne(t)))}function ee(){return d(".ld-fixed-page").filter(t=>!t.closest("[hidden]")&&getComputedStyle(t).display!=="none")}function ie(t,e){const i=t.getBoundingClientRect(),r=Math.max(1,Me(t)*2),a=s=>s.width>0&&s.height>0&&(s.left<i.left-r||s.right>i.right+r||s.top<i.top-r||s.bottom>i.bottom+r),n=s=>{let u=s.parentElement?.closest("details:not([open])");for(;u&&t.contains(u);){if(!u.querySelector(":scope > summary")?.contains(s))return!0;u=u.parentElement?.closest("details:not([open])")}return!1},o=d("*",t).filter(s=>!s.closest("[hidden],[data-editor-only],.ld-unit-tools")&&!n(s)&&!s.matches("script,style")&&s.getClientRects().length);return o.some(s=>{const u=s.getBoundingClientRect(),m=getComputedStyle(s),h=!(s instanceof SVGElement)&&(/auto|scroll|hidden|clip/.test(m.overflowY)&&s.scrollHeight>s.clientHeight+2||/auto|scroll|hidden|clip/.test(m.overflowX)&&s.scrollWidth>s.clientWidth+2),g=a(u)||h;return g&&e&&e.push({page:t.id||t.getAttribute("data-composition-section"),tag:s.tagName,className:s.getAttribute("class"),kind:h?"internal clipping":"box outside frame",height:s.clientHeight,scrollHeight:s.scrollHeight,width:s.clientWidth,scrollWidth:s.scrollWidth,top:u.top-i.top,bottom:u.bottom-i.top}),g})?!0:o.some(s=>Array.from(s.childNodes).some(u=>{if(u.nodeType!==Node.TEXT_NODE||!u.textContent.trim())return!1;const m=document.createRange();m.selectNodeContents(u);const h=m.getBoundingClientRect(),g=a(h);return g&&e&&e.push({page:t.id||t.dataset.compositionSection,tag:s.tagName,className:s.getAttribute("class"),kind:"text ink outside frame",top:h.top-i.top,bottom:h.bottom-i.top}),g}))}function bi(t=!0){const e=ee().some(r=>ie(r));A.toggleAttribute("data-page-overflow",e);let i=document.getElementById("ld-page-fit-error");return e&&t&&!i&&(i=document.createElement("div"),i.id="ld-page-fit-error",i.className="ld-page-fit-error",i.setAttribute("data-editor-chrome",""),i.setAttribute("role","alert"),i.textContent="This page has more content than the available window can hold. Move detail into a popup or split it into another page before exporting. Your content has not been removed.",document.body.appendChild(i)),i&&!e&&!i.hasAttribute("data-export-fit-error")&&i.remove(),!e}function qe(t){const e=[],i=Oe().filter(o=>{const s=o.closest("[data-approach]");return t||!s||s.dataset.approach===ht()}),r=new Map,a=o=>{!o||r.has(o)||(r.set(o,{hidden:o.hidden,display:o.style.display}),o.hidden=!1,getComputedStyle(o).display==="none"&&(o.style.display="block"))};let n=!0;try{for(const o of i){a(o.closest("[data-approach]")),a(o),d('.ld-unit[data-kind="figure"]',o).forEach(m=>{const h=Q(m.getAttribute("data-unit"));h&&Le(m,h)}),ie(o,e)&&(n=!1);const s=d("details.ld-overview-group",o),u=s.map(m=>m.open);try{for(const m of s)s.forEach(h=>{h.open=h===m}),ie(o,e)&&(n=!1)}finally{s.forEach((m,h)=>{m.open=u[h]})}}}finally{r.forEach((o,s)=>{s.hidden=o.hidden,s.style.display=o.display,s.getAttribute("style")||s.removeAttribute("style")})}if(_.lastPageFitIssues=e,n){const o=document.getElementById("ld-page-fit-error");o&&o.remove()}else{let o=document.getElementById("ld-page-fit-error");o||(o=document.createElement("div"),o.id="ld-page-fit-error",o.className="ld-page-fit-error",o.setAttribute("data-editor-chrome",""),o.setAttribute("role","alert"),document.body.appendChild(o)),o.textContent="An output page exceeds its available window. Review every page and move detail into a popup or another page before exporting. Nothing has been deleted.",o.setAttribute("data-export-fit-error","")}return n}function Nt(){if(bt=0,!A.hasAttribute("data-fixed-pages"))return;const t=te(),e=document.querySelector(".ld-bar"),i=document.getElementById("ld-page-approach"),r=e?Math.max(0,e.getBoundingClientRect().bottom):0,a=i&&!i.hidden?i.offsetHeight+10:0,n=document.querySelector("nav.rail"),o=n&&n.getClientRects().length?n.getBoundingClientRect().right+12:0,s=A.hasAttribute("data-has-slide-index")?t.width<=760?68:214:12,u=A.hasAttribute("data-composed-shell")&>();A.toggleAttribute("data-stable-type",u);const m=Math.max(1,t.width-Math.max(s,o)-12),h=u&&t.width>760?Math.min(m,1440):m,g=(m-h)/2,w=Math.max(s,o)+g;A.style.setProperty("--ld-index-left",g+"px");const x=r+10+a;A.style.setProperty("--ld-result-top",x+"px");const E=document.querySelector(".ld-save-banner"),I=E&&E.getClientRects().length?E.getBoundingClientRect().height+10:0,N=x+I,X=document.getElementById("ld-read-page");X&&(X.hidden=!1);const dt=u&&t.width>760?0:52,ct=Math.max(1,t.height-N-12-dt);let Y=Math.min(h/1200,ct/900,1);u&&t.width>760&&(Y=1);const U=Y;if(A.hasAttribute("data-composed-shell")&&!u&&t.width>760&&Y<.8){const et=Math.min(h/1200,1);for(let G=et;G>U;G-=.02){A.style.setProperty("--ld-page-scale",String(G)),A.style.setProperty("--ld-page-width",h/G+"px"),A.style.setProperty("--ld-page-height",ct/G+"px");const Ut=new Map,At=R=>{!R||Ut.has(R)||(Ut.set(R,{hidden:R.hidden,display:R.style.display}),R.hidden=!1,getComputedStyle(R).display==="none"&&(R.style.display="block"))};let $t=!0;try{for(const R of Oe())if(At(R.closest("[data-approach]")),At(R),ie(R)){$t=!1;break}}finally{Ut.forEach((R,fe)=>{fe.hidden=R.hidden,fe.style.display=R.display})}if($t){Y=G;break}}}A.style.setProperty("--ld-page-scale",String(Y)),A.style.setProperty("--ld-page-width",h/Y+"px"),A.style.setProperty("--ld-page-height",ct/Y+"px"),A.style.setProperty("--ld-page-left",w+"px"),A.style.setProperty("--ld-page-top",N+"px"),A.setAttribute("data-page-layout","adaptive"),A.style.setProperty("--ld-approach-top",r+6+"px"),bi(),ma(),d(".ld-fixed-page .ld-diagram svg text").forEach(et=>{const G=et.getAttribute("transform");et.setAttribute("transform",(G||"")+" translate(0 0)"),et.getBoundingClientRect(),G===null?et.removeAttribute("transform"):et.setAttribute("transform",G)}),D&&Z()}function ot(){bt||(bt=requestAnimationFrame(Nt))}function ma(){const t=document.getElementById("ld-form-navigation");if(!t||!A.hasAttribute("data-composed-shell"))return;const e=te();if(e.width<=760){t.style.removeProperty("height"),t.style.removeProperty("--ld-index-top");return}const r=ee().flatMap(o=>d(".ld-composed-grid",o));if(!r.length)return;const a=Math.min(...r.map(o=>o.getBoundingClientRect().top)),n=Math.max(...r.map(o=>o.getBoundingClientRect().bottom));t.style.setProperty("--ld-index-top",a+"px"),t.style.height=Math.max(44,Math.min(n,e.height-12)-a)+"px"}function yi(){pa(),fa();const t=Oe();if(t.length){if(A.setAttribute("data-fixed-pages","4:3"),ha(),d(".ld-fixed-page").forEach(e=>{t.includes(e)||e.classList.remove("ld-fixed-page")}),t.forEach(e=>{if(e.classList.add("ld-fixed-page"),!e.querySelector("h1,h2")){const i=document.createElement("h1");i.className="ld-page-heading",i.setAttribute("data-editable",""),i.setAttribute("data-placeholder","[Title for the subjects covered on this page.]"),i.textContent=e.getAttribute("aria-label")||c.brief?.title||"Supporting details",e.prepend(i)}}),!gi){gi=!0,mi(ot);const e=document.querySelector(".ld-bar");e&&typeof ResizeObserver<"u"&&new ResizeObserver(ot).observe(e),new MutationObserver(i=>{i.some(r=>!r.target.closest||!r.target.closest("#ld-selection-box,#ld-editor-layer,#ld-page-fit-error,#ld-page-reader"))&&ot()}).observe(document.body,{subtree:!0,childList:!0,characterData:!0}),document.addEventListener("toggle",ot,!0),document.fonts&&document.fonts.ready.then(ot)}bt&&cancelAnimationFrame(bt),Nt()}}_.checkPageFit=(t={})=>({valid:t.allPages?qe(!0):bi(),ratio:"adaptive",authoringReference:"4:3",width:parseFloat(A.style.getPropertyValue("--ld-page-width"))||1200,height:parseFloat(A.style.getPropertyValue("--ld-page-height"))||900,visiblePages:ee().length});function De(t){const e=c.review&&c.review.location;return Number.isInteger(e)?Math.max(0,Math.min(t-1,e)):0}function vi(t){return t.map((e,i)=>{const r=e.querySelector("h1,h2,h3");return{id:e.getAttribute("data-composition-section"),label:e.getAttribute("data-index-label")||r&&r.textContent.trim()||e.getAttribute("aria-label")||"Section "+(i+1)}})}function Ai(){const t=c.overview;if(!t?.groups?.length)return[];const e=new Map((t.topics||[]).map(i=>[i.unitId,i.targetSectionId]));return t.groups.map(i=>({label:i.label,sectionIds:i.topicUnitIds.map(r=>e.get(r)).filter(Boolean)}))}function _e(){Ei(),yi();const t=Qt();if(t.length<2)return;const e=Be(),i=De(t.length);t.forEach((a,n)=>{a.hidden=e!=="one-page"&&n!==i}),t.filter(a=>!a.hidden).forEach(a=>{d("section.ld-unit[data-unit]",a).forEach(n=>{const o=Q(n.getAttribute("data-unit"));o?.kind==="figure"&&Le(n,o)})});const r=document.getElementById("ld-form-navigation");if(r){if(r.__legalDesignIndexSignature!==JSON.stringify({form:e,items:vi(t),groups:Ai()})){qt();return}if(e!=="one-page"){const a=r.querySelector("[data-walkthrough-status]"),n=r.querySelector("[data-walkthrough-previous]"),o=r.querySelector("[data-walkthrough-next]");a&&(a.textContent=i+1+" / "+t.length),n&&(n.disabled=i===0),o&&(o.disabled=i===t.length-1)}d("[data-report-section]",r).forEach(a=>{a.setAttribute("aria-current",Number(a.dataset.reportSection)===i?"true":"false")}),r.__legalDesignGroupLocation!==i&&(d(".ld-index-group",r).forEach(a=>{a.open=!!a.querySelector('[aria-current="true"]')}),r.__legalDesignGroupLocation=i)}}let xi=!1;function Ei(){if(ga(),d("[data-section-target]").forEach(e=>{e.setAttribute("role","link"),e.setAttribute("tabindex","0")}),xi)return;xi=!0;const t=e=>{const i=e.target.closest("[data-section-target]");if(!i||D||e.type==="keydown"&&!["Enter"," "].includes(e.key))return;const r=Qt(),a=r.findIndex(s=>s.dataset.compositionSection===i.dataset.sectionTarget);if(a<0)return;e.preventDefault();const n=!!i.closest("#ld-page-reader");if(st()&&se(),ae(a),n){Ne(document.getElementById("ld-read-page"));return}const o=r[a].querySelector("h1,h2,h3");o&&(o.setAttribute("tabindex","-1"),o.focus({preventScroll:!0}))};document.addEventListener("click",t),document.addEventListener("keydown",t)}let wi=!1;function ga(){wi||(wi=!0,document.addEventListener("click",t=>{const e=t.target.closest(".ld-overview-group > summary");if(!e)return;const i=e.parentElement,r=i.closest(".ld-overview-groups");if(!r)return;t.preventDefault();const a=!i.open;a&&d(":scope > details.ld-overview-group",r).forEach(n=>{n!==i&&(n.open=!1)}),i.open=a}),document.addEventListener("toggle",t=>{const e=t.target;if(!e.matches?.("details.ld-overview-group"))return;const i=e.closest(".ld-overview-groups");i&&(i.closest("#ld-page-reader")||at(),ot())},!0))}function ae(t,e){const i=Qt();if(!i.length)return;const r=Math.max(0,Math.min(i.length-1,t));c.review||(c.review={}),c.review.location=r,c.savedAt=new Date().toISOString(),K(),_e(),at(),ot()}function qt(){ba();const t=Qt(),e=Be();if(t.length<2||!["slide-brief","walkthrough","report"].includes(e)){if(A.hasAttribute("data-composed-shell")){const s=document.getElementById("ld-form-navigation");s&&s.remove(),A.removeAttribute("data-has-slide-index")}return}const i=document.getElementById("legaldesign-composed-root");let r=document.getElementById("ld-form-navigation");const a=vi(t),n=Ai(),o=JSON.stringify({form:e,items:a,groups:n});if(r&&r.__legalDesignIndexSignature!==o&&(r.remove(),r=null),!r){r=document.createElement("nav"),r.id="ld-form-navigation",r.className="ld-form-nav ld-slide-index",r.setAttribute("aria-label",e==="report"?"Report sections":"Slide navigation"),r.innerHTML='<button class="ld-control ld-index-toggle" type="button" data-index-toggle aria-controls="ld-index-list" aria-expanded="true">Contents</button><div id="ld-index-list" data-index-list></div>';const s=r.querySelector("[data-index-list]"),u=(h,g)=>{const w=document.createElement("button");w.className="ld-control",w.type="button",w.setAttribute("data-report-section",String(g));const x=document.createElement("span");x.className="ld-index-number",x.setAttribute("aria-hidden","true"),x.textContent=String(g+1);const E=document.createElement("span");return E.className="ld-index-label",E.textContent=h.label,w.append(x,E),w},m=new Set(n.flatMap(h=>h.sectionIds));if(a.forEach((h,g)=>{m.has(h.id)||s.appendChild(u(h,g))}),n.forEach(h=>{const g=document.createElement("details");g.className="ld-index-group";const w=document.createElement("summary");w.textContent=h.label,g.appendChild(w);const x=document.createElement("div");x.className="ld-index-group-items",h.sectionIds.forEach(E=>{const I=a.findIndex(N=>N.id===E);I>=0&&x.appendChild(u(a[I],I))}),g.appendChild(x),w.addEventListener("click",E=>{E.preventDefault();const I=!g.open;d(".ld-index-group",s).forEach(N=>{N.open=!1}),g.open=I}),s.appendChild(g)}),e!=="one-page"){const h=document.createElement("div");h.className="ld-index-pager",h.innerHTML='<button class="ld-control" type="button" data-walkthrough-previous>Previous</button><span data-walkthrough-status aria-live="polite"></span><button class="ld-control" type="button" data-walkthrough-next>Next</button>',(gt()?r:s).appendChild(h)}i.insertBefore(r,i.firstChild)}if(r.__legalDesignIndexSignature=o,Si(r),!r.__legalDesignFormBound){r.__legalDesignFormBound=!0;const s=r.querySelector("[data-walkthrough-previous]"),u=r.querySelector("[data-walkthrough-next]");s&&s.addEventListener("click",()=>{ae(De(t.length)-1)}),u&&u.addEventListener("click",()=>{ae(De(t.length)+1)}),d("[data-report-section]",r).forEach(m=>{m.addEventListener("click",()=>{ae(Number(m.getAttribute("data-report-section")),{scroll:e==="report"})})})}_e()}function Si(t){A.setAttribute("data-has-slide-index","true");const e=t.querySelector("[data-index-toggle]"),i=t.querySelector("[data-index-list]");if(!e||!i||t.__legalDesignIndexBound)return;t.__legalDesignIndexBound=!0;const r=window.matchMedia("(max-width: 760px)"),a=o=>{t.setAttribute("data-index-expanded",o?"true":"false"),e.setAttribute("aria-expanded",o?"true":"false"),e.textContent=o?"Contents":"\u2630",e.setAttribute("aria-label",o?"Collapse contents":"Open contents"),i.hidden=!o};a(!r.matches),e.addEventListener("click",()=>{a(e.getAttribute("aria-expanded")!=="true")}),t.addEventListener("click",o=>{r.matches&&o.target.closest("[data-report-section]")&&a(!1)}),r.addEventListener("change",()=>a(!r.matches));const n=document.querySelector(".ld-bar");if(n&&typeof ResizeObserver<"u"){const o=()=>t.style.setProperty("--ld-index-top",Math.ceil(n.getBoundingClientRect().height+16)+"px");o(),new ResizeObserver(o).observe(n)}}function ba(){if(A.hasAttribute("data-composed-shell"))return;const t=d("section.sb-slide[data-frame]"),e=document.getElementById("slide-stage");if(t.length<2||!e)return;let i=document.getElementById("ld-legacy-slide-index");if(!i){i=document.createElement("nav"),i.id="ld-legacy-slide-index",i.className="ld-slide-index",i.setAttribute("aria-label","Slide navigation"),i.innerHTML='<button class="ld-control ld-index-toggle" type="button" data-index-toggle aria-controls="ld-legacy-index-list" aria-expanded="true">Contents</button><div id="ld-legacy-index-list" data-index-list></div>';const n=i.querySelector("[data-index-list]");t.forEach((s,u)=>{const m=document.createElement("button");m.type="button",m.className="ld-control",m.setAttribute("data-report-section",String(u)),n.appendChild(m)});const o=document.querySelector(".sb-navigation");o&&n.appendChild(o),e.before(i)}if(Si(i),i.__legalDesignLegacyBound)return;i.__legalDesignLegacyBound=!0;const r=()=>{d("[data-report-section]",i).forEach((n,o)=>{const s=t[o].querySelector(".ld-variant:not([hidden]) h1,h2,h3");n.textContent=s&&s.textContent.trim()||"Slide "+(o+1),n.setAttribute("aria-current",t[o].classList.contains("is-current")?"true":"false")})};i.addEventListener("click",n=>{const o=n.target.closest("[data-report-section]");if(!o)return;const s=Number(o.getAttribute("data-report-section"))+1;if(window.LegalDesignWalkthrough)window.LegalDesignWalkthrough.showFrame(s,!0);else{const u=document.querySelector('[data-frame-button="'+s+'"]');u?u.click():(t.forEach((m,h)=>{m.hidden=h!==s-1,m.classList.toggle("is-current",h===s-1)}),c.review||(c.review={}),c.review.location=s-1,K(),ot())}r()}),new MutationObserver(r).observe(e,{attributes:!0,attributeFilter:["class","hidden"],childList:!0,characterData:!0,subtree:!0}),r()}function ya(t){if(!t||!t.isConnected)return;const e=t.getAttribute("data-unit"),i=Q(e);!i||i.kind==="figure"||(i.edits||(i.edits={}),d(".ld-variant[data-variant]",t).forEach(r=>{const a=r.querySelector("[data-variant-body]");a&&(i.edits[r.getAttribute("data-variant")]=a.innerHTML)}))}function va(t){if(!t||!t.isConnected)return;const e=t.getAttribute("data-evidence-id")||t.id,i=c.evidence&&c.evidence[e];i&&d("[data-evidence-field]",t).forEach(r=>{const a=r.getAttribute("data-evidence-field"),n=r.textContent.trim();if(n){if(["cite","locator","detail"].includes(a))i[a]=n;else if(a==="popup.title"&&i.popup)i.popup.title=n;else if(a==="popup.lede"&&i.popup)i.popup.lede=n;else{const o=/^popup\.sections\.(\d+)\.(heading|body)$/.exec(a),s=o&&i.popup&&Array.isArray(i.popup.sections)?i.popup.sections[Number(o[1])]:null;if(!s)return;s[o[2]]=n}a==="detail"&&(i.excerpt=n),a==="locator"&&(i.provenance=(i.sourceId||"source")+" \xB7 "+n)}})}function re(t){let e=[],i=[];t&&t.length?t.forEach(r=>{const a=r&&r.closest&&r.closest("section.ld-unit[data-unit]");a&&!e.includes(a)&&e.push(a);const n=r&&r.closest&&r.closest(".pop[data-evidence-id]");n&&!i.includes(n)&&i.push(n)}):(e=d("section.ld-unit[data-unit]"),i=d(".pop[data-evidence-id]")),e.forEach(ya),i.forEach(va)}function H(t){(t||[]).forEach(e=>{if(!e||!e.closest)return;const i=e.closest(".ld-diagram"),r=e.closest("section.ld-unit[data-unit]");i?i.setAttribute("data-editor-preserve-dom","true"):r&&Q(r.getAttribute("data-unit"))&&Q(r.getAttribute("data-unit")).kind==="figure"&&d(".ld-diagram",r).forEach(a=>{a.setAttribute("data-editor-preserve-dom","true")})}),re(t),c.savedAt=new Date().toISOString(),K(),at(),Z(),lt()}function ne(){d("section.ld-unit[data-unit]").forEach(t=>{const e=t.getAttribute("data-unit"),i=t.querySelector(".ld-ab");i&&!i.__legalDesignUnitBound&&(i.__legalDesignUnitBound=!0,i.addEventListener("keydown",n=>{n.key!=="ArrowLeft"&&n.key!=="ArrowRight"||(n.preventDefault(),n.stopPropagation(),pi(e,n.key==="ArrowLeft"?"a":"b"))}),d("[data-select-variant]",i).forEach(n=>{n.__legalDesignUnitBound||(n.__legalDesignUnitBound=!0,n.addEventListener("click",()=>{pi(e,n.getAttribute("data-select-variant"))}))}));const r=t.querySelector(".ld-why-toggle"),a=t.querySelector(".ld-why");r&&a&&!r.__legalDesignUnitBound&&(r.__legalDesignUnitBound=!0,r.addEventListener("click",()=>{const n=a.hidden;a.hidden=!n,r.setAttribute("aria-expanded",n?"true":"false")})),d("[data-editable]",t).forEach(n=>{n.__legalDesignUnitBound||(n.__legalDesignUnitBound=!0,n.addEventListener("blur",()=>{!n.isConnected||!n.hasAttribute("contenteditable")||(n.removeAttribute("contenteditable"),n.removeAttribute("spellcheck"),nt=!1,H([n]))}))})})}function Aa(){d('[data-kind="decision"][data-unit]').forEach(t=>{const e=t.getAttribute("data-unit"),i=c.review&&c.review.decisions?c.review.decisions[e]:null,r=i&&typeof i=="object"&&!Array.isArray(i)?i.choice:i,a=i&&typeof i=="object"&&!Array.isArray(i)?i.choices:i;d("[data-decision-option]",t).forEach(n=>{const o=t.hasAttribute("data-multi")?Array.isArray(a)&&a.includes(n.value):r===n.value;n.setAttribute("aria-pressed",o?"true":"false")}),d("[data-decision-custom],[data-decision-note]",t).forEach(n=>{const o=n.hasAttribute("data-decision-custom")?"custom":"note",s=i&&typeof i=="object"&&!Array.isArray(i)&&i[o]||"";document.activeElement!==n&&(n.value=s)}),t.toggleAttribute("data-answered",!!(t.hasAttribute("data-multi")?Array.isArray(a)&&a.length||i&&(i.custom||i.note):r||i&&(i.custom||i.note)))})}function Dt(){d('[data-kind="decision"][data-unit]').forEach(t=>{const e=t.getAttribute("data-unit");d("[data-decision-option]",t).forEach(i=>{i.__legalDesignDecisionBound||(i.__legalDesignDecisionBound=!0,i.addEventListener("click",()=>{Se(()=>{if(c.review.decisions||(c.review.decisions={}),t.hasAttribute("data-multi")){const r=c.review.decisions[e],a=Array.isArray(r)?r:r&&Array.isArray(r.choices)?r.choices:[],n=a.indexOf(i.value);n>=0?a.splice(n,1):a.push(i.value),r&&typeof r=="object"&&!Array.isArray(r)?r.choices=a:c.review.decisions[e]=a}else{const r=c.review.decisions[e];r&&typeof r=="object"&&!Array.isArray(r)?r.choice=i.value:c.review.decisions[e]=i.value}})}))}),d("[data-decision-custom],[data-decision-note]",t).forEach(i=>{i.__legalDesignDecisionBound||(i.__legalDesignDecisionBound=!0,i.addEventListener("change",()=>{Se(()=>{c.review.decisions||(c.review.decisions={});let r=c.review.decisions[e];(!r||typeof r!="object"||Array.isArray(r))&&(r=t.hasAttribute("data-multi")?{choices:Array.isArray(r)?r.slice():r?[r]:[]}:{choice:r||null}),r[i.hasAttribute("data-decision-custom")?"custom":"note"]=i.value,c.review.decisions[e]=r})}))})})}function oe(t){const e=document.getElementById(t);return e&&e.matches("#popup-scrim .pop")?e:null}function st(){const t=document.getElementById("popup-scrim");return!t||t.hidden?null:d(".pop",t).find(e=>!e.hidden&&Et(e))||null}function ki(t){return d('a[href],button,input:not([type="hidden"]),select,textarea,summary,[contenteditable="true"],[tabindex]',t).filter(e=>e.tabIndex>=0&&!e.matches(':disabled,[aria-disabled="true"]')&&!e.closest('[hidden],[inert],[aria-hidden="true"]')&&Et(e))}function Pe(t){t.hasAttribute("tabindex")||(t.setAttribute("tabindex","-1"),be.add(t)),t.focus()}function Re(t){be.has(t)&&(t.removeAttribute("tabindex"),be.delete(t))}function xa(t,e){const i=ki(e);if(!i.length){t.preventDefault(),Pe(e);return}const r=document.activeElement,a=i[0],n=i[i.length-1];(!i.includes(r)||t.shiftKey&&r===a||!t.shiftKey&&r===n)&&(t.preventDefault(),(t.shiftKey?n:a).focus())}function _t(t,e){const i=document.getElementById("popup-scrim"),r=oe(t);if(!i||!r)return;const a=st();a&&a!==r&&e&&a.contains(e)?ge.push({pop:a,source:e,scrollTop:a.scrollTop,returnFocus:Tt,returnFocusKey:Lt}):a||(ge.length=0),ta(e),d(".pop",i).forEach(u=>{Re(u),u.hidden=u!==r}),i.hidden=!1,r.hidden=!1,document.body.style.overflow="hidden";const n=r.querySelector(".ld-popup-close,.pop-close"),o=ki(r),s=n&&o.includes(n)?n:o[0];s?s.focus():Pe(r),le(r)}function se(){const t=document.getElementById("popup-scrim");if(!t||t.hidden)return;const e=ge.pop();if(e?.pop.isConnected){d(".pop",t).forEach(i=>{i.hidden=i!==e.pop,Re(i)}),e.pop.scrollTop=e.scrollTop,Tt=e.returnFocus,Lt=e.returnFocusKey,e.source.isConnected?e.source.focus({preventScroll:!0}):Pe(e.pop),le(e.pop);return}t.hidden=!0,d(".pop",t).forEach(i=>{i.hidden=!0,Re(i)}),document.body.style.overflow="",ea()}function yt(){d("[data-evidence],[data-detail]").forEach(t=>{t.matches("a,button,input,select,textarea,[tabindex]")||(t.tabIndex=0,t.setAttribute("role","button"))}),d("#popup-scrim .pop").forEach(t=>{t.querySelector(".ld-popup-authoring")&&Ti(t),!t.__legalDesignPopupBound&&(t.__legalDesignPopupBound=!0,t.addEventListener("scroll",()=>{le(t)}),d("[data-evidence-field][data-editable]",t).forEach(e=>{e.__legalDesignEvidenceBound||(e.__legalDesignEvidenceBound=!0,e.addEventListener("blur",()=>{!e.isConnected||!e.hasAttribute("contenteditable")||(e.removeAttribute("contenteditable"),e.removeAttribute("spellcheck"),nt=!1,H([e]))}))}))}),d("#popup-scrim a[href]").forEach(t=>{try{const e=new URL(t.getAttribute("href"));if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error("scheme")}catch{t.setAttribute("href","#")}})}function Ea(){yt(),document.addEventListener("click",t=>{if(Gt){Gt=!1,t.preventDefault();return}const e=t.target.closest("[data-evidence],[data-detail]");if(D&&e&&!e.closest(".pop"))return;const i=t.target.closest("button,input,select,textarea,.ld-unit-tools");if(e&&i&&i!==e)return;const r=D&&t.target.closest("[data-editable]");if(!(e&&r&&e.contains(r))){if(e){t.preventDefault(),_t(e.getAttribute("data-evidence")||e.getAttribute("data-detail"),e);return}(t.target.closest(".ld-popup-close,.pop-close")||t.target.id==="popup-scrim")&&(t.preventDefault(),se())}}),document.addEventListener("keydown",t=>{const e=st();if(e&&t.key==="Tab"){xa(t,e);return}const i=t.target.closest&&t.target.closest("[data-evidence],[data-detail]"),r=D&&t.target.closest&&t.target.closest("[data-editable]");i&&r&&i.contains(r)||(i&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),_t(i.getAttribute("data-evidence")||i.getAttribute("data-detail"),i)),e&&t.key==="Escape"&&(t.preventDefault(),se()))})}function le(t){t&&t.toggleAttribute("data-scroll-more",t.scrollTop+t.clientHeight<t.scrollHeight-1)}function wa(){const t=document.querySelector(".ld-editor-tools");if(t){for(const[e,i]of[["editor-add-text","Text box"],["editor-popup","Add popup"],["editor-remove-popup","Remove popup"]]){if(document.getElementById(e))continue;const r=document.createElement("button");r.id=e,r.type="button",r.className="ld-tool",r.textContent=i,r.title=i,t.appendChild(r)}for(const[e,i]of[["fill",pt],["text",ut]]){const r=document.getElementById(`editor-${e}-token`);if(!r)continue;document.getElementById(`editor-${e}-palette`)?.remove(),r.hidden=!0;const a=document.createElement("button");a.id=`editor-${e}-palette`,a.type="button",a.className="ld-tool",a.textContent=e==="fill"?"Fill \u25BE":"Text \u25BE",a.setAttribute("aria-label",e==="fill"?"Fill color":"Text color"),a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-expanded","false"),r.after(a),a.addEventListener("click",()=>{const n=document.getElementById("ld-color-palette"),o=n&&n.dataset.kind===e;if(n&&n.remove(),d('[id$="-palette"].ld-tool').forEach(I=>{I.setAttribute("aria-expanded","false")}),o)return;const s=document.createElement("div");s.id="ld-color-palette",s.dataset.kind=e,s.setAttribute("data-editor-only",""),s.setAttribute("role","dialog"),s.setAttribute("aria-label",e==="fill"?"Choose fill color":"Choose text color");const u={card:"Card","card-strong":"Raised card",tint:"Soft tint",bg:"Page",none:"No fill",ink:"Primary text",muted:"Secondary text",faint:"Quiet text",red:"Accent","red-strong":"Strong accent"},m=document.createElement("strong");m.textContent=e==="fill"?"Fill color":"Text color",s.appendChild(m);const h=document.createElement("div");h.className="ld-swatch-grid";const g=M.map(I=>I.getAttribute(`data-${e}-token`)),w=g.length&&g.every(I=>I===g[0])?g[0]:null;i.forEach(I=>{const N=document.createElement("button");N.type="button",N.className="ld-color-swatch",N.dataset.colorToken=I,N.setAttribute("aria-label",u[I]),N.setAttribute("aria-pressed",String(w===I)),N.title=u[I],N.style.background=I==="none"?"transparent":`var(--${I})`,I==="none"&&(N.textContent="\u2205"),N.addEventListener("click",()=>{We(`data-${e}-token`,I),s.remove(),a.setAttribute("aria-expanded","false"),a.focus()}),h.appendChild(N)}),s.appendChild(h);const x=document.createElement("small");x.textContent="House palette \xB7 adapts to light and dark",s.appendChild(x),document.body.appendChild(s);const E=a.getBoundingClientRect();s.style.top=Math.min(innerHeight-s.offsetHeight-8,E.bottom+8)+"px",s.style.left=Math.max(8,Math.min(innerWidth-s.offsetWidth-8,E.left))+"px",a.setAttribute("aria-expanded","true"),h.querySelector("button").focus(),s.addEventListener("keydown",I=>{I.key==="Escape"&&(I.stopPropagation(),s.remove(),a.setAttribute("aria-expanded","false"),a.focus())})})}}}function Ci(){let t=1;for(;c.evidence["detail-added-"+t]||document.getElementById("detail-added-"+t);)t++;return"detail-added-"+t}function Sa(t){const e=d("[data-detail],[data-evidence]",t);t.matches("[data-detail],[data-evidence]")&&e.unshift(t);const i=new Map;e.forEach(r=>{const a=r.hasAttribute("data-detail")?"data-detail":"data-evidence",n=r.getAttribute(a),o=oe(n);if(o){if(!i.has(n)){const s=Ci(),u=o.cloneNode(!0);u.id=s,u.setAttribute("data-evidence-id",s),u.hidden=!0,d("[id]",u).forEach(m=>{m.removeAttribute("id")}),u.removeAttribute("aria-labelledby"),u.setAttribute("aria-label",c.evidence[n]?.popup?.title||"Detail"),c.evidence[n]&&(c.evidence[s]=F(c.evidence[n])),document.getElementById("popup-scrim").appendChild(u),i.set(n,s)}r.setAttribute(a,i.get(n)),r.setAttribute("aria-controls",i.get(n))}})}function ka(){z();const t=$()[0],e=st()||t&&t.closest("section.ld-unit")||d("section.ld-unit").find(Et)||document.querySelector("main");if(!e)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");const i=document.createElement("p");i.className="ld-added-text",i.setAttribute("data-editable",""),i.setAttribute("data-editor-object","text"),i.setAttribute("data-placeholder","[Text explaining this point.]"),i.textContent="Your text",Object.assign(i.style,{position:"absolute",left:"24px",top:"64px",width:"240px",margin:"0",zIndex:"4"}),e.appendChild(i),vt(i),H([i]),rt([i]),ue(i)}function Ii(t){const e=t.getAttribute("data-evidence-id"),i=c.evidence[e];if(!i?.popup)return;const r=i.popup.sections.length;i.popup.sections.push({heading:"Section heading",body:"Explain this point."});const a=document.createElement("section");a.className="ld-popup-section";for(const[o,s,u]of[["h3","heading","Section heading"],["p","body","Explain this point."]]){const m=document.createElement(o);m.textContent=u,m.setAttribute("data-editable",""),m.setAttribute("data-evidence-field",`popup.sections.${r}.${s}`),m.setAttribute("data-placeholder",s==="heading"?"[Section heading.]":"[Explanation of this point.]"),a.appendChild(m)}const n=t.querySelector(".ld-popup-authoring");t.insertBefore(a,n||null),yt(),vt(a),H([a])}function Ti(t){const e=t.querySelector(".ld-popup-authoring");if(e?.__bound)return;e?.remove();const i=document.createElement("div");i.className="ld-popup-authoring",i.setAttribute("data-editor-only",""),i.__bound=!0;const r=document.createElement("button");r.type="button",r.className="ld-tool",r.textContent="Add section",r.addEventListener("click",()=>{z(),Ii(t)}),i.appendChild(r),t.appendChild(i)}function Ca(){const t=$().length===1&&$()[0];if(!t)return;let e=t.getAttribute("data-detail")||t.getAttribute("data-evidence");if(!e||!oe(e)){z(),e=Ci();const r=(t.textContent||"Detail").trim().slice(0,120)||"Detail";c.evidence[e]={cite:"",locator:"",excerpt:"",link:null,status:"authored",popup:{type:"detail",title:r,lede:"Add the detail this element should explain.",sections:[]}},t.setAttribute("data-detail",e),t.setAttribute("aria-controls",e),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t instanceof SVGElement&&t.classList.add("ld-detail");const a=document.createElement("article");a.id=e,a.className="pop",a.hidden=!0,a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.setAttribute("aria-label",r),a.setAttribute("data-evidence-id",e);const n=document.createElement("button");n.type="button",n.className="ld-popup-close",n.textContent="\xD7",n.setAttribute("aria-label","Close"),a.appendChild(n);for(const[o,s,u]of[["h2","title",r],["p","lede",c.evidence[e].popup.lede]]){const m=document.createElement(o);m.textContent=u,m.setAttribute("data-editable",""),m.setAttribute("data-evidence-field","popup."+s),s==="lede"&&(m.className="ld-popup-lede"),a.appendChild(m)}document.getElementById("popup-scrim").appendChild(a),Ii(a),yt(),H([t,a])}const i=oe(e);Ti(i),vt(i),rt([]),_t(e,t)}function Ia(){const t=$().length===1&&$()[0];t&&(z(),["data-detail","data-evidence","aria-controls","aria-haspopup"].forEach(e=>{t.removeAttribute(e)}),t.classList.remove("ld-detail"),t.getAttribute("role")==="button"&&!t.matches("button")&&(t.removeAttribute("role"),t.removeAttribute("tabindex")),H([t]))}function Ta(){return d(Kt).filter(Et)}function La(t){return d(Kt,t||document).filter(e=>Et(e)&&!e.closest("[data-editor-only],.ld-slide-index")&&(!st()||st().contains(e)))}function vt(t){d(".ld-diagram",t||document).forEach(r=>{d('svg [data-diagram-object],svg g[role="button"]',r).forEach((a,n)=>{a.hasAttribute("data-editor-node-key")||a.setAttribute("data-editor-node-key","node-"+(n+1))})}),Ot(t||document);const e=Kt,i=d(e,t||document);t&&t.matches&&t.matches(e)&&i.unshift(t),i.forEach(r=>{r.closest("[data-editor-only]")||(r.setAttribute("data-editor-unit","1"),r.hasAttribute("data-editor-origin-style-stamped")||(r.setAttribute("data-editor-origin-style-stamped","true"),r.setAttribute("data-editor-origin-style-present",r.hasAttribute("style")?"true":"false"),r.setAttribute("data-editor-origin-style",r.getAttribute("style")||""),["fill-token","text-token"].forEach(a=>{const n="data-"+a;r.setAttribute("data-editor-origin-"+a+"-present",r.hasAttribute(n)?"true":"false"),r.setAttribute("data-editor-origin-"+a,r.getAttribute(n)||"")})))})}function $(){return M.filter(t=>!M.some(e=>e!==t&&e.contains(t)))}function Li(t){const e=t.filter(Et).map(o=>o.getBoundingClientRect());if(!e.length)return null;const i=Math.min.apply(null,e.map(o=>o.left)),r=Math.min.apply(null,e.map(o=>o.top)),a=Math.max.apply(null,e.map(o=>o.right)),n=Math.max.apply(null,e.map(o=>o.bottom));return{left:i,top:r,right:a,bottom:n,width:a-i,height:n-r}}function Ba(){if(document.getElementById("ld-editor-layer"))return;const t=document.createElement("div");t.id="ld-editor-layer",t.setAttribute("data-editor-only","");const e=document.createElement("div");e.id="ld-selection-box",["nw","n","ne","e","se","s","sw","w"].forEach(r=>{const a=document.createElement("span");a.className="ld-handle",a.setAttribute("data-handle",r),e.appendChild(a)});const i=document.createElement("div");i.id="ld-marquee",t.appendChild(e),t.appendChild(i),document.body.appendChild(t)}function Z(){d(".ld-selected").forEach(n=>{n.classList.remove("ld-selected")}),M.forEach(n=>{n.classList.add("ld-selected")});const t=Math.max(0,...d(".ld-bar,#ld-page-approach,.ld-save-banner").filter(n=>!n.hidden&&n.getClientRects().length).map(n=>n.getBoundingClientRect().bottom));d(".ld-fixed-page .ld-unit-tools").forEach(n=>{if(n.style.removeProperty("--ld-context-offset"),!D||!n.getClientRects().length)return;const o=t+4-n.getBoundingClientRect().top;o>0&&n.style.setProperty("--ld-context-offset",o+"px")});const e=document.getElementById("ld-selection-box");if(!e)return;const i=Li(M);if(lt(),e.toggleAttribute("data-diagram-label-selection",M.length===1&&M[0].hasAttribute("data-diagram-label")),!i||!D){e.style.display="none";return}e.style.display="block",e.style.left=i.left+"px",e.style.top=i.top+"px",e.style.width=i.width+"px",e.style.height=i.height+"px";const r=st()?.querySelector(".ld-popup-close,.pop-close"),a=r&&r.getBoundingClientRect();d(".ld-handle",e).forEach(n=>{const o=n.getBoundingClientRect(),s=a&&o.left<a.right+4&&o.right>a.left-4&&o.top<a.bottom+4&&o.bottom>a.top-4;n.style.visibility=s?"hidden":""}),lt()}function rt(t,e){e||(M=[]),t.forEach(i=>{i&&i.isConnected&&!M.includes(i)&&M.push(i)}),Z()}function z(){we()}function St(t,e,i){e=Math.round(e*10)/10,i=Math.round(i*10)/10,t.setAttribute("data-editor-x",String(e)),t.setAttribute("data-editor-y",String(i));let r=t.getAttribute("data-editor-base-transform");r==null&&(r=t.style.transform||"",t.setAttribute("data-editor-base-transform",r));const a=Number(t.getAttribute("data-editor-scale-x")||1),n=Number(t.getAttribute("data-editor-scale-y")||1);t.style.transform=`translate(${e}px,${i}px) ${r} scale(${a},${n})`.trim()}function de(t,e,i){const r=t instanceof SVGElement&&t.parentElement,a=r&&r.getScreenCTM&&r.getScreenCTM();if(!a){const o=Me(t);return{x:e/o,y:i/o}}const n=a.inverse();return{x:n.a*e+n.c*i,y:n.b*e+n.d*i}}function Bi(){if(!M.length)return;z();const t=$().map(e=>e.closest("section.ld-unit[data-unit]")).filter(Boolean);$().forEach(e=>{e.remove()}),M=[],H(t)}function Ma(t){const e=(t||"unit")+"-copy";let i=1;for(;c.units&&c.units[e+"-"+i];)i+=1;return e+"-"+i}function Oa(t){d("[id]",t).concat(t.id?[t]:[]).forEach(i=>{i.removeAttribute("id")});const e=["data-editor-unit","data-editor-origin-style","data-editor-origin-style-present","data-editor-origin-style-stamped","data-editor-origin-fill-token","data-editor-origin-fill-token-present","data-editor-origin-text-token","data-editor-origin-text-token-present","data-editor-x","data-editor-y","data-editor-base-transform","contenteditable","spellcheck"];d("*",t).concat([t]).forEach(i=>{e.forEach(r=>{i.removeAttribute(r)}),i.classList.remove("ld-selected","ld-selection-mark")})}function Mi(){if(!M.length)return;z();const t=[];$().forEach(e=>{const i=e.cloneNode(!0);Oa(i),Sa(i);let r=[];e.matches&&e.matches("section.ld-unit[data-unit]")&&r.push(e),r=r.concat(d("section.ld-unit[data-unit]",e));let a=[];i.matches&&i.matches("section.ld-unit[data-unit]")&&a.push(i),a=a.concat(d("section.ld-unit[data-unit]",i)),r.forEach((m,h)=>{const g=a[h];if(!g)return;const w=m.getAttribute("data-unit"),x=Ma(w);g.setAttribute("data-unit",x),c.units&&c.units[w]&&(c.units[x]=F(c.units[w]))});const n=e.parentElement,o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),u=getComputedStyle(e).position;if(e instanceof SVGElement){const m=de(e,20,20);i.setAttribute("data-editor-base-transform",e.getAttribute("data-editor-base-transform")||""),St(i,Number(e.getAttribute("data-editor-x")||0)+m.x,Number(e.getAttribute("data-editor-y")||0)+m.y)}else u!=="absolute"&&u!=="fixed"?(getComputedStyle(n).position==="static"&&(n.style.position="relative"),i.style.position="absolute",i.style.left=o.left-s.left+n.scrollLeft+16+"px",i.style.top=o.top-s.top+n.scrollTop+16+"px",i.style.width=o.width+"px",i.style.margin="0",i.style.zIndex="4"):St(i,Number(e.getAttribute("data-editor-x")||0)+16,Number(e.getAttribute("data-editor-y")||0)+16);e.insertAdjacentElement("afterend",i),vt(i),t.push(i)}),ne(),Dt(),yt(),H(t),rt(t)}function ce(t){M.length&&(z(),M.forEach(t),H(M))}function Na(t,e){return(t==="data-fill-token"?pt:t==="data-text-token"?ut:[]).includes(e)?e:""}function We(t,e){e=Na(t,e),e&&ce(i=>{i.setAttribute(t,e)})}function je(t,e,i){ce(r=>{r.style[t]=getComputedStyle(r)[t].includes(e)?i:e})}function Oi(t){ce(e=>{e.style.fontSize=Math.max(11,Math.min(180,(parseFloat(getComputedStyle(e).fontSize)||14)+t))+"px"})}function qa(){ce(t=>{t.getAttribute("data-editor-origin-style-present")==="true"?t.setAttribute("style",t.getAttribute("data-editor-origin-style")||""):t.removeAttribute("style"),["fill-token","text-token"].forEach(e=>{t.getAttribute("data-editor-origin-"+e+"-present")==="true"?t.setAttribute("data-"+e,t.getAttribute("data-editor-origin-"+e)||""):t.removeAttribute("data-"+e)}),["data-editor-x","data-editor-y","data-editor-base-transform","data-editor-scale-x","data-editor-scale-y"].forEach(e=>{t.removeAttribute(e)})})}function Ni(t){return t&&t.hasAttribute("data-editable")&&(!(t instanceof SVGElement)||t.hasAttribute("data-diagram-label"))&&!t.matches("img,input,select,button")}function Da(t,e){const i=d("tspan",t);if(!i.length){t.textContent=e;return}const r=e.trim().split(/\s+/).filter(Boolean),a=Math.max(1,Math.min(i.length,r.length||1)),n=[];for(let o=0;o<a;o+=1){const s=Math.floor(o*r.length/a),u=Math.floor((o+1)*r.length/a);n.push(r.slice(s,u).join(" "))}i.forEach((o,s)=>{s<n.length?o.textContent=n[s]:o.remove()})}function _a(t,e){const i=t.getAttribute("data-param-path"),r=t.closest("section.ld-unit[data-unit]"),a=t.closest(".ld-variant[data-variant]");if(!i||!r||!a)return!1;const n=Q(r.getAttribute("data-unit")),o=n&&n.variants&&n.variants[a.getAttribute("data-variant")];return!!(o&&da(o.params,i,e))}function Pa(t){rt([t]),z();const e=document.getElementById("ld-svg-text-editor");e&&e.remove();const i=t.getBoundingClientRect(),r=getComputedStyle(t),a=document.createElement("input");a.id="ld-svg-text-editor",a.type="text",a.value=t.textContent.trim(),a.setAttribute("aria-label","Edit diagram label"),Object.assign(a.style,{position:"fixed",zIndex:"1000",left:Math.max(8,i.left-6)+"px",top:Math.max(8,i.top-5)+"px",width:Math.max(160,i.width+28)+"px",minHeight:Math.max(34,i.height+10)+"px",border:"2px solid var(--interaction)",borderRadius:"4px",background:"var(--card)",color:"var(--ink)",padding:"5px 8px",fontFamily:r.fontFamily,fontSize:Math.max(13,parseFloat(r.fontSize)||13)+"px"}),document.body.appendChild(a);let n=!1;const o=s=>{if(!n){if(n=!0,s&&a.value.trim()){const u=a.value.trim();_a(t,u),Da(t,u),H([t])}a.remove(),Z()}};a.addEventListener("blur",()=>o(!0)),a.addEventListener("keydown",s=>{s.key==="Enter"?(s.preventDefault(),o(!0)):s.key==="Escape"&&(s.preventDefault(),o(!1))}),a.focus(),a.select()}function ue(t){if(!Ni(t))return;if(t.hasAttribute("data-diagram-label")){Pa(t);return}d('[contenteditable="true"]').forEach(r=>{r!==t&&r.blur()}),rt([t]),z(),nt=!0,t.setAttribute("contenteditable","true"),t.setAttribute("spellcheck","false"),t.focus();const e=document.createRange();e.selectNodeContents(t);const i=getSelection();i.removeAllRanges(),i.addRange(e)}function lt(){["editor-duplicate","editor-delete","editor-bold","editor-italic","editor-underline","editor-font-up","editor-font-down","editor-reset","editor-fill-token","editor-text-token","editor-fill-palette","editor-text-palette","editor-popup","editor-remove-popup"].forEach(o=>{const s=document.getElementById(o);s&&(s.disabled=!M.length)});const t=document.getElementById("editor-popup"),e=document.getElementById("editor-remove-popup"),i=$().length===1?$()[0]:null,r=i&&(i.getAttribute("data-detail")||i.getAttribute("data-evidence"));t&&(t.disabled=!i,t.textContent=r?"Edit popup":"Add popup"),e&&(e.disabled=!r);const a=document.getElementById("editor-undo"),n=document.getElementById("editor-redo");a&&(a.disabled=!ft.length),n&&(n.disabled=!It.length)}function qi(t){t||d('[contenteditable="true"]').forEach(i=>{i.blur()}),D=!!t,A.toggleAttribute("data-mode",D),D&&A.setAttribute("data-mode","edit");const e=document.getElementById("mode-toggle");e&&(e.textContent=D?"Done":"Edit",e.setAttribute("aria-pressed",D?"true":"false")),D?(d("section.ld-unit[data-unit]").forEach(i=>{i.hasAttribute("tabindex")||(i.tabIndex=0,i.setAttribute("data-editor-added-tabindex",""))}),vt(),Ba()):(M=[],A.removeAttribute("data-editor-menu"),d("[contenteditable]").forEach(i=>{i.removeAttribute("contenteditable"),i.removeAttribute("spellcheck")}),d("[data-editor-added-tabindex]").forEach(i=>{i.removeAttribute("data-editor-added-tabindex"),i.removeAttribute("tabindex")}),nt=!1),Ot(document),Z(),lt()}function Ra(){document.addEventListener("pointerdown",()=>A.setAttribute("data-input-modality","pointer"),!0),document.addEventListener("keydown",a=>{(a.key==="Tab"||a.key.startsWith("Arrow"))&&A.setAttribute("data-input-modality","keyboard")},!0);const t=document.getElementById("mode-toggle");t&&t.addEventListener("click",()=>{qi(!D)});function e(a,n){const o=document.getElementById(a);o&&o.addEventListener("click",n)}e("editor-undo",di),e("editor-redo",ci),e("editor-duplicate",Mi),e("editor-delete",Bi),e("editor-bold",()=>{je("fontWeight","700","400")}),e("editor-italic",()=>{je("fontStyle","italic","normal")}),e("editor-underline",()=>{je("textDecorationLine","underline","none")}),e("editor-font-up",()=>{Oi(1)}),e("editor-font-down",()=>{Oi(-1)}),e("editor-reset",qa),e("editor-add-text",ka),e("editor-popup",Ca),e("editor-remove-popup",Ia),e("editor-overflow-toggle",()=>{const a=A.getAttribute("data-editor-menu")==="open";A.toggleAttribute("data-editor-menu",!a),a||A.setAttribute("data-editor-menu","open");const n=document.getElementById("editor-overflow-toggle");n&&n.setAttribute("aria-expanded",a?"false":"true")});const i=document.getElementById("editor-fill-token");i&&i.addEventListener("change",()=>{We("data-fill-token",i.value),i.value=""});const r=document.getElementById("editor-text-token");r&&r.addEventListener("change",()=>{We("data-text-token",r.value),r.value=""}),document.addEventListener("pointerdown",a=>{if(!D||a.button!==0||a.target.closest('.ld-bar,.ld-unit-tools,.ld-slide-index,[data-editor-only]:not(#ld-editor-layer):not(#ld-selection-box),input,textarea,select,button:not([data-detail]):not([data-evidence]),[contenteditable="true"]'))return;const n=a.target.closest(".ld-handle");if(n){a.preventDefault();const h=Li(M);if(!h)return;z(),L={type:"resize",handle:n.getAttribute("data-handle"),x:a.clientX,y:a.clientY,bounds:h,starts:$().map(g=>{const w=g.getBoundingClientRect();return g.hasAttribute("data-editor-base-transform")||g.setAttribute("data-editor-base-transform",g.style.transform||""),{node:g,box:w,x:Number(g.getAttribute("data-editor-x")||0),y:Number(g.getAttribute("data-editor-y")||0),sx:Number(g.getAttribute("data-editor-scale-x")||1),sy:Number(g.getAttribute("data-editor-scale-y")||1)}})};return}const o=a.target.closest(".ld-diagram [data-diagram-label][data-editable]");let s=a.target.closest(Kt);o&&a.detail<2&&(s=o.closest('[data-diagram-object],g[role="button"]')||o);const u=a.target.closest('.ld-card,.sb-card,section.ld-unit[data-kind="card"]');if(u&&a.detail<2&&(s=u),a.target.closest(".ld-diagram")&&!a.target.closest('[data-diagram-object],g[role="button"],[data-diagram-label]')&&(s=null),s){if(a.preventDefault(),a.detail>=2&&o){a.stopImmediatePropagation(),L=null,ue(o);return}(!M.find(g=>g===s||g.contains(s))||a.shiftKey)&&rt([s],a.shiftKey),L={type:"pending",x:a.clientX,y:a.clientY,starts:$().map(g=>({node:g,x:Number(g.getAttribute("data-editor-x")||0),y:Number(g.getAttribute("data-editor-y")||0)}))};return}const m=document.getElementById("ld-marquee");m&&(a.shiftKey||rt([]),L={type:"marquee",x:a.clientX,y:a.clientY,base:M.slice()},m.style.display="block",m.style.left=a.clientX+"px",m.style.top=a.clientY+"px")},!0),document.addEventListener("pointermove",a=>{if(!L)return;const n=a.clientX-L.x,o=a.clientY-L.y;if(L.type==="pending"&&Math.hypot(n,o)>3&&(z(),L.type="move"),L.type==="move"&&(a.preventDefault(),L.starts.forEach(s=>{const u=de(s.node,n,o);St(s.node,s.x+u.x,s.y+u.y)}),Z()),L.type==="resize"){a.preventDefault();const s=L.handle.includes("e")?1:L.handle.includes("w")?-1:0,u=L.handle.includes("s")?1:L.handle.includes("n")?-1:0,m=Math.max(12,L.bounds.width+n*s),h=Math.max(12,L.bounds.height+o*u),g=m/L.bounds.width,w=h/L.bounds.height;L.starts.forEach(x=>{const E=x.node,I=x.box.left-L.bounds.left,N=x.box.top-L.bounds.top,X=Math.max(8,x.box.width*g),dt=Math.max(8,x.box.height*w);if(!(E instanceof SVGElement)){const U=Me(E);getComputedStyle(E).display==="inline"&&(E.style.display="inline-block"),s&&(E.style.width=X/U+"px",E.style.maxWidth="none"),u&&(/^(P|H1|H2|H3|H4|SPAN|B|I|A|DEL|INS|MARK|FIGCAPTION|TD|TH)$/.test(E.tagName)?(E.style.minHeight=dt/U+"px",E.style.height="auto"):E.style.height=dt/U+"px"),E.style.boxSizing="border-box"}const ct=x.x+I*(g-1)+(s<0?n:0),Y=x.y+N*(w-1)+(u<0?o:0);if(E instanceof SVGElement){const U=de(E,ct-x.x,Y-x.y);E.style.transformBox="fill-box",E.style.transformOrigin="top left",E.setAttribute("data-editor-scale-x",String(x.sx*g)),E.setAttribute("data-editor-scale-y",String(x.sy*w)),St(E,x.x+U.x,x.y+U.y)}else{const U=de(E,ct-x.x,Y-x.y);St(E,x.x+U.x,x.y+U.y)}}),Z()}if(L.type==="marquee"){const s=Math.min(L.x,a.clientX),u=Math.min(L.y,a.clientY),m=Math.max(L.x,a.clientX),h=Math.max(L.y,a.clientY),g=document.getElementById("ld-marquee");g.style.left=s+"px",g.style.top=u+"px",g.style.width=m-s+"px",g.style.height=h-u+"px";const w=La().filter(E=>{const I=E.getBoundingClientRect();return I.left>=s&&I.right<=m&&I.top>=u&&I.bottom<=h}),x=w.filter(E=>!w.some(I=>I!==E&&I.contains(E)));M=L.base.concat(x.filter(E=>!L.base.includes(E))),Z()}},!0),document.addEventListener("pointerup",()=>{const a=document.getElementById("ld-marquee");a&&(a.style.display="none"),L&&(L.type==="move"||L.type==="resize")&&(Gt=!0,H(L.starts.map(n=>n.node)),setTimeout(()=>{Gt=!1},0)),L=null},!0),document.addEventListener("dblclick",a=>{if(!D)return;const n=a.target.closest("[data-editable]");n&&(a.preventDefault(),a.stopImmediatePropagation(),ue(n))},!0),window.addEventListener("keydown",a=>{if(!D)return;const n=a.target.matches&&a.target.matches("section.ld-unit[data-unit]")?a.target:null;if(n&&(a.key==="Enter"||a.key===" ")){const m=Ta().find(h=>n.contains(h));m&&(a.preventDefault(),a.stopImmediatePropagation(),a.key==="Enter"&&M.length===1&&M[0]===m&&Ni(m)?ue(m):rt([m]));return}const o=a.target.closest&&a.target.closest('[contenteditable="true"],input,textarea,select'),s=a.key.toLowerCase(),u=a.metaKey||a.ctrlKey;if(u&&s==="z")a.preventDefault(),a.stopImmediatePropagation(),a.shiftKey?ci():di();else if(u&&s==="d"&&!o)a.preventDefault(),a.stopImmediatePropagation(),Mi();else if((a.key==="Delete"||a.key==="Backspace")&&!o)a.preventDefault(),a.stopImmediatePropagation(),Bi();else if(a.key==="Escape")a.preventDefault(),a.stopImmediatePropagation(),o&&o.hasAttribute("contenteditable")&&o.blur(),rt([]);else if(a.key.startsWith("Arrow")&&!o&&M.length){a.preventDefault(),a.stopImmediatePropagation();let m=a.key==="ArrowLeft"?-1:a.key==="ArrowRight"?1:0,h=a.key==="ArrowUp"?-1:a.key==="ArrowDown"?1:0;a.shiftKey&&(m*=10,h*=10),z(),$().forEach(g=>{St(g,Number(g.getAttribute("data-editor-x")||0)+m,Number(g.getAttribute("data-editor-y")||0)+h)}),H(M)}}),document.addEventListener("beforeinput",a=>{D&&a.target.closest&&a.target.closest('[contenteditable="true"]')&&!nt&&(z(),nt=!0)},!0),document.addEventListener("input",a=>{D&&a.target.closest&&a.target.closest('[contenteditable="true"]')&&H([a.target])},!0),document.addEventListener("focusout",a=>{const n=a.target;!D||!n.matches?.('[data-editable][contenteditable="true"]')||(n.removeAttribute("contenteditable"),n.removeAttribute("spellcheck"),nt=!1,H([n]))},!0),document.addEventListener("scroll",Z,!0),mi(()=>{bt&&cancelAnimationFrame(bt),Nt(),mt(),Z()})}function Wa(t){d("[data-export-protect]",t).forEach(e=>{(e.getAttribute("data-export-protect")||"").split(/[\s,]+/).filter(Boolean).forEach(i=>{e.style.removeProperty(i),e.removeAttribute(i)})})}function Fe(t){return`<!doctype html>
`+t.outerHTML.replaceAll("","")}function He(t,e){const i=t.querySelector("#legaldesign-state");i&&(i.textContent=it(e))}function Ue(t){d("[contenteditable]",t).forEach(n=>{n.removeAttribute("contenteditable"),n.removeAttribute("spellcheck")}),d(".ld-selected,.ld-selection-mark",t).forEach(n=>{n.classList.remove("ld-selected","ld-selection-mark")}),d("#ld-editor-layer,#ld-svg-text-editor,#ld-selection-popover,#ld-phone-sheet,#ld-restore-banner,.ld-save-banner,.ld-download-link,.ld-bottom-save,#ld-page-reader,#ld-read-page,#ld-page-fit-error",t).forEach(n=>{n.remove()}),d("[data-editor-added-tabindex]",t).forEach(n=>{n.removeAttribute("data-editor-added-tabindex"),n.removeAttribute("tabindex")}),t.removeAttribute("data-mode"),t.removeAttribute("data-editor-menu");const e=t.querySelector("#mode-toggle");e&&(e.textContent="Edit",e.setAttribute("aria-pressed","false"));const i=t.querySelector("#editor-overflow-toggle");i&&i.setAttribute("aria-expanded","false");const r=t.querySelector("#popup-scrim");r&&(r.hidden=!0,d(".pop",r).forEach(n=>{n.hidden=!0}));const a=t.querySelector("body");a&&a.style.overflow==="hidden"&&a.style.removeProperty("overflow")}function Di(t){Ue(t),Wa(t)}function ja(t,e){const i=c.brief||{},r={schema:c.schema,artifactId:e,savedAt:new Date().toISOString(),brief:{title:"[Descriptive title for the visible artifact.]",reader:"[Reader described by the visible artifact.]",action:"[Action described by the visible artifact.]",purpose:i.purpose||"understand",message:"[Message stated in the visible artifact.]",spine:i.spine||"sequence",situation:i.situation||"laptop",form:i.form||"one-page",sources:[],assumptions:[],gaps:[]},units:{},evidence:{},review:{...gt()?{}:{approach:ht()},decisions:{},theme:c.review&&c.review.theme||"light",location:c.review&&c.review.location!=null?c.review.location:null}};if(c.sourceSchemaVersion!=null&&(r.sourceSchemaVersion=c.sourceSchemaVersion),c.approaches){const n=ht();c.approaches[n]&&(r.approaches={[n]:F(c.approaches[n])})}c.composition&&(r.composition={strategy:c.composition.strategy,sections:(c.composition.sections||[]).map(n=>({id:n.id,unitIds:[...n.unitIds],layout:F(n.layout),...n.issueLayout?{issueLayout:F(n.issueLayout)}:{}}))}),c.overview&&(r.overview=F(c.overview)),c.style&&(r.style={source:c.style.source||"loxoto",ref:null});const a=[];return d("section.ld-unit[data-unit]",t).forEach(n=>{const o=n.getAttribute("data-unit"),s=c.units&&c.units[o];if(!s)return;a.push(o);const u=s.selected==="b"?"b":"a",m=n.querySelector('.ld-variant[data-variant="'+u+'"]'),h=m&&m.querySelector("[data-variant-body]"),g=h?h.innerHTML:"",x={axis:s.variants&&s.variants[u]&&s.variants[u].axis||"single",why:""};s.kind!=="figure"&&(x.html=g);const E={kind:s.kind,selected:u,variants:{a:F(x)},edits:{a:u==="a"?g:null},placeholder:s.kind==="card"?W.cardLine:s.kind==="figure"?W.figureLabel:s.kind==="decision"?"[The decision the reader must make.]":W.title};u==="b"&&(E.variants.b=F(x),E.edits.b=s.kind==="figure"?null:g),r.units[o]=E}),Object.keys(c.review&&c.review.decisions||{}).forEach(n=>{a.includes(n)&&(r.review.decisions[n]=F(c.review.decisions[n]))}),r}function Fa(t,e,i,r){if(r===""||Ze.has(e))return r;if(e==="sub"||/Sub$/.test(e))return"[One fact about it, under twenty words.]";const a={flow:{title:"[Stage name.]",edges:"[What passes to the next stage.]"},timeline:{when:"[Date.]",title:"[What happened.]"},hierarchy:{root:"[The authority at the top.]",title:i.includes("leaves")?"[Leaf.]":"[Branch.]",edge:"[What connects it.]"},zones:{zoneA:"[Zone label.]",zoneB:"[Zone label.]",title:"[Item in this zone.]",crossing:"[What crosses between the zones.]"},beforeAfter:{beforeLabel:"[State before.]",afterLabel:"[State after.]",edge:"[What changes it.]"},hub:{centre:"[Central idea.]",title:"[Spoke.]",edge:"[What connects it.]"},compareTwo:{a:i.includes("rows")?"[Value.]":"[Option name.]",b:i.includes("rows")?"[Value.]":"[Option name.]",label:"[Criterion.]"},funnel:{title:"[Tier.]",edges:"[What passes to the next tier.]",outcome:"[Outcome.]"},loop:{centre:"[Central idea.]",title:"[Step.]",edge:"[What leads to the next step.]"},matrix:{xAxis:"[Axis label.]",yAxis:"[Axis label.]",title:"[Quadrant.]"},figurePath:{marks:"[Milestone.]",goal:"[Goal.]",caption:"[What the path shows.]"},stairSteps:{title:"[Step.]",caption:"[What the steps show.]"},pyramid:{title:"[Level.]",caption:"[What the levels show.]"},gears:{labels:"[Moving part.]",caption:"[How the parts work together.]"}};return a[t]&&a[t][e]||"[Label.]"}function pe(t){return typeof t!="string"||!/^\[[^[\]\r\n]{3,200}\]$/.test(t.trim())?!1:new Set(["[0 checked \xB7 0 need attention]","[01]","[AREA \xB7 STATUS]","[Agreed in this draft: the settled sections, listed.]","[Amount, security, valuation \xB7 investor.]","[Area name, e.g. Formation]","[Area name.]","[Area \xB7 document and page.]","[Assumption the reader should know.]","[Axis label.]","[Branch.]","[Candidate visual treatment.]","[Central idea.]","[Citation or record label.]","[Clip of the source page with the cited passage highlighted.]","[Column heading.]","[Company name, or the number of findings that matter.]","[Company \xB7 transaction \xB7 report date.]","[Criterion.]","[Date.]","[Date. What it means.]","[Decision or action.]","[Document name.]","[Document, section, and page.]","[Each date with what happened or came due on it.]","[Expected record: the document, approval, or filing that would resolve the point.]","[Fact label, e.g. Incorporated]","[Finding not included in this sample.]","[First amount.]","[First position.]","[Goal.]","[How choices are saved.]","[How position, direction, grouping, scale, or contrast expresses the relationship.]","[How the parts work together.]","[How to read this report.]","[How to use the page, in one line.]","[How to use the slide.]","[Item in this zone.]","[Known gap or unresolved point.]","[Label.]","[Leaf.]","[Level.]","[List item.]","[Matter or deliverable title.]","[Section heading.]","[Finding title.]","[Scope and limits.]","[Required conditions.]","[Options and next action.]","[Review summary.]","[Findings and consequences.]","[Follow-up plan.]","[Actions before proceeding.]","[Review coverage.]","[Method workflow.]","[Method structure.]","[Matter \xB7 document \xB7 draft \xB7 date received.]","[Matter \xB7 the question this page answers.]","[Milestone.]","[Moving part.]","[NN]","[Not included in this template.]","[One card or row per finding that needs attention.]","[One fact about it, under twenty words.]","[One line that qualifies the title.]","[Open issue \xB7 section and name.]","[Open item name.]","[Open the document in the data room.]","[Open the source.]","[Option A.]","[Option B.]","[Option C.]","[Outcome.]","[PROPOSED INVESTMENT]","[Page label.]","[Provenance line.]","[QUESTION \xB7 JURISDICTION OR MATTER]","[QUESTION \xB7 MATTER]","[REPORT AREA]","[SECTION N OF TOTAL \xB7 COUNT DOCUMENTS CHECKED]","[STATUS]","[Scale end.]","[Scale label and gap.]","[Scale start.]","[Second amount.]","[Second position.]","[Section and page.]","[Short answer.]","[Source and locator.]","[Source of the figure's facts.]","[Sources and the date they were read.]","[Spoke.]","[Stage name.]","[State after.]","[State before.]","[Step.]","[Table value.]","[Term or category.]","[The area, or its exceptions, in one sentence.]","[The authority at the top.]","[The choice the reader makes, as a question.]","[The claim in one sentence, ending with a period.]","[The clause, in the document\u2019s words.]","[The closing condition, cure, covenant, representation, or follow-up.]","[The consequence of option A.]","[The consequence of option B.]","[The consequence of option C.]","[The counts.]","[The decision the reader must make.]","[The finding in five words.]","[The finding in one sentence.]","[The open item in five words.]","[The practical consequence for this transaction.]","[The question this card answers?]","[The reader and what they already know.]","[The source reviewed, the controlling fact, and the exact gap, with dates and numbers.]","[The value or fact this block communicates.]","[Timing or provenance.]","[Two sentences that tell the reader what they are looking at.]","[Value from the data room.]","[Value.]","[Verbatim excerpt of the controlling passage, in the document's words.]","[What changes it.]","[What connects it.]","[What crosses between the zones.]","[What happened.]","[What happens on this date.]","[What is open, in one line.]","[What it means.]","[What leads to the next step.]","[What passes to the next stage.]","[What passes to the next tier.]","[What the figure shows, as a claim.]","[What the levels show.]","[What the path shows.]","[What the steps show.]","[What the table shows.]","[What the value means.]","[What this report is and who it is for.]","[What this section enables the reader to understand or do.]","[What this source establishes, in one sentence.]","[What was found, with the date.]","[Why this composition best communicates the core relationship.]","[Why this treatment fits the reader and purpose.]","[Zone label.]","[\xA7 Section]","[\xA7N]"]).has(t.trim())}function $e(t,e){return pe(t)?t.trim():e}function Ha(t,e){const i=(e||[]).filter(n=>typeof n=="number"),r=(i.length?i[i.length-1]:0)+1,a={nowAt:0,offset:0,location:0,min:0,minValue:0,scaleMin:0,low:20,q1:25,before:30,a:30,start:40,median:50,mark:50,markAt:50,after:60,b:60,q3:75,high:80,max:100,maxValue:100,scaleMax:100,delta:10};return t==="value"?r:Object.hasOwn(a,t)?a[t]:t==="x"?r:r*10}function Pt(t,e,i,r,a){if(a=a||[],Array.isArray(t))return t.map((n,o)=>Pt(n,e,i,r,a.concat(o)));if(t&&typeof t=="object"){const n={};return Object.keys(t).forEach(o=>{const s=Pt(t[o],o,i,r,a.concat(o));s!==void 0&&(n[o]=s)}),n}return e==="detail"||/Detail$/.test(e)?i[t]||void 0:Ze.has(e)?t:typeof t=="number"?Ha(e,a):typeof t=="string"?Fa(r,e,a,t):t}function V(t,e,i){typeof i!="string"||!i||Object.hasOwn(e,i)||(e[i]=!0,t.push(i))}function Rt(t,e){const i=Object.create(null);return t.forEach((r,a)=>{i[r]=e+"-"+(a+1)}),i}function Ua(){const t={section:[],unit:[],claim:[],evidence:[],source:[]},e={section:Object.create(null),unit:Object.create(null),claim:Object.create(null),evidence:Object.create(null),source:Object.create(null)};(c.approaches?["a","b"].map(a=>(c.approaches[a]||{}).composition||{}):[c.composition||{}]).forEach(a=>{(a.sections||[]).forEach(n=>{V(t.section,e.section,n.id),(n.unitIds||[]).forEach(o=>{V(t.unit,e.unit,o)}),((n.layout||{}).placements||[]).forEach(o=>{V(t.unit,e.unit,o.unitId)})})}),Object.keys(c.units||{}).forEach(a=>{V(t.unit,e.unit,a)}),(c.claims||[]).forEach(a=>{V(t.claim,e.claim,a.id),(a.sourceIds||[]).forEach(n=>{V(t.source,e.source,n)}),(a.evidenceIds||[]).forEach(n=>{V(t.evidence,e.evidence,n)})}),Object.keys(c.units||{}).forEach(a=>{const n=c.units[a]||{};(n.claimRefs||[]).forEach(o=>{V(t.claim,e.claim,o)}),(n.evidence||[]).forEach(o=>{V(t.evidence,e.evidence,o)})}),Object.keys(c.evidence||{}).forEach(a=>{V(t.evidence,e.evidence,a);const n=c.evidence[a]||{};V(t.source,e.source,n.sourceId),(n.claimRefs||[]).forEach(o=>{V(t.claim,e.claim,o)})}),((c.brief||{}).sources||[]).forEach(a=>{V(t.source,e.source,a.id)});const r={section:Rt(t.section,"section"),unit:Rt(t.unit,"unit"),claim:Rt(t.claim,"claim"),evidence:Rt(t.evidence,"evidence"),source:Rt(t.source,"source"),options:Object.create(null),orders:t};return Object.keys(c.units||{}).forEach(a=>{const n=Object.create(null);((c.units[a]||{}).options||[]).forEach((o,s)=>{o&&o.key!=null&&(n[String(o.key)]="option-"+(s+1))}),r.options[a]=n}),r}function tt(t,e){return(t||[]).map(i=>e[i])}function ze(t){let e=W.title;return t.kind==="card"&&(e=W.cardLine),t.kind==="figure"&&(e=W.figureLabel),t.kind==="decision"&&(e="[The decision the reader must make.]"),$e(t.placeholder,e)}function Wt(t={},e=null){const i=new Set(["[Matter or deliverable title.]","[Section heading.]","[Finding title.]","[Scope and limits.]","[Short answer.]","[Decision or action.]","[Required conditions.]","[Options and next action.]","[Review summary.]","[Findings and consequences.]","[Follow-up plan.]","[Actions before proceeding.]","[Review coverage.]","[Method workflow.]","[Method structure.]"]);for(const a of[t.placeholder_title,e?.getAttribute("data-placeholder-title"),e?.getAttribute("data-placeholder"),t.placeholder])if(typeof a=="string"&&i.has(a.trim()))return a.trim();const r={title:"[Matter or deliverable title.]",matter:"[Matter or deliverable title.]",answer:"[Short answer.]",finding:"[Finding title.]",scope:"[Scope and limits.]",action:"[Decision or action.]",expected:"[Required conditions.]"};return Object.hasOwn(r,t.role)?r[t.role]:"[Section heading.]"}function $a(t,e,i){const r=Qe[e];return!r||!Array.isArray(t)?[]:t.map((a,n)=>{if(!a||typeof a!="object"||Array.isArray(a))return{};const o={};return Object.keys(a).forEach(s=>{r.has(s)&&(o[s]=Pt(a[s],s,i.evidence,null,[n,s]))}),o})}function za(t,e,i){const r={};let a=typeof t.component=="string"&&(_.registry||[]).includes(t.component)?t.component:null;if(a)try{_.render(a,t.params,{})}catch{a=null}return Object.keys(t).forEach(n=>{if($i.has(n)){if(n==="axis"){r.axis=Hi.includes(t.axis)?t.axis:e.single?"single":"form";return}if(n==="component"){a&&(r.component=a);return}if(n==="params"){if(a){r.params=Pt(t.params,"params",i.evidence,a,[]);try{_.render(a,r.params,{})}catch(o){throw new TypeError(`template ${a} parameters became invalid during sanitization: ${o.message}`)}}return}if(Object.hasOwn(Qe,n)){r[n]=$a(t[n],n,i);return}if(n==="layout"){Ui.includes(t.layout)&&(r.layout=t.layout);return}if(n==="why"){r[n]="[Why this treatment fits the reader and purpose.]";return}if(n==="encoding"){r[n]="[How position, direction, grouping, scale, or contrast expresses the relationship.]";return}if(n==="html"){r[n]=ze(e);return}if(n==="title"){r[n]=W.cardTitle;return}r[n]=Pt(t[n],n,i.evidence,a,[])}}),r}function Va(t,e){const i=c.units[t]||{},r={kind:zi.includes(i.kind)?i.kind:"text",selected:i.selected==="b"?"b":"a"};if(ti.includes(i.role)&&(r.role=i.role),["single","multiple"].includes(i.selection_mode)&&(r.selection_mode=i.selection_mode),["allow_custom","allow_note","single","sourcePreview"].forEach(a=>{typeof i[a]=="boolean"&&(r[a]=i[a])}),i.claim!=null&&(r.claim=i.kind==="decision"?"[The decision this unit presents.]":ze(i)),i.relationship!=null&&(r.relationship=Fi.includes(i.relationship)?i.relationship:"containment"),Array.isArray(i.candidates)&&(r.candidates=i.candidates.map(()=>"[Candidate visual treatment.]")),Array.isArray(i.claimRefs)&&(r.claimRefs=tt(i.claimRefs,e.claim)),Array.isArray(i.evidence)&&(r.evidence=tt(i.evidence,e.evidence)),typeof i.detail=="string"&&e.evidence[i.detail]&&(r.detail=e.evidence[i.detail]),r.variants={},Object.keys(i.variants||{}).forEach(a=>{r.variants[a]=za(i.variants[a],i,e)}),r.edits={},Object.keys(Object.assign({},i.variants||{},i.edits||{})).forEach(a=>{r.edits[a]=null}),r.placeholder=ze(i),i.placeholder_title!=null&&(r.placeholder_title=Wt(i)),i.placeholder_sub!=null&&(r.placeholder_sub="[One fact about it, under twenty words.]"),i.source_note!=null&&(r.source_note="[Source and locator.]"),i.tag!=null&&(r.tag="[Open issue \xB7 section and name.]"),i.question!=null&&(r.question="[The choice the reader makes, as a question.]"),Array.isArray(i.options)){const a=e.options[t]||{};r.options=i.options.map((n,o)=>({key:a[String(n.key)]||"option-"+(o+1),label:"[Option "+(o+1)+".]",consequence:"[The consequence of option "+(o+1)+".]"}))}return r}function Ga(t,e){const i={cite:"[Citation or record label.]",locator:"[Section and page.]",excerpt:"[Verbatim excerpt of the controlling clause, in the document's words.]",link:t.link==null?null:"#",status:"supplied-unverified"};return t.sourceId!=null&&(i.sourceId=e.source[t.sourceId]),Array.isArray(t.claimRefs)&&(i.claimRefs=tt(t.claimRefs,e.claim)),t.detail!=null&&(i.detail="[What this source establishes, in one sentence.]"),t.popup&&(i.popup={type:["source","explainer","detail"].includes(t.popup.type)?t.popup.type:"detail",title:"[The question or insight this popup explains.]",sections:(t.popup.sections||[]).map(()=>({heading:"[Specific subpoint.]",body:"[The deeper detail the reader needs here.]"}))},t.popup.lede!=null&&(i.popup.lede="[One-sentence orientation to the deeper detail.]")),t.original&&(i.original={availability:t.original.availability==="linked"?"linked":"unavailable",label:"[Original source label.]"},i.original.availability==="linked"&&(i.original.href="#")),t.image&&(i.image={status:"[Clip of the source page with the cited passage highlighted.]"},Object.hasOwn(t.image,"data")&&(i.image.data=null)),t.provenance!=null&&(i.provenance="[Source, version, and retrieval note.]"),i}function _i(t){return/^legaldesign-template-[a-z0-9][a-z0-9-]{0,79}$/.test(t||"")}function Ka(t){if(_i(t))return t;let e="";return window.crypto&&typeof window.crypto.randomUUID=="function"?e=window.crypto.randomUUID():e=Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,14),"legaldesign-template-"+e.toLowerCase()}function Xa(t,e){const i=c.brief||{},r={title:"[Descriptive title for the artifact.]",reader:"[The reader and what they already know.]",action:"[What the reader should decide or do.]",purpose:i.purpose,message:"[The answer the page should make clear.]",spine:i.spine,situation:i.situation,form:i.form,sources:(i.sources||[]).map(n=>{const o={id:t.source[n.id],label:"[Source label.]",status:"supplied-unverified"};return n.note!=null&&(o.note="[Source status note.]"),o}),assumptions:(i.assumptions||[]).map(()=>"[Assumption the reader should know.]"),gaps:(i.gaps||[]).map(()=>"[Known gap or unresolved point.]")};i.run!=null&&(r.run={});const a={schema:c.schema,artifactId:e,savedAt:new Date().toISOString(),brief:r,units:{},evidence:{},review:{...gt()?{}:{approach:"a"},decisions:{},theme:c.review&&c.review.theme||"light",location:null},history:[]};return c.sourceSchemaVersion!=null&&(a.sourceSchemaVersion=c.sourceSchemaVersion),c.style!=null&&(a.style={source:"template",ref:null}),c.approaches&&(a.approaches={},["a","b"].forEach(n=>{const s=(c.approaches[n]||{}).composition||{};a.approaches[n]={label:n==="a"?"Page A":"Page B",rationale:"[Why this complete page approach fits the reader and purpose.]",composition:{strategy:s.strategy,shape:"[The section sequence and reading path.]",rationale:"[Why this composition best communicates the core relationship.]",sections:(s.sections||[]).map(u=>({id:t.section[u.id],purpose:"[What this section enables the reader to understand or do.]",unitIds:tt(u.unitIds,t.unit),layout:{columns:(u.layout||{}).columns||12,placements:((u.layout||{}).placements||[]).map(m=>({unitId:t.unit[m.unitId],row:m.row,column:m.column,span:m.span,...m.rowSpan?{rowSpan:m.rowSpan}:{}}))}})),templateRef:s.strategy==="template-import"?"[Template or playbook reference.]":null}}})),c.composition&&(a.composition={strategy:c.composition.strategy,shape:"[The section sequence and reading path.]",rationale:"[Why this composition best communicates the core relationship.]",sections:(c.composition.sections||[]).map(n=>({id:t.section[n.id],purpose:"[What this section enables the reader to understand or do.]",unitIds:tt(n.unitIds,t.unit),...n.issueLayout?{issueLayout:{findingUnitId:t.unit[n.issueLayout.findingUnitId],implicationUnitId:t.unit[n.issueLayout.implicationUnitId],actionUnitId:t.unit[n.issueLayout.actionUnitId],supportUnitIds:tt(n.issueLayout.supportUnitIds,t.unit)}}:{},layout:{columns:(n.layout||{}).columns||12,placements:((n.layout||{}).placements||[]).map(o=>({unitId:t.unit[o.unitId],row:o.row,column:o.column,span:o.span,...o.rowSpan?{rowSpan:o.rowSpan}:{}}))}})),templateRef:c.composition.strategy==="template-import"?"[Template or playbook reference.]":null}),c.overview&&(a.overview={sectionId:t.section[c.overview.sectionId],contextUnitIds:tt(c.overview.contextUnitIds,t.unit),questionUnitId:t.unit[c.overview.questionUnitId],answerUnitId:t.unit[c.overview.answerUnitId],topics:(c.overview.topics||[]).map(n=>({unitId:t.unit[n.unitId],targetSectionId:t.section[n.targetSectionId]})),...c.overview.groups?{groups:c.overview.groups.map((n,o)=>({label:`Topic group ${o+1}`,topicUnitIds:tt(n.topicUnitIds,t.unit)}))}:{}}),Array.isArray(c.claims)&&(a.claims=c.claims.map(n=>{const o={id:t.claim[n.id],text:n.kind==="context"?"[Context the reader needs.]":"[Material claim the artifact communicates.]",kind:n.kind,sourceIds:tt(n.sourceIds,t.source),placement:n.placement,evidenceIds:tt(n.evidenceIds,t.evidence)};return n.omissionReason!=null&&(o.omissionReason="[Why this claim belongs in detail or is omitted.]"),o})),t.orders.unit.forEach(n=>{c.units&&c.units[n]&&(a.units[t.unit[n]]=Va(n,t))}),t.orders.evidence.forEach(n=>{c.evidence&&c.evidence[n]&&(a.evidence[t.evidence[n]]=Ga(c.evidence[n],t))}),a}function Ya(t,e,i){const r=Object.assign(Object.create(null),i.unit),a=Object.assign(Object.create(null),i.section),n=Object.assign(Object.create(null),i.evidence),o=Object.create(null),s=Object.keys(n).reduce((l,f)=>(l[n[f]]=!0,l),Object.create(null));let u=Object.keys(r).length,m=Object.keys(a).length,h=0;function g(l,f,p,b){if(Object.hasOwn(l,f))return l[f];const y=p+"-"+b();return l[f]=y,y}function w(l){return Object.hasOwn(n,l)?n[l]:s[l]?l:g(n,l,"detail",()=>{h+=1;const f=h;return s["detail-"+f]=!0,f})}function x(l,f,p){const b=[];let y="__ld_attribute_stage__";for(;l.includes(y);)y="_"+y;return Object.keys(p).forEach((C,q)=>{const T=y+f+"-"+q;l=N(l,f,C,T),b.push([T,p[C]])}),b.forEach(C=>{l=N(l,f,C[0],C[1])}),l}function E(l,f){const p=[];let b="__ld_class_stage__";for(;l.includes(b);)b="_"+b;return Object.keys(f).forEach((y,C)=>{const q=b+C,T=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=l.replace(new RegExp("\\."+T+"(?![A-Za-z0-9_-])","g"),"."+q),p.push([q,f[y]])}),p.forEach(y=>{const C=y[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=l.replace(new RegExp("\\."+C+"(?![A-Za-z0-9_-])","g"),"."+y[1])}),l}function I(l,f){!l||l===f||(d("[for],[aria-controls],[aria-labelledby],[aria-describedby]",t).forEach(p=>{["for","aria-controls","aria-labelledby","aria-describedby"].forEach(b=>{if(!p.hasAttribute(b))return;const y=p.getAttribute(b).split(/\s+/).map(C=>C===l?f:C);p.setAttribute(b,y.join(" "))})}),d("[href]",t).forEach(p=>{p.getAttribute("href")==="#"+l&&p.setAttribute("href","#"+f)}))}function N(l,f,p,b){return[`[${f}="${p}"]`,`[${f}='${p}']`,`[${f}=${p}]`].forEach((y,C)=>{const q=C===0?'"':C===1?"'":"",T=`[${f}=${q}${b}${q}]`;l=l.split(y).join(T)}),l}function X(l,f){return $e(l.getAttribute("data-placeholder"),f)}function dt(l,f){const p=l.localName;let b=f;if(/^h[1-4]$/.test(p)){const y=l.closest("[data-unit]")?.getAttribute("data-unit");return Wt(e.units[y]||c.units[y],l)}return p==="li"&&(b="[List item.]"),p==="th"&&(b="[Column heading.]"),p==="td"&&(b="[Table value.]"),p==="caption"&&(b="[What the table shows.]"),p==="dt"&&(b="[Term or category.]"),p==="dd"&&(b="[What it means.]"),X(l,b)}function ct(l,f,p){const b=d("[data-editable]",l);l.matches("[data-editable]")&&b.unshift(l);const y=new Set;b.forEach(v=>{if(v===f||y.has(v))return;if(!v.children.length){const k=dt(v,p);v.setAttribute("data-placeholder",k),v.textContent=k,y.add(v);return}let S=d("h1,h2,h3,h4,p,li,td,th,caption,dt,dd",v);if(v.matches("h1,h2,h3,h4,p,li,td,th,caption,dt,dd")&&S.unshift(v),S=S.filter(k=>{if(k===v)return!0;const B=k.parentElement.closest("h1,h2,h3,h4,p,li,td,th,caption,dt,dd");return!B||!v.contains(B)}),S.length||(S=d("span,small,strong,em",v).filter(k=>!k.querySelector("span,small,strong,em"))),!S.length){const k=X(v,p);v.setAttribute("data-placeholder",k),v.textContent=k,y.add(v);return}S.forEach(k=>{if(k===f||y.has(k))return;const B=dt(k,p);k.setAttribute("data-placeholder",B),k.textContent=B,y.add(k)})});const C=d("h1,h2,h3,h4,p,li,td,th,caption,dt,dd",l);l.matches("h1,h2,h3,h4,p,li,td,th,caption,dt,dd")&&C.unshift(l),C.filter(v=>{if(v===f||y.has(v))return!1;if(v===l)return!0;const S=v.parentElement.closest("h1,h2,h3,h4,p,li,td,th,caption,dt,dd");return!S||!l.contains(S)}).forEach(v=>{const S=dt(v,p);v.setAttribute("data-placeholder",S),v.textContent=S,y.add(v)});const q=document.createTreeWalker(l,NodeFilter.SHOW_TEXT),T=[];for(;q.nextNode();)T.push(q.currentNode);T.forEach(v=>{if(!v.textContent.trim())return;const S=v.parentElement;!S||S.closest("script,style,.ld-diagram")||S.closest("h1,h2,h3,h4,p,li,td,th,caption,dt,dd")||pe(v.textContent.trim())||(v.textContent=X(S,p))})}function Y(l){if(!l||!l.hasAttribute("data-editor-preserve-dom"))return null;const f=d('svg [data-diagram-object],svg g[role="button"]',l).map((p,b)=>({key:p.getAttribute("data-editor-node-key")||"node-"+(b+1),transform:p.style.transform||"",transformBox:p.style.transformBox||"",transformOrigin:p.style.transformOrigin||"",detail:p.getAttribute("data-detail")||null,x:p.getAttribute("data-editor-x")||"0",y:p.getAttribute("data-editor-y")||"0",sx:p.getAttribute("data-editor-scale-x")||"1",sy:p.getAttribute("data-editor-scale-y")||"1",fill:pt.includes(p.getAttribute("data-fill-token"))?p.getAttribute("data-fill-token"):null,text:ut.includes(p.getAttribute("data-text-token"))?p.getAttribute("data-text-token"):null,labels:U(p).map(et)}));return f.looseLabels=d("svg text",l).filter(p=>!p.closest('[data-diagram-object],g[role="button"]')).map(et),f}function U(l){return d("text",l).filter(f=>f.closest('[data-diagram-object],g[role="button"]')===l)}function et(l){const f={};for(const b of["transform","transform-box","transform-origin","font-size","font-weight","font-style","text-decoration-line"]){const y=l.style.getPropertyValue(b);y&&ni(b,y)&&(f[b]=y)}const p={};for(const b of["x","y","scale-x","scale-y"]){const y=l.getAttribute("data-editor-"+b);y!==null&&Number.isFinite(Number(y))&&(p[b]=String(Number(y)))}return{styles:f,geometry:p,fill:pt.includes(l.getAttribute("data-fill-token"))?l.getAttribute("data-fill-token"):null,text:ut.includes(l.getAttribute("data-text-token"))?l.getAttribute("data-text-token"):null}}function G(l,f){(f||[]).forEach((p,b)=>{const y=l[b];y&&(Object.entries(p.styles).forEach(([C,q])=>{y.style.setProperty(C,q)}),Object.entries(p.geometry).forEach(([C,q])=>{y.setAttribute("data-editor-"+C,q)}),p.styles.transform&&y.setAttribute("data-editor-base-transform",""),p.fill&&y.setAttribute("data-fill-token",p.fill),p.text&&y.setAttribute("data-text-token",p.text))})}function Ut(l,f){if(!f)return;const p=d('svg [data-diagram-object],svg g[role="button"]',l),b=Object.create(null);f.forEach(y=>{b[y.key]||(b[y.key]=[]),b[y.key].push(y)}),p.forEach((y,C)=>{const q="node-"+(C+1),T=b[q]||[];if(!T.length){y.remove();return}let v=y;T.forEach((S,k)=>{const B=k?y.cloneNode(!0):y;k&&v.insertAdjacentElement("afterend",B),B.setAttribute("data-editor-node-key",q),B.style.transform=S.transform,B.style.transformBox=S.transformBox,B.style.transformOrigin=S.transformOrigin,B.setAttribute("data-editor-x",S.x),B.setAttribute("data-editor-y",S.y),B.setAttribute("data-editor-scale-x",S.sx),B.setAttribute("data-editor-scale-y",S.sy),B.setAttribute("data-editor-base-transform",""),S.detail?(B.setAttribute("data-detail",S.detail),B.setAttribute("aria-controls",S.detail),B.setAttribute("role","button"),B.setAttribute("tabindex","0"),B.classList.add("ld-detail")):(["data-detail","aria-controls","aria-haspopup","role","tabindex"].forEach(J=>{B.removeAttribute(J)}),B.classList.remove("ld-detail")),S.fill?B.setAttribute("data-fill-token",S.fill):B.removeAttribute("data-fill-token"),S.text?B.setAttribute("data-text-token",S.text):B.removeAttribute("data-text-token"),G(U(B),S.labels),v=B})}),G(d("svg text",l).filter(y=>!y.closest('[data-diagram-object],g[role="button"]')),f.looseLabels),l.setAttribute("data-editor-preserve-dom","true")}const At=t.matches("[data-document-title-placeholder]")?t:t.querySelector("[data-document-title-placeholder]");At&&At.setAttribute("data-document-title-placeholder","[Matter] \xB7 LegalDesign template");const $t=t.querySelector("title");$t&&($t.textContent=At?At.getAttribute("data-document-title-placeholder"):"[Matter] \xB7 LegalDesign template");const R=t.querySelector(".ld-matter");R&&(R.setAttribute("data-placeholder","[Matter or deliverable title.]"),R.textContent="[Matter or deliverable title.]"),d("[data-placeholder]",t).forEach(l=>{const f=l.hasAttribute("data-card-title")?W.cardTitle:l.closest(".ld-diagram")?W.figureLabel:W.title,p=l.closest("[data-unit]")?.getAttribute("data-unit"),b=/^h[1-4]$/.test(l.localName)?Wt(c.units[p],l):X(l,f);l.setAttribute("data-placeholder",b),l.textContent=b}),d("[data-placeholder-title]",t).forEach(l=>{const f=l.closest("[data-unit]")?.getAttribute("data-unit");l.setAttribute("data-placeholder-title",Wt(c.units[f],l))}),d("[data-placeholder-sub]",t).forEach(l=>{l.setAttribute("data-placeholder-sub",$e(l.getAttribute("data-placeholder-sub"),"[One fact about it, under twenty words.]"))}),d("[data-evidence],[data-detail],[data-evidence-ids]",t).forEach(l=>{l.hasAttribute("data-evidence")&&l.setAttribute("data-evidence",w(l.getAttribute("data-evidence"))),l.hasAttribute("data-detail")&&l.setAttribute("data-detail",w(l.getAttribute("data-detail"))),l.hasAttribute("data-evidence-ids")&&l.setAttribute("data-evidence-ids",l.getAttribute("data-evidence-ids").split(/\s+/).filter(Boolean).map(w).join(" "))}),d("[data-section-target]",t).forEach(l=>{const f=a[l.getAttribute("data-section-target")];f?l.setAttribute("data-section-target",f):l.removeAttribute("data-section-target")}),d("[data-composition-section]",t).forEach(l=>{const f=l.getAttribute("data-composition-section");if(!Object.hasOwn(a,f)){l.remove();return}const p=g(a,f,"section",()=>(m+=1,m));l.setAttribute("data-composition-section",p),l.hasAttribute("data-index-label")&&l.setAttribute("data-index-label","[Section topic]"),l.setAttribute("aria-label","[What this section enables the reader to understand or do.]")}),d("section.ld-unit[data-unit]",t).forEach(l=>{const f=l.getAttribute("data-unit");if(!Object.hasOwn(r,f)){l.remove();return}const p=g(r,f,"unit",()=>(u+=1,u));l.setAttribute("data-unit",p);const b=e.units[p];if(!b)return;l.setAttribute("aria-label",b.claim||b.placeholder),d(".ld-variant",l).forEach(v=>{const S=v.getAttribute("data-variant"),k=b.variants&&b.variants[S],B=d(".ld-diagram",v),J=d("[data-variant-body]",v).filter(j=>j.parentElement===v);let P=J.shift();P||(P=document.createElement("div"),P.setAttribute("data-variant-body",""),P.setAttribute("data-editable",""),v.appendChild(P));let O=b.kind==="figure"?P.querySelector(".ld-diagram"):null;!O&&b.kind==="figure"&&(O=B[0]||null);const zt=Y(O);if(O&&!P.contains(O)&&P.appendChild(O),J.forEach(j=>{j.remove()}),d(".ld-diagram",v).forEach(j=>{j!==O&&j.remove()}),b.kind==="figure"&&Array.from(P.childNodes).forEach(j=>{j!==O&&j.remove()}),P&&k&&b.kind!=="figure"){const j=d(".ld-inline-detail[data-detail]",P).map(he=>({detail:he.getAttribute("data-detail"),parent:he.closest("p,li,td,th,dt,dd")})),xt=P.querySelector("[data-card-title]");xt&&(xt.textContent=Wt(b,xt)),ct(P,xt,b.placeholder||(b.kind==="card"?W.cardLine:W.title)),j.forEach(({detail:he,parent:Xe})=>{const Ye=Xe&&P.contains(Xe),me=Ye?Xe:document.createElement("p"),kt=document.createElement("button");kt.type="button",kt.className="ld-inline-detail",kt.setAttribute("data-detail",he),kt.setAttribute("aria-haspopup","dialog"),kt.textContent=Ye?me.textContent:"[Open the supporting explanation.]",me.replaceChildren(kt),Ye||(me.className="ld-detail-linkline",P.appendChild(me))})}if(!O&&k&&b.kind==="figure"&&(O=document.createElement("div"),O.className="ld-diagram",P.appendChild(O)),O&&b.kind==="figure"){const j=O.id,xt="diagram-"+p+"-"+(S||"a");O.id=xt,I(j,xt)}O&&k&&k.component?(O.innerHTML=_.render(k.component,k.params,{ariaLabel:b.placeholder||W.figureLabel}),Ut(O,zt),Ot(O,k.params)):O&&k&&b.kind==="figure"&&(O.removeAttribute("data-editor-preserve-dom"),O.innerHTML='<svg viewBox="0 0 800 420" role="img" aria-label="[Illustration or diagram supplied for this field.]"><rect width="799" height="419" x=".5" y=".5" fill="var(--card)" stroke="var(--line-strong)"/><text x="400" y="210" text-anchor="middle" fill="currentColor" font-family="Helvetica,Arial,sans-serif" font-size="20">[Illustration or diagram supplied for this field.]</text></svg>')});const y=l.querySelector(".ld-why"),C=b.variants&&b.variants[b.selected];if(y&&C&&C.why&&(y.textContent=C.why),d("[data-editable]",l).forEach(v=>{v.closest(".ld-variant")||(v.textContent=v.getAttribute("data-placeholder")||(v.hasAttribute("data-card-title")?b.placeholder_title||W.cardTitle:b.placeholder||W.title))}),b.kind==="decision"){l.removeAttribute("data-answered");const v=l.querySelector(".tag");v&&b.tag&&(v.textContent=b.tag);const S=l.querySelector(".ld-decision h3,h2");S&&b.question&&(S.textContent=b.question),d("[data-decision-option]",l).forEach((k,B)=>{const J=(b.options||[])[B];if(!J)return;k.setAttribute("value",J.key),k.setAttribute("aria-pressed","false");const P=k.querySelector("strong"),O=k.querySelector("b"),zt=k.querySelector("span"),j=k.querySelector("small");P&&(P.textContent="Option "+(B+1)),O&&(O.textContent=J.label),zt&&(zt.textContent=j?J.label:J.consequence),j&&(j.textContent=J.consequence),!P&&!O&&!zt&&!j&&(k.textContent=J.label)})}d(".ld-evidence-trigger",l).forEach(v=>{v.textContent="Source: [Citation or record label.]"});const q=document.createTreeWalker(l,NodeFilter.SHOW_TEXT),T=[];for(;q.nextNode();)T.push(q.currentNode);T.forEach(v=>{const S=v.textContent.trim();if(!S||pe(S))return;const k=v.parentElement;!k||k.closest("script,style,.ld-unit-tools,.ld-diagram,.ld-why,[data-decision-option],.ld-evidence-trigger")||k.closest("[data-placeholder]")||(v.textContent=b.placeholder||W.title)})}),d("[data-variant-body] [class]",t).forEach(l=>{if(l.closest(".ld-diagram"))return;const f=l.getAttribute("class").split(/\s+/).filter(Boolean).map(p=>p.startsWith("ld-")||["cite","tag","action"].includes(p)?p:(Object.hasOwn(o,p)||(o[p]="template-class-"+(Object.keys(o).length+1)),o[p]));f.length?l.setAttribute("class",f.join(" ")):l.removeAttribute("class")}),d("section.ld-unit [data-variant-body] img",t).forEach(l=>{const f=document.createElementNS("http:"+"//www.w3.org/2000/svg","svg"),p=l.closest(".ld-source-preview"),b=p?d(".ld-source-preview img").find(q=>q.getAttribute("src")===l.getAttribute("src")):null,y=b?.naturalWidth||800,C=b?.naturalHeight||420;f.setAttribute("viewBox",`0 0 ${y} ${C}`),f.setAttribute("role","img"),f.setAttribute("aria-label","[Illustration or source image supplied for this field.]"),f.innerHTML=`<rect width="${y-1}" height="${C-1}" x=".5" y=".5" fill="var(--card)" stroke="var(--line-strong)"/><text x="${y/2}" y="${C/2}" dominant-baseline="middle" text-anchor="middle" fill="currentColor" font-family="Helvetica,Arial,sans-serif" font-size="${Math.min(20,C/2)}">${p?"[Source clip.]":"[Illustration or source image supplied for this field.]"}</text>`,l.replaceWith(f)});const fe=new Set(d("[id][data-frame]",t).map(l=>l.id).filter(l=>/^p\d+$/.test(l)));d("[data-page]",t).forEach(l=>{fe.has(l.getAttribute("data-page"))||l.removeAttribute("data-page")});const er=new Set(["data-card-title","data-decision-custom","data-decision-note","data-decision-option","data-detail","data-editable","data-diagram-label","data-evidence-field","data-evidence-id","data-editor-node-key","data-editor-object","data-diagram-object","data-editor-preserve-dom","data-evidence","data-fill-token","data-placeholder","data-placeholder-sub","data-placeholder-title","data-page","data-text-token","data-variant-body"]);d("section.ld-unit [data-variant-body],section.ld-unit [data-variant-body] *",t).forEach(l=>{l.closest(".ld-diagram")||Array.from(l.attributes).forEach(f=>{const p=f.name.toLowerCase();if(p==="id"){l.removeAttribute(p);return}if(p==="title"||p==="aria-description"){l.setAttribute(p,"[Accessible description.]");return}if(p==="alt"){l.setAttribute(p,"[Accessible description.]");return}if(p==="src"||p==="srcset"){l.removeAttribute(p);return}p.startsWith("data-")&&!er.has(p)&&l.removeAttribute(p)})});const ir=new Set(["data-answered","data-detail","data-editor-preserve-dom","data-editor-x","data-editor-y","data-evidence","data-fill-token","data-kind","data-role","data-section-target","data-single","data-text-token","data-unit"]);d("section.ld-unit[data-unit]",t).forEach(l=>{Array.from(l.attributes).forEach(f=>{const p=f.name.toLowerCase();if(p==="data-role"&&!ti.includes(f.value)){l.removeAttribute(p);return}if(p==="id"){l.removeAttribute(p);return}if(p==="title"||p==="aria-description"){l.setAttribute(p,"[Accessible description.]");return}p.startsWith("data-")&&!ir.has(p)&&l.removeAttribute(p)})}),d("section.ld-unit .ld-variant",t).forEach(l=>{Array.from(l.attributes).forEach(f=>{const p=f.name.toLowerCase();if(p==="id"){l.removeAttribute(p);return}if(p==="title"||p==="aria-description"){l.setAttribute(p,"[Accessible description.]");return}p.startsWith("data-")&&p!=="data-variant"&&l.removeAttribute(p)})}),d("main [title],#popup-scrim [title]",t).forEach(l=>{l.setAttribute("title","[Accessible description.]")});const Ri=t.querySelector("main");if(Ri){const l=document.createTreeWalker(Ri,NodeFilter.SHOW_TEXT),f=[];for(;l.nextNode();)f.push(l.currentNode);f.forEach(p=>{const b=p.textContent.trim();if(!b||pe(b))return;const y=p.parentElement;!y||y.closest("script,style,section.ld-unit,#ld-form-navigation,#ld-page-approach,.ld-diagram")||y.closest("[data-placeholder]")||(p.textContent="[The value or fact this block communicates.]")})}d(".ld-index-group",t).forEach((l,f)=>{l.open=!1;const p=l.querySelector(":scope > summary");p&&(p.textContent=`Topic group ${f+1}`)}),d(".ld-overview-groups",t).forEach(l=>{d(":scope > .ld-overview-group",l).forEach((f,p)=>{f.open=p===0,f.setAttribute("data-overview-group",String(p));const b=f.querySelector(".ld-overview-group-label");b&&(b.textContent=`Topic group ${p+1}`,b.setAttribute("data-overview-group-label",String(p)));const y=f.querySelector(".ld-overview-group-count"),C=e.overview?.groups?.[p]?.topicUnitIds.length||0;y&&(y.textContent=`${C} ${C===1?"topic":"topics"}`)})}),d(".ld-issue-analysis",t).forEach(l=>{const f=["[Statement or finding.]","[Why it matters.]","[Recommendation or next check.]"];d(":scope > section.ld-unit",l).forEach((p,b)=>{const y=p.querySelector("h2,h3");!y||!f[b]||(y.textContent=f[b],y.setAttribute("data-placeholder",f[b]))})}),d(".ld-source-preview",t).forEach(l=>{const f=l.querySelector("h2,h3"),p=l.querySelector("blockquote"),b=l.querySelector("figcaption");for(const[y,C]of[[f,"[Source passage.]"],[p,"[Exact supporting excerpt, with its qualification.]"],[b,"[Source, locator and review status.]"]])y&&(y.textContent=C,y.setAttribute("data-placeholder",C))}),Xi(t),d("style",t).forEach(l=>{let f=l.textContent;f=x(f,"data-unit",r),f=x(f,"data-composition-section",a),f=E(f,o),l.textContent=f}),d("#popup-scrim .pop",t).forEach(l=>{const f=l.id,p=w(f),b=l.querySelector(".tag"),y=l.querySelector("h2"),C=l.querySelector(".desc");I(f,p),I(f+"-title",p+"-title"),l.id=p,l.setAttribute("data-evidence-id",p),l.setAttribute("aria-labelledby",p+"-title"),b&&(b.textContent="[Citation or record label.]"),y&&(y.id=p+"-title",y.textContent="[What this source establishes, in one sentence.]"),C&&(C.textContent="[Two sentences that tell the reader what they are looking at.]"),d(".doc-text",l).forEach(T=>{T.textContent="[Verbatim excerpt of the controlling clause, in the document's words.]"}),d("blockquote",l).forEach(T=>{T.textContent="[Verbatim excerpt of the controlling clause, in the document's words.]"}),d(".doc-cl",l).forEach(T=>{T.textContent="[Section and page.]"}),d(".doc-foot,.ld-popup-source",l).forEach(T=>{T.textContent="[Source, version, date retrieved.]"});const q={cite:"[Citation or record label.]",locator:"[Section and page.]",detail:"[Verbatim excerpt of the controlling clause, in the document's words.]","popup.title":"[The question or insight this popup explains.]","popup.lede":"[One-sentence orientation to the deeper detail.]"};d("[data-evidence-field]",l).forEach(T=>{const v=T.getAttribute("data-evidence-field"),S=/^popup\.sections\.\d+\.(heading|body)$/.exec(v),k=q[v]||(S&&S[1]==="heading"?"[Specific subpoint.]":S?"[The deeper detail the reader needs here.]":null);k&&(T.setAttribute("data-placeholder",k),T.textContent=k)}),d("img",l).forEach(T=>{const v=document.createElementNS("http:"+"//www.w3.org/2000/svg","svg");v.setAttribute("viewBox","0 0 800 420"),v.setAttribute("role","img"),v.setAttribute("aria-label","[Clip of the source page with the cited passage highlighted.]"),v.innerHTML='<rect width="799" height="419" x=".5" y=".5" fill="var(--card)" stroke="var(--line-strong)"/><text x="400" y="210" text-anchor="middle" fill="currentColor" font-family="Helvetica,Arial,sans-serif" font-size="20">[Clip of the source page with the cited passage highlighted.]</text>',T.replaceWith(v)}),d("a",l).forEach(T=>{T.setAttribute("href","#"),T.removeAttribute("target"),T.removeAttribute("rel"),T.textContent="[Open the clause in the source document.]"}),d(".out,.ld-source-unavailable",l).forEach(T=>{T.querySelector("a")||(T.textContent="[Original source unavailable in this template.]")})});const ar=["Close source popup","Theme","Edit","Export HTML","Export template","Save","Undo","Redo","Duplicate","Delete","Bold","Italic","Underline","Increase type","Decrease type","Reset","More","Treatment","Treatment A","Treatment B","Fill token","Text token","Custom position","Note","Previous slide","Next slide","Slide navigation","Select slide","Report sections","Contents","Collapse contents","Expand contents","Open contents","Previous page","Next page","Previous section","Next section"];d("[aria-label]",t).forEach(l=>{const f=l.getAttribute("aria-label");f&&!ar.includes(f)&&l.setAttribute("aria-label","[Accessible description.]")}),d("a[href]",t).forEach(l=>{if(l.setAttribute("href","#"),l.removeAttribute("target"),l.removeAttribute("rel"),l.closest("#popup-scrim"))return;const f=l.hasAttribute("data-page")||l.hasAttribute("data-frame-button")||l.hasAttribute("data-evidence")||l.hasAttribute("data-detail");f&&l.children.length||(l.hasAttribute("data-evidence")||l.hasAttribute("data-detail")?l.textContent="[Open the source.]":f?l.textContent="[Open the relevant section.]":l.textContent="[Link.]")}),d("[data-decision-custom],[data-decision-note]",t).forEach(l=>{l.value="",l.setAttribute("aria-label",l.hasAttribute("data-decision-custom")?"Custom position":"Note")}),d("[data-report-section]",t).forEach((l,f)=>{l.textContent="[Section "+(f+1)+".]"}),d("#ld-page-approach [data-select-approach]",t).forEach(l=>{const f=l.getAttribute("data-select-approach")==="b"?"B":"A";l.innerHTML="<span>"+f+"</span>Page "+f}),d("[data-zone-doc]",t).forEach(l=>{l.removeAttribute("data-zone-doc")}),Zi(t)}function Ja(t,e){const i=new Blob([t],{type:"text/html;charset=utf-8"}),r=document.createElement("a");r.className="ld-download-link";const a=URL.createObjectURL(i);r.href=a,r.download=e,r.hidden=!0,r.setAttribute("data-editor-chrome",""),document.body.appendChild(r);try{r.click()}catch(n){throw r.remove(),URL.revokeObjectURL(a),n}setTimeout(()=>{r.remove(),URL.revokeObjectURL(a)},6e4)}let Ve=!1,jt=null;function Ft(){const t=document.querySelector(".ld-save-banner");t&&t.remove(),jt&&(URL.revokeObjectURL(jt),jt=null)}async function Ge(t,e,i=!1,r=!1){if(Ve)return Ht("A save is already in progress. Finish that save first.",8e3),"busy";Ve=!0,Ft();let a;try{if(typeof window.showSaveFilePicker=="function")try{const n=i&&Vt?Vt:await window.showSaveFilePicker({suggestedName:e,types:[{description:"HTML file",accept:{"text/html":[".html"]}}]});return a=await n.createWritable(),await a.write(t),await a.close(),a=null,i&&(Vt=n),Ht(`Saved ${n.name||e} to the location you chose.${r?" Open a preview of this exact exported copy below.":""}`,r?0:8e3,r?t:null),"saved"}catch(n){if(a&&typeof a.abort=="function"){try{await a.abort()}catch{}a=null}if(n&&n.name==="AbortError")return Ht("Save canceled. Your open work is unchanged.",8e3),"canceled";i&&(Vt=null)}return Ja(t,e),Ht(`Download requested: ${e}. Check your browser's download location; this page cannot confirm it reached disk. Your open work is unchanged.${r?" The link opens a preview of this exact exported copy, not the saved disk file.":""}`,r?0:16e3,r?t:null),"download-requested"}catch{return Ht("The file could not be saved. Your open work is unchanged. Try Save or Export again and choose a writable location.",16e3),"failed"}finally{Ve=!1}}function Za(t){const e=["data-card-title","data-document-title-placeholder","data-editable","data-diagram-label","data-evidence-field","data-evidence-id","data-editor-base-transform","data-editor-scale-x","data-editor-scale-y","data-editor-node-key","data-editor-origin-fill-token","data-editor-origin-fill-token-present","data-editor-origin-style","data-editor-origin-style-present","data-editor-origin-style-stamped","data-editor-origin-text-token","data-editor-origin-text-token-present","data-editor-only","data-editor-preserve-dom","data-editor-unit","data-editor-x","data-editor-y","data-export-chrome","data-export-protect","data-placeholder","data-param-path","data-single","data-zone-doc"];d("*",t).concat([t]).forEach(i=>{e.forEach(r=>{i.removeAttribute(r)})})}function Pi(t){if(t.getAttribute("data-exported")!=="client"||t.querySelector("#ld-response-save"))return;const e=t.querySelector(".ld-controls");if(!e)return;const i=document.createElement("button");i.className="ld-control",i.id="ld-response-save",i.type="button",i.textContent="Save responses",e.appendChild(i)}_.exportHTML=t=>{if(d('[contenteditable="true"]').forEach(o=>{o.blur()}),Ft(),Nt(),!qe(!1))throw new Error("Page exceeds the available window. Move detail to a popup or another page before exporting.");const e=document.documentElement.cloneNode(!0);Di(e),e.setAttribute("data-exported","client");const i="legaldesign-client-"+Ae(c.artifactId);if(e.setAttribute("data-client-blueprint-id",i),d("#export-html,#export-template",e).forEach(o=>{o.remove()}),d("[data-placeholder],[data-placeholder-title]",e).forEach(o=>{o.removeAttribute("data-placeholder"),o.removeAttribute("data-placeholder-title")}),c.approaches){const o=ht();d("[data-approach]",e).forEach(u=>{u.getAttribute("data-approach")!==o?u.remove():u.hidden=!1});const s=e.querySelector("#ld-page-approach");s&&s.remove()}d("section.ld-unit[data-unit]",e).forEach(o=>{const s=Q(o.getAttribute("data-unit"));if(!s){o.remove();return}const u=s.selected;d(".ld-variant",o).forEach(m=>{m.getAttribute("data-variant")!==u?m.remove():m.hidden=!1}),d(".ld-ab,.ld-why,.ld-unit-tools,.ld-review,.ld-sheet-open",o).forEach(m=>{m.remove()})}),d("[data-editor-only]",e).forEach(o=>{o.remove()});const r=new Set(d("[data-evidence],[data-detail],[data-evidence-ids]",e).filter(o=>!o.closest("#popup-scrim")).flatMap(o=>{const s=o.getAttribute("data-evidence-ids");return s?s.split(/\s+/).filter(Boolean):[o.getAttribute("data-evidence")||o.getAttribute("data-detail")].filter(Boolean)}));for(const o of r){const s=d("#popup-scrim .pop[id]",e).find(u=>u.id===o);s&&d("[data-detail],[data-evidence],[data-evidence-ids]",s).forEach(u=>{const m=u.getAttribute("data-evidence-ids");(m?m.split(/\s+/):[u.getAttribute("data-detail")||u.getAttribute("data-evidence")]).filter(Boolean).forEach(h=>{r.add(h)})})}d("#popup-scrim .pop[id]",e).forEach(o=>{r.has(o.id)||o.remove()});const a=ja(e,i);Za(e),Pi(e),He(e,a);const n=Fe(e);return t!==!1&&Ge(n,c.artifactId+".html",!1,!0),n},_.exportTemplate=(t,e)=>{if(d('[contenteditable="true"]').forEach(s=>{s.blur()}),Ft(),Nt(),!qe(!0))throw new Error("Page exceeds the available window. Move detail to a popup or another page before exporting.");const i=Ka(e),r=document.documentElement.cloneNode(!0);r.dataset.templateId=i,_i(e)?r.dataset.templateKind="packaged":r.dataset.templateKind="exported",r.dataset.templateBlueprintId=i,Di(r),r.setAttribute("data-exported","template");const a=Ua(),n=Xa(a,i);Ya(r,n,a),He(r,n);const o=Fe(r);return t!==!1&&Ge(o,i+".html"),o};async function Ke(){d('[contenteditable="true"]').forEach(a=>{a.blur()}),c.savedAt=new Date().toISOString(),K(),at();const t=document.documentElement.cloneNode(!0);Ue(t),He(t,c);const e=Fe(t),i=A.getAttribute("data-exported")==="client"?c.artifactId+"-responses.html":c.artifactId+".html",r=await Ge(e,i,!0);return r==="saved"&&Qa(),r==="canceled"||r==="failed"||r==="busy"?null:e}function Qa(){const t=document.getElementById("ld-restore-banner");t&&t.remove()}function Ht(t,e=2400,i=null){Ft();const r=document.createElement("div");if(r.className="ld-save-banner",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("data-editor-chrome",""),r.textContent=t,i!==null){jt=URL.createObjectURL(new Blob([i],{type:"text/html;charset=utf-8"}));const n=document.createElement("a");n.className="ld-export-preview",n.href=jt,n.target="_blank",n.rel="noopener noreferrer",n.textContent="Open exported HTML",r.appendChild(n)}const a=document.querySelector(".ld-bar");(a?a.parentNode:document.body).insertBefore(r,a?a.nextSibling:document.body.firstChild),e>0&&setTimeout(()=>{r.isConnected&&Ft()},e)}function tr(){const t=document.getElementById("theme-toggle");t&&t.addEventListener("click",()=>{ri(!0),Zt(A.getAttribute("data-theme")==="dark"?"light":"dark",!0)});const e=document.getElementById("ld-save");e&&e.addEventListener("click",Ke);const i=document.getElementById("ld-response-save");i&&i.addEventListener("click",Ke);const r=document.getElementById("export-html");r&&r.addEventListener("click",()=>{_.exportHTML(!0)});const a=document.getElementById("export-template");a&&a.addEventListener("click",()=>{_.exportTemplate(!0)})}_.state=()=>F(c),_.setState=t=>{if(!t||t.schema!=="legaldesign.state.v1")throw new TypeError("state must use legaldesign.state.v1");we(),c=F(t),K(),mt({sync:!1}),at()},_.save=Ke,_.setMode=qi,_.setApproach=Ce,_.openPopup=_t,_.closePopup=se,_.bindDecisions=Dt,_.placeholderDerivation=F(W),Ue(A),Qi(),Zt(ke(),!1),Ki(),Pi(A),yi(),mt(),Ie(),ne(),Dt(),Ea(),qt(),Ra(),tr(),oa(),lt(),ri(!1),gt()&&window.matchMedia("(max-width: 760px)").matches&&requestAnimationFrame(()=>{!D&&!st()&&Ne(document.getElementById("ld-read-page"))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Je,{once:!0}):Je()})();
</script></head><body><header class="ld-bar" data-export-chrome=""><p class="ld-matter" data-placeholder="[Matter or deliverable title.]">[Matter or deliverable title.]</p><div class="ld-controls ld-pills"><button class="ld-control" id="mode-toggle" type="button" data-editor-only="" aria-pressed="false">Edit</button><div class="ld-editor-tools" data-editor-only="" aria-label="[Accessible description.]"><button class="ld-tool" id="ld-save" type="button">Save</button><button class="ld-tool" id="editor-undo" type="button">Undo</button><button class="ld-tool" id="editor-redo" type="button" disabled="">Redo</button><button class="ld-tool" id="editor-duplicate" type="button" disabled="">Duplicate</button><button class="ld-tool" id="editor-delete" type="button" disabled="">Delete</button><button class="ld-tool" id="editor-bold" type="button" aria-label="Bold" title="Bold" disabled="">B</button><button class="ld-tool" id="editor-italic" type="button" aria-label="Italic" title="Italic" disabled="">I</button><button class="ld-tool" id="editor-underline" type="button" aria-label="Underline" title="Underline" disabled="">U</button><span class="ld-overflow-wrap"><button class="ld-tool" id="editor-overflow-toggle" type="button" aria-expanded="false" aria-controls="editor-overflow-menu" aria-label="More">More</button><span class="ld-overflow-menu" id="editor-overflow-menu"><button class="ld-tool" id="editor-font-up" type="button" aria-label="Increase type" title="Increase type" disabled="">A+</button><button class="ld-tool" id="editor-font-down" type="button" aria-label="Decrease type" title="Decrease type" disabled="">A−</button><button class="ld-tool" id="editor-reset" type="button" disabled="">Reset</button><select class="ld-palette" id="editor-fill-token" aria-label="Fill token" hidden="" disabled=""><option value="">Fill</option><option value="card">card</option><option value="card-strong">card-strong</option><option value="tint">tint</option><option value="bg">bg</option><option value="none">none</option></select><button id="editor-fill-palette" type="button" class="ld-tool" aria-label="[Accessible description.]" aria-haspopup="dialog" aria-expanded="false" disabled="">Fill ▾</button><select class="ld-palette" id="editor-text-token" aria-label="Text token" hidden="" disabled=""><option value="">Text</option><option value="ink">ink</option><option value="muted">muted</option><option value="faint">faint</option><option value="red">red</option><option value="red-strong">red-strong</option></select><button id="editor-text-palette" type="button" class="ld-tool" aria-label="[Accessible description.]" aria-haspopup="dialog" aria-expanded="false" disabled="">Text ▾</button></span></span><button id="editor-add-text" type="button" class="ld-tool" title="Text box">Text box</button><button id="editor-popup" type="button" class="ld-tool" title="Add popup" disabled="">Add popup</button><button id="editor-remove-popup" type="button" class="ld-tool" title="Remove popup" disabled="">Remove popup</button></div><button class="ld-control" id="theme-toggle" type="button" aria-label="Theme" title="Theme"><svg class="ld-theme-icon ld-theme-moon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"></path></svg><svg class="ld-theme-icon ld-theme-sun" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"></path></svg></button><button class="ld-control" id="export-html" type="button" data-editor-only="">Export HTML</button><button class="ld-control" id="export-template" type="button" data-editor-only="">Export template</button></div></header><main class="ld-composed-main" id="legaldesign-composed-root"><div class="ld-page-approach ld-fixed-page" data-approach="a"><section class="ld-composed-section" data-composition-section="section-1" aria-label="[Accessible description.]" data-index-label="[Section topic]"><div class="ld-composed-grid"><section class="ld-unit ld-composed-unit" data-unit="unit-1" data-kind="text" aria-label="[Accessible description.]" data-role="title" style="--ld-row: 1; --ld-column: 1; --ld-span: 12;"><div class="ld-variant" data-variant="a"><div data-variant-body="" data-editable=""><h1 data-placeholder="[Matter or deliverable title.]">[Matter or deliverable title.]</h1></div></div></section><section class="ld-unit ld-composed-unit" data-unit="unit-2" data-kind="text" aria-label="[Accessible description.]" data-role="summary" style="--ld-row: 2; --ld-column: 1; --ld-span: 6;"><div class="ld-variant" data-variant="a"><div data-variant-body="" data-editable=""><h2 data-placeholder="[Section heading.]">[Section heading.]</h2><p data-placeholder="[The claim in one sentence, ending with a period.]">[The claim in one sentence, ending with a period.]</p></div></div></section><section class="ld-unit ld-composed-unit" data-unit="unit-3" data-kind="text" aria-label="[Accessible description.]" data-role="summary" style="--ld-row: 2; --ld-column: 7; --ld-span: 6;"><div class="ld-variant" data-variant="a"><div data-variant-body="" data-editable=""><h2 data-placeholder="[Section heading.]">[Section heading.]</h2><p data-placeholder="[The claim in one sentence, ending with a period.]">[The claim in one sentence, ending with a period.]</p></div></div></section><section class="ld-unit ld-composed-unit" data-unit="unit-4" data-kind="text" aria-label="[Accessible description.]" data-role="answer" style="--ld-row: 3; --ld-column: 1; --ld-span: 12;"><div class="ld-variant" data-variant="a"><div data-variant-body="" data-editable=""><h2 data-placeholder="[Short answer.]">[Short answer.]</h2><p data-placeholder="[Short answer.]">[Short answer.]</p><p class="ld-detail-linkline" data-placeholder="[Short answer.]"><button type="button" class="ld-inline-detail" data-detail="evidence-1" aria-haspopup="dialog">[Short answer.]</button></p></div></div></section><section class="ld-unit ld-composed-unit" data-unit="unit-5" data-kind="figure" aria-label="[Accessible description.]" style="--ld-row: 4; --ld-column: 1; --ld-span: 12;"><h2 class="ld-figure-title" data-editable="">[What this section enables the reader to understand or do.]</h2><div class="ld-variant" data-variant="a"><div data-variant-body="" data-editable=""><div class="ld-diagram" id="diagram-unit-5-a"><svg class="library-viz diagram-viz" viewBox="0 0 880 360" width="100%" role="group" aria-label="[Accessible description.]"><g data-diagram-object="" class="ld-detail" role="button" tabindex="0" aria-haspopup="dialog" aria-controls="evidence-1" data-detail="evidence-1"><rect class="box" x="24" y="88" width="178.66666666666666" height="178" rx="7"></rect><text class="" x="113.33333333333333" y="169" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[Stage name.]" data-param-path="/stages/0/title"><tspan x="113.33333333333333" dy="0">[Stage name.]</tspan></text><text class="sub" x="113.33333333333333" y="189" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[One fact about it, under twenty words.]" data-param-path="/stages/0/sub"><tspan x="113.33333333333333" dy="0">[One fact about it, under</tspan><tspan x="113.33333333333333" dy="14">twenty words.]</tspan></text></g><path class="line" d="M210.66666666666666 177H335.66666666666663"></path><path class="line" d="M335.66666666666663 173L342.66666666666663 177L335.66666666666663 181"></path><text class="edge" x="276.66666666666663" y="138" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[What passes to the next stage.]" data-param-path="/edges/0"><tspan x="276.66666666666663" dy="0">[What passes</tspan><tspan x="276.66666666666663" dy="14">to the next</tspan><tspan x="276.66666666666663" dy="14">stage.]</tspan></text><g data-diagram-object="" class="ld-detail" role="button" tabindex="0" aria-haspopup="dialog" aria-controls="evidence-2" data-detail="evidence-2"><rect class="box" x="350.66666666666663" y="88" width="178.66666666666666" height="178" rx="7"></rect><text class="" x="439.99999999999994" y="169" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[Stage name.]" data-param-path="/stages/1/title"><tspan x="439.99999999999994" dy="0">[Stage name.]</tspan></text><text class="sub" x="439.99999999999994" y="189" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[One fact about it, under twenty words.]" data-param-path="/stages/1/sub"><tspan x="439.99999999999994" dy="0">[One fact about it, under</tspan><tspan x="439.99999999999994" dy="14">twenty words.]</tspan></text></g><path class="line" d="M537.3333333333333 177H662.3333333333333"></path><path class="line" d="M662.3333333333333 173L669.3333333333333 177L662.3333333333333 181"></path><text class="edge" x="603.3333333333333" y="138" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[What passes to the next stage.]" data-param-path="/edges/1"><tspan x="603.3333333333333" dy="0">[What passes</tspan><tspan x="603.3333333333333" dy="14">to the next</tspan><tspan x="603.3333333333333" dy="14">stage.]</tspan></text><g data-diagram-object="" class="ld-detail" role="button" tabindex="0" aria-haspopup="dialog" aria-controls="evidence-3" data-detail="evidence-3"><rect class="box" x="677.3333333333333" y="88" width="178.66666666666666" height="178" rx="7"></rect><text class="" x="766.6666666666666" y="169" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[Stage name.]" data-param-path="/stages/2/title"><tspan x="766.6666666666666" dy="0">[Stage name.]</tspan></text><text class="sub" x="766.6666666666666" y="189" text-anchor="middle" data-diagram-label="" data-editable="" data-placeholder="[One fact about it, under twenty words.]" data-param-path="/stages/2/sub"><tspan x="766.6666666666666" dy="0">[One fact about it, under</tspan><tspan x="766.6666666666666" dy="14">twenty words.]</tspan></text></g></svg></div></div></div></section></div></section></div></main><div class="ld-scrim" id="popup-scrim" hidden=""><div class="pop" id="evidence-1" data-evidence-id="evidence-1" hidden="" data-popup-type="explainer" role="dialog" aria-modal="true" aria-labelledby="evidence-1-title"><button class="ld-popup-close" type="button" aria-label="[Accessible description.]">×</button><h2 data-evidence-field="popup.title" data-editable="" id="evidence-1-title" data-placeholder="[The question or insight this popup explains.]">[The question or insight this popup explains.]</h2><p class="ld-popup-lede" data-evidence-field="popup.lede" data-editable="" data-placeholder="[One-sentence orientation to the deeper detail.]">[One-sentence orientation to the deeper detail.]</p><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.0.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.0.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.1.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.1.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><footer class="ld-popup-source">[Source, version, date retrieved.]</footer></div><div class="pop" id="evidence-2" data-evidence-id="evidence-2" hidden="" data-popup-type="explainer" role="dialog" aria-modal="true" aria-labelledby="evidence-2-title"><button class="ld-popup-close" type="button" aria-label="[Accessible description.]">×</button><h2 data-evidence-field="popup.title" data-editable="" id="evidence-2-title" data-placeholder="[The question or insight this popup explains.]">[The question or insight this popup explains.]</h2><p class="ld-popup-lede" data-evidence-field="popup.lede" data-editable="" data-placeholder="[One-sentence orientation to the deeper detail.]">[One-sentence orientation to the deeper detail.]</p><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.0.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.0.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.1.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.1.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><footer class="ld-popup-source">[Source, version, date retrieved.]</footer></div><div class="pop" id="evidence-3" data-evidence-id="evidence-3" hidden="" data-popup-type="explainer" role="dialog" aria-modal="true" aria-labelledby="evidence-3-title"><button class="ld-popup-close" type="button" aria-label="[Accessible description.]">×</button><h2 data-evidence-field="popup.title" data-editable="" id="evidence-3-title" data-placeholder="[The question or insight this popup explains.]">[The question or insight this popup explains.]</h2><p class="ld-popup-lede" data-evidence-field="popup.lede" data-editable="" data-placeholder="[One-sentence orientation to the deeper detail.]">[One-sentence orientation to the deeper detail.]</p><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.0.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.0.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><section class="ld-popup-section"><h3 data-evidence-field="popup.sections.1.heading" data-editable="" data-placeholder="[Specific subpoint.]">[Specific subpoint.]</h3><p data-evidence-field="popup.sections.1.body" data-editable="" data-placeholder="[The deeper detail the reader needs here.]">[The deeper detail the reader needs here.]</p></section><footer class="ld-popup-source">[Source, version, date retrieved.]</footer></div></div><script id="legaldesign-state" type="application/json">{"schema":"legaldesign.state.v1","artifactId":"legaldesign-template-stacked-explainer","savedAt":"2026-09-07T08:49:26.980Z","brief":{"title":"[Descriptive title for the artifact.]","reader":"[The reader and what they already know.]","action":"[What the reader should decide or do.]","purpose":"understand","message":"[The answer the page should make clear.]","spine":"sequence","situation":"laptop","form":"one-page","sources":[{"id":"source-1","label":"[Source label.]","status":"supplied-unverified"}],"assumptions":[],"gaps":["[Known gap or unresolved point.]"]},"units":{"unit-1":{"kind":"text","selected":"a","role":"title","claim":"[The claim in one sentence, ending with a period.]","relationship":"containment","candidates":["[Candidate visual treatment.]","[Candidate visual treatment.]"],"claimRefs":["claim-1"],"evidence":[],"variants":{"a":{"html":"[The claim in one sentence, ending with a period.]","axis":"framing","encoding":"[How position, direction, grouping, scale, or contrast expresses the relationship.]","why":"[Why this treatment fits the reader and purpose.]"}},"edits":{"a":null},"placeholder":"[The claim in one sentence, ending with a period.]"},"unit-2":{"kind":"text","selected":"a","role":"summary","claim":"[The claim in one sentence, ending with a period.]","relationship":"containment","candidates":["[Candidate visual treatment.]","[Candidate visual treatment.]"],"claimRefs":["claim-5"],"evidence":[],"variants":{"a":{"html":"[The claim in one sentence, ending with a period.]","axis":"framing","encoding":"[How position, direction, grouping, scale, or contrast expresses the relationship.]","why":"[Why this treatment fits the reader and purpose.]"}},"edits":{"a":null},"placeholder":"[The claim in one sentence, ending with a period.]"},"unit-3":{"kind":"text","selected":"a","role":"summary","claim":"[The claim in one sentence, ending with a period.]","relationship":"containment","candidates":["[Candidate visual treatment.]","[Candidate visual treatment.]"],"claimRefs":["claim-5"],"evidence":[],"variants":{"a":{"html":"[The claim in one sentence, ending with a period.]","axis":"framing","encoding":"[How position, direction, grouping, scale, or contrast expresses the relationship.]","why":"[Why this treatment fits the reader and purpose.]"}},"edits":{"a":null},"placeholder":"[The claim in one sentence, ending with a period.]"},"unit-4":{"kind":"text","selected":"a","role":"answer","claim":"[Short answer.]","relationship":"containment","candidates":["[Candidate visual treatment.]","[Candidate visual treatment.]"],"claimRefs":["claim-2"],"evidence":["evidence-1"],"detail":"evidence-1","variants":{"a":{"html":"[Short answer.]","axis":"framing","encoding":"[How position, direction, grouping, scale, or contrast expresses the relationship.]","why":"[Why this treatment fits the reader and purpose.]"}},"edits":{"a":null},"placeholder":"[Short answer.]"},"unit-5":{"kind":"figure","selected":"a","claim":"[What this section enables the reader to understand or do.]","relationship":"sequence","candidates":["[Candidate visual treatment.]","[Candidate visual treatment.]"],"claimRefs":["claim-2","claim-3","claim-4"],"evidence":["evidence-1","evidence-2","evidence-3"],"variants":{"a":{"component":"flow","params":{"stages":[{"title":"[Stage name.]","sub":"[One fact about it, under twenty words.]","detail":"evidence-1"},{"title":"[Stage name.]","sub":"[One fact about it, under twenty words.]","detail":"evidence-2"},{"title":"[Stage name.]","sub":"[One fact about it, under twenty words.]","detail":"evidence-3"}],"edges":["[What passes to the next stage.]","[What passes to the next stage.]"]},"axis":"form","encoding":"[How position, direction, grouping, scale, or contrast expresses the relationship.]","why":"[Why this treatment fits the reader and purpose.]"}},"edits":{"a":null},"placeholder":"[What this section enables the reader to understand or do.]"}},"evidence":{"evidence-1":{"cite":"[Citation or record label.]","locator":"[Section and page.]","excerpt":"[Verbatim excerpt of the controlling clause, in the document's words.]","link":null,"status":"supplied-unverified","sourceId":"source-1","claimRefs":["claim-2"],"detail":"[What this source establishes, in one sentence.]","popup":{"type":"explainer","title":"[The question or insight this popup explains.]","sections":[{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"},{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"}],"lede":"[One-sentence orientation to the deeper detail.]"},"original":{"availability":"unavailable","label":"[Original source label.]"},"image":{"status":"[Clip of the source page with the cited passage highlighted.]"},"provenance":"[Source, version, and retrieval note.]"},"evidence-2":{"cite":"[Citation or record label.]","locator":"[Section and page.]","excerpt":"[Verbatim excerpt of the controlling clause, in the document's words.]","link":null,"status":"supplied-unverified","sourceId":"source-1","claimRefs":["claim-3"],"detail":"[What this source establishes, in one sentence.]","popup":{"type":"explainer","title":"[The question or insight this popup explains.]","sections":[{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"},{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"}],"lede":"[One-sentence orientation to the deeper detail.]"},"original":{"availability":"unavailable","label":"[Original source label.]"},"image":{"status":"[Clip of the source page with the cited passage highlighted.]"},"provenance":"[Source, version, and retrieval note.]"},"evidence-3":{"cite":"[Citation or record label.]","locator":"[Section and page.]","excerpt":"[Verbatim excerpt of the controlling clause, in the document's words.]","link":null,"status":"supplied-unverified","sourceId":"source-1","claimRefs":["claim-4"],"detail":"[What this source establishes, in one sentence.]","popup":{"type":"explainer","title":"[The question or insight this popup explains.]","sections":[{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"},{"heading":"[Specific subpoint.]","body":"[The deeper detail the reader needs here.]"}],"lede":"[One-sentence orientation to the deeper detail.]"},"original":{"availability":"unavailable","label":"[Original source label.]"},"image":{"status":"[Clip of the source page with the cited passage highlighted.]"},"provenance":"[Source, version, and retrieval note.]"}},"review":{"decisions":{},"theme":"light","location":null},"history":[],"sourceSchemaVersion":"legaldesign.build.v4","style":{"source":"template","ref":null},"composition":{"strategy":"composed","shape":"[The section sequence and reading path.]","rationale":"[Why this composition best communicates the core relationship.]","sections":[{"id":"section-1","purpose":"[What this section enables the reader to understand or do.]","unitIds":["unit-1","unit-2","unit-3","unit-4","unit-5"],"layout":{"columns":12,"placements":[{"unitId":"unit-1","row":1,"column":1,"span":12},{"unitId":"unit-2","row":2,"column":1,"span":6},{"unitId":"unit-3","row":2,"column":7,"span":6},{"unitId":"unit-4","row":3,"column":1,"span":12},{"unitId":"unit-5","row":4,"column":1,"span":12}]}}],"templateRef":null},"overview":{"sectionId":"section-1","contextUnitIds":["unit-2"],"questionUnitId":"unit-3","answerUnitId":"unit-4","topics":[]},"claims":[{"id":"claim-1","text":"[Context the reader needs.]","kind":"context","sourceIds":["source-1"],"placement":"surface","evidenceIds":[]},{"id":"claim-2","text":"[Material claim the artifact communicates.]","kind":"material","sourceIds":["source-1"],"placement":"surface","evidenceIds":["evidence-1"]},{"id":"claim-3","text":"[Material claim the artifact communicates.]","kind":"material","sourceIds":["source-1"],"placement":"surface","evidenceIds":["evidence-2"]},{"id":"claim-4","text":"[Material claim the artifact communicates.]","kind":"material","sourceIds":["source-1"],"placement":"surface","evidenceIds":["evidence-3"]},{"id":"claim-5","text":"[Context the reader needs.]","kind":"context","sourceIds":["source-1"],"placement":"surface","evidenceIds":[]}]}</script></body></html>SHA-256: 436b94e2bf18baabd5dec8decf36305a7d76cb92b0ccec13ac862d6b333cb280