@diagrammo/dgmo-standalone 0.69.0 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto.js +4 -4
- package/dist/element.js +4 -4
- package/package.json +1 -1
package/dist/auto.js
CHANGED
|
@@ -19,7 +19,7 @@ Georgia heat: 2`},CLOCK_TZ_INVALID:{code:"W_MAP_CLOCK_TZ_INVALID",severity:"warn
|
|
|
19
19
|
poi Tokyo clock`},CLOCK_TZ_NEEDED:{code:"W_MAP_CLOCK_TZ_NEEDED",severity:"warning",chartType:"map",title:"Clock pin needs a time zone",message:()=>"This `clock` pin has no known time zone \u2014 a named city derives its zone automatically, but a bare-coordinate pin needs a valued `clock: <zone>` (e.g. `clock: America/Denver` or `clock: UTC-7`). Rendered without a time card.",hint:"Name the zone with `clock: <IANA/zone>` \u2014 coordinate pins can\u2019t derive one on their own.",example:`map
|
|
20
20
|
poi 39.74 -104.98 as Field clock: America/Denver`},CLOCK_TZ_OVERRIDE:{code:"W_MAP_CLOCK_TZ_OVERRIDE",severity:"warning",chartType:"map",title:"Time zone overrides the city",message:t=>`\`clock: ${t.name??""}\` overrides this city's actual zone (${t.tz??""}) \u2014 using your value. Use a bare \`clock\` to take the city's real zone.`,hint:"A named city derives its own zone \u2014 use a bare `clock` unless you mean to override it.",example:`map
|
|
21
21
|
poi Denver clock`},DATA_NOT_SUPPLIED:{code:"E_MAP_DATA_NOT_SUPPLIED",severity:"error",chartType:"map",title:"No map data supplied",message:t=>t.reason?`This map's basemap data could not be loaded, so nothing was drawn. The loader reported: ${t.reason}`:"This map has no basemap data. `render()` reads nothing from disk or the network on its own \u2014 pass `mapData`, either the bundled assets or a loader that returns them.",hint:"In Node: `render(src, { mapData: loadMapData })` with `loadMapData` from `@diagrammo/dgmo/advanced`. In a browser or Worker: pass your bundled `MapData`. If you already do, the assets are missing from the installed package rather than from your code.",example:`map
|
|
22
|
-
Denver heat: 2`}},S6t=Object.values(oo)});function Rp(t){return Object.prototype.hasOwnProperty.call(hk,t.toLowerCase())}function Re(t,e){if(!t||t.startsWith("#"))return null;let n=t.toLowerCase();if(!Rp(n))return null;if(e){let r=e.colors[n];if(r)return r}return hk[n]??null}function yk(t){let e=gk[t.trim().toLowerCase()];e&&(t=e);let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t.trim());if(!n)return null;let r=n[1].toLowerCase();r.length===3&&(r=r.split("").map(g=>g+g).join(""));let o=parseInt(r.slice(0,2),16)/255,a=parseInt(r.slice(2,4),16)/255,i=parseInt(r.slice(4,6),16)/255,s=Math.max(o,a,i),l=Math.min(o,a,i),c=s-l,d=(s+l)/2;if((c===0?0:c/(1-Math.abs(2*d-1)))<.15)return d<.2?"black":d>.85?"white":"gray";let f;s===o?f=60*((a-i)/c%6):s===a?f=60*((i-o)/c+2):f=60*((o-a)/c+4),f<0&&(f+=360);let m=[["red",0],["orange",30],["yellow",55],["green",120],["teal",170],["cyan",190],["blue",225],["purple",285],["red",360]],p="red",h=1/0;for(let[g,x]of m){let y=Math.abs(f-x);y<h&&(h=y,p=g)}return p}function nU(t){if(/^(#|rgba?\(|hsla?\()/i.test(t))return!0;let e=t.toLowerCase();return gk[e]!==void 0&&!Rp(e)}function bk(t,e){if(!nU(t))return null;let n=yk(t),r=n?` Nearest: ${n}.`:"";return At(e,`Color "${t}" is not a valid DGMO color \u2014 DGMO accepts only these 11 named colors: ${ua.join(", ")} (no hex, no CSS color names).${r}`,"warning",Ky)}function Yn(t,e,n,r){let o=Re(t,r);if(o!==null)return o;if(/^(#|rgba?\(|hsla?\()/i.test(t)){let s=yk(t),l=s?` Nearest: ${s}.`:"";n.push(At(e,`Color "${t}" is not supported \u2014 DGMO does not accept hex or CSS color values. Use a named palette color: ${ua.join(", ")}.${l}`,"error",Ky));return}let a=xe(t,ua),i=a?` ${a}`:"";n.push(At(e,`Unknown color "${t}". DGMO accepts only these 11 named colors: ${ua.join(", ")} (no hex, no CSS color names).${i}`,"warning",Ky))}var Hr,hk,ua,oc,Ky,gk,L6t,rr=dt(()=>{"use strict";Je();Hr={nord0:"#2e3440",nord1:"#3b4252",nord2:"#434c5e",nord3:"#4c566a",nord4:"#d8dee9",nord5:"#e5e9f0",nord6:"#eceff4",nord7:"#8fbcbb",nord8:"#88c0d0",nord9:"#81a1c1",nord10:"#5e81ac",nord11:"#bf616a",nord12:"#d08770",nord13:"#ebcb8b",nord14:"#a3be8c",nord15:"#b48ead"},hk={red:Hr.nord11,orange:Hr.nord12,yellow:Hr.nord13,green:Hr.nord14,blue:Hr.nord10,purple:Hr.nord15,teal:Hr.nord7,cyan:Hr.nord8,gray:Hr.nord3,black:Hr.nord0,white:Hr.nord6},ua=Object.freeze(["red","orange","yellow","green","blue","purple","teal","cyan","gray","black","white"]),oc=Object.freeze(["red","green","blue","yellow","teal","purple","orange","cyan"]);Ky="E_INVALID_COLOR",gk=Object.freeze({pink:"#ffc0cb",hotpink:"#ff69b4",deeppink:"#ff1493",lightpink:"#ffb6c1",palevioletred:"#db7093",crimson:"#dc143c",scarlet:"#ff2400",firebrick:"#b22222",darkred:"#8b0000",maroon:"#800000",salmon:"#fa8072",lightsalmon:"#ffa07a",darksalmon:"#e9967a",coral:"#ff7f50",lightcoral:"#f08080",tomato:"#ff6347",orangered:"#ff4500",darkorange:"#ff8c00",gold:"#ffd700",goldenrod:"#daa520",darkgoldenrod:"#b8860b",khaki:"#f0e68c",darkkhaki:"#bdb76b",amber:"#ffbf00",lavender:"#e6e6fa",violet:"#ee82ee",magenta:"#ff00ff",fuchsia:"#ff00ff",orchid:"#da70d6",plum:"#dda0dd",indigo:"#4b0082",navy:"#000080",midnightblue:"#191970",darkblue:"#00008b",mediumblue:"#0000cd",royalblue:"#4169e1",cornflowerblue:"#6495ed",dodgerblue:"#1e90ff",deepskyblue:"#00bfff",skyblue:"#87ceeb",lightskyblue:"#87cefa",lightblue:"#add8e6",powderblue:"#b0e0e6",steelblue:"#4682b4",slateblue:"#6a5acd",cadetblue:"#5f9ea0",turquoise:"#40e0d0",aqua:"#00ffff",aquamarine:"#7fffd4",lime:"#00ff00",limegreen:"#32cd32",lightgreen:"#90ee90",palegreen:"#98fb98",seagreen:"#2e8b57",mediumseagreen:"#3cb371",forestgreen:"#228b22",darkgreen:"#006400",olive:"#808000",olivedrab:"#6b8e23",darkolivegreen:"#556b2f",chartreuse:"#7fff00",lawngreen:"#7cfc00",springgreen:"#00ff7f",greenyellow:"#adff2f",brown:"#a52a2a",sienna:"#a0522d",chocolate:"#d2691e",peru:"#cd853f",tan:"#d2b48c",beige:"#f5f5dc",wheat:"#f5deb3",ivory:"#fffff0",silver:"#c0c0c0",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",dimgray:"#696969",dimgrey:"#696969",slategray:"#708090",slategrey:"#708090",gainsboro:"#dcdcdc",grey:"#808080"});L6t=[Hr.nord10,Hr.nord14,Hr.nord13,Hr.nord12,Hr.nord15,Hr.nord11,Hr.nord7,Hr.nord8]});function Ma(t){let e=new Set;for(let n of rU)t(n)&&e.add(n.token);return e}var rU,xk,wk,Ek,kk,Sk,Mk,vk,Lk,Ck,Nk,Tk,_k,N6t,tl=dt(()=>{"use strict";rU=[{token:"year",category:"directive"},{token:"date-order",category:"directive"},{token:"no-current-year",category:"directive"},{token:"slo-availability",category:"directive",infra:["top-level","behavior"]},{token:"slo-p90-latency-ms",category:"directive",infra:["top-level","behavior"]},{token:"slo-warning-margin",category:"directive",infra:["top-level","behavior"]},{token:"default-latency-ms",category:"directive",infra:["top-level"]},{token:"default-uptime",category:"directive",infra:["top-level"]},{token:"default-rps",category:"directive",infra:["top-level"]},{token:"latency-ms",colonKey:!0,infra:["behavior"]},{token:"uptime",colonKey:!0,infra:["behavior"]},{token:"instances",colonKey:!0,infra:["behavior"]},{token:"max-rps",colonKey:!0,infra:["behavior"]},{token:"cache-hit",colonKey:!0,infra:["behavior"]},{token:"firewall-block",colonKey:!0,infra:["behavior"]},{token:"ratelimit-rps",colonKey:!0,infra:["behavior"]},{token:"buffer",colonKey:!0,infra:["behavior"]},{token:"drain-rate",colonKey:!0,infra:["behavior"]},{token:"retention-hours",colonKey:!0,infra:["behavior"]},{token:"partitions",colonKey:!0,infra:["behavior"]},{token:"concurrency",colonKey:!0,infra:["behavior"]},{token:"duration-ms",colonKey:!0,infra:["behavior"]},{token:"cold-start-ms",colonKey:!0,infra:["behavior"]},{token:"cb-error-threshold",colonKey:!0,infra:["behavior"]},{token:"cb-latency-threshold-ms",colonKey:!0,infra:["behavior"]},{token:"rps",colonKey:!0,infra:["edge"]},{token:"start",category:"directive",gantt:["option"]},{token:"today-marker",category:"directive",gantt:["option","boolean"]},{token:"critical-path",category:"directive",gantt:["option","boolean"]},{token:"sprint-length",category:"directive",gantt:["option"]},{token:"sprint-number",category:"directive",gantt:["option"]},{token:"sprint-start",category:"directive",gantt:["option"]},{token:"fill-tint",category:"directive",gantt:["boolean"]},{token:"fill-solid",category:"directive",gantt:["boolean"]},{token:"fill-outline",category:"directive",gantt:["boolean"]},{token:"chart",category:"control",gantt:["option"]},{token:"dependencies",noHighlight:!0,gantt:["option","boolean"]},{token:"region-heat",category:"directive",map:!0},{token:"poi-size",category:"directive",map:!0},{token:"flow-width",category:"directive",map:!0},{token:"locale",category:"directive",map:!0},{token:"caption",category:"directive",map:!0},{token:"no-coastline",category:"directive",map:!0},{token:"no-relief",category:"directive",map:!0},{token:"no-context-labels",category:"directive",map:!0},{token:"no-region-labels",category:"directive",map:!0},{token:"no-region-heat-value",category:"directive",map:!0},{token:"no-poi-labels",category:"directive",map:!0},{token:"no-colorize",category:"directive",map:!0},{token:"no-cities",category:"directive",map:!0},{token:"no-cluster-pois",category:"directive",map:!0},{token:"hours",category:"directive",map:!0},{token:"days",category:"directive",map:!0},{token:"active-tag",category:"directive",infra:["top-level"],gantt:["option"],map:!0},{token:"title",category:"directive",gantt:["option"]},{token:"sort",category:"directive",gantt:["option"]},{token:"lane-by",category:"directive",gantt:["option"]},{token:"no-title",category:"directive",gantt:["boolean"],map:!0},{token:"no-legend",category:"directive",gantt:["boolean"],map:!0},{token:"legend-inline",category:"directive",gantt:["boolean"],map:!0},{token:"era",category:"directive"},{token:"marker",category:"directive"},{token:"holiday",category:"directive"},{token:"workweek",category:"directive",map:!0},{token:"no-dependencies",category:"directive"},{token:"rings",category:"directive"},{token:"no-blip-legend",category:"directive"},{token:"show-blip-legend",category:"directive"},{token:"trend",category:"directive"},{token:"tags",category:"directive"},{token:"import",category:"directive"},{token:"hide",category:"directive"},{token:"focus",category:"directive"},{token:"direction",category:"directive"},{token:"analog",category:"directive"},{token:"hours",category:"directive"},{token:"days",category:"directive"},{token:"no-sun",category:"directive"},{token:"time-24",category:"directive"},{token:"color-by",category:"directive"},{token:"show-values",category:"directive"},{token:"no-values",category:"directive"},{token:"lane",category:"directive"},{token:"notation",category:"directive"},{token:"extends",category:"directive"},{token:"implements",category:"directive"},{token:"abstract",category:"directive"},{token:"interface",category:"directive"},{token:"enum",category:"directive"},{token:"containers",category:"directive"},{token:"components",category:"directive"},{token:"deployment",category:"directive"},{token:"technology",category:"directive"},{token:"sub-node-label",category:"directive"},{token:"show-sub-node-count",category:"directive"},{token:"animate",category:"directive"},{token:"activations",category:"directive"},{token:"no-activations",category:"directive"},{token:"poi",category:"directive"},{token:"route",category:"directive"},{token:"stacked",category:"directive"},{token:"no-name",category:"directive"},{token:"no-value",category:"directive"},{token:"no-percent",category:"directive"},{token:"series",category:"directive"},{token:"orientation",category:"directive"},{token:"x-label",category:"directive"},{token:"y-label",category:"directive"},{token:"size-label",category:"directive"},{token:"columns",category:"directive"},{token:"rows",category:"directive"},{token:"labels",category:"directive"},{token:"rotate",category:"directive"},{token:"scale",category:"directive"},{token:"values",category:"directive"},{token:"orientation-horizontal",category:"directive"},{token:"period",category:"directive"},{token:"x-axis",category:"directive"},{token:"y-axis",category:"directive"},{token:"top-right",category:"directive"},{token:"top-left",category:"directive"},{token:"bottom-right",category:"directive"},{token:"bottom-left",category:"directive"},{token:"direction-tb",category:"directive"},{token:"direction-lr",category:"directive"},{token:"orientation-vertical",category:"directive"},{token:"inverted",category:"directive"},{token:"color",category:"directive"},{token:"no-notes",category:"directive"},{token:"highlight",category:"directive"},{token:"dim",category:"directive"},{token:"roles",category:"directive"},{token:"direction-counterclockwise",category:"directive"},{token:"circle-nodes",category:"directive"},{token:"persona",category:"directive"},{token:"x",category:"directive"},{token:"fill",category:"directive"},{token:"max",category:"directive"},{token:"size",category:"directive"},{token:"order",category:"directive"},{token:"time-unit",category:"directive"},{token:"default-confidence",category:"directive"},{token:"node-detail",category:"directive"},{token:"trials",category:"directive"},{token:"seed",category:"directive"},{token:"scrubber-trials",category:"directive"},{token:"start-date",category:"directive",gantt:["option"]},{token:"end-date",category:"directive"},{token:"thermometer",category:"directive"},{token:"gauge",category:"directive"},{token:"now",category:"directive"},{token:"target",category:"directive"},{token:"no-note",category:"directive"},{token:"no-auto-color",category:"directive"},{token:"if",category:"control"},{token:"else",category:"control"},{token:"loop",category:"control"},{token:"parallel",category:"control"},{token:"note",category:"control"},{token:"nav",category:"control"},{token:"tabs",category:"control"},{token:"table",category:"control"},{token:"image",category:"control"},{token:"modal",category:"control"},{token:"skeleton",category:"control"},{token:"alert",category:"control"},{token:"progress",category:"control"},{token:"mobile",category:"control"},{token:"na",category:"status"},{token:"todo",category:"status"},{token:"wip",category:"status"},{token:"done",category:"status"},{token:"blocked",category:"status"},{token:"in-progress",category:"status"},{token:"backlog",category:"status"},{token:"ready",category:"status"},{token:"collapsed",category:"modifier"},{token:"as",category:"modifier"},{token:"alias",category:"modifier"},{token:"aka",category:"modifier"},{token:"position",category:"modifier"},{token:"default",category:"modifier"},{token:"pk",category:"modifier"},{token:"fk",category:"modifier"},{token:"nullable",category:"modifier"},{token:"unique",category:"modifier"},{token:"int",category:"modifier"},{token:"varchar",category:"modifier"},{token:"text",category:"modifier"},{token:"boolean",category:"modifier"},{token:"date",category:"modifier"},{token:"timestamp",category:"modifier"},{token:"float",category:"modifier"},{token:"decimal",category:"modifier"},{token:"beats",category:"control"},{token:"vs",category:"control"},{token:"rounds",category:"directive"},{token:"accent",category:"directive"},{token:"no-round",category:"modifier"},{token:"no-rounds",category:"modifier"},{token:"single-elim",category:"modifier"},{token:"double-elim",category:"modifier"},{token:"seeded",category:"modifier"},{token:"url",category:"directive"}];xk=Ma(()=>!0),wk=Ma(t=>!!t.infra?.includes("top-level")),Ek=Ma(t=>!!t.infra?.includes("behavior")),kk=Ma(t=>!!t.infra?.includes("edge")),Sk=Ma(t=>!!t.gantt?.includes("option")),Mk=Ma(t=>!!t.gantt?.includes("boolean")),vk=Ma(t=>t.map===!0),Lk=Ma(t=>t.category==="directive"&&!t.colonKey&&!t.noHighlight),Ck=Ma(t=>t.category==="control"&&!t.colonKey&&!t.noHighlight),Nk=Ma(t=>t.category==="status"&&!t.colonKey&&!t.noHighlight),Tk=Ma(t=>t.category==="modifier"&&!t.colonKey&&!t.noHighlight),_k=Ma(t=>!!t.colonKey),N6t=Ma(t=>!!t.noHighlight)});var Ak,Lf,Ip,Cf=dt(()=>{"use strict";Ak=[{id:"journey-map",description:"User experience flow with emotion scores, phases, and annotations"},{id:"c4",description:"System architecture (context, container, component, deployment)"},{id:"er",description:"Database schemas and relationships"},{id:"class",description:"UML class hierarchies"},{id:"sequence",description:"Message request and response interaction flows",fallback:!0},{id:"state",description:"State machine / lifecycle transitions"},{id:"infra",description:"Infrastructure traffic flow with RPS computation"},{id:"gantt",description:"Project scheduling with task dependencies and milestones"},{id:"pert",description:"Project network with three-point estimates, critical path, and uncertainty (Beta-PERT, Monte Carlo)"},{id:"swimlane",description:"Cross-functional process flow with lanes, phases and gateways (BPMN-style)"},{id:"version-control",description:"Git / version-control branch-and-merge graph: commits, branches, merges, rebase, HEAD and remote-tracking (gitGraph-style)"},{id:"timeline",description:"Events, eras, and date ranges"},{id:"event-line",description:"Annotated narrative timeline \u2014 events on a horizontal line with descriptions (not the date-scaled timeline)"},{id:"body",description:"Human anatomy figure annotated by muscle/bone/joint name \u2014 for medical, exercise, and educational diagrams"},{id:"org",description:"Reporting hierarchy"},{id:"family",description:"Family tree / genealogy: unions (couples), children, remarriage, adoption, and GEDCOM-style metadata"},{id:"sitemap",description:"Site / app navigation structure"},{id:"bracket",description:"Single-elimination tournament bracket: winners auto-advance up a tree; seed the field for a day-0 skeleton or list results for a casual bracket, with two sides mirroring inward to a championship"},{id:"kanban",description:"Task board columns"},{id:"raci",description:"Tasks \xD7 roles responsibility matrix with constraint linting"},{id:"tech-radar",description:"Technology adoption quadrants (adopt/trial/assess/hold)"},{id:"mindmap",description:"Radial hierarchy of ideas branching from a central topic"},{id:"wireframe",description:"Low-fidelity UI layout with panels, controls, and annotations"},{id:"cycle",description:"Cyclical process visualization (PDCA, OODA, DevOps loops)"},{id:"pyramid",description:"Stacked hierarchy of layers with descriptions (Maslow, DIKW)"},{id:"ring",description:"Concentric rings showing nested or hierarchical categories (read core-out)"},{id:"treemap",description:"Nested rectangles sized by value \u2014 show a hierarchy\u2019s proportions (budgets, disk usage, portfolios) with color by category, value heatmap, or branch"},{id:"block",description:"Block diagram: an author-controlled grid of rectangular blocks with nested, collapsible containers \u2014 system/hardware/architecture layouts where the 2-D arrangement is the meaning"},{id:"sketch",description:"GUI-first constrained canvas: uniformly-sized shapes placed freely on a snap grid, arrows between them, meaning through tags \u2014 the markup is generated by the canvas editor"},{id:"goal",description:"Single progress-toward-a-target value (now vs target) as a progress bar, thermometer, or gauge \u2014 KPIs, fundraising, quotas, completion"},{id:"countdown",description:'Live "N days until X" that ticks every second and is accurate on every load \u2014 trip dates, launches, deadlines; the only dynamic chart type'},{id:"clock",description:"Live world-clock board: current time for people/places across time zones, ticking every second, with optional working-hours status and sundown line"},{id:"map",description:"Geographic concept map: highlight/score regions, drop points of interest, connect with routes or edges"},{id:"quadrant",description:"2x2 positioning matrix"},{id:"venn",description:"Set overlaps"},{id:"funnel",description:"Conversion pipeline"},{id:"slope",description:"Change between 2 time periods"},{id:"sankey",description:"Flow / allocation visualization"},{id:"arc",description:"Network relationships (linear or circular via `layout`)"},{id:"wordcloud",description:"Term frequency visualization"},{id:"heatmap",description:"Matrix intensity visualization"},{id:"function",description:"Mathematical expressions"},{id:"bar",description:"Categorical comparisons for 3 - 5 figures",fallback:!0},{id:"line",description:"Trends over time",fallback:!0},{id:"pie",description:"Part-to-whole proportions"},{id:"radar",description:"Multi-dimensional metrics"},{id:"polar-area",description:"Radial bar chart"},{id:"scatter",description:"2D data points or bubble chart"},{id:"flowchart",description:"Decision trees and process flows",fallback:!0},{id:"boxes-and-lines",description:"General-purpose node-edge diagrams with groups and tags",fallback:!0},{id:"live-link",description:"A pointer to a diagram published at Diagrammo Cloud",internal:!0}],Lf=Ak,Ip=Ak.map(t=>t.id)});function Rr(t){return{keys:new Set(t),tagAliases:new Set}}function Xe(t,e){let n=new Set(e);for(let r of e)n.add(oU(r));return{keys:t.keys,tagAliases:n}}function oU(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Di(t,e){return t.keys.has(e)||t.tagAliases.has(e)}var Zy,ld,Rk,Ik,cd,Pk,Dk,Qy,Jy,ac,Ok,Pp,tb,$k,Nf,Gk,Tf,_f,qk,eb,nb,Bk,rb,ob,ab,Sr=dt(()=>{"use strict";Zy=Rr(["color","description","role","collapsed","position"]),ld=Rr(["color","description","collapsed","icon"]),Rk=Rr(["heat","size","width","label","style","clock"]),Ik=Rr(["color","description","role","location","email","phone"]),cd=Rr(["color","description","tech","type","collapsed"]),Pk=Rr(["color","description","domain"]),Dk=Rr(["color"]),Qy=Rr(["color","description","wip","assignee","due","collapsed"]),Jy=Rr(["color","description","status"]),ac=Rr(["color","description","duration","offset","progress","start","collapsed"]),Ok=Rr(["color","description","confidence","collapsed"]),Pp=Rr(["color","description","heat"]),tb=Rr([]),$k=Rr(["shape","at","collapsed"]),Nf=Rr(["color","description","duration"]),Gk=Rr(["color","description","collapsed"]),Tf=Rr(["color","description","quadrant","ring","trend"]),_f=Rr(["color","description","width","span"]),qk=Rr(["color","description","score","emotion","pain","opportunity","thought"]),eb=Rr(["color","description"]),nb=Rr(["color","description"]),Bk=Rr(["heat"]),rb=Rr(["color","description"]),ob=Rr(["sex","b","d","bp","dp","occupation","military","education","religion","burial"]),ab=Rr(["m"])});function me(t){let e=0;for(let n of t)if(n===" ")e++;else if(n===" ")e+=4;else break;return e}function ye(t,e,n,r){let o=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(o<0)return{label:t};let a=t.substring(o+1);if(!ib.has(a)){if(n&&r!==void 0){let s=bk(a,r);s&&n.push(s)}return{label:t}}let i;return n&&r!==void 0?i=Yn(a,r,n,e):i=Re(a,e)??void 0,{label:t.substring(0,o).trimEnd(),...i!==void 0&&{color:i}}}function or(t){return t["no-legend"]==="on"}function vo(t){return t["legend-inline"]==="on"}function Gr(t){switch(t.trim().toLowerCase()){case"fill-solid":return"solid";case"fill-outline":return"outline";case"fill-tint":return"tint";default:return null}}function mn(t){if(t["fill-solid"]==="on")return"solid";if(t["fill-outline"]==="on")return"outline"}function aU(t){let e=t.trim().toLowerCase();return Af.has(e)?e:null}function ar(t,e){let n=aU(t);if(n){if(oa.has(n))for(let r of oa)delete e[r];return e[n]="on",!0}return!1}function Ce(t){let e=t.trim();if(!e||e.startsWith("//"))return null;let n=e.indexOf(" ");if(n===-1){let o=e.toLowerCase();return el.has(o)?{chartType:o,title:void 0}:null}let r=e.substring(0,n).toLowerCase();return el.has(r)?{chartType:r,title:e.substring(n+1).trim()||void 0}:null}function Dp(t,e){let n=t.trim();if(!n||n.includes(":"))return null;let r=n.indexOf(" "),o=r===-1?n:n.substring(0,r);if(!iU.test(o))return null;let a=o.toLowerCase();if(e.has(a)||xk.has(a))return null;if(r===-1)return/\d/.test(o)?null:o;let i=n.substring(r+1).trim();return!i||!sU.test(i)?null:o}function Vo(t){if(!t.includes(",")&&!t.includes("_")||t.includes(",")&&t.includes("_"))return null;let e="",n=t;return n.startsWith("-")&&(e="-",n=n.substring(1)),n?n.includes(",")?/^\d{1,3}(,\d{3})+$/.test(n)?e+n.replace(/,/g,""):/^\d{1,3}(,\d{3})+\.\d+$/.test(n)?e+n.replace(/,/g,""):null:/^\d+(_\d+)+$/.test(n)?e+n.replace(/_/g,""):/^\d+(_\d+)*\.\d+$/.test(n)&&n.includes("_")?e+n.replace(/_/g,""):null:null}function fa(t){return t.length>=2&&(t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'")?t.substring(1,t.length-1):t}function bn(t){let e=t.trim();if(e.length<2)return t;let n=e[0],r=e[e.length-1];if((n!=='"'||r!=='"')&&(n!=="'"||r!=="'"))return t;let o=e.slice(1,-1);return o.length===0||o.includes(n)?t:o}function nl(t){let e=[],n=0;for(;n<t.length;){if(t[n]===" "||t[n]===" "){n++;continue}if(t[n]==='"'||t[n]==="'"){let o=t[n],a=n;for(n++;n<t.length&&t[n]!==o;)n++;n<t.length&&n++,e.push(t.substring(a,n));continue}let r=n;for(;n<t.length&&t[n]!==" "&&t[n]!==" ";)n++;e.push(t.substring(r,n))}return e}function ks(t,e){let n=[],r=[],o=e+1;for(;o<t.length;o++){let a=t[o],i=a.trim();if(i&&!i.startsWith("//")){if(a[0]!==" "&&a[0]!==" ")break;n.push(i.replace(/,\s*$/,"")),r.push(o+1)}}return{values:n,lineNumbers:r,newIndex:o-1}}function dd(t,e,n,r,o){let a,i,s=n,l=[];if(t)i=t,a=t.split(",").map(f=>f.trim()).filter(Boolean),l=a.map(()=>n+1);else{let f=ks(e,n);s=f.newIndex,a=f.values,l=f.lineNumbers,i=a.join(", ")}let c=f=>{let m=f.split(/\s+/,1)[0];return m==="y-label"?"left":m==="y-right-label"?"right":null};if(a.some(f=>c(f)!==null)){let f=[],m=[],p=[],h=[],g,x,y="left";for(let b=0;b<a.length;b++){let w=a[b],k=c(w);if(k!==null){let v=w.slice(w.indexOf(" ")+1).trim();y=k,k==="left"?g=v||g:x=v||x;continue}let C=ye(w,r,o,l[b]);f.push(C.label),m.push(C.color),p.push(y),h.push(l[b])}return{series:f.join(", "),names:f,nameColors:m,nameLineNumbers:h,newIndex:s,axes:p,...g!==void 0&&{leftLabel:g},...x!==void 0&&{rightLabel:x}}}let d=[],u=[];for(let f=0;f<a.length;f++){let m=a[f],p=ye(m,r,o,l[f]);u.push(p.color),d.push(p.label)}return d.length===1&&(i=d[0]),{series:i,names:d,nameColors:u,nameLineNumbers:l,newIndex:s}}function Oi(t){let e=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(e<0)return{label:t};let n=t.substring(e+1);return ib.has(n)?{label:t.substring(0,e).trimEnd(),colorName:n}:{label:t}}function $i(t){let e=t.trimEnd();return e==="collapsed"?{rest:"",collapsed:!0}:/[ \t]collapsed$/.test(e)?{rest:e.slice(0,e.length-9).trimEnd().replace(/,\s*$/,""),collapsed:!0}:{rest:t,collapsed:!1}}function ud(t){let e=o=>{let a=Math.max(o.lastIndexOf(" "),o.lastIndexOf(" "));if(a<0)return{rest:o};let i=o.substring(a+1);return ib.has(i)?{rest:o.substring(0,a).trimEnd(),color:i}:{rest:o}},n=e(t);if(n.color===void 0)return{label:t};let r=e(n.rest);return r.color===void 0?{label:n.rest,high:n.color}:{label:r.rest,low:r.color,high:n.color}}function Fk(t){let e=[],n=0;for(;n<t.length;){if(t[n]===" "||t[n]===" "){n++;continue}if(t[n]==='"'||t[n]==="'"){let o=t[n],a=n;for(n++;n<t.length&&t[n]!==o;)n++;n<t.length&&n++,e.push({text:t.substring(a,n),start:a,end:n,quoted:!0});continue}let r=n;for(;n<t.length&&t[n]!==" "&&t[n]!==" ";)n++;e.push({text:t.substring(r,n),start:r,end:n,quoted:!1})}return e}function Wk(t,e,n){for(let r=0;r<e.length;r++){let o=e[r];if(o.quoted)continue;let a=o.text.indexOf(":");if(a>0){let i=o.text.substring(0,a);if(Hk.test(i)&&Di(n,i.toLowerCase()))return o.start}else if(a<0&&Hk.test(o.text)&&Di(n,o.text.toLowerCase())&&t.substring(o.end).replace(/^[ \t]+/,"").startsWith(":"))return o.start}return-1}function sb(t,e,n,r){let o={},a=0;for(;a<t.length;){for(;a<t.length&&(t[a]===" "||t[a]===" "||t[a]===",");)a++;if(a>=t.length)break;let i=a;for(;a<t.length&&t[a]!==":"&&t[a]!==",";)a++;if(a>=t.length||t[a]!==":")break;let s=t.substring(i,a).trim().toLowerCase();if(!s)break;for(a++;a<t.length&&(t[a]===" "||t[a]===" ");)a++;let l;if(a<t.length&&(t[a]==='"'||t[a]==="'")){let d=t[a];a++;let u=a;for(;a<t.length&&t[a]!==d;)a++;for(l=t.substring(u,a),a<t.length&&a++;a<t.length&&(t[a]===" "||t[a]===" ");)a++}else{let d=a;for(;a<t.length&&t[a]!==",";)a++;l=t.substring(d,a).trim()}let c=e.get(s)??s;if(!l){n&&r!==void 0&&n.push(At(r,pk(s),"warning",mk.EMPTY_METADATA_VALUE));continue}o[c]=l}return o}function Rf(t,e){return Wk(t,Fk(t),e)}function Be(t,e,n=new Map,r,o,a,i={}){let s=Fk(t),l=Wk(t,s,e),c,d;l===-1?(c=t.trim(),d=""):(c=t.substring(0,l).trimEnd(),d=t.substring(l));let u=Oi(c),f=u.label,m;if(i.peelAlias!==!1){let h=f.match(lU);h&&(m=h[1],f=f.substring(0,h.index).trimEnd())}let p=d.length>0?sb(d,n,o,a):{};return{name:f,meta:p,...u.colorName!==void 0&&{color:u.colorName},...m!==void 0&&{alias:m}}}function Ye(t,e,n,r){let o=Array.from(e.keys);for(let a of Object.keys(t)){if(Di(e,a))continue;let i=xe(a,o);n(`Unknown metadata key "${a}".${i?" "+i:""}`)}if(r){let a=r.match(cU);if(a){let i=a[1].toLowerCase();if(!Di(e,i)){let s=xe(i,o);s&&n(`Unknown metadata key "${i}". ${s}`)}}}}var ib,el,Xn,Af,oa,iU,sU,Hk,lU,cU,Ae=dt(()=>{"use strict";rr();Je();tl();Cf();Sr();ib=new Set(ua),el=new Set(Ip);Xn=/^([a-z][a-z0-9-]*)\s+(.+)$/i,Af=new Set(["fill-tint","fill-solid","fill-outline","no-title","no-notes","no-legend","legend-inline"]);oa=new Set(["fill-tint","fill-solid","fill-outline"]);iU=/^[A-Za-z][A-Za-z0-9-]*$/,sU=/^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;Hk=/^[A-Za-z][A-Za-z0-9_-]*$/,lU=/\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;cU=/\b([\w-]+)\s*:/});function Bt(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function an(t){return/\bdefault\s*$/.test(t)?{text:t.replace(/\s+default\s*$/,"").trim(),isDefault:!0}:{text:t,isDefault:!1}}function dU(t,e){let n=t.entries,r=new Set,o=!1;for(let s of n)s.color===fn?o=!0:r.add(s.color.toLowerCase());if(!o)return;let a=fd.map(s=>({name:s,hex:Re(s,e)??s})),i=new Set;for(let s=0;s<n.length;s++){let l=n[s];if(l.color!==fn)continue;let c=a.find(d=>!r.has(d.hex.toLowerCase())&&!i.has(d.hex.toLowerCase()));c||(c=a[i.size%a.length]),i.add(c.hex.toLowerCase()),n[s]={...l,color:c.hex}}}function wn(t,e){for(let n of t){for(let r=0;r<n.entries.length;r++){let o=n.entries[r],a=bn(o.value);a!==o.value&&(n.entries[r]={...o,value:a})}n.defaultValue!==void 0&&(n.defaultValue=bn(n.defaultValue)),dU(n,e)}}function uU(t){return/^[A-Za-z][A-Za-z0-9_]{0,11}$/.test(t)}function rl(t){return Yk.test(t)}function fU(t){if(!Yk.test(t))return null;let e=t.replace(/^tag\s+/i,"");if(!e.trim())return null;let n=nl(e);if(n.length===0)return null;let r,o,a,i,s,l=n.length;for(let d=1;d<n.length;d++)if(n[d].includes(",")){l=d;break}let c=-1;for(let d=1;d<l;d++)if(n[d].toLowerCase()==="as"){c=d;break}if(c>0&&c+1<n.length&&uU(n[c+1]))r=n.slice(0,c).map(d=>fa(d)).join(" "),o=n[c+1],s=c+2;else{let d=l;if(l<n.length){let u=m=>ua.includes(m),f=n[l].replace(/,$/,"");d=u(f)?l-1:l,d<1&&(d=1)}r=n.slice(0,d).map(u=>fa(u)).join(" "),s=d}if(s<n.length&&(a=n.slice(s).join(" ").split(",").map(u=>u.trim()).filter(Boolean)),!a||a.length===0){let d=r.lastIndexOf(" ");if(d>0){let u=r.substring(d+1);ua.includes(u)&&(i=u,r=r.substring(0,d).trimEnd())}}return{name:r,alias:o,colorHint:i,inlineValues:a&&a.length>0?a:void 0}}function Dn(t,e,n,r){if(!n)return;let o=e.find(i=>Bt(i.name)===Bt(n));if(!o)return;let a=t[Bt(o.name)]??(r?void 0:o.defaultValue);return a?o.entries.find(i=>i.value.toLowerCase()===a.toLowerCase())?.color??"#999999":"#999999"}function Nr(t,e,n,r){if(e.length===0)return;let o=new Map;for(let a of e)o.set(Bt(a.name),a);for(let a of t)for(let[i,s]of Object.entries(a.metadata)){let l=o.get(i);if(!l)continue;if(!l.entries.some(d=>d.value.toLowerCase()===s.toLowerCase())){let d=s.toLowerCase();if(!l.entries.some(f=>f.value.toLowerCase().startsWith(d))){let f=l.entries.map(h=>h.value),m=`Unknown value '${s}' for tag group '${l.name}' \u2014 use one of: ${f.join(", ")}`,p=r?.(s,f);p&&(m+=`. ${p}`),n(a.lineNumber,m)}}}}function On(t,e,n){let r=n??e;for(let o of t)o.name.toLowerCase()==="none"&&e(o.lineNumber,"'none' is a reserved keyword and cannot be used as a tag group name"),zk.test(Bt(o.name))||r(o.lineNumber,`Tag group name "${o.name}" can't form a valid key \u2014 use letters, digits, underscore, or hyphen, and quote a multi-word name (e.g. tag "Trust Zone" as tz)`),o.alias!=null&&!zk.test(o.alias)&&r(o.lineNumber,`Tag group alias "${o.alias}" contains invalid characters \u2014 use a single identifier (letters, digits, underscore, hyphen)`)}function Op(t,e){let n=e.map(o=>Bt(o.name));if(n.length===0)return;let r=(o,a)=>{let i={...a};for(let s of n){let l=o.metadata[s];l?i[s]=l:a[s]&&(o.metadata[s]=a[s])}for(let s of o.children)r(s,i)};for(let o of t)r(o,{})}function ma(t,e,n){let r=[];for(let o of e)o.defaultValue&&r.push({key:Bt(o.name),value:o.defaultValue});if(r.length!==0){for(let o of t)if(!n?.(o))for(let{key:a,value:i}of r)a in o.metadata||(o.metadata[a]=i)}}function mr(t,e,n){return n!==void 0?!n||n.toLowerCase()==="none"?null:n:e?e.toLowerCase()==="none"?null:e:t.length>0?t[0].name:null}function ln(t){return fU(t)}var fn,fd,Yk,zk,Oe=dt(()=>{"use strict";Ae();rr();fn="",fd=oc;Yk=/^tag\s+/i;zk=/^[A-Za-z_][A-Za-z0-9_-]*$/});function If(t){let e=t.toLowerCase().replace(/\.$/,""),n=mU.indexOf(e);return n>=0?n+1:(n=pU.indexOf(e.slice(0,3)),n>=0?n+1:0)}function Vk(t){let e=[],n=new RegExp(hU.source,"g"),r;for(;(r=n.exec(t))!==null;){let o=r[2]??r[3]??"";if(If(o)<=0){n.lastIndex=r.index+1;continue}e.push({start:r.index,end:r.index+r[0].length})}return e}function $p(t){let e=t.match(EU);if(!e)return{hour:0,minute:0,second:0,hasTime:!1,consumed:0};let n=parseInt(e[1],10),r=parseInt(e[2],10),o=e[3]!==void 0?parseInt(e[3],10):0,a=n<=23&&r<=59&&o<=59;return{hour:n,minute:r,second:o,hasTime:!0,consumed:e[0].length,invalid:a?void 0:e[0].trim()}}function lb(t,e,n,r=1){return{sign:r,year:t,month:e,day:n,hour:0,minute:0,second:0,grain:3,hasTime:!1,invalidTime:void 0}}function Uo(t,e={}){let n=e.dateOrder??"mdy",r=t.match(gU);if(r){let l=r[4].toUpperCase(),c=l==="BCE"||l==="BC"?-1:1,d=r[3]?3:r[2]?2:1;return{token:{sign:c,year:parseInt(r[1],10),month:r[2]?parseInt(r[2],10):1,day:r[3]?parseInt(r[3],10):1,hour:0,minute:0,second:0,grain:d,hasTime:!1},consumed:r[0].length}}let o=t.match(yU);if(o){let l=o[3]?3:o[2]?2:1,c=o[0].length,d={hour:0,minute:0,second:0,hasTime:!1,consumed:0};return l===3&&(d=$p(t.slice(c)),c+=d.consumed),{token:{sign:1,year:parseInt(o[1],10),month:o[2]?parseInt(o[2],10):1,day:o[3]?parseInt(o[3],10):1,hour:d.hour,minute:d.minute,second:d.second,grain:l,hasTime:d.hasTime,invalidTime:d.invalid},consumed:c}}let a=t.match(bU);if(a&&If(a[1])>0){let l=If(a[1]),c=parseInt(a[2],10),d=a[3]?parseInt(a[3],10):null,u=lb(d,l,c),f=$p(t.slice(a[0].length));return u.hour=f.hour,u.minute=f.minute,u.second=f.second,u.hasTime=f.hasTime,u.invalidTime=f.invalid,{token:u,consumed:a[0].length+f.consumed}}let i=t.match(xU);if(i&&If(i[2])>0){let l=If(i[2]),c=parseInt(i[1],10),d=i[3]?parseInt(i[3],10):null,u=lb(d,l,c),f=$p(t.slice(i[0].length));return u.hour=f.hour,u.minute=f.minute,u.second=f.second,u.hasTime=f.hasTime,u.invalidTime=f.invalid,{token:u,consumed:i[0].length+f.consumed}}let s=t.match(wU);if(s){let l=parseInt(s[1],10),c=parseInt(s[2],10),d=null;s[3]&&(d=parseInt(s[3],10),s[3].length===2&&(d+=2e3));let u,f;if(l>12&&c<=12?(f=l,u=c):c>12&&l<=12?(u=l,f=c):n==="dmy"?(f=l,u=c):(u=l,f=c),u<1||u>12||f<1||f>31)return null;let m=lb(d,u,f),p=$p(t.slice(s[0].length));return m.hour=p.hour,m.minute=p.minute,m.second=p.second,m.hasTime=p.hasTime,m.invalidTime=p.invalid,{token:m,consumed:s[0].length+p.consumed}}return null}function pa(t,e){let n=t.year??e,r=t.sign<0?"-":"",o=String(n);if(t.grain===1)return`${r}${o}`;let a=String(t.month).padStart(2,"0");if(t.grain===2)return`${r}${o}-${a}`;let i=String(t.day).padStart(2,"0"),s=`${r}${o}-${a}-${i}`;if(t.hasTime){let l=String(t.hour).padStart(2,"0"),c=String(t.minute).padStart(2,"0");s+=` ${l}:${c}`,t.second&&(s+=`:${String(t.second).padStart(2,"0")}`)}return s}function kU(t,e,n,r){return t!==r.y?t-r.y:e!==r.m?e-r.m:n-r.d}function Gp(t,e){if(t.year!=null){let a=t.sign*t.year;return e.contextYear=a,e.prev={y:a,m:t.month,d:t.day},{internal:pa(t,t.year)}}let n,r,o;return e.contextYear!=null?o=e.contextYear:e.noCurrentYear?(r="Date has no year and none can be derived. Add a full date, a `year 20XX` directive, or remove `no-current-year`.",o=e.currentYear):(o=e.currentYear,n="Date has no year; assuming the current year. Add `year 20XX` to make this diagram reproducible."),e.prev&&kU(o,t.month,t.day,e.prev)<0&&(o+=1),e.contextYear=o,e.prev={y:o,m:t.month,d:t.day},{internal:pa(t,o),hint:n,error:r}}function qp(t){let e=t.directiveYear??null,n=e??t.prescanYear??null;return{order:t.order??"mdy",directiveYear:e,currentYear:t.currentYear??new Date().getFullYear(),noCurrentYear:t.noCurrentYear??!1,contextYear:n,prev:null}}function cb(t,e={}){let n=t.trim(),r=Uo(n,{dateOrder:e.order});if(!r||r.consumed!==n.length||r.token.invalidTime)return null;let o=r.token.year??e.year??e.currentYear??new Date().getFullYear();return pa(r.token,o)}var mU,pU,hU,gU,yU,bU,xU,wU,EU,ol=dt(()=>{"use strict";mU=["january","february","march","april","may","june","july","august","september","october","november","december"],pU=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];hU=/\b(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+\d{4})?|\b([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+\d{4})?/g;gU=/^(\d{1,4})(?:-(\d{2})(?:-(\d{2}))?)?\s+(BCE|BC|CE|AD)\b/i,yU=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?/,bU=/^([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+(\d{4}))?/,xU=/^(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+(\d{4}))?/,wU=/^(\d{1,2})[/-](\d{1,2})(?:[/-](\d{2,4}))?/,EU=/^[T ](\d{1,2}):(\d{2})(?::(\d{2}))?/});function Uk(t,e){let n=Uo(t,{dateOrder:e?.order});if(!n)return null;let{token:r,consumed:o}=n;return{date:e?.resolve?e.resolve(r).internal:pa(r,r.year??e?.currentYear??new Date().getFullYear()),rest:t.slice(o),timeValid:!r.invalidTime,invalidTime:r.invalidTime}}function Bp(t,e){let n=Uk(t,e);if(!n)return null;let{date:r}=n,{rest:o}=n,a=o.match(MU);if(a){o=o.slice(a[0].length);let s=Uk(o,e);if(s){let l=!1,c=s.rest;c.startsWith("?")&&(l=!0,c=c.slice(1));let d=c.trimStart();return{startDate:r,endDate:s.date,uncertain:l,remainder:d,startTimeValid:n.timeValid,endTimeValid:s.timeValid,invalidStartTime:n.invalidTime,invalidEndTime:s.invalidTime}}return null}let i=o.trimStart();return i?{startDate:r,endDate:null,uncertain:!1,remainder:i,startTimeValid:n.timeValid,endTimeValid:!0,invalidStartTime:n.invalidTime,invalidEndTime:void 0}:{startDate:r,endDate:null,uncertain:!1,remainder:"",startTimeValid:n.timeValid,endTimeValid:!0,invalidStartTime:n.invalidTime,invalidEndTime:void 0}}function Xk(t){let e=t,n=1;e.startsWith("-")&&(n=-1,e=e.slice(1));let r=e.indexOf(" "),o=e,a=0,i=0,s=0,l=!1;if(r!==-1){o=e.slice(0,r);let u=e.slice(r+1).split(":");u.length>=2&&(l=!0,a=parseInt(u[0],10)||0,i=parseInt(u[1],10)||0,s=u.length>=3&&parseInt(u[2],10)||0)}let c=o.split("-").map(u=>parseInt(u,10)),d=c.length>=3?3:c.length===2?2:1;return{sign:n,year:c[0],month:c.length>=2?c[1]:1,day:c.length>=3?c[2]:1,hour:a,minute:i,second:s,granularity:d,hasTime:l}}function vU(t,e,n){let r=Xk(t),o=r.sign*r.year,a=new Date(2e3,r.month-1,r.day,r.hour,r.minute,r.second);switch(a.setFullYear(o),n){case"d":a.setDate(a.getDate()+Math.round(e));break;case"w":a.setDate(a.getDate()+Math.round(e*7));break;case"m":{let g=Math.floor(e),x=Math.round((e-g)*30);a.setMonth(a.getMonth()+g),x>0&&a.setDate(a.getDate()+x);break}case"y":{let g=Math.floor(e),x=Math.round((e-g)*12);a.setFullYear(a.getFullYear()+g),x>0&&a.setMonth(a.getMonth()+x);break}case"h":a.setTime(a.getTime()+e*36e5);break;case"min":a.setTime(a.getTime()+e*6e4);break;case"s":a.setTime(a.getTime()+e*1e3);break}let i=a.getFullYear(),s=i<0?"-":"",l=Math.abs(i),c=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),u=String(a.getHours()).padStart(2,"0"),f=String(a.getMinutes()).padStart(2,"0"),m=String(a.getSeconds()).padStart(2,"0"),p=n==="h"||n==="min"||n==="s"||r.hasTime,h=n==="s"||r.second!==0||a.getSeconds()!==0;if(r.granularity===1)return`${s}${l}`;if(r.granularity===2)return`${s}${l}-${c}`;if(p&&(a.getHours()!==0||a.getMinutes()!==0||a.getSeconds()!==0)){let g=h?`${u}:${f}:${m}`:`${u}:${f}`;return`${s}${l}-${c}-${d} ${g}`}else return`${s}${l}-${c}-${d}`}function En(t){let e=Xk(t);return e.sign*e.year+(e.month-1)/12+(e.day-1)/365+e.hour/8760+e.minute/525600+e.second/31536e3}function jk(t,e,n,r,o,a,i){let s=[],l=Bp(t,i);if(!l){if(/^\d/.test(t)){let w=t.split(/\s/)[0];if(!/^\d{4}(?:-\d{2}(?:-\d{2})?)?$/.test(w))return s.push(At(e,`Expected date format YYYY, YYYY-MM, or YYYY-MM-DD. Got '${w}'.`,"warning")),{event:null,diagnostics:s}}return null}if(!l.startTimeValid&&l.invalidStartTime&&s.push(At(e,`Invalid time '${l.invalidStartTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.endTimeValid&&l.invalidEndTime&&s.push(At(e,`Invalid time '${l.invalidEndTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.remainder)return s.push(At(e,"Event needs a name after the date.","warning")),{event:null,diagnostics:s};let c=a??Xe(Nf,new Set([...o.keys(),...o.values()])),d=Be(l.remainder,c,o);Ye(d.meta,c,w=>s.push(At(e,w,"warning")));let u=d.name,f=l.endDate,m=l.uncertain,p={...d.meta},h=null;if(p.duration){let w=p.duration,k=w.match(/^(.+)\?$/),C=k?k[1]:w;k&&(m=!0);let v=C.match(SU);v?h={amount:parseFloat(v[1]),unit:v[2]}:s.push(At(e,`Invalid duration '${w}'. Expected format like "30d", "2w", "1.5m", "1y", "2h", "30min", "45s".`,"warning")),delete p.duration}f&&h&&s.push(At(e,"Event has both an end date and duration. End date takes precedence.","warning")),!f&&h&&(f=vU(l.startDate,h.amount,h.unit));let g=u;d.color!==void 0&&(g=`${g} ${d.color}`);let x={...r,...p};d.color&&(x.color=d.color);let y={...x};return d.color&&delete y.color,{event:{date:l.startDate,endDate:f,label:g,group:n,metadata:y,lineNumber:e,...m?{uncertain:!0}:{}},diagnostics:s}}var SU,MU,Pf=dt(()=>{"use strict";Je();Ae();Sr();ol();SU=/^(\d+(?:\.\d{1,2})?)(min|[dwmyhs])(\?)?$/,MU=/^\s*(?:->|–>)\s*/});var Kk,Zk=dt(()=>{"use strict";Kk={rotate:"none",max:0,minSize:14,maxSize:80}});function Lo(t,e){return LU(t,e)}function LU(t,e){let n={type:null,title:null,titleLineNumber:null,orientation:"horizontal",periods:[],data:[],words:[],cloudOptions:{...Kk},links:[],arcOrder:"appearance",arcNodeGroups:[],timelineEvents:[],timelineGroups:[],timelineEras:[],timelineMarkers:[],timelineTagGroups:[],timelineSort:null,timelineScale:!0,timelineSwimlanes:!1,vennSets:[],vennOverlaps:[],quadrantLabels:{topRight:null,topLeft:null,bottomLeft:null,bottomRight:null},quadrantPoints:[],quadrantXAxis:null,quadrantXAxisLineNumber:null,quadrantYAxis:null,quadrantYAxisLineNumber:null,quadrantTitleLineNumber:null,diagnostics:[],error:null},r=(G,$)=>{let A=At(G,$);return n.diagnostics.push(A),n.error=He(A),n},o=(G,$)=>{n.diagnostics.push(At(G,$,"warning"))};if(!t?.trim())return r(0,"Empty content");let a=t.split(`
|
|
22
|
+
Denver heat: 2`}},S6t=Object.values(oo)});function Rp(t){return Object.prototype.hasOwnProperty.call(hk,t.toLowerCase())}function Re(t,e){if(!t||t.startsWith("#"))return null;let n=t.toLowerCase();if(!Rp(n))return null;if(e){let r=e.colors[n];if(r)return r}return hk[n]??null}function yk(t){let e=gk[t.trim().toLowerCase()];e&&(t=e);let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t.trim());if(!n)return null;let r=n[1].toLowerCase();r.length===3&&(r=r.split("").map(g=>g+g).join(""));let o=parseInt(r.slice(0,2),16)/255,a=parseInt(r.slice(2,4),16)/255,i=parseInt(r.slice(4,6),16)/255,s=Math.max(o,a,i),l=Math.min(o,a,i),c=s-l,d=(s+l)/2;if((c===0?0:c/(1-Math.abs(2*d-1)))<.15)return d<.2?"black":d>.85?"white":"gray";let f;s===o?f=60*((a-i)/c%6):s===a?f=60*((i-o)/c+2):f=60*((o-a)/c+4),f<0&&(f+=360);let m=[["red",0],["orange",30],["yellow",55],["green",120],["teal",170],["cyan",190],["blue",225],["purple",285],["red",360]],p="red",h=1/0;for(let[g,x]of m){let y=Math.abs(f-x);y<h&&(h=y,p=g)}return p}function nU(t){if(/^(#|rgba?\(|hsla?\()/i.test(t))return!0;let e=t.toLowerCase();return gk[e]!==void 0&&!Rp(e)}function bk(t,e){if(!nU(t))return null;let n=yk(t),r=n?` Nearest: ${n}.`:"";return At(e,`Color "${t}" is not a valid DGMO color \u2014 DGMO accepts only these 11 named colors: ${ua.join(", ")} (no hex, no CSS color names).${r}`,"warning",Ky)}function Yn(t,e,n,r){let o=Re(t,r);if(o!==null)return o;if(/^(#|rgba?\(|hsla?\()/i.test(t)){let s=yk(t),l=s?` Nearest: ${s}.`:"";n.push(At(e,`Color "${t}" is not supported \u2014 DGMO does not accept hex or CSS color values. Use a named palette color: ${ua.join(", ")}.${l}`,"error",Ky));return}let a=xe(t,ua),i=a?` ${a}`:"";n.push(At(e,`Unknown color "${t}". DGMO accepts only these 11 named colors: ${ua.join(", ")} (no hex, no CSS color names).${i}`,"warning",Ky))}var Hr,hk,ua,oc,Ky,gk,L6t,rr=dt(()=>{"use strict";Je();Hr={nord0:"#2e3440",nord1:"#3b4252",nord2:"#434c5e",nord3:"#4c566a",nord4:"#d8dee9",nord5:"#e5e9f0",nord6:"#eceff4",nord7:"#8fbcbb",nord8:"#88c0d0",nord9:"#81a1c1",nord10:"#5e81ac",nord11:"#bf616a",nord12:"#d08770",nord13:"#ebcb8b",nord14:"#a3be8c",nord15:"#b48ead"},hk={red:Hr.nord11,orange:Hr.nord12,yellow:Hr.nord13,green:Hr.nord14,blue:Hr.nord10,purple:Hr.nord15,teal:Hr.nord7,cyan:Hr.nord8,gray:Hr.nord3,black:Hr.nord0,white:Hr.nord6},ua=Object.freeze(["red","orange","yellow","green","blue","purple","teal","cyan","gray","black","white"]),oc=Object.freeze(["red","green","blue","yellow","teal","purple","orange","cyan"]);Ky="E_INVALID_COLOR",gk=Object.freeze({pink:"#ffc0cb",hotpink:"#ff69b4",deeppink:"#ff1493",lightpink:"#ffb6c1",palevioletred:"#db7093",crimson:"#dc143c",scarlet:"#ff2400",firebrick:"#b22222",darkred:"#8b0000",maroon:"#800000",salmon:"#fa8072",lightsalmon:"#ffa07a",darksalmon:"#e9967a",coral:"#ff7f50",lightcoral:"#f08080",tomato:"#ff6347",orangered:"#ff4500",darkorange:"#ff8c00",gold:"#ffd700",goldenrod:"#daa520",darkgoldenrod:"#b8860b",khaki:"#f0e68c",darkkhaki:"#bdb76b",amber:"#ffbf00",lavender:"#e6e6fa",violet:"#ee82ee",magenta:"#ff00ff",fuchsia:"#ff00ff",orchid:"#da70d6",plum:"#dda0dd",indigo:"#4b0082",navy:"#000080",midnightblue:"#191970",darkblue:"#00008b",mediumblue:"#0000cd",royalblue:"#4169e1",cornflowerblue:"#6495ed",dodgerblue:"#1e90ff",deepskyblue:"#00bfff",skyblue:"#87ceeb",lightskyblue:"#87cefa",lightblue:"#add8e6",powderblue:"#b0e0e6",steelblue:"#4682b4",slateblue:"#6a5acd",cadetblue:"#5f9ea0",turquoise:"#40e0d0",aqua:"#00ffff",aquamarine:"#7fffd4",lime:"#00ff00",limegreen:"#32cd32",lightgreen:"#90ee90",palegreen:"#98fb98",seagreen:"#2e8b57",mediumseagreen:"#3cb371",forestgreen:"#228b22",darkgreen:"#006400",olive:"#808000",olivedrab:"#6b8e23",darkolivegreen:"#556b2f",chartreuse:"#7fff00",lawngreen:"#7cfc00",springgreen:"#00ff7f",greenyellow:"#adff2f",brown:"#a52a2a",sienna:"#a0522d",chocolate:"#d2691e",peru:"#cd853f",tan:"#d2b48c",beige:"#f5f5dc",wheat:"#f5deb3",ivory:"#fffff0",silver:"#c0c0c0",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",dimgray:"#696969",dimgrey:"#696969",slategray:"#708090",slategrey:"#708090",gainsboro:"#dcdcdc",grey:"#808080"});L6t=[Hr.nord10,Hr.nord14,Hr.nord13,Hr.nord12,Hr.nord15,Hr.nord11,Hr.nord7,Hr.nord8]});function Ma(t){let e=new Set;for(let n of rU)t(n)&&e.add(n.token);return e}var rU,xk,wk,Ek,kk,Sk,Mk,vk,Lk,Ck,Nk,Tk,_k,N6t,tl=dt(()=>{"use strict";rU=[{token:"year",category:"directive"},{token:"date-order",category:"directive"},{token:"no-current-year",category:"directive"},{token:"slo-availability",category:"directive",infra:["top-level","behavior"]},{token:"slo-p90-latency-ms",category:"directive",infra:["top-level","behavior"]},{token:"slo-warning-margin",category:"directive",infra:["top-level","behavior"]},{token:"default-latency-ms",category:"directive",infra:["top-level"]},{token:"default-uptime",category:"directive",infra:["top-level"]},{token:"default-rps",category:"directive",infra:["top-level"]},{token:"latency-ms",colonKey:!0,infra:["behavior"]},{token:"uptime",colonKey:!0,infra:["behavior"]},{token:"instances",colonKey:!0,infra:["behavior"]},{token:"max-rps",colonKey:!0,infra:["behavior"]},{token:"cache-hit",colonKey:!0,infra:["behavior"]},{token:"firewall-block",colonKey:!0,infra:["behavior"]},{token:"ratelimit-rps",colonKey:!0,infra:["behavior"]},{token:"buffer",colonKey:!0,infra:["behavior"]},{token:"drain-rate",colonKey:!0,infra:["behavior"]},{token:"retention-hours",colonKey:!0,infra:["behavior"]},{token:"partitions",colonKey:!0,infra:["behavior"]},{token:"concurrency",colonKey:!0,infra:["behavior"]},{token:"duration-ms",colonKey:!0,infra:["behavior"]},{token:"cold-start-ms",colonKey:!0,infra:["behavior"]},{token:"cb-error-threshold",colonKey:!0,infra:["behavior"]},{token:"cb-latency-threshold-ms",colonKey:!0,infra:["behavior"]},{token:"rps",colonKey:!0,infra:["edge"]},{token:"start",category:"directive",gantt:["option"]},{token:"today-marker",category:"directive",gantt:["option","boolean"]},{token:"critical-path",category:"directive",gantt:["option","boolean"]},{token:"sprint-length",category:"directive",gantt:["option"]},{token:"sprint-number",category:"directive",gantt:["option"]},{token:"sprint-start",category:"directive",gantt:["option"]},{token:"fill-tint",category:"directive",gantt:["boolean"]},{token:"fill-solid",category:"directive",gantt:["boolean"]},{token:"fill-outline",category:"directive",gantt:["boolean"]},{token:"chart",category:"control",gantt:["option"]},{token:"dependencies",noHighlight:!0,gantt:["option","boolean"]},{token:"region-heat",category:"directive",map:!0},{token:"poi-size",category:"directive",map:!0},{token:"flow-width",category:"directive",map:!0},{token:"locale",category:"directive",map:!0},{token:"caption",category:"directive",map:!0},{token:"no-coastline",category:"directive",map:!0},{token:"no-relief",category:"directive",map:!0},{token:"no-context-labels",category:"directive",map:!0},{token:"no-region-labels",category:"directive",map:!0},{token:"no-region-heat-value",category:"directive",map:!0},{token:"no-poi-labels",category:"directive",map:!0},{token:"no-colorize",category:"directive",map:!0},{token:"no-cities",category:"directive",map:!0},{token:"no-cluster-pois",category:"directive",map:!0},{token:"hours",category:"directive",map:!0},{token:"days",category:"directive",map:!0},{token:"active-tag",category:"directive",infra:["top-level"],gantt:["option"],map:!0},{token:"title",category:"directive",gantt:["option"]},{token:"sort",category:"directive",gantt:["option"]},{token:"lane-by",category:"directive",gantt:["option"]},{token:"no-title",category:"directive",gantt:["boolean"],map:!0},{token:"no-legend",category:"directive",gantt:["boolean"],map:!0},{token:"legend-inline",category:"directive",gantt:["boolean"],map:!0},{token:"era",category:"directive"},{token:"marker",category:"directive"},{token:"holiday",category:"directive"},{token:"workweek",category:"directive",map:!0},{token:"no-dependencies",category:"directive"},{token:"rings",category:"directive"},{token:"no-blip-legend",category:"directive"},{token:"show-blip-legend",category:"directive"},{token:"trend",category:"directive"},{token:"tags",category:"directive"},{token:"import",category:"directive"},{token:"hide",category:"directive"},{token:"focus",category:"directive"},{token:"direction",category:"directive"},{token:"analog",category:"directive"},{token:"hours",category:"directive"},{token:"days",category:"directive"},{token:"no-sun",category:"directive"},{token:"time-24",category:"directive"},{token:"color-by",category:"directive"},{token:"show-values",category:"directive"},{token:"no-values",category:"directive"},{token:"lane",category:"directive"},{token:"notation",category:"directive"},{token:"extends",category:"directive"},{token:"implements",category:"directive"},{token:"abstract",category:"directive"},{token:"interface",category:"directive"},{token:"enum",category:"directive"},{token:"containers",category:"directive"},{token:"components",category:"directive"},{token:"deployment",category:"directive"},{token:"technology",category:"directive"},{token:"sub-node-label",category:"directive"},{token:"show-sub-node-count",category:"directive"},{token:"animate",category:"directive"},{token:"activations",category:"directive"},{token:"no-activations",category:"directive"},{token:"poi",category:"directive"},{token:"route",category:"directive"},{token:"stacked",category:"directive"},{token:"no-name",category:"directive"},{token:"no-value",category:"directive"},{token:"no-percent",category:"directive"},{token:"series",category:"directive"},{token:"orientation",category:"directive"},{token:"x-label",category:"directive"},{token:"y-label",category:"directive"},{token:"size-label",category:"directive"},{token:"columns",category:"directive"},{token:"rows",category:"directive"},{token:"labels",category:"directive"},{token:"rotate",category:"directive"},{token:"scale",category:"directive"},{token:"values",category:"directive"},{token:"orientation-horizontal",category:"directive"},{token:"period",category:"directive"},{token:"x-axis",category:"directive"},{token:"y-axis",category:"directive"},{token:"top-right",category:"directive"},{token:"top-left",category:"directive"},{token:"bottom-right",category:"directive"},{token:"bottom-left",category:"directive"},{token:"direction-tb",category:"directive"},{token:"direction-lr",category:"directive"},{token:"orientation-vertical",category:"directive"},{token:"inverted",category:"directive"},{token:"color",category:"directive"},{token:"no-notes",category:"directive"},{token:"highlight",category:"directive"},{token:"dim",category:"directive"},{token:"roles",category:"directive"},{token:"direction-counterclockwise",category:"directive"},{token:"circle-nodes",category:"directive"},{token:"persona",category:"directive"},{token:"x",category:"directive"},{token:"fill",category:"directive"},{token:"max",category:"directive"},{token:"size",category:"directive"},{token:"order",category:"directive"},{token:"time-unit",category:"directive"},{token:"default-confidence",category:"directive"},{token:"node-detail",category:"directive"},{token:"trials",category:"directive"},{token:"seed",category:"directive"},{token:"scrubber-trials",category:"directive"},{token:"start-date",category:"directive",gantt:["option"]},{token:"end-date",category:"directive"},{token:"thermometer",category:"directive"},{token:"gauge",category:"directive"},{token:"now",category:"directive"},{token:"target",category:"directive"},{token:"no-note",category:"directive"},{token:"no-auto-color",category:"directive"},{token:"if",category:"control"},{token:"else",category:"control"},{token:"loop",category:"control"},{token:"parallel",category:"control"},{token:"note",category:"control"},{token:"nav",category:"control"},{token:"tabs",category:"control"},{token:"table",category:"control"},{token:"image",category:"control"},{token:"modal",category:"control"},{token:"skeleton",category:"control"},{token:"alert",category:"control"},{token:"progress",category:"control"},{token:"mobile",category:"control"},{token:"na",category:"status"},{token:"todo",category:"status"},{token:"wip",category:"status"},{token:"done",category:"status"},{token:"blocked",category:"status"},{token:"in-progress",category:"status"},{token:"backlog",category:"status"},{token:"ready",category:"status"},{token:"collapsed",category:"modifier"},{token:"as",category:"modifier"},{token:"alias",category:"modifier"},{token:"aka",category:"modifier"},{token:"position",category:"modifier"},{token:"default",category:"modifier"},{token:"pk",category:"modifier"},{token:"fk",category:"modifier"},{token:"nullable",category:"modifier"},{token:"unique",category:"modifier"},{token:"int",category:"modifier"},{token:"varchar",category:"modifier"},{token:"text",category:"modifier"},{token:"boolean",category:"modifier"},{token:"date",category:"modifier"},{token:"timestamp",category:"modifier"},{token:"float",category:"modifier"},{token:"decimal",category:"modifier"},{token:"beats",category:"control"},{token:"vs",category:"control"},{token:"rounds",category:"directive"},{token:"accent",category:"directive"},{token:"no-round",category:"modifier"},{token:"no-rounds",category:"modifier"},{token:"single-elim",category:"modifier"},{token:"double-elim",category:"modifier"},{token:"seeded",category:"modifier"},{token:"url",category:"directive"}];xk=Ma(()=>!0),wk=Ma(t=>!!t.infra?.includes("top-level")),Ek=Ma(t=>!!t.infra?.includes("behavior")),kk=Ma(t=>!!t.infra?.includes("edge")),Sk=Ma(t=>!!t.gantt?.includes("option")),Mk=Ma(t=>!!t.gantt?.includes("boolean")),vk=Ma(t=>t.map===!0),Lk=Ma(t=>t.category==="directive"&&!t.colonKey&&!t.noHighlight),Ck=Ma(t=>t.category==="control"&&!t.colonKey&&!t.noHighlight),Nk=Ma(t=>t.category==="status"&&!t.colonKey&&!t.noHighlight),Tk=Ma(t=>t.category==="modifier"&&!t.colonKey&&!t.noHighlight),_k=Ma(t=>!!t.colonKey),N6t=Ma(t=>!!t.noHighlight)});var Ak,Lf,Ip,Cf=dt(()=>{"use strict";Ak=[{id:"journey-map",description:"User experience flow with emotion scores, phases, and annotations"},{id:"c4",description:"System architecture (context, container, component, deployment)"},{id:"er",description:"Database schemas and relationships"},{id:"class",description:"UML class hierarchies"},{id:"sequence",description:"Message request and response interaction flows",fallback:!0},{id:"state",description:"State machine / lifecycle transitions"},{id:"infra",description:"Infrastructure traffic flow with RPS computation"},{id:"gantt",description:"Project scheduling with task dependencies and milestones"},{id:"pert",description:"Project network with three-point estimates, critical path, and uncertainty (Beta-PERT, Monte Carlo)"},{id:"swimlane",description:"Cross-functional process flow with lanes, phases and gateways (BPMN-style)"},{id:"version-control",description:"Git / version-control branch-and-merge graph: commits, branches, merges, rebase, HEAD and remote-tracking (gitGraph-style)"},{id:"timeline",description:"Events, eras, and date ranges"},{id:"event-line",description:"Annotated narrative timeline \u2014 events on a horizontal line with descriptions (not the date-scaled timeline)"},{id:"body",description:"Human anatomy figure annotated by muscle/bone/joint name \u2014 for medical, exercise, and educational diagrams"},{id:"org",description:"Reporting hierarchy"},{id:"family",description:"Family tree / genealogy: unions (couples), children, remarriage, adoption, and GEDCOM-style metadata"},{id:"sitemap",description:"Site / app navigation structure"},{id:"bracket",description:"Single-elimination tournament bracket: winners auto-advance up a tree; seed the field for a day-0 skeleton or list results for a casual bracket, with two sides mirroring inward to a championship"},{id:"kanban",description:"Task board columns"},{id:"raci",description:"Tasks \xD7 roles responsibility matrix with constraint linting"},{id:"tech-radar",description:"Technology adoption quadrants (adopt/trial/assess/hold)"},{id:"mindmap",description:"Radial hierarchy of ideas branching from a central topic"},{id:"wireframe",description:"Low-fidelity UI layout with panels, controls, and annotations"},{id:"cycle",description:"Cyclical process visualization (PDCA, OODA, DevOps loops)"},{id:"pyramid",description:"Stacked hierarchy of layers with descriptions (Maslow, DIKW)"},{id:"ring",description:"Concentric rings showing nested or hierarchical categories (read core-out)"},{id:"treemap",description:"Nested rectangles sized by value \u2014 show a hierarchy\u2019s proportions (budgets, disk usage, portfolios) with color by category, value heatmap, or branch"},{id:"block",description:"Block diagram: an author-controlled grid of rectangular blocks with nested, collapsible containers \u2014 system/hardware/architecture layouts where the 2-D arrangement is the meaning"},{id:"sketch",description:"GUI-first constrained canvas: uniformly-sized shapes placed freely on a snap grid, arrows between them, meaning through tags \u2014 the markup is generated by the canvas editor"},{id:"goal",description:"Single progress-toward-a-target value (now vs target) as a progress bar, thermometer, or gauge \u2014 KPIs, fundraising, quotas, completion"},{id:"countdown",description:'Live "N days until X" that ticks every second and is accurate on every load \u2014 trip dates, launches, deadlines; the only dynamic chart type'},{id:"clock",description:"Live world-clock board: current time for people/places across time zones, ticking every second, with optional working-hours status and sundown line"},{id:"map",description:"Geographic concept map: highlight/score regions, drop points of interest, connect with routes or edges"},{id:"quadrant",description:"2x2 positioning matrix"},{id:"venn",description:"Set overlaps"},{id:"funnel",description:"Conversion pipeline"},{id:"slope",description:"Change between 2 time periods"},{id:"sankey",description:"Flow / allocation visualization"},{id:"arc",description:"Network relationships (linear or circular via `layout`)"},{id:"wordcloud",description:"Term frequency visualization"},{id:"heatmap",description:"Matrix intensity visualization"},{id:"function",description:"Mathematical expressions"},{id:"bar",description:"Categorical comparisons for 3 - 5 figures",fallback:!0},{id:"line",description:"Trends over time",fallback:!0},{id:"pie",description:"Part-to-whole proportions"},{id:"radar",description:"Multi-dimensional metrics"},{id:"polar-area",description:"Radial bar chart"},{id:"scatter",description:"2D data points or bubble chart"},{id:"flowchart",description:"Decision trees and process flows",fallback:!0},{id:"boxes-and-lines",description:"General-purpose node-edge diagrams with groups and tags",fallback:!0},{id:"live-link",description:"A pointer to a diagram published at Diagrammo Cloud",internal:!0}],Lf=Ak,Ip=Ak.map(t=>t.id)});function Rr(t){return{keys:new Set(t),tagAliases:new Set}}function Xe(t,e){let n=new Set(e);for(let r of e)n.add(oU(r));return{keys:t.keys,tagAliases:n}}function oU(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Di(t,e){return t.keys.has(e)||t.tagAliases.has(e)}var Zy,ld,Rk,Ik,cd,Pk,Dk,Qy,Jy,ac,Ok,Pp,tb,$k,Nf,Gk,Tf,_f,qk,eb,nb,Bk,rb,ob,ab,Sr=dt(()=>{"use strict";Zy=Rr(["color","description","role","collapsed","position"]),ld=Rr(["color","description","collapsed","icon"]),Rk=Rr(["heat","size","width","label","style","clock"]),Ik=Rr(["color","description","role","location","email","phone"]),cd=Rr(["color","description","tech","type","collapsed"]),Pk=Rr(["color","description","domain"]),Dk=Rr(["color"]),Qy=Rr(["color","description","wip","assignee","due","collapsed"]),Jy=Rr(["color","description","status"]),ac=Rr(["color","description","duration","offset","progress","start","collapsed"]),Ok=Rr(["color","description","confidence","collapsed"]),Pp=Rr(["color","description","heat"]),tb=Rr([]),$k=Rr(["shape","at","collapsed"]),Nf=Rr(["color","description","duration"]),Gk=Rr(["color","description","collapsed"]),Tf=Rr(["color","description","quadrant","ring","trend"]),_f=Rr(["color","description","width","span"]),qk=Rr(["color","description","score","emotion","pain","opportunity","thought"]),eb=Rr(["color","description"]),nb=Rr(["color","description"]),Bk=Rr(["heat"]),rb=Rr(["color","description"]),ob=Rr(["sex","b","d","bp","dp","occupation","military","education","religion","burial"]),ab=Rr(["m"])});function me(t){let e=0;for(let n of t)if(n===" ")e++;else if(n===" ")e+=4;else break;return e}function ye(t,e,n,r){let o=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(o<0)return{label:t};let a=t.substring(o+1);if(!ib.has(a)){if(n&&r!==void 0){let s=bk(a,r);s&&n.push(s)}return{label:t}}let i;return n&&r!==void 0?i=Yn(a,r,n,e):i=Re(a,e)??void 0,{label:t.substring(0,o).trimEnd(),...i!==void 0&&{color:i}}}function or(t){return t["no-legend"]==="on"}function vo(t){return t["legend-inline"]==="on"}function Gr(t){switch(t.trim().toLowerCase()){case"fill-solid":return"solid";case"fill-outline":return"outline";case"fill-tint":return"tint";default:return null}}function mn(t){if(t["fill-solid"]==="on")return"solid";if(t["fill-outline"]==="on")return"outline"}function aU(t){let e=t.trim().toLowerCase();return Af.has(e)?e:null}function ar(t,e){let n=aU(t);if(n){if(oa.has(n))for(let r of oa)delete e[r];return e[n]="on",!0}return!1}function Ce(t){let e=t.trim();if(!e||e.startsWith("//"))return null;let n=e.indexOf(" ");if(n===-1){let o=e.toLowerCase();return el.has(o)?{chartType:o,title:void 0}:null}let r=e.substring(0,n).toLowerCase();return el.has(r)?{chartType:r,title:e.substring(n+1).trim()||void 0}:null}function Dp(t,e){let n=t.trim();if(!n||n.includes(":"))return null;let r=n.indexOf(" "),o=r===-1?n:n.substring(0,r);if(!iU.test(o))return null;let a=o.toLowerCase();if(e.has(a)||xk.has(a))return null;if(r===-1)return/\d/.test(o)?null:o;let i=n.substring(r+1).trim();return!i||!sU.test(i)?null:o}function Vo(t){if(!t.includes(",")&&!t.includes("_")||t.includes(",")&&t.includes("_"))return null;let e="",n=t;return n.startsWith("-")&&(e="-",n=n.substring(1)),n?n.includes(",")?/^\d{1,3}(,\d{3})+$/.test(n)?e+n.replace(/,/g,""):/^\d{1,3}(,\d{3})+\.\d+$/.test(n)?e+n.replace(/,/g,""):null:/^\d+(_\d+)+$/.test(n)?e+n.replace(/_/g,""):/^\d+(_\d+)*\.\d+$/.test(n)&&n.includes("_")?e+n.replace(/_/g,""):null:null}function fa(t){return t.length>=2&&(t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'")?t.substring(1,t.length-1):t}function bn(t){let e=t.trim();if(e.length<2)return t;let n=e[0],r=e[e.length-1];if((n!=='"'||r!=='"')&&(n!=="'"||r!=="'"))return t;let o=e.slice(1,-1);return o.length===0||o.includes(n)?t:o}function nl(t){let e=[],n=0;for(;n<t.length;){if(t[n]===" "||t[n]===" "){n++;continue}if(t[n]==='"'||t[n]==="'"){let o=t[n],a=n;for(n++;n<t.length&&t[n]!==o;)n++;n<t.length&&n++,e.push(t.substring(a,n));continue}let r=n;for(;n<t.length&&t[n]!==" "&&t[n]!==" ";)n++;e.push(t.substring(r,n))}return e}function ks(t,e){let n=[],r=[],o=e+1;for(;o<t.length;o++){let a=t[o],i=a.trim();if(i&&!i.startsWith("//")){if(a[0]!==" "&&a[0]!==" ")break;n.push(i.replace(/,\s*$/,"")),r.push(o+1)}}return{values:n,lineNumbers:r,newIndex:o-1}}function dd(t,e,n,r,o){let a,i,s=n,l=[];if(t)i=t,a=t.split(",").map(f=>f.trim()).filter(Boolean),l=a.map(()=>n+1);else{let f=ks(e,n);s=f.newIndex,a=f.values,l=f.lineNumbers,i=a.join(", ")}let c=f=>{let m=f.split(/\s+/,1)[0];return m==="y-label"?"left":m==="y-right-label"?"right":null};if(a.some(f=>c(f)!==null)){let f=[],m=[],p=[],h=[],g,x,y="left";for(let b=0;b<a.length;b++){let w=a[b],k=c(w);if(k!==null){let v=w.slice(w.indexOf(" ")+1).trim();y=k,k==="left"?g=v||g:x=v||x;continue}let C=ye(w,r,o,l[b]);f.push(C.label),m.push(C.color),p.push(y),h.push(l[b])}return{series:f.join(", "),names:f,nameColors:m,nameLineNumbers:h,newIndex:s,axes:p,...g!==void 0&&{leftLabel:g},...x!==void 0&&{rightLabel:x}}}let d=[],u=[];for(let f=0;f<a.length;f++){let m=a[f],p=ye(m,r,o,l[f]);u.push(p.color),d.push(p.label)}return d.length===1&&(i=d[0]),{series:i,names:d,nameColors:u,nameLineNumbers:l,newIndex:s}}function Oi(t){let e=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(e<0)return{label:t};let n=t.substring(e+1);return ib.has(n)?{label:t.substring(0,e).trimEnd(),colorName:n}:{label:t}}function $i(t){let e=t.trimEnd();return e==="collapsed"?{rest:"",collapsed:!0}:/[ \t]collapsed$/.test(e)?{rest:e.slice(0,e.length-9).trimEnd().replace(/,\s*$/,""),collapsed:!0}:{rest:t,collapsed:!1}}function ud(t){let e=o=>{let a=Math.max(o.lastIndexOf(" "),o.lastIndexOf(" "));if(a<0)return{rest:o};let i=o.substring(a+1);return ib.has(i)?{rest:o.substring(0,a).trimEnd(),color:i}:{rest:o}},n=e(t);if(n.color===void 0)return{label:t};let r=e(n.rest);return r.color===void 0?{label:n.rest,high:n.color}:{label:r.rest,low:r.color,high:n.color}}function Fk(t){let e=[],n=0;for(;n<t.length;){if(t[n]===" "||t[n]===" "){n++;continue}if(t[n]==='"'||t[n]==="'"){let o=t[n],a=n;for(n++;n<t.length&&t[n]!==o;)n++;n<t.length&&n++,e.push({text:t.substring(a,n),start:a,end:n,quoted:!0});continue}let r=n;for(;n<t.length&&t[n]!==" "&&t[n]!==" ";)n++;e.push({text:t.substring(r,n),start:r,end:n,quoted:!1})}return e}function Wk(t,e,n){for(let r=0;r<e.length;r++){let o=e[r];if(o.quoted)continue;let a=o.text.indexOf(":");if(a>0){let i=o.text.substring(0,a);if(Hk.test(i)&&Di(n,i.toLowerCase()))return o.start}else if(a<0&&Hk.test(o.text)&&Di(n,o.text.toLowerCase())&&t.substring(o.end).replace(/^[ \t]+/,"").startsWith(":"))return o.start}return-1}function sb(t,e,n,r){let o={},a=0;for(;a<t.length;){for(;a<t.length&&(t[a]===" "||t[a]===" "||t[a]===",");)a++;if(a>=t.length)break;let i=a;for(;a<t.length&&t[a]!==":"&&t[a]!==",";)a++;if(a>=t.length||t[a]!==":")break;let s=t.substring(i,a).trim().toLowerCase();if(!s)break;for(a++;a<t.length&&(t[a]===" "||t[a]===" ");)a++;let l;if(a<t.length&&(t[a]==='"'||t[a]==="'")){let d=t[a];a++;let u=a;for(;a<t.length&&t[a]!==d;)a++;for(l=t.substring(u,a),a<t.length&&a++;a<t.length&&(t[a]===" "||t[a]===" ");)a++}else{let d=a;for(;a<t.length&&t[a]!==",";)a++;l=t.substring(d,a).trim()}let c=e.get(s)??s;if(!l){n&&r!==void 0&&n.push(At(r,pk(s),"warning",mk.EMPTY_METADATA_VALUE));continue}o[c]=l}return o}function Rf(t,e){return Wk(t,Fk(t),e)}function Be(t,e,n=new Map,r,o,a,i={}){let s=Fk(t),l=Wk(t,s,e),c,d;l===-1?(c=t.trim(),d=""):(c=t.substring(0,l).trimEnd(),d=t.substring(l));let u=Oi(c),f=u.label,m;if(i.peelAlias!==!1){let h=f.match(lU);h&&(m=h[1],f=f.substring(0,h.index).trimEnd())}let p=d.length>0?sb(d,n,o,a):{};return{name:f,meta:p,...u.colorName!==void 0&&{color:u.colorName},...m!==void 0&&{alias:m}}}function Ye(t,e,n,r){let o=Array.from(e.keys);for(let a of Object.keys(t)){if(Di(e,a))continue;let i=xe(a,o);n(`Unknown metadata key "${a}".${i?" "+i:""}`)}if(r){let a=r.match(cU);if(a){let i=a[1].toLowerCase();if(!Di(e,i)){let s=xe(i,o);s&&n(`Unknown metadata key "${i}". ${s}`)}}}}var ib,el,Xn,Af,oa,iU,sU,Hk,lU,cU,Ae=dt(()=>{"use strict";rr();Je();tl();Cf();Sr();ib=new Set(ua),el=new Set(Ip);Xn=/^([a-z][a-z0-9-]*)\s+(.+)$/i,Af=new Set(["fill-tint","fill-solid","fill-outline","no-title","no-notes","no-legend","legend-inline"]);oa=new Set(["fill-tint","fill-solid","fill-outline"]);iU=/^[A-Za-z][A-Za-z0-9-]*$/,sU=/^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;Hk=/^[A-Za-z][A-Za-z0-9_-]*$/,lU=/\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;cU=/\b([\w-]+)\s*:/});function Bt(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function an(t){return/\bdefault\s*$/.test(t)?{text:t.replace(/\s+default\s*$/,"").trim(),isDefault:!0}:{text:t,isDefault:!1}}function dU(t,e){let n=t.entries,r=new Set,o=!1;for(let s of n)s.color===fn?o=!0:r.add(s.color.toLowerCase());if(!o)return;let a=fd.map(s=>({name:s,hex:Re(s,e)??s})),i=new Set;for(let s=0;s<n.length;s++){let l=n[s];if(l.color!==fn)continue;let c=a.find(d=>!r.has(d.hex.toLowerCase())&&!i.has(d.hex.toLowerCase()));c||(c=a[i.size%a.length]),i.add(c.hex.toLowerCase()),n[s]={...l,color:c.hex}}}function wn(t,e){for(let n of t){for(let r=0;r<n.entries.length;r++){let o=n.entries[r],a=bn(o.value);a!==o.value&&(n.entries[r]={...o,value:a})}n.defaultValue!==void 0&&(n.defaultValue=bn(n.defaultValue)),dU(n,e)}}function uU(t){return/^[A-Za-z][A-Za-z0-9_]{0,11}$/.test(t)}function rl(t){return Yk.test(t)}function fU(t){if(!Yk.test(t))return null;let e=t.replace(/^tag\s+/i,"");if(!e.trim())return null;let n=nl(e);if(n.length===0)return null;let r,o,a,i,s,l=n.length;for(let d=1;d<n.length;d++)if(n[d].includes(",")){l=d;break}let c=-1;for(let d=1;d<l;d++)if(n[d].toLowerCase()==="as"){c=d;break}if(c>0&&c+1<n.length&&uU(n[c+1]))r=n.slice(0,c).map(d=>fa(d)).join(" "),o=n[c+1],s=c+2;else{let d=l;if(l<n.length){let u=m=>ua.includes(m),f=n[l].replace(/,$/,"");d=u(f)?l-1:l,d<1&&(d=1)}r=n.slice(0,d).map(u=>fa(u)).join(" "),s=d}if(s<n.length&&(a=n.slice(s).join(" ").split(",").map(u=>u.trim()).filter(Boolean)),!a||a.length===0){let d=r.lastIndexOf(" ");if(d>0){let u=r.substring(d+1);ua.includes(u)&&(i=u,r=r.substring(0,d).trimEnd())}}return{name:r,alias:o,colorHint:i,inlineValues:a&&a.length>0?a:void 0}}function Dn(t,e,n,r){if(!n)return;let o=e.find(i=>Bt(i.name)===Bt(n));if(!o)return;let a=t[Bt(o.name)]??(r?void 0:o.defaultValue);return a?o.entries.find(i=>i.value.toLowerCase()===a.toLowerCase())?.color??"#999999":"#999999"}function Nr(t,e,n,r){if(e.length===0)return;let o=new Map;for(let a of e)o.set(Bt(a.name),a);for(let a of t)for(let[i,s]of Object.entries(a.metadata)){let l=o.get(i);if(!l)continue;if(!l.entries.some(d=>d.value.toLowerCase()===s.toLowerCase())){let d=s.toLowerCase();if(!l.entries.some(f=>f.value.toLowerCase().startsWith(d))){let f=l.entries.map(h=>h.value),m=`Unknown value '${s}' for tag group '${l.name}' \u2014 use one of: ${f.join(", ")}`,p=r?.(s,f);p&&(m+=`. ${p}`),n(a.lineNumber,m)}}}}function On(t,e,n){let r=n??e;for(let o of t)if(o.name.toLowerCase()==="none"&&e(o.lineNumber,"'none' is a reserved keyword and cannot be used as a tag group name"),zk.test(Bt(o.name))||r(o.lineNumber,`Tag group name "${o.name}" can't form a valid key \u2014 use letters, digits, underscore, or hyphen, and quote a multi-word name (e.g. tag "Trust Zone" as tz)`),o.alias!=null&&!zk.test(o.alias)&&r(o.lineNumber,`Tag group alias "${o.alias}" contains invalid characters \u2014 use a single identifier (letters, digits, underscore, hyphen)`),o.alias==null){let a=o.name.trim().split(/\s+/),i=a[a.length-1];if(a.length>1&&/^[a-z][a-z0-9_]{0,11}$/.test(i)){let s=a.slice(0,-1).join(" ");e(o.lineNumber,`Tag group "${o.name}" has a space and no alias \u2014 if '${i}' is meant as an alias, write 'tag ${s} as ${i}'; if the space is intentional, quote the name: tag "${o.name}"`)}}}function Op(t,e){let n=e.map(o=>Bt(o.name));if(n.length===0)return;let r=(o,a)=>{let i={...a};for(let s of n){let l=o.metadata[s];l?i[s]=l:a[s]&&(o.metadata[s]=a[s])}for(let s of o.children)r(s,i)};for(let o of t)r(o,{})}function ma(t,e,n){let r=[];for(let o of e)o.defaultValue&&r.push({key:Bt(o.name),value:o.defaultValue});if(r.length!==0){for(let o of t)if(!n?.(o))for(let{key:a,value:i}of r)a in o.metadata||(o.metadata[a]=i)}}function mr(t,e,n){return n!==void 0?!n||n.toLowerCase()==="none"?null:n:e?e.toLowerCase()==="none"?null:e:t.length>0?t[0].name:null}function ln(t){return fU(t)}var fn,fd,Yk,zk,Oe=dt(()=>{"use strict";Ae();rr();fn="",fd=oc;Yk=/^tag\s+/i;zk=/^[A-Za-z_][A-Za-z0-9_-]*$/});function If(t){let e=t.toLowerCase().replace(/\.$/,""),n=mU.indexOf(e);return n>=0?n+1:(n=pU.indexOf(e.slice(0,3)),n>=0?n+1:0)}function Vk(t){let e=[],n=new RegExp(hU.source,"g"),r;for(;(r=n.exec(t))!==null;){let o=r[2]??r[3]??"";if(If(o)<=0){n.lastIndex=r.index+1;continue}e.push({start:r.index,end:r.index+r[0].length})}return e}function $p(t){let e=t.match(EU);if(!e)return{hour:0,minute:0,second:0,hasTime:!1,consumed:0};let n=parseInt(e[1],10),r=parseInt(e[2],10),o=e[3]!==void 0?parseInt(e[3],10):0,a=n<=23&&r<=59&&o<=59;return{hour:n,minute:r,second:o,hasTime:!0,consumed:e[0].length,invalid:a?void 0:e[0].trim()}}function lb(t,e,n,r=1){return{sign:r,year:t,month:e,day:n,hour:0,minute:0,second:0,grain:3,hasTime:!1,invalidTime:void 0}}function Uo(t,e={}){let n=e.dateOrder??"mdy",r=t.match(gU);if(r){let l=r[4].toUpperCase(),c=l==="BCE"||l==="BC"?-1:1,d=r[3]?3:r[2]?2:1;return{token:{sign:c,year:parseInt(r[1],10),month:r[2]?parseInt(r[2],10):1,day:r[3]?parseInt(r[3],10):1,hour:0,minute:0,second:0,grain:d,hasTime:!1},consumed:r[0].length}}let o=t.match(yU);if(o){let l=o[3]?3:o[2]?2:1,c=o[0].length,d={hour:0,minute:0,second:0,hasTime:!1,consumed:0};return l===3&&(d=$p(t.slice(c)),c+=d.consumed),{token:{sign:1,year:parseInt(o[1],10),month:o[2]?parseInt(o[2],10):1,day:o[3]?parseInt(o[3],10):1,hour:d.hour,minute:d.minute,second:d.second,grain:l,hasTime:d.hasTime,invalidTime:d.invalid},consumed:c}}let a=t.match(bU);if(a&&If(a[1])>0){let l=If(a[1]),c=parseInt(a[2],10),d=a[3]?parseInt(a[3],10):null,u=lb(d,l,c),f=$p(t.slice(a[0].length));return u.hour=f.hour,u.minute=f.minute,u.second=f.second,u.hasTime=f.hasTime,u.invalidTime=f.invalid,{token:u,consumed:a[0].length+f.consumed}}let i=t.match(xU);if(i&&If(i[2])>0){let l=If(i[2]),c=parseInt(i[1],10),d=i[3]?parseInt(i[3],10):null,u=lb(d,l,c),f=$p(t.slice(i[0].length));return u.hour=f.hour,u.minute=f.minute,u.second=f.second,u.hasTime=f.hasTime,u.invalidTime=f.invalid,{token:u,consumed:i[0].length+f.consumed}}let s=t.match(wU);if(s){let l=parseInt(s[1],10),c=parseInt(s[2],10),d=null;s[3]&&(d=parseInt(s[3],10),s[3].length===2&&(d+=2e3));let u,f;if(l>12&&c<=12?(f=l,u=c):c>12&&l<=12?(u=l,f=c):n==="dmy"?(f=l,u=c):(u=l,f=c),u<1||u>12||f<1||f>31)return null;let m=lb(d,u,f),p=$p(t.slice(s[0].length));return m.hour=p.hour,m.minute=p.minute,m.second=p.second,m.hasTime=p.hasTime,m.invalidTime=p.invalid,{token:m,consumed:s[0].length+p.consumed}}return null}function pa(t,e){let n=t.year??e,r=t.sign<0?"-":"",o=String(n);if(t.grain===1)return`${r}${o}`;let a=String(t.month).padStart(2,"0");if(t.grain===2)return`${r}${o}-${a}`;let i=String(t.day).padStart(2,"0"),s=`${r}${o}-${a}-${i}`;if(t.hasTime){let l=String(t.hour).padStart(2,"0"),c=String(t.minute).padStart(2,"0");s+=` ${l}:${c}`,t.second&&(s+=`:${String(t.second).padStart(2,"0")}`)}return s}function kU(t,e,n,r){return t!==r.y?t-r.y:e!==r.m?e-r.m:n-r.d}function Gp(t,e){if(t.year!=null){let a=t.sign*t.year;return e.contextYear=a,e.prev={y:a,m:t.month,d:t.day},{internal:pa(t,t.year)}}let n,r,o;return e.contextYear!=null?o=e.contextYear:e.noCurrentYear?(r="Date has no year and none can be derived. Add a full date, a `year 20XX` directive, or remove `no-current-year`.",o=e.currentYear):(o=e.currentYear,n="Date has no year; assuming the current year. Add `year 20XX` to make this diagram reproducible."),e.prev&&kU(o,t.month,t.day,e.prev)<0&&(o+=1),e.contextYear=o,e.prev={y:o,m:t.month,d:t.day},{internal:pa(t,o),hint:n,error:r}}function qp(t){let e=t.directiveYear??null,n=e??t.prescanYear??null;return{order:t.order??"mdy",directiveYear:e,currentYear:t.currentYear??new Date().getFullYear(),noCurrentYear:t.noCurrentYear??!1,contextYear:n,prev:null}}function cb(t,e={}){let n=t.trim(),r=Uo(n,{dateOrder:e.order});if(!r||r.consumed!==n.length||r.token.invalidTime)return null;let o=r.token.year??e.year??e.currentYear??new Date().getFullYear();return pa(r.token,o)}var mU,pU,hU,gU,yU,bU,xU,wU,EU,ol=dt(()=>{"use strict";mU=["january","february","march","april","may","june","july","august","september","october","november","december"],pU=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];hU=/\b(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+\d{4})?|\b([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+\d{4})?/g;gU=/^(\d{1,4})(?:-(\d{2})(?:-(\d{2}))?)?\s+(BCE|BC|CE|AD)\b/i,yU=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?/,bU=/^([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+(\d{4}))?/,xU=/^(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+(\d{4}))?/,wU=/^(\d{1,2})[/-](\d{1,2})(?:[/-](\d{2,4}))?/,EU=/^[T ](\d{1,2}):(\d{2})(?::(\d{2}))?/});function Uk(t,e){let n=Uo(t,{dateOrder:e?.order});if(!n)return null;let{token:r,consumed:o}=n;return{date:e?.resolve?e.resolve(r).internal:pa(r,r.year??e?.currentYear??new Date().getFullYear()),rest:t.slice(o),timeValid:!r.invalidTime,invalidTime:r.invalidTime}}function Bp(t,e){let n=Uk(t,e);if(!n)return null;let{date:r}=n,{rest:o}=n,a=o.match(MU);if(a){o=o.slice(a[0].length);let s=Uk(o,e);if(s){let l=!1,c=s.rest;c.startsWith("?")&&(l=!0,c=c.slice(1));let d=c.trimStart();return{startDate:r,endDate:s.date,uncertain:l,remainder:d,startTimeValid:n.timeValid,endTimeValid:s.timeValid,invalidStartTime:n.invalidTime,invalidEndTime:s.invalidTime}}return null}let i=o.trimStart();return i?{startDate:r,endDate:null,uncertain:!1,remainder:i,startTimeValid:n.timeValid,endTimeValid:!0,invalidStartTime:n.invalidTime,invalidEndTime:void 0}:{startDate:r,endDate:null,uncertain:!1,remainder:"",startTimeValid:n.timeValid,endTimeValid:!0,invalidStartTime:n.invalidTime,invalidEndTime:void 0}}function Xk(t){let e=t,n=1;e.startsWith("-")&&(n=-1,e=e.slice(1));let r=e.indexOf(" "),o=e,a=0,i=0,s=0,l=!1;if(r!==-1){o=e.slice(0,r);let u=e.slice(r+1).split(":");u.length>=2&&(l=!0,a=parseInt(u[0],10)||0,i=parseInt(u[1],10)||0,s=u.length>=3&&parseInt(u[2],10)||0)}let c=o.split("-").map(u=>parseInt(u,10)),d=c.length>=3?3:c.length===2?2:1;return{sign:n,year:c[0],month:c.length>=2?c[1]:1,day:c.length>=3?c[2]:1,hour:a,minute:i,second:s,granularity:d,hasTime:l}}function vU(t,e,n){let r=Xk(t),o=r.sign*r.year,a=new Date(2e3,r.month-1,r.day,r.hour,r.minute,r.second);switch(a.setFullYear(o),n){case"d":a.setDate(a.getDate()+Math.round(e));break;case"w":a.setDate(a.getDate()+Math.round(e*7));break;case"m":{let g=Math.floor(e),x=Math.round((e-g)*30);a.setMonth(a.getMonth()+g),x>0&&a.setDate(a.getDate()+x);break}case"y":{let g=Math.floor(e),x=Math.round((e-g)*12);a.setFullYear(a.getFullYear()+g),x>0&&a.setMonth(a.getMonth()+x);break}case"h":a.setTime(a.getTime()+e*36e5);break;case"min":a.setTime(a.getTime()+e*6e4);break;case"s":a.setTime(a.getTime()+e*1e3);break}let i=a.getFullYear(),s=i<0?"-":"",l=Math.abs(i),c=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),u=String(a.getHours()).padStart(2,"0"),f=String(a.getMinutes()).padStart(2,"0"),m=String(a.getSeconds()).padStart(2,"0"),p=n==="h"||n==="min"||n==="s"||r.hasTime,h=n==="s"||r.second!==0||a.getSeconds()!==0;if(r.granularity===1)return`${s}${l}`;if(r.granularity===2)return`${s}${l}-${c}`;if(p&&(a.getHours()!==0||a.getMinutes()!==0||a.getSeconds()!==0)){let g=h?`${u}:${f}:${m}`:`${u}:${f}`;return`${s}${l}-${c}-${d} ${g}`}else return`${s}${l}-${c}-${d}`}function En(t){let e=Xk(t);return e.sign*e.year+(e.month-1)/12+(e.day-1)/365+e.hour/8760+e.minute/525600+e.second/31536e3}function jk(t,e,n,r,o,a,i){let s=[],l=Bp(t,i);if(!l){if(/^\d/.test(t)){let w=t.split(/\s/)[0];if(!/^\d{4}(?:-\d{2}(?:-\d{2})?)?$/.test(w))return s.push(At(e,`Expected date format YYYY, YYYY-MM, or YYYY-MM-DD. Got '${w}'.`,"warning")),{event:null,diagnostics:s}}return null}if(!l.startTimeValid&&l.invalidStartTime&&s.push(At(e,`Invalid time '${l.invalidStartTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.endTimeValid&&l.invalidEndTime&&s.push(At(e,`Invalid time '${l.invalidEndTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.remainder)return s.push(At(e,"Event needs a name after the date.","warning")),{event:null,diagnostics:s};let c=a??Xe(Nf,new Set([...o.keys(),...o.values()])),d=Be(l.remainder,c,o);Ye(d.meta,c,w=>s.push(At(e,w,"warning")));let u=d.name,f=l.endDate,m=l.uncertain,p={...d.meta},h=null;if(p.duration){let w=p.duration,k=w.match(/^(.+)\?$/),C=k?k[1]:w;k&&(m=!0);let v=C.match(SU);v?h={amount:parseFloat(v[1]),unit:v[2]}:s.push(At(e,`Invalid duration '${w}'. Expected format like "30d", "2w", "1.5m", "1y", "2h", "30min", "45s".`,"warning")),delete p.duration}f&&h&&s.push(At(e,"Event has both an end date and duration. End date takes precedence.","warning")),!f&&h&&(f=vU(l.startDate,h.amount,h.unit));let g=u;d.color!==void 0&&(g=`${g} ${d.color}`);let x={...r,...p};d.color&&(x.color=d.color);let y={...x};return d.color&&delete y.color,{event:{date:l.startDate,endDate:f,label:g,group:n,metadata:y,lineNumber:e,...m?{uncertain:!0}:{}},diagnostics:s}}var SU,MU,Pf=dt(()=>{"use strict";Je();Ae();Sr();ol();SU=/^(\d+(?:\.\d{1,2})?)(min|[dwmyhs])(\?)?$/,MU=/^\s*(?:->|–>)\s*/});var Kk,Zk=dt(()=>{"use strict";Kk={rotate:"none",max:0,minSize:14,maxSize:80}});function Lo(t,e){return LU(t,e)}function LU(t,e){let n={type:null,title:null,titleLineNumber:null,orientation:"horizontal",periods:[],data:[],words:[],cloudOptions:{...Kk},links:[],arcOrder:"appearance",arcNodeGroups:[],timelineEvents:[],timelineGroups:[],timelineEras:[],timelineMarkers:[],timelineTagGroups:[],timelineSort:null,timelineScale:!0,timelineSwimlanes:!1,vennSets:[],vennOverlaps:[],quadrantLabels:{topRight:null,topLeft:null,bottomLeft:null,bottomRight:null},quadrantPoints:[],quadrantXAxis:null,quadrantXAxisLineNumber:null,quadrantYAxis:null,quadrantYAxisLineNumber:null,quadrantTitleLineNumber:null,diagnostics:[],error:null},r=(G,$)=>{let A=At(G,$);return n.diagnostics.push(A),n.error=He(A),n},o=(G,$)=>{n.diagnostics.push(At(G,$,"warning"))};if(!t?.trim())return r(0,"Empty content");let a=t.split(`
|
|
23
23
|
`),i="mdy",s=!1,l=null;for(let G of a){let $=G.trim().toLowerCase();if($==="no-current-year")s=!0;else if($==="date-order dmy")i="dmy";else if($==="date-order mdy")i="mdy";else{let A=$.match(/^year\s+(\d{1,4})$/);A&&(l=parseInt(A[1],10))}}let c=null;for(let G of a){let $=G.trim();if(!$)continue;let A=Uo($,{dateOrder:i});if(A?.token.year!=null){c=A.token.sign*A.token.year;break}}let d=qp({order:i,directiveYear:l,prescanYear:c,noCurrentYear:s}),u={order:i,resolve:G=>Gp(G,d)},f=G=>G==="no-current-year"||G==="date-order dmy"||G==="date-order mdy"||/^year\s+\d{1,4}$/.test(G),m=l??c,p=new Date().getFullYear(),h=G=>G.year!=null?pa(G,G.year):m==null&&s?null:pa(G,m??p),g=/\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/,x=G=>{let $=G.match(g);return $?{label:G.slice(0,$.index).trim(),color:$[1].toLowerCase()}:{label:G.trim(),color:null}},y=G=>{let $=Uo(G,{dateOrder:i});if(!$||$.consumed===0||$.token.invalidTime)return null;let A=h($.token);return A==null?null:{iso:A,rest:G.slice($.consumed)}},b=G=>{let $=y(G);if(!$)return null;let A=$.rest.match(/^\s*(?:->|–>)\s*/);if(!A)return null;let D=y($.rest.slice(A[0].length));return D?{start:$.iso,end:D.iso,rest:D.rest}:null},w=[],k=null,C=null,v={},_=null,R=!1,L=0,E=!1,M=0,S=!1,T=new Map,N=new Set(["slope","wordcloud","arc","timeline","venn","quadrant","sequence"]),I=!1;for(let G=0;G<a.length;G++){let $=a[G],A=$.trim(),D=me($),O=G+1;if(!A||A.startsWith("//"))continue;if(!I){I=!0;let B=Ce(A);if(B&&N.has(B.chartType)){n.type=B.chartType,B.title&&(n.title=B.title,n.titleLineNumber=O);continue}}if(n.type==="timeline"&&D===0){if(f(A.toLowerCase()))continue;let B=ln(A);if(B){let q={name:B.name,...B.alias!==void 0&&{alias:B.alias},entries:[],lineNumber:O};_=q,B.alias?T.set(B.alias.toLowerCase(),B.name.toLowerCase()):T.set(B.name.toLowerCase(),B.name.toLowerCase()),n.timelineTagGroups.push(q);continue}}if(_&&D>0){let{text:B,isDefault:q}=an(A),{label:V,color:X}=ye(B,e,n.diagnostics,O);if(X){(q||_.entries.length===0)&&(_.defaultValue=V),_.entries.push({value:V,color:X,lineNumber:O});continue}}if(_&&D===0&&(_=null),n.type==="timeline"){let B=A.match(/^\[(.+?)\]\s*(.*?)\s*$/);if(B){let q=B[1].trim(),V=B[2]??"",X=null,z={};if(V){let{label:U,colorName:Y}=Oi(" "+V);if(Y&&U.trim()==="")X=Yn(Y,O,n.diagnostics,e)??null;else{let K=Xe(Nf,new Set([...T.keys(),...T.values()])),et=Be(V,K,T);et.color&&(X=Yn(et.color,O,n.diagnostics,e)??null),z={...et.meta},z.color&&(X=Yn(z.color,O,n.diagnostics,e)??null,delete z.color)}}n.timelineGroups.push({name:q,color:X,metadata:z,lineNumber:O}),C=q,v=z;continue}}let P=A.match(/^\[(.+?)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/);if(P){if(n.type==="arc"){let B=P[1].trim(),q=P[2]?Yn(P[2].trim(),O,n.diagnostics,e)??null:null;n.arcNodeGroups.push({name:B,nodes:[],color:q,lineNumber:O}),k=B}continue}if(/^#{2,}\s+/.test(A)&&(n.type==="arc"||n.type==="timeline")){let B=A.replace(/^#{2,}\s+/,"").replace(/\s*\([^)]*\)\s*$/,"").trim();n.diagnostics.push(At(O,`'## ${B}' is no longer supported. Use '[${B}]' instead`,"warning"));continue}if(D===0&&(k=null,C=null,v={}),n.type==="arc"){let B=A.match(/^(.+?)\s*->\s*(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s+(-?[\d,_]+(?:\.[\d]+)?))?$/);if(B){let q=B[1].trim(),V=B[2].trim();if(q.endsWith(":")||V.endsWith(":")){n.diagnostics.push(At(O,`Trailing colon is not valid in arc edges \u2014 write '${q.replace(/:$/,"")} -> ${V.replace(/:$/,"")}' instead`));continue}let X=B[3]?Yn(B[3].trim(),O,n.diagnostics,e)??null:null,z=B[4]?parseFloat(Vo(B[4])??B[4]):1;if(z<0){n.diagnostics.push(ne(ui,O,{value:z,label:`${q} -> ${V}`,channel:"arc link weights"}));continue}if(n.links.push({source:q,target:V,value:z,color:X,lineNumber:O}),k!==null){let U=n.arcNodeGroups.find(Y=>Y.name===k);if(U){let Y=new Set(n.arcNodeGroups.flatMap(K=>K.nodes));Y.has(q)||U.nodes.push(q),Y.has(V)||U.nodes.push(V)}}continue}}if(n.type==="timeline"&&R)if(D<=L)R=!1;else{if(A.startsWith("//"))continue;let B=b(A),q=B&&x(B.rest);B&&q&&q.label?n.timelineEras.push({startDate:B.start,endDate:B.end,label:q.label,color:q.color?Yn(q.color,O,n.diagnostics,e)??null:null,lineNumber:O}):o(O,`Unrecognized era entry: "${A}" \u2014 use '<start> -> <end> Label [color]' (e.g. '1716 -> 1717 Reign').`);continue}if(n.type==="timeline"&&E)if(D<=M)E=!1;else{if(A.startsWith("//"))continue;let B=y(A),q=B&&x(B.rest);B&&q&&q.label?n.timelineMarkers.push({date:B.iso,label:q.label,color:q.color?Yn(q.color,O,n.diagnostics,e)??null:null,lineNumber:O}):o(O,`Unrecognized marker entry: "${A}" \u2014 use '<date> Label [color]' (e.g. '1776 Independence').`);continue}if(n.type==="timeline"){if(A.toLowerCase()==="era"){R=!0,L=D;continue}if(A.toLowerCase()==="marker"){E=!0,M=D;continue}let B=A.match(/^era\s+(.+)$/i),q=B&&b(B[1]),V=q&&x(q.rest);if(q&&V&&V.label){n.timelineEras.push({startDate:q.start,endDate:q.end,label:V.label,color:V.color?Yn(V.color,O,n.diagnostics,e)??null:null,lineNumber:O});continue}let X=A.match(/^marker\s+(.+)$/i),z=X&&y(X[1]),U=z&&x(z.rest);if(z&&U&&U.label){n.timelineMarkers.push({date:z.iso,label:U.label,color:U.color?Yn(U.color,O,n.diagnostics,e)??null:null,lineNumber:O});continue}}if(n.type==="timeline"){let B=A.match(/^sort\s+(time|group|tag:(.+))$/i);if(B){let q=B[1].toLowerCase();q==="time"?n.timelineSort="time":q==="group"?n.timelineSort="group":(n.timelineSort="tag",n.timelineDefaultSwimlaneTG=B[2].trim());continue}}if(n.type==="timeline"){let B=A.toLowerCase();if(B==="no-scale"){n.timelineScale=!1;continue}if(B==="swimlanes"){n.timelineSwimlanes=!0;continue}let q=A.match(/^lane-by\s+(.+)$/i);if(q){n.timelineSort="tag",n.timelineDefaultSwimlaneTG=q[1].trim();continue}let V=A.match(/^active-tag\s+(.+)$/i);if(V){n.timelineActiveTag=V[1].trim();continue}}if(n.type==="timeline"){let B=Xe(Nf,new Set([...T.keys(),...T.values()])),q=jk(A,O,C,v,T,B,u);if(q){n.diagnostics.push(...q.diagnostics),q.event&&n.timelineEvents.push(q.event);continue}if(!/^(era|marker|tag|sort|active-tag|swimlanes|no-scale|no-legend|lane-by|fill-tint|fill-solid|fill-outline)\b/i.test(A)&&!A.startsWith("[")){o(O,`Expected a date at the start \u2014 e.g., '1718 ${A}'`);continue}}if(n.type==="venn"){if(!/^(fill-tint|fill-solid|fill-outline|no-name|no-value|no-percent|no-title)$/i.test(A)){if(/\+/.test(A)){let B=new Set;for(let V of n.vennSets)B.add(V.name.toLowerCase()),V.alias&&B.add(V.alias.toLowerCase());let q=A.split("+").map(V=>V.trim()).filter(Boolean);if(q.length>=2){let V=q.slice(0,-1),z=q[q.length-1].split(/\s+/),U=0;for(let et=z.length;et>=1;et--){let nt=z.slice(0,et).join(" ");if(B.has(nt.toLowerCase())){U=et;break}}let Y,K;U>0?(Y=z.slice(0,U).join(" "),K=z.length>U?z.slice(U).join(" "):null):(Y=z[0],K=z.length>1?z.slice(1).join(" "):null),V.push(Y),n.vennOverlaps.push({sets:V,label:K,lineNumber:O});continue}}}if(!/^(fill-tint|fill-solid|fill-outline|no-name|no-value|no-percent|no-title)$/i.test(A)){let{label:B,colorName:q}=Oi(A),V=null;q&&(V=Yn(q,O,n.diagnostics,e)??null);let X=B.match(/^(.+?)(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*$/i);if(X){let z=X[1].trim(),U=X[2]?.trim()??null;n.vennSets.push({name:z,alias:U,color:V,lineNumber:O});continue}}}if(n.type==="quadrant"){let B=A.match(/^x-label\s+(.*)/i);if(B){let U=B[1].trim(),Y;if(U)Y=U.split(",").map(K=>K.trim());else{let K=ks(a,G);G=K.newIndex,Y=K.values}Y.length>=2&&(n.quadrantXAxis=[Y[0],Y[1]],n.quadrantXAxisLineNumber=O);continue}let q=A.match(/^y-label\s+(.*)/i);if(q){let U=q[1].trim(),Y;if(U)Y=U.split(",").map(K=>K.trim());else{let K=ks(a,G);G=K.newIndex,Y=K.values}Y.length>=2&&(n.quadrantYAxis=[Y[0],Y[1]],n.quadrantYAxisLineNumber=O);continue}let V=/^(top-right|top-left|bottom-left|bottom-right)\s+(.+)/i,X=A.match(V);if(X){let U=X[1].toLowerCase(),Y=X[2].trim(),{label:K,colorName:et}=Oi(Y),nt=et?Yn(et,O,n.diagnostics,e)??null:null,J={text:K,color:nt,lineNumber:O};U==="top-right"?n.quadrantLabels.topRight=J:U==="top-left"?n.quadrantLabels.topLeft=J:U==="bottom-left"?n.quadrantLabels.bottomLeft=J:U==="bottom-right"&&(n.quadrantLabels.bottomRight=J);continue}let z=A.match(/^(.+?)\s+(-?[0-9][0-9,_]*(?:\.[0-9]+)?)\s*([,\s])\s*(-?[0-9][0-9,_]*(?:\.[0-9]+)?)\s*$/);if(z){let U=z[1].trim(),Y=U.toLowerCase();if(Y!=="top-right"&&Y!=="top-left"&&Y!=="bottom-left"&&Y!=="bottom-right"){let K=parseFloat(Vo(z[2])??z[2]),et=parseFloat(Vo(z[4])??z[4]);n.quadrantPoints.push({label:U,x:K,y:et,lineNumber:O})}continue}}let H=A.indexOf(" ");if(H>=0){let B=A.substring(0,H).toLowerCase(),q=A.substring(H+1).trim();if(B==="chart"&&N.has(q.toLowerCase())){n.type=q.toLowerCase();continue}if(B==="title"){n.diagnostics.push(ne(rc,O));continue}if(B==="order"){let V=q.toLowerCase();(V==="name"||V==="group"||V==="degree")&&(n.arcOrder=V);continue}if(B==="layout"){let V=q.toLowerCase();(V==="arc"||V==="chord")&&(n.layout=V);continue}if(B==="rotate"){let V=q.toLowerCase();(V==="none"||V==="mixed"||V==="angled")&&(n.cloudOptions.rotate=V);continue}if(B==="max"){let V=parseInt(q,10);!isNaN(V)&&V>0&&(n.cloudOptions.max=V);continue}if(B==="size"){let V=q.split(",").map(X=>parseInt(X.trim(),10));V.length===2&&V.every(X=>!isNaN(X)&&X>0)&&V[0]<V[1]&&(n.cloudOptions.minSize=V[0],n.cloudOptions.maxSize=V[1]);continue}}{let B=A.toLowerCase();if(B==="no-name"){n.noName=!0;continue}if(B==="no-value"){n.noValue=!0;continue}if(B==="no-percent"){n.noPercent=!0;continue}let q=Gr(B);if(q!==null){q==="tint"?delete n.fillMode:n.fillMode=q;continue}if(B==="no-title"){n.noTitle=!0;continue}if(B==="no-legend"){n.noLegend=!0;continue}if(B==="orientation-vertical"){n.type==="arc"&&(n.orientation="vertical");continue}if(B==="orientation-horizontal"){n.type==="arc"&&(n.orientation="horizontal");continue}if(B.startsWith("no-"))continue}if(n.type==="slope"){if(S){if(D>0){n.periods.push(A);continue}S=!1}if(n.data.length===0){let B=A.match(/^period\b(.*)$/i);if(B){n.periods.length>0&&!S&&o(O,"Duplicate 'period' directive \u2014 periods are already defined");let q=B[1].trim();if(q){let V=q.split(/\s+/);n.periods.push(...V)}else S=!0;continue}}if(n.periods.length===0&&A.includes(",")&&!A.includes(":")){let B=A.split(",").map(V=>V.trim()).filter(Boolean);if(B.length>=2&&B.every(V=>V.length<=20))return r(O,`Period lines require the 'period' keyword \u2014 use 'period ${B.join(" ")}'`)}if(A.includes(":")){let B=A.indexOf(":"),q=A.substring(B+1).trim(),V=q.split(/[,\s]+/).filter(X=>/^-?\d/.test(X));if(V.length>=1){let X=q.split(/[,\s]+/).filter(Boolean);if(V.length>=X.length*.5){let z=A.substring(0,B).trim();return r(O,`Colons are no longer used in slope data rows \u2014 use '${z} ${V.join(" ")}'`)}}}if(n.periods.length>=2){let B=n.periods.length,q=A.split(/\s+/),V=[],X=q.length-1;for(;X>=0&&V.length<B;){let nt=q[X],J=Vo(nt)??nt,F=parseFloat(J);if(!isNaN(F)&&/^-?\d/.test(J))V.unshift(F),X--;else break}if(V.length<B){o(O,`Data row has ${V.length} numeric value(s) but ${B} period(s) are defined \u2014 expected ${B} values`);continue}let U=q.slice(0,X+1).join(" ");if(!U){o(O,"Data row has no label \u2014 add a label before the numeric values");continue}let{label:Y,colorName:K}=Oi(U),et=K?Yn(K,O,n.diagnostics,e)??null:null;if(!Y){o(O,"Data row has no label \u2014 add a label before the numeric values");continue}/^\d[\d,.]*$/.test(Y)&&o(O,`Label '${Y}' looks numeric \u2014 this may indicate too many values or a missing label`),n.data.push({label:Y,values:V,color:et,lineNumber:O});continue}I&&o(O,`Unexpected line: '${A}'.`);continue}let W=A.indexOf(":");if(W!==-1){let B=A.substring(0,W).trim(),q=B.toLowerCase(),V=B.match(/^(.+?)\(([^)]+)\)\s*$/);if(q==="title"){n.diagnostics.push(ne(rc,O));continue}if(q==="order"){let nt=A.substring(W+1).trim().toLowerCase();(nt==="name"||nt==="group"||nt==="degree")&&(n.arcOrder=nt);continue}if(q==="rotate"){let nt=A.substring(W+1).trim().toLowerCase();(nt==="none"||nt==="mixed"||nt==="angled")&&(n.cloudOptions.rotate=nt);continue}if(q==="max"){let nt=parseInt(A.substring(W+1).trim(),10);!isNaN(nt)&&nt>0&&(n.cloudOptions.max=nt);continue}if(q==="size"){let J=A.substring(W+1).trim().split(",").map(F=>parseInt(F.trim(),10));J.length===2&&J.every(F=>!isNaN(F)&&F>0)&&J[0]<J[1]&&(n.cloudOptions.minSize=J[0],n.cloudOptions.maxSize=J[1]);continue}let X=V?V[1].trim():B,z=V?Yn(V[2].trim(),O,n.diagnostics,e)??null:null,Y=A.substring(W+1).trim().split(",").map(nt=>nt.trim()),K=[],et=!0;for(let nt of Y){let J=parseFloat(nt);if(isNaN(J)){et=!1;break}K.push(J)}if(et&&K.length>0&&n.type!=="wordcloud"){n.data.push({label:X,values:K,color:z,lineNumber:O});continue}}if(n.type==="wordcloud"){if(W===-1&&!A.includes(" "))n.words.push({text:A,weight:10,lineNumber:O});else if(W===-1){let B=A.lastIndexOf(" "),q=B>=0?A.substring(B+1):"",V=B>=0?parseFloat(Vo(q)??q):NaN;if(B>=0&&!isNaN(V)&&V>0){let X=A.substring(0,B).trim();n.words.push({text:X,weight:V,lineNumber:O})}else B>=0&&!isNaN(V)&&V<0?n.diagnostics.push(ne(ui,O,{value:V,label:A.substring(0,B).trim(),channel:"wordcloud weights"})):w.push(A)}else w.push(A);continue}I&&o(O,`Unexpected line: '${A}'.`)}if(!n.type){let G=[...N],$=a.find(O=>O.trim()&&!O.trim().startsWith("//"))?.trim()??"",A=xe($.split(/\s/)[0].toLowerCase(),G),D=`Unsupported chart type: "${$.split(/\s/)[0]}". Supported types: ${G.join(", ")}`;return A&&(D+=`. ${A}`),r(1,D)}if(n.type==="sequence")return n;if(n.type==="wordcloud")return n.words.length===0&&w.length>0&&(n.words=NU(w.join(" "))),n.words.length===0&&o(1,'No words found. Add words as "word weight" (space-separated), one per line, or paste freeform text'),n.cloudOptions.max>0&&n.words.length>n.cloudOptions.max&&(n.words=n.words.slice().sort((G,$)=>$.weight-G.weight).slice(0,n.cloudOptions.max)),n;if(n.type==="arc")return n.links.length===0&&o(1,'No links found. Add links as "Source -> Target weight" (e.g., "Alice -> Bob 5")'),n.arcNodeGroups.length>0&&((n.arcOrder==="name"||n.arcOrder==="degree")&&(o(1,`Cannot use "order ${n.arcOrder}" with [Group] headers. Use "order group" or remove group headers.`),n.arcOrder="group"),n.arcOrder==="appearance"&&(n.arcOrder="group")),n;if(n.type==="timeline"){if(n.timelineEvents.length===0&&o(1,'No events found. Add events like "1718 Event Name" or "1716 -> 1717 Event Name"'),n.timelineTagGroups.length>0){Nr(n.timelineEvents,n.timelineTagGroups,(G,$)=>n.diagnostics.push(At(G,$,"warning")),xe),On(n.timelineTagGroups,(G,$)=>n.diagnostics.push(At(G,$,"warning")),(G,$)=>{let A=At(G,$);n.diagnostics.push(A),n.error||(n.error=He(A))});for(let G of n.timelineTagGroups){if(!G.defaultValue)continue;let $=Bt(G.name);for(let A of n.timelineEvents)A.metadata[$]||(A.metadata[$]=G.defaultValue)}}return n}if(n.type==="venn"){if(n.vennSets.length<2)return r(1,'At least 2 sets are required. Add set names (e.g., "Apples", "Oranges")');if(n.vennSets.length>3)return r(1,"Venn diagrams support 2\u20133 sets");let G=new Map(n.vennSets.map(O=>[O.name.toLowerCase(),O.name])),$=new Map;for(let O of n.vennSets)O.alias&&$.set(O.alias.toLowerCase(),O.name);let A=O=>G.get(O.toLowerCase())??$.get(O.toLowerCase())??null,D=[];for(let O of n.vennOverlaps){let P=[],H=!0;for(let W of O.sets){let B=A(W);if(!B){n.diagnostics.push(At(O.lineNumber,`Intersection references unknown set or alias "${W}" \u2014 declare the set first on its own line ('Name [as <alias>] [color]', e.g. 'Navigation as nav blue'), then reference it by that name or alias. (\xA716.4)`)),n.error||(n.error=He(n.diagnostics[n.diagnostics.length-1])),H=!1;break}P.push(B)}H&&D.push({...O,sets:P.sort()})}return n.vennOverlaps=D,n}if(n.type==="quadrant")return n.quadrantPoints.length===0&&o(1,'No data points found. Add points as "Label x, y" (e.g., "Item A 0.5, 0.7")'),n;if(n.periods.length<2)return r(1,"Missing 'period' directive. Add 'period 2020 2024' before data rows (minimum 2 periods required)");n.data.length===0&&o(1,"No data lines found. Add data as 'Label value1 value2' (e.g., 'Blackbeard 40 4')");for(let G of n.data)G.values.length!==n.periods.length&&o(G.lineNumber,`Data item "${G.label}" has ${G.values.length} value(s) but ${n.periods.length} period(s) are defined`);return n.data=n.data.filter(G=>G.values.length===n.periods.length),n}function NU(t){let e=new Map,n=t.toLowerCase().split(/[^a-zA-Z']+/).filter(Boolean);for(let r of n){let o=r.replace(/^'+|'+$/g,"");o.length<2||CU.has(o)||e.set(o,(e.get(o)??0)+1)}return Array.from(e.entries()).map(([r,o])=>({text:r,weight:o,lineNumber:0})).sort((r,o)=>o.weight-r.weight)}var CU,Ss=dt(()=>{"use strict";rr();Je();Ae();Sr();Oe();Pf();ol();Zk();CU=new Set(["a","an","the","and","or","but","in","on","at","to","for","of","with","by","is","am","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","it","its","this","that","these","those","i","me","my","we","us","our","you","your","he","him","his","she","her","they","them","their","what","which","who","whom","how","when","where","why","not","no","nor","so","if","then","than","too","very","just","about","up","out","from","into","over","after","before","between","under","again","there","here","all","each","every","both","few","more","most","other","some","such","only","own","same","also","as","because","until","while","during","through"])});function _U(t){return t.replace(/(\s[\w:.-]+=")([^"]*)"/g,(e,n,r)=>!r.includes("<")&&!r.includes(">")&&!r.includes("&")?e:`${n}${r.replace(TU,"&").replace(/</g,"<").replace(/>/g,">")}"`)}function Fr(t){return _U(t.outerHTML)}var TU,fi=dt(()=>{"use strict";TU=/&(?![a-zA-Z][a-zA-Z0-9]*;|#\d+;|#[xX][0-9a-fA-F]+;)/g});var Hp,db,ub=dt(()=>{"use strict";Hp="http://www.w3.org/1999/xhtml",db={svg:"http://www.w3.org/2000/svg",xhtml:Hp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Fp(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),db.hasOwnProperty(e)?{space:db[e],local:t}:t}var fb=dt(()=>{"use strict";ub()});function AU(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Hp&&e.documentElement.namespaceURI===Hp?e.createElement(t):e.createElementNS(n,t)}}function RU(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wp(t){var e=Fp(t);return(e.local?RU:AU)(e)}var mb=dt(()=>{"use strict";fb();ub()});function IU(){}function zp(t){return t==null?IU:function(){return this.querySelector(t)}}var pb=dt(()=>{"use strict"});function Qk(t){typeof t!="function"&&(t=zp(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var a=e[o],i=a.length,s=r[o]=new Array(i),l,c,d=0;d<i;++d)(l=a[d])&&(c=t.call(l,l.__data__,d,a))&&("__data__"in l&&(c.__data__=l.__data__),s[d]=c);return new Ur(r,this._parents)}var Jk=dt(()=>{"use strict";Gi();pb()});function hb(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var tS=dt(()=>{"use strict"});function PU(){return[]}function eS(t){return t==null?PU:function(){return this.querySelectorAll(t)}}var nS=dt(()=>{"use strict"});function DU(t){return function(){return hb(t.apply(this,arguments))}}function rS(t){typeof t=="function"?t=DU(t):t=eS(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var i=e[a],s=i.length,l,c=0;c<s;++c)(l=i[c])&&(r.push(t.call(l,l.__data__,c,i)),o.push(l));return new Ur(r,o)}var oS=dt(()=>{"use strict";Gi();tS();nS()});function aS(t){return function(){return this.matches(t)}}function Yp(t){return function(e){return e.matches(t)}}var Vp=dt(()=>{"use strict"});function $U(t){return function(){return OU.call(this.children,t)}}function GU(){return this.firstElementChild}function iS(t){return this.select(t==null?GU:$U(typeof t=="function"?t:Yp(t)))}var OU,sS=dt(()=>{"use strict";Vp();OU=Array.prototype.find});function BU(){return Array.from(this.children)}function HU(t){return function(){return qU.call(this.children,t)}}function lS(t){return this.selectAll(t==null?BU:HU(typeof t=="function"?t:Yp(t)))}var qU,cS=dt(()=>{"use strict";Vp();qU=Array.prototype.filter});function dS(t){typeof t!="function"&&(t=aS(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var a=e[o],i=a.length,s=r[o]=[],l,c=0;c<i;++c)(l=a[c])&&t.call(l,l.__data__,c,a)&&s.push(l);return new Ur(r,this._parents)}var uS=dt(()=>{"use strict";Gi();Vp()});function Up(t){return new Array(t.length)}var gb=dt(()=>{"use strict"});function fS(){return new Ur(this._enter||this._groups.map(Up),this._parents)}function Df(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var yb=dt(()=>{"use strict";gb();Gi();Df.prototype={constructor:Df,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}}});function mS(t){return function(){return t}}var pS=dt(()=>{"use strict"});function FU(t,e,n,r,o,a){for(var i=0,s,l=e.length,c=a.length;i<c;++i)(s=e[i])?(s.__data__=a[i],r[i]=s):n[i]=new Df(t,a[i]);for(;i<l;++i)(s=e[i])&&(o[i]=s)}function WU(t,e,n,r,o,a,i){var s,l,c=new Map,d=e.length,u=a.length,f=new Array(d),m;for(s=0;s<d;++s)(l=e[s])&&(f[s]=m=i.call(l,l.__data__,s,e)+"",c.has(m)?o[s]=l:c.set(m,l));for(s=0;s<u;++s)m=i.call(t,a[s],s,a)+"",(l=c.get(m))?(r[s]=l,l.__data__=a[s],c.delete(m)):n[s]=new Df(t,a[s]);for(s=0;s<d;++s)(l=e[s])&&c.get(f[s])===l&&(o[s]=l)}function zU(t){return t.__data__}function hS(t,e){if(!arguments.length)return Array.from(this,zU);var n=e?WU:FU,r=this._parents,o=this._groups;typeof t!="function"&&(t=mS(t));for(var a=o.length,i=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var d=r[c],u=o[c],f=u.length,m=YU(t.call(d,d&&d.__data__,c,r)),p=m.length,h=s[c]=new Array(p),g=i[c]=new Array(p),x=l[c]=new Array(f);n(d,u,h,g,x,m,e);for(var y=0,b=0,w,k;y<p;++y)if(w=h[y]){for(y>=b&&(b=y+1);!(k=g[b])&&++b<p;);w._next=k||null}}return i=new Ur(i,r),i._enter=s,i._exit=l,i}function YU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var gS=dt(()=>{"use strict";Gi();yb();pS()});function yS(){return new Ur(this._exit||this._groups.map(Up),this._parents)}var bS=dt(()=>{"use strict";gb();Gi()});function xS(t,e,n){var r=this.enter(),o=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?a.remove():n(a),r&&o?r.merge(o).order():o}var wS=dt(()=>{"use strict"});function ES(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c=n[l],d=r[l],u=c.length,f=s[l]=new Array(u),m,p=0;p<u;++p)(m=c[p]||d[p])&&(f[p]=m);for(;l<o;++l)s[l]=n[l];return new Ur(s,this._parents)}var kS=dt(()=>{"use strict";Gi()});function SS(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,a=r[o],i;--o>=0;)(i=r[o])&&(a&&i.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(i,a),a=i);return this}var MS=dt(()=>{"use strict"});function vS(t){t||(t=VU);function e(u,f){return u&&f?t(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i=n[a],s=i.length,l=o[a]=new Array(s),c,d=0;d<s;++d)(c=i[d])&&(l[d]=c);l.sort(e)}return new Ur(o,this._parents).order()}function VU(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var LS=dt(()=>{"use strict";Gi()});function CS(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var NS=dt(()=>{"use strict"});function TS(){return Array.from(this)}var _S=dt(()=>{"use strict"});function AS(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null}var RS=dt(()=>{"use strict"});function IS(){let t=0;for(let e of this)++t;return t}var PS=dt(()=>{"use strict"});function DS(){return!this.node()}var OS=dt(()=>{"use strict"});function $S(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],a=0,i=o.length,s;a<i;++a)(s=o[a])&&t.call(s,s.__data__,a,o);return this}var GS=dt(()=>{"use strict"});function UU(t){return function(){this.removeAttribute(t)}}function XU(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jU(t,e){return function(){this.setAttribute(t,e)}}function KU(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ZU(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function QU(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function qS(t,e){var n=Fp(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?XU:UU:typeof e=="function"?n.local?QU:ZU:n.local?KU:jU)(n,e))}var BS=dt(()=>{"use strict";fb()});function Xp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var bb=dt(()=>{"use strict"});function JU(t){return function(){this.style.removeProperty(t)}}function tX(t,e,n){return function(){this.style.setProperty(t,e,n)}}function eX(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function HS(t,e,n){return arguments.length>1?this.each((e==null?JU:typeof e=="function"?eX:tX)(t,e,n??"")):nX(this.node(),t)}function nX(t,e){return t.style.getPropertyValue(e)||Xp(t).getComputedStyle(t,null).getPropertyValue(e)}var FS=dt(()=>{"use strict";bb()});function rX(t){return function(){delete this[t]}}function oX(t,e){return function(){this[t]=e}}function aX(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function WS(t,e){return arguments.length>1?this.each((e==null?rX:typeof e=="function"?aX:oX)(t,e)):this.node()[t]}var zS=dt(()=>{"use strict"});function YS(t){return t.trim().split(/^|\s+/)}function xb(t){return t.classList||new VS(t)}function VS(t){this._node=t,this._names=YS(t.getAttribute("class")||"")}function US(t,e){for(var n=xb(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function XS(t,e){for(var n=xb(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function iX(t){return function(){US(this,t)}}function sX(t){return function(){XS(this,t)}}function lX(t,e){return function(){(e.apply(this,arguments)?US:XS)(this,t)}}function jS(t,e){var n=YS(t+"");if(arguments.length<2){for(var r=xb(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?lX:e?iX:sX)(n,e))}var KS=dt(()=>{"use strict";VS.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}}});function cX(){this.textContent=""}function dX(t){return function(){this.textContent=t}}function uX(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ZS(t){return arguments.length?this.each(t==null?cX:(typeof t=="function"?uX:dX)(t)):this.node().textContent}var QS=dt(()=>{"use strict"});function fX(){this.innerHTML=""}function mX(t){return function(){this.innerHTML=t}}function pX(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function JS(t){return arguments.length?this.each(t==null?fX:(typeof t=="function"?pX:mX)(t)):this.node().innerHTML}var tM=dt(()=>{"use strict"});function hX(){this.nextSibling&&this.parentNode.appendChild(this)}function eM(){return this.each(hX)}var nM=dt(()=>{"use strict"});function gX(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rM(){return this.each(gX)}var oM=dt(()=>{"use strict"});function aM(t){var e=typeof t=="function"?t:Wp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var iM=dt(()=>{"use strict";mb()});function yX(){return null}function sM(t,e){var n=typeof t=="function"?t:Wp(t),r=e==null?yX:typeof e=="function"?e:zp(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}var lM=dt(()=>{"use strict";mb();pb()});function bX(){var t=this.parentNode;t&&t.removeChild(this)}function cM(){return this.each(bX)}var dM=dt(()=>{"use strict"});function xX(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wX(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function uM(t){return this.select(t?wX:xX)}var fM=dt(()=>{"use strict"});function mM(t){return arguments.length?this.property("__data__",t):this.node().__data__}var pM=dt(()=>{"use strict"});function EX(t){return function(e){t.call(this,e,this.__data__)}}function kX(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function SX(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,a;n<o;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function MX(t,e,n){return function(){var r=this.__on,o,a=EX(e);if(r){for(var i=0,s=r.length;i<s;++i)if((o=r[i]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),o.value=e;return}}this.addEventListener(t.type,a,n),o={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(o):this.__on=[o]}}function hM(t,e,n){var r=kX(t+""),o,a=r.length,i;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,c=s.length,d;l<c;++l)for(o=0,d=s[l];o<a;++o)if((i=r[o]).type===d.type&&i.name===d.name)return d.value}return}for(s=e?MX:SX,o=0;o<a;++o)this.each(s(r[o],e,n));return this}var gM=dt(()=>{"use strict"});function yM(t,e,n){var r=Xp(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function vX(t,e){return function(){return yM(this,t,e)}}function LX(t,e){return function(){return yM(this,t,e.apply(this,arguments))}}function bM(t,e){return this.each((typeof e=="function"?LX:vX)(t,e))}var xM=dt(()=>{"use strict";bb()});function*wM(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,a=r.length,i;o<a;++o)(i=r[o])&&(yield i)}var EM=dt(()=>{"use strict"});function Ur(t,e){this._groups=t,this._parents=e}function CX(){return new Ur([[document.documentElement]],wb)}function NX(){return this}var wb,Gi=dt(()=>{"use strict";Jk();oS();sS();cS();uS();gS();yb();bS();wS();kS();MS();LS();NS();_S();RS();PS();OS();GS();BS();FS();zS();KS();QS();tM();nM();oM();iM();lM();dM();fM();pM();gM();xM();EM();wb=[null];Ur.prototype=CX.prototype={constructor:Ur,select:Qk,selectAll:rS,selectChild:iS,selectChildren:lS,filter:dS,data:hS,enter:fS,exit:yS,join:xS,merge:ES,selection:NX,order:SS,sort:vS,call:CS,nodes:TS,node:AS,size:IS,empty:DS,each:$S,attr:qS,style:HS,property:WS,classed:jS,text:ZS,html:JS,raise:eM,lower:rM,append:aM,insert:sM,remove:cM,clone:uM,datum:mM,on:hM,dispatch:bM,[Symbol.iterator]:wM}});function It(t){return typeof t=="string"?new Ur([[document.querySelector(t)]],[document.documentElement]):new Ur([[t]],wb)}var kM=dt(()=>{"use strict";Gi()});var Nn=dt(()=>{"use strict";kM()});var Mt,Ke=dt(()=>{"use strict";Mt="Inter, system-ui, Avenir, Helvetica, Arial, sans-serif"});function jp(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)}function SM(t,e,n){for(let r of _X){let o=t[r];if(typeof o!="string"||!jp(o))throw new Error(`Palette "${n}" ${e}.${r}: invalid hex "${o}"`)}for(let r of TX){let o=t.colors[r];if(typeof o!="string"||!jp(o))throw new Error(`Palette "${n}" ${e}.colors.${r}: invalid hex "${o}"`)}}function Xo(t){SM(t.light,"light",t.id),SM(t.dark,"dark",t.id),md.set(t.id,t)}function Kp(t){return md.get(t)??md.get(Eb)}function kb(t,e){let n=md.get(t);return n||(e?.(`Palette "${t}" is not registered \u2014 falling back to "${Eb}".`),md.get(Eb))}function Zp(){return Array.from(md.values()).sort((t,e)=>t.name.localeCompare(e.name))}var md,Eb,TX,_X,mi=dt(()=>{"use strict";md=new Map,Eb="slate";TX=["red","orange","yellow","green","blue","purple","teal","cyan","gray"],_X=["bg","surface","overlay","border","text","textMuted","primary","secondary","accent","destructive"]});function ic(t){let e=Qp.get(t);if(e)return{...e};let n=t.replace("#",""),r=n.length===3?[...n].map(u=>u+u).join(""):n,o=parseInt(r.substring(0,2),16)/255,a=parseInt(r.substring(2,4),16)/255,i=parseInt(r.substring(4,6),16)/255,s=Math.max(o,a,i),l=Math.min(o,a,i),c=(s+l)/2,d;if(s===l)d={h:0,s:0,l:Math.round(c*100)};else{let u=s-l,f=c>.5?u/(2-s-l):u/(s+l),m;s===o?m=((a-i)/u+(a<i?6:0))/6:s===a?m=((i-o)/u+2)/6:m=((o-a)/u+4)/6,d={h:Math.round(m*360),s:Math.round(f*100),l:Math.round(c*100)}}return Qp.size>=AX&&Qp.clear(),Qp.set(t,d),{...d}}function sc(t,e,n){let r=e/100,o=n/100;if(r===0){let f=Math.round(o*255);return`#${f.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}let a=(f,m,p)=>{let h=p;return h<0&&(h+=1),h>1&&(h-=1),h<1/6?f+(m-f)*6*h:h<1/2?m:h<2/3?f+(m-f)*(2/3-h)*6:f},i=o<.5?o*(1+r):o+r-o*r,s=2*o-i,l=t/360,c=Math.round(a(s,i,l+1/3)*255),d=Math.round(a(s,i,l)*255),u=Math.round(a(s,i,l-1/3)*255);return`#${c.toString(16).padStart(2,"0")}${d.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`}function CM(t){let{h:e,s:n,l:r}=ic(t);return`${e} ${n}% ${r}%`}function NM(t,e){let n=t.replace("#",""),r=n.length===3?[...n].map(d=>d+d).join(""):n,o=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16),s=Math.round(o+(255-o)*e),l=Math.round(a+(255-a)*e),c=Math.round(i+(255-i)*e);return`#${s.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function TM(t,e,n){let r=m=>{let p=m.replace("#",""),h=p.length===3?[...p].map(g=>g+g).join(""):p;return[parseInt(h.substring(0,2),16),parseInt(h.substring(2,4),16),parseInt(h.substring(4,6),16)]},[o,a,i]=r(t),[s,l,c]=r(e),d=Math.round(o+(s-o)*n),u=Math.round(a+(l-a)*n),f=Math.round(i+(c-i)*n);return`#${d.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}function vt(t,e,n){let r=`${t}|${e}|${n}`,o=Jp.get(r);if(o!==void 0)return o;let a=h=>{let g=h.replace("#",""),x=g.length===3?[...g].map(y=>y+y).join(""):g;return[parseInt(x.substring(0,2),16),parseInt(x.substring(2,4),16),parseInt(x.substring(4,6),16)]},[i,s,l]=a(t),[c,d,u]=a(e),f=n/100,m=(h,g)=>Math.round(h*f+g*(1-f)).toString(16).padStart(2,"0"),p=`#${m(i,c)}${m(s,d)}${m(l,u)}`;return Jp.size>=RX&&Jp.clear(),Jp.set(r,p),p}function th(t,e,n,r){let o=Math.max(0,Math.min(1,n));return vt(e,t,o*100)}function _M(t,e,n){return[{offset:0,color:t},{offset:1,color:e}]}function Ms(t){let e=t.replace("#",""),n=e.length===3?[...e].map(i=>i+i).join(""):e,[r,o,a]=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(i=>i<=.04045?i/12.92:((i+.055)/1.055)**2.4);return .2126*r+.7152*o+.0722*a}function al(t,e){let n=Ms(t),r=Ms(e),o=Math.max(n,r),a=Math.min(n,r);return(o+.05)/(a+.05)}function MM(t){let e=t.replace("#",""),n=e.length===3?[...e].map(i=>i+i).join(""):e,[r,o,a]=[0,2,4].map(i=>(parseInt(n.substring(i,i+2),16)/255)**Co.mainTRC);return Co.sRco*r+Co.sGco*o+Co.sBco*a}function vM(t,e){let n=i=>i>Co.blkThrs?i:i+(Co.blkThrs-i)**Co.blkClmp,r=n(MM(t)),o=n(MM(e));if(Math.abs(o-r)<Co.deltaYmin)return 0;if(o>r){let i=(o**Co.normBG-r**Co.normTXT)*Co.scale;return i<Co.loClip?0:(i-Co.loOffset)*100}let a=(o**Co.revBG-r**Co.revTXT)*Co.scale;return a>-Co.loClip?0:(a+Co.loOffset)*100}function pe(t,e,n){return Math.abs(vM(n,t))>=Math.abs(vM(e,t))?n:e}function Ie(t,e){return e?t.surface:t.bg}function ee(t,e,n,r){return r?.mode==="solid"?e:r?.mode==="outline"?Ie(t,n):vt(e,Ie(t,n),25)}function Bn(t){let e=t.colors;return oc.map(n=>e[n])}function pd(t,e){if(e<=0)return[];let n=[...new Set(Bn(t))];if(e<=n.length)return n.slice(0,e);let{bg:r,text:o}=t,a=[s=>vt(s,r,55),s=>vt(s,o,55),s=>vt(s,r,35),s=>vt(s,o,35)],i=[...n];for(let s=0;i.length<e;s++){let l=a[s%a.length];for(let c of n){if(i.length>=e)break;i.push(l(c))}}return i.slice(0,e)}function AM(t,e,n){if(e<=0)return[];let r=Ie(t,n),o=t.colors,a=[...new Set([o.green,o.yellow,o.orange,o.purple,o.red,o.teal,o.cyan,o.blue])],i=n?LM.dark:LM.light,s=[];for(let l of i){if(s.length>=e)break;for(let c of a)s.push(vt(c,r,l))}return s.slice(0,e)}var Qp,AX,Jp,RX,Co,LM,Fe=dt(()=>{"use strict";rr();Qp=new Map,AX=5e3;Jp=new Map,RX=5e3;Co={mainTRC:2.4,sRco:.2126729,sGco:.7151522,sBco:.072175,normBG:.56,normTXT:.57,revTXT:.62,revBG:.65,blkThrs:.022,blkClmp:1.414,scale:1.14,loOffset:.027,deltaYmin:5e-4,loClip:.1};LM={light:[32,48,64,80],dark:[44,58,72,86]}});var Of,Sb=dt(()=>{"use strict";mi();Of={id:"atlas",name:"Atlas",light:{bg:"#f3ead3",surface:"#ece0c0",overlay:"#e8dab8",border:"#bcaa86",text:"#463a26",textMuted:"#7a6a4f",textOnFillLight:"#f7f1de",textOnFillDark:"#3a2e1c",primary:"#5b7a99",secondary:"#7e9a6f",accent:"#b07f7c",destructive:"#b25a45",colors:{red:"#bf6a52",orange:"#cf9a5c",yellow:"#cdb35e",green:"#7e9a6f",blue:"#5b7a99",purple:"#9a7fa6",teal:"#6fa094",cyan:"#79a7b5",gray:"#8a7d68",black:"#463a26",white:"#ece0c0"}},dark:{bg:"#1e2a33",surface:"#27353f",overlay:"#2e3d48",border:"#3d4f5c",text:"#e8dcc0",textMuted:"#a89a7d",textOnFillLight:"#f7f1de",textOnFillDark:"#1a242c",primary:"#7ba0bf",secondary:"#9bb588",accent:"#cf9a96",destructive:"#c9745c",colors:{red:"#cf7a60",orange:"#d9a96a",yellow:"#d8c074",green:"#9bb588",blue:"#7ba0bf",purple:"#b59ac0",teal:"#85b3a6",cyan:"#92bccb",gray:"#9a8d76",black:"#27353f",white:"#e8dcc0"}}};Xo(Of)});var $f,Mb=dt(()=>{"use strict";mi();$f={id:"blueprint",name:"Blueprint",light:{bg:"#f4f8fb",surface:"#e6eef4",overlay:"#dde9f1",border:"#aac3d6",text:"#123a5e",textMuted:"#4f7390",textOnFillLight:"#f4f8fb",textOnFillDark:"#0c2f4d",primary:"#1f5e8c",secondary:"#5b7d96",accent:"#b08a3e",destructive:"#c0504d",colors:{red:"#c25a4e",orange:"#c2823e",yellow:"#c2a843",green:"#4f8a6b",blue:"#1f5e8c",purple:"#6f5e96",teal:"#3a8a8a",cyan:"#3f8fb5",gray:"#7e8e98",black:"#123a5e",white:"#e6eef4"}},dark:{bg:"#103a5e",surface:"#16466e",overlay:"#1c5180",border:"#3a6f96",text:"#eaf2f8",textMuted:"#9fc0d6",textOnFillLight:"#eaf2f8",textOnFillDark:"#0c2f4d",primary:"#7fb8d8",secondary:"#9fb8c8",accent:"#d8c27a",destructive:"#e08a7a",colors:{red:"#e0907e",orange:"#e0ab78",yellow:"#e3d089",green:"#93c79e",blue:"#8ec3e0",purple:"#b6a6d8",teal:"#84c7c2",cyan:"#9fd6e0",gray:"#aebecb",black:"#16466e",white:"#eaf2f8"}}};Xo($f)});var Gf,vb=dt(()=>{"use strict";mi();Gf={id:"catppuccin",name:"Catppuccin",light:{bg:"#eff1f5",surface:"#e6e9ef",overlay:"#ccd0da",border:"#dce0e8",text:"#4c4f69",textMuted:"#5c5f77",textOnFillLight:"#eff1f5",textOnFillDark:"#11111b",primary:"#1e66f5",secondary:"#7287fd",accent:"#8839ef",destructive:"#d20f39",colors:{red:"#d20f39",orange:"#fe640b",yellow:"#df8e1d",green:"#40a02b",blue:"#1e66f5",purple:"#8839ef",teal:"#179299",cyan:"#209fb5",gray:"#9ca0b0",black:"#4c4f69",white:"#e6e9ef"}},dark:{bg:"#1e1e2e",surface:"#313244",overlay:"#45475a",border:"#6c7086",text:"#cdd6f4",textMuted:"#bac2de",textOnFillLight:"#f5e0dc",textOnFillDark:"#11111b",primary:"#89b4fa",secondary:"#b4befe",accent:"#cba6f7",destructive:"#f38ba8",colors:{red:"#f38ba8",orange:"#fab387",yellow:"#f9e2af",green:"#a6e3a1",blue:"#89b4fa",purple:"#cba6f7",teal:"#94e2d5",cyan:"#74c7ec",gray:"#6c7086",black:"#313244",white:"#cdd6f4"}}};Xo(Gf)});var qf,Lb=dt(()=>{"use strict";mi();qf={id:"nord",name:"Nord",light:{bg:"#eceff4",surface:"#e5e9f0",overlay:"#d8dee9",border:"#d8dee9",text:"#2e3440",textMuted:"#4c566a",textOnFillLight:"#eceff4",textOnFillDark:"#2e3440",primary:"#5e81ac",secondary:"#81a1c1",accent:"#81a1c1",destructive:"#bf616a",colors:{red:"#bf616a",orange:"#d08770",yellow:"#ebcb8b",green:"#a3be8c",blue:"#5e81ac",purple:"#b48ead",teal:"#8fbcbb",cyan:"#88c0d0",gray:"#4c566a",black:"#2e3440",white:"#e5e9f0"}},dark:{bg:"#2e3440",surface:"#3b4252",overlay:"#434c5e",border:"#4c566a",text:"#eceff4",textMuted:"#d8dee9",textOnFillLight:"#eceff4",textOnFillDark:"#2e3440",primary:"#88c0d0",secondary:"#81a1c1",accent:"#81a1c1",destructive:"#bf616a",colors:{red:"#bf616a",orange:"#d08770",yellow:"#ebcb8b",green:"#a3be8c",blue:"#5e81ac",purple:"#b48ead",teal:"#8fbcbb",cyan:"#88c0d0",gray:"#4c566a",black:"#3b4252",white:"#eceff4"}}};Xo(qf)});var Bf,Cb=dt(()=>{"use strict";mi();Bf={id:"slate",name:"Slate",light:{bg:"#ffffff",surface:"#f3f5f8",overlay:"#eaeef3",border:"#d4dae1",text:"#1f2933",textMuted:"#5b6672",textOnFillLight:"#ffffff",textOnFillDark:"#1f2933",primary:"#3b6ea5",secondary:"#5b6672",accent:"#3a9188",destructive:"#c0504d",colors:{red:"#c0504d",orange:"#cc7a33",yellow:"#c9a227",green:"#5b9357",blue:"#3b6ea5",purple:"#7d5ba6",teal:"#3a9188",cyan:"#4f96c4",gray:"#7e8a97",black:"#1f2933",white:"#f3f5f8"}},dark:{bg:"#161b22",surface:"#202833",overlay:"#29323e",border:"#38424f",text:"#e6eaef",textMuted:"#9aa5b1",textOnFillLight:"#ffffff",textOnFillDark:"#161b22",primary:"#5b9bd5",secondary:"#8593a3",accent:"#45b3a3",destructive:"#e07b6e",colors:{red:"#e07b6e",orange:"#e0975a",yellow:"#d9bd5a",green:"#74b56e",blue:"#5b9bd5",purple:"#a585c9",teal:"#45b3a3",cyan:"#62b0d9",gray:"#95a1ae",black:"#202833",white:"#e6eaef"}}};Xo(Bf)});var Hf,Nb=dt(()=>{"use strict";mi();Hf={id:"tidewater",name:"Tidewater",light:{bg:"#eceff0",surface:"#e0e4e3",overlay:"#dadfdf",border:"#a9b2b3",text:"#18313f",textMuted:"#51636b",textOnFillLight:"#f3f5f3",textOnFillDark:"#162c38",primary:"#1f4e6b",secondary:"#b08a4f",accent:"#c69a3e",destructive:"#c1433a",colors:{red:"#c1433a",orange:"#cc7a38",yellow:"#d6bf5a",green:"#4f8a6b",blue:"#1f4e6b",purple:"#6a5a8c",teal:"#3d8c8c",cyan:"#4f9bb5",gray:"#8a8d86",black:"#18313f",white:"#e0e4e3"}},dark:{bg:"#0f2230",surface:"#16303f",overlay:"#1d3a4a",border:"#2c4856",text:"#e6ebe8",textMuted:"#9aaab0",textOnFillLight:"#f3f5f3",textOnFillDark:"#0f2230",primary:"#4f9bc4",secondary:"#c9a46a",accent:"#d9b25a",destructive:"#e06a5e",colors:{red:"#e06a5e",orange:"#df9a52",yellow:"#e0c662",green:"#6fb58c",blue:"#4f9bc4",purple:"#9486bf",teal:"#5cb0ac",cyan:"#62b4cf",gray:"#9aa39c",black:"#16303f",white:"#e6ebe8"}}};Xo(Hf)});var Ff,Tb=dt(()=>{"use strict";mi();Ff={id:"tokyo-night",name:"Tokyo Night",light:{bg:"#e1e2e7",surface:"#d0d5e3",overlay:"#c4c8da",border:"#a8aecb",text:"#3760bf",textMuted:"#6172b0",textOnFillLight:"#e1e2e7",textOnFillDark:"#1a1b26",primary:"#2e7de9",secondary:"#007197",accent:"#9854f1",destructive:"#f52a65",colors:{red:"#f52a65",orange:"#b15c00",yellow:"#8c6c3e",green:"#587539",blue:"#2e7de9",purple:"#7847bd",teal:"#118c74",cyan:"#007197",gray:"#8990b3",black:"#1a1b26",white:"#d0d5e3"}},dark:{bg:"#1a1b26",surface:"#292e42",overlay:"#414868",border:"#3b4261",text:"#c0caf5",textMuted:"#a9b1d6",textOnFillLight:"#c0caf5",textOnFillDark:"#1a1b26",primary:"#7aa2f7",secondary:"#7dcfff",accent:"#bb9af7",destructive:"#f7768e",colors:{red:"#f7768e",orange:"#ff9e64",yellow:"#e0af68",green:"#9ece6a",blue:"#7aa2f7",purple:"#bb9af7",teal:"#1abc9c",cyan:"#7dcfff",gray:"#565f89",black:"#292e42",white:"#c0caf5"}}};Xo(Ff)});var _b={};ue(_b,{atlasPalette:()=>Of,blueprintPalette:()=>$f,catppuccinPalette:()=>Gf,contrastText:()=>pe,getAvailablePalettes:()=>Zp,getPalette:()=>Kp,getSegmentColors:()=>pd,getSeriesColors:()=>Bn,hexToHSL:()=>ic,hexToHSLString:()=>CM,hslToHex:()=>sc,isValidHex:()=>jp,nordPalette:()=>qf,palettes:()=>IX,registerPalette:()=>Xo,resolvePaletteOrFallback:()=>kb,shade:()=>TM,shapeFill:()=>ee,slatePalette:()=>Bf,themeBaseBg:()=>Ie,tidewaterPalette:()=>Hf,tint:()=>NM,tokyoNightPalette:()=>Ff});var IX,pi=dt(()=>{"use strict";mi();Fe();Sb();Mb();vb();Lb();Cb();Nb();Tb();Sb();Mb();vb();Lb();Cb();Nb();Tb();IX={atlas:Of,blueprint:$f,slate:Bf,tidewater:Hf,nord:qf,catppuccin:Gf,tokyoNight:Ff}});function ao(t,e,n,r,o,a){if(!e)return;let i=t.append("text").attr("class","chart-title").attr("x",r/2).attr("y",30).attr("text-anchor","middle").attr("fill",o).attr("font-size",20).attr("font-weight","700").style("cursor",a&&n?"pointer":"default").text(e);n&&(i.attr("data-line-number",n),a&&i.on("click",()=>a(n)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}function hi(t,e,n){It(t).selectAll(":not([data-d3-tooltip])").remove();let r=n?.width??t.clientWidth,o=n?.height??t.clientHeight;if(r<=0||o<=0)return null;let a=e.text,i=e.border,s=e.bg,l=Bn(e);return{svg:It(t).append("svg").attr("width",r).attr("height",o).attr("viewBox",`0 0 ${r} ${o}`).style("background",s),width:r,height:o,textColor:a,mutedColor:i,bgColor:s,colors:l}}function eh(t,e,n){t.style.position="relative";let r=t.querySelector("[data-d3-tooltip]");if(r)return r.style.display="none",r.style.background=e.surface,r.style.color=e.text,r.style.boxShadow=n?"0 2px 6px rgba(0,0,0,0.3)":"0 2px 6px rgba(0,0,0,0.12)",r;let o=document.createElement("div");return o.setAttribute("data-d3-tooltip",""),o.style.position="absolute",o.style.display="none",o.style.pointerEvents="none",o.style.background=e.surface,o.style.color=e.text,o.style.padding="6px 10px",o.style.borderRadius="4px",o.style.fontSize="12px",o.style.lineHeight="1.4",o.style.whiteSpace="nowrap",o.style.zIndex="10",o.style.boxShadow=n?"0 2px 6px rgba(0,0,0,0.3)":"0 2px 6px rgba(0,0,0,0.12)",t.appendChild(o),o}function ha(t,e,n){t.innerHTML=e,t.style.display="block";let o=t.parentElement.getBoundingClientRect(),a=n.clientX-o.left+12,i=n.clientY-o.top-28,s=t.offsetWidth,l=t.offsetHeight;a+s>o.width&&(a=o.width-s-4),i<0&&(i=n.clientY-o.top+16),i+l>o.height&&(i=o.height-l-4),t.style.left=`${a}px`,t.style.top=`${i}px`}function il(t){t.style.display="none"}async function kn(t,e){if(e)return e;let{getPalette:n}=await Promise.resolve().then(()=>(pi(),_b));return t==="dark"?n("nord").dark:n("nord").light}function Vn(t,e){let n=document.createElement("div");return n.style.width=`${t}px`,n.style.height=`${e}px`,n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n),n}function Sn(t,e,n){let r=t.querySelector("svg");if(!r)return"";e==="transparent"?r.style.background="none":r.style.background||(r.style.background=n.bg),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.style.fontFamily=Mt,r.querySelectorAll("[data-export-ignore]").forEach(a=>a.remove());let o=Fr(r);return document.body.removeChild(t),o}var nh,rh,qi=dt(()=>{"use strict";fi();Nn();Ke();pi();nh=1200,rh=800});function lc(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var Ab=dt(()=>{"use strict"});function Rb(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var RM=dt(()=>{"use strict"});function oh(t){let e,n,r;t.length!==2?(e=lc,n=(s,l)=>lc(t(s),l),r=(s,l)=>t(s)-l):(e=t===lc||t===Rb?t:PX,n=t,r=t);function o(s,l,c=0,d=s.length){if(c<d){if(e(l,l)!==0)return d;do{let u=c+d>>>1;n(s[u],l)<0?c=u+1:d=u}while(c<d)}return c}function a(s,l,c=0,d=s.length){if(c<d){if(e(l,l)!==0)return d;do{let u=c+d>>>1;n(s[u],l)<=0?c=u+1:d=u}while(c<d)}return c}function i(s,l,c=0,d=s.length){let u=o(s,l,c,d-1);return u>c&&r(s[u-1],l)>-r(s[u],l)?u-1:u}return{left:o,center:i,right:a}}function PX(){return 0}var IM=dt(()=>{"use strict";Ab();RM()});function Ib(t){return t===null?NaN:+t}var PM=dt(()=>{"use strict"});var DM,OM,DX,OX,Pb,$M=dt(()=>{"use strict";Ab();IM();PM();DM=oh(lc),OM=DM.right,DX=DM.left,OX=oh(Ib).center,Pb=OM});function hd(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let a of t)(a=e(a,++o,t))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var GM=dt(()=>{"use strict"});var io,qM=dt(()=>{"use strict";io=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let a=n[o],i=e+a,s=Math.abs(e)<Math.abs(a)?e-(i-a):a-(i-e);s&&(n[r++]=s),e=i}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,a,i=0;if(n>0){for(i=e[--n];n>0&&(r=i,o=e[--n],i=r+o,a=o-(i-r),!a););n>0&&(a<0&&e[n-1]<0||a>0&&e[n-1]>0)&&(o=a*2,r=i+o,o==r-i&&(i=r))}return i}}});function BM({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function $X({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function GX({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function qX(t){return t!==null&&typeof t=="object"?t.valueOf():t}var gd,HM=dt(()=>{"use strict";gd=class extends Map{constructor(e,n=qX){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(BM(this,e))}has(e){return super.has(BM(this,e))}set(e,n){return super.set($X(this,e),n)}delete(e){return super.delete(GX(this,e))}}});function ah(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),a=r/Math.pow(10,o),i=a>=BX?10:a>=HX?5:a>=FX?2:1,s,l,c;return o<0?(c=Math.pow(10,-o)/i,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,o)*i,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?ah(t,e,n*2):[s,l,c]}function ih(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,a,i]=r?ah(e,t,n):ah(t,e,n);if(!(a>=o))return[];let s=a-o+1,l=new Array(s);if(r)if(i<0)for(let c=0;c<s;++c)l[c]=(a-c)/-i;else for(let c=0;c<s;++c)l[c]=(a-c)*i;else if(i<0)for(let c=0;c<s;++c)l[c]=(o+c)/-i;else for(let c=0;c<s;++c)l[c]=(o+c)*i;return l}function Wf(t,e,n){return e=+e,t=+t,n=+n,ah(t,e,n)[2]}function Db(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?Wf(e,t,n):Wf(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}var BX,HX,FX,FM=dt(()=>{"use strict";BX=Math.sqrt(50),HX=Math.sqrt(10),FX=Math.sqrt(2)});function yd(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}var WM=dt(()=>{"use strict"});function bd(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}var zM=dt(()=>{"use strict"});function*WX(t){for(let e of t)yield*e}function xd(t){return Array.from(WX(t))}var YM=dt(()=>{"use strict"});function sh(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(o);++r<o;)a[r]=t+r*n;return a}var VM=dt(()=>{"use strict"});var jo=dt(()=>{"use strict";$M();GM();qM();WM();YM();zM();VM();FM();HM()});function sl(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var zf=dt(()=>{"use strict"});function lh(){var t=new gd,e=[],n=[],r=XM;function o(a){let i=t.get(a);if(i===void 0){if(r!==XM)return r;t.set(a,i=e.push(a)-1)}return n[i%n.length]}return o.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new gd;for(let i of a)t.has(i)||t.set(i,e.push(i)-1);return o},o.range=function(a){return arguments.length?(n=Array.from(a),o):n.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.copy=function(){return lh(e,n).unknown(r)},sl.apply(o,arguments),o}var XM,jM=dt(()=>{"use strict";jo();zf();XM=Symbol("implicit")});function cc(){var t=lh().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,a,i,s=!1,l=0,c=0,d=.5;delete t.unknown;function u(){var f=e().length,m=o<r,p=m?o:r,h=m?r:o;a=(h-p)/Math.max(1,f-l+c*2),s&&(a=Math.floor(a)),p+=(h-p-a*(f-l))*d,i=a*(1-l),s&&(p=Math.round(p),i=Math.round(i));var g=sh(f).map(function(x){return p+a*x});return n(m?g.reverse():g)}return t.domain=function(f){return arguments.length?(e(f),u()):e()},t.range=function(f){return arguments.length?([r,o]=f,r=+r,o=+o,u()):[r,o]},t.rangeRound=function(f){return[r,o]=f,r=+r,o=+o,s=!0,u()},t.bandwidth=function(){return i},t.step=function(){return a},t.round=function(f){return arguments.length?(s=!!f,u()):s},t.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),u()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),u()):l},t.paddingOuter=function(f){return arguments.length?(c=+f,u()):c},t.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),u()):d},t.copy=function(){return cc(e(),[r,o]).round(s).paddingInner(l).paddingOuter(c).align(d)},sl.apply(u(),arguments)}function KM(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return KM(e())},t}function ll(){return KM(cc.apply(null,arguments).paddingInner(1))}var ZM=dt(()=>{"use strict";jo();zf();jM()});function ch(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ob(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}var QM=dt(()=>{"use strict"});function Uf(){}function tv(){return this.rgb().formatHex()}function ZX(){return this.rgb().formatHex8()}function QX(){return sv(this).formatHsl()}function ev(){return this.rgb().formatRgb()}function cl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=zX.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?nv(e):n===3?new ga(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?dh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?dh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=YX.exec(t))?new ga(e[1],e[2],e[3],1):(e=VX.exec(t))?new ga(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=UX.exec(t))?dh(e[1],e[2],e[3],e[4]):(e=XX.exec(t))?dh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=jX.exec(t))?av(e[1],e[2]/100,e[3]/100,1):(e=KX.exec(t))?av(e[1],e[2]/100,e[3]/100,e[4]):JM.hasOwnProperty(t)?nv(JM[t]):t==="transparent"?new ga(NaN,NaN,NaN,0):null}function nv(t){return new ga(t>>16&255,t>>8&255,t&255,1)}function dh(t,e,n,r){return r<=0&&(t=e=n=NaN),new ga(t,e,n,r)}function JX(t){return t instanceof Uf||(t=cl(t)),t?(t=t.rgb(),new ga(t.r,t.g,t.b,t.opacity)):new ga}function Ed(t,e,n,r){return arguments.length===1?JX(t):new ga(t,e,n,r??1)}function ga(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function rv(){return`#${dc(this.r)}${dc(this.g)}${dc(this.b)}`}function tj(){return`#${dc(this.r)}${dc(this.g)}${dc(this.b)}${dc((isNaN(this.opacity)?1:this.opacity)*255)}`}function ov(){let t=mh(this.opacity);return`${t===1?"rgb(":"rgba("}${uc(this.r)}, ${uc(this.g)}, ${uc(this.b)}${t===1?")":`, ${t})`}`}function mh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function uc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function dc(t){return t=uc(t),(t<16?"0":"")+t.toString(16)}function av(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new gi(t,e,n,r)}function sv(t){if(t instanceof gi)return new gi(t.h,t.s,t.l,t.opacity);if(t instanceof Uf||(t=cl(t)),!t)return new gi;if(t instanceof gi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),a=Math.max(e,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(e===a?i=(n-r)/s+(n<r)*6:n===a?i=(r-e)/s+2:i=(e-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new gi(i,s,l,t.opacity)}function lv(t,e,n,r){return arguments.length===1?sv(t):new gi(t,e,n,r??1)}function gi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function iv(t){return t=(t||0)%360,t<0?t+360:t}function uh(t){return Math.max(0,Math.min(1,t||0))}function $b(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Yf,fh,wd,Vf,Bi,zX,YX,VX,UX,XX,jX,KX,JM,cv=dt(()=>{"use strict";QM();Yf=.7,fh=1/Yf,wd="\\s*([+-]?\\d+)\\s*",Vf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zX=/^#([0-9a-f]{3,8})$/,YX=new RegExp(`^rgb\\(${wd},${wd},${wd}\\)$`),VX=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),UX=new RegExp(`^rgba\\(${wd},${wd},${wd},${Vf}\\)$`),XX=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${Vf}\\)$`),jX=new RegExp(`^hsl\\(${Vf},${Bi},${Bi}\\)$`),KX=new RegExp(`^hsla\\(${Vf},${Bi},${Bi},${Vf}\\)$`),JM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ch(Uf,cl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:tv,formatHex:tv,formatHex8:ZX,formatHsl:QX,formatRgb:ev,toString:ev});ch(ga,Ed,Ob(Uf,{brighter(t){return t=t==null?fh:Math.pow(fh,t),new ga(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Yf:Math.pow(Yf,t),new ga(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ga(uc(this.r),uc(this.g),uc(this.b),mh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rv,formatHex:rv,formatHex8:tj,formatRgb:ov,toString:ov}));ch(gi,lv,Ob(Uf,{brighter(t){return t=t==null?fh:Math.pow(fh,t),new gi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Yf:Math.pow(Yf,t),new gi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new ga($b(t>=240?t-240:t+120,o,r),$b(t,o,r),$b(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new gi(iv(this.h),uh(this.s),uh(this.l),mh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=mh(this.opacity);return`${t===1?"hsl(":"hsla("}${iv(this.h)}, ${uh(this.s)*100}%, ${uh(this.l)*100}%${t===1?")":`, ${t})`}`}}))});var Gb=dt(()=>{"use strict";cv()});function qb(t,e,n,r,o){var a=t*t,i=a*t;return((1-3*t+3*a-i)*e+(4-6*a+3*i)*n+(1+3*t+3*a-3*i)*r+i*o)/6}function dv(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],a=t[r+1],i=r>0?t[r-1]:2*o-a,s=r<e-1?t[r+2]:2*a-o;return qb((n-r/e)*e,i,o,a,s)}}var Bb=dt(()=>{"use strict"});function uv(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],a=t[r%e],i=t[(r+1)%e],s=t[(r+2)%e];return qb((n-r/e)*e,o,a,i,s)}}var fv=dt(()=>{"use strict";Bb()});var Xf,Hb=dt(()=>{"use strict";Xf=t=>()=>t});function ej(t,e){return function(n){return t+n*e}}function nj(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function mv(t){return(t=+t)==1?ph:function(e,n){return n-e?nj(e,n,t):Xf(isNaN(e)?n:e)}}function ph(t,e){var n=e-t;return n?ej(t,n):Xf(isNaN(t)?e:t)}var pv=dt(()=>{"use strict";Hb()});function hv(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),a=new Array(n),i,s;for(i=0;i<n;++i)s=Ed(e[i]),r[i]=s.r||0,o[i]=s.g||0,a[i]=s.b||0;return r=t(r),o=t(o),a=t(a),s.opacity=1,function(l){return s.r=r(l),s.g=o(l),s.b=a(l),s+""}}}var Fb,F9t,W9t,gv=dt(()=>{"use strict";Gb();Bb();fv();pv();Fb=(function t(e){var n=mv(e);function r(o,a){var i=n((o=Ed(o)).r,(a=Ed(a)).r),s=n(o.g,a.g),l=n(o.b,a.b),c=ph(o.opacity,a.opacity);return function(d){return o.r=i(d),o.g=s(d),o.b=l(d),o.opacity=c(d),o+""}}return r.gamma=t,r})(1);F9t=hv(dv),W9t=hv(uv)});function yv(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(a){for(o=0;o<n;++o)r[o]=t[o]*(1-a)+e[o]*a;return r}}function bv(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var xv=dt(()=>{"use strict"});function wv(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),a=new Array(n),i;for(i=0;i<r;++i)o[i]=fc(t[i],e[i]);for(;i<n;++i)a[i]=e[i];return function(s){for(i=0;i<r;++i)a[i]=o[i](s);return a}}var Ev=dt(()=>{"use strict";hh()});function kv(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}var Sv=dt(()=>{"use strict"});function dl(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var gh=dt(()=>{"use strict"});function Mv(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=fc(t[o],e[o]):r[o]=e[o];return function(a){for(o in n)r[o]=n[o](a);return r}}var vv=dt(()=>{"use strict";hh()});function rj(t){return function(){return t}}function oj(t){return function(e){return t(e)+""}}function Lv(t,e){var n=zb.lastIndex=Wb.lastIndex=0,r,o,a,i=-1,s=[],l=[];for(t=t+"",e=e+"";(r=zb.exec(t))&&(o=Wb.exec(e));)(a=o.index)>n&&(a=e.slice(n,a),s[i]?s[i]+=a:s[++i]=a),(r=r[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i,x:dl(r,o)})),n=Wb.lastIndex;return n<e.length&&(a=e.slice(n),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?oj(l[0].x):rj(e):(e=l.length,function(c){for(var d=0,u;d<e;++d)s[(u=l[d]).i]=u.x(c);return s.join("")})}var zb,Wb,Cv=dt(()=>{"use strict";gh();zb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wb=new RegExp(zb.source,"g")});function fc(t,e){var n=typeof e,r;return e==null||n==="boolean"?Xf(e):(n==="number"?dl:n==="string"?(r=cl(e))?(e=r,Fb):Lv:e instanceof cl?Fb:e instanceof Date?kv:bv(e)?yv:Array.isArray(e)?wv:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Mv:dl)(t,e)}var hh=dt(()=>{"use strict";Gb();gv();Ev();Sv();gh();vv();Cv();Hb();xv()});function Yb(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Nv=dt(()=>{"use strict"});var Tv=dt(()=>{"use strict";hh();gh();Nv()});function Vb(t){return function(){return t}}var _v=dt(()=>{"use strict"});function Ub(t){return+t}var Av=dt(()=>{"use strict"});function yi(t){return t}function Xb(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Vb(isNaN(e)?NaN:.5)}function aj(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ij(t,e,n){var r=t[0],o=t[1],a=e[0],i=e[1];return o<r?(r=Xb(o,r),a=n(i,a)):(r=Xb(r,o),a=n(a,i)),function(s){return a(r(s))}}function sj(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),a=new Array(r),i=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++i<r;)o[i]=Xb(t[i],t[i+1]),a[i]=n(e[i],e[i+1]);return function(s){var l=Pb(t,s,1,r)-1;return a[l](o[l](s))}}function yh(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function jb(){var t=Rv,e=Rv,n=fc,r,o,a,i=yi,s,l,c;function d(){var f=Math.min(t.length,e.length);return i!==yi&&(i=aj(t[0],t[f-1])),s=f>2?sj:ij,l=c=null,u}function u(f){return f==null||isNaN(f=+f)?a:(l||(l=s(t.map(r),e,n)))(r(i(f)))}return u.invert=function(f){return i(o((c||(c=s(e,t.map(r),dl)))(f)))},u.domain=function(f){return arguments.length?(t=Array.from(f,Ub),d()):t.slice()},u.range=function(f){return arguments.length?(e=Array.from(f),d()):e.slice()},u.rangeRound=function(f){return e=Array.from(f),n=Yb,d()},u.clamp=function(f){return arguments.length?(i=f?!0:yi,d()):i!==yi},u.interpolate=function(f){return arguments.length?(n=f,d()):n},u.unknown=function(f){return arguments.length?(a=f,u):a},function(f,m){return r=f,o=m,d()}}function Kb(){return jb()(yi,yi)}var Rv,Zb=dt(()=>{"use strict";jo();Tv();_v();Av();Rv=[0,1]});function Iv(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function mc(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var jf=dt(()=>{"use strict"});function Hi(t){return t=mc(Math.abs(t)),t?t[1]:NaN}var Kf=dt(()=>{"use strict";jf()});function Pv(t,e){return function(n,r){for(var o=n.length,a=[],i=0,s=t[0],l=0;o>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(o-=s,o+s)),!((l+=s+1)>r));)s=t[i=(i+1)%t.length];return a.reverse().join(e)}}var Dv=dt(()=>{"use strict"});function Ov(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var $v=dt(()=>{"use strict"});function ul(t){if(!(e=lj.exec(t)))throw new Error("invalid format: "+t);var e;return new bh({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function bh(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}var lj,Qb=dt(()=>{"use strict";lj=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;ul.prototype=bh.prototype;bh.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function Gv(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var qv=dt(()=>{"use strict"});function Bv(t,e){var n=mc(t,e);if(!n)return Zf=void 0,t.toPrecision(e);var r=n[0],o=n[1],a=o-(Zf=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+mc(t,Math.max(0,e+a-1))[0]}var Zf,Jb=dt(()=>{"use strict";jf()});function t4(t,e){var n=mc(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var Hv=dt(()=>{"use strict";jf()});var e4,Fv=dt(()=>{"use strict";jf();Jb();Hv();e4={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Iv,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>t4(t*100,e),r:t4,s:Bv,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)}});function n4(t){return t}var Wv=dt(()=>{"use strict"});function Vv(t){var e=t.grouping===void 0||t.thousands===void 0?n4:Pv(zv.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?n4:Ov(zv.call(t.numerals,String)),i=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(u,f){u=ul(u);var m=u.fill,p=u.align,h=u.sign,g=u.symbol,x=u.zero,y=u.width,b=u.comma,w=u.precision,k=u.trim,C=u.type;C==="n"?(b=!0,C="g"):e4[C]||(w===void 0&&(w=12),k=!0,C="g"),(x||m==="0"&&p==="=")&&(x=!0,m="0",p="=");var v=(f&&f.prefix!==void 0?f.prefix:"")+(g==="$"?n:g==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),_=(g==="$"?r:/[%p]/.test(C)?i:"")+(f&&f.suffix!==void 0?f.suffix:""),R=e4[C],L=/[defgprs%]/.test(C);w=w===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function E(M){var S=v,T=_,N,I,G;if(C==="c")T=R(M)+T,M="";else{M=+M;var $=M<0||1/M<0;if(M=isNaN(M)?l:R(Math.abs(M),w),k&&(M=Gv(M)),$&&+M==0&&h!=="+"&&($=!1),S=($?h==="("?h:s:h==="-"||h==="("?"":h)+S,T=(C==="s"&&!isNaN(M)&&Zf!==void 0?Yv[8+Zf/3]:"")+T+($&&h==="("?")":""),L){for(N=-1,I=M.length;++N<I;)if(G=M.charCodeAt(N),48>G||G>57){T=(G===46?o+M.slice(N+1):M.slice(N))+T,M=M.slice(0,N);break}}}b&&!x&&(M=e(M,1/0));var A=S.length+M.length+T.length,D=A<y?new Array(y-A+1).join(m):"";switch(b&&x&&(M=e(D+M,D.length?y-T.length:1/0),D=""),p){case"<":M=S+M+T+D;break;case"=":M=S+D+M+T;break;case"^":M=D.slice(0,A=D.length>>1)+S+M+T+D.slice(A);break;default:M=D+S+M+T;break}return a(M)}return E.toString=function(){return u+""},E}function d(u,f){var m=Math.max(-8,Math.min(8,Math.floor(Hi(f)/3)))*3,p=Math.pow(10,-m),h=c((u=ul(u),u.type="f",u),{suffix:Yv[8+m/3]});return function(g){return h(p*g)}}return{format:c,formatPrefix:d}}var zv,Yv,Uv=dt(()=>{"use strict";Kf();Dv();$v();Qb();qv();Fv();Jb();Wv();zv=Array.prototype.map,Yv=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function r4(t){return xh=Vv(t),wh=xh.format,Eh=xh.formatPrefix,xh}var xh,wh,Eh,Xv=dt(()=>{"use strict";Uv();r4({thousands:",",grouping:[3],currency:["$",""]})});function o4(t){return Math.max(0,-Hi(Math.abs(t)))}var jv=dt(()=>{"use strict";Kf()});function a4(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hi(e)/3)))*3-Hi(Math.abs(t)))}var Kv=dt(()=>{"use strict";Kf()});function i4(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Hi(e)-Hi(t))+1}var Zv=dt(()=>{"use strict";Kf()});var Qv=dt(()=>{"use strict";Xv();Qb();jv();Kv();Zv()});function s4(t,e,n,r){var o=Db(t,e,n),a;switch(r=ul(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=a4(o,i))&&(r.precision=a),Eh(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=i4(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=o4(o))&&(r.precision=a-(r.type==="%")*2);break}}return wh(r)}var Jv=dt(()=>{"use strict";jo();Qv()});function l4(t){var e=t.domain;return t.ticks=function(n){var r=e();return ih(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return s4(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,a=r.length-1,i=r[o],s=r[a],l,c,d=10;for(s<i&&(c=i,i=s,s=c,c=o,o=a,a=c);d-- >0;){if(c=Wf(i,s,n),c===l)return r[o]=i,r[a]=s,e(r);if(c>0)i=Math.floor(i/c)*c,s=Math.ceil(s/c)*c;else if(c<0)i=Math.ceil(i*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function yr(){var t=Kb();return t.copy=function(){return yh(t,yr())},sl.apply(t,arguments),l4(t)}var c4=dt(()=>{"use strict";jo();Zb();zf();Jv()});function tL(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function cj(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function dj(t){return t<0?-t*t:t*t}function uj(t){var e=t(yi,yi),n=1;function r(){return n===1?t(yi,yi):n===.5?t(cj,dj):t(tL(n),tL(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},l4(e)}function kh(){var t=uj(jb());return t.copy=function(){return yh(t,kh()).exponent(t.exponent())},sl.apply(t,arguments),t}function d4(){return kh.apply(null,arguments).exponent(.5)}var eL=dt(()=>{"use strict";c4();Zb();zf()});var bi=dt(()=>{"use strict";ZM();c4();eL()});function Un(t){return function(){return t}}var Jf=dt(()=>{"use strict"});function rL(t){return t>1?0:t<-1?kd:Math.acos(t)}function f4(t){return t>=1?t1:t<=-1?-t1:Math.asin(t)}var u4,Ho,fl,nL,Sh,xi,pc,No,kd,t1,Sd,Mh=dt(()=>{"use strict";u4=Math.abs,Ho=Math.atan2,fl=Math.cos,nL=Math.max,Sh=Math.min,xi=Math.sin,pc=Math.sqrt,No=1e-12,kd=Math.PI,t1=kd/2,Sd=2*kd});function oL(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function mj(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return oL;let n=10**e;return function(r){this._+=r[0];for(let o=1,a=r.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}function aL(){return new gc}var m4,p4,hc,fj,gc,iL=dt(()=>{"use strict";m4=Math.PI,p4=2*m4,hc=1e-6,fj=p4-hc;gc=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?oL:mj(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,a,i){this._append`C${+e},${+n},${+r},${+o},${this._x1=+a},${this._y1=+i}`}arcTo(e,n,r,o,a){if(e=+e,n=+n,r=+r,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let i=this._x1,s=this._y1,l=r-e,c=o-n,d=i-e,u=s-n,f=d*d+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>hc)if(!(Math.abs(u*l-c*d)>hc)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let m=r-i,p=o-s,h=l*l+c*c,g=m*m+p*p,x=Math.sqrt(h),y=Math.sqrt(f),b=a*Math.tan((m4-Math.acos((h+f-g)/(2*x*y)))/2),w=b/y,k=b/x;Math.abs(w-1)>hc&&this._append`L${e+w*d},${n+w*u}`,this._append`A${a},${a},0,0,${+(u*m>d*p)},${this._x1=e+k*l},${this._y1=n+k*c}`}}arc(e,n,r,o,a,i){if(e=+e,n=+n,r=+r,i=!!i,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),l=r*Math.sin(o),c=e+s,d=n+l,u=1^i,f=i?o-a:a-o;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>hc||Math.abs(this._y1-d)>hc)&&this._append`L${c},${d}`,r&&(f<0&&(f=f%p4+p4),f>fj?this._append`A${r},${r},0,1,${u},${e-s},${n-l}A${r},${r},0,1,${u},${this._x1=c},${this._y1=d}`:f>hc&&this._append`A${r},${r},0,${+(f>=m4)},${u},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};aL.prototype=gc.prototype});var sL=dt(()=>{"use strict";iL()});function Md(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new gc(e)}var vh=dt(()=>{"use strict";sL()});function pj(t){return t.innerRadius}function hj(t){return t.outerRadius}function gj(t){return t.startAngle}function yj(t){return t.endAngle}function bj(t){return t&&t.padAngle}function xj(t,e,n,r,o,a,i,s){var l=n-t,c=r-e,d=i-o,u=s-a,f=u*l-d*c;if(!(f*f<No))return f=(d*(e-a)-u*(t-o))/f,[t+f*l,e+f*c]}function Lh(t,e,n,r,o,a,i){var s=t-n,l=e-r,c=(i?a:-a)/pc(s*s+l*l),d=c*l,u=-c*s,f=t+d,m=e+u,p=n+d,h=r+u,g=(f+p)/2,x=(m+h)/2,y=p-f,b=h-m,w=y*y+b*b,k=o-a,C=f*h-p*m,v=(b<0?-1:1)*pc(nL(0,k*k*w-C*C)),_=(C*b-y*v)/w,R=(-C*y-b*v)/w,L=(C*b+y*v)/w,E=(-C*y+b*v)/w,M=_-g,S=R-x,T=L-g,N=E-x;return M*M+S*S>T*T+N*N&&(_=L,R=E),{cx:_,cy:R,x01:-d,y01:-u,x11:_*(o/k-1),y11:R*(o/k-1)}}function yc(){var t=pj,e=hj,n=Un(0),r=null,o=gj,a=yj,i=bj,s=null,l=Md(c);function c(){var d,u,f=+t.apply(this,arguments),m=+e.apply(this,arguments),p=o.apply(this,arguments)-t1,h=a.apply(this,arguments)-t1,g=u4(h-p),x=h>p;if(s||(s=d=l()),m<f&&(u=m,m=f,f=u),!(m>No))s.moveTo(0,0);else if(g>Sd-No)s.moveTo(m*fl(p),m*xi(p)),s.arc(0,0,m,p,h,!x),f>No&&(s.moveTo(f*fl(h),f*xi(h)),s.arc(0,0,f,h,p,x));else{var y=p,b=h,w=p,k=h,C=g,v=g,_=i.apply(this,arguments)/2,R=_>No&&(r?+r.apply(this,arguments):pc(f*f+m*m)),L=Sh(u4(m-f)/2,+n.apply(this,arguments)),E=L,M=L,S,T;if(R>No){var N=f4(R/f*xi(_)),I=f4(R/m*xi(_));(C-=N*2)>No?(N*=x?1:-1,w+=N,k-=N):(C=0,w=k=(p+h)/2),(v-=I*2)>No?(I*=x?1:-1,y+=I,b-=I):(v=0,y=b=(p+h)/2)}var G=m*fl(y),$=m*xi(y),A=f*fl(k),D=f*xi(k);if(L>No){var O=m*fl(b),P=m*xi(b),H=f*fl(w),W=f*xi(w),B;if(g<kd)if(B=xj(G,$,H,W,O,P,A,D)){var q=G-B[0],V=$-B[1],X=O-B[0],z=P-B[1],U=1/xi(rL((q*X+V*z)/(pc(q*q+V*V)*pc(X*X+z*z)))/2),Y=pc(B[0]*B[0]+B[1]*B[1]);E=Sh(L,(f-Y)/(U-1)),M=Sh(L,(m-Y)/(U+1))}else E=M=0}v>No?M>No?(S=Lh(H,W,G,$,m,M,x),T=Lh(O,P,A,D,m,M,x),s.moveTo(S.cx+S.x01,S.cy+S.y01),M<L?s.arc(S.cx,S.cy,M,Ho(S.y01,S.x01),Ho(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,M,Ho(S.y01,S.x01),Ho(S.y11,S.x11),!x),s.arc(0,0,m,Ho(S.cy+S.y11,S.cx+S.x11),Ho(T.cy+T.y11,T.cx+T.x11),!x),s.arc(T.cx,T.cy,M,Ho(T.y11,T.x11),Ho(T.y01,T.x01),!x))):(s.moveTo(G,$),s.arc(0,0,m,y,b,!x)):s.moveTo(G,$),!(f>No)||!(C>No)?s.lineTo(A,D):E>No?(S=Lh(A,D,O,P,f,-E,x),T=Lh(G,$,H,W,f,-E,x),s.lineTo(S.cx+S.x01,S.cy+S.y01),E<L?s.arc(S.cx,S.cy,E,Ho(S.y01,S.x01),Ho(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,E,Ho(S.y01,S.x01),Ho(S.y11,S.x11),!x),s.arc(0,0,f,Ho(S.cy+S.y11,S.cx+S.x11),Ho(T.cy+T.y11,T.cx+T.x11),x),s.arc(T.cx,T.cy,E,Ho(T.y11,T.x11),Ho(T.y01,T.x01),!x))):s.arc(0,0,f,k,w,x)}if(s.closePath(),d)return s=null,d+""||null}return c.centroid=function(){var d=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,u=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-kd/2;return[fl(u)*d,xi(u)*d]},c.innerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:Un(+d),c):t},c.outerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:Un(+d),c):e},c.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:Un(+d),c):n},c.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Un(+d),c):r},c.startAngle=function(d){return arguments.length?(o=typeof d=="function"?d:Un(+d),c):o},c.endAngle=function(d){return arguments.length?(a=typeof d=="function"?d:Un(+d),c):a},c.padAngle=function(d){return arguments.length?(i=typeof d=="function"?d:Un(+d),c):i},c.context=function(d){return arguments.length?(s=d??null,c):s},c}var lL=dt(()=>{"use strict";Jf();Mh();vh()});function vd(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var PEt,Ch=dt(()=>{"use strict";PEt=Array.prototype.slice});function cL(t){this._context=t}function bc(t){return new cL(t)}var Nh=dt(()=>{"use strict";cL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}}});function Th(t){return t[0]}function _h(t){return t[1]}var h4=dt(()=>{"use strict"});function lr(t,e){var n=Un(!0),r=null,o=bc,a=null,i=Md(s);t=typeof t=="function"?t:t===void 0?Th:Un(t),e=typeof e=="function"?e:e===void 0?_h:Un(e);function s(l){var c,d=(l=vd(l)).length,u,f=!1,m;for(r==null&&(a=o(m=i())),c=0;c<=d;++c)!(c<d&&n(u=l[c],c,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(u,c,l),+e(u,c,l));if(m)return a=null,m+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Un(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Un(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Un(!!l),s):n},s.curve=function(l){return arguments.length?(o=l,r!=null&&(a=o(r)),s):o},s.context=function(l){return arguments.length?(l==null?r=a=null:a=o(r=l),s):r},s}var g4=dt(()=>{"use strict";Ch();Jf();Nh();vh();h4()});function xc(t,e,n){var r=null,o=Un(!0),a=null,i=bc,s=null,l=Md(c);t=typeof t=="function"?t:t===void 0?Th:Un(+t),e=typeof e=="function"?e:e===void 0?Un(0):Un(+e),n=typeof n=="function"?n:n===void 0?_h:Un(+n);function c(u){var f,m,p,h=(u=vd(u)).length,g,x=!1,y,b=new Array(h),w=new Array(h);for(a==null&&(s=i(y=l())),f=0;f<=h;++f){if(!(f<h&&o(g=u[f],f,u))===x)if(x=!x)m=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=f-1;p>=m;--p)s.point(b[p],w[p]);s.lineEnd(),s.areaEnd()}x&&(b[f]=+t(g,f,u),w[f]=+e(g,f,u),s.point(r?+r(g,f,u):b[f],n?+n(g,f,u):w[f]))}if(y)return s=null,y+""||null}function d(){return lr().defined(o).curve(i).context(a)}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:Un(+u),r=null,c):t},c.x0=function(u){return arguments.length?(t=typeof u=="function"?u:Un(+u),c):t},c.x1=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Un(+u),c):r},c.y=function(u){return arguments.length?(e=typeof u=="function"?u:Un(+u),n=null,c):e},c.y0=function(u){return arguments.length?(e=typeof u=="function"?u:Un(+u),c):e},c.y1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:Un(+u),c):n},c.lineX0=c.lineY0=function(){return d().x(t).y(e)},c.lineY1=function(){return d().x(t).y(n)},c.lineX1=function(){return d().x(r).y(e)},c.defined=function(u){return arguments.length?(o=typeof u=="function"?u:Un(!!u),c):o},c.curve=function(u){return arguments.length?(i=u,a!=null&&(s=i(a)),c):i},c.context=function(u){return arguments.length?(u==null?a=s=null:s=i(a=u),c):a},c}var dL=dt(()=>{"use strict";Ch();Jf();Nh();g4();vh();h4()});function uL(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}var fL=dt(()=>{"use strict"});function mL(t){return t}var pL=dt(()=>{"use strict"});function y4(){var t=mL,e=uL,n=null,r=Un(0),o=Un(Sd),a=Un(0);function i(s){var l,c=(s=vd(s)).length,d,u,f=0,m=new Array(c),p=new Array(c),h=+r.apply(this,arguments),g=Math.min(Sd,Math.max(-Sd,o.apply(this,arguments)-h)),x,y=Math.min(Math.abs(g)/c,a.apply(this,arguments)),b=y*(g<0?-1:1),w;for(l=0;l<c;++l)(w=p[m[l]=l]=+t(s[l],l,s))>0&&(f+=w);for(e!=null?m.sort(function(k,C){return e(p[k],p[C])}):n!=null&&m.sort(function(k,C){return n(s[k],s[C])}),l=0,u=f?(g-c*b)/f:0;l<c;++l,h=x)d=m[l],w=p[d],x=h+(w>0?w*u:0)+b,p[d]={data:s[d],index:l,value:w,startAngle:h,endAngle:x,padAngle:y};return p}return i.value=function(s){return arguments.length?(t=typeof s=="function"?s:Un(+s),i):t},i.sortValues=function(s){return arguments.length?(e=s,n=null,i):e},i.sort=function(s){return arguments.length?(n=s,e=null,i):n},i.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:Un(+s),i):r},i.endAngle=function(s){return arguments.length?(o=typeof s=="function"?s:Un(+s),i):o},i.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Un(+s),i):a},i}var hL=dt(()=>{"use strict";Ch();Jf();fL();pL();Mh()});function b4(t){return new Ah(t,!0)}function x4(t){return new Ah(t,!1)}var Ah,gL=dt(()=>{"use strict";Ah=class{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}});function yL(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function bL(t){this._context=t}function To(t){return new bL(t)}var xL=dt(()=>{"use strict";bL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:yL(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:yL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}}});function wL(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Rh(t,e){this._context=t,this._k=(1-e)/6}var skt,EL=dt(()=>{"use strict";Rh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wL(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:wL(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};skt=(function t(e){function n(r){return new Rh(r,e)}return n.tension=function(r){return t(+r)},n})(0)});function wj(t,e,n){var r=t._x1,o=t._y1,a=t._x2,i=t._y2;if(t._l01_a>No){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>No){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,d=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/d,i=(i*c+t._y1*t._l23_2a-n*t._l12_2a)/d}t._context.bezierCurveTo(r,o,a,i,t._x2,t._y2)}function kL(t,e){this._context=t,this._alpha=e}var w4,SL=dt(()=>{"use strict";Mh();EL();kL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wj(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};w4=(function t(e){function n(r){return e?new kL(r,e):new Rh(r,0)}return n.alpha=function(r){return t(+r)},n})(.5)});function ML(t){return t<0?-1:1}function vL(t,e,n){var r=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(r||o<0&&-0),i=(n-t._y1)/(o||r<0&&-0),s=(a*o+i*r)/(r+o);return(ML(a)+ML(i))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs(s))||0}function LL(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function E4(t,e,n){var r=t._x0,o=t._y0,a=t._x1,i=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,o+s*e,a-s,i-s*n,a,i)}function Ih(t){this._context=t}function Ej(t){this._context=new CL(t)}function CL(t){this._context=t}function Ld(t){return new Ih(t)}var NL=dt(()=>{"use strict";Ih.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:E4(this,this._t0,LL(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,E4(this,LL(this,n=vL(this,t,e)),n);break;default:E4(this,this._t0,n=vL(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};(Ej.prototype=Object.create(Ih.prototype)).point=function(t,e){Ih.prototype.point.call(this,e,t)};CL.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,a){this._context.bezierCurveTo(e,t,r,n,a,o)}}});var Fo=dt(()=>{"use strict";lL();dL();g4();hL();xL();gL();SL();Nh();NL()});var TL,_L,e1,k4=dt(()=>{"use strict";TL={" ":.281,"!":.288,'"':.466,"#":.633,$:.642,"%":.982,"&":.644,"'":.3,"(":.365,")":.365,"*":.501,"+":.662,",":.288,"-":.46,".":.288,"/":.36,0:.631,1:.407,2:.61,3:.618,4:.646,5:.593,6:.62,7:.566,8:.619,9:.62,":":.288,";":.302,"<":.662,"=":.662,">":.662,"?":.511,"@":.966,A:.69,B:.654,C:.73,D:.722,E:.601,F:.59,G:.746,H:.743,I:.269,J:.571,K:.672,L:.565,M:.903,N:.753,O:.765,P:.639,Q:.765,R:.644,S:.642,T:.646,U:.744,V:.69,W:.985,X:.682,Y:.679,Z:.629,"[":.365,"\\":.36,"]":.365,"^":.471,_:.456,"`":.323,a:.562,b:.612,c:.571,d:.612,e:.583,f:.37,g:.613,h:.591,i:.242,j:.242,k:.549,l:.242,m:.876,n:.591,o:.6,p:.612,q:.612,r:.376,s:.528,t:.327,u:.591,v:.562,w:.818,x:.546,y:.562,z:.552,"{":.426,"|":.333,"}":.426,"~":.662,"\xA0":.281,"\xA1":.288,"\xA2":.571,"\xA3":.611,"\xA4":.725,"\xA5":.55,"\xA6":.27,"\xA7":.568,"\xA8":.591,"\xA9":.914,\u00AA:.454,"\xAB":.583,"\xAC":.662,"\xAE":.666,"\xAF":.478,"\xB0":.456,"\xB1":.662,"\xB2":.442,"\xB3":.446,"\xB4":.323,\u00B5:.586,"\xB6":.603,"\xB7":.288,"\xB8":.268,"\xB9":.304,\u00BA:.482,"\xBB":.583,"\xBC":.802,"\xBD":.847,"\xBE":.882,"\xBF":.511,\u00C0:.69,\u00C1:.69,\u00C2:.69,\u00C3:.69,\u00C4:.69,\u00C5:.69,\u00C6:.994,\u00C7:.73,\u00C8:.601,\u00C9:.601,\u00CA:.601,\u00CB:.601,\u00CC:.269,\u00CD:.269,\u00CE:.269,\u00CF:.269,\u00D0:.735,\u00D1:.753,\u00D2:.765,\u00D3:.765,\u00D4:.765,\u00D5:.765,\u00D6:.765,"\xD7":.662,\u00D8:.765,\u00D9:.744,\u00DA:.744,\u00DB:.744,\u00DC:.744,\u00DD:.679,\u00DE:.636,\u00DF:.616,\u00E0:.562,\u00E1:.562,\u00E2:.562,\u00E3:.562,\u00E4:.562,\u00E5:.562,\u00E6:.917,\u00E7:.571,\u00E8:.583,\u00E9:.583,\u00EA:.583,\u00EB:.583,\u00EC:.242,\u00ED:.242,\u00EE:.242,\u00EF:.242,\u00F0:.583,\u00F1:.591,\u00F2:.6,\u00F3:.6,\u00F4:.6,\u00F5:.6,\u00F6:.6,"\xF7":.662,\u00F8:.6,\u00F9:.591,\u00FA:.591,\u00FB:.591,\u00FC:.591,\u00FD:.562,\u00FE:.612,\u00FF:.562,"\u2013":.5,"\u2014":1,"\u2018":.261,"\u2019":.261,"\u201A":.241,"\u201C":.44,"\u201D":.44,"\u201E":.421,"\u2020":.491,"\u2021":.491,"\u2022":.563,"\u2026":.864,"\u20AC":.667,"\u2122":.611,"\u2190":.954,"\u2192":.954,"\u2194":1.341,"\u2248":.662,"\u2260":.662,"\u2264":.662,"\u2265":.662},_L={" ":.237,"!":.338,'"':.552,"#":.649,$:.655,"%":1.016,"&":.672,"'":.339,"(":.377,")":.377,"*":.559,"+":.679,",":.334,"-":.468,".":.334,"/":.388,0:.674,1:.431,2:.63,3:.646,4:.676,5:.622,6:.649,7:.582,8:.651,9:.649,":":.334,";":.343,"<":.679,"=":.679,">":.679,"?":.56,"@":1.016,A:.747,B:.662,C:.74,D:.722,E:.607,F:.587,G:.75,H:.747,I:.281,J:.584,K:.719,L:.565,M:.932,N:.762,O:.771,P:.648,Q:.777,R:.657,S:.655,T:.667,U:.732,V:.747,W:1.038,X:.738,Y:.731,Z:.664,"[":.377,"\\":.388,"]":.377,"^":.487,_:.476,"`":.365,a:.581,b:.63,c:.588,d:.63,e:.596,f:.398,g:.632,h:.623,i:.271,j:.271,k:.58,l:.271,m:.913,n:.623,o:.613,p:.63,q:.63,r:.407,s:.56,t:.366,u:.623,v:.6,w:.85,x:.58,y:.602,z:.573,"{":.469,"|":.372,"}":.469,"~":.679,"\xA0":.237,"\xA1":.338,"\xA2":.588,"\xA3":.639,"\xA4":.762,"\xA5":.57,"\xA6":.339,"\xA7":.568,"\xA8":.623,"\xA9":.914,\u00AA:.464,"\xAB":.66,"\xAC":.679,"\xAE":.662,"\xAF":.439,"\xB0":.459,"\xB1":.679,"\xB2":.46,"\xB3":.472,"\xB4":.365,\u00B5:.628,"\xB6":.599,"\xB7":.334,"\xB8":.364,"\xB9":.333,\u00BA:.49,"\xBB":.66,"\xBC":.846,"\xBD":.881,"\xBE":.92,"\xBF":.56,\u00C0:.747,\u00C1:.747,\u00C2:.747,\u00C3:.747,\u00C4:.747,\u00C5:.747,\u00C6:1.022,\u00C7:.74,\u00C8:.607,\u00C9:.607,\u00CA:.607,\u00CB:.607,\u00CC:.281,\u00CD:.281,\u00CE:.281,\u00CF:.281,\u00D0:.76,\u00D1:.762,\u00D2:.771,\u00D3:.771,\u00D4:.771,\u00D5:.771,\u00D6:.771,"\xD7":.679,\u00D8:.771,\u00D9:.732,\u00DA:.732,\u00DB:.732,\u00DC:.732,\u00DD:.731,\u00DE:.669,\u00DF:.657,\u00E0:.581,\u00E1:.581,\u00E2:.581,\u00E3:.581,\u00E4:.581,\u00E5:.581,\u00E6:.91,\u00E7:.588,\u00E8:.596,\u00E9:.596,\u00EA:.596,\u00EB:.596,\u00EC:.271,\u00ED:.271,\u00EE:.271,\u00EF:.271,\u00F0:.599,\u00F1:.623,\u00F2:.613,\u00F3:.613,\u00F4:.613,\u00F5:.613,\u00F6:.613,"\xF7":.679,\u00F8:.613,\u00F9:.623,\u00FA:.623,\u00FB:.623,\u00FC:.623,\u00FD:.602,\u00FE:.63,\u00FF:.602,"\u2013":.5,"\u2014":1,"\u2018":.311,"\u2019":.311,"\u201A":.289,"\u201C":.54,"\u201D":.532,"\u201E":.51,"\u2020":.583,"\u2021":.583,"\u2022":.474,"\u2026":1.002,"\u20AC":.685,"\u2122":.64,"\u2190":.954,"\u2192":.954,"\u2194":1.341,"\u2248":.679,"\u2260":.679,"\u2264":.679,"\u2265":.679},e1=.603});function PL(t){if(t<RL)return e1;if(IL.test(String.fromCodePoint(t)))return 0;for(let[e,n,r]of kj){if(t<e)break;if(t<=n)return r}return e1}function S4(t){let e=!0;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>=RL){e=!1;break}if(e)return t.split("");if(AL){let r=[];for(let{segment:o}of AL.segment(t))r.push(o);return r}let n=[];for(let r of t)n.length>0&&IL.test(r)?n[n.length-1]+=r:n.push(r);return n}var kj,RL,IL,AL,DL=dt(()=>{"use strict";k4();kj=[[880,1023,.559],[1024,1327,.604],[1424,1535,.499],[1536,1791,.447],[1872,1919,.447],[2208,2303,.447],[2304,2431,.553],[3584,3711,.589],[4352,4607,1],[7936,8191,.559],[11904,12031,1],[12288,12351,1],[12352,12543,1],[12592,12687,1],[12784,12799,1],[13312,19903,1],[19968,40959,1],[42560,42655,.604],[43232,43263,.553],[43360,43391,1],[44032,55295,1],[63744,64255,1],[64336,65023,.447],[65136,65279,.447],[65281,65376,1],[131072,195103,1]],RL=768,IL=/\p{M}/u;AL=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0});function Cd(t,e,n,r){let o=$L(r),a=t;for(let i=0;i<e.length;i++){let s=o[e.charAt(i)];if(s!==void 0){a+=s*n;continue}let l=e.codePointAt(i);l!==void 0&&(l>65535&&i++,a+=PL(l)*n)}return a}function Tt(t,e,n){let r=`${n?.bold?"b":"r"}|${e}|${t}`,o=Ph.get(r);if(o!==void 0)return o;let a=Cd(0,t,e,n);return Ph.size>=Sj&&Ph.clear(),Ph.set(r,a),a}function Gn(t,e,n,r){if(Tt(t,e,r)<=n)return t;let o="\u2026",a=Tt(o,e,r);if(a>n)return"";let i=S4(t),s=[0];for(let d=0;d<i.length;d++)s.push(Cd(s[d],i[d],e,r));let l=0,c=i.length;for(;l<c;){let d=Math.ceil((l+c)/2);s[d]+a<=n?l=d:c=d-1}return l===0?o:i.slice(0,l).join("")+o}function hn(t,e,n,r){let o=t.split(/\s+/).filter(u=>u.length>0);if(o.length===0)return[""];let a=r?.hardBreak??!1,i=($L(r)[" "]??OL)*e,s=[],l="",c=0,d=u=>{let f=Cd(l?c+i:0,u,e,r);f<=n||!l?(l=l?`${l} ${u}`:u,c=f):(s.push(l),l=u,c=Cd(0,u,e,r))};for(let u of o){if(a&&Tt(u,e,r)>n){l&&(s.push(l),l="",c=0);let f="",m=0;for(let p of S4(u)){let h=Cd(m,p,e,r);f&&h>n?(s.push(f),f=p,m=Cd(0,p,e,r)):(f+=p,m=h)}l=f,c=m;continue}d(u)}return l&&s.push(l),s.length>0?s:[""]}var OL,$L,aa,Ph,Sj,Ve=dt(()=>{"use strict";k4();DL();OL=e1,$L=t=>t?.bold?_L:TL,aa=OL,Ph=new Map,Sj=1e4});var Le,wr=dt(()=>{"use strict";Le=class t{factor;isBelowFloor;constructor(e,n){this.factor=e,this.isBelowFloor=e<=n}static from(e,n,r=.5){if(n<=0)return t.identity();let o=e/n,a=Math.max(Math.min(o,1),r);return new t(a,r)}static fromBox(e,n,r,o,a=.5){let i=n>0?e/n:1,s=o>0?r/o:1,l=Math.min(i,s),c=Math.max(Math.min(l,1),a);return new t(c,a)}static fromFactor(e,n=.5){let r=Math.max(Math.min(e,1),n);return new t(r,n)}static identity(){return new t(1,.5)}aesthetic(e){return this.factor>=1?e:e*this.factor**1.5}structural(e){return this.factor>=1?e:e*this.factor}text(e,n=9){return this.factor>=1?e:Math.max(e*this.factor,n)}}});function Oh(t,e){return Lo(t,e)}var M4=dt(()=>{"use strict";Ss()});function Nd(t,e){return Lo(t,e)}var L4=dt(()=>{"use strict";Ss()});function C4(t){let e=Math.floor(t),n=t-e,r=n*12,o=Math.floor(r),i=(n-o/12)*365,s=Math.floor(i)+1,c=(i-Math.floor(i))*24,d=Math.floor(c),u=(c-d)*60,f=Math.floor(u),m=Math.round((u-f)*60);return new Date(e,o,s,d,f,m)}function N4(t){return t.getFullYear()+t.getMonth()/12+(t.getDate()-1)/365+t.getHours()/8760+t.getMinutes()/525600+t.getSeconds()/31536e3}function Bj(t){return t<0?`${-t} BCE`:String(t)}function $h(t,e,n,r,o,a,i){let s=Math.floor(t),l=Math.floor(e),c=e-t,d=[],u=Math.ceil(t),f=Math.floor(e);if(f>=u+1){let p=f-u,h=1;p>800?h=200:p>400?h=100:p>160?h=50:p>80?h=20:p>40?h=10:p>20?h=5:p>10&&(h=2);let g=Math.ceil(u/h)*h;for(let x=g;x<=f;x+=h)d.push({pos:n(x),label:Bj(x)})}else if(c>.25){let p=l>s;for(let h=s;h<=l+1;h++)for(let g=1;g<=12;g++){let x=h+(g-1)/12;if(x>e)break;if(x>=t){let y=wc[g-1];d.push({pos:n(x),label:p?`${y} '${String(h).slice(-2)}`:y})}}}else if(c<=114e-7){let p=5,h=c*31536e3;h>180?p=30:h>60?p=15:h>30&&(p=10);let g=C4(t);for(g.setSeconds(Math.floor(g.getSeconds()/p)*p,0);;){let x=N4(g);if(x>e)break;if(x>=t){let y=String(g.getHours()).padStart(2,"0"),b=String(g.getMinutes()).padStart(2,"0"),w=String(g.getSeconds()).padStart(2,"0");d.push({pos:n(x),label:`${y}:${b}:${w}`})}g.setSeconds(g.getSeconds()+p)}}else if(c<=685e-6){let p=5,h=c*8760;h>3?p=30:h>1?p=15:h>.5&&(p=10);let g=C4(t);for(g.setMinutes(Math.floor(g.getMinutes()/p)*p,0,0);;){let x=N4(g);if(x>e)break;if(x>=t){let y=String(g.getHours()).padStart(2,"0"),b=String(g.getMinutes()).padStart(2,"0");d.push({pos:n(x),label:`${y}:${b}`})}g.setMinutes(g.getMinutes()+p)}}else if(c<=.00822){let p=1,h=c*8760;h>48?p=6:h>24?p=3:h>12&&(p=2);let g=h<=24,x=C4(t);for(x.setHours(Math.floor(x.getHours()/p)*p,0,0,0);;){let y=N4(x);if(y>e)break;if(y>=t){let b=String(x.getHours()).padStart(2,"0"),w=String(x.getMinutes()).padStart(2,"0");if(g)d.push({pos:n(y),label:`${b}:${w}`});else{let k=wc[x.getMonth()],C=x.getDate();d.push({pos:n(y),label:`${k} ${C} ${b}:${w}`})}}x.setHours(x.getHours()+p)}}else for(let p=s;p<=l+1;p++)for(let h=1;h<=12;h++)for(let g of[1,8,15,22]){let x=p+(h-1)/12+(g-1)/365;if(x>e)break;x>=t&&d.push({pos:n(x),label:`${wc[h-1]} ${g}`})}let m=40;if(r!==void 0&&a){let p=n(r);d=d.filter(h=>Math.abs(h.pos-p)>=m),d.unshift({pos:p,label:a})}if(o!==void 0&&i){let p=n(o);d=d.filter(h=>Math.abs(h.pos-p)>=m),d.push({pos:p,label:i})}return d}var wc,T4=dt(()=>{"use strict";wc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var zL={};ue(zL,{CONTROLS_ICON_PATH:()=>qh,EYE_CLOSED_PATH:()=>r1,EYE_OPEN_PATH:()=>n1,LEGEND_CAPSULE_PAD:()=>qn,LEGEND_DOT_R:()=>Tr,LEGEND_ENTRY_DOT_GAP:()=>Ir,LEGEND_ENTRY_FONT_SIZE:()=>Qn,LEGEND_ENTRY_TRAIL:()=>Qr,LEGEND_EYE_GAP:()=>Ha,LEGEND_EYE_SIZE:()=>_o,LEGEND_GEAR_PILL_W:()=>Wi,LEGEND_GROUP_GAP:()=>Mn,LEGEND_HEIGHT:()=>Se,LEGEND_ICON_W:()=>Td,LEGEND_MAX_ENTRY_ROWS:()=>Gh,LEGEND_PILL_FONT_SIZE:()=>Er,LEGEND_PILL_PAD:()=>xo,LEGEND_TOGGLE_DOT_R:()=>Cs,LEGEND_TOGGLE_OFF_OPACITY:()=>_4,legendChromeColors:()=>vs,measureLegendText:()=>We,truncateLegendText:()=>Ls});function vs(t,e){return{groupBg:e?vt(t.surface,t.bg,50):vt(t.surface,t.textMuted,98),pillBorder:vt(t.textMuted,t.bg,50)}}var Se,xo,Er,qn,Tr,Qn,Ir,Qr,Mn,_o,Ha,Td,Gh,We,Ls,n1,r1,qh,Cs,_4,Wi,pr=dt(()=>{"use strict";Fe();Ve();Se=28,xo=16,Er=11,qn=4,Tr=4,Qn=10,Ir=4,Qr=8,Mn=12,_o=14,Ha=6,Td=20,Gh=3;We=Tt,Ls=Gn,n1="M1 7s2.5-5 6-5 6 5 6 5-2.5 5-6 5-6-5-6-5z M7 9.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",r1="M2.5 2.5l9 9 M1.5 7s2.2-4 5.5-4c1.2 0 2.2.5 3 1.1 M12.5 7s-2.2 4-5.5 4c-1.2 0-2.2-.5-3-1.1",qh="M5.6 1.7L8.4 1.7L7.9 3.6L9.5 4.5L10.9 3.1L12.3 5.6L10.4 6.1L10.4 7.9L12.3 8.4L10.9 10.9L9.5 9.5L7.9 10.4L8.4 12.3L5.6 12.3L6.1 10.4L4.5 9.5L3.1 10.9L1.7 8.4L3.6 7.9L3.6 6.1L1.7 5.6L3.1 3.1L4.5 4.5L6.1 3.6ZM5 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0Z",Cs=Tr,_4=.4,Wi=14+xo});function Bh(t){if(!Number.isFinite(t))return String(t);let e=Math.abs(t);if(e<1e3)return Number.isInteger(t)?String(t):String(Math.round(t*10)/10);let n=t<0?"-":"",r=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"K"]];for(let[o,a]of r)if(e>=o){let i=Math.round(e/o*10)/10,s=Number.isInteger(i)?String(i):i.toFixed(1);return`${n}${s}${a}`}return String(t)}var A4=dt(()=>{"use strict"});function Wh(t){return Bh(t)}function Wj(t,e){let n=a1(t),r=We(Wh(e.min),Qn),o=We(Wh(e.max),Qn);return qn+n+4+r+Fh+R4+Fh+o+qn}function zj(t,e){let n=a1(t.name),r=Wh(e.min),o=Wh(e.max),a=We(r,Qn),i=qn+n+4,s=i,l=i+a+Fh,c=l+R4+Fh,d=Wj(t.name,e);return{groupName:t.name,x:0,y:0,width:d,height:Se,pill:{groupName:t.name,x:qn,y:qn,width:n,height:Se-qn*2,isActive:!0},entries:[],gradient:{rampX:l,rampY:(Se-YL)/2,rampW:R4,rampH:YL,min:e.min,max:e.max,minText:r,minX:s,maxText:o,maxX:c,textY:Se/2,low:e.low,high:e.high}}}function a1(t){return We(t,Er)+xo}function Yj(t){let e=0;for(let n of t)e+=Tr*2+Ir+We(n.value,Qn)+Qr;return e}function XL(t){return Tr*2+Ir+We(t,Qn)+Qr}function VL(t){let e=Hj;if(t.label&&(e+=We(t.label,Hh),t.icon&&(e+=Fj)),t.icon&&(e+=14),t.children)for(let n of t.children)e+=We(n.label,Hh)+12;return e}function jL(t,e,n,r=0){let o=a1(t),a=n,i=qn*2+o+4+r,s=Yj(e),l=i+s;if(l<=a+.5)return{width:l,entryRows:1,moreCount:0,visibleEntries:e.length};let c=a-qn,d=1,u=qn+o+4+r,f=0;for(let m=0;m<e.length;m++){let p=XL(e[m].value),h=c-u;if(p>h&&m>0&&(d++,u=qn+o+4+r,d>Gh))return{width:a,entryRows:Gh,moreCount:e.length-f,visibleEntries:f};p=Math.min(p,c-u),u+=p,f++}return{width:a,entryRows:d,moreCount:0,visibleEntries:e.length}}function zh(t){let e=qn*2+Wi+4;for(let n of t)e+=Cs*2+Ir+We(n.label,Qn)+Qr;return e}function Vj(t,e){return!e&&t.controlsHost==="app"&&!!t.controlsGroup&&t.controlsGroup.toggles.length>0}function Uj(t,e){let n=t.controlsGroup;if(!n||n.toggles.length===0)return;let r=!!e.controlsExpanded,o=Se-qn*2;if(!r)return{x:0,y:0,width:Wi,height:Se,expanded:!1,pill:{x:0,y:0,width:Wi,height:Se},toggles:[]};let a=zh(n.toggles),i=[],s=qn+Wi+4;for(let l of n.toggles){let c=s+Cs,d=Se/2,u=s+Cs*2+Ir,f=Se/2;i.push({id:l.id,label:l.label,active:l.active,dotCx:c,dotCy:d,textX:u,textY:f}),s+=Cs*2+Ir+We(l.label,Qn)+Qr}return{x:0,y:0,width:a,height:Se,expanded:!0,pill:{x:qn,y:qn,width:Wi-qn*2,height:o},toggles:i}}function ml(t,e,n){let{groups:r,controls:o,mode:a}=t,i=a==="export",s=Vj(t,i),l=e.activeGroup?.toLowerCase()??null;if(i&&!l)return{height:0,width:0,rows:[],controls:[],pills:[]};let c=i||s?void 0:Uj(t,e),d=t.showEmptyGroups?r:r.filter(C=>C.entries.length>0||!!C.gradient);if(d.length===0&&(!o||o.length===0)&&!c)return{height:0,width:0,rows:[],controls:[],pills:[]};let u=[],f=0;if(o&&!i){for(let C of o){let v=VL(C),_=C.children?.map(R=>({id:R.id,label:R.label,x:0,y:0,width:We(R.label,Hh)+12,...R.isActive!==void 0&&{isActive:R.isActive}}));u.push({id:C.id,x:0,y:0,width:v,height:Se,icon:C.icon,...C.label!==void 0&&{label:C.label},exportBehavior:C.exportBehavior,..._!==void 0&&{children:_}}),f+=v+o1}f>0&&(f-=o1)}else if(o&&i){for(let C of o){if(C.exportBehavior==="strip")continue;let v=VL(C),_=C.children?.map(R=>({id:R.id,label:R.label,x:0,y:0,width:We(R.label,Hh)+12,...R.isActive!==void 0&&{isActive:R.isActive}}));u.push({id:C.id,x:0,y:0,width:v,height:Se,icon:C.icon,...C.label!==void 0&&{label:C.label},exportBehavior:C.exportBehavior,..._!==void 0&&{children:_}}),f+=v+o1}f>0&&(f-=o1)}let m=f>0?f+Mn*2:0,p=c?c.width+Mn:0,h=n-m-p,g=[],x;for(let C of d){let v=l===C.name.toLowerCase();if(!(i&&!v)){if(v)x=Xj(C,h,t.capsulePillAddonWidth??0);else if(!l||t.showInactivePills){let _=a1(C.name);g.push({groupName:C.name,x:0,y:0,width:_,height:Se,isActive:!1})}}}let y=t.position.titleRelation==="inline-with-title",b=jj(x,g,u,h,n,f,y,c);return{height:b.length*Se,width:n,rows:b,...x!==void 0&&{activeCapsule:x},controls:u,pills:g,...c!==void 0&&{controlsGroup:c}}}function Xj(t,e,n=0){if(t.gradient)return zj(t,t.gradient);let r=a1(t.name),o=jL(t.name,t.entries,e,n),a={groupName:t.name,x:qn,y:qn,width:r,height:Se-qn*2,isActive:!0},i=[],s=qn+r+4+n,l=0,c=s,d=e-qn,u=0;for(let p=0;p<o.visibleEntries;p++){let h=t.entries[p],g=XL(h.value);o.entryRows>1&&c+g>d&&c>s&&p>0&&(u++,c=s,l=u*Se);let x,y=d-c;if(g>y){let v=y-(Tr*2+Ir+Qr);v>0&&(x=Ls(h.value,Qn,v),g=Tr*2+Ir+We(x,Qn)+Qr)}let b=c+Tr,w=l+Se/2,k=c+Tr*2+Ir,C=l+Se/2;i.push({value:h.value,color:h.color,x:c,y:l,width:g,dotCx:b,dotCy:w,textX:k,textY:C,...x!==void 0&&{displayValue:x}}),c+=g}let m=o.entryRows*Se;return{groupName:t.name,x:0,y:0,width:o.width,height:m,pill:a,entries:i,...o.moreCount>0&&{moreCount:o.moreCount},...n>0&&{addonX:qn+r+4}}}function jj(t,e,n,r,o,a,i=!1,s){let l=[],c=[];t&&c.push(t),c.push(...e);let d=s?s.width+Mn:0,u=[],f=0,m=0;for(let p of c){let h=p.width+Mn;if(f+p.width>r&&u.length>0){if(!i){let g=l.length===0?d:0;UL(u,o,a,g)}l.push({y:m,items:u}),m+=Se,u=[],f=0}p.x=f,p.y=m,u.push(p),f+=h}if(n.length>0){let p=o;for(let h=n.length-1;h>=0;h--){let g=n[h];p-=g.width,g.x=p,g.y=0,p-=o1}l.length>0?l[0].items.push(...n):u.length>0?u.push(...n):u.push(...n)}if(u.length>0&&(i||UL(u,o,a,d),l.push({y:m,items:u})),s){let h=(l[0]?.items??[]).filter(g=>"groupName"in g);if(h.length>0){let g=h[h.length-1];s.x=g.x+g.width+Mn}else s.x=(o-s.width)/2;s.y=0}return l.length===0&&l.push({y:0,items:[]}),l}function UL(t,e,n,r=0){let o=t.filter(c=>"groupName"in c);if(o.length===0)return;let a=o.reduce((c,d)=>c+d.width,0)+(o.length-1)*Mn,i=e-(n>0?n+Mn*2:0)-r,l=Math.max(0,(i-a)/2);for(let c of o)c.x=l,l+=c.width+Mn}function ir(t,e){let n=t.groups;if(n.length===0)return Se;let r=t.capsulePillAddonWidth??0,o=Se;for(let a of n){if(a.entries.length===0)continue;let s=jL(a.name,a.entries,e,r).entryRows*Se;s>o&&(o=s)}return o}function cr(t,e,n){let r=ml(t,e,n),o=1/0,a=0,i=0,s=(l,c,d,u)=>{o=Math.min(o,l),a=Math.max(a,l+d),i=Math.max(i,c+u)};if(r.activeCapsule){let l=r.activeCapsule;s(l.x,l.y,l.width,l.height)}for(let l of r.pills)s(l.x,l.y,l.width,l.height);return{width:a-(o===1/0?0:o),height:i||Se}}var Hj,Hh,Fj,o1,R4,YL,Fh,qr=dt(()=>{"use strict";pr();A4();Hj=16,Hh=11,Fj=4,o1=8,R4=80,YL=8,Fh=6});function pl(t){return t.attr("dominant-baseline","central")}function KL(t,e,n,r,o,a,i){let s=i??parseFloat(t.attr("width")||"800"),l={...n},c,d=t.append("g").attr("class","dgmo-legend").attr("data-legend-title-relation",e.position.titleRelation).attr("data-legend-capsule-addon-width",String(e.capsulePillAddonWidth??0));function u(){if(c=ml(e,l,s),d.selectAll("*").remove(),c.height===0)return;l.activeGroup?d.attr("data-legend-active",Bt(l.activeGroup)):d.attr("data-legend-active",null);let{groupBg:f,pillBorder:m}=vs(r,o);c.activeCapsule&&Kj(d,c.activeCapsule,r,f,m,o,a);for(let p of c.pills)Zj(d,p,r,f,a);c.controlsGroup&&Jj(d,c.controlsGroup,r,f,m,a,e);for(let p of c.controls)Qj(d,p,r,f,m,o,e.controls)}return u(),{setState(f){l={...f},u()},destroy(){d.remove()},getHeight(){return c?.height??0},getLayout(){return c}}}function Kj(t,e,n,r,o,a,i){let s=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-group",Bt(e.groupName)).style("cursor","pointer");s.append("rect").attr("width",e.width).attr("height",e.height).attr("rx",Se/2).attr("fill",r);let l=e.pill;if(s.append("rect").attr("x",l.x).attr("y",l.y).attr("width",l.width).attr("height",l.height).attr("rx",l.height/2).attr("fill",n.bg),s.append("rect").attr("x",l.x).attr("y",l.y).attr("width",l.width).attr("height",l.height).attr("rx",l.height/2).attr("fill","none").attr("stroke",o).attr("stroke-width",.75),s.append("text").attr("x",l.x+l.width/2).attr("y",Se/2).attr("text-anchor","middle").call(pl).attr("font-size",Er).attr("font-weight",500).attr("fill",n.text).attr("pointer-events","none").attr("font-family",Mt).text(e.groupName),e.gradient){let c=e.gradient,d=`dgmo-legend-ramp-${Bt(e.groupName).replace(/[^a-z0-9]+/g,"-")}`,u=s.append("defs").append("linearGradient").attr("id",d);for(let f of _M(c.low,c.high,{isDark:a}))u.append("stop").attr("offset",`${f.offset*100}%`).attr("stop-color",f.color);s.append("text").attr("x",c.minX).attr("y",c.textY).call(pl).attr("font-size",Qn).attr("fill",n.textMuted).attr("pointer-events","none").attr("font-family",Mt).text(c.minText),s.append("rect").attr("class","dgmo-legend-gradient-ramp").attr("data-ramp-min",c.min).attr("data-ramp-max",c.max).attr("x",c.rampX).attr("y",c.rampY).attr("width",c.rampW).attr("height",c.rampH).attr("rx",2).attr("fill",`url(#${d})`),s.append("text").attr("x",c.maxX).attr("y",c.textY).call(pl).attr("font-size",Qn).attr("fill",n.textMuted).attr("pointer-events","none").attr("font-family",Mt).text(c.maxText)}for(let c of e.entries){let d=s.append("g").attr("data-legend-entry",c.value.toLowerCase()).attr("data-series-name",c.value).style("cursor","pointer");if(d.append("circle").attr("cx",c.dotCx).attr("cy",c.dotCy).attr("r",Tr).attr("fill",c.color),d.append("text").attr("x",c.textX).attr("y",c.textY).call(pl).attr("font-size",Qn).attr("fill",n.textMuted).attr("font-family",Mt).text(c.displayValue??c.value),i?.onEntryHover){let u=e.groupName,f=c.value,m=i.onEntryHover;d.on("mouseenter",()=>m(u,f)).on("mouseleave",()=>m(u,null))}}if(i?.onGroupToggle){let c=i.onGroupToggle,d=e.groupName;s.on("click",()=>c(d))}i?.onGroupRendered&&i.onGroupRendered(e.groupName,s,!0)}function Zj(t,e,n,r,o){let a=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-group",Bt(e.groupName)).style("cursor","pointer");if(a.append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.height/2).attr("fill",r),a.append("text").attr("x",e.width/2).attr("y",e.height/2).attr("text-anchor","middle").call(pl).attr("font-size",Er).attr("font-weight",500).attr("fill",n.textMuted).attr("pointer-events","none").attr("font-family",Mt).text(e.groupName),o?.onGroupToggle){let i=o.onGroupToggle,s=e.groupName;a.on("click",()=>i(s))}o?.onGroupRendered&&o.onGroupRendered(e.groupName,a,!1)}function Qj(t,e,n,r,o,a,i){let s=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-control",e.id).style("cursor","pointer");e.exportBehavior==="strip"&&s.attr("data-export-ignore","true"),s.append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.height/2).attr("fill","none").attr("stroke",o).attr("stroke-width",.75);let l=e.width/2;if(e.icon&&e.label&&(s.append("g").attr("transform",`translate(8,${(e.height-14)/2})`).html(e.icon),l=22+Ir+We(e.label,Er)/2),e.label&&s.append("text").attr("x",l).attr("y",e.height/2).attr("text-anchor","middle").call(pl).attr("font-size",Er).attr("font-weight",500).attr("fill",n.textMuted).attr("pointer-events","none").attr("font-family",Mt).text(e.label),e.children){let d=e.width+4;for(let u of e.children){let f=s.append("g").attr("transform",`translate(${d},0)`).style("cursor","pointer");f.append("rect").attr("width",u.width).attr("height",e.height).attr("rx",e.height/2).attr("fill",u.isActive?n.primary??n.text:"none").attr("stroke",o).attr("stroke-width",.75),f.append("text").attr("x",u.width/2).attr("y",e.height/2).attr("text-anchor","middle").call(pl).attr("font-size",Qn).attr("fill",u.isActive?n.bg:n.textMuted).attr("font-family",Mt).text(u.label);let p=i?.find(h=>h.id===e.id)?.children?.find(h=>h.id===u.id);if(p?.onClick){let h=p.onClick;f.on("click",()=>h())}d+=u.width+4}}let c=i?.find(d=>d.id===e.id);if(c?.onClick){let d=c.onClick;s.on("click",()=>d())}}function Jj(t,e,n,r,o,a,i){let s=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-controls",e.expanded?"expanded":"collapsed").attr("data-export-ignore","true").style("cursor","pointer");if(e.expanded){let l=e.pill;s.append("rect").attr("width",e.width).attr("height",e.height).attr("rx",Se/2).attr("fill",r);let c=s.append("g").attr("class","controls-gear-pill").style("cursor","pointer");c.append("rect").attr("x",l.x).attr("y",l.y).attr("width",l.width).attr("height",l.height).attr("rx",l.height/2).attr("fill",n.bg),c.append("rect").attr("x",l.x).attr("y",l.y).attr("width",l.width).attr("height",l.height).attr("rx",l.height/2).attr("fill","none").attr("stroke",o).attr("stroke-width",.75);let d=14,u=l.x+(l.width-d)/2,f=l.y+(l.height-d)/2;if(c.append("path").attr("d",qh).attr("transform",`translate(${u},${f})`).attr("fill",n.text).attr("fill-rule","evenodd").attr("pointer-events","none"),a?.onControlsExpand){let p=a.onControlsExpand;c.on("click",h=>{h.stopPropagation(),p()})}let m=i?.controlsGroup?.toggles??[];for(let p of e.toggles){let h=m.find(x=>x.id===p.id),g=s.append("g").attr("data-controls-toggle",p.id).style("cursor","pointer");if(p.active?g.append("circle").attr("cx",p.dotCx).attr("cy",p.dotCy).attr("r",Cs).attr("fill",n.primary??n.text):g.append("circle").attr("cx",p.dotCx).attr("cy",p.dotCy).attr("r",Cs).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1),g.append("text").attr("x",p.textX).attr("y",p.textY).call(pl).attr("font-size",Qn).attr("fill",n.textMuted).attr("opacity",p.active?1:_4).attr("font-family",Mt).text(p.label),a?.onControlsToggle&&h){let x=a.onControlsToggle,y=p.id,b=!p.active;g.on("click",w=>{w.stopPropagation(),x(y,b)})}}}else{s.append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.height/2).attr("fill",r).attr("stroke",o).attr("stroke-width",.75);let l=14,c=(e.width-l)/2,d=(e.height-l)/2;if(s.append("path").attr("d",qh).attr("transform",`translate(${c},${d})`).attr("fill",n.textMuted).attr("fill-rule","evenodd").attr("pointer-events","none"),a?.onControlsExpand){let u=a.onControlsExpand;s.on("click",()=>u())}}}var ZL=dt(()=>{"use strict";Oe();pr();qr();Fe();Ke()});function tn(t,e){return KL(t,{groups:e.groups,position:e.position??tK,mode:e.mode,...e.controls!==void 0&&{controls:e.controls},...e.controlsGroup!==void 0&&{controlsGroup:e.controlsGroup},...e.controlsHost!==void 0&&{controlsHost:e.controlsHost},...e.titleWidth!==void 0&&{titleWidth:e.titleWidth},...e.capsulePillAddonWidth!==void 0&&{capsulePillAddonWidth:e.capsulePillAddonWidth},...e.showEmptyGroups!==void 0&&{showEmptyGroups:e.showEmptyGroups},...e.showInactivePills!==void 0&&{showInactivePills:e.showInactivePills}},{activeGroup:e.activeGroup??null,...e.hiddenAttributes!==void 0&&{hiddenAttributes:e.hiddenAttributes},...e.controlsExpanded!==void 0&&{controlsExpanded:e.controlsExpanded}},e.palette,e.isDark,e.callbacks,e.width)}var tK,Mr=dt(()=>{"use strict";ZL();tK={placement:"top-center",titleRelation:"below-title"}});function eK(t){return[t.colors.blue,t.colors.green,t.colors.yellow,t.colors.orange,t.colors.purple]}function Yh(t,e,n,r,o,a,i,s,l=!1,c=null,d,u,f,m){let p=d?eK(d):["#3b6ea5","#5b9357","#c9a227","#cc7a33","#7d5ba6"];e.forEach((h,g)=>{let x=En(h.startDate),y=En(h.endDate);if(!Number.isFinite(x)||!Number.isFinite(y))return;let b=n(x),w=n(y);if(!Number.isFinite(b)||!Number.isFinite(w))return;let k=h.color||p[g%p.length],C=t.append("g").attr("class","tl-era").attr("data-line-number",String(h.lineNumber)).attr("data-era-start",String(x)).attr("data-era-end",String(y)).style("cursor","pointer"),v,_=h.label,R=!1,L=f==="outline"&&m!==void 0,E=M=>{L?M.attr("fill",m).attr("stroke",k).attr("stroke-width",1):M.attr("fill",k).attr("opacity",.08)};if(r){let M=Math.min(b,w),S=Math.abs(w-b);E(C.append("rect").attr("x",0).attr("y",M).attr("width",o).attr("height",S)),v=C.append("text").attr("x",6).attr("y",M+18).attr("text-anchor","start").attr("fill",k).attr("font-size","13px").attr("font-weight","600").attr("opacity",.8).text(_)}else{let M=Math.min(b,w),S=Math.abs(w-b),T=u!=null,N=T?0:l?-48:0,I=T?u:l?-32:18;if(E(C.append("rect").attr("x",M).attr("y",N).attr("width",S).attr("height",a-N)),T){let G=Math.max(0,S-8);_=Ls(h.label,13,G,{bold:!0}),R=_!==h.label}v=C.append("text").attr("x",M+S/2).attr("y",I).attr("text-anchor","middle").attr("fill",k).attr("font-size","13px").attr("font-weight","600").attr("opacity",.8).text(_)}C.on("mouseenter",function(){i(x,y),R&&v.text(h.label)}).on("mouseleave",function(){s(),R&&v.text(_)})})}function Vh(t,e,n,r,o,a,i,s,l=!1,c=null,d,u,f,m){let p=d?.accent||"#3a9188",h=e.map(x=>{let y=En(x.date);return Number.isFinite(y)?n(y):NaN}),g=u!=null&&!r;e.forEach((x,y)=>{let b=En(x.date);if(!Number.isFinite(b))return;let w=h[y];if(!Number.isFinite(w))return;let k=x.color||p,C=.5,v=5,_=f==="outline"&&m!==void 0,R=E=>{_?E.attr("fill",m).attr("stroke",k).attr("stroke-width",1.25).attr("opacity",.9):E.attr("fill",k).attr("opacity",.9)},L=t.append("g").attr("class","tl-marker").attr("data-marker-date",String(b)).attr("data-line-number",String(x.lineNumber)).style("cursor","pointer");if(r)L.append("line").attr("x1",0).attr("y1",w).attr("x2",o).attr("y2",w).attr("stroke",k).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.append("text").attr("x",-v-8).attr("y",w-v-4).attr("text-anchor","middle").attr("fill",k).attr("font-size","11px").attr("font-weight","600").text(x.label),R(L.append("path").attr("d",`M${-v-8},${w} l${v},-${v} l${v},${v} l-${v},${v} Z`)),L.on("mouseenter",function(){i(b)}).on("mouseleave",function(){s()});else{let E=g?u:6,M=g?-(v+1):E+14,S=M+v,T=x.label,N=!1;if(g){let G=Math.min(w,o-w);for(let A=0;A<h.length;A++){if(A===y)continue;let D=h[A];if(!Number.isFinite(D))continue;let O=Math.abs(D-w);O<G&&(G=O)}let $=Math.max(0,G-8);T=Ls(x.label,11,$,{bold:!0}),N=T!==x.label}let I=L.append("text").attr("x",w).attr("y",E).attr("text-anchor","middle").attr("fill",k).attr("font-size","11px").attr("font-weight","600").text(T);R(L.append("path").attr("d",`M${w},${M-v} l${v},${v} l-${v},${v} l-${v},-${v} Z`)),L.append("line").attr("x1",w).attr("y1",S).attr("x2",w).attr("y2",a).attr("stroke",k).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.on("mouseenter",function(){i(b),N&&I.text(x.label)}).on("mouseleave",function(){s(),N&&I.text(T)})}})}function zi(t){let e=!1;t.startsWith("-")&&(e=!0,t=t.slice(1));let n=e?" BCE":"",r=t.indexOf(" "),o=t,a="";r!==-1&&(o=t.slice(0,r),a=" "+t.slice(r+1));let i=o.split("-"),s=String(parseInt(i[0],10));if(i.length===1)return`${s}${a}${n}`;let l=wc[parseInt(i[1],10)-1];if(i.length===2)return`${l} ${s}${a}${n}`;let c=parseInt(i[2],10);return`${l} ${c}, ${s}${a}${n}`}function hl(t,e){let n=t.indexOf(" "),r=e.indexOf(" ");if(n!==-1&&r!==-1){let o=t.slice(0,n),a=e.slice(0,r);if(o===a)return t.slice(n+1)}return zi(t)}function Uh(t,e,n,r,o,a,i,s,l,c){let[d,u]=e.domain(),f=$h(d,u,e,i,s,l,c);if(f.length<2)return;let m=6,p=.4,h=.15;for(let g of f)n?(t.append("line").attr("x1",0).attr("y1",g.pos).attr("x2",r).attr("y2",g.pos).attr("stroke",a).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("opacity",h),t.append("line").attr("x1",-m).attr("y1",g.pos).attr("x2",0).attr("y2",g.pos).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("x",-m-3).attr("y",g.pos).attr("dy","0.35em").attr("text-anchor","end").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(g.label),t.append("line").attr("x1",r).attr("y1",g.pos).attr("x2",r+m).attr("y2",g.pos).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("x",r+m+3).attr("y",g.pos).attr("dy","0.35em").attr("text-anchor","start").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(g.label)):(t.append("line").attr("class","tl-scale-tick").attr("x1",g.pos).attr("y1",0).attr("x2",g.pos).attr("y2",o).attr("stroke",a).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("opacity",h),t.append("line").attr("class","tl-scale-tick").attr("x1",g.pos).attr("y1",o).attr("x2",g.pos).attr("y2",o+m).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("class","tl-scale-tick").attr("x",g.pos).attr("y",o+m+12).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(g.label),t.append("line").attr("class","tl-scale-tick").attr("x1",g.pos).attr("y1",-m).attr("x2",g.pos).attr("y2",0).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("class","tl-scale-tick").attr("x",g.pos).attr("y",-m-4).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(g.label))}function JL(t,e,n,r,o,a){t.selectAll(".tl-scale-tick").attr("opacity",.1);let i=6,s=e(En(n)),l=zi(n);if(t.append("line").attr("class","tl-event-date").attr("x1",s).attr("y1",-i).attr("x2",s).attr("y2",o).attr("stroke",a).attr("stroke-width",1.5).attr("stroke-dasharray","4 4").attr("opacity",.6),t.append("text").attr("class","tl-event-date").attr("x",s).attr("y",-i-4).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("font-weight","600").text(l),t.append("text").attr("class","tl-event-date").attr("x",s).attr("y",o+i+12).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("font-weight","600").text(l),r){let c=e(En(r)),d=zi(r);t.append("line").attr("class","tl-event-date").attr("x1",c).attr("y1",-i).attr("x2",c).attr("y2",o).attr("stroke",a).attr("stroke-width",1.5).attr("stroke-dasharray","4 4").attr("opacity",.6),t.append("text").attr("class","tl-event-date").attr("x",c).attr("y",-i-4).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("font-weight","600").text(d),t.append("text").attr("class","tl-event-date").attr("x",c).attr("y",o+i+12).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("font-weight","600").text(d)}}function tC(t){t.selectAll(".tl-event-date").remove(),t.selectAll(".tl-scale-tick").each(function(){let e=It(this),n=e.attr("stroke-dasharray");e.attr("opacity",n?.15:.4)})}function gl(t){let e=t.endDate?`${zi(t.date)} \u2192 ${zi(t.endDate)}`:zi(t.date);return`<strong>${t.label}</strong><br>${e}`}function eC(t,e,n,r,o,a,i,s,l){let h=vs(o,a).groupBg,g=0;for(let x of e){let y=n.get(x.name)??r,w=22+We(x.name,11)+10,k=t.append("g").attr("class","tl-legend-item").attr("data-group",x.name).style("cursor","pointer").on("mouseenter",()=>s(x.name)).on("mouseleave",()=>l());k.append("rect").attr("x",g).attr("y",i-22/2).attr("width",w).attr("height",22).attr("rx",22/2).attr("fill",h),k.append("circle").attr("cx",g+10+4).attr("cy",i).attr("r",4).attr("fill",y),k.append("text").attr("x",g+10+8+4).attr("y",i).attr("dy","0.35em").attr("fill",r).attr("font-size","11px").attr("font-family",Mt).text(x.name),g+=w+8}}function nK(t,e,n,r,o,a,i){It(t).selectAll(":not([data-d3-tooltip])").remove();let s=e.fillMode,{timelineEvents:l,timelineGroups:c,timelineEras:d,timelineMarkers:u,timelineSort:f,orientation:m}=e;if(l.length===0)return null;let p=i??null;p==null&&f==="tag"&&e.timelineDefaultSwimlaneTG&&(p=e.timelineDefaultSwimlaneTG);let h=eh(t,n,r),g=o?.width??t.clientWidth,x=o?.height??t.clientHeight;if(g<=0||x<=0)return null;let y=m==="vertical",b=n.text,w=n.border,k=n.bg,C=Ie(n,r),v=Bn(n),_=new Map;c.forEach((D,O)=>{_.set(D.name,D.color??v[O%v.length])});let R=null;if(p){let D=Bt(p),O=e.timelineTagGroups.find(P=>P.name.toLowerCase()===D);if(O){let P=new Map,H=[];for(let B of l){let q=B.metadata[D];if(q){let V=P.get(q)??[];V.push(B),P.set(q,V)}else H.push(B)}R=[...P.entries()].sort((B,q)=>{let V=Math.min(...B[1].map(z=>En(z.date))),X=Math.min(...q[1].map(z=>En(z.date)));return V-X}).map(([B,q])=>({name:B,events:q})),H.length>0&&R.push({name:"(Other)",events:H});for(let B of O.entries)_.set(B.value,B.color)}}let L=a??p??null;function E(D){if(L){let O=Dn(D.metadata,e.timelineTagGroups,L);if(O)return O}return D.group&&_.has(D.group)?_.get(D.group):b}let M=1/0,S=-1/0,T="",N="";for(let D of l){let O=En(D.date),P=D.endDate?En(D.endDate):O;O<M&&(M=O,T=D.date),P>S&&(S=P,N=D.endDate??D.date)}for(let D of d){let O=En(D.startDate),P=En(D.endDate);Number.isFinite(O)&&O<M&&(M=O,T=D.startDate),Number.isFinite(P)&&P>S&&(S=P,N=D.endDate)}for(let D of u){let O=En(D.date);Number.isFinite(O)&&(O<M&&(M=O,T=D.date),O>S&&(S=O,N=D.date))}let I=(S-M)*.05||.5,G=e.timelineTagGroups.length>0&&!e.noLegend?36:0,$=y?500:Math.max(600,l.length*40+200),A=o?Le.identity():Le.from(g,$);return{width:g,height:x,isVertical:y,tooltip:h,fillMode:s,textColor:b,mutedColor:w,bgColor:k,bg:C,swimlaneTagGroup:p,groupColorMap:_,tagLanes:R,eventColor:E,minDate:M,maxDate:S,datePadding:I,earliestStartDateStr:T,latestEndDateStr:N,tagLegendReserve:G,ctx:A}}function rK(){function e(s,l){s.selectAll(".tl-event").each(function(){let c=It(this),d=c.attr("data-group");c.attr("opacity",d===l?1:.1)}),s.selectAll(".tl-legend-item, .tl-lane-header").each(function(){let c=It(this),d=c.attr("data-group");c.attr("opacity",d===l?1:.1)}),s.selectAll(".tl-marker").attr("opacity",.1)}function n(s,l,c){s.selectAll(".tl-event").each(function(){let d=It(this),u=parseFloat(d.attr("data-date")),f=d.attr("data-end-date"),p=(f?parseFloat(f):u)>=l&&u<=c;d.attr("opacity",p?1:.1)}),s.selectAll(".tl-legend-item, .tl-lane-header").attr("opacity",.1),s.selectAll(".tl-era").each(function(){let d=It(this),u=parseFloat(d.attr("data-era-start")),f=parseFloat(d.attr("data-era-end")),m=u===l&&f===c;d.attr("opacity",m?1:.1)}),s.selectAll(".tl-marker").each(function(){let d=It(this),u=parseFloat(d.attr("data-marker-date")),f=u>=l&&u<=c;d.attr("opacity",f?1:.1)})}function r(s,l){s.selectAll(".tl-event").attr("opacity",.1),s.selectAll(".tl-era").attr("opacity",.1),s.selectAll(".tl-legend-item, .tl-lane-header").attr("opacity",.1),s.selectAll(".tl-marker").each(function(){let c=It(this),d=parseFloat(c.attr("data-marker-date"));c.attr("opacity",d===l?1:.1)})}function o(s){s.selectAll(".tl-event, .tl-legend-item, .tl-lane-header, .tl-marker, .tl-tag-legend-entry").attr("opacity",1),s.selectAll(".tl-era").attr("opacity",1)}function a(s,l,c){let d=`data-tag-${l}`;s.selectAll(".tl-event").each(function(){let u=It(this),f=u.attr(d);u.attr("opacity",f===c?1:.1)}),s.selectAll(".tl-legend-item, .tl-lane-header").attr("opacity",.1),s.selectAll(".tl-marker").attr("opacity",.1),s.selectAll(".tl-tag-legend-entry").each(function(){let u=It(this),f=u.attr("data-legend-entry");if(f==="__group__")return;let m=u.attr("data-tag-group");u.attr("opacity",m===l&&f===c?1:.1)})}function i(s,l){for(let[c,d]of Object.entries(l.metadata))s.attr(`data-tag-${c}`,d.toLowerCase())}return{FADE_OPACITY:.1,fadeToGroup:e,fadeToEra:n,fadeToMarker:r,fadeReset:o,fadeToTagValue:a,setTagAttrs:i}}function oK(t,e,n,r,o,a,i,s,l,c,d,u,f){if(e.timelineTagGroups.length===0||e.noLegend)return;let{width:m,textColor:p,groupColorMap:h,fillMode:g}=o,{FADE_OPACITY:x,fadeReset:y,fadeToTagValue:b}=a,w=e.noTitle?null:e.title,{timelineEvents:k}=e,C=Se,v=xo,_=Er,R=qn,L=Tr,E=Qn,M=Ir,S=Qr,T=20,N=It(t).select("svg"),I=N.select("g");if(!N.empty()&&!I.empty()){let B=function(U,Y,K,et){let nt=U.append("g").attr("class","tl-swimlane-icon").attr("transform",`translate(${Y}, ${K})`).style("cursor","pointer");nt.append("rect").attr("x",-5).attr("y",-5).attr("width",22).attr("height",20).attr("fill","transparent");let J=et?n.primary:n.textMuted,F=et?1:.35,j=[{y:0,w:8},{y:4,w:12},{y:8,w:6}];for(let Q of j)nt.append("rect").attr("x",0).attr("y",Q.y).attr("width",Q.w).attr("height",2).attr("rx",1).attr("fill",J).attr("opacity",F);return nt},q=function(){Xh(t,e,n,r,i,s,H,W,d,u)},V=function(){N.selectAll(".tl-tag-legend-group").remove(),N.selectAll(".tl-tag-legend-container").remove();let U=(H??W)?.toLowerCase()??null,Y=u?P.filter(Z=>U!=null&&Z.group.name.toLowerCase()===U):P;if(Y.length===0)return;let K=N.append("g").attr("class","tl-tag-legend-container");H&&K.attr("data-legend-active",Bt(H));let et=u?0:T,nt=Y.map(Z=>({name:Z.group.name,entries:Z.group.entries.map(ot=>({value:ot.value,color:ot.color}))})),J=u?U:H,F={groups:nt,position:{placement:"top-center",titleRelation:"below-title"},mode:f?"export":"preview",capsulePillAddonWidth:et},j=u?{}:{onGroupToggle:Z=>{H=H===Z.toLowerCase()?null:Z.toLowerCase(),V(),z(),d?.(H,W)},onEntryHover:(Z,ot)=>{let at=Bt(Z);if(ot){let lt=ot.toLowerCase();b(I,at,lt),N.selectAll("[data-legend-entry]").each(function(){let rt=It(this),ut=rt.attr("data-legend-entry"),tt=rt.attr("data-tag-group")??rt.node()?.closest?.("[data-tag-group]")?.getAttribute("data-tag-group");rt.attr("opacity",tt===at&&ut===lt?1:x)})}else y(I),N.selectAll("[data-legend-entry]").attr("opacity",1)},onGroupRendered:(Z,ot,at)=>{let lt=Bt(Z);if(ot.attr("data-tag-group",lt),at&&!u){let rt=W?.toLowerCase()===lt,ut=We(Z,_)+v,it=R+ut+5,st=(C-10)/2;B(ot,it,st,rt).attr("data-swimlane-toggle",lt).on("click",pt=>{pt.stopPropagation(),W=W===lt?null:lt,d?.(H,W),q()})}}},Q=K.append("g").attr("transform",`translate(0, ${O})`);tn(Q,{...F,palette:n,isDark:r,width:m,activeGroup:J,callbacks:j})},z=function(){let U=H??l??null;I.selectAll(".tl-event").each(function(){let Y=It(this),K=Y.attr("data-line-number"),et=K?X.get(K):void 0;if(!et)return;let nt;U?nt=Dn(et.metadata,e.timelineTagGroups,U)??(et.group&&h.has(et.group)?h.get(et.group):p):nt=et.group&&h.has(et.group)?h.get(et.group):p,Y.selectAll("rect").attr("fill",ee(n,nt,r,{mode:g})).attr("stroke",nt),Y.selectAll("circle:not(.tl-event-point-outline)").attr("fill",ee(n,nt,r,{mode:g})).attr("stroke",nt)})};var G=B,$=q,A=V,D=z;let O=w?50:10,P=e.timelineTagGroups.map(U=>{let Y=We(U.name,_)+v,K=u?8:T+4,et=R+Y+K;for(let nt of U.entries)et=et+L*2+M+We(nt.value,E)+S;return{group:U,minifiedWidth:Y,expandedWidth:et+R}}),H=c??null,W=l??null,X=new Map;for(let U of k)X.set(String(U.lineNumber),U);V()}}function aK(t,e,n,r,o,a,i,s,l,c,d,u){let{width:f,height:m,tooltip:p,fillMode:h,textColor:g,bgColor:x,bg:y,groupColorMap:b,eventColor:w,minDate:k,maxDate:C,datePadding:v,earliestStartDateStr:_,latestEndDateStr:R,tagLegendReserve:L,ctx:E}=o,{fadeToGroup:M,fadeToEra:S,fadeToMarker:T,fadeReset:N,setTagAttrs:I}=a,{timelineEvents:G,timelineGroups:$,timelineEras:A,timelineMarkers:D,timelineScale:O}=e,P=e.noTitle?null:e.title,H=E.structural(22),W=E.structural(5),B=E.structural(2),q=E.structural(4),V=E.structural(2),X=E.text(13),z=E.text(12),U=E.structural(7),Y=G.slice().sort((mt,bt)=>En(mt.date)-En(bt.date)),K=O?E.aesthetic(24):0,et=E.structural(22),nt=E.structural(22),J=A.length>0?et:0,F=D.length>0?nt:0,j=O?E.structural(40):0,Q={top:E.aesthetic(104)+j+J+F+L,right:E.aesthetic(40),bottom:E.aesthetic(40)+K,left:E.aesthetic(60)},Z=F?-(j+nt/2):0,ot=J?-(j+F+et/2):0,at=f-Q.left-Q.right,lt=E.structural(28),rt=lt*Y.length,ut=Q.top+rt+Q.bottom,tt=!s&&m>0&&ut>m,it=tt?m:ut,st=yr().domain([k-v,C+v]).range([0,at]),ct=It(t).append("svg").attr("width",f).attr("height",it).attr("viewBox",`0 0 ${f} ${ut}`).attr("preserveAspectRatio","xMidYMin meet").style("background",x);E.isBelowFloor&&!tt&&ct.attr("width","100%");let pt=ct.append("g").attr("transform",`translate(${Q.left},${Q.top})`);if(ao(ct,P,e.titleLineNumber,f,g,i),Yh(pt,A,st,!1,at,rt,(mt,bt)=>S(pt,mt,bt),()=>N(pt),O,p,n,J?ot:void 0,h,y),Vh(pt,D,st,!1,at,rt,mt=>T(pt,mt),()=>N(pt),O,p,n,F?Z:void 0,h,y),O&&Uh(pt,st,!1,at,rt,g,k,C,hl(_,R),hl(R,_)),$.length>0&&!e.noLegend){let mt=O?-E.aesthetic(75):-E.aesthetic(55);eC(pt,$,b,g,n,r,mt,bt=>M(pt,bt),()=>N(pt))}Y.forEach((mt,bt)=>{let gt=bt*lt+lt/2,Et=st(En(mt.date)),ft=w(mt),kt=pt.append("g").attr("class","tl-event").attr("data-group",mt.group||"").attr("data-line-number",String(mt.lineNumber)).attr("data-date",String(En(mt.date))).attr("data-end-date",mt.endDate?String(En(mt.endDate)):null).style("cursor","pointer").on("mouseenter",function(_t){mt.group&&$.length>0&&M(pt,mt.group),O?JL(pt,st,mt.date,mt.endDate,rt,ft):ha(p,gl(mt),_t)}).on("mouseleave",function(){N(pt),O?tC(pt):il(p)}).on("mousemove",function(_t){O||ha(p,gl(mt),_t)}).on("click",()=>{i&&mt.lineNumber&&i(mt.lineNumber)});if(I(kt,mt),mt.endDate){let _t=st(En(mt.endDate)),yt=Math.max(_t-Et,4),St=mt.label.length*U+E.aesthetic(16),Ct=yt>=St,ht=ee(n,ft,r,{mode:h}),Pt=ft;if(mt.uncertain){let Dt=`uncertain-ts-${mt.lineNumber}`,qt=`uncertain-ts-s-${mt.lineNumber}`,Wt=ct.select("defs").node()||ct.append("defs").node(),Ft=It(Wt);Ft.append("linearGradient").attr("id",Dt).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",Xt=>Xt.offset).attr("stop-color",h==="outline"?y:vt(ft,y,30)).attr("stop-opacity",Xt=>Xt.opacity),Ft.append("linearGradient").attr("id",qt).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",Xt=>Xt.offset).attr("stop-color",ft).attr("stop-opacity",Xt=>Xt.opacity),ht=`url(#${Dt})`,Pt=`url(#${qt})`}if(kt.append("rect").attr("x",Et).attr("y",gt-H/2).attr("width",yt).attr("height",H).attr("rx",q).attr("fill",ht).attr("stroke",Pt).attr("stroke-width",V),Ct)kt.append("text").attr("x",Et+E.aesthetic(8)).attr("y",gt).attr("dy","0.35em").attr("text-anchor","start").attr("fill",g).attr("font-size",`${X}px`).text(mt.label);else{let Dt=E.aesthetic(6),qt=Et+yt>at*.6,Wt=Et-Dt-St>0,Ft=qt&&Wt;kt.append("text").attr("x",Ft?Et-Dt:Et+yt+Dt).attr("y",gt).attr("dy","0.35em").attr("text-anchor",Ft?"end":"start").attr("fill",g).attr("font-size",`${X}px`).text(mt.label)}}else{let _t=mt.label.length*U,yt=E.aesthetic(10),St=Et>at*.6,Ct=Et-yt-_t>0,ht=St&&Ct;kt.append("circle").attr("cx",Et).attr("cy",gt).attr("r",W).attr("fill",ee(n,ft,r,{mode:h})).attr("stroke",ft).attr("stroke-width",B),kt.append("text").attr("x",ht?Et-yt:Et+yt).attr("y",gt).attr("dy","0.35em").attr("text-anchor",ht?"end":"start").attr("fill",g).attr("font-size",`${z}px`).text(mt.label)}})}function iK(t,e,n,r,o,a,i,s,l,c,d,u,f,m){let{width:p,height:h,tooltip:g,fillMode:x,textColor:y,bgColor:b,bg:w,groupColorMap:k,tagLanes:C,eventColor:v,minDate:_,maxDate:R,datePadding:L,earliestStartDateStr:E,latestEndDateStr:M,tagLegendReserve:S,ctx:T}=o,{fadeToGroup:N,fadeToEra:I,fadeToMarker:G,fadeReset:$,setTagAttrs:A}=a,{timelineEvents:D,timelineGroups:O,timelineEras:P,timelineMarkers:H,timelineScale:W}=e,B=e.noTitle?null:e.title,q=T.structural(22),V=T.aesthetic(12),X=T.structural(5),z=T.structural(2),U=T.structural(4),Y=T.structural(2),K=T.text(13),et=T.structural(7),nt=T.text(12),J;if(C)J=C;else{let Dt=O.map(Ft=>Ft.name);J=(D.filter(Ft=>Ft.group===null||!Dt.includes(Ft.group)).length>0?[...Dt,"(Other)"]:Dt).map(Ft=>({name:Ft,events:D.filter(Xt=>Ft==="(Other)"?Xt.group===null||!Dt.includes(Xt.group):Xt.group===Ft)}))}let F=J.reduce((Dt,qt)=>f.has(qt.name)?Dt+1:Dt+qt.events.length+1,0),j=W?T.aesthetic(24):0,Q=T.structural(22),Z=T.structural(22),ot=P.length>0?Q:0,at=H.length>0?Z:0,lt=W?T.structural(40):0,rt=Math.max(...J.map(Dt=>Dt.name.length))+2,ut=Math.max(0,...J.flatMap(Dt=>Dt.events.map(qt=>qt.label.length+2))),tt=Math.max(rt,ut),it=Math.max(T.aesthetic(140),tt*et+T.aesthetic(30)),ct={top:(B?T.aesthetic(50):T.aesthetic(20))+lt+ot+at+S,right:T.aesthetic(40),bottom:T.aesthetic(40)+j,left:it},pt=at?-(lt+Z/2):0,mt=ot?-(lt+at+Q/2):0,bt=p-ct.left-ct.right,gt=(J.length-1)*V,Et=T.structural(28),ft=Et*F+gt,kt=ct.top+ft+ct.bottom,_t=!s&&h>0&&kt>h,yt=_t?h:kt,St=yr().domain([_-L,R+L]).range([0,bt]),Ct=It(t).append("svg").attr("width",p).attr("height",yt).attr("viewBox",`0 0 ${p} ${kt}`).attr("preserveAspectRatio","xMidYMin meet").style("background",b);T.isBelowFloor&&!_t&&Ct.attr("width","100%");let ht=Ct.append("g").attr("transform",`translate(${ct.left},${ct.top})`);ao(Ct,B,e.titleLineNumber,p,y,i),Yh(ht,P,St,!1,bt,ft,(Dt,qt)=>I(ht,Dt,qt),()=>$(ht),W,g,n,ot?mt:void 0,x,w),Vh(ht,H,St,!1,bt,ft,Dt=>G(ht,Dt),()=>$(ht),W,g,n,at?pt:void 0,x,w),W&&Uh(ht,St,!1,bt,ft,y,_,R,hl(E,M),hl(M,E));let Pt=0;for(let Dt of J){let qt=k.get(Dt.name)??y,Wt=f.has(Dt.name),Ft=Wt?"\u25B6":"\u25BC",Xt=-ct.left+5,zt=ct.left-7,xt=Pt,$t=q,Zt=T.structural(4),re=T.structural(4),Ot=`tl-band-clip-${lK++}`;if(ht.append("clipPath").attr("id",Ot).append("rect").attr("x",Xt).attr("y",xt).attr("width",zt).attr("height",$t).attr("rx",Zt),ht.append("rect").attr("class","tl-group-header-bg").attr("data-group",Dt.name).attr("x",Xt).attr("y",xt).attr("width",zt).attr("height",$t).attr("rx",Zt).attr("fill",ee(n,qt,r,{mode:x})).style("pointer-events","none"),ht.append("rect").attr("class","tl-group-header-accent").attr("data-group",Dt.name).attr("x",Xt).attr("y",xt).attr("width",re).attr("height",$t).attr("fill",qt).attr("clip-path",`url(#${Ot})`).style("pointer-events","none"),ht.append("g").attr("class","tl-group-header").attr("data-group",Dt.name).style("cursor","pointer").on("mouseenter",()=>N(ht,Dt.name)).on("mouseleave",()=>$(ht)).on("click",()=>m(Dt.name)).append("text").attr("x",-ct.left+T.aesthetic(10)).attr("y",Pt+q/2).attr("dy","0.35em").attr("text-anchor","start").attr("fill",y).attr("font-size",`${nt}px`).attr("font-weight","600").text(`${Ft} ${Dt.name}`),Dt.events.length>0){let oe=Dt.events.map(Ne=>En(Ne.date)),Ee=Dt.events.filter(Ne=>Ne.endDate).map(Ne=>En(Ne.endDate)),de=Math.min(...oe),jt=Math.max(...oe,...Ee),te=St(de),fe=St(jt),Me=Math.max(fe-te,T.structural(20));ht.append("g").attr("class",Wt?"tl-group-summary":"tl-group-bar").attr("data-group",Dt.name).style("cursor","pointer").on("mouseenter",()=>N(ht,Dt.name)).on("mouseleave",()=>$(ht)).on("click",()=>m(Dt.name)).append("rect").attr("x",te).attr("y",Pt).attr("width",Me).attr("height",q).attr("rx",U).attr("fill",ee(n,qt,r,{mode:x})).attr("stroke",qt).attr("stroke-width",Y)}if(Wt){Pt+=Et+V;continue}Dt.events.forEach((oe,Ee)=>{let de=Pt+(Ee+1)*Et+Et/2,jt=St(En(oe.date)),te=ht.append("g").attr("class","tl-event").attr("data-group",Dt.name).attr("data-line-number",String(oe.lineNumber)).attr("data-date",String(En(oe.date))).attr("data-end-date",oe.endDate?String(En(oe.endDate)):null).style("cursor","pointer").on("mouseenter",function(Ue){N(ht,Dt.name),W?JL(ht,St,oe.date,oe.endDate,ft,qt):ha(g,gl(oe),Ue)}).on("mouseleave",function(){$(ht),W?tC(ht):il(g)}).on("mousemove",function(Ue){W||ha(g,gl(oe),Ue)}).on("click",()=>{i&&oe.lineNumber&&i(oe.lineNumber)});A(te,oe);let fe=v(oe),_e=!oe.endDate?"\u25C6":"\u25CF",Ne=te.append("text").attr("class","tl-event-label").attr("x",-ct.left+T.aesthetic(20)).attr("y",de).attr("dy","0.35em").attr("text-anchor","start").attr("font-size",`${K}px`).attr("fill",y);if(Ne.append("tspan").attr("fill",fe).text(_e),Ne.append("tspan").attr("fill",y).text(" "+oe.label),oe.endDate){let Ue=St(En(oe.endDate)),en=Math.max(Ue-jt,4),An=ee(n,fe,r,{mode:x}),cn=fe;if(oe.uncertain){let se=`uncertain-${oe.lineNumber}`,ae=`uncertain-s-${oe.lineNumber}`,he=Ct.select("defs").node()||Ct.append("defs").node(),ze=It(he);ze.append("linearGradient").attr("id",se).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",Te=>Te.offset).attr("stop-color",x==="outline"?w:vt(fe,w,30)).attr("stop-opacity",Te=>Te.opacity),ze.append("linearGradient").attr("id",ae).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",Te=>Te.offset).attr("stop-color",fe).attr("stop-opacity",Te=>Te.opacity),An=`url(#${se})`,cn=`url(#${ae})`}te.append("rect").attr("x",jt).attr("y",de-q/2).attr("width",en).attr("height",q).attr("rx",U).attr("fill",An).attr("stroke",cn).attr("stroke-width",Y)}else te.append("circle").attr("cx",jt).attr("cy",de).attr("r",X).attr("fill",ee(n,fe,r,{mode:x})).attr("stroke",fe).attr("stroke-width",z)}),Pt+=(Dt.events.length+1)*Et+V}}function sK(t,e,n,r,o,a,i,s,l,c,d,u){let{width:f,height:m,tooltip:p,fillMode:h,textColor:g,mutedColor:x,bgColor:y,bg:b,groupColorMap:w,tagLanes:k,eventColor:C,minDate:v,maxDate:_,datePadding:R,earliestStartDateStr:L,latestEndDateStr:E,tagLegendReserve:M,ctx:S}=o,{fadeToGroup:T,fadeToEra:N,fadeToMarker:I,fadeReset:G,setTagAttrs:$}=a,{timelineEvents:A,timelineGroups:D,timelineEras:O,timelineMarkers:P,timelineSort:H,timelineScale:W,timelineSwimlanes:B}=e,q=e.noTitle?null:e.title,V=S.structural(4),X=S.structural(2),z=S.structural(4),U=S.structural(2),Y=S.structural(12),K=S.text(10),et=S.text(11),nt=S.text(10),J=S.text(12),F=`${S.structural(4)},${S.structural(4)}`;if(k!=null||H==="group"&&D.length>0){let Q,Z;if(k)Q=k.map(mt=>mt.name),Z=new Map(k.map(mt=>[mt.name,mt.events]));else{let mt=D.map(gt=>gt.name);Q=A.filter(gt=>gt.group===null||!mt.includes(gt.group)).length>0?[...mt,"(Other)"]:mt,Z=new Map(Q.map(gt=>[gt,A.filter(Et=>gt==="(Other)"?Et.group===null||!mt.includes(Et.group):Et.group===gt)]))}let ot=Q.length,at=W?S.aesthetic(40):0,lt=P.length>0?S.aesthetic(30):0,rt={top:S.aesthetic(104)+lt+M,right:S.aesthetic(40)+at,bottom:S.aesthetic(40),left:S.aesthetic(60)+at},ut=f-rt.left-rt.right,tt=m-rt.top-rt.bottom,it=ut/ot,st=yr().domain([v-R,_+R]).range([0,tt]),ct=It(t).append("svg").attr("viewBox",`0 0 ${f} ${m}`).attr("width",s?f:"100%").attr("preserveAspectRatio","xMidYMin meet").style("background",y),pt=ct.append("g").attr("transform",`translate(${rt.left},${rt.top})`);ao(ct,q,e.titleLineNumber,f,g,i),Yh(pt,O,st,!0,ut,tt,(mt,bt)=>N(pt,mt,bt),()=>G(pt),W,p,n,void 0,h,b),Vh(pt,P,st,!0,ut,tt,mt=>I(pt,mt),()=>G(pt),W,p,n,void 0,h,b),W&&Uh(pt,st,!0,ut,tt,g,v,_,hl(L,E),hl(E,L)),(B||k)&&Q.forEach((mt,bt)=>{let gt=bt*it,Et=bt%2===0?g:"transparent";pt.append("rect").attr("class","tl-swimlane").attr("data-group",mt).attr("x",gt).attr("y",0).attr("width",it).attr("height",tt).attr("fill",Et).attr("opacity",.06)}),Q.forEach((mt,bt)=>{let gt=bt*it,Et=w.get(mt)??g,ft=gt+it/2;pt.append("g").attr("class","tl-lane-header").attr("data-group",mt).style("cursor","pointer").on("mouseenter",()=>T(pt,mt)).on("mouseleave",()=>G(pt)).append("text").attr("x",ft).attr("y",-S.structural(15)).attr("text-anchor","middle").attr("fill",Et).attr("font-size",`${J}px`).attr("font-weight","600").text(mt),pt.append("line").attr("x1",ft).attr("y1",0).attr("x2",ft).attr("y2",tt).attr("stroke",x).attr("stroke-width",1).attr("stroke-dasharray",F);let _t=Z.get(mt)??[];for(let yt of _t){let St=st(En(yt.date)),Ct=pt.append("g").attr("class","tl-event").attr("data-group",mt).attr("data-line-number",String(yt.lineNumber)).attr("data-date",String(En(yt.date))).attr("data-end-date",yt.endDate?String(En(yt.endDate)):null).style("cursor","pointer").on("mouseenter",function(Pt){T(pt,mt),ha(p,gl(yt),Pt)}).on("mouseleave",function(){G(pt),il(p)}).on("mousemove",function(Pt){ha(p,gl(yt),Pt)}).on("click",()=>{i&&yt.lineNumber&&i(yt.lineNumber)});$(Ct,yt);let ht=C(yt);if(yt.endDate){let Pt=st(En(yt.endDate)),Dt=Math.max(Pt-St,4),qt=ee(n,ht,r,{mode:h}),Wt=ht;if(yt.uncertain){let Ft=`uncertain-vg-${yt.lineNumber}`,Xt=`uncertain-vg-s-${yt.lineNumber}`,zt=ct.select("defs").node()||ct.append("defs").node(),xt=It(zt);xt.append("linearGradient").attr("id",Ft).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",$t=>$t.offset).attr("stop-color",h==="outline"?b:vt(Et,b,30)).attr("stop-opacity",$t=>$t.opacity),xt.append("linearGradient").attr("id",Xt).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",$t=>$t.offset).attr("stop-color",ht).attr("stop-opacity",$t=>$t.opacity),qt=`url(#${Ft})`,Wt=`url(#${Xt})`}Ct.append("rect").attr("x",ft-Y/2).attr("y",St).attr("width",Y).attr("height",Dt).attr("rx",z).attr("fill",qt).attr("stroke",Wt).attr("stroke-width",U),Ct.append("text").attr("x",ft+Y+S.aesthetic(2)).attr("y",St+Dt/2).attr("dy","0.35em").attr("fill",g).attr("font-size",`${K}px`).text(yt.label)}else Ct.append("circle").attr("cx",ft).attr("cy",St).attr("r",V).attr("fill",ee(n,ht,r,{mode:h})).attr("stroke",ht).attr("stroke-width",X),Ct.append("text").attr("x",ft+S.aesthetic(10)).attr("y",St).attr("dy","0.35em").attr("fill",g).attr("font-size",`${K}px`).text(yt.label)}})}else{let Q=W?S.aesthetic(40):0,Z=P.length>0?S.aesthetic(30):0,ot={top:S.aesthetic(104)+Z+M,right:S.aesthetic(200),bottom:S.aesthetic(40),left:S.aesthetic(60)+Q},at=f-ot.left-ot.right,lt=m-ot.top-ot.bottom,rt=S.structural(20),ut=yr().domain([v-R,_+R]).range([0,lt]),tt=A.slice().sort((ct,pt)=>En(ct.date)-En(pt.date)),it=It(t).append("svg").attr("viewBox",`0 0 ${f} ${m}`).attr("width",s?f:"100%").attr("preserveAspectRatio","xMidYMin meet").style("background",y),st=it.append("g").attr("transform",`translate(${ot.left},${ot.top})`);ao(it,q,e.titleLineNumber,f,g,i),Yh(st,O,ut,!0,at,lt,(ct,pt)=>N(st,ct,pt),()=>G(st),W,p,n,void 0,h,b),Vh(st,P,ut,!0,at,lt,ct=>I(st,ct),()=>G(st),W,p,n,void 0,h,b),W&&Uh(st,ut,!0,at,lt,g,v,_,hl(L,E),hl(E,L)),D.length>0&&!e.noLegend&&eC(st,D,w,g,n,r,-S.aesthetic(55),ct=>T(st,ct),()=>G(st)),st.append("line").attr("x1",rt).attr("y1",0).attr("x2",rt).attr("y2",lt).attr("stroke",x).attr("stroke-width",1).attr("stroke-dasharray",F);for(let ct of tt){let pt=ut(En(ct.date)),mt=C(ct),bt=st.append("g").attr("class","tl-event").attr("data-group",ct.group||"").attr("data-line-number",String(ct.lineNumber)).attr("data-date",String(En(ct.date))).attr("data-end-date",ct.endDate?String(En(ct.endDate)):null).style("cursor","pointer").on("mouseenter",function(gt){ct.group&&D.length>0&&T(st,ct.group),ha(p,gl(ct),gt)}).on("mouseleave",function(){G(st),il(p)}).on("mousemove",function(gt){ha(p,gl(ct),gt)}).on("click",()=>{i&&ct.lineNumber&&i(ct.lineNumber)});if($(bt,ct),ct.endDate){let gt=ut(En(ct.endDate)),Et=Math.max(gt-pt,4),ft=ee(n,mt,r,{mode:h}),kt=mt;if(ct.uncertain){let _t=`uncertain-v-${ct.lineNumber}`,yt=`uncertain-v-s-${ct.lineNumber}`,St=it.select("defs").node()||it.append("defs").node(),Ct=It(St);Ct.append("linearGradient").attr("id",_t).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",ht=>ht.offset).attr("stop-color",h==="outline"?b:vt(mt,b,30)).attr("stop-opacity",ht=>ht.opacity),Ct.append("linearGradient").attr("id",yt).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%").selectAll("stop").data([{offset:"0%",opacity:1},{offset:"80%",opacity:1},{offset:"100%",opacity:0}]).enter().append("stop").attr("offset",ht=>ht.offset).attr("stop-color",mt).attr("stop-opacity",ht=>ht.opacity),ft=`url(#${_t})`,kt=`url(#${yt})`}bt.append("rect").attr("x",rt-Y/2).attr("y",pt).attr("width",Y).attr("height",Et).attr("rx",z).attr("fill",ft).attr("stroke",kt).attr("stroke-width",U),bt.append("text").attr("x",rt+Y+S.aesthetic(4)).attr("y",pt+Et/2).attr("dy","0.35em").attr("fill",g).attr("font-size",`${et}px`).text(ct.label)}else bt.append("circle").attr("cx",rt).attr("cy",pt).attr("r",V).attr("fill",ee(n,mt,r,{mode:h})).attr("stroke",mt).attr("stroke-width",X),bt.append("text").attr("x",rt+Y+S.aesthetic(4)).attr("y",pt).attr("dy","0.35em").attr("fill",g).attr("font-size",`${et}px`).text(ct.label);bt.append("text").attr("x",rt-S.aesthetic(14)).attr("y",ct.endDate?ut(En(ct.date))+Math.max(ut(En(ct.endDate))-ut(En(ct.date)),4)/2:pt).attr("dy","0.35em").attr("text-anchor","end").attr("fill",x).attr("font-size",`${nt}px`).text(ct.date+(ct.endDate?`\u2192${ct.endDate}`:""))}}}function Xh(t,e,n,r,o,a,i,s,l,c,d){let u=nK(t,e,n,r,a,i,s);if(!u)return;s=u.swimlaneTagGroup;let{isVertical:f,tagLanes:m}=u,p=rK(),h=QL.get(t);h||(h=new Set,QL.set(t,h));function g(y){h.has(y)?h.delete(y):h.add(y),Xh(t,e,n,r,o,a,i,s,l,c,d)}if(f){sK(t,e,n,r,u,p,o,a,s,i,l,c);return}m!=null||e.timelineSort!=="time"&&e.timelineGroups.length>0?iK(t,e,n,r,u,p,o,a,s,i,l,c,h,g):aK(t,e,n,r,u,p,o,a,s,i,l,c),oK(t,e,n,r,u,p,o,a,s,i,l,c,d)}var QL,lK,I4=dt(()=>{"use strict";Oe();bi();Nn();Ke();T4();wr();qi();Pf();pi();Fe();Oe();pr();Mr();QL=new WeakMap,lK=0});function jh(t,e){return Lo(t,e)}var P4=dt(()=>{"use strict";Ss()});function rC(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Kh(n)}function Kh(t){this._=t}function dK(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function uK(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function nC(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=cK,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var cK,oC,aC=dt(()=>{"use strict";cK={value:function(){}};Kh.prototype=rC.prototype={constructor:Kh,on:function(t,e){var n=this._,r=dK(t+"",n),o,a=-1,i=r.length;if(arguments.length<2){for(;++a<i;)if((o=(t=r[a]).type)&&(o=uK(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<i;)if(o=(t=r[a]).type)n[o]=nC(n[o],t.name,e);else if(e==null)for(o in n)n[o]=nC(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Kh(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,a;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,o=a.length;r<o;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,a=r.length;o<a;++o)r[o].value.apply(e,n)}};oC=rC});var iC={};ue(iC,{dispatch:()=>oC});var sC=dt(()=>{"use strict";aC()});var uC=lk((xSt,dC)=>{"use strict";var fK=(sC(),uk(iC)).dispatch,D4=Math.PI/180,mK={archimedean:cC,rectangular:kK},i1=64,Zh=2048;dC.exports=function(){var t=[256,256],e=pK,n=hK,r=gK,o=lC,a=lC,i=yK,s=cC,l=[],c=1/0,d=fK("word","end"),u=null,f=Math.random,m=()=>(~~(f()*6)-3)*30,p={},h=MK;p.canvas=function(y){return arguments.length?(h=yl(y),p):h},p.start=function(){var y=g(h()),b=SK((t[0]>>5)*t[1]),w=null,k=l.length,C=-1,v=[],_=l.map(function(L,E){return L.text=e.call(this,L,E),L.font=n.call(this,L,E),L.style=o.call(this,L,E),L.weight=a.call(this,L,E),L.rotate=m.call(this,L,E),L.size=~~r.call(this,L,E),L.padding=i.call(this,L,E),L}).sort(function(L,E){return E.size-L.size});return u&&clearInterval(u),u=setInterval(R,0),R(),p;function R(){for(var L=Date.now();Date.now()-L<c&&++C<k&&u;){var E=_[C];E.x=t[0]*(f()+.5)>>1,E.y=t[1]*(f()+.5)>>1,bK(y,E,_,C),E.hasText&&x(b,E,w)&&(v.push(E),d.call("word",p,E),w?wK(w,E):w=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=t[0]>>1,E.y-=t[1]>>1)}C>=k&&(p.stop(),d.call("end",p,v,w))}},p.stop=function(){u&&(clearInterval(u),u=null);for(let y of l)delete y.sprite;return p};function g(y){let b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;let w=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(i1<<5)/w,y.height=Zh/w,b.fillStyle=b.strokeStyle="red",{context:b,ratio:w}}function x(y,b,w){for(var k=[{x:0,y:0},{x:t[0],y:t[1]}],C=b.x,v=b.y,_=Math.sqrt(t[0]*t[0]+t[1]*t[1]),R=s(t),L=f()<.5?1:-1,E=-L,M,S,T;(M=R(E+=L))&&(S=~~M[0],T=~~M[1],!(Math.min(Math.abs(S),Math.abs(T))>=_));)if(b.x=C+S,b.y=v+T,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>t[0]||b.y+b.y1>t[1])&&(!w||EK(b,w))&&!xK(b,y,t[0])){for(var N=b.sprite,I=b.width>>5,G=t[0]>>5,$=b.x-(I<<4),A=$&127,D=32-A,O=b.y1-b.y0,P=(b.y+b.y0)*G+($>>5),H,W=0;W<O;W++){H=0;for(var B=0;B<=I;B++)y[P+B]|=H<<D|(B<I?(H=N[W*I+B])>>>A:0);P+=G}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(c=y??1/0,p):c},p.words=function(y){return arguments.length?(l=y,p):l},p.size=function(y){return arguments.length?(t=[+y[0],+y[1]],p):t},p.font=function(y){return arguments.length?(n=yl(y),p):n},p.fontStyle=function(y){return arguments.length?(o=yl(y),p):o},p.fontWeight=function(y){return arguments.length?(a=yl(y),p):a},p.rotate=function(y){return arguments.length?(m=yl(y),p):m},p.text=function(y){return arguments.length?(e=yl(y),p):e},p.spiral=function(y){return arguments.length?(s=mK[y]||y,p):s},p.fontSize=function(y){return arguments.length?(r=yl(y),p):r},p.padding=function(y){return arguments.length?(i=yl(y),p):i},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function pK(t){return t.text}function hK(){return"serif"}function lC(){return"normal"}function gK(t){return Math.sqrt(t.value)}function yK(){return 1}function bK(t,e,n,r){if(!e.sprite){var o=t.context,a=t.ratio;o.clearRect(0,0,(i1<<5)/a,Zh/a);var i=0,s=0,l=0,c=n.length;for(--r;++r<c;){e=n[r],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let E=o.measureText(e.text),M=-Math.floor(E.width/2),S=(E.width+1)*a,T=e.size<<1;if(e.rotate){var d=Math.sin(e.rotate*D4),u=Math.cos(e.rotate*D4),f=S*u,m=S*d,p=T*u,h=T*d;S=Math.max(Math.abs(f+h),Math.abs(f-h))+31>>5<<5,T=~~Math.max(Math.abs(m+p),Math.abs(m-p))}else S=S+31>>5<<5;if(T>l&&(l=T),i+S>=i1<<5&&(i=0,s+=l,l=0),s+T>=Zh)break;o.translate((i+(S>>1))/a,(s+(T>>1))/a),e.rotate&&o.rotate(e.rotate*D4),o.fillText(e.text,M,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,M,0)),o.restore(),e.width=S,e.height=T,e.xoff=i,e.yoff=s,e.x1=S>>1,e.y1=T>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,i+=S}for(var g=o.getImageData(0,0,(i1<<5)/a,Zh/a).data,x=[];--r>=0;)if(e=n[r],!!e.hasText){for(var y=e.width,b=y>>5,w=e.y1-e.y0,k=0;k<w*b;k++)x[k]=0;if(i=e.xoff,i==null)return;s=e.yoff;for(var C=0,v=-1,_=0;_<w;_++){for(var k=0;k<y;k++){var R=b*_+(k>>5),L=g[(s+_)*(i1<<5)+(i+k)<<2]?1<<31-k%32:0;x[R]|=L,C|=L}C?v=_:(e.y0++,w--,_--,s++)}e.y1=e.y0+v,e.sprite=x.slice(0,(e.y1-e.y0)*b)}}}function xK(t,e,n){n>>=5;for(var r=t.sprite,o=t.width>>5,a=t.x-(o<<4),i=a&127,s=32-i,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),d,u=0;u<l;u++){d=0;for(var f=0;f<=o;f++)if((d<<s|(f<o?(d=r[u*o+f])>>>i:0))&e[c+f])return!0;c+=n}return!1}function wK(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function EK(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function cC(t){var e=t[0]/t[1];return function(n){return[e*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function kK(t){var e=4,n=e*t[0]/t[1],r=0,o=0;return function(a){var i=a<0?-1:1;switch(Math.sqrt(1+4*i*a)-i&3){case 0:r+=n;break;case 1:o+=e;break;case 2:r-=n;break;default:o-=e;break}return[r,o]}}function SK(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}function MK(){return document.createElement("canvas")}function yl(t){return typeof t=="function"?t:function(){return t}}});function Qh(t,e){return Lo(t,e)}var O4=dt(()=>{"use strict";Ss()});function Jh(t,e){return Lo(t,e)}var G4=dt(()=>{"use strict";Ss()});function va(t,e){return t.x<e.x+e.w&&t.x+t.w>e.x&&t.y<e.y+e.h&&t.y+t.h>e.y}function bl(t,e){let n=Math.max(t.x,Math.min(e.cx,t.x+t.w)),r=Math.max(t.y,Math.min(e.cy,t.y+t.h)),o=n-e.cx,a=r-e.cy;return o*o+a*a<e.r*e.r}function q4(t,e,n,r,o){let a=n-t,i=r-e,s=0,l=1,c=[[-a,t-o.x],[a,o.x+o.w-t],[-i,e-o.y],[i,o.y+o.h-e]];for(let[d,u]of c)if(d===0){if(u<0)return!1}else{let f=u/d;if(d<0){if(f>l)return!1;f>s&&(s=f)}else{if(f<s)return!1;f<l&&(l=f)}}return!0}function _K(t,e,n,r,o,a,i,s){let l=(p,h,g,x,y,b)=>Math.sign((g-p)*(b-h)-(x-h)*(y-p)),c=l(t,e,n,r,o,a),d=l(t,e,n,r,i,s),u=l(o,a,i,s,t,e),f=l(o,a,i,s,n,r);if(c!==d&&u!==f)return!0;let m=(p,h,g,x,y,b)=>Math.min(p,g)<=y&&y<=Math.max(p,g)&&Math.min(h,x)<=b&&b<=Math.max(h,x);return!!(c===0&&m(t,e,n,r,o,a)||d===0&&m(t,e,n,r,i,s)||u===0&&m(o,a,i,s,t,e)||f===0&&m(o,a,i,s,n,r))}function hC(t){let e=[...t?.reserved??[]],n=[],r=t?.obstacles??[],o=t?.markers??[];return{hitsPlaced:a=>e.some(i=>va(a,i)),hitsObstacle:a=>r.some(i=>va(a,i)),hitsMarker:a=>o.some(i=>bl(a,i)),leaderCrosses:([a,i,s,l])=>n.some(c=>_K(a,i,s,l,c[0],c[1],c[2],c[3])),leaderHitsPlaced:([a,i,s,l])=>e.some(c=>q4(a,i,s,l,c)),commit:(a,i)=>{e.push(a),i&&n.push(i)},get placed(){return e}}}function tg(t,e,n,r,o,a=!1){let i=o+4,s=i+2,l=t.map(u=>({cx:u.cx,cy:u.cy,r:u.r??r})),c=[],d=[];for(let u=0;u<t.length;u++){let f=t[u],m=(f.r??r)+4,p=Tt(f.label,o,{bold:a})+8,h=null,g=[{gen:y=>{let b=f.cx-p/2,w=f.cy-y-i;return w<e.top||b<e.left||b+p>e.right?null:{rect:{x:b,y:w,w:p,h:i},textX:f.cx,textY:w+i/2,anchor:"middle"}}},{gen:y=>{let b=f.cx-p/2,w=f.cy+y;return w+i>e.bottom||b<e.left||b+p>e.right?null:{rect:{x:b,y:w,w:p,h:i},textX:f.cx,textY:w+i/2,anchor:"middle"}}},{gen:y=>{let b=f.cx+y,w=f.cy-i/2;return b+p>e.right||w<e.top||w+i>e.bottom?null:{rect:{x:b,y:w,w:p,h:i},textX:b,textY:f.cy,anchor:"start"}}},{gen:y=>{let b=f.cx-y-p,w=f.cy-i/2;return b<e.left||w<e.top||w+i>e.bottom?null:{rect:{x:b,y:w,w:p,h:i},textX:b+p,textY:f.cy,anchor:"end"}}}];for(let{gen:y}of g)for(let b=m;;b+=s){let w=y(b);if(!w)break;let k=!1;for(let C of c)if(va(w.rect,C)){k=!0;break}if(!k){for(let C of l)if(bl(w.rect,C)){k=!0;break}}if(!k){for(let C of n)if(va(w.rect,C)){k=!0;break}}if(!k){let C=b;(!h||C<h.dist)&&(h={rect:w.rect,textX:w.textX,textY:w.textY,anchor:w.anchor,dist:C});break}}if(!h){let y=f.cx-p/2,b=f.cy-m-i;h={rect:{x:y,y:b,w:p,h:i},textX:f.cx,textY:b+i/2,anchor:"middle",dist:m}}c.push(h.rect);let x;if(h.dist>m+s){let y=h.textX-f.cx,b=h.textY-f.cy,w=Math.atan2(b,y),k=f.r??r,C=f.cx+Math.cos(w)*k,v=f.cy+Math.sin(w)*k,_=Math.max(h.rect.x,Math.min(f.cx,h.rect.x+h.rect.w)),R=Math.max(h.rect.y,Math.min(f.cy,h.rect.y+h.rect.h));x={x1:C,y1:v,x2:_,y2:R}}d.push({label:f.label,x:h.textX,y:h.textY,anchor:h.anchor,...x!==void 0&&{connectorLine:x}})}return d}var _d=dt(()=>{"use strict";Ve()});function eg(t,e){return Lo(t,e)}var B4=dt(()=>{"use strict";Ss()});function l1(t){for(let e of yC)if(e.pattern.test(t))return e.type;return"default"}var yC,zSt,H4=dt(()=>{"use strict";yC=[{pattern:/^KeyDB$/i,type:"cache"},{pattern:/DB$/i,type:"database"},{pattern:/Database/i,type:"database"},{pattern:/Datastore/i,type:"database"},{pattern:/Store$/i,type:"database"},{pattern:/Storage/i,type:"database"},{pattern:/Repo$/i,type:"database"},{pattern:/Repository/i,type:"database"},{pattern:/SQL/i,type:"database"},{pattern:/Postgres/i,type:"database"},{pattern:/MySQL/i,type:"database"},{pattern:/Mongo/i,type:"database"},{pattern:/Dynamo/i,type:"database"},{pattern:/^Aurora$/i,type:"database"},{pattern:/Spanner/i,type:"database"},{pattern:/Supabase/i,type:"database"},{pattern:/Firebase/i,type:"database"},{pattern:/BigQuery/i,type:"database"},{pattern:/Redshift/i,type:"database"},{pattern:/Snowflake/i,type:"database"},{pattern:/Cassandra/i,type:"database"},{pattern:/Neo4j/i,type:"database"},{pattern:/ClickHouse/i,type:"database"},{pattern:/Elastic/i,type:"database"},{pattern:/OpenSearch/i,type:"database"},{pattern:/Druid/i,type:"database"},{pattern:/Trino/i,type:"database"},{pattern:/Pinecone/i,type:"database"},{pattern:/Weaviate/i,type:"database"},{pattern:/Qdrant/i,type:"database"},{pattern:/Milvus/i,type:"database"},{pattern:/Presto/i,type:"database"},{pattern:/Table$/i,type:"database"},{pattern:/Cache/i,type:"cache"},{pattern:/Redis/i,type:"cache"},{pattern:/Memcache/i,type:"cache"},{pattern:/Dragonfly/i,type:"cache"},{pattern:/Hazelcast/i,type:"cache"},{pattern:/Valkey/i,type:"cache"},{pattern:/Queue/i,type:"queue"},{pattern:/MQ$/i,type:"queue"},{pattern:/SQS/i,type:"queue"},{pattern:/Kafka/i,type:"queue"},{pattern:/RabbitMQ/i,type:"queue"},{pattern:/EventBus/i,type:"queue"},{pattern:/MessageBus/i,type:"queue"},{pattern:/Bus$/i,type:"queue"},{pattern:/Topic/i,type:"queue"},{pattern:/Stream$/i,type:"queue"},{pattern:/SNS/i,type:"queue"},{pattern:/PubSub/i,type:"queue"},{pattern:/Broker$/i,type:"queue"},{pattern:/NATS/i,type:"queue"},{pattern:/Pulsar/i,type:"queue"},{pattern:/Kinesis/i,type:"queue"},{pattern:/EventBridge/i,type:"queue"},{pattern:/CloudEvents/i,type:"queue"},{pattern:/Celery/i,type:"queue"},{pattern:/Sidekiq/i,type:"queue"},{pattern:/EventHub/i,type:"queue"},{pattern:/Channel$/i,type:"queue"},{pattern:/^Admin$/i,type:"actor"},{pattern:/^User$/i,type:"actor"},{pattern:/^Customer$/i,type:"actor"},{pattern:/^Agent$/i,type:"actor"},{pattern:/^Person$/i,type:"actor"},{pattern:/^Buyer$/i,type:"actor"},{pattern:/^Seller$/i,type:"actor"},{pattern:/^Guest$/i,type:"actor"},{pattern:/^Visitor$/i,type:"actor"},{pattern:/^Operator$/i,type:"actor"},{pattern:/^Developer$/i,type:"actor"},{pattern:/^Alice$/i,type:"actor"},{pattern:/^Bob$/i,type:"actor"},{pattern:/^Charlie$/i,type:"actor"},{pattern:/^Fan$/i,type:"actor"},{pattern:/^Purchaser$/i,type:"actor"},{pattern:/^Reviewer$/i,type:"actor"},{pattern:/User$/i,type:"actor"},{pattern:/Actor$/i,type:"actor"},{pattern:/Analyst$/i,type:"actor"},{pattern:/Staff$/i,type:"actor"}];zSt=yC.length});function ie(t){return t.normalize("NFC").replace(AK," ").trim().toLocaleLowerCase("en-US")}function _r(t){return t.normalize("NFC").trim()}var AK,so=dt(()=>{"use strict";AK=/\s+/gu});function Ad(t,e){let n=[];(t.includes("->")||t.includes("~>"))&&n.push(At(e,'Arrow symbols (-> or ~>) are not allowed inside a label. Move the label after the arrow: "A -> B: uses -> to chain". See "In-Arrow Message Labels" \u2192 Forbidden.',"error",bC.ARROW_SUBSTRING_IN_LABEL));for(let r of t){let o=r.codePointAt(0);if(o>=0&&o<=31&&o!==9||o===127){let s=o.toString(16).toUpperCase().padStart(4,"0");n.push(At(e,`Label contains a control character (U+${s}). Remove it and use plain text.`,"error",bC.CONTROL_CHAR_IN_LABEL));break}}return n}function Ao(t,e){let n=t.trim();if(n.length===0)return{label:void 0,diagnostics:[]};let r=Ad(n,e);return{label:n,diagnostics:r}}function EC(t){if(PK.test(t)||DK.test(t))return{error:"Bidirectional arrows are no longer supported. Use two separate lines: 'A -msg-> B' and 'B -msg-> A'"};if(xC.test(t)||wC.test(t)){let n=t.match(xC)??t.match(wC),r=n[3],o=n[1],a=n[2].trim();return{error:`Left-pointing arrows are no longer supported. Write '${r} -${a}-> ${o}' instead`}}let e=[{re:RK,async:!1},{re:IK,async:!0}];for(let{re:n,async:r}of e){let o=t.match(n);if(!o)continue;let a=o[2].trim();return a?{from:o[1],to:o[3],label:a,async:r}:null}return null}var bC,RK,IK,xC,wC,PK,DK,wi=dt(()=>{"use strict";Je();bC={ARROW_SUBSTRING_IN_LABEL:"E_ARROW_SUBSTRING_IN_LABEL",CONTROL_CHAR_IN_LABEL:"E_CONTROL_CHAR_IN_LABEL"};RK=/^(.+?)\s*-(.+)->\s*(.+)$/,IK=/^(.+?)\s*~(.+)~>\s*(.+)$/,xC=/^(.+?)\s*<-(.+)-\s*(.+)$/,wC=/^(.+?)\s*<~(.+)~\s*(.+)$/,PK=/^(.+?)\s*<-(.+)->\s*(.+)$/,DK=/^(.+?)\s*<~(.+)~>\s*(.+)$/});var kC={};ue(kC,{isSequenceBlock:()=>Wr,isSequenceNote:()=>lo,isSequenceSection:()=>ia,looksLikeSequence:()=>W4,parseSequenceDgmo:()=>ng});function Wr(t){return t.kind==="block"}function ia(t){return t.kind==="section"}function lo(t){return t.kind==="note"}function VK(t,e,n,r,o){if(!t.toLowerCase().startsWith("note")||t.length>4&&t[4]!==" ")return null;let i=t.match(YK);if(i){let l=i[1]?.toLowerCase()||"right",c=i[2]||null;if(!c){if(!o)return{kind:"skip"};c=o}let d=ie(bn(c));if(n.has(d)){let u=e.find(f=>ie(f.id)===d);return{kind:"multi-head",position:l,participantId:u?.id??c}}}let s=t.match(zK);if(s){let l=s[1].trim(),c=l.toLowerCase();if(c.startsWith("left")||c.startsWith("right")){let d=c.startsWith("left")?"left":"right",u=d,f=l.substring(d.length).trim(),m=!1;if(f.toLowerCase().startsWith("of ")&&(f=f.substring(3).trim(),m=!0),!f)return o?n.has(ie(o))?{kind:"multi-head",position:u,participantId:o}:{kind:"skip"}:{kind:"skip"};let p=UK(f,e,n,r);return p?p.text?{kind:"single",position:u,participantId:p.participantId,text:p.text}:{kind:"multi-head",position:u,participantId:p.participantId}:m?{kind:"skip"}:o?n.has(ie(o))?{kind:"single",position:u,participantId:o,text:f}:{kind:"skip"}:{kind:"skip"}}return o?n.has(ie(o))?{kind:"single",position:"right",participantId:o,text:l}:{kind:"skip"}:{kind:"skip"}}return null}function UK(t,e,n,r){if(t.startsWith('"')||t.startsWith("'")){let a=t[0],i=t.indexOf(a,1);if(i>0){let s=t.substring(1,i),l=ie(s);if(n.has(l)){let c=t.substring(i+1).trim();return{participantId:e.find(u=>ie(u.id)===l)?.id??s,text:c}}}return null}let o=r;for(let a of o){let i=a.id.length;if(t.length<i)continue;let s=t.substring(0,i);if(ie(s)!==ie(a.id))continue;let l=t.substring(i);if(l===""||l[0]===" "||l[0]===" ")return{participantId:a.id,text:l.trim()}}return null}function ng(t,e){let r={title:null,titleLineNumber:null,participants:[],messages:[],elements:[],groups:[],sections:[],tagGroups:[],options:{},diagnostics:[],error:null},o=new Map,a=S=>{let T=S.trim();return o.get(T)??T},i=Cn(r),s=(S,T)=>{let N=At(S,T);r.diagnostics.push(N),r.error||(r.error=He(N))},l=(S,T)=>{r.diagnostics.push(At(S,T,"warning"))};if(!t?.trim())return i(0,"Empty content");let c=t.split(`
|
|
24
24
|
`),d=!1,u=!1,f=!1,m=-1;for(let S=0;S<c.length;S++){let T=c[S].trim();if(!T||T.startsWith("//"))continue;let N=Ce(T);N?.chartType==="sequence"&&(d=!0,m=S,N.title&&(r.title=N.title,r.titleLineNumber=S+1));break}let p=null,h=new Set,g=new Map,x=(S,T,N)=>{let I=bn(S);I===S.trim()&&I.includes(":")&&s(T,`'${I}' is not a participant name \u2014 a colon here means the rest of the line was read as the name. Put the message inside the arrow: 'A -message-> B'`);let G=ie(I),$=I.trim(),A=N?.label??$;if(h.has(G)){let D=r.participants.find(O=>ie(O.id)===G);return D?((_r(D.label)!==_r(A)||_r(D.id)!==_r($))&&r.diagnostics.push(At(T,Bo({incomingDisplay:$,incomingLine:T,existingDisplay:D.id,existingLine:D.lineNumber}),"warning",qo.NAME_MERGED)),D.id):g.get(G)??$}return h.add(G),g.set(G,$),b=!0,r.participants.push({id:$,label:A,type:N?.type??l1(I),lineNumber:T,...N?.position!==void 0?{position:N.position}:{},...N?.metadata&&Object.keys(N.metadata).length>0?{metadata:N.metadata}:{}}),$},y=[],b=!0,w=()=>(b&&(y=[...r.participants].sort((S,T)=>T.label.length-S.label.length),b=!1),y),k=new Map,C=null,v=new Map,_=(S,T)=>{let N=Xe(Zy,new Set(v.keys())),I=Be(S,N,v);return T!=null&&Ye(I.meta,N,G=>l(T,G),I.name),Object.keys(I.meta).length>0?{core:I.name,meta:I.meta,...I.alias!==void 0&&{alias:I.alias}}:{core:S}},R=(S,T)=>{if(S?.position===void 0)return;let N=S.position;delete S.position;let I=parseInt(N,10);if(!/^-?\d+$/.test(N.trim())||Number.isNaN(I)){s(T,`'position: ${N}' must be an integer slot index`);return}return I},L=[],E=()=>{if(L.length===0)return r.elements;let S=L[L.length-1];return S.activeElseIfBranch?S.activeElseIfBranch.children:S.inElse?S.block.elseChildren:S.block.children},M=null;for(let S=0;S<c.length;S++){let T=c[S],N=T.trim(),I=S+1;if(!N){p=null,C=null;continue}if(S===m)continue;let G=N.match(HK);if(G){let bt=G[1].trim(),gt=G[2]?.trim(),Et,ft=G[3]?.trim()||"",kt=!1,_t=$i(ft);if(_t.collapsed&&(kt=!0,ft=_t.rest),ft){let yt=Xe(Zy,new Set(v.keys())),St=Be(ft,yt,v);Ye(St.meta,yt,Ct=>l(I,Ct),St.name),Object.keys(St.meta).length>0&&(Et=St.meta),Et?.collapsed?.toLowerCase()==="true"&&(kt=!0,delete Et.collapsed,Object.keys(Et).length===0&&(Et=void 0))}gt&&l(I,`'(${gt})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,p={name:bt,participantIds:[],lineNumber:I,...Et?{metadata:Et}:{},...kt?{collapsed:!0}:{}},r.groups.push(p);continue}if(N.startsWith("[")){let bt=N.match(FK);if(bt&&bt[1].includes("|")){let gt=bt[1],Et=gt.indexOf("|"),ft=gt.substring(0,Et).trim().replace(/\([^)]*\)$/,"").trim(),kt=gt.substring(Et).replace(/^\|\s*/,"").trim();s(I,`Metadata goes after the bracket with no pipe \u2014 use '[${ft}] ${kt}' (e.g. '[Backend] t: Product'), not '[${gt.trim()}]'`);continue}}if(p&&me(T)===0&&(p=null),N.startsWith("//"))continue;if(N.startsWith("#")){s(I,"Use // for comments");continue}let $=ln(N);if($){if(u){s(I,"Tag groups must appear before sequence content");continue}let bt={name:$.name,...$.alias!==void 0&&{alias:$.alias},entries:[],lineNumber:I};C=bt,$.alias&&v.set($.alias.toLowerCase(),$.name.toLowerCase()),v.set(ie($.name),$.name.toLowerCase()),r.tagGroups.push(bt);continue}if(C&&!u&&me(T)>0){let{text:bt,isDefault:gt}=an(N),{label:Et,color:ft}=ye(bt,e,r.diagnostics,I);(gt||C.entries.length===0)&&(C.defaultValue=Et),C.entries.push({value:Et,color:ft??fn,lineNumber:I});continue}C&&(C=null);let A=N.match(WK);if(A){let bt=me(T);for(;L.length>0;){let kt=L[L.length-1];if(bt>kt.indent)break;L.pop()}let gt=A[1].trim(),Et=gt.match(/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/);Et&&l(I,`'(${Et[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,f=!0;let ft={kind:"section",label:Et?Et[1].trim():gt,lineNumber:I};r.sections.push(ft),E().push(ft);continue}let D=N.indexOf(":"),O=D>0?N.substring(0,D).trim():"",P=/^[A-Za-z][\w-]*$/.test(O);if(D>0&&P&&!N.includes("->")&&!N.includes("~>")&&!N.includes("<-")&&!N.includes("<~")&&!N.includes("|")){let bt=O.toLowerCase();if(!(bt==="note"||bt.startsWith("note "))){let gt=N.substring(D+1).trim();if(u){s(I,`Options like '${bt}: ${gt}' must appear before the first message or declaration`);continue}if(bt==="title"){r.title=gt,r.titleLineNumber=I;continue}r.options[bt]=gt;continue}}{let bt=N.toLowerCase();if(bt.startsWith("no-")){let Et=bt.substring(3);if(F4.has(Et)||$K.has(Et)){if(u){s(I,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]="off";continue}}let gt=N.match(Xn);if(gt){let Et=gt[1].toLowerCase(),ft=gt[2].trim();if(OK.has(Et)||F4.has(Et)){if(u){s(I,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]=ft;continue}}if(F4.has(bt)){if(u){s(I,`Options like '${N}' must appear before the first message or declaration`);continue}if(oa.has(bt)){for(let Et of oa)delete r.options[Et];if(bt==="fill-tint")continue}r.options[bt]="on";continue}}let{core:H,meta:W,alias:B}=_(N,I),q=/^note(\s|$)/i.test(N)?null:H.match(qK);if(q){u=!0;let bt=q[1],gt=q[2].toLowerCase(),Et=q[3]?.trim()||"",ft=GK.has(gt)?gt:"default";B!==void 0&&o.set(B,bt);let kt=Et.match(/^(.*?)\s*\bas\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*$/);kt&&o.set(kt[2],bt);let _t=R(W,I),yt=x(bt,I,{type:ft,..._t!==void 0&&{position:_t},...W!==void 0&&{metadata:W}});if(p&&!p.participantIds.includes(yt)){let St=k.get(yt);St?s(I,`Participant '${bt}' is already in group '${St}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.set(yt,p.name))}continue}let{core:V,meta:X}=_(N,I),z=V.match(BK);if(z&&!c1.test(V)){let bt=z[1],gt=z[2].trim();s(I,`'${bt}(${gt})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`),u=!0;let Et=x(bt,I,{...X!==void 0&&{metadata:X}});if(p&&!p.participantIds.includes(Et)){let ft=k.get(Et);ft?s(I,`Participant '${bt}' is already in group '${ft}' \u2014 participants can only belong to one group`):(p.participantIds.push(Et),k.set(Et,p.name))}continue}{let{core:bt,meta:gt,alias:Et}=_(N,I),ft=p&&me(T)>0;if(/^\S+$/.test(bt)&&!c1.test(bt)&&(ft||!f||gt)){u=!0;let kt=bt;Et!==void 0&&o.set(Et,kt);let _t=R(gt,I),yt=x(kt,I,{..._t!==void 0&&{position:_t},...gt!==void 0&&{metadata:gt}});if(p&&!p.participantIds.includes(yt)){let St=k.get(yt);St?s(I,`Participant '${kt}' is already in group '${St}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.set(yt,p.name))}continue}}let U=me(T);for(;L.length>0;){let bt=L[L.length-1];if(U>bt.indent)break;if(U===bt.indent&&(bt.block.type==="if"||bt.block.type==="parallel")){let gt=N.toLowerCase();if(gt==="else"||gt.startsWith("else if "))break}L.pop()}let{core:Y,meta:K}=_(N,I),et=Y.match(/^async\s+(.+)$/i);if(et&&c1.test(et[1])){s(I,"Use ~> for async messages: A ~> B: message");continue}let nt=EC(Y);if(nt&&"error"in nt){s(I,nt.error);continue}if(nt){u=!0,f=!0;let{from:bt,to:gt,label:Et,async:ft}=nt,kt=x(a(bt),I),_t=x(a(gt),I);M=kt;let yt=Ao(Et,I);yt.diagnostics.forEach(ht=>r.diagnostics.push(ht));let St=yt.label??Et,Ct={kind:"message",from:kt,to:_t,label:St,lineNumber:I,...ft?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(Ct),E().push(Ct);continue}let J=Y.match(/^(.+?)\s*->\s*([^:"]+?)\s*:\s*(.+)$/),F=Y.match(/^(.+?)\s*~>\s*([^:"]+?)\s*:\s*(.+)$/),j=J||F;if(j){let bt=j[1],gt=j[2],Et=j[3].trim();s(I,`Colon syntax is no longer supported. Use '${bt} ${F?"~":"-"}${Et}${F?"~>":"->"} ${gt}' instead`);continue}if(Y.match(/^(.+?)\s*(?:<->|<~>)\s*(.+)/)){s(I,"Bidirectional arrows are no longer supported. Use two separate lines: 'A -msg-> B' and 'B -msg-> A'");continue}let Z=Y.match(/^(.+?)\s*<-\s*(.+)$/),ot=Y.match(/^(.+?)\s*<~\s*(.+)$/),at=Z||ot;if(at){let bt=at[1],gt=at[2];s(I,`Left-pointing arrows are no longer supported. Write '${gt} -> ${bt}' instead`);continue}let lt=Y.match(/^(.+?)\s*->\s*(.+)$/),rt=Y.match(/^(.+?)\s*~>\s*(.+)$/),ut=lt||rt;if(ut){u=!0,f=!0;let bt=ut[1],gt=ut[2],Et=x(a(bt),I),ft=x(a(gt),I);M=Et;let kt={kind:"message",from:Et,to:ft,label:"",lineNumber:I,...rt?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(kt),E().push(kt);continue}let tt=N.match(/^if\s+(.+)$/i);if(tt){u=!0,f=!0;let bt={kind:"block",type:"if",label:tt[1].trim(),children:[],elseChildren:[],lineNumber:I};E().push(bt),L.push({block:bt,indent:U,inElse:!1});continue}let it=N.match(/^loop\s+(.+)$/i);if(it){u=!0,f=!0;let bt={kind:"block",type:"loop",label:it[1].trim(),children:[],elseChildren:[],lineNumber:I};E().push(bt),L.push({block:bt,indent:U,inElse:!1});continue}let st=N.match(/^parallel(?:\s+(.+))?$/i);if(st){u=!0,f=!0;let bt={kind:"block",type:"parallel",label:st[1]?.trim()||"",children:[],elseChildren:[],lineNumber:I};E().push(bt),L.push({block:bt,indent:U,inElse:!1});continue}let ct=N.match(/^else\s+if\s+(.+)$/i);if(ct){if(L.length>0&&L[L.length-1].indent===U){let bt=L[L.length-1];if(bt.block.type==="parallel"){s(I,"parallel blocks don't support else if \u2014 list all concurrent messages directly inside the block");continue}if(bt.block.type==="if"){let gt={label:ct[1].trim(),children:[],lineNumber:I};bt.block.elseIfBranches||(bt.block.elseIfBranches=[]),bt.block.elseIfBranches.push(gt),bt.activeElseIfBranch=gt,bt.inElse=!1}}continue}if(N.toLowerCase()==="else"){if(L.length>0&&L[L.length-1].indent===U){let bt=L[L.length-1];if(bt.block.type==="parallel"){s(I,"parallel blocks don't support else \u2014 list all concurrent messages directly inside the block");continue}bt.block.type==="if"&&(bt.inElse=!0,delete bt.activeElseIfBranch,bt.block.elseLineNumber=I)}continue}let pt=N.match(/^elif\b\s*(.*)$/i);if(pt){let bt=pt[1].trim(),gt=bt?" "+bt:"";s(I,`'elif' is not a keyword. Did you mean 'else if${gt}'?`);continue}let mt=N.match(/^else\s+(.+)$/i);if(mt){let bt=mt[1].trim();s(I,`'else' does not take a label. Did you mean 'else if ${bt}'?`);continue}{let bt=VK(N,r.participants,h,w(),M);if(bt){if(bt.kind==="single"){let gt={kind:"note",text:bt.text,position:bt.position,participantId:bt.participantId,lineNumber:I,endLineNumber:I};f=!0,E().push(gt);continue}if(bt.kind==="multi-head"){let gt=[];for(;S+1<c.length;){let ft=c[S+1],kt=ft.trim();if(!kt||me(ft)<=U)break;gt.push(kt),S++}if(gt.length===0)continue;let Et={kind:"note",text:gt.join(`
|
|
25
25
|
`),position:bt.position,participantId:bt.participantId,lineNumber:I,endLineNumber:S+1};f=!0,E().push(Et);continue}continue}}l(I,`Unexpected line: '${N}'. Expected a message ('A -> B' or 'A -label-> B'), participant ('Name' or 'Name is a actor'), note ('note right of A Text'), section ('== Name =='), or block ('if/loop/parallel <label>').`)}if(!d&&r.messages.length===0&&!c.some(T=>c1.test(T.trim())))return i(1,'No "sequence" header and no sequence content detected');if(r.messages.length>0){let S=new Set;for(let N of r.messages)S.add(N.from),S.add(N.to);let T=N=>{for(let I of N)if(lo(I))S.add(I.participantId);else if(Wr(I)&&(T(I.children),T(I.elseChildren),I.elseIfBranches))for(let G of I.elseIfBranches)T(G.children)};T(r.elements);for(let N of r.participants)S.has(N.id)||l(N.lineNumber,`Participant "${N.label}" is declared but never used in any message or note`)}for(let S of r.groups)S.participantIds.length===0&&l(S.lineNumber,`Empty group '${S.name}' \u2014 did you mean '== ${S.name} ==' for a section divider?`);if(wn(r.tagGroups,e),r.tagGroups.length>0){let S=[];for(let T of r.participants)T.metadata&&S.push({metadata:T.metadata,lineNumber:T.lineNumber});for(let T of r.messages)T.metadata&&S.push({metadata:T.metadata,lineNumber:T.lineNumber});for(let T of r.groups)T.metadata&&S.push({metadata:T.metadata,lineNumber:T.lineNumber});Nr(S,r.tagGroups,l,xe),On(r.tagGroups,l,s)}return r}function W4(t){return t?t.split(`
|
|
@@ -114,7 +114,7 @@ direction-tb
|
|
|
114
114
|
2020 A
|
|
115
115
|
2024 B
|
|
116
116
|
2022 C`}},oLt=Object.values(Ca)});var EN={};ue(EN,{parseEventLine:()=>yg});function yg(t,e){let n={scale:!0,side:"alternate",noTitle:!1,noBox:!1,noLegend:!1,fillMode:void 0},r={type:"event-line",title:null,titleLineNumber:null,events:[],eras:[],now:null,tagGroups:[],options:n,diagnostics:[],error:null},o=Cn(r),a=(L,E,M)=>{r.diagnostics.push(At(L,E,"warning",M))},i=(L,E,M)=>{let S=At(L,E,"error",M);r.diagnostics.push(S),r.error||(r.error=He(S))};if(!t?.trim())return o(0,"No content provided");let s=t.split(`
|
|
117
|
-
`),l="mdy",c=!1,d=null;for(let L of s){let E=L.trim().toLowerCase();if(E==="no-current-year")c=!0;else if(E==="date-order dmy")l="dmy";else if(E==="date-order mdy")l="mdy";else{let M=E.match(/^year\s+(\d{1,4})$/);M&&(d=parseInt(M[1],10))}}let u=null;for(let L of s){let E=L.trim();if(!E)continue;let M=Uo(E,{dateOrder:l});if(M?.token.year!=null){u=M.token.sign*M.token.year;break}}let f=qp({order:l,directiveYear:d,prescanYear:u,noCurrentYear:c}),m={order:l,resolve:L=>Gp(L,f)},p=L=>L==="no-current-year"||L==="date-order dmy"||L==="date-order mdy"||/^year\s+\d{1,4}$/.test(L),h=!1,g=!1,x={},y=null,b=null,w=null,k=-1,C=0,v=!1,_=new Map;for(let L=0;L<s.length;L++){let E=s[L],M=L+1,S=E.trim();if(!S){y=null,v=!0;continue}if(S.startsWith("//"))continue;let T=me(E);if(!g){let A=Ce(S);if(A?.chartType==="event-line"){r.title=A.title??null,r.titleLineNumber=M,g=!0;continue}let D='Expected "event-line [Title]" as the first line.',O=xe(A?.chartType??S,["event-line"]);return O&&(D+=` ${O}`),o(M,D)}let N=ln(S);if(N){if(h){i(M,"Tag groups must appear before event-line content","E_TAG_DECLARED_AFTER_CONTENT");continue}y={name:N.name,...N.alias!==void 0&&{alias:N.alias},entries:[],lineNumber:M},N.alias&&_.set(N.alias.toLowerCase(),Bt(N.name)),_.set(Bt(N.name),Bt(N.name)),r.tagGroups.push(y);continue}if(y&&!h&&T>0){let{text:A,isDefault:D}=an(S),{label:O,color:P}=ye(A,e,r.diagnostics,M);(D||y.entries.length===0)&&(y.defaultValue=O),y.entries.push({value:O,color:P??fn,lineNumber:M});continue}if(b&&T>C){v&&b.description.length>0&&b.description.push(""),v=!1;let A=S.startsWith("- ")?`\u2022 ${S.substring(2)}`:S;b.description.push(A);continue}let I=S.match(LQ);if(I){h=!0,y=null,b=null;let A=I[1].trim(),D=(I[2]??"").trim(),O=!1,P=D.match(CQ);if(P)O=P[1].toLowerCase()==="true",D=(D.slice(0,P.index)+D.slice(P.index+P[0].length)).trim();else{let B=D.match(/(?:^|\s)collapsed(?=\s|$)/);B&&(O=!0,D=(D.slice(0,B.index)+" "+D.slice(B.index+B[0].length)).trim())}let H=null;if(D){let B=D.split(/\s+/).pop();ye(`x ${B}`,e,r.diagnostics,M).color!==void 0&&(H=B)}let W={name:A,color:H,collapsed:O,lineNumber:M};r.eras.push(W),w=A,k=T;continue}if(T===0){if(y=null,p(S.toLowerCase()))continue;if(S.toLowerCase()==="no-scale"){n.scale=!1;continue}let A=S.match(vQ);if(A){n.side=A[1].toLowerCase();continue}if(S.toLowerCase()==="no-box"){n.noBox=!0;continue}if(S.toLowerCase()==="no-legend"){n.noLegend=!0;continue}if(S.toLowerCase()==="legend-inline"){n.legendInline=!0;continue}{let O=S.match(NQ);if(O){let P=O[1].trim();if(!P)r.now={computed:!0,date:null,dateValue:null,label:null,lineNumber:M};else{let
|
|
117
|
+
`),l="mdy",c=!1,d=null;for(let L of s){let E=L.trim().toLowerCase();if(E==="no-current-year")c=!0;else if(E==="date-order dmy")l="dmy";else if(E==="date-order mdy")l="mdy";else{let M=E.match(/^year\s+(\d{1,4})$/);M&&(d=parseInt(M[1],10))}}let u=null;for(let L of s){let E=L.trim();if(!E)continue;let M=Uo(E,{dateOrder:l});if(M?.token.year!=null){u=M.token.sign*M.token.year;break}}let f=qp({order:l,directiveYear:d,prescanYear:u,noCurrentYear:c}),m={order:l,resolve:L=>Gp(L,f)},p=L=>L==="no-current-year"||L==="date-order dmy"||L==="date-order mdy"||/^year\s+\d{1,4}$/.test(L),h=!1,g=!1,x={},y=null,b=null,w=null,k=-1,C=0,v=!1,_=new Map;for(let L=0;L<s.length;L++){let E=s[L],M=L+1,S=E.trim();if(!S){y=null,v=!0;continue}if(S.startsWith("//"))continue;let T=me(E);if(!g){let A=Ce(S);if(A?.chartType==="event-line"){r.title=A.title??null,r.titleLineNumber=M,g=!0;continue}let D='Expected "event-line [Title]" as the first line.',O=xe(A?.chartType??S,["event-line"]);return O&&(D+=` ${O}`),o(M,D)}let N=ln(S);if(N){if(h){i(M,"Tag groups must appear before event-line content","E_TAG_DECLARED_AFTER_CONTENT");continue}y={name:N.name,...N.alias!==void 0&&{alias:N.alias},entries:[],lineNumber:M},N.alias&&_.set(N.alias.toLowerCase(),Bt(N.name)),_.set(Bt(N.name),Bt(N.name)),r.tagGroups.push(y);continue}if(y&&!h&&T>0){let{text:A,isDefault:D}=an(S),{label:O,color:P}=ye(A,e,r.diagnostics,M);(D||y.entries.length===0)&&(y.defaultValue=O),y.entries.push({value:O,color:P??fn,lineNumber:M});continue}if(b&&T>C){v&&b.description.length>0&&b.description.push(""),v=!1;let A=S.startsWith("- ")?`\u2022 ${S.substring(2)}`:S;b.description.push(A);continue}let I=S.match(LQ);if(I){h=!0,y=null,b=null;let A=I[1].trim(),D=(I[2]??"").trim(),O=!1,P=D.match(CQ);if(P)O=P[1].toLowerCase()==="true",D=(D.slice(0,P.index)+D.slice(P.index+P[0].length)).trim();else{let B=D.match(/(?:^|\s)collapsed(?=\s|$)/);B&&(O=!0,D=(D.slice(0,B.index)+" "+D.slice(B.index+B[0].length)).trim())}let H=null;if(D){let B=D.split(/\s+/).pop();ye(`x ${B}`,e,r.diagnostics,M).color!==void 0&&(H=B)}let W={name:A,color:H,collapsed:O,lineNumber:M};r.eras.push(W),w=A,k=T;continue}if(T===0){if(y=null,p(S.toLowerCase()))continue;if(S.toLowerCase()==="no-scale"){n.scale=!1;continue}let A=S.match(vQ);if(A){n.side=A[1].toLowerCase();continue}if(S.toLowerCase()==="no-box"){n.noBox=!0;continue}if(S.toLowerCase()==="no-legend"){n.noLegend=!0;continue}if(S.toLowerCase()==="legend-inline"){n.legendInline=!0;continue}{let O=S.match(NQ);if(O){let P=O[1].trim(),H=null;if(P){let W=P.split(/\s+/).pop();ye(`x ${W}`,e,r.diagnostics,M).color!==void 0&&(H=W,P=P.slice(0,P.length-W.length).trim())}if(!P)r.now={computed:!0,date:null,dateValue:null,label:null,color:H,lineNumber:M};else{let W=Bp(P,m);if(W){let B=W.remainder?.trim()||null;r.now={computed:!1,date:W.startDate,dateValue:En(W.startDate),label:B,color:H,lineNumber:M}}else r.diagnostics.push(ne(Ca.BAD_DATE,M,{token:P.split(/\s+/)[0]}))}continue}}{let O=Gr(S);if(O!==null){n.fillMode=O==="tint"?void 0:O;continue}}if(/^direction-lr$/i.test(S))continue;if(/^direction-tb$/i.test(S)){r.diagnostics.push(ne(Ca.UNSUPPORTED,M,{reason:"event-line is horizontal-only in v1; `direction-tb` (vertical orientation) is a fast-follow."}));continue}let D=S.match(_Q);if(D){let O=D[1].toUpperCase();O!=="LR"&&r.diagnostics.push(ne(Ca.UNSUPPORTED,M,{reason:`event-line is horizontal-only in v1; \`direction ${O}\` (vertical orientation) is a fast-follow.`}));continue}if(ar(S,x))continue;if(TQ.test(S)){r.diagnostics.push(ne(Ca.UNSUPPORTED,M,{reason:"Group events with `[Name]` era brackets (\xA728.6a), not `section`."}));continue}}w!==null&&T>k||(w=null),h=!0;let $=PQ(S,M,w,_,r.diagnostics,a,m);r.events.push($),b=$,C=T}if(n.noTitle=x["no-title"]==="on",AQ(r.events),wn(r.tagGroups,e),r.tagGroups.length>0&&(Nr(r.events,r.tagGroups,a,xe),On(r.tagGroups,a),ma(r.events,r.tagGroups)),r.events.length===0&&!r.error){let L=ne(Ca.NO_EVENTS,r.titleLineNumber??1);r.diagnostics.push(L),r.error=He(L)}let R=new Set;return n.scale&&IQ(r.events,r.eras,L=>{R.add(L.line),r.diagnostics.push(L)}),RQ(r.events,R,r.diagnostics),r.now&&!n.scale&&r.diagnostics.push(ne(Ca.UNSUPPORTED,r.now.lineNumber,{reason:"the `now` marker needs a to-scale axis; it is ignored under `no-scale`."})),r}function AQ(t){let e=t.filter(c=>!c.future&&c.dateValue!==null).map(c=>c.dateValue);if(e.length===0)return;let n=Math.max(...e),r=Math.min(...e),o=n>r?(n-r)*.15:1,a=[],i=null;for(let c of t)a.push(i),!c.future&&c.dateValue!==null&&(i=c.dateValue);let s=new Array(t.length).fill(null);i=null;for(let c=t.length-1;c>=0;c--){s[c]=i;let d=t[c];!d.future&&d.dateValue!==null&&(i=d.dateValue)}let l=0;for(;l<t.length;){if(!t[l].future){l++;continue}let c=a[l],d=s[l],u=l;for(;u<t.length&&t[u].future&&a[u]===c&&s[u]===d;)u++;let f=t.slice(l,u),m=f.length;if(c!==null&&d!==null)f.forEach((p,h)=>{p.dateValue=c+(d-c)*(h+1)/(m+1),p.futureSpan=[c,d]});else if(c===null&&d!==null){let p=d-o;f.forEach((h,g)=>{h.dateValue=p+(d-p)*(g+1)/(m+1),h.futureSpan=[p,d]})}else f.forEach((p,h)=>{p.dateValue=n+o*(h+1),p.futureSpan=null});l=u}}function RQ(t,e,n){let r=null;for(let o of t)o.future||o.dateValue===null||(r&&o.dateValue<r.dateValue&&!e.has(o.lineNumber)&&n.push(ne(Ca.DATE_ORDER,o.lineNumber,{label:o.label,date:o.date,prevLabel:r.label,prevDate:r.date})),r=o)}function IQ(t,e,n){if(e.length<2)return;let r=new Map(e.map((c,d)=>[c.name,d])),o=t.filter(c=>!c.future&&c.dateValue!==null&&c.era!==null&&r.has(c.era));if(o.length===0)return;let a=new Map;for(let c of o){let d=r.get(c.era),u=a.get(d);u?(c.dateValue<u.min.dateValue&&(u.min=c),c.dateValue>u.max.dateValue&&(u.max=c)):a.set(d,{min:c,max:c})}let i=e.length,s=new Array(i).fill(null),l=new Array(i).fill(null);for(let c=1;c<i;c++){let d=a.get(c-1)?.max??null,u=s[c-1]??null;s[c]=d&&(!u||d.dateValue>u.dateValue)?d:u}for(let c=i-2;c>=0;c--){let d=a.get(c+1)?.min??null,u=l[c+1]??null;l[c]=d&&(!u||d.dateValue<u.dateValue)?d:u}for(let c of o){let d=r.get(c.era),u=l[d],f=s[d];u&&c.dateValue>u.dateValue?n(ne(Ca.ERA_DATE_ORDER,c.lineNumber,{label:c.label,date:c.date,era:c.era,rel:"after",otherEra:u.era,edge:"begins",otherDate:u.date})):f&&c.dateValue<f.dateValue&&n(ne(Ca.ERA_DATE_ORDER,c.lineNumber,{label:c.label,date:c.date,era:c.era,rel:"before",otherEra:f.era,edge:"ends",otherDate:f.date}))}}function PQ(t,e,n,r,o,a,i){let s=null,l=null,c=!1,d=t,u=t.match(MQ);u&&(s="TBD",c=!0,d=t.slice(u[0].length).trimStart());let f=c?null:Bp(t,i);if(f)s=f.startDate,l=En(f.startDate),d=f.remainder||"",f.endDate&&o.push(ne(Ca.UNSUPPORTED,e,{reason:"event-line events are points; a date range (`->`) is not supported \u2014 using the start date."}));else if(!c&&SQ.test(t)){let g=t.split(/\s+/)[0];o.push(ne(Ca.BAD_DATE,e,{token:g}))}let m=Xe(Dk,new Set(r.keys())),p=Be(d,m,r,void 0,o,e);Ye(p.meta,m,g=>a(e,g),p.name);let h={...p.meta};return p.color!==void 0&&(h.color=p.color),{label:p.name||d.trim(),lineNumber:e,date:s,dateValue:l,future:c,futureSpan:null,metadata:h,description:[],era:n}}var SQ,MQ,vQ,LQ,CQ,NQ,TQ,_Q,_5=dt(()=>{"use strict";Je();wN();Oe();Ae();Sr();Pf();ol();SQ=/^\d{1,4}[/.]\d/,MQ=/^TBD\b/i,vQ=/^side\s+(above|below|alternate)\b/i,LQ=/^\[([^\]]+)\]\s*(.*)$/,CQ=/\bcollapsed:\s*(true|false)\b/i,NQ=/^now\b\s*(.*)$/i,TQ=/^section\b/i,_Q=/^direction\s+(\w+)/i});var Mc,mLt,kN=dt(()=>{"use strict";Mc={NO_COMMITS:{code:"E_VERSION_CONTROL_NO_COMMITS",severity:"error",chartType:"version-control",title:"No commits",message:"version-control has no commits.",hint:"Add at least one indented commit line under a branch.",example:"version-control Empty"},UNKNOWN_BRANCH:{code:"E_VERSION_CONTROL_UNKNOWN_BRANCH",severity:"warning",chartType:"version-control",title:"Unknown branch reference",message:t=>{let e=t.op??"merge",n=t.branch??"ghostbranch",r=t.section??"\xA729.4";return`${e} references unknown branch "${n}". (${r})`},hint:"Declare the branch (a bare top-level line) before referencing it in merge/rebase/reset.",example:`version-control U
|
|
118
118
|
|
|
119
119
|
main
|
|
120
120
|
A
|
|
@@ -286,7 +286,7 @@ back`}},lTt=Object.values(Jg)});var t0,h_=dt(()=>{"use strict";t0={maleFront:{vi
|
|
|
286
286
|
`);for(let n of e){let r=n.trim();if(!r||r.startsWith("//"))continue;let o=Ce(r);if(o)return o.chartType;if(x5(r))return"live-link";break}return W4(t)?"sequence":t5(t)?"flowchart":r5(t)?"class":a5(t)?"er":e5(t)?"state":u5(t)?"sitemap":s5(t)?"org":A_(t)?"c4":__(t)?"gantt":y5(t)?"pert":null}function z6(t){return W6.get(t.toLowerCase())?.category??null}function wnt(t){let e=W6.get(t.toLowerCase());return e?L_(e.parse):!1}function Ent(){return Lf.map(t=>t.id)}function V6(t){let e=Mnt(t);return{diagnostics:fk(e.diagnostics),chartType:e.chartType}}function Mnt(t){let e=e0(t);if(!e){let o=vnt(t);if(o){let a=Lo(t).diagnostics;return{diagnostics:[o,...a],chartType:null}}return{diagnostics:Lo(t).diagnostics,chartType:null}}let n=Snt.get(e);return n?{diagnostics:[...n(t).diagnostics,...T_(t,e)],chartType:e}:{diagnostics:[...Lo(t).diagnostics,...T_(t,e)],chartType:e}}function vnt(t){let e=t.split(`
|
|
287
287
|
`);for(let n=0;n<e.length;n++){let r=e[n].trim();if(!r||r.startsWith("#")||r.startsWith("//"))continue;let o=r.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(!o)return null;let a=o[1].toLowerCase(),i=o[2].trim();if(N_.has(a)){let l=i?`${a} ${i}`:a;return At(n+1,`Remove the colon \u2014 use '${l}' instead of '${r}'. DGMO chart types don't use colons.`)}let s=xe(a,[...N_]);return s?At(n+1,`Unknown chart type: ${a}. ${s} Also, DGMO chart types don't use colons.`):null}return null}function T_(t,e){return e&&Lnt.has(e)?[]:t.split(`
|
|
288
288
|
`).filter(o=>o.trim()&&!o.trim().startsWith("#")&&!o.trim().startsWith("//")).length<=1?[At(1,"No content after chart type declaration.","warning")]:[]}var ynt,bnt,xnt,knt,Y6,R_,Snt,N_,Lnt,n0=dt(()=>{"use strict";Rd();u1();f1();m1();p1();h1();g1();E1();Ss();Ae();mg();Je();Cf();C_();ynt=/^\d+(?:\.\d+)?(?:min|bd|sp|d|w|m|q|y|h)(?:\?)?\s+/,bnt=/^\d{4}-\d{2}-\d{2}(?:\s\d{2}:\d{2})?\s+/;xnt=/\bis\s+an?\s+(person|system|container|component)\b/i;knt=Object.fromEntries(Lf.map(t=>[t.id,t.description])),Y6=F6.map(t=>[t.id,t.parse]),R_=Y6.map(([t])=>t),Snt=new Map(Y6),N_=new Set(R_);Lnt=new Set(["live-link"])});function uo(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Cnt(t,e,n,r){let o=[],a=t.pill;o.push(`<rect width="${t.width}" height="${t.height}" rx="${Se/2}" fill="${uo(n)}"/>`),o.push(`<rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" rx="${a.height/2}" fill="${uo(e.bg)}"/>`,`<rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" rx="${a.height/2}" fill="none" stroke="${uo(r)}" stroke-width="0.75"/>`),o.push(`<text x="${a.x+a.width/2}" y="${Se/2}" ${U6} font-size="${Er}" font-weight="500" fill="${uo(e.text)}" text-anchor="middle" font-family="${uo(Mt)}">${uo(t.groupName)}</text>`);for(let i of t.entries){let s=i.displayValue??i.value,l=i.width!=null?`<rect x="${i.x}" y="${i.y}" width="${i.width}" height="${Se}" fill="transparent"/>`:"";o.push(`<g data-legend-entry="${uo(i.value.toLowerCase())}" data-series-name="${uo(i.value)}" style="cursor:pointer">`+l+`<circle cx="${i.dotCx}" cy="${i.dotCy}" r="${Tr}" fill="${uo(i.color)}"/><text x="${i.textX}" y="${i.dotCy}" ${U6} font-size="${Qn}" fill="${uo(e.textMuted)}" font-family="${uo(Mt)}">${uo(s)}</text></g>`)}return`<g transform="translate(${t.x},${t.y})" data-legend-group="${uo(Bt(t.groupName))}" style="cursor:pointer">${o.join("")}</g>`}function Nnt(t,e,n){return`<g transform="translate(${t.x},${t.y})" data-legend-group="${uo(Bt(t.groupName))}" style="cursor:pointer"><rect width="${t.width}" height="${t.height}" rx="${t.height/2}" fill="${uo(n)}"/><text x="${t.width/2}" y="${t.height/2}" ${U6} font-size="${Er}" font-weight="500" fill="${uo(e.textMuted)}" text-anchor="middle" font-family="${uo(Mt)}">${uo(t.groupName)}</text></g>`}function X6(t,e){if(t.length===0)return{svg:"",height:0,width:0};let{palette:n,isDark:r,containerWidth:o,activeGroup:a,className:i}=e,s=o>0?o:1200,l={groups:t,position:{placement:"top-center",titleRelation:e.align==="left"?"inline-with-title":"below-title"},mode:"preview"},d=ml(l,{activeGroup:a??null},s);if(!d.activeCapsule&&d.pills.length===0)return{svg:"",height:0,width:0};let{groupBg:u,pillBorder:f}=vs(n,r),m=[],p=0,h=1/0,g=0,x=(k,C,v,_)=>{h=Math.min(h,k),g=Math.max(g,k+v),p=Math.max(p,C+_)};if(d.activeCapsule){let k=d.activeCapsule;m.push(Cnt(k,n,u,f)),x(k.x,k.y,k.width,k.height)}for(let k of d.pills)m.push(Nnt(k,n,u)),x(k.x,k.y,k.width,k.height);let y=i?` class="${uo(i)}"`:"",b=a?` data-legend-active="${uo(Bt(a))}"`:"";return{svg:`<g${y}${b}>${m.join("")}</g>`,height:p,width:g-(h===1/0?0:h)}}var U6,P_=dt(()=>{"use strict";Oe();pr();qr();Ke();U6='dominant-baseline="central"'});function D_(t){return Tnt.has(t.toLowerCase())}function Rnt(t,e=20){return Tt(t,e,{bold:!0})}function nr(t){let e=t.pad??G1,n=t.gap??_nt,r=t.titleFontSize??20,o=t.titleBaselineY??30,a={inline:!1,titleX:t.containerWidth/2,titleAnchor:"middle",legendX:0,legendY:t.titleBandHeight,headerHeight:t.titleBandHeight+(t.hasLegend?t.legendReserve:0)};if(!t.requested||!t.hasLegend)return a;let i=Rnt(t.title,r),s=e+i+n,l=t.containerWidth-s-e;return l>=Ant&&t.legendHeight<=Se+1&&t.legendWidth<=l+.5?{inline:!0,titleX:e,titleAnchor:"start",legendX:t.containerWidth-e-t.legendWidth,legendY:o-r*.36-t.legendHeight/2,headerHeight:t.titleBandHeight}:a}var Tnt,G1,_nt,Ant,ko=dt(()=>{"use strict";pr();Ve();Tnt=new Set(["bar","line","radar","scatter","function","state","treemap","block","event-line","boxes-and-lines","er","class","family","infra","sequence","sketch","bracket","gantt","pert","sitemap","mindmap","kanban","journey-map"]);G1=8,_nt=16,Ant=48});function je(t){return isFinite(t)?Math.abs(t)>=1e3?t.toLocaleString("en-US"):String(Math.round(t*100)/100):""}function Pnt(t,e,n,r,o,a){let{svg:i,height:s,width:l}=X6(e,{palette:n,isDark:r,containerWidth:o,activeGroup:e[0].name,className:"chart-legend",align:"left"});if(!i)return null;let c=nr({requested:!0,title:a.title,hasLegend:!0,legendWidth:l,legendHeight:s,containerWidth:o,titleBandHeight:40,legendReserve:0,titleBaselineY:30,titleFontSize:20});if(!c.inline)return null;let d=t.append("text").attr("class","chart-title").attr("x",c.titleX).attr("y",30).attr("fill",a.textColor).attr("font-size",20).attr("font-weight","700").text(a.title);a.titleLineNumber&&d.attr("data-line-number",a.titleLineNumber);let u=t.node();return u&&u.insertAdjacentHTML("beforeend",`<g transform="translate(${c.legendX},${c.legendY})">${i}</g>`),52}function r0(t,e,n,r,o,a,i,s){return q1(t,e.noLegend?[]:gg(e,n),r,o,a,i,s)}function q1(t,e,n,r,o,a,i){if(i&&e.length>0){let f=Pnt(t,e,n,r,a,i);if(f!==null)return f}i&&ao(t,i.title,i.titleLineNumber,a,i.textColor);let s=o?40:0;if(e.length===0)return o?s+12:24;let l=8+s,{svg:c,height:d}=X6(e,{palette:n,isDark:r,containerWidth:a,activeGroup:e[0].name,className:"chart-legend"}),u=t.node();return u&&c&&u.insertAdjacentHTML("beforeend",`<g transform="translate(0,${l})">${c}</g>`),l+d+14}function Ps(t,e){let r=t?22:0,o=e.length?Math.max(...e.map(a=>Tt(a,zo))):0;return Math.max(56,16+r+o+14)}function Il(t,e,n,r,o){e&&t.append("text").attr("x",n).attr("y",r).attr("text-anchor","middle").attr("fill",o).attr("font-size",O_).attr("font-family",Mt).attr("font-weight",600).text(e)}function Ds(t,e,n,r,o){e&&t.append("text").attr("transform",`translate(${r},${n}) rotate(-90)`).attr("text-anchor","middle").attr("fill",o).attr("font-size",O_).attr("font-family",Mt).attr("font-weight",600).text(e)}function Pr(t,e){let n=(t.attr("class")??"").split(/\s+/).filter(Boolean);return n.includes("dgmo-datum")||n.push("dgmo-datum"),t.attr("class",n.join(" ")),e.line!=null&&t.attr("data-line-number",e.line),e.key!=null&&t.attr("data-emph-key",e.key),e.name!=null&&t.attr("data-name",e.name),e.value!=null&&t.attr("data-value",String(e.value)),e.color!=null&&t.attr("data-color",e.color),e.seriesName!=null&&t.attr("data-series-name",e.seriesName),t}function _c(t,e,n,r,o,a="middle"){t.append("text").attr("x",n).attr("y",r).attr("text-anchor",a).attr("fill",o).attr("font-size",Int).attr("font-family",Mt).text(e)}var O_,zo,Int,Na=dt(()=>{"use strict";Ke();Ve();M1();P_();qi();ko();O_=13,zo=12,Int=12});function $_(t,e){let n=[t.value];for(let r=1;r<e;r++)n.push(t.extraValues?.[r-1]??0);return n}function G_(t,e,n,r,o,a,i,s,l,c,d){let u=e.data,f=e.seriesNames?.length?e.seriesNames:[e.series??""],m=e.barLayout==="stack",p=e.barLayout==="group",h=m||p?Math.max(1,f.length,1+Math.max(0,...u.map(H=>H.extraValues?.length??0))):1,g=e.orientation==="horizontal",x=h>1,y=e.fillMode,b=(H,W,B)=>B||(x?e.seriesNameColors?.[H]??o[H%o.length]:o[W%o.length]),w=H=>ee(a,H,i,{mode:y}),k=r0(t,e,o,a,i,c,n,d),C=u.map(H=>$_(H,h)),v=m?yd(C,H=>H.filter(W=>W>0).reduce((W,B)=>W+B,0))??0:yd(C,H=>yd(H)??0)??0,_=m?bd(C,H=>H.filter(W=>W<0).reduce((W,B)=>W+B,0))??0:bd(C,H=>bd(H)??0)??0,R=Math.max(0,v),L=Math.min(0,_),E=R===0&&L===0?1:R,M=g?u.map(H=>H.label):[je(E),je(E/2),je(L),je(L/2)],S={top:k+8,right:32,bottom:64,left:Ps(e.ylabel,M)},T=n-S.left-S.right,N=r-S.top-S.bottom,I=g,G=I?[S.top,S.top+N]:[S.left,S.left+T],$=cc().domain(u.map(H=>H.label)).range(G).padding(.3),A=I?[S.left,S.left+T]:[S.top+N,S.top],D=yr().domain([L,E]).nice().range(A);for(let H of D.ticks(6))if(I){let W=D(H);t.append("line").attr("x1",W).attr("x2",W).attr("y1",S.top).attr("y2",S.top+N).attr("stroke",l).attr("stroke-opacity",H===0?.6:.25),t.append("text").attr("x",W).attr("y",S.top+N+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(je(H))}else{let W=D(H);t.append("line").attr("x1",S.left).attr("x2",S.left+T).attr("y1",W).attr("y2",W).attr("stroke",l).attr("stroke-opacity",H===0?.6:.25),t.append("text").attr("x",S.left-10).attr("y",W+4).attr("text-anchor","end").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(je(H))}for(let H of u){let W=($(H.label)??0)+$.bandwidth()/2;I?t.append("text").attr("x",S.left-10).attr("y",W+4).attr("text-anchor","end").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(H.label):t.append("text").attr("x",W).attr("y",S.top+N+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(H.label)}let O=D(0),P=m?null:cc().domain(f.map((H,W)=>W)).range([0,$.bandwidth()]).padding(.12);u.forEach((H,W)=>{let B=$(H.label)??0,q=$_(H,h),V=0,X=0;q.forEach((z,U)=>{let Y=b(U,W,h===1?H.color:void 0),K=w(Y),et=f[U]??"",nt={line:H.lineNumber,key:x?et:H.label,name:x?`${H.label} \xB7 ${et}`:H.label,value:z,color:Y,seriesName:x?et:void 0};if(m){let J=z<0?X:V;if(I){let F=D(J),j=D(J+z);o0(t,Math.min(F,j),B,Math.abs(j-F),$.bandwidth(),K,Y,nt),Math.abs(j-F)>26&&_c(t,je(z),(F+j)/2,B+$.bandwidth()/2+4,s)}else{let F=D(J),j=D(J+z);o0(t,B,Math.min(F,j),$.bandwidth(),Math.abs(j-F),K,Y,nt),Math.abs(j-F)>18&&_c(t,je(z),B+$.bandwidth()/2,(F+j)/2+4,s)}z<0?X+=z:V+=z}else{let J=P(U)??0,F=P.bandwidth();if(I){let j=D(z);o0(t,Math.min(O,j),B+J,Math.abs(j-O),F,K,Y,nt);let Q=je(z),Z=Q.length*7+6,ot=z<0?j-Z<S.left:j+Z>S.left+T;_c(t,Q,z<0?ot?j+6:j-6:ot?j-6:j+6,B+J+F/2+4,s,z<0!==ot?"end":"start")}else{let j=D(z);o0(t,B+J,Math.min(O,j),F,Math.abs(O-j),K,Y,nt);let Q=z<0?j+14:j-6,Z=z<0?Q>S.top+N-2:Q<S.top+2;_c(t,je(z),B+J+F/2,Z?z<0?j-6:j+14:Q,s)}}})}),Il(t,e.xlabel,S.left+T/2,S.top+N+46,s),Ds(t,e.ylabel,S.top+N/2,20,s)}function o0(t,e,n,r,o,a,i,s){let l=t.append("rect").attr("x",e).attr("y",n).attr("width",r).attr("height",o).attr("fill",a).attr("stroke",i).attr("stroke-width",1.5);Pr(l,s)}var q_=dt(()=>{"use strict";bi();jo();Ke();Fe();Na()});function B_(t,e){return e===0?t.value:t.extraValues?.[e-1]??0}function H_(t,e,n,r,o,a,i,s,l,c,d,u){let f=e.data,m=e.fill===!0,p=e.fillMode==="solid",h=e.seriesNames?.length?e.seriesNames:[e.series??""],g=Math.max(1,h.length,1+Math.max(0,...f.map(D=>D.extraValues?.length??0))),x=D=>e.seriesNameColors?.[D]??o[D%o.length],y=D=>e.seriesAxes?.[D]??"left",b=(e.seriesAxes??[]).includes("right"),w=D=>{let O=[];for(let P=0;P<g;P++)y(P)===D&&O.push(P);return O.length===1?x(O[0]):void 0},k=r0(t,e,o,a,i,d,n,u),C=D=>{let O=1/0,P=-1/0;for(let H of f)for(let W=0;W<g;W++)if(y(W)===D){let B=B_(H,W);O=Math.min(O,B),P=Math.max(P,B)}if(!isFinite(O))return[0,1];if(e.noAutoY)O>0&&(O=0);else{let H=(P-O)*.05||Math.abs(P)*.05||1,W=O-H;O=O>=0&&W<0?0:W,P=P+H}return O===P&&(P=O+1),[O,P]},[v,_]=C("left"),[R,L]=b?C("right"):[0,1],E={top:k+8,right:b?Ps(e.yrlabel,[je(L),je(R)]):32,bottom:64,left:Ps(e.ylabel,[je(_),je(v)])},M=n-E.left-E.right,S=r-E.top-E.bottom,T=ll().domain(f.map(D=>D.label)).range([E.left,E.left+M]).padding(.5),N=yr().domain([v,_]).nice().range([E.top+S,E.top]),I=b?yr().domain([R,L]).nice().range([E.top+S,E.top]):null,G=D=>b&&y(D)==="right"&&I?I:N,$=b?w("left"):void 0,A=w("right");e.eras?.length&&e.eras.forEach((D,O)=>{let P=T(D.start),H=T(D.end);if(P==null||H==null)return;let W=D.color??o[O%o.length];t.append("rect").attr("x",Math.min(P,H)).attr("y",E.top).attr("width",Math.abs(H-P)).attr("height",S).attr("fill",vt(W,c,12)),t.append("text").attr("x",(P+H)/2).attr("y",E.top+14).attr("text-anchor","middle").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).attr("opacity",.8).text(D.label)});for(let D of N.ticks(6)){let O=N(D);t.append("line").attr("x1",E.left).attr("x2",E.left+M).attr("y1",O).attr("y2",O).attr("stroke",l).attr("stroke-opacity",D===0?.6:.25),t.append("text").attr("class","dgmo-tick").attr("x",E.left-10).attr("y",O+4).attr("text-anchor","end").attr("fill",$??s).attr("font-size",zo).attr("font-family",Mt).text(je(D))}if(b&&I)for(let D of I.ticks(6))t.append("text").attr("class","dgmo-tick").attr("x",E.left+M+10).attr("y",I(D)+4).attr("text-anchor","start").attr("fill",A??s).attr("font-size",zo).attr("font-family",Mt).text(je(D));for(let D of f)t.append("text").attr("class","dgmo-tick").attr("x",T(D.label)??0).attr("y",E.top+S+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(D.label);t.append("rect").attr("class","dgmo-plot-rect").attr("x",E.left).attr("y",E.top).attr("width",M).attr("height",S).attr("fill","transparent");for(let D=0;D<g;D++){let O=x(D),P=G(D),H=h[D]??`Series ${D+1}`,W=f.map((z,U)=>({label:z.label,v:B_(z,D),xIndex:U,lineNumber:z.lineNumber})),B=t.append("g").attr("class","dgmo-series").attr("data-series-index",D).attr("data-series-name",H).attr("data-axis",y(D)).attr("data-color",O),q=e.seriesNameLineNumbers?.[D];if(q!==void 0&&B.attr("data-line-number",q),m){let z=xc().x(U=>T(U.label)??0).y0(P(Math.max(P.domain()[0],0))).y1(U=>P(U.v));B.append("path").attr("class","dgmo-series-area").attr("d",z(W)??"").attr("fill",p?O:ee(a,O,i)).attr("stroke","none")}let V=lr().x(z=>T(z.label)??0).y(z=>P(z.v));B.append("path").attr("class","dgmo-series-line").attr("d",V(W)??"").attr("fill","none").attr("stroke",O).attr("stroke-width",2.5).attr("stroke-linejoin","round").attr("stroke-linecap","round"),B.append("path").attr("class","dgmo-series-hit").attr("d",V(W)??"").attr("fill","none").attr("stroke","transparent").attr("stroke-width",16).attr("stroke-linejoin","round").attr("stroke-linecap","round");let X=vt(O,s,60);for(let z of W)B.append("circle").attr("class","dgmo-pt").attr("data-series-index",D).attr("data-series-name",H).attr("data-color",O).attr("data-x-index",z.xIndex).attr("data-x-label",z.label).attr("data-value",z.v).attr("data-line-number",z.lineNumber).attr("cx",T(z.label)??0).attr("cy",P(z.v)).attr("r",3.5).attr("fill",c).attr("stroke",O).attr("stroke-width",2),e.noValue||_c(t,je(z.v),T(z.label)??0,P(z.v)-10,X)}Il(t,e.xlabel,E.left+M/2,E.top+S+46,s),Ds(t,e.ylabel,E.top+S/2,20,$??s),b&&(Ds(t,e.yrlabel,E.top+S/2,n-18,A??s),t.append("rect").attr("class","dgmo-axis-legend").attr("data-axis-legend","left").attr("x",0).attr("y",E.top).attr("width",E.left).attr("height",S).attr("fill","transparent").attr("style","cursor:pointer"),t.append("rect").attr("class","dgmo-axis-legend").attr("data-axis-legend","right").attr("x",E.left+M).attr("y",E.top).attr("width",E.right).attr("height",S).attr("fill","transparent").attr("style","cursor:pointer"))}var F_=dt(()=>{"use strict";bi();Fo();Ke();Fe();Na()});function W_(t,e,n,r,o,a,i,s){let l=e.data.filter(O=>O.value>0);if(l.length===0)return;let c=e.hole,d=c!==void 0,u=e.fillMode,f=l.reduce((O,P)=>O+P.value,0),m=n/2,p=s+12,h=r-p,g=p+h/2,x=l.map(O=>{let P=Math.round(O.value/f*100),H=e.noName?"":O.label,W=[e.noValue?"":je(O.value),e.noPercent?"":`(${P}%)`].filter(Boolean).join(" ");return[H,W].filter(Boolean).join(" \u2014 ")}),y=x.reduce((O,P)=>Math.max(O,P.length),0),w=n/2-6,k=h/2-h*.06,C=1.27+.06*y,v=Math.min(k,w/C),_=y>0&&v>=45,R=Math.min(k,w*.94),L=Math.max(8,_?v:R),E=L/180,M=Math.max(7,Dnt*E),S=L*.09,T=L*.155,N=pd(o,l.length),I=(O,P)=>P??N[O%N.length],G=y4().sort(null).value(O=>O.value)(l.map(O=>({value:O.value}))),$=yc().innerRadius(d?L*c:0).outerRadius(L),A=t.append("g").attr("transform",`translate(${m},${g})`),D=[];if(G.forEach((O,P)=>{let H=I(P,l[P].color),W=ee(o,H,a,{mode:u}),B=Math.round(l[P].value/f*100),q=A.append("path").attr("d",$(O)??"").attr("fill",W).attr("stroke",H).attr("stroke-width",1.5);if(Pr(q,{line:l[P].lineNumber,key:l[P].label,name:l[P].label,value:`${je(l[P].value)} (${B}%)`,color:H}),!_)return;let V=x[P];if(!V)return;let X=(O.startAngle+O.endAngle)/2-Math.PI/2,z=Math.cos(X)>=0;D.push({rightSide:z,x0:Math.cos(X)*L,y0:Math.sin(X)*L,x1:Math.cos(X)*(L+S),y1:Math.sin(X)*(L+S),idealY:Math.sin(X)*(L+S),y:0,label:V,stroke:H,tag:{line:l[P].lineNumber,key:l[P].label,name:l[P].label,value:`${je(l[P].value)} (${B}%)`,color:H}})}),_&&D.length>0){let O=L+S+T,P=M*1.18,H=h/2-M;for(let W of[!0,!1]){let B=D.filter(U=>U.rightSide===W);if(B.length===0)continue;let q=B.filter(U=>U.idealY<0).sort((U,Y)=>Y.idealY-U.idealY),V=B.filter(U=>U.idealY>=0).sort((U,Y)=>U.idealY-Y.idealY);q.forEach((U,Y)=>{U.y=Y===0?U.idealY:Math.min(U.idealY,q[Y-1].y-P),U.y=Math.max(U.y,-H)}),V.forEach((U,Y)=>{U.y=Y===0?U.idealY:Math.max(U.idealY,V[Y-1].y+P),U.y=Math.min(U.y,H)});let X=W?1:-1,z=X*O;for(let U of B){let Y=Math.abs(U.y0)<.001?U.x1:U.y*U.x0/U.y0;Pr(A.append("polyline").attr("points",`${U.x0},${U.y0} ${Y},${U.y} ${z},${U.y}`).attr("fill","none").attr("stroke",U.stroke).attr("stroke-width",1),U.tag),Pr(A.append("text").attr("x",z+X*M*.3).attr("y",U.y+M*.3).attr("text-anchor",W?"start":"end").attr("fill",U.stroke).attr("font-size",M).attr("font-family",Mt).text(U.label),U.tag)}}}d&&!e.noCenterTotal&&A.append("text").attr("text-anchor","middle").attr("y",Math.max(4,8*E)).attr("fill",i).attr("font-size",Math.max(11,26*E)).attr("font-weight",700).attr("font-family",Mt).text(je(f))}var Dnt,z_=dt(()=>{"use strict";Fo();Fe();Ke();Na();Dnt=14});function K6(t,e){return e===0?t.value:t.extraValues?.[e-1]??0}function V_(t,e,n,r,o,a,i,s,l,c){let d=e.data,u=d.length;if(u<3)return;let f=e.fillMode,m=f==="solid",p=e.seriesNames?.length?e.seriesNames:[e.series??""],h=Math.max(1,p.length,1+Math.max(0,...d.map(L=>L.extraValues?.length??0))),g=h>1,x=L=>g?e.seriesNameColors?.[L]??o[L%o.length]:e.color??e.seriesNameColors?.[0]??a.primary,y=[];for(let L of d)for(let E=0;E<h;E++)y.push(K6(L,E));let b=Math.max(...y)*1.15||1,w=n/2,k=c+8,C=k+(r-k)/2,v=Math.min(n/2-130,(r-k)/2-50),_=L=>-Math.PI/2+L*2*Math.PI/u,R=(L,E)=>[w+Math.cos(_(L))*E,C+Math.sin(_(L))*E];for(let L=1;L<=Y_;L++){let E=v*L/Y_,M=d.map((S,T)=>R(T,E).join(",")).join(" ");t.append("polygon").attr("points",M).attr("fill","none").attr("stroke",l).attr("stroke-opacity",.4)}d.forEach((L,E)=>{let[M,S]=R(E,v);t.append("line").attr("x1",w).attr("y1",C).attr("x2",M).attr("y2",S).attr("stroke",l).attr("stroke-opacity",.4);let[T,N]=R(E,v+18),I=Math.cos(_(E));t.append("text").attr("x",T).attr("y",N+4).attr("text-anchor",Math.abs(I)<.3?"middle":I>0?"start":"end").attr("fill",s).attr("font-size",14).attr("font-family",Mt).text(d[E].label)});for(let L=0;L<h;L++){let E=x(L),M=p[L]??`Series ${L+1}`,S=t.append("g").attr("class","dgmo-series").attr("data-series-index",L).attr("data-series-name",M).attr("data-color",E),T=e.seriesNameLineNumbers?.[L];T!==void 0&&S.attr("data-line-number",T);let N=d.map((I,G)=>R(G,K6(I,L)/b*v).join(",")).join(" ");S.append("polygon").attr("points",N).attr("fill",f==="outline"?"none":m||g?E:ee(a,E,i)).attr("fill-opacity",m?.6:g?.2:1).attr("stroke",E).attr("stroke-width",2),d.forEach((I,G)=>{let $=K6(I,L),[A,D]=R(G,$/b*v),O=S.append("circle").attr("cx",A).attr("cy",D).attr("r",4).attr("fill",E);if(Pr(O,{line:I.lineNumber,key:g?`${M} ${I.label}`:I.label,name:g?`${M} \u2014 ${I.label}`:I.label,value:je($),color:E}),!e.noValue){let[P,H]=R(G,$/b*v+14),W=Math.cos(_(G)),B=Math.sin(_(G));S.append("text").attr("x",P).attr("y",H+(B<-.3?0:B>.3?11:4)).attr("text-anchor",Math.abs(W)<.3?"middle":W>0?"start":"end").attr("fill",g?E:s).attr("font-size",12).attr("font-family",Mt).text(je($))}})}}var Y_,U_=dt(()=>{"use strict";Ke();Fe();Na();Y_=5});function X_(t,e,n,r,o,a,i,s){let l=e.data.filter(k=>k.value>0),c=l.length;if(c===0)return;let d=e.fillMode,u=l.reduce((k,C)=>k+C.value,0),f=Math.max(...l.map(k=>k.value))||1,m=n/2,p=s+8,h=p+(r-p)/2,g=Math.min(n/2-200,(r-p)/2-40),x=g*.14,y=pd(o,c),b=t.append("g").attr("transform",`translate(${m},${h})`),w=2*Math.PI/c;l.forEach((k,C)=>{let v=k.color??y[C%y.length],_=x+k.value/f*(g-x),R=C*w,L=R+w,E=yc().innerRadius(x).outerRadius(_).startAngle(R).endAngle(L),M=Math.round(k.value/u*100),S=b.append("path").attr("d",E({})??"").attr("fill",ee(o,v,a,{mode:d})).attr("stroke",v).attr("stroke-width",2);Pr(S,{line:k.lineNumber,key:k.label,name:k.label,value:`${je(k.value)} (${M}%)`,color:v});let T=R+w/2-Math.PI/2,N=Math.cos(T)>=0,I=Math.cos(T)*(g+14),G=Math.sin(T)*(g+14),$=e.noName?"":k.label,A=[e.noValue?"":je(k.value),e.noPercent?"":`(${M}%)`].filter(Boolean).join(" "),D=[$,A].filter(Boolean).join(" \u2014 ");D&&b.append("text").attr("x",I+(N?4:-4)).attr("y",G+4).attr("text-anchor",N?"start":"end").attr("fill",i).attr("font-size",13).attr("font-family",Mt).text(D)})}var j_=dt(()=>{"use strict";Fo();Ke();Fe();Na()});function Z_(t,e,n,r,o,a,i,s){let l=[...e.data].sort((S,T)=>T.value-S.value),c=l.length;if(c===0)return;let d=e.fillMode,u=s+8,p=(r-30-u)/c,h=l[0].value||1,g=Math.max(11,Math.min(21,n/52)),x=(S,T)=>S.length*T*.6,y=S=>{let T=l[S].value/l[S-1].value*100;return T<1?"<1%":`${Math.round(T)}%`},b=(S,T)=>{let N=[];return!e.noValue&&!T&&N.push(je(l[S].value)),!e.noPercent&&S>0&&N.push(y(S)),N.join(" \xB7 ")},w=e.noName?0:Math.max(...l.map(S=>x(S.label,g)))+B1,k=(S,T)=>{let N=S*.14,I=A=>Math.max(N,A/h*S),G=I(l[T].value),$=T<c-1?I(l[T+1].value):G*.7;return{topW:G,botW:$}},C=(S,T)=>{let{topW:N,botW:I}=k(S,T),G=(N+I)/2,$=je(l[T].value),A=(G-16)/($.length*.6);return Math.min(p*.55,A)},v=(S,T)=>!e.noValue&&C(S,T)>=13,_=S=>{let T=K_+w,N=n-K_-S,I=Math.max(n*.25,Math.min(n*.6,N-T)),G=T+I/2,$=N-I/2,A=G>$?(T+N)/2:Math.min(Math.max(n/2,G),$);return{plotW:I,cx:A}},R=S=>Math.max(0,...l.map((T,N)=>x(b(N,S===null?!0:v(S,N)),g))),L=R(null)+B1,{plotW:E,cx:M}=_(L);L=R(E)+B1,{plotW:E,cx:M}=_(L),l.forEach((S,T)=>{let N=S.color??o[e.data.indexOf(S)%o.length],I=ee(a,N,i,{mode:d}),{topW:G,botW:$}=k(E,T),A=u+T*p,D=A+p,O=t.append("polygon").attr("points",`${M-G/2},${A} ${M+G/2},${A} ${M+$/2},${D} ${M-$/2},${D}`).attr("fill",I).attr("stroke",N).attr("stroke-width",2);Pr(O,{line:S.lineNumber,key:S.label,name:S.label,value:je(S.value),color:N});let P=(A+D)/2,H=(G+$)/4;e.noName||t.append("text").attr("x",M-H-B1).attr("y",P+g*.35).attr("text-anchor","end").attr("fill",N).attr("font-size",g).attr("font-weight",600).attr("font-family",Mt).text(S.label);let W=!e.noPercent&&T>0,B=v(E,T);if(B){let V=C(E,T),X=d==="solid"?pe(I,a.textOnFillLight,a.textOnFillDark):N;t.append("text").attr("x",M).attr("y",P+V*.35).attr("text-anchor","middle").attr("fill",X).attr("font-size",V).attr("font-weight",700).attr("font-family",Mt).text(je(S.value))}let q=!e.noValue&&!B;if(q||W){let V=t.append("text").attr("x",M+H+B1).attr("y",P+g*.35).attr("text-anchor","start").attr("font-size",g).attr("font-weight",600).attr("font-family",Mt);q&&V.append("tspan").attr("fill",N).text(je(S.value)),W&&V.append("tspan").attr("fill",N).text(q?` \xB7 ${y(T)}`:y(T))}})}var B1,K_,Q_=dt(()=>{"use strict";Ke();Fe();Na();B1=12,K_=8});function J_(t,e,n,r,o,a,i,s,l){let c=e.heatmapRows??[];if(c.length===0)return;let d=Math.max(e.columns?.length??0,...c.map($=>$.values.length)),u=c.length,f=e.columns??[],m=1/0,p=-1/0;for(let $ of c)for(let A of $.values)m=Math.min(m,A),p=Math.max(p,A);let h=e.fillMode==="outline",g=h||e.fillMode==="solid"?"solid":void 0,x=Ie(o,a),y=[ee(o,o.primary,a,{mode:g}),ee(o,o.colors.cyan,a,{mode:g}),ee(o,o.colors.yellow,a,{mode:g}),ee(o,o.colors.orange,a,{mode:g})],b=$=>{let A=Math.max(0,Math.min(1,$)),D=1/(y.length-1),O=Math.min(y.length-2,Math.floor(A/D)),P=(A-O*D)/D;return vt(y[O+1],y[O],P*100)},w=$=>{let{h:A,s:D}=ic($),O=Math.min(75,Math.max(D+25,50));return sc(A,O,a?72:30)},C=20+(Math.max(0,...c.map($=>Tt($.label,13)))+16),v=l+28,_=24,R=24,L=n-C-_,E=r-v-R,M=L/d,S=E/u,T=100,N=Math.max(1,...c.flatMap($=>$.values.map(A=>Tt(je(A),T,{bold:!0})))),I=Math.max(11,Math.min(S*.55,M*.7*T/N)),G=f.some($=>Tt($,12)>M*.85);f.forEach(($,A)=>{let D=C+A*M+M/2,O=t.append("text").attr("class","dgmo-axis-label").attr("data-filter-attr","data-col-key").attr("data-filter-value",$).attr("fill",i).attr("font-size",12).attr("font-family",Mt).text($);G?O.attr("transform",`translate(${D},${v-8}) rotate(-40)`).attr("text-anchor","start"):O.attr("x",D).attr("y",v-8).attr("text-anchor","middle")}),c.forEach(($,A)=>{t.append("text").attr("class","dgmo-axis-label").attr("data-filter-attr","data-row-key").attr("data-filter-value",$.label).attr("x",C-10).attr("y",v+A*S+S/2+4).attr("text-anchor","end").attr("fill",i).attr("font-size",13).attr("font-family",Mt).text($.label),$.values.forEach((D,O)=>{let P=p===m?.5:(D-m)/(p-m),H=b(P),W=h?x:H,B=f[O]??`Col ${O+1}`,q=`${$.label} \xB7 ${B}`,V=t.append("rect").attr("x",C+O*M).attr("y",v+A*S).attr("width",M).attr("height",S).attr("fill",W).attr("stroke",h?H:s).attr("stroke-width",h?1.5:2).attr("data-row-key",$.label).attr("data-col-key",B);if(Pr(V,{line:$.lineNumber,key:q,name:q,value:je(D),color:H}),!e.noValue){let X=t.append("text").attr("x",C+O*M+M/2).attr("y",v+A*S+S/2+I/3).attr("text-anchor","middle").attr("fill",w(H)).attr("font-size",I).attr("font-weight",600).attr("font-family",Mt).text(je(D));Pr(X,{line:$.lineNumber,key:q,name:q,value:je(D),color:H}),X.attr("data-row-key",$.label).attr("data-col-key",B)}})})}var tA=dt(()=>{"use strict";Ke();Fe();Ve();Na()});function Gnt(t,e,n,r,o,a,i,s){let l=Math.max(Tt(o,rA)*$nt,Tt(r,oA))+6,c=eA+nA,d=8,u=(m,p,h)=>{let g=h?m.y+eA-6:m.y+c-6,x=h?m.y+c-4:m.y+nA-4;return{x:p==="middle"?t:p==="start"?m.x:m.x+m.w,y:g,labelY:x,anchor:p,rect:m}},f=[m=>({rect:{x:t-l/2,y:e+n+m,w:l,h:c},anchor:"middle",numberFirst:!0}),m=>({rect:{x:t-l/2,y:e-n-m-c,w:l,h:c},anchor:"middle",numberFirst:!1}),m=>({rect:{x:t+n+m,y:e-c/2,w:l,h:c},anchor:"start",numberFirst:!0}),m=>({rect:{x:t-n-m-l,y:e-c/2,w:l,h:c},anchor:"end",numberFirst:!0})];for(let m=d;m<=d+96;m+=12)for(let p of f){let{rect:h,anchor:g,numberFirst:x}=p(m);if(!(h.x<s.left||h.x+h.w>s.right||h.y<s.top||h.y+h.h>s.bottom)&&!a.some(y=>va(h,y))&&!i.some(y=>bl(h,y)))return u(h,g,x)}return u({x:t-l/2,y:e+n+d,w:l,h:c},"middle",!0)}function aA(t,e,n,r,o,a,i,s,l,c){let d=e.scatterPoints??[];if(d.length===0)return;let u=e.fillMode,f=d.some(O=>O.size!==void 0),m=[...new Set(d.map(O=>O.category).filter(Boolean))],p=(O,P)=>e.categoryColors?.[O]??o[P%o.length],h=new Map(m.map((O,P)=>[O,P])),g=d.map(O=>O.x),x=d.map(O=>O.y),y=Math.min(...g),b=Math.max(...g),w=Math.min(...x),k=Math.max(...x),C=(b-y)*.1||1,v=(k-w)*.1||1,_={top:c+8,right:32,bottom:64,left:Ps(e.ylabel,[je(Math.ceil(k+v)),je(Math.floor(w-v))])},R=n-_.left-_.right,L=r-_.top-_.bottom,E=d.map(O=>f?O.size??a0:a0),M=Math.max(12,Math.min(R,L)*.14),S=d4().domain([0,Math.max(...E)||1]).range([0,M]),T=d.map((O,P)=>f?Math.max(5,S(E[P])):a0/2),N=Math.max(...T)+4,I=yr().domain([Math.floor(y-C),Math.ceil(b+C)]).range([_.left+N,_.left+R-N]),G=yr().domain([Math.floor(w-v),Math.ceil(k+v)]).range([_.top+L-N,_.top+N]);t.append("rect").attr("class","dgmo-plot-rect").attr("x",_.left).attr("y",_.top).attr("width",R).attr("height",L).attr("fill","transparent").attr("pointer-events","none");for(let O of G.ticks(6)){let P=G(O);t.append("line").attr("x1",_.left).attr("x2",_.left+R).attr("y1",P).attr("y2",P).attr("stroke",l).attr("stroke-opacity",.25),t.append("text").attr("class","dgmo-tick").attr("x",_.left-10).attr("y",P+4).attr("text-anchor","end").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(je(O))}for(let O of I.ticks(6)){let P=I(O);t.append("line").attr("x1",P).attr("x2",P).attr("y1",_.top).attr("y2",_.top+L).attr("stroke",l).attr("stroke-opacity",.25),t.append("text").attr("class","dgmo-tick").attr("x",P).attr("y",_.top+L+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",zo).attr("font-family",Mt).text(je(O))}let $=e.noName?null:tg(d.map((O,P)=>({label:O.name,cx:I(O.x),cy:G(O.y),r:T[P]})),{left:_.left,top:_.top,right:_.left+R,bottom:_.top+L},[],a0/2,i0),A={left:_.left,top:_.top,right:_.left+R,bottom:_.top+L},D=O=>{let P=$?.[O];if(!P)return[];let H=Tt(d[O].name,i0)+8,W=i0+4;return[{x:P.anchor==="middle"?P.x-H/2:P.anchor==="end"?P.x-H:P.x,y:P.y-W/2,w:H,h:W}]};d.forEach((O,P)=>{let H=O.color??(O.category?p(O.category,h.get(O.category)??0):o[P%o.length]),W=T[P],B=t.append("circle").attr("cx",I(O.x)).attr("cy",G(O.y)).attr("r",W).attr("fill",ee(a,H,i,{mode:u})).attr("fill-opacity",Ont).attr("stroke",H).attr("stroke-width",2);if(Pr(B,{line:O.lineNumber,key:O.name,name:O.category?`${O.name} \xB7 ${O.category}`:O.name,value:O.size!==void 0?`(${je(O.x)}, ${je(O.y)}) \xB7 ${e.sizelabel??"size"}: ${je(O.size)}`:`(${je(O.x)}, ${je(O.y)})`,color:H}),B.attr("data-axval-x",je(O.x)).attr("data-axval-y",je(O.y)),O.size!==void 0){let q=e.sizelabel??"size",V=Gnt(I(O.x),G(O.y),W,q,je(O.size),D(P),[],A);B.attr("data-size",je(O.size)).attr("data-size-label",q).attr("data-sizeval-x",V.x).attr("data-sizeval-y",V.y).attr("data-sizeval-ly",V.labelY).attr("data-sizeval-anchor",V.anchor)}if(O.category&&(B.attr("data-category",O.category),B.attr("data-series-name",O.category)),$){let q=$[P];q.connectorLine&&t.append("line").attr("class","dgmo-ptlabel").attr("data-line-number",O.lineNumber).attr("x1",q.connectorLine.x1).attr("y1",q.connectorLine.y1).attr("x2",q.connectorLine.x2).attr("y2",q.connectorLine.y2).attr("stroke",H).attr("stroke-width",1).attr("opacity",.5),t.append("text").attr("class","dgmo-ptlabel").attr("data-line-number",O.lineNumber).attr("x",q.x).attr("y",q.y).attr("text-anchor",q.anchor).attr("dominant-baseline","central").attr("fill",H).attr("font-size",i0).attr("font-family",Mt).text(O.name)}}),Il(t,e.xlabel,_.left+R/2,_.top+L+46,s),Ds(t,e.ylabel,_.top+L/2,20,s)}var Ont,a0,i0,rA,eA,oA,nA,$nt,iA=dt(()=>{"use strict";bi();_d();Ve();Ke();Fe();Na();Ont=.65,a0=15,i0=11,rA=20,eA=rA+4,oA=11,nA=oA+4,$nt=1.08});function lA(t,e,n,r,o,a,i,s){let l=e.links??[];if(l.length===0)return;let c=e.fillMode==="solid",d=Array.from(new Set(l.flatMap(S=>[S.source,S.target]))),u=(S,T)=>{let N=new Set(S);for(let I=0;I<d.length;I++){let G=!1;for(let $ of l){let A=T?$.target:$.source,D=T?$.source:$.target;N.has(A)&&!N.has(D)&&(N.add(D),G=!0)}if(!G)break}return N},f=S=>new Set([...u(S,!0),...u(S,!1)]),{dimmed:m}=yN(e.emphasis,d,f),p=S=>m.has(S.source)||m.has(S.target),h=new Map;d.forEach((S,T)=>h.set(S,{name:S,rank:0,value:0,order:T,x:0,y:0,h:0,raw:e.nodeColors?.[S]??o[T%o.length]}));for(let S=0;S<d.length;S++){let T=!1;for(let N of l){let I=h.get(N.source),G=h.get(N.target);G.rank<I.rank+1&&(G.rank=I.rank+1,T=!0)}if(!T)break}for(let S of h.values()){let T=l.filter(I=>I.source===S.name).reduce((I,G)=>I+G.value,0),N=l.filter(I=>I.target===S.name).reduce((I,G)=>I+G.value,0);S.value=Math.max(T,N,1)}let g=Math.max(...[...h.values()].map(S=>S.rank)),x=Array.from({length:g+1},()=>[]);for(let S of h.values())x[S.rank].push(S);let y=16,b=s+8,w=n-y-16-Tt("M",14),k=r-b-24,C=1/0;for(let S of x){let T=S.reduce((I,G)=>I+G.value,0),N=k-(S.length-1)*Z6;T>0&&(C=Math.min(C,N/T))}isFinite(C)||(C=1);let v=S=>y+(g===0?0:S*(w-s0)/g),_=S=>{S.sort((I,G)=>I.order-G.order);let T=S.reduce((I,G)=>I+G.value*C,0)+(S.length-1)*Z6,N=b+(k-T)/2;for(let I of S)I.h=I.value*C,I.x=v(I.rank),I.y=N,N+=I.h+Z6};x.forEach(_);let R=S=>S.y+S.h/2;for(let S=0;S<6;S++){let T=S%2===0,N=T?[...x.keys()]:[...x.keys()].reverse();for(let I of N){for(let G of x[I]){let $=T?l.filter(A=>A.target===G.name).map(A=>h.get(A.source)):l.filter(A=>A.source===G.name).map(A=>h.get(A.target));G.order=$.length?$.reduce((A,D)=>A+R(D),0)/$.length:R(G)}_(x[I])}}let L=new Map,E=new Map;for(let S of h.values())L.set(S.name,S.y),E.set(S.name,S.y);let M=[...l].sort((S,T)=>{let N=h.get(S.source),I=h.get(T.source);return N.y!==I.y?N.y-I.y:h.get(S.target).y-h.get(T.target).y});for(let S of M){let T=h.get(S.source),N=h.get(S.target),I=S.value*C,G=L.get(T.name),$=E.get(N.name);L.set(T.name,G+I),E.set(N.name,$+I);let A=T.x+s0,D=N.x,O=A+(D-A)*.5,P=S.color??T.raw,H=c?P:vt(P,a,45),W=t.append("path").attr("d",`M${A},${G} C${O},${G} ${O},${$} ${D},${$} L${D},${$+I} C${O},${$+I} ${O},${G+I} ${A},${G+I} Z`).attr("fill",H).attr("fill-opacity",p(S)?sA*.28:sA);Pr(W,{line:S.lineNumber,key:`link:${T.name}\u241F${N.name}`,name:`${T.name} \u2192 ${N.name}`,value:String(S.value),color:T.raw})}for(let S of h.values()){let T=l.find(A=>A.source===S.name||A.target===S.name)?.lineNumber,N=m.has(S.name),I=t.append("rect").attr("x",S.x).attr("y",S.y).attr("width",s0).attr("height",Math.max(1,S.h)).attr("fill",c?S.raw:vt(S.raw,a,75)).attr("stroke",S.raw).attr("stroke-width",1);N&&I.attr("opacity",.28),Pr(I,{...T!==void 0&&{line:T},key:`node:${S.name}`,name:S.name,value:String(S.value),color:S.raw});let G=S.rank===g,$=t.append("text").attr("x",G?S.x-6:S.x+s0+6).attr("y",S.y+S.h/2+4).attr("text-anchor",G?"end":"start").attr("fill",i).attr("font-size",13).attr("font-family",Mt).text(S.name);N&&$.attr("opacity",.5)}}var s0,Z6,sA,cA=dt(()=>{"use strict";Ke();Fe();Ve();Na();M5();s0=20,Z6=14,sA=.6});function dA(t,e,n,r,o,a,i,s,l){let c=e.links??[];if(c.length===0)return;let d=e.fillMode,u=Array.from(new Set(c.flatMap(v=>[v.source,v.target]))),f=u.length,m=new Map(u.map((v,_)=>[v,_])),p=v=>o[v%o.length],h=l+8,g=n/2,x=h+(r-h)/2,y=Math.max(0,...u.map(v=>Tt(v,14))),b=Math.min(n/2-y-60,(r-h)/2-50),w=v=>-Math.PI/2+v*2*Math.PI/f,k=v=>[g+Math.cos(w(v))*b,x+Math.sin(w(v))*b],C=new Set;for(let v of c)c.some(_=>_.source===v.target&&_.target===v.source&&_!==v)&&C.add(`${v.source}\0${v.target}`);for(let v of c){let _=m.get(v.source),R=m.get(v.target),[L,E]=k(_),[M,S]=k(R),T=C.has(`${v.source}\0${v.target}`),N=.3,I=T?v.source<v.target?N+.15:N-.15:N,G=(L+M)/2,$=(E+S)/2,A=G+(g-G)*I*2,D=$+(x-$)*I*2,O=Math.max(1,Math.min(v.value/20,10)),P=p(_),H=t.append("path").attr("d",`M${L},${E} Q${A},${D} ${M},${S}`).attr("fill","none").attr("stroke",P).attr("stroke-width",O).attr("stroke-opacity",.6);if(Pr(H,{line:v.lineNumber,key:`edge:${v.source} ${v.target}`,name:`${v.source} \u2192 ${v.target}`,value:String(v.value),color:P}),v.directed){let W=Math.atan2(S-D,M-A),B=11,q=M-Math.cos(W)*10,V=S-Math.sin(W)*10,X=W+Math.PI-.4,z=W+Math.PI+.4;t.append("polygon").attr("points",`${q},${V} ${q+Math.cos(X)*B},${V+Math.sin(X)*B} ${q+Math.cos(z)*B},${V+Math.sin(z)*B}`).attr("fill",P).attr("fill-opacity",.7)}}u.forEach((v,_)=>{let[R,L]=k(_),E=p(_),M=t.append("circle").attr("cx",R).attr("cy",L).attr("r",10).attr("fill",ee(a,E,i,{mode:d})).attr("stroke",E).attr("stroke-width",2);Pr(M,{key:`node:${v}`,name:v,color:E});let S=Math.cos(w(_)),T=R+S*16,N=L+Math.sin(w(_))*16;t.append("text").attr("x",T).attr("y",N+4).attr("text-anchor",Math.abs(S)<.3?"middle":S>0?"start":"end").attr("fill",s).attr("font-size",14).attr("font-family",Mt).text(v)})}var uA=dt(()=>{"use strict";Ke();Fe();Ve();Na()});function Hnt(t){let e=[],n=0,r=t.length;for(;n<r;){let o=t.charAt(n);if(o===" "||o===" "){n++;continue}if(o>="0"&&o<="9"||o==="."){let a=n+1;for(;/[0-9.]/.test(t.charAt(a));)a++;let i=t.charAt(a);if(i==="e"||i==="E"){let l=a+1,c=t.charAt(l);if((c==="+"||c==="-")&&l++,/[0-9]/.test(t.charAt(l))){for(;/[0-9]/.test(t.charAt(l));)l++;a=l}}let s=Number(t.slice(n,a));if(!isFinite(s))throw new Error("bad number");e.push({t:"num",v:s}),n=a;continue}if(/[a-zA-Z]/.test(o)){let a=n+1;for(;/[a-zA-Z0-9]/.test(t.charAt(a));)a++;e.push({t:"id",v:t.slice(n,a).toLowerCase()}),n=a;continue}if("+-*/^()".includes(o)){e.push({t:"op",v:o}),n++;continue}throw new Error(`unexpected char: ${o}`)}return e}function fA(t,e){try{let n=new J6(Hnt(t),e).evaluate();return typeof n=="number"&&isFinite(n)?n:NaN}catch{return NaN}}var Bnt,J6,mA=dt(()=>{"use strict";Bnt={sin:Math.sin,cos:Math.cos,tan:Math.tan,ln:Math.log,log:Math.log10,exp:Math.exp,sqrt:Math.sqrt,abs:Math.abs};J6=class{constructor(e,n){this.tokens=e;this.x=n}tokens;x;pos=0;peek(){return this.tokens[this.pos]}eatOp(e){let n=this.peek();if(n?.t!=="op"||n.v!==e)throw new Error(`expected ${e}`);this.pos++}evaluate(){let e=this.parseExpr();if(this.pos!==this.tokens.length)throw new Error("trailing input");return e}parseExpr(){let e=this.parseTerm();for(;;){let n=this.peek();if(n?.t==="op"&&(n.v==="+"||n.v==="-")){this.pos++;let r=this.parseTerm();e=n.v==="+"?e+r:e-r}else break}return e}parseTerm(){let e=this.parseFactor();for(;;){let n=this.peek();if(n?.t==="op"&&(n.v==="*"||n.v==="/")){this.pos++;let r=this.parseFactor();e=n.v==="*"?e*r:e/r}else break}return e}parseFactor(){let e=this.peek();if(e?.t==="op"&&(e.v==="+"||e.v==="-")){this.pos++;let n=this.parseFactor();return e.v==="-"?-n:n}return this.parsePower()}parsePower(){let e=this.parsePrimary(),n=this.peek();if(n?.t==="op"&&n.v==="^"){this.pos++;let r=this.parseFactor();return e**r}return e}parsePrimary(){let e=this.peek();if(!e)throw new Error("unexpected end");if(e.t==="num")return this.pos++,e.v;if(e.t==="op"&&e.v==="("){this.pos++;let n=this.parseExpr();return this.eatOp(")"),n}if(e.t==="id"){if(this.pos++,e.v==="x")return this.x;if(e.v==="pi")return Math.PI;if(e.v==="e")return Math.E;let n=Bnt[e.v];if(n){this.eatOp("(");let r=this.parseExpr();return this.eatOp(")"),n(r)}throw new Error(`unknown identifier: ${e.v}`)}throw new Error("unexpected token")}}});function hA(t,e,n,r,o,a,i,s,l,c){let d=e.functions??[];if(d.length===0)return;let u=e.xRange??{min:-10,max:10},f=(u.max-u.min)/pA,m=[];for(let _=0;_<=pA;_++)m.push(u.min+_*f);let p=d.map((_,R)=>({color:_.color??o[R%o.length],name:_.name,line:_.lineNumber,pts:m.map(L=>[L,fA(_.expression,L)])})),h=1/0,g=-1/0;for(let _ of p)for(let[,R]of _.pts)isFinite(R)&&(h=Math.min(h,R),g=Math.max(g,R));isFinite(h)||(h=-1,g=1),h===g&&(g=h+1);let x={top:s+8,right:32,bottom:64,left:Ps(e.ylabel,[je(g),je(h)])},y=n-x.left-x.right,b=r-x.top-x.bottom,w=yr().domain([u.min,u.max]).range([x.left,x.left+y]),k=yr().domain([h,g]).nice().range([x.top+b,x.top]);for(let _ of k.ticks(8)){let R=k(_);t.append("line").attr("x1",x.left).attr("x2",x.left+y).attr("y1",R).attr("y2",R).attr("stroke",i).attr("stroke-opacity",_===0?.6:.2),t.append("text").attr("class","dgmo-tick").attr("x",x.left-10).attr("y",R+4).attr("text-anchor","end").attr("fill",a).attr("font-size",zo).attr("font-family",Mt).text(je(_))}for(let _ of w.ticks(10)){let R=w(_);t.append("line").attr("x1",R).attr("x2",R).attr("y1",x.top).attr("y2",x.top+b).attr("stroke",i).attr("stroke-opacity",_===0?.6:.2),t.append("text").attr("class","dgmo-tick").attr("x",R).attr("y",x.top+b+18).attr("text-anchor","middle").attr("fill",a).attr("font-size",zo).attr("font-family",Mt).text(je(_))}let C=_=>isFinite(_[1])&&_[1]>=h-1&&_[1]<=g+1;if(e.fill===!0){let _=e.fillMode==="solid",R=xc().defined(C).x(L=>w(L[0])).y0(k(Math.max(k.domain()[0],0))).y1(L=>k(L[1]));for(let L of p)t.append("path").attr("class","dgmo-series-area").attr("d",R(L.pts)??"").attr("fill",_?L.color:ee(l,L.color,c)).attr("stroke","none").attr("data-series-name",L.name)}let v=lr().defined(C).x(_=>w(_[0])).y(_=>k(_[1]));for(let _ of p){let R=t.append("path").attr("d",v(_.pts)??"").attr("fill","none").attr("stroke",_.color).attr("stroke-width",1.75).attr("stroke-linejoin","round").attr("data-series-name",_.name);Pr(R,{line:_.line,key:_.name,name:_.name,color:_.color})}Il(t,e.xlabel,x.left+y/2,x.top+b+46,a),Ds(t,e.ylabel,x.top+b/2,20,a)}var pA,gA=dt(()=>{"use strict";bi();Fo();Fe();Ke();mA();Na();pA=200});var wA={};ue(wA,{D3_DATA_CHART_TYPES:()=>xA,renderDataChartD3:()=>ex,supportsD3DataChart:()=>Fnt});function Fnt(t){return xA.has(t)}function yA(t,e,n){if(!(!e||!t.legendInline||t.noLegend||!Wnt.has(t.type)))return{title:t.title,...t.titleLineNumber!==void 0&&{titleLineNumber:t.titleLineNumber},textColor:n}}function znt(t){for(let e of t.split(`
|
|
289
|
-
`)){let n=e.trim();if(!(!n||n.startsWith("//")))return n.split(/\s+/)[0].toLowerCase()}return""}async function ex(t,e,n,r){let o=await kn(e,n),a=e==="dark",i=r?.width&&r.width>0?Math.round(r.width):nh,s=r?.height&&r.height>0?Math.round(r.height):rh,l=Vn(i,s),c=hi(l,o,{width:i,height:s});if(!c)return document.body.removeChild(l),"";let{svg:d,width:u,height:f,textColor:m,mutedColor:p,bgColor:h,colors:g}=c;return Ynt(d,t,o,a,u,f,m,p,h,g)?Sn(l,e,o):(document.body.removeChild(l),"")}function Ynt(t,e,n,r,o,a,i,s,l,c){let d=znt(e),f=tx.has(d)?null:Sl(e,n);if(f&&!f.error&&f.data.length>0&&bA.has(f.type)){let x=!f.noTitle&&!!f.title,y=yA(f,x,i);switch(x&&!y&&ao(t,f.title,f.titleLineNumber,o,i),f.type){case"bar":return G_(t,f,o,a,c,n,r,i,s,x,y),!0;case"line":return H_(t,f,o,a,c,n,r,i,s,l,x,y),!0;case"pie":return W_(t,f,o,a,n,r,i,x?52:24),!0;case"radar":{let b=f.noLegend?[]:gg(f,c),w=q1(t,b,n,r,x,o,y);return V_(t,f,o,a,c,n,r,i,s,w),!0}case"polar-area":return X_(t,f,o,a,n,r,i,x?52:24),!0}}let m=Ml(e,n);if(m.error||!tx.has(m.type))return!1;let p=Bn(n),h=!m.noTitle&&!!m.title,g=yA(m,h,i);switch(h&&!g&&ao(t,m.title,m.titleLineNumber,o,i),m.type){case"funnel":return Z_(t,m,o,a,p,n,r,h?52:24),!0;case"heatmap":return J_(t,m,o,a,n,r,i,l,h?52:24),!0;case"scatter":{let x=m.noLegend?[]:T5(m,p),y=q1(t,x,n,r,h,o,g);return aA(t,m,o,a,p,n,r,i,s,y),!0}case"sankey":return lA(t,m,o,a,p,l,i,h?52:24),!0;case"chord":return dA(t,m,o,a,p,n,r,i,h?52:24),!0;case"function":{let x=m.noLegend?[]:T5(m,p),y=q1(t,x,n,r,h,o,g);return hA(t,m,o,a,p,i,s,y,n,r),!0}default:return!1}}var bA,tx,xA,Wnt,nx=dt(()=>{"use strict";pg();M1();M1();Fe();qi();Na();q_();F_();z_();U_();j_();Q_();tA();iA();cA();uA();gA();bA=new Set(["bar","line","pie","radar","polar-area"]),tx=new Set(["funnel","heatmap","scatter","sankey","chord","function"]),xA=new Set([...bA,...tx]);Wnt=new Set(["bar","line","radar","scatter","function"])});function Os(t,e){let n=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("rx",e.rx).attr("fill",e.fill).attr("stroke",e.stroke).attr("stroke-width",e.strokeWidth);e.dashed&&n.attr("stroke-dasharray","6 3");let r=e.labelLines;if(r&&r.length>1){let c=e.labelFontSize*1.2,u=e.headerHeight/2-(r.length-1)*c/2;for(let f=0;f<r.length;f++)t.append("text").attr("x",e.width/2).attr("y",u+f*c).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(r[f])}else t.append("text").attr("x",e.width/2).attr("y",e.headerHeight/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(r?.[0]??e.label);let o=e.meta;if(!o||o.rows.length===0)return;t.append("line").attr("x1",0).attr("y1",e.headerHeight).attr("x2",e.width).attr("y2",e.headerHeight).attr("stroke",o.separatorColor).attr("stroke-opacity",.3).attr("stroke-width",1);let a=o.keyX??10,i=Math.max(...o.rows.map(([c])=>Tt(`${c}: `,o.fontSize))),s=a+i,l=e.headerHeight+o.separatorGap+o.fontSize;for(let c=0;c<o.rows.length;c++){let[d,u]=o.rows[c],f=l+c*o.lineHeight;t.append("text").attr("x",a).attr("y",f).attr("fill",o.textColor).attr("font-size",o.fontSize).text(`${d}: `),t.append("text").attr("x",s).attr("y",f).attr("fill",o.textColor).attr("font-size",o.fontSize).text(u)}}function H1(t,e){t.append("clipPath").attr("id",e.clipId).append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.rx),t.append("rect").attr("x",e.inset).attr("y",e.height-e.barHeight).attr("width",e.width-e.inset*2).attr("height",e.barHeight).attr("fill",e.fill).attr("clip-path",`url(#${e.clipId})`).attr("class",e.className)}var F1=dt(()=>{"use strict";Ve()});var PA={};ue(PA,{clearEventLineMuted:()=>irt,focusEventLine:()=>IA,renderEventLine:()=>mx,renderEventLineForExport:()=>prt});function mx(t,e,n,r,o,a,i,s){if(e.events.length===0)return;It(t).selectAll(":not([data-d3-tooltip])").remove();let l=a?.width??t.clientWidth,c=a?.height??t.clientHeight;if(l<=0||c<=0)return;let d=!!a,u=d?new Set:px(t),m=Bn(n)[0],p=mr(e.tagGroups,void 0,i),h=!!e.title&&!e.options.noTitle,g=e.tagGroups.length>0&&p!==null&&!e.options.noLegend,x=h?Vnt:0,y=g?Unt:0,b=e.options.legendInline===!0,w=b&&g?cr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:d?"export":"preview"},{activeGroup:p??null},l):{width:0,height:0},k=nr({requested:b,title:e.title??"",hasLegend:g,legendWidth:w.width,legendHeight:w.height,containerWidth:l,titleBandHeight:x,legendReserve:y,titleBaselineY:30,titleFontSize:20}),C=k.inline?x:x+y,v=new Map(e.eras.map(ft=>[ft.name,ft])),_=new Set(e.eras.filter(ft=>ft.collapsed).map(ft=>ft.name)),R=e.events.some(ft=>ft.era&&v.has(ft.era)),L=e.events.some(ft=>ft.era&&v.has(ft.era)&&!_.has(ft.era)),E=e.options.side,M=E==="alternate",S=M||E==="above"?"below":"above",T=[],N=new Set;for(let ft of e.events){let kt=ft.era;kt&&_.has(kt)?N.has(kt)||(N.add(kt),T.push({kind:"era",era:v.get(kt),members:e.events.filter(_t=>_t.era===kt)})):T.push({kind:"event",event:ft})}let I=Math.max(8,Math.floor((fo-Pl*2)/(Ac*aa))),G=ft=>{let kt=hn(ft,13,jnt,{hardBreak:!0,bold:!0}),_t=Math.max(28,kt.length*ax+12);return{lines:kt,headerH:_t}},$=(ft,kt,_t)=>ft+(_t?EA:0)+(kt.length>0?6+kt.length*AA:0)+(kt.length>0?Pl:6),A=ft=>{if(!p)return m;let kt=Dn(ft.metadata,e.tagGroups,p);return kt&&kt!==Qnt?Re(kt,n)??kt:m},D=0,O=T.map(ft=>{let kt=M?D++%2===0?"above":"below":E;if(ft.kind==="event"){let re=ft.event,Ot=A(re),Ut=ee(n,Ot,r,{mode:e.options.fillMode}),oe=pe(Ut,n.textOnFillLight,n.textOnFillDark),Ee=TA(re.description,I),de=G(re.label);return{kind:"event",event:re,era:null,members:[],label:re.label,date:re.date,dateValue:re.dateValue,future:re.future,futureSpan:re.futureSpan,lineNumber:re.lineNumber,eraName:re.era,color:Ot,cardFill:Ut,titleColor:oe,titleLines:de.lines,headerH:de.headerH,lines:Ee,bulletColors:[],bulletMeta:[],cardH:$(de.headerH,Ee,!!re.date),x:0,side:kt,lane:0,left:0,spanHalf:0}}let _t=ft.era,yt=ft.members.map(A),St=p!=null&&yt.length>0&&yt.every(re=>re===yt[0])&&yt[0]!==m,Ct=_t.color?Re(_t.color,n)??n.text:St?yt[0]:n.text,ht=vt(Ct,Ie(n,r),10),Pt=pe(ht,n.textOnFillLight,n.textOnFillDark),Dt=null,qt=null;for(let re of ft.members)re.dateValue!==null&&((Dt===null||re.dateValue<Dt)&&(Dt=re.dateValue),(qt===null||re.dateValue>qt)&&(qt=re.dateValue));let Wt=Dt!==null&&qt!==null?(Dt+qt)/2:null,Ft=ft.members.filter(re=>!lrt(re.metadata,u)),Xt=Ft.map(re=>`\u2022 ${re.date?`${re.future?"TBD":zi(re.date)} `:""}${re.label}`),zt=Ft.map(A),xt=Ft.map(re=>re.metadata),$t=TA(Xt,I),Zt=G(_t.name);return{kind:"era",event:null,era:_t,members:ft.members,label:_t.name,date:null,dateValue:Wt,future:!1,futureSpan:null,lineNumber:_t.lineNumber,eraName:_t.name,color:Ct,cardFill:ht,titleColor:Pt,titleLines:Zt.lines,headerH:Zt.headerH,lines:$t,bulletColors:zt,bulletMeta:xt,cardH:$(Zt.headerH,$t,!1),x:0,side:kt,lane:0,left:0,spanHalf:0}}),P=e.options.scale&&O.every(ft=>ft.dateValue!==null),H=l-l0*2,W=16,B=8,q=64,V=16,X=[],z=[],U=()=>{if(!z.length)return;let ft=z.map(kt=>kt.dateValue);X.push({kind:"run",events:z,lo:Math.min(...ft),hi:Math.max(...ft)}),z=[]};for(let ft of O)ft.kind==="era"?(U(),X.push({kind:"capsule",p:ft})):z.push(ft);U();let Y=X.reduce((ft,kt)=>ft+(kt.kind==="run"?kt.hi-kt.lo:0),0),K=ft=>{if(P){let kt=Y>0?H*ft/Y:0,_t={above:-1/0,below:-1/0},yt=l0;for(let ht of X)if(ht.kind==="capsule"){let Pt=yt+q/2,Dt=Math.max(fo/2+6,_t[ht.p.side]+lx+fo/2);Pt<Dt&&(yt+=Dt-Pt,Pt=Dt),ht.p.x=Pt,ht.p.spanHalf=q/2,_t[ht.p.side]=Pt+fo/2,yt+=q+V}else{for(let Pt of ht.events)Pt.x=yt+(Pt.dateValue-ht.lo)*kt,Pt.spanHalf=0;yt+=(ht.hi-ht.lo)*kt+V}let St=-1/0,Ct=null;for(let ht of[...O].sort((Pt,Dt)=>Pt.x-Dt.x)){if(ht.kind==="era"){St=ht.x+ht.spanHalf,Ct=null;continue}if(ht.dateValue===Ct){ht.x=St;continue}ht.x<St+W&&(ht.x=St+W),St=ht.x,Ct=ht.dateValue}}else{O.forEach(yt=>{yt.spanHalf=0});let kt=O.length,_t=kt>1?Math.max(Knt,H/(kt-1)):0;O.forEach((yt,St)=>{yt.x=l0+St*_t})}for(let kt of["above","below"]){let _t=O.filter(St=>St.side===kt).sort((St,Ct)=>St.x-Ct.x),yt=[];for(let St=0;St<_t.length;St++){let Ct=_t[St],ht=_t[St+1],Dt=Ct.kind!=="era"&&!!ht&&ht.x-Ct.x<fo+lx?Ct.x-fo+sx:Ct.x-fo/2,qt=Ct.x-sx,Wt=Ct.x-fo+sx,Ft=yt.length,Xt=Math.max(Dt,Wt);for(let zt=0;zt<yt.length;zt++){let xt=Math.max(Dt,yt[zt]+lx,Wt);if(xt<=qt){Ft=zt,Xt=xt;break}}Ct.lane=Ft,Ct.left=Math.max(6,Xt),yt[Ft]=Ct.left+fo}}},et=()=>{let ft=Math.max(l,Math.max(...O.map(xt=>xt.x+xt.spanHalf))+l0,Math.max(...O.map(xt=>xt.left+fo))+6),kt={above:[],below:[]};for(let xt of["above","below"]){let $t=[];for(let Ot of O)Ot.side===xt&&($t[Ot.lane]=Math.max($t[Ot.lane]??0,Ot.cardH));let Zt=[],re=0;for(let Ot=0;Ot<$t.length;Ot++)Zt[Ot]=re,re+=($t[Ot]??0)+Znt;kt[xt]=Zt}let _t=xt=>(xt.side==="above"?rx:ox)+(kt[xt.side][xt.lane]??0),yt=xt=>Math.max(0,...O.filter($t=>$t.side===xt).map($t=>_t($t)+$t.cardH)),St=yt("above"),Ct=yt("below"),ht=St+(L&&S==="above"?SA:0),Pt=Ct+(L&&S==="below"?SA:0),Dt=14,qt=14,Wt=C+Dt+ht,Ft=S==="above"?Wt-(St+14):Wt+(Ct+14),Xt=Wt+Pt+qt,zt=d?Xt:Math.max(c,Xt);return{contentW:ft,contentH:Xt,totalH:zt,spineY:Wt,eraBaseY:Ft,laneNear:_t}},nt=Number(globalThis.process?.env?.DGMO_EVT_STRETCH),J;if(Number.isFinite(nt)&&nt>0)K(nt),J=et();else{K(1),J=et();let ft=l/c,kt=_t=>_t.contentW/_t.contentH;if(P&&J.contentH>c&&kt(J)<ft){K(B);let _t=et();if(kt(_t)<=ft)J=_t;else{let yt=1,St=B;for(let Ct=0;Ct<8;Ct++){let ht=(yt+St)/2;K(ht),kt(et())>=ft?St=ht:yt=ht}K(St),J=et()}}}let{contentW:F,contentH:j,totalH:Q,spineY:Z,eraBaseY:ot,laneNear:at}=J,lt=It(t).append("svg").attr("width",F).attr("height",Q).attr("viewBox",`0 0 ${F} ${Q}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(!d&&Q>j&<.attr("data-content-height",Math.ceil(j)),d||lt.append("style").text(rrt),h){let ft=lt.append("text").attr("class","chart-title").attr("x",k.inline?k.titleX:F/2).attr("y",30).attr("text-anchor",k.inline?k.titleAnchor:"middle").attr("fill",n.text).attr("font-family",Mt).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber){let kt=e.titleLineNumber;ft.style("cursor","pointer").on("click",()=>o(kt))}}if(g){let ft=lt.append("g").attr("transform",k.inline?`translate(${k.legendX}, ${k.legendY})`:`translate(0, ${x})`),kt=e.tagGroups.map(_t=>({name:_t.name,entries:_t.entries.map(yt=>({value:yt.value,color:Re(yt.color,n)??yt.color}))}));tn(ft,{groups:kt,palette:n,isDark:r,width:F,mode:d?"export":"preview",activeGroup:p,position:{placement:"top-center",titleRelation:k.inline?"inline-with-title":"below-title"}}),d||srt(ft)}let rt=Math.min(...O.map(ft=>ft.x-ft.spanHalf)),ut=Math.max(...O.map(ft=>ft.x+ft.spanHalf)),tt=rt-20,it=ut+20,st=P&&O.some(ft=>ft.future&&!ft.futureSpan),ct=O.length?Math.max(tt,...O.filter(ft=>!ft.future).map(ft=>ft.x+ft.spanHalf)):it,pt=st?ct:it;lt.append("line").attr("x1",tt).attr("y1",Z).attr("x2",pt).attr("y2",Z).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round"),st&<.append("line").attr("x1",pt).attr("y1",Z).attr("x2",it).attr("y2",Z).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round").attr("stroke-opacity",.45).attr("stroke-dasharray","2 6");let mt=O.map(ft=>{let kt=ft.side==="above"?Z-at(ft):Z+at(ft),_t=ft.side==="above"?kt-ft.cardH:kt;return{p:ft,near:kt,top:_t}}),bt=(ft,kt)=>{let _t=Math.min(Z,kt),yt=Math.max(Z,kt);return mt.some(St=>St.p!==ft&&ft.x>St.p.left&&ft.x<St.p.left+fo&&yt>St.top&&_t<St.top+St.p.cardH)},gt=ft=>Z+nrt*(ft.side==="above"?-1:1);for(let{p:ft,near:kt}of mt){let _t=ft.kind==="era"?gt(ft):Z,yt=lt.append("line").attr("class","dgmo-event-leader").attr("x1",ft.x).attr("y1",_t).attr("x2",ft.x).attr("y2",kt).attr("stroke",ft.color).attr("stroke-width",1.5).attr("stroke-opacity",bt(ft,kt)?.18:ft.future?.4:.65);dx(yt,ft)}let Et=0;for(let{p:ft,top:kt}of mt){let _t=ft.left,yt=lt.append("g").attr("class","dgmo-event-card").attr("transform",`translate(${_t}, ${kt})`).attr("data-line-number",ft.lineNumber);if(dx(yt,ft),ft.kind==="era"&&yt.attr("data-era",ft.era.name).attr("data-era-collapsed","true"),o){let ht=ft.lineNumber;yt.style("cursor","pointer").on("click",()=>o(ht)),yt.append("rect").attr("x",0).attr("y",0).attr("width",fo).attr("height",ft.cardH).attr("fill","transparent").attr("pointer-events","all")}let St=ft.kind==="event"&&ft.date?ft.future?"TBD":zi(ft.date):null,Ct=St?EA:0;if(e.options.noBox){let ht=ft.side==="below",Pt=ht?0:ft.cardH-ft.headerH,Dt=ht?0:ft.cardH-ft.headerH-Ct,qt=ft.headerH+Ct,Wt=`dgmo-evt-shelf-${Et++}`;if(yt.append("clipPath").attr("id",Wt).append("rect").attr("x",0).attr("y",Dt).attr("width",fo).attr("height",qt).attr("rx",trt),yt.append("rect").attr("x",0).attr("y",Dt).attr("width",fo).attr("height",qt).attr("clip-path",`url(#${Wt})`).attr("fill",e.options.fillMode?ft.color:vt(ft.color,Ie(n,r),Jnt)),kA!=="none"&&!e.options.fillMode){let xt=kA==="left"?{x:0,y:Dt,width:cx,height:qt}:{x:0,y:ht?Dt:Dt+qt-cx,width:fo,height:cx};yt.append("rect").attr("x",xt.x).attr("y",xt.y).attr("width",xt.width).attr("height",xt.height).attr("clip-path",`url(#${Wt})`).attr("fill",ft.color).attr("fill-opacity",ft.future?.4:1)}let Ft=e.options.fillMode?pe(ft.color,n.textOnFillLight,n.textOnFillDark):ft.color,zt=Pt+ft.headerH/2-(ft.titleLines.length-1)*ax/2;for(let xt=0;xt<ft.titleLines.length;xt++)yt.append("text").attr("x",Pl).attr("y",zt+xt*ax).attr("dominant-baseline","central").attr("fill",Ft).attr("font-family",Mt).attr("font-size",13).attr("font-weight",700).text(ft.titleLines[xt]);if(St&&yt.append("text").attr("x",Pl).attr("y",(ht?ft.headerH:Pt-Ct)+c0+2).attr("fill",e.options.fillMode?vt(Ft,ft.color,25):vt(n.text,n.bg,55)).attr("font-family",Mt).attr("font-size",c0).attr("font-weight",600).text(St),ft.lines.length>0){let xt=ht?ft.headerH+6+Ct+Ac:Pl+Ac;_A(yt,ft.lines,n.text,n,xt,ft.bulletColors,ft.bulletMeta)}}else Os(yt,{width:fo,height:ft.cardH,rx:6,fill:ft.cardFill,stroke:ft.color,strokeWidth:1.5,label:ft.label,labelLines:ft.titleLines,labelColor:ft.titleColor,labelFontSize:13,headerHeight:ft.headerH}),St&&yt.append("text").attr("x",fo/2).attr("y",ft.headerH+c0+1).attr("text-anchor","middle").attr("fill",vt(ft.titleColor,ft.cardFill,60)).attr("font-family",Mt).attr("font-size",c0).attr("font-weight",600).text(St),ft.lines.length>0&&(yt.append("line").attr("x1",0).attr("y1",ft.headerH+Ct).attr("x2",fo).attr("y2",ft.headerH+Ct).attr("stroke",ft.titleColor).attr("stroke-opacity",.3).attr("stroke-width",1),_A(yt,ft.lines,ft.titleColor,n,ft.headerH+6+Ct+Ac,ft.bulletColors,ft.bulletMeta))}for(let ft of O){if(ft.kind==="era"){let _t=ft.color,yt=Math.max(16,ft.spanHalf),St=rt-20,Ct=ut+20,ht=Math.max(St,ft.x-yt),Pt=Math.min(Ct,ft.x+yt),Dt=gt(ft),qt=lt.append("g").attr("class","dgmo-event-era").attr("data-era",ft.era.name).attr("data-era-collapsed","true").attr("data-line-number",ft.lineNumber);if(o){let Ft=Math.min(Dt,Z)-4,Xt=Math.max(Dt,Z)+8;qt.append("rect").attr("x",ht).attr("y",Ft).attr("width",Pt-ht).attr("height",Xt-Ft).attr("fill","transparent").attr("pointer-events","all")}qt.append("path").attr("d",`M${ht},${Z} L${ht},${Dt} L${Pt},${Dt} L${Pt},${Z}`).attr("fill","none").attr("stroke",_t).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round");let Wt=(ht+Pt)/2;qt.append("line").attr("x1",Wt-u0/2).attr("y1",Z).attr("x2",Wt+u0/2).attr("y2",Z).attr("stroke",n.bg).attr("stroke-width",5).attr("stroke-linecap","butt");for(let Ft of grt(Wt,Z))qt.append("path").attr("d",Ft).attr("fill","none").attr("stroke",n.text).attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round");if(o){let Ft=ft.lineNumber;qt.style("cursor","pointer").on("click",()=>o(Ft))}continue}let kt=lt.append("circle").attr("class","dgmo-event-dot").attr("cx",ft.x).attr("cy",Z).attr("r",ix).attr("fill",ft.future?n.bg:ft.color).attr("stroke",ft.future?ft.color:n.bg).attr("stroke-width",2).attr("data-line-number",ft.lineNumber);dx(kt,ft)}if(R){let ft=[],kt=null;for(let Ct of O){let ht=Ct.eraName;if(ht&&v.has(ht)){if(kt===ht&&ft.length>0){let Pt=ft[ft.length-1];Pt.firstX=Math.min(Pt.firstX,Ct.x),Pt.lastX=Math.max(Pt.lastX,Ct.x)}else ft.push({era:v.get(ht),collapsed:Ct.kind==="era",firstX:Ct.x,lastX:Ct.x});kt=ht}else kt=null}let _t=Ct=>Math.max(4,Math.min(F-4,Ct)),yt=S==="above"?1:-1,St=ft.filter(Ct=>!Ct.collapsed).map(Ct=>({run:Ct,x0:_t(Ct.firstX-vA),x1:_t(Ct.lastX+vA)})).sort((Ct,ht)=>Ct.run.firstX-ht.run.firstX);for(let Ct=1;Ct<St.length;Ct++){let ht=St[Ct-1],Pt=St[Ct];if(ht.x1<=Pt.x0)continue;let Dt=(ht.run.lastX+Pt.run.firstX)/2;ht.x1=Math.max(ht.run.lastX,Math.min(ht.x1,Dt-LA)),Pt.x0=Math.min(Pt.run.firstX,Math.max(Pt.x0,Dt+LA))}for(let{run:Ct,x0:ht,x1:Pt}of St){let Dt=!Ct.era.color,qt=Dt?n.text:Re(Ct.era.color,n)??n.text,Wt=Dt?.5:.85,Ft=ot,Xt=lt.append("g").attr("class","dgmo-event-era").attr("data-era",Ct.era.name).attr("data-era-collapsed",String(Ct.collapsed)).attr("data-line-number",Ct.era.lineNumber);if(Xt.append("path").attr("d",`M${ht},${Ft+MA*yt} L${ht},${Ft} L${Pt},${Ft} L${Pt},${Ft+MA*yt}`).attr("fill","none").attr("stroke",qt).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",Wt),Xt.append("text").attr("x",(Ct.firstX+Ct.lastX)/2).attr("y",S==="above"?Ft-6:Ft+NA+4).attr("text-anchor","middle").attr("font-family",Mt).attr("font-size",NA).attr("font-weight",700).attr("fill",qt).attr("fill-opacity",Dt?.85:1).text(Ct.era.name),o){let zt=Ct.era.lineNumber;Xt.style("cursor","pointer").on("click",()=>o(zt))}}}if(e.now&&P){let ft=e.now.dateValue,kt=e.now.date;if(e.now.computed){let Ct=s??new Date,ht=`${Ct.getFullYear()}-${String(Ct.getMonth()+1).padStart(2,"0")}-${String(Ct.getDate()).padStart(2,"0")}`;kt=ht;let Pt=En(ht);ft=Number.isFinite(Pt)?Pt:null}let _t=O.filter(Ct=>Ct.kind!=="era"&&!Ct.future&&Ct.dateValue!==null).sort((Ct,ht)=>Ct.dateValue-ht.dateValue),yt=ft===null?null:hrt(ft,_t),St=_t[_t.length-1];if(yt!==null&&ft!==null&&St&&ft>St.dateValue){let Ct=O.filter(ht=>ht.future&&!ht.futureSpan).map(ht=>ht.x);Ct.length&&(yt=Math.min(...Ct))}if(yt!==null){let Ct=Ie(n,r),ht=n.destructive,Pt=e.options.fillMode,Dt=ee(n,ht,r,{mode:Pt}),qt=Pt==="solid"?"none":Pt==="outline"?ht:vt(ht,Ct,55),Wt=Pt==="solid"?0:Pt==="outline"?1.3:1,Ft=Pt==="solid"?pe(Dt,n.textOnFillLight,n.textOnFillDark):ht,Xt=e.now.label??(kt?zi(kt):"now"),zt=18,xt=Math.max(28,Xt.length*6.6+16),$t=6,Zt=xt/2+4,re=yt-Zt,Ot=yt+Zt,Ut=mt.map(Te=>({side:Te.p.side,top:Te.top,bot:Te.top+Te.p.cardH,left:Te.p.left,right:Te.p.left+fo})),oe=Te=>Te.left<Ot&&Te.right>re,Ee=[],de=Te=>{let dn=Te-zt;dn>C+1&&Ee.push({y0:dn,y1:Te,stem:Z-Te})},jt=Te=>{let dn=Te+zt;dn<Q-1&&Ee.push({y0:Te,y1:dn,stem:Te-Z})};de(Z-rx/2+zt/2),jt(Z+ox/2-zt/2);for(let Te of Ut)oe(Te)&&(Te.side==="above"?de(Te.top-$t):jt(Te.bot+$t));let te=Te=>!Ut.some(dn=>oe(dn)&&dn.bot>Te.y0&&dn.top<Te.y1),fe=(Te,dn)=>Te.stem-dn.stem,Me=Ee.filter(te).sort(fe)[0]??Ee.sort(fe)[0]??{y0:Z-$t-zt,y1:Z-$t,stem:$t+zt},_e=Me.y1<=Z,Ne=_e?Z-ix:Z+ix,Ue=_e?Me.y1:Me.y0,en=Math.max(xt/2+2,Math.min(yt,F-xt/2-2)),An=lt.append("g").attr("class","evt-now").attr("data-now-x",yt.toFixed(2)),cn=Math.min(rx,ox),se=Z-cn,ae=Z+cn,he=`evt-now-fade-${yt.toFixed(0)}`,ze=An.append("defs").append("linearGradient").attr("id",he).attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",se).attr("x2",0).attr("y2",ae);if(ze.append("stop").attr("offset","0%").attr("stop-color",ht).attr("stop-opacity",0),ze.append("stop").attr("offset","50%").attr("stop-color",ht).attr("stop-opacity",.9),ze.append("stop").attr("offset","100%").attr("stop-color",ht).attr("stop-opacity",0),An.append("line").attr("x1",yt).attr("y1",se).attr("x2",yt).attr("y2",ae).attr("stroke",`url(#${he})`).attr("stroke-width",1.6).attr("stroke-dasharray","1 4").attr("stroke-linecap","round"),An.append("path").attr("d",`M${yt} ${Z-5} l5 5 l-5 5 l-5 -5 z`).attr("fill",ht),An.append("line").attr("x1",yt).attr("y1",Ne).attr("x2",yt).attr("y2",Ue).attr("stroke",ht).attr("stroke-width",1.6),An.append("rect").attr("x",en-xt/2).attr("y",Me.y0).attr("width",xt).attr("height",zt).attr("rx",zt/2).attr("fill",Dt).attr("stroke",qt).attr("stroke-width",Wt),An.append("text").attr("x",en).attr("y",Me.y0+zt/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",Mt).attr("font-size",10.5).attr("font-weight",600).attr("fill",Ft).text(Xt),!d){let Te=An.append("line").attr("class","evt-now-rule-full").attr("x1",yt).attr("y1",Math.max(C,2)).attr("x2",yt).attr("y2",Q-2).attr("stroke",ht).attr("stroke-width",1.4).attr("stroke-dasharray","1 4").attr("stroke-linecap","round").attr("opacity",0).style("transition","opacity 120ms ease").style("pointer-events","none");Te.lower();let dn=An.node();dn&&(dn.addEventListener("mouseenter",()=>Te.attr("opacity",.5)),dn.addEventListener("mouseleave",()=>Te.attr("opacity",0)))}}}if(!d){let ft=lt.node();mrt(ft),ft&&(frt(t,ft,()=>mx(t,e,n,r,o,a,i,s)),crt(t,ft))}}function dx(t,e){if(t.attr("data-evt",e.lineNumber),e.eraName&&t.attr("data-evt-era",e.eraName),e.event)for(let[n,r]of Object.entries(e.event.metadata))t.attr(`data-tag-${n.toLowerCase()}`,String(r).toLowerCase())}function art(t){t.querySelectorAll(`.${Dl},.${Rc},.${f0}`).forEach(e=>e.classList.remove(Dl,Rc,f0))}function fu(t,e){if(art(t),!e)return;let n=[...t.querySelectorAll(ort)];if(e.kind==="event"){let l=c=>c.getAttribute("data-evt")===e.id;if(!n.some(l))return;n.forEach(c=>c.classList.add(l(c)?Dl:Rc));return}if(e.kind==="era"){let l=c=>c.getAttribute("data-evt-era")===e.name||c.classList.contains("dgmo-event-era")&&c.getAttribute("data-era")===e.name;if(!n.some(l))return;n.forEach(c=>{l(c)?c.classList.contains("dgmo-event-era")&&c.classList.add(f0):c.classList.add(Rc)});return}let r=`data-tag-${e.group}`,o=l=>l.getAttribute(r)===e.value,a=[...t.querySelectorAll(".dgmo-evt-bullet")],i=new Set;for(let l of a){if(!o(l))continue;let c=l.closest(".dgmo-event-card"),d=c?.getAttribute("data-era")??c?.getAttribute("data-evt-era");d&&i.add(d)}if(!n.some(o)&&i.size===0)return;let s=l=>{let c=l.getAttribute("data-era")??l.getAttribute("data-evt-era");return!!c&&i.has(c)};n.forEach(l=>{!o(l)&&!s(l)&&l.classList.add(Rc)});for(let l of a)o(l)||l.classList.add(Rc)}function d0(t){let e=t.getAttribute(ux);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function irt(t){t.removeAttribute(fx)}function IA(t,e){let n=t.querySelector("svg");n&&(e?n.setAttribute(ux,JSON.stringify(e)):n.removeAttribute(ux),fu(n,e))}function px(t){let e=t.getAttribute(fx);if(!e)return new Set;try{return new Set(JSON.parse(e))}catch{return new Set}}function srt(t){t.selectAll("[data-legend-entry]").each(function(){let r;try{r=this.getBBox()}catch{return}!r.width||!r.height||It(this).insert("rect",":first-child").attr("x",r.x-6).attr("y",r.y-7).attr("width",r.width+12).attr("height",r.height+14).attr("fill","transparent").attr("data-legend-hit","")})}function lrt(t,e){if(e.size===0)return!1;for(let[n,r]of Object.entries(t))if(e.has(`${n.toLowerCase()}:${String(r).toLowerCase()}`))return!0;return!1}function crt(t,e){let n=px(t),r=o=>{for(let a of n){let i=a.indexOf(":");if(i<0)continue;let s=a.slice(0,i),l=a.slice(i+1);if(o.getAttribute(`data-tag-${s}`)===l)return!0}return!1};e.querySelectorAll(".dgmo-event-card,.dgmo-event-leader").forEach(o=>o.classList.toggle(W1,r(o))),e.querySelectorAll("[data-legend-entry]").forEach(o=>{let a=o.closest("[data-legend-group]")?.getAttribute("data-legend-group"),i=o.getAttribute("data-legend-entry");drt(o,!!a&&n.has(`${a}:${i}`))})}function drt(t,e){t.classList.toggle(RA,e);let n=t.querySelector("circle");if(n)if(e)n.hasAttribute("data-fill0")||n.setAttribute("data-fill0",n.getAttribute("fill")??""),n.setAttribute("fill","none"),n.setAttribute("stroke",n.getAttribute("data-fill0")||"currentColor"),n.setAttribute("stroke-width","1.5");else{let r=n.getAttribute("data-fill0");r!==null&&n.setAttribute("fill",r),n.removeAttribute("stroke"),n.removeAttribute("stroke-width")}}function urt(t,e,n){let r=px(t),o=`${e}:${n}`;r.has(o)?r.delete(o):r.add(o),t.setAttribute(fx,JSON.stringify([...r]))}function frt(t,e,n){e.addEventListener("click",r=>{let o=r.target;if(!o||typeof o.closest!="function")return;let a=o.closest("[data-legend-entry]");if(!a)return;let i=a.getAttribute("data-legend-entry"),s=a.closest("[data-legend-group]")?.getAttribute("data-legend-group");if(!s||!i)return;urt(t,s,i);let l=d0(e);n(),l&&IA(t,l),typeof CustomEvent<"u"&&t.dispatchEvent(new CustomEvent("dgmo-event-line-rerender"))})}function mrt(t){t&&(t.addEventListener("mouseover",e=>{let n=e.target;if(!n||typeof n.closest!="function")return;let r=n.closest("[data-legend-entry]");if(r){let i=r.getAttribute("data-legend-entry"),s=r.closest("[data-legend-group]")?.getAttribute("data-legend-group");fu(t,s&&i?{kind:"tag",group:s,value:i}:d0(t));return}let o=n.closest(".dgmo-event-era");if(o){fu(t,{kind:"era",name:o.getAttribute("data-era")??""});return}let a=n.closest("[data-evt]");if(a){let i=a.getAttribute("data-era");fu(t,i?{kind:"era",name:i}:{kind:"event",id:a.getAttribute("data-evt")??""});return}fu(t,d0(t))}),t.addEventListener("mouseout",e=>{let n=e.relatedTarget;(!n||!t.contains(n))&&fu(t,d0(t))}))}function prt(t,e,n,r,o,a,i){mx(t,e,n,r,void 0,o,a,i)}function hrt(t,e){if(!e.length)return null;let n=e[0],r=e[e.length-1];if(t<=n.dateValue)return n.x;if(t>=r.dateValue)return r.x;for(let o=0;o<e.length-1;o++){let a=e[o],i=e[o+1];if(t>=a.dateValue&&t<=i.dateValue){let s=i.dateValue-a.dateValue;return s<=0?a.x:a.x+(t-a.dateValue)/s*(i.x-a.x)}}return r.x}function grt(t,e){let o=a=>{let i="";for(let s=0;s<=48;s++){let l=s/48,c=e-CA+l*2*CA,d=a+ert*Math.sin(l*Math.PI*2);i+=`${s===0?"M":"L"}${d.toFixed(2)},${c.toFixed(2)}`,s<48&&(i+=" ")}return i};return[o(t-u0/2),o(t+u0/2)]}function TA(t,e){return Wo([...t],e)}function _A(t,e,n,r,o=Xnt+Ac,a=[],i=[]){let s=o,l=0,c=n,d=null,u=f=>{if(d){f.attr("class","dgmo-evt-bullet");for(let[m,p]of Object.entries(d))f.attr(`data-tag-${m.toLowerCase()}`,String(p).toLowerCase())}};for(let f of e){let m=f.kind==="bullet-first"||f.kind==="bullet-cont",p=Pl+(m?12:0);if(f.kind==="bullet-first"){c=a[l]??n,d=i[l]??null,l++;let g=t.append("text").attr("x",Pl).attr("y",s).attr("text-anchor","start").attr("fill",c).attr("font-family",Mt).attr("font-size",Ac).attr("font-weight",700).text("\u2022");u(g)}else m||(c=n,d=null);let h=t.append("text").attr("x",p).attr("y",s).attr("text-anchor","start").attr("fill",m?c:n).attr("font-family",Mt).attr("font-size",Ac);m&&u(h),pn(h,f.text,r),s+=AA}}var fo,l0,Vnt,Unt,rx,ox,Ac,AA,Pl,Xnt,ax,jnt,ix,Knt,Znt,Qnt,sx,lx,EA,c0,Jnt,trt,kA,cx,SA,MA,vA,LA,CA,ert,u0,nrt,NA,Dl,Rc,f0,W1,RA,fx,rrt,ort,ux,DA=dt(()=>{"use strict";Nn();Ke();Fe();rr();F1();co();Ve();Ts();Mr();qr();ko();I4();Pf();Oe();fo=210,l0=58,Vnt=48,Unt=34,rx=46,ox=46,Ac=11.5,AA=16,Pl=9,Xnt=34,ax=16,jnt=(fo-Pl*2)*.93,ix=5.5,Knt=96,Znt=16,Qnt="#999999",sx=18,lx=6,EA=15,c0=10,Jnt=13,trt=4,kA="spine",cx=2,SA=30,MA=8,vA=14,LA=3,CA=6,ert=2.6,u0=5,nrt=13,NA=11.5,Dl="dgmo-evt-hl",Rc="dgmo-evt-dim",f0="dgmo-evt-era-hl",W1="dgmo-evt-collapsed",RA="dgmo-evt-off",fx="data-evt-hidden",rrt=`.dgmo-event-dot{transition:transform .12s ease;transform-box:fill-box;transform-origin:center}.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era{transition:opacity .12s ease,filter .12s ease}.dgmo-event-dot,.dgmo-event-card,.dgmo-event-era{cursor:default}[data-legend-entry]{cursor:pointer}.${Rc}{opacity:.2}.dgmo-event-dot.${Dl}{transform:scale(1.55)}.dgmo-event-leader.${Dl}{stroke-opacity:1;stroke-width:2.5}.dgmo-event-card.${Dl}{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}.dgmo-event-era.${f0}{filter:drop-shadow(0 1px 2px rgba(0,0,0,.28))}.dgmo-event-card.${W1},.dgmo-event-leader.${W1}{opacity:0;pointer-events:none}.dgmo-event-card.${W1}.${Dl},.dgmo-event-leader.${W1}.${Dl}{opacity:1;pointer-events:auto}[data-legend-entry].${RA} text{opacity:.5}`;ort=".dgmo-event-dot,.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era",ux="data-evt-pin"});var zA={};ue(zA,{renderBody:()=>WA,renderBodyForExport:()=>krt});function $A(t){let e=t.match(/[Mm]\s*(-?[\d.]+)/);return e?parseFloat(e[1]):0}function HA(t){return(t.side?`${t.side} `:"")+t.name.toLowerCase()}function FA(t){return t.side?`${t.side} ${t.name}`:t.name}function xrt(t,e,n){let r=n==="front"?e==="left":e==="right";return t.reduce((o,a)=>r?a.x>o.x?a:o:a.x<o.x?a:o)}function wrt(t,e,n,r,o,a,i,s,l,c){let[d,u,f,m]=t.viewBox.split(" ").map(Number),p=vt(i.bg,i.border,.7),h=i.bg,g=i.textMuted,x=`body-skin-${d}-${u}`;c.push({id:x,stops:[{offset:"0",color:vt(i.surface,i.bg,.4)},{offset:"1",color:vt(i.border,i.bg,.3)}]});let y="";if(a==="skin"){y+=`<path d="${t.outline}" fill="url(#${x})"/>`;for(let C of t.headPaths)y+=`<path d="${C}" fill="url(#${x})" stroke="${g}" stroke-width="2.5"/>`;let k=vt(i.text,i.bg,.6);for(let C of t.hairPaths)y+=`<path d="${C}" fill="${k}" stroke="${g}" stroke-width="1.5"/>`}else{y+=`<path d="${t.outline}" fill="url(#${x})"/>`;for(let k of t.base)y+=`<path d="${k}" fill="${p}" fill-opacity="0.55" stroke="${h}" stroke-width="1"/>`;for(let k of t.headPaths)y+=`<path d="${k}" fill="url(#${x})" stroke="${g}" stroke-width="2.5"/>`;for(let k of t.hairPaths)y+=`<path d="${k}" fill="none" stroke="${g}" stroke-width="2.5"/>`}let b=new Map,w=d+f/2;for(let k of n){let C=O1(t,k.name);if(!C)continue;let v=E_(t,C),_=r(k),R=o(k).toLowerCase(),L=` class="dgmo-body-part" data-line-number="${k.lineNumber}" data-emph-key="${Pc(R)}"`,E=v.paths;if(k.side){let T=e==="front"?k.side==="left":k.side==="right",N=v.paths.filter(I=>T?$A(I)>=w:$A(I)<w);N.length&&(E=N)}if(l==="solid")for(let T of E)y+=`<path${L} d="${T}" fill="${_}" stroke="${_}" stroke-width="1.5"/>`;else if(l==="outline"){let T=Ie(i,s);for(let N of E)y+=`<path${L} d="${N}" fill="${T}" stroke="${_}" stroke-width="2.5"/>`}else if(a==="skin")for(let T of E)y+=`<path${L} d="${T}" fill="${_}" fill-opacity="0.5" stroke="${_}" stroke-width="1.5"/>`;else{let T=vt(_,Ie(i,s),25);for(let N of E)y+=`<path${L} d="${N}" fill="${T}" stroke="${_}" stroke-width="1.5"/>`}let M=v.centers?.length?v.centers.map(T=>({x:T.x,y:T.y})):[{x:v.anchor.x,y:v.anchor.y}],S=k.side&&M.length>1?xrt(M,k.side,e):null;b.set(HA(k),{x:S?.x??v.anchor.x,y:S?.y??v.anchor.y,centers:S?[S]:M,color:_,emph:R,part:k})}return y+=`<path d="${t.outline}" fill="none" stroke="${g}" stroke-width="2.5"/>`,{fig:t,body:y,anchors:b,vx:d,vy:u,vw:f,vh:m}}function gx(t,e){let n=t.centers[0]??{x:t.x,y:t.y},r=Math.abs(n.x-e);for(let o of t.centers){let a=Math.abs(o.x-e);a<r&&(r=a,n=o)}return n}function Ert(t,e){let{vx:n,vw:r,vh:o}=t,a=n+r/2,i=[...t.anchors.values()],s=r*.1,l=i.filter(m=>m.x<a-s),c=i.filter(m=>m.x>a+s),d=i.filter(m=>m.x>=a-s&&m.x<=a+s).sort((m,p)=>m.y-p.y);for(let m of d)(l.length<=c.length?l:c).push(m);let u="",f=(m,p)=>{let h=p==="L"?n-14:n+r+14,g=p==="L"?h+26:h-26,x=p==="L"?"end":"start",y=o*.05,b=m.map(k=>({a:k,tgt:gx(k,h)})).sort((k,C)=>k.tgt.y-C.tgt.y),w=-1e9;for(let{a:k,tgt:C}of b){let v=Math.max(C.y,w+y);w=v;let _=k.part.notes.length?k.part.notes[0]:"",R=` class="dgmo-body-part" data-line-number="${k.part.lineNumber}" data-emph-key="${Pc(k.emph)}"`;u+=`<path${R} d="M${g} ${v} L${C.x} ${C.y}" stroke="${k.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${R} cx="${C.x}" cy="${C.y}" r="5.5" fill="${k.color}" stroke="${e.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/><text${R} x="${h}" y="${v+(_?-2:7)}" text-anchor="${x}" font-size="${qA}" font-weight="700" fill="${e.text}">${Pc(FA(k.part))}</text>`,_&&(u+=`<text${R} x="${h}" y="${v+22}" text-anchor="${x}" font-size="${BA}" fill="${e.textMuted}">${Pc(_)}</text>`)}};return f(l,"L"),f(c,"R"),u}function WA(t,e,n,r,o,a,i){let s=Bn(n)[0],l=mr(e.tagGroups,void 0,i),c=k=>Dn(k.metadata,e.tagGroups,l)??s,d=k=>l?k.metadata[Bt(l)]??"":"",u=[],f=e.options.views.map(k=>wrt(D1(e.options.sex,k),k,e.parts,c,d,e.options.form,n,r,e.options.fillMode,u)),m=Math.max(...f.map(k=>k.fig.contentBox.h)),p="",h;if(f.length===1){let k=f[0],C=k.vw*.42,v=pu+C-k.vx,_=m0-k.vy;p=`<g transform="translate(${v.toFixed(2)} ${_.toFixed(2)})">${k.body}${Ert(k,n)}</g>`,h=pu*2+C*2+k.vw}else{let k=f[0],C=f[1],v=k.fig.contentBox,_=C.fig.contentBox,R=m/v.h,L=m/_.h,E=pu,M=pu+v.w*R+hx,S=E-v.x*R,T=M-_.x*L,N=m0-v.y*R,I=m0-_.y*L;p+=`<g transform="translate(${S.toFixed(2)} ${N.toFixed(2)}) scale(${R.toFixed(4)})">${k.body}</g>`,p+=`<g transform="translate(${T.toFixed(2)} ${I.toFixed(2)}) scale(${L.toFixed(4)})">${C.body}</g>`,h=pu*2+v.w*R+hx+_.w*L;let G=pu+v.w*R+hx/2,$=q=>({x:S+q.x*R,y:N+q.y*R}),A=q=>({x:T+q.x*L,y:I+q.y*L}),D=new Set,O=[];for(let q of e.parts){let V=HA(q);if(D.has(V))continue;let X=k.anchors.get(V),z=C.anchors.get(V);if(!X&&!z)continue;D.add(V);let U=X?$(gx(X,k.vx+k.vw)):void 0,Y=z?A(gx(z,C.vx)):void 0,K=[U?.y,Y?.y].filter(et=>et!=null);O.push({name:FA(q),note:q.notes.length?q.notes[0]:"",color:(X??z).color,emph:(X??z).emph,line:q.lineNumber,...U&&{left:U},...Y&&{right:Y},y:K.reduce((et,nt)=>et+nt,0)/K.length})}O.sort((q,V)=>q.y-V.y);let P=m*.052,H=-1e9;for(let q of O)q.y=Math.max(q.y,H+P),H=q.y;let W="",B=96;for(let q of O){let V=` class="dgmo-body-part" data-line-number="${q.line}" data-emph-key="${Pc(q.emph)}"`;q.left&&(W+=`<path${V} d="M${(G-B).toFixed(1)} ${q.y.toFixed(1)} L${q.left.x.toFixed(1)} ${q.left.y.toFixed(1)}" stroke="${q.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${V} cx="${q.left.x.toFixed(1)}" cy="${q.left.y.toFixed(1)}" r="5.5" fill="${q.color}" stroke="${n.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/>`),q.right&&(W+=`<path${V} d="M${(G+B).toFixed(1)} ${q.y.toFixed(1)} L${q.right.x.toFixed(1)} ${q.right.y.toFixed(1)}" stroke="${q.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${V} cx="${q.right.x.toFixed(1)}" cy="${q.right.y.toFixed(1)}" r="5.5" fill="${q.color}" stroke="${n.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/>`),W+=`<text${V} x="${G}" y="${(q.y-3).toFixed(1)}" text-anchor="middle" font-size="${qA}" font-weight="700" fill="${n.text}">${Pc(q.name)}</text>`,q.note&&(W+=`<text${V} x="${G}" y="${(q.y+20).toFixed(1)}" text-anchor="middle" font-size="${BA}" fill="${n.textMuted}">${Pc(q.note)}</text>`)}p+=W}let g=m0+m+brt,x=!!a;It(t).selectAll("svg").remove();let y=a?.width??t.clientWidth??1200,b=a?.height??t.clientHeight??800,w=It(t).append("svg").attr("width",y).attr("height",b).attr("viewBox",`${-p0} ${-p0} ${(h+2*p0).toFixed(0)} ${(g+2*p0).toFixed(0)}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(u.length){let k=w.append("defs");for(let C of u){let v=k.append("linearGradient").attr("id",C.id).attr("x1","0").attr("y1","0").attr("x2","0").attr("y2","1");for(let _ of C.stops)v.append("stop").attr("offset",_.offset).attr("stop-color",_.color)}}if(w.append("g").html(p),e.title&&!e.options.noTitle&&w.append("text").attr("x",h/2).attr("y",40).attr("text-anchor","middle").attr("font-size",34).attr("font-weight",700).attr("fill",n.text).text(e.title),!e.options.noLegend&&e.tagGroups.length){let k=w.append("g").attr("transform",`translate(0, ${GA}) scale(${OA})`),C=e.tagGroups.map(v=>({name:v.name,entries:v.entries.map(_=>({value:_.value,color:Re(_.color,n)??_.color}))}));tn(k,{groups:C,palette:n,isDark:r,width:h/OA,mode:x?"export":"preview",activeGroup:l})}}function krt(t,e,n,r,o,a){WA(t,e,n,r,void 0,o,a)}var Pc,GA,OA,yrt,m0,brt,p0,pu,hx,qA,BA,YA=dt(()=>{"use strict";Nn();Fe();rr();Ke();Oe();Mr();q6();Pc=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),GA=60,OA=2.4,yrt=76,m0=GA+yrt,brt=40,p0=160,pu=30,hx=420,qA=23,BA=17});var ZA={};ue(ZA,{renderVersionControl:()=>KA,renderVersionControlForExport:()=>_rt});function Crt(t,e){return t.length>e?t.slice(0,e-1)+"\u2026":t}function xx(t,e,n,r,o,a,i){let s=Math.hypot(n-t,r-e),l=Math.hypot(o-n,a-r),c=Math.max(2,Math.min(i,s-1,l-1)),d=(n-t)/(s||1),u=(r-e)/(s||1),f=(o-n)/(l||1),m=(a-r)/(l||1);return`M${t},${e} L${n-d*c},${r-u*c} Q${n},${r} ${n+f*c},${r+m*c} L${o},${a}`}function KA(t,e,n,r,o,a){if(e.nodes.length===0)return;It(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.nodes,s=e.options.direction!=="LR",l=new Map(e.branches.map(B=>[B.name,B])),c=Bn(n),d=B=>B.colorToken?Re(B.colorToken,n)??c[B.lane%c.length]:c[B.lane%c.length],u=B=>d(l.get(B.branch)),f=B=>i[B],m=B=>B.kind==="cherry"?"\u21E0 ":B.kind==="merge"?"\u21F2 ":"",p=new Map;for(let B of i){let q=B.id,V=m(B)+Crt(B.message||"(empty)",26),X=(q?q.length*6.6+8:0)+V.length*6.9+8;p.set(B.key,{sha:q,msg:V,lw:X})}let h=Math.max(0,...[...p.values()].map(B=>B.lw)),g=new Map,x=(B,q)=>{g.has(B)||g.set(B,[]),g.get(B).push(q)};if(!e.options.noLabels)for(let B of i)B.tag&&x(B.key,{kind:"tag",label:B.tag,w:B.tag.length*6.6+16});for(let B of e.refs)B.atKey!=null&&(B.head?x(B.atKey,{kind:"head",label:"HEAD",w:46}):x(B.atKey,{kind:"ref",label:B.name,remote:B.remote,w:B.name.length*6.2+18}));for(let B of e.notes)B.anchorKey!=null&&x(B.anchorKey,{kind:"note",label:jA[B.num-1]??`#${B.num}`,w:19});let y=Math.max(0,...[...g.values()].map(B=>B.length)),b=e.branches.length,w=i.length,k=new Map,C=[],v,_,R,L,E=0;if(s){R=24;let B=R+32,q=52,V=96;L=78;for(let z of i)k.set(z.key,{x:L+z.lane*V,y:B+z.seq*q});let X=L+(b-1)*V+28;for(let z of i){let U=k.get(z.key);C.push({node:z,kind:"msg",x:X,y:U.y,anchor:"start",leader:{x1:U.x+Ko+2,y1:U.y,x2:X-6,y2:U.y}}),(g.get(z.key)??[]).forEach((K,et)=>C.push({node:z,kind:K.kind,label:K.label,remote:K.remote,w:K.w,x:U.x-Ko-12-K.w/2-et*4,y:U.y,anchor:"middle"}))}v=X+h+16,_=B+(w-1)*q+22}else{R=14;let B=R+20,q=88,V=50;L=16+y*VA+14;for(let nt of i)k.set(nt.key,{x:B+nt.seq*q,y:L+nt.lane*V});let z=L+(b-1)*V+Lrt,U=6,Y=[],K=[...i].sort((nt,J)=>k.get(nt.key).x-k.get(J.key).x);for(let nt of K){let J=k.get(nt.key),F=p.get(nt.key).lw+wx*2,j=J.x-F/2,Q=Y.length;for(let at=0;at<Y.length;at++)if(Y[at]+U<=j){Q=at;break}let Z=z+Q*(z1+XA);Y[Q]=j+F,C.push({node:nt,kind:"msg",x:J.x,y:Z,anchor:"start",shelfLeft:Math.max(4,j),shelfTop:Z,shelfW:F,leader:{x1:J.x,y1:J.y+Ko,x2:J.x,y2:Z}}),(g.get(nt.key)??[]).forEach((at,lt)=>C.push({node:nt,kind:at.kind,label:at.label,remote:at.remote,w:at.w,x:J.x,y:J.y-Ko-12-lt*VA,anchor:"middle"}))}let et=Y.length;for(let nt of e.branches){if(!nt.ab||nt.ab.ahead+nt.ab.behind===0||nt.tip==null)continue;let J=k.get(nt.tip);C.push({node:f(nt.tip),kind:"ab",label:Nrt(nt.ab),x:J.x+Ko+10,y:J.y,anchor:"start"})}v=Math.max(B+(w-1)*q+Ko+40,...[...k.entries()].map(([nt,J])=>J.x+p.get(nt).lw/2+wx+8))+8,_=z+et*(z1+XA)+8,e.notes.length&&(E=_+4,_+=8+e.notes.length*16+8)}let M=!!e.title,S=M?Srt:0,T=v,N=_+S,I=!!a,G=I?0:t.clientWidth||0,$=I?0:t.clientHeight||0,A=Math.round(Math.max(T,G)),D=Math.round(Math.max(N,$)),O=I?A:G||A,P=I?D:$||D,H=It(t).append("svg").attr("width",O).attr("height",P).attr("viewBox",`0 0 ${A} ${D}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(H.append("rect").attr("width",A).attr("height",D).attr("fill",n.bg),M){let B=H.append("text").attr("class","chart-title").attr("x",A/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",Mt).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber&&!I){let q=e.titleLineNumber;B.style("cursor","pointer").on("click",()=>o(q))}}let W=H.append("g").attr("transform",`translate(0, ${S})`);Trt(W,e,n,s,k,C,p,u,f,L,E,o&&!I?o:void 0)}function Nrt(t){let e=[];return t.ahead&&e.push("\u2191"+t.ahead),t.behind&&e.push("\u2193"+t.behind),e.join(" ")}function Trt(t,e,n,r,o,a,i,s,l,c,d,u){let f=e.nodes,m=w=>o.get(w),p=(w,k)=>r?{x:m(k.key).x,y:m(w.key).y}:{x:m(w.key).x,y:m(k.key).y},h=(w,k)=>r?{x:m(w.key).x,y:m(k.key).y}:{x:m(k.key).x,y:m(w.key).y},g=w=>w.ghost?.32:1,x=(w,k,C,v)=>{let _=m(w.key),R=m(k.key),L=h(w,k);if(t.append("path").attr("d",xx(_.x,_.y,L.x,L.y,R.x,R.y,bx)).attr("fill","none").attr("stroke",C).attr("stroke-width",2).attr("stroke-dasharray","2 4").attr("opacity",.8),v){let E=R.x-L.x,M=R.y-L.y,S=Math.hypot(E,M)||1,T=E/S,N=M/S,I=-N,G=T,$=4;t.append("path").attr("d",`M${R.x},${R.y} L${R.x-T*$*2+I*$},${R.y-N*$*2+G*$} L${R.x-T*$*2-I*$},${R.y-N*$*2-G*$} Z`).attr("fill",C).attr("opacity",.8)}};for(let w of f){let k=s(w),C=g(w),v=m(w.key);if(w.prev!=null){let _=m(w.prev),R=t.append("line").attr("x1",_.x).attr("y1",_.y).attr("x2",v.x).attr("y2",v.y).attr("stroke",k).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",w.branch).attr("opacity",C);w.ghost&&R.attr("stroke-dasharray","5 5")}if(w.parent!=null){let _=l(w.parent),R=p(_,w),L=m(_.key),E=t.append("path").attr("d",xx(L.x,L.y,R.x,R.y,v.x,v.y,bx)).attr("fill","none").attr("stroke",k).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",w.branch).attr("opacity",C);w.ghost&&E.attr("stroke-dasharray","5 5")}if(w.mergeFrom!=null){let _=l(w.mergeFrom),R=h(_,w),L=m(_.key);t.append("path").attr("d",xx(L.x,L.y,R.x,R.y,v.x,v.y,bx)).attr("fill","none").attr("stroke",s(_)).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",_.branch).attr("opacity",.92*C)}w.cherryFrom!=null&&x(l(w.cherryFrom),w,s(l(w.cherryFrom)),!1),w.revertFrom!=null&&x(l(w.revertFrom),w,k,!1),w.squashFrom!=null&&x(l(w.squashFrom),w,n.textMuted,!0),w.movedTo!=null&&x(w,l(w.movedTo),n.textMuted,!0)}if(!e.options.noLanes)for(let w of e.branches){let k=null;for(let _ of f)_.branch===w.name&&(k===null||_.seq<k.seq)&&(k=_);if(!k)continue;let C=m(k.key),v=s(k);r?t.append("text").attr("x",C.x).attr("y",14).attr("text-anchor","middle").attr("font-size",12.5).attr("font-weight",800).attr("fill",v).text(w.name):t.append("text").attr("x",C.x-Ko-1).attr("y",C.y-Ko-7).attr("text-anchor","start").attr("font-size",12.5).attr("font-weight",800).attr("fill",v).attr("data-branch",w.name).text(w.name)}for(let w of f){let k=s(w),C=m(w.key),v=_=>{_.attr("data-line-number",w.lineNumber),_.attr("data-branch",w.branch),u&&_.style("cursor","pointer").on("click",()=>u(w.lineNumber))};if(w.ghost){v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko-1).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",2).attr("opacity",.4));continue}w.type==="highlight"?v(t.append("rect").attr("x",C.x-Ko).attr("y",C.y-Ko).attr("width",Ko*2).attr("height",Ko*2).attr("rx",3.5).attr("fill",k).attr("stroke",n.bg).attr("stroke-width",3)):w.type==="reverse"?(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",3),v(t.append("path").attr("d",`M${C.x-3.6},${C.y-3.6} L${C.x+3.6},${C.y+3.6} M${C.x+3.6},${C.y-3.6} L${C.x-3.6},${C.y+3.6}`).attr("stroke",k).attr("stroke-width",2).attr("stroke-linecap","round").attr("fill","none"))):w.kind==="merge"?(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",3),v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",3).attr("fill",k))):v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",k).attr("stroke",n.bg).attr("stroke-width",3))}let y=(w,k,C,v,_,R,L,E,M=700)=>{let S=t.append("rect").attr("x",w-C/2).attr("y",k-8.5).attr("width",C).attr("height",17).attr("rx",8.5).attr("fill",_);L&&(S.attr("stroke",L).attr("stroke-width",1.3),E&&S.attr("stroke-dasharray","3 2")),t.append("text").attr("x",w).attr("y",k+4).attr("text-anchor","middle").attr("font-size",10.5).attr("font-weight",M).attr("fill",R).text(v)},b=0;for(let w of a){let k=w.node,C=s(k);if(w.leader&&t.append("line").attr("x1",w.leader.x1).attr("y1",w.leader.y1).attr("x2",w.leader.x2).attr("y2",w.leader.y2).attr("stroke",C).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("data-branch",k.branch).attr("opacity",.55*g(k)),w.kind==="tag")y(w.x,w.y,w.w,w.label,C,n.bg);else if(w.kind==="head")y(w.x,w.y,w.w,"HEAD",n.text,n.bg,void 0,!1,800);else if(w.kind==="ref")y(w.x,w.y,w.w,w.label,n.bg,C,C,w.remote);else if(w.kind==="note")t.append("circle").attr("cx",w.x).attr("cy",w.y).attr("r",8.5).attr("fill",C),t.append("text").attr("x",w.x).attr("y",w.y+4).attr("text-anchor","middle").attr("font-size",11).attr("fill",n.bg).text(w.label);else if(w.kind==="ab")t.append("text").attr("x",w.x).attr("y",w.y+4).attr("text-anchor","start").attr("font-size",11).attr("font-weight",700).attr("fill",C).text(w.label);else{let v=i.get(k.key),_=k.ghost,R=_?n.textMuted:C,L=w.x,E=w.y+4,M=w.anchor;if(w.shelfW!=null){let T=w.shelfLeft,N=w.shelfTop,I=w.shelfW,G=`dgmo-vc-shelf-${b++}`;t.append("clipPath").attr("id",G).append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",z1).attr("rx",UA),t.append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",z1).attr("rx",UA).attr("fill",_?n.bg:vt(C,n.bg,Mrt)).attr("data-branch",k.branch).attr("opacity",_?.5:1),t.append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",vrt).attr("clip-path",`url(#${G})`).attr("fill",C).attr("data-branch",k.branch).attr("opacity",_?.4:1),L=T+wx,E=N+z1/2+4,M="start"}let S=t.append("text").attr("x",L).attr("y",E).attr("text-anchor",M).attr("font-size",12).attr("data-branch",k.branch).attr("opacity",_?.6:1);v.sha&&S.append("tspan").attr("font-family","ui-monospace, monospace").attr("font-size",11).attr("fill",n.textMuted).text(v.sha+" "),S.append("tspan").attr("fill",R).attr("font-weight",k.kind==="cherry"?400:700).attr("font-style",k.kind==="cherry"?"italic":"normal").text(v.msg)}}if(d&&e.notes.length){let w=d+14;for(let k of e.notes){let C=t.append("text").attr("x",12).attr("y",w).attr("font-size",11.5);C.append("tspan").attr("fill",n.text).attr("font-weight",800).text((jA[k.num-1]??`#${k.num}`)+" "),C.append("tspan").attr("fill",n.textMuted).text(k.text),w+=16}}}function _rt(t,e,n,r,o){KA(t,e,n,r,void 0,o)}var yx,Ko,bx,VA,jA,Srt,Mrt,UA,vrt,wx,z1,Lrt,XA,QA=dt(()=>{"use strict";Nn();Ke();Fe();rr();yx=3,Ko=5.5,bx=10,VA=19,jA="\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468",Srt=40,Mrt=13,UA=4,vrt=2,wx=8,z1=21,Lrt=22,XA=7});function Art(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function JA(){return this.eachAfter(Art)}var tR=dt(()=>{"use strict"});function eR(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}var nR=dt(()=>{"use strict"});function rR(t,e){for(var n=this,r=[n],o,a,i=-1;n=r.pop();)if(t.call(e,n,++i,this),o=n.children)for(a=o.length-1;a>=0;--a)r.push(o[a]);return this}var oR=dt(()=>{"use strict"});function aR(t,e){for(var n=this,r=[n],o=[],a,i,s,l=-1;n=r.pop();)if(o.push(n),a=n.children)for(i=0,s=a.length;i<s;++i)r.push(a[i]);for(;n=o.pop();)t.call(e,n,++l,this);return this}var iR=dt(()=>{"use strict"});function sR(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}var lR=dt(()=>{"use strict"});function cR(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}var dR=dt(()=>{"use strict"});function uR(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}var fR=dt(()=>{"use strict"});function mR(t){for(var e=this,n=Rrt(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Rrt(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}var pR=dt(()=>{"use strict"});function hR(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}var gR=dt(()=>{"use strict"});function yR(){return Array.from(this)}var bR=dt(()=>{"use strict"});function xR(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}var wR=dt(()=>{"use strict"});function ER(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var kR=dt(()=>{"use strict"});function*SR(){var t=this,e,n=[t],r,o,a;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,a=r.length;o<a;++o)n.push(r[o]);while(n.length)}var MR=dt(()=>{"use strict"});function ts(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Drt)):e===void 0&&(e=Prt);for(var n=new Dc(t),r,o=[n],a,i,s,l;r=o.pop();)if((i=e(r.data))&&(l=(i=Array.from(i)).length))for(r.children=i,s=l-1;s>=0;--s)o.push(a=i[s]=new Dc(i[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore($rt)}function Irt(){return ts(this).eachBefore(Ort)}function Prt(t){return t.children}function Drt(t){return Array.isArray(t)?t[1]:null}function Ort(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function $rt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Dc(t){this.data=t,this.depth=this.height=0,this.parent=null}var Ex=dt(()=>{"use strict";tR();nR();oR();iR();lR();dR();fR();pR();gR();bR();wR();kR();MR();Dc.prototype=ts.prototype={constructor:Dc,count:JA,each:eR,eachAfter:aR,eachBefore:rR,find:sR,sum:cR,sort:uR,path:mR,ancestors:hR,descendants:yR,leaves:xR,links:ER,copy:Irt,[Symbol.iterator]:SR}});function vR(t){if(typeof t!="function")throw new Error;return t}var LR=dt(()=>{"use strict"});function hu(){return 0}function gu(t){return function(){return t}}var CR=dt(()=>{"use strict"});function h0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}var kx=dt(()=>{"use strict"});function g0(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(r-e)/t.value;++s<l;)i=a[s],i.y0=n,i.y1=o,i.x0=e,i.x1=e+=i.value*c}var Sx=dt(()=>{"use strict"});function Mx(){var t=1,e=1,n=0,r=!1;function o(i){var s=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/s,i.eachBefore(a(e,s)),r&&i.eachBefore(h0),i}function a(i,s){return function(l){l.children&&g0(l,l.x0,i*(l.depth+1)/s,l.x1,i*(l.depth+2)/s);var c=l.x0,d=l.y0,u=l.x1-n,f=l.y1-n;u<c&&(c=u=(c+u)/2),f<d&&(d=f=(d+f)/2),l.x0=c,l.y0=d,l.x1=u,l.y1=f}}return o.round=function(i){return arguments.length?(r=!!i,o):r},o.size=function(i){return arguments.length?(t=+i[0],e=+i[1],o):[t,e]},o.padding=function(i){return arguments.length?(n=+i,o):n},o}var NR=dt(()=>{"use strict";kx();Sx()});function Grt(t,e){return t.parent===e.parent?1:2}function vx(t){var e=t.children;return e?e[0]:t.t}function Lx(t){var e=t.children;return e?e[e.length-1]:t.t}function qrt(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Brt(t){for(var e=0,n=0,r=t.children,o=r.length,a;--o>=0;)a=r[o],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function Hrt(t,e,n){return t.a.parent===e.parent?t.a:n}function y0(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Frt(t){for(var e=new y0(t,0),n,r=[e],o,a,i,s;n=r.pop();)if(a=n._.children)for(n.children=new Array(s=a.length),i=s-1;i>=0;--i)r.push(o=n.children[i]=new y0(a[i],i)),o.parent=n;return(e.parent=new y0(null,0)).children=[e],e}function Cx(){var t=Grt,e=1,n=1,r=null;function o(c){var d=Frt(c);if(d.eachAfter(a),d.parent.m=-d.z,d.eachBefore(i),r)c.eachBefore(l);else{var u=c,f=c,m=c;c.eachBefore(function(y){y.x<u.x&&(u=y),y.x>f.x&&(f=y),y.depth>m.depth&&(m=y)});var p=u===f?1:t(u,f)/2,h=p-u.x,g=e/(f.x+p+h),x=n/(m.depth||1);c.eachBefore(function(y){y.x=(y.x+h)*g,y.y=y.depth*x})}return c}function a(c){var d=c.children,u=c.parent.children,f=c.i?u[c.i-1]:null;if(d){Brt(c);var m=(d[0].z+d[d.length-1].z)/2;f?(c.z=f.z+t(c._,f._),c.m=c.z-m):c.z=m}else f&&(c.z=f.z+t(c._,f._));c.parent.A=s(c,f,c.parent.A||u[0])}function i(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function s(c,d,u){if(d){for(var f=c,m=c,p=d,h=f.parent.children[0],g=f.m,x=m.m,y=p.m,b=h.m,w;p=Lx(p),f=vx(f),p&&f;)h=vx(h),m=Lx(m),m.a=c,w=p.z+y-f.z-g+t(p._,f._),w>0&&(qrt(Hrt(p,c,u),c,w),g+=w,x+=w),y+=p.m,g+=f.m,b+=h.m,x+=m.m;p&&!Lx(m)&&(m.t=p,m.m+=y-x),f&&!vx(h)&&(h.t=f,h.m+=g-b,u=c)}return u}function l(c){c.x*=e,c.y=c.depth*n}return o.separation=function(c){return arguments.length?(t=c,o):t},o.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],o):r?null:[e,n]},o.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],o):r?[e,n]:null},o}var TR=dt(()=>{"use strict";Ex();y0.prototype=Object.create(Dc.prototype)});function _R(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(o-n)/t.value;++s<l;)i=a[s],i.x0=e,i.x1=r,i.y0=n,i.y1=n+=i.value*c}var AR=dt(()=>{"use strict"});function zrt(t,e,n,r,o,a){for(var i=[],s=e.children,l,c,d=0,u=0,f=s.length,m,p,h=e.value,g,x,y,b,w,k,C;d<f;){m=o-n,p=a-r;do g=s[u++].value;while(!g&&u<f);for(x=y=g,k=Math.max(p/m,m/p)/(h*t),C=g*g*k,w=Math.max(y/C,C/x);u<f;++u){if(g+=c=s[u].value,c<x&&(x=c),c>y&&(y=c),C=g*g*k,b=Math.max(y/C,C/x),b>w){g-=c;break}w=b}i.push(l={value:g,dice:m<p,children:s.slice(d,u)}),l.dice?g0(l,n,r,o,h?r+=p*g/h:a):_R(l,n,r,h?n+=m*g/h:o,a),h-=g,d=u}return i}var Wrt,Y1,Nx=dt(()=>{"use strict";Sx();AR();Wrt=(1+Math.sqrt(5))/2;Y1=(function t(e){function n(r,o,a,i,s){zrt(e,r,o,a,i,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(Wrt)});function Tx(){var t=Y1,e=!1,n=1,r=1,o=[0],a=hu,i=hu,s=hu,l=hu,c=hu;function d(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(u),o=[0],e&&f.eachBefore(h0),f}function u(f){var m=o[f.depth],p=f.x0+m,h=f.y0+m,g=f.x1-m,x=f.y1-m;g<p&&(p=g=(p+g)/2),x<h&&(h=x=(h+x)/2),f.x0=p,f.y0=h,f.x1=g,f.y1=x,f.children&&(m=o[f.depth+1]=a(f)/2,p+=c(f)-m,h+=i(f)-m,g-=s(f)-m,x-=l(f)-m,g<p&&(p=g=(p+g)/2),x<h&&(h=x=(h+x)/2),t(f,p,h,g,x))}return d.round=function(f){return arguments.length?(e=!!f,d):e},d.size=function(f){return arguments.length?(n=+f[0],r=+f[1],d):[n,r]},d.tile=function(f){return arguments.length?(t=vR(f),d):t},d.padding=function(f){return arguments.length?d.paddingInner(f).paddingOuter(f):d.paddingInner()},d.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:gu(+f),d):a},d.paddingOuter=function(f){return arguments.length?d.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):d.paddingTop()},d.paddingTop=function(f){return arguments.length?(i=typeof f=="function"?f:gu(+f),d):i},d.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:gu(+f),d):s},d.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:gu(+f),d):l},d.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:gu(+f),d):c},d}var RR=dt(()=>{"use strict";kx();Nx();LR();CR()});var b0=dt(()=>{"use strict";Ex();NR();TR();RR();Nx()});var BR={};ue(BR,{layoutOrg:()=>Ax});function k0(t,e){let n=0;for(let r of t.children){n+=(r.isContainer?0:1)+k0(r,e);let o=e?.get(r.id);o&&(n+=o)}return n}function V1(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Jrt(t,e){let n=Tt(t,Yrt,{bold:!0});for(let[r,o]of Object.entries(e)){let a=Tt(`${r}: ${o}`,Vrt);a>n&&(n=a)}return Math.max(Krt,Math.ceil(n)+jrt*2)}function tot(t){let e=Object.keys(t).length;return e===0?IR+PR:IR+Xrt+e*Urt+PR}function E0(t,e,n){return t.color?t.color:Dn(t.metadata,[...e],n,t.isContainer)}function $R(t,e,n,r,o){return t.map(a=>{let i=V1(a.metadata,n),s=e?.get(a.id);if(!a.isContainer&&o&&!(s!=null&&s>0)){let l=k0(a,e);l>0&&(i[r??"Sub-node Count"]=String(l))}return{orgNode:a,children:$R(a.children,e,n,r,o),width:Jrt(a.label,i),height:tot(i)}})}function GR(t){let e=0;for(let n of t.children)e+=1+GR(n);return e}function qR(t){for(let i of t.children)qR(i);if(t.children.length<=2)return;let e=t.children.map(i=>({child:i,weight:GR(i)})).sort((i,s)=>s.weight-i.weight),n=new Array(e.length),r=Math.floor((e.length-1)/2),o=r,a=r;for(let i=0;i<e.length;i++){let s=e[i];i===0?n[r]=s.child:i%2===1?(a++,n[a]=s.child):(o--,n[o]=s.child)}t.children=n}function OR(t,e,n){let r=[];for(let o of t){if(o.entries.length===0)continue;let a=n?.get(Bt(o.name)),i=a?o.entries.filter(f=>a.has(f.value.toLowerCase())):o.entries;if(i.length===0)continue;let s=We(o.name,Er)+xo,l=s,c=0;for(let f of i)c+=Tr*2+Ir+We(f.value,Qn)+Qr;let d=e?_o+Ha:0,u=qn*2+s+4+d+c;r.push({name:o.name,...o.alias!==void 0&&{alias:o.alias},entries:i.map(f=>({value:f.value,color:f.color})),x:0,y:0,width:u,height:Se,minifiedWidth:l,minifiedHeight:Se})}return r}function eot(t,e){let n=[],r=o=>{n.push(o);for(let a of o.children)r(a)};for(let o of t)r(o);ma(n,e,o=>o.isContainer)}function Ax(t,e,n,r,o){if(t.roots.length===0){let tt=r!==void 0,it=OR(or(t.options)?[]:t.tagGroups,tt);if(it.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let st=Ci,ct=0;for(let pt of it)pt.x=Ci,pt.y=st,st+=Se+Mn,pt.width>ct&&(ct=pt.width);return{nodes:[],edges:[],containers:[],legend:it,width:ct+Ci*2,height:st-Mn+Ci}}let a=t.direction==="LR",i=tt=>a?tt.width:tt.height,s=tt=>a?tt.height:tt.width,l=(tt,it)=>a?{x:it,y:tt}:{x:tt,y:it},c=(tt,it,st,ct)=>a?{left:it,top:tt-ct/2}:{left:tt-st/2,top:it};eot(t.roots,t.tagGroups);let d=t.options["sub-node-label"]??void 0,u=["yes","on"].includes(t.options["show-sub-node-count"]?.toLowerCase()??""),f=$R(t.roots,e,r,d,u),m;f.length===1?m=f[0]:m={orgNode:{id:"__virtual_root__",label:"",metadata:{},children:t.roots,parentId:null,isContainer:!1,lineNumber:0},children:f,width:0,height:0};let p=0,h=0,g=[],x=tt=>{tt.orgNode.id!=="__virtual_root__"&&(g.push(tt),tt.width>p&&(p=tt.width),tt.height>h&&(h=tt.height));for(let it of tt.children)x(it)};x(m);for(let tt of g)tt.width=p;let y=a?p:h,b=a?h:p,w=Qrt,k=Zrt,C=new Map,v=tt=>{for(let it of tt.children)v(it);if(tt.orgNode.isContainer&&tt.children.length>0&&tt.children.every(it=>it.children.length===0)){let it=`__stack_${tt.orgNode.id}`;C.set(tt.orgNode.id,{children:[...tt.children],placeholderId:it});let st=Math.max(...tt.children.map(mt=>mt.width));for(let mt of tt.children)mt.width=st;let ct=tt.children.reduce((mt,bt)=>mt+i(bt),0)+(tt.children.length-1)*DR,pt=Math.max(...tt.children.map(mt=>s(mt)));tt.children=[{orgNode:{id:it,label:"",metadata:{},children:[],parentId:tt.orgNode.id,isContainer:!1,lineNumber:0},children:[],width:a?ct:pt,height:a?pt:ct}]}};v(m),qR(m);let _=ts(m,tt=>tt.children);Cx().nodeSize([b+k,y+w])(_);{let tt=_.descendants().filter(mt=>mt.data.orgNode.id!=="__virtual_root__"),it=new Map;for(let mt of tt){if(mt.data.orgNode.id.startsWith("__stack_"))continue;let bt=it.get(mt.depth)??0,gt=i(mt.data);gt>bt&&it.set(mt.depth,gt)}let st=Math.max(...it.keys(),0),ct=new Map,pt=f.length===1?0:1;ct.set(pt,0);for(let mt=pt+1;mt<=st;mt++){let bt=it.get(mt-1)??y,gt=ct.get(mt-1)??0;ct.set(mt,gt+bt+w)}for(let mt of _.descendants())mt.data.orgNode.id!=="__virtual_root__"&&(mt.y=ct.get(mt.depth)??mt.y)}for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||!tt.data.orgNode.isContainer||!tt.children||tt.children.length===0)continue;let st=tt.children[0].y-tt.y,ct=Object.keys(tt.data.orgNode.metadata).length,pt=x0+ct*w0,mt=a?Oc:pt+15,bt=st-mt;if(bt<=0)continue;let gt=Et=>{if(Et.children)for(let ft of Et.children)ft.y-=bt,gt(ft)};gt(tt)}for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||tt.data.orgNode.isContainer||!tt.children||tt.children.length===0||!tt.children.every(gt=>gt.data.orgNode.isContainer))continue;let it=tt.y+i(tt.data),ct=Math.min(...tt.children.map(gt=>gt.y))-it,pt=w*.6,mt=ct-pt;if(mt<=0)continue;let bt=gt=>{if(gt.y-=mt,gt.children)for(let Et of gt.children)bt(Et)};for(let gt of tt.children)bt(gt)}{let tt=ct=>{let pt=ct.x-s(ct.data)/2,mt=ct.x+s(ct.data)/2;if(ct.children)for(let bt of ct.children){let gt=tt(bt);gt.minX<pt&&(pt=gt.minX),gt.maxX>mt&&(mt=gt.maxX)}if(ct.data.orgNode.isContainer&&(pt-=Oc,mt+=Oc,a)){let bt=Object.keys(ct.data.orgNode.metadata).length;pt-=x0+bt*w0}return{minX:pt,maxX:mt}},it=(ct,pt)=>{ct.x+=pt,ct.children&&ct.children.forEach(mt=>it(mt,pt))},st=_.descendants().filter(ct=>ct.children&&ct.children.length>=2).sort((ct,pt)=>pt.depth-ct.depth);for(let ct of st){let pt=ct.children,mt=pt.map(kt=>{let _t=tt(kt);return{relLeft:_t.minX-kt.x,relRight:_t.maxX-kt.x}}),bt=(pt[0].x+pt[pt.length-1].x)/2,gt=[0];for(let kt=1;kt<pt.length;kt++){let _t=gt[kt-1]+mt[kt-1].relRight;gt[kt]=_t+k-mt[kt].relLeft}let Et=(gt[0]+gt[gt.length-1])/2,ft=bt-Et;for(let kt=0;kt<pt.length;kt++){let yt=gt[kt]+ft-pt[kt].x;Math.abs(yt)>.001&&it(pt[kt],yt)}}}{let tt=_.descendants().filter(it=>it.children&&it.children.length>=1&&it.data.orgNode.id!=="__virtual_root__").sort((it,st)=>st.depth-it.depth);for(let it of tt){let st=it.children.map(pt=>pt.x),ct=(Math.min(...st)+Math.max(...st))/2;it.x=ct}}let L=[],E=[],M=1/0,S=-1/0,T=1/0,N=-1/0,I=[];for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||!tt.data.orgNode.id.startsWith("__stack_"))continue;let it=tt.data.orgNode.id.replace("__stack_",""),st=C.get(it);if(!st)continue;let ct=tt.y;for(let pt of st.children)I.push({orgNode:pt.orgNode,width:pt.width,height:pt.height,cx:tt.x,cy:ct}),ct+=i(pt)+DR}let G=(tt,it,st,ct)=>{let{left:pt,top:mt}=c(tt,it,st,ct);return{left:pt,top:mt,right:pt+st,bottom:mt+ct}},$=tt=>{tt.left<M&&(M=tt.left),tt.right>S&&(S=tt.right),tt.top<T&&(T=tt.top),tt.bottom>N&&(N=tt.bottom)};for(let tt of _.descendants())tt.data.orgNode.id!=="__virtual_root__"&&(tt.data.orgNode.id.startsWith("__stack_")||$(G(tt.x,tt.y,tt.data.width,tt.data.height)));for(let tt of I)$(G(tt.cx,tt.cy,tt.width,tt.height));let A=-M+Ci,D=-T+Ci,O=(tt,it,st,ct)=>{let pt=G(tt,it,st,ct);return{x:pt.left+A+st/2,y:pt.top+D}},P=d??"Sub-node Count";for(let tt of I){let it=e?.get(tt.orgNode.id),st=V1(tt.orgNode.metadata,r);if(!tt.orgNode.isContainer&&u&&!(it!=null&&it>0)){let mt=k0(tt.orgNode,e);mt>0&&(st[P]=String(mt))}let ct=E0(tt.orgNode,t.tagGroups,n??null),pt=tt.orgNode.children.length>0||it!=null&&it>0||void 0;L.push({id:tt.orgNode.id,label:tt.orgNode.label,metadata:st,tagMetadata:{...tt.orgNode.metadata},isContainer:tt.orgNode.isContainer,lineNumber:tt.orgNode.lineNumber,...ct!==void 0&&{color:ct},...O(tt.cx,tt.cy,tt.width,tt.height),width:tt.width,height:tt.height,...it!==void 0&&{hiddenCount:it},...pt!==void 0&&{hasChildren:pt}})}let H=(tt,it)=>{let st=l(tt,it);return{x:st.x+A,y:st.y+D}},W=new Map;for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||tt.data.orgNode.id.startsWith("__stack_"))continue;let it=tt.data.orgNode,st=tt.data.width,ct=tt.data.height,{x:pt,y:mt}=O(tt.x,tt.y,st,ct),bt=e?.get(it.id),gt=V1(it.metadata,r);if(!it.isContainer&&u&&!(bt!=null&&bt>0)){let _t=k0(it,e);_t>0&&(gt[P]=String(_t))}let Et=E0(it,t.tagGroups,n??null),ft=tt.children!=null&&tt.children.length>0||bt!=null&&bt>0||void 0;L.push({id:it.id,label:it.label,metadata:gt,tagMetadata:{...it.metadata},isContainer:it.isContainer,lineNumber:it.lineNumber,...Et!==void 0&&{color:Et},x:pt,y:mt,width:st,height:ct,...bt!==void 0&&{hiddenCount:bt},...ft!==void 0&&{hasChildren:ft}});let kt=tt.parent?.data.orgNode.isContainer&&tt.parent.children&&tt.parent.children.length>0;if(tt.parent&&tt.parent.data.orgNode.id!=="__virtual_root__"&&!kt){let _t=tt.parent.data.orgNode.id;W.has(_t)||W.set(_t,{parentX:tt.parent.x,parentBottomY:tt.parent.y+i(tt.parent.data),children:[]}),W.get(_t).children.push({id:it.id,x:tt.x,topY:tt.y})}}for(let[tt,it]of W){let{parentX:st,parentBottomY:ct,children:pt}=it;if(pt.length===1){let mt=pt[0],bt=(ct+mt.topY)/2;E.push({sourceId:tt,targetId:mt.id,points:[H(st,ct),H(st,bt),H(mt.x,bt),H(mt.x,mt.topY)]})}else{let mt=(ct+pt[0].topY)/2,bt=pt.map(ft=>ft.x),gt=Math.min(...bt),Et=Math.max(...bt);E.push({sourceId:tt,targetId:tt,points:[H(st,ct),H(st,mt)]}),E.push({sourceId:tt,targetId:tt,points:[H(gt,mt),H(Et,mt)]});for(let ft of pt)E.push({sourceId:tt,targetId:ft.id,points:[H(ft.x,mt),H(ft.x,ft.topY)]})}}let B=_.descendants().filter(tt=>tt.data.orgNode.id!=="__virtual_root__"&&tt.data.orgNode.isContainer),q=new Map,V=[],X=60;for(let tt of B){if(tt.children&&tt.children.length>0)continue;let it=Object.keys(tt.data.orgNode.metadata).length,st=x0+it*w0,ct=tt.data.width,pt=Math.max(st+_x,X),mt=c(tt.x,tt.y,ct,pt),bt=mt.left+A,gt=mt.top+D;q.set(tt.data.orgNode.id,{minX:bt,maxX:bt+ct,minY:gt,maxY:gt+pt});let Et=e?.get(tt.data.orgNode.id),ft=V1(tt.data.orgNode.metadata,r),kt=E0(tt.data.orgNode,t.tagGroups,n??null),_t=Et!=null&&Et>0||void 0;V.push({nodeId:tt.data.orgNode.id,label:tt.data.orgNode.label,lineNumber:tt.data.orgNode.lineNumber,...kt!==void 0&&{color:kt},metadata:ft,tagMetadata:{...tt.data.orgNode.metadata},x:bt,y:gt,width:ct,height:pt,labelHeight:st,...Et!==void 0&&{hiddenCount:Et},..._t!==void 0&&{hasChildren:_t}})}let z=B.filter(tt=>tt.children&&tt.children.length>0);z.sort((tt,it)=>it.depth-tt.depth);for(let tt of z){let it=[],st=Xt=>{if(Xt.children)for(let zt of Xt.children)it.push(zt),st(zt)};if(st(tt),it.length===0)continue;let ct=1/0,pt=-1/0,mt=1/0,bt=-1/0,gt=(Xt,zt,xt,$t)=>{Xt<ct&&(ct=Xt),xt>pt&&(pt=xt),zt<mt&&(mt=zt),$t>bt&&(bt=$t)};for(let Xt of it){let zt=q.get(Xt.data.orgNode.id);if(zt)gt(zt.minX,zt.minY,zt.maxX,zt.maxY);else if(Xt.data.orgNode.id.startsWith("__stack_")){let xt=Xt.data.orgNode.id.replace("__stack_","");if(C.get(xt))for(let Zt of I){if(Zt.orgNode.parentId!==xt)continue;let re=G(Zt.cx,Zt.cy,Zt.width,Zt.height);gt(re.left+A,re.top+D,re.right+A,re.bottom+D)}}else{let xt=G(Xt.x,Xt.y,Xt.data.width,Xt.data.height);gt(xt.left+A,xt.top+D,xt.right+A,xt.bottom+D)}}let Et=c(tt.x,tt.y,tt.data.width,tt.data.height),ft=Et.left+tt.data.width/2+A,kt=Et.left+A,_t=Et.top+D,yt=Object.keys(tt.data.orgNode.metadata).length,St=x0+yt*w0,Ct,ht,Pt,Dt;if(a)Pt=kt,Dt=Math.max(pt-kt+Oc,tt.data.width),Ct=mt-St-Oc,ht=bt-Ct+_x;else{Ct=_t,ht=bt-_t+_x;let Xt=ct-Oc,zt=pt-ct+Oc*2;Dt=Math.max(zt,tt.data.width),Pt=Dt>zt?ft-Dt/2:Xt}q.set(tt.data.orgNode.id,{minX:Pt,maxX:Pt+Dt,minY:Ct,maxY:Ct+ht});let qt=e?.get(tt.data.orgNode.id),Wt=V1(tt.data.orgNode.metadata,r),Ft=E0(tt.data.orgNode,t.tagGroups,n??null);V.push({nodeId:tt.data.orgNode.id,label:tt.data.orgNode.label,lineNumber:tt.data.orgNode.lineNumber,...Ft!==void 0&&{color:Ft},metadata:Wt,tagMetadata:{...tt.data.orgNode.metadata},x:Pt,y:Ct,width:Dt,height:ht,labelHeight:St,...qt!==void 0&&{hiddenCount:qt},hasChildren:!0})}V.reverse();let U=M,Y=S,K=T,et=N;for(let tt of V){let it=tt.x-A,st=it+tt.width,ct=tt.y-D,pt=ct+tt.height;it<U&&(U=it),st>Y&&(Y=st),ct<K&&(K=ct),pt>et&&(et=pt)}let nt=T-K;if(nt>0){for(let tt of L)tt.y+=nt;for(let tt of V)tt.y+=nt;for(let tt of E)for(let it of tt.points)it.y+=nt}let J=Y-U+Ci*2,F=et-K+Ci*2,j=new Map;for(let tt of t.tagGroups){let it=Bt(tt.name),st=new Set,ct=pt=>{!pt.isContainer&&pt.metadata[it]&&st.add(pt.metadata[it].toLowerCase());for(let mt of pt.children)ct(mt)};for(let pt of t.roots)ct(pt);j.set(it,st)}let Q=r!==void 0,Z=OR(or(t.options)?[]:t.tagGroups,Q,j),ot=J,at=F,lt=n!=null?Z.filter(tt=>tt.name.toLowerCase()===n.toLowerCase()):Z,rt=o&&n==null,ut=tt=>n!=null||rt?tt.width:tt.minifiedWidth;if(lt.length>0){let tt=Se+Mn;for(let pt of L)pt.y+=tt;for(let pt of V)pt.y+=tt;for(let pt of E)for(let mt of pt.points)mt.y+=tt;let it=lt.reduce((pt,mt)=>pt+ut(mt),0)+(lt.length-1)*Mn,st=Ci;for(let pt of lt)pt.x=st,pt.y=Ci,st+=ut(pt)+Mn;at+=tt;let ct=it+Ci*2;ct>ot&&(ot=ct)}return{nodes:L,edges:E,containers:V,legend:Z,width:ot,height:at}}var Yrt,Vrt,Urt,IR,Xrt,jrt,PR,Krt,Zrt,Qrt,Ci,Oc,_x,x0,w0,DR,Rx=dt(()=>{"use strict";Oe();b0();Oe();Ae();pr();Ve();Yrt=13,Vrt=11,Urt=16,IR=28,Xrt=6,jrt=20,PR=10,Krt=140,Zrt=30,Qrt=50,Ci=40,Oc=24,_x=24,x0=28,w0=16,DR=20});function HR(t,e){let n=0;for(let r of e.getChildren(t))n+=(e.countsAsHidden(r)?1:0)+HR(r,e);return n}function FR(t,e,n,r){for(let o of t){let a=r.getChildren(o);e.has(r.getId(o))&&a.length>0&&n.set(r.getId(o),HR(o,r)),FR(a,e,n,r)}}function WR(t,e,n){for(let r of n.getChildren(t))WR(r,e,n);e.has(n.getId(t))&&n.getChildren(t).length>0&&n.setChildren(t,[])}function yu(t,e,n){let r=new Map;FR(t,e,r,n);let o=t.map(a=>n.clone(a));for(let a of o)WR(a,e,n);return{roots:o,hiddenCounts:r}}function zR(t,e){let n=new Set,r=o=>{for(let a of o)n.add(e.getId(a)),r(e.getChildren(a))};return r(t),n}var U1=dt(()=>{"use strict"});var VR={};ue(VR,{collapseOrgTree:()=>rot,focusOrgTree:()=>oot});function S0(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(S0),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function rot(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=yu(t.roots,e,not);return{parsed:{...t,roots:n},hiddenCounts:r}}function YR(t,e,n){for(let r of t){if(r.id===e)return{node:r,path:n};let o=YR(r.children,e,[...n,{id:r.id,label:r.label,lineNumber:r.lineNumber,...r.color!==void 0&&{color:r.color},metadata:{...r.metadata},isContainer:r.isContainer}]);if(o)return o}return null}function oot(t,e){let n=YR(t.roots,e,[]);if(!n)return null;if(t.roots.some(a=>a.id===e))return{parsed:{...t,roots:[S0(n.node)]},ancestorPath:[]};let o=S0(n.node);return o.parentId=null,{parsed:{...t,roots:[o]},ancestorPath:n.path}}var not,UR=dt(()=>{"use strict";U1();not={getId:t=>t.id,getChildren:t=>t.children,clone:S0,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer}});function bu(t,e,n){let r=document.createElement("div");r.style.width=`${t}px`,r.style.height=`${e}px`,r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);try{return n(r)}finally{document.body.removeChild(r)}}function xu(t,e,n){let r=t.querySelector("svg");return r?(e==="transparent"?r.style.background="none":n&&!r.style.background&&(r.style.background=n.bg),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.style.fontFamily=Mt,r.querySelectorAll("[data-export-ignore]").forEach(o=>o.remove()),Fr(r)):""}var M0=dt(()=>{"use strict";fi();Ke()});var tI={};ue(tI,{ancestorTrailReserve:()=>uot,renderOrg:()=>JR,renderOrgForExport:()=>hot});function uot(t){return t>0?t*ZR+QR:0}function mot(t,e,n,r){let o=n??t.primary;return ee(t,o,e,{mode:r})}function XR(t,e){return e??t.primary}function pot(t,e,n){return n?vt(n,Ie(t,e),10):vt(t.surface,t.bg,40)}function jR(t,e){return e??t.textMuted}function JR(t,e,n,r,o,a,i,s,l,c,d){It(t).selectAll(":not([data-d3-tooltip])").remove();let u=i?.width??t.clientWidth,f=i?.height??t.clientHeight;if(u<=0||f<=0)return;let m=Le.identity(),p=m.aesthetic(Ix),h=m.structural(KR),g=m.text(13),x=m.text(11),y=m.structural(16),b=m.structural(28),w=m.structural(6),k=m.structural(1.5),C=m.structural(1.5),v=m.structural(6),_=m.structural(8),R=m.text(13),L=m.text(11),E=m.structural(16),M=m.structural(28),S=m.structural(6),T=m.structural(0),N=m.structural(cot),I=m.text(dot),G=m.structural(ZR),$=m.structural(QR),A=m.aesthetic(fot),D=!!e.title&&e.options["no-title"]!=="on",O=D?h:0,P=n.nodes.length===0,H=n.legend.length>0,W=Se+Mn,B=!i&&H&&!P,q=B?ir({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:_o+Ha},u)+A:0,V=!i&&D,X=V?h:0,z=c&&c.length>0,U=z?c.length*G+$:0,Y=n.width,K=n.height+(V?0:O)+U;B&&(K-=W);let et=f-p*2-q-X,nt=(u-p*2)/Y,J=et/K,F=Math.min(lot,nt,J),j=Y*F,Q=(u-j)/2,Z=B?p+q+X:p+X,ot=It(t).append("svg").attr("width",u).attr("height",f).attr("viewBox",`0 0 ${u} ${f}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);m.isBelowFloor&&ot.attr("width","100%");let at=ot.append("g").attr("transform",`translate(${Q}, ${Z}) scale(${F})`);if(D){let ct=V?ot:at,pt=V?u/2:Y/2,mt=V?p+20:20,bt=ct.append("text").attr("x",pt).attr("y",mt).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",20).attr("font-weight","700").attr("class","org-title chart-title").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(bt.attr("data-line-number",e.titleLineNumber),a&&bt.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}let lt=(V?0:O)+U,rt=at.append("g").attr("transform",`translate(0, ${lt})`),ut=new Map;for(let ct of e.tagGroups)ut.set(Bt(ct.name),ct.name);let tt=new Set(e.roots.map(ct=>ct.id)),it=e.options?.color==="off";for(let ct of n.containers){let pt=rt.append("g").attr("transform",`translate(${ct.x}, ${ct.y})`).attr("class","org-container").attr("data-line-number",String(ct.lineNumber));if(s){let Et=Bt(s),ft=ct.tagMetadata[Et];ft&&pt.attr(`data-tag-${Et}`,ft.toLowerCase())}ct.hasChildren&&pt.attr("data-node-toggle",ct.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!ct.hiddenCount)).attr("aria-label",ct.label),a&&pt.style("cursor","pointer").on("click",()=>{a(ct.lineNumber)});let mt=pot(r,o,it?void 0:ct.color),bt=jR(r,it?void 0:ct.color);pt.append("rect").attr("x",0).attr("y",0).attr("width",ct.width).attr("height",ct.height).attr("rx",_).attr("fill",mt).attr("stroke",bt).attr("stroke-opacity",.35).attr("stroke-width",C),pt.append("text").attr("x",ct.width/2).attr("y",M/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",r.text).attr("font-size",R).attr("font-weight","bold").text(ct.label);let gt=Object.entries(ct.metadata);if(gt.length>0){let Et=gt.map(([yt])=>ut.get(yt)??yt),kt=10+Math.max(...Et.map(yt=>Tt(`${yt}: `,L))),_t=M+L-2;for(let yt=0;yt<gt.length;yt++){let[,St]=gt[yt],Ct=Et[yt],ht=_t+yt*E;pt.append("text").attr("x",10).attr("y",ht).attr("fill",r.textMuted).attr("font-size",L).text(`${Ct}: `),pt.append("text").attr("x",kt).attr("y",ht).attr("fill",r.text).attr("font-size",L).text(St)}}if(!i&&ct.hiddenCount&&ct.hiddenCount>0&&H1(pt,{width:ct.width,height:ct.height,barHeight:S,inset:T,rx:_,fill:jR(r,it?void 0:ct.color),clipId:`clip-${ct.nodeId}`,className:"org-collapse-bar"}),!i&&ct.hasChildren&&!tt.has(ct.nodeId)){let kt=ct.width-14-5,yt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",ct.nodeId).attr("data-export-ignore","true").attr("transform",`translate(${kt}, 5)`);yt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let St=pe(mt,r.textOnFillLight,r.textOnFillDark),Ct=14/2,ht=14/2;yt.append("circle").attr("cx",Ct).attr("cy",ht).attr("r",14/2-1).attr("fill","none").attr("stroke",St).attr("stroke-width",1.5),yt.append("circle").attr("cx",Ct).attr("cy",ht).attr("r",2).attr("fill",St)}}for(let ct of n.edges){if(ct.points.length<2)continue;let pt=[];pt.push(`M ${ct.points[0].x} ${ct.points[0].y}`);for(let mt=1;mt<ct.points.length;mt++)pt.push(`L ${ct.points[mt].x} ${ct.points[mt].y}`);rt.append("path").attr("d",pt.join(" ")).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",k).attr("class","org-edge").attr("data-from",ct.sourceId).attr("data-to",ct.targetId)}let st=new Set(n.containers.map(ct=>ct.nodeId));for(let ct of n.nodes){if(st.has(ct.id))continue;let pt=rt.append("g").attr("transform",`translate(${ct.x-ct.width/2}, ${ct.y})`).attr("class","org-node").attr("data-line-number",String(ct.lineNumber)).attr("data-node-id",ct.id);if(s){let kt=Bt(s),_t=ct.tagMetadata[kt];_t&&pt.attr(`data-tag-${kt}`,_t.toLowerCase())}ct.hasChildren&&pt.attr("data-node-toggle",ct.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!ct.hiddenCount)).attr("aria-label",ct.label),a&&pt.style("cursor","pointer").on("click",()=>{a(ct.lineNumber)});let mt=mn(e.options),bt=mot(r,o,it?void 0:ct.color,mt),gt=XR(r,it?void 0:ct.color),Et=pe(bt,r.textOnFillLight,r.textOnFillDark),ft=Object.entries(ct.metadata);if(Os(pt,{width:ct.width,height:ct.height,rx:v,fill:bt,stroke:gt,strokeWidth:C,...ct.isContainer&&{dashed:!0},label:ct.label,labelColor:Et,labelFontSize:g,headerHeight:b,...ft.length>0&&{meta:{rows:ft.map(([kt,_t])=>[ut.get(kt)??kt,_t]),fontSize:x,lineHeight:y,separatorGap:w,separatorColor:mt==="solid"?Et:gt,textColor:Et}}}),!i&&ct.hiddenCount&&ct.hiddenCount>0&&H1(pt,{width:ct.width,height:ct.height,barHeight:S,inset:T,rx:v,fill:mt==="solid"?Et:XR(r,it?void 0:ct.color),clipId:`clip-${ct.id}`,className:"org-collapse-bar"}),!i&&ct.hasChildren&&!tt.has(ct.id)){let yt=ct.width-14-5,Ct=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",ct.id).attr("data-export-ignore","true").attr("transform",`translate(${yt}, 5)`);Ct.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let ht=Et,Pt=14/2,Dt=14/2;Ct.append("circle").attr("cx",Pt).attr("cy",Dt).attr("r",14/2-1).attr("fill","none").attr("stroke",ht).attr("stroke-width",1.5),Ct.append("circle").attr("cx",Pt).attr("cy",Dt).attr("r",2).attr("fill",ht)}}if(z){let ct=n.nodes.find(gt=>tt.has(gt.id)),pt=ct?null:n.containers.find(gt=>tt.has(gt.nodeId)),mt=ct?ct.x:pt?pt.x+pt.width/2:null,bt=ct?ct.y:pt?pt.y:null;if(mt!==null&&bt!==null){let gt=bt-$,Et=rt.append("g").attr("class","org-ancestor-trail"),ft=c.length,kt=[];for(let yt=0;yt<ft;yt++){let St=ft-1-yt;kt.push(gt-St*G)}let _t=kt[0];Et.append("line").attr("x1",mt).attr("y1",_t).attr("x2",mt).attr("y2",bt).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.4);for(let yt=0;yt<ft;yt++){let St=c[yt],Ct=kt[yt],Pt=St.color??Dn(St.metadata,[...e.tagGroups],s??null,St.isContainer)??r.textMuted,Dt=Et.append("g").attr("class","org-ancestor-node").attr("data-focus-ancestor",St.id).style("cursor","pointer").attr("transform",`translate(${mt}, ${Ct})`);Dt.append("rect").attr("x",-N-2).attr("y",-N-2).attr("width",120).attr("height",N*2+4).attr("fill","transparent"),Dt.append("circle").attr("cx",0).attr("cy",0).attr("r",N).attr("fill",Pt),Dt.append("text").attr("x",N+6).attr("y",I*.35).attr("fill",r.textMuted).attr("font-size",I).text(St.label),Dt.on("mouseenter",function(){It(this).select("circle").attr("r",N+1),It(this).select("text").attr("fill",r.text)}).on("mouseleave",function(){It(this).select("circle").attr("r",N),It(this).select("text").attr("fill",r.textMuted)})}}}if(B||P||i&&H){let ct=n.legend.map(gt=>({name:gt.name,entries:gt.entries.map(Et=>({value:Et.value,color:Et.color}))})),pt=B?_o+Ha:0,mt=B?ot.append("g").attr("class","org-legend-fixed").attr("transform",`translate(0, ${p+X})`):rt.append("g"),bt;if(P){for(let gt of n.legend){let Et={groups:[{name:gt.name,entries:gt.entries.map(kt=>({value:kt.value,color:kt.color}))}],position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview"},ft=mt.append("g").attr("transform",`translate(${gt.x}, ${gt.y})`);tn(ft,{...Et,palette:r,isDark:o,width:gt.width,activeGroup:gt.name}),ft.selectAll("[data-legend-group]").classed("org-legend-group",!0)}bt=null}else bt=tn(mt,{...{groups:ct,position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview",capsulePillAddonWidth:pt},palette:r,isDark:o,width:B?u:n.width,activeGroup:s??null}),mt.selectAll("[data-legend-group]").classed("org-legend-group",!0);if(B&&bt){let gt=bt.getLayout();if(gt.activeCapsule?.addonX!=null){let Et=gt.activeCapsule,ft=Bt(Et.groupName),kt=l?.has(ft)??!1,_t=mt.select(`[data-legend-group="${ft}"]`);if(!_t.empty()){let yt=Et.addonX,St=(Se-_o)/2,Ct=6,ht=_t.append("g").attr("class","org-legend-eye").attr("data-legend-visibility",ft).style("cursor","pointer").attr("opacity",kt?.4:.7);ht.append("rect").attr("x",yt-Ct).attr("y",St-Ct).attr("width",_o+Ct*2).attr("height",_o+Ct*2).attr("fill","transparent").attr("pointer-events","all"),ht.append("path").attr("d",kt?r1:n1).attr("transform",`translate(${yt}, ${St})`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}}function hot(t,e,n){let r=Fd(t,n);if(r.error)return"";let o=r.options?.hide,a=o?new Set(o.split(",").map(u=>u.trim().toLowerCase())):void 0,i=Ax(r,void 0,void 0,a),s=e==="dark",l=r.title&&r.options["no-title"]!=="on"?KR:0,c=i.width+Ix*2,d=i.height+Ix*2+l;return bu(c,d,u=>(JR(u,r,i,n,s,void 0,{width:c,height:d}),xu(u,e,n)))}var Ix,lot,KR,cot,dot,ZR,QR,fot,eI=dt(()=>{"use strict";Oe();Ae();Nn();Ke();M0();wr();Fe();Oe();h1();Rx();pr();Mr();F1();Ve();qr();Ix=20,lot=3,KR=30,cot=4,dot=11,ZR=22,QR=16;fot=8});function nI(t,e){t[e]?t[e]++:t[e]=1}function rI(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function j1(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let i=o;o=a,a=i}return o+""+a+""+(r===void 0?"\0":r)}function wot(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let s=o;o=a,a=s}let i={v:o,w:a};return r&&(i.name=r),i}function Ox(t,e){return j1(t,e.v,e.w,e.name)}function kot(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Sot(t),edges:Mot(t)},n=t.graph();return n!==void 0&&(e.value=structuredClone(n)),e}function Sot(t){return t.nodes().map(e=>{let n=t.node(e),r=t.parent(e),o={v:e};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Mot(t){return t.edges().map(e=>{let n=t.edge(e),r={v:e.v,w:e.w};return e.name!==void 0&&(r.name=e.name),n!==void 0&&(r.value=n),r})}function vot(t){let e=new Ya(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(n=>{e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(n=>{e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}function xI(t,e,n,r){return Cot(t,String(e),n||Lot,r||function(o){return t.outEdges(o)})}function Cot(t,e,n,r){let o={},a,i=0,s=t.nodes(),l=function(u){let f=n(u);o[u.v].distance+f<o[u.w].distance&&(o[u.w]={distance:o[u.v].distance+f,predecessor:u.v},a=!0)},c=function(){s.forEach(function(u){r(u).forEach(function(f){let m=f.v===u?f.v:f.w,p=m===f.v?f.w:f.v;l({v:m,w:p})})})};s.forEach(function(u){let f=u===e?0:Number.POSITIVE_INFINITY;o[u]={distance:f,predecessor:""}});let d=s.length;for(let u=1;u<d&&(a=!1,i++,c(),!!a);u++);if(i===d-1&&(a=!1,c(),a))throw new Error("The graph contains a negative weight cycle");return o}function Not(t){let e={},n=[],r;function o(a){a in e||(e[a]=!0,r.push(a),t.successors(a).forEach(o),t.predecessors(a).forEach(o))}return t.nodes().forEach(function(a){r=[],o(a),r.length&&n.push(r)}),n}function L0(t,e,n,r){let o=function(a){return t.outEdges(a)};return _ot(t,String(e),n||Tot,r||o)}function _ot(t,e,n,r){let o={},a=new wI,i,s,l=function(c){let d=c.v!==i?c.v:c.w,u=o[d],f=n(c),m=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);m<u.distance&&(u.distance=m,u.predecessor=i,a.decrease(d,m))};for(t.nodes().forEach(function(c){let d=c===e?0:Number.POSITIVE_INFINITY;o[c]={distance:d,predecessor:""},a.add(c,d)});a.size()>0&&(i=a.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return o}function Aot(t,e,n){return t.nodes().reduce(function(r,o){return r[o]=L0(t,o,e,n),r},{})}function EI(t){let e=0,n=[],r={},o=[];function a(i){let s=r[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(l){l in r?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(a(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){let l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(i!==c);o.push(l)}}return t.nodes().forEach(function(i){i in r||a(i)}),o}function Rot(t){return EI(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}function Pot(t,e,n){return Dot(t,e||Iot,n||function(r){return t.outEdges(r)})}function Dot(t,e,n){let r={},o=t.nodes();return o.forEach(function(a){r[a]={},r[a][a]={distance:0,predecessor:""},o.forEach(function(i){a!==i&&(r[a][i]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(a).forEach(function(i){let s=i.v===a?i.w:i.v,l=e(i);r[a][s]={distance:l,predecessor:a}})}),o.forEach(function(a){let i=r[a];o.forEach(function(s){let l=r[s];o.forEach(function(c){let d=l[a],u=i[c],f=l[c],m=d.distance+u.distance;m<f.distance&&(f.distance=m,f.predecessor=u.predecessor)})})}),r}function kI(t){let e={},n={},r=[];function o(a){if(a in n)throw new C0;a in e||(n[a]=!0,e[a]=!0,t.predecessors(a).forEach(o),delete n[a],r.push(a))}if(t.sinks().forEach(o),Object.keys(e).length!==t.nodeCount())throw new C0;return r}function Oot(t){try{kI(t)}catch(e){if(e instanceof C0)return!1;throw e}return!0}function $ot(t,e,n,r,o){Array.isArray(e)||(e=[e]);let a=(s=>{var l;return(l=t.isDirected()?t.successors(s):t.neighbors(s))!=null?l:[]}),i={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);o=SI(t,s,n==="post",i,a,r,o)}),o}function SI(t,e,n,r,o,a,i){return e in r||(r[e]=!0,n||(i=a(i,e)),o(e).forEach(function(s){i=SI(t,s,n,r,o,a,i)}),n&&(i=a(i,e))),i}function MI(t,e,n){return $ot(t,e,n,function(r,o){return r.push(o),r},[])}function Got(t,e){return MI(t,e,"post")}function qot(t,e){return MI(t,e,"pre")}function Bot(t,e){let n=new Ya,r={},o=new wI,a;function i(l){let c=l.v===a?l.w:l.v,d=o.priority(c);if(d!==void 0){let u=e(l);u<d&&(r[c]=a,o.decrease(c,u))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(l){o.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),o.decrease(t.nodes()[0],0);let s=!1;for(;o.size()>0;){if(a=o.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(a).forEach(i)}return n}function Hot(t,e,n,r){return Fot(t,e,n,r??(o=>{let a=t.outEdges(o);return a??[]}))}function Fot(t,e,n,r){if(n===void 0)return L0(t,e,n,r);let o=!1,a=t.nodes();for(let i=0;i<a.length;i++){let s=r(a[i]);for(let l=0;l<s.length;l++){let c=s[l],d=c.v===a[i]?c.v:c.w,u=d===c.v?c.w:c.v;n({v:d,w:u})<0&&(o=!0)}if(o)return xI(t,e,n,r)}return L0(t,e,n,r)}function ku(t,e,n,r){let o=r;for(;t.hasNode(o);)o=zx(r);return n.dummy=e,t.setNode(o,n),o}function Wot(t){let e=new Ya().setGraph(t.graph());return t.nodes().forEach(n=>e.setNode(n,t.node(n))),t.edges().forEach(n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),e}function vI(t){let e=new Ya({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{t.children(n).length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdge(n,t.edge(n))}),e}function oI(t,e){let n=t.x,r=t.y,o=e.x-n,a=e.y-r,i=t.width/2,s=t.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),l=s*o/a,c=s):(o<0&&(i=-i),l=i,c=i*a/o),{x:n+l,y:r+c}}function Z1(t){let e=K1(CI(t)+1).map(()=>[]);return t.nodes().forEach(n=>{let r=t.node(n),o=r.rank;o!==void 0&&(e[o]||(e[o]=[]),e[o][r.order]=n)}),e}function zot(t){let e=t.nodes().map(r=>{let o=t.node(r).rank;return o===void 0?Number.MAX_VALUE:o}),n=es(Math.min,e);t.nodes().forEach(r=>{let o=t.node(r);Object.hasOwn(o,"rank")&&(o.rank-=n)})}function Yot(t){let e=t.nodes().map(i=>t.node(i).rank).filter(i=>i!==void 0),n=es(Math.min,e),r=[];t.nodes().forEach(i=>{let s=t.node(i).rank-n;r[s]||(r[s]=[]),r[s].push(i)});let o=0,a=t.graph().nodeRankFactor;Array.from(r).forEach((i,s)=>{i===void 0&&s%a!==0?--o:i!==void 0&&o&&i.forEach(l=>t.node(l).rank+=o)})}function aI(t,e,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),ku(t,"border",o,e)}function Vot(t,e=LI){let n=[];for(let r=0;r<t.length;r+=e){let o=t.slice(r,r+e);n.push(o)}return n}function es(t,e){if(e.length>LI){let n=Vot(e);return t(...n.map(r=>t(...r)))}else return t(...e)}function CI(t){let e=t.nodes().map(n=>{let r=t.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return es(Math.max,e)}function Uot(t,e){let n={lhs:[],rhs:[]};return t.forEach(r=>{e(r)?n.lhs.push(r):n.rhs.push(r)}),n}function NI(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}}function TI(t,e){return e()}function zx(t){let e=++Xot;return t+(""+e)}function K1(t,e,n=1){e==null&&(e=t,t=0);let r=a=>a<e;n<0&&(r=a=>e<a);let o=[];for(let a=t;r(a);a+=n)o.push(a);return o}function N0(t,e){let n={};for(let r of e)t[r]!==void 0&&(n[r]=t[r]);return n}function T0(t,e){let n;return typeof e=="string"?n=r=>r[e]:n=e,Object.entries(t).reduce((r,[o,a])=>(r[o]=n(a,o),r),{})}function jot(t,e){return t.reduce((n,r,o)=>(n[r]=e[o],n),{})}function iI(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Qot(t,e){if(t!=="_next"&&t!=="_prev")return e}function eat(t,e){if(t.nodeCount()<=1)return[];let n=rat(t,e||tat);return nat(n.graph,n.buckets,n.zeroIdx).flatMap(r=>t.outEdges(r.v,r.w)||[])}function nat(t,e,n){var r;let o=[],a=e[e.length-1],i=e[0],s;for(;t.nodeCount();){for(;s=i.dequeue();)$x(t,e,n,s);for(;s=a.dequeue();)$x(t,e,n,s);if(t.nodeCount()){for(let l=e.length-2;l>0;--l)if(s=(r=e[l])==null?void 0:r.dequeue(),s){o=o.concat($x(t,e,n,s,!0)||[]);break}}}return o}function $x(t,e,n,r,o){let a=[],i=o?a:void 0;return(t.inEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=t.node(s.v);o&&a.push({v:s.v,w:s.w}),c.out-=l,Fx(e,n,c)}),(t.outEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=s.w,d=t.node(c);d.in-=l,Fx(e,n,d)}),t.removeNode(r.v),i}function rat(t,e){let n=new Ya,r=0,o=0;t.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let l=n.edge(s.v,s.w)||0,c=e(s),d=l+c;n.setEdge(s.v,s.w,d);let u=n.node(s.v),f=n.node(s.w);o=Math.max(o,u.out+=c),r=Math.max(r,f.in+=c)});let a=oat(o+r+3).map(()=>new Jot),i=r+1;return n.nodes().forEach(s=>{Fx(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function Fx(t,e,n){var r,o,a;n.out?n.in?(a=t[n.out-n.in+e])==null||a.enqueue(n):(o=t[t.length-1])==null||o.enqueue(n):(r=t[0])==null||r.enqueue(n)}function oat(t){let e=[];for(let n=0;n<t;n++)e.push(n);return e}function aat(t){(t.graph().acyclicer==="greedy"?eat(t,e(t)):iat(t)).forEach(n=>{let r=t.edge(n);t.removeEdge(n),r.forwardName=n.name,r.reversed=!0,t.setEdge(n.w,n.v,r,zx("rev"))});function e(n){return r=>n.edge(r).weight}}function iat(t){let e=[],n={},r={};function o(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,t.outEdges(a).forEach(i=>{Object.hasOwn(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return t.nodes().forEach(o),e}function sat(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}function lat(t){t.graph().dummyChains=[],t.edges().forEach(e=>cat(t,e))}function cat(t,e){let n=e.v,r=t.node(n).rank,o=e.w,a=t.node(o).rank,i=e.name,s=t.edge(e),l=s.labelRank;if(a===r+1)return;t.removeEdge(e);let c,d,u;for(u=0,++r;r<a;++u,++r)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},c=ku(t,"edge",d,"_d"),r===l&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),t.setEdge(n,c,{weight:s.weight},i),u===0&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,o,{weight:s.weight},i)}function dat(t){t.graph().dummyChains.forEach(e=>{let n=t.node(e),r=n.edgeLabel,o;for(t.setEdge(n.edgeObj,r);n.dummy;)o=t.successors(e)[0],t.removeNode(e),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e=o,n=t.node(e)})}function Yx(t){let e={};function n(r){let o=t.node(r);if(Object.hasOwn(e,r))return o.rank;e[r]=!0;let a=t.outEdges(r),i=a?a.map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-t.edge(l).minlen):[],s=es(Math.min,i);return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}t.sources().forEach(n)}function Eu(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function uat(t){let e=new Ya({directed:!1}),n=t.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],o=t.nodeCount();e.setNode(r,{});let a,i;for(;fat(e,t)<o&&(a=mat(e,t),!!a);)i=e.hasNode(a.v)?Eu(t,a):-Eu(t,a),pat(e,t,i);return e}function fat(t,e){function n(r){let o=e.nodeEdges(r);o&&o.forEach(a=>{let i=a.v,s=r===i?a.w:i;!t.hasNode(s)&&!Eu(e,a)&&(t.setNode(s,{}),t.setEdge(r,s,{}),n(s))})}return t.nodes().forEach(n),t.nodeCount()}function mat(t,e){return e.edges().reduce((n,r)=>{let o=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(o=Eu(e,r)),o<n[0]?[o,r]:n},[Number.POSITIVE_INFINITY,null])[1]}function pat(t,e,n){t.nodes().forEach(r=>e.node(r).rank+=n)}function $c(t){t=Wot(t),Yx(t);let e=_I(t);Ux(e),Vx(e,t);let n,r;for(;n=II(e);)r=PI(e,t,n),DI(e,t,n,r)}function Vx(t,e){let n=gat(t,t.nodes());n=n.slice(0,n.length-1),n.forEach(r=>bat(t,e,r))}function bat(t,e,n){let r=t.node(n).parent,o=t.edge(n,r);o.cutvalue=AI(t,e,n)}function AI(t,e,n){let r=t.node(n).parent,o=!0,a=e.edge(n,r),i=0;a||(o=!1,a=e.edge(r,n)),i=a.weight;let s=e.nodeEdges(n);return s&&s.forEach(l=>{let c=l.v===n,d=c?l.w:l.v;if(d!==r){let u=c===o,f=e.edge(l).weight;if(i+=u?f:-f,wat(t,n,d)){let m=t.edge(n,d).cutvalue;i+=u?-m:m}}}),i}function Ux(t,e){arguments.length<2&&(e=t.nodes()[0]),RI(t,{},1,e)}function RI(t,e,n,r,o){let a=n,i=t.node(r);e[r]=!0;let s=t.neighbors(r);return s&&s.forEach(l=>{Object.hasOwn(e,l)||(n=RI(t,e,n,l,r))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function II(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function PI(t,e,n){let r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);let a=t.node(r),i=t.node(o),s=a,l=!1;return a.lim>i.lim&&(s=i,l=!0),e.edges().filter(c=>l===sI(t,t.node(c.v),s)&&l!==sI(t,t.node(c.w),s)).reduce((c,d)=>Eu(e,d)<Eu(e,c)?d:c)}function DI(t,e,n,r){let o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),Ux(t),Vx(t,e),xat(t,e)}function xat(t,e){let n=t.nodes().find(o=>!t.node(o).parent);if(!n)return;let r=hat(t,[n]);r=r.slice(1),r.forEach(o=>{let a=t.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function wat(t,e,n){return t.hasEdge(e,n)}function sI(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function kat(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":lI(t);break;case"tight-tree":Mat(t);break;case"longest-path":Sat(t);break;case"none":break;default:lI(t)}}function Mat(t){Yx(t),_I(t)}function lI(t){yat(t)}function Lat(t){let e=Nat(t);t.graph().dummyChains.forEach(n=>{let r=t.node(n),o=r.edgeObj,a=Cat(t,e,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],d=!0;for(;n!==o.w;){if(r=t.node(n),d){for(;(c=i[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(i[l+1]).minRank<=r.rank;)l++;c=i[l]}c!==void 0&&t.setParent(n,c),n=t.successors(n)[0]}})}function Cat(t,e,n,r){let o=[],a=[],i=Math.min(e[n].low,e[r].low),s=Math.max(e[n].lim,e[r].lim),l;l=n;do l=t.parent(l),o.push(l);while(l&&(e[l].low>i||s>e[l].lim));let c=l,d=r;for(;(d=t.parent(d))!==c;)a.push(d);return{path:o.concat(a.reverse()),lca:c}}function Nat(t){let e={},n=0;function r(o){let a=n;t.children(o).forEach(r),e[o]={low:a,lim:n++}}return t.children(_0).forEach(r),e}function Tat(t){let e=ku(t,"root",{},"_root"),n=_at(t),r=Object.values(n),o=es(Math.max,r)-1,a=2*o+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=a);let i=Aat(t)+1;t.children(_0).forEach(s=>OI(t,e,a,i,o,n,s)),t.graph().nodeRankFactor=a}function OI(t,e,n,r,o,a,i){var s;let l=t.children(i);if(!l.length){i!==e&&t.setEdge(e,i,{weight:0,minlen:n});return}let c=aI(t,"_bt"),d=aI(t,"_bb"),u=t.node(i);t.setParent(c,i),u.borderTop=c,t.setParent(d,i),u.borderBottom=d,l.forEach(f=>{var m;OI(t,e,n,r,o,a,f);let p=t.node(f),h=p.borderTop?p.borderTop:f,g=p.borderBottom?p.borderBottom:f,x=p.borderTop?r:2*r,y=h!==g?1:o-((m=a[i])!=null?m:0)+1;t.setEdge(c,h,{weight:x,minlen:y,nestingEdge:!0}),t.setEdge(g,d,{weight:x,minlen:y,nestingEdge:!0})}),t.parent(i)||t.setEdge(e,c,{weight:0,minlen:o+((s=a[i])!=null?s:0)})}function _at(t){let e={};function n(r,o){let a=t.children(r);a&&a.length&&a.forEach(i=>n(i,o+1)),e[r]=o}return t.children(_0).forEach(r=>n(r,1)),e}function Aat(t){return t.edges().reduce((e,n)=>e+t.edge(n).weight,0)}function Rat(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdge(n)})}function Pat(t){function e(n){let r=t.children(n),o=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let a=o.minRank,i=o.maxRank+1;a<i;++a)cI(t,"borderLeft","_bl",n,o,a),cI(t,"borderRight","_br",n,o,a)}}t.children(_0).forEach(e)}function cI(t,e,n,r,o,a){let i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],l=ku(t,"border",i,n);o[e][a]=l,t.setParent(l,r),s&&t.setEdge(s,l,{weight:1})}function Dat(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&$I(t)}function Oat(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&$at(t),(n==="lr"||n==="rl")&&(Gat(t),$I(t))}function $I(t){t.nodes().forEach(e=>dI(t.node(e))),t.edges().forEach(e=>dI(t.edge(e)))}function dI(t){let e=t.width;t.width=t.height,t.height=e}function $at(t){t.nodes().forEach(e=>Gx(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(Gx),Object.hasOwn(r,"y")&&Gx(r)})}function Gx(t){t.y=-t.y}function Gat(t){t.nodes().forEach(e=>qx(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(qx),Object.hasOwn(r,"x")&&qx(r)})}function qx(t){let e=t.x;t.x=t.y,t.y=e}function qat(t){let e={},n=t.nodes().filter(s=>!t.children(s).length),r=n.map(s=>t.node(s).rank),o=es(Math.max,r),a=K1(o+1).map(()=>[]);function i(s){if(e[s])return;e[s]=!0;let l=t.node(s);a[l.rank].push(s);let c=t.successors(s);c&&c.forEach(i)}return n.sort((s,l)=>t.node(s).rank-t.node(l).rank).forEach(i),a}function Bat(t,e){let n=0;for(let r=1;r<e.length;++r)n+=Hat(t,e[r-1],e[r]);return n}function Hat(t,e,n){let r=jot(n,n.map((c,d)=>d)),o=e.flatMap(c=>{let d=t.outEdges(c);return d?d.map(u=>({pos:r[u.w],weight:t.edge(u).weight})).sort((u,f)=>u.pos-f.pos):[]}),a=1;for(;a<n.length;)a<<=1;let i=2*a-1;a-=1;let s=new Array(i).fill(0),l=0;return o.forEach(c=>{let d=c.pos+a;s[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=s[d+1]),d=d-1>>1,s[d]+=c.weight;l+=c.weight*u}),l}function Fat(t,e=[]){return e.map(n=>{let r=t.inEdges(n);if(!r||!r.length)return{v:n};{let o=r.reduce((a,i)=>{let s=t.edge(i),l=t.node(i.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function Wat(t,e){let n={};t.forEach((o,a)=>{let i={indegree:0,in:[],out:[],vs:[o.v],i:a};o.barycenter!==void 0&&(i.barycenter=o.barycenter,i.weight=o.weight),n[o.v]=i}),e.edges().forEach(o=>{let a=n[o.v],i=n[o.w];a!==void 0&&i!==void 0&&(i.indegree++,a.out.push(i))});let r=Object.values(n).filter(o=>!o.indegree);return zat(r)}function zat(t){let e=[];function n(o){return a=>{a.merged||(a.barycenter===void 0||o.barycenter===void 0||a.barycenter>=o.barycenter)&&Yat(o,a)}}function r(o){return a=>{a.in.push(o),--a.indegree===0&&t.push(a)}}for(;t.length;){let o=t.pop();e.push(o),o.in.reverse().forEach(n(o)),o.out.forEach(r(o))}return e.filter(o=>!o.merged).map(o=>N0(o,["vs","i","barycenter","weight"]))}function Yat(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function Vat(t,e){let n=Uot(t,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,o=n.rhs.sort((d,u)=>u.i-d.i),a=[],i=0,s=0,l=0;r.sort(Uat(!!e)),l=uI(a,o,l),r.forEach(d=>{l+=d.vs.length,a.push(d.vs),i+=d.barycenter*d.weight,s+=d.weight,l=uI(a,o,l)});let c={vs:a.flat(1)};return s&&(c.barycenter=i/s,c.weight=s),c}function uI(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}function Uat(t){return(e,n)=>e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}function GI(t,e,n,r){let o=t.children(e),a=t.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};i&&(o=o.filter(f=>f!==i&&f!==s));let c=Fat(t,o);c.forEach(f=>{if(t.children(f.v).length){let m=GI(t,f.v,n,r);l[f.v]=m,Object.hasOwn(m,"barycenter")&&jat(f,m)}});let d=Wat(c,n);Xat(d,l);let u=Vat(d,r);if(i&&s){u.vs=[i,u.vs,s].flat(1);let f=t.predecessors(i);if(f&&f.length){let m=t.node(f[0]),p=t.predecessors(s),h=t.node(p[0]);Object.hasOwn(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+m.order+h.order)/(u.weight+2),u.weight+=2}}return u}function Xat(t,e){t.forEach(n=>{n.vs=n.vs.flatMap(r=>e[r]?e[r].vs:r)})}function jat(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function Kat(t,e,n,r){r||(r=t.nodes());let o=Zat(t),a=new Ya({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return r.forEach(i=>{let s=t.node(i),l=t.parent(i);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){a.setNode(i),a.setParent(i,l||o);let c=t[n](i);c&&c.forEach(d=>{let u=d.v===i?d.w:d.v,f=a.edge(u,i),m=f!==void 0?f.weight:0;a.setEdge(u,i,{weight:t.edge(d).weight+m})}),Object.hasOwn(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),a}function Zat(t){let e;for(;t.hasNode(e=zx("_root")););return e}function Qat(t,e,n){let r={},o;n.forEach(a=>{let i=t.parent(a),s,l;for(;i;){if(s=t.parent(i),s?(l=r[s],r[s]=i):(l=o,o=i),l&&l!==i){e.setEdge(l,i);return}i=s}})}function qI(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,qI);return}let n=CI(t),r=fI(t,K1(1,n+1),"inEdges"),o=fI(t,K1(n-1,-1,-1),"outEdges"),a=qat(t);if(mI(t,a),e.disableOptimalOrderHeuristic)return;let i=Number.POSITIVE_INFINITY,s,l=e.constraints||[];for(let c=0,d=0;d<4;++c,++d){Jat(c%2?r:o,c%4>=2,l),a=Z1(t);let u=Bat(t,a);u<i?(d=0,s=Object.assign({},a),i=u):u===i&&(s=structuredClone(a))}mI(t,s)}function fI(t,e,n){let r=new Map,o=(a,i)=>{r.has(a)||r.set(a,[]),r.get(a).push(i)};for(let a of t.nodes()){let i=t.node(a);if(typeof i.rank=="number"&&o(i.rank,a),typeof i.minRank=="number"&&typeof i.maxRank=="number")for(let s=i.minRank;s<=i.maxRank;s++)s!==i.rank&&o(s,a)}return e.map(function(a){return Kat(t,a,n,r.get(a)||[])})}function Jat(t,e,n){let r=new Ya;t.forEach(function(o){n.forEach(s=>r.setEdge(s.left,s.right));let a=o.graph().root,i=GI(o,a,r,e);i.vs.forEach((s,l)=>o.node(s).order=l),Qat(o,r,i.vs)})}function mI(t,e){Object.values(e).forEach(n=>n.forEach((r,o)=>t.node(r).order=o))}function tit(t,e){let n={};function r(o,a){let i=0,s=0,l=o.length,c=a[a.length-1];return a.forEach((d,u)=>{let f=nit(t,d),m=f?t.node(f).order:l;(f||d===c)&&(a.slice(s,u+1).forEach(p=>{let h=t.predecessors(p);h&&h.forEach(g=>{let x=t.node(g),y=x.order;(y<i||m<y)&&!(x.dummy&&t.node(p).dummy)&&BI(n,g,p)})}),s=u+1,i=m)}),a}return e.length&&e.reduce(r),n}function eit(t,e){let n={};function r(a,i,s,l,c){K1(i,s).forEach(d=>{let u=a[d];if(u!==void 0&&t.node(u).dummy){let f=t.predecessors(u);f&&f.forEach(m=>{if(m===void 0)return;let p=t.node(m);p.dummy&&(p.order<l||p.order>c)&&BI(n,m,u)})}})}function o(a,i){let s=-1,l=-1,c=0;return i.forEach((d,u)=>{if(t.node(d).dummy==="border"){let f=t.predecessors(d);if(f&&f.length){let m=f[0];if(m===void 0)return;l=t.node(m).order,r(i,c,u,s,l),c=u,s=l}}r(i,c,i.length,l,a.length)}),i}return e.length&&e.reduce(o),n}function nit(t,e){if(t.node(e).dummy){let n=t.predecessors(e);if(n)return n.find(r=>t.node(r).dummy)}}function BI(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];r||(t[e]=r={}),r[n]=!0}function rit(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];return r!==void 0&&Object.hasOwn(r,n)}function oit(t,e,n,r){let o={},a={},i={};return e.forEach(s=>{s.forEach((l,c)=>{o[l]=l,a[l]=l,i[l]=c})}),e.forEach(s=>{let l=-1;s.forEach(c=>{let d=r(c);if(d&&d.length){let u=d.sort((m,p)=>{let h=i[m],g=i[p];return(h!==void 0?h:0)-(g!==void 0?g:0)}),f=(u.length-1)/2;for(let m=Math.floor(f),p=Math.ceil(f);m<=p;++m){let h=u[m];if(h===void 0)continue;let g=i[h];if(g!==void 0&&a[c]===c&&l<g&&!rit(n,c,h)){let x=o[h];x!==void 0&&(a[h]=c,a[c]=o[c]=x,l=g)}}}})}),{root:o,align:a}}function ait(t,e,n,r,o=!1){let a={},i=iit(t,e,n,o),s=o?"borderLeft":"borderRight";function l(m,p){let h=i.nodes().slice(),g={},x=h.pop();for(;x;){if(g[x])m(x);else{g[x]=!0,h.push(x);for(let y of p(x))h.push(y)}x=h.pop()}}function c(m){let p=i.inEdges(m);p?a[m]=p.reduce((h,g)=>{var x;let y=(x=a[g.v])!=null?x:0,b=i.edge(g);return Math.max(h,y+(b!==void 0?b:0))},0):a[m]=0}function d(m){let p=i.outEdges(m),h=Number.POSITIVE_INFINITY;p&&(h=p.reduce((x,y)=>{let b=a[y.w],w=i.edge(y);return Math.min(x,(b!==void 0?b:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let g=t.node(m);h!==Number.POSITIVE_INFINITY&&g.borderType!==s&&(a[m]=Math.max(a[m]!==void 0?a[m]:0,h))}function u(m){return i.predecessors(m)||[]}function f(m){return i.successors(m)||[]}return l(c,u),l(d,f),Object.keys(r).forEach(m=>{var p;let h=n[m];h!==void 0&&(a[m]=(p=a[h])!=null?p:0)}),a}function iit(t,e,n,r){let o=new Ya,a=t.graph(),i=uit(a.nodesep,a.edgesep,r);return e.forEach(s=>{let l;s.forEach(c=>{let d=n[c];if(d!==void 0){if(o.setNode(d),l!==void 0){let u=n[l];if(u!==void 0){let f=o.edge(u,d);o.setEdge(u,d,Math.max(i(t,c,l),f||0))}}l=c}})}),o}function sit(t,e){return Object.values(e).reduce((n,r)=>{let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([s,l])=>{let c=fit(t,s)/2;o=Math.max(l+c,o),a=Math.min(l-c,a)});let i=o-a;return i<n[0]&&(n=[i,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function lit(t,e){let n=Object.values(e),r=es(Math.min,n),o=es(Math.max,n);["u","d"].forEach(a=>{["l","r"].forEach(i=>{let s=a+i,l=t[s];if(!l||l===e)return;let c=Object.values(l),d=r-es(Math.min,c);i!=="l"&&(d=o-es(Math.max,c)),d&&(t[s]=T0(l,u=>u+d))})})}function cit(t,e=void 0){let n=t.ul;return n?T0(n,(r,o)=>{var a,i;if(e){let l=e.toLowerCase(),c=t[l];if(c&&c[o]!==void 0)return c[o]}let s=Object.values(t).map(l=>{let c=l[o];return c!==void 0?c:0}).sort((l,c)=>l-c);return(((a=s[1])!=null?a:0)+((i=s[2])!=null?i:0))/2}):{}}function dit(t){let e=Z1(t),n=Object.assign(tit(t,e),eit(t,e)),r={},o;["u","d"].forEach(i=>{o=i==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=oit(t,o,n,d=>(i==="u"?t.predecessors(d):t.successors(d))||[]),c=ait(t,o,l.root,l.align,s==="r");s==="r"&&(c=T0(c,d=>-d)),r[i+s]=c})});let a=sit(t,r);return lit(r,a),cit(r,t.graph().align)}function uit(t,e,n){return(r,o,a)=>{let i=r.node(o),s=r.node(a),l=0,c;if(l+=i.width/2,Object.hasOwn(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":c=-i.width/2;break;case"r":c=i.width/2;break}if(c&&(l+=n?c:-c),c=void 0,l+=(i.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=s.width/2;break;case"r":c=-s.width/2;break}return c&&(l+=n?c:-c),l}}function fit(t,e){return t.node(e).width}function mit(t){t=vI(t),pit(t),Object.entries(dit(t)).forEach(([e,n])=>t.node(e).x=n)}function pit(t){let e=Z1(t),n=t.graph(),r=n.ranksep,o=n.rankalign,a=0;e.forEach(i=>{let s=i.reduce((l,c)=>{var d;let u=(d=t.node(c).height)!=null?d:0;return l>u?l:u},0);i.forEach(l=>{let c=t.node(l);o==="top"?c.y=a+c.height/2:o==="bottom"?c.y=a+s-c.height/2:c.y=a+s/2}),a+=s+r})}function hit(t,e={}){let n=e.debugTiming?NI:TI;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>vit(t));return n(" runLayout",()=>git(r,n,e)),n(" updateInputGraph",()=>yit(t,r)),r})}function git(t,e,n){e(" makeSpaceForEdgeLabels",()=>Lit(t)),e(" removeSelfEdges",()=>Dit(t)),e(" acyclic",()=>aat(t)),e(" nestingGraph.run",()=>Tat(t)),e(" rank",()=>Eat(vI(t))),e(" injectEdgeLabelProxies",()=>Cit(t)),e(" removeEmptyRanks",()=>Yot(t)),e(" nestingGraph.cleanup",()=>Rat(t)),e(" normalizeRanks",()=>zot(t)),e(" assignRankMinMax",()=>Nit(t)),e(" removeEdgeLabelProxies",()=>Tit(t)),e(" normalize.run",()=>lat(t)),e(" parentDummyChains",()=>vat(t)),e(" addBorderSegments",()=>Iat(t)),e(" order",()=>qI(t,n)),e(" insertSelfEdges",()=>Oit(t)),e(" adjustCoordinateSystem",()=>Dat(t)),e(" position",()=>mit(t)),e(" positionSelfEdges",()=>$it(t)),e(" removeBorderNodes",()=>Pit(t)),e(" normalize.undo",()=>dat(t)),e(" fixupEdgeLabelCoords",()=>Rit(t)),e(" undoCoordinateSystem",()=>Oat(t)),e(" translateGraph",()=>_it(t)),e(" assignNodeIntersects",()=>Ait(t)),e(" reversePoints",()=>Iit(t)),e(" acyclic.undo",()=>sat(t))}function yit(t,e){t.nodes().forEach(n=>{let r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,e.children(n).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(n=>{let r=t.edge(n),o=e.edge(n);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function vit(t){let e=new Ya({multigraph:!0,compound:!0}),n=Hx(t.graph());return e.setGraph(Object.assign({},xit,Bx(n,bit),N0(n,wit))),t.nodes().forEach(r=>{let o=Hx(t.node(r)),a=Bx(o,Eit);Object.keys(pI).forEach(s=>{a[s]===void 0&&(a[s]=pI[s])}),e.setNode(r,a);let i=t.parent(r);i!==void 0&&e.setParent(r,i)}),t.edges().forEach(r=>{let o=Hx(t.edge(r));e.setEdge(r,Object.assign({},Sit,Bx(o,kit),N0(o,Mit)))}),e}function Lit(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(n=>{let r=t.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Cit(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};ku(t,"edge-proxy",o,"_ep")}})}function Nit(t){let e=0;t.nodes().forEach(n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))}),t.graph().maxRank=e}function Tit(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="edge-proxy"){let r=n;t.edge(r.e).labelRank=n.rank,t.removeNode(e)}})}function _it(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,a=t.graph(),i=a.marginx||0,s=a.marginy||0;function l(c){let d=c.x,u=c.y,f=c.width,m=c.height;e=Math.min(e,d-f/2),n=Math.max(n,d+f/2),r=Math.min(r,u-m/2),o=Math.max(o,u+m/2)}t.nodes().forEach(c=>l(t.node(c))),t.edges().forEach(c=>{let d=t.edge(c);Object.hasOwn(d,"x")&&l(d)}),e-=i,r-=s,t.nodes().forEach(c=>{let d=t.node(c);d.x-=e,d.y-=r}),t.edges().forEach(c=>{let d=t.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=r}),Object.hasOwn(d,"x")&&(d.x-=e),Object.hasOwn(d,"y")&&(d.y-=r)}),a.width=n-e+i,a.height=o-r+s}function Ait(t){t.edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=r),n.points.unshift(oI(r,a)),n.points.push(oI(o,i))})}function Rit(t){t.edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Iit(t){t.edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}function Pit(t){t.nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(n.borderLeft[n.borderLeft.length-1]),i=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function Dit(t){t.edges().forEach(e=>{if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Oit(t){Z1(t).forEach(e=>{let n=0;e.forEach((r,o)=>{let a=t.node(r);a.order=o+n,(a.selfEdges||[]).forEach(i=>{ku(t,"selfedge",{width:i.label.width,height:i.label.height,rank:a.rank,order:o+ ++n,e:i.e,label:i.label},"_se")}),delete a.selfEdges})})}function $it(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="selfedge"){let r=n,o=t.node(r.e.v),a=o.x+o.width/2,i=o.y,s=n.x-a,l=o.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*s/3,y:i-l},{x:a+5*s/6,y:i-l},{x:a+s,y:i},{x:a+5*s/6,y:i+l},{x:a+2*s/3,y:i+l}],r.label.x=n.x,r.label.y=n.y}})}function Bx(t,e){return T0(N0(t,e),Number)}function Hx(t){let e={};return t&&Object.entries(t).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),e[n]=r}),e}function Git(t){let e=Z1(t),n=new Ya({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+t.node(r).rank)}),t.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),e.forEach((r,o)=>{let a="layer"+o;n.setNode(a,{rank:"same"}),r.reduce((i,s)=>(n.setEdge(i,s,{style:"invis"}),s))}),n}var hI,got,yot,bot,gI,xot,yI,Ya,Eot,bI,Wx,Lot,wI,Tot,Iot,C0,LI,Xot,_0,Kot,Zot,Jot,tat,_I,hat,gat,yat,Eat,Sat,vat,Iat,bit,xit,wit,Eit,pI,kit,Sit,Mit,qit,dr,$s=dt(()=>{"use strict";hI=Object.defineProperty,got=(t,e,n)=>e in t?hI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yot=(t,e)=>{for(var n in e)hI(t,n,{get:e[n],enumerable:!0})},bot=(t,e,n)=>got(t,typeof e!="symbol"?e+"":e,n),gI={};yot(gI,{Graph:()=>Ya,alg:()=>Wx,json:()=>bI,version:()=>Eot});xot=Object.defineProperty,yI=(t,e)=>{for(var n in e)xot(t,n,{get:e[n],enumerable:!0})},Ya=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(n=>{e!==void 0?this.setNode(n,e):this.setNode(n)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(n=>{this.setParent(n)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let n=e;n!==void 0;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let n=new Set(e);for(let r of this.successors(t))n.add(r);return Array.from(n.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,a])=>{t(o)&&e.setNode(o,a)}),Object.values(this._edgeObjs).forEach(o=>{e.hasNode(o.v)&&e.hasNode(o.w)&&e.setEdge(o,this.edge(o))});let n={},r=o=>{let a=this.parent(o);return!a||e.hasNode(a)?(n[o]=a??void 0,a??void 0):a in n?n[a]:r(a)};return this._isCompound&&e.nodes().forEach(o=>e.setParent(o,r(o))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((n,r)=>(e!==void 0?this.setEdge(n,r,e):this.setEdge(n,r),r)),this}setEdge(t,e,n,r){let o,a,i,s,l=!1;typeof t=="object"&&t!==null&&"v"in t?(o=t.v,a=t.w,i=t.name,arguments.length===2&&(s=e,l=!0)):(o=t,a=e,i=r,arguments.length>2&&(s=n,l=!0)),o=""+o,a=""+a,i!==void 0&&(i=""+i);let c=j1(this._isDirected,o,a,i);if(c in this._edgeLabels)return l&&(this._edgeLabels[c]=s),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(a),this._edgeLabels[c]=l?s:this._defaultEdgeLabelFn(o,a,i);let d=wot(this._isDirected,o,a,i);return o=d.v,a=d.w,Object.freeze(d),this._edgeObjs[c]=d,nI(this._preds[a],o),nI(this._sucs[o],a),this._in[a][c]=d,this._out[o][c]=d,this._edgeCount++,this}edge(t,e,n){let r=arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(t,e,n){let r=arguments.length===1?this.edge(t):this.edge(t,e,n);return typeof r!="object"?{label:r}:r}hasEdge(t,e,n){return(arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n))in this._edgeLabels}removeEdge(t,e,n){let r=arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n),o=this._edgeObjs[r];if(o){let a=o.v,i=o.w;delete this._edgeLabels[r],delete this._edgeObjs[r],rI(this._preds[i],a),rI(this._sucs[a],i),delete this._in[i][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,n){if(!t)return;let r=Object.values(t);return n?r.filter(o=>o.v===e&&o.w===n||o.v===n&&o.w===e):r}};Eot="4.0.1",bI={};yI(bI,{read:()=>vot,write:()=>kot});Wx={};yI(Wx,{CycleException:()=>C0,bellmanFord:()=>xI,components:()=>Not,dijkstra:()=>L0,dijkstraAll:()=>Aot,findCycles:()=>Rot,floydWarshall:()=>Pot,isAcyclic:()=>Oot,postorder:()=>Got,preorder:()=>qot,prim:()=>Bot,shortestPaths:()=>Hot,tarjan:()=>EI,topsort:()=>kI});Lot=()=>1;wI=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let n=this._keyIndices,r=String(t);if(!(r in n)){let o=this._arr,a=o.length;return n[r]=a,o.push({key:r,priority:e}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let n=this._keyIndices[t];if(n===void 0)throw new Error(`Key not found: ${t}`);let r=this._arr[n].priority;if(e>r)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${r} New: ${e}`);this._arr[n].priority=e,this._decrease(n)}_heapify(t){let e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){let e=this._arr,n=e[t].priority,r;for(;t!==0&&(r=t>>1,!(e[r].priority<n));)this._swap(t,r),t=r}_swap(t,e){let n=this._arr,r=this._keyIndices,o=n[t],a=n[e];n[t]=a,n[e]=o,r[a.key]=t,r[o.key]=e}},Tot=()=>1;Iot=()=>1;C0=class extends Error{constructor(...t){super(...t)}};LI=65535;Xot=0;_0="\0",Kot="3.0.0",Zot=class{constructor(){bot(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return iI(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&iI(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Qot)),n=n._prev;return"["+t.join(", ")+"]"}};Jot=Zot,tat=()=>1;_I=uat;({preorder:hat,postorder:gat}=Wx),yat=$c;$c.initLowLimValues=Ux;$c.initCutValues=Vx;$c.calcCutValue=AI;$c.leaveEdge=II;$c.enterEdge=PI;$c.exchangeEdges=DI;Eat=kat;Sat=Yx;vat=Lat;Iat=Pat;bit=["nodesep","edgesep","ranksep","marginx","marginy"],xit={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},wit=["acyclicer","ranker","rankdir","align","rankalign"],Eit=["width","height","rank"],pI={width:0,height:0},kit=["minlen","weight","width","height","labeloffset"],Sit={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Mit=["labelpos"];qit={graphlib:gI,version:Kot,layout:hit,debug:Git,util:{time:NI,notime:TI}},dr=qit;});var Kx={};ue(Kx,{layoutSitemap:()=>Kit});function FI(t,e,n,r,o,a){let i=o-t,s=a-e;if(i===0&&s===0)return{x:t,y:e};let l=n/2,c=r/2,d=i!==0?l/Math.abs(i):1/0,u=s!==0?c/Math.abs(s):1/0,f=Math.min(d,u);return{x:t+i*f,y:e+s*f}}function Yit(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Vit(t,e,n){let r=Tt(t,Bit,{bold:!0});for(let[o,a]of Object.entries(e)){let i=Tt(`${o}: ${a}`,HI);i>r&&(r=i)}if(n)for(let o of n){let a=Tt(o,HI);a>r&&(r=a)}return Math.max(XI,Math.ceil(r)+UI*2)}function Uit(t,e=0){let r=Object.keys(t).length+e;return r===0?WI+zI:WI+Wit+r*Fit+zI}function VI(t,e,n){return t.color?t.color:Dn(t.metadata,[...e],n,t.isContainer)}function jit(t,e){let n=[];for(let r of t){if(r.entries.length===0)continue;let o=e?.get(Bt(r.name)),a=o?r.entries.filter(u=>o.has(u.value.toLowerCase())):r.entries;if(a.length===0)continue;let i=We(r.name,Er)+xo,s=i,l=0;for(let u of a)l+=Tr*2+Ir+We(u.value,Qn)+Qr;let c=_o+Ha,d=qn*2+i+4+c+l;n.push({name:r.name,...r.alias!==void 0&&{alias:r.alias},entries:a.map(u=>({value:u.value,color:u.color})),x:0,y:0,width:d,height:Se,minifiedWidth:s,minifiedHeight:Se})}return n}function jx(t,e,n,r,o,a){for(let i of t){let s=Yit(i.metadata,o);if(i.isContainer){let l=Object.keys(s).length,c=jI+l*KI;a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Math.max(XI,Tt(i.label,Hit,{bold:!0})+UI*2),height:c+Xx}),jx(i.children,i.id,n,r,o,a)}else a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Vit(i.label,s,i.description),height:Uit(s,i.description?.length??0)}),i.children.length>0&&jx(i.children,e,i.id,r,o,a)}}function Kit(t,e,n,r,o){if(t.roots.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let a=[],i=M=>{a.push(M);for(let S of M.children)i(S)};for(let M of t.roots)i(M);ma(a,t.tagGroups,M=>M.isContainer);let s=[];jx(t.roots,null,null,e,r,s);let l=new Map;for(let M of s)l.set(M.sitemapNode.id,M);let c=new dr.graphlib.Graph({compound:!0,multigraph:!0});c.setGraph({rankdir:t.direction,nodesep:50,ranksep:60,edgesep:30,marginx:Gc,marginy:Gc}),c.setDefaultEdgeLabel(()=>({}));let d=new Set,u=new Set,f=new Set;for(let M of s)M.sitemapNode.isContainer?(d.add(M.sitemapNode.id),(e?.get(M.sitemapNode.id)??0)>0&&f.add(M.sitemapNode.id)):u.add(M.sitemapNode.id);let m=0,p=0;for(let M of s)M.sitemapNode.isContainer||(M.width>m&&(m=M.width),M.height>p&&(p=M.height));for(let M of s){let S=M.sitemapNode;if(S.isContainer)if(f.has(S.id)){let T=Math.max(M.width,m),N=Math.max(M.height,p);c.setNode(S.id,{label:S.label,width:T,height:N})}else c.setNode(S.id,{label:S.label,paddingLeft:YI,paddingRight:YI,paddingTop:zit,paddingBottom:Xx});else c.setNode(S.id,{label:S.label,width:M.width,height:M.height})}for(let M of s)M.parentContainerId&&!f.has(M.parentContainerId)&&c.setParent(M.sitemapNode.id,M.parentContainerId);let h=new Set;for(let M of d)f.has(M)||h.add(M);let g=[];for(let M=0;M<t.edges.length;M++){let S=t.edges[M];if(!(!c.hasNode(S.sourceId)||!c.hasNode(S.targetId))){if(h.has(S.sourceId)||h.has(S.targetId)){g.push(M);continue}c.setEdge(S.sourceId,S.targetId,{label:S.label??"",minlen:1},`e${M}`)}}dr.layout(c);let x=[],y=[];for(let M of s){let S=M.sitemapNode;if(S.isContainer)continue;let T=c.node(S.id);if(!T)continue;let N=e?.get(S.id),I=VI(S,t.tagGroups,n??null);x.push({id:S.id,label:S.label,metadata:M.meta,tagMetadata:M.fullMeta,...S.description!==void 0&&{description:[...S.description]},isContainer:!1,lineNumber:S.lineNumber,...I!==void 0&&{color:I},x:T.x,y:T.y-T.height/2,width:T.width,height:T.height,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}})}for(let M of s){let S=M.sitemapNode;if(!S.isContainer)continue;let T=c.node(S.id),N=e?.get(S.id),I=Object.keys(M.meta).length,G=jI+I*KI,$=VI(S,t.tagGroups,n??null);if(T)y.push({nodeId:S.id,label:S.label,lineNumber:S.lineNumber,...$!==void 0&&{color:$},metadata:M.meta,tagMetadata:M.fullMeta,x:T.x-T.width/2,y:T.y-T.height/2,width:T.width,height:T.height,labelHeight:G,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}});else{let A=f.has(S.id),D=A?Math.max(M.width,m):M.width,O=A?M.height:G+Xx,P=A?Math.max(O,p):O;y.push({nodeId:S.id,label:S.label,lineNumber:S.lineNumber,...$!==void 0&&{color:$},metadata:M.meta,tagMetadata:M.fullMeta,x:Gc,y:Gc,width:D,height:P,labelHeight:G,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}})}}let b=new Set(g),w=[];for(let M=0;M<t.edges.length;M++){let S=t.edges[M];if(!c.hasNode(S.sourceId)||!c.hasNode(S.targetId))continue;let T;if(b.has(M)){let N=c.node(S.sourceId),I=c.node(S.targetId);if(!N||!I)continue;let G=FI(N.x,N.y,N.width,N.height,I.x,I.y),$=FI(I.x,I.y,I.width,I.height,N.x,N.y),A=(G.x+$.x)/2,D=(G.y+$.y)/2;T=[G,{x:A,y:D},$]}else{let N=c.edge({v:S.sourceId,w:S.targetId,name:`e${M}`});if(!N)continue;T=N.points??[]}w.push({sourceId:S.sourceId,targetId:S.targetId,points:T,...S.label!==void 0&&{label:S.label},lineNumber:S.lineNumber,...b.has(M)&&{deferred:!0}})}{let M=new Set([...u,...f]),S=new Map;for(let D of M)S.set(D,D);let T=D=>{for(;S.get(D)!==D;)S.set(D,S.get(S.get(D))),D=S.get(D);return D},N=(D,O)=>{let P=T(D),H=T(O);P!==H&&S.set(P,H)};for(let D of t.edges)M.has(D.sourceId)&&M.has(D.targetId)&&N(D.sourceId,D.targetId);let I=s.find(D=>!D.sitemapNode.isContainer)?.sitemapNode.id,G=I?T(I):null,$=new Set;for(let D of M)G&&T(D)!==G&&$.add(D);let A=new Set;for(let D of d){if(f.has(D)){$.has(D)&&A.add(D);continue}let O=s.filter(P=>!P.sitemapNode.isContainer&&P.parentContainerId===D);O.length>0&&O.every(P=>$.has(P.sitemapNode.id))&&A.add(D)}if($.size>0){let D=t.direction==="TB",O=0,P=0,H=1/0,W=1/0;for(let z of x)$.has(z.id)||(O=Math.max(O,z.x+z.width/2),P=Math.max(P,z.y+z.height),H=Math.min(H,z.y),W=Math.min(W,z.x-z.width/2));for(let z of y)A.has(z.nodeId)||(O=Math.max(O,z.x+z.width),P=Math.max(P,z.y+z.height),H=Math.min(H,z.y),W=Math.min(W,z.x));let B=1/0,q=1/0,V=0,X=0;for(let z of x)$.has(z.id)&&(B=Math.min(B,z.x-z.width/2),q=Math.min(q,z.y),V=Math.max(V,z.x+z.width/2),X=Math.max(X,z.y+z.height));for(let z of y)A.has(z.nodeId)&&(B=Math.min(B,z.x),q=Math.min(q,z.y),V=Math.max(V,z.x+z.width),X=Math.max(X,z.y+z.height));if(B!==1/0){let z=Xit*2,U,Y;if(D?(U=O+z-B,Y=(H===1/0?0:H)-q):(U=(W===1/0?0:W)-B,Y=P+z-q),U!==0||Y!==0){for(let K of x)$.has(K.id)&&(K.x+=U,K.y+=Y);for(let K of y)A.has(K.nodeId)&&(K.x+=U,K.y+=Y);for(let K of w){let et=$.has(K.sourceId),nt=$.has(K.targetId);if(et||nt)for(let J of K.points)J.x+=U,J.y+=Y}}}}}let k=0,C=0;for(let M of x){let S=M.x+M.width/2,T=M.y+M.height;S>k&&(k=S),T>C&&(C=T)}for(let M of y){let S=M.x+M.width,T=M.y+M.height;S>k&&(k=S),T>C&&(C=T)}for(let M of w)for(let S of M.points)S.x>k&&(k=S.x),S.y>C&&(C=S.y);k+=Gc,C+=Gc;let v=new Map;for(let M of t.tagGroups){let S=Bt(M.name),T=new Set,N=I=>{!I.isContainer&&I.metadata[S]&&T.add(I.metadata[S].toLowerCase());for(let G of I.children)N(G)};for(let I of t.roots)N(I);v.set(S,T)}let _=jit(t.tagGroups,v),R=n!=null?_.filter(M=>M.name.toLowerCase()===n.toLowerCase()):_,L=o&&n==null,E=M=>n!=null||L?M.width:M.minifiedWidth;if(R.length>0){let M=Se+Mn,S=R.reduce((G,$)=>G+E($),0)+(R.length-1)*Mn,T=S+Gc*2;T>k&&(k=T);let N=(k-S)/2,I=C+Mn;for(let G of R)G.x=N,G.y=I,N+=E(G)+Mn;C+=M}return{nodes:x,edges:w,containers:y,legend:_,width:k,height:C}}var Bit,HI,Hit,Fit,WI,Wit,UI,zI,XI,Gc,YI,zit,Xx,jI,KI,Xit,Zx=dt(()=>{"use strict";Oe();$s();Oe();pr();Ve();Bit=13,HI=11,Hit=13;Fit=16,WI=28,Wit=6,UI=20,zI=10,XI=140,Gc=40,YI=24,zit=40,Xx=24,jI=28,KI=16;Xit=20});function Zit(t,e){let n=new Map,r=o=>{for(let a of o)for(let i of e.getChildren(a))n.set(e.getId(i),e.getId(a)),r([i])};return r(t),n}function ZI(t,e,n,r){let o=t;for(;;){let a=e.get(o);if(!a)return null;if(n.has(a)&&r.has(a))return a;o=a}}function QI(t,e,n,r,o,a){let i=zR(e,o),s=Zit(t,o),l=[];for(let c of n){let d=a.getSource(c),u=a.getTarget(c),f=i.has(d),m=i.has(u);if(f&&m){l.push(a.withEndpoints(c,d,u));continue}if(!f){let p=ZI(d,s,i,r);if(!p)continue;d=p}if(!m){let p=ZI(u,s,i,r);if(!p)continue;u=p}d!==u&&l.push(a.withEndpoints(c,d,u))}return l}var JI=dt(()=>{"use strict";U1()});var nP={};ue(nP,{collapseSitemapTree:()=>Jit});function eP(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(eP),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function Jit(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=yu(t.roots,e,tP),o=QI(t.roots,n,t.edges,e,tP,Qit);return{parsed:{...t,roots:n,edges:o},hiddenCounts:r}}var tP,Qit,rP=dt(()=>{"use strict";U1();JI();tP={getId:t=>t.id,getChildren:t=>t.children,clone:eP,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer},Qit={getSource:t=>t.sourceId,getTarget:t=>t.targetId,withEndpoints:(t,e,n)=>({...t,sourceId:e,targetId:n})}});var iP={};ue(iP,{renderSitemap:()=>aP,renderSitemapForExport:()=>ust});function ast(t,e,n,r){let o=n??t.primary;return ee(t,o,e,{mode:r})}function ist(t,e){return e??t.primary}function sst(t,e,n){return n?vt(n,Ie(t,e),10):vt(t.surface,t.bg,40)}function lst(t,e){return e??t.textMuted}function aP(t,e,n,r,o,a,i,s,l,c){It(t).selectAll(":not([data-d3-tooltip])").remove();let d=i?.width??t.clientWidth,u=i?.height??t.clientHeight;if(d<=0||u<=0)return;let f=Le.identity(),m=f.aesthetic(tst),p=f.text(13),h=f.text(11),g=f.structural(16),x=f.structural(28),y=f.structural(6),b=f.structural(1.5),w=f.structural(1.5),k=f.text(rst),C=f.text(13),v=f.text(11),_=f.structural(16),R=f.structural(28),L=f.text(20),E=f.structural(nst),M=f.structural(6),S=f.aesthetic(ost),T=or(e.options),N=n.legend.length>0&&!T,I=n.legend.length>0&&T,G=Se+Mn,$=!!e.title&&e.options["no-title"]!=="on",A=!i&&N,D=A&&$,O=D?E:0,P=f.structural(A?ir({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:_o+Ha},d):Se),H=A?P+S:0,W=vo(e.options),B=W&&D?cr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:c?"export":"preview",capsulePillAddonWidth:_o+Ha},{activeGroup:s??null},d):{width:0,height:0},q=nr({requested:W,title:e.title??"",hasLegend:D,legendWidth:B.width,legendHeight:B.height,containerWidth:d,titleBandHeight:O,legendReserve:H,titleBaselineY:m+L,titleFontSize:L}),V=q.inline?O:O+H,X=0,z=!D&&$?E:0,U=n.width,Y=n.height+z;(A||I)&&(Y-=G);let K=u-m*2-V-X,et=(d-m*2)/U,nt=K/Y,J=Math.min(est,et,nt),F=U*J,j=(d-F)/2,Q=m+V,Z=It(t).append("svg").attr("width",d).attr("height",u).attr("viewBox",`0 0 ${d} ${u}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);f.isBelowFloor&&Z.attr("width","100%");let ot=Z.append("defs");ot.append("marker").attr("id","sm-arrow").attr("viewBox",`0 0 ${Ol} ${ns}`).attr("refX",Ol).attr("refY",ns/2).attr("markerWidth",Ol).attr("markerHeight",ns).attr("orient","auto").append("polygon").attr("points",`0,0 ${Ol},${ns/2} 0,${ns}`).attr("fill",r.textMuted);let at=new Set;for(let st of at){let ct=`sm-arrow-${st.replace("#","")}`;ot.append("marker").attr("id",ct).attr("viewBox",`0 0 ${Ol} ${ns}`).attr("refX",Ol).attr("refY",ns/2).attr("markerWidth",Ol).attr("markerHeight",ns).attr("orient","auto").append("polygon").attr("points",`0,0 ${Ol},${ns/2} 0,${ns}`).attr("fill",st)}let lt=Z.append("g").attr("transform",`translate(${j}, ${Q}) scale(${J})`);if(!D&&$){let st=lt.append("text").attr("x",U/2).attr("y",L).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",L).attr("font-weight","700").attr("class","sitemap-title chart-title");e.titleLineNumber&&(st.attr("data-line-number",e.titleLineNumber),a&&st.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),st.text(e.title)}let rt=A?-G:0,ut=lt.append("g").attr("transform",`translate(0, ${z+rt})`),tt=new Map,it=new Map;for(let st of e.tagGroups){tt.set(Bt(st.name),st.name);for(let ct of st.entries)it.set(`${Bt(st.name)}:${ct.value.toLowerCase()}`,ct.color)}for(let st of n.containers){let ct=ut.append("g").attr("transform",`translate(${st.x}, ${st.y})`).attr("class","sitemap-container").attr("data-line-number",String(st.lineNumber));if(st.hasChildren&&ct.attr("data-node-toggle",st.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!st.hiddenCount)).attr("aria-label",st.label),a&&ct.style("cursor","pointer").on("click",()=>a(st.lineNumber)),s){let gt=Bt(s),Et=st.tagMetadata[gt];Et&&ct.attr(`data-tag-${gt}`,Et.toLowerCase())}let pt=sst(r,o,st.color),mt=lst(r,st.color);ct.append("rect").attr("x",0).attr("y",0).attr("width",st.width).attr("height",st.height).attr("rx",8).attr("fill",pt).attr("stroke",mt).attr("stroke-opacity",.35).attr("stroke-width",w),ct.append("text").attr("x",st.width/2).attr("y",R/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",r.text).attr("font-size",C).attr("font-weight","bold").text(st.label);let bt=Object.entries(st.metadata);if(bt.length>0){let gt=bt.map(([_t])=>tt.get(_t)??_t),ft=10+Math.max(...gt.map(_t=>Tt(`${_t}: `,v))),kt=R+v-2;for(let _t=0;_t<bt.length;_t++){let[yt,St]=bt[_t],Ct=gt[_t],ht=kt+_t*_,Pt=it.get(`${yt}:${St.toLowerCase()}`)??r.text;ct.append("text").attr("x",10).attr("y",ht).attr("fill",r.textMuted).attr("font-size",v).text(`${Ct}: `),ct.append("text").attr("x",ft).attr("y",ht).attr("fill",Pt).attr("font-size",v).text(St)}}if(!i&&st.hiddenCount&&st.hiddenCount>0){let gt=`clip-${st.nodeId}`;ct.append("clipPath").attr("id",gt).append("rect").attr("width",st.width).attr("height",st.height).attr("rx",8),ct.append("rect").attr("y",st.height-M).attr("width",st.width).attr("height",M).attr("fill",mt).attr("clip-path",`url(#${gt})`).attr("class","sitemap-collapse-bar")}}for(let st of n.edges){if(st.points.length<2)continue;let ct=ut.append("g").attr("class","sitemap-edge-group").attr("data-line-number",String(st.lineNumber)).attr("data-from",st.sourceId).attr("data-to",st.targetId),pt=r.textMuted,mt="sm-arrow",gt=(st.deferred?dst:cst)(st.points);if(gt&&ct.append("path").attr("d",gt).attr("fill","none").attr("stroke",pt).attr("stroke-width",b).attr("marker-end",`url(#${mt})`).attr("class","sitemap-edge"),st.label&&st.points.length>=2){let Et=st.points[Math.floor(st.points.length/2)],ft=Tt(st.label,k)+10,kt=k+6;ct.append("rect").attr("x",Et.x-ft/2).attr("y",Et.y-kt/2-1).attr("width",ft).attr("height",kt).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","sitemap-edge-label-bg"),ct.append("text").attr("x",Et.x).attr("y",Et.y+4).attr("text-anchor","middle").attr("fill",pt).attr("font-size",k).attr("class","sitemap-edge-label").text(st.label)}}for(let st of n.nodes){let ct=ut.append("g").attr("transform",`translate(${st.x-st.width/2}, ${st.y})`).attr("class","sitemap-node").attr("data-line-number",String(st.lineNumber)).attr("data-node-id",st.id);if(st.hasChildren&&ct.attr("data-node-toggle",st.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!st.hiddenCount)),a&&ct.style("cursor","pointer").on("click",()=>a(st.lineNumber)),s){let ft=Bt(s),kt=st.tagMetadata[ft];kt&&ct.attr(`data-tag-${ft}`,kt.toLowerCase())}let pt=mn(e.options),mt=ast(r,o,st.color,pt),bt=ist(r,st.color),gt=pe(mt,r.textOnFillLight,r.textOnFillDark);Os(ct,{width:st.width,height:st.height,rx:6,fill:mt,stroke:bt,strokeWidth:w,label:st.label,labelColor:gt,labelFontSize:p,headerHeight:x});let Et=Object.entries(st.metadata);if(Et.length>0){ct.append("line").attr("x1",0).attr("y1",x).attr("x2",st.width).attr("y2",x).attr("stroke",pt==="solid"?gt:bt).attr("stroke-opacity",.3);let ft=Et.map(([yt])=>tt.get(yt)??yt),_t=10+Math.max(...ft.map(yt=>Tt(`${yt}: `,h)));for(let yt=0;yt<Et.length;yt++){let[St,Ct]=Et[yt],ht=ft[yt],Pt=x+y+(yt+1)*g-4,Dt=it.get(`${St}:${Ct.toLowerCase()}`),qt=pt==="solid"?gt:Dt??gt;ct.append("text").attr("x",10).attr("y",Pt).attr("fill",gt).attr("font-size",h).text(`${ht}:`),ct.append("text").attr("x",_t).attr("y",Pt).attr("fill",qt).attr("font-size",h).text(Ct)}}if(st.description&&st.description.length>0){let ft=Object.keys(st.metadata).length,kt=ft>0?x+y+ft*g:x;ct.append("line").attr("x1",0).attr("y1",kt).attr("x2",st.width).attr("y2",kt).attr("stroke",pt==="solid"?gt:bt).attr("stroke-opacity",.3);let _t=x+y+ft*g;for(let yt=0;yt<st.description.length;yt++){let St=la(st.description[yt]),Ct=_t+(yt+1)*g-4,ht=ct.append("text").attr("x",10).attr("y",Ct).attr("fill",gt).attr("font-size",h);pn(ht,St,r,h)}}if(!i&&st.hiddenCount&&st.hiddenCount>0){let ft=`clip-${st.id}`;ct.append("clipPath").attr("id",ft).append("rect").attr("width",st.width).attr("height",st.height).attr("rx",6),ct.append("rect").attr("y",st.height-M).attr("width",st.width).attr("height",M).attr("fill",pt==="solid"?gt:st.color??r.primary).attr("opacity",.5).attr("clip-path",`url(#${ft})`)}}if(i&&N&&oP(ut,n.legend,r,o,s,void 0,l,c),D){let st=Z.append("text").attr("x",q.titleX).attr("y",m+L).attr("text-anchor",q.titleAnchor).attr("fill",r.text).attr("font-size",L).attr("font-weight","700").attr("class","sitemap-title chart-title").style("font-family",Mt);e.titleLineNumber&&(st.attr("data-line-number",e.titleLineNumber),a&&st.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),st.text(e.title)}if(A){let st=Z.append("g").attr("class","sitemap-legend-fixed").attr("transform",q.inline?`translate(${q.legendX}, ${q.legendY})`:`translate(0, ${m+O})`);s&&st.attr("data-legend-active",Bt(s)),oP(st,n.legend,r,o,s,d,l,c,q.inline)}}function oP(t,e,n,r,o,a,i,s,l){if(e.length===0)return;let c=e.map(p=>({name:p.name,entries:p.entries.map(h=>({value:h.value,color:h.color}))})),d=a!=null,u=d?_o+Ha:0,f=a??e[0].x+(e[0].width??200),m=tn(t,{groups:c,activeGroup:o??null,mode:s?"export":"preview",position:{placement:"top-center",titleRelation:l?"inline-with-title":"below-title"},capsulePillAddonWidth:u,palette:n,isDark:r,width:f});if(t.selectAll("[data-legend-group]").classed("sitemap-legend-group",!0),d){let p=m.getLayout();if(p.activeCapsule?.addonX!=null){let h=p.activeCapsule,g=Bt(h.groupName),x=i?.has(g)??!1,y=t.select(`[data-legend-group="${g}"]`);if(!y.empty()){let b=h.addonX,w=(Se-_o)/2,k=6,C=y.append("g").attr("class","sitemap-legend-eye").attr("data-legend-visibility",g).style("cursor","pointer").attr("opacity",x?.4:.7);C.append("rect").attr("x",b-k).attr("y",w-k).attr("width",_o+k*2).attr("height",_o+k*2).attr("fill","transparent").attr("pointer-events","all"),C.append("path").attr("d",x?r1:n1).attr("transform",`translate(${b}, ${w})`).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}async function ust(t,e,n){let{parseSitemap:r}=await Promise.resolve().then(()=>(g1(),m5)),{layoutSitemap:o}=await Promise.resolve().then(()=>(Zx(),Kx)),{getPalette:a}=await Promise.resolve().then(()=>(pi(),_b)),i=e==="dark",s=n??(i?a("nord").dark:a("nord").light),l=r(t,s);if(l.error||l.roots.length===0)return"";let c=o(l,void 0,null,void 0,!0),d=20,u=l.title?30:0,f=c.width+d*2,m=c.height+d*2+u,p=document.createElement("div");p.style.width=`${f}px`,p.style.height=`${m}px`,p.style.position="absolute",p.style.left="-9999px",document.body.appendChild(p),aP(p,l,c,s,i,void 0,{width:f,height:m});let h=p.querySelector("svg");if(!h)return document.body.removeChild(p),"";e==="transparent"?h.style.background="none":h.style.background||(h.style.background=s.bg),h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.style.fontFamily=Mt;let g=Fr(h);return document.body.removeChild(p),g}var tst,est,nst,Ol,ns,rst,ost,cst,dst,sP=dt(()=>{"use strict";fi();Oe();Ae();ko();Nn();Fo();Ke();Fe();co();Fa();Ve();pr();Mr();qr();wr();F1();tst=20,est=3,nst=30,Ol=10,ns=7,rst=11,ost=8;cst=lr().x(t=>t.x).y(t=>t.y).curve(To),dst=lr().x(t=>t.x).y(t=>t.y).curve(bc)});function A0(t){return t.toLowerCase()===fst}var fst,lP=dt(()=>{"use strict";fst="archive"});var gP={};ue(gP,{renderKanban:()=>hP,renderKanbanForExport:()=>mst});function B0(t,e,n){let r=[];for(let o of e){if(n?.includes(o.name.toLowerCase()))continue;let i=t.tags[Bt(o.name)]??o.defaultValue;if(!i)continue;let s=o.entries.find(l=>l.value.toLowerCase()===i.toLowerCase());r.push({label:o.name,value:i,...s?.color!==void 0&&{color:s.color}})}return r}function mP(t,e,n){if(!n)return t.color;let r=e.find(s=>s.name.toLowerCase()===n.toLowerCase());if(!r)return t.color;let a=t.tags[Bt(r.name)]??r.defaultValue;return a?r.entries.find(s=>s.value.toLowerCase()===a.toLowerCase())?.color:void 0}function pP(t,e,n,r,o=Q1,a=O0,i=$0,s=t7,l=R0,c=I0,d=D0,u=Lu,f=vu,m=Mu,p=Su,h=G0,g=P0,x=Qx,y=J1,b=q0){let k=!!t.title&&t.options["no-title"]!=="on"?a+8:0,C=o+k,v=[],_=0,R=t.columns.filter(S=>!A0(S.name));for(let S of R){if(n?.has(S.id)??!1){v.push({x:0,y:C,width:b,height:0,column:S,cardLayouts:[]});continue}let N=Tt(S.name,s,{bold:!0}),I=[],G=l+c;for(let D of S.cards){let O=Tt(D.title,i);N=Math.max(N,O+d*2);let P=B0(D,t.tagGroups,r),H=P.length+D.details.length,W=H>0?f+1+u+H*m:0,B=p+u+W;for(let q of P){let V=Tt(`${q.label}: ${q.value}`,h)+d*2;N=Math.max(N,V)}I.push({x:c,y:G,width:0,height:B,card:D}),G+=B+g}let $=Math.max(x,N+c*2);for(let D of I)D.width=$-c*2;let A=G+c;_=Math.max(_,A),v.push({x:0,y:C,width:$,height:A,column:S,cardLayouts:I})}let L=o;for(let S of v)S.x=L,S.height=_,L+=S.width+y;let E=L-y+o,M=C+_+o;return{columns:v,totalWidth:E,totalHeight:M}}function hP(t,e,n,r,o){let a=o?.exportDims,i=o?.activeTagGroup??null,s=o?.onSwimlaneChange,l=o?.collapsedLanes,c=o?.collapsedColumns??new Set(e.columns.filter(Q=>Q.collapsed).map(Q=>Q.id)),d=o?.compactMeta??!1,u=mn(e.options),f=Ie(n,r),m=vt(n.border,f,20),p=o?.currentSwimlaneGroup??null,h=p?e.tagGroups.find(Q=>Q.name.toLowerCase()===p.toLowerCase())??null:null,g=[];d&&(i&&g.push(i.toLowerCase()),p&&g.push(p.toLowerCase()));let x=e.columns.filter(Q=>!A0(Q.name)),y=Math.max(1,x.length),b=y*Qx+(y-1)*J1+2*Q1,w=a?.width??t.getBoundingClientRect().width,k=a||w<=0?Le.identity():Le.from(w,b),C=k.aesthetic(Q1),v=k.aesthetic(J1),_=k.structural(R0),R=k.aesthetic(I0),L=k.structural(Qx),E=k.structural(Su),M=k.structural(Mu),S=k.structural(vu),T=k.aesthetic(P0),N=k.structural(6),I=k.aesthetic(D0),G=k.aesthetic(Lu),$=k.structural(Jx),A=k.structural(O0),D=k.text(t7),O=k.text($0),P=k.text(G0),H=k.text(dP),W=k.structural(uP),B=k.structural(fP),q=k.structural(q0),V=k.structural(e7),X=k.text(20),z=k.structural(n7),U=k.aesthetic(r7),Y=pP(e,n,c,g,C,A,O,D,_,R,I,G,S,M,E,P,T,L,v,q),K=a?.width??Y.totalWidth,et=a?.height??Y.totalHeight;t.innerHTML="";let nt=It(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",K).attr("height",et).attr("viewBox",`0 0 ${K} ${et}`).attr("preserveAspectRatio","xMidYMin meet").attr("font-family",Mt).style("background",n.bg);k.isBelowFloor&&nt.attr("width","100%");let J=!!e.title&&e.options["no-title"]!=="on";if(J&&nt.append("text").attr("class","chart-title").attr("data-line-number",e.titleLineNumber??0).attr("x",C).attr("y",C+X).attr("font-size",X).attr("font-weight","700").attr("fill",n.text).text(e.title),e.tagGroups.length>0&&!or(e.options)){let Q=J?We(e.title,X)+16:0,Z=C+Q,ot={groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:o?.exportMode?"export":"preview"},at=ir(ot,K-Z-C),lt=C+(X-at)/2,rt=nt.append("g").attr("class","kanban-legend").attr("transform",`translate(${Z},${lt})`),tt=!!s&&!a?{onGroupRendered:(it,st,ct)=>{let pt=h?.name.toLowerCase()===it.toLowerCase(),mt=We(it,11),bt=ct?10+mt+6:8+mt+4,gt=(Se-7)/2,Et=pst(st,bt,gt,pt,n);Et.append("title").text(`Group by ${it}`),Et.style("cursor","pointer").on("click",ft=>{ft.stopPropagation(),s?.(pt?null:it)})}}:void 0;tn(rt,{...ot,palette:n,isDark:r,width:K-Z-C,activeGroup:i??null,...tt!==void 0&&{callbacks:tt}})}if(h){yst(nt,e,Y,h,n,r,i,l,c,g,C,A,z,v,q,_,R,E,G,T,V,U,S,M,D,W,B,H,N,I,$,O,P);return}let F=r?vt(n.surface,n.bg,50):vt(n.surface,n.bg,30),j=r?vt(n.surface,n.bg,70):vt(n.surface,n.bg,50);for(let Q of Y.columns){let Z=Q.column,ot=c?.has(Z.id)??!1,at=nt.append("g").attr("class","kanban-column").attr("data-column-id",Z.id).attr("data-line-number",Z.lineNumber),lt=F,rt=Z.color?ee(n,Z.color,r,{mode:u}):j,ut=Z.color?pe(rt,n.textOnFillLight,n.textOnFillDark):n.text;if(ot){at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",q).attr("height",Q.height).attr("rx",W).attr("fill",u==="outline"?f:lt).call(tt=>{u==="outline"&&tt.attr("stroke",m).attr("stroke-width",1)}),at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",q).attr("height",_).attr("rx",B).attr("fill",rt),at.append("text").attr("x",Q.x+q/2).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("font-size",H).attr("font-weight","bold").attr("fill",Z.color?ut:n.textMuted).attr("text-anchor","middle").text(String(Z.cards.length)),at.append("text").attr("x",Q.x+q/2).attr("y",Q.y+_+R).attr("font-size",O).attr("font-weight","bold").attr("fill",n.text).attr("text-anchor","middle").attr("writing-mode","tb").text(Z.name);continue}at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",Q.width).attr("height",Q.height).attr("rx",W).attr("fill",u==="outline"?f:lt).call(tt=>{u==="outline"&&tt.attr("stroke",m).attr("stroke-width",1)}),at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",Q.width).attr("height",_).attr("rx",B).attr("fill",rt),at.append("text").attr("x",Q.x+R).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("font-size",D).attr("font-weight","bold").attr("fill",ut).text(Z.name);{let tt=Z.wipLimit!=null&&Z.cards.length>Z.wipLimit,it=Z.wipLimit!=null?`${Z.cards.length}/${Z.wipLimit}`:String(Z.cards.length);at.append("text").attr("x",Q.x+Q.width-R).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("text-anchor","end").attr("font-size",H).attr("fill",tt?n.colors.red:Z.color?ut:n.textMuted).attr("font-weight",tt?"bold":"normal").text(it)}for(let tt of Q.cardLayouts){let it=tt.card,st=mP(it,e.tagGroups,i??null),ct=B0(it,e.tagGroups,g),pt=ct.length>0||it.details.length>0,mt=ee(n,st??n.primary,r,{mode:u}),bt=st??n.textMuted,gt=pe(mt,n.textOnFillLight,n.textOnFillDark),Et=at.append("g").attr("class","kanban-card").attr("data-card-id",it.id).attr("data-line-number",it.lineNumber);if(i){let yt=Bt(i),St=it.tags[yt],Ct=e.tagGroups.find(Pt=>Pt.name.toLowerCase()===yt),ht=St??Ct?.defaultValue;ht&&Et.attr(`data-tag-${yt}`,ht.toLowerCase())}let ft=Q.x+tt.x,kt=Q.y+tt.y;Et.append("rect").attr("x",ft).attr("y",kt).attr("width",tt.width).attr("height",tt.height).attr("rx",N).attr("fill",mt).attr("stroke",bt).attr("stroke-width",$);let _t=Et.append("text").attr("x",ft+I).attr("y",kt+G+O).attr("font-size",O).attr("font-weight","500").attr("fill",gt);if(pn(_t,it.title,n,O),pt){let yt=kt+E;Et.append("line").attr("x1",ft).attr("y1",yt).attr("x2",ft+tt.width).attr("y2",yt).attr("stroke",u==="solid"?gt:bt).attr("stroke-opacity",.3).attr("stroke-width",1);let St=yt+S+P;for(let Ct of ct){Et.append("text").attr("x",ft+I).attr("y",St).attr("font-size",P).attr("fill",gt).text(`${Ct.label}: `);let ht=Tt(`${Ct.label}: `,P);Et.append("text").attr("x",ft+I+ht).attr("y",St).attr("font-size",P).attr("fill",gt).text(Ct.value),St+=M}for(let Ct of it.details){let ht=Et.append("text").attr("x",ft+I).attr("y",St).attr("font-size",P).attr("fill",gt);pn(ht,Ct,n,P),St+=M}}}}}function mst(t,e,n){let r=Xd(t,n);if(r.error||r.columns.length===0)return"";let o=e==="dark",a=pP(r,n),i=document.createElement("div");hP(i,r,n,o,{exportDims:{width:a.totalWidth,height:a.totalHeight},exportMode:!0});let s=i.querySelector("svg");return s?Fr(s):""}function pst(t,e,n,r,o){let a=t.append("g").attr("class","kanban-swimlane-icon").attr("transform",`translate(${e}, ${n})`);a.append("rect").attr("x",-5).attr("y",-5).attr("width",22).attr("height",18).attr("fill","transparent");let i=r?o.primary:o.textMuted,s=r?1:.35,l=[8,12,6],c=2,d=3;for(let u=0;u<l.length;u++)a.append("rect").attr("x",0).attr("y",u*d).attr("width",l[u]).attr("height",c).attr("rx",1).attr("fill",i).attr("opacity",s);return a}function hst(t,e){let n=Bt(e.name),r=new Map;for(let a of e.entries)r.set(a.value.toLowerCase(),{laneName:a.value,laneColor:a.color,isFallback:!1,cellsByColumn:{}});let o=`__no_${n}__`;for(let a of t)for(let i of a.cards){let s=i.tags[n]??e.defaultValue,l;s&&r.has(s.toLowerCase())?l=s.toLowerCase():(r.has(o)||r.set(o,{laneName:`No ${e.name}`,isFallback:!0,cellsByColumn:{}}),l=o);let c=r.get(l);(c.cellsByColumn[a.id]??=[]).push(i)}return Array.from(r.values())}function cP(t,e,n,r=vu,o=Lu,a=Mu,i=Su){let l=B0(t,e,n).length+t.details.length,c=l>0?r+1+o+l*a:0;return i+o+c}function gst(t,e,n,r,o,a,i=Q1,s=O0,l=n7,c=J1,d=q0,u=R0,f=I0,m=Su,p=Lu,h=P0,g=e7,x=r7,y=vu,b=Mu){let w=t.title&&t.options["no-title"]!=="on"?s+8:0,k=i+w,C=[],v=i+l;for(let S of n.columns){let N=o?.has(S.column.id)??!1?d:S.width;C.push({column:S.column,x:v,width:N}),v+=N+c}let _=v-c+i,R=[],L=k+u+f,E=m+p+h;for(let S of e){if(r?.has(S.laneName)??!1){let A=C.map(D=>({column:D.column,cards:S.cellsByColumn[D.column.id]??[],cardLayouts:[]}));R.push({bucket:S,y:L,height:g,cells:A}),L+=g+x;continue}let N=E,I=[];for(let A of C){let D=o?.has(A.column.id)??!1,O=S.cellsByColumn[A.column.id]??[];if(D){I.push({column:A.column,cards:O,h:0});continue}let P=0;for(let H of O)P+=cP(H,t.tagGroups,a,y,p,b,m)+h;P=Math.max(P-(O.length>0?h:0),0),I.push({column:A.column,cards:O,h:P}),P>N&&(N=P)}let G=Math.max(N,E),$=I.map((A,D)=>{let O=C[D];if(o?.has(O.column.id)??!1)return{column:A.column,cards:A.cards,cardLayouts:[]};let H=[],W=0;for(let B of A.cards){let q=cP(B,t.tagGroups,a,y,p,b,m);H.push({x:O.x+f,y:L+W,width:O.width-f*2,height:q,card:B}),W+=q+h}return{column:A.column,cards:A.cards,cardLayouts:H}});R.push({bucket:S,y:L,height:G,cells:$}),L+=G+x}let M=L-x+f+i;return{columnXs:C,lanes:R,totalWidth:_,totalHeight:M,startY:k}}function yst(t,e,n,r,o,a,i,s,l,c,d=Q1,u=O0,f=n7,m=J1,p=q0,h=R0,g=I0,x=Su,y=Lu,b=P0,w=e7,k=r7,C=vu,v=Mu,_=t7,R=uP,L=fP,E=dP,M=6,S=D0,T=Jx,N=$0,I=G0){let G=e.columns.filter(W=>!A0(W.name)),$=hst(G,r),A=gst(e,$,n,s,l,c,d,u,f,m,p,h,g,x,y,b,w,k,C,v),D=parseFloat(t.attr("width")||"0"),O=parseFloat(t.attr("height")||"0");A.totalWidth>D&&(t.attr("width",A.totalWidth),t.attr("viewBox",`0 0 ${A.totalWidth} ${Math.max(O,A.totalHeight)}`)),A.totalHeight>O&&(t.attr("height",A.totalHeight),t.attr("viewBox",`0 0 ${Math.max(D,A.totalWidth)} ${A.totalHeight}`));let P=a?vt(o.surface,o.bg,50):vt(o.surface,o.bg,30),H=a?vt(o.surface,o.bg,70):vt(o.surface,o.bg,50);for(let W of A.columnXs){let B=W.column,q=l?.has(B.id)??!1,V=t.append("g").attr("class","kanban-column kanban-column-header").attr("data-column-id",B.id).attr("data-line-number",B.lineNumber),X=B.color?ee(o,B.color,a,{mode:mn(e.options)}):H;if(V.append("rect").attr("x",W.x).attr("y",A.startY).attr("width",W.width).attr("height",h).attr("rx",L).attr("fill",X),q)V.append("text").attr("x",W.x+W.width/2).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(B.cards.length));else{V.append("text").attr("x",W.x+g).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("font-size",_).attr("font-weight","bold").attr("fill",o.text).text(B.name);let z=B.wipLimit!=null&&B.cards.length>B.wipLimit,U=B.wipLimit!=null?`${B.cards.length}/${B.wipLimit}`:String(B.cards.length);V.append("text").attr("x",W.x+W.width-g).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("text-anchor","end").attr("font-size",E).attr("fill",z?o.colors.red:o.textMuted).attr("font-weight",z?"bold":"normal").text(U)}}for(let W of A.lanes){let B=s?.has(W.bucket.laneName)??!1,q=t.append("g").attr("class","kanban-lane").attr("data-lane-name",W.bucket.laneName),V=q.append("g").attr("class","kanban-lane-header").attr("transform",`translate(${d}, ${W.y-g})`);V.append("rect").attr("x",0).attr("y",0).attr("width",f-8).attr("height",W.height+g*2).attr("rx",R).attr("fill",P);let X=10,z=W.cells.reduce((U,Y)=>U+Y.cards.length,0);if(W.bucket.laneColor&&(V.append("circle").attr("cx",X+4).attr("cy",16).attr("r",4).attr("fill",W.bucket.laneColor),X+=14),B?V.append("text").attr("x",X).attr("y",20).attr("font-size",10).attr("fill",o.textMuted).text(`${W.bucket.laneName} (${z})`):V.append("text").attr("x",X).attr("y",20).attr("font-size",12).attr("font-weight","bold").attr("fill",W.bucket.isFallback?o.textMuted:o.text).text(W.bucket.laneName),B)for(let U of W.cells){let Y=l?.has(U.column.id)??!1;if(U.cards.length>0){let K=A.columnXs.find(J=>J.column.id===U.column.id);if(!K)continue;let et=W.bucket.laneColor?vt(W.bucket.laneColor,o.bg,a?40:28):vt(o.textMuted,o.bg,a?28:22),nt=Y?p-8:K.width-g*2;q.append("rect").attr("x",K.x+(Y?4:g)).attr("y",W.y).attr("width",nt).attr("height",18).attr("rx",4).attr("fill",et),q.append("text").attr("x",K.x+(Y?4:g)+nt/2).attr("y",W.y+13).attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(U.cards.length))}}if(q.append("line").attr("x1",d+f).attr("x2",A.totalWidth-d).attr("y1",W.y+W.height+g).attr("y2",W.y+W.height+g).attr("stroke",o.border??o.textMuted).attr("stroke-opacity",.4).attr("stroke-width",1),!B)for(let U of W.cells){if((l?.has(U.column.id)??!1)&&U.cards.length>0){let K=A.columnXs.find(et=>et.column.id===U.column.id);if(K){let et=W.bucket.laneColor?vt(W.bucket.laneColor,o.bg,a?40:28):vt(o.textMuted,o.bg,a?28:22);q.append("rect").attr("x",K.x+4).attr("y",W.y).attr("width",p-8).attr("height",22).attr("rx",4).attr("fill",et),q.append("text").attr("x",K.x+p/2).attr("y",W.y+16).attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(U.cards.length))}continue}for(let K of U.cardLayouts)bst(q,K,e.tagGroups,i,o,a,c,mn(e.options),M,S,y,T,N,I,x,C,v)}}}function bst(t,e,n,r,o,a,i,s,l=6,c=D0,d=Lu,u=Jx,f=$0,m=G0,p=Su,h=vu,g=Mu){let x=e.card,y=mP(x,n,r),b=B0(x,n,i),w=b.length>0||x.details.length>0,k=ee(o,y??o.primary,a,{mode:s}),C=y??o.textMuted,v=pe(k,o.textOnFillLight,o.textOnFillDark),_=t.append("g").attr("class","kanban-card").attr("data-card-id",x.id).attr("data-line-number",x.lineNumber);if(r){let M=Bt(r),S=n.find(N=>N.name.toLowerCase()===M),T=x.tags[M]??S?.defaultValue;T&&_.attr(`data-tag-${M}`,T.toLowerCase())}let R=e.x,L=e.y;_.append("rect").attr("x",R).attr("y",L).attr("width",e.width).attr("height",e.height).attr("rx",l).attr("fill",k).attr("stroke",C).attr("stroke-width",u);let E=_.append("text").attr("x",R+c).attr("y",L+d+f).attr("font-size",f).attr("font-weight","500").attr("fill",v);if(pn(E,x.title,o,f),w){let M=L+p;_.append("line").attr("x1",R).attr("y1",M).attr("x2",R+e.width).attr("y2",M).attr("stroke",C).attr("stroke-opacity",.3).attr("stroke-width",1);let S=M+h+m;for(let T of b){_.append("text").attr("x",R+c).attr("y",S).attr("font-size",m).attr("fill",o.textMuted).text(`${T.label}: `);let N=Tt(`${T.label}: `,m);_.append("text").attr("x",R+c+N).attr("y",S).attr("font-size",m).attr("fill",v).text(T.value),S+=g}for(let T of x.details){let N=_.append("text").attr("x",R+c).attr("y",S).attr("font-size",m).attr("fill",o.textMuted);pn(N,T,o,m),S+=g}}}var Q1,J1,R0,I0,Qx,Su,Mu,vu,P0,D0,Lu,Jx,O0,t7,$0,G0,dP,uP,fP,q0,e7,n7,r7,yP=dt(()=>{"use strict";fi();Oe();Ae();Nn();Ke();Fe();co();wg();lP();pr();qr();Ae();Mr();wr();Ve();Q1=20,J1=16,R0=36,I0=12,Qx=200,Su=24,Mu=14,vu=4,P0=8,D0=10,Lu=6,Jx=1.5,O0=30,t7=13,$0=12,G0=10,dP=10,uP=8,fP=8,q0=40,e7=26;n7=140,r7=14});var xP={};ue(xP,{layoutClassDiagram:()=>a7});function Mst(t){let e=t.members.filter(d=>!d.isMethod),n=t.members.filter(d=>d.isMethod),r=t.modifier==="enum",o=Tt(t.name,kst,{bold:!0});t.modifier&&(o=Math.max(o,Tt(`\xAB${t.modifier}\xBB`,bP)));for(let d of t.members){let u=d.name;d.isMethod?(u+=`(${d.params??""})`,d.type&&(u+=`: ${d.type}`)):d.type&&(u+=`: ${d.type}`),u=`+ ${u}`,o=Math.max(o,Tt(u,bP))}let a=Math.max(xst,o+wst),i=Est+(t.modifier?Sst:0),s;if(r){let d=t.members;d.length>0?s=Cu*2+d.length*o7+Nu:s=Nu+Cu}else e.length>0?s=Cu*2+e.length*o7+Nu:s=Nu+Cu;let l=0;r||(n.length>0?l=Cu*2+n.length*o7+Nu:l=Nu+Cu);let c=i+s+l;return{width:a,height:c,headerHeight:i,fieldsHeight:s,methodsHeight:l}}function a7(t,e){if(t.classes.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new dr.graphlib.Graph;n.setGraph({rankdir:"TB",nodesep:60,ranksep:80,edgesep:20}),n.setDefaultEdgeLabel(()=>({}));let r=new Map;for(let k of t.classes){let C=Mst(k);r.set(k.id,C),n.setNode(k.id,{label:k.name,width:C.width,height:C.height})}for(let k of t.relationships)n.setEdge(k.source,k.target,{label:k.label??""});dr.layout(n);let a=t.options?.["no-notes"]==="on"||!t.notes?new Map:wo(t.notes,t.classes.map(k=>({id:k.id,label:k.name}))),i=Od(t.classes.map(k=>{let C=n.node(k.id);return{id:k.id,x:C.x,y:C.y,width:C.width,height:C.height}}),a,"TB",e?.collapsedNotes),s=t.classes.map(k=>{let C=n.node(k.id),v=r.get(k.id),_=i.get(k.id);return{...k,x:C.x,y:C.y,width:v.width,height:v.height,headerHeight:v.headerHeight,fieldsHeight:v.fieldsHeight,methodsHeight:v.methodsHeight,..._&&{note:_}}}),l=t.relationships.map(k=>{let C=n.edge(k.source,k.target);return{source:k.source,target:k.target,type:k.type,points:C?.points??[],...k.label!==void 0&&{label:k.label},lineNumber:k.lineNumber}}),c=1/0,d=1/0,u=-1/0,f=-1/0,m=(k,C,v,_)=>{k<c&&(c=k),C<d&&(d=C),v>u&&(u=v),_>f&&(f=_)};for(let k of s)m(k.x-k.width/2,k.y-k.height/2,k.x+k.width/2,k.y+k.height/2),k.note&&!k.note.collapsed&&m(k.x+k.note.x,k.y+k.note.y,k.x+k.note.x+k.note.width,k.y+k.note.y+k.note.height);Number.isFinite(c)||(c=0,d=0,u=0,f=0);let{shiftX:p,shiftY:h}=xl(c,d),g=p!==0||h!==0,x=g?s.map(k=>({...k,x:k.x+p,y:k.y+h})):s,y=g?l.map(k=>({...k,points:k.points.map(C=>({x:C.x+p,y:C.y+h}))})):l,b=u+p+40,w=f+h+40;return{nodes:x,edges:y,width:b,height:w}}var xst,wst,Est,kst,bP,Sst,o7,Cu,Nu,i7=dt(()=>{"use strict";$s();Ve();_s();xst=140,wst=24,Est=36,kst=13,bP=11,Sst=16,o7=18,Cu=8,Nu=1});var MP={};ue(MP,{renderClassDiagram:()=>SP,renderClassDiagramForExport:()=>Hst});function EP(t,e,n){if(n)return e.textMuted;switch(t){case"interface":return e.colors.blue;case"abstract":return e.colors.purple;case"enum":return e.colors.yellow;default:return e.colors.teal}}function Rst(t,e,n,r,o,a){let i=r??EP(n,t,o);return ee(t,i,e,{mode:a})}function Ist(t,e,n,r){return n??EP(e,t,r)}function kP(t){if(t.options?.["no-auto-color"])return[];let e=new Set;for(let n of t.classes)n.color||e.add(n.modifier??"class");return Dst.filter(n=>e.has(n)).map(n=>Pst[n])}function Ost(t){return t??"class"}function wP(t){switch(t){case"public":return"+";case"private":return"-";case"protected":return"#"}}function Gst(t){return t==="implements"||t==="depends"}function qst(t){switch(t){case"extends":return"cd-arrow-inherit";case"implements":return"cd-arrow-implement";case"composes":return"cd-arrow-compose";case"aggregates":return"cd-arrow-aggregate";case"depends":return"cd-arrow-depend";case"associates":return"cd-arrow-assoc"}}function Bst(t){return t==="composes"||t==="aggregates"}function SP(t,e,n,r,o,a,i,s,l){It(t).selectAll(":not([data-d3-tooltip])").remove();let c=i?.width??t.clientWidth,d=i?.height??t.clientHeight;if(c<=0||d<=0)return;let u=Le.identity(),f=u.aesthetic(l7),m=u.text(Lst),p=u.text(Cst),h=u.text(Nst),g=u.structural(1.5),x=u.structural(1.5),y=u.structural(Tst),b=u.structural(_st),w=u.structural(Ast),k=u.text(20),C=u.structural(30),v=u.structural(Se),_=kP(e),R=_.length>1&&!or(e.options),L=!!e.title&&e.options["no-title"]!=="on",E=L?40:0,S=u.aesthetic(8),T=R?v+S:0,N=s!==!1,I=[{name:s7,entries:_.map(F=>({value:F.label,color:r.colors[F.colorKey]}))}],G=vo(e.options),$=G&&R?cr({groups:I,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:l?"export":"preview"},{activeGroup:N?s7:null},c):{width:0,height:0},A=nr({requested:G,title:e.title??"",hasLegend:R,legendWidth:$.width,legendHeight:$.height,containerWidth:c,titleBandHeight:E,legendReserve:T,titleBaselineY:C,titleFontSize:k}),D=n.width,O=n.height,P=d-E-(A.inline?0:T),H=(c-f*2)/D,W=(P-f*2)/O,B=Math.min(vst,H,W),q=D*B,V=(c-q)/2,X=E+(A.inline?0:T)+f,z=It(t).append("svg").attr("width",c).attr("height",d).attr("viewBox",`0 0 ${c} ${d}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);u.isBelowFloor&&z.attr("width","100%");let U=z.append("defs"),Y=12,K=8;U.append("marker").attr("id","cd-arrow-inherit").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-implement").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1);let et=12,nt=8;if(U.append("marker").attr("id","cd-arrow-compose").attr("viewBox",`0 0 ${et} ${nt}`).attr("refX",0).attr("refY",nt/2).attr("markerWidth",et).attr("markerHeight",nt).attr("orient","auto").append("polygon").attr("points",`${et/2},0 ${et},${nt/2} ${et/2},${nt} 0,${nt/2}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-aggregate").attr("viewBox",`0 0 ${et} ${nt}`).attr("refX",0).attr("refY",nt/2).attr("markerWidth",et).attr("markerHeight",nt).attr("orient","auto").append("polygon").attr("points",`${et/2},0 ${et},${nt/2} ${et/2},${nt} 0,${nt/2}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-depend").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),U.append("marker").attr("id","cd-arrow-assoc").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),L){let F=z.append("text").attr("class","chart-title").attr("x",A.titleX).attr("y",C).attr("text-anchor",A.titleAnchor).attr("fill",r.text).attr("font-size",k).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(F.attr("data-line-number",e.titleLineNumber),a&&F.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}if(R){let F=z.append("g").attr("class","cd-legend").attr("transform",A.inline?`translate(${A.legendX}, ${A.legendY})`:`translate(0,${E})`);tn(F,{groups:I,activeGroup:N?s7:null,mode:l?"export":"preview",position:{placement:"top-center",titleRelation:A.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:c})}let J=z.append("g").attr("transform",`translate(${V}, ${X}) scale(${B})`);for(let F of n.edges){if(F.points.length<2)continue;let j=J.append("g").attr("class","cd-edge-group").attr("data-line-number",String(F.lineNumber)).attr("data-source",F.source).attr("data-target",F.target),Q=r.textMuted,Z=qst(F.type),ot=Gst(F.type),at=Bst(F.type),lt=$st(F.points);if(lt){let rt=j.append("path").attr("d",lt).attr("fill","none").attr("stroke",Q).attr("stroke-width",g).attr("class","cd-edge");ot&&rt.attr("stroke-dasharray","6 3"),at?rt.attr("marker-start",`url(#${Z})`):rt.attr("marker-end",`url(#${Z})`)}if(F.label){let rt=Math.floor(F.points.length/2),ut=F.points[rt],tt=Tt(F.label,h)+8,it=16;j.append("rect").attr("x",ut.x-tt/2).attr("y",ut.y-it/2-1).attr("width",tt).attr("height",it).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","cd-edge-label-bg"),j.append("text").attr("x",ut.x).attr("y",ut.y+4).attr("text-anchor","middle").attr("fill",Q).attr("font-size",h).attr("class","cd-edge-label").text(F.label)}}for(let F of n.nodes){let j=J.append("g").attr("transform",`translate(${F.x}, ${F.y})`).attr("class","cd-class").attr("data-line-number",String(F.lineNumber)).attr("data-node-id",F.id).attr("data-cd-type",Ost(F.modifier));a&&j.style("cursor","pointer").on("click",()=>{a(F.lineNumber)});let Q=F.width,Z=F.height,ot=!!e.options?.["no-auto-color"],lt=R&&!N&&!F.color?r.primary:F.color,rt=mn(e.options??{}),ut=Rst(r,o,F.modifier,lt,ot,rt),tt=Ist(r,F.modifier,lt,ot),it=pe(ut,r.textOnFillLight,r.textOnFillDark);j.append("rect").attr("x",-Q/2).attr("y",-Z/2).attr("width",Q).attr("height",Z).attr("rx",3).attr("ry",3).attr("fill",ut).attr("stroke",tt).attr("stroke-width",x);let st=-Z/2,ct=st+F.headerHeight/2;if(F.modifier){let gt=`\xAB${F.modifier}\xBB`;j.append("text").attr("x",0).attr("y",ct-6).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",p).attr("font-style","italic").text(gt),j.append("text").attr("x",0).attr("y",ct+10).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",m).attr("font-weight","bold").attr("font-style",F.modifier==="abstract"?"italic":"normal").text(F.name)}else j.append("text").attr("x",0).attr("y",ct).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",m).attr("font-weight","bold").text(F.name);st+=F.headerHeight;let pt=F.modifier==="enum",mt=F.members.filter(gt=>!gt.isMethod),bt=F.members.filter(gt=>gt.isMethod);if(pt){j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5);let gt=st+b;for(let Et of F.members)j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p).text(Et.name),gt+=y}else{if(j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5),mt.length>0){let gt=st+b;for(let Et of mt){let kt=`${wP(Et.visibility)} ${Et.name}`;Et.type&&(kt+=`: ${Et.type}`);let _t=j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p);Et.isStatic&&_t.attr("text-decoration","underline"),_t.text(kt),gt+=y}}if(st+=F.fieldsHeight,j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5),bt.length>0){let gt=st+b;for(let Et of bt){let kt=`${wP(Et.visibility)} ${Et.name}(${Et.params??""})`;Et.type&&(kt+=`: ${Et.type}`);let _t=j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p);Et.isStatic&&_t.attr("text-decoration","underline"),_t.text(kt),gt+=y}}}if(F.note)if(F.note.collapsed)ji(j,{x:Q/2-sa-3,y:-Z/2+sa+3},r,{isDark:o,...F.note.color&&{color:F.note.color},lineNumber:F.note.lineNumber,endLineNumber:F.note.endLineNumber});else{let[gt,Et,ft,kt]=Ui({width:Q,height:Z},F.note);Vi(j,gt,Et,ft,kt,r),Xi(j,{x:F.note.x,y:F.note.y,width:F.note.width,height:F.note.height},F.note.lines,r,{isDark:o,...F.note.color&&{color:F.note.color},lineNumber:F.note.lineNumber,endLineNumber:F.note.endLineNumber,interactive:!0})}}}function Hst(t,e,n){let r=Bd(t,n);if(r.error||r.classes.length===0)return"";let o=a7(r),a=e==="dark",l=kP(r).length>1&&!or(r.options)?Se+8:0,c=o.width+l7*2,d=o.height+l7*2+(r.title?40:0)+l;return bu(c,d,u=>(SP(u,r,o,n,a,void 0,{width:c,height:d},!0,!0),xu(u,e,n)))}var l7,vst,Lst,Cst,Nst,Tst,_st,Ast,Pst,Dst,s7,$st,vP=dt(()=>{"use strict";Nn();Ae();Fo();Ke();M0();pr();Mr();qr();ko();Fe();m1();i7();wr();Ve();Ki();l7=20,vst=3,Lst=13,Cst=11,Nst=11,Tst=18,_st=8,Ast=10;Pst={class:{label:"Class",colorKey:"teal"},abstract:{label:"Abstract",colorKey:"purple"},interface:{label:"Interface",colorKey:"blue"},enum:{label:"Enum",colorKey:"yellow"}},Dst=["class","abstract","interface","enum"];s7="Type";$st=lr().x(t=>t.x).y(t=>t.y).curve(To)});var CP={};ue(CP,{layoutERDiagram:()=>u7});function Kst(t){let e=Tt(t.name,Wst,{bold:!0});for(let i of t.columns){let s=i.name;i.type&&(s+=`: ${i.type}`);let l=Tt(s,zst);i.constraints.length>0&&(l+=Vst),e=Math.max(e,l)}let n=Math.max(c7,e+Fst),r=d7,o=0;t.columns.length>0&&(o=Xst*2+t.columns.length*Ust+jst);let a=r+o+(o===0?4:0);return{width:n,height:a,headerHeight:r,columnsHeight:o}}function Zst(t,e){let n=new Map;for(let a of t)n.set(a,new Set);for(let a of e)n.get(a.source)?.add(a.target),n.get(a.target)?.add(a.source);let r=new Set,o=[];for(let a of t){if(r.has(a))continue;let i=[],s=[a];for(;s.length>0;){let l=s.shift();if(!r.has(l)){r.add(l),i.push(l);for(let c of n.get(l)??[])r.has(c)||s.push(c)}}o.push(i)}return o}function Qst(t,e,n){let r=new Map,o=new Map;if(t.length===1){let d=t[0],u=n.get(d.id);return r.set(d.id,{x:u.width/2,y:u.height/2,...u}),{nodePositions:r,edgePoints:o,width:u.width,height:u.height}}let a=new dr.graphlib.Graph({multigraph:!0});a.setGraph({rankdir:"LR",nodesep:40,ranksep:80,edgesep:20}),a.setDefaultEdgeLabel(()=>({}));for(let d of t){let u=n.get(d.id);a.setNode(d.id,{width:u.width,height:u.height})}for(let d of e)a.setEdge(d.source,d.target,{label:d.label??""},String(d.lineNumber));dr.layout(a);let i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of t){let u=a.node(d.id),f=n.get(d.id);i=Math.min(i,u.x-f.width/2),s=Math.min(s,u.y-f.height/2),l=Math.max(l,u.x+f.width/2),c=Math.max(c,u.y+f.height/2)}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));for(let f of u?.points??[])i=Math.min(i,f.x),s=Math.min(s,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y);if(d.label&&(u?.points??[]).length>0){let f=u.points,m=f[Math.floor(f.length/2)],p=(Tt(d.label,Yst)+8)/2;i=Math.min(i,m.x-p),l=Math.max(l,m.x+p)}}for(let d of t){let u=a.node(d.id),f=n.get(d.id);r.set(d.id,{x:u.x-i,y:u.y-s,...f})}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));o.set(d.lineNumber,(u?.points??[]).map(f=>({x:f.x-i,y:f.y-s})))}return{nodePositions:r,edgePoints:o,width:Math.max(0,l-i),height:Math.max(0,c-s)}}function Jst(t){if(t.length===0)return[];let e=[...t].sort((l,c)=>{let d=l.compIds.length>1?1:0,u=c.compIds.length>1?1:0;return d!==u?u-d:c.compLayout.height-l.compLayout.height}),n=t.reduce((l,c)=>l+(c.compLayout.width||c7)*(c.compLayout.height||d7),0),r=Math.max(Math.sqrt(n)*1.5,e[0].compLayout.width),o=[],a=0,i=0,s=0;for(let l of e){let c=l.compLayout.width||c7,d=l.compLayout.height||d7;a>0&&a+c>r&&(i+=s+LP,a=0,s=0),o.push({compIds:l.compIds,compLayout:l.compLayout,offsetX:a,offsetY:i}),a+=c+LP,s=Math.max(s,d)}return o}function u7(t,e){if(t.tables.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new Map;for(let R of t.tables)n.set(R.id,Kst(R));let r=Zst(t.tables.map(R=>R.id),t.relationships),o=new Map(t.tables.map(R=>[R.id,R])),a=r.map(R=>{let L=R.map(M=>o.get(M)),E=t.relationships.filter(M=>R.includes(M.source));return{compIds:R,compLayout:Qst(L,E,n)}}),i=Jst(a),s=new Map;for(let R of i)for(let L of R.compIds)s.set(L,R);let l=new Map;for(let R of i)for(let L of R.compLayout.edgePoints.keys())l.set(L,R);let c=t.tables.map(R=>{let L=s.get(R.id),E=L.compLayout.nodePositions.get(R.id);return{...R,x:E.x+L.offsetX+Tu,y:E.y+L.offsetY+Tu,width:E.width,height:E.height,headerHeight:E.headerHeight,columnsHeight:E.columnsHeight}}),d=t.relationships.map(R=>{let L=l.get(R.lineNumber),E=L?.compLayout.edgePoints.get(R.lineNumber)??[];return{source:R.source,target:R.target,cardinality:R.cardinality,points:E.map(M=>({x:M.x+(L?.offsetX??0)+Tu,y:M.y+(L?.offsetY??0)+Tu})),...R.label!==void 0&&{label:R.label},lineNumber:R.lineNumber}}),f=t.options?.["no-notes"]==="on"||!t.notes?new Map:wo(t.notes,t.tables.map(R=>({id:R.id,label:R.name}))),m=Od(c.map(R=>({id:R.id,x:R.x,y:R.y,width:R.width,height:R.height})),f,"TB",e?.collapsedNotes),p=c.map(R=>{let L=m.get(R.id);return L?{...R,note:L}:R}),h=1/0,g=1/0,x=-1/0,y=-1/0,b=(R,L,E,M)=>{R<h&&(h=R),L<g&&(g=L),E>x&&(x=E),M>y&&(y=M)};for(let R of p)b(R.x-R.width/2,R.y-R.height/2,R.x+R.width/2,R.y+R.height/2),R.note&&!R.note.collapsed&&b(R.x+R.note.x,R.y+R.note.y,R.x+R.note.x+R.note.width,R.y+R.note.y+R.note.height);for(let R of d)for(let L of R.points)b(L.x,L.y,L.x,L.y);Number.isFinite(h)||(h=0,g=0,x=0,y=0);let{shiftX:w,shiftY:k}=xl(h,g),C=w!==0||k!==0,v=C?p.map(R=>({...R,x:R.x+w,y:R.y+k})):p,_=C?d.map(R=>({...R,points:R.points.map(L=>({x:L.x+w,y:L.y+k}))})):d;return{nodes:v,edges:_,width:x+w+Tu,height:y+k+Tu}}var c7,Fst,d7,Wst,zst,Yst,Vst,Ust,Xst,jst,Tu,LP,f7=dt(()=>{"use strict";$s();Ve();_s();c7=140,Fst=24,d7=36,Wst=13,zst=11,Yst=11,Vst=16,Ust=18,Xst=8,jst=1,Tu=30,LP=60});function _P(t,e){let n=new Map;if(t.length===0)return n;let r={};for(let f of t)r[f.id]=0;for(let f of e)f.source!==f.target&&(f.cardinality.from==="1"&&f.cardinality.to!=="1"&&(r[f.source]=(r[f.source]??0)+1),f.cardinality.to==="1"&&f.cardinality.from!=="1"&&(r[f.target]=(r[f.target]??0)+1));let o=new Map;for(let f of e)f.source!==f.target&&(f.cardinality.from==="*"&&(o.has(f.source)||o.set(f.source,new Set),o.get(f.source).add(f.target)),f.cardinality.to==="*"&&(o.has(f.target)||o.set(f.target,new Set),o.get(f.target).add(f.source)));let a=new Set;for(let[f,m]of o)m.size>=2&&a.add(f);let i=Object.values(r),s=i.reduce((f,m)=>f+m,0)/i.length,l=i.reduce((f,m)=>f+(m-s)**2,0)/i.length,c=Math.sqrt(l),d=[...i].sort((f,m)=>f-m),u=d.length%2===0?(d[d.length/2-1]+d[d.length/2])/2:d[Math.floor(d.length/2)];for(let f of t){let m=f.id,p=f.columns,h=p.filter(S=>S.constraints.includes("fk")),g=p.filter(S=>S.constraints.includes("pk")&&S.constraints.includes("fk")),x=h.length,y=p.length===0?0:x/p.length,b=r[m]??0,w=f.name.toLowerCase(),k=e.filter(S=>(S.source===m||S.target===m)&&S.source!==S.target),C=e.some(S=>S.source===m&&S.target===m),v=new Set;for(let S of k)v.add(S.source===m?S.target:S.source);if(C&&k.length===0){n.set(m,"self-referential");continue}let _=g.length>=2&&v.size===1,R=y>=.6&&!_,L=g.length>=2&&v.size>=2,E=a.has(m);if(R||L||E){n.set(m,"junction");continue}if(y>=.4&&y<.6&&g.length<2&&!a.has(m)){n.set(m,"ambiguous");continue}if(tlt.some(S=>w.endsWith(S))&&p.length<=6&&x<=1&&b>u){n.set(m,"lookup");continue}if(t.length>=6&&b>0&&b>s+1.5*c&&b>=2*s){n.set(m,"hub");continue}if(x>0){n.set(m,"dependent");continue}n.set(m,"core")}return n}var m7,NP,TP,tlt,AP=dt(()=>{"use strict";m7={core:"green",dependent:"blue",junction:"red",ambiguous:"purple",lookup:"yellow",hub:"orange","self-referential":"teal",unclassified:"gray"},NP={core:"Core entity",dependent:"Dependent",junction:"Junction / M:M",ambiguous:"Bridge",lookup:"Lookup / Reference",hub:"Hub","self-referential":"Self-referential",unclassified:"Unclassified"},TP=["core","dependent","junction","ambiguous","lookup","hub","self-referential","unclassified"],tlt=["_type","_status","_code","_category"]});var DP={};ue(DP,{renderERDiagram:()=>PP,renderERDiagramForExport:()=>clt});function slt(t){switch(t){case"pk":return"\u2666";case"fk":return"\u2192";case"unique":return"\u25C6";case"nullable":return"\u25CB"}}function RP(t,e,n,r,o,a,i=IP,s=1.5){let l=e.x-n.x,c=e.y-n.y,d=Math.sqrt(l*l+c*c);if(d===0)return;let u=l/d,f=c/d,m=-f,p=u,h=s+.5;if(a){let b=e.x-u*15,w=e.y-f*15,k=r==="1"?"1":r==="*"?"*":"0..1";t.append("text").attr("x",b+m*12).attr("y",w+p*12).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",o).attr("font-size",i).text(k);return}let g=14,x=9;if(r==="1"){let y=e.x-u*g,b=e.y-f*g;t.append("line").attr("x1",y+m*x).attr("y1",b+p*x).attr("x2",y-m*x).attr("y2",b-p*x).attr("stroke",o).attr("stroke-width",h)}else if(r==="*"){let w=e.x-u*18,k=e.y-f*18,C=e.x-u*5,v=e.y-f*5;t.append("line").attr("x1",w).attr("y1",k).attr("x2",C+m*x).attr("y2",v+p*x).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",w).attr("y1",k).attr("x2",C-m*x).attr("y2",v-p*x).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",w).attr("y1",k).attr("x2",C).attr("y2",v).attr("stroke",o).attr("stroke-width",h)}else if(r==="?"){let b=g+10+2,w=e.x-u*b,k=e.y-f*b;t.append("circle").attr("cx",w).attr("cy",k).attr("r",5).attr("fill","none").attr("stroke",o).attr("stroke-width",h);let C=e.x-u*g,v=e.y-f*g;t.append("line").attr("x1",C+m*x).attr("y1",v+p*x).attr("x2",C-m*x).attr("y2",v-p*x).attr("stroke",o).attr("stroke-width",h)}}function PP(t,e,n,r,o,a,i,s,l,c){It(t).selectAll(":not([data-d3-tooltip])").remove();let d=e.tagGroups.length===0&&n.nodes.every(Z=>!Z.color),u=8,f=or(e.options),m=e.tagGroups.length>0&&!f,p=!f&&(d||m)?Se+u:0,h=!!e.title&&e.options["no-title"]!=="on",g=h?40:0,x=n.width,y=n.height,b=Le.identity(),w=b.aesthetic(p7),k=b.text(nlt),C=b.text(rlt),v=b.text(IP),_=b.structural(1.5),R=b.structural(1.5),L=b.structural(olt),E=b.structural(alt),M=b.structural(ilt),S=b.text(20),T=b.structural(30),N=x+w*2,I=d?_P([...e.tables],[...e.relationships]):null,G=I!==null&&(l??!0),$=I?TP.filter(Z=>{for(let ot of I.values())if(ot===Z)return!0;return!1}):[],A=$.length>0?[{name:"Role",entries:$.map(Z=>({value:NP[Z],color:r.colors[m7[Z]]}))}]:[],D=I!==null&&!f&&$.length>0,O=vo(e.options),P=m||D,H=m?e.tagGroups:A,W=m?s??null:G?"Role":null,B=i?.width??N,q=O&&P?cr({groups:H,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:c?"export":"preview"},{activeGroup:W},B):{width:0,height:0},V=nr({requested:O,title:e.title??"",hasLegend:P,legendWidth:q.width,legendHeight:q.height,containerWidth:B,titleBandHeight:g,legendReserve:p,titleBaselineY:T,titleFontSize:S}),X=V.inline?0:p,z=y+g+X+w*2,U,Y,K,et,nt;if(i){U=i.width??N,Y=i.height??z;let Z=Y-g-X,ot=(U-w*2)/x,at=(Z-w*2)/y;K=Math.min(elt,ot,at);let lt=x*K;et=(U-lt)/2,nt=g+X+w}else U=N,Y=z,K=1,et=w,nt=g+X+w;if(U<=0||Y<=0)return;let J=It(t).append("svg").attr("width",i?U:"100%").attr("height",i?Y:"100%").attr("viewBox",`0 0 ${U} ${Y}`).attr("preserveAspectRatio","xMidYMid meet").style("font-family",Mt);if(h){let Z=J.append("text").attr("class","chart-title").attr("x",V.titleX).attr("y",T).attr("text-anchor",V.titleAnchor).attr("fill",r.text).attr("font-size",S).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(Z.attr("data-line-number",e.titleLineNumber),a&&Z.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}let F=J.append("g").attr("transform",`translate(${et}, ${nt}) scale(${K})`),j=Bn(r),Q=e.options.notation==="labels";for(let Z of n.edges){if(Z.points.length<2)continue;let ot=F.append("g").attr("class","er-edge-group").attr("data-line-number",String(Z.lineNumber)).attr("data-source",Z.source).attr("data-target",Z.target),at=r.textMuted,lt=llt(Z.points);lt&&ot.append("path").attr("d",lt).attr("fill","none").attr("stroke",at).attr("stroke-width",_).attr("class","er-edge");let rt=Z.points;if(RP(ot,rt[0],rt[1],Z.cardinality.from,at,Q,v,_),RP(ot,rt[rt.length-1],rt[rt.length-2],Z.cardinality.to,at,Q,v,_),Z.label){let ut=Math.floor(rt.length/2),tt=rt[ut],it=Tt(Z.label,v)+8,st=16;ot.append("rect").attr("x",tt.x-it/2).attr("y",tt.y-st/2-1).attr("width",it).attr("height",st).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","er-edge-label-bg"),ot.append("text").attr("x",tt.x).attr("y",tt.y+4).attr("text-anchor","middle").attr("fill",at).attr("font-size",v).attr("class","er-edge-label").text(Z.label)}}for(let Z=0;Z<n.nodes.length;Z++){let ot=n.nodes[Z],at=Dn(ot.metadata,[...e.tagGroups],s??null),lt=G?r.colors[m7[I.get(ot.id)??"unclassified"]]:I?r.primary:void 0,rt=ot.color??at??lt??j[Z%j.length],ut=F.append("g").attr("transform",`translate(${ot.x}, ${ot.y})`).attr("class","er-table").attr("data-line-number",String(ot.lineNumber)).attr("data-node-id",ot.id);if(s){let gt=Bt(s),Et=ot.metadata[gt];Et&&ut.attr(`data-tag-${gt}`,Et.toLowerCase())}if(I){let gt=I.get(ot.id);gt&&ut.attr("data-er-role",gt)}a&&ut.style("cursor","pointer").on("click",()=>{a(ot.lineNumber)});let tt=ot.width,it=ot.height,st=ee(r,rt,o,{mode:mn(e.options)}),ct=rt,pt=pe(st,r.textOnFillLight,r.textOnFillDark);ut.append("rect").attr("x",-tt/2).attr("y",-it/2).attr("width",tt).attr("height",it).attr("rx",3).attr("ry",3).attr("fill",st).attr("stroke",ct).attr("stroke-width",R);let mt=-it/2,bt=mt+ot.headerHeight/2;if(ut.append("text").attr("x",0).attr("y",bt).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",pt).attr("font-size",k).attr("font-weight","bold").text(ot.name),mt+=ot.headerHeight,ot.columns.length>0){ut.append("line").attr("x1",-tt/2).attr("y1",mt).attr("x2",tt/2).attr("y2",mt).attr("stroke",ct).attr("stroke-width",.5).attr("stroke-opacity",.5);let gt=mt+E;for(let Et of ot.columns){let ft=-tt/2+M,kt=Et.constraints[0];kt&&ut.append("text").attr("x",ft).attr("y",gt+L/2).attr("dominant-baseline","central").attr("fill",pt).attr("font-size",C).text(slt(kt));let _t=-tt/2+M+(kt?16:0),yt=Et.name;Et.type&&(yt+=`: ${Et.type}`),ut.append("text").attr("x",_t).attr("y",gt+L/2).attr("dominant-baseline","central").attr("fill",pt).attr("font-size",C).text(yt),gt+=L}}if(ot.note)if(ot.note.collapsed)ji(ut,{x:tt/2-sa-3,y:-it/2+sa+3},r,{isDark:o,...ot.note.color&&{color:ot.note.color},lineNumber:ot.note.lineNumber,endLineNumber:ot.note.endLineNumber});else{let[gt,Et,ft,kt]=Ui({width:tt,height:it},ot.note);Vi(ut,gt,Et,ft,kt,r),Xi(ut,{x:ot.note.x,y:ot.note.y,width:ot.note.width,height:ot.note.height},ot.note.lines,r,{isDark:o,...ot.note.color&&{color:ot.note.color},lineNumber:ot.note.lineNumber,endLineNumber:ot.note.endLineNumber,interactive:!0})}}if(m){let Z=w+g,ot=J.append("g").attr("class","er-tag-legend").attr("transform",V.inline?`translate(${V.legendX}, ${V.legendY})`:`translate(0,${Z})`);tn(ot,{groups:e.tagGroups,activeGroup:s??null,mode:c?"export":"preview",position:{placement:"top-center",titleRelation:V.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:U}),ot.selectAll("[data-legend-group]").classed("er-legend-group",!0)}if(D){let Z=w+g,ot=J.append("g").attr("class","er-semantic-legend").attr("transform",V.inline?`translate(${V.legendX}, ${V.legendY})`:`translate(0,${Z})`);tn(ot,{groups:A,activeGroup:G?"Role":null,mode:c?"export":"preview",position:{placement:"top-center",titleRelation:V.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:U}),ot.selectAll("[data-legend-group]").classed("er-legend-group",!0)}}function clt(t,e,n){let r=Hd(t,n);if(r.error||r.tables.length===0)return"";let o=u7(r),a=e==="dark",i=document.createElement("div"),s=o.width+p7*2,l=o.height+p7*2+(r.title&&r.options["no-title"]!=="on"?40:0);i.style.width=`${s}px`,i.style.height=`${l}px`,i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i);try{PP(i,r,o,n,a,void 0,{width:s,height:l},void 0,void 0,!0);let c=i.querySelector("svg");return c?(e==="transparent"&&(c.style.background="none"),c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.style.fontFamily=Mt,Fr(c)):""}finally{document.body.removeChild(i)}}var p7,elt,nlt,rlt,IP,olt,alt,ilt,llt,OP=dt(()=>{"use strict";fi();Oe();Ae();Nn();Fo();Ke();Fe();pi();Oe();pr();qr();ko();Mr();wr();Ve();Ki();p1();f7();AP();p7=20,elt=3,nlt=13,rlt=11,IP=11,olt=18,alt=8,ilt=10;llt=lr().x(t=>t.x).y(t=>t.y).curve(To)});var dlt,Ta,Gs,qc,tm,_u,Jr,$P,GP,qP=dt(()=>{"use strict";dlt=(1+Math.sqrt(5))/2,Ta={cellPx:26,footprintCellsW:8,gapCellsX:4,gapCellsY:4,bandPx:44,boxPadPx:26,ringFrac:.22},Gs=Ta.footprintCellsW*Ta.cellPx,qc=2*Math.round(Gs/dlt/2),tm=Gs/2,_u=qc/2,Jr=3,$P=tm*Jr,GP=_u*Jr});function BP(t,e){let n=e??new Set(t.boxes.filter(d=>d.collapsed).map(d=>d.label));if(n.size===0)return{nodes:t.nodes,boxes:t.boxes,virtualBoxes:[],edges:t.edges,collapsedChildCounts:new Map};let r=t.boxes.filter(d=>n.has(d.label)),o=t.boxes.filter(d=>!n.has(d.label)),a=new Map,i=new Map;for(let d of r){i.set(d.label,d.children.length);for(let u of d.children)a.set(u,d.id)}let s=t.nodes.filter(d=>!a.has(d.id)),l=[],c=new Set;for(let d of t.edges){let u=a.get(d.sourceId)??d.sourceId,f=a.get(d.targetId)??d.targetId;if(u===f)continue;let m=`${u}|${f}|${d.label??""}|${d.heads}|${d.dashed}`;c.has(m)||(c.add(m),l.push({...d,sourceId:u,targetId:f}))}return{nodes:s,boxes:o,virtualBoxes:r,edges:l,collapsedChildCounts:i}}var HP=dt(()=>{"use strict"});var YP={};ue(YP,{SKETCH_AUTO_LAYOUT_DEFAULTS:()=>WP,layoutSketch:()=>mlt});function ult(t={}){let e=WP;return{normalizeOrigin:t.normalizeOrigin??e.normalizeOrigin,sortRootsBySource:t.sortRootsBySource??e.sortRootsBySource,resolveOverlap:t.resolveOverlap??e.resolveOverlap,groupCollisionAsRect:t.groupCollisionAsRect??e.groupCollisionAsRect,flowPlaceUnpositioned:t.flowPlaceUnpositioned??e.flowPlaceUnpositioned,avoidEdges:t.avoidEdges??e.avoidEdges}}function H0(t,e){return{c:t,r:e,w:Jr,h:Jr}}function flt(t,e){return t.c<e.c+e.w&&e.c<t.c+t.w&&t.r<e.r+e.h&&e.r<t.r+t.h}function em(t,e){for(let n of e)if(flt(t,n))return!0;return!1}function zP(t,e){if(!em(t,e))return{c:t.c,r:t.r};for(let n=1;n<=200;n++){let r=[];for(let o=-n;o<=n;o++){let a=n-Math.abs(o);r.push({c:t.c+o,r:t.r+a}),a!==0&&r.push({c:t.c+o,r:t.r-a})}r.sort((o,a)=>{let i=(o.r<t.r?2:0)+(o.c<t.c?1:0),s=(a.r<t.r?2:0)+(a.c<t.c?1:0);return i-s||o.r-a.r||o.c-a.c});for(let o of r)if(!em({...t,c:o.c,r:o.r},e))return o}return{c:t.c,r:t.r}}function FP(t,e,n,r){let o=[],a=[],i=[];for(let u of t.children){let f=e.get(u);if(!f)continue;if(f.at===null){i.push(f);continue}let m=H0(f.at.c,f.at.r),p=r.resolveOverlap?zP(m,o):{c:f.at.c,r:f.at.r};(p.c!==f.at.c||p.r!==f.at.r)&&n(f.lineNumber,f.label),o.push(H0(p.c,p.r)),a.push({node:f,c:p.c,r:p.r})}if(!r.flowPlaceUnpositioned){for(let u of i)a.push({node:u,c:0,r:0});i.length=0}let s=o.length>0?Math.max(...o.map(u=>u.r))+Jr:0,l=0,c=Math.max(Jr*3,o.length>0?Math.max(...o.map(u=>u.c))+Jr:Jr*3);for(let u of i){let f=!1;for(;!f;){let m=H0(l,s);em(m,o)||(o.push(m),a.push({node:u,c:l,r:s}),f=!0),l+=Jr,l>c&&(l=0,s+=Jr)}}let d;if(o.length===0)d={c:0,r:0,w:Jr,h:Jr};else{let u=Math.min(...o.map(h=>h.c)),f=Math.min(...o.map(h=>h.r)),m=Math.max(...o.map(h=>h.c+h.w)),p=Math.max(...o.map(h=>h.r+h.h));d={c:u,r:f,w:m-u,h:p-f}}return{children:a,extent:d}}function mlt(t,e={}){let n=[],r=(P,H)=>{n.push(At(P,`Shape "${H}" overlapped another at its authored position \u2014 moved to the nearest free slot`,"warning",Wa.OVERLAP_RESOLVED))},o=ult(e.autoLayout),a=BP(t,e.collapsedBoxes),i=new Map(a.nodes.map(P=>[P.id,P])),s=Ta.boxPadPx/tm,l=Ta.boxPadPx/_u,c=Ta.bandPx/_u,d=new Map,u=new Set;for(let P of a.boxes){let H=FP(P,i,r,o);d.set(P.id,H);for(let W of H.children)u.add(W.node.id)}let f=new Map(t.nodes.map(P=>[P.id,P])),m=()=>{},p=new Map;for(let P of a.virtualBoxes)p.set(P.id,FP(P,f,m,o));let h=Gs/tm,g=qc/_u,x=(P,H)=>{let W=p.get(P);if(W.children.length===0)return{c:H.c,r:H.r};let B=1/0,q=1/0,V=-1/0,X=-1/0;for(let Y of W.children)B=Math.min(B,Y.c),q=Math.min(q,Y.r),V=Math.max(V,Y.c+h),X=Math.max(X,Y.r+g);let z=H.c+(B+V)/2,U=H.r+(q+X)/2+(l-c)/2;return{c:Math.round(z-h/2),r:Math.round(U-g/2)}},y=[];for(let P of a.nodes)u.has(P.id)||y.push({kind:"shape",node:P});for(let P of a.virtualBoxes)y.push({kind:"virtual",box:P});for(let P of a.boxes)y.push({kind:"box",box:P});let b=P=>P.kind==="shape"?P.node.lineNumber:P.box.lineNumber,w=P=>P.kind==="shape"?P.node.at:P.box.at;o.sortRootsBySource?y.sort((P,H)=>b(P)-b(H)):y.sort((P,H)=>{let W=w(P),B=w(H);return W&&B?W.r-B.r||W.c-B.c||b(P)-b(H):W?-1:B?1:b(P)-b(H)});let k=(P,H,W)=>{if(P.kind!=="shape"&&o.groupCollisionAsRect){let B=(P.kind==="box"?d:p).get(P.box.id);return{c:H+B.extent.c-s,r:W+B.extent.r-c,w:B.extent.w+2*s,h:B.extent.h+c+l}}return H0(H,W)},C=[],v=new Map,_=[];for(let P of y){let H=w(P);if(H===null){_.push(P);continue}let W=k(P,H.c,H.r),B={c:H.c,r:H.r};if(o.resolveOverlap&&P.kind==="shape"&&em(W,C)){let q=zP(W,C);B={c:H.c+(q.c-W.c),r:H.r+(q.r-W.r)},r(P.node.lineNumber,P.node.label)}C.push(k(P,B.c,B.r)),v.set(P,B)}if(!o.flowPlaceUnpositioned){for(let P of _)C.push(k(P,0,0)),v.set(P,{c:0,r:0});_.length=0}let R=C.length>0?Math.ceil(Math.max(...C.map(P=>P.r+P.h))):0,L=0,E=Math.max(Jr*4,C.length>0?Math.ceil(Math.max(...C.map(P=>P.c+P.w))):Jr*4);for(let P of _){let H=!1;for(;!H;){let W=k(P,L,R);em(W,C)||(C.push(W),v.set(P,{c:L,r:R}),H=!0),L+=Jr,L>E&&(L=0,R+=Jr)}}let M=y.map(P=>{let H=v.get(P);return k(P,H.c,H.r)}),S=M.length>0?Math.min(...M.map(P=>P.c)):0,T=M.length>0?Math.min(...M.map(P=>P.r)):0,N=o.normalizeOrigin?S:Math.min(e.frozenOrigin?.c??S,S),I=o.normalizeOrigin?T:Math.min(e.frozenOrigin?.r??T,T),G=(P,H)=>({x:(P-N)*tm,y:(H-I)*_u}),$=[],A=[];for(let P of y){let H=v.get(P);if(P.kind==="shape"){let{x:W,y:B}=G(H.c,H.r);$.push({id:P.node.id,label:P.node.label,shape:P.node.shape,metadata:P.node.metadata,...P.node.description&&{description:P.node.description},lineNumber:P.node.lineNumber,slot:H,x:W,y:B,w:Gs,h:qc})}else if(P.kind==="virtual"){let W=x(P.box.id,H),{x:B,y:q}=G(W.c,W.r);$.push({id:P.box.id,label:P.box.label,shape:"rectangle",metadata:P.box.metadata,lineNumber:P.box.lineNumber,slot:W,x:B,y:q,w:Gs,h:qc,isCollapsedBox:!0,childCount:a.collapsedChildCounts.get(P.box.label)??0})}else{let W=d.get(P.box.id),B=1/0,q=1/0,V=-1/0,X=-1/0;for(let z of W.children){let U=G(H.c+z.c,H.r+z.r);$.push({id:z.node.id,label:z.node.label,shape:z.node.shape,metadata:z.node.metadata,...z.node.description&&{description:z.node.description},boxLabel:P.box.label,lineNumber:z.node.lineNumber,slot:{c:H.c+z.c,r:H.r+z.r},x:U.x,y:U.y,w:Gs,h:qc}),B=Math.min(B,U.x),q=Math.min(q,U.y),V=Math.max(V,U.x+Gs),X=Math.max(X,U.y+qc)}if(B===1/0){let z=G(H.c,H.r);B=z.x,q=z.y+Ta.bandPx,V=z.x+Gs,X=q}A.push({id:P.box.id,label:P.box.label,metadata:P.box.metadata,lineNumber:P.box.lineNumber,x:B-Ta.boxPadPx,y:q-Ta.bandPx,w:V-B+2*Ta.boxPadPx,h:X-q+Ta.bandPx+Ta.boxPadPx,bandH:Ta.bandPx})}}if(o.avoidEdges){let P=new Set;for(let q of y)w(q)!==null&&P.add(q.kind==="shape"?q.node.id:q.box.id);let H=q=>{let V=$.find(z=>z.id===q);if(V)return{x:V.x+V.w/2,y:V.y+V.h/2};let X=A.find(z=>z.id===q);return X?{x:X.x+X.w/2,y:X.y+X.h/2}:null},W=(q,V,X,z,U,Y,K,et)=>{let nt=0,J=1,F=[-(X-q),X-q,-(z-V),z-V],j=[q-U,K-q,V-Y,et-V];for(let Q=0;Q<4;Q++)if(F[Q]===0){if(j[Q]<0)return!1}else{let Z=j[Q]/F[Q];if(F[Q]<0){if(Z>J)return!1;Z>nt&&(nt=Z)}else{if(Z<nt)return!1;Z<J&&(J=Z)}}return nt<=J},B=new Set;for(let q=0;q<4;q++){let V=!1;for(let X of $)if(!X.boxLabel&&!P.has(X.id))for(let z of a.edges){if(z.sourceId===X.id||z.targetId===X.id)continue;let U=H(z.sourceId),Y=H(z.targetId);if(!U||!Y||!W(U.x,U.y,Y.x,Y.y,X.x,X.y,X.x+X.w,X.y+X.h))continue;let K=X.x+X.w/2,et=X.y+X.h/2,nt=X;if(Math.abs(Y.x-U.x)>=Math.abs(Y.y-U.y)){let J=U.y+(Y.y-U.y)*(K-U.x)/(Y.x-U.x||1),F=et>=J?1:-1;X.slot.r+F*Jr<0&&(F=1),nt.y+=F*GP,nt.slot={c:X.slot.c,r:X.slot.r+F*Jr}}else{let J=U.x+(Y.x-U.x)*(et-U.y)/(Y.y-U.y||1),F=K>=J?1:-1;X.slot.c+F*Jr<0&&(F=1),nt.x+=F*$P,nt.slot={c:X.slot.c+F*Jr,r:X.slot.r}}B.has(X.id)||(r(X.lineNumber,X.label),B.add(X.id)),V=!0;break}if(!V)break}}let D=0,O=0;for(let P of $)D=Math.max(D,P.x+P.w),O=Math.max(O,P.y+P.h);for(let P of A)D=Math.max(D,P.x+P.w),O=Math.max(O,P.y+P.h);return{nodes:$,boxes:A,edges:a.edges,width:D,height:O,diagnostics:n,origin:{c:N,r:I}}}var WP,VP=dt(()=>{"use strict";Je();Y5();qP();HP();WP={normalizeOrigin:!1,sortRootsBySource:!1,resolveOverlap:!0,groupCollisionAsRect:!0,flowPlaceUnpositioned:!0,avoidEdges:!0}});function UP(t,e){return Tt(t.text,e,{bold:t.bold})}function blt(t){let e=[],n=/\*\*(.+?)\*\*|\[([^\]]*)\]\(([^)]*)\)|((?:(?!\*\*|\[).)+)/gs,r;for(;(r=n.exec(t))!==null;)r[1]!==void 0?e.push({text:r[1],bold:!0}):r[2]!==void 0?e.push({text:r[2],bold:!1,...r[3]&&{href:r[3]}}):r[4]!==void 0&&e.push({text:r[4],bold:!1});return e}function xlt(t){let e=[],n=[];for(let r of t){let o=r.text.split(/(\s+)/);for(let a of o)a!==""&&(/^\s+$/.test(a)?n.length>0&&(e.push(n),n=[]):n.push({text:a,bold:r.bold,...r.href!==void 0&&{href:r.href}}))}return n.length>0&&e.push(n),e}function wlt(t,e){let n=0;for(let r of t)n+=UP(r,e);return n}function Elt(t){let e=[];for(let n of t){let r=e[e.length-1];r?.bold===n.bold&&r.href===n.href?r.text+=n.text:e.push({text:n.text,bold:n.bold,...n.href!==void 0&&{href:n.href}})}return e}function klt(t,e,n,r,o){let a=xlt(t);if(a.length===0)return[{segments:[],x:r,...o!==void 0&&{bulletX:o}}];let i=Tt(" ",e),s=[],l=[],c=0,d=!0,u=()=>{s.push({segments:Elt(l),x:r,...d&&o!==void 0&&{bulletX:o}}),d=!1,l=[],c=0};for(let f of a){let m=wlt(f,e),p=l.length===0?m:i+m;l.length>0&&c+p>n?(u(),l.push(...f),c=m):(l.length>0&&(l.push({text:" ",bold:!1}),c+=i),l.push(...f),c+=m)}return u(),s}function Slt(t){let e=0,n=0,r=0;for(;e<t.length;){let i=t[e];if(i===" ")n+=1,e+=1,r=0;else if(i===" ")r+=1,e+=1,r===2&&(n+=1,r=0);else break}let o=t.slice(e),a=!1;return(o.startsWith("- ")||o.startsWith("* "))&&(a=!0,o=o.slice(2)),{level:n,bullet:a,content:o}}function XP(t,e,n){let{width:r,fontSize:o,lineHeight:a,color:i,linkColor:s,maxLines:l}=n,c=[];for(let f of e.split(`
|
|
289
|
+
`)){let n=e.trim();if(!(!n||n.startsWith("//")))return n.split(/\s+/)[0].toLowerCase()}return""}async function ex(t,e,n,r){let o=await kn(e,n),a=e==="dark",i=r?.width&&r.width>0?Math.round(r.width):nh,s=r?.height&&r.height>0?Math.round(r.height):rh,l=Vn(i,s),c=hi(l,o,{width:i,height:s});if(!c)return document.body.removeChild(l),"";let{svg:d,width:u,height:f,textColor:m,mutedColor:p,bgColor:h,colors:g}=c;return Ynt(d,t,o,a,u,f,m,p,h,g)?Sn(l,e,o):(document.body.removeChild(l),"")}function Ynt(t,e,n,r,o,a,i,s,l,c){let d=znt(e),f=tx.has(d)?null:Sl(e,n);if(f&&!f.error&&f.data.length>0&&bA.has(f.type)){let x=!f.noTitle&&!!f.title,y=yA(f,x,i);switch(x&&!y&&ao(t,f.title,f.titleLineNumber,o,i),f.type){case"bar":return G_(t,f,o,a,c,n,r,i,s,x,y),!0;case"line":return H_(t,f,o,a,c,n,r,i,s,l,x,y),!0;case"pie":return W_(t,f,o,a,n,r,i,x?52:24),!0;case"radar":{let b=f.noLegend?[]:gg(f,c),w=q1(t,b,n,r,x,o,y);return V_(t,f,o,a,c,n,r,i,s,w),!0}case"polar-area":return X_(t,f,o,a,n,r,i,x?52:24),!0}}let m=Ml(e,n);if(m.error||!tx.has(m.type))return!1;let p=Bn(n),h=!m.noTitle&&!!m.title,g=yA(m,h,i);switch(h&&!g&&ao(t,m.title,m.titleLineNumber,o,i),m.type){case"funnel":return Z_(t,m,o,a,p,n,r,h?52:24),!0;case"heatmap":return J_(t,m,o,a,n,r,i,l,h?52:24),!0;case"scatter":{let x=m.noLegend?[]:T5(m,p),y=q1(t,x,n,r,h,o,g);return aA(t,m,o,a,p,n,r,i,s,y),!0}case"sankey":return lA(t,m,o,a,p,l,i,h?52:24),!0;case"chord":return dA(t,m,o,a,p,n,r,i,h?52:24),!0;case"function":{let x=m.noLegend?[]:T5(m,p),y=q1(t,x,n,r,h,o,g);return hA(t,m,o,a,p,i,s,y,n,r),!0}default:return!1}}var bA,tx,xA,Wnt,nx=dt(()=>{"use strict";pg();M1();M1();Fe();qi();Na();q_();F_();z_();U_();j_();Q_();tA();iA();cA();uA();gA();bA=new Set(["bar","line","pie","radar","polar-area"]),tx=new Set(["funnel","heatmap","scatter","sankey","chord","function"]),xA=new Set([...bA,...tx]);Wnt=new Set(["bar","line","radar","scatter","function"])});function Os(t,e){let n=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("rx",e.rx).attr("fill",e.fill).attr("stroke",e.stroke).attr("stroke-width",e.strokeWidth);e.dashed&&n.attr("stroke-dasharray","6 3");let r=e.labelLines;if(r&&r.length>1){let c=e.labelFontSize*1.2,u=e.headerHeight/2-(r.length-1)*c/2;for(let f=0;f<r.length;f++)t.append("text").attr("x",e.width/2).attr("y",u+f*c).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(r[f])}else t.append("text").attr("x",e.width/2).attr("y",e.headerHeight/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(r?.[0]??e.label);let o=e.meta;if(!o||o.rows.length===0)return;t.append("line").attr("x1",0).attr("y1",e.headerHeight).attr("x2",e.width).attr("y2",e.headerHeight).attr("stroke",o.separatorColor).attr("stroke-opacity",.3).attr("stroke-width",1);let a=o.keyX??10,i=Math.max(...o.rows.map(([c])=>Tt(`${c}: `,o.fontSize))),s=a+i,l=e.headerHeight+o.separatorGap+o.fontSize;for(let c=0;c<o.rows.length;c++){let[d,u]=o.rows[c],f=l+c*o.lineHeight;t.append("text").attr("x",a).attr("y",f).attr("fill",o.textColor).attr("font-size",o.fontSize).text(`${d}: `),t.append("text").attr("x",s).attr("y",f).attr("fill",o.textColor).attr("font-size",o.fontSize).text(u)}}function H1(t,e){t.append("clipPath").attr("id",e.clipId).append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.rx),t.append("rect").attr("x",e.inset).attr("y",e.height-e.barHeight).attr("width",e.width-e.inset*2).attr("height",e.barHeight).attr("fill",e.fill).attr("clip-path",`url(#${e.clipId})`).attr("class",e.className)}var F1=dt(()=>{"use strict";Ve()});var PA={};ue(PA,{clearEventLineMuted:()=>irt,focusEventLine:()=>IA,renderEventLine:()=>mx,renderEventLineForExport:()=>prt});function mx(t,e,n,r,o,a,i,s){if(e.events.length===0)return;It(t).selectAll(":not([data-d3-tooltip])").remove();let l=a?.width??t.clientWidth,c=a?.height??t.clientHeight;if(l<=0||c<=0)return;let d=!!a,u=d?new Set:px(t),m=Bn(n)[0],p=mr(e.tagGroups,void 0,i),h=!!e.title&&!e.options.noTitle,g=e.tagGroups.length>0&&p!==null&&!e.options.noLegend,x=h?Vnt:0,y=g?Unt:0,b=e.options.legendInline===!0,w=b&&g?cr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:d?"export":"preview"},{activeGroup:p??null},l):{width:0,height:0},k=nr({requested:b,title:e.title??"",hasLegend:g,legendWidth:w.width,legendHeight:w.height,containerWidth:l,titleBandHeight:x,legendReserve:y,titleBaselineY:30,titleFontSize:20}),C=k.inline?x:x+y,v=new Map(e.eras.map(ft=>[ft.name,ft])),_=new Set(e.eras.filter(ft=>ft.collapsed).map(ft=>ft.name)),R=e.events.some(ft=>ft.era&&v.has(ft.era)),L=e.events.some(ft=>ft.era&&v.has(ft.era)&&!_.has(ft.era)),E=e.options.side,M=E==="alternate",S=M||E==="above"?"below":"above",T=[],N=new Set;for(let ft of e.events){let kt=ft.era;kt&&_.has(kt)?N.has(kt)||(N.add(kt),T.push({kind:"era",era:v.get(kt),members:e.events.filter(_t=>_t.era===kt)})):T.push({kind:"event",event:ft})}let I=Math.max(8,Math.floor((fo-Pl*2)/(Ac*aa))),G=ft=>{let kt=hn(ft,13,jnt,{hardBreak:!0,bold:!0}),_t=Math.max(28,kt.length*ax+12);return{lines:kt,headerH:_t}},$=(ft,kt,_t)=>ft+(_t?EA:0)+(kt.length>0?6+kt.length*AA:0)+(kt.length>0?Pl:6),A=ft=>{if(!p)return m;let kt=Dn(ft.metadata,e.tagGroups,p);return kt&&kt!==Qnt?Re(kt,n)??kt:m},D=0,O=T.map(ft=>{let kt=M?D++%2===0?"above":"below":E;if(ft.kind==="event"){let re=ft.event,Ot=A(re),Ut=ee(n,Ot,r,{mode:e.options.fillMode}),oe=pe(Ut,n.textOnFillLight,n.textOnFillDark),Ee=TA(re.description,I),de=G(re.label);return{kind:"event",event:re,era:null,members:[],label:re.label,date:re.date,dateValue:re.dateValue,future:re.future,futureSpan:re.futureSpan,lineNumber:re.lineNumber,eraName:re.era,color:Ot,cardFill:Ut,titleColor:oe,titleLines:de.lines,headerH:de.headerH,lines:Ee,bulletColors:[],bulletMeta:[],cardH:$(de.headerH,Ee,!!re.date),x:0,side:kt,lane:0,left:0,spanHalf:0}}let _t=ft.era,yt=ft.members.map(A),St=p!=null&&yt.length>0&&yt.every(re=>re===yt[0])&&yt[0]!==m,Ct=_t.color?Re(_t.color,n)??n.text:St?yt[0]:n.text,ht=vt(Ct,Ie(n,r),10),Pt=pe(ht,n.textOnFillLight,n.textOnFillDark),Dt=null,qt=null;for(let re of ft.members)re.dateValue!==null&&((Dt===null||re.dateValue<Dt)&&(Dt=re.dateValue),(qt===null||re.dateValue>qt)&&(qt=re.dateValue));let Wt=Dt!==null&&qt!==null?(Dt+qt)/2:null,Ft=ft.members.filter(re=>!lrt(re.metadata,u)),Xt=Ft.map(re=>`\u2022 ${re.date?`${re.future?"TBD":zi(re.date)} `:""}${re.label}`),zt=Ft.map(A),xt=Ft.map(re=>re.metadata),$t=TA(Xt,I),Zt=G(_t.name);return{kind:"era",event:null,era:_t,members:ft.members,label:_t.name,date:null,dateValue:Wt,future:!1,futureSpan:null,lineNumber:_t.lineNumber,eraName:_t.name,color:Ct,cardFill:ht,titleColor:Pt,titleLines:Zt.lines,headerH:Zt.headerH,lines:$t,bulletColors:zt,bulletMeta:xt,cardH:$(Zt.headerH,$t,!1),x:0,side:kt,lane:0,left:0,spanHalf:0}}),P=e.options.scale&&O.every(ft=>ft.dateValue!==null),H=l-l0*2,W=16,B=8,q=64,V=16,X=[],z=[],U=()=>{if(!z.length)return;let ft=z.map(kt=>kt.dateValue);X.push({kind:"run",events:z,lo:Math.min(...ft),hi:Math.max(...ft)}),z=[]};for(let ft of O)ft.kind==="era"?(U(),X.push({kind:"capsule",p:ft})):z.push(ft);U();let Y=X.reduce((ft,kt)=>ft+(kt.kind==="run"?kt.hi-kt.lo:0),0),K=ft=>{if(P){let kt=Y>0?H*ft/Y:0,_t={above:-1/0,below:-1/0},yt=l0;for(let ht of X)if(ht.kind==="capsule"){let Pt=yt+q/2,Dt=Math.max(fo/2+6,_t[ht.p.side]+lx+fo/2);Pt<Dt&&(yt+=Dt-Pt,Pt=Dt),ht.p.x=Pt,ht.p.spanHalf=q/2,_t[ht.p.side]=Pt+fo/2,yt+=q+V}else{for(let Pt of ht.events)Pt.x=yt+(Pt.dateValue-ht.lo)*kt,Pt.spanHalf=0;yt+=(ht.hi-ht.lo)*kt+V}let St=-1/0,Ct=null;for(let ht of[...O].sort((Pt,Dt)=>Pt.x-Dt.x)){if(ht.kind==="era"){St=ht.x+ht.spanHalf,Ct=null;continue}if(ht.dateValue===Ct){ht.x=St;continue}ht.x<St+W&&(ht.x=St+W),St=ht.x,Ct=ht.dateValue}}else{O.forEach(yt=>{yt.spanHalf=0});let kt=O.length,_t=kt>1?Math.max(Knt,H/(kt-1)):0;O.forEach((yt,St)=>{yt.x=l0+St*_t})}for(let kt of["above","below"]){let _t=O.filter(St=>St.side===kt).sort((St,Ct)=>St.x-Ct.x),yt=[];for(let St=0;St<_t.length;St++){let Ct=_t[St],ht=_t[St+1],Dt=Ct.kind!=="era"&&!!ht&&ht.x-Ct.x<fo+lx?Ct.x-fo+sx:Ct.x-fo/2,qt=Ct.x-sx,Wt=Ct.x-fo+sx,Ft=yt.length,Xt=Math.max(Dt,Wt);for(let zt=0;zt<yt.length;zt++){let xt=Math.max(Dt,yt[zt]+lx,Wt);if(xt<=qt){Ft=zt,Xt=xt;break}}Ct.lane=Ft,Ct.left=Math.max(6,Xt),yt[Ft]=Ct.left+fo}}},et=()=>{let ft=Math.max(l,Math.max(...O.map(xt=>xt.x+xt.spanHalf))+l0,Math.max(...O.map(xt=>xt.left+fo))+6),kt={above:[],below:[]};for(let xt of["above","below"]){let $t=[];for(let Ot of O)Ot.side===xt&&($t[Ot.lane]=Math.max($t[Ot.lane]??0,Ot.cardH));let Zt=[],re=0;for(let Ot=0;Ot<$t.length;Ot++)Zt[Ot]=re,re+=($t[Ot]??0)+Znt;kt[xt]=Zt}let _t=xt=>(xt.side==="above"?rx:ox)+(kt[xt.side][xt.lane]??0),yt=xt=>Math.max(0,...O.filter($t=>$t.side===xt).map($t=>_t($t)+$t.cardH)),St=yt("above"),Ct=yt("below"),ht=St+(L&&S==="above"?SA:0),Pt=Ct+(L&&S==="below"?SA:0),Dt=14,qt=14,Wt=C+Dt+ht,Ft=S==="above"?Wt-(St+14):Wt+(Ct+14),Xt=Wt+Pt+qt,zt=d?Xt:Math.max(c,Xt);return{contentW:ft,contentH:Xt,totalH:zt,spineY:Wt,eraBaseY:Ft,laneNear:_t}},nt=Number(globalThis.process?.env?.DGMO_EVT_STRETCH),J;if(Number.isFinite(nt)&&nt>0)K(nt),J=et();else{K(1),J=et();let ft=l/c,kt=_t=>_t.contentW/_t.contentH;if(P&&J.contentH>c&&kt(J)<ft){K(B);let _t=et();if(kt(_t)<=ft)J=_t;else{let yt=1,St=B;for(let Ct=0;Ct<8;Ct++){let ht=(yt+St)/2;K(ht),kt(et())>=ft?St=ht:yt=ht}K(St),J=et()}}}let{contentW:F,contentH:j,totalH:Q,spineY:Z,eraBaseY:ot,laneNear:at}=J,lt=It(t).append("svg").attr("width",F).attr("height",Q).attr("viewBox",`0 0 ${F} ${Q}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(!d&&Q>j&<.attr("data-content-height",Math.ceil(j)),d||lt.append("style").text(rrt),h){let ft=lt.append("text").attr("class","chart-title").attr("x",k.inline?k.titleX:F/2).attr("y",30).attr("text-anchor",k.inline?k.titleAnchor:"middle").attr("fill",n.text).attr("font-family",Mt).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber){let kt=e.titleLineNumber;ft.style("cursor","pointer").on("click",()=>o(kt))}}if(g){let ft=lt.append("g").attr("transform",k.inline?`translate(${k.legendX}, ${k.legendY})`:`translate(0, ${x})`),kt=e.tagGroups.map(_t=>({name:_t.name,entries:_t.entries.map(yt=>({value:yt.value,color:Re(yt.color,n)??yt.color}))}));tn(ft,{groups:kt,palette:n,isDark:r,width:F,mode:d?"export":"preview",activeGroup:p,position:{placement:"top-center",titleRelation:k.inline?"inline-with-title":"below-title"}}),d||srt(ft)}let rt=Math.min(...O.map(ft=>ft.x-ft.spanHalf)),ut=Math.max(...O.map(ft=>ft.x+ft.spanHalf)),tt=rt-20,it=ut+20,st=P&&O.some(ft=>ft.future&&!ft.futureSpan),ct=O.length?Math.max(tt,...O.filter(ft=>!ft.future).map(ft=>ft.x+ft.spanHalf)):it,pt=st?ct:it;lt.append("line").attr("x1",tt).attr("y1",Z).attr("x2",pt).attr("y2",Z).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round"),st&<.append("line").attr("x1",pt).attr("y1",Z).attr("x2",it).attr("y2",Z).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round").attr("stroke-opacity",.45).attr("stroke-dasharray","2 6");let mt=O.map(ft=>{let kt=ft.side==="above"?Z-at(ft):Z+at(ft),_t=ft.side==="above"?kt-ft.cardH:kt;return{p:ft,near:kt,top:_t}}),bt=(ft,kt)=>{let _t=Math.min(Z,kt),yt=Math.max(Z,kt);return mt.some(St=>St.p!==ft&&ft.x>St.p.left&&ft.x<St.p.left+fo&&yt>St.top&&_t<St.top+St.p.cardH)},gt=ft=>Z+nrt*(ft.side==="above"?-1:1);for(let{p:ft,near:kt}of mt){let _t=ft.kind==="era"?gt(ft):Z,yt=lt.append("line").attr("class","dgmo-event-leader").attr("x1",ft.x).attr("y1",_t).attr("x2",ft.x).attr("y2",kt).attr("stroke",ft.color).attr("stroke-width",1.5).attr("stroke-opacity",bt(ft,kt)?.18:ft.future?.4:.65);dx(yt,ft)}let Et=0;for(let{p:ft,top:kt}of mt){let _t=ft.left,yt=lt.append("g").attr("class","dgmo-event-card").attr("transform",`translate(${_t}, ${kt})`).attr("data-line-number",ft.lineNumber);if(dx(yt,ft),ft.kind==="era"&&yt.attr("data-era",ft.era.name).attr("data-era-collapsed","true"),o){let ht=ft.lineNumber;yt.style("cursor","pointer").on("click",()=>o(ht)),yt.append("rect").attr("x",0).attr("y",0).attr("width",fo).attr("height",ft.cardH).attr("fill","transparent").attr("pointer-events","all")}let St=ft.kind==="event"&&ft.date?ft.future?"TBD":zi(ft.date):null,Ct=St?EA:0;if(e.options.noBox){let ht=ft.side==="below",Pt=ht?0:ft.cardH-ft.headerH,Dt=ht?0:ft.cardH-ft.headerH-Ct,qt=ft.headerH+Ct,Wt=`dgmo-evt-shelf-${Et++}`;if(yt.append("clipPath").attr("id",Wt).append("rect").attr("x",0).attr("y",Dt).attr("width",fo).attr("height",qt).attr("rx",trt),yt.append("rect").attr("x",0).attr("y",Dt).attr("width",fo).attr("height",qt).attr("clip-path",`url(#${Wt})`).attr("fill",e.options.fillMode?ft.color:vt(ft.color,Ie(n,r),Jnt)),kA!=="none"&&!e.options.fillMode){let xt=kA==="left"?{x:0,y:Dt,width:cx,height:qt}:{x:0,y:ht?Dt:Dt+qt-cx,width:fo,height:cx};yt.append("rect").attr("x",xt.x).attr("y",xt.y).attr("width",xt.width).attr("height",xt.height).attr("clip-path",`url(#${Wt})`).attr("fill",ft.color).attr("fill-opacity",ft.future?.4:1)}let Ft=e.options.fillMode?pe(ft.color,n.textOnFillLight,n.textOnFillDark):ft.color,zt=Pt+ft.headerH/2-(ft.titleLines.length-1)*ax/2;for(let xt=0;xt<ft.titleLines.length;xt++)yt.append("text").attr("x",Pl).attr("y",zt+xt*ax).attr("dominant-baseline","central").attr("fill",Ft).attr("font-family",Mt).attr("font-size",13).attr("font-weight",700).text(ft.titleLines[xt]);if(St&&yt.append("text").attr("x",Pl).attr("y",(ht?ft.headerH:Pt-Ct)+c0+2).attr("fill",e.options.fillMode?vt(Ft,ft.color,25):vt(n.text,n.bg,55)).attr("font-family",Mt).attr("font-size",c0).attr("font-weight",600).text(St),ft.lines.length>0){let xt=ht?ft.headerH+6+Ct+Ac:Pl+Ac;_A(yt,ft.lines,n.text,n,xt,ft.bulletColors,ft.bulletMeta)}}else Os(yt,{width:fo,height:ft.cardH,rx:6,fill:ft.cardFill,stroke:ft.color,strokeWidth:1.5,label:ft.label,labelLines:ft.titleLines,labelColor:ft.titleColor,labelFontSize:13,headerHeight:ft.headerH}),St&&yt.append("text").attr("x",fo/2).attr("y",ft.headerH+c0+1).attr("text-anchor","middle").attr("fill",vt(ft.titleColor,ft.cardFill,60)).attr("font-family",Mt).attr("font-size",c0).attr("font-weight",600).text(St),ft.lines.length>0&&(yt.append("line").attr("x1",0).attr("y1",ft.headerH+Ct).attr("x2",fo).attr("y2",ft.headerH+Ct).attr("stroke",ft.titleColor).attr("stroke-opacity",.3).attr("stroke-width",1),_A(yt,ft.lines,ft.titleColor,n,ft.headerH+6+Ct+Ac,ft.bulletColors,ft.bulletMeta))}for(let ft of O){if(ft.kind==="era"){let _t=ft.color,yt=Math.max(16,ft.spanHalf),St=rt-20,Ct=ut+20,ht=Math.max(St,ft.x-yt),Pt=Math.min(Ct,ft.x+yt),Dt=gt(ft),qt=lt.append("g").attr("class","dgmo-event-era").attr("data-era",ft.era.name).attr("data-era-collapsed","true").attr("data-line-number",ft.lineNumber);if(o){let Ft=Math.min(Dt,Z)-4,Xt=Math.max(Dt,Z)+8;qt.append("rect").attr("x",ht).attr("y",Ft).attr("width",Pt-ht).attr("height",Xt-Ft).attr("fill","transparent").attr("pointer-events","all")}qt.append("path").attr("d",`M${ht},${Z} L${ht},${Dt} L${Pt},${Dt} L${Pt},${Z}`).attr("fill","none").attr("stroke",_t).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round");let Wt=(ht+Pt)/2;qt.append("line").attr("x1",Wt-u0/2).attr("y1",Z).attr("x2",Wt+u0/2).attr("y2",Z).attr("stroke",n.bg).attr("stroke-width",5).attr("stroke-linecap","butt");for(let Ft of grt(Wt,Z))qt.append("path").attr("d",Ft).attr("fill","none").attr("stroke",n.text).attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round");if(o){let Ft=ft.lineNumber;qt.style("cursor","pointer").on("click",()=>o(Ft))}continue}let kt=lt.append("circle").attr("class","dgmo-event-dot").attr("cx",ft.x).attr("cy",Z).attr("r",ix).attr("fill",ft.future?n.bg:ft.color).attr("stroke",ft.future?ft.color:n.bg).attr("stroke-width",2).attr("data-line-number",ft.lineNumber);dx(kt,ft)}if(R){let ft=[],kt=null;for(let Ct of O){let ht=Ct.eraName;if(ht&&v.has(ht)){if(kt===ht&&ft.length>0){let Pt=ft[ft.length-1];Pt.firstX=Math.min(Pt.firstX,Ct.x),Pt.lastX=Math.max(Pt.lastX,Ct.x)}else ft.push({era:v.get(ht),collapsed:Ct.kind==="era",firstX:Ct.x,lastX:Ct.x});kt=ht}else kt=null}let _t=Ct=>Math.max(4,Math.min(F-4,Ct)),yt=S==="above"?1:-1,St=ft.filter(Ct=>!Ct.collapsed).map(Ct=>({run:Ct,x0:_t(Ct.firstX-vA),x1:_t(Ct.lastX+vA)})).sort((Ct,ht)=>Ct.run.firstX-ht.run.firstX);for(let Ct=1;Ct<St.length;Ct++){let ht=St[Ct-1],Pt=St[Ct];if(ht.x1<=Pt.x0)continue;let Dt=(ht.run.lastX+Pt.run.firstX)/2;ht.x1=Math.max(ht.run.lastX,Math.min(ht.x1,Dt-LA)),Pt.x0=Math.min(Pt.run.firstX,Math.max(Pt.x0,Dt+LA))}for(let{run:Ct,x0:ht,x1:Pt}of St){let Dt=!Ct.era.color,qt=Dt?n.text:Re(Ct.era.color,n)??n.text,Wt=Dt?.5:.85,Ft=ot,Xt=lt.append("g").attr("class","dgmo-event-era").attr("data-era",Ct.era.name).attr("data-era-collapsed",String(Ct.collapsed)).attr("data-line-number",Ct.era.lineNumber);if(Xt.append("path").attr("d",`M${ht},${Ft+MA*yt} L${ht},${Ft} L${Pt},${Ft} L${Pt},${Ft+MA*yt}`).attr("fill","none").attr("stroke",qt).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",Wt),Xt.append("text").attr("x",(Ct.firstX+Ct.lastX)/2).attr("y",S==="above"?Ft-6:Ft+NA+4).attr("text-anchor","middle").attr("font-family",Mt).attr("font-size",NA).attr("font-weight",700).attr("fill",qt).attr("fill-opacity",Dt?.85:1).text(Ct.era.name),o){let zt=Ct.era.lineNumber;Xt.style("cursor","pointer").on("click",()=>o(zt))}}}if(e.now&&P){let ft=e.now.dateValue,kt=e.now.date;if(e.now.computed){let Ct=s??new Date,ht=`${Ct.getFullYear()}-${String(Ct.getMonth()+1).padStart(2,"0")}-${String(Ct.getDate()).padStart(2,"0")}`;kt=ht;let Pt=En(ht);ft=Number.isFinite(Pt)?Pt:null}let _t=O.filter(Ct=>Ct.kind!=="era"&&!Ct.future&&Ct.dateValue!==null).sort((Ct,ht)=>Ct.dateValue-ht.dateValue),yt=ft===null?null:hrt(ft,_t),St=_t[_t.length-1];if(yt!==null&&ft!==null&&St&&ft>St.dateValue){let Ct=O.filter(ht=>ht.future&&!ht.futureSpan).map(ht=>ht.x);Ct.length&&(yt=Math.min(...Ct))}if(yt!==null){let Ct=Ie(n,r),ht=e.now.color?Re(e.now.color,n)??n.destructive:n.destructive,Pt=e.options.fillMode,Dt=ee(n,ht,r,{mode:Pt}),qt=Pt==="solid"?"none":Pt==="outline"?ht:vt(ht,Ct,55),Wt=Pt==="solid"?0:Pt==="outline"?1.3:1,Ft=Pt==="solid"?pe(Dt,n.textOnFillLight,n.textOnFillDark):ht,Xt=e.now.label??(kt?zi(kt):"now"),zt=18,xt=Math.max(28,Xt.length*6.6+16),$t=6,Zt=xt/2+4,re=yt-Zt,Ot=yt+Zt,Ut=mt.map(Te=>({side:Te.p.side,top:Te.top,bot:Te.top+Te.p.cardH,left:Te.p.left,right:Te.p.left+fo})),oe=Te=>Te.left<Ot&&Te.right>re,Ee=[],de=Te=>{let dn=Te-zt;dn>C+1&&Ee.push({y0:dn,y1:Te,stem:Z-Te})},jt=Te=>{let dn=Te+zt;dn<Q-1&&Ee.push({y0:Te,y1:dn,stem:Te-Z})};de(Z-rx/2+zt/2),jt(Z+ox/2-zt/2);for(let Te of Ut)oe(Te)&&(Te.side==="above"?de(Te.top-$t):jt(Te.bot+$t));let te=Te=>!Ut.some(dn=>oe(dn)&&dn.bot>Te.y0&&dn.top<Te.y1),fe=(Te,dn)=>Te.stem-dn.stem,Me=Ee.filter(te).sort(fe)[0]??Ee.sort(fe)[0]??{y0:Z-$t-zt,y1:Z-$t,stem:$t+zt},_e=Me.y1<=Z,Ne=_e?Z-ix:Z+ix,Ue=_e?Me.y1:Me.y0,en=Math.max(xt/2+2,Math.min(yt,F-xt/2-2)),An=lt.append("g").attr("class","evt-now").attr("data-now-x",yt.toFixed(2)),cn=Math.min(rx,ox),se=Z-cn,ae=Z+cn,he=`evt-now-fade-${yt.toFixed(0)}`,ze=An.append("defs").append("linearGradient").attr("id",he).attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",se).attr("x2",0).attr("y2",ae);if(ze.append("stop").attr("offset","0%").attr("stop-color",ht).attr("stop-opacity",0),ze.append("stop").attr("offset","50%").attr("stop-color",ht).attr("stop-opacity",.9),ze.append("stop").attr("offset","100%").attr("stop-color",ht).attr("stop-opacity",0),An.append("line").attr("x1",yt).attr("y1",se).attr("x2",yt).attr("y2",ae).attr("stroke",`url(#${he})`).attr("stroke-width",1.6).attr("stroke-dasharray","1 4").attr("stroke-linecap","round"),An.append("path").attr("d",`M${yt} ${Z-5} l5 5 l-5 5 l-5 -5 z`).attr("fill",ht),An.append("line").attr("x1",yt).attr("y1",Ne).attr("x2",yt).attr("y2",Ue).attr("stroke",ht).attr("stroke-width",1.6),An.append("rect").attr("x",en-xt/2).attr("y",Me.y0).attr("width",xt).attr("height",zt).attr("rx",zt/2).attr("fill",Dt).attr("stroke",qt).attr("stroke-width",Wt),An.append("text").attr("x",en).attr("y",Me.y0+zt/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",Mt).attr("font-size",10.5).attr("font-weight",600).attr("fill",Ft).text(Xt),!d){let Te=An.append("line").attr("class","evt-now-rule-full").attr("x1",yt).attr("y1",Math.max(C,2)).attr("x2",yt).attr("y2",Q-2).attr("stroke",ht).attr("stroke-width",1.4).attr("stroke-dasharray","1 4").attr("stroke-linecap","round").attr("opacity",0).style("transition","opacity 120ms ease").style("pointer-events","none");Te.lower();let dn=An.node();dn&&(dn.addEventListener("mouseenter",()=>Te.attr("opacity",.5)),dn.addEventListener("mouseleave",()=>Te.attr("opacity",0)))}}}if(!d){let ft=lt.node();mrt(ft),ft&&(frt(t,ft,()=>mx(t,e,n,r,o,a,i,s)),crt(t,ft))}}function dx(t,e){if(t.attr("data-evt",e.lineNumber),e.eraName&&t.attr("data-evt-era",e.eraName),e.event)for(let[n,r]of Object.entries(e.event.metadata))t.attr(`data-tag-${n.toLowerCase()}`,String(r).toLowerCase())}function art(t){t.querySelectorAll(`.${Dl},.${Rc},.${f0}`).forEach(e=>e.classList.remove(Dl,Rc,f0))}function fu(t,e){if(art(t),!e)return;let n=[...t.querySelectorAll(ort)];if(e.kind==="event"){let l=c=>c.getAttribute("data-evt")===e.id;if(!n.some(l))return;n.forEach(c=>c.classList.add(l(c)?Dl:Rc));return}if(e.kind==="era"){let l=c=>c.getAttribute("data-evt-era")===e.name||c.classList.contains("dgmo-event-era")&&c.getAttribute("data-era")===e.name;if(!n.some(l))return;n.forEach(c=>{l(c)?c.classList.contains("dgmo-event-era")&&c.classList.add(f0):c.classList.add(Rc)});return}let r=`data-tag-${e.group}`,o=l=>l.getAttribute(r)===e.value,a=[...t.querySelectorAll(".dgmo-evt-bullet")],i=new Set;for(let l of a){if(!o(l))continue;let c=l.closest(".dgmo-event-card"),d=c?.getAttribute("data-era")??c?.getAttribute("data-evt-era");d&&i.add(d)}if(!n.some(o)&&i.size===0)return;let s=l=>{let c=l.getAttribute("data-era")??l.getAttribute("data-evt-era");return!!c&&i.has(c)};n.forEach(l=>{!o(l)&&!s(l)&&l.classList.add(Rc)});for(let l of a)o(l)||l.classList.add(Rc)}function d0(t){let e=t.getAttribute(ux);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function irt(t){t.removeAttribute(fx)}function IA(t,e){let n=t.querySelector("svg");n&&(e?n.setAttribute(ux,JSON.stringify(e)):n.removeAttribute(ux),fu(n,e))}function px(t){let e=t.getAttribute(fx);if(!e)return new Set;try{return new Set(JSON.parse(e))}catch{return new Set}}function srt(t){t.selectAll("[data-legend-entry]").each(function(){let r;try{r=this.getBBox()}catch{return}!r.width||!r.height||It(this).insert("rect",":first-child").attr("x",r.x-6).attr("y",r.y-7).attr("width",r.width+12).attr("height",r.height+14).attr("fill","transparent").attr("data-legend-hit","")})}function lrt(t,e){if(e.size===0)return!1;for(let[n,r]of Object.entries(t))if(e.has(`${n.toLowerCase()}:${String(r).toLowerCase()}`))return!0;return!1}function crt(t,e){let n=px(t),r=o=>{for(let a of n){let i=a.indexOf(":");if(i<0)continue;let s=a.slice(0,i),l=a.slice(i+1);if(o.getAttribute(`data-tag-${s}`)===l)return!0}return!1};e.querySelectorAll(".dgmo-event-card,.dgmo-event-leader").forEach(o=>o.classList.toggle(W1,r(o))),e.querySelectorAll("[data-legend-entry]").forEach(o=>{let a=o.closest("[data-legend-group]")?.getAttribute("data-legend-group"),i=o.getAttribute("data-legend-entry");drt(o,!!a&&n.has(`${a}:${i}`))})}function drt(t,e){t.classList.toggle(RA,e);let n=t.querySelector("circle");if(n)if(e)n.hasAttribute("data-fill0")||n.setAttribute("data-fill0",n.getAttribute("fill")??""),n.setAttribute("fill","none"),n.setAttribute("stroke",n.getAttribute("data-fill0")||"currentColor"),n.setAttribute("stroke-width","1.5");else{let r=n.getAttribute("data-fill0");r!==null&&n.setAttribute("fill",r),n.removeAttribute("stroke"),n.removeAttribute("stroke-width")}}function urt(t,e,n){let r=px(t),o=`${e}:${n}`;r.has(o)?r.delete(o):r.add(o),t.setAttribute(fx,JSON.stringify([...r]))}function frt(t,e,n){e.addEventListener("click",r=>{let o=r.target;if(!o||typeof o.closest!="function")return;let a=o.closest("[data-legend-entry]");if(!a)return;let i=a.getAttribute("data-legend-entry"),s=a.closest("[data-legend-group]")?.getAttribute("data-legend-group");if(!s||!i)return;urt(t,s,i);let l=d0(e);n(),l&&IA(t,l),typeof CustomEvent<"u"&&t.dispatchEvent(new CustomEvent("dgmo-event-line-rerender"))})}function mrt(t){t&&(t.addEventListener("mouseover",e=>{let n=e.target;if(!n||typeof n.closest!="function")return;let r=n.closest("[data-legend-entry]");if(r){let i=r.getAttribute("data-legend-entry"),s=r.closest("[data-legend-group]")?.getAttribute("data-legend-group");fu(t,s&&i?{kind:"tag",group:s,value:i}:d0(t));return}let o=n.closest(".dgmo-event-era");if(o){fu(t,{kind:"era",name:o.getAttribute("data-era")??""});return}let a=n.closest("[data-evt]");if(a){let i=a.getAttribute("data-era");fu(t,i?{kind:"era",name:i}:{kind:"event",id:a.getAttribute("data-evt")??""});return}fu(t,d0(t))}),t.addEventListener("mouseout",e=>{let n=e.relatedTarget;(!n||!t.contains(n))&&fu(t,d0(t))}))}function prt(t,e,n,r,o,a,i){mx(t,e,n,r,void 0,o,a,i)}function hrt(t,e){if(!e.length)return null;let n=e[0],r=e[e.length-1];if(t<=n.dateValue)return n.x;if(t>=r.dateValue)return r.x;for(let o=0;o<e.length-1;o++){let a=e[o],i=e[o+1];if(t>=a.dateValue&&t<=i.dateValue){let s=i.dateValue-a.dateValue;return s<=0?a.x:a.x+(t-a.dateValue)/s*(i.x-a.x)}}return r.x}function grt(t,e){let o=a=>{let i="";for(let s=0;s<=48;s++){let l=s/48,c=e-CA+l*2*CA,d=a+ert*Math.sin(l*Math.PI*2);i+=`${s===0?"M":"L"}${d.toFixed(2)},${c.toFixed(2)}`,s<48&&(i+=" ")}return i};return[o(t-u0/2),o(t+u0/2)]}function TA(t,e){return Wo([...t],e)}function _A(t,e,n,r,o=Xnt+Ac,a=[],i=[]){let s=o,l=0,c=n,d=null,u=f=>{if(d){f.attr("class","dgmo-evt-bullet");for(let[m,p]of Object.entries(d))f.attr(`data-tag-${m.toLowerCase()}`,String(p).toLowerCase())}};for(let f of e){let m=f.kind==="bullet-first"||f.kind==="bullet-cont",p=Pl+(m?12:0);if(f.kind==="bullet-first"){c=a[l]??n,d=i[l]??null,l++;let g=t.append("text").attr("x",Pl).attr("y",s).attr("text-anchor","start").attr("fill",c).attr("font-family",Mt).attr("font-size",Ac).attr("font-weight",700).text("\u2022");u(g)}else m||(c=n,d=null);let h=t.append("text").attr("x",p).attr("y",s).attr("text-anchor","start").attr("fill",m?c:n).attr("font-family",Mt).attr("font-size",Ac);m&&u(h),pn(h,f.text,r),s+=AA}}var fo,l0,Vnt,Unt,rx,ox,Ac,AA,Pl,Xnt,ax,jnt,ix,Knt,Znt,Qnt,sx,lx,EA,c0,Jnt,trt,kA,cx,SA,MA,vA,LA,CA,ert,u0,nrt,NA,Dl,Rc,f0,W1,RA,fx,rrt,ort,ux,DA=dt(()=>{"use strict";Nn();Ke();Fe();rr();F1();co();Ve();Ts();Mr();qr();ko();I4();Pf();Oe();fo=210,l0=58,Vnt=48,Unt=34,rx=46,ox=46,Ac=11.5,AA=16,Pl=9,Xnt=34,ax=16,jnt=(fo-Pl*2)*.93,ix=5.5,Knt=96,Znt=16,Qnt="#999999",sx=18,lx=6,EA=15,c0=10,Jnt=13,trt=4,kA="spine",cx=2,SA=30,MA=8,vA=14,LA=3,CA=6,ert=2.6,u0=5,nrt=13,NA=11.5,Dl="dgmo-evt-hl",Rc="dgmo-evt-dim",f0="dgmo-evt-era-hl",W1="dgmo-evt-collapsed",RA="dgmo-evt-off",fx="data-evt-hidden",rrt=`.dgmo-event-dot{transition:transform .12s ease;transform-box:fill-box;transform-origin:center}.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era{transition:opacity .12s ease,filter .12s ease}.dgmo-event-dot,.dgmo-event-card,.dgmo-event-era{cursor:default}[data-legend-entry]{cursor:pointer}.${Rc}{opacity:.2}.dgmo-event-dot.${Dl}{transform:scale(1.55)}.dgmo-event-leader.${Dl}{stroke-opacity:1;stroke-width:2.5}.dgmo-event-card.${Dl}{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}.dgmo-event-era.${f0}{filter:drop-shadow(0 1px 2px rgba(0,0,0,.28))}.dgmo-event-card.${W1},.dgmo-event-leader.${W1}{opacity:0;pointer-events:none}.dgmo-event-card.${W1}.${Dl},.dgmo-event-leader.${W1}.${Dl}{opacity:1;pointer-events:auto}[data-legend-entry].${RA} text{opacity:.5}`;ort=".dgmo-event-dot,.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era",ux="data-evt-pin"});var zA={};ue(zA,{renderBody:()=>WA,renderBodyForExport:()=>krt});function $A(t){let e=t.match(/[Mm]\s*(-?[\d.]+)/);return e?parseFloat(e[1]):0}function HA(t){return(t.side?`${t.side} `:"")+t.name.toLowerCase()}function FA(t){return t.side?`${t.side} ${t.name}`:t.name}function xrt(t,e,n){let r=n==="front"?e==="left":e==="right";return t.reduce((o,a)=>r?a.x>o.x?a:o:a.x<o.x?a:o)}function wrt(t,e,n,r,o,a,i,s,l,c){let[d,u,f,m]=t.viewBox.split(" ").map(Number),p=vt(i.bg,i.border,.7),h=i.bg,g=i.textMuted,x=`body-skin-${d}-${u}`;c.push({id:x,stops:[{offset:"0",color:vt(i.surface,i.bg,.4)},{offset:"1",color:vt(i.border,i.bg,.3)}]});let y="";if(a==="skin"){y+=`<path d="${t.outline}" fill="url(#${x})"/>`;for(let C of t.headPaths)y+=`<path d="${C}" fill="url(#${x})" stroke="${g}" stroke-width="2.5"/>`;let k=vt(i.text,i.bg,.6);for(let C of t.hairPaths)y+=`<path d="${C}" fill="${k}" stroke="${g}" stroke-width="1.5"/>`}else{y+=`<path d="${t.outline}" fill="url(#${x})"/>`;for(let k of t.base)y+=`<path d="${k}" fill="${p}" fill-opacity="0.55" stroke="${h}" stroke-width="1"/>`;for(let k of t.headPaths)y+=`<path d="${k}" fill="url(#${x})" stroke="${g}" stroke-width="2.5"/>`;for(let k of t.hairPaths)y+=`<path d="${k}" fill="none" stroke="${g}" stroke-width="2.5"/>`}let b=new Map,w=d+f/2;for(let k of n){let C=O1(t,k.name);if(!C)continue;let v=E_(t,C),_=r(k),R=o(k).toLowerCase(),L=` class="dgmo-body-part" data-line-number="${k.lineNumber}" data-emph-key="${Pc(R)}"`,E=v.paths;if(k.side){let T=e==="front"?k.side==="left":k.side==="right",N=v.paths.filter(I=>T?$A(I)>=w:$A(I)<w);N.length&&(E=N)}if(l==="solid")for(let T of E)y+=`<path${L} d="${T}" fill="${_}" stroke="${_}" stroke-width="1.5"/>`;else if(l==="outline"){let T=Ie(i,s);for(let N of E)y+=`<path${L} d="${N}" fill="${T}" stroke="${_}" stroke-width="2.5"/>`}else if(a==="skin")for(let T of E)y+=`<path${L} d="${T}" fill="${_}" fill-opacity="0.5" stroke="${_}" stroke-width="1.5"/>`;else{let T=vt(_,Ie(i,s),25);for(let N of E)y+=`<path${L} d="${N}" fill="${T}" stroke="${_}" stroke-width="1.5"/>`}let M=v.centers?.length?v.centers.map(T=>({x:T.x,y:T.y})):[{x:v.anchor.x,y:v.anchor.y}],S=k.side&&M.length>1?xrt(M,k.side,e):null;b.set(HA(k),{x:S?.x??v.anchor.x,y:S?.y??v.anchor.y,centers:S?[S]:M,color:_,emph:R,part:k})}return y+=`<path d="${t.outline}" fill="none" stroke="${g}" stroke-width="2.5"/>`,{fig:t,body:y,anchors:b,vx:d,vy:u,vw:f,vh:m}}function gx(t,e){let n=t.centers[0]??{x:t.x,y:t.y},r=Math.abs(n.x-e);for(let o of t.centers){let a=Math.abs(o.x-e);a<r&&(r=a,n=o)}return n}function Ert(t,e){let{vx:n,vw:r,vh:o}=t,a=n+r/2,i=[...t.anchors.values()],s=r*.1,l=i.filter(m=>m.x<a-s),c=i.filter(m=>m.x>a+s),d=i.filter(m=>m.x>=a-s&&m.x<=a+s).sort((m,p)=>m.y-p.y);for(let m of d)(l.length<=c.length?l:c).push(m);let u="",f=(m,p)=>{let h=p==="L"?n-14:n+r+14,g=p==="L"?h+26:h-26,x=p==="L"?"end":"start",y=o*.05,b=m.map(k=>({a:k,tgt:gx(k,h)})).sort((k,C)=>k.tgt.y-C.tgt.y),w=-1e9;for(let{a:k,tgt:C}of b){let v=Math.max(C.y,w+y);w=v;let _=k.part.notes.length?k.part.notes[0]:"",R=` class="dgmo-body-part" data-line-number="${k.part.lineNumber}" data-emph-key="${Pc(k.emph)}"`;u+=`<path${R} d="M${g} ${v} L${C.x} ${C.y}" stroke="${k.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${R} cx="${C.x}" cy="${C.y}" r="5.5" fill="${k.color}" stroke="${e.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/><text${R} x="${h}" y="${v+(_?-2:7)}" text-anchor="${x}" font-size="${qA}" font-weight="700" fill="${e.text}">${Pc(FA(k.part))}</text>`,_&&(u+=`<text${R} x="${h}" y="${v+22}" text-anchor="${x}" font-size="${BA}" fill="${e.textMuted}">${Pc(_)}</text>`)}};return f(l,"L"),f(c,"R"),u}function WA(t,e,n,r,o,a,i){let s=Bn(n)[0],l=mr(e.tagGroups,void 0,i),c=k=>Dn(k.metadata,e.tagGroups,l)??s,d=k=>l?k.metadata[Bt(l)]??"":"",u=[],f=e.options.views.map(k=>wrt(D1(e.options.sex,k),k,e.parts,c,d,e.options.form,n,r,e.options.fillMode,u)),m=Math.max(...f.map(k=>k.fig.contentBox.h)),p="",h;if(f.length===1){let k=f[0],C=k.vw*.42,v=pu+C-k.vx,_=m0-k.vy;p=`<g transform="translate(${v.toFixed(2)} ${_.toFixed(2)})">${k.body}${Ert(k,n)}</g>`,h=pu*2+C*2+k.vw}else{let k=f[0],C=f[1],v=k.fig.contentBox,_=C.fig.contentBox,R=m/v.h,L=m/_.h,E=pu,M=pu+v.w*R+hx,S=E-v.x*R,T=M-_.x*L,N=m0-v.y*R,I=m0-_.y*L;p+=`<g transform="translate(${S.toFixed(2)} ${N.toFixed(2)}) scale(${R.toFixed(4)})">${k.body}</g>`,p+=`<g transform="translate(${T.toFixed(2)} ${I.toFixed(2)}) scale(${L.toFixed(4)})">${C.body}</g>`,h=pu*2+v.w*R+hx+_.w*L;let G=pu+v.w*R+hx/2,$=q=>({x:S+q.x*R,y:N+q.y*R}),A=q=>({x:T+q.x*L,y:I+q.y*L}),D=new Set,O=[];for(let q of e.parts){let V=HA(q);if(D.has(V))continue;let X=k.anchors.get(V),z=C.anchors.get(V);if(!X&&!z)continue;D.add(V);let U=X?$(gx(X,k.vx+k.vw)):void 0,Y=z?A(gx(z,C.vx)):void 0,K=[U?.y,Y?.y].filter(et=>et!=null);O.push({name:FA(q),note:q.notes.length?q.notes[0]:"",color:(X??z).color,emph:(X??z).emph,line:q.lineNumber,...U&&{left:U},...Y&&{right:Y},y:K.reduce((et,nt)=>et+nt,0)/K.length})}O.sort((q,V)=>q.y-V.y);let P=m*.052,H=-1e9;for(let q of O)q.y=Math.max(q.y,H+P),H=q.y;let W="",B=96;for(let q of O){let V=` class="dgmo-body-part" data-line-number="${q.line}" data-emph-key="${Pc(q.emph)}"`;q.left&&(W+=`<path${V} d="M${(G-B).toFixed(1)} ${q.y.toFixed(1)} L${q.left.x.toFixed(1)} ${q.left.y.toFixed(1)}" stroke="${q.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${V} cx="${q.left.x.toFixed(1)}" cy="${q.left.y.toFixed(1)}" r="5.5" fill="${q.color}" stroke="${n.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/>`),q.right&&(W+=`<path${V} d="M${(G+B).toFixed(1)} ${q.y.toFixed(1)} L${q.right.x.toFixed(1)} ${q.right.y.toFixed(1)}" stroke="${q.color}" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" fill="none" opacity="0.85"/><circle${V} cx="${q.right.x.toFixed(1)}" cy="${q.right.y.toFixed(1)}" r="5.5" fill="${q.color}" stroke="${n.bg}" stroke-width="2" vector-effect="non-scaling-stroke"/>`),W+=`<text${V} x="${G}" y="${(q.y-3).toFixed(1)}" text-anchor="middle" font-size="${qA}" font-weight="700" fill="${n.text}">${Pc(q.name)}</text>`,q.note&&(W+=`<text${V} x="${G}" y="${(q.y+20).toFixed(1)}" text-anchor="middle" font-size="${BA}" fill="${n.textMuted}">${Pc(q.note)}</text>`)}p+=W}let g=m0+m+brt,x=!!a;It(t).selectAll("svg").remove();let y=a?.width??t.clientWidth??1200,b=a?.height??t.clientHeight??800,w=It(t).append("svg").attr("width",y).attr("height",b).attr("viewBox",`${-p0} ${-p0} ${(h+2*p0).toFixed(0)} ${(g+2*p0).toFixed(0)}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(u.length){let k=w.append("defs");for(let C of u){let v=k.append("linearGradient").attr("id",C.id).attr("x1","0").attr("y1","0").attr("x2","0").attr("y2","1");for(let _ of C.stops)v.append("stop").attr("offset",_.offset).attr("stop-color",_.color)}}if(w.append("g").html(p),e.title&&!e.options.noTitle&&w.append("text").attr("x",h/2).attr("y",40).attr("text-anchor","middle").attr("font-size",34).attr("font-weight",700).attr("fill",n.text).text(e.title),!e.options.noLegend&&e.tagGroups.length){let k=w.append("g").attr("transform",`translate(0, ${GA}) scale(${OA})`),C=e.tagGroups.map(v=>({name:v.name,entries:v.entries.map(_=>({value:_.value,color:Re(_.color,n)??_.color}))}));tn(k,{groups:C,palette:n,isDark:r,width:h/OA,mode:x?"export":"preview",activeGroup:l})}}function krt(t,e,n,r,o,a){WA(t,e,n,r,void 0,o,a)}var Pc,GA,OA,yrt,m0,brt,p0,pu,hx,qA,BA,YA=dt(()=>{"use strict";Nn();Fe();rr();Ke();Oe();Mr();q6();Pc=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),GA=60,OA=2.4,yrt=76,m0=GA+yrt,brt=40,p0=160,pu=30,hx=420,qA=23,BA=17});var ZA={};ue(ZA,{renderVersionControl:()=>KA,renderVersionControlForExport:()=>_rt});function Crt(t,e){return t.length>e?t.slice(0,e-1)+"\u2026":t}function xx(t,e,n,r,o,a,i){let s=Math.hypot(n-t,r-e),l=Math.hypot(o-n,a-r),c=Math.max(2,Math.min(i,s-1,l-1)),d=(n-t)/(s||1),u=(r-e)/(s||1),f=(o-n)/(l||1),m=(a-r)/(l||1);return`M${t},${e} L${n-d*c},${r-u*c} Q${n},${r} ${n+f*c},${r+m*c} L${o},${a}`}function KA(t,e,n,r,o,a){if(e.nodes.length===0)return;It(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.nodes,s=e.options.direction!=="LR",l=new Map(e.branches.map(B=>[B.name,B])),c=Bn(n),d=B=>B.colorToken?Re(B.colorToken,n)??c[B.lane%c.length]:c[B.lane%c.length],u=B=>d(l.get(B.branch)),f=B=>i[B],m=B=>B.kind==="cherry"?"\u21E0 ":B.kind==="merge"?"\u21F2 ":"",p=new Map;for(let B of i){let q=B.id,V=m(B)+Crt(B.message||"(empty)",26),X=(q?q.length*6.6+8:0)+V.length*6.9+8;p.set(B.key,{sha:q,msg:V,lw:X})}let h=Math.max(0,...[...p.values()].map(B=>B.lw)),g=new Map,x=(B,q)=>{g.has(B)||g.set(B,[]),g.get(B).push(q)};if(!e.options.noLabels)for(let B of i)B.tag&&x(B.key,{kind:"tag",label:B.tag,w:B.tag.length*6.6+16});for(let B of e.refs)B.atKey!=null&&(B.head?x(B.atKey,{kind:"head",label:"HEAD",w:46}):x(B.atKey,{kind:"ref",label:B.name,remote:B.remote,w:B.name.length*6.2+18}));for(let B of e.notes)B.anchorKey!=null&&x(B.anchorKey,{kind:"note",label:jA[B.num-1]??`#${B.num}`,w:19});let y=Math.max(0,...[...g.values()].map(B=>B.length)),b=e.branches.length,w=i.length,k=new Map,C=[],v,_,R,L,E=0;if(s){R=24;let B=R+32,q=52,V=96;L=78;for(let z of i)k.set(z.key,{x:L+z.lane*V,y:B+z.seq*q});let X=L+(b-1)*V+28;for(let z of i){let U=k.get(z.key);C.push({node:z,kind:"msg",x:X,y:U.y,anchor:"start",leader:{x1:U.x+Ko+2,y1:U.y,x2:X-6,y2:U.y}}),(g.get(z.key)??[]).forEach((K,et)=>C.push({node:z,kind:K.kind,label:K.label,remote:K.remote,w:K.w,x:U.x-Ko-12-K.w/2-et*4,y:U.y,anchor:"middle"}))}v=X+h+16,_=B+(w-1)*q+22}else{R=14;let B=R+20,q=88,V=50;L=16+y*VA+14;for(let nt of i)k.set(nt.key,{x:B+nt.seq*q,y:L+nt.lane*V});let z=L+(b-1)*V+Lrt,U=6,Y=[],K=[...i].sort((nt,J)=>k.get(nt.key).x-k.get(J.key).x);for(let nt of K){let J=k.get(nt.key),F=p.get(nt.key).lw+wx*2,j=J.x-F/2,Q=Y.length;for(let at=0;at<Y.length;at++)if(Y[at]+U<=j){Q=at;break}let Z=z+Q*(z1+XA);Y[Q]=j+F,C.push({node:nt,kind:"msg",x:J.x,y:Z,anchor:"start",shelfLeft:Math.max(4,j),shelfTop:Z,shelfW:F,leader:{x1:J.x,y1:J.y+Ko,x2:J.x,y2:Z}}),(g.get(nt.key)??[]).forEach((at,lt)=>C.push({node:nt,kind:at.kind,label:at.label,remote:at.remote,w:at.w,x:J.x,y:J.y-Ko-12-lt*VA,anchor:"middle"}))}let et=Y.length;for(let nt of e.branches){if(!nt.ab||nt.ab.ahead+nt.ab.behind===0||nt.tip==null)continue;let J=k.get(nt.tip);C.push({node:f(nt.tip),kind:"ab",label:Nrt(nt.ab),x:J.x+Ko+10,y:J.y,anchor:"start"})}v=Math.max(B+(w-1)*q+Ko+40,...[...k.entries()].map(([nt,J])=>J.x+p.get(nt).lw/2+wx+8))+8,_=z+et*(z1+XA)+8,e.notes.length&&(E=_+4,_+=8+e.notes.length*16+8)}let M=!!e.title,S=M?Srt:0,T=v,N=_+S,I=!!a,G=I?0:t.clientWidth||0,$=I?0:t.clientHeight||0,A=Math.round(Math.max(T,G)),D=Math.round(Math.max(N,$)),O=I?A:G||A,P=I?D:$||D,H=It(t).append("svg").attr("width",O).attr("height",P).attr("viewBox",`0 0 ${A} ${D}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);if(H.append("rect").attr("width",A).attr("height",D).attr("fill",n.bg),M){let B=H.append("text").attr("class","chart-title").attr("x",A/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",Mt).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber&&!I){let q=e.titleLineNumber;B.style("cursor","pointer").on("click",()=>o(q))}}let W=H.append("g").attr("transform",`translate(0, ${S})`);Trt(W,e,n,s,k,C,p,u,f,L,E,o&&!I?o:void 0)}function Nrt(t){let e=[];return t.ahead&&e.push("\u2191"+t.ahead),t.behind&&e.push("\u2193"+t.behind),e.join(" ")}function Trt(t,e,n,r,o,a,i,s,l,c,d,u){let f=e.nodes,m=w=>o.get(w),p=(w,k)=>r?{x:m(k.key).x,y:m(w.key).y}:{x:m(w.key).x,y:m(k.key).y},h=(w,k)=>r?{x:m(w.key).x,y:m(k.key).y}:{x:m(k.key).x,y:m(w.key).y},g=w=>w.ghost?.32:1,x=(w,k,C,v)=>{let _=m(w.key),R=m(k.key),L=h(w,k);if(t.append("path").attr("d",xx(_.x,_.y,L.x,L.y,R.x,R.y,bx)).attr("fill","none").attr("stroke",C).attr("stroke-width",2).attr("stroke-dasharray","2 4").attr("opacity",.8),v){let E=R.x-L.x,M=R.y-L.y,S=Math.hypot(E,M)||1,T=E/S,N=M/S,I=-N,G=T,$=4;t.append("path").attr("d",`M${R.x},${R.y} L${R.x-T*$*2+I*$},${R.y-N*$*2+G*$} L${R.x-T*$*2-I*$},${R.y-N*$*2-G*$} Z`).attr("fill",C).attr("opacity",.8)}};for(let w of f){let k=s(w),C=g(w),v=m(w.key);if(w.prev!=null){let _=m(w.prev),R=t.append("line").attr("x1",_.x).attr("y1",_.y).attr("x2",v.x).attr("y2",v.y).attr("stroke",k).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",w.branch).attr("opacity",C);w.ghost&&R.attr("stroke-dasharray","5 5")}if(w.parent!=null){let _=l(w.parent),R=p(_,w),L=m(_.key),E=t.append("path").attr("d",xx(L.x,L.y,R.x,R.y,v.x,v.y,bx)).attr("fill","none").attr("stroke",k).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",w.branch).attr("opacity",C);w.ghost&&E.attr("stroke-dasharray","5 5")}if(w.mergeFrom!=null){let _=l(w.mergeFrom),R=h(_,w),L=m(_.key);t.append("path").attr("d",xx(L.x,L.y,R.x,R.y,v.x,v.y,bx)).attr("fill","none").attr("stroke",s(_)).attr("stroke-width",yx).attr("stroke-linecap","round").attr("data-branch",_.branch).attr("opacity",.92*C)}w.cherryFrom!=null&&x(l(w.cherryFrom),w,s(l(w.cherryFrom)),!1),w.revertFrom!=null&&x(l(w.revertFrom),w,k,!1),w.squashFrom!=null&&x(l(w.squashFrom),w,n.textMuted,!0),w.movedTo!=null&&x(w,l(w.movedTo),n.textMuted,!0)}if(!e.options.noLanes)for(let w of e.branches){let k=null;for(let _ of f)_.branch===w.name&&(k===null||_.seq<k.seq)&&(k=_);if(!k)continue;let C=m(k.key),v=s(k);r?t.append("text").attr("x",C.x).attr("y",14).attr("text-anchor","middle").attr("font-size",12.5).attr("font-weight",800).attr("fill",v).text(w.name):t.append("text").attr("x",C.x-Ko-1).attr("y",C.y-Ko-7).attr("text-anchor","start").attr("font-size",12.5).attr("font-weight",800).attr("fill",v).attr("data-branch",w.name).text(w.name)}for(let w of f){let k=s(w),C=m(w.key),v=_=>{_.attr("data-line-number",w.lineNumber),_.attr("data-branch",w.branch),u&&_.style("cursor","pointer").on("click",()=>u(w.lineNumber))};if(w.ghost){v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko-1).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",2).attr("opacity",.4));continue}w.type==="highlight"?v(t.append("rect").attr("x",C.x-Ko).attr("y",C.y-Ko).attr("width",Ko*2).attr("height",Ko*2).attr("rx",3.5).attr("fill",k).attr("stroke",n.bg).attr("stroke-width",3)):w.type==="reverse"?(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",3),v(t.append("path").attr("d",`M${C.x-3.6},${C.y-3.6} L${C.x+3.6},${C.y+3.6} M${C.x+3.6},${C.y-3.6} L${C.x-3.6},${C.y+3.6}`).attr("stroke",k).attr("stroke-width",2).attr("stroke-linecap","round").attr("fill","none"))):w.kind==="merge"?(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",k).attr("stroke-width",3),v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",3).attr("fill",k))):v(t.append("circle").attr("cx",C.x).attr("cy",C.y).attr("r",Ko).attr("fill",k).attr("stroke",n.bg).attr("stroke-width",3))}let y=(w,k,C,v,_,R,L,E,M=700)=>{let S=t.append("rect").attr("x",w-C/2).attr("y",k-8.5).attr("width",C).attr("height",17).attr("rx",8.5).attr("fill",_);L&&(S.attr("stroke",L).attr("stroke-width",1.3),E&&S.attr("stroke-dasharray","3 2")),t.append("text").attr("x",w).attr("y",k+4).attr("text-anchor","middle").attr("font-size",10.5).attr("font-weight",M).attr("fill",R).text(v)},b=0;for(let w of a){let k=w.node,C=s(k);if(w.leader&&t.append("line").attr("x1",w.leader.x1).attr("y1",w.leader.y1).attr("x2",w.leader.x2).attr("y2",w.leader.y2).attr("stroke",C).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("data-branch",k.branch).attr("opacity",.55*g(k)),w.kind==="tag")y(w.x,w.y,w.w,w.label,C,n.bg);else if(w.kind==="head")y(w.x,w.y,w.w,"HEAD",n.text,n.bg,void 0,!1,800);else if(w.kind==="ref")y(w.x,w.y,w.w,w.label,n.bg,C,C,w.remote);else if(w.kind==="note")t.append("circle").attr("cx",w.x).attr("cy",w.y).attr("r",8.5).attr("fill",C),t.append("text").attr("x",w.x).attr("y",w.y+4).attr("text-anchor","middle").attr("font-size",11).attr("fill",n.bg).text(w.label);else if(w.kind==="ab")t.append("text").attr("x",w.x).attr("y",w.y+4).attr("text-anchor","start").attr("font-size",11).attr("font-weight",700).attr("fill",C).text(w.label);else{let v=i.get(k.key),_=k.ghost,R=_?n.textMuted:C,L=w.x,E=w.y+4,M=w.anchor;if(w.shelfW!=null){let T=w.shelfLeft,N=w.shelfTop,I=w.shelfW,G=`dgmo-vc-shelf-${b++}`;t.append("clipPath").attr("id",G).append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",z1).attr("rx",UA),t.append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",z1).attr("rx",UA).attr("fill",_?n.bg:vt(C,n.bg,Mrt)).attr("data-branch",k.branch).attr("opacity",_?.5:1),t.append("rect").attr("x",T).attr("y",N).attr("width",I).attr("height",vrt).attr("clip-path",`url(#${G})`).attr("fill",C).attr("data-branch",k.branch).attr("opacity",_?.4:1),L=T+wx,E=N+z1/2+4,M="start"}let S=t.append("text").attr("x",L).attr("y",E).attr("text-anchor",M).attr("font-size",12).attr("data-branch",k.branch).attr("opacity",_?.6:1);v.sha&&S.append("tspan").attr("font-family","ui-monospace, monospace").attr("font-size",11).attr("fill",n.textMuted).text(v.sha+" "),S.append("tspan").attr("fill",R).attr("font-weight",k.kind==="cherry"?400:700).attr("font-style",k.kind==="cherry"?"italic":"normal").text(v.msg)}}if(d&&e.notes.length){let w=d+14;for(let k of e.notes){let C=t.append("text").attr("x",12).attr("y",w).attr("font-size",11.5);C.append("tspan").attr("fill",n.text).attr("font-weight",800).text((jA[k.num-1]??`#${k.num}`)+" "),C.append("tspan").attr("fill",n.textMuted).text(k.text),w+=16}}}function _rt(t,e,n,r,o){KA(t,e,n,r,void 0,o)}var yx,Ko,bx,VA,jA,Srt,Mrt,UA,vrt,wx,z1,Lrt,XA,QA=dt(()=>{"use strict";Nn();Ke();Fe();rr();yx=3,Ko=5.5,bx=10,VA=19,jA="\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468",Srt=40,Mrt=13,UA=4,vrt=2,wx=8,z1=21,Lrt=22,XA=7});function Art(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function JA(){return this.eachAfter(Art)}var tR=dt(()=>{"use strict"});function eR(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}var nR=dt(()=>{"use strict"});function rR(t,e){for(var n=this,r=[n],o,a,i=-1;n=r.pop();)if(t.call(e,n,++i,this),o=n.children)for(a=o.length-1;a>=0;--a)r.push(o[a]);return this}var oR=dt(()=>{"use strict"});function aR(t,e){for(var n=this,r=[n],o=[],a,i,s,l=-1;n=r.pop();)if(o.push(n),a=n.children)for(i=0,s=a.length;i<s;++i)r.push(a[i]);for(;n=o.pop();)t.call(e,n,++l,this);return this}var iR=dt(()=>{"use strict"});function sR(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}var lR=dt(()=>{"use strict"});function cR(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}var dR=dt(()=>{"use strict"});function uR(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}var fR=dt(()=>{"use strict"});function mR(t){for(var e=this,n=Rrt(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Rrt(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}var pR=dt(()=>{"use strict"});function hR(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}var gR=dt(()=>{"use strict"});function yR(){return Array.from(this)}var bR=dt(()=>{"use strict"});function xR(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}var wR=dt(()=>{"use strict"});function ER(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var kR=dt(()=>{"use strict"});function*SR(){var t=this,e,n=[t],r,o,a;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,a=r.length;o<a;++o)n.push(r[o]);while(n.length)}var MR=dt(()=>{"use strict"});function ts(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Drt)):e===void 0&&(e=Prt);for(var n=new Dc(t),r,o=[n],a,i,s,l;r=o.pop();)if((i=e(r.data))&&(l=(i=Array.from(i)).length))for(r.children=i,s=l-1;s>=0;--s)o.push(a=i[s]=new Dc(i[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore($rt)}function Irt(){return ts(this).eachBefore(Ort)}function Prt(t){return t.children}function Drt(t){return Array.isArray(t)?t[1]:null}function Ort(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function $rt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Dc(t){this.data=t,this.depth=this.height=0,this.parent=null}var Ex=dt(()=>{"use strict";tR();nR();oR();iR();lR();dR();fR();pR();gR();bR();wR();kR();MR();Dc.prototype=ts.prototype={constructor:Dc,count:JA,each:eR,eachAfter:aR,eachBefore:rR,find:sR,sum:cR,sort:uR,path:mR,ancestors:hR,descendants:yR,leaves:xR,links:ER,copy:Irt,[Symbol.iterator]:SR}});function vR(t){if(typeof t!="function")throw new Error;return t}var LR=dt(()=>{"use strict"});function hu(){return 0}function gu(t){return function(){return t}}var CR=dt(()=>{"use strict"});function h0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}var kx=dt(()=>{"use strict"});function g0(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(r-e)/t.value;++s<l;)i=a[s],i.y0=n,i.y1=o,i.x0=e,i.x1=e+=i.value*c}var Sx=dt(()=>{"use strict"});function Mx(){var t=1,e=1,n=0,r=!1;function o(i){var s=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/s,i.eachBefore(a(e,s)),r&&i.eachBefore(h0),i}function a(i,s){return function(l){l.children&&g0(l,l.x0,i*(l.depth+1)/s,l.x1,i*(l.depth+2)/s);var c=l.x0,d=l.y0,u=l.x1-n,f=l.y1-n;u<c&&(c=u=(c+u)/2),f<d&&(d=f=(d+f)/2),l.x0=c,l.y0=d,l.x1=u,l.y1=f}}return o.round=function(i){return arguments.length?(r=!!i,o):r},o.size=function(i){return arguments.length?(t=+i[0],e=+i[1],o):[t,e]},o.padding=function(i){return arguments.length?(n=+i,o):n},o}var NR=dt(()=>{"use strict";kx();Sx()});function Grt(t,e){return t.parent===e.parent?1:2}function vx(t){var e=t.children;return e?e[0]:t.t}function Lx(t){var e=t.children;return e?e[e.length-1]:t.t}function qrt(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Brt(t){for(var e=0,n=0,r=t.children,o=r.length,a;--o>=0;)a=r[o],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function Hrt(t,e,n){return t.a.parent===e.parent?t.a:n}function y0(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Frt(t){for(var e=new y0(t,0),n,r=[e],o,a,i,s;n=r.pop();)if(a=n._.children)for(n.children=new Array(s=a.length),i=s-1;i>=0;--i)r.push(o=n.children[i]=new y0(a[i],i)),o.parent=n;return(e.parent=new y0(null,0)).children=[e],e}function Cx(){var t=Grt,e=1,n=1,r=null;function o(c){var d=Frt(c);if(d.eachAfter(a),d.parent.m=-d.z,d.eachBefore(i),r)c.eachBefore(l);else{var u=c,f=c,m=c;c.eachBefore(function(y){y.x<u.x&&(u=y),y.x>f.x&&(f=y),y.depth>m.depth&&(m=y)});var p=u===f?1:t(u,f)/2,h=p-u.x,g=e/(f.x+p+h),x=n/(m.depth||1);c.eachBefore(function(y){y.x=(y.x+h)*g,y.y=y.depth*x})}return c}function a(c){var d=c.children,u=c.parent.children,f=c.i?u[c.i-1]:null;if(d){Brt(c);var m=(d[0].z+d[d.length-1].z)/2;f?(c.z=f.z+t(c._,f._),c.m=c.z-m):c.z=m}else f&&(c.z=f.z+t(c._,f._));c.parent.A=s(c,f,c.parent.A||u[0])}function i(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function s(c,d,u){if(d){for(var f=c,m=c,p=d,h=f.parent.children[0],g=f.m,x=m.m,y=p.m,b=h.m,w;p=Lx(p),f=vx(f),p&&f;)h=vx(h),m=Lx(m),m.a=c,w=p.z+y-f.z-g+t(p._,f._),w>0&&(qrt(Hrt(p,c,u),c,w),g+=w,x+=w),y+=p.m,g+=f.m,b+=h.m,x+=m.m;p&&!Lx(m)&&(m.t=p,m.m+=y-x),f&&!vx(h)&&(h.t=f,h.m+=g-b,u=c)}return u}function l(c){c.x*=e,c.y=c.depth*n}return o.separation=function(c){return arguments.length?(t=c,o):t},o.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],o):r?null:[e,n]},o.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],o):r?[e,n]:null},o}var TR=dt(()=>{"use strict";Ex();y0.prototype=Object.create(Dc.prototype)});function _R(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(o-n)/t.value;++s<l;)i=a[s],i.x0=e,i.x1=r,i.y0=n,i.y1=n+=i.value*c}var AR=dt(()=>{"use strict"});function zrt(t,e,n,r,o,a){for(var i=[],s=e.children,l,c,d=0,u=0,f=s.length,m,p,h=e.value,g,x,y,b,w,k,C;d<f;){m=o-n,p=a-r;do g=s[u++].value;while(!g&&u<f);for(x=y=g,k=Math.max(p/m,m/p)/(h*t),C=g*g*k,w=Math.max(y/C,C/x);u<f;++u){if(g+=c=s[u].value,c<x&&(x=c),c>y&&(y=c),C=g*g*k,b=Math.max(y/C,C/x),b>w){g-=c;break}w=b}i.push(l={value:g,dice:m<p,children:s.slice(d,u)}),l.dice?g0(l,n,r,o,h?r+=p*g/h:a):_R(l,n,r,h?n+=m*g/h:o,a),h-=g,d=u}return i}var Wrt,Y1,Nx=dt(()=>{"use strict";Sx();AR();Wrt=(1+Math.sqrt(5))/2;Y1=(function t(e){function n(r,o,a,i,s){zrt(e,r,o,a,i,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(Wrt)});function Tx(){var t=Y1,e=!1,n=1,r=1,o=[0],a=hu,i=hu,s=hu,l=hu,c=hu;function d(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(u),o=[0],e&&f.eachBefore(h0),f}function u(f){var m=o[f.depth],p=f.x0+m,h=f.y0+m,g=f.x1-m,x=f.y1-m;g<p&&(p=g=(p+g)/2),x<h&&(h=x=(h+x)/2),f.x0=p,f.y0=h,f.x1=g,f.y1=x,f.children&&(m=o[f.depth+1]=a(f)/2,p+=c(f)-m,h+=i(f)-m,g-=s(f)-m,x-=l(f)-m,g<p&&(p=g=(p+g)/2),x<h&&(h=x=(h+x)/2),t(f,p,h,g,x))}return d.round=function(f){return arguments.length?(e=!!f,d):e},d.size=function(f){return arguments.length?(n=+f[0],r=+f[1],d):[n,r]},d.tile=function(f){return arguments.length?(t=vR(f),d):t},d.padding=function(f){return arguments.length?d.paddingInner(f).paddingOuter(f):d.paddingInner()},d.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:gu(+f),d):a},d.paddingOuter=function(f){return arguments.length?d.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):d.paddingTop()},d.paddingTop=function(f){return arguments.length?(i=typeof f=="function"?f:gu(+f),d):i},d.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:gu(+f),d):s},d.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:gu(+f),d):l},d.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:gu(+f),d):c},d}var RR=dt(()=>{"use strict";kx();Nx();LR();CR()});var b0=dt(()=>{"use strict";Ex();NR();TR();RR();Nx()});var BR={};ue(BR,{layoutOrg:()=>Ax});function k0(t,e){let n=0;for(let r of t.children){n+=(r.isContainer?0:1)+k0(r,e);let o=e?.get(r.id);o&&(n+=o)}return n}function V1(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Jrt(t,e){let n=Tt(t,Yrt,{bold:!0});for(let[r,o]of Object.entries(e)){let a=Tt(`${r}: ${o}`,Vrt);a>n&&(n=a)}return Math.max(Krt,Math.ceil(n)+jrt*2)}function tot(t){let e=Object.keys(t).length;return e===0?IR+PR:IR+Xrt+e*Urt+PR}function E0(t,e,n){return t.color?t.color:Dn(t.metadata,[...e],n,t.isContainer)}function $R(t,e,n,r,o){return t.map(a=>{let i=V1(a.metadata,n),s=e?.get(a.id);if(!a.isContainer&&o&&!(s!=null&&s>0)){let l=k0(a,e);l>0&&(i[r??"Sub-node Count"]=String(l))}return{orgNode:a,children:$R(a.children,e,n,r,o),width:Jrt(a.label,i),height:tot(i)}})}function GR(t){let e=0;for(let n of t.children)e+=1+GR(n);return e}function qR(t){for(let i of t.children)qR(i);if(t.children.length<=2)return;let e=t.children.map(i=>({child:i,weight:GR(i)})).sort((i,s)=>s.weight-i.weight),n=new Array(e.length),r=Math.floor((e.length-1)/2),o=r,a=r;for(let i=0;i<e.length;i++){let s=e[i];i===0?n[r]=s.child:i%2===1?(a++,n[a]=s.child):(o--,n[o]=s.child)}t.children=n}function OR(t,e,n){let r=[];for(let o of t){if(o.entries.length===0)continue;let a=n?.get(Bt(o.name)),i=a?o.entries.filter(f=>a.has(f.value.toLowerCase())):o.entries;if(i.length===0)continue;let s=We(o.name,Er)+xo,l=s,c=0;for(let f of i)c+=Tr*2+Ir+We(f.value,Qn)+Qr;let d=e?_o+Ha:0,u=qn*2+s+4+d+c;r.push({name:o.name,...o.alias!==void 0&&{alias:o.alias},entries:i.map(f=>({value:f.value,color:f.color})),x:0,y:0,width:u,height:Se,minifiedWidth:l,minifiedHeight:Se})}return r}function eot(t,e){let n=[],r=o=>{n.push(o);for(let a of o.children)r(a)};for(let o of t)r(o);ma(n,e,o=>o.isContainer)}function Ax(t,e,n,r,o){if(t.roots.length===0){let tt=r!==void 0,it=OR(or(t.options)?[]:t.tagGroups,tt);if(it.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let st=Ci,ct=0;for(let pt of it)pt.x=Ci,pt.y=st,st+=Se+Mn,pt.width>ct&&(ct=pt.width);return{nodes:[],edges:[],containers:[],legend:it,width:ct+Ci*2,height:st-Mn+Ci}}let a=t.direction==="LR",i=tt=>a?tt.width:tt.height,s=tt=>a?tt.height:tt.width,l=(tt,it)=>a?{x:it,y:tt}:{x:tt,y:it},c=(tt,it,st,ct)=>a?{left:it,top:tt-ct/2}:{left:tt-st/2,top:it};eot(t.roots,t.tagGroups);let d=t.options["sub-node-label"]??void 0,u=["yes","on"].includes(t.options["show-sub-node-count"]?.toLowerCase()??""),f=$R(t.roots,e,r,d,u),m;f.length===1?m=f[0]:m={orgNode:{id:"__virtual_root__",label:"",metadata:{},children:t.roots,parentId:null,isContainer:!1,lineNumber:0},children:f,width:0,height:0};let p=0,h=0,g=[],x=tt=>{tt.orgNode.id!=="__virtual_root__"&&(g.push(tt),tt.width>p&&(p=tt.width),tt.height>h&&(h=tt.height));for(let it of tt.children)x(it)};x(m);for(let tt of g)tt.width=p;let y=a?p:h,b=a?h:p,w=Qrt,k=Zrt,C=new Map,v=tt=>{for(let it of tt.children)v(it);if(tt.orgNode.isContainer&&tt.children.length>0&&tt.children.every(it=>it.children.length===0)){let it=`__stack_${tt.orgNode.id}`;C.set(tt.orgNode.id,{children:[...tt.children],placeholderId:it});let st=Math.max(...tt.children.map(mt=>mt.width));for(let mt of tt.children)mt.width=st;let ct=tt.children.reduce((mt,bt)=>mt+i(bt),0)+(tt.children.length-1)*DR,pt=Math.max(...tt.children.map(mt=>s(mt)));tt.children=[{orgNode:{id:it,label:"",metadata:{},children:[],parentId:tt.orgNode.id,isContainer:!1,lineNumber:0},children:[],width:a?ct:pt,height:a?pt:ct}]}};v(m),qR(m);let _=ts(m,tt=>tt.children);Cx().nodeSize([b+k,y+w])(_);{let tt=_.descendants().filter(mt=>mt.data.orgNode.id!=="__virtual_root__"),it=new Map;for(let mt of tt){if(mt.data.orgNode.id.startsWith("__stack_"))continue;let bt=it.get(mt.depth)??0,gt=i(mt.data);gt>bt&&it.set(mt.depth,gt)}let st=Math.max(...it.keys(),0),ct=new Map,pt=f.length===1?0:1;ct.set(pt,0);for(let mt=pt+1;mt<=st;mt++){let bt=it.get(mt-1)??y,gt=ct.get(mt-1)??0;ct.set(mt,gt+bt+w)}for(let mt of _.descendants())mt.data.orgNode.id!=="__virtual_root__"&&(mt.y=ct.get(mt.depth)??mt.y)}for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||!tt.data.orgNode.isContainer||!tt.children||tt.children.length===0)continue;let st=tt.children[0].y-tt.y,ct=Object.keys(tt.data.orgNode.metadata).length,pt=x0+ct*w0,mt=a?Oc:pt+15,bt=st-mt;if(bt<=0)continue;let gt=Et=>{if(Et.children)for(let ft of Et.children)ft.y-=bt,gt(ft)};gt(tt)}for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||tt.data.orgNode.isContainer||!tt.children||tt.children.length===0||!tt.children.every(gt=>gt.data.orgNode.isContainer))continue;let it=tt.y+i(tt.data),ct=Math.min(...tt.children.map(gt=>gt.y))-it,pt=w*.6,mt=ct-pt;if(mt<=0)continue;let bt=gt=>{if(gt.y-=mt,gt.children)for(let Et of gt.children)bt(Et)};for(let gt of tt.children)bt(gt)}{let tt=ct=>{let pt=ct.x-s(ct.data)/2,mt=ct.x+s(ct.data)/2;if(ct.children)for(let bt of ct.children){let gt=tt(bt);gt.minX<pt&&(pt=gt.minX),gt.maxX>mt&&(mt=gt.maxX)}if(ct.data.orgNode.isContainer&&(pt-=Oc,mt+=Oc,a)){let bt=Object.keys(ct.data.orgNode.metadata).length;pt-=x0+bt*w0}return{minX:pt,maxX:mt}},it=(ct,pt)=>{ct.x+=pt,ct.children&&ct.children.forEach(mt=>it(mt,pt))},st=_.descendants().filter(ct=>ct.children&&ct.children.length>=2).sort((ct,pt)=>pt.depth-ct.depth);for(let ct of st){let pt=ct.children,mt=pt.map(kt=>{let _t=tt(kt);return{relLeft:_t.minX-kt.x,relRight:_t.maxX-kt.x}}),bt=(pt[0].x+pt[pt.length-1].x)/2,gt=[0];for(let kt=1;kt<pt.length;kt++){let _t=gt[kt-1]+mt[kt-1].relRight;gt[kt]=_t+k-mt[kt].relLeft}let Et=(gt[0]+gt[gt.length-1])/2,ft=bt-Et;for(let kt=0;kt<pt.length;kt++){let yt=gt[kt]+ft-pt[kt].x;Math.abs(yt)>.001&&it(pt[kt],yt)}}}{let tt=_.descendants().filter(it=>it.children&&it.children.length>=1&&it.data.orgNode.id!=="__virtual_root__").sort((it,st)=>st.depth-it.depth);for(let it of tt){let st=it.children.map(pt=>pt.x),ct=(Math.min(...st)+Math.max(...st))/2;it.x=ct}}let L=[],E=[],M=1/0,S=-1/0,T=1/0,N=-1/0,I=[];for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||!tt.data.orgNode.id.startsWith("__stack_"))continue;let it=tt.data.orgNode.id.replace("__stack_",""),st=C.get(it);if(!st)continue;let ct=tt.y;for(let pt of st.children)I.push({orgNode:pt.orgNode,width:pt.width,height:pt.height,cx:tt.x,cy:ct}),ct+=i(pt)+DR}let G=(tt,it,st,ct)=>{let{left:pt,top:mt}=c(tt,it,st,ct);return{left:pt,top:mt,right:pt+st,bottom:mt+ct}},$=tt=>{tt.left<M&&(M=tt.left),tt.right>S&&(S=tt.right),tt.top<T&&(T=tt.top),tt.bottom>N&&(N=tt.bottom)};for(let tt of _.descendants())tt.data.orgNode.id!=="__virtual_root__"&&(tt.data.orgNode.id.startsWith("__stack_")||$(G(tt.x,tt.y,tt.data.width,tt.data.height)));for(let tt of I)$(G(tt.cx,tt.cy,tt.width,tt.height));let A=-M+Ci,D=-T+Ci,O=(tt,it,st,ct)=>{let pt=G(tt,it,st,ct);return{x:pt.left+A+st/2,y:pt.top+D}},P=d??"Sub-node Count";for(let tt of I){let it=e?.get(tt.orgNode.id),st=V1(tt.orgNode.metadata,r);if(!tt.orgNode.isContainer&&u&&!(it!=null&&it>0)){let mt=k0(tt.orgNode,e);mt>0&&(st[P]=String(mt))}let ct=E0(tt.orgNode,t.tagGroups,n??null),pt=tt.orgNode.children.length>0||it!=null&&it>0||void 0;L.push({id:tt.orgNode.id,label:tt.orgNode.label,metadata:st,tagMetadata:{...tt.orgNode.metadata},isContainer:tt.orgNode.isContainer,lineNumber:tt.orgNode.lineNumber,...ct!==void 0&&{color:ct},...O(tt.cx,tt.cy,tt.width,tt.height),width:tt.width,height:tt.height,...it!==void 0&&{hiddenCount:it},...pt!==void 0&&{hasChildren:pt}})}let H=(tt,it)=>{let st=l(tt,it);return{x:st.x+A,y:st.y+D}},W=new Map;for(let tt of _.descendants()){if(tt.data.orgNode.id==="__virtual_root__"||tt.data.orgNode.id.startsWith("__stack_"))continue;let it=tt.data.orgNode,st=tt.data.width,ct=tt.data.height,{x:pt,y:mt}=O(tt.x,tt.y,st,ct),bt=e?.get(it.id),gt=V1(it.metadata,r);if(!it.isContainer&&u&&!(bt!=null&&bt>0)){let _t=k0(it,e);_t>0&&(gt[P]=String(_t))}let Et=E0(it,t.tagGroups,n??null),ft=tt.children!=null&&tt.children.length>0||bt!=null&&bt>0||void 0;L.push({id:it.id,label:it.label,metadata:gt,tagMetadata:{...it.metadata},isContainer:it.isContainer,lineNumber:it.lineNumber,...Et!==void 0&&{color:Et},x:pt,y:mt,width:st,height:ct,...bt!==void 0&&{hiddenCount:bt},...ft!==void 0&&{hasChildren:ft}});let kt=tt.parent?.data.orgNode.isContainer&&tt.parent.children&&tt.parent.children.length>0;if(tt.parent&&tt.parent.data.orgNode.id!=="__virtual_root__"&&!kt){let _t=tt.parent.data.orgNode.id;W.has(_t)||W.set(_t,{parentX:tt.parent.x,parentBottomY:tt.parent.y+i(tt.parent.data),children:[]}),W.get(_t).children.push({id:it.id,x:tt.x,topY:tt.y})}}for(let[tt,it]of W){let{parentX:st,parentBottomY:ct,children:pt}=it;if(pt.length===1){let mt=pt[0],bt=(ct+mt.topY)/2;E.push({sourceId:tt,targetId:mt.id,points:[H(st,ct),H(st,bt),H(mt.x,bt),H(mt.x,mt.topY)]})}else{let mt=(ct+pt[0].topY)/2,bt=pt.map(ft=>ft.x),gt=Math.min(...bt),Et=Math.max(...bt);E.push({sourceId:tt,targetId:tt,points:[H(st,ct),H(st,mt)]}),E.push({sourceId:tt,targetId:tt,points:[H(gt,mt),H(Et,mt)]});for(let ft of pt)E.push({sourceId:tt,targetId:ft.id,points:[H(ft.x,mt),H(ft.x,ft.topY)]})}}let B=_.descendants().filter(tt=>tt.data.orgNode.id!=="__virtual_root__"&&tt.data.orgNode.isContainer),q=new Map,V=[],X=60;for(let tt of B){if(tt.children&&tt.children.length>0)continue;let it=Object.keys(tt.data.orgNode.metadata).length,st=x0+it*w0,ct=tt.data.width,pt=Math.max(st+_x,X),mt=c(tt.x,tt.y,ct,pt),bt=mt.left+A,gt=mt.top+D;q.set(tt.data.orgNode.id,{minX:bt,maxX:bt+ct,minY:gt,maxY:gt+pt});let Et=e?.get(tt.data.orgNode.id),ft=V1(tt.data.orgNode.metadata,r),kt=E0(tt.data.orgNode,t.tagGroups,n??null),_t=Et!=null&&Et>0||void 0;V.push({nodeId:tt.data.orgNode.id,label:tt.data.orgNode.label,lineNumber:tt.data.orgNode.lineNumber,...kt!==void 0&&{color:kt},metadata:ft,tagMetadata:{...tt.data.orgNode.metadata},x:bt,y:gt,width:ct,height:pt,labelHeight:st,...Et!==void 0&&{hiddenCount:Et},..._t!==void 0&&{hasChildren:_t}})}let z=B.filter(tt=>tt.children&&tt.children.length>0);z.sort((tt,it)=>it.depth-tt.depth);for(let tt of z){let it=[],st=Xt=>{if(Xt.children)for(let zt of Xt.children)it.push(zt),st(zt)};if(st(tt),it.length===0)continue;let ct=1/0,pt=-1/0,mt=1/0,bt=-1/0,gt=(Xt,zt,xt,$t)=>{Xt<ct&&(ct=Xt),xt>pt&&(pt=xt),zt<mt&&(mt=zt),$t>bt&&(bt=$t)};for(let Xt of it){let zt=q.get(Xt.data.orgNode.id);if(zt)gt(zt.minX,zt.minY,zt.maxX,zt.maxY);else if(Xt.data.orgNode.id.startsWith("__stack_")){let xt=Xt.data.orgNode.id.replace("__stack_","");if(C.get(xt))for(let Zt of I){if(Zt.orgNode.parentId!==xt)continue;let re=G(Zt.cx,Zt.cy,Zt.width,Zt.height);gt(re.left+A,re.top+D,re.right+A,re.bottom+D)}}else{let xt=G(Xt.x,Xt.y,Xt.data.width,Xt.data.height);gt(xt.left+A,xt.top+D,xt.right+A,xt.bottom+D)}}let Et=c(tt.x,tt.y,tt.data.width,tt.data.height),ft=Et.left+tt.data.width/2+A,kt=Et.left+A,_t=Et.top+D,yt=Object.keys(tt.data.orgNode.metadata).length,St=x0+yt*w0,Ct,ht,Pt,Dt;if(a)Pt=kt,Dt=Math.max(pt-kt+Oc,tt.data.width),Ct=mt-St-Oc,ht=bt-Ct+_x;else{Ct=_t,ht=bt-_t+_x;let Xt=ct-Oc,zt=pt-ct+Oc*2;Dt=Math.max(zt,tt.data.width),Pt=Dt>zt?ft-Dt/2:Xt}q.set(tt.data.orgNode.id,{minX:Pt,maxX:Pt+Dt,minY:Ct,maxY:Ct+ht});let qt=e?.get(tt.data.orgNode.id),Wt=V1(tt.data.orgNode.metadata,r),Ft=E0(tt.data.orgNode,t.tagGroups,n??null);V.push({nodeId:tt.data.orgNode.id,label:tt.data.orgNode.label,lineNumber:tt.data.orgNode.lineNumber,...Ft!==void 0&&{color:Ft},metadata:Wt,tagMetadata:{...tt.data.orgNode.metadata},x:Pt,y:Ct,width:Dt,height:ht,labelHeight:St,...qt!==void 0&&{hiddenCount:qt},hasChildren:!0})}V.reverse();let U=M,Y=S,K=T,et=N;for(let tt of V){let it=tt.x-A,st=it+tt.width,ct=tt.y-D,pt=ct+tt.height;it<U&&(U=it),st>Y&&(Y=st),ct<K&&(K=ct),pt>et&&(et=pt)}let nt=T-K;if(nt>0){for(let tt of L)tt.y+=nt;for(let tt of V)tt.y+=nt;for(let tt of E)for(let it of tt.points)it.y+=nt}let J=Y-U+Ci*2,F=et-K+Ci*2,j=new Map;for(let tt of t.tagGroups){let it=Bt(tt.name),st=new Set,ct=pt=>{!pt.isContainer&&pt.metadata[it]&&st.add(pt.metadata[it].toLowerCase());for(let mt of pt.children)ct(mt)};for(let pt of t.roots)ct(pt);j.set(it,st)}let Q=r!==void 0,Z=OR(or(t.options)?[]:t.tagGroups,Q,j),ot=J,at=F,lt=n!=null?Z.filter(tt=>tt.name.toLowerCase()===n.toLowerCase()):Z,rt=o&&n==null,ut=tt=>n!=null||rt?tt.width:tt.minifiedWidth;if(lt.length>0){let tt=Se+Mn;for(let pt of L)pt.y+=tt;for(let pt of V)pt.y+=tt;for(let pt of E)for(let mt of pt.points)mt.y+=tt;let it=lt.reduce((pt,mt)=>pt+ut(mt),0)+(lt.length-1)*Mn,st=Ci;for(let pt of lt)pt.x=st,pt.y=Ci,st+=ut(pt)+Mn;at+=tt;let ct=it+Ci*2;ct>ot&&(ot=ct)}return{nodes:L,edges:E,containers:V,legend:Z,width:ot,height:at}}var Yrt,Vrt,Urt,IR,Xrt,jrt,PR,Krt,Zrt,Qrt,Ci,Oc,_x,x0,w0,DR,Rx=dt(()=>{"use strict";Oe();b0();Oe();Ae();pr();Ve();Yrt=13,Vrt=11,Urt=16,IR=28,Xrt=6,jrt=20,PR=10,Krt=140,Zrt=30,Qrt=50,Ci=40,Oc=24,_x=24,x0=28,w0=16,DR=20});function HR(t,e){let n=0;for(let r of e.getChildren(t))n+=(e.countsAsHidden(r)?1:0)+HR(r,e);return n}function FR(t,e,n,r){for(let o of t){let a=r.getChildren(o);e.has(r.getId(o))&&a.length>0&&n.set(r.getId(o),HR(o,r)),FR(a,e,n,r)}}function WR(t,e,n){for(let r of n.getChildren(t))WR(r,e,n);e.has(n.getId(t))&&n.getChildren(t).length>0&&n.setChildren(t,[])}function yu(t,e,n){let r=new Map;FR(t,e,r,n);let o=t.map(a=>n.clone(a));for(let a of o)WR(a,e,n);return{roots:o,hiddenCounts:r}}function zR(t,e){let n=new Set,r=o=>{for(let a of o)n.add(e.getId(a)),r(e.getChildren(a))};return r(t),n}var U1=dt(()=>{"use strict"});var VR={};ue(VR,{collapseOrgTree:()=>rot,focusOrgTree:()=>oot});function S0(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(S0),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function rot(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=yu(t.roots,e,not);return{parsed:{...t,roots:n},hiddenCounts:r}}function YR(t,e,n){for(let r of t){if(r.id===e)return{node:r,path:n};let o=YR(r.children,e,[...n,{id:r.id,label:r.label,lineNumber:r.lineNumber,...r.color!==void 0&&{color:r.color},metadata:{...r.metadata},isContainer:r.isContainer}]);if(o)return o}return null}function oot(t,e){let n=YR(t.roots,e,[]);if(!n)return null;if(t.roots.some(a=>a.id===e))return{parsed:{...t,roots:[S0(n.node)]},ancestorPath:[]};let o=S0(n.node);return o.parentId=null,{parsed:{...t,roots:[o]},ancestorPath:n.path}}var not,UR=dt(()=>{"use strict";U1();not={getId:t=>t.id,getChildren:t=>t.children,clone:S0,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer}});function bu(t,e,n){let r=document.createElement("div");r.style.width=`${t}px`,r.style.height=`${e}px`,r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);try{return n(r)}finally{document.body.removeChild(r)}}function xu(t,e,n){let r=t.querySelector("svg");return r?(e==="transparent"?r.style.background="none":n&&!r.style.background&&(r.style.background=n.bg),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.style.fontFamily=Mt,r.querySelectorAll("[data-export-ignore]").forEach(o=>o.remove()),Fr(r)):""}var M0=dt(()=>{"use strict";fi();Ke()});var tI={};ue(tI,{ancestorTrailReserve:()=>uot,renderOrg:()=>JR,renderOrgForExport:()=>hot});function uot(t){return t>0?t*ZR+QR:0}function mot(t,e,n,r){let o=n??t.primary;return ee(t,o,e,{mode:r})}function XR(t,e){return e??t.primary}function pot(t,e,n){return n?vt(n,Ie(t,e),10):vt(t.surface,t.bg,40)}function jR(t,e){return e??t.textMuted}function JR(t,e,n,r,o,a,i,s,l,c,d){It(t).selectAll(":not([data-d3-tooltip])").remove();let u=i?.width??t.clientWidth,f=i?.height??t.clientHeight;if(u<=0||f<=0)return;let m=Le.identity(),p=m.aesthetic(Ix),h=m.structural(KR),g=m.text(13),x=m.text(11),y=m.structural(16),b=m.structural(28),w=m.structural(6),k=m.structural(1.5),C=m.structural(1.5),v=m.structural(6),_=m.structural(8),R=m.text(13),L=m.text(11),E=m.structural(16),M=m.structural(28),S=m.structural(6),T=m.structural(0),N=m.structural(cot),I=m.text(dot),G=m.structural(ZR),$=m.structural(QR),A=m.aesthetic(fot),D=!!e.title&&e.options["no-title"]!=="on",O=D?h:0,P=n.nodes.length===0,H=n.legend.length>0,W=Se+Mn,B=!i&&H&&!P,q=B?ir({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:_o+Ha},u)+A:0,V=!i&&D,X=V?h:0,z=c&&c.length>0,U=z?c.length*G+$:0,Y=n.width,K=n.height+(V?0:O)+U;B&&(K-=W);let et=f-p*2-q-X,nt=(u-p*2)/Y,J=et/K,F=Math.min(lot,nt,J),j=Y*F,Q=(u-j)/2,Z=B?p+q+X:p+X,ot=It(t).append("svg").attr("width",u).attr("height",f).attr("viewBox",`0 0 ${u} ${f}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);m.isBelowFloor&&ot.attr("width","100%");let at=ot.append("g").attr("transform",`translate(${Q}, ${Z}) scale(${F})`);if(D){let ct=V?ot:at,pt=V?u/2:Y/2,mt=V?p+20:20,bt=ct.append("text").attr("x",pt).attr("y",mt).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",20).attr("font-weight","700").attr("class","org-title chart-title").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(bt.attr("data-line-number",e.titleLineNumber),a&&bt.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}let lt=(V?0:O)+U,rt=at.append("g").attr("transform",`translate(0, ${lt})`),ut=new Map;for(let ct of e.tagGroups)ut.set(Bt(ct.name),ct.name);let tt=new Set(e.roots.map(ct=>ct.id)),it=e.options?.color==="off";for(let ct of n.containers){let pt=rt.append("g").attr("transform",`translate(${ct.x}, ${ct.y})`).attr("class","org-container").attr("data-line-number",String(ct.lineNumber));if(s){let Et=Bt(s),ft=ct.tagMetadata[Et];ft&&pt.attr(`data-tag-${Et}`,ft.toLowerCase())}ct.hasChildren&&pt.attr("data-node-toggle",ct.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!ct.hiddenCount)).attr("aria-label",ct.label),a&&pt.style("cursor","pointer").on("click",()=>{a(ct.lineNumber)});let mt=pot(r,o,it?void 0:ct.color),bt=jR(r,it?void 0:ct.color);pt.append("rect").attr("x",0).attr("y",0).attr("width",ct.width).attr("height",ct.height).attr("rx",_).attr("fill",mt).attr("stroke",bt).attr("stroke-opacity",.35).attr("stroke-width",C),pt.append("text").attr("x",ct.width/2).attr("y",M/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",r.text).attr("font-size",R).attr("font-weight","bold").text(ct.label);let gt=Object.entries(ct.metadata);if(gt.length>0){let Et=gt.map(([yt])=>ut.get(yt)??yt),kt=10+Math.max(...Et.map(yt=>Tt(`${yt}: `,L))),_t=M+L-2;for(let yt=0;yt<gt.length;yt++){let[,St]=gt[yt],Ct=Et[yt],ht=_t+yt*E;pt.append("text").attr("x",10).attr("y",ht).attr("fill",r.textMuted).attr("font-size",L).text(`${Ct}: `),pt.append("text").attr("x",kt).attr("y",ht).attr("fill",r.text).attr("font-size",L).text(St)}}if(!i&&ct.hiddenCount&&ct.hiddenCount>0&&H1(pt,{width:ct.width,height:ct.height,barHeight:S,inset:T,rx:_,fill:jR(r,it?void 0:ct.color),clipId:`clip-${ct.nodeId}`,className:"org-collapse-bar"}),!i&&ct.hasChildren&&!tt.has(ct.nodeId)){let kt=ct.width-14-5,yt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",ct.nodeId).attr("data-export-ignore","true").attr("transform",`translate(${kt}, 5)`);yt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let St=pe(mt,r.textOnFillLight,r.textOnFillDark),Ct=14/2,ht=14/2;yt.append("circle").attr("cx",Ct).attr("cy",ht).attr("r",14/2-1).attr("fill","none").attr("stroke",St).attr("stroke-width",1.5),yt.append("circle").attr("cx",Ct).attr("cy",ht).attr("r",2).attr("fill",St)}}for(let ct of n.edges){if(ct.points.length<2)continue;let pt=[];pt.push(`M ${ct.points[0].x} ${ct.points[0].y}`);for(let mt=1;mt<ct.points.length;mt++)pt.push(`L ${ct.points[mt].x} ${ct.points[mt].y}`);rt.append("path").attr("d",pt.join(" ")).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",k).attr("class","org-edge").attr("data-from",ct.sourceId).attr("data-to",ct.targetId)}let st=new Set(n.containers.map(ct=>ct.nodeId));for(let ct of n.nodes){if(st.has(ct.id))continue;let pt=rt.append("g").attr("transform",`translate(${ct.x-ct.width/2}, ${ct.y})`).attr("class","org-node").attr("data-line-number",String(ct.lineNumber)).attr("data-node-id",ct.id);if(s){let kt=Bt(s),_t=ct.tagMetadata[kt];_t&&pt.attr(`data-tag-${kt}`,_t.toLowerCase())}ct.hasChildren&&pt.attr("data-node-toggle",ct.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!ct.hiddenCount)).attr("aria-label",ct.label),a&&pt.style("cursor","pointer").on("click",()=>{a(ct.lineNumber)});let mt=mn(e.options),bt=mot(r,o,it?void 0:ct.color,mt),gt=XR(r,it?void 0:ct.color),Et=pe(bt,r.textOnFillLight,r.textOnFillDark),ft=Object.entries(ct.metadata);if(Os(pt,{width:ct.width,height:ct.height,rx:v,fill:bt,stroke:gt,strokeWidth:C,...ct.isContainer&&{dashed:!0},label:ct.label,labelColor:Et,labelFontSize:g,headerHeight:b,...ft.length>0&&{meta:{rows:ft.map(([kt,_t])=>[ut.get(kt)??kt,_t]),fontSize:x,lineHeight:y,separatorGap:w,separatorColor:mt==="solid"?Et:gt,textColor:Et}}}),!i&&ct.hiddenCount&&ct.hiddenCount>0&&H1(pt,{width:ct.width,height:ct.height,barHeight:S,inset:T,rx:v,fill:mt==="solid"?Et:XR(r,it?void 0:ct.color),clipId:`clip-${ct.id}`,className:"org-collapse-bar"}),!i&&ct.hasChildren&&!tt.has(ct.id)){let yt=ct.width-14-5,Ct=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",ct.id).attr("data-export-ignore","true").attr("transform",`translate(${yt}, 5)`);Ct.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let ht=Et,Pt=14/2,Dt=14/2;Ct.append("circle").attr("cx",Pt).attr("cy",Dt).attr("r",14/2-1).attr("fill","none").attr("stroke",ht).attr("stroke-width",1.5),Ct.append("circle").attr("cx",Pt).attr("cy",Dt).attr("r",2).attr("fill",ht)}}if(z){let ct=n.nodes.find(gt=>tt.has(gt.id)),pt=ct?null:n.containers.find(gt=>tt.has(gt.nodeId)),mt=ct?ct.x:pt?pt.x+pt.width/2:null,bt=ct?ct.y:pt?pt.y:null;if(mt!==null&&bt!==null){let gt=bt-$,Et=rt.append("g").attr("class","org-ancestor-trail"),ft=c.length,kt=[];for(let yt=0;yt<ft;yt++){let St=ft-1-yt;kt.push(gt-St*G)}let _t=kt[0];Et.append("line").attr("x1",mt).attr("y1",_t).attr("x2",mt).attr("y2",bt).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.4);for(let yt=0;yt<ft;yt++){let St=c[yt],Ct=kt[yt],Pt=St.color??Dn(St.metadata,[...e.tagGroups],s??null,St.isContainer)??r.textMuted,Dt=Et.append("g").attr("class","org-ancestor-node").attr("data-focus-ancestor",St.id).style("cursor","pointer").attr("transform",`translate(${mt}, ${Ct})`);Dt.append("rect").attr("x",-N-2).attr("y",-N-2).attr("width",120).attr("height",N*2+4).attr("fill","transparent"),Dt.append("circle").attr("cx",0).attr("cy",0).attr("r",N).attr("fill",Pt),Dt.append("text").attr("x",N+6).attr("y",I*.35).attr("fill",r.textMuted).attr("font-size",I).text(St.label),Dt.on("mouseenter",function(){It(this).select("circle").attr("r",N+1),It(this).select("text").attr("fill",r.text)}).on("mouseleave",function(){It(this).select("circle").attr("r",N),It(this).select("text").attr("fill",r.textMuted)})}}}if(B||P||i&&H){let ct=n.legend.map(gt=>({name:gt.name,entries:gt.entries.map(Et=>({value:Et.value,color:Et.color}))})),pt=B?_o+Ha:0,mt=B?ot.append("g").attr("class","org-legend-fixed").attr("transform",`translate(0, ${p+X})`):rt.append("g"),bt;if(P){for(let gt of n.legend){let Et={groups:[{name:gt.name,entries:gt.entries.map(kt=>({value:kt.value,color:kt.color}))}],position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview"},ft=mt.append("g").attr("transform",`translate(${gt.x}, ${gt.y})`);tn(ft,{...Et,palette:r,isDark:o,width:gt.width,activeGroup:gt.name}),ft.selectAll("[data-legend-group]").classed("org-legend-group",!0)}bt=null}else bt=tn(mt,{...{groups:ct,position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview",capsulePillAddonWidth:pt},palette:r,isDark:o,width:B?u:n.width,activeGroup:s??null}),mt.selectAll("[data-legend-group]").classed("org-legend-group",!0);if(B&&bt){let gt=bt.getLayout();if(gt.activeCapsule?.addonX!=null){let Et=gt.activeCapsule,ft=Bt(Et.groupName),kt=l?.has(ft)??!1,_t=mt.select(`[data-legend-group="${ft}"]`);if(!_t.empty()){let yt=Et.addonX,St=(Se-_o)/2,Ct=6,ht=_t.append("g").attr("class","org-legend-eye").attr("data-legend-visibility",ft).style("cursor","pointer").attr("opacity",kt?.4:.7);ht.append("rect").attr("x",yt-Ct).attr("y",St-Ct).attr("width",_o+Ct*2).attr("height",_o+Ct*2).attr("fill","transparent").attr("pointer-events","all"),ht.append("path").attr("d",kt?r1:n1).attr("transform",`translate(${yt}, ${St})`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}}function hot(t,e,n){let r=Fd(t,n);if(r.error)return"";let o=r.options?.hide,a=o?new Set(o.split(",").map(u=>u.trim().toLowerCase())):void 0,i=Ax(r,void 0,void 0,a),s=e==="dark",l=r.title&&r.options["no-title"]!=="on"?KR:0,c=i.width+Ix*2,d=i.height+Ix*2+l;return bu(c,d,u=>(JR(u,r,i,n,s,void 0,{width:c,height:d}),xu(u,e,n)))}var Ix,lot,KR,cot,dot,ZR,QR,fot,eI=dt(()=>{"use strict";Oe();Ae();Nn();Ke();M0();wr();Fe();Oe();h1();Rx();pr();Mr();F1();Ve();qr();Ix=20,lot=3,KR=30,cot=4,dot=11,ZR=22,QR=16;fot=8});function nI(t,e){t[e]?t[e]++:t[e]=1}function rI(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function j1(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let i=o;o=a,a=i}return o+""+a+""+(r===void 0?"\0":r)}function wot(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let s=o;o=a,a=s}let i={v:o,w:a};return r&&(i.name=r),i}function Ox(t,e){return j1(t,e.v,e.w,e.name)}function kot(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Sot(t),edges:Mot(t)},n=t.graph();return n!==void 0&&(e.value=structuredClone(n)),e}function Sot(t){return t.nodes().map(e=>{let n=t.node(e),r=t.parent(e),o={v:e};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Mot(t){return t.edges().map(e=>{let n=t.edge(e),r={v:e.v,w:e.w};return e.name!==void 0&&(r.name=e.name),n!==void 0&&(r.value=n),r})}function vot(t){let e=new Ya(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(n=>{e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(n=>{e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}function xI(t,e,n,r){return Cot(t,String(e),n||Lot,r||function(o){return t.outEdges(o)})}function Cot(t,e,n,r){let o={},a,i=0,s=t.nodes(),l=function(u){let f=n(u);o[u.v].distance+f<o[u.w].distance&&(o[u.w]={distance:o[u.v].distance+f,predecessor:u.v},a=!0)},c=function(){s.forEach(function(u){r(u).forEach(function(f){let m=f.v===u?f.v:f.w,p=m===f.v?f.w:f.v;l({v:m,w:p})})})};s.forEach(function(u){let f=u===e?0:Number.POSITIVE_INFINITY;o[u]={distance:f,predecessor:""}});let d=s.length;for(let u=1;u<d&&(a=!1,i++,c(),!!a);u++);if(i===d-1&&(a=!1,c(),a))throw new Error("The graph contains a negative weight cycle");return o}function Not(t){let e={},n=[],r;function o(a){a in e||(e[a]=!0,r.push(a),t.successors(a).forEach(o),t.predecessors(a).forEach(o))}return t.nodes().forEach(function(a){r=[],o(a),r.length&&n.push(r)}),n}function L0(t,e,n,r){let o=function(a){return t.outEdges(a)};return _ot(t,String(e),n||Tot,r||o)}function _ot(t,e,n,r){let o={},a=new wI,i,s,l=function(c){let d=c.v!==i?c.v:c.w,u=o[d],f=n(c),m=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);m<u.distance&&(u.distance=m,u.predecessor=i,a.decrease(d,m))};for(t.nodes().forEach(function(c){let d=c===e?0:Number.POSITIVE_INFINITY;o[c]={distance:d,predecessor:""},a.add(c,d)});a.size()>0&&(i=a.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return o}function Aot(t,e,n){return t.nodes().reduce(function(r,o){return r[o]=L0(t,o,e,n),r},{})}function EI(t){let e=0,n=[],r={},o=[];function a(i){let s=r[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(l){l in r?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(a(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){let l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(i!==c);o.push(l)}}return t.nodes().forEach(function(i){i in r||a(i)}),o}function Rot(t){return EI(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}function Pot(t,e,n){return Dot(t,e||Iot,n||function(r){return t.outEdges(r)})}function Dot(t,e,n){let r={},o=t.nodes();return o.forEach(function(a){r[a]={},r[a][a]={distance:0,predecessor:""},o.forEach(function(i){a!==i&&(r[a][i]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(a).forEach(function(i){let s=i.v===a?i.w:i.v,l=e(i);r[a][s]={distance:l,predecessor:a}})}),o.forEach(function(a){let i=r[a];o.forEach(function(s){let l=r[s];o.forEach(function(c){let d=l[a],u=i[c],f=l[c],m=d.distance+u.distance;m<f.distance&&(f.distance=m,f.predecessor=u.predecessor)})})}),r}function kI(t){let e={},n={},r=[];function o(a){if(a in n)throw new C0;a in e||(n[a]=!0,e[a]=!0,t.predecessors(a).forEach(o),delete n[a],r.push(a))}if(t.sinks().forEach(o),Object.keys(e).length!==t.nodeCount())throw new C0;return r}function Oot(t){try{kI(t)}catch(e){if(e instanceof C0)return!1;throw e}return!0}function $ot(t,e,n,r,o){Array.isArray(e)||(e=[e]);let a=(s=>{var l;return(l=t.isDirected()?t.successors(s):t.neighbors(s))!=null?l:[]}),i={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);o=SI(t,s,n==="post",i,a,r,o)}),o}function SI(t,e,n,r,o,a,i){return e in r||(r[e]=!0,n||(i=a(i,e)),o(e).forEach(function(s){i=SI(t,s,n,r,o,a,i)}),n&&(i=a(i,e))),i}function MI(t,e,n){return $ot(t,e,n,function(r,o){return r.push(o),r},[])}function Got(t,e){return MI(t,e,"post")}function qot(t,e){return MI(t,e,"pre")}function Bot(t,e){let n=new Ya,r={},o=new wI,a;function i(l){let c=l.v===a?l.w:l.v,d=o.priority(c);if(d!==void 0){let u=e(l);u<d&&(r[c]=a,o.decrease(c,u))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(l){o.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),o.decrease(t.nodes()[0],0);let s=!1;for(;o.size()>0;){if(a=o.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(a).forEach(i)}return n}function Hot(t,e,n,r){return Fot(t,e,n,r??(o=>{let a=t.outEdges(o);return a??[]}))}function Fot(t,e,n,r){if(n===void 0)return L0(t,e,n,r);let o=!1,a=t.nodes();for(let i=0;i<a.length;i++){let s=r(a[i]);for(let l=0;l<s.length;l++){let c=s[l],d=c.v===a[i]?c.v:c.w,u=d===c.v?c.w:c.v;n({v:d,w:u})<0&&(o=!0)}if(o)return xI(t,e,n,r)}return L0(t,e,n,r)}function ku(t,e,n,r){let o=r;for(;t.hasNode(o);)o=zx(r);return n.dummy=e,t.setNode(o,n),o}function Wot(t){let e=new Ya().setGraph(t.graph());return t.nodes().forEach(n=>e.setNode(n,t.node(n))),t.edges().forEach(n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),e}function vI(t){let e=new Ya({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{t.children(n).length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdge(n,t.edge(n))}),e}function oI(t,e){let n=t.x,r=t.y,o=e.x-n,a=e.y-r,i=t.width/2,s=t.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),l=s*o/a,c=s):(o<0&&(i=-i),l=i,c=i*a/o),{x:n+l,y:r+c}}function Z1(t){let e=K1(CI(t)+1).map(()=>[]);return t.nodes().forEach(n=>{let r=t.node(n),o=r.rank;o!==void 0&&(e[o]||(e[o]=[]),e[o][r.order]=n)}),e}function zot(t){let e=t.nodes().map(r=>{let o=t.node(r).rank;return o===void 0?Number.MAX_VALUE:o}),n=es(Math.min,e);t.nodes().forEach(r=>{let o=t.node(r);Object.hasOwn(o,"rank")&&(o.rank-=n)})}function Yot(t){let e=t.nodes().map(i=>t.node(i).rank).filter(i=>i!==void 0),n=es(Math.min,e),r=[];t.nodes().forEach(i=>{let s=t.node(i).rank-n;r[s]||(r[s]=[]),r[s].push(i)});let o=0,a=t.graph().nodeRankFactor;Array.from(r).forEach((i,s)=>{i===void 0&&s%a!==0?--o:i!==void 0&&o&&i.forEach(l=>t.node(l).rank+=o)})}function aI(t,e,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),ku(t,"border",o,e)}function Vot(t,e=LI){let n=[];for(let r=0;r<t.length;r+=e){let o=t.slice(r,r+e);n.push(o)}return n}function es(t,e){if(e.length>LI){let n=Vot(e);return t(...n.map(r=>t(...r)))}else return t(...e)}function CI(t){let e=t.nodes().map(n=>{let r=t.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return es(Math.max,e)}function Uot(t,e){let n={lhs:[],rhs:[]};return t.forEach(r=>{e(r)?n.lhs.push(r):n.rhs.push(r)}),n}function NI(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}}function TI(t,e){return e()}function zx(t){let e=++Xot;return t+(""+e)}function K1(t,e,n=1){e==null&&(e=t,t=0);let r=a=>a<e;n<0&&(r=a=>e<a);let o=[];for(let a=t;r(a);a+=n)o.push(a);return o}function N0(t,e){let n={};for(let r of e)t[r]!==void 0&&(n[r]=t[r]);return n}function T0(t,e){let n;return typeof e=="string"?n=r=>r[e]:n=e,Object.entries(t).reduce((r,[o,a])=>(r[o]=n(a,o),r),{})}function jot(t,e){return t.reduce((n,r,o)=>(n[r]=e[o],n),{})}function iI(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Qot(t,e){if(t!=="_next"&&t!=="_prev")return e}function eat(t,e){if(t.nodeCount()<=1)return[];let n=rat(t,e||tat);return nat(n.graph,n.buckets,n.zeroIdx).flatMap(r=>t.outEdges(r.v,r.w)||[])}function nat(t,e,n){var r;let o=[],a=e[e.length-1],i=e[0],s;for(;t.nodeCount();){for(;s=i.dequeue();)$x(t,e,n,s);for(;s=a.dequeue();)$x(t,e,n,s);if(t.nodeCount()){for(let l=e.length-2;l>0;--l)if(s=(r=e[l])==null?void 0:r.dequeue(),s){o=o.concat($x(t,e,n,s,!0)||[]);break}}}return o}function $x(t,e,n,r,o){let a=[],i=o?a:void 0;return(t.inEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=t.node(s.v);o&&a.push({v:s.v,w:s.w}),c.out-=l,Fx(e,n,c)}),(t.outEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=s.w,d=t.node(c);d.in-=l,Fx(e,n,d)}),t.removeNode(r.v),i}function rat(t,e){let n=new Ya,r=0,o=0;t.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let l=n.edge(s.v,s.w)||0,c=e(s),d=l+c;n.setEdge(s.v,s.w,d);let u=n.node(s.v),f=n.node(s.w);o=Math.max(o,u.out+=c),r=Math.max(r,f.in+=c)});let a=oat(o+r+3).map(()=>new Jot),i=r+1;return n.nodes().forEach(s=>{Fx(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function Fx(t,e,n){var r,o,a;n.out?n.in?(a=t[n.out-n.in+e])==null||a.enqueue(n):(o=t[t.length-1])==null||o.enqueue(n):(r=t[0])==null||r.enqueue(n)}function oat(t){let e=[];for(let n=0;n<t;n++)e.push(n);return e}function aat(t){(t.graph().acyclicer==="greedy"?eat(t,e(t)):iat(t)).forEach(n=>{let r=t.edge(n);t.removeEdge(n),r.forwardName=n.name,r.reversed=!0,t.setEdge(n.w,n.v,r,zx("rev"))});function e(n){return r=>n.edge(r).weight}}function iat(t){let e=[],n={},r={};function o(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,t.outEdges(a).forEach(i=>{Object.hasOwn(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return t.nodes().forEach(o),e}function sat(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}function lat(t){t.graph().dummyChains=[],t.edges().forEach(e=>cat(t,e))}function cat(t,e){let n=e.v,r=t.node(n).rank,o=e.w,a=t.node(o).rank,i=e.name,s=t.edge(e),l=s.labelRank;if(a===r+1)return;t.removeEdge(e);let c,d,u;for(u=0,++r;r<a;++u,++r)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},c=ku(t,"edge",d,"_d"),r===l&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),t.setEdge(n,c,{weight:s.weight},i),u===0&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,o,{weight:s.weight},i)}function dat(t){t.graph().dummyChains.forEach(e=>{let n=t.node(e),r=n.edgeLabel,o;for(t.setEdge(n.edgeObj,r);n.dummy;)o=t.successors(e)[0],t.removeNode(e),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e=o,n=t.node(e)})}function Yx(t){let e={};function n(r){let o=t.node(r);if(Object.hasOwn(e,r))return o.rank;e[r]=!0;let a=t.outEdges(r),i=a?a.map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-t.edge(l).minlen):[],s=es(Math.min,i);return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}t.sources().forEach(n)}function Eu(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function uat(t){let e=new Ya({directed:!1}),n=t.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],o=t.nodeCount();e.setNode(r,{});let a,i;for(;fat(e,t)<o&&(a=mat(e,t),!!a);)i=e.hasNode(a.v)?Eu(t,a):-Eu(t,a),pat(e,t,i);return e}function fat(t,e){function n(r){let o=e.nodeEdges(r);o&&o.forEach(a=>{let i=a.v,s=r===i?a.w:i;!t.hasNode(s)&&!Eu(e,a)&&(t.setNode(s,{}),t.setEdge(r,s,{}),n(s))})}return t.nodes().forEach(n),t.nodeCount()}function mat(t,e){return e.edges().reduce((n,r)=>{let o=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(o=Eu(e,r)),o<n[0]?[o,r]:n},[Number.POSITIVE_INFINITY,null])[1]}function pat(t,e,n){t.nodes().forEach(r=>e.node(r).rank+=n)}function $c(t){t=Wot(t),Yx(t);let e=_I(t);Ux(e),Vx(e,t);let n,r;for(;n=II(e);)r=PI(e,t,n),DI(e,t,n,r)}function Vx(t,e){let n=gat(t,t.nodes());n=n.slice(0,n.length-1),n.forEach(r=>bat(t,e,r))}function bat(t,e,n){let r=t.node(n).parent,o=t.edge(n,r);o.cutvalue=AI(t,e,n)}function AI(t,e,n){let r=t.node(n).parent,o=!0,a=e.edge(n,r),i=0;a||(o=!1,a=e.edge(r,n)),i=a.weight;let s=e.nodeEdges(n);return s&&s.forEach(l=>{let c=l.v===n,d=c?l.w:l.v;if(d!==r){let u=c===o,f=e.edge(l).weight;if(i+=u?f:-f,wat(t,n,d)){let m=t.edge(n,d).cutvalue;i+=u?-m:m}}}),i}function Ux(t,e){arguments.length<2&&(e=t.nodes()[0]),RI(t,{},1,e)}function RI(t,e,n,r,o){let a=n,i=t.node(r);e[r]=!0;let s=t.neighbors(r);return s&&s.forEach(l=>{Object.hasOwn(e,l)||(n=RI(t,e,n,l,r))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function II(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function PI(t,e,n){let r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);let a=t.node(r),i=t.node(o),s=a,l=!1;return a.lim>i.lim&&(s=i,l=!0),e.edges().filter(c=>l===sI(t,t.node(c.v),s)&&l!==sI(t,t.node(c.w),s)).reduce((c,d)=>Eu(e,d)<Eu(e,c)?d:c)}function DI(t,e,n,r){let o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),Ux(t),Vx(t,e),xat(t,e)}function xat(t,e){let n=t.nodes().find(o=>!t.node(o).parent);if(!n)return;let r=hat(t,[n]);r=r.slice(1),r.forEach(o=>{let a=t.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function wat(t,e,n){return t.hasEdge(e,n)}function sI(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function kat(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":lI(t);break;case"tight-tree":Mat(t);break;case"longest-path":Sat(t);break;case"none":break;default:lI(t)}}function Mat(t){Yx(t),_I(t)}function lI(t){yat(t)}function Lat(t){let e=Nat(t);t.graph().dummyChains.forEach(n=>{let r=t.node(n),o=r.edgeObj,a=Cat(t,e,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],d=!0;for(;n!==o.w;){if(r=t.node(n),d){for(;(c=i[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(i[l+1]).minRank<=r.rank;)l++;c=i[l]}c!==void 0&&t.setParent(n,c),n=t.successors(n)[0]}})}function Cat(t,e,n,r){let o=[],a=[],i=Math.min(e[n].low,e[r].low),s=Math.max(e[n].lim,e[r].lim),l;l=n;do l=t.parent(l),o.push(l);while(l&&(e[l].low>i||s>e[l].lim));let c=l,d=r;for(;(d=t.parent(d))!==c;)a.push(d);return{path:o.concat(a.reverse()),lca:c}}function Nat(t){let e={},n=0;function r(o){let a=n;t.children(o).forEach(r),e[o]={low:a,lim:n++}}return t.children(_0).forEach(r),e}function Tat(t){let e=ku(t,"root",{},"_root"),n=_at(t),r=Object.values(n),o=es(Math.max,r)-1,a=2*o+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=a);let i=Aat(t)+1;t.children(_0).forEach(s=>OI(t,e,a,i,o,n,s)),t.graph().nodeRankFactor=a}function OI(t,e,n,r,o,a,i){var s;let l=t.children(i);if(!l.length){i!==e&&t.setEdge(e,i,{weight:0,minlen:n});return}let c=aI(t,"_bt"),d=aI(t,"_bb"),u=t.node(i);t.setParent(c,i),u.borderTop=c,t.setParent(d,i),u.borderBottom=d,l.forEach(f=>{var m;OI(t,e,n,r,o,a,f);let p=t.node(f),h=p.borderTop?p.borderTop:f,g=p.borderBottom?p.borderBottom:f,x=p.borderTop?r:2*r,y=h!==g?1:o-((m=a[i])!=null?m:0)+1;t.setEdge(c,h,{weight:x,minlen:y,nestingEdge:!0}),t.setEdge(g,d,{weight:x,minlen:y,nestingEdge:!0})}),t.parent(i)||t.setEdge(e,c,{weight:0,minlen:o+((s=a[i])!=null?s:0)})}function _at(t){let e={};function n(r,o){let a=t.children(r);a&&a.length&&a.forEach(i=>n(i,o+1)),e[r]=o}return t.children(_0).forEach(r=>n(r,1)),e}function Aat(t){return t.edges().reduce((e,n)=>e+t.edge(n).weight,0)}function Rat(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdge(n)})}function Pat(t){function e(n){let r=t.children(n),o=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let a=o.minRank,i=o.maxRank+1;a<i;++a)cI(t,"borderLeft","_bl",n,o,a),cI(t,"borderRight","_br",n,o,a)}}t.children(_0).forEach(e)}function cI(t,e,n,r,o,a){let i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],l=ku(t,"border",i,n);o[e][a]=l,t.setParent(l,r),s&&t.setEdge(s,l,{weight:1})}function Dat(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&$I(t)}function Oat(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&$at(t),(n==="lr"||n==="rl")&&(Gat(t),$I(t))}function $I(t){t.nodes().forEach(e=>dI(t.node(e))),t.edges().forEach(e=>dI(t.edge(e)))}function dI(t){let e=t.width;t.width=t.height,t.height=e}function $at(t){t.nodes().forEach(e=>Gx(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(Gx),Object.hasOwn(r,"y")&&Gx(r)})}function Gx(t){t.y=-t.y}function Gat(t){t.nodes().forEach(e=>qx(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(qx),Object.hasOwn(r,"x")&&qx(r)})}function qx(t){let e=t.x;t.x=t.y,t.y=e}function qat(t){let e={},n=t.nodes().filter(s=>!t.children(s).length),r=n.map(s=>t.node(s).rank),o=es(Math.max,r),a=K1(o+1).map(()=>[]);function i(s){if(e[s])return;e[s]=!0;let l=t.node(s);a[l.rank].push(s);let c=t.successors(s);c&&c.forEach(i)}return n.sort((s,l)=>t.node(s).rank-t.node(l).rank).forEach(i),a}function Bat(t,e){let n=0;for(let r=1;r<e.length;++r)n+=Hat(t,e[r-1],e[r]);return n}function Hat(t,e,n){let r=jot(n,n.map((c,d)=>d)),o=e.flatMap(c=>{let d=t.outEdges(c);return d?d.map(u=>({pos:r[u.w],weight:t.edge(u).weight})).sort((u,f)=>u.pos-f.pos):[]}),a=1;for(;a<n.length;)a<<=1;let i=2*a-1;a-=1;let s=new Array(i).fill(0),l=0;return o.forEach(c=>{let d=c.pos+a;s[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=s[d+1]),d=d-1>>1,s[d]+=c.weight;l+=c.weight*u}),l}function Fat(t,e=[]){return e.map(n=>{let r=t.inEdges(n);if(!r||!r.length)return{v:n};{let o=r.reduce((a,i)=>{let s=t.edge(i),l=t.node(i.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function Wat(t,e){let n={};t.forEach((o,a)=>{let i={indegree:0,in:[],out:[],vs:[o.v],i:a};o.barycenter!==void 0&&(i.barycenter=o.barycenter,i.weight=o.weight),n[o.v]=i}),e.edges().forEach(o=>{let a=n[o.v],i=n[o.w];a!==void 0&&i!==void 0&&(i.indegree++,a.out.push(i))});let r=Object.values(n).filter(o=>!o.indegree);return zat(r)}function zat(t){let e=[];function n(o){return a=>{a.merged||(a.barycenter===void 0||o.barycenter===void 0||a.barycenter>=o.barycenter)&&Yat(o,a)}}function r(o){return a=>{a.in.push(o),--a.indegree===0&&t.push(a)}}for(;t.length;){let o=t.pop();e.push(o),o.in.reverse().forEach(n(o)),o.out.forEach(r(o))}return e.filter(o=>!o.merged).map(o=>N0(o,["vs","i","barycenter","weight"]))}function Yat(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function Vat(t,e){let n=Uot(t,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,o=n.rhs.sort((d,u)=>u.i-d.i),a=[],i=0,s=0,l=0;r.sort(Uat(!!e)),l=uI(a,o,l),r.forEach(d=>{l+=d.vs.length,a.push(d.vs),i+=d.barycenter*d.weight,s+=d.weight,l=uI(a,o,l)});let c={vs:a.flat(1)};return s&&(c.barycenter=i/s,c.weight=s),c}function uI(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}function Uat(t){return(e,n)=>e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}function GI(t,e,n,r){let o=t.children(e),a=t.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};i&&(o=o.filter(f=>f!==i&&f!==s));let c=Fat(t,o);c.forEach(f=>{if(t.children(f.v).length){let m=GI(t,f.v,n,r);l[f.v]=m,Object.hasOwn(m,"barycenter")&&jat(f,m)}});let d=Wat(c,n);Xat(d,l);let u=Vat(d,r);if(i&&s){u.vs=[i,u.vs,s].flat(1);let f=t.predecessors(i);if(f&&f.length){let m=t.node(f[0]),p=t.predecessors(s),h=t.node(p[0]);Object.hasOwn(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+m.order+h.order)/(u.weight+2),u.weight+=2}}return u}function Xat(t,e){t.forEach(n=>{n.vs=n.vs.flatMap(r=>e[r]?e[r].vs:r)})}function jat(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function Kat(t,e,n,r){r||(r=t.nodes());let o=Zat(t),a=new Ya({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return r.forEach(i=>{let s=t.node(i),l=t.parent(i);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){a.setNode(i),a.setParent(i,l||o);let c=t[n](i);c&&c.forEach(d=>{let u=d.v===i?d.w:d.v,f=a.edge(u,i),m=f!==void 0?f.weight:0;a.setEdge(u,i,{weight:t.edge(d).weight+m})}),Object.hasOwn(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),a}function Zat(t){let e;for(;t.hasNode(e=zx("_root")););return e}function Qat(t,e,n){let r={},o;n.forEach(a=>{let i=t.parent(a),s,l;for(;i;){if(s=t.parent(i),s?(l=r[s],r[s]=i):(l=o,o=i),l&&l!==i){e.setEdge(l,i);return}i=s}})}function qI(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,qI);return}let n=CI(t),r=fI(t,K1(1,n+1),"inEdges"),o=fI(t,K1(n-1,-1,-1),"outEdges"),a=qat(t);if(mI(t,a),e.disableOptimalOrderHeuristic)return;let i=Number.POSITIVE_INFINITY,s,l=e.constraints||[];for(let c=0,d=0;d<4;++c,++d){Jat(c%2?r:o,c%4>=2,l),a=Z1(t);let u=Bat(t,a);u<i?(d=0,s=Object.assign({},a),i=u):u===i&&(s=structuredClone(a))}mI(t,s)}function fI(t,e,n){let r=new Map,o=(a,i)=>{r.has(a)||r.set(a,[]),r.get(a).push(i)};for(let a of t.nodes()){let i=t.node(a);if(typeof i.rank=="number"&&o(i.rank,a),typeof i.minRank=="number"&&typeof i.maxRank=="number")for(let s=i.minRank;s<=i.maxRank;s++)s!==i.rank&&o(s,a)}return e.map(function(a){return Kat(t,a,n,r.get(a)||[])})}function Jat(t,e,n){let r=new Ya;t.forEach(function(o){n.forEach(s=>r.setEdge(s.left,s.right));let a=o.graph().root,i=GI(o,a,r,e);i.vs.forEach((s,l)=>o.node(s).order=l),Qat(o,r,i.vs)})}function mI(t,e){Object.values(e).forEach(n=>n.forEach((r,o)=>t.node(r).order=o))}function tit(t,e){let n={};function r(o,a){let i=0,s=0,l=o.length,c=a[a.length-1];return a.forEach((d,u)=>{let f=nit(t,d),m=f?t.node(f).order:l;(f||d===c)&&(a.slice(s,u+1).forEach(p=>{let h=t.predecessors(p);h&&h.forEach(g=>{let x=t.node(g),y=x.order;(y<i||m<y)&&!(x.dummy&&t.node(p).dummy)&&BI(n,g,p)})}),s=u+1,i=m)}),a}return e.length&&e.reduce(r),n}function eit(t,e){let n={};function r(a,i,s,l,c){K1(i,s).forEach(d=>{let u=a[d];if(u!==void 0&&t.node(u).dummy){let f=t.predecessors(u);f&&f.forEach(m=>{if(m===void 0)return;let p=t.node(m);p.dummy&&(p.order<l||p.order>c)&&BI(n,m,u)})}})}function o(a,i){let s=-1,l=-1,c=0;return i.forEach((d,u)=>{if(t.node(d).dummy==="border"){let f=t.predecessors(d);if(f&&f.length){let m=f[0];if(m===void 0)return;l=t.node(m).order,r(i,c,u,s,l),c=u,s=l}}r(i,c,i.length,l,a.length)}),i}return e.length&&e.reduce(o),n}function nit(t,e){if(t.node(e).dummy){let n=t.predecessors(e);if(n)return n.find(r=>t.node(r).dummy)}}function BI(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];r||(t[e]=r={}),r[n]=!0}function rit(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];return r!==void 0&&Object.hasOwn(r,n)}function oit(t,e,n,r){let o={},a={},i={};return e.forEach(s=>{s.forEach((l,c)=>{o[l]=l,a[l]=l,i[l]=c})}),e.forEach(s=>{let l=-1;s.forEach(c=>{let d=r(c);if(d&&d.length){let u=d.sort((m,p)=>{let h=i[m],g=i[p];return(h!==void 0?h:0)-(g!==void 0?g:0)}),f=(u.length-1)/2;for(let m=Math.floor(f),p=Math.ceil(f);m<=p;++m){let h=u[m];if(h===void 0)continue;let g=i[h];if(g!==void 0&&a[c]===c&&l<g&&!rit(n,c,h)){let x=o[h];x!==void 0&&(a[h]=c,a[c]=o[c]=x,l=g)}}}})}),{root:o,align:a}}function ait(t,e,n,r,o=!1){let a={},i=iit(t,e,n,o),s=o?"borderLeft":"borderRight";function l(m,p){let h=i.nodes().slice(),g={},x=h.pop();for(;x;){if(g[x])m(x);else{g[x]=!0,h.push(x);for(let y of p(x))h.push(y)}x=h.pop()}}function c(m){let p=i.inEdges(m);p?a[m]=p.reduce((h,g)=>{var x;let y=(x=a[g.v])!=null?x:0,b=i.edge(g);return Math.max(h,y+(b!==void 0?b:0))},0):a[m]=0}function d(m){let p=i.outEdges(m),h=Number.POSITIVE_INFINITY;p&&(h=p.reduce((x,y)=>{let b=a[y.w],w=i.edge(y);return Math.min(x,(b!==void 0?b:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let g=t.node(m);h!==Number.POSITIVE_INFINITY&&g.borderType!==s&&(a[m]=Math.max(a[m]!==void 0?a[m]:0,h))}function u(m){return i.predecessors(m)||[]}function f(m){return i.successors(m)||[]}return l(c,u),l(d,f),Object.keys(r).forEach(m=>{var p;let h=n[m];h!==void 0&&(a[m]=(p=a[h])!=null?p:0)}),a}function iit(t,e,n,r){let o=new Ya,a=t.graph(),i=uit(a.nodesep,a.edgesep,r);return e.forEach(s=>{let l;s.forEach(c=>{let d=n[c];if(d!==void 0){if(o.setNode(d),l!==void 0){let u=n[l];if(u!==void 0){let f=o.edge(u,d);o.setEdge(u,d,Math.max(i(t,c,l),f||0))}}l=c}})}),o}function sit(t,e){return Object.values(e).reduce((n,r)=>{let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([s,l])=>{let c=fit(t,s)/2;o=Math.max(l+c,o),a=Math.min(l-c,a)});let i=o-a;return i<n[0]&&(n=[i,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function lit(t,e){let n=Object.values(e),r=es(Math.min,n),o=es(Math.max,n);["u","d"].forEach(a=>{["l","r"].forEach(i=>{let s=a+i,l=t[s];if(!l||l===e)return;let c=Object.values(l),d=r-es(Math.min,c);i!=="l"&&(d=o-es(Math.max,c)),d&&(t[s]=T0(l,u=>u+d))})})}function cit(t,e=void 0){let n=t.ul;return n?T0(n,(r,o)=>{var a,i;if(e){let l=e.toLowerCase(),c=t[l];if(c&&c[o]!==void 0)return c[o]}let s=Object.values(t).map(l=>{let c=l[o];return c!==void 0?c:0}).sort((l,c)=>l-c);return(((a=s[1])!=null?a:0)+((i=s[2])!=null?i:0))/2}):{}}function dit(t){let e=Z1(t),n=Object.assign(tit(t,e),eit(t,e)),r={},o;["u","d"].forEach(i=>{o=i==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=oit(t,o,n,d=>(i==="u"?t.predecessors(d):t.successors(d))||[]),c=ait(t,o,l.root,l.align,s==="r");s==="r"&&(c=T0(c,d=>-d)),r[i+s]=c})});let a=sit(t,r);return lit(r,a),cit(r,t.graph().align)}function uit(t,e,n){return(r,o,a)=>{let i=r.node(o),s=r.node(a),l=0,c;if(l+=i.width/2,Object.hasOwn(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":c=-i.width/2;break;case"r":c=i.width/2;break}if(c&&(l+=n?c:-c),c=void 0,l+=(i.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=s.width/2;break;case"r":c=-s.width/2;break}return c&&(l+=n?c:-c),l}}function fit(t,e){return t.node(e).width}function mit(t){t=vI(t),pit(t),Object.entries(dit(t)).forEach(([e,n])=>t.node(e).x=n)}function pit(t){let e=Z1(t),n=t.graph(),r=n.ranksep,o=n.rankalign,a=0;e.forEach(i=>{let s=i.reduce((l,c)=>{var d;let u=(d=t.node(c).height)!=null?d:0;return l>u?l:u},0);i.forEach(l=>{let c=t.node(l);o==="top"?c.y=a+c.height/2:o==="bottom"?c.y=a+s-c.height/2:c.y=a+s/2}),a+=s+r})}function hit(t,e={}){let n=e.debugTiming?NI:TI;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>vit(t));return n(" runLayout",()=>git(r,n,e)),n(" updateInputGraph",()=>yit(t,r)),r})}function git(t,e,n){e(" makeSpaceForEdgeLabels",()=>Lit(t)),e(" removeSelfEdges",()=>Dit(t)),e(" acyclic",()=>aat(t)),e(" nestingGraph.run",()=>Tat(t)),e(" rank",()=>Eat(vI(t))),e(" injectEdgeLabelProxies",()=>Cit(t)),e(" removeEmptyRanks",()=>Yot(t)),e(" nestingGraph.cleanup",()=>Rat(t)),e(" normalizeRanks",()=>zot(t)),e(" assignRankMinMax",()=>Nit(t)),e(" removeEdgeLabelProxies",()=>Tit(t)),e(" normalize.run",()=>lat(t)),e(" parentDummyChains",()=>vat(t)),e(" addBorderSegments",()=>Iat(t)),e(" order",()=>qI(t,n)),e(" insertSelfEdges",()=>Oit(t)),e(" adjustCoordinateSystem",()=>Dat(t)),e(" position",()=>mit(t)),e(" positionSelfEdges",()=>$it(t)),e(" removeBorderNodes",()=>Pit(t)),e(" normalize.undo",()=>dat(t)),e(" fixupEdgeLabelCoords",()=>Rit(t)),e(" undoCoordinateSystem",()=>Oat(t)),e(" translateGraph",()=>_it(t)),e(" assignNodeIntersects",()=>Ait(t)),e(" reversePoints",()=>Iit(t)),e(" acyclic.undo",()=>sat(t))}function yit(t,e){t.nodes().forEach(n=>{let r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,e.children(n).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(n=>{let r=t.edge(n),o=e.edge(n);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function vit(t){let e=new Ya({multigraph:!0,compound:!0}),n=Hx(t.graph());return e.setGraph(Object.assign({},xit,Bx(n,bit),N0(n,wit))),t.nodes().forEach(r=>{let o=Hx(t.node(r)),a=Bx(o,Eit);Object.keys(pI).forEach(s=>{a[s]===void 0&&(a[s]=pI[s])}),e.setNode(r,a);let i=t.parent(r);i!==void 0&&e.setParent(r,i)}),t.edges().forEach(r=>{let o=Hx(t.edge(r));e.setEdge(r,Object.assign({},Sit,Bx(o,kit),N0(o,Mit)))}),e}function Lit(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(n=>{let r=t.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Cit(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};ku(t,"edge-proxy",o,"_ep")}})}function Nit(t){let e=0;t.nodes().forEach(n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))}),t.graph().maxRank=e}function Tit(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="edge-proxy"){let r=n;t.edge(r.e).labelRank=n.rank,t.removeNode(e)}})}function _it(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,a=t.graph(),i=a.marginx||0,s=a.marginy||0;function l(c){let d=c.x,u=c.y,f=c.width,m=c.height;e=Math.min(e,d-f/2),n=Math.max(n,d+f/2),r=Math.min(r,u-m/2),o=Math.max(o,u+m/2)}t.nodes().forEach(c=>l(t.node(c))),t.edges().forEach(c=>{let d=t.edge(c);Object.hasOwn(d,"x")&&l(d)}),e-=i,r-=s,t.nodes().forEach(c=>{let d=t.node(c);d.x-=e,d.y-=r}),t.edges().forEach(c=>{let d=t.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=r}),Object.hasOwn(d,"x")&&(d.x-=e),Object.hasOwn(d,"y")&&(d.y-=r)}),a.width=n-e+i,a.height=o-r+s}function Ait(t){t.edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=r),n.points.unshift(oI(r,a)),n.points.push(oI(o,i))})}function Rit(t){t.edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Iit(t){t.edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}function Pit(t){t.nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(n.borderLeft[n.borderLeft.length-1]),i=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function Dit(t){t.edges().forEach(e=>{if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Oit(t){Z1(t).forEach(e=>{let n=0;e.forEach((r,o)=>{let a=t.node(r);a.order=o+n,(a.selfEdges||[]).forEach(i=>{ku(t,"selfedge",{width:i.label.width,height:i.label.height,rank:a.rank,order:o+ ++n,e:i.e,label:i.label},"_se")}),delete a.selfEdges})})}function $it(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="selfedge"){let r=n,o=t.node(r.e.v),a=o.x+o.width/2,i=o.y,s=n.x-a,l=o.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*s/3,y:i-l},{x:a+5*s/6,y:i-l},{x:a+s,y:i},{x:a+5*s/6,y:i+l},{x:a+2*s/3,y:i+l}],r.label.x=n.x,r.label.y=n.y}})}function Bx(t,e){return T0(N0(t,e),Number)}function Hx(t){let e={};return t&&Object.entries(t).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),e[n]=r}),e}function Git(t){let e=Z1(t),n=new Ya({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+t.node(r).rank)}),t.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),e.forEach((r,o)=>{let a="layer"+o;n.setNode(a,{rank:"same"}),r.reduce((i,s)=>(n.setEdge(i,s,{style:"invis"}),s))}),n}var hI,got,yot,bot,gI,xot,yI,Ya,Eot,bI,Wx,Lot,wI,Tot,Iot,C0,LI,Xot,_0,Kot,Zot,Jot,tat,_I,hat,gat,yat,Eat,Sat,vat,Iat,bit,xit,wit,Eit,pI,kit,Sit,Mit,qit,dr,$s=dt(()=>{"use strict";hI=Object.defineProperty,got=(t,e,n)=>e in t?hI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yot=(t,e)=>{for(var n in e)hI(t,n,{get:e[n],enumerable:!0})},bot=(t,e,n)=>got(t,typeof e!="symbol"?e+"":e,n),gI={};yot(gI,{Graph:()=>Ya,alg:()=>Wx,json:()=>bI,version:()=>Eot});xot=Object.defineProperty,yI=(t,e)=>{for(var n in e)xot(t,n,{get:e[n],enumerable:!0})},Ya=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(n=>{e!==void 0?this.setNode(n,e):this.setNode(n)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(n=>{this.setParent(n)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let n=e;n!==void 0;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let n=new Set(e);for(let r of this.successors(t))n.add(r);return Array.from(n.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,a])=>{t(o)&&e.setNode(o,a)}),Object.values(this._edgeObjs).forEach(o=>{e.hasNode(o.v)&&e.hasNode(o.w)&&e.setEdge(o,this.edge(o))});let n={},r=o=>{let a=this.parent(o);return!a||e.hasNode(a)?(n[o]=a??void 0,a??void 0):a in n?n[a]:r(a)};return this._isCompound&&e.nodes().forEach(o=>e.setParent(o,r(o))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((n,r)=>(e!==void 0?this.setEdge(n,r,e):this.setEdge(n,r),r)),this}setEdge(t,e,n,r){let o,a,i,s,l=!1;typeof t=="object"&&t!==null&&"v"in t?(o=t.v,a=t.w,i=t.name,arguments.length===2&&(s=e,l=!0)):(o=t,a=e,i=r,arguments.length>2&&(s=n,l=!0)),o=""+o,a=""+a,i!==void 0&&(i=""+i);let c=j1(this._isDirected,o,a,i);if(c in this._edgeLabels)return l&&(this._edgeLabels[c]=s),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(a),this._edgeLabels[c]=l?s:this._defaultEdgeLabelFn(o,a,i);let d=wot(this._isDirected,o,a,i);return o=d.v,a=d.w,Object.freeze(d),this._edgeObjs[c]=d,nI(this._preds[a],o),nI(this._sucs[o],a),this._in[a][c]=d,this._out[o][c]=d,this._edgeCount++,this}edge(t,e,n){let r=arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(t,e,n){let r=arguments.length===1?this.edge(t):this.edge(t,e,n);return typeof r!="object"?{label:r}:r}hasEdge(t,e,n){return(arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n))in this._edgeLabels}removeEdge(t,e,n){let r=arguments.length===1?Ox(this._isDirected,t):j1(this._isDirected,t,e,n),o=this._edgeObjs[r];if(o){let a=o.v,i=o.w;delete this._edgeLabels[r],delete this._edgeObjs[r],rI(this._preds[i],a),rI(this._sucs[a],i),delete this._in[i][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,n){if(!t)return;let r=Object.values(t);return n?r.filter(o=>o.v===e&&o.w===n||o.v===n&&o.w===e):r}};Eot="4.0.1",bI={};yI(bI,{read:()=>vot,write:()=>kot});Wx={};yI(Wx,{CycleException:()=>C0,bellmanFord:()=>xI,components:()=>Not,dijkstra:()=>L0,dijkstraAll:()=>Aot,findCycles:()=>Rot,floydWarshall:()=>Pot,isAcyclic:()=>Oot,postorder:()=>Got,preorder:()=>qot,prim:()=>Bot,shortestPaths:()=>Hot,tarjan:()=>EI,topsort:()=>kI});Lot=()=>1;wI=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let n=this._keyIndices,r=String(t);if(!(r in n)){let o=this._arr,a=o.length;return n[r]=a,o.push({key:r,priority:e}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let n=this._keyIndices[t];if(n===void 0)throw new Error(`Key not found: ${t}`);let r=this._arr[n].priority;if(e>r)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${r} New: ${e}`);this._arr[n].priority=e,this._decrease(n)}_heapify(t){let e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){let e=this._arr,n=e[t].priority,r;for(;t!==0&&(r=t>>1,!(e[r].priority<n));)this._swap(t,r),t=r}_swap(t,e){let n=this._arr,r=this._keyIndices,o=n[t],a=n[e];n[t]=a,n[e]=o,r[a.key]=t,r[o.key]=e}},Tot=()=>1;Iot=()=>1;C0=class extends Error{constructor(...t){super(...t)}};LI=65535;Xot=0;_0="\0",Kot="3.0.0",Zot=class{constructor(){bot(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return iI(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&iI(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Qot)),n=n._prev;return"["+t.join(", ")+"]"}};Jot=Zot,tat=()=>1;_I=uat;({preorder:hat,postorder:gat}=Wx),yat=$c;$c.initLowLimValues=Ux;$c.initCutValues=Vx;$c.calcCutValue=AI;$c.leaveEdge=II;$c.enterEdge=PI;$c.exchangeEdges=DI;Eat=kat;Sat=Yx;vat=Lat;Iat=Pat;bit=["nodesep","edgesep","ranksep","marginx","marginy"],xit={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},wit=["acyclicer","ranker","rankdir","align","rankalign"],Eit=["width","height","rank"],pI={width:0,height:0},kit=["minlen","weight","width","height","labeloffset"],Sit={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Mit=["labelpos"];qit={graphlib:gI,version:Kot,layout:hit,debug:Git,util:{time:NI,notime:TI}},dr=qit;});var Kx={};ue(Kx,{layoutSitemap:()=>Kit});function FI(t,e,n,r,o,a){let i=o-t,s=a-e;if(i===0&&s===0)return{x:t,y:e};let l=n/2,c=r/2,d=i!==0?l/Math.abs(i):1/0,u=s!==0?c/Math.abs(s):1/0,f=Math.min(d,u);return{x:t+i*f,y:e+s*f}}function Yit(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Vit(t,e,n){let r=Tt(t,Bit,{bold:!0});for(let[o,a]of Object.entries(e)){let i=Tt(`${o}: ${a}`,HI);i>r&&(r=i)}if(n)for(let o of n){let a=Tt(o,HI);a>r&&(r=a)}return Math.max(XI,Math.ceil(r)+UI*2)}function Uit(t,e=0){let r=Object.keys(t).length+e;return r===0?WI+zI:WI+Wit+r*Fit+zI}function VI(t,e,n){return t.color?t.color:Dn(t.metadata,[...e],n,t.isContainer)}function jit(t,e){let n=[];for(let r of t){if(r.entries.length===0)continue;let o=e?.get(Bt(r.name)),a=o?r.entries.filter(u=>o.has(u.value.toLowerCase())):r.entries;if(a.length===0)continue;let i=We(r.name,Er)+xo,s=i,l=0;for(let u of a)l+=Tr*2+Ir+We(u.value,Qn)+Qr;let c=_o+Ha,d=qn*2+i+4+c+l;n.push({name:r.name,...r.alias!==void 0&&{alias:r.alias},entries:a.map(u=>({value:u.value,color:u.color})),x:0,y:0,width:d,height:Se,minifiedWidth:s,minifiedHeight:Se})}return n}function jx(t,e,n,r,o,a){for(let i of t){let s=Yit(i.metadata,o);if(i.isContainer){let l=Object.keys(s).length,c=jI+l*KI;a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Math.max(XI,Tt(i.label,Hit,{bold:!0})+UI*2),height:c+Xx}),jx(i.children,i.id,n,r,o,a)}else a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Vit(i.label,s,i.description),height:Uit(s,i.description?.length??0)}),i.children.length>0&&jx(i.children,e,i.id,r,o,a)}}function Kit(t,e,n,r,o){if(t.roots.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let a=[],i=M=>{a.push(M);for(let S of M.children)i(S)};for(let M of t.roots)i(M);ma(a,t.tagGroups,M=>M.isContainer);let s=[];jx(t.roots,null,null,e,r,s);let l=new Map;for(let M of s)l.set(M.sitemapNode.id,M);let c=new dr.graphlib.Graph({compound:!0,multigraph:!0});c.setGraph({rankdir:t.direction,nodesep:50,ranksep:60,edgesep:30,marginx:Gc,marginy:Gc}),c.setDefaultEdgeLabel(()=>({}));let d=new Set,u=new Set,f=new Set;for(let M of s)M.sitemapNode.isContainer?(d.add(M.sitemapNode.id),(e?.get(M.sitemapNode.id)??0)>0&&f.add(M.sitemapNode.id)):u.add(M.sitemapNode.id);let m=0,p=0;for(let M of s)M.sitemapNode.isContainer||(M.width>m&&(m=M.width),M.height>p&&(p=M.height));for(let M of s){let S=M.sitemapNode;if(S.isContainer)if(f.has(S.id)){let T=Math.max(M.width,m),N=Math.max(M.height,p);c.setNode(S.id,{label:S.label,width:T,height:N})}else c.setNode(S.id,{label:S.label,paddingLeft:YI,paddingRight:YI,paddingTop:zit,paddingBottom:Xx});else c.setNode(S.id,{label:S.label,width:M.width,height:M.height})}for(let M of s)M.parentContainerId&&!f.has(M.parentContainerId)&&c.setParent(M.sitemapNode.id,M.parentContainerId);let h=new Set;for(let M of d)f.has(M)||h.add(M);let g=[];for(let M=0;M<t.edges.length;M++){let S=t.edges[M];if(!(!c.hasNode(S.sourceId)||!c.hasNode(S.targetId))){if(h.has(S.sourceId)||h.has(S.targetId)){g.push(M);continue}c.setEdge(S.sourceId,S.targetId,{label:S.label??"",minlen:1},`e${M}`)}}dr.layout(c);let x=[],y=[];for(let M of s){let S=M.sitemapNode;if(S.isContainer)continue;let T=c.node(S.id);if(!T)continue;let N=e?.get(S.id),I=VI(S,t.tagGroups,n??null);x.push({id:S.id,label:S.label,metadata:M.meta,tagMetadata:M.fullMeta,...S.description!==void 0&&{description:[...S.description]},isContainer:!1,lineNumber:S.lineNumber,...I!==void 0&&{color:I},x:T.x,y:T.y-T.height/2,width:T.width,height:T.height,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}})}for(let M of s){let S=M.sitemapNode;if(!S.isContainer)continue;let T=c.node(S.id),N=e?.get(S.id),I=Object.keys(M.meta).length,G=jI+I*KI,$=VI(S,t.tagGroups,n??null);if(T)y.push({nodeId:S.id,label:S.label,lineNumber:S.lineNumber,...$!==void 0&&{color:$},metadata:M.meta,tagMetadata:M.fullMeta,x:T.x-T.width/2,y:T.y-T.height/2,width:T.width,height:T.height,labelHeight:G,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}});else{let A=f.has(S.id),D=A?Math.max(M.width,m):M.width,O=A?M.height:G+Xx,P=A?Math.max(O,p):O;y.push({nodeId:S.id,label:S.label,lineNumber:S.lineNumber,...$!==void 0&&{color:$},metadata:M.meta,tagMetadata:M.fullMeta,x:Gc,y:Gc,width:D,height:P,labelHeight:G,...N!==void 0&&{hiddenCount:N},...(S.children.length>0||N!=null&&N>0)&&{hasChildren:!0}})}}let b=new Set(g),w=[];for(let M=0;M<t.edges.length;M++){let S=t.edges[M];if(!c.hasNode(S.sourceId)||!c.hasNode(S.targetId))continue;let T;if(b.has(M)){let N=c.node(S.sourceId),I=c.node(S.targetId);if(!N||!I)continue;let G=FI(N.x,N.y,N.width,N.height,I.x,I.y),$=FI(I.x,I.y,I.width,I.height,N.x,N.y),A=(G.x+$.x)/2,D=(G.y+$.y)/2;T=[G,{x:A,y:D},$]}else{let N=c.edge({v:S.sourceId,w:S.targetId,name:`e${M}`});if(!N)continue;T=N.points??[]}w.push({sourceId:S.sourceId,targetId:S.targetId,points:T,...S.label!==void 0&&{label:S.label},lineNumber:S.lineNumber,...b.has(M)&&{deferred:!0}})}{let M=new Set([...u,...f]),S=new Map;for(let D of M)S.set(D,D);let T=D=>{for(;S.get(D)!==D;)S.set(D,S.get(S.get(D))),D=S.get(D);return D},N=(D,O)=>{let P=T(D),H=T(O);P!==H&&S.set(P,H)};for(let D of t.edges)M.has(D.sourceId)&&M.has(D.targetId)&&N(D.sourceId,D.targetId);let I=s.find(D=>!D.sitemapNode.isContainer)?.sitemapNode.id,G=I?T(I):null,$=new Set;for(let D of M)G&&T(D)!==G&&$.add(D);let A=new Set;for(let D of d){if(f.has(D)){$.has(D)&&A.add(D);continue}let O=s.filter(P=>!P.sitemapNode.isContainer&&P.parentContainerId===D);O.length>0&&O.every(P=>$.has(P.sitemapNode.id))&&A.add(D)}if($.size>0){let D=t.direction==="TB",O=0,P=0,H=1/0,W=1/0;for(let z of x)$.has(z.id)||(O=Math.max(O,z.x+z.width/2),P=Math.max(P,z.y+z.height),H=Math.min(H,z.y),W=Math.min(W,z.x-z.width/2));for(let z of y)A.has(z.nodeId)||(O=Math.max(O,z.x+z.width),P=Math.max(P,z.y+z.height),H=Math.min(H,z.y),W=Math.min(W,z.x));let B=1/0,q=1/0,V=0,X=0;for(let z of x)$.has(z.id)&&(B=Math.min(B,z.x-z.width/2),q=Math.min(q,z.y),V=Math.max(V,z.x+z.width/2),X=Math.max(X,z.y+z.height));for(let z of y)A.has(z.nodeId)&&(B=Math.min(B,z.x),q=Math.min(q,z.y),V=Math.max(V,z.x+z.width),X=Math.max(X,z.y+z.height));if(B!==1/0){let z=Xit*2,U,Y;if(D?(U=O+z-B,Y=(H===1/0?0:H)-q):(U=(W===1/0?0:W)-B,Y=P+z-q),U!==0||Y!==0){for(let K of x)$.has(K.id)&&(K.x+=U,K.y+=Y);for(let K of y)A.has(K.nodeId)&&(K.x+=U,K.y+=Y);for(let K of w){let et=$.has(K.sourceId),nt=$.has(K.targetId);if(et||nt)for(let J of K.points)J.x+=U,J.y+=Y}}}}}let k=0,C=0;for(let M of x){let S=M.x+M.width/2,T=M.y+M.height;S>k&&(k=S),T>C&&(C=T)}for(let M of y){let S=M.x+M.width,T=M.y+M.height;S>k&&(k=S),T>C&&(C=T)}for(let M of w)for(let S of M.points)S.x>k&&(k=S.x),S.y>C&&(C=S.y);k+=Gc,C+=Gc;let v=new Map;for(let M of t.tagGroups){let S=Bt(M.name),T=new Set,N=I=>{!I.isContainer&&I.metadata[S]&&T.add(I.metadata[S].toLowerCase());for(let G of I.children)N(G)};for(let I of t.roots)N(I);v.set(S,T)}let _=jit(t.tagGroups,v),R=n!=null?_.filter(M=>M.name.toLowerCase()===n.toLowerCase()):_,L=o&&n==null,E=M=>n!=null||L?M.width:M.minifiedWidth;if(R.length>0){let M=Se+Mn,S=R.reduce((G,$)=>G+E($),0)+(R.length-1)*Mn,T=S+Gc*2;T>k&&(k=T);let N=(k-S)/2,I=C+Mn;for(let G of R)G.x=N,G.y=I,N+=E(G)+Mn;C+=M}return{nodes:x,edges:w,containers:y,legend:_,width:k,height:C}}var Bit,HI,Hit,Fit,WI,Wit,UI,zI,XI,Gc,YI,zit,Xx,jI,KI,Xit,Zx=dt(()=>{"use strict";Oe();$s();Oe();pr();Ve();Bit=13,HI=11,Hit=13;Fit=16,WI=28,Wit=6,UI=20,zI=10,XI=140,Gc=40,YI=24,zit=40,Xx=24,jI=28,KI=16;Xit=20});function Zit(t,e){let n=new Map,r=o=>{for(let a of o)for(let i of e.getChildren(a))n.set(e.getId(i),e.getId(a)),r([i])};return r(t),n}function ZI(t,e,n,r){let o=t;for(;;){let a=e.get(o);if(!a)return null;if(n.has(a)&&r.has(a))return a;o=a}}function QI(t,e,n,r,o,a){let i=zR(e,o),s=Zit(t,o),l=[];for(let c of n){let d=a.getSource(c),u=a.getTarget(c),f=i.has(d),m=i.has(u);if(f&&m){l.push(a.withEndpoints(c,d,u));continue}if(!f){let p=ZI(d,s,i,r);if(!p)continue;d=p}if(!m){let p=ZI(u,s,i,r);if(!p)continue;u=p}d!==u&&l.push(a.withEndpoints(c,d,u))}return l}var JI=dt(()=>{"use strict";U1()});var nP={};ue(nP,{collapseSitemapTree:()=>Jit});function eP(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(eP),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function Jit(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=yu(t.roots,e,tP),o=QI(t.roots,n,t.edges,e,tP,Qit);return{parsed:{...t,roots:n,edges:o},hiddenCounts:r}}var tP,Qit,rP=dt(()=>{"use strict";U1();JI();tP={getId:t=>t.id,getChildren:t=>t.children,clone:eP,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer},Qit={getSource:t=>t.sourceId,getTarget:t=>t.targetId,withEndpoints:(t,e,n)=>({...t,sourceId:e,targetId:n})}});var iP={};ue(iP,{renderSitemap:()=>aP,renderSitemapForExport:()=>ust});function ast(t,e,n,r){let o=n??t.primary;return ee(t,o,e,{mode:r})}function ist(t,e){return e??t.primary}function sst(t,e,n){return n?vt(n,Ie(t,e),10):vt(t.surface,t.bg,40)}function lst(t,e){return e??t.textMuted}function aP(t,e,n,r,o,a,i,s,l,c){It(t).selectAll(":not([data-d3-tooltip])").remove();let d=i?.width??t.clientWidth,u=i?.height??t.clientHeight;if(d<=0||u<=0)return;let f=Le.identity(),m=f.aesthetic(tst),p=f.text(13),h=f.text(11),g=f.structural(16),x=f.structural(28),y=f.structural(6),b=f.structural(1.5),w=f.structural(1.5),k=f.text(rst),C=f.text(13),v=f.text(11),_=f.structural(16),R=f.structural(28),L=f.text(20),E=f.structural(nst),M=f.structural(6),S=f.aesthetic(ost),T=or(e.options),N=n.legend.length>0&&!T,I=n.legend.length>0&&T,G=Se+Mn,$=!!e.title&&e.options["no-title"]!=="on",A=!i&&N,D=A&&$,O=D?E:0,P=f.structural(A?ir({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:_o+Ha},d):Se),H=A?P+S:0,W=vo(e.options),B=W&&D?cr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:c?"export":"preview",capsulePillAddonWidth:_o+Ha},{activeGroup:s??null},d):{width:0,height:0},q=nr({requested:W,title:e.title??"",hasLegend:D,legendWidth:B.width,legendHeight:B.height,containerWidth:d,titleBandHeight:O,legendReserve:H,titleBaselineY:m+L,titleFontSize:L}),V=q.inline?O:O+H,X=0,z=!D&&$?E:0,U=n.width,Y=n.height+z;(A||I)&&(Y-=G);let K=u-m*2-V-X,et=(d-m*2)/U,nt=K/Y,J=Math.min(est,et,nt),F=U*J,j=(d-F)/2,Q=m+V,Z=It(t).append("svg").attr("width",d).attr("height",u).attr("viewBox",`0 0 ${d} ${u}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);f.isBelowFloor&&Z.attr("width","100%");let ot=Z.append("defs");ot.append("marker").attr("id","sm-arrow").attr("viewBox",`0 0 ${Ol} ${ns}`).attr("refX",Ol).attr("refY",ns/2).attr("markerWidth",Ol).attr("markerHeight",ns).attr("orient","auto").append("polygon").attr("points",`0,0 ${Ol},${ns/2} 0,${ns}`).attr("fill",r.textMuted);let at=new Set;for(let st of at){let ct=`sm-arrow-${st.replace("#","")}`;ot.append("marker").attr("id",ct).attr("viewBox",`0 0 ${Ol} ${ns}`).attr("refX",Ol).attr("refY",ns/2).attr("markerWidth",Ol).attr("markerHeight",ns).attr("orient","auto").append("polygon").attr("points",`0,0 ${Ol},${ns/2} 0,${ns}`).attr("fill",st)}let lt=Z.append("g").attr("transform",`translate(${j}, ${Q}) scale(${J})`);if(!D&&$){let st=lt.append("text").attr("x",U/2).attr("y",L).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",L).attr("font-weight","700").attr("class","sitemap-title chart-title");e.titleLineNumber&&(st.attr("data-line-number",e.titleLineNumber),a&&st.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),st.text(e.title)}let rt=A?-G:0,ut=lt.append("g").attr("transform",`translate(0, ${z+rt})`),tt=new Map,it=new Map;for(let st of e.tagGroups){tt.set(Bt(st.name),st.name);for(let ct of st.entries)it.set(`${Bt(st.name)}:${ct.value.toLowerCase()}`,ct.color)}for(let st of n.containers){let ct=ut.append("g").attr("transform",`translate(${st.x}, ${st.y})`).attr("class","sitemap-container").attr("data-line-number",String(st.lineNumber));if(st.hasChildren&&ct.attr("data-node-toggle",st.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!st.hiddenCount)).attr("aria-label",st.label),a&&ct.style("cursor","pointer").on("click",()=>a(st.lineNumber)),s){let gt=Bt(s),Et=st.tagMetadata[gt];Et&&ct.attr(`data-tag-${gt}`,Et.toLowerCase())}let pt=sst(r,o,st.color),mt=lst(r,st.color);ct.append("rect").attr("x",0).attr("y",0).attr("width",st.width).attr("height",st.height).attr("rx",8).attr("fill",pt).attr("stroke",mt).attr("stroke-opacity",.35).attr("stroke-width",w),ct.append("text").attr("x",st.width/2).attr("y",R/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",r.text).attr("font-size",C).attr("font-weight","bold").text(st.label);let bt=Object.entries(st.metadata);if(bt.length>0){let gt=bt.map(([_t])=>tt.get(_t)??_t),ft=10+Math.max(...gt.map(_t=>Tt(`${_t}: `,v))),kt=R+v-2;for(let _t=0;_t<bt.length;_t++){let[yt,St]=bt[_t],Ct=gt[_t],ht=kt+_t*_,Pt=it.get(`${yt}:${St.toLowerCase()}`)??r.text;ct.append("text").attr("x",10).attr("y",ht).attr("fill",r.textMuted).attr("font-size",v).text(`${Ct}: `),ct.append("text").attr("x",ft).attr("y",ht).attr("fill",Pt).attr("font-size",v).text(St)}}if(!i&&st.hiddenCount&&st.hiddenCount>0){let gt=`clip-${st.nodeId}`;ct.append("clipPath").attr("id",gt).append("rect").attr("width",st.width).attr("height",st.height).attr("rx",8),ct.append("rect").attr("y",st.height-M).attr("width",st.width).attr("height",M).attr("fill",mt).attr("clip-path",`url(#${gt})`).attr("class","sitemap-collapse-bar")}}for(let st of n.edges){if(st.points.length<2)continue;let ct=ut.append("g").attr("class","sitemap-edge-group").attr("data-line-number",String(st.lineNumber)).attr("data-from",st.sourceId).attr("data-to",st.targetId),pt=r.textMuted,mt="sm-arrow",gt=(st.deferred?dst:cst)(st.points);if(gt&&ct.append("path").attr("d",gt).attr("fill","none").attr("stroke",pt).attr("stroke-width",b).attr("marker-end",`url(#${mt})`).attr("class","sitemap-edge"),st.label&&st.points.length>=2){let Et=st.points[Math.floor(st.points.length/2)],ft=Tt(st.label,k)+10,kt=k+6;ct.append("rect").attr("x",Et.x-ft/2).attr("y",Et.y-kt/2-1).attr("width",ft).attr("height",kt).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","sitemap-edge-label-bg"),ct.append("text").attr("x",Et.x).attr("y",Et.y+4).attr("text-anchor","middle").attr("fill",pt).attr("font-size",k).attr("class","sitemap-edge-label").text(st.label)}}for(let st of n.nodes){let ct=ut.append("g").attr("transform",`translate(${st.x-st.width/2}, ${st.y})`).attr("class","sitemap-node").attr("data-line-number",String(st.lineNumber)).attr("data-node-id",st.id);if(st.hasChildren&&ct.attr("data-node-toggle",st.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!st.hiddenCount)),a&&ct.style("cursor","pointer").on("click",()=>a(st.lineNumber)),s){let ft=Bt(s),kt=st.tagMetadata[ft];kt&&ct.attr(`data-tag-${ft}`,kt.toLowerCase())}let pt=mn(e.options),mt=ast(r,o,st.color,pt),bt=ist(r,st.color),gt=pe(mt,r.textOnFillLight,r.textOnFillDark);Os(ct,{width:st.width,height:st.height,rx:6,fill:mt,stroke:bt,strokeWidth:w,label:st.label,labelColor:gt,labelFontSize:p,headerHeight:x});let Et=Object.entries(st.metadata);if(Et.length>0){ct.append("line").attr("x1",0).attr("y1",x).attr("x2",st.width).attr("y2",x).attr("stroke",pt==="solid"?gt:bt).attr("stroke-opacity",.3);let ft=Et.map(([yt])=>tt.get(yt)??yt),_t=10+Math.max(...ft.map(yt=>Tt(`${yt}: `,h)));for(let yt=0;yt<Et.length;yt++){let[St,Ct]=Et[yt],ht=ft[yt],Pt=x+y+(yt+1)*g-4,Dt=it.get(`${St}:${Ct.toLowerCase()}`),qt=pt==="solid"?gt:Dt??gt;ct.append("text").attr("x",10).attr("y",Pt).attr("fill",gt).attr("font-size",h).text(`${ht}:`),ct.append("text").attr("x",_t).attr("y",Pt).attr("fill",qt).attr("font-size",h).text(Ct)}}if(st.description&&st.description.length>0){let ft=Object.keys(st.metadata).length,kt=ft>0?x+y+ft*g:x;ct.append("line").attr("x1",0).attr("y1",kt).attr("x2",st.width).attr("y2",kt).attr("stroke",pt==="solid"?gt:bt).attr("stroke-opacity",.3);let _t=x+y+ft*g;for(let yt=0;yt<st.description.length;yt++){let St=la(st.description[yt]),Ct=_t+(yt+1)*g-4,ht=ct.append("text").attr("x",10).attr("y",Ct).attr("fill",gt).attr("font-size",h);pn(ht,St,r,h)}}if(!i&&st.hiddenCount&&st.hiddenCount>0){let ft=`clip-${st.id}`;ct.append("clipPath").attr("id",ft).append("rect").attr("width",st.width).attr("height",st.height).attr("rx",6),ct.append("rect").attr("y",st.height-M).attr("width",st.width).attr("height",M).attr("fill",pt==="solid"?gt:st.color??r.primary).attr("opacity",.5).attr("clip-path",`url(#${ft})`)}}if(i&&N&&oP(ut,n.legend,r,o,s,void 0,l,c),D){let st=Z.append("text").attr("x",q.titleX).attr("y",m+L).attr("text-anchor",q.titleAnchor).attr("fill",r.text).attr("font-size",L).attr("font-weight","700").attr("class","sitemap-title chart-title").style("font-family",Mt);e.titleLineNumber&&(st.attr("data-line-number",e.titleLineNumber),a&&st.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),st.text(e.title)}if(A){let st=Z.append("g").attr("class","sitemap-legend-fixed").attr("transform",q.inline?`translate(${q.legendX}, ${q.legendY})`:`translate(0, ${m+O})`);s&&st.attr("data-legend-active",Bt(s)),oP(st,n.legend,r,o,s,d,l,c,q.inline)}}function oP(t,e,n,r,o,a,i,s,l){if(e.length===0)return;let c=e.map(p=>({name:p.name,entries:p.entries.map(h=>({value:h.value,color:h.color}))})),d=a!=null,u=d?_o+Ha:0,f=a??e[0].x+(e[0].width??200),m=tn(t,{groups:c,activeGroup:o??null,mode:s?"export":"preview",position:{placement:"top-center",titleRelation:l?"inline-with-title":"below-title"},capsulePillAddonWidth:u,palette:n,isDark:r,width:f});if(t.selectAll("[data-legend-group]").classed("sitemap-legend-group",!0),d){let p=m.getLayout();if(p.activeCapsule?.addonX!=null){let h=p.activeCapsule,g=Bt(h.groupName),x=i?.has(g)??!1,y=t.select(`[data-legend-group="${g}"]`);if(!y.empty()){let b=h.addonX,w=(Se-_o)/2,k=6,C=y.append("g").attr("class","sitemap-legend-eye").attr("data-legend-visibility",g).style("cursor","pointer").attr("opacity",x?.4:.7);C.append("rect").attr("x",b-k).attr("y",w-k).attr("width",_o+k*2).attr("height",_o+k*2).attr("fill","transparent").attr("pointer-events","all"),C.append("path").attr("d",x?r1:n1).attr("transform",`translate(${b}, ${w})`).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}async function ust(t,e,n){let{parseSitemap:r}=await Promise.resolve().then(()=>(g1(),m5)),{layoutSitemap:o}=await Promise.resolve().then(()=>(Zx(),Kx)),{getPalette:a}=await Promise.resolve().then(()=>(pi(),_b)),i=e==="dark",s=n??(i?a("nord").dark:a("nord").light),l=r(t,s);if(l.error||l.roots.length===0)return"";let c=o(l,void 0,null,void 0,!0),d=20,u=l.title?30:0,f=c.width+d*2,m=c.height+d*2+u,p=document.createElement("div");p.style.width=`${f}px`,p.style.height=`${m}px`,p.style.position="absolute",p.style.left="-9999px",document.body.appendChild(p),aP(p,l,c,s,i,void 0,{width:f,height:m});let h=p.querySelector("svg");if(!h)return document.body.removeChild(p),"";e==="transparent"?h.style.background="none":h.style.background||(h.style.background=s.bg),h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.style.fontFamily=Mt;let g=Fr(h);return document.body.removeChild(p),g}var tst,est,nst,Ol,ns,rst,ost,cst,dst,sP=dt(()=>{"use strict";fi();Oe();Ae();ko();Nn();Fo();Ke();Fe();co();Fa();Ve();pr();Mr();qr();wr();F1();tst=20,est=3,nst=30,Ol=10,ns=7,rst=11,ost=8;cst=lr().x(t=>t.x).y(t=>t.y).curve(To),dst=lr().x(t=>t.x).y(t=>t.y).curve(bc)});function A0(t){return t.toLowerCase()===fst}var fst,lP=dt(()=>{"use strict";fst="archive"});var gP={};ue(gP,{renderKanban:()=>hP,renderKanbanForExport:()=>mst});function B0(t,e,n){let r=[];for(let o of e){if(n?.includes(o.name.toLowerCase()))continue;let i=t.tags[Bt(o.name)]??o.defaultValue;if(!i)continue;let s=o.entries.find(l=>l.value.toLowerCase()===i.toLowerCase());r.push({label:o.name,value:i,...s?.color!==void 0&&{color:s.color}})}return r}function mP(t,e,n){if(!n)return t.color;let r=e.find(s=>s.name.toLowerCase()===n.toLowerCase());if(!r)return t.color;let a=t.tags[Bt(r.name)]??r.defaultValue;return a?r.entries.find(s=>s.value.toLowerCase()===a.toLowerCase())?.color:void 0}function pP(t,e,n,r,o=Q1,a=O0,i=$0,s=t7,l=R0,c=I0,d=D0,u=Lu,f=vu,m=Mu,p=Su,h=G0,g=P0,x=Qx,y=J1,b=q0){let k=!!t.title&&t.options["no-title"]!=="on"?a+8:0,C=o+k,v=[],_=0,R=t.columns.filter(S=>!A0(S.name));for(let S of R){if(n?.has(S.id)??!1){v.push({x:0,y:C,width:b,height:0,column:S,cardLayouts:[]});continue}let N=Tt(S.name,s,{bold:!0}),I=[],G=l+c;for(let D of S.cards){let O=Tt(D.title,i);N=Math.max(N,O+d*2);let P=B0(D,t.tagGroups,r),H=P.length+D.details.length,W=H>0?f+1+u+H*m:0,B=p+u+W;for(let q of P){let V=Tt(`${q.label}: ${q.value}`,h)+d*2;N=Math.max(N,V)}I.push({x:c,y:G,width:0,height:B,card:D}),G+=B+g}let $=Math.max(x,N+c*2);for(let D of I)D.width=$-c*2;let A=G+c;_=Math.max(_,A),v.push({x:0,y:C,width:$,height:A,column:S,cardLayouts:I})}let L=o;for(let S of v)S.x=L,S.height=_,L+=S.width+y;let E=L-y+o,M=C+_+o;return{columns:v,totalWidth:E,totalHeight:M}}function hP(t,e,n,r,o){let a=o?.exportDims,i=o?.activeTagGroup??null,s=o?.onSwimlaneChange,l=o?.collapsedLanes,c=o?.collapsedColumns??new Set(e.columns.filter(Q=>Q.collapsed).map(Q=>Q.id)),d=o?.compactMeta??!1,u=mn(e.options),f=Ie(n,r),m=vt(n.border,f,20),p=o?.currentSwimlaneGroup??null,h=p?e.tagGroups.find(Q=>Q.name.toLowerCase()===p.toLowerCase())??null:null,g=[];d&&(i&&g.push(i.toLowerCase()),p&&g.push(p.toLowerCase()));let x=e.columns.filter(Q=>!A0(Q.name)),y=Math.max(1,x.length),b=y*Qx+(y-1)*J1+2*Q1,w=a?.width??t.getBoundingClientRect().width,k=a||w<=0?Le.identity():Le.from(w,b),C=k.aesthetic(Q1),v=k.aesthetic(J1),_=k.structural(R0),R=k.aesthetic(I0),L=k.structural(Qx),E=k.structural(Su),M=k.structural(Mu),S=k.structural(vu),T=k.aesthetic(P0),N=k.structural(6),I=k.aesthetic(D0),G=k.aesthetic(Lu),$=k.structural(Jx),A=k.structural(O0),D=k.text(t7),O=k.text($0),P=k.text(G0),H=k.text(dP),W=k.structural(uP),B=k.structural(fP),q=k.structural(q0),V=k.structural(e7),X=k.text(20),z=k.structural(n7),U=k.aesthetic(r7),Y=pP(e,n,c,g,C,A,O,D,_,R,I,G,S,M,E,P,T,L,v,q),K=a?.width??Y.totalWidth,et=a?.height??Y.totalHeight;t.innerHTML="";let nt=It(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",K).attr("height",et).attr("viewBox",`0 0 ${K} ${et}`).attr("preserveAspectRatio","xMidYMin meet").attr("font-family",Mt).style("background",n.bg);k.isBelowFloor&&nt.attr("width","100%");let J=!!e.title&&e.options["no-title"]!=="on";if(J&&nt.append("text").attr("class","chart-title").attr("data-line-number",e.titleLineNumber??0).attr("x",C).attr("y",C+X).attr("font-size",X).attr("font-weight","700").attr("fill",n.text).text(e.title),e.tagGroups.length>0&&!or(e.options)){let Q=J?We(e.title,X)+16:0,Z=C+Q,ot={groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:o?.exportMode?"export":"preview"},at=ir(ot,K-Z-C),lt=C+(X-at)/2,rt=nt.append("g").attr("class","kanban-legend").attr("transform",`translate(${Z},${lt})`),tt=!!s&&!a?{onGroupRendered:(it,st,ct)=>{let pt=h?.name.toLowerCase()===it.toLowerCase(),mt=We(it,11),bt=ct?10+mt+6:8+mt+4,gt=(Se-7)/2,Et=pst(st,bt,gt,pt,n);Et.append("title").text(`Group by ${it}`),Et.style("cursor","pointer").on("click",ft=>{ft.stopPropagation(),s?.(pt?null:it)})}}:void 0;tn(rt,{...ot,palette:n,isDark:r,width:K-Z-C,activeGroup:i??null,...tt!==void 0&&{callbacks:tt}})}if(h){yst(nt,e,Y,h,n,r,i,l,c,g,C,A,z,v,q,_,R,E,G,T,V,U,S,M,D,W,B,H,N,I,$,O,P);return}let F=r?vt(n.surface,n.bg,50):vt(n.surface,n.bg,30),j=r?vt(n.surface,n.bg,70):vt(n.surface,n.bg,50);for(let Q of Y.columns){let Z=Q.column,ot=c?.has(Z.id)??!1,at=nt.append("g").attr("class","kanban-column").attr("data-column-id",Z.id).attr("data-line-number",Z.lineNumber),lt=F,rt=Z.color?ee(n,Z.color,r,{mode:u}):j,ut=Z.color?pe(rt,n.textOnFillLight,n.textOnFillDark):n.text;if(ot){at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",q).attr("height",Q.height).attr("rx",W).attr("fill",u==="outline"?f:lt).call(tt=>{u==="outline"&&tt.attr("stroke",m).attr("stroke-width",1)}),at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",q).attr("height",_).attr("rx",B).attr("fill",rt),at.append("text").attr("x",Q.x+q/2).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("font-size",H).attr("font-weight","bold").attr("fill",Z.color?ut:n.textMuted).attr("text-anchor","middle").text(String(Z.cards.length)),at.append("text").attr("x",Q.x+q/2).attr("y",Q.y+_+R).attr("font-size",O).attr("font-weight","bold").attr("fill",n.text).attr("text-anchor","middle").attr("writing-mode","tb").text(Z.name);continue}at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",Q.width).attr("height",Q.height).attr("rx",W).attr("fill",u==="outline"?f:lt).call(tt=>{u==="outline"&&tt.attr("stroke",m).attr("stroke-width",1)}),at.append("rect").attr("x",Q.x).attr("y",Q.y).attr("width",Q.width).attr("height",_).attr("rx",B).attr("fill",rt),at.append("text").attr("x",Q.x+R).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("font-size",D).attr("font-weight","bold").attr("fill",ut).text(Z.name);{let tt=Z.wipLimit!=null&&Z.cards.length>Z.wipLimit,it=Z.wipLimit!=null?`${Z.cards.length}/${Z.wipLimit}`:String(Z.cards.length);at.append("text").attr("x",Q.x+Q.width-R).attr("y",Q.y+_/2).attr("dominant-baseline","central").attr("text-anchor","end").attr("font-size",H).attr("fill",tt?n.colors.red:Z.color?ut:n.textMuted).attr("font-weight",tt?"bold":"normal").text(it)}for(let tt of Q.cardLayouts){let it=tt.card,st=mP(it,e.tagGroups,i??null),ct=B0(it,e.tagGroups,g),pt=ct.length>0||it.details.length>0,mt=ee(n,st??n.primary,r,{mode:u}),bt=st??n.textMuted,gt=pe(mt,n.textOnFillLight,n.textOnFillDark),Et=at.append("g").attr("class","kanban-card").attr("data-card-id",it.id).attr("data-line-number",it.lineNumber);if(i){let yt=Bt(i),St=it.tags[yt],Ct=e.tagGroups.find(Pt=>Pt.name.toLowerCase()===yt),ht=St??Ct?.defaultValue;ht&&Et.attr(`data-tag-${yt}`,ht.toLowerCase())}let ft=Q.x+tt.x,kt=Q.y+tt.y;Et.append("rect").attr("x",ft).attr("y",kt).attr("width",tt.width).attr("height",tt.height).attr("rx",N).attr("fill",mt).attr("stroke",bt).attr("stroke-width",$);let _t=Et.append("text").attr("x",ft+I).attr("y",kt+G+O).attr("font-size",O).attr("font-weight","500").attr("fill",gt);if(pn(_t,it.title,n,O),pt){let yt=kt+E;Et.append("line").attr("x1",ft).attr("y1",yt).attr("x2",ft+tt.width).attr("y2",yt).attr("stroke",u==="solid"?gt:bt).attr("stroke-opacity",.3).attr("stroke-width",1);let St=yt+S+P;for(let Ct of ct){Et.append("text").attr("x",ft+I).attr("y",St).attr("font-size",P).attr("fill",gt).text(`${Ct.label}: `);let ht=Tt(`${Ct.label}: `,P);Et.append("text").attr("x",ft+I+ht).attr("y",St).attr("font-size",P).attr("fill",gt).text(Ct.value),St+=M}for(let Ct of it.details){let ht=Et.append("text").attr("x",ft+I).attr("y",St).attr("font-size",P).attr("fill",gt);pn(ht,Ct,n,P),St+=M}}}}}function mst(t,e,n){let r=Xd(t,n);if(r.error||r.columns.length===0)return"";let o=e==="dark",a=pP(r,n),i=document.createElement("div");hP(i,r,n,o,{exportDims:{width:a.totalWidth,height:a.totalHeight},exportMode:!0});let s=i.querySelector("svg");return s?Fr(s):""}function pst(t,e,n,r,o){let a=t.append("g").attr("class","kanban-swimlane-icon").attr("transform",`translate(${e}, ${n})`);a.append("rect").attr("x",-5).attr("y",-5).attr("width",22).attr("height",18).attr("fill","transparent");let i=r?o.primary:o.textMuted,s=r?1:.35,l=[8,12,6],c=2,d=3;for(let u=0;u<l.length;u++)a.append("rect").attr("x",0).attr("y",u*d).attr("width",l[u]).attr("height",c).attr("rx",1).attr("fill",i).attr("opacity",s);return a}function hst(t,e){let n=Bt(e.name),r=new Map;for(let a of e.entries)r.set(a.value.toLowerCase(),{laneName:a.value,laneColor:a.color,isFallback:!1,cellsByColumn:{}});let o=`__no_${n}__`;for(let a of t)for(let i of a.cards){let s=i.tags[n]??e.defaultValue,l;s&&r.has(s.toLowerCase())?l=s.toLowerCase():(r.has(o)||r.set(o,{laneName:`No ${e.name}`,isFallback:!0,cellsByColumn:{}}),l=o);let c=r.get(l);(c.cellsByColumn[a.id]??=[]).push(i)}return Array.from(r.values())}function cP(t,e,n,r=vu,o=Lu,a=Mu,i=Su){let l=B0(t,e,n).length+t.details.length,c=l>0?r+1+o+l*a:0;return i+o+c}function gst(t,e,n,r,o,a,i=Q1,s=O0,l=n7,c=J1,d=q0,u=R0,f=I0,m=Su,p=Lu,h=P0,g=e7,x=r7,y=vu,b=Mu){let w=t.title&&t.options["no-title"]!=="on"?s+8:0,k=i+w,C=[],v=i+l;for(let S of n.columns){let N=o?.has(S.column.id)??!1?d:S.width;C.push({column:S.column,x:v,width:N}),v+=N+c}let _=v-c+i,R=[],L=k+u+f,E=m+p+h;for(let S of e){if(r?.has(S.laneName)??!1){let A=C.map(D=>({column:D.column,cards:S.cellsByColumn[D.column.id]??[],cardLayouts:[]}));R.push({bucket:S,y:L,height:g,cells:A}),L+=g+x;continue}let N=E,I=[];for(let A of C){let D=o?.has(A.column.id)??!1,O=S.cellsByColumn[A.column.id]??[];if(D){I.push({column:A.column,cards:O,h:0});continue}let P=0;for(let H of O)P+=cP(H,t.tagGroups,a,y,p,b,m)+h;P=Math.max(P-(O.length>0?h:0),0),I.push({column:A.column,cards:O,h:P}),P>N&&(N=P)}let G=Math.max(N,E),$=I.map((A,D)=>{let O=C[D];if(o?.has(O.column.id)??!1)return{column:A.column,cards:A.cards,cardLayouts:[]};let H=[],W=0;for(let B of A.cards){let q=cP(B,t.tagGroups,a,y,p,b,m);H.push({x:O.x+f,y:L+W,width:O.width-f*2,height:q,card:B}),W+=q+h}return{column:A.column,cards:A.cards,cardLayouts:H}});R.push({bucket:S,y:L,height:G,cells:$}),L+=G+x}let M=L-x+f+i;return{columnXs:C,lanes:R,totalWidth:_,totalHeight:M,startY:k}}function yst(t,e,n,r,o,a,i,s,l,c,d=Q1,u=O0,f=n7,m=J1,p=q0,h=R0,g=I0,x=Su,y=Lu,b=P0,w=e7,k=r7,C=vu,v=Mu,_=t7,R=uP,L=fP,E=dP,M=6,S=D0,T=Jx,N=$0,I=G0){let G=e.columns.filter(W=>!A0(W.name)),$=hst(G,r),A=gst(e,$,n,s,l,c,d,u,f,m,p,h,g,x,y,b,w,k,C,v),D=parseFloat(t.attr("width")||"0"),O=parseFloat(t.attr("height")||"0");A.totalWidth>D&&(t.attr("width",A.totalWidth),t.attr("viewBox",`0 0 ${A.totalWidth} ${Math.max(O,A.totalHeight)}`)),A.totalHeight>O&&(t.attr("height",A.totalHeight),t.attr("viewBox",`0 0 ${Math.max(D,A.totalWidth)} ${A.totalHeight}`));let P=a?vt(o.surface,o.bg,50):vt(o.surface,o.bg,30),H=a?vt(o.surface,o.bg,70):vt(o.surface,o.bg,50);for(let W of A.columnXs){let B=W.column,q=l?.has(B.id)??!1,V=t.append("g").attr("class","kanban-column kanban-column-header").attr("data-column-id",B.id).attr("data-line-number",B.lineNumber),X=B.color?ee(o,B.color,a,{mode:mn(e.options)}):H;if(V.append("rect").attr("x",W.x).attr("y",A.startY).attr("width",W.width).attr("height",h).attr("rx",L).attr("fill",X),q)V.append("text").attr("x",W.x+W.width/2).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(B.cards.length));else{V.append("text").attr("x",W.x+g).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("font-size",_).attr("font-weight","bold").attr("fill",o.text).text(B.name);let z=B.wipLimit!=null&&B.cards.length>B.wipLimit,U=B.wipLimit!=null?`${B.cards.length}/${B.wipLimit}`:String(B.cards.length);V.append("text").attr("x",W.x+W.width-g).attr("y",A.startY+h/2).attr("dominant-baseline","central").attr("text-anchor","end").attr("font-size",E).attr("fill",z?o.colors.red:o.textMuted).attr("font-weight",z?"bold":"normal").text(U)}}for(let W of A.lanes){let B=s?.has(W.bucket.laneName)??!1,q=t.append("g").attr("class","kanban-lane").attr("data-lane-name",W.bucket.laneName),V=q.append("g").attr("class","kanban-lane-header").attr("transform",`translate(${d}, ${W.y-g})`);V.append("rect").attr("x",0).attr("y",0).attr("width",f-8).attr("height",W.height+g*2).attr("rx",R).attr("fill",P);let X=10,z=W.cells.reduce((U,Y)=>U+Y.cards.length,0);if(W.bucket.laneColor&&(V.append("circle").attr("cx",X+4).attr("cy",16).attr("r",4).attr("fill",W.bucket.laneColor),X+=14),B?V.append("text").attr("x",X).attr("y",20).attr("font-size",10).attr("fill",o.textMuted).text(`${W.bucket.laneName} (${z})`):V.append("text").attr("x",X).attr("y",20).attr("font-size",12).attr("font-weight","bold").attr("fill",W.bucket.isFallback?o.textMuted:o.text).text(W.bucket.laneName),B)for(let U of W.cells){let Y=l?.has(U.column.id)??!1;if(U.cards.length>0){let K=A.columnXs.find(J=>J.column.id===U.column.id);if(!K)continue;let et=W.bucket.laneColor?vt(W.bucket.laneColor,o.bg,a?40:28):vt(o.textMuted,o.bg,a?28:22),nt=Y?p-8:K.width-g*2;q.append("rect").attr("x",K.x+(Y?4:g)).attr("y",W.y).attr("width",nt).attr("height",18).attr("rx",4).attr("fill",et),q.append("text").attr("x",K.x+(Y?4:g)+nt/2).attr("y",W.y+13).attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(U.cards.length))}}if(q.append("line").attr("x1",d+f).attr("x2",A.totalWidth-d).attr("y1",W.y+W.height+g).attr("y2",W.y+W.height+g).attr("stroke",o.border??o.textMuted).attr("stroke-opacity",.4).attr("stroke-width",1),!B)for(let U of W.cells){if((l?.has(U.column.id)??!1)&&U.cards.length>0){let K=A.columnXs.find(et=>et.column.id===U.column.id);if(K){let et=W.bucket.laneColor?vt(W.bucket.laneColor,o.bg,a?40:28):vt(o.textMuted,o.bg,a?28:22);q.append("rect").attr("x",K.x+4).attr("y",W.y).attr("width",p-8).attr("height",22).attr("rx",4).attr("fill",et),q.append("text").attr("x",K.x+p/2).attr("y",W.y+16).attr("font-size",E).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(U.cards.length))}continue}for(let K of U.cardLayouts)bst(q,K,e.tagGroups,i,o,a,c,mn(e.options),M,S,y,T,N,I,x,C,v)}}}function bst(t,e,n,r,o,a,i,s,l=6,c=D0,d=Lu,u=Jx,f=$0,m=G0,p=Su,h=vu,g=Mu){let x=e.card,y=mP(x,n,r),b=B0(x,n,i),w=b.length>0||x.details.length>0,k=ee(o,y??o.primary,a,{mode:s}),C=y??o.textMuted,v=pe(k,o.textOnFillLight,o.textOnFillDark),_=t.append("g").attr("class","kanban-card").attr("data-card-id",x.id).attr("data-line-number",x.lineNumber);if(r){let M=Bt(r),S=n.find(N=>N.name.toLowerCase()===M),T=x.tags[M]??S?.defaultValue;T&&_.attr(`data-tag-${M}`,T.toLowerCase())}let R=e.x,L=e.y;_.append("rect").attr("x",R).attr("y",L).attr("width",e.width).attr("height",e.height).attr("rx",l).attr("fill",k).attr("stroke",C).attr("stroke-width",u);let E=_.append("text").attr("x",R+c).attr("y",L+d+f).attr("font-size",f).attr("font-weight","500").attr("fill",v);if(pn(E,x.title,o,f),w){let M=L+p;_.append("line").attr("x1",R).attr("y1",M).attr("x2",R+e.width).attr("y2",M).attr("stroke",C).attr("stroke-opacity",.3).attr("stroke-width",1);let S=M+h+m;for(let T of b){_.append("text").attr("x",R+c).attr("y",S).attr("font-size",m).attr("fill",o.textMuted).text(`${T.label}: `);let N=Tt(`${T.label}: `,m);_.append("text").attr("x",R+c+N).attr("y",S).attr("font-size",m).attr("fill",v).text(T.value),S+=g}for(let T of x.details){let N=_.append("text").attr("x",R+c).attr("y",S).attr("font-size",m).attr("fill",o.textMuted);pn(N,T,o,m),S+=g}}}var Q1,J1,R0,I0,Qx,Su,Mu,vu,P0,D0,Lu,Jx,O0,t7,$0,G0,dP,uP,fP,q0,e7,n7,r7,yP=dt(()=>{"use strict";fi();Oe();Ae();Nn();Ke();Fe();co();wg();lP();pr();qr();Ae();Mr();wr();Ve();Q1=20,J1=16,R0=36,I0=12,Qx=200,Su=24,Mu=14,vu=4,P0=8,D0=10,Lu=6,Jx=1.5,O0=30,t7=13,$0=12,G0=10,dP=10,uP=8,fP=8,q0=40,e7=26;n7=140,r7=14});var xP={};ue(xP,{layoutClassDiagram:()=>a7});function Mst(t){let e=t.members.filter(d=>!d.isMethod),n=t.members.filter(d=>d.isMethod),r=t.modifier==="enum",o=Tt(t.name,kst,{bold:!0});t.modifier&&(o=Math.max(o,Tt(`\xAB${t.modifier}\xBB`,bP)));for(let d of t.members){let u=d.name;d.isMethod?(u+=`(${d.params??""})`,d.type&&(u+=`: ${d.type}`)):d.type&&(u+=`: ${d.type}`),u=`+ ${u}`,o=Math.max(o,Tt(u,bP))}let a=Math.max(xst,o+wst),i=Est+(t.modifier?Sst:0),s;if(r){let d=t.members;d.length>0?s=Cu*2+d.length*o7+Nu:s=Nu+Cu}else e.length>0?s=Cu*2+e.length*o7+Nu:s=Nu+Cu;let l=0;r||(n.length>0?l=Cu*2+n.length*o7+Nu:l=Nu+Cu);let c=i+s+l;return{width:a,height:c,headerHeight:i,fieldsHeight:s,methodsHeight:l}}function a7(t,e){if(t.classes.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new dr.graphlib.Graph;n.setGraph({rankdir:"TB",nodesep:60,ranksep:80,edgesep:20}),n.setDefaultEdgeLabel(()=>({}));let r=new Map;for(let k of t.classes){let C=Mst(k);r.set(k.id,C),n.setNode(k.id,{label:k.name,width:C.width,height:C.height})}for(let k of t.relationships)n.setEdge(k.source,k.target,{label:k.label??""});dr.layout(n);let a=t.options?.["no-notes"]==="on"||!t.notes?new Map:wo(t.notes,t.classes.map(k=>({id:k.id,label:k.name}))),i=Od(t.classes.map(k=>{let C=n.node(k.id);return{id:k.id,x:C.x,y:C.y,width:C.width,height:C.height}}),a,"TB",e?.collapsedNotes),s=t.classes.map(k=>{let C=n.node(k.id),v=r.get(k.id),_=i.get(k.id);return{...k,x:C.x,y:C.y,width:v.width,height:v.height,headerHeight:v.headerHeight,fieldsHeight:v.fieldsHeight,methodsHeight:v.methodsHeight,..._&&{note:_}}}),l=t.relationships.map(k=>{let C=n.edge(k.source,k.target);return{source:k.source,target:k.target,type:k.type,points:C?.points??[],...k.label!==void 0&&{label:k.label},lineNumber:k.lineNumber}}),c=1/0,d=1/0,u=-1/0,f=-1/0,m=(k,C,v,_)=>{k<c&&(c=k),C<d&&(d=C),v>u&&(u=v),_>f&&(f=_)};for(let k of s)m(k.x-k.width/2,k.y-k.height/2,k.x+k.width/2,k.y+k.height/2),k.note&&!k.note.collapsed&&m(k.x+k.note.x,k.y+k.note.y,k.x+k.note.x+k.note.width,k.y+k.note.y+k.note.height);Number.isFinite(c)||(c=0,d=0,u=0,f=0);let{shiftX:p,shiftY:h}=xl(c,d),g=p!==0||h!==0,x=g?s.map(k=>({...k,x:k.x+p,y:k.y+h})):s,y=g?l.map(k=>({...k,points:k.points.map(C=>({x:C.x+p,y:C.y+h}))})):l,b=u+p+40,w=f+h+40;return{nodes:x,edges:y,width:b,height:w}}var xst,wst,Est,kst,bP,Sst,o7,Cu,Nu,i7=dt(()=>{"use strict";$s();Ve();_s();xst=140,wst=24,Est=36,kst=13,bP=11,Sst=16,o7=18,Cu=8,Nu=1});var MP={};ue(MP,{renderClassDiagram:()=>SP,renderClassDiagramForExport:()=>Hst});function EP(t,e,n){if(n)return e.textMuted;switch(t){case"interface":return e.colors.blue;case"abstract":return e.colors.purple;case"enum":return e.colors.yellow;default:return e.colors.teal}}function Rst(t,e,n,r,o,a){let i=r??EP(n,t,o);return ee(t,i,e,{mode:a})}function Ist(t,e,n,r){return n??EP(e,t,r)}function kP(t){if(t.options?.["no-auto-color"])return[];let e=new Set;for(let n of t.classes)n.color||e.add(n.modifier??"class");return Dst.filter(n=>e.has(n)).map(n=>Pst[n])}function Ost(t){return t??"class"}function wP(t){switch(t){case"public":return"+";case"private":return"-";case"protected":return"#"}}function Gst(t){return t==="implements"||t==="depends"}function qst(t){switch(t){case"extends":return"cd-arrow-inherit";case"implements":return"cd-arrow-implement";case"composes":return"cd-arrow-compose";case"aggregates":return"cd-arrow-aggregate";case"depends":return"cd-arrow-depend";case"associates":return"cd-arrow-assoc"}}function Bst(t){return t==="composes"||t==="aggregates"}function SP(t,e,n,r,o,a,i,s,l){It(t).selectAll(":not([data-d3-tooltip])").remove();let c=i?.width??t.clientWidth,d=i?.height??t.clientHeight;if(c<=0||d<=0)return;let u=Le.identity(),f=u.aesthetic(l7),m=u.text(Lst),p=u.text(Cst),h=u.text(Nst),g=u.structural(1.5),x=u.structural(1.5),y=u.structural(Tst),b=u.structural(_st),w=u.structural(Ast),k=u.text(20),C=u.structural(30),v=u.structural(Se),_=kP(e),R=_.length>1&&!or(e.options),L=!!e.title&&e.options["no-title"]!=="on",E=L?40:0,S=u.aesthetic(8),T=R?v+S:0,N=s!==!1,I=[{name:s7,entries:_.map(F=>({value:F.label,color:r.colors[F.colorKey]}))}],G=vo(e.options),$=G&&R?cr({groups:I,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:l?"export":"preview"},{activeGroup:N?s7:null},c):{width:0,height:0},A=nr({requested:G,title:e.title??"",hasLegend:R,legendWidth:$.width,legendHeight:$.height,containerWidth:c,titleBandHeight:E,legendReserve:T,titleBaselineY:C,titleFontSize:k}),D=n.width,O=n.height,P=d-E-(A.inline?0:T),H=(c-f*2)/D,W=(P-f*2)/O,B=Math.min(vst,H,W),q=D*B,V=(c-q)/2,X=E+(A.inline?0:T)+f,z=It(t).append("svg").attr("width",c).attr("height",d).attr("viewBox",`0 0 ${c} ${d}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt);u.isBelowFloor&&z.attr("width","100%");let U=z.append("defs"),Y=12,K=8;U.append("marker").attr("id","cd-arrow-inherit").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-implement").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1);let et=12,nt=8;if(U.append("marker").attr("id","cd-arrow-compose").attr("viewBox",`0 0 ${et} ${nt}`).attr("refX",0).attr("refY",nt/2).attr("markerWidth",et).attr("markerHeight",nt).attr("orient","auto").append("polygon").attr("points",`${et/2},0 ${et},${nt/2} ${et/2},${nt} 0,${nt/2}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-aggregate").attr("viewBox",`0 0 ${et} ${nt}`).attr("refX",0).attr("refY",nt/2).attr("markerWidth",et).attr("markerHeight",nt).attr("orient","auto").append("polygon").attr("points",`${et/2},0 ${et},${nt/2} ${et/2},${nt} 0,${nt/2}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1),U.append("marker").attr("id","cd-arrow-depend").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),U.append("marker").attr("id","cd-arrow-assoc").attr("viewBox",`0 0 ${Y} ${K}`).attr("refX",Y).attr("refY",K/2).attr("markerWidth",Y).attr("markerHeight",K).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${K/2} 0,${K}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),L){let F=z.append("text").attr("class","chart-title").attr("x",A.titleX).attr("y",C).attr("text-anchor",A.titleAnchor).attr("fill",r.text).attr("font-size",k).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(F.attr("data-line-number",e.titleLineNumber),a&&F.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}if(R){let F=z.append("g").attr("class","cd-legend").attr("transform",A.inline?`translate(${A.legendX}, ${A.legendY})`:`translate(0,${E})`);tn(F,{groups:I,activeGroup:N?s7:null,mode:l?"export":"preview",position:{placement:"top-center",titleRelation:A.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:c})}let J=z.append("g").attr("transform",`translate(${V}, ${X}) scale(${B})`);for(let F of n.edges){if(F.points.length<2)continue;let j=J.append("g").attr("class","cd-edge-group").attr("data-line-number",String(F.lineNumber)).attr("data-source",F.source).attr("data-target",F.target),Q=r.textMuted,Z=qst(F.type),ot=Gst(F.type),at=Bst(F.type),lt=$st(F.points);if(lt){let rt=j.append("path").attr("d",lt).attr("fill","none").attr("stroke",Q).attr("stroke-width",g).attr("class","cd-edge");ot&&rt.attr("stroke-dasharray","6 3"),at?rt.attr("marker-start",`url(#${Z})`):rt.attr("marker-end",`url(#${Z})`)}if(F.label){let rt=Math.floor(F.points.length/2),ut=F.points[rt],tt=Tt(F.label,h)+8,it=16;j.append("rect").attr("x",ut.x-tt/2).attr("y",ut.y-it/2-1).attr("width",tt).attr("height",it).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","cd-edge-label-bg"),j.append("text").attr("x",ut.x).attr("y",ut.y+4).attr("text-anchor","middle").attr("fill",Q).attr("font-size",h).attr("class","cd-edge-label").text(F.label)}}for(let F of n.nodes){let j=J.append("g").attr("transform",`translate(${F.x}, ${F.y})`).attr("class","cd-class").attr("data-line-number",String(F.lineNumber)).attr("data-node-id",F.id).attr("data-cd-type",Ost(F.modifier));a&&j.style("cursor","pointer").on("click",()=>{a(F.lineNumber)});let Q=F.width,Z=F.height,ot=!!e.options?.["no-auto-color"],lt=R&&!N&&!F.color?r.primary:F.color,rt=mn(e.options??{}),ut=Rst(r,o,F.modifier,lt,ot,rt),tt=Ist(r,F.modifier,lt,ot),it=pe(ut,r.textOnFillLight,r.textOnFillDark);j.append("rect").attr("x",-Q/2).attr("y",-Z/2).attr("width",Q).attr("height",Z).attr("rx",3).attr("ry",3).attr("fill",ut).attr("stroke",tt).attr("stroke-width",x);let st=-Z/2,ct=st+F.headerHeight/2;if(F.modifier){let gt=`\xAB${F.modifier}\xBB`;j.append("text").attr("x",0).attr("y",ct-6).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",p).attr("font-style","italic").text(gt),j.append("text").attr("x",0).attr("y",ct+10).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",m).attr("font-weight","bold").attr("font-style",F.modifier==="abstract"?"italic":"normal").text(F.name)}else j.append("text").attr("x",0).attr("y",ct).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",it).attr("font-size",m).attr("font-weight","bold").text(F.name);st+=F.headerHeight;let pt=F.modifier==="enum",mt=F.members.filter(gt=>!gt.isMethod),bt=F.members.filter(gt=>gt.isMethod);if(pt){j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5);let gt=st+b;for(let Et of F.members)j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p).text(Et.name),gt+=y}else{if(j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5),mt.length>0){let gt=st+b;for(let Et of mt){let kt=`${wP(Et.visibility)} ${Et.name}`;Et.type&&(kt+=`: ${Et.type}`);let _t=j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p);Et.isStatic&&_t.attr("text-decoration","underline"),_t.text(kt),gt+=y}}if(st+=F.fieldsHeight,j.append("line").attr("x1",-Q/2).attr("y1",st).attr("x2",Q/2).attr("y2",st).attr("stroke",rt==="solid"?it:tt).attr("stroke-width",.5).attr("stroke-opacity",.5),bt.length>0){let gt=st+b;for(let Et of bt){let kt=`${wP(Et.visibility)} ${Et.name}(${Et.params??""})`;Et.type&&(kt+=`: ${Et.type}`);let _t=j.append("text").attr("x",-Q/2+w).attr("y",gt+y/2).attr("dominant-baseline","central").attr("fill",it).attr("font-size",p);Et.isStatic&&_t.attr("text-decoration","underline"),_t.text(kt),gt+=y}}}if(F.note)if(F.note.collapsed)ji(j,{x:Q/2-sa-3,y:-Z/2+sa+3},r,{isDark:o,...F.note.color&&{color:F.note.color},lineNumber:F.note.lineNumber,endLineNumber:F.note.endLineNumber});else{let[gt,Et,ft,kt]=Ui({width:Q,height:Z},F.note);Vi(j,gt,Et,ft,kt,r),Xi(j,{x:F.note.x,y:F.note.y,width:F.note.width,height:F.note.height},F.note.lines,r,{isDark:o,...F.note.color&&{color:F.note.color},lineNumber:F.note.lineNumber,endLineNumber:F.note.endLineNumber,interactive:!0})}}}function Hst(t,e,n){let r=Bd(t,n);if(r.error||r.classes.length===0)return"";let o=a7(r),a=e==="dark",l=kP(r).length>1&&!or(r.options)?Se+8:0,c=o.width+l7*2,d=o.height+l7*2+(r.title?40:0)+l;return bu(c,d,u=>(SP(u,r,o,n,a,void 0,{width:c,height:d},!0,!0),xu(u,e,n)))}var l7,vst,Lst,Cst,Nst,Tst,_st,Ast,Pst,Dst,s7,$st,vP=dt(()=>{"use strict";Nn();Ae();Fo();Ke();M0();pr();Mr();qr();ko();Fe();m1();i7();wr();Ve();Ki();l7=20,vst=3,Lst=13,Cst=11,Nst=11,Tst=18,_st=8,Ast=10;Pst={class:{label:"Class",colorKey:"teal"},abstract:{label:"Abstract",colorKey:"purple"},interface:{label:"Interface",colorKey:"blue"},enum:{label:"Enum",colorKey:"yellow"}},Dst=["class","abstract","interface","enum"];s7="Type";$st=lr().x(t=>t.x).y(t=>t.y).curve(To)});var CP={};ue(CP,{layoutERDiagram:()=>u7});function Kst(t){let e=Tt(t.name,Wst,{bold:!0});for(let i of t.columns){let s=i.name;i.type&&(s+=`: ${i.type}`);let l=Tt(s,zst);i.constraints.length>0&&(l+=Vst),e=Math.max(e,l)}let n=Math.max(c7,e+Fst),r=d7,o=0;t.columns.length>0&&(o=Xst*2+t.columns.length*Ust+jst);let a=r+o+(o===0?4:0);return{width:n,height:a,headerHeight:r,columnsHeight:o}}function Zst(t,e){let n=new Map;for(let a of t)n.set(a,new Set);for(let a of e)n.get(a.source)?.add(a.target),n.get(a.target)?.add(a.source);let r=new Set,o=[];for(let a of t){if(r.has(a))continue;let i=[],s=[a];for(;s.length>0;){let l=s.shift();if(!r.has(l)){r.add(l),i.push(l);for(let c of n.get(l)??[])r.has(c)||s.push(c)}}o.push(i)}return o}function Qst(t,e,n){let r=new Map,o=new Map;if(t.length===1){let d=t[0],u=n.get(d.id);return r.set(d.id,{x:u.width/2,y:u.height/2,...u}),{nodePositions:r,edgePoints:o,width:u.width,height:u.height}}let a=new dr.graphlib.Graph({multigraph:!0});a.setGraph({rankdir:"LR",nodesep:40,ranksep:80,edgesep:20}),a.setDefaultEdgeLabel(()=>({}));for(let d of t){let u=n.get(d.id);a.setNode(d.id,{width:u.width,height:u.height})}for(let d of e)a.setEdge(d.source,d.target,{label:d.label??""},String(d.lineNumber));dr.layout(a);let i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of t){let u=a.node(d.id),f=n.get(d.id);i=Math.min(i,u.x-f.width/2),s=Math.min(s,u.y-f.height/2),l=Math.max(l,u.x+f.width/2),c=Math.max(c,u.y+f.height/2)}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));for(let f of u?.points??[])i=Math.min(i,f.x),s=Math.min(s,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y);if(d.label&&(u?.points??[]).length>0){let f=u.points,m=f[Math.floor(f.length/2)],p=(Tt(d.label,Yst)+8)/2;i=Math.min(i,m.x-p),l=Math.max(l,m.x+p)}}for(let d of t){let u=a.node(d.id),f=n.get(d.id);r.set(d.id,{x:u.x-i,y:u.y-s,...f})}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));o.set(d.lineNumber,(u?.points??[]).map(f=>({x:f.x-i,y:f.y-s})))}return{nodePositions:r,edgePoints:o,width:Math.max(0,l-i),height:Math.max(0,c-s)}}function Jst(t){if(t.length===0)return[];let e=[...t].sort((l,c)=>{let d=l.compIds.length>1?1:0,u=c.compIds.length>1?1:0;return d!==u?u-d:c.compLayout.height-l.compLayout.height}),n=t.reduce((l,c)=>l+(c.compLayout.width||c7)*(c.compLayout.height||d7),0),r=Math.max(Math.sqrt(n)*1.5,e[0].compLayout.width),o=[],a=0,i=0,s=0;for(let l of e){let c=l.compLayout.width||c7,d=l.compLayout.height||d7;a>0&&a+c>r&&(i+=s+LP,a=0,s=0),o.push({compIds:l.compIds,compLayout:l.compLayout,offsetX:a,offsetY:i}),a+=c+LP,s=Math.max(s,d)}return o}function u7(t,e){if(t.tables.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new Map;for(let R of t.tables)n.set(R.id,Kst(R));let r=Zst(t.tables.map(R=>R.id),t.relationships),o=new Map(t.tables.map(R=>[R.id,R])),a=r.map(R=>{let L=R.map(M=>o.get(M)),E=t.relationships.filter(M=>R.includes(M.source));return{compIds:R,compLayout:Qst(L,E,n)}}),i=Jst(a),s=new Map;for(let R of i)for(let L of R.compIds)s.set(L,R);let l=new Map;for(let R of i)for(let L of R.compLayout.edgePoints.keys())l.set(L,R);let c=t.tables.map(R=>{let L=s.get(R.id),E=L.compLayout.nodePositions.get(R.id);return{...R,x:E.x+L.offsetX+Tu,y:E.y+L.offsetY+Tu,width:E.width,height:E.height,headerHeight:E.headerHeight,columnsHeight:E.columnsHeight}}),d=t.relationships.map(R=>{let L=l.get(R.lineNumber),E=L?.compLayout.edgePoints.get(R.lineNumber)??[];return{source:R.source,target:R.target,cardinality:R.cardinality,points:E.map(M=>({x:M.x+(L?.offsetX??0)+Tu,y:M.y+(L?.offsetY??0)+Tu})),...R.label!==void 0&&{label:R.label},lineNumber:R.lineNumber}}),f=t.options?.["no-notes"]==="on"||!t.notes?new Map:wo(t.notes,t.tables.map(R=>({id:R.id,label:R.name}))),m=Od(c.map(R=>({id:R.id,x:R.x,y:R.y,width:R.width,height:R.height})),f,"TB",e?.collapsedNotes),p=c.map(R=>{let L=m.get(R.id);return L?{...R,note:L}:R}),h=1/0,g=1/0,x=-1/0,y=-1/0,b=(R,L,E,M)=>{R<h&&(h=R),L<g&&(g=L),E>x&&(x=E),M>y&&(y=M)};for(let R of p)b(R.x-R.width/2,R.y-R.height/2,R.x+R.width/2,R.y+R.height/2),R.note&&!R.note.collapsed&&b(R.x+R.note.x,R.y+R.note.y,R.x+R.note.x+R.note.width,R.y+R.note.y+R.note.height);for(let R of d)for(let L of R.points)b(L.x,L.y,L.x,L.y);Number.isFinite(h)||(h=0,g=0,x=0,y=0);let{shiftX:w,shiftY:k}=xl(h,g),C=w!==0||k!==0,v=C?p.map(R=>({...R,x:R.x+w,y:R.y+k})):p,_=C?d.map(R=>({...R,points:R.points.map(L=>({x:L.x+w,y:L.y+k}))})):d;return{nodes:v,edges:_,width:x+w+Tu,height:y+k+Tu}}var c7,Fst,d7,Wst,zst,Yst,Vst,Ust,Xst,jst,Tu,LP,f7=dt(()=>{"use strict";$s();Ve();_s();c7=140,Fst=24,d7=36,Wst=13,zst=11,Yst=11,Vst=16,Ust=18,Xst=8,jst=1,Tu=30,LP=60});function _P(t,e){let n=new Map;if(t.length===0)return n;let r={};for(let f of t)r[f.id]=0;for(let f of e)f.source!==f.target&&(f.cardinality.from==="1"&&f.cardinality.to!=="1"&&(r[f.source]=(r[f.source]??0)+1),f.cardinality.to==="1"&&f.cardinality.from!=="1"&&(r[f.target]=(r[f.target]??0)+1));let o=new Map;for(let f of e)f.source!==f.target&&(f.cardinality.from==="*"&&(o.has(f.source)||o.set(f.source,new Set),o.get(f.source).add(f.target)),f.cardinality.to==="*"&&(o.has(f.target)||o.set(f.target,new Set),o.get(f.target).add(f.source)));let a=new Set;for(let[f,m]of o)m.size>=2&&a.add(f);let i=Object.values(r),s=i.reduce((f,m)=>f+m,0)/i.length,l=i.reduce((f,m)=>f+(m-s)**2,0)/i.length,c=Math.sqrt(l),d=[...i].sort((f,m)=>f-m),u=d.length%2===0?(d[d.length/2-1]+d[d.length/2])/2:d[Math.floor(d.length/2)];for(let f of t){let m=f.id,p=f.columns,h=p.filter(S=>S.constraints.includes("fk")),g=p.filter(S=>S.constraints.includes("pk")&&S.constraints.includes("fk")),x=h.length,y=p.length===0?0:x/p.length,b=r[m]??0,w=f.name.toLowerCase(),k=e.filter(S=>(S.source===m||S.target===m)&&S.source!==S.target),C=e.some(S=>S.source===m&&S.target===m),v=new Set;for(let S of k)v.add(S.source===m?S.target:S.source);if(C&&k.length===0){n.set(m,"self-referential");continue}let _=g.length>=2&&v.size===1,R=y>=.6&&!_,L=g.length>=2&&v.size>=2,E=a.has(m);if(R||L||E){n.set(m,"junction");continue}if(y>=.4&&y<.6&&g.length<2&&!a.has(m)){n.set(m,"ambiguous");continue}if(tlt.some(S=>w.endsWith(S))&&p.length<=6&&x<=1&&b>u){n.set(m,"lookup");continue}if(t.length>=6&&b>0&&b>s+1.5*c&&b>=2*s){n.set(m,"hub");continue}if(x>0){n.set(m,"dependent");continue}n.set(m,"core")}return n}var m7,NP,TP,tlt,AP=dt(()=>{"use strict";m7={core:"green",dependent:"blue",junction:"red",ambiguous:"purple",lookup:"yellow",hub:"orange","self-referential":"teal",unclassified:"gray"},NP={core:"Core entity",dependent:"Dependent",junction:"Junction / M:M",ambiguous:"Bridge",lookup:"Lookup / Reference",hub:"Hub","self-referential":"Self-referential",unclassified:"Unclassified"},TP=["core","dependent","junction","ambiguous","lookup","hub","self-referential","unclassified"],tlt=["_type","_status","_code","_category"]});var DP={};ue(DP,{renderERDiagram:()=>PP,renderERDiagramForExport:()=>clt});function slt(t){switch(t){case"pk":return"\u2666";case"fk":return"\u2192";case"unique":return"\u25C6";case"nullable":return"\u25CB"}}function RP(t,e,n,r,o,a,i=IP,s=1.5){let l=e.x-n.x,c=e.y-n.y,d=Math.sqrt(l*l+c*c);if(d===0)return;let u=l/d,f=c/d,m=-f,p=u,h=s+.5;if(a){let b=e.x-u*15,w=e.y-f*15,k=r==="1"?"1":r==="*"?"*":"0..1";t.append("text").attr("x",b+m*12).attr("y",w+p*12).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",o).attr("font-size",i).text(k);return}let g=14,x=9;if(r==="1"){let y=e.x-u*g,b=e.y-f*g;t.append("line").attr("x1",y+m*x).attr("y1",b+p*x).attr("x2",y-m*x).attr("y2",b-p*x).attr("stroke",o).attr("stroke-width",h)}else if(r==="*"){let w=e.x-u*18,k=e.y-f*18,C=e.x-u*5,v=e.y-f*5;t.append("line").attr("x1",w).attr("y1",k).attr("x2",C+m*x).attr("y2",v+p*x).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",w).attr("y1",k).attr("x2",C-m*x).attr("y2",v-p*x).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",w).attr("y1",k).attr("x2",C).attr("y2",v).attr("stroke",o).attr("stroke-width",h)}else if(r==="?"){let b=g+10+2,w=e.x-u*b,k=e.y-f*b;t.append("circle").attr("cx",w).attr("cy",k).attr("r",5).attr("fill","none").attr("stroke",o).attr("stroke-width",h);let C=e.x-u*g,v=e.y-f*g;t.append("line").attr("x1",C+m*x).attr("y1",v+p*x).attr("x2",C-m*x).attr("y2",v-p*x).attr("stroke",o).attr("stroke-width",h)}}function PP(t,e,n,r,o,a,i,s,l,c){It(t).selectAll(":not([data-d3-tooltip])").remove();let d=e.tagGroups.length===0&&n.nodes.every(Z=>!Z.color),u=8,f=or(e.options),m=e.tagGroups.length>0&&!f,p=!f&&(d||m)?Se+u:0,h=!!e.title&&e.options["no-title"]!=="on",g=h?40:0,x=n.width,y=n.height,b=Le.identity(),w=b.aesthetic(p7),k=b.text(nlt),C=b.text(rlt),v=b.text(IP),_=b.structural(1.5),R=b.structural(1.5),L=b.structural(olt),E=b.structural(alt),M=b.structural(ilt),S=b.text(20),T=b.structural(30),N=x+w*2,I=d?_P([...e.tables],[...e.relationships]):null,G=I!==null&&(l??!0),$=I?TP.filter(Z=>{for(let ot of I.values())if(ot===Z)return!0;return!1}):[],A=$.length>0?[{name:"Role",entries:$.map(Z=>({value:NP[Z],color:r.colors[m7[Z]]}))}]:[],D=I!==null&&!f&&$.length>0,O=vo(e.options),P=m||D,H=m?e.tagGroups:A,W=m?s??null:G?"Role":null,B=i?.width??N,q=O&&P?cr({groups:H,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:c?"export":"preview"},{activeGroup:W},B):{width:0,height:0},V=nr({requested:O,title:e.title??"",hasLegend:P,legendWidth:q.width,legendHeight:q.height,containerWidth:B,titleBandHeight:g,legendReserve:p,titleBaselineY:T,titleFontSize:S}),X=V.inline?0:p,z=y+g+X+w*2,U,Y,K,et,nt;if(i){U=i.width??N,Y=i.height??z;let Z=Y-g-X,ot=(U-w*2)/x,at=(Z-w*2)/y;K=Math.min(elt,ot,at);let lt=x*K;et=(U-lt)/2,nt=g+X+w}else U=N,Y=z,K=1,et=w,nt=g+X+w;if(U<=0||Y<=0)return;let J=It(t).append("svg").attr("width",i?U:"100%").attr("height",i?Y:"100%").attr("viewBox",`0 0 ${U} ${Y}`).attr("preserveAspectRatio","xMidYMid meet").style("font-family",Mt);if(h){let Z=J.append("text").attr("class","chart-title").attr("x",V.titleX).attr("y",T).attr("text-anchor",V.titleAnchor).attr("fill",r.text).attr("font-size",S).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(Z.attr("data-line-number",e.titleLineNumber),a&&Z.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)}))}let F=J.append("g").attr("transform",`translate(${et}, ${nt}) scale(${K})`),j=Bn(r),Q=e.options.notation==="labels";for(let Z of n.edges){if(Z.points.length<2)continue;let ot=F.append("g").attr("class","er-edge-group").attr("data-line-number",String(Z.lineNumber)).attr("data-source",Z.source).attr("data-target",Z.target),at=r.textMuted,lt=llt(Z.points);lt&&ot.append("path").attr("d",lt).attr("fill","none").attr("stroke",at).attr("stroke-width",_).attr("class","er-edge");let rt=Z.points;if(RP(ot,rt[0],rt[1],Z.cardinality.from,at,Q,v,_),RP(ot,rt[rt.length-1],rt[rt.length-2],Z.cardinality.to,at,Q,v,_),Z.label){let ut=Math.floor(rt.length/2),tt=rt[ut],it=Tt(Z.label,v)+8,st=16;ot.append("rect").attr("x",tt.x-it/2).attr("y",tt.y-st/2-1).attr("width",it).attr("height",st).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","er-edge-label-bg"),ot.append("text").attr("x",tt.x).attr("y",tt.y+4).attr("text-anchor","middle").attr("fill",at).attr("font-size",v).attr("class","er-edge-label").text(Z.label)}}for(let Z=0;Z<n.nodes.length;Z++){let ot=n.nodes[Z],at=Dn(ot.metadata,[...e.tagGroups],s??null),lt=G?r.colors[m7[I.get(ot.id)??"unclassified"]]:I?r.primary:void 0,rt=ot.color??at??lt??j[Z%j.length],ut=F.append("g").attr("transform",`translate(${ot.x}, ${ot.y})`).attr("class","er-table").attr("data-line-number",String(ot.lineNumber)).attr("data-node-id",ot.id);if(s){let gt=Bt(s),Et=ot.metadata[gt];Et&&ut.attr(`data-tag-${gt}`,Et.toLowerCase())}if(I){let gt=I.get(ot.id);gt&&ut.attr("data-er-role",gt)}a&&ut.style("cursor","pointer").on("click",()=>{a(ot.lineNumber)});let tt=ot.width,it=ot.height,st=ee(r,rt,o,{mode:mn(e.options)}),ct=rt,pt=pe(st,r.textOnFillLight,r.textOnFillDark);ut.append("rect").attr("x",-tt/2).attr("y",-it/2).attr("width",tt).attr("height",it).attr("rx",3).attr("ry",3).attr("fill",st).attr("stroke",ct).attr("stroke-width",R);let mt=-it/2,bt=mt+ot.headerHeight/2;if(ut.append("text").attr("x",0).attr("y",bt).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",pt).attr("font-size",k).attr("font-weight","bold").text(ot.name),mt+=ot.headerHeight,ot.columns.length>0){ut.append("line").attr("x1",-tt/2).attr("y1",mt).attr("x2",tt/2).attr("y2",mt).attr("stroke",ct).attr("stroke-width",.5).attr("stroke-opacity",.5);let gt=mt+E;for(let Et of ot.columns){let ft=-tt/2+M,kt=Et.constraints[0];kt&&ut.append("text").attr("x",ft).attr("y",gt+L/2).attr("dominant-baseline","central").attr("fill",pt).attr("font-size",C).text(slt(kt));let _t=-tt/2+M+(kt?16:0),yt=Et.name;Et.type&&(yt+=`: ${Et.type}`),ut.append("text").attr("x",_t).attr("y",gt+L/2).attr("dominant-baseline","central").attr("fill",pt).attr("font-size",C).text(yt),gt+=L}}if(ot.note)if(ot.note.collapsed)ji(ut,{x:tt/2-sa-3,y:-it/2+sa+3},r,{isDark:o,...ot.note.color&&{color:ot.note.color},lineNumber:ot.note.lineNumber,endLineNumber:ot.note.endLineNumber});else{let[gt,Et,ft,kt]=Ui({width:tt,height:it},ot.note);Vi(ut,gt,Et,ft,kt,r),Xi(ut,{x:ot.note.x,y:ot.note.y,width:ot.note.width,height:ot.note.height},ot.note.lines,r,{isDark:o,...ot.note.color&&{color:ot.note.color},lineNumber:ot.note.lineNumber,endLineNumber:ot.note.endLineNumber,interactive:!0})}}if(m){let Z=w+g,ot=J.append("g").attr("class","er-tag-legend").attr("transform",V.inline?`translate(${V.legendX}, ${V.legendY})`:`translate(0,${Z})`);tn(ot,{groups:e.tagGroups,activeGroup:s??null,mode:c?"export":"preview",position:{placement:"top-center",titleRelation:V.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:U}),ot.selectAll("[data-legend-group]").classed("er-legend-group",!0)}if(D){let Z=w+g,ot=J.append("g").attr("class","er-semantic-legend").attr("transform",V.inline?`translate(${V.legendX}, ${V.legendY})`:`translate(0,${Z})`);tn(ot,{groups:A,activeGroup:G?"Role":null,mode:c?"export":"preview",position:{placement:"top-center",titleRelation:V.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:U}),ot.selectAll("[data-legend-group]").classed("er-legend-group",!0)}}function clt(t,e,n){let r=Hd(t,n);if(r.error||r.tables.length===0)return"";let o=u7(r),a=e==="dark",i=document.createElement("div"),s=o.width+p7*2,l=o.height+p7*2+(r.title&&r.options["no-title"]!=="on"?40:0);i.style.width=`${s}px`,i.style.height=`${l}px`,i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i);try{PP(i,r,o,n,a,void 0,{width:s,height:l},void 0,void 0,!0);let c=i.querySelector("svg");return c?(e==="transparent"&&(c.style.background="none"),c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.style.fontFamily=Mt,Fr(c)):""}finally{document.body.removeChild(i)}}var p7,elt,nlt,rlt,IP,olt,alt,ilt,llt,OP=dt(()=>{"use strict";fi();Oe();Ae();Nn();Fo();Ke();Fe();pi();Oe();pr();qr();ko();Mr();wr();Ve();Ki();p1();f7();AP();p7=20,elt=3,nlt=13,rlt=11,IP=11,olt=18,alt=8,ilt=10;llt=lr().x(t=>t.x).y(t=>t.y).curve(To)});var dlt,Ta,Gs,qc,tm,_u,Jr,$P,GP,qP=dt(()=>{"use strict";dlt=(1+Math.sqrt(5))/2,Ta={cellPx:26,footprintCellsW:8,gapCellsX:4,gapCellsY:4,bandPx:44,boxPadPx:26,ringFrac:.22},Gs=Ta.footprintCellsW*Ta.cellPx,qc=2*Math.round(Gs/dlt/2),tm=Gs/2,_u=qc/2,Jr=3,$P=tm*Jr,GP=_u*Jr});function BP(t,e){let n=e??new Set(t.boxes.filter(d=>d.collapsed).map(d=>d.label));if(n.size===0)return{nodes:t.nodes,boxes:t.boxes,virtualBoxes:[],edges:t.edges,collapsedChildCounts:new Map};let r=t.boxes.filter(d=>n.has(d.label)),o=t.boxes.filter(d=>!n.has(d.label)),a=new Map,i=new Map;for(let d of r){i.set(d.label,d.children.length);for(let u of d.children)a.set(u,d.id)}let s=t.nodes.filter(d=>!a.has(d.id)),l=[],c=new Set;for(let d of t.edges){let u=a.get(d.sourceId)??d.sourceId,f=a.get(d.targetId)??d.targetId;if(u===f)continue;let m=`${u}|${f}|${d.label??""}|${d.heads}|${d.dashed}`;c.has(m)||(c.add(m),l.push({...d,sourceId:u,targetId:f}))}return{nodes:s,boxes:o,virtualBoxes:r,edges:l,collapsedChildCounts:i}}var HP=dt(()=>{"use strict"});var YP={};ue(YP,{SKETCH_AUTO_LAYOUT_DEFAULTS:()=>WP,layoutSketch:()=>mlt});function ult(t={}){let e=WP;return{normalizeOrigin:t.normalizeOrigin??e.normalizeOrigin,sortRootsBySource:t.sortRootsBySource??e.sortRootsBySource,resolveOverlap:t.resolveOverlap??e.resolveOverlap,groupCollisionAsRect:t.groupCollisionAsRect??e.groupCollisionAsRect,flowPlaceUnpositioned:t.flowPlaceUnpositioned??e.flowPlaceUnpositioned,avoidEdges:t.avoidEdges??e.avoidEdges}}function H0(t,e){return{c:t,r:e,w:Jr,h:Jr}}function flt(t,e){return t.c<e.c+e.w&&e.c<t.c+t.w&&t.r<e.r+e.h&&e.r<t.r+t.h}function em(t,e){for(let n of e)if(flt(t,n))return!0;return!1}function zP(t,e){if(!em(t,e))return{c:t.c,r:t.r};for(let n=1;n<=200;n++){let r=[];for(let o=-n;o<=n;o++){let a=n-Math.abs(o);r.push({c:t.c+o,r:t.r+a}),a!==0&&r.push({c:t.c+o,r:t.r-a})}r.sort((o,a)=>{let i=(o.r<t.r?2:0)+(o.c<t.c?1:0),s=(a.r<t.r?2:0)+(a.c<t.c?1:0);return i-s||o.r-a.r||o.c-a.c});for(let o of r)if(!em({...t,c:o.c,r:o.r},e))return o}return{c:t.c,r:t.r}}function FP(t,e,n,r){let o=[],a=[],i=[];for(let u of t.children){let f=e.get(u);if(!f)continue;if(f.at===null){i.push(f);continue}let m=H0(f.at.c,f.at.r),p=r.resolveOverlap?zP(m,o):{c:f.at.c,r:f.at.r};(p.c!==f.at.c||p.r!==f.at.r)&&n(f.lineNumber,f.label),o.push(H0(p.c,p.r)),a.push({node:f,c:p.c,r:p.r})}if(!r.flowPlaceUnpositioned){for(let u of i)a.push({node:u,c:0,r:0});i.length=0}let s=o.length>0?Math.max(...o.map(u=>u.r))+Jr:0,l=0,c=Math.max(Jr*3,o.length>0?Math.max(...o.map(u=>u.c))+Jr:Jr*3);for(let u of i){let f=!1;for(;!f;){let m=H0(l,s);em(m,o)||(o.push(m),a.push({node:u,c:l,r:s}),f=!0),l+=Jr,l>c&&(l=0,s+=Jr)}}let d;if(o.length===0)d={c:0,r:0,w:Jr,h:Jr};else{let u=Math.min(...o.map(h=>h.c)),f=Math.min(...o.map(h=>h.r)),m=Math.max(...o.map(h=>h.c+h.w)),p=Math.max(...o.map(h=>h.r+h.h));d={c:u,r:f,w:m-u,h:p-f}}return{children:a,extent:d}}function mlt(t,e={}){let n=[],r=(P,H)=>{n.push(At(P,`Shape "${H}" overlapped another at its authored position \u2014 moved to the nearest free slot`,"warning",Wa.OVERLAP_RESOLVED))},o=ult(e.autoLayout),a=BP(t,e.collapsedBoxes),i=new Map(a.nodes.map(P=>[P.id,P])),s=Ta.boxPadPx/tm,l=Ta.boxPadPx/_u,c=Ta.bandPx/_u,d=new Map,u=new Set;for(let P of a.boxes){let H=FP(P,i,r,o);d.set(P.id,H);for(let W of H.children)u.add(W.node.id)}let f=new Map(t.nodes.map(P=>[P.id,P])),m=()=>{},p=new Map;for(let P of a.virtualBoxes)p.set(P.id,FP(P,f,m,o));let h=Gs/tm,g=qc/_u,x=(P,H)=>{let W=p.get(P);if(W.children.length===0)return{c:H.c,r:H.r};let B=1/0,q=1/0,V=-1/0,X=-1/0;for(let Y of W.children)B=Math.min(B,Y.c),q=Math.min(q,Y.r),V=Math.max(V,Y.c+h),X=Math.max(X,Y.r+g);let z=H.c+(B+V)/2,U=H.r+(q+X)/2+(l-c)/2;return{c:Math.round(z-h/2),r:Math.round(U-g/2)}},y=[];for(let P of a.nodes)u.has(P.id)||y.push({kind:"shape",node:P});for(let P of a.virtualBoxes)y.push({kind:"virtual",box:P});for(let P of a.boxes)y.push({kind:"box",box:P});let b=P=>P.kind==="shape"?P.node.lineNumber:P.box.lineNumber,w=P=>P.kind==="shape"?P.node.at:P.box.at;o.sortRootsBySource?y.sort((P,H)=>b(P)-b(H)):y.sort((P,H)=>{let W=w(P),B=w(H);return W&&B?W.r-B.r||W.c-B.c||b(P)-b(H):W?-1:B?1:b(P)-b(H)});let k=(P,H,W)=>{if(P.kind!=="shape"&&o.groupCollisionAsRect){let B=(P.kind==="box"?d:p).get(P.box.id);return{c:H+B.extent.c-s,r:W+B.extent.r-c,w:B.extent.w+2*s,h:B.extent.h+c+l}}return H0(H,W)},C=[],v=new Map,_=[];for(let P of y){let H=w(P);if(H===null){_.push(P);continue}let W=k(P,H.c,H.r),B={c:H.c,r:H.r};if(o.resolveOverlap&&P.kind==="shape"&&em(W,C)){let q=zP(W,C);B={c:H.c+(q.c-W.c),r:H.r+(q.r-W.r)},r(P.node.lineNumber,P.node.label)}C.push(k(P,B.c,B.r)),v.set(P,B)}if(!o.flowPlaceUnpositioned){for(let P of _)C.push(k(P,0,0)),v.set(P,{c:0,r:0});_.length=0}let R=C.length>0?Math.ceil(Math.max(...C.map(P=>P.r+P.h))):0,L=0,E=Math.max(Jr*4,C.length>0?Math.ceil(Math.max(...C.map(P=>P.c+P.w))):Jr*4);for(let P of _){let H=!1;for(;!H;){let W=k(P,L,R);em(W,C)||(C.push(W),v.set(P,{c:L,r:R}),H=!0),L+=Jr,L>E&&(L=0,R+=Jr)}}let M=y.map(P=>{let H=v.get(P);return k(P,H.c,H.r)}),S=M.length>0?Math.min(...M.map(P=>P.c)):0,T=M.length>0?Math.min(...M.map(P=>P.r)):0,N=o.normalizeOrigin?S:Math.min(e.frozenOrigin?.c??S,S),I=o.normalizeOrigin?T:Math.min(e.frozenOrigin?.r??T,T),G=(P,H)=>({x:(P-N)*tm,y:(H-I)*_u}),$=[],A=[];for(let P of y){let H=v.get(P);if(P.kind==="shape"){let{x:W,y:B}=G(H.c,H.r);$.push({id:P.node.id,label:P.node.label,shape:P.node.shape,metadata:P.node.metadata,...P.node.description&&{description:P.node.description},lineNumber:P.node.lineNumber,slot:H,x:W,y:B,w:Gs,h:qc})}else if(P.kind==="virtual"){let W=x(P.box.id,H),{x:B,y:q}=G(W.c,W.r);$.push({id:P.box.id,label:P.box.label,shape:"rectangle",metadata:P.box.metadata,lineNumber:P.box.lineNumber,slot:W,x:B,y:q,w:Gs,h:qc,isCollapsedBox:!0,childCount:a.collapsedChildCounts.get(P.box.label)??0})}else{let W=d.get(P.box.id),B=1/0,q=1/0,V=-1/0,X=-1/0;for(let z of W.children){let U=G(H.c+z.c,H.r+z.r);$.push({id:z.node.id,label:z.node.label,shape:z.node.shape,metadata:z.node.metadata,...z.node.description&&{description:z.node.description},boxLabel:P.box.label,lineNumber:z.node.lineNumber,slot:{c:H.c+z.c,r:H.r+z.r},x:U.x,y:U.y,w:Gs,h:qc}),B=Math.min(B,U.x),q=Math.min(q,U.y),V=Math.max(V,U.x+Gs),X=Math.max(X,U.y+qc)}if(B===1/0){let z=G(H.c,H.r);B=z.x,q=z.y+Ta.bandPx,V=z.x+Gs,X=q}A.push({id:P.box.id,label:P.box.label,metadata:P.box.metadata,lineNumber:P.box.lineNumber,x:B-Ta.boxPadPx,y:q-Ta.bandPx,w:V-B+2*Ta.boxPadPx,h:X-q+Ta.bandPx+Ta.boxPadPx,bandH:Ta.bandPx})}}if(o.avoidEdges){let P=new Set;for(let q of y)w(q)!==null&&P.add(q.kind==="shape"?q.node.id:q.box.id);let H=q=>{let V=$.find(z=>z.id===q);if(V)return{x:V.x+V.w/2,y:V.y+V.h/2};let X=A.find(z=>z.id===q);return X?{x:X.x+X.w/2,y:X.y+X.h/2}:null},W=(q,V,X,z,U,Y,K,et)=>{let nt=0,J=1,F=[-(X-q),X-q,-(z-V),z-V],j=[q-U,K-q,V-Y,et-V];for(let Q=0;Q<4;Q++)if(F[Q]===0){if(j[Q]<0)return!1}else{let Z=j[Q]/F[Q];if(F[Q]<0){if(Z>J)return!1;Z>nt&&(nt=Z)}else{if(Z<nt)return!1;Z<J&&(J=Z)}}return nt<=J},B=new Set;for(let q=0;q<4;q++){let V=!1;for(let X of $)if(!X.boxLabel&&!P.has(X.id))for(let z of a.edges){if(z.sourceId===X.id||z.targetId===X.id)continue;let U=H(z.sourceId),Y=H(z.targetId);if(!U||!Y||!W(U.x,U.y,Y.x,Y.y,X.x,X.y,X.x+X.w,X.y+X.h))continue;let K=X.x+X.w/2,et=X.y+X.h/2,nt=X;if(Math.abs(Y.x-U.x)>=Math.abs(Y.y-U.y)){let J=U.y+(Y.y-U.y)*(K-U.x)/(Y.x-U.x||1),F=et>=J?1:-1;X.slot.r+F*Jr<0&&(F=1),nt.y+=F*GP,nt.slot={c:X.slot.c,r:X.slot.r+F*Jr}}else{let J=U.x+(Y.x-U.x)*(et-U.y)/(Y.y-U.y||1),F=K>=J?1:-1;X.slot.c+F*Jr<0&&(F=1),nt.x+=F*$P,nt.slot={c:X.slot.c+F*Jr,r:X.slot.r}}B.has(X.id)||(r(X.lineNumber,X.label),B.add(X.id)),V=!0;break}if(!V)break}}let D=0,O=0;for(let P of $)D=Math.max(D,P.x+P.w),O=Math.max(O,P.y+P.h);for(let P of A)D=Math.max(D,P.x+P.w),O=Math.max(O,P.y+P.h);return{nodes:$,boxes:A,edges:a.edges,width:D,height:O,diagnostics:n,origin:{c:N,r:I}}}var WP,VP=dt(()=>{"use strict";Je();Y5();qP();HP();WP={normalizeOrigin:!1,sortRootsBySource:!1,resolveOverlap:!0,groupCollisionAsRect:!0,flowPlaceUnpositioned:!0,avoidEdges:!0}});function UP(t,e){return Tt(t.text,e,{bold:t.bold})}function blt(t){let e=[],n=/\*\*(.+?)\*\*|\[([^\]]*)\]\(([^)]*)\)|((?:(?!\*\*|\[).)+)/gs,r;for(;(r=n.exec(t))!==null;)r[1]!==void 0?e.push({text:r[1],bold:!0}):r[2]!==void 0?e.push({text:r[2],bold:!1,...r[3]&&{href:r[3]}}):r[4]!==void 0&&e.push({text:r[4],bold:!1});return e}function xlt(t){let e=[],n=[];for(let r of t){let o=r.text.split(/(\s+)/);for(let a of o)a!==""&&(/^\s+$/.test(a)?n.length>0&&(e.push(n),n=[]):n.push({text:a,bold:r.bold,...r.href!==void 0&&{href:r.href}}))}return n.length>0&&e.push(n),e}function wlt(t,e){let n=0;for(let r of t)n+=UP(r,e);return n}function Elt(t){let e=[];for(let n of t){let r=e[e.length-1];r?.bold===n.bold&&r.href===n.href?r.text+=n.text:e.push({text:n.text,bold:n.bold,...n.href!==void 0&&{href:n.href}})}return e}function klt(t,e,n,r,o){let a=xlt(t);if(a.length===0)return[{segments:[],x:r,...o!==void 0&&{bulletX:o}}];let i=Tt(" ",e),s=[],l=[],c=0,d=!0,u=()=>{s.push({segments:Elt(l),x:r,...d&&o!==void 0&&{bulletX:o}}),d=!1,l=[],c=0};for(let f of a){let m=wlt(f,e),p=l.length===0?m:i+m;l.length>0&&c+p>n?(u(),l.push(...f),c=m):(l.length>0&&(l.push({text:" ",bold:!1}),c+=i),l.push(...f),c+=m)}return u(),s}function Slt(t){let e=0,n=0,r=0;for(;e<t.length;){let i=t[e];if(i===" ")n+=1,e+=1,r=0;else if(i===" ")r+=1,e+=1,r===2&&(n+=1,r=0);else break}let o=t.slice(e),a=!1;return(o.startsWith("- ")||o.startsWith("* "))&&(a=!0,o=o.slice(2)),{level:n,bullet:a,content:o}}function XP(t,e,n){let{width:r,fontSize:o,lineHeight:a,color:i,linkColor:s,maxLines:l}=n,c=[];for(let f of e.split(`
|
|
290
290
|
`)){let{level:m,bullet:p,content:h}=Slt(f),g=m*plt,x=p?g+hlt:g,y=Math.max(1,r-x),b=blt(h),w=klt(b,o,y,x,p?g:void 0);c.push(...w)}let d=c,u=!1;l!==void 0&&c.length>l&&(d=c.slice(0,l),u=!0);for(let f=0;f<d.length;f++){let m=d[f],p=o+f*a,h=f===d.length-1;m.bulletX!==void 0&&t.append("text").attr("x",m.bulletX).attr("y",p).attr("fill",i).attr("font-size",o).text(ylt);let g=t.append("text").attr("x",m.x).attr("y",p).attr("font-size",o),x=m.x,y=m.segments.slice();u&&h&&!n.noEllipsis&&y.push({text:glt,bold:!1});for(let b of y){let w=g.append("tspan").attr("x",x).attr("fill",b.href!==void 0?s:i).text(b.text);b.bold&&w.attr("font-weight","bold");let k=UP(b,o);b.href!==void 0&&(w.attr("data-href",b.href),t.append("line").attr("x1",x).attr("y1",p+1.5).attr("x2",x+k).attr("y2",p+1.5).attr("stroke",s).attr("stroke-width",1)),x+=k}}return{height:d.length*a,shown:d.length,total:c.length}}var plt,hlt,glt,ylt,jP=dt(()=>{"use strict";Ve();plt=12,hlt=12,glt="\u2026",ylt="\u2022"});var cD={};ue(cD,{renderSketch:()=>iD,renderSketchForExport:()=>Hlt,sketchEdgeGeometry:()=>lD});function Rlt(t,e,n,r){t.append("path").attr("d",`M0 2 a2 2 0 0 1 2 -2 h${e-14-2} l14 14 v${n-14-2} a2 2 0 0 1 -2 2 h-${e-4} a2 2 0 0 1 -2 -2 Z`).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",z0),t.append("path").attr("d",`M${e-14} 0 v14 h14`).attr("fill","none").attr("stroke",r.stroke).attr("stroke-width",1.2)}function QP(t,e,n,r,o){let a=t.append("g").attr("transform",`translate(${r},${o})`).attr("fill","none").attr("stroke",n).attr("stroke-width",1.3).attr("stroke-linejoin","round").attr("stroke-linecap","round");switch(e){case"database":a.append("ellipse").attr("cx",8).attr("cy",3).attr("rx",6).attr("ry",2.4),a.append("path").attr("d","M2 3 v10 a6 2.4 0 0 0 12 0 v-10");return;case"queue":a.append("path").attr("d","M3 1 h8 a3 6.5 0 0 1 0 13 h-8 Z"),a.append("ellipse").attr("cx",3).attr("cy",7.5).attr("rx",3).attr("ry",6.5);return;case"document":a.append("path").attr("d","M2 1 h9 v11 q-4.5 2 -9 0 q0 0 0 0 Z");return;case"person":a.append("circle").attr("cx",8).attr("cy",5).attr("r",3),a.append("path").attr("d","M2 15 a6 5 0 0 1 12 0");return;default:return}}function y7(t,e,n=aD,r=g7,o=2){let a={hardBreak:!0,bold:!0};for(let c=n;c>=r;c--){let d=hn(t,c,e,a);if(d.length<=o)return{lines:d,fontSize:c}}let i=hn(t,r,e,a);if(i.length<=o)return{lines:i,fontSize:r};let s=i.slice(0,o),l=s[o-1];for(;l.length>1&&Tt(`${l}\u2026`,r,{bold:!0})>e;)l=l.slice(0,-1);return s[o-1]=`${l}\u2026`,{lines:s,fontSize:r}}function iD(t,e,n,r,o,a={}){let{activeTagGroup:i,exportMode:s=!1,hideDescriptions:l=!1,splitCardIds:c}=a,d=l||e.options.noDescriptions,u=e.options.fillMode==="outline"?Ie(r,o):vt(r.textMuted,r.bg,12),f=[...e.tagGroups],m=mr(f,void 0,i),p=m===null?null:Bt(m),h=(K,et=!1)=>{let J=p!==null&&K[p]!==void 0?Dn(K,f,m,et):void 0;if(!J)return{fill:u,stroke:r.textMuted,text:r.text};let F=ee(r,J,o,{mode:e.options.fillMode});return{fill:F,stroke:J,text:e.options.fillMode==="solid"?pe(F,r.textOnFillLight,r.textOnFillDark):J}},g=!!e.title,x=g?40:0,y=e.options.noLegend?[]:f,b=lD(n),w=0,k=0,C=n.width,v=n.height;for(let K=0;K<b.length;K++){let et=b[K];if(!et)continue;let nt=(et.d.match(/-?[\d.]+/g)??[]).map(Number);for(let F=0;F+1<nt.length;F+=2)w=Math.min(w,nt[F]),C=Math.max(C,nt[F]),k=Math.min(k,nt[F+1]),v=Math.max(v,nt[F+1]);let J=n.edges[K]?.label;if(J){let F=Tt(J,nm)/2+6,j=nm/2+4;w=Math.min(w,et.mid.x-F),C=Math.max(C,et.mid.x+F),k=Math.min(k,et.mid.y-j),v=Math.max(v,et.mid.y+j)}}let _=Math.max(0,-w),R=Math.max(0,-k),E=C+_+2*F0,M=Math.max(E,a.exportDims?.width??0),S=y.length>0?ir({groups:y,position:{placement:"top-center",titleRelation:"below-title"},mode:s?"export":"preview"},M):0,T=y.length>0,N=e.options.legendInline===!0,I=N&&T?cr({groups:y,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:s?"export":"preview",showInactivePills:!0},{activeGroup:m},M):{width:0,height:0},G=nr({requested:N,title:e.title??"",hasLegend:T,legendWidth:I.width,legendHeight:I.height,containerWidth:M,titleBandHeight:x,legendReserve:S,titleBaselineY:KP,titleFontSize:ZP}),$=x+(G.inline?0:S)+F0+R,A=Math.max($+v+F0,a.exportDims?.height??0);It(t).selectAll("*").remove();let D=It(t).append("svg").attr("width",M).attr("height",A).attr("viewBox",`0 0 ${M} ${A}`).style("font-family",Mt),O=D.append("defs"),P=K=>{if(p!==null&&K[p]!==void 0){let et=Dn(K,f,m);if(et&&et!=="#999999")return et}return r.textMuted},H=K=>P(K.metadata),W=new Set(n.edges.map(K=>H(K)));for(let K of W){let et=K.replace("#","");O.append("marker").attr("id",`sk-arrow-${et}`).attr("viewBox",`0 0 ${$l} ${rs}`).attr("refX",$l).attr("refY",rs/2).attr("markerWidth",$l).attr("markerHeight",rs).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("polygon").attr("points",`0,0 ${$l},${rs/2} 0,${rs}`).attr("fill",K),O.append("marker").attr("id",`sk-arrow-rev-${et}`).attr("viewBox",`0 0 ${$l} ${rs}`).attr("refX",0).attr("refY",rs/2).attr("markerWidth",$l).attr("markerHeight",rs).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("polygon").attr("points",`${$l},0 0,${rs/2} ${$l},${rs}`).attr("fill",K)}if(g&&D.append("text").attr("class","chart-title").attr("x",G.titleX).attr("y",KP).attr("text-anchor",G.titleAnchor).attr("font-size",ZP).attr("font-weight",700).attr("fill",r.text).text(e.title),y.length>0){let K=D.append("g").attr("transform",G.inline?`translate(${G.legendX}, ${G.legendY})`:`translate(0,${x+4})`);tn(K,{groups:y,...m!==null&&{activeGroup:m},mode:s?"export":"preview",showInactivePills:!0,position:{placement:"top-center",titleRelation:G.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:M}),K.selectAll("[data-legend-group]").classed("sk-legend-group",!0)}let B=F0+_+Math.max(0,(M-E)/2),q=D.append("g").attr("class","sk-root").attr("transform",`translate(${B},${$})`),V=q.append("g").attr("class","sk-boxes");for(let K of n.boxes)Plt(V,K,h(K.metadata,!0),r);let X=q.append("g").attr("class","sk-edges"),z=[];for(let K=0;K<n.edges.length;K++){let et=n.edges[K],nt=b[K];if(!nt)continue;let J=H(et),F=J.replace("#",""),{d:j,mid:Q}=nt,Z=X.append("g").attr("class","sk-edge-group").attr("data-from",et.sourceId).attr("data-to",et.targetId).attr("data-line-number",et.lineNumber),ot=Z.append("path").attr("d",nt.dRender??j).attr("fill","none").attr("stroke",J).attr("stroke-width",Mlt);et.dashed&&ot.attr("stroke-dasharray",Llt),(et.heads==="one"||et.heads==="both")&&ot.attr("marker-end",`url(#sk-arrow-${F})`),et.heads==="both"&&ot.attr("marker-start",`url(#sk-arrow-rev-${F})`),Z.append("path").attr("class","sk-edge-hit").attr("d",j).attr("fill","none").attr("stroke","transparent").attr("stroke-width",vlt).attr("stroke-linecap","round").attr("pointer-events","stroke"),et.label&&z.push({x:Q.x,y:Q.y,text:et.label,color:J,from:et.sourceId,to:et.targetId,ei:K,cp:(j.match(/-?[\d.]+/g)??[]).map(Number)})}{let K=at=>at.length*nm*.56,et=nm/2+3,nt=4,J=[...n.nodes.map(at=>({x:at.x,y:at.y,w:at.w,h:at.h})),...n.boxes.map(at=>({x:at.x,y:at.y,w:at.w,h:at.h}))],F=(at,lt)=>{let rt=1-lt,ut=rt*rt*rt,tt=3*rt*rt*lt,it=3*rt*lt*lt,st=lt*lt*lt;return{x:ut*at[0]+tt*at[2]+it*at[4]+st*at[6],y:ut*at[1]+tt*at[3]+it*at[5]+st*at[7]}},j=b.map(at=>{if(!at)return null;let lt=(at.d.match(/-?[\d.]+/g)??[]).map(Number);if(lt.length<8)return null;let rt=[];for(let ut=0;ut<=32;ut++)rt.push(F(lt,ut/32));return rt}),Q=(at,lt,rt,ut,tt,it,st)=>Math.abs(at-ut)<rt+it+nt&&Math.abs(lt-tt)<et+st+nt,Z=[],ot=[.5,.4,.6,.32,.68,.25,.75,.18,.82];for(let at of z){let lt=K(at.text)/2+3,rt=.5,ut=1/0;for(let it of ot){let st=F(at.cp,it),ct=0;for(let gt of Z)Q(st.x,st.y,lt,gt.x,gt.y,gt.hw,et)&&ct++;let pt=0;for(let gt of J)Q(st.x,st.y,lt,gt.x+gt.w/2,gt.y+gt.h/2,gt.w/2,gt.h/2)&&pt++;let mt=0;for(let gt=0;gt<j.length;gt++){if(gt===at.ei)continue;j[gt]?.some(ft=>Q(st.x,st.y,lt,ft.x,ft.y,0,0))&&mt++}if(ct===0&&pt===0&&mt===0){rt=it;break}let bt=ct*10+pt*6+mt*4+Math.abs(it-.5);bt<ut&&(ut=bt,rt=it)}let tt=F(at.cp,rt);at.x=tt.x,at.y=tt.y,Z.push({x:tt.x,y:tt.y,hw:lt})}}let U=q.append("g").attr("class","sk-nodes");for(let K of n.nodes){let et=K;d&&K.description&&(et={...K},delete et.description),Dlt(U,et,h(K.metadata),r,o,!d&&(c?.includes(K.id)??!1))}let Y=q.append("g").attr("class","sk-edge-labels");for(let K of z)Y.append("g").attr("class","sk-edge-label").attr("data-from",K.from).attr("data-to",K.to).append("text").attr("x",K.x).attr("y",K.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",nm).attr("fill",K.color).attr("stroke",r.bg).attr("stroke-width",3).attr("stroke-linejoin","round").attr("paint-order","stroke").text(K.text);if(a.onClickItem){let K=a.onClickItem;D.selectAll("[data-line-number]").on("click",function(){let et=Number(this.getAttribute("data-line-number"));Number.isFinite(et)&&et>0&&K(et)})}}function Plt(t,e,n,r){let o=t.append("g").attr("class","sk-box").attr("data-node-id",e.id).attr("data-group-toggle",e.label).attr("data-line-number",e.lineNumber);o.append("rect").attr("x",e.x).attr("y",e.y).attr("width",e.w).attr("height",e.h).attr("rx",8).attr("fill",n.fill).attr("fill-opacity",.4).attr("stroke",n.stroke).attr("stroke-opacity",.7).attr("stroke-width",z0);let a=y7(e.label,e.w-16,Clt,12,2),i=a.fontSize*1.2,l=e.y+e.bandH/2-(a.lines.length-1)*i/2;for(let c=0;c<a.lines.length;c++)o.append("text").attr("x",e.x+e.w/2).attr("y",l+c*i).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",a.fontSize).attr("font-weight",800).attr("fill",r.text).attr("opacity",Nlt).text(a.lines[c])}function Dlt(t,e,n,r,o,a){let i=t.append("g").attr("class",e.isCollapsedBox?"sk-node sk-box-collapsed":"sk-node").attr("transform",`translate(${e.x},${e.y})`).attr("data-node-id",e.id).attr("data-line-number",e.lineNumber);for(let[s,l]of Object.entries(e.metadata))i.attr(`data-tag-${s}`,l);if(e.isCollapsedBox&&i.attr("data-group-toggle",e.label),e.shape==="note"){Rlt(i,e.w,e.h,n);let s=hn(e.label,h7,e.w-34),l=h7+4;s.slice(0,5).forEach((c,d)=>{i.append("text").attr("x",10).attr("y",20+d*l).attr("font-size",h7).attr("fill",n.text).text(c)})}else{let s=e.shape!=="rectangle",l=s?22:0,d=n.stroke===n.fill?n.text:n.stroke;if(!e.isCollapsedBox&&(e.description||a)){let f=y7(e.label,e.w-24-l,aD,g7,1);if(Os(i,{width:e.w,height:e.h,rx:6,fill:n.fill,stroke:n.stroke,strokeWidth:z0,label:f.lines[0]??e.label,labelColor:n.text,labelFontSize:f.fontSize,headerHeight:Bc}),i.append("line").attr("x1",0).attr("y1",Bc).attr("x2",e.w).attr("y2",Bc).attr("stroke",d).attr("stroke-opacity",.3).attr("stroke-width",1),e.description){let h=JP+4,g=e.h-Bc-8-8,x=i.append("g").attr("class","sk-desc").attr("transform",`translate(12 ${Bc+8})`),y=XP(x,e.description,{width:e.w-24,fontSize:JP,lineHeight:h,color:n.text,linkColor:n.text,maxLines:Math.max(1,Math.floor(g/h)),noEllipsis:!0});y.total>y.shown&&i.append("text").attr("class","sk-desc-more").attr("x",e.w-8).attr("y",e.h-5).attr("text-anchor","end").attr("font-size",9).attr("fill",r.textMuted).attr("data-line-number",e.lineNumber).style("cursor","pointer").text(`+${y.total-y.shown} more in source`)}s&&QP(i,e.shape,n.text,10,(Bc-16)/2);return}let u=y7(e.label,e.w-24-l,Ilt,g7,3);Os(i,{width:e.w,height:e.h,rx:6,fill:n.fill,stroke:n.stroke,strokeWidth:z0,label:u.lines.join(" "),labelLines:u.lines,labelColor:n.text,labelFontSize:u.fontSize,headerHeight:e.h}),s&&QP(i,e.shape,n.text,10,(Bc-16)/2)}e.isCollapsedBox&&H1(i,{width:e.w,height:e.h,barHeight:Tlt,inset:0,rx:6,fill:n.stroke===r.textMuted?r.textMuted:n.stroke,clipId:`sk-clip-${e.id.replace(/[^a-zA-Z0-9_-]/g,"")}-${e.lineNumber}`,className:"sk-collapse-bar"})}function Olt(t,e){let n=a=>a.x+a.w/2,r=a=>a.y+a.h/2,o=(a,i)=>Math.abs(a)>=Math.abs(i)?a>=0?"R":"L":i>=0?"B":"T";return t.map(a=>{let i=e.get(a.sourceId),s=e.get(a.targetId);if(!i||!s)return null;let l=n(s)-n(i),c=r(s)-r(i),d=Math.min(i.x+i.w,s.x+s.w)-Math.max(i.x,s.x),u=Math.min(i.y+i.h,s.y+s.h)-Math.max(i.y,s.y);if(d>=0&&d>=u){let f=c>=0;return{s:f?"B":"T",t:f?"T":"B"}}if(u>=0&&u>=d){let f=l>=0;return{s:f?"R":"L",t:f?"L":"R"}}return{s:o(l,c),t:o(-l,-c)}})}function tD(t,e,n,r,o,a){let i=t.x+t.w/2,s=t.y+t.h/2,l=e.x+e.w/2,c=e.y+e.h/2,d=(k,C,v)=>Math.max(C,Math.min(v,k)),u=(k,C)=>k.reduce((v,_)=>Math.abs(_-C)<Math.abs(v-C)?_:v,k[0]),f=(k,C,v,_)=>{if(k==="L"||k==="R"){let E=k==="L"?C.x:C.x+C.w,M=v?d(u(v.ys,_.y),C.y,C.y+C.h):C.y+C.h/2;return{x:E,y:M}}let R=k==="T"?C.y:C.y+C.h;return{x:v?d(u(v.xs,_.x),C.x,C.x+C.w):C.x+C.w/2,y:R}},m=k=>k==="L"?{x:-1,y:0}:k==="R"?{x:1,y:0}:k==="T"?{x:0,y:-1}:{x:0,y:1},p=f(n,t,o,{x:l,y:c}),h=f(r,e,a,{x:i,y:s}),g=m(n),x=m(r),y=Math.max(_lt,Math.min(Alt,Math.hypot(h.x-p.x,h.y-p.y)/2)),b={x:p.x+g.x*y,y:p.y+g.y*y},w={x:h.x+x.x*y,y:h.y+x.y*y};return{d:`M ${p.x} ${p.y} C ${b.x} ${b.y}, ${w.x} ${w.y}, ${h.x} ${h.y}`,mid:{x:.125*p.x+.375*b.x+.375*w.x+.125*h.x,y:.125*p.y+.375*b.y+.375*w.y+.125*h.y},p0:p,h0:b,h1:w,p1:h}}function b7(t,e){let n=1-e,r=n*n*n,o=3*n*n*e,a=3*n*e*e,i=e*e*e;return{x:r*t.p0.x+o*t.h0.x+a*t.h1.x+i*t.p1.x,y:r*t.p0.y+o*t.h0.y+a*t.h1.y+i*t.p1.y}}function oD(t){let e=[];for(let n=0;n<=rD;n++)e.push(b7(t,n/rD));return e}function sD(t,e,n,r){let o=(c,d,u)=>(d.x-c.x)*(u.y-c.y)-(d.y-c.y)*(u.x-c.x),a=o(t,e,n),i=o(t,e,r),s=o(n,r,t),l=o(n,r,e);return(a>0&&i<0||a<0&&i>0)&&(s>0&&l<0||s<0&&l>0)}function $lt(t,e){let n=0;for(let r=0;r+1<t.length;r++)for(let o=0;o+1<e.length;o++)sD(t[r],t[r+1],e[o],e[o+1])&&n++;return n}function Glt(t,e){for(let n=0;n+1<t.length;n++){let r=t[n],o=t[n+1];for(let a=0;a+1<e.length;a++){let i=e[a],s=e[a+1];if(!sD(r,o,i,s))continue;let l=o.x-r.x,c=o.y-r.y,d=s.x-i.x,u=s.y-i.y,f=l*u-c*d;if(f===0)continue;let m=((i.x-r.x)*u-(i.y-r.y)*d)/f;return{x:r.x+m*l,y:r.y+m*c}}}return null}function qlt(t,e){if(e.length===0)return null;let n=49,r=[];for(let i=0;i<=n;i++)r.push(b7(t,i/n));let o=new Map;for(let i of e){let s=-1,l=1/0,c=null;for(let d=1;d<=n;d++){let u=r[d-1],f=r[d],m=f.x-u.x,p=f.y-u.y,h=m*m+p*p||1,g=((i.x-u.x)*m+(i.y-u.y)*p)/h;g=Math.max(0,Math.min(1,g));let x=u.x+g*m,y=u.y+g*p,b=Math.hypot(i.x-x,i.y-y);b<l&&(l=b,s=d,c={x,y})}s>=3&&s<=n-3&&c&&!o.has(s)&&o.set(s,c)}if(o.size===0)return null;let a=`M ${r[0].x} ${r[0].y}`;for(let i=1;i<=n;i++){let s=r[i-1],l=r[i],c=o.get(i);if(c){let d=Math.hypot(l.x-s.x,l.y-s.y)||1,u={x:(l.x-s.x)/d,y:(l.y-s.y)/d},f={x:u.y,y:-u.x};f.y>0&&(f={x:-f.x,y:-f.y});let m={x:c.x-u.x*Gl,y:c.y-u.y*Gl},p={x:c.x+u.x*Gl,y:c.y+u.y*Gl},h={x:m.x+f.x*Gl*1.33,y:m.y+f.y*Gl*1.33},g={x:p.x+f.x*Gl*1.33,y:p.y+f.y*Gl*1.33};a+=` L ${m.x} ${m.y} C ${h.x} ${h.y}, ${g.x} ${g.y}, ${p.x} ${p.y} L ${l.x} ${l.y}`}else a+=` L ${l.x} ${l.y}`}return a}function Blt(t,e){if(e.length===0)return 0;let n=0;for(let r=1;r<nD;r++){let o=b7(t,r/nD);for(let a of e){let i=a.x+W0,s=a.y+W0,l=a.x+a.w-W0,c=a.y+a.h-W0;if(o.x>=i&&o.x<=l&&o.y>=s&&o.y<=c){n++;break}}}return n}function lD(t,e){let n=T=>e?.get(T)??{dx:0,dy:0},r=new Map;for(let T of t.nodes){let N=n(T.id);r.set(T.id,{x:T.x+N.dx,y:T.y+N.dy,w:T.w,h:T.h})}for(let T of t.boxes){let N=n(T.id);r.set(T.id,{x:T.x+N.dx,y:T.y+N.dy,w:T.w,h:T.h})}let o=new Map;for(let T of t.boxes){let N=n(T.id),I=t.nodes.filter(A=>A.boxLabel===T.label),G=I.map(A=>A.y+n(A.id).dy+A.h/2),$=I.map(A=>A.x+n(A.id).dx+A.w/2);G.push(T.y+N.dy+T.h/2),$.push(T.x+N.dx+T.w/2),o.set(T.id,{ys:G,xs:$})}let a=Olt(t.edges,r),i=new Map;for(let T of t.boxes)i.set(T.label,T.id);let s=T=>{let N=t.nodes.find(I=>I.id===T);return N?.boxLabel?i.get(N.boxLabel):void 0},l=[];for(let[T,N]of r)l.push({id:T,rect:N});let c=T=>T==="L"?{x:-1,y:0}:T==="R"?{x:1,y:0}:T==="T"?{x:0,y:-1}:{x:0,y:1},d=(T,N,I)=>{let G=N.x+N.w/2-(T.x+T.w/2),$=N.y+N.h/2-(T.y+T.h/2),A=Math.hypot(G,$)||1,D=c(I);return 1-(D.x*G+D.y*$)/A},u=2.6,f=(T,N,I)=>u*Math.max(0,d(T,N,I)-1),m=t.edges.map(T=>{let N=r.get(T.sourceId),I=r.get(T.targetId);if(!N||!I)return null;let G=new Set([T.sourceId,T.targetId,s(T.sourceId),s(T.targetId)].filter($=>$!==void 0));return{source:N,target:I,sPorts:o.get(T.sourceId),tPorts:o.get(T.targetId),obstacleRects:l.filter($=>!G.has($.id)).map($=>$.rect),adjacent:new Set}});for(let T=0;T<t.edges.length;T++)for(let N=T+1;N<t.edges.length;N++){let I=t.edges[T],G=t.edges[N];(I.sourceId===G.sourceId||I.sourceId===G.targetId||I.targetId===G.sourceId||I.targetId===G.targetId)&&(m[T]?.adjacent.add(N),m[N]?.adjacent.add(T))}let p=100,h=8,g=1.5,x=.6,y=T=>o.has(T),b=(T,N,I)=>{let G=t.edges[T],$=0;for(let A=0;A<t.edges.length;A++){if(A===T)continue;let D=t.edges[A],O=L[A];!y(G.sourceId)&&D.targetId===G.sourceId&&D.sourceId!==G.targetId&&O.t===N&&$++,!y(G.targetId)&&D.sourceId===G.targetId&&D.targetId!==G.sourceId&&O.s===I&&$++}return $},w=(T,N,I)=>{let G=t.edges[T];if(y(G.targetId))return 0;let $=0;for(let A=0;A<t.edges.length;A++){if(A===T)continue;let D=t.edges[A];D.targetId===G.targetId&&D.sourceId!==G.sourceId&&L[A].t===I&&$++}return $},k=.55,C=1.8,v=.35,_=T=>{let N=0,I=0,G=0;for(let $=1;$<T.length-1;$++){let A=T[$].x-T[$-1].x,D=T[$].y-T[$-1].y,O=T[$+1].x-T[$].x,P=T[$+1].y-T[$].y,H=A*P-D*O,W=A*O+D*P;if(A===0&&D===0||O===0&&P===0)continue;N+=Math.abs(Math.atan2(H,W));let B=H>1e-6?1:H<-1e-6?-1:0;B!==0&&(G!==0&&B!==G&&I++,G=B)}return N*k+I*C},R=(T,N,I,G,$,A,D)=>{let O=0;for(let P=0;P<$.length;P++){if(P===G||T.adjacent.has(P))continue;let H=$[P];H&&(O+=$lt(I,H))}return Blt(N,T.obstacleRects)*p+O*h+b(G,A,D)*g+w(G,A,D)*x+_(I)+d(T.source,T.target,A)+d(T.target,T.source,D)+f(T.source,T.target,A)+f(T.target,T.source,D)},L=t.edges.map((T,N)=>a[N]??{s:"R",t:"L"}),E=m.map((T,N)=>T?tD(T.source,T.target,L[N].s,L[N].t,T.sPorts,T.tPorts):null),M=E.map(T=>T?oD(T):null);for(let T=0;T<3;T++){let N=!1;for(let I=0;I<m.length;I++){let G=m[I],$=E[I],A=M[I];if(!G||!$||!A)continue;let D=L[I],O=R(G,$,A,I,M,D.s,D.t);if(O<h&&b(I,D.s,D.t)===0&&w(I,D.s,D.t)===0&&_(A)<v&&f(G.source,G.target,D.s)===0&&f(G.target,G.source,D.t)===0)continue;let P=O,H=$,W=A,B=D;for(let q of eD)for(let V of eD){let X=tD(G.source,G.target,q,V,G.sPorts,G.tPorts),z=oD(X),U=R(G,X,z,I,M,q,V);U<P&&(P=U,H=X,W=z,B={s:q,t:V})}B!==D&&(L[I]=B,E[I]=H,M[I]=W,N=!0)}if(!N)break}let S=t.edges.map(()=>[]);for(let T=0;T<M.length;T++)for(let N=T+1;N<M.length;N++){if(m[T]?.adjacent.has(N))continue;let I=M[T],G=M[N];if(!I||!G)continue;let $=Glt(I,G);$&&S[N].push($)}return t.edges.map((T,N)=>{let I=E[N];if(!I)return null;let G=qlt(I,S[N]);return{sourceId:T.sourceId,targetId:T.targetId,d:I.d,mid:I.mid,...G&&{dRender:G}}})}function Hlt(t,e,n,r,o,a={}){iD(t,e,n,r,o,{...a,exportMode:a.exportMode??!0})}var F0,KP,ZP,z0,Mlt,vlt,$l,rs,Llt,Clt,Nlt,h7,Tlt,nm,_lt,Alt,Bc,aD,g7,JP,Ilt,eD,W0,nD,rD,Gl,dD=dt(()=>{"use strict";Nn();Ke();Fe();F1();jP();qr();Mr();ko();Oe();Ve();F0=20,KP=32,ZP=18,z0=2,Mlt=2,vlt=18,$l=18,rs=12,Llt="6 3",Clt=19,Nlt=.55,h7=11,Tlt=4,nm=12,_lt=24,Alt=90;Bc=34,aD=15,g7=11,JP=12,Ilt=30;eD=["T","B","L","R"];W0=6,nD=24,rD=19;Gl=7});var bD={};ue(bD,{renderBoxesAndLines:()=>yD,renderBoxesAndLinesForExport:()=>nct});function Zlt(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t[r-1],a=t[r],i=r+1<t.length?t[r+1]:"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function Qlt(t){let e=[],n=t.split(/\s+/).filter(r=>r.length>0);for(let r=0;r<n.length;r++){let o=n[r],a=[],i=0;for(let l=0;l<o.length;l++)o[l]==="-"&&(a.push(o.slice(i,l+1)),i=l+1);i<o.length&&a.push(o.slice(i));let s=!0;for(let l of a)for(let c of Zlt(l))e.push({text:c,spaceBefore:r>0&&s}),s=!1}return e}function Y0(t,e,n){let r={bold:!0},o=e-gD*2,a=Qlt(t);for(let s=Wlt;s>=V0;s--){if(o<Tt("MM",s,r))continue;let l=[],c="";for(let m of a){let p=c&&m.spaceBefore?" ":"",h=c?`${c}${p}${m.text}`:m.text;Tt(h,s,r)<=o?c=h:(c&&l.push(c),c=m.text)}c&&l.push(c);let d=m=>Tt(m,s,r)<=o;if(l.length<=n&&l.every(d))return{lines:l,fontSize:s};if(l.length<=n)return{lines:l.map(p=>d(p)?p:Gn(p,s,o,r)),fontSize:s};let u=l.slice(0,n).map(m=>d(m)?m:Gn(m,s,o,r)),f=u[n-1];return f.endsWith("\u2026")||(u[n-1]=Gn(f+"\u2026",s,o,r)),{lines:u,fontSize:s}}return{lines:[Gn(t,V0,o,r)],fontSize:V0}}function Jlt(t,e,n,r,o,a,i){let s=vt(r.bg,r.text,o?90:95);if(a.active){if(t.value===void 0){let g=pe(s,r.textOnFillLight,r.textOnFillDark);return{fill:s,stroke:a.hue,text:g}}let f=a.fillForValue(t.value),m=ee(r,f,o,{mode:i}),p=a.twoColor?f:a.hue,h=pe(m,r.textOnFillLight,r.textOnFillDark);return{fill:m,stroke:p,text:h}}let l=Dn(t.metadata,[...e],n);if(l){let f=ee(r,l,o,{mode:i}),m=l,p=pe(f,r.textOnFillLight,r.textOnFillDark);return{fill:f,stroke:m,text:p}}let c=vt(r.bg,r.text,o?90:95),d=vt(r.text,r.bg,o?60:40),u=r.text;return{fill:c,stroke:d,text:u}}function tct(t,e,n,r){if(Object.keys(t.metadata).length>0&&n!=null){let a=Dn(t.metadata,[...e],n);if(a)return a}return r.textMuted}function ect(t,e){for(let n of e){let r=`bl-arrow-${n.replace("#","")}`;if(!t.select(`#${r}`).empty())continue;t.append("marker").attr("id",r).attr("viewBox",`0 0 ${ql*2} ${os*2}`).attr("refX",ql*2).attr("refY",os).attr("markerWidth",ql).attr("markerHeight",os).attr("orient","auto").append("polygon").attr("points",`0,0 ${ql*2},${os} 0,${os*2}`).attr("fill",n);let o=`bl-arrow-rev-${n.replace("#","")}`;t.select(`#${o}`).empty()&&t.append("marker").attr("id",o).attr("viewBox",`0 0 ${ql*2} ${os*2}`).attr("refX",0).attr("refY",os).attr("markerWidth",ql).attr("markerHeight",os).attr("orient","auto").append("polygon").attr("points",`${ql*2},0 0,${os} ${ql*2},${os*2}`).attr("fill",n)}}function yD(t,e,n,r,o,a){let{onClickItem:i,exportDims:s,activeTagGroup:l,hiddenTagValues:c,hideDescriptions:d,controlsExpanded:u,onToggleDescriptions:f,onToggleControlsExpand:m,exportMode:p=!1,controlsHost:h,rampDomain:g}=a??{};It(t).selectAll(":not([data-d3-tooltip])").remove();let x=s?.width??t.clientWidth,y=s?.height??t.clientHeight;if(x<=0||y<=0)return;let b=Le.identity(),w=b.aesthetic(Flt),k=b.text(V0),C=b.text(zlt),v=b.structural(1.5),_=b.structural(1.5),R=b.structural(Ylt),L=b.text(uD),E=b.text(Ult),M=b.structural(Xlt),S=b.text(20),T=b.structural(30),N=e.nodes.filter(xt=>xt.value!==void 0).map(xt=>xt.value),I=N.length>0,G=g?.min??(I?Math.min(...N):0),$=g?.max??Math.max(...N),A=Re(e.boxMetricColor??"",r)??r.primary,D=e.boxMetricLowColor?Re(e.boxMetricLowColor,r)??void 0:void 0,O=o?vt(r.surface,r.text,28):r.bg,P=vt(A,O,x7),H=xt=>{let $t=$>G?(xt-G)/($-G):1;if(D!==void 0)return th(D,A,$t,{isDark:o});let Zt=x7+Math.max(0,Math.min(1,$t))*(100-x7);return vt(A,O,Zt)},W=I?e.boxMetric?.trim()||"Value":null,B=xt=>{let $t=xt.trim().toLowerCase();if($t===""||$t==="none")return null;let Zt=e.tagGroups.find(re=>re.name.toLowerCase()===$t);return Zt?Zt.name:$t===W?.toLowerCase()?W:xt},q=l,V;q!==void 0?V=q===null?null:B(q):e.options["active-tag"]!==void 0?V=B(e.options["active-tag"]):V=W??(e.tagGroups.length>0?e.tagGroups[0].name:null);let X=W!==null&&V===W,z=W!==null?{name:W,entries:[],gradient:{min:G,max:$,low:D??P,high:A}}:null,U=[...z?[z]:[],...e.tagGroups],Y=e.nodes.some(xt=>xt.description&&xt.description.length>0),K=or(e.options),nt=(U.length>0||Y&&h!=="app")&&!K?b.structural(ir({groups:U,position:{placement:"top-center",titleRelation:"below-title"},mode:p?"export":"preview"},x)):0,J=c??e.initialHiddenTagValues,F=new Map;for(let xt of e.nodes)F.set(xt.label,xt);let j=new Map;for(let xt of n.nodes)j.set(xt.label,xt);let Q=!!e.title&&e.options["no-title"]!=="on",Z=Q?40:0,ot=e.nodes.some(xt=>xt.description&&xt.description.length>0),at=(U.length>0||ot&&!!f)&&!K,lt=at?nt+8:0,rt=vo(e.options),ut=rt&&at?cr({groups:U,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:p?"export":"preview",showInactivePills:!0},{activeGroup:V},x):{width:0,height:0},tt=nr({requested:rt,title:e.title??"",hasLegend:at,legendWidth:ut.width,legendHeight:ut.height,containerWidth:x,titleBandHeight:Z,legendReserve:lt,titleBaselineY:T,titleFontSize:S}),it=new Set(n.groups.map(xt=>xt.label)),st=0;for(let xt of e.groups)xt.children.some($t=>it.has($t))&&(st+=M);let ct=n.width,pt=Z+(tt.inline?0:lt)+st,mt=Math.max(1,y-pt-w*2),bt=x/(ct+w*2),gt=mt/n.height,Et=Math.min(bt,gt,3),ft=(x-ct*Et)/2,kt=w+Z+(tt.inline?0:lt),_t=It(t).append("svg").attr("width",x).attr("height",y).attr("viewBox",`0 0 ${x} ${y}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt).style("background",r.bg);b.isBelowFloor&&_t.attr("width","100%");let yt=_t.append("defs");Q&&_t.append("text").attr("class","chart-title").attr("x",tt.titleX).attr("y",T).attr("text-anchor",tt.titleAnchor).attr("font-size",S).attr("font-weight","700").attr("fill",r.text).text(e.title);let St=_t.append("g").attr("transform",`translate(${ft},${kt}) scale(${Et})`),Ct=new Set,ht=new Map;for(let xt=0;xt<n.edges.length;xt++){let $t=tct(n.edges[xt],e.tagGroups,V,r);Ct.add($t),ht.set(xt,$t)}ect(yt,Ct);let Pt=[...n.groups].sort((xt,$t)=>$t.width*$t.height-xt.width*xt.height),Dt=new Set(n.groups.map(xt=>xt.label)),qt=new Set;for(let xt of e.groups)for(let $t of xt.children)Dt.has($t)&&qt.add(xt.label);for(let xt of Pt){let $t=xt.x-xt.width/2,Zt=!xt.collapsed&&qt.has(xt.label),re=Zt?xt.y-xt.height/2-M:xt.y-xt.height/2,Ot=Zt?xt.height+M:xt.height,Ut=St.append("g").attr("class",xt.collapsed?"bl-group bl-group-collapsed":"bl-group").attr("data-line-number",String(xt.lineNumber)).attr("data-node-id",xt.label).attr("data-group-toggle",xt.label).style("cursor","pointer");if(xt.collapsed){let oe=Ie(r,o),Ee=r.border;Ut.append("rect").attr("x",$t).attr("y",re).attr("width",xt.width).attr("height",xt.height).attr("rx",rm).attr("ry",rm).attr("fill",oe).attr("stroke",Ee).attr("stroke-width",_);let de=`bl-clip-${xt.label.replace(/[[\]\s]/g,"")}`;Ut.append("clipPath").attr("id",de).append("rect").attr("x",$t).attr("y",re).attr("width",xt.width).attr("height",xt.height).attr("rx",rm),Ut.append("rect").attr("x",$t).attr("y",re+xt.height-R).attr("width",xt.width).attr("height",R).attr("fill",Ee).attr("clip-path",`url(#${de})`).attr("class","bl-collapse-bar");let jt=Math.max(2,Math.floor((xt.height-16)/(k*1.3))),te=Y0(xt.label,xt.width,jt),fe=te.fontSize*1.3,Me=te.lines.length*fe;for(let _e=0;_e<te.lines.length;_e++)Ut.append("text").attr("class","bl-group-label").attr("x",xt.x).attr("y",xt.y-Me/2+fe/2+_e*fe).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",Mt).attr("font-size",te.fontSize).attr("font-weight","600").attr("fill",r.text).text(te.lines[_e]);if(xt.childCount!==void 0&&xt.childCount>0){let _e=Math.max(9,k-2),Ne=_e+7,Ue=Math.max(Ne,String(xt.childCount).length*_e*.62+10),en=$t+xt.width-Ue/2-6,An=re+Ne/2+6;Ut.append("rect").attr("class","bl-collapse-count").attr("x",en-Ue/2).attr("y",An-Ne/2).attr("width",Ue).attr("height",Ne).attr("rx",Ne/2).attr("ry",Ne/2).attr("fill",r.textMuted).attr("fill-opacity",.18),Ut.append("text").attr("class","bl-collapse-count").attr("x",en).attr("y",An).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",Mt).attr("font-size",_e).attr("font-weight","600").attr("fill",r.text).text(String(xt.childCount))}}else Ut.append("rect").attr("x",$t).attr("y",re).attr("width",xt.width).attr("height",Ot).attr("rx",mD).attr("ry",mD).attr("fill",vt(r.surface,r.bg,40)).attr("stroke",r.textMuted).attr("stroke-width",1).attr("stroke-opacity",.35),Ut.append("text").attr("class","bl-group-label").attr("x",$t+xt.width/2).attr("y",re+18).attr("text-anchor","middle").attr("font-family",Mt).attr("font-size",E).attr("font-weight","600").attr("fill",r.text).text(xt.label)}for(let xt=0;xt<n.edges.length;xt++){let $t=n.edges[xt],Zt=ht.get(xt)??r.textMuted;if(J.size>0){let de=!1;for(let[jt,te]of J){let fe=$t.metadata[jt];if(fe&&te.has(fe.toLowerCase())){de=!0;break}}if(de)continue}if($t.source===$t.target){let de=j.get($t.source);if(de){let jt=St.append("g").attr("class","bl-edge-group").attr("data-line-number",String($t.lineNumber)).attr("data-from",$t.source).attr("data-to",$t.target),te=`bl-arrow-${Zt.replace("#","")}`,fe=de.x,Me=de.y,_e=de.width/2,Ne=de.height/2,Ue=20,en=fe+_e,An=Me+Ne*.4,cn=fe+_e*.4,se=Me+Ne,ae=en+_e+Ue,he=An,ze=cn,Te=se+Ne+Ue;jt.append("path").attr("class","bl-edge").attr("d",`M ${en} ${An} C ${ae} ${he}, ${ze} ${Te}, ${cn} ${se}`).attr("fill","none").attr("stroke",Zt).attr("stroke-width",v).attr("marker-end",`url(#${te})`)}continue}let re;if($t.yOffset!==0&&$t.parallelCount>1){let de=j.get($t.source),jt=j.get($t.target),te=de?.y??$t.points[0]?.y??0,fe=jt?.y??$t.points[$t.points.length-1]?.y??0,Me=$t.points[0]?.x??0,_e=$t.points[$t.points.length-1]?.x??0,Ne=(Me+_e)/2,Ue=(te+fe)/2;re=[{x:Me,y:te},{x:Me+(Ne-Me)*.3,y:te+$t.yOffset*.5},{x:Ne,y:Ue+$t.yOffset},{x:_e-(_e-Ne)*.3,y:fe+$t.yOffset*.5},{x:_e,y:fe}]}else re=$t.points.map(de=>({x:de.x,y:de.y}));if(re.length<2)continue;let Ot=St.append("g").attr("class","bl-edge-group").attr("data-line-number",String($t.lineNumber)).attr("data-from",$t.source).attr("data-to",$t.target),Ut=`bl-arrow-${Zt.replace("#","")}`,oe=e.direction==="TB"?Klt:jlt,Ee=Ot.append("path").attr("class","bl-edge").attr("d",oe(re)??"").attr("fill","none").attr("stroke",Zt).attr("stroke-width",v).attr("marker-end",`url(#${Ut})`);if($t.bidirectional){let de=`bl-arrow-rev-${Zt.replace("#","")}`;Ee.attr("marker-start",`url(#${de})`)}}for(let xt of n.nodes){let $t=F.get(xt.label);if(!$t)continue;if(J.size>0){let jt=!1;for(let[te,fe]of J){let Me=$t.metadata[te];if(Me&&fe.has(Me.toLowerCase())){jt=!0;break}}if(jt)continue}let Zt=mn(e.options),re=Jlt($t,e.tagGroups,V,r,o,{active:X,hue:A,twoColor:D!==void 0,fillForValue:H},Zt),Ot=Zt==="solid"?re.text:re.stroke,Ut=St.append("g").attr("class","bl-node").attr("transform",`translate(${xt.x},${xt.y})`).attr("data-line-number",$t.lineNumber).attr("data-node-id",$t.label).style("cursor",i?"pointer":"default").style("--bl-node-stroke",re.stroke);for(let[jt,te]of Object.entries($t.metadata))Ut.attr(`data-tag-${jt.toLowerCase()}`,te.toLowerCase());$t.value!==void 0&&Ut.attr("data-value",$t.value),i&&Ut.on("click",jt=>{jt.target?.closest("a")||i($t.lineNumber)});let oe=-xt.width/2,Ee=-xt.height/2;Ut.append("rect").attr("x",oe).attr("y",Ee).attr("width",xt.width).attr("height",xt.height).attr("rx",rm).attr("ry",rm).attr("fill",re.fill).attr("stroke",re.stroke).attr("stroke-width",_);let de=$t.description;if(de&&de.length>0&&!d){let te=Y0($t.label,xt.width,3),fe=te.lines,Me=te.fontSize*1.3,_e=fe.length*Me,Ne=_e+12,Ue=-xt.height/2+Ne/2;for(let gn=0;gn<fe.length;gn++)Ut.append("text").attr("x",0).attr("y",Ue-_e/2+Me/2+gn*Me).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",te.fontSize).attr("font-weight","bold").attr("fill",re.text).text(fe[gn]);let en=-xt.height/2+Ne;Ut.append("line").attr("x1",-xt.width/2).attr("y1",en).attr("x2",xt.width/2).attr("y2",en).attr("stroke",Ot).attr("stroke-opacity",.3).attr("stroke-width",1);let An=en+4+L,cn=xt.width-gD*2,se=Math.floor(cn/(L*aa)),ae=L*Vlt,he=gn=>Id(gn).length,ze=[];for(let gn of de){let Kn=gn.startsWith("- ")?"\u2022 "+gn.slice(2):gn;Kn=Kn.replace(/\bhttps?\s+([\w][\w.-]+\.[a-z]{2,}(?:\/\S*)?)/gi,(sr,hr)=>`https://${hr}`),ze.push(Kn)}let Te=Wo(ze,se,he),dn=Te.length>fD,Zr=dn?Te.slice(0,fD):Te,ra=-xt.width/2+6,Mo=ra+10,$r=Ms(re.fill)>.5?r.textMuted:vt(re.text,re.fill,75);for(let gn=0;gn<Zr.length;gn++){let Kn=Zr[gn],sr=Kn.text;dn&&gn===Zr.length-1&&(sr=Tt(sr,L)>=cn?Gn(sr,L,cn):sr+"\u2026");let hr=An+gn*ae;Kn.kind==="bullet-first"&&Ut.append("text").attr("x",ra).attr("y",hr).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size",L).attr("fill",$r).text("\u2022");let po=Kn.kind==="bullet-first"||Kn.kind==="bullet-cont",ho=Ut.append("text").attr("x",po?Mo:0).attr("y",hr).attr("text-anchor",po?"start":"middle").attr("dominant-baseline","central").attr("font-size",uD).attr("fill",$r);pn(ho,sr,r,L)}if(dn){let gn=de.join(" "),Kn=gn.length>200?gn.slice(0,199)+"\u2026":gn;Ut.append("title").text(Kn)}if(e.showValues!==!1&&$t.value!==void 0){let gn=e.boxMetric?`${e.boxMetric}: ${$t.value}`:String($t.value);Ut.append("text").attr("class","bl-node-value").attr("x",0).attr("y",An+Zr.length*ae).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",pD).attr("font-weight","600").attr("fill",re.text).text(gn)}}else if(e.showValues!==!1&&$t.value!==void 0){let jt=e.boxMetric?`${e.boxMetric}: ${$t.value}`:String($t.value),te=xt.height/2,fe=-xt.height/2+te,Me=Y0($t.label,xt.width,2),_e=Me.fontSize*1.3,Ne=Me.lines.length*_e,Ue=-xt.height/2+te/2;for(let en=0;en<Me.lines.length;en++)Ut.append("text").attr("x",0).attr("y",Ue-Ne/2+_e/2+en*_e).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",Me.fontSize).attr("font-weight","bold").attr("fill",re.text).text(Me.lines[en]);Ut.append("line").attr("x1",-xt.width/2).attr("y1",fe).attr("x2",xt.width/2).attr("y2",fe).attr("stroke",Ot).attr("stroke-opacity",.3).attr("stroke-width",1),Ut.append("text").attr("class","bl-node-value").attr("x",0).attr("y",(fe+xt.height/2)/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",pD).attr("fill",re.text).attr("opacity",.85).text(jt)}else{let jt=Math.max(2,Math.floor((xt.height-16)/(k*1.3))),te=Y0($t.label,xt.width,jt),fe=te.fontSize*1.3,Me=te.lines.length*fe;for(let _e=0;_e<te.lines.length;_e++)Ut.append("text").attr("x",0).attr("y",-Me/2+fe/2+_e*fe).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",te.fontSize).attr("font-weight","600").attr("fill",re.text).text(te.lines[_e])}if(xt.note)if(xt.note.collapsed)ji(Ut,{x:xt.width/2-sa-3,y:-xt.height/2+sa+3},r,{isDark:o,...xt.note.color&&{color:xt.note.color},lineNumber:xt.note.lineNumber,endLineNumber:xt.note.endLineNumber});else{let[jt,te,fe,Me]=Ui({width:xt.width,height:xt.height},xt.note);Vi(Ut,jt,te,fe,Me,r),Xi(Ut,{x:xt.note.x,y:xt.note.y,width:xt.note.width,height:xt.note.height},xt.note.lines,r,{isDark:o,...xt.note.color&&{color:xt.note.color},lineNumber:xt.note.lineNumber,endLineNumber:xt.note.endLineNumber,interactive:!0})}}let Wt=St.append("g").attr("class","bl-edge-labels"),Ft=C*1.3;for(let xt of n.edges){if(!xt.labelLines||xt.labelLines.length===0||xt.labelX===void 0||xt.labelY===void 0)continue;let $t=xt.labelX,Zt=xt.labelY;if(J.size>0){let jt=!1;for(let[te,fe]of J){let Me=xt.metadata[te];if(Me&&fe.has(Me.toLowerCase())){jt=!0;break}}if(jt)continue}let re=xt.labelWidth??0,Ot=xt.labelHeight??C+6,Ut=xt.labelLines,oe=Wt.append("g").attr("class","bl-edge-label").attr("data-line-number",String(xt.lineNumber));oe.append("rect").attr("x",$t-re/2).attr("y",Zt-Ot/2).attr("width",re).attr("height",Ot).attr("rx",3).attr("fill",r.bg).attr("opacity",.9);let Ee=oe.append("text").attr("x",$t).attr("text-anchor","middle").attr("font-family",Mt).attr("font-size",C).attr("fill",r.textMuted),de=Zt-(Ut.length-1)/2*Ft+C/3;Ut.forEach((jt,te)=>{Ee.append("tspan").attr("x",$t).attr("y",de+te*Ft).text(jt)})}let Xt=e.nodes.some(xt=>xt.description&&xt.description.length>0);if((U.length>0||Xt&&h!=="app")&&!K){let xt;Xt&&(f||h==="app")&&(xt={toggles:[{id:"descriptions",type:"toggle",label:"Descriptions",active:!d,onToggle:()=>{}}]});let $t={...m!==void 0&&{onControlsExpand:m},onControlsToggle:(re,Ot)=>{re==="descriptions"&&f&&f(Ot)}},Zt=_t.append("g").attr("transform",tt.inline?`translate(${tt.legendX}, ${tt.legendY})`:`translate(0,${Z+4})`);tn(Zt,{groups:U,activeGroup:V,mode:p?"export":"preview",position:{placement:"top-center",titleRelation:tt.inline?"inline-with-title":"below-title"},showInactivePills:!0,...xt!==void 0&&{controlsGroup:xt},...h!==void 0&&{controlsHost:h},...u!==void 0&&{controlsExpanded:u},callbacks:$t,palette:r,isDark:o,width:x}),Zt.selectAll("[data-legend-group]").classed("bl-legend-group",!0)}if(!s&&!p){let $t=_t.append("g").attr("class","bl-focus-icon").attr("data-export-ignore","true").style("display","none").style("pointer-events","auto").style("cursor","pointer");$t.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let Zt=14/2,re=14/2;$t.append("circle").attr("cx",Zt).attr("cy",re).attr("r",14/2-1).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1.5),$t.append("circle").attr("cx",Zt).attr("cy",re).attr("r",2).attr("fill",r.textMuted)}}function nct(t,e,n,r,o,a){yD(t,e,n,r,o,{...a?.exportDims!==void 0&&{exportDims:a.exportDims},...a?.activeTagGroup!==void 0&&{activeTagGroup:a.activeTagGroup},...a?.hiddenTagValues!==void 0&&{hiddenTagValues:a.hiddenTagValues},...a?.exportMode!==void 0&&{exportMode:a.exportMode}})}var Flt,Wlt,V0,zlt,rm,Ylt,ql,os,uD,Vlt,fD,gD,mD,Ult,Xlt,x7,pD,jlt,Klt,xD=dt(()=>{"use strict";Nn();Ae();ko();Ki();Fo();Ke();Mr();qr();Fe();rr();Oe();co();Ts();wr();Ve();Flt=20,Wlt=11,V0=9,zlt=11,rm=8,Ylt=4,ql=5,os=4,uD=10,Vlt=1.4,fD=6,gD=12,mD=8,Ult=14,Xlt=32,x7=15,pD=11,jlt=lr().x(t=>t.x).y(t=>t.y).curve(To),Klt=lr().x(t=>t.x).y(t=>t.y).curve(To)});var xa,Au=dt(()=>{"use strict";xa=Math.round(97.08000000000001)});function k7(t,e=j0,n=kD){let r=hn(t,e,n,{hardBreak:!0});if(r.length>w7){let a=r.slice(0,w7-1),i=r.slice(w7-1).join(" ");a.push(Gn(i,e,n)),r=a}let o=0;for(let a of r){let i=Tt(a,e);i>o&&(o=i)}return{lines:r,width:o+2*oct,height:r.length*e*rct+2*act}}function lct(t){return E7(t,.5).p}function E7(t,e){if(t.length===0)return{p:{x:0,y:0},nx:0,ny:1};if(t.length===1)return{p:{x:t[0].x,y:t[0].y},nx:0,ny:1};let n=[],r=0;for(let i=1;i<t.length;i++){let s=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);n.push(s),r+=s}let o=r*Math.max(0,Math.min(1,e));for(let i=1;i<t.length;i++){let s=n[i-1];if(o<=s||i===t.length-1){let l=s===0?0:Math.min(1,o/s),c=t[i-1].x,d=t[i-1].y,u=t[i].x,f=t[i].y,m=u-c,p=f-d,h=Math.hypot(m,p)||1;return{p:{x:c+m*l,y:d+p*l},nx:-p/h,ny:m/h}}o-=s}let a=t[t.length-1];return{p:{x:a.x,y:a.y},nx:0,ny:1}}function ED(t,e,n,r){return{minX:t-n/2,minY:e-r/2,maxX:t+n/2,maxY:e+r/2}}function X0(t,e,n,r,o,a){let i=t-n/2-a,s=e-r/2-a,l=t+n/2+a,c=e+r/2+a;for(let d of o)if(i<d.maxX&&l>d.minX&&s<d.maxY&&c>d.minY)return!0;return!1}function cct(){let t=[.5];for(let e=1;e<=sct;e++){let n=e*.08;.5-n>=.12&&t.push(.5-n),.5+n<=.88&&t.push(.5+n)}return t}function dct(t,e,n,r){let o=cct();for(let a of o){let{p:i}=E7(n,a);if(!X0(i.x,i.y,t,e,r,U0))return i}for(let a=wD;a<=ict;a+=wD)for(let i of o){let{p:s,nx:l,ny:c}=E7(n,i);for(let d of[-1,1]){let u=s.x+l*a*d,f=s.y+c*a*d;if(!X0(u,f,t,e,r,U0))return{x:u,y:f}}}return null}function uct(t){for(let r=0;r<8;r++){let o=!1;for(let a=0;a<t.length;a++)for(let i=a+1;i<t.length;i++){let s=t[a],l=t[i],c=Math.abs(s.cx-l.cx),d=Math.abs(s.cy-l.cy),u=(s.w+l.w)/2+4-c,f=(s.h+l.h)/2+4-d;if(u>0&&f>0){let m=f/2+1;s.cy<l.cy?(s.cy-=m,l.cy+=m):(s.cy+=m,l.cy-=m),o=!0}}if(!o)break}}function S7(t,e){let n=e?.fontSize??j0,r=e?.maxWidth??kD,o=[];for(let l of t.nodes)o.push(ED(l.x,l.y,l.width,l.height));for(let l of t.groups)l.collapsed&&o.push(ED(l.x,l.y,l.width,l.height));let a=[];t.edges.forEach((l,c)=>{if(!l.label||l.points.length<2)return;let d=k7(l.label,n,r),u=lct(l.points),f=u.y;l.parallelCount>1&&l.yOffset!==0&&(f+=(l.yOffset<0?-1:1)*(d.height/2)),a.push({edgeIdx:c,cx:u.x,cy:f,w:d.width,h:d.height,lines:d.lines,resolved:!0})});for(let l of a){if(!X0(l.cx,l.cy,l.w,l.h,o,U0))continue;let c=t.edges[l.edgeIdx],d=dct(l.w,l.h,c.points,o);d?(l.cx=d.x,l.cy=d.y):l.resolved=!1}uct(a);for(let l of a)X0(l.cx,l.cy,l.w,l.h,o,U0)&&(l.resolved=!1);let i=new Map;for(let l of a)i.set(l.edgeIdx,l);let s=t.edges.map((l,c)=>{let d=i.get(c);return d?{...l,labelX:d.cx,labelY:d.cy,labelWidth:d.w,labelHeight:d.h,labelLines:d.lines}:l});return{layout:{...t,edges:s},unresolved:a.filter(l=>!l.resolved).map(l=>l.edgeIdx)}}var j0,kD,w7,rct,oct,act,U0,wD,ict,sct,M7=dt(()=>{"use strict";Ve();j0=11,kD=160,w7=3,rct=1.3,oct=6,act=3,U0=4,wD=8,ict=40,sct=9});function bct(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function SD(t,e,n){if(t.groups.length>0)return[];let r=t.nodes.length;if(r<3||r>40)return[];let o=t.direction==="TB",a=n?.nodesep??fct,i=n?.ranksep??mct,s=n?.backEdgeSide??"nearest",l=n?.restarts??(r<=14?28:r<=25?14:6),c=n?.keepK??3,d=t.nodes.map(U=>U.label),u=new Set(d),f=t.edges.map((U,Y)=>({e:U,i:Y})).filter(({e:U})=>u.has(U.source)&&u.has(U.target)&&U.source!==U.target);if(f.length===0)return[];let m=new Map;for(let U of d)m.set(U,[]);for(let{e:U,i:Y}of f)m.get(U.source).push({to:U.target,idx:Y});let p=new Set,h=new Map;for(let U of d)h.set(U,0);let g=U=>{h.set(U,1);for(let{to:Y,idx:K}of m.get(U)){let et=h.get(Y);et===1?p.add(K):et===0&&g(Y)}h.set(U,2)};for(let U of d)h.get(U)===0&&g(U);let x=f.map(({e:U,i:Y})=>p.has(Y)?{from:U.target,to:U.source,idx:Y,rev:!0}:{from:U.source,to:U.target,idx:Y,rev:!1}),y=new Map,b=new Map;for(let U of d)y.set(U,[]),b.set(U,0);for(let U of x)y.get(U.from).push(U.to),b.set(U.to,(b.get(U.to)??0)+1);let w=new Map;for(let U of d)w.set(U,0);let k=d.filter(U=>(b.get(U)??0)===0),C=new Map(b),v=[];for(;k.length;){let U=k.shift();v.push(U);for(let Y of y.get(U))w.set(Y,Math.max(w.get(Y),w.get(U)+1)),C.set(Y,C.get(Y)-1),C.get(Y)===0&&k.push(Y)}if(v.length!==d.length)return[];let _=Math.max(...d.map(U=>w.get(U))),R=new Map;for(let U of t.nodes){let Y=e.get(U.label)??{width:xa,height:60};R.set(U.label,{id:U.label,dummy:!1,rank:w.get(U.label),cross:0,thick:o?Y.width:Y.height,depth:o?Y.height:Y.width,realW:Y.width,realH:Y.height})}let L=[],E=[],M=[];for(let U of x){if(U.rev){M.push({edgeIdx:U.idx,src:U.to,tgt:U.from});continue}let Y=w.get(U.from),K=w.get(U.to),et=[U.from],nt=U.from;for(let J=Y+1;J<K;J++){let F=`__d${U.idx}_${J}`;R.set(F,{id:F,dummy:!0,rank:J,cross:0,thick:pct,depth:0,realW:0,realH:0}),L.push({a:nt,b:F}),et.push(F),nt=F}L.push({a:nt,b:U.to}),et.push(U.to),E.push({edgeIdx:U.idx,chain:U.rev?et.slice().reverse():et})}let S=Array.from({length:_+1},()=>[]);for(let U of R.values())S[U.rank].push(U.id);let T=new Map,N=new Map;for(let U of R.keys())T.set(U,[]),N.set(U,[]);for(let U of L)N.get(U.a).push(U.b),T.get(U.b).push(U.a);let I=new Map,G=U=>{for(let Y of R.keys())I.set(Y,U.get(Y))},$=U=>{if(!S[U+1])return 0;let K=[];for(let nt of S[U]){let J=I.get(nt);for(let F of N.get(nt))K.push({p:J,q:I.get(F)})}let et=0;for(let nt=0;nt<K.length;nt++)for(let J=nt+1;J<K.length;J++){let F=K[nt],j=K[J];(F.p-j.p)*(F.q-j.q)<0&&et++}return et},A=()=>{let U=0;for(let Y=0;Y<_;Y++)U+=$(Y);return U},D=U=>{if(U.length===0)return-1;U.sort((nt,J)=>nt-J);let Y=Math.floor(U.length/2);if(U.length%2===1)return U[Y];if(U.length===2)return(U[0]+U[1])/2;let K=U[Y-1]-U[0],et=U[U.length-1]-U[Y];return K+et===0?(U[Y-1]+U[Y])/2:(U[Y-1]*et+U[Y]*K)/(K+et)},O=(U,Y)=>{let K=S[U],et=Y?T:N,nt=new Map;for(let Z of K)nt.set(Z,D(et.get(Z).map(ot=>I.get(ot))));let J=K.filter(Z=>nt.get(Z)>=0).sort((Z,ot)=>nt.get(Z)-nt.get(ot)),F=new Array(K.length).fill(null);for(let Z of K)nt.get(Z)<0&&(F[I.get(Z)]=Z);let j=0;for(let Z=0;Z<F.length;Z++)F[Z]===null&&(F[Z]=J[j++]);let Q=F;Q.forEach((Z,ot)=>I.set(Z,ot)),S[U]=Q},P=()=>{let U=!0,Y=0;for(;U&&Y++<12;){U=!1;for(let K=0;K<=_;K++){let et=S[K];for(let nt=0;nt<et.length-1;nt++){let J=(K>0?$(K-1):0)+(K<_?$(K):0),F=et[nt],j=et[nt+1];et[nt]=j,et[nt+1]=F,I.set(j,nt),I.set(F,nt+1),(K>0?$(K-1):0)+(K<_?$(K):0)<J?U=!0:(et[nt]=F,et[nt+1]=j,I.set(F,nt),I.set(j,nt+1))}}}},H=U=>{let Y=U===0?null:bct(U);for(let K=0;K<=_;K++){let et=S[K].slice();if(Y)for(let nt=et.length-1;nt>0;nt--){let J=Math.floor(Y()*(nt+1));[et[nt],et[J]]=[et[J],et[nt]]}S[K]=et,et.forEach((nt,J)=>I.set(nt,J))}},W=[];for(let U=0;U<l;U++){H(U);let Y=A(),K=new Map(I);for(let nt=0;nt<8;nt++){if(nt%2===0)for(let j=1;j<=_;j++)O(j,!0);else for(let j=_-1;j>=0;j--)O(j,!1);P();let F=A();if(F<Y&&(Y=F,K=new Map(I)),F===0)break}G(K);for(let nt=0;nt<=_;nt++)S[nt].sort((J,F)=>I.get(J)-I.get(F));let et=S.map(nt=>nt.join(",")).join("|");W.some(nt=>nt.sig===et)||W.push({sig:et,cross:Y,order:new Map(K)})}W.sort((U,Y)=>U.cross-Y.cross);let B=W.slice(0,c);if(B.length===0)return[];let q=[];for(let U of B){G(U.order);let Y=Array.from({length:_+1},()=>[]);for(let K of R.values())Y[K.rank].push(K.id);for(let K=0;K<=_;K++)Y[K].sort((et,nt)=>U.order.get(et)-U.order.get(nt));q.push(V(Y))}return q;function V(U){let Y=U.map(ht=>Math.max(0,...ht.map(Pt=>R.get(Pt).depth))),K=[],et=Hc;for(let ht=0;ht<=_;ht++)K[ht]=et+Y[ht]/2,et+=Y[ht]+i;for(let ht=0;ht<=_;ht++){let Pt=Hc;for(let Dt of U[ht]){let qt=R.get(Dt);qt.cross=Pt+qt.thick/2,Pt+=qt.thick+a}}let nt=18;for(let ht=0;ht<nt;ht++){let Dt=ht%2===0?Array.from({length:_+1},(qt,Wt)=>Wt):Array.from({length:_+1},(qt,Wt)=>_-Wt);for(let qt of Dt){let Wt=U[qt],Ft=Wt.map(Xt=>{let zt=R.get(Xt),xt=0,$t=0;for(let Zt of T.get(Xt)){let re=X(zt,R.get(Zt));xt+=re,$t+=re*R.get(Zt).cross}for(let Zt of N.get(Xt)){let re=X(zt,R.get(Zt));xt+=re,$t+=re*R.get(Zt).cross}return xt>0?$t/xt:zt.cross});z(Wt,Ft)}}let J=1/0;for(let ht of R.values())J=Math.min(J,ht.cross-ht.thick/2);let F=Hc-J;for(let ht of R.values())ht.cross+=F;let j=ht=>o?{x:ht.cross,y:K[ht.rank]}:{x:K[ht.rank],y:ht.cross},Q=t.nodes.map(ht=>{let Pt=R.get(ht.label),Dt=j(Pt);return{label:ht.label,x:Dt.x,y:Dt.y,width:Pt.realW,height:Pt.realH}}),Z=new Map;for(let ht of E)Z.set(ht.edgeIdx,ht.chain);let ot=1/0,at=-1/0;for(let ht of R.values())ht.dummy||(ot=Math.min(ot,ht.cross-ht.thick/2),at=Math.max(at,ht.cross+ht.thick/2));let lt=34,rt=28,ut=ht=>s==="left"?-1:s==="right"||R.get(ht.src).cross-R.get(ht.tgt).cross>=0?1:-1,tt=M.map(ht=>({...ht,side:ut(ht),span:Math.abs(R.get(ht.src).rank-R.get(ht.tgt).rank)})).sort((ht,Pt)=>ht.side-Pt.side||ht.span-Pt.span),it=new Map;for(let ht of tt)it.set(ht.side,(it.get(ht.side)??0)+1);let st=new Map,ct=new Map,pt=ht=>Math.max(0,ht/2-6),mt=new Map,bt=new Map;{let ht=new Map;for(let Pt of tt){let Dt=`${Pt.side}|${Pt.tgt}`,qt=ht.get(Dt)??0;ht.set(Dt,qt+1),mt.set(Pt.edgeIdx,qt)}for(let[Pt,Dt]of ht)bt.set(Pt,Dt)}for(let ht of tt){let Pt=ht.side,Dt=st.get(Pt)??0;st.set(Pt,Dt+1);let qt=it.get(Pt),Wt=R.get(ht.src),Ft=R.get(ht.tgt),Xt=Pt>0?at+lt+Dt*rt:ot-lt-Dt*rt,zt=K[Wt.rank],xt=K[Ft.rank],$t=qt>1?(Dt+1)/(qt+1):0,Zt=zt+$t*pt(Wt.depth),re=xt-$t*pt(Ft.depth),Ot=(te,fe)=>o?{x:te,y:fe}:{x:fe,y:te},Ut=10,oe=Wt.cross+Pt*(Wt.thick/2+Ut),Ee=Ft.cross+Pt*(Ft.thick/2+Ut),de=mt.get(ht.edgeIdx),jt=bt.get(`${Pt}|${ht.tgt}`);if(jt>1&&de>0){let te=xt-(Ft.depth/2+lt+(de-1)*rt),fe=Ft.cross+Pt*pt(Ft.thick)*(de/jt);ct.set(ht.edgeIdx,[Ot(Wt.cross,zt),Ot(oe,Zt),Ot(Xt,Zt),Ot(Xt,te),Ot(fe,te),Ot(Ft.cross,xt)])}else ct.set(ht.edgeIdx,[Ot(Wt.cross,zt),Ot(oe,Zt),Ot(Xt,Zt),Ot(Xt,re),Ot(Ee,re),Ot(Ft.cross,xt)])}let gt=[];for(let ht=0;ht<t.edges.length;ht++){let Pt=t.edges[ht];if(!u.has(Pt.source)||!u.has(Pt.target))continue;let Dt;if(Pt.source===Pt.target){let qt=j(R.get(Pt.source));Dt=[qt,qt]}else if(ct.has(ht))Dt=ct.get(ht);else{let qt=Z.get(ht);if(!qt)continue;Dt=qt.map(Wt=>j(R.get(Wt)))}gt.push({source:Pt.source,target:Pt.target,...Pt.label!==void 0&&{label:Pt.label},bidirectional:Pt.bidirectional,lineNumber:Pt.lineNumber,points:Dt,yOffset:0,parallelCount:1,metadata:Pt.metadata})}let Et=1/0,ft=1/0,kt=-1/0,_t=-1/0;for(let ht of Q)Et=Math.min(Et,ht.x-ht.width/2),ft=Math.min(ft,ht.y-ht.height/2),kt=Math.max(kt,ht.x+ht.width/2),_t=Math.max(_t,ht.y+ht.height/2);for(let ht of gt)for(let Pt of ht.points)Et=Math.min(Et,Pt.x),ft=Math.min(ft,Pt.y),kt=Math.max(kt,Pt.x),_t=Math.max(_t,Pt.y);let yt=Hc-Et,St=Hc-ft,Ct=yt!==0||St!==0?{nodes:Q.map(ht=>({...ht,x:ht.x+yt,y:ht.y+St})),edges:gt.map(ht=>({...ht,points:ht.points.map(Pt=>({x:Pt.x+yt,y:Pt.y+St}))}))}:{nodes:Q,edges:gt};return{nodes:Ct.nodes,edges:Ct.edges,groups:[],width:kt+yt+Hc,height:_t+St+Hc}}function X(U,Y){return U.dummy&&Y.dummy?yct:U.dummy||Y.dummy?gct:hct}function z(U,Y){let K=U.length;if(K===0)return;let et=U.map(Q=>R.get(Q).thick/2),nt=[0];for(let Q=1;Q<K;Q++)nt[Q]=nt[Q-1]+et[Q-1]+a+et[Q];let J=Y.map((Q,Z)=>Q-nt[Z]),F=[];for(let Q=0;Q<K;Q++){let Z={pos:J[Q],count:1,sumOffset:J[Q],first:Q};for(;F.length&&F[F.length-1].pos>=Z.pos;){let ot=F.pop(),at=ot.count+Z.count,lt=ot.sumOffset+Z.sumOffset;Z={pos:lt/at,count:at,sumOffset:lt,first:ot.first}}F.push(Z)}let j=new Array(K);for(let Q of F)for(let Z=0;Z<Q.count;Z++)j[Q.first+Z]=Q.pos;for(let Q=0;Q<K;Q++)R.get(U[Q]).cross=j[Q]+nt[Q]}}var fct,mct,pct,Hc,hct,gct,yct,MD=dt(()=>{"use strict";Au();fct=50,mct=60,pct=10,Hc=40,hct=1,gct=2,yct=8});function Cct(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function Nct(t){if(t.length===0)return-1;t.sort((o,a)=>o-a);let e=Math.floor(t.length/2);if(t.length%2===1)return t[e];if(t.length===2)return(t[0]+t[1])/2;let n=t[e-1]-t[0],r=t[t.length-1]-t[e];return n+r===0?(t[e-1]+t[e])/2:(t[e-1]*r+t[e]*n)/(n+r)}function K0(t,e){let n=new Map;for(let l of t)n.set(l,[]);for(let l of e)n.get(l.from)?.push({to:l.to,idx:l.idx});let r=new Set,o=new Map;for(let l of t)o.set(l,0);let a=[],i=l=>{a.push(l);let c=new Map;for(;a.length;){let d=a[a.length-1];o.get(d)===0&&o.set(d,1);let u=n.get(d),f=c.get(d)??0,m=!1;for(;f<u.length;f++){let{to:p,idx:h}=u[f],g=o.get(p);if(g===1)r.add(h);else if(g===0){c.set(d,f+1),a.push(p),m=!0;break}}m||(c.set(d,u.length),o.set(d,2),a.pop())}};for(let l of t)o.get(l)===0&&i(l);return{dag:e.map(l=>r.has(l.idx)?{from:l.to,to:l.from,idx:l.idx,rev:!0}:{from:l.from,to:l.to,idx:l.idx,rev:!1})}}function vD(t,e){let n=new Map,r=new Map;for(let l of t)n.set(l,[]),r.set(l,0);for(let l of e)n.get(l.from).push(l.to),r.set(l.to,(r.get(l.to)??0)+1);let o=new Map;for(let l of t)o.set(l,0);let a=t.filter(l=>(r.get(l)??0)===0),i=new Map(r),s=0;for(;a.length;){let l=a.shift();s++;for(let c of n.get(l))o.set(c,Math.max(o.get(c),o.get(l)+1)),i.set(c,i.get(c)-1),i.get(c)===0&&a.push(c)}return s===t.length?o:null}function CD(t,e,n){if(t.groups.length===0)return[];let r=t.nodes.length;if(r<3||r>60)return[];let o=t.direction==="TB",a=t.nodes.map(J=>J.label),i=new Set(a);for(let J of t.edges)if(J.source.startsWith("__group_")||J.target.startsWith("__group_"))return[];let s=new Map(t.groups.map(J=>[J.label,J])),l=new Map;for(let J of t.groups)for(let F of J.children)i.has(F)&&l.set(F,J.label);let c=J=>{let F=J,j=new Set;for(;;){let Q=s.get(F);if(!Q?.parentGroup||j.has(F))return F;j.add(F),F=Q.parentGroup}},d=J=>{let F=l.get(J);if(!F)return[];let j=[F],Q=F,Z=new Set([F]);for(;;){let ot=s.get(Q);if(!ot?.parentGroup||Z.has(ot.parentGroup))break;j.push(ot.parentGroup),Z.add(ot.parentGroup),Q=ot.parentGroup}return j.reverse()},u="\0node\0",f=J=>{let F=l.get(J);return F?c(F):u+J},m=t.edges.map((J,F)=>({e:J,i:F})).filter(({e:J})=>i.has(J.source)&&i.has(J.target)&&J.source!==J.target);if(m.length===0)return[];let p=new Map;for(let J of a)p.set(J,f(J));let h=Array.from(new Set(a.map(J=>p.get(J)))),g=m.filter(({e:J})=>p.get(J.source)!==p.get(J.target)).map(({e:J,i:F})=>({from:p.get(J.source),to:p.get(J.target),idx:F})),{dag:x}=K0(h,g),y=vD(h,x.map(J=>({from:J.from,to:J.to})));if(!y)return[];let b=new Map,w=new Map;for(let J of a){let F=p.get(J);(w.get(F)??w.set(F,[]).get(F)).push(J)}for(let[J,F]of w){let j=new Set(F),Q=m.filter(({e:at})=>p.get(at.source)===J&&p.get(at.target)===J&&j.has(at.source)&&j.has(at.target)).map(({e:at,i:lt})=>({from:at.source,to:at.target,idx:lt})),{dag:Z}=K0(F,Q),ot=vD(F,Z.map(at=>({from:at.from,to:at.to})));if(!ot)return[];for(let at of F)b.set(at,ot.get(at))}let k=Math.max(...h.map(J=>y.get(J))),C=Array.from({length:k+1},()=>1);for(let J of h){let F=Math.max(...w.get(J).map(Q=>b.get(Q)+1)),j=y.get(J);C[j]=Math.max(C[j],F)}let v=[],_=0;for(let J=0;J<=k;J++)v[J]=_,_+=C[J];let R=new Set(v.slice(1)),L=new Map;for(let J of a)L.set(J,v[y.get(p.get(J))]+b.get(J));let E=Math.max(...a.map(J=>L.get(J))),M=new Map;for(let J of t.nodes){let F=e.get(J.label)??{width:xa,height:60};M.set(J.label,{id:J.label,dummy:!1,rank:L.get(J.label),cross:0,thick:o?F.width:F.height,depth:o?F.height:F.width,realW:F.width,realH:F.height,unit:p.get(J.label),path:d(J.label)})}let S=[],T=[],N=[],I=[];for(let{e:J,i:F}of m){let j=L.get(J.source),Q=L.get(J.target);if(j===Q){I.push({edgeIdx:F,a:J.source,b:J.target});continue}if(Q<j){N.push({edgeIdx:F,src:J.source,tgt:J.target});continue}let Z=[J.source],ot=J.source;for(let at=j+1;at<Q;at++){let lt=`__d${F}_${at}`;M.set(lt,{id:lt,dummy:!0,rank:at,cross:0,thick:Ect,depth:0,realW:0,realH:0,unit:u+lt,path:[]}),T.push({a:ot,b:lt}),Z.push(lt),ot=lt}T.push({a:ot,b:J.target}),Z.push(J.target),S.push({edgeIdx:F,chain:Z})}let G=Array.from({length:E+1},()=>[]);for(let J of M.values())G[J.rank].push(J.id);let $=new Map,A=new Map;for(let J of M.keys())$.set(J,[]),A.set(J,[]);for(let J of T)A.get(J.a).push(J.b),$.get(J.b).push(J.a);let D=new Map,O=J=>{if(!G[J+1])return 0;let j=[];for(let Z of G[J]){let ot=D.get(Z);for(let at of A.get(Z))j.push({p:ot,q:D.get(at)})}let Q=0;for(let Z=0;Z<j.length;Z++)for(let ot=Z+1;ot<j.length;ot++){let at=j[Z],lt=j[ot];(at.p-lt.p)*(at.q-lt.q)<0&&Q++}return Q},P=()=>{let J=0;for(let F=0;F<E;F++)J+=O(F);return J},H=(J,F)=>{let j=G[J],Q=F?$:A,Z=new Map;for(let ut of j)Z.set(ut,Nct(Q.get(ut).map(tt=>D.get(tt))));let ot=j.filter(ut=>Z.get(ut)>=0).sort((ut,tt)=>Z.get(ut)-Z.get(tt)),at=new Array(j.length).fill(null);for(let ut of j)Z.get(ut)<0&&(at[D.get(ut)]=ut);let lt=0;for(let ut=0;ut<at.length;ut++)at[ut]===null&&(at[ut]=ot[lt++]);let rt=at;rt.forEach((ut,tt)=>D.set(ut,tt)),G[J]=rt},W=()=>{let J=!0,F=0;for(;J&&F++<12;){J=!1;for(let j=0;j<=E;j++){let Q=G[j];for(let Z=0;Z<Q.length-1;Z++){let ot=(j>0?O(j-1):0)+(j<E?O(j):0),at=Q[Z],lt=Q[Z+1];Q[Z]=lt,Q[Z+1]=at,D.set(lt,Z),D.set(at,Z+1),(j>0?O(j-1):0)+(j<E?O(j):0)<ot?J=!0:(Q[Z]=at,Q[Z+1]=lt,D.set(at,Z),D.set(lt,Z+1))}}}},B=J=>{let F=J===0?null:Cct(J);for(let j=0;j<=E;j++){let Q=G[j].slice();if(F)for(let Z=Q.length-1;Z>0;Z--){let ot=Math.floor(F()*(Z+1));[Q[Z],Q[ot]]=[Q[ot],Q[Z]]}G[j]=Q,Q.forEach((Z,ot)=>D.set(Z,ot))}},q=n?.restarts??(r<=16?20:r<=30?12:6),V=n?.keepK??3,X=[];for(let J=0;J<q;J++){B(J);let F=P(),j=new Map(D);for(let Z=0;Z<8;Z++){if(Z%2===0)for(let at=1;at<=E;at++)H(at,!0);else for(let at=E-1;at>=0;at--)H(at,!1);W();let ot=P();if(ot<F&&(F=ot,j=new Map(D)),ot===0)break}for(let[Z,ot]of j)D.set(Z,ot);for(let Z=0;Z<=E;Z++)G[Z].sort((ot,at)=>D.get(ot)-D.get(at));let Q=G.map(Z=>Z.join(",")).join("|");X.some(Z=>Z.sig===Q)||X.push({sig:Q,cross:F,order:new Map(j)})}X.sort((J,F)=>J.cross-F.cross);let z=X.slice(0,V);if(z.length===0)return[];let U=[];for(let J of z){for(let[j,Q]of J.order)D.set(j,Q);let F=Array.from({length:E+1},()=>[]);for(let j of M.values())F[j.rank].push(j.id);for(let j=0;j<=E;j++)F[j].sort((Q,Z)=>J.order.get(Q)-J.order.get(Z));U.push(nt(F))}return U;function Y(J,F){return J.dummy&&F.dummy?Lct:J.dummy||F.dummy?vct:Mct}function K(J,F,j){let Q=J.length;if(Q===0)return;let Z=[0];for(let rt=1;rt<Q;rt++)Z[rt]=Z[rt-1]+j[rt];let ot=F.map((rt,ut)=>rt-Z[ut]),at=[];for(let rt=0;rt<Q;rt++){let ut={pos:ot[rt],count:1,sumOffset:ot[rt],first:rt};for(;at.length&&at[at.length-1].pos>=ut.pos;){let tt=at.pop(),it=tt.count+ut.count,st=tt.sumOffset+ut.sumOffset;ut={pos:st/it,count:it,sumOffset:st,first:tt.first}}at.push(ut)}let lt=new Array(Q);for(let rt of at)for(let ut=0;ut<rt.count;ut++)lt[rt.first+ut]=rt.pos;for(let rt=0;rt<Q;rt++)M.get(J[rt]).cross=lt[rt]+Z[rt]}function et(J,F){let j=J.thick/2+F.thick/2+xct;if(J.dummy||F.dummy)return j;if(J.unit!==F.unit)return j+2*Ru+kct;let Q=J.path[J.path.length-1],Z=F.path[F.path.length-1];return Q!==Z&&(Q||Z)?j+2*Ru:j}function nt(J){let F=J.map(Ot=>Math.max(0,...Ot.map(Ut=>M.get(Ut).depth))),j=[],Q=Bl;for(let Ot=0;Ot<=E;Ot++)Ot>0&&(Q+=wct+(R.has(Ot)?Sct:0)),j[Ot]=Q+F[Ot]/2,Q+=F[Ot];let Z=Ot=>Ot.map((Ut,oe)=>oe===0?0:et(M.get(Ot[oe-1]),M.get(Ut)));for(let Ot=0;Ot<=E;Ot++){let Ut=J[Ot],oe=Z(Ut),Ee=Bl;for(let de=0;de<Ut.length;de++){let jt=M.get(Ut[de]);Ee+=oe[de],jt.cross=de===0?Bl+jt.thick/2:Ee}}let ot=18;for(let Ot=0;Ot<ot;Ot++){let oe=Ot%2===0?Array.from({length:E+1},(Ee,de)=>de):Array.from({length:E+1},(Ee,de)=>E-de);for(let Ee of oe){let de=J[Ee],jt=de.map(te=>{let fe=M.get(te),Me=0,_e=0;for(let Ne of $.get(te)){let Ue=Y(fe,M.get(Ne));Me+=Ue,_e+=Ue*M.get(Ne).cross}for(let Ne of A.get(te)){let Ue=Y(fe,M.get(Ne));Me+=Ue,_e+=Ue*M.get(Ne).cross}return Me>0?_e/Me:fe.cross});K(de,jt,Z(de))}}let at=1/0;for(let Ot of M.values())at=Math.min(at,Ot.cross-Ot.thick/2);let lt=Bl-at;for(let Ot of M.values())Ot.cross+=lt;let rt=Ot=>o?{x:Ot.cross,y:j[Ot.rank]}:{x:j[Ot.rank],y:Ot.cross},ut=t.nodes.map(Ot=>{let Ut=M.get(Ot.label),oe=rt(Ut);return{label:Ot.label,x:oe.x,y:oe.y,width:Ut.realW,height:Ut.realH}}),tt=new Map;for(let Ot of S)tt.set(Ot.edgeIdx,Ot.chain);let it=1/0,st=-1/0;for(let Ot of M.values())Ot.dummy||(it=Math.min(it,Ot.cross-Ot.thick/2),st=Math.max(st,Ot.cross+Ot.thick/2));let ct=34,pt=28,mt=Ot=>Math.max(0,Ot/2-6),bt=Ot=>M.get(Ot.src).cross-M.get(Ot.tgt).cross>=0?1:-1,gt=N.map(Ot=>({...Ot,side:bt(Ot),span:Math.abs(M.get(Ot.src).rank-M.get(Ot.tgt).rank)})).sort((Ot,Ut)=>Ot.side-Ut.side||Ot.span-Ut.span),Et=new Map;for(let Ot of gt)Et.set(Ot.side,(Et.get(Ot.side)??0)+1);let ft=new Map,kt=new Map;for(let Ot of gt){let Ut=Ot.side,oe=ft.get(Ut)??0;ft.set(Ut,oe+1);let Ee=Et.get(Ut),de=M.get(Ot.src),jt=M.get(Ot.tgt),te=Ut>0?st+ct+oe*pt:it-ct-oe*pt,fe=j[de.rank],Me=j[jt.rank],_e=Ee>1?(oe+1)/(Ee+1):0,Ne=fe-_e*mt(de.depth),Ue=Me+_e*mt(jt.depth),en=(ae,he)=>o?{x:ae,y:he}:{x:he,y:ae},An=10,cn=de.cross+Ut*(de.thick/2+An),se=jt.cross+Ut*(jt.thick/2+An);kt.set(Ot.edgeIdx,[en(de.cross,fe),en(cn,Ne),en(te,Ne),en(te,Ue),en(se,Ue),en(jt.cross,Me)])}let _t=new Map;for(let Ot of I){let Ut=M.get(Ot.a),oe=M.get(Ot.b),Ee=j[Ut.rank],de=Ee-(Ut.depth/2+26),jt=(te,fe)=>o?{x:te,y:fe}:{x:fe,y:te};_t.set(Ot.edgeIdx,[jt(Ut.cross,Ee),jt(Ut.cross,de),jt(oe.cross,de),jt(oe.cross,Ee)])}let yt=[];for(let Ot=0;Ot<t.edges.length;Ot++){let Ut=t.edges[Ot];if(!i.has(Ut.source)||!i.has(Ut.target))continue;let oe;if(Ut.source===Ut.target){let Ee=rt(M.get(Ut.source));oe=[Ee,Ee]}else if(kt.has(Ot))oe=kt.get(Ot);else if(_t.has(Ot))oe=_t.get(Ot);else{let Ee=tt.get(Ot);if(!Ee)continue;oe=Ee.map(de=>rt(M.get(de)))}yt.push({source:Ut.source,target:Ut.target,...Ut.label!==void 0&&{label:Ut.label},bidirectional:Ut.bidirectional,lineNumber:Ut.lineNumber,points:oe,yOffset:0,parallelCount:1,metadata:Ut.metadata})}let St=new Map(ut.map(Ot=>[Ot.label,{l:Ot.x-Ot.width/2,r:Ot.x+Ot.width/2,t:Ot.y-Ot.height/2,b:Ot.y+Ot.height/2}])),Ct=Ot=>{let Ut=0,oe=Ot,Ee=new Set;for(;oe&&!Ee.has(oe);)Ee.add(oe),oe=s.get(oe)?.parentGroup,oe&&Ut++;return Ut},ht=new Map;for(let Ot of t.groups)Ot.parentGroup&&(ht.get(Ot.parentGroup)??ht.set(Ot.parentGroup,[]).get(Ot.parentGroup)).push(Ot.label);let Pt=new Map,Dt=[...t.groups].sort((Ot,Ut)=>Ct(Ut.label)-Ct(Ot.label)),qt=[];for(let Ot of Dt){let Ut=1/0,oe=-1/0,Ee=1/0,de=-1/0,jt=Ne=>{Ut=Math.min(Ut,Ne.l),oe=Math.max(oe,Ne.r),Ee=Math.min(Ee,Ne.t),de=Math.max(de,Ne.b)};for(let Ne of Ot.children){let Ue=St.get(Ne);Ue&&jt(Ue)}for(let Ne of ht.get(Ot.label)??[]){let Ue=Pt.get(Ne);Ue&&jt(Ue)}if(!Number.isFinite(Ut))continue;let te=Ut-Ru,fe=oe+Ru,Me=Ee-LD,_e=de+Ru;Pt.set(Ot.label,{l:te,r:fe,t:Me,b:_e}),qt.push({label:Ot.label,lineNumber:Ot.lineNumber,x:(te+fe)/2,y:(Me+_e)/2,width:fe-te,height:_e-Me,collapsed:!1,childCount:Ot.children.length})}let Wt=1/0,Ft=1/0,Xt=-1/0,zt=-1/0,xt=(Ot,Ut,oe,Ee)=>{Wt=Math.min(Wt,Ot),Ft=Math.min(Ft,Ut),Xt=Math.max(Xt,oe),zt=Math.max(zt,Ee)};for(let Ot of ut)xt(Ot.x-Ot.width/2,Ot.y-Ot.height/2,Ot.x+Ot.width/2,Ot.y+Ot.height/2);for(let Ot of yt)for(let Ut of Ot.points)xt(Ut.x,Ut.y,Ut.x,Ut.y);for(let Ot of qt)xt(Ot.x-Ot.width/2,Ot.y-Ot.height/2,Ot.x+Ot.width/2,Ot.y+Ot.height/2);let $t=Bl-Wt,Zt=Bl-Ft,re=$t!==0||Zt!==0;return{nodes:re?ut.map(Ot=>({...Ot,x:Ot.x+$t,y:Ot.y+Zt})):ut,edges:re?yt.map(Ot=>({...Ot,points:Ot.points.map(Ut=>({x:Ut.x+$t,y:Ut.y+Zt}))})):yt,groups:re?qt.map(Ot=>({...Ot,x:Ot.x+$t,y:Ot.y+Zt})):qt,width:Xt+$t+Bl,height:zt+Zt+Bl}}}var xct,wct,Ect,Bl,Ru,LD,kct,Sct,Mct,vct,Lct,v7=dt(()=>{"use strict";Au();xct=50,wct=60,Ect=10,Bl=40,Ru=16,LD=32,kct=24,Sct=LD+2*Ru,Mct=1,vct=2,Lct=8});function Q0(t){let e=1/0,n=1/0,r=-1/0,o=-1/0;for(let a of t)e=Math.min(e,J0(a)),n=Math.min(n,e2(a)),r=Math.max(r,t2(a)),o=Math.max(o,n2(a));return{x:(e+r)/2,y:(n+o)/2,width:r-e,height:o-n}}function _D(t,e){let n=e.x-t.x,r=e.y-t.y,o=n===0?1/0:t.width/2/Math.abs(n),a=r===0?1/0:t.height/2/Math.abs(r),i=Math.min(o,a);return Number.isFinite(i)?{x:t.x+n*i,y:t.y+r*i}:{x:t.x,y:t.y}}function AD(t){let{parsed:e,collapseInfo:n,collapsedGroupLabels:r,previousPositions:o,sizes:a}=t,i=o,s=new Map;for(let T of e.nodes){let N=i.get(T.label),I=a.get(T.label);if(!N||!I)return null;s.set(T.label,{x:N.x,y:N.y,width:I.width,height:I.height})}let l=new Map;for(let T of n.originalGroups)l.set(T.label,T);let c=(T,N=new Set)=>{if(N.has(T))return[];N.add(T);let I=l.get(T);if(!I)return[];let G=[];for(let $ of I.children)l.has($)?G.push(...c($,N)):G.push($);return G},d=[];for(let T of r){let N=i.get(as(T));if(N){s.set(as(T),{x:N.x,y:N.y,width:xa,height:60});continue}let I=c(T);if(I.length===0)return null;let G=[];for(let A of I){let D=i.get(A);if(!D)return null;G.push({x:D.x,y:D.y,width:xa,height:60})}let $=Q0(G);s.set(as(T),{x:$.x,y:$.y,width:xa,height:60}),d.push({label:T,memberBbox:$})}let u=new Map(e.groups.map(T=>[T.label,T])),f=new Set,m=(T,N=new Set)=>{if(N.has(T))return[];N.add(T);let I=u.get(T);if(!I)return[];let G=[];for(let $ of I.children)u.has($)?G.push(...m($,N)):s.has($)?G.push($):s.has(as($))&&G.push(as($));return G},p=[];for(let T of e.groups){if(T.parentGroup)continue;let N=m(T.label);if(N.length!==0){for(let I of N)f.add(I);p.push(N)}}for(let T of s.keys())f.has(T)||p.push([T]);let h=["x","y"];for(let{label:T,memberBbox:N}of d){let I=s.get(as(T));for(let G of h){let $=G==="x"?"width":"height",A=G==="x"?e2:J0,D=G==="x"?n2:t2,O=G==="x"?J0:e2,P=G==="x"?t2:n2,H=N[$]-I[$];if(H<=0)continue;let W=X=>Q0(X.map(z=>s.get(z))),B=[],q=[];for(let X of p){let z=W(X);O(z)>=I[G]&&!X.includes(as(T))?B.push(X):q.push(...X.map(U=>s.get(U)))}if(B.length===0)continue;let V=H;for(let X of B){let z=W(X);for(let U of q)!(A(z)<D(U)-4&&D(z)>A(U)+4)||P(U)>O(z)||(V=Math.min(V,O(z)-P(U)-Tct))}if(!(V<=0))for(let X of B)for(let z of X){let U=s.get(z);s.set(z,{...U,[G]:U[G]-V})}}}let g=new Map,x=(T,N=new Set)=>{if(g.has(T))return g.get(T);if(N.has(T))return null;N.add(T);let I=u.get(T);if(!I)return null;let G=[];for(let D of I.children)if(u.has(D)){let O=x(D,N);O&&G.push(O)}else s.has(D)?G.push(s.get(D)):s.has(as(D))&&G.push(s.get(as(D)));if(G.length===0)return null;let $=Q0(G),A={x:$.x,y:$.y-TD/2,width:$.width+2*ND,height:$.height+2*ND+TD};return g.set(T,A),A};for(let T of e.groups)if(!x(T.label))return null;let y=[...s.values()];for(let T=0;T<y.length;T++)for(let N=T+1;N<y.length;N++){let I=y[T],G=y[N];if(Math.abs(I.x-G.x)<(I.width+G.width)/2-4&&Math.abs(I.y-G.y)<(I.height+G.height)/2-4)return null}let b=T=>{let N=s.get(T);if(N)return N;if(T.startsWith("__group_")){let I=T.slice(8);return g.get(I)??null}return g.get(T)??null},w=[];for(let T of e.edges){let N=b(T.source),I=b(T.target);if(!N||!I)return null;w.push({source:T.source,target:T.target,...T.label!==void 0&&{label:T.label},bidirectional:T.bidirectional,lineNumber:T.lineNumber,points:[_D(N,I),_D(I,N)],yOffset:0,parallelCount:1,metadata:T.metadata})}let k=[...s.values(),...g.values()],C=Q0(k),v=Z0-J0(C),_=Z0-e2(C),R=T=>({...T,x:T.x+v,y:T.y+_}),L=e.nodes.map(T=>{let N=R(s.get(T.label));return{label:T.label,x:N.x,y:N.y,width:N.width,height:N.height}}),E=e.groups.map(T=>{let N=R(g.get(T.label));return{label:T.label,lineNumber:T.lineNumber,x:N.x,y:N.y,width:N.width,height:N.height,collapsed:!1,childCount:T.children.length}});for(let T of r){let N=R(s.get(as(T)));E.push({label:T,lineNumber:0,x:N.x,y:N.y,width:N.width,height:N.height,collapsed:!0,childCount:n.collapsedChildCounts.get(T)??0})}let M=w.map(T=>({...T,points:T.points.map(N=>({x:N.x+v,y:N.y+_}))})),S=R(C);return{nodes:L,edges:M,groups:E,width:t2(S)+Z0,height:n2(S)+Z0}}var ND,TD,Z0,Tct,as,J0,t2,e2,n2,RD=dt(()=>{"use strict";Au();ND=16,TD=32,Z0=40,Tct=36,as=t=>`__group_${t}`,J0=t=>t.x-t.width/2,t2=t=>t.x+t.width/2,e2=t=>t.y-t.height/2,n2=t=>t.y+t.height/2});var BD={};ue(BD,{countEdgeNearMiss:()=>Yct,countEdgeNodePierces:()=>GD,countEdgeOverlaps:()=>$D,countGroupOverlaps:()=>a2,countSplineCrossings:()=>OD,deroutePierces:()=>L7,detectEdgeNodePierces:()=>N7,detectEdgeOverlaps:()=>r2,detectGroupOverlaps:()=>Vct,layoutBoxesAndLinesSearch:()=>Kct,separateGroupBands:()=>qD});function Oct(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function $ct(t,e){let n=t.slice();for(let r=n.length-1;r>0;r--){let o=Math.floor(e()*(r+1));[n[r],n[o]]=[n[o],n[r]]}return n}function Bct(t){let e=t.match(qct)??[],n=[],r=0,o=0,a=0,i="",s=()=>parseFloat(e[r++]),l=(c,d,u,f)=>{for(let m=0;m<=1;m+=.12){let p=1-m;u?n.push({x:p*p*p*c.x+3*p*p*m*d.x+3*p*m*m*u.x+m*m*m*f.x,y:p*p*p*c.y+3*p*p*m*d.y+3*p*m*m*u.y+m*m*m*f.y}):n.push({x:p*p*c.x+2*p*m*d.x+m*m*f.x,y:p*p*c.y+2*p*m*d.y+m*m*f.y})}};for(;r<e.length;){let c=e[r];if(/[MLQC]/i.test(c)&&(i=c,r++),i==="M"||i==="L"){let d=s(),u=s();n.push({x:d,y:u}),o=d,a=u}else if(i==="Q"){let d={x:s(),y:s()},u={x:s(),y:s()};l({x:o,y:a},d,null,u),o=u.x,a=u.y}else if(i==="C"){let d={x:s(),y:s()},u={x:s(),y:s()},f={x:s(),y:s()};l({x:o,y:a},d,u,f),o=f.x,a=f.y}else r++}return n}function C7(t){let e=t.edges,n=ID.get(e);if(n)return n;let r=t.edges.map(o=>{let a=o.points.length>=2?Bct(Gct(o.points)??""):[],i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of a)d.x<i&&(i=d.x),d.x>l&&(l=d.x),d.y<s&&(s=d.y),d.y>c&&(c=d.y);return{pts:a,x0:i,y0:s,x1:l,y1:c}});return ID.set(e,r),r}function Hct(t,e,n,r){let o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(Math.abs(o)<1e-9)return null;let a=((n.x-t.x)*(r.y-n.y)-(n.y-t.y)*(r.x-n.x))/o,i=((n.x-t.x)*(e.y-t.y)-(n.y-t.y)*(e.x-t.x))/o;return a>0&&a<1&&i>0&&i<1?{x:t.x+a*(e.x-t.x),y:t.y+a*(e.y-t.y)}:null}function OD(t,e=1/0){let n=new Map;for(let s of t.nodes)n.set(s.label,{x:s.x,y:s.y});for(let s of t.groups)s.collapsed&&n.set("__group_"+s.label,{x:s.x,y:s.y});let r=C7(t),o=t.edges,a=34,i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){let c=r[s],d=r[l];if(c.pts.length<2||d.pts.length<2||c.x1<d.x0||d.x1<c.x0||c.y1<d.y0||d.y1<c.y0)continue;let u=o[s],f=o[l],m,p;(u.source===f.source||u.source===f.target)&&(m=n.get(u.source)),(u.target===f.source||u.target===f.target)&&(p=n.get(u.target));let h=[],g=c.pts,x=d.pts;for(let y=1;y<g.length;y++){let b=g[y-1],w=g[y],k=b.x<w.x?b.x:w.x,C=b.x>w.x?b.x:w.x,v=b.y<w.y?b.y:w.y,_=b.y>w.y?b.y:w.y;for(let R=1;R<x.length;R++){let L=x[R-1],E=x[R];if(C<(L.x<E.x?L.x:E.x)||(L.x>E.x?L.x:E.x)<k||_<(L.y<E.y?L.y:E.y)||(L.y>E.y?L.y:E.y)<v)continue;let M=Hct(b,w,L,E);M&&(m&&Math.hypot(M.x-m.x,M.y-m.y)<a||p&&Math.hypot(M.x-p.x,M.y-p.y)<a||h.some(S=>Math.hypot(S.x-M.x,S.y-M.y)<6)||h.push(M))}}if(i+=h.length,i>e)return i}return i}function Fct(t,e,n){let r=n.x-e.x,o=n.y-e.y,a=r*r+o*o;if(a<1e-9)return Math.hypot(t.x-e.x,t.y-e.y);let i=((t.x-e.x)*r+(t.y-e.y)*o)/a;return i=Math.max(0,Math.min(1,i)),Math.hypot(t.x-(e.x+i*r),t.y-(e.y+i*o))}function Wct(t,e){let n=1/0;for(let r=1;r<e.length;r++)n=Math.min(n,Fct(t,e[r-1],e[r]));return n}function PD(t,e){let n=Math.max(e.x-e.w/2-t.x,0,t.x-(e.x+e.w/2)),r=Math.max(e.y-e.h/2-t.y,0,t.y-(e.y+e.h/2));return Math.hypot(n,r)}function r2(t,e){let n=e?.dist??8,r=e?.minLen??16,o=e?.nodeClear??12,a=new Map;for(let c of t.nodes)a.set(c.label,{x:c.x,y:c.y,w:c.width,h:c.height});for(let c of t.groups)c.collapsed&&a.set("__group_"+c.label,{x:c.x,y:c.y,w:c.width,h:c.height});let i=C7(t),s=t.edges,l=[];for(let c=0;c<i.length;c++)for(let d=c+1;d<i.length;d++){let u=i[c],f=i[d];if(u.pts.length<2||f.pts.length<2||u.x1+n<f.x0||f.x1+n<u.x0||u.y1+n<f.y0||f.y1+n<u.y0)continue;let m=s[c],p=s[d],h,g;(m.source===p.source||m.source===p.target)&&(h=a.get(m.source)),(m.target===p.source||m.target===p.target)&&(g=a.get(m.target));let x=[],y=0,b=()=>{y>=r&&x.length>=2&&l.push({mid:x[Math.floor(x.length/2)],length:y,pts:x.slice()}),x=[],y=0};for(let w of u.pts)!(h!==void 0&&PD(w,h)<o||g!==void 0&&PD(w,g)<o)&&Wct(w,f.pts)<n?(x.length&&(y+=Math.hypot(w.x-x[x.length-1].x,w.y-x[x.length-1].y)),x.push(w)):b();b()}return l}function $D(t,e){return r2(t,e).length}function N7(t,e){let n=e?.inset??6,r=e?.minPts??2,o=[];for(let l of t.nodes)o.push({key:l.label,x:l.x,y:l.y,w:l.width,h:l.height});for(let l of t.groups)l.collapsed&&o.push({key:"__group_"+l.label,x:l.x,y:l.y,w:l.width,h:l.height});let a=(l,c)=>Math.abs(l.x-c.x)<c.w/2-n&&Math.abs(l.y-c.y)<c.h/2-n,i=[],s=C7(t);return t.edges.forEach((l,c)=>{if(l.points.length<2)return;let d=s[c].pts;for(let u of o){if(u.key===l.source||u.key===l.target||"__group_"+u.key===l.source||"__group_"+u.key===l.target)continue;let f=d.filter(m=>a(m,u));f.length>=r&&i.push({edgeIdx:c,node:u.key,pts:f})}}),i}function GD(t,e){return N7(t,e).length}function L7(t){let e=N7(t);if(!e.length)return t;let n=new Map;for(let a of t.nodes)n.set(a.label,{x:a.x,y:a.y,w:a.width,h:a.height});for(let a of t.groups)a.collapsed&&n.set("__group_"+a.label,{x:a.x,y:a.y,w:a.width,h:a.height});let r=new Map;for(let a of e){let i=r.get(a.edgeIdx);i?i.push(a.node):r.set(a.edgeIdx,[a.node])}let o=t.edges.map((a,i)=>{let s=r.get(i);if(!s)return a;let l=a.points.map(c=>({x:c.x,y:c.y}));for(let c of s){let d=n.get(c);d&&(l=zct(l,d))}return{...a,points:l}});return{...t,edges:o}}function zct(t,e){if(t.length<2)return t;let n={x:e.x,y:e.y},r=-1,o=0,a=1/0,i=t[0];for(let k=0;k<t.length-1;k++){let C=t[k],v=t[k+1],_=v.x-C.x,R=v.y-C.y,L=_*_+R*R||1e-9,E=((n.x-C.x)*_+(n.y-C.y)*R)/L;E=Math.max(0,Math.min(1,E));let M={x:C.x+E*_,y:C.y+E*R},S=Math.hypot(M.x-n.x,M.y-n.y);S<a&&(a=S,r=k,o=E,i=M)}if(r<0)return t;let s=i.x-n.x,l=i.y-n.y;Math.hypot(s,l)<1&&(e.w<=e.h?(s=1,l=0):(s=0,l=1));let c=Math.hypot(s,l)||1;s/=c,l/=c;let d=t[r],u=t[r+1],f=u.x-d.x,m=u.y-d.y,p=Math.hypot(f,m)||1;f/=p,m/=p;let h=Math.hypot(e.w,e.h)/2+18,g=Math.hypot(e.w,e.h)/2,x={x:i.x-f*g+s*h*.5,y:i.y-m*g+l*h*.5},y={x:n.x+s*h,y:n.y+l*h},b={x:i.x+f*g+s*h*.5,y:i.y+m*g+l*h*.5},w=t.slice(0,r+1);return w.push(x,y,b),w.push(...t.slice(r+1)),w}function Yct(t,e){let n=e?.near??14,r=e?.tight??8,o=e?.minLen??18,a=r2(t,{dist:n,minLen:o}).length,i=r2(t,{dist:r,minLen:o}).length;return Math.max(0,a-i)}function Vct(t,e){let n=e?.margin??4,r=t.groups.map(s=>({label:s.label,l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-o2}:s),i=new Set;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&(i.add(r[s].label),i.add(r[l].label))}return[...i]}function a2(t,e){let n=e?.margin??4,r=t.groups.map(s=>({l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-o2}:s),i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&i++}return i}function qD(t,e){if(t.groups.some(N=>N.collapsed)||a2(t)===0)return t;let n=new Map;for(let N of e.groups)n.set(N.label,N.parentGroup);let r=N=>{let I=N,G=new Set;for(;;){let $=n.get(I);if(!$||G.has($))return I;G.add(I),I=$}},o=e.groups.filter(N=>!N.parentGroup).map(N=>N.label);if(o.length<2)return t;let a=new Map;for(let N of e.groups)for(let I of N.children)e.groups.some(G=>G.label===I)||a.set(I,r(N.label));let i=e.direction==="TB"?"x":"y",s=new Map(t.groups.map(N=>[N.label,N])),l=o.map(N=>{let I=s.get(N),G=(i==="y"?I.height:I.width)/2,$=(i==="y"?I.y:I.x)-G,A=(i==="y"?I.y:I.x)+G,D=e.groups.some(O=>O.parentGroup===N);return i==="y"&&D&&($-=o2),{label:N,lo:$,hi:A,c:($+A)/2}});l.sort((N,I)=>N.c-I.c);let c=16,d=l.map(N=>(N.hi-N.lo)/2),u=[0];for(let N=1;N<l.length;N++)u[N]=u[N-1]+d[N-1]+c+d[N];let f=l.map((N,I)=>N.c-u[I]),m=[];for(let N=0;N<l.length;N++){let I={pos:f[N],count:1,sum:f[N],first:N};for(;m.length&&m[m.length-1].pos>=I.pos;){let G=m.pop(),$=G.count+I.count,A=G.sum+I.sum;I={pos:A/$,count:$,sum:A,first:G.first}}m.push(I)}let p=new Array(l.length);for(let N of m)for(let I=0;I<N.count;I++)p[N.first+I]=N.pos+u[N.first+I];let h=new Map,g=!1;if(l.forEach((N,I)=>{let G=p[I]-N.c;h.set(N.label,G),Math.abs(G)>.5&&(g=!0)}),!g)return t;let x=N=>{if(N.startsWith("__group_"))return h.get(r(N.slice(8)))??0;let I=a.get(N);return I?h.get(I)??0:0},y=(N,I)=>i==="y"?{x:N.x,y:N.y+I}:{x:N.x+I,y:N.y},b=t.nodes.map(N=>{let I=x(N.label);return I?{...N,...i==="y"?{y:N.y+I}:{x:N.x+I}}:N}),w=t.groups.map(N=>{let I=h.get(r(N.label))??0;return I?{...N,...i==="y"?{y:N.y+I}:{x:N.x+I}}:N}),k=t.edges.map(N=>{let I=x(N.source),G=x(N.target);if(!I&&!G)return N;let $=N.points.length,A=N.points.map((D,O)=>{let P=$>1?O/($-1):0;return y(D,I*(1-P)+G*P)});return{...N,points:A}}),C=1/0,v=1/0,_=-1/0,R=-1/0,L=(N,I)=>{N<C&&(C=N),N>_&&(_=N),I<v&&(v=I),I>R&&(R=I)};for(let N of b)L(N.x-N.width/2,N.y-N.height/2),L(N.x+N.width/2,N.y+N.height/2);for(let N of w)L(N.x-N.width/2,N.y-N.height/2-o2),L(N.x+N.width/2,N.y+N.height/2);for(let N of k)for(let I of N.points)L(I.x,I.y);let E=40,M=E-C,S=E-v,T=M!==0||S!==0;return{nodes:T?b.map(N=>({...N,x:N.x+M,y:N.y+S})):b,groups:T?w.map(N=>({...N,x:N.x+M,y:N.y+S})):w,edges:T?k.map(N=>({...N,points:N.points.map(I=>({x:I.x+M,y:I.y+S}))})):k,width:_-C+2*E,height:R-v+2*E}}function Uct(t,e,n,r){let o=e.x-t.x,a=e.y-t.y,i=r.x-n.x,s=r.y-n.y,l=o*s-a*i;if(Math.abs(l)<1e-9)return!1;let c=((n.x-t.x)*s-(n.y-t.y)*i)/l,d=((n.x-t.x)*a-(n.y-t.y)*o)/l;return c>.001&&c<.999&&d>.001&&d<.999}function DD(t){let e=t.edges.filter(o=>o.points.length>=2),n=e.map(o=>{let a=1/0,i=1/0,s=-1/0,l=-1/0;for(let c of o.points)c.x<a&&(a=c.x),c.x>s&&(s=c.x),c.y<i&&(i=c.y),c.y>l&&(l=c.y);return{x0:a,y0:i,x1:s,y1:l}}),r=0;for(let o=0;o<e.length;o++)for(let a=o+1;a<e.length;a++){let i=e[o],s=e[a];if(i.source===s.source||i.source===s.target||i.target===s.source||i.target===s.target)continue;let l=n[o],c=n[a];if(l.x1<c.x0||c.x1<l.x0||l.y1<c.y0||c.y1<l.y0)continue;let d=i.points,u=s.points,f=!1;for(let m=0;m<d.length-1&&!f;m++)for(let p=0;p<u.length-1;p++)if(Uct(d[m],d[m+1],u[p],u[p+1])){f=!0;break}f&&r++}return r}function Xct(t,e){if(!e?.size)return 0;let n=0,r=0;for(let o of t.nodes){let a=e.get(o.label);a&&(n+=Math.hypot(o.x-a.x,o.y-a.y),r++)}return r?n/r:0}function jct(t){let e=0;for(let n of t.edges)for(let r=1;r<n.points.length;r++)e+=Math.hypot(n.points[r].x-n.points[r-1].x,n.points[r].y-n.points[r-1].y);return e}async function Kct(t,e,n){let r=n?.hideDescriptions??!1,o=n?.reserveEdgeLabels??!1,a=n?.onProgress,i=a?()=>new Promise(F=>setTimeout(F)):()=>{},s=150,l=30,c=performance.now(),d=c,u=n?.budgetMs??Dct,f=()=>u>0&&performance.now()-c>u,m=new Set;if(e){let F=new Set;for(let j of e.originalGroups)t.groups.some(Q=>Q.label===j.label)||F.add(j.label);for(let j of F){let Z=e.originalGroups.find(ot=>ot.label===j)?.parentGroup;(!Z||!F.has(Z))&&m.add(j)}}let p=new Map,h=0;for(let F of t.nodes){let j=r?{width:xa,height:60}:T7(F,t.showValues!==!1);p.set(F.label,j),!r&&F.description&&F.description.length>0&&(h=Math.max(h,j.height))}if(h>0){for(let F of t.nodes)if(F.description&&F.description.length>0){let j=p.get(F.label);p.set(F.label,{width:j.width,height:h})}}let g=F=>`__group_${F}`,x=t.direction==="TB"?"TB":"LR";if(n?.stableCollapse&&e&&m.size>0&&n.previousPositions){let F=AD({parsed:t,collapseInfo:e,collapsedGroupLabels:m,previousPositions:n.previousPositions,sizes:p,rankdir:x});if(F)return F}let y=new Set(t.nodes.map(F=>F.label)),b=new Map,w=new Map;for(let F of t.groups)if(b.set(F.label,F.children.filter(j=>y.has(j))),F.parentGroup){let j=w.get(F.parentGroup)??[];j.push(F.label),w.set(F.parentGroup,j)}let k=new Map,C=F=>{let j=k.get(F);if(j)return j;k.set(F,[]);let Q=[...b.get(F)??[]];for(let Z of w.get(F)??[])Q.push(...C(Z));return k.set(F,Q),Q},v=new Map,_=new Map;for(let F of t.groups){let j=C(F.label);if(j.length===0)continue;let Q=new Set(j),Z=new Map;for(let tt of t.edges)if(Q.has(tt.source)&&Q.has(tt.target)){let it=Z.get(tt.target)??[];it.push(tt.source),Z.set(tt.target,it)}let ot=new Map,at=new Set,lt=tt=>{let it=ot.get(tt);if(it!==void 0)return it;if(at.has(tt))return 0;at.add(tt);let st=0;for(let ct of Z.get(tt)??[])st=Math.max(st,lt(ct)+1);return at.delete(tt),ot.set(tt,st),st},rt=j[0],ut=j[0];for(let tt of j)lt(tt)>lt(rt)&&(rt=tt),lt(tt)<lt(ut)&&(ut=tt);v.set(g(F.label),rt),_.set(g(F.label),ut)}let R=F=>v.get(F)??F,L=F=>_.get(F)??F,E=F=>`${F.source}->${F.target}#${F.lineNumber}`,M=(F,j)=>{let Q=j.x-F.x,Z=j.y-F.y,ot=Q===0?1/0:F.w/2/Math.abs(Q),at=Z===0?1/0:F.h/2/Math.abs(Z),lt=Math.min(ot,at);return Number.isFinite(lt)?{x:F.x+Q*lt,y:F.y+Z*lt}:{x:F.x,y:F.y}},S=(F,j)=>Math.abs(F.x-j.x)<=j.w/2&&Math.abs(F.y-j.y)<=j.h/2;function T(F){let j=F.seed===void 0?null:Oct(F.seed+1),Q=it=>j?$ct(it,j):it.slice(),Z=new dr.graphlib.Graph({compound:!0,multigraph:!0});Z.setGraph({rankdir:x,ranker:F.ranker,nodesep:F.nodesep,ranksep:F.ranksep,edgesep:20,marginx:40,marginy:40}),Z.setDefaultEdgeLabel(()=>({}));for(let it of Q(t.groups))Z.setNode(g(it.label),{label:it.label});for(let it of Q(t.nodes)){let st=p.get(it.label);Z.setNode(it.label,{width:st.width,height:st.height})}for(let it of m)Z.setNode(g(it),{width:xa,height:60});for(let it of t.groups){it.parentGroup&&Z.hasNode(g(it.parentGroup))&&Z.setParent(g(it.label),g(it.parentGroup));for(let st of Q(it.children))Z.hasNode(st)&&Z.setParent(st,g(it.label))}if(e)for(let it of m){let st=e.originalGroups.find(ct=>ct.label===it);st?.parentGroup&&!m.has(st.parentGroup)&&Z.hasNode(g(st.parentGroup))&&Z.setParent(g(it),g(st.parentGroup))}for(let it of Q(t.edges)){let st=R(it.source),ct=L(it.target);if(st!==ct&&Z.hasNode(st)&&Z.hasNode(ct)){let pt={};if(o&&it.label){let mt=k7(it.label,j0);pt={width:mt.width,height:mt.height,labelpos:"c"}}Z.setEdge(st,ct,pt,E(it))}}dr.layout(Z);let ot=t.nodes.map(it=>{let st=Z.node(it.label);return{label:it.label,x:st.x,y:st.y,width:st.width,height:st.height}}),at=t.groups.map(it=>{let st=Z.node(g(it.label));return{label:it.label,lineNumber:it.lineNumber,x:st.x,y:st.y,width:st.width,height:st.height,collapsed:!1,childCount:it.children.length}});for(let it of m){let st=Z.node(g(it));at.push({label:it,lineNumber:0,x:st.x,y:st.y,width:st.width,height:st.height,collapsed:!0,childCount:e?.collapsedChildCounts.get(it)??0})}let lt=new Map;for(let it of t.groups){let st=Z.node(g(it.label));st&<.set(g(it.label),{x:st.x,y:st.y,w:st.width,h:st.height})}let rt=(it,st,ct)=>{if(it.length<2)return it;let pt=it,mt=lt.get(st);if(mt){let gt=0;for(;gt<pt.length-1&&S(pt[gt],mt);)gt++;pt=[M(mt,pt[gt]),...pt.slice(gt)]}let bt=lt.get(ct);if(bt){let gt=pt.length-1;for(;gt>0&&S(pt[gt],bt);)gt--;pt=[...pt.slice(0,gt+1),M(bt,pt[gt])]}return pt},ut=t.edges.flatMap(it=>{let st=R(it.source),ct=L(it.target),pt=E(it);if(st===ct||!Z.hasEdge(st,ct,pt))return[];let mt=Z.edge(st,ct,pt),bt=rt(mt?.points??[],it.source,it.target);return[{source:it.source,target:it.target,...it.label!==void 0&&{label:it.label},bidirectional:it.bidirectional,lineNumber:it.lineNumber,points:bt,yOffset:0,parallelCount:1,metadata:it.metadata}]}),tt=Z.graph();return{nodes:ot,edges:ut,groups:at,width:tt.width??800,height:tt.height??600}}let N=t.nodes.length,I=n?.seeds??(N<=12?80:N<=22?40:N<=35?22:10),G=n?.refineK??6,$=n?.lambda??_ct,A=n?.previousPositions,D=[];if(n?.configs)D.push(...n.configs);else{let F=["network-simplex","tight-tree","longest-path"],j=[{nodesep:50,ranksep:60},{nodesep:34,ranksep:46},{nodesep:66,ranksep:82}];for(let Q of F)for(let Z of j)D.push({ranker:Q,...Z});for(let Q=0;Q<I;Q++)D.push({ranker:"network-simplex",nodesep:50,ranksep:60,seed:Q})}let O=(F,j)=>{let Q=OD(F,j);return Q>j?1/0:Q+$D(F)+GD(F)+a2(F)},P=(F,j)=>j*1e6+jct(F)+$*Xct(F,A)*10,H=D.length+Math.min(n?.refineK??6,D.length),W=0,B=async F=>{if(!a)return;a(++W,H,F);let j=performance.now();j-c>s&&j-d>l&&(d=j,await i())},q=[],V=new Map;for(let F of D){try{let j=T(F);q.push(j),V.set(j,F)}catch{}if(await B("Optimizing layout"),q.length&&f())break}if(!q.length)return T({ranker:"network-simplex",nodesep:50,ranksep:60});let X=[];if(m.size===0)try{X=SD(t,p)}catch{}if(t.groups.length>0&&m.size===0)try{X=X.concat(CD(t,p))}catch{}let z=new Map;for(let F of q)z.set(F,P(F,DD(F)));q.sort((F,j)=>z.get(F)-z.get(j));let U=Math.min(G,q.length),Y=q[0],K=1/0,et=1/0,nt=F=>{let j=O(F,et);if(j===1/0)return;let Q=P(F,j);Q<K&&(K=Q,et=j,Y=F)},J=[];for(let F of q.slice(0,U)){nt(F);let j=V.get(F);j&&J.push(j),await B("Refining layout")}if(!n?.configs&&et>=Act&&N<=Rct){let F=[];for(let Q=I;Q<I+Ict;Q++){let Z={ranker:"network-simplex",nodesep:50,ranksep:60,seed:Q};try{let ot=T(Z);F.push(ot),V.set(ot,Z)}catch{}if(f())break}let j=new Map;for(let Q of F)j.set(Q,P(Q,DD(Q)));F.sort((Q,Z)=>j.get(Q)-j.get(Z));for(let Q of F.slice(0,Pct)){nt(Q);let Z=V.get(Q);Z&&J.push(Z)}}for(let F of X){let j=[F],Q=L7(F);Q!==F&&j.push(Q);for(let Z of j){let ot=O(Z,et-1);ot<et&&(et=ot,Y=Z)}}if(et>0){let F=L7(Y);F!==Y&&O(F,et-1)<et&&(Y=F)}if(et>0&&a2(Y)>0){let F=qD(Y,t);F!==Y&&O(F,et-1)<et&&(Y=F)}return n?.onTopConfigs?.(J),Y}var _ct,Act,Rct,Ict,Pct,Dct,Gct,qct,ID,o2,HD=dt(()=>{"use strict";$s();Fo();Au();_7();MD();v7();M7();RD();_ct=4,Act=4,Rct=45,Ict=18,Pct=10,Dct=5e3;Gct=lr().x(t=>t.x).y(t=>t.y).curve(To),qct=/[MLQC]|-?\d*\.?\d+(?:e-?\d+)?/gi;ID=new WeakMap;o2=32});var UD={};ue(UD,{computeNodeSize:()=>T7,layoutBoxesAndLines:()=>idt});function odt(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t.charAt(r-1),a=t.charAt(r),i=r+1<t.length?t.charAt(r+1):"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function adt(t,e=xa){let n=t.split(/[\s-]+/),r=[];for(let a of n)a&&r.push(...odt(a));let o=e-24;for(let a=13;a>=9;a--){if(o<Tt("MM",a))continue;let i=1,s="";for(let l of r){let c=s?`${s} ${l}`:l;Tt(c,a)<=o?s=c:(i++,s=l)}if(i<=R7)return Math.min(i,R7)}return R7}function T7(t,e){if(!t.description||t.description.length===0)return{width:xa,height:60};let n=Qct,o=adt(t.label,n)*13*tdt+edt,a=n-24,i=0;for(let c of t.description)Tt(c,A7)<=a?i+=1:i+=hn(c,A7,a,{hardBreak:!0}).length;i=Math.min(i,Jct);let s=i*A7*YD,l=o+VD+I7+s+I7+(e?rdt:0);return{width:n,height:Math.max(60,l)}}async function idt(t,e,n){let{layoutBoxesAndLinesSearch:r}=await Promise.resolve().then(()=>(HD(),BD)),o={...n?.hideDescriptions!==void 0&&{hideDescriptions:n.hideDescriptions},...n?.previousPositions!==void 0&&{previousPositions:n.previousPositions},...n?.stableCollapse!==void 0&&{stableCollapse:n.stableCollapse},...n?.onProgress!==void 0&&{onProgress:n.onProgress}},a,i=await r(t,e,{...o,onTopConfigs:l=>{a=l}}),s=S7(zD(i));if(s.unresolved.length>0){let l=await r(t,e,{...o,reserveEdgeLabels:!0,...a!==void 0&&a.length>0&&{configs:a}}),c=S7(zD(l));c.unresolved.length<s.unresolved.length&&(s=c)}return sdt(s.layout,t,n?.collapsedNotes)}function sdt(t,e,n){let o=e.options?.["no-notes"]==="on"||!e.notes?new Map:wo(e.notes,e.nodes.map(y=>({id:y.label,label:y.label})));if(o.size===0)return t;let a=Od(t.nodes.map(y=>({id:y.label,x:y.x,y:y.y,width:y.width,height:y.height})),o,e.direction==="TB"?"TB":"LR",n),i=t.nodes.map(y=>{let b=a.get(y.label);return b?{...y,note:b}:y}),s=1/0,l=1/0,c=-1/0,d=-1/0,u=(y,b,w,k)=>{y<s&&(s=y),b<l&&(l=b),w>c&&(c=w),k>d&&(d=k)};for(let y of i)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2),y.note&&!y.note.collapsed&&u(y.x+y.note.x,y.y+y.note.y,y.x+y.note.x+y.note.width,y.y+y.note.y+y.note.height);for(let y of t.groups)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2);if(!Number.isFinite(s))return{...t,nodes:i};let{shiftX:f,shiftY:m}=xl(s,l),p=f!==0||m!==0,h=p?i.map(y=>({...y,x:y.x+f,y:y.y+m})):i,g=p?t.edges.map(y=>({...y,points:y.points.map(b=>({x:b.x+f,y:b.y+m})),...y.labelX!==void 0&&{labelX:y.labelX+f},...y.labelY!==void 0&&{labelY:y.labelY+m}})):t.edges,x=p?t.groups.map(y=>({...y,x:y.x+f,y:y.y+m})):t.groups;return{nodes:h,edges:g,groups:x,width:c+f+FD,height:d+m+FD}}function zD(t){let e=new Map;if(t.edges.forEach((o,a)=>{let[i,s]=o.source<o.target?[o.source,o.target]:[o.target,o.source],l=`${i}\0${s}`,c=e.get(l);c?c.push(a):e.set(l,[a])}),[...e.values()].every(o=>o.length<2))return t;let n=new Array(t.edges.length).fill(0),r=new Array(t.edges.length).fill(1);for(let o of e.values()){let a=o.slice(0,WD);for(let i of o.slice(WD))r[i]=0;a.length<2||a.forEach((i,s)=>{n[i]=(s-(a.length-1)/2)*Zct,r[i]=a.length})}return{...t,edges:t.edges.map((o,a)=>({...o,yOffset:n[a],parallelCount:r[a]}))}}var FD,WD,Zct,Qct,A7,YD,I7,VD,Jct,R7,tdt,edt,ndt,rdt,_7=dt(()=>{"use strict";Au();Ve();M7();_s();FD=40,WD=5,Zct=22,Qct=140,A7=10,YD=1.4,I7=8,VD=4,Jct=6,R7=3,tdt=1.3,edt=12,ndt=11,rdt=VD+ndt*YD+I7});var oO={};ue(oO,{layoutSwimlane:()=>ddt});function cdt(t){return t==="exclusive"||t==="parallel"?{w:jD,h:jD}:t==="terminal"?{w:KD,h:KD}:{w:D7,h:nO}}function eO(t,e,n,r){let o=new Map,a=new Map;for(let c of t)o.set(c,[]),a.set(c,0);for(let c of e)o.get(c.from)?.push(c.to),a.set(c.to,(a.get(c.to)??0)+1);let i=new Map(t.map(c=>[c,0])),s=new Map;for(let c of t)s.set(c,new Map);let l=t.filter(c=>(a.get(c)??0)===0);for(let c=0;c<l.length;c++){let d=l[c],u=n(d),f=s.get(d),m=r?.get(d);m!==void 0&&(i.get(d)??0)<m&&i.set(d,m);let p=f.get(u);p!==void 0&&(i.get(d)??0)<=p&&i.set(d,p+1);let h=i.get(d),g=new Map(f);g.set(u,Math.max(g.get(u)??-1,h));for(let x of o.get(d)??[]){let y=h+(n(x)===u?1:0);y>(i.get(x)??0)&&i.set(x,y);let b=s.get(x);for(let[k,C]of g)C>(b.get(k)??-1)&&b.set(k,C);let w=(a.get(x)??0)-1;a.set(x,w),w===0&&l.push(x)}}return i}function ddt(t){let n=t.direction==="LR",r=new Map(t.nodes.map(F=>[F.id,F])),o=t.nodes.map(F=>F.id),a=new Map(t.nodes.map(F=>[F.id,cdt(F.shape)])),i=F=>{let j=a.get(F);return n?j.w:j.h},s=F=>{let j=a.get(F);return n?j.h:j.w},l=t.edges.map((F,j)=>({from:F.source,to:F.target,idx:j})).filter(F=>F.from!==F.to&&r.has(F.from)&&r.has(F.to)),{dag:c}=K0(o,l),d=F=>r.get(F).lane,u=eO(o,c.map(F=>({from:F.from,to:F.to})),d),f=new Map;for(let F of o)f.set(F,u.get(F)??0);{let F=new Map(t.lanes.map((Z,ot)=>[Z.id,ot])),j=c.map(Z=>({from:Z.from,to:Z.to})),Q=new Map;for(let Z=0;Z<o.length;Z++){let ot=!1;for(let at of l)if(!((f.get(at.to)??0)>=(f.get(at.from)??0)))for(let lt of[at.from,at.to]){let rt=f.get(lt),ut=F.get(d(lt));for(let tt of o)tt===at.from||tt===at.to||f.get(tt)===rt&&((F.get(d(tt))??0)<=ut||(Q.get(tt)??0)<=rt&&(Q.set(tt,rt+1),ot=!0))}if(!ot)break;f=eO(o,j,d,Q)}}let m=Array.from(new Set(o.map(F=>f.get(F)))).sort((F,j)=>F-j),p=new Map(m.map((F,j)=>[F,j])),h=m.length,g=F=>p.get(f.get(F))??0,x=ZD+i2,y=Array.from({length:h},()=>0);for(let F of o){let j=g(F);y[j]=Math.max(y[j],i(F))}let b=[],w=[];{let F=x;for(let j=0;j<h;j++){let Q=Math.max(y[j],D7);w[j]=Q,b[j]=F+Q/2,F+=Q+XD}}let k=F=>b[F]+w[F]/2+XD/2,C=(h>0?b[h-1]+Math.max(y[h-1],D7)/2:x)+i2,v=(t.phases.length?QD:0)+i2,_=new Map;for(let F of t.nodes){let j=`${F.lane}\0${g(F.id)}`;(_.get(j)??_.set(j,[]).get(j)).push(F.id)}let R=(F,j)=>{let Q=_.get(`${F}\0${j}`)??[];return Q.length===0?0:Q.reduce((Z,ot)=>Z+s(ot),0)+P7*(Q.length-1)},L=new Map,E=new Map,M=new Map;{let F=v;for(let j of t.lanes){let Q=0;for(let ot=0;ot<h;ot++)Q=Math.max(Q,R(j.id,ot));let Z=Math.max(ldt,Q+2*rO);L.set(j.id,F),E.set(j.id,Z),M.set(j.id,F+Z/2),F+=Z}}let S=(()=>{let F=v;for(let j of t.lanes)F+=E.get(j.id);return F})(),T=new Map,N=new Map;for(let[F,j]of _){let Q=F.indexOf("\0"),Z=F.slice(0,Q),ot=M.get(Z)??v,at=j.reduce((rt,ut)=>rt+s(ut),0)+P7*(j.length-1),lt=ot-at/2;for(let rt of j){let ut=s(rt);N.set(rt,lt+ut/2),lt+=ut+P7,T.set(rt,b[g(rt)])}}let I=0;for(let F of l)(f.get(F.to)??0)<(f.get(F.from)??0)&&I++;let $=I>0?JD+tO*(I-1):0,A=S+$+i2,D=(F,j)=>n?{x:F,y:j}:{x:j,y:F},O=t.nodes.map(F=>{let j=a.get(F.id),Q=D(T.get(F.id),N.get(F.id));return{id:F.id,label:F.label,shape:F.shape,event:F.event,lane:F.lane,...F.phase!==void 0&&{phase:F.phase},...F.color!==void 0&&{color:F.color},tags:F.tags,x:Q.x,y:Q.y,width:j.w,height:j.h,lineNumber:F.lineNumber}}),P=16,H=new Array(t.edges.length).fill(0);{let F=new Map;t.edges.forEach((j,Q)=>{let Z=r.get(j.source),ot=r.get(j.target);if(!Z||!ot||Z.id===ot.id)return;let at=f.get(Z.id)??0;if((f.get(ot.id)??0)<=at||Math.abs((N.get(Z.id)??0)-(N.get(ot.id)??0))<.5)return;let rt=`${j.target}\0${at}`;(F.get(rt)??F.set(rt,[]).get(rt)).push(Q)});for(let j of F.values())j.length<2||(j.sort((Q,Z)=>(N.get(t.edges[Q].source)??0)-(N.get(t.edges[Z].source)??0)),j.forEach((Q,Z)=>{H[Q]=(Z-(j.length-1)/2)*P}))}let W=4,B=(F,j,Q,Z,ot,at)=>{let lt=1/0;for(let it of o){if(it===F)continue;let st=i(it)/2+W;if(Math.abs(T.get(it)-j)>=st)continue;let ct=s(it)/2,pt=N.get(it);pt+ct<=Q||pt-ct>=Z||(lt=Math.min(lt,pt-ct))}if(lt===1/0)return{flow:j};let rt=ot-1,ut=ot<h-1?ot:-1,tt=at<j?rt:ut;return tt<0&&(tt=at<j?ut:rt),tt<0?{flow:j}:{flow:k(tt),jogCross:(Q+lt)/2}},q=0,V=[];t.edges.forEach((F,j)=>{let Q=r.get(F.source),Z=r.get(F.target);if(!Q||!Z||Q.id===Z.id)return;let ot=T.get(Q.id),at=N.get(Q.id),lt=T.get(Z.id),rt=N.get(Z.id),ut=i(Q.id)/2,tt=i(Z.id)/2,it=s(Q.id)/2,st=s(Z.id)/2,ct=f.get(Q.id)??0,pt=f.get(Z.id)??0,mt,bt=!1;if(pt>ct){let gt=ot+ut,Et=lt-tt;if(Math.abs(at-rt)<.5)mt=[D(gt,at),D(Et,rt)];else{let ft=(gt+Et)/2+H[j];mt=[D(gt,at),D(ft,at),D(ft,rt),D(Et,rt)]}}else if(pt===ct){let gt=rt>=at,Et=at+(gt?it:-it),ft=rt+(gt?-st:st);if(Math.abs(ot-lt)<.5)mt=[D(ot,Et),D(lt,ft)];else{let kt=(Et+ft)/2;mt=[D(ot,Et),D(ot,kt),D(lt,kt),D(lt,ft)]}}else{bt=!0;let gt=S+JD+tO*q;q++;let Et=at+it,ft=rt+st,kt=B(Q.id,ot,Et,gt,g(Q.id),lt),_t=B(Z.id,lt,ft,gt,g(Z.id),ot);mt=[D(ot,Et),...kt.jogCross!==void 0?[D(ot,kt.jogCross),D(kt.flow,kt.jogCross)]:[],D(kt.flow,gt),D(_t.flow,gt),..._t.jogCross!==void 0?[D(_t.flow,_t.jogCross),D(lt,_t.jogCross)]:[],D(lt,ft)]}V.push({source:F.source,target:F.target,...F.label!==void 0&&{label:F.label},points:mt,back:bt,lineNumber:F.lineNumber})});let X=(F,j,Q,Z)=>n?{x:F,y:Q,width:j,height:Z}:{x:Q,y:F,width:Z,height:j},z=t.lanes.map(F=>{let j=X(0,C,L.get(F.id),E.get(F.id));return{id:F.id,label:F.label,...F.color!==void 0&&{color:F.color},...j,headerSize:ZD,lineNumber:F.lineNumber}}),U=new Map(t.phases.map((F,j)=>[F.id,j])),Y=Array.from({length:h},()=>{});for(let F of t.nodes){if(F.phase===void 0)continue;let j=U.get(F.phase);if(j===void 0)continue;let Q=g(F.id),Z=Y[Q];(Z===void 0||j<Z)&&(Y[Q]=j)}let K=Array.from({length:h},()=>0),et=0;for(let F=0;F<h;F++){let j=Y[F];j!==void 0&&j>et&&(et=j),K[F]=et}let nt=(F,j)=>(b[F]+b[j])/2,J=[];if(t.phases.length>0&&h>0){let F=0;for(let j=1;j<=h;j++)if(j===h||K[j]!==K[F]){let Q=F,Z=j-1,ot=t.phases[K[F]],at=Q===0?0:nt(Q-1,Q),lt=Z===h-1?C:nt(Z,Z+1);J.push({id:ot.id,label:ot.label,...X(at,lt-at,0,A),headerSize:QD,lineNumber:ot.lineNumber}),F=j}}return{nodes:O,edges:V,lanes:z,phases:J,width:n?C:A,height:n?A:C}}var i2,XD,D7,nO,jD,KD,P7,rO,ldt,ZD,QD,JD,tO,aO=dt(()=>{"use strict";v7();i2=30,XD=64,D7=124,nO=44,jD=56,KD=40,P7=16,rO=22,ldt=nO+2*rO,ZD=116,QD=30,JD=28,tO=18});function Iu(t,e){let{idPrefix:n,width:r,height:o,baseFill:a,colors:i}=e,s=(l,c)=>{t.append("marker").attr("id",l).attr("viewBox",`0 0 ${r} ${o}`).attr("refX",r).attr("refY",o/2).attr("markerWidth",r).attr("markerHeight",o).attr("orient","auto").append("polygon").attr("points",`0,0 ${r},${o/2} 0,${o}`).attr("fill",c)};s(`${n}-arrow`,a);for(let l of i??[])s(`${n}-arrow-${l.replace("#","")}`,l)}var s2=dt(()=>{"use strict"});var dO={};ue(dO,{renderSwimlaneForExport:()=>xdt});function ydt(t,e){if(t.length<3)return t.map((o,a)=>`${a?"L":"M"}${o.x} ${o.y}`).join(" ");let n=`M${t[0].x} ${t[0].y}`;for(let o=1;o<t.length-1;o++){let a=t[o-1],i=t[o],s=t[o+1],l=Math.hypot(i.x-a.x,i.y-a.y),c=Math.hypot(s.x-i.x,s.y-i.y);if(l<.01||c<.01){n+=` L${i.x} ${i.y}`;continue}let d=Math.min(e,l/2,c/2),u=i.x-(i.x-a.x)/l*d,f=i.y-(i.y-a.y)/l*d,m=i.x+(s.x-i.x)/c*d,p=i.y+(s.y-i.y)/c*d;n+=` L${u} ${f} Q${i.x} ${i.y} ${m} ${p}`}let r=t[t.length-1];return n+=` L${r.x} ${r.y}`,n}function bdt(t,e,n,r,o,a){let i=o-n,s=a-r,l=i*i+s*s,c=l>0?((t-n)*i+(e-r)*s)/l:0;return c=Math.max(0,Math.min(1,c)),Math.hypot(t-(n+c*i),e-(r+c*s))}function lO(t,e,n,r,o={}){let a=Math.min(n,r)/2,i=Math.min(o.tl??0,a),s=Math.min(o.tr??0,a),l=Math.min(o.br??0,a),c=Math.min(o.bl??0,a);return[`M${t+i},${e}`,`H${t+n-s}`,s?`A${s},${s} 0 0 1 ${t+n},${e+s}`:"",`V${e+r-l}`,l?`A${l},${l} 0 0 1 ${t+n-l},${e+r}`:"",`H${t+c}`,c?`A${c},${c} 0 0 1 ${t},${e+r-c}`:"",`V${e+i}`,i?`A${i},${i} 0 0 1 ${t+i},${e}`:"","Z"].join(" ")}function xdt(t,e,n,r,o,a={}){It(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.title?40:0,s=a.exportDims?.width??n.width,l=(a.exportDims?.height??n.height)+0,c=It(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",s).attr("height",l).attr("viewBox",`0 0 ${s} ${l}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt),d=c.append("defs"),u=Ie(r,o),f={error:r.colors.red,success:r.colors.green,terminate:r.text,neutral:r.border};Iu(d,{idPrefix:"sw",width:hdt,height:gdt,baseFill:r.textMuted,colors:[f.error,f.success]});let m=c.append("g").attr("transform",`translate(0, ${i})`);e.title&&c.append("text").attr("class","chart-title").attr("x",s/2).attr("y",30).attr("text-anchor","middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).attr("data-line-number",String(e.titleLineNumber??1)).text(e.title);let p=new Map;e.lanes.forEach((E,M)=>{let S=E.color??Re(oc[M%oc.length],r)??r.border;p.set(E.id,S)});let h=e.direction==="LR",g=mn(e.options),x=E=>vt(E,u,9),y=E=>{for(let M of n.lanes){let S=h?M.y:M.x,T=S+(h?M.height:M.width);if(E>=S&&E<=T)return x(p.get(M.id)??r.border)}return u},b=m.append("g").attr("class","dgmo-swimlane-lanes");for(let E of n.lanes){let M=p.get(E.id)??r.border,S=h?E.x:E.x+c2,T=h?E.y+c2:E.y,N=h?E.width:E.width-c2*2,I=h?E.height-c2*2:E.height;b.append("path").attr("d",lO(S,T,N,I,{tl:qs,tr:qs,br:qs,bl:qs})).attr("fill",vt(M,u,9)).attr("stroke",vt(r.border,u,60)).attr("stroke-width",1).attr("data-line-number",String(E.lineNumber));let G=h?E.headerSize:N,$=h?I:E.headerSize;b.append("path").attr("d",lO(S,T,G,$,h?{tl:qs,bl:qs}:{tl:qs,tr:qs})).attr("fill",vt(M,u,16)).attr("opacity",.6),b.append("text").attr("x",h?S+12:S+N/2).attr("y",h?T+I/2:T+E.headerSize/2).attr("text-anchor",h?"start":"middle").attr("dominant-baseline","middle").attr("font-size",udt).attr("font-weight","700").attr("fill",vt(M,r.text,55)).text(E.label)}let w=m.append("g").attr("class","dgmo-swimlane-phases");n.phases.forEach((E,M)=>{M%2===1&&w.append("rect").attr("x",E.x).attr("y",E.y).attr("width",E.width).attr("height",E.height).attr("rx",qs).attr("fill",r.text).attr("opacity",.05).attr("pointer-events","none"),w.append("text").attr("x",h?E.x+E.width/2:E.headerSize/2).attr("y",h?E.headerSize/2:E.y+E.height/2).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",fdt).attr("font-weight","700").attr("letter-spacing","0.06em").attr("fill",r.textMuted).attr("data-line-number",String(E.lineNumber)).text(E.label)});let k=a.activeTagGroup??null,C=g==="outline",v=E=>{if(k){let S=Bt(k);if(E.tags[S]){let T=Dn(E.tags,[...e.tagGroups],k);if(T&&T!=="#999999")return{fill:g==="solid"?T:C?u:vt(T,u,22),stroke:T}}}if(E.shape==="terminal")return E.event==="error"?{fill:g==="solid"?f.error:C?u:vt(f.error,u,22),stroke:f.error}:E.event==="success"?{fill:g==="solid"?f.success:C?u:vt(f.success,u,22),stroke:f.success}:E.event==="terminate"?{fill:C?u:vt(r.text,u,30),stroke:r.text}:{fill:r.bg,stroke:r.textMuted};if(E.shape==="exclusive"||E.shape==="parallel")return{fill:vt(r.surface,u,80),stroke:r.textMuted};let M=p.get(E.lane)??r.border;return{fill:g==="solid"?M:C?u:vt(M,u,20),stroke:C?M:vt(M,r.text,40)}},_=new Map(n.nodes.map(E=>[E.id,E])),R=m.append("g").attr("class","dgmo-swimlane-edges");for(let E of n.edges){let M=_.get(E.target),S=r.textMuted,T="sw-arrow";M?.shape==="terminal"&&M.event==="error"?(S=f.error,T=`sw-arrow-${f.error.replace("#","")}`):M?.shape==="terminal"&&M.event==="success"&&(S=f.success,T=`sw-arrow-${f.success.replace("#","")}`);let N=ydt(E.points,pdt);if(R.append("path").attr("class","sw-edge sw-edge-group").attr("d",N).attr("fill","none").attr("stroke",S).attr("stroke-width",mdt).attr("stroke-dasharray",E.back?"5 4":null).attr("marker-end",`url(#${T})`).attr("data-line-number",String(E.lineNumber)),E.label){let I=[],G=0;for(let nt=0;nt<E.points.length-1;nt++){let J=E.points[nt],F=E.points[nt+1],j=Math.abs(F.x-J.x)+Math.abs(F.y-J.y);I.push(j),G+=j}let $=G/2,A=0;for(let nt=0;nt<I.length;nt++){if($<=I[nt]||nt===I.length-1){A=nt;break}$-=I[nt]}let D=E.points[A],O=E.points[A+1]??D,P=I[A]>0?$/I[A]:.5,H={x:D.x+(O.x-D.x)*P,y:D.y+(O.y-D.y)*P},W=Math.abs(O.x-D.x)>=Math.abs(O.y-D.y),B=7,q=(nt,J)=>{let F=1/0;for(let j of n.edges)if(j!==E)for(let Q=0;Q<j.points.length-1;Q++){let Z=bdt(nt,J,j.points[Q].x,j.points[Q].y,j.points[Q+1].x,j.points[Q+1].y);Z<F&&(F=Z)}return F},V=E.label.length*iO*.6,X=(nt,J,F)=>{let j=F===0?[nt-V/2,nt,nt+V/2]:[nt,nt+F*V/2,nt+F*V];return Math.min(...j.map(Q=>q(Q,J)))},z=10,U,Y,K,et;if(W){let nt=X(H.x,H.y-B,0),J=X(H.x,H.y+B,0),F=nt<z&&J>nt;U=H.x,Y=H.y+(F?B:-B),K="middle",et=F?"hanging":"auto"}else{let nt=X(H.x+B,H.y,1),J=X(H.x-B,H.y,-1),F=nt<z&&J>nt;U=H.x+(F?-B:B),Y=H.y,K=F?"end":"start",et="middle"}R.append("text").attr("x",U).attr("y",Y).attr("text-anchor",K).attr("dominant-baseline",et).attr("font-size",iO).attr("fill",S===r.textMuted?r.textMuted:S).attr("stroke",y(Y)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(E.label)}}let L=m.append("g").attr("class","dgmo-swimlane-nodes");for(let E of n.nodes){let{fill:M,stroke:S}=v(E),T=L.append("g").attr("class","sw-node").attr("data-node-id",E.id).attr("data-line-number",String(E.lineNumber)).attr("data-lane",E.lane),N=E.x,I=E.y;if(E.shape==="exclusive"||E.shape==="parallel"){let G=E.width/2;if(T.append("polygon").attr("points",`${N},${I-G} ${N+G},${I} ${N},${I+G} ${N-G},${I}`).attr("fill",M).attr("stroke",S).attr("stroke-width",O7),E.shape==="parallel"){let $=r.textMuted;T.append("line").attr("x1",N).attr("y1",I-G/2.4).attr("x2",N).attr("y2",I+G/2.4).attr("stroke",$).attr("stroke-width",2.4),T.append("line").attr("x1",N-G/2.4).attr("y1",I).attr("x2",N+G/2.4).attr("y2",I).attr("stroke",$).attr("stroke-width",2.4),T.append("text").attr("x",N).attr("y",I+G+12).attr("text-anchor","middle").attr("font-size",l2-1).attr("fill",r.textMuted).attr("stroke",y(I+G+12)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(E.label)}else cO(T,E.label,N,I,r.text,l2-1,!0,y(I))}else if(E.shape==="terminal"){let G=E.width/2;T.append("circle").attr("cx",N).attr("cy",I).attr("r",G).attr("fill",M).attr("stroke",S).attr("stroke-width",E.event==="none"?O7:2.4),E.event==="success"&&T.append("circle").attr("cx",N).attr("cy",I).attr("r",G-4).attr("fill","none").attr("stroke",S).attr("stroke-width",1);let $=!1;for(let D of n.edges){let O=D.target===E.id?D.points[D.points.length-1]:D.source===E.id?D.points[0]:void 0;O&&O.y>I+G*.5&&($=!0)}let A=$?I-G-6:I+G+12;T.append("text").attr("x",N).attr("y",A).attr("text-anchor","middle").attr("font-size",l2-1).attr("fill",r.text).attr("stroke",y(A)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(E.label)}else{T.append("rect").attr("x",N-E.width/2).attr("y",I-E.height/2).attr("width",E.width).attr("height",E.height).attr("rx",sO).attr("fill",M).attr("stroke",S).attr("stroke-width",O7),E.shape==="subprocess"&&T.append("rect").attr("x",N-E.width/2+3).attr("y",I-E.height/2+3).attr("width",E.width-6).attr("height",E.height-6).attr("rx",sO-2).attr("fill","none").attr("stroke",S).attr("stroke-width",1);let G=pe(M,r.textOnFillLight,r.textOnFillDark);cO(T,E.label,N,I,G,l2)}}}function wdt(t,e){let n=[],r="";for(let o of t)r===""?r=o:r.length+1+o.length<=e?r+=" "+o:(n.push(r),r=o);return r&&n.push(r),n}function cO(t,e,n,r,o,a,i=!1,s){let l=e.split(/\s+/),c;if(i)c=l.length===1?[e]:wdt(l,7);else if(e.length<=14||l.length===1)c=[e];else{let f=Math.ceil(l.length/2);c=[l.slice(0,f).join(" "),l.slice(f).join(" ")]}let d=a*1.2,u=r-(c.length-1)*d/2;c.forEach((f,m)=>{let p=t.append("text").attr("x",n).attr("y",u+m*d).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",a).attr("fill",o);s&&p.attr("stroke",s).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke"),p.text(f)})}var l2,udt,fdt,iO,sO,O7,mdt,pdt,hdt,gdt,qs,c2,uO=dt(()=>{"use strict";Nn();Ae();Ke();s2();Fe();rr();Oe();l2=12,udt=12,fdt=12,iO=11,sO=8,O7=1.5,mdt=1.6,pdt=11,hdt=9,gdt=6.4,qs=10,c2=2});function fO(t){return!t.placeholder&&t.metadata.d?`\u2020 ${t.label}`:t.label}function d2(t){let e=[],n=t.metadata.b,r=t.metadata.d;n&&r?e.push({key:"",value:`${n} \u2013 ${r}`,year:!0}):n?e.push({key:"",value:`b. ${n}`,year:!0}):r&&e.push({key:"",value:`d. ${r}`,year:!0});for(let[o,a]of Edt){let i=t.metadata[o];i&&e.push({key:a,value:i,year:!1})}return e}var Edt,$7=dt(()=>{"use strict";Edt=[["bp","Born"],["dp","Died"],["occupation","Occupation"],["military","Military"],["education","Education"],["religion","Religion"],["burial","Burial"]]});var yO={};ue(yO,{focusFamily:()=>gO,layoutFamily:()=>Rdt});function Ldt(t,e){let n=t.get(e)?.metadata.b;if(n===void 0)return null;let r=parseInt(n,10);return Number.isFinite(r)?r:null}function Cdt(t,e){return t.map((n,r)=>({c:n,i:r,b:Ldt(e,n.personId)})).sort((n,r)=>n.b!==null&&r.b!==null?n.b-r.b||n.i-r.i:n.b!==null?-1:r.b!==null?1:n.i-r.i).map(n=>n.c)}function Ndt(t,e){let n=new Map,r=new Map,o=new Map(t.map(l=>[l.id,l]));for(let l of t){for(let c of l.parents)(r.get(c)??r.set(c,[]).get(c)).push(l.id);for(let c of l.children)(n.get(c.personId)??n.set(c.personId,[]).get(c.personId)).push(l.id)}let a=new Set([e]),i=[e];for(;i.length;){let l=i.pop();for(let c of n.get(l)??[])for(let d of o.get(c).parents)a.has(d)||(a.add(d),i.push(d))}let s=[e];for(;s.length;){let l=s.pop();for(let c of r.get(l)??[])for(let d of o.get(c).children)a.has(d.personId)||(a.add(d.personId),s.push(d.personId))}for(let l of[...a])for(let c of r.get(l)??[])for(let d of o.get(c).parents)a.add(d);return a}function Tdt(t){let e=d2(t),n=e.filter(c=>!c.year),r=n.length?Math.max(...n.map(c=>Tt(`${c.key}: `,11))):0,o=hO+r+Mdt,a=0;for(let c of e){let d=c.year?hO+Tt(c.value,11):o+Tt(c.value,11);a=Math.max(a,d)}let i=Tt(t.label,13,{bold:!0}),s=Math.max(kdt,i+pO*2,a+pO),l=e.length>0?34+e.length*16+mO:28+mO;return{width:s,height:l}}function _dt(t,e,n,r,o){let a=new Map,i=0,s=l=>{if(!a.has(l)){a.set(l,i++);for(let c of e.get(l)??[]){for(let d of n.get(c)??[])s(d);for(let d of r.get(c)??[])s(d)}}};for(let l of o)for(let c of n.get(l)??[])s(c);for(let l of t.keys())s(l);return a}function Adt(t,e,n){let r=new Set(t),o=s=>[...e.get(s)??[]].filter(l=>r.has(l)),a=new Set,i=[];for(let s of[...t].sort((l,c)=>n(l)-n(c))){if(a.has(s))continue;let l=[],c=[s];for(a.add(s);c.length;){let p=c.pop();l.push(p);for(let h of o(p))a.has(h)||(a.add(h),c.push(h))}if(l.length===1){i.push(l);continue}let d=l.filter(p=>o(p).length<=1).sort((p,h)=>n(p)-n(h))[0]??l.slice().sort((p,h)=>n(p)-n(h))[0],u=[],f=new Set,m=d;for(;m!==void 0&&!f.has(m);)f.add(m),u.push(m),m=o(m).filter(p=>!f.has(p)).sort((p,h)=>n(p)-n(h))[0];for(let p of l)f.has(p)||u.push(p);i.push(u)}return i.sort((s,l)=>Math.min(...s.map(n))-Math.min(...l.map(n))),i.flat()}function gO(t,e){if(!t.persons.has(e))return{persons:t.persons,unions:t.unions,parents:[]};let n=new Map,r=new Map,o=new Map(t.unions.map(u=>[u.id,u]));for(let u of t.unions){for(let f of u.parents)(r.get(f)??r.set(f,[]).get(f)).push(u.id);for(let f of u.children)(n.get(f.personId)??n.set(f.personId,[]).get(f.personId)).push(u.id)}let a=new Set([e]),i=[e];for(;i.length;){let u=i.pop();for(let f of r.get(u)??[])for(let m of o.get(f).children)a.has(m.personId)||(a.add(m.personId),i.push(m.personId))}for(let u of[...a])for(let f of r.get(u)??[])for(let m of o.get(f).parents)a.add(m);let s=new Set;for(let u of n.get(e)??[])for(let f of o.get(u).parents)s.add(f);let l=[...s].map(u=>t.persons.get(u)).filter(u=>u!==void 0),c=new Map;for(let[u,f]of t.persons)a.has(u)&&c.set(u,f);let d=t.unions.filter(u=>u.parents.every(f=>a.has(f))).map(u=>({...u,children:u.children.filter(f=>a.has(f.personId))}));return{persons:c,unions:d,parents:l}}function Rdt(t,e){let n=e?gO(t,e):null,r=n?n.persons:t.persons,o=(n?n.unions:t.unions).map(Y=>({...Y,children:Cdt(Y.children,r)})),a=n?n.parents:[],i=t.options.highlight||null,s=i?Ndt(o,i):null,l=t.options.generations==="true",c=20,d=a.length>0?34+Math.max(0,a.length-1)*c:0,u=Ng(r,o),f=u.cycle?new Map:sT(u),m=Y=>{let K=u.classOf.get(Y);return K===void 0?0:f.get(K)??0},p=new Map,h=new Map,g=new Map,x=[];for(let Y of o){x.push(Y.id),h.set(Y.id,[...Y.parents]),g.set(Y.id,Y.children.map(K=>K.personId));for(let K of Y.parents)(p.get(K)??p.set(K,[]).get(K)).push(Y.id)}let y=_dt(r,p,h,g,x),b=new Map;for(let[Y,K]of r)b.set(Y,Tdt(K));let w=new Map,k=0;for(let Y of r.keys()){let K=m(Y);k=Math.max(k,K),(w.get(K)??w.set(K,[]).get(K)).push(Y)}let C=new Map;for(let Y of o){if(Y.parents.length!==2)continue;let[K,et]=Y.parents;(C.get(K)??C.set(K,new Set).get(K)).add(et),(C.get(et)??C.set(et,new Set).get(et)).add(K)}let v=Y=>y.get(Y)??0;for(let[Y,K]of w)w.set(Y,Adt(K,C,v));let _=new Map;for(let Y=0;Y<=k;Y++){let K=0;for(let et of w.get(Y)??[])K=Math.max(K,b.get(et).height);_.set(Y,K)}let R=new Map;{let Y=Fc+d;for(let K=0;K<=k;K++)R.set(K,Y),Y+=(_.get(K)??0)+Sdt}let L=new Map;for(let Y=0;Y<=k;Y++){let K=0;for(let et of w.get(Y)??[]){let nt=b.get(et).width;L.set(et,K+nt/2),K+=nt+om}}let E=(Y,K)=>{let et=-1/0;for(let nt of Y){let J=b.get(nt).width/2,F=K.get(nt)??L.get(nt),j=et+om+J;F<j&&(F=j),L.set(nt,F),et=F+J}},M=Y=>{let K=(g.get(Y)??[]).filter(et=>L.has(et)).map(et=>L.get(et));if(K.length!==0)return(Math.min(...K)+Math.max(...K))/2},S=new Map;for(let Y=0;Y<=k;Y++)for(let K of w.get(Y)??[])S.set(K,Y);for(let Y=0;Y<4;Y++)for(let K=k-1;K>=0;K--){let et=new Map,nt=(F,j)=>{(et.get(F)??et.set(F,[]).get(F)).push(j)};for(let F of o){let j=F.parents.filter(Z=>S.get(Z)===K);if(j.length===0)continue;let Q=M(F.id);if(Q!==void 0)if(j.length===2){let Z=[...j].sort((rt,ut)=>L.get(rt)-L.get(ut)),[ot,at]=Z,lt=b.get(ot).width/2+om+b.get(at).width/2;nt(ot,Q-lt/2),nt(at,Q+lt/2)}else for(let Z of j)nt(Z,Q)}let J=new Map;for(let[F,j]of et)J.set(F,j.reduce((Q,Z)=>Q+Z,0)/j.length);E(w.get(K)??[],J)}let T=Y=>{let K=Y.parents.filter(et=>L.has(et));return K.reduce((et,nt)=>et+L.get(nt),0)/K.length};for(let Y=0;Y<2;Y++)for(let K=1;K<=k;K++){let et=new Map;for(let nt of o){let J=nt.children.map(Q=>Q.personId).filter(Q=>S.get(Q)===K&&L.has(Q)).sort((Q,Z)=>L.get(Q)-L.get(Z));if(J.length===0||nt.parents.every(Q=>!L.has(Q)))continue;let F=J.reduce((Q,Z)=>Q+b.get(Z).width,0)+om*(J.length-1),j=T(nt)-F/2;for(let Q of J){let Z=b.get(Q).width;et.set(Q,j+Z/2),j+=Z+om}}E(w.get(K)??[],et)}let N=1/0;for(let Y of r.keys())N=Math.min(N,L.get(Y)-b.get(Y).width/2);let I=l?vdt:0,G=(Number.isFinite(N)?Fc-N:Fc)+I,$=[],A=new Map,D=new Map;for(let Y=0;Y<=k;Y++)for(let K of w.get(Y)??[]){let et=r.get(K),nt=b.get(K),J=L.get(K)-nt.width/2+G,F=R.get(Y);L.set(K,J+nt.width/2),A.set(K,F),D.set(K,F+nt.height),$.push({id:et.id,label:et.label,sex:et.sex,metadata:et.metadata,...et.color!==void 0&&{color:et.color},tagMetadata:et.tagMetadata,x:J,y:F,width:nt.width,height:nt.height,row:Y,...et.placeholder&&{placeholder:!0},...s&&!s.has(K)&&{dimmed:!0},lineNumber:et.lineNumber})}let O=0;for(let Y of $)O=Math.max(O,Y.x+Y.width);let P=[];for(let Y of o){if(Y.parents.length!==2)continue;let[K,et]=Y.parents;if(!L.has(K)||!L.has(et))continue;let J=Math.min(A.get(K),A.get(et))+28/2,F=L.get(K),j=L.get(et),Q=Math.min(F,j),Z=Math.max(F,j),ot=F<=j?K:et,at=F<=j?et:K,lt=(L.get(ot)+b.get(ot).width/2+(L.get(at)-b.get(at).width/2))/2;P.push({unionId:Y.id,x1:Q,x2:Z,y:J,midX:(Q+Z)/2,labelX:lt,...Y.metadata.m!==void 0&&{year:Y.metadata.m},...Y.divorced&&{divorced:!0},...s&&!(s.has(K)&&s.has(et))&&{dimmed:!0},lineNumber:Y.lineNumber})}let H=new Map(P.map(Y=>[Y.unionId,Y])),W=[];for(let Y of o){if(Y.children.length===0)continue;let K,et,nt=H.get(Y.id);if(nt)K=nt.midX,et=nt.y;else{let Z=Y.parents[0];if(Z===void 0||!L.has(Z))continue;K=L.get(Z),et=D.get(Z)}let J=Y.children.filter(Z=>L.has(Z.personId));if(J.length===0)continue;let F=Math.min(...J.map(Z=>A.get(Z.personId))),Q=(Math.max(...Y.parents.filter(Z=>D.has(Z)).map(Z=>D.get(Z)))+F)/2;for(let Z of J){let ot=L.get(Z.personId),at=A.get(Z.personId);W.push({unionId:Y.id,childId:Z.personId,points:[{x:K,y:et},{x:K,y:Q},{x:ot,y:Q},{x:ot,y:at}],adopted:Z.adopted,...s&&!s.has(Z.personId)&&{dimmed:!0}})}}let B=[],q;if(e&&a.length>0&&L.has(e)){let Y=L.get(e),K=A.get(e);q={x:Y,y:K},a.forEach((et,nt)=>{B.push({id:et.id,label:et.label,sex:et.sex,...et.color!==void 0&&{color:et.color},x:Y,y:Fc+10+nt*c})})}let V=O+Fc,X=k,z=(R.get(X)??Fc)+(_.get(X)??0)+Fc,U=[];for(let Y=0;Y<=k;Y++)w.get(Y)?.length&&U.push({row:Y,y:R.get(Y),height:_.get(Y)??0});return{nodes:$,bars:P,edges:W,ancestors:B,...q!==void 0&&{focusAnchor:q},rows:U,width:V,height:z}}var Fc,kdt,mO,pO,om,Sdt,Mdt,hO,vdt,bO=dt(()=>{"use strict";Ve();J5();$7();Fc=30,kdt=132,mO=12,pO=12,om=60,Sdt=74,Mdt=6,hO=10,vdt=72});var EO={};ue(EO,{renderFamily:()=>Gdt,renderFamilyForExport:()=>wO});function Odt(t){let e="",n=t;for(let[r,o]of Ddt)for(;n>=r;)e+=o,n-=r;return e}function $dt(t,e,n,r){if(t.color){let o=Re(t.color,n);if(o)return o}if(r){let o=Dn(t.tagMetadata,[...e.tagGroups],r);if(o&&o!=="#999999")return o}return n.primary}function wO(t,e,n,r,o,a={}){It(t).selectAll(":not([data-d3-tooltip])").remove();let i=a.activeTagGroup??null,s=mn(e.options),l=e.options["no-daggers"]==="true",c=Ie(r,o),d=20,u=1.5,f=e.title?Pdt:0,m=e.tagGroups.filter(D=>D.entries.length>0).map(D=>({name:D.name,entries:D.entries.map(O=>({value:O.value,color:O.color}))})),p=m.length>0&&!or(e.options),h={groups:m,position:{placement:"top-center",titleRelation:"below-title"},mode:a.exportMode?"export":"preview",showInactivePills:!0},g=n.width,x=n.height,y=a.fit?.width??a.exportDims?.width??g+d*2,b=p?ir(h,y)+Mn:0,w=vo(e.options),k=w&&p?cr({groups:m,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:a.exportMode?"export":"preview",showInactivePills:!0},{activeGroup:i},y):{width:0,height:0},C=nr({requested:w,title:e.title??"",hasLegend:p,legendWidth:k.width,legendHeight:k.height,containerWidth:y,titleBandHeight:f,legendReserve:b,titleBaselineY:30,titleFontSize:20}),v=f+(C.inline?0:b),_=1,R;if(a.fit){R=a.fit.height;let D=Math.max(1,y-d*2),O=Math.max(1,R-v-d*2);_=Math.min(u,D/g,O/x),(!Number.isFinite(_)||_<=0)&&(_=1)}else R=x+v+d*2;let L=It(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",y).attr("height",R).attr("viewBox",`0 0 ${y} ${R}`).attr("preserveAspectRatio","xMidYMin meet").attr("data-fit-scale",_.toFixed(3)).style("font-family",Mt);if(L.append("style").text(".family-focus-icon{opacity:0;transition:opacity .15s ease;pointer-events:none}.family-card:hover .family-focus-icon{opacity:.6;pointer-events:all}.family-focus-icon:hover{opacity:1}"),e.title&&L.append("text").attr("class","chart-title").attr("x",C.titleX).attr("y",30).attr("text-anchor",C.titleAnchor).attr("font-size",20).attr("font-weight","700").attr("fill",r.text).text(e.title),p){let D=L.append("g").attr("transform",C.inline?`translate(${C.legendX}, ${C.legendY})`:`translate(0, ${f})`);tn(D,{...h,position:{placement:"top-center",titleRelation:C.inline?"inline-with-title":"below-title"},palette:r,isDark:o,width:y,activeGroup:i}),D.selectAll("[data-legend-group]").classed("family-legend-group",!0)}let E=(y-g*_)/2,M=L.append("g").attr("transform",`translate(${E}, ${v+d}) scale(${_})`);if(e.options.generations==="true"&&n.rows.length>0){let D=M.append("g").attr("class","family-generation-bands"),O=vt(r.textMuted,c,7),P=vt(r.textMuted,c,2),H=12,W=2;for(let B=0;B<n.rows.length;B++){let q=n.rows[B];D.append("rect").attr("x",W).attr("y",q.y-H).attr("width",Math.max(0,g-W*2)).attr("height",q.height+H*2).attr("rx",6).attr("fill",B%2===0?O:P)}}let S=M.append("g").attr("class","family-edges"),T=D=>D.map((O,P)=>`${P?"L":"M"}${O.x} ${O.y}`).join(" "),N=(D,O,P)=>{S.append("path").attr("d",T(D)).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-dasharray",O?"6 3":null).attr("stroke-opacity",P?u2:null)},I=new Map;for(let D of n.edges)(I.get(D.unionId)??I.set(D.unionId,[]).get(D.unionId)).push(D);for(let D of I.values()){let O=D[0],P=D.every(W=>W.adopted),H=D.every(W=>W.dimmed);if(O.points.length>2){N(O.points.slice(0,2),P,H);for(let W of D)N(W.points.slice(1),W.adopted,!!W.dimmed)}else for(let W of D)N(W.points,W.adopted,!!W.dimmed);for(let W of D){if(!W.adopted)continue;let B=W.points[W.points.length-1],q=W.points[W.points.length-2]??B;S.append("text").attr("x",B.x+5).attr("y",(B.y+q.y)/2).attr("font-size",11).attr("font-style","italic").attr("fill",r.textMuted).attr("fill-opacity",W.dimmed?u2:null).text("adopted")}}let G=M.append("g").attr("class","family-bars");for(let D of n.bars){let O=G.append("g");D.dimmed&&O.attr("opacity",u2),O.append("line").attr("x1",D.x1).attr("y1",D.y).attr("x2",D.x2).attr("y2",D.y).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-dasharray",D.divorced?"6 3":null).attr("class","family-marriage-bar").attr("data-line-number",String(D.lineNumber)),O.append("circle").attr("cx",D.midX).attr("cy",D.y).attr("r",xO).attr("fill",r.textMuted),D.year&&O.append("text").attr("x",D.labelX).attr("y",D.y-xO-3).attr("text-anchor","middle").attr("font-size",11).attr("fill",r.textMuted).attr("stroke",c).attr("stroke-width",3).attr("stroke-linejoin","round").attr("paint-order","stroke").text(`m. ${D.year}`)}let $=M.append("g").attr("class","family-dim-occluders");for(let D of n.nodes)D.dimmed&&$.append("rect").attr("x",D.x).attr("y",D.y).attr("width",D.width).attr("height",D.height).attr("rx",6).attr("fill",c);let A=M.append("g").attr("class","family-cards");for(let D of n.nodes){let O=!!D.placeholder,P=$dt(D,e,r,i),H=O?vt(r.textMuted,c,6):ee(r,P,o,{mode:s}),W=O?r.textMuted:P,B=O?r.textMuted:pe(H,r.textOnFillLight,r.textOnFillDark),q=A.append("g").attr("class","family-card").attr("transform",`translate(${D.x}, ${D.y})`).attr("data-line-number",String(D.lineNumber)).attr("data-person-id",D.id);if(D.dimmed&&q.attr("opacity",u2),i){let nt=Bt(i),J=D.tagMetadata[nt];J&&q.attr(`data-tag-${nt}`,J.toLowerCase())}if(q.append("rect").attr("x",0).attr("y",0).attr("width",D.width).attr("height",D.height).attr("rx",6).attr("fill",H).attr("stroke",W).attr("stroke-width",1.5),q.append("text").attr("x",D.width/2).attr("y",28/2).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill",B).attr("font-size",13).attr("font-weight","bold").text(l?D.label:fO(D)),O)continue;let V=D.width-13,X=9,z=q.append("g").attr("class","family-focus-icon").attr("data-focus-person",D.id).attr("data-export-ignore","true").style("cursor","pointer");z.append("rect").attr("x",V-6).attr("y",X-6).attr("width",16).attr("height",16).attr("fill","transparent"),z.append("circle").attr("cx",V).attr("cy",X).attr("r",5).attr("fill","none").attr("stroke",B).attr("stroke-width",1.4),z.append("circle").attr("cx",V).attr("cy",X).attr("r",1.6).attr("fill",B);let U=d2(D);if(U.length===0)continue;q.append("line").attr("x1",0).attr("y1",28).attr("x2",D.width).attr("y2",28).attr("stroke",s==="solid"?B:W).attr("stroke-opacity",.3).attr("stroke-width",1);let Y=Math.max(0,...U.filter(nt=>!nt.year).map(nt=>Tt(`${nt.key}: `,11))),K=G7+Y+Idt,et=45;U.forEach((nt,J)=>{let F=et+J*16;nt.year?q.append("text").attr("x",G7).attr("y",F).attr("fill",B).attr("fill-opacity",.7).attr("font-size",11).text(nt.value):(q.append("text").attr("x",G7).attr("y",F).attr("fill",B).attr("font-size",11).text(`${nt.key}: `),q.append("text").attr("x",K).attr("y",F).attr("fill",B).attr("font-size",11).text(nt.value))})}if(e.options.generations==="true"){let D=M.append("g").attr("class","family-generations");for(let O of n.rows)D.append("text").attr("x",6).attr("y",O.y+O.height/2).attr("dominant-baseline","middle").attr("font-size",11).attr("font-weight","bold").attr("fill",r.textMuted).text(`Gen ${Odt(O.row+1)}`)}if(n.ancestors.length>0&&n.focusAnchor){let D=M.append("g").attr("class","family-ancestors"),O=n.focusAnchor,P=n.ancestors[0].y;D.append("line").attr("x1",O.x).attr("y1",P).attr("x2",O.x).attr("y2",O.y).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.5);for(let H of n.ancestors){let W=(H.color?Re(H.color,r):null)??Re(H.sex==="m"?"blue":H.sex==="f"?"purple":"gray",r)??r.textMuted,B=D.append("g").attr("data-ancestor",H.label).attr("data-focus-person",H.id).style("cursor","pointer");B.append("circle").attr("cx",H.x).attr("cy",H.y).attr("r",6).attr("fill",vt(W,c,40)).attr("stroke",W).attr("stroke-width",1.5),B.append("text").attr("x",H.x+10).attr("y",H.y).attr("dominant-baseline","middle").attr("font-size",11).attr("fill",r.textMuted).attr("stroke",c).attr("stroke-width",3).attr("stroke-linejoin","round").attr("paint-order","stroke").text(H.label)}}}function Gdt(t,e,n,r,o,a={}){wO(t,e,n,r,o,a)}var G7,Idt,xO,Pdt,u2,Ddt,kO=dt(()=>{"use strict";Nn();Ae();ko();Ke();Fe();rr();Oe();Mr();qr();pr();Ve();$7();G7=10,Idt=6,xO=3.5,Pdt=40,u2=.28,Ddt=[[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]]});function Bdt(t){let e=[],n=t.split(/(\s+)/);for(let r of n){if(/^\s+$/.test(r))continue;let o=r.split(/(?<=-)(?=\S)/);e.push(...o)}return e}function SO(t,e,n,r,o){let a=e-B7,i=[],s="";for(let l of t){let c=s&&!s.endsWith("-")?" ":"",d=s+c+l;if(Tt(d,n,{bold:o})<=a)s=d;else if(!s)s=l;else{if(i.push(s),i.length>=r)return null;s=l}}return s&&i.push(s),i.length>r?null:i}function MO(t,e,n,r){let o=e-B7,a=[...t],i=a[a.length-1];return Tt(i,n,{bold:r})>o&&(a[a.length-1]=Gn(i,n,o,{bold:r})),a}function vO(t,e,n,r,o=LO,a=!1){if(!t)return{lines:[""],fontSize:n};let i=Bdt(t);for(let d=n;d>=r;d--){let u=SO(i,e,d,o,a);if(u)return{lines:MO(u,e,d,a),fontSize:d}}let s=SO(i,e,r,999,a)??[t],l=s.slice(0,o),c=MO(l,e,r,a);if(s.length>o){let d=c[c.length-1];if(!d.endsWith("\u2026")){let u=e-B7;Tt(d+"\u2026",r,{bold:a})>u?c[c.length-1]=Gn(d,r,u,{bold:a}):c[c.length-1]=d+"\u2026"}}return{lines:c,fontSize:r}}function Wdt(t){return Math.max(CO,Hdt-t*Fdt)}function f2(t,e,n,r,o){let a=Wdt(n),i=vO(t,r,a,CO,LO,n===0),s=[],l=q7;if(!o&&e&&e.length>0){let c=qdt;for(let d of e){if(c<=0)break;let u=la(d),f=vO(u,r,q7,q7,c);s.push(...f.lines),c-=f.lines.length,l=f.fontSize}}return{labelLines:i.lines,labelFontSize:i.fontSize,descLines:s,descFontSize:l}}var B7,LO,qdt,Hdt,CO,Fdt,q7,H7=dt(()=>{"use strict";Fa();Ve();B7=16,LO=3,qdt=2;Hdt=17,CO=9,Fdt=3,q7=10});var TO={};ue(TO,{layoutMindmap:()=>p2});function p2(t,e,n){let r=t.roots;if(r.length===0)return{nodes:[],edges:[],width:0,height:0};let o=n?.hiddenCounts??new Map,a=n?.activeTagGroup??null,i=n?.hideDescriptions??!1,s=n?.ctx??Le.identity(),l={rootWidth:s.structural(zdt),depth1Width:s.structural(Ydt),leafWidth:s.structural(Vdt),hGap:s.aesthetic(Zdt),vGap:s.aesthetic(Qdt),margin:s.aesthetic(Jdt),multiRootGap:s.aesthetic(tut)};sut(r);let c=[],d=f=>{for(let m of f)c.push(m),d(m.children)};d(r),ma(c,t.tagGroups);let u=t.tagGroups;return r.length===1?NO(r[0],o,i,u,a,l):eut(r,t,o,i,u,a,l)}function NO(t,e,n,r=[],o=null,a){let i=[],s=Y7(0,a),l=V7(t,n,a),c=t.children,{right:d,left:u}=out(c,n,a),f=m2(d,1,n,a),m=m2(u,1,n,a),p=Math.max(f,m,l),h=0,g=p/2-l/2;i.push({node:t,x:h,y:g,width:s,height:l,depth:0,direction:"right",subtreeHeight:p});let x=g+l/2,y=h+s+a.hGap;F7(d,y,x,1,"right",n,i,a);let b=h-a.hGap;return F7(u,b,x,1,"left",n,i,a),rut(i,e,n,t,r,o,a)}function eut(t,e,n,r,o,a,i){let s=[];for(let m of t)s.push(NO(m,n,r,o,a,i));let l=s.reduce((m,p)=>m+p.width,0)+i.multiRootGap*(s.length-1),c=Math.max(...s.map(m=>m.height)),d=[],u=[],f=0;for(let m of s){let p=(c-m.height)/2;for(let h of m.nodes)d.push({...h,x:h.x+f,y:h.y+p});for(let h of m.edges)u.push({sourceId:h.sourceId,targetId:h.targetId,path:aut(h.path,f,p)});f+=m.width+i.multiRootGap}return{nodes:d,edges:u,width:l,height:c}}function F7(t,e,n,r,o,a,i,s){if(t.length===0)return;let l=m2(t,r,a,s),c=n-l/2;for(let d of t){let u=Y7(r,s),f=V7(d,a,s),m=z7(d,r,a,s),p=c+m/2-f/2,h=o==="right"?e:e-u;if(i.push({node:d,x:h,y:p,width:u,height:f,depth:r,direction:o,subtreeHeight:m}),d.children.length>0){let g=p+f/2,x=o==="right"?h+u+s.hGap:h-s.hGap;F7(d.children,x,g,r+1,o,a,i,s)}c+=m+s.vGap}}function m2(t,e,n,r){if(t.length===0)return 0;let o=0;for(let a of t)o+=z7(a,e,n,r);return o+=r.vGap*(t.length-1),o}function z7(t,e,n,r){let o=V7(t,n,r);if(t.children.length===0)return o;let a=m2(t.children,e+1,n,r);return Math.max(o,a)}function nut(t,e,n){return t.color?t.color:Dn(t.metadata,[...e],n)}function rut(t,e,n,r,o=[],a=null,i){let s=1/0,l=1/0,c=-1/0,d=-1/0;for(let w of t)s=Math.min(s,w.x),l=Math.min(l,w.y),c=Math.max(c,w.x+w.width),d=Math.max(d,w.y+w.height);let u=-s+i.margin,f=-l+i.margin,m=c-s+i.margin*2,p=d-l+i.margin*2,h=new Map;for(let w of t)h.set(w.node.id,w);let g=[],x=[];for(let w of t){let k=nut(w.node,o,a),C=e.get(w.node.id);g.push({id:w.node.id,label:w.node.label,...w.node.description!==void 0&&{description:[...w.node.description]},metadata:{...w.node.metadata},lineNumber:w.node.lineNumber,...k!==void 0&&{color:k},x:w.x+u,y:w.y+f,width:w.width,height:w.height,depth:w.depth,angle:0,radius:0,...C!==void 0&&{hiddenCount:C},hasChildren:e.has(w.node.id)||w.node.children.length>0})}let y=new Map;for(let w of t)if(w.node.parentId){let k=y.get(w.node.parentId)??[];k.push(w),y.set(w.node.parentId,k)}let b=[];for(let[w,k]of y){let C=k.filter(_=>_.direction==="right"),v=k.filter(_=>_.direction==="left");C.length>0&&b.push([w,C]),v.length>0&&b.push([w,v])}for(let[w,k]of b){let C=h.get(w),v=C.x+u,_=C.y+f,R=k[0].direction==="left",L=R?v:v+C.width,E=_+C.height/2,M=k[0],S=R?M.x+u+M.width:M.x+u,T=(L+S)/2;if(k.length===1){let N=k[0],I=R?N.x+u+N.width:N.x+u,G=N.y+f+N.height/2;x.push({sourceId:w,targetId:N.node.id,path:`M ${L} ${E} L ${T} ${E} L ${T} ${G} L ${I} ${G}`})}else{x.push({sourceId:w,targetId:w,path:`M ${L} ${E} L ${T} ${E}`});let N=k.map($=>$.y+f+$.height/2),I=Math.min(...N),G=Math.max(...N);x.push({sourceId:w,targetId:w,path:`M ${T} ${I} L ${T} ${G}`});for(let $=0;$<k.length;$++){let A=k[$],D=R?A.x+u+A.width:A.x+u,O=N[$];x.push({sourceId:w,targetId:A.node.id,path:`M ${T} ${O} L ${D} ${O}`})}}}return{nodes:g,edges:x,width:m,height:p}}function out(t,e,n){if(t.length<=1)return{right:[...t],left:[]};if(t.length===2)return{right:[t[0]],left:[t[1]]};let r=t.map((l,c)=>({index:c,node:l,height:z7(l,1,e,n)})),o=[],a=[],i=0,s=0;for(let l of r)i<=s?(o.push(l.node),i+=l.height):(a.push(l.node),s+=l.height);return{right:o,left:a}}function aut(t,e,n){return e===0&&n===0?t:t.replace(/([ML])\s*([\d.e+-]+)\s+([\d.e+-]+)/g,(r,o,a,i)=>`${o} ${parseFloat(a)+e} ${parseFloat(i)+n}`)}function Y7(t,e){return t===0?e.rootWidth:t===1?e.depth1Width:e.leafWidth}function V7(t,e,n){let r=iut(t),o=Y7(r,n),a=f2(t.label,t.description?[...t.description]:void 0,r,o,e),i=a.labelLines.length,l=(i<=1?Udt:Xdt*i)+Kdt;return a.descLines.length>0&&(l+=jdt*a.descLines.length+4),l}function iut(t){return W7.get(t.id)??0}function sut(t){W7.clear();let e=(n,r)=>{for(let o of n)W7.set(o.id,r),e(o.children,r+1)};e(t,0)}var zdt,Ydt,Vdt,Udt,Xdt,jdt,Kdt,Zdt,Qdt,Jdt,tut,W7,U7=dt(()=>{"use strict";Oe();H7();wr();zdt=180,Ydt=150,Vdt=120,Udt=28,Xdt=18,jdt=14,Kdt=10,Zdt=40,Qdt=12,Jdt=40,tut=60;W7=new Map});var AO={};ue(AO,{collapseMindmapTree:()=>cut});function _O(t){return{id:t.id,label:t.label,...t.description!==void 0&&{description:[...t.description]},metadata:{...t.metadata},children:t.children.map(_O),parentId:t.parentId,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color},...t.collapsed!==void 0&&{collapsed:t.collapsed}}}function cut(t,e){return e.size===0?{roots:[...t],hiddenCounts:new Map}:yu(t,e,lut)}var lut,RO=dt(()=>{"use strict";U1();lut={getId:t=>t.id,getChildren:t=>t.children,clone:_O,setChildren:(t,e)=>{t.children=e},countsAsHidden:()=>!0}});var DO={};ue(DO,{renderMindmap:()=>PO,renderMindmapForExport:()=>yut});function mut(t,e,n,r){let o=n??t.primary;return ee(t,o,e,{mode:r})}function put(t,e){return e??t.primary}function gut(t,e){let n=hut[t];return n&&n in e.colors?e.colors[n]:e.colors.gray}function PO(t,e,n,r,o,a,i,s,l,c,d){let u=!!i,f=i?.width??(t.getBoundingClientRect().width||800),m=i?.height??(t.getBoundingClientRect().height||600);It(t).selectAll("*").remove();let p=It(t).append("svg").attr("width",f).attr("height",m).attr("viewBox",`0 0 ${f} ${m}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",Mt),h=d?.controlsHost==="app",g=!!d?.onToggleColorByDepth||!!d?.onToggleDescriptions,x=(e.tagGroups.length>0||g&&!h)&&!or(e.options),y=!u&&x,b=y?ir({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview"},f)+Mn:0,w=!!e.title&&e.options["no-title"]!=="on",k=!u&&w,C=k?IO:0,v=vo(e.options),_=v&&y?cr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:u?"export":"preview"},{activeGroup:c??null},f):{width:0,height:0},R=nr({requested:v,title:e.title??"",hasLegend:y,legendWidth:_.width,legendHeight:_.height,containerWidth:f,titleBandHeight:C,legendReserve:b,titleBaselineY:Wc+20,titleFontSize:20}),L=f,E=m-Wc*2-(R.inline?0:b)-C,M=u?Le.identity():Le.fromBox(L,n.width,E,n.height),S=n;if(M.factor<1){let D=new Map;for(let P of n.nodes)P.hiddenCount!=null&&P.hiddenCount>0&&D.set(P.id,P.hiddenCount);let O=P=>p2(e,r,{interactive:!u,...D.size>0&&{hiddenCounts:D},activeTagGroup:c??null,...l!==void 0&&{hideDescriptions:l},ctx:P});S=O(M);for(let P=0;P<3&&!M.isBelowFloor;P++){let H=Math.min(L/S.width,E/S.height);if(H>=.999)break;M=Le.fromFactor(M.factor*H),S=O(M)}}let T=u?1:Math.min(1,S.width>0?L/S.width:1,S.height>0?E/S.height:1),N=S.width*T,I=S.height*T,G=Math.max(0,(L-N)/2),$=Wc+(R.inline?0:b)+C+Math.max(0,(E-I)/2),A=p.append("g").attr("transform",`translate(${G}, ${$})${T<1?` scale(${T})`:""}`);if(M.isBelowFloor&&p.attr("width","100%"),w){let D=k?p:A,O=k?R.titleX:S.width/2,P=k?Wc+20:20,H=D.append("text").attr("x",O).attr("y",P).attr("text-anchor",k?R.titleAnchor:"middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).attr("class","chart-title").text(e.title);e.titleLineNumber&&H.attr("data-line-number",e.titleLineNumber),a&&e.titleLineNumber&&H.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))}if(y){let D=p.append("g").attr("class","mindmap-legend-fixed").attr("transform",R.inline?`translate(${R.legendX}, ${R.legendY})`:`translate(0, ${Wc+C})`),O=new Map;for(let V of S.nodes)for(let X of e.tagGroups){let z=X.name.toLowerCase(),U=V.metadata[z];U&&(O.has(z)||O.set(z,new Set),O.get(z).add(U.toLowerCase()))}let P=[];d?.onToggleDescriptions&&P.push({id:"descriptions",type:"toggle",label:"Descriptions",active:!l,onToggle:V=>d.onToggleDescriptions(V)}),d?.onToggleColorByDepth&&P.push({id:"depth-colors",type:"toggle",label:"Depth Colors",active:d.colorByDepth??!1,onToggle:d.onToggleColorByDepth});let H=P.length>0?{toggles:P}:void 0,W={groups:e.tagGroups.map(V=>{let X=O.get(V.name.toLowerCase());return{name:V.name,...V.alias!==void 0&&{alias:V.alias},entries:V.entries.filter(z=>X?.has(z.value.toLowerCase())).map(z=>({value:z.value,color:z.color}))}}),position:{placement:"top-center",titleRelation:R.inline?"inline-with-title":"below-title"},mode:d?.exportMode?"export":"preview",...H!==void 0&&{controlsGroup:H},...d?.controlsHost!==void 0&&{controlsHost:d.controlsHost}},B={text:r.text,textMuted:r.textMuted,bg:r.bg,surface:r.surface,primary:r.primary},q={...d?.onToggleControlsExpand!==void 0&&{onControlsExpand:d.onToggleControlsExpand},onControlsToggle:(V,X)=>{V==="depth-colors"&&d?.onToggleColorByDepth&&d.onToggleColorByDepth(X),V==="descriptions"&&d?.onToggleDescriptions&&d.onToggleDescriptions(X)}};tn(D,{...W,palette:B,isDark:o,width:f,activeGroup:d?.colorByDepth?null:c!==void 0?c:e.options["active-tag"]??null,hiddenAttributes:new Set,...d?.controlsExpanded!==void 0&&{controlsExpanded:d.controlsExpanded},callbacks:q})}for(let D of S.edges)A.append("path").attr("class","mindmap-edge").attr("d",D.path).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.5);for(let D of S.nodes){let O=D.radius===0&&S.nodes.indexOf(D)===0,P=O?fut:1.5,H=d?.colorByDepth?gut(D.depth,r):D.color,W=mut(r,o,H,mn(e.options)),B=put(r,H),q=pe(W,r.textOnFillLight,r.textOnFillDark),V=A.append("g").attr("class","mindmap-node").attr("data-line-number",D.lineNumber);if(c){let Z=Bt(c),ot=D.metadata[Z];ot&&V.attr(`data-tag-${Z}`,ot.toLowerCase())}D.hasChildren&&V.attr("data-node-toggle",D.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",D.hiddenCount!=null&&D.hiddenCount>0?"false":"true").attr("aria-label",D.label),V.append("rect").attr("x",D.x).attr("y",D.y).attr("width",D.width).attr("height",D.height).attr("rx",h2).attr("ry",h2).attr("fill",W).attr("stroke",B).attr("stroke-width",P);let X=D.hiddenCount!=null&&D.hiddenCount>0,z=!l&&!!D.description&&!X,U=f2(D.label,D.description,D.depth,D.width,l||X),{labelLines:Y,labelFontSize:K,descLines:et,descFontSize:nt}=U,J=Y.length,F=J<=1?dut:X7*J,j=z?F:D.height,Q=D.x+D.width/2;if(J<=1){let Z=D.y+j/2+K*.35;V.append("text").attr("x",Q).attr("y",Z).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",O?"bold":"normal").attr("fill",q).text(Y[0])}else{let Z=X7*(J-1),ot=D.y+j/2-Z/2+K*.35,at=V.append("text").attr("x",Q).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",O?"bold":"normal").attr("fill",q);for(let lt=0;lt<Y.length;lt++)at.append("tspan").attr("x",Q).attr("y",ot+lt*X7).text(Y[lt])}if((Y.length>1||Y[0]!==D.label)&&V.append("title").text(D.label),z&&et.length>0){let Z=D.y+F;if(V.append("line").attr("x1",D.x).attr("y1",Z).attr("x2",D.x+D.width).attr("y2",Z).attr("stroke",B).attr("stroke-opacity",.3).attr("stroke-width",1),et.length<=1){let ot=Z+4+nt,at=la(et[0]),lt=V.append("text").attr("x",Q).attr("y",ot).attr("text-anchor","middle").attr("font-size",nt).attr("fill",q);pn(lt,at,r,nt)}else{let ot=Z+4+nt;for(let at=0;at<et.length;at++){let lt=la(et[at]),rt=V.append("text").attr("x",Q).attr("y",ot+at*uut).attr("text-anchor","middle").attr("font-size",nt).attr("fill",q);pn(rt,lt,r,nt)}}}if(!u&&D.hiddenCount!=null&&D.hiddenCount>0){let Z=`collapse-clip-${D.id}`;A.append("defs").append("clipPath").attr("id",Z).append("rect").attr("x",D.x).attr("y",D.y).attr("width",D.width).attr("height",D.height).attr("rx",h2).attr("ry",h2),V.append("rect").attr("class","collapse-bar").attr("x",D.x).attr("y",D.y+D.height-6).attr("width",D.width).attr("height",6).attr("fill",B).attr("clip-path",`url(#${Z})`)}a&&V.style("cursor","pointer").on("click",Z=>{D.hasChildren&&s?(Z.stopPropagation(),s(D.id)):a(D.lineNumber)}),u||V.on("mouseenter",function(){It(this).attr("opacity",.7)}).on("mouseleave",function(){It(this).attr("opacity",1)})}}function yut(t,e,n){let r=eu(t,n);if(r.error)return"";let o=e==="dark",a=r.options["no-descriptions"]==="true",i=p2(r,n,{interactive:!1,hideDescriptions:a}),s=r.title&&r.options["no-title"]!=="on"?IO:0,l=i.width+Wc*2,c=i.height+Wc*2+s;return bu(l,c,d=>(PO(d,r,i,n,o,void 0,{width:l,height:c},void 0,a),xu(d,e,n)))}var Wc,IO,dut,X7,uut,h2,fut,hut,OO=dt(()=>{"use strict";Oe();Ae();Nn();Ke();M0();Fe();Ag();U7();H7();co();Fa();Mr();pr();qr();ko();wr();Wc=20,IO=30,dut=28,X7=18,uut=14,h2=6,fut=2.5;hut=["red","orange","yellow","green","blue","purple","teal","cyan"]});var HO={};ue(HO,{layoutWireframe:()=>Tut});function Tut(t,e,n,r=!0){j7=r?BO:kut;let o=t.formFactor==="mobile"?xut:but,a=n??o,i=t.title&&t.options["no-title"]!=="on"?vut:0,s=a-GO*2,l=_ut(t.roots,s,t.formFactor),c=0;for(let m of l)c=Math.max(c,m.y+m.height);let d=[],u=c+24;for(let m of t.modals){let p=Math.min(s*.7,600),h=(s-p)/2,g=Pu(m,h,u,p);d.push(g),u+=g.height+24}let f=(d.length>0?d[d.length-1].y+d[d.length-1].height:c)+GO*2+i;return{width:a,height:f,titleHeight:i,nodes:l,modalNodes:d}}function _ut(t,e,n){let r=[],o=0,a=[],i=[];for(let s of t){let l=s.label.toLowerCase().split(/\s+/)[0];qO.has(l)||n==="mobile"?(i.length>0&&(a.push(i),i=[]),a.push([s])):i.push(s)}i.length>0&&a.push(i);for(let s of a){if(s.length===1&&n!=="mobile"){let l=s[0],c=l.label.toLowerCase().split(/\s+/)[0];if(qO.has(c)){let d=Pu(l,0,o,e);c==="header"||c==="top"?d.height=Math.max(d.height,Cut):d.height=Math.max(d.height,Nut),r.push(d),o+=d.height+16;continue}}if(n==="mobile"||s.length===1)for(let l of s){let c=Pu(l,0,o,e);r.push(c),o+=c.height+16}else{let l=Aut(s,e),c=0,d=0,u=[];for(let f=0;f<s.length;f++){let m=l[f],p=Pu(s[f],c,o,m);u.push(p),d=Math.max(d,p.height),c+=m+12}for(let f of u)f.height=d;r.push(...u),o+=d+16}}return r}function Aut(t,e){let r=(t.length-1)*12,o=e-r,a=new Array(t.length).fill(0),i=0,s=0;for(let l=0;l<t.length;l++){let c=t[l].label.toLowerCase().split(/\s+/)[0],d=Lut[c];d!==void 0&&d>0?(a[l]=o*d,i+=a[l]):s++}if(s>0){let c=Math.max(0,o-i)/s;for(let d=0;d<a.length;d++)a[d]===0&&(a[d]=Math.max(40,c))}for(let l=0;l<a.length;l++)a[l]=Math.max(40,a[l]);return a}function Pu(t,e,n,r){let o={id:t.id,x:e,y:n,width:r,height:0,element:t,children:[]},a=t.type==="nav"||t.type==="tabs";if(!t.isContainer||t.children.length===0||a)return o.height=Iut(t),o;let i=t.metadata._inlineRow==="true"||t.metadata._labelField==="true",s=i?0:j7,l=i?0:Sut,c=i?0:Mut,d=r-c*2,u=c;if(t.orientation==="horizontal"){let f=Rut(t.children,d),m=u,p=0,h=[];for(let g=0;g<t.children.length;g++){let x=t.children[g],y=f[g],b=Pu(x,m,s,y);h.push(b),o.children.push(b),p=Math.max(p,b.height),m+=y+8}for(let g of h)g.height=p;o.height=s+p+l}else{let f=s,m=Dut(t.children);m>0&&(o.fieldAlignX=m);for(let p of t.children){let h=Pu(p,u,f,d);o.children.push(h),f+=h.height+Put(p)}o.height=f+l}return t.states.includes("collapsed")&&(o.height=j7,o.children=[]),o}function Rut(t,e){let r=(t.length-1)*8,o=Math.max(40,(e-r)/t.length);return t.map(()=>o)}function Iut(t){return t.type==="heading"?t.headingLevel===2?g2.subheading??36:g2.heading??48:t.type==="textInput"&&t.fieldVariant==="textarea"?80:t.type==="table"?32+(t.tableData?.length||t.tableRows||0)*28+8:t.type==="image"?t.imageHint==="round"||t.imageHint==="wide"?80:g2.image??120:t.metadata._labelField==="true"?36:g2[t.type]??24}function Put(t){return t.type==="heading"&&t.headingLevel===2?$O.subheading??12:$O[t.type]??8}function Dut(t){let e=0,n=0;for(let r of t)if(r.metadata._labelField==="true"&&r.children.length>=2){let o=r.children[0],a=Tt(o.label,Eut);e=Math.max(e,a),n++}return n<2?0:e+wut}var but,xut,wut,Eut,g2,$O,BO,kut,Sut,j7,Mut,GO,vut,Lut,qO,Cut,Nut,FO=dt(()=>{"use strict";Ve();but=1200,xut=375,wut=16,Eut=13,g2={textInput:36,button:40,dropdown:36,checkbox:24,radio:24,heading:48,subheading:36,divider:24,text:22,listItem:24,image:120,progress:28,chart:160,alert:40,nav:44,tabs:44},$O={heading:16,subheading:12,divider:12,textInput:8,dropdown:8,checkbox:8,radio:8,button:8,text:12,listItem:4,group:16,image:12,progress:12,chart:16,alert:12,nav:12,tabs:12,table:16},BO=32,kut=10,Sut=12,j7=BO,Mut=12,GO=20,vut=40,Lut={sidebar:.25,side:.25,left:.25,right:.25,main:0,content:0,center:0},qO=new Set(["header","top","footer","bottom"]),Cut=60,Nut=40});var XO={};ue(XO,{renderWireframe:()=>Gut});function $ut(t,e){let n=Out[t];return n?n(e):null}function VO(t,e){for(let n of t.states){let r=$ut(n,e);if(r)return r}return null}function Gut(t,e,n,r,o,a,i,s,l){let c=l??{},d=c.exportDims??i,u=c.theme??s;It(t).selectAll(":not([data-d3-tooltip])").remove();let f=!!d,m=d?.width??t.clientWidth,p=d?.height??t.clientHeight,h=f?Le.identity():Le.from(m,n.width),g=It(t).append("svg").attr("viewBox",`0 0 ${n.width} ${n.height}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",Mt);f?g.attr("width",m).attr("height",p):g.attr("width","100%").attr("height","auto").style("display","block");let x={palette:r,isTransparent:u==="transparent",isDark:o,showGroupLabels:c.showGroupLabels??!0,fillMode:mn(e.options)};x.isTransparent||g.append("rect").attr("width",n.width).attr("height",n.height).attr("fill",r.bg).attr("rx",8);let y=g.append("g").attr("transform","translate(20, 20)"),b=0,w=!!e.title&&e.options["no-title"]!=="on",k=h.text(20);f&&w&&(y.append("text").attr("x",0).attr("y",k).attr("fill",r.text).attr("font-size",k).attr("font-weight","700").text(e.title),b=n.titleHeight);let C=y.append("g").attr("transform",`translate(0, ${b})`);for(let v of n.nodes)im(C,v,x,0);if(n.modalNodes.length>0){let v=C.append("g").attr("class","wireframe-modals");for(let _ of n.modalNodes)rft(v,_,x)}}function im(t,e,n,r){let o=e.element,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",o.lineNumber);if(o.states.includes("disabled")&&a.attr("opacity",.5),o.isSkeleton&&o.type!=="skeleton"){UO(a,e,n);return}switch(o.type){case"group":qut(a,e,n,r);break;case"textInput":But(a,e,n);break;case"button":Hut(a,e,n);break;case"dropdown":Fut(a,e,n);break;case"checkbox":Wut(a,e,n);break;case"radio":zut(a,e,n);break;case"heading":Yut(a,e,n);break;case"divider":Vut(a,e,n);break;case"text":zO(a,e,n);break;case"listItem":Uut(a,e,n);break;case"nav":Xut(a,e,n);break;case"tabs":jut(a,e,n);break;case"table":Kut(a,e,n);break;case"image":Qut(a,e,n);break;case"skeleton":Jut(a,e,n);break;case"alert":tft(a,e,n);break;case"progress":eft(a,e,n);break;case"chart":nft(a,e,n);break;default:zO(a,e,n)}}function qut(t,e,n,r){let{palette:o,isTransparent:a}=n,i=e.element;if(i.metadata._inlineRow==="true"||i.metadata._labelField==="true"){for(let d of e.children)im(t,d,n,r);return}let s=[12,7,4,2],l=s[Math.min(r,s.length-1)],c=vt(o.textMuted,o.bg,l);if(a?t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",o.border).attr("stroke-width",1).attr("rx",am):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("stroke",o.border).attr("stroke-width",1).attr("rx",am),i.label&&n.showGroupLabels&&t.append("text").attr("x",10).attr("y",18).attr("fill",o.textMuted).attr("font-size",11).attr("font-weight","600").attr("letter-spacing","0.5px").text(i.label.toUpperCase()),i.states.includes("collapsed")){t.append("text").attr("x",e.width-20).attr("y",18).attr("fill",o.textMuted).attr("font-size",12).attr("opacity",.6).text("\u25B6");return}i.states.includes("scrollable")&&t.append("rect").attr("x",e.width-6).attr("y",28).attr("width",3).attr("height",Math.min(e.height-36,40)).attr("fill",o.border).attr("rx",1.5);for(let d of e.children)im(t,d,n,r+1)}function But(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=e.height;if(t.append("rect").attr("width",e.width).attr("height",i).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",YO),a.fieldVariant==="password"?t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.text).attr("font-size",16).text("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022"):t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.textMuted).attr("font-size",13).text(a.label||"Text input"),a.fieldVariant!=="password"){let s=Math.min(Tt(a.label||"Text input",13)+14,e.width-20);t.append("line").attr("x1",s).attr("y1",8).attr("x2",s).attr("y2",i-8).attr("stroke",r.primary).attr("stroke-width",1.5).attr("opacity",.6)}if(a.fieldVariant==="textarea")for(let s=0;s<3;s++)t.append("line").attr("x1",e.width-12+s*3).attr("y1",i-4).attr("x2",e.width-4).attr("y2",i-12+s*3).attr("stroke",r.border).attr("stroke-width",1)}function Hut(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.states.includes("ghost"),s=VO(a,r),c=a.states.includes("primary")?r.primary:r.secondary,d=r.bg;s&&(c=s),i||o?(t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",c).attr("stroke-width",1.5).attr("rx",WO),d=c):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("rx",WO),t.append("text").attr("x",e.width/2).attr("y",e.height/2+4).attr("fill",d).attr("font-size",13).attr("font-weight","600").attr("text-anchor","middle").text(a.label)}function Fut(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",YO),t.append("text").attr("x",10).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(a.label||(a.options?.[0]??"Select..."));let i=e.width-16,s=e.height/2;t.append("path").attr("d",`M${i-4},${s-2} L${i},${s+2} L${i+4},${s-2}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5)}function Wut(t,e,n){let{palette:r}=n,o=e.element;if(o.states.includes("toggle")){let l=e.height/2;t.append("rect").attr("x",0).attr("y",l-18/2).attr("width",32).attr("height",18).attr("rx",18/2).attr("fill",o.checked?r.primary:r.border),t.append("circle").attr("cx",o.checked?32-18/2:18/2).attr("cy",l).attr("r",18/2-2).attr("fill",r.bg),o.label&&t.append("text").attr("x",40).attr("y",l+4).attr("fill",r.text).attr("font-size",13).text(o.label)}else{let s=e.height/2;t.append("rect").attr("x",0).attr("y",s-16/2).attr("width",16).attr("height",16).attr("fill",o.checked?r.primary:"none").attr("stroke",o.checked?r.primary:r.border).attr("rx",3),o.checked&&t.append("path").attr("d",`M3,${s} L6,${s+3} L13,${s-4}`).attr("fill","none").attr("stroke",r.bg).attr("stroke-width",2),o.label&&t.append("text").attr("x",24).attr("y",s+4).attr("fill",r.text).attr("font-size",13).text(o.label)}}function zut(t,e,n){let{palette:r}=n,o=e.element,a=8,i=e.height/2;t.append("circle").attr("cx",a).attr("cy",i).attr("r",a).attr("fill","none").attr("stroke",o.selected?r.primary:r.border).attr("stroke-width",1.5),o.selected&&t.append("circle").attr("cx",a).attr("cy",i).attr("r",4).attr("fill",r.primary),t.append("text").attr("x",a*2+8).attr("y",i+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Yut(t,e,n){let{palette:r}=n,o=e.element,a=o.headingLevel===1;t.append("text").attr("x",0).attr("y",a?28:22).attr("fill",r.text).attr("font-size",a?22:16).attr("font-weight","bold").text(o.label)}function Vut(t,e,n){let{palette:r}=n;t.append("line").attr("x1",0).attr("y1",e.height/2).attr("x2",e.width).attr("y2",e.height/2).attr("stroke",r.border).attr("stroke-width",1)}function zO(t,e,n){let{palette:r}=n,o=e.element;if(o.metadata._labelField==="true"&&o.children.length>=2){for(let i of e.children)im(t,i,n,0);return}let a=o.labelFor?r.textMuted:r.text;t.append("text").attr("x",0).attr("y",15).attr("fill",a).attr("font-size",13).text(o.label)}function Uut(t,e,n){let{palette:r}=n,o=e.element;t.append("circle").attr("cx",4).attr("cy",e.height/2).attr("r",2.5).attr("fill",r.textMuted),t.append("text").attr("x",14).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Xut(t,e,n){let{palette:r}=n,o=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",vt(r.textMuted,r.bg,8)).attr("rx",4);let a=12;for(let i of o.children){let s=i.states.includes("active");t.append("text").attr("x",a).attr("y",e.height/2+4).attr("fill",s?r.primary:r.text).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label);let l=Tt(i.label,13,{bold:s});s&&t.append("line").attr("x1",a).attr("y1",e.height-4).attr("x2",a+l).attr("y2",e.height-4).attr("stroke",r.primary).attr("stroke-width",2),a+=l+24}}function jut(t,e,n){let{palette:r}=n,o=e.element;t.append("line").attr("x1",0).attr("y1",e.height-1).attr("x2",e.width).attr("y2",e.height-1).attr("stroke",r.border).attr("stroke-width",1);let a=0;for(let i of o.children){let s=i.states.includes("active"),l=Tt(i.label,13,{bold:s})+24;s&&t.append("line").attr("x1",a).attr("y1",e.height-1).attr("x2",a+l).attr("y2",e.height-1).attr("stroke",r.primary).attr("stroke-width",2),t.append("text").attr("x",a+12).attr("y",e.height/2+4).attr("fill",s?r.primary:r.textMuted).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label),a+=l}}function Kut(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.tableHeaders||[],s=a.tableData||[],l=a.tableRows!==void 0&&a.tableCols!==void 0,c=i.length||a.tableCols||3,d=e.width/c,u=32,f=28;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",r.border).attr("rx",4),t.append("rect").attr("width",e.width).attr("height",u).attr("fill",o?"none":vt(r.textMuted,r.bg,8)).attr("rx",4);for(let p=0;p<c;p++){let h=i[p]||`Col ${p+1}`;t.append("text").attr("x",p*d+10).attr("y",u/2+4).attr("fill",r.text).attr("font-size",12).attr("font-weight","600").text(h)}t.append("line").attr("x1",0).attr("y1",u).attr("x2",e.width).attr("y2",u).attr("stroke",r.border);let m=l?a.tableRows||3:s.length;for(let p=0;p<m;p++){let h=u+p*f;p>0&&t.append("line").attr("x1",0).attr("y1",h).attr("x2",e.width).attr("y2",h).attr("stroke",r.border).attr("opacity",.3);for(let g=0;g<c;g++)if(l)t.append("rect").attr("x",g*d+10).attr("y",h+8).attr("width",d*.6).attr("height",12).attr("fill",r.textMuted).attr("opacity",.25).attr("rx",2);else if(s[p]){let x=s[p][g]||"";Zut(t,x,g*d+10,h,d-20,f,n)}}}function Zut(t,e,n,r,o,a,i){let{palette:s}=i,l=e.trim(),c=l.match(/^\(([^)]+)\)(?:\s*\|\s*(.+))?$/);if(c){let d=c[1],u=c[2]?.trim().toLowerCase(),f=u==="ghost",p=u==="destructive"?s.destructive:s.primary,h=Math.min(Tt(d,10,{bold:!0})+16,o),g=20,x=r+(a-g)/2;f?(t.append("rect").attr("x",n).attr("y",x).attr("width",h).attr("height",g).attr("fill","none").attr("stroke",p).attr("stroke-width",1).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",x+g/2+3).attr("fill",p).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d)):(t.append("rect").attr("x",n).attr("y",x).attr("width",h).attr("height",g).attr("fill",p).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",x+g/2+3).attr("fill",s.bg).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d));return}if(/^<\s*x?\s*>$/.test(l)){let d=/x/i.test(l),u=12,f=n,m=r+(a-u)/2;t.append("rect").attr("x",f).attr("y",m).attr("width",u).attr("height",u).attr("fill",d?s.primary:"none").attr("stroke",d?s.primary:s.border).attr("rx",2),d&&t.append("path").attr("d",`M${f+2},${m+u/2} L${f+4},${m+u/2+2} L${f+10},${m+2}`).attr("fill","none").attr("stroke",s.bg).attr("stroke-width",1.5);return}t.append("text").attr("x",n).attr("y",r+a/2+4).attr("fill",s.text).attr("font-size",12).text(l)}function Qut(t,e,n){let{palette:r,isTransparent:o}=n;if(e.element.imageHint==="round"){let s=Math.min(e.width,e.height)/2,l=e.width/2,c=e.height/2;t.append("circle").attr("cx",l).attr("cy",c).attr("r",s).attr("fill",o?"none":vt(r.border,r.bg,30)).attr("stroke",r.border),t.append("line").attr("x1",l-s*.7).attr("y1",c-s*.7).attr("x2",l+s*.7).attr("y2",c+s*.7).attr("stroke",r.border),t.append("line").attr("x1",l+s*.7).attr("y1",c-s*.7).attr("x2",l-s*.7).attr("y2",c+s*.7).attr("stroke",r.border)}else t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":vt(r.border,r.bg,30)).attr("stroke",r.border).attr("rx",4),t.append("line").attr("x1",0).attr("y1",0).attr("x2",e.width).attr("y2",e.height).attr("stroke",r.border),t.append("line").attr("x1",e.width).attr("y1",0).attr("x2",0).attr("y2",e.height).attr("stroke",r.border)}function Jut(t,e,n){for(let r of e.children)UO(t,r,n)}function UO(t,e,n){let{palette:r,isTransparent:o}=n,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`);o?a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.1).attr("rx",4):a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.2).attr("rx",4)}function tft(t,e,n){let{palette:r,isDark:o,isTransparent:a}=n,i=e.element,s=VO(i,r)||r.accent,l=a?null:ee(r,s,o,{mode:n.fillMode});l&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",l).attr("rx",4),t.append("rect").attr("width",3).attr("height",e.height).attr("fill",s).attr("rx",1.5),a&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",s).attr("rx",4);let c=l?pe(l,r.textOnFillLight,r.textOnFillDark):r.text;t.append("text").attr("x",12).attr("y",e.height/2+4).attr("fill",c).attr("font-size",13).text(i.label)}function eft(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.progressValue??0,s=8,l=e.height/2;t.append("rect").attr("width",e.width-40).attr("height",s).attr("y",l-s/2).attr("fill",o?"none":vt(r.border,r.bg,30)).attr("stroke",o?r.border:"none").attr("rx",s/2);let c=(e.width-40)*i/100;c>0&&t.append("rect").attr("width",c).attr("height",s).attr("y",l-s/2).attr("fill",r.primary).attr("rx",s/2),t.append("text").attr("x",e.width-32).attr("y",l+4).attr("fill",r.textMuted).attr("font-size",11).text(`${i}%`)}function nft(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.chartHint||"line";t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":vt(r.textMuted,r.bg,8)).attr("stroke",r.border).attr("rx",4);let s=20,l=20,c=e.width-s*2,d=e.height-l*2;if(i==="line"){let f=[[0,d*.7],[c*.2,d*.4],[c*.4,d*.6],[c*.6,d*.2],[c*.8,d*.3],[c,d*.1]].map(([m,p],h)=>h===0?`M${s+m},${l+p}`:`L${s+m},${l+p}`).join(" ");t.append("path").attr("d",f).attr("fill","none").attr("stroke",r.primary).attr("stroke-width",2)}else if(i==="bar"){let f=c/10,m=[.6,.8,.5,.9,.7];for(let p=0;p<5;p++){let h=d*m[p];t.append("rect").attr("x",s+p*(c/5)+f/2).attr("y",l+d-h).attr("width",f).attr("height",h).attr("fill",r.primary).attr("opacity",.7).attr("rx",2)}}else if(i==="pie"){let u=e.width/2,f=e.height/2,m=Math.min(c,d)/2,p=[.35,.25,.2,.2],h=[r.primary,r.secondary,r.accent,r.border],g=0;for(let x=0;x<p.length;x++){let y=g+p[x]*Math.PI*2,b=u+m*Math.cos(g),w=f+m*Math.sin(g),k=u+m*Math.cos(y),C=f+m*Math.sin(y),v=p[x]>.5?1:0;t.append("path").attr("d",`M${u},${f} L${b},${w} A${m},${m} 0 ${v},1 ${k},${C} Z`).attr("fill",h[x]).attr("opacity",.7),g=y}}}function rft(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",a.lineNumber);o||i.append("rect").attr("x",4).attr("y",4).attr("width",e.width).attr("height",e.height).attr("fill","rgba(0,0,0,0.1)").attr("rx",am),i.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.surface).attr("stroke",r.border).attr("rx",am),i.append("rect").attr("width",e.width).attr("height",36).attr("fill",o?"none":vt(r.textMuted,r.bg,15)).attr("rx",am),i.append("text").attr("x",12).attr("y",24).attr("fill",r.text).attr("font-size",14).attr("font-weight","600").text(a.label||"Modal");let s=e.width-16;i.append("text").attr("x",s).attr("y",24).attr("fill",r.textMuted).attr("font-size",16).text("\xD7");for(let l of e.children){let c=i.append("g").attr("transform","translate(0, 36)");im(c,l,n,1)}}var YO,WO,am,Out,jO=dt(()=>{"use strict";Nn();Ae();Ke();Fe();Ve();wr();YO=4,WO=6,am=8,Out={destructive:t=>t.destructive,success:t=>t.colors.green,warning:t=>t.colors.yellow,info:t=>t.colors.blue}});var a$={};ue(a$,{collectCardMetadata:()=>E2,computeC4NodeDimensions:()=>zc,layoutC4Components:()=>t8,layoutC4Containers:()=>J7,layoutC4Context:()=>Q7,layoutC4Deployment:()=>e8,rollUpContextRelationships:()=>r$});function e$(t){for(let e of t.nodes()){let n=is(t,e);n&&([n.x,n.y]=[n.y,n.x],[n.width,n.height]=[n.height,n.width])}}function w2(t,e,n,r){if(e==="LR"){e$(t),n$(t,n,r),e$(t);return}n$(t,n,r)}function x2(t,e,n,r){let o=0;for(let a of t){let i=e.get(a.source),s=e.get(a.target);if(i==null||s==null)continue;let l=Math.abs(i-s),c=Math.min(n.get(a.source)??1,n.get(a.target)??1);o+=l*c}if(r)for(let a of t){let i=r.get(a.source),s=r.get(a.target);if(!i||!s)continue;let l=e.get(a.source)??0,c=e.get(a.target)??0,d=i.y,u=s.y;if(d===u)continue;let f=Math.min(l,c),m=Math.max(l,c),p=Math.min(d,u),h=Math.max(d,u);for(let[g,x]of r){if(g===a.source||g===a.target)continue;let y=e.get(g)??0,b=x.y,w=x.width/2,k=x.height/2;y+w>f&&y-w<m&&b+k>p&&b-k<h&&(o+=dft)}}return o}function n$(t,e,n){if(e.length<2)return;let r=new Map;for(let s of e)r.set(s.source,(r.get(s.source)??0)+1),r.set(s.target,(r.get(s.target)??0)+1);let o=new Map;for(let s of t.nodes()){let l=is(t,s);l&&o.set(s,{y:l.y,width:l.width,height:l.height})}let a=new Map;for(let s of t.nodes()){let l=is(t,s);if(!l)continue;let c=Math.round(l.y);a.has(c)||a.set(c,[]),a.get(c).push(s)}for(let[,s]of a)s.sort((l,c)=>is(t,l).x-is(t,c).x);let i=!1;for(let[,s]of a){if(s.length<2)continue;let l=[];if(n&&n.size>0){let c=new Map,d=[];for(let u of s){let f=n.get(u);f?(c.has(f)||c.set(f,[]),c.get(f).push(u)):d.push(u)}for(let u of c.values())u.length>=2&&l.push(u);d.length>=2&&l.push(d)}else l.push(s);for(let c of l){if(c.length<2)continue;let d=c.map(h=>is(t,h).x).sort((h,g)=>h-g),u=new Map;for(let h of t.nodes()){let g=is(t,h);g&&u.set(h,g.x)}let f=x2(e,u,r,o),m=[...c],p=f;if(c.length<=8){let h=uft(c);for(let g of h){let x=new Map(u);for(let b=0;b<g.length;b++)x.set(g[b],d[b]);let y=x2(e,x,r,o);y<p&&(p=y,m=[...g])}}else{let h=[...c],g=!0,x=0;for(;g&&x<10;){g=!1,x++;for(let y=0;y<h.length-1;y++){let b=new Map(u);for(let v=0;v<h.length;v++)b.set(h[v],d[v]);let w=x2(e,b,r,o);[h[y],h[y+1]]=[h[y+1],h[y]];let k=new Map(u);for(let v=0;v<h.length;v++)k.set(h[v],d[v]);let C=x2(e,k,r,o);C<w?(g=!0,C<p&&(p=C,m=[...h])):[h[y],h[y+1]]=[h[y+1],h[y]]}}}if(m.some((h,g)=>h!==c[g])){for(let h=0;h<m.length;h++){is(t,m[h]).x=d[h];let g=s.indexOf(c[h]);g>=0&&(s[g]=m[h])}i=!0}}}if(i)for(let s of e){let l=oft(t,s.source,s.target);if(!l)continue;let c=is(t,s.source),d=is(t,s.target);if(!c||!d)continue;let u={x:c.x,y:c.y+c.height/2},f={x:d.x,y:d.y-d.height/2},m=(u.y+f.y)/2;l.points=[u,{x:u.x,y:m},{x:f.x,y:m},f]}}function uft(t){let e=[],n=[...t],r=n.length,o=new Array(r).fill(0);e.push([...n]);let a=0;for(;a<r;)o[a]<a?(a%2===0?[n[0],n[a]]=[n[a],n[0]]:[n[o[a]],n[a]]=[n[a],n[o[a]]],e.push([...n]),o[a]++,a=0):(o[a]=0,a++);return e}function K7(t){let e=new Map;function n(r,o){e.set(r.name,o);for(let a of r.children)n(a,o);for(let a of r.groups)for(let i of a.children)n(i,o)}for(let r of t)n(r,r.name);return e}function Z7(t,e){let n=[];function r(o){for(let a of o.relationships)n.push({sourceName:o.name,rel:a});for(let a of o.children)r(a);for(let a of o.groups)for(let i of a.children)r(i)}for(let o of t)r(o);return n}function r$(t){let e=K7(t.elements),n=Z7(t.elements,e),r=new Set(t.elements.map(c=>c.name)),o=new Set,a=[],i=[];for(let{sourceName:c,rel:d}of n){let u=e.get(c)??c,f=e.get(d.target)??d.target;if(u===f)continue;let m={sourceName:u,targetName:f,...d.label!==void 0&&{label:d.label},...d.technology!==void 0&&{technology:d.technology},arrowType:d.arrowType,lineNumber:d.lineNumber};if(r.has(c)&&c===u){let p=`${u}\u2192${f}`;o.add(p),a.push(m)}else i.push(m)}let s=[...a],l=new Set(o);for(let c of i){let d=`${c.sourceName}\u2192${c.targetName}`;l.has(d)||(l.add(d),s.push(c))}return s}function Du(t,e,n,r){let o=t.metadata.color;if(o)return o;if(!n)return;let a=e.find(c=>c.name.toLowerCase()===n.toLowerCase());if(!a)return;let i=Bt(a.name),s=t.metadata[i];if(!s&&r){for(let c of r)if(s=c.metadata[i],s)break}let l=s??a.defaultValue;return l?a.entries.find(c=>c.value.toLowerCase()===l.toLowerCase())?.color??"#999999":"#999999"}function E2(t){let e=[],n=t.tech??t.technology;n&&e.push({key:"Technology",value:n});for(let[r,o]of Object.entries(t)){if(fft.has(r.toLowerCase()))continue;let a=r.charAt(0).toUpperCase()+r.slice(1);e.push({key:a,value:o})}return e}function zc(t,e){let n=Tt(t.name,sft)+b2*2,r=Math.max(aft,Math.min(KO,n));if(e?.showTechnology){let i=y2+QO,s=t.description?.join(`
|
|
291
291
|
`);if(s){let c=r-b2*2,d=hn(s,t$,c);i+=d.length*JO}let l=E2(t.metadata);if(l.length>0){i+=ZO,i+=l.length*lft;let c=Math.max(...l.map(d=>Tt(`${d.key}: ${d.value}`,cft)+b2*2));c>r&&(r=Math.min(KO,c))}return i+=y2,{width:r,height:i}}let o=y2+ift+ZO+QO,a=t.description?.join(`
|
|
292
292
|
`);if(a){let i=r-b2*2,s=hn(a,t$,i);o+=s.length*JO}return o+=y2,{width:r,height:o}}function k2(t){let e=[];for(let n of t){let r=[];for(let i of n.entries)r.push({value:i.value,color:i.color});if(r.length===0)continue;let o=We(n.name,Er)+xo*2,a=qn;for(let i of r)a+=Tr*2+Ir+We(i.value,Qn)+Qr;a+=qn,e.push({name:n.name,entries:r,x:0,y:0,width:o+a,height:Se})}return e}function S2(t){let e=new Map;for(let i of t)(i.label||i.technology)&&e.set(i.sourceName,(e.get(i.sourceName)??0)+1);let n=Math.max(0,...e.values()),r=Math.max(80,60+n*20),o=Math.max(140,100+n*35),a=Math.max(30,20+n*8);return{nodesep:r,ranksep:o,edgesep:a}}function Q7(t,e){let n=t.elements.filter(y=>y.type==="person"||y.type==="system");if(n.length===0)return{nodes:[],edges:[],legend:[],groupBoundaries:[],width:0,height:0};let r=r$(t),o=S2(r),a=t.direction,i=new dr.graphlib.Graph;i.setGraph({rankdir:a,nodesep:o.nodesep,ranksep:o.ranksep,edgesep:o.edgesep}),i.setDefaultEdgeLabel(()=>({}));let s=new Map;for(let y of n){s.set(y.name,y);let b=zc(y);i.setNode(y.name,{width:b.width,height:b.height})}let l=[];for(let y of r)s.has(y.sourceName)&&s.has(y.targetName)&&(l.push(y),i.setEdge(y.sourceName,y.targetName,{label:y.label??""}));dr.layout(i),w2(i,a,l.map(y=>({source:y.sourceName,target:y.targetName})));let c=n.map(y=>{let b=i.node(y.name),w=Du(y,t.tagGroups,e??null),k=y.children.some(_=>_.type==="container")||y.groups.some(_=>_.children.some(R=>R.type==="container")),C=y.description?.join(`
|
|
@@ -887,7 +887,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
887
887
|
`)}var AV=Z5t+`
|
|
888
888
|
`+JE+`
|
|
889
889
|
`+Q5t(JE)+`
|
|
890
|
-
`;d1();var qy="0.
|
|
890
|
+
`;d1();var qy="0.70.0",J5t=200,t6t=1500,e6t="[dgmo]",n6t=/[\x00-\x1F--]/g,tk="dgmoAutoStyles";function r6t(...t){typeof console<"u"&&console.warn&&console.warn(e6t,...t)}function IV(t){t.querySelectorAll("script, foreignObject").forEach(r=>r.remove());let n=[t,...Array.from(t.querySelectorAll("*"))];for(let r of n){for(let o of Array.from(r.attributes))o.name.toLowerCase().startsWith("on")&&r.removeAttribute(o.name);if(r.hasAttribute("href")&&Yi(r.getAttribute("href"))===null&&r.removeAttribute("href"),r.hasAttributeNS("http://www.w3.org/1999/xlink","href")){let o=r.getAttributeNS("http://www.w3.org/1999/xlink","href");Yi(o)===null&&r.removeAttributeNS("http://www.w3.org/1999/xlink","href")}}}function ek(t){if(t==="light"||t==="dark"||t==="transparent")return t;if(typeof document>"u")return"light";let e=document.documentElement,n=e.getAttribute("data-theme");return n==="dark"?"dark":n==="light"?"light":e.classList.contains("dark")?"dark":e.classList.contains("light")?"light":typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function nk(){if(typeof document>"u")return;let t=document.documentElement;if(t?.dataset?.[tk]==="1")return;if(document.querySelector('link[rel="stylesheet"][href*="auto.css"]')){t&&t.dataset&&(t.dataset[tk]="1");return}let n=document.createElement("style");n.setAttribute("data-dgmo-auto",""),n.textContent=AV,document.head.appendChild(n),t&&t.dataset&&(t.dataset[tk]="1")}function PV(t){let e=t.split(`
|
|
891
891
|
`).map(n=>n.trim()).find(n=>n.length>0);return e?e.replace(n6t,"").slice(0,J5t):"DGMO diagram"}function DV(t){let e=t.showSource||t.showCopy||t.showExpand||t.showEditorLink,n=TV(t.source,'<div class="dgmo-svg"></div>',{mode:e?"showcase":"diagram",showSource:t.showSource,showCopy:t.showCopy,showExpand:t.showExpand,showOpenInEditor:t.showEditorLink,legacyClassNames:["dgmo-rendered",t.themeClass]}),r=document.createElement("div");r.innerHTML=n;let o=r.firstElementChild;o.querySelector(".dgmo-svg")?.appendChild(t.svgEl);let a=o.querySelector("a.dgmo-open");return a&&(t.shareUrl?a.href=t.shareUrl:a.remove()),o6t(o),o}function o6t(t){t.addEventListener("click",n=>{a6t(n)});let e=()=>{t.querySelectorAll("details.dgmo-source-wrap[open]").forEach(n=>{n.open=!1})};t.addEventListener("mouseleave",()=>{t.contains(document.activeElement)||e()}),t.addEventListener("focusout",n=>{let r=n.relatedTarget;r&&t.contains(r)||t.matches(":hover")||e()})}async function a6t(t){let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest(".dgmo-toolbar-btn");if(!n)return;let r=!!n.closest("summary");if(r&&t.preventDefault(),n.matches("button.dgmo-expand")){u6t(n);return}if(n.matches("button.dgmo-copy")){await i6t(n.dataset.dgmoSource??"")?(n.classList.add("dgmo-copy--success"),setTimeout(()=>n.classList.remove("dgmo-copy--success"),t6t)):r6t("clipboard write failed");return}if(r&&n.matches("a.dgmo-open")){let o=n;o.href&&window.open(o.href,o.target||"_blank","noopener,noreferrer")}}async function i6t(t){try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}if(typeof document<"u")try{let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select();let n=document.execCommand("copy");return document.body.removeChild(e),n}catch{return!1}return!1}var RV="http://www.w3.org/1999/xlink",s6t=["clip-path","mask","filter","fill","stroke","marker-start","marker-mid","marker-end"],l6t=0,c6t='<svg width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4 4 8 8"/><path d="m12 4-8 8"/></svg>';function d6t(t,e){let n=new Map;if(t.querySelectorAll("[id]").forEach(o=>{let a=o.getAttribute("id");if(!a)return;let i=e+a;n.set(a,i),o.setAttribute("id",i)}),n.size===0)return;let r=o=>o.replace(/url\(#([^)]+)\)/g,(a,i)=>{let s=n.get(i);return s?`url(#${s})`:a});t.querySelectorAll("*").forEach(o=>{for(let l of s6t){let c=o.getAttribute(l);c&&c.includes("url(#")&&o.setAttribute(l,r(c))}let a=o.getAttribute("style");a&&a.includes("url(#")&&o.setAttribute("style",r(a));let i=o.getAttribute("href");i&&i.startsWith("#")&&n.has(i.slice(1))&&o.setAttribute("href","#"+n.get(i.slice(1)));let s=o.getAttributeNS(RV,"href");s&&s.startsWith("#")&&n.has(s.slice(1))&&o.setAttributeNS(RV,"href","#"+n.get(s.slice(1)))})}function u6t(t){if(typeof document>"u")return;let e=t.closest(".dgmo");if(!e)return;let n=e.querySelectorAll(".dgmo-light, .dgmo-dark, .dgmo-svg"),r=null;for(let c of Array.from(n)){if(window.getComputedStyle(c).display==="none")continue;let d=c.querySelector("svg");if(d){r=d;break}}if(r||(r=e.querySelector("svg")),!r)return;let o=r.cloneNode(!0);d6t(o,`dgmo-lb-${++l6t}-`);let a=document.createElement("dialog");a.className="dgmo-lightbox",a.setAttribute("aria-label","Diagram, full screen");let i=document.createElement("button");i.type="button",i.className="dgmo-lightbox-close",i.setAttribute("aria-label","Close full screen"),i.innerHTML=c6t;let s=document.createElement("div");s.className="dgmo-lightbox-svg",s.appendChild(o),a.appendChild(i),a.appendChild(s),document.body.appendChild(a);let l=()=>{a.open&&a.close()};i.addEventListener("click",l),a.addEventListener("click",c=>{c.target===a&&l()}),a.addEventListener("close",()=>a.remove()),a.showModal()}function OV(t){let e=t.severity&&t.severity!=="error"?`${t.severity}: ${t.message}`:t.message;t.line!==void 0&&t.line>0&&(e+=t.column!==void 0?` (at ${t.line}:${t.column})`:` (at line ${t.line})`);let n=document.createElement("div");n.innerHTML=_V(new Error(e),t.source);let r=n.firstElementChild;return r.setAttribute("data-dgmo-processed","true"),r}function $V(t,e){let n=gy(t,{baseUrl:e.editorBase,palette:e.palette,theme:e.theme});if(!n.url)return null;let r=`utm_source=${encodeURIComponent(e.utmSource)}&utm_medium=html&utm_campaign=${encodeURIComponent(e.campaign)}`,o=n.url.indexOf("#"),a;if(o===-1){let i=n.url.includes("?")?"&":"?";a=n.url+i+r}else{let i=n.url.slice(0,o),s=n.url.slice(o+1),l=i.includes("?")?"&":"?",c=s.length>0?"&":"";a=i+l+r+"#"+s+c+r}return Yi(a)?a:null}var f6t={theme:"auto",palette:"slate",showSource:!0,showCopy:!0,showExpand:!0,showEditorLink:!0},Hy={...f6t},Sp=new Set,GV=256*1024,m6t="[dgmo:auto]";function $o(...t){typeof console<"u"&&console.warn&&console.warn(m6t,...t)}function BV(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function By(t,e,n){let r=t.dataset[e];return r==="true"?!0:r==="false"?!1:(r!==void 0&&$o(`${n}: invalid value`,r,'\u2014 expected "true" or "false"'),null)}function HV(t){try{return Zp().some(e=>e.id===t)}catch{return!1}}function FV(){if(typeof document>"u")return null;let t=document.currentScript;if(t&&t instanceof HTMLScriptElement)return t;let e=document.querySelectorAll('script[src*="auto.js"], script[src*="auto.min.js"]');return e.length===0?null:e[e.length-1]}var p6t=["theme","palette","showSource","showCopy","showExpand","showEditorLink"],WV=["__proto__","constructor","prototype"],h6t=["auto","light","dark","transparent"];function zV(t){return typeof t=="string"&&h6t.includes(t)}function YV(t){if(!t)return{};let e;try{e=JSON.parse(t)}catch(r){return $o("data-config: invalid JSON",r),{}}if(!BV(e))return $o("data-config: not an object"),{};for(let r of WV)if(Object.prototype.hasOwnProperty.call(e,r))return $o("data-config: rejected (prototype-pollution key:",r,")"),{};let n={};for(let[r,o]of Object.entries(e)){if(!p6t.includes(r)){$o("data-config: dropping unknown key",r);continue}if(r==="theme"){if(!zV(o)){$o("data-config: rejected theme",o);continue}n.theme=o}else if(r==="palette"){if(typeof o!="string"||!HV(o)){$o("data-config: rejected palette",o);continue}n.palette=o}else if(r==="showSource"){if(typeof o!="boolean"){$o("data-config: rejected showSource",o);continue}n.showSource=o}else if(r==="showCopy"){if(typeof o!="boolean"){$o("data-config: rejected showCopy",o);continue}n.showCopy=o}else if(r==="showExpand"){if(typeof o!="boolean"){$o("data-config: rejected showExpand",o);continue}n.showExpand=o}else if(r==="showEditorLink"){if(typeof o!="boolean"){$o("data-config: rejected showEditorLink",o);continue}n.showEditorLink=o}}return n}function VV(t=document){let e=t.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])");return Array.from(e).filter(n=>!n.closest(".dgmo-rendered"))}function UV(t){if(t.tagName==="CODE"){let e=t.parentElement;if(e?.tagName==="PRE"){let n=Array.from(e.childNodes).filter(r=>r.nodeType===1||r.nodeType===3&&(r.textContent||"").trim().length>0);if(n.length===1&&n[0]===t)return e}}return t}function kp(t,e,n){let r=OV({...n,source:e});UV(t).replaceWith(r)}async function XV(t){if(!(t instanceof HTMLElement))return{};if(t.dataset.dgmoProcessed==="true")return{};t.dataset.dgmoProcessed="true";let e=t.textContent||"";if(new TextEncoder().encode(e).byteLength>GV)return kp(t,e,{message:`DGMO source too large to render \u2014 ${GV/1024} KB max`,severity:"error"}),$o("source exceeds 256 KB cap"),{};let r=Hy,o=r.theme==="transparent"?"transparent":ek(r.theme),a=o==="transparent"?"transparent":o,i=PV(e),s={showSource:By(t,"showSource","data-show-source"),showCopy:By(t,"showCopy","data-show-copy"),showExpand:By(t,"showExpand","data-show-expand"),showEditorLink:By(t,"showEditorLink","data-show-editor-link")},l=s.showSource??r.showSource,c=s.showCopy??r.showCopy,d=s.showExpand??r.showExpand,u=s.showEditorLink??r.showEditorLink,f;try{f=await JY(e,{theme:a,palette:r.palette})}catch(w){let k=w instanceof Error?w.message:"Render failed unexpectedly";return kp(t,e,{message:k,severity:"error"}),$o("render() rejected:",w),{}}if(f.diagnostics&&f.diagnostics.length>0){let w=f.diagnostics[0];return kp(t,e,{message:w.message,severity:w.severity,line:w.line,...w.column!==void 0&&{column:w.column}}),$o("diagnostic:",w.message,w.line,w.column),{}}if(!f.svg)return kp(t,e,{message:"Empty SVG returned from renderer",severity:"error"}),{};let m=o==="dark"?"dgmo-theme-dark":o==="transparent"?"dgmo-theme-transparent":"dgmo-theme-light",p=document.createElement("div");p.innerHTML=f.svg;let h=p.querySelector("svg");if(!h)return kp(t,e,{message:"Empty SVG returned from renderer",severity:"error"}),{};IV(h),h.setAttribute("role","img"),h.setAttribute("aria-label",i);let g=null;u&&(g=$V(e,{palette:r.palette,theme:o==="dark"?"dark":"light",editorBase:Gy,campaign:qy,utmSource:"auto-embed"}));let x=DV({source:e,svgEl:h,themeClass:m,showSource:l,showCopy:c,showExpand:d,showEditorLink:u,shareUrl:g});x.dataset.dgmoProcessed="true";let y={wrapper:x,source:e,overrides:s};return Sp.add(y),UV(t).replaceWith(x),oV(x),sV(x),{wrapper:x}}function ok(t={}){if(!BV(t))return;for(let n of WV)if(Object.prototype.hasOwnProperty.call(t,n)){$o("initialize: rejected (prototype-pollution key:",n,")");return}let e={...Hy};zV(t.theme)&&(e.theme=t.theme),typeof t.palette=="string"&&HV(t.palette)&&(e.palette=t.palette),typeof t.showSource=="boolean"&&(e.showSource=t.showSource),typeof t.showEditorLink=="boolean"&&(e.showEditorLink=t.showEditorLink),Hy=e}async function ak(t={}){nk();for(let n of Array.from(Sp))document.contains(n.wrapper)||Sp.delete(n);let e;if(t.nodes){e=("length"in t.nodes&&typeof t.nodes!="string"?Array.from(t.nodes):[]).filter(o=>o instanceof Element&&(o.matches(".dgmo, .language-dgmo")||o.querySelector(".dgmo, .language-dgmo")!==null));let r=[];for(let o of e)o.matches(".dgmo, .language-dgmo")&&r.push(o),o.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])").forEach(i=>r.push(i));e=Array.from(new Set(r)).filter(o=>!o.closest(".dgmo-rendered"))}else e=VV();await Promise.all(e.map(n=>XV(n).catch(()=>({}))))}function g6t(){if(Hy.theme==="auto")for(let t of Array.from(Sp)){let e=document.createElement("pre");e.className="dgmo",e.textContent=t.source,t.overrides.showSource!==null&&(e.dataset.showSource=String(t.overrides.showSource)),t.overrides.showCopy!==null&&(e.dataset.showCopy=String(t.overrides.showCopy)),t.overrides.showExpand!==null&&(e.dataset.showExpand=String(t.overrides.showExpand)),t.overrides.showEditorLink!==null&&(e.dataset.showEditorLink=String(t.overrides.showEditorLink)),t.wrapper.replaceWith(e),Sp.delete(t),XV(e)}}function y6t(){if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>g6t();t.addEventListener?t.addEventListener("change",e):"addListener"in t&&typeof t.addListener=="function"&&t.addListener(e)}function rk(){if(typeof document>"u")return;document.querySelectorAll(".dgmo:not(.dgmo-rendered), .language-dgmo").forEach(e=>{e.closest(".dgmo-rendered")||(e.style.visibility="visible")}),document.documentElement&&document.documentElement.dataset&&(document.documentElement.dataset.dgmoAutoFailed="1")}function b6t(){try{nk();let t=FV(),e=t?.getAttribute("data-auto"),n=t?.getAttribute("data-config");if(n){let o=YV(n);ok(o)}if(y6t(),typeof window<"u"&&window.setTimeout(()=>{document.querySelectorAll(".dgmo:not(.dgmo-rendered):not([data-dgmo-processed])").length>0&&($o("safety timeout: un-hiding unrendered sources"),rk())},3e4),e==="false")return;let r=()=>{ak().catch(o=>{$o("run() crashed:",o),rk()})};typeof document<"u"&&document.readyState!=="loading"?r():typeof document<"u"&&document.addEventListener("DOMContentLoaded",r,{once:!0})}catch(t){$o("bootstrap failed:",t),rk()}}var jV=Object.freeze({initialize:ok,run:ak,version:qy});function qV(t,e){try{Object.defineProperty(t,e,{value:jV,writable:!1,configurable:!1,enumerable:!0})}catch{}}typeof window<"u"&&(qV(window,"dgmo"),qV(window,"diagrammo"),b6t());var x6t=jV;return uk(w6t);})();
|
|
892
892
|
/*! Bundled license information:
|
|
893
893
|
|